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