delivery_users.php

Go to the documentation of this file.
00001 <?php
00002 
00009 class Delivery_Users extends oxAdminDetails
00010 {
00017     public function render()
00018     {
00019         parent::render();
00020 
00021         $soxId = $this->getEditObjectId();
00022         $sSelGroup = oxConfig::getParameter( "selgroup");
00023 
00024         $sViewName = getViewName( "oxgroups", $this->_iEditLang );
00025         // all usergroups
00026         $oGroups = oxNew( "oxlist" );
00027         $oGroups->init( 'oxgroups' );
00028         $oGroups->selectString( "select * from {$sViewName}" );
00029 
00030         $oRoot = new oxGroups();
00031         $oRoot->oxgroups__oxid    = new oxField("");
00032         $oRoot->oxgroups__oxtitle = new oxField("-- ");
00033         // rebuild list as we need the "no value" entry at the first position
00034         $aNewList = array();
00035         $aNewList[] = $oRoot;
00036 
00037         foreach ( $oGroups as $val ) {
00038             $aNewList[$val->oxgroups__oxid->value] = new oxGroups();
00039             $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxid    = new oxField($val->oxgroups__oxid->value);
00040             $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxtitle = new oxField($val->oxgroups__oxtitle->value);
00041         }
00042 
00043         $oGroups = $aNewList;
00044 
00045         if ( isset($soxId) && $soxId != "-") {
00046             $oDelivery = oxNew( "oxdelivery" );
00047             $oDelivery->load( $soxId);
00048 
00049             //Disable editing for derived articles
00050             if ($oDelivery->isDerived())
00051                $this->_aViewData['readonly'] = true;
00052         }
00053 
00054         $this->_aViewData["allgroups2"]  = $oGroups;
00055 
00056         $iAoc = oxConfig::getParameter("aoc");
00057         if ( $iAoc == 1 ) {
00058             $oDeliveryUsersAjax = oxNew( 'delivery_users_ajax' );
00059             $this->_aViewData['oxajax'] = $oDeliveryUsersAjax->getColumns();
00060 
00061             return "popups/delivery_users.tpl";
00062         } elseif ( $iAoc == 2 ) {
00063             $oDeliveryGroupsAjax = oxNew( 'delivery_groups_ajax' );
00064             $this->_aViewData['oxajax'] = $oDeliveryGroupsAjax->getColumns();
00065 
00066             return "popups/delivery_groups.tpl";
00067         }
00068 
00069         return "delivery_users.tpl";
00070     }
00071 }