OXID eShop CE  4.9.10
 All Classes Files Functions Variables Pages
delivery_users.php
Go to the documentation of this file.
1 <?php
2 
10 {
11 
18  public function render()
19  {
21 
22  $soxId = $this->getEditObjectId();
23  $sSelGroup = oxRegistry::getConfig()->getRequestParameter("selgroup");
24 
25  $sViewName = getViewName("oxgroups", $this->_iEditLang);
26  // all usergroups
27  $oGroups = oxNew("oxlist");
28  $oGroups->init('oxgroups');
29  $oGroups->selectString("select * from {$sViewName}");
30 
31  $oRoot = new oxGroups();
32  $oRoot->oxgroups__oxid = new oxField("");
33  $oRoot->oxgroups__oxtitle = new oxField("-- ");
34  // rebuild list as we need the "no value" entry at the first position
35  $aNewList = array();
36  $aNewList[] = $oRoot;
37 
38  foreach ($oGroups as $val) {
39  $aNewList[$val->oxgroups__oxid->value] = new oxGroups();
40  $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxid = new oxField($val->oxgroups__oxid->value);
41  $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxtitle = new oxField($val->oxgroups__oxtitle->value);
42  }
43 
44  $oGroups = $aNewList;
45 
46  if (isset($soxId) && $soxId != "-") {
47  $oDelivery = oxNew("oxdelivery");
48  $oDelivery->load($soxId);
49 
50  //Disable editing for derived articles
51  if ($oDelivery->isDerived()) {
52  $this->_aViewData['readonly'] = true;
53  }
54  }
55 
56  $this->_aViewData["allgroups2"] = $oGroups;
57 
58  $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
59  if ($iAoc == 1) {
60  $oDeliveryUsersAjax = oxNew('delivery_users_ajax');
61  $this->_aViewData['oxajax'] = $oDeliveryUsersAjax->getColumns();
62 
63  return "popups/delivery_users.tpl";
64  } elseif ($iAoc == 2) {
65  $oDeliveryGroupsAjax = oxNew('delivery_groups_ajax');
66  $this->_aViewData['oxajax'] = $oDeliveryGroupsAjax->getColumns();
67 
68  return "popups/delivery_groups.tpl";
69  }
70 
71  return "delivery_users.tpl";
72  }
73 }