deliveryset_users.php

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