OXID eShop CE  4.10.1
 All Classes Namespaces Files Functions Variables Pages
deliveryset_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  // all usergroups
26  $oGroups = oxNew('oxlist');
27  $oGroups->init('oxgroups');
28  $oGroups->selectString("select * from " . getViewName("oxgroups", $this->_iEditLang));
29 
30  $oRoot = new oxgroups();
31  $oRoot->oxgroups__oxid = new oxField("");
32  $oRoot->oxgroups__oxtitle = new oxField("-- ");
33  // rebuild list as we need the "no value" entry at the first position
34  $aNewList = array();
35  $aNewList[] = $oRoot;
36 
37  foreach ($oGroups as $val) {
38  $aNewList[$val->oxgroups__oxid->value] = new oxGroups();
39  $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxid = new oxField($val->oxgroups__oxid->value);
40  $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxtitle = new oxField($val->oxgroups__oxtitle->value);
41  }
42 
43  $oGroups = $aNewList;
44 
45  if (isset($soxId) && $soxId != "-") {
46  $oDelivery = oxNew("oxdeliveryset");
47  $oDelivery->load($soxId);
48 
49  //Disable editing for derived articles
50  if ($oDelivery->isDerived()) {
51  $this->_aViewData['readonly'] = true;
52  }
53  }
54 
55  $this->_aViewData["allgroups2"] = $oGroups;
56 
57  $iAoc = oxRegistry::getConfig()->getRequestParameter("aoc");
58  if ($iAoc == 1) {
59  $oDeliverysetGroupsAjax = oxNew('deliveryset_groups_ajax');
60  $this->_aViewData['oxajax'] = $oDeliverysetGroupsAjax->getColumns();
61 
62  return "popups/deliveryset_groups.tpl";
63  } elseif ($iAoc == 2) {
64  $oDeliverysetUsersAjax = oxNew('deliveryset_users_ajax');
65  $this->_aViewData['oxajax'] = $oDeliverysetUsersAjax->getColumns();
66 
67  return "popups/deliveryset_users.tpl";
68  }
69 
70  return "deliveryset_users.tpl";
71  }
72 }