コード例 #1
0
 /**
  * @return integer[]
  */
 function getItemsKeys()
 {
     static $cache = array();
     if (isset($cache[$this->_guid])) {
         return $cache[$this->_guid];
     }
     $item = new CExListItem();
     $where = array($this->getBackRefField() => "= '{$this->_id}'");
     // TODO ne pas ordonner par nom dans certains cas
     // Natural sort, sort of ...
     $orderby = self::$_order_list_items ? "LPAD(code, 20, '0'), name" : null;
     return $cache[$this->_guid] = $item->loadIds($where, $orderby);
 }
コード例 #2
0
         if ($msg = $list->store()) {
             CAppUI::setMsg("Ligne {$line_number} : {$msg}", UI_MSG_WARNING);
             continue;
         } else {
             CAppUI::setMsg("{$list->_class}-msg-create", UI_MSG_OK);
         }
     } else {
         if ($msg = $list->store()) {
             CAppUI::setMsg("Ligne {$line_number} : {$msg}", UI_MSG_WARNING);
             continue;
         } else {
             CAppUI::setMsg("{$list->_class}-msg-modify", UI_MSG_OK);
         }
     }
     // LIST ITEM
     $list_item = new CExListItem();
     $ds = $list_item->_spec->ds;
     $where = array("list_id" => $ds->prepare("=%", $list->_id), "name" => $ds->prepare("=%", $line["item_name"]));
     $list_item->loadObject($where);
     if (!$list_item->_id) {
         $list_item->list_id = $list->_id;
         $list_item->name = $line["item_name"];
         $list_item->code = $line["item_code"];
         if ($msg = $list_item->store()) {
             CAppUI::setMsg("Ligne {$line_number} : {$msg}", UI_MSG_WARNING);
             continue;
         } else {
             CAppUI::setMsg("{$list_item->_class}-msg-create", UI_MSG_OK);
         }
     }
 }