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