OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
delivery_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  $sViewName = getViewName( "oxgroups", $this->_iEditLang );
25  // all usergroups
26  $oGroups = oxNew( "oxlist" );
27  $oGroups->init( 'oxgroups' );
28  $oGroups->selectString( "select * from {$sViewName}" );
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( "oxdelivery" );
47  $oDelivery->load( $soxId);
48 
49  //Disable editing for derived articles
50  if ($oDelivery->isDerived())
51  $this->_aViewData['readonly'] = true;
52  }
53 
54  $this->_aViewData["allgroups2"] = $oGroups;
55 
56  $iAoc = oxConfig::getParameter("aoc");
57  if ( $iAoc == 1 ) {
58  $oDeliveryUsersAjax = oxNew( 'delivery_users_ajax' );
59  $this->_aViewData['oxajax'] = $oDeliveryUsersAjax->getColumns();
60 
61  return "popups/delivery_users.tpl";
62  } elseif ( $iAoc == 2 ) {
63  $oDeliveryGroupsAjax = oxNew( 'delivery_groups_ajax' );
64  $this->_aViewData['oxajax'] = $oDeliveryGroupsAjax->getColumns();
65 
66  return "popups/delivery_groups.tpl";
67  }
68 
69  return "delivery_users.tpl";
70  }
71 }