當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CommonDBRelation類代碼示例

本文整理匯總了PHP中CommonDBRelation的典型用法代碼示例。如果您正苦於以下問題:PHP CommonDBRelation類的具體用法?PHP CommonDBRelation怎麽用?PHP CommonDBRelation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了CommonDBRelation類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getRelationMassiveActionsSpecificities

 /**
  * @since version 0.85
  *
  * @see CommonDBRelation::getRelationMassiveActionsSpecificities()
  **/
 static function getRelationMassiveActionsSpecificities()
 {
     global $CFG_GLPI;
     $specificities = parent::getRelationMassiveActionsSpecificities();
     $specificities['dropdown_method_2'] = 'dropdownUnder';
     $specificities['can_remove_all_at_once'] = false;
     return $specificities;
 }
開發者ID:Ixertec,項目名稱:glpi,代碼行數:13,代碼來源:profile_user.class.php

示例2: getRelationMassiveActionsSpecificities

 /**
  * @since version 0.85
  *
  * @see CommonDBRelation::getRelationMassiveActionsSpecificities()
  **/
 static function getRelationMassiveActionsSpecificities()
 {
     global $CFG_GLPI;
     $specificities = parent::getRelationMassiveActionsSpecificities();
     // Set the labels for add_item and remove_item
     $specificities['button_labels']['add'] = _sx('button', 'Associate');
     $specificities['button_labels']['remove'] = _sx('button', 'Dissociate');
     return $specificities;
 }
開發者ID:jose-martins,項目名稱:glpi,代碼行數:14,代碼來源:networkport_vlan.class.php

示例3: getRelationMassiveActionsSpecificities

 /**
  * @since version 0.85
  *
  * @see CommonDBRelation::getRelationMassiveActionsSpecificities()
  **/
 static function getRelationMassiveActionsSpecificities()
 {
     global $CFG_GLPI;
     $specificities = parent::getRelationMassiveActionsSpecificities();
     $specificities['select_items_options_1'] = array('right' => 'all');
     $specificities['select_items_options_2'] = array('condition' => '`is_usergroup`');
     // Define normalized action for add_item and remove_item
     $specificities['normalized']['add'][] = 'add_supervisor';
     $specificities['normalized']['add'][] = 'add_delegatee';
     $specificities['button_labels']['add_supervisor'] = $specificities['button_labels']['add'];
     $specificities['button_labels']['add_delegatee'] = $specificities['button_labels']['add'];
     $specificities['update_if_different'] = true;
     return $specificities;
 }
開發者ID:paisdelconocimiento,項目名稱:glpi-smartcities,代碼行數:19,代碼來源:group_user.class.php

示例4: getRelationMassiveActionsSpecificities

 /**
  * @since version 0.85
  *
  * @see CommonDBRelation::getRelationMassiveActionsSpecificities()
  **/
 static function getRelationMassiveActionsSpecificities()
 {
     global $CFG_GLPI;
     $specificities = parent::getRelationMassiveActionsSpecificities();
     $specificities['itemtypes'] = Document::getItemtypesThatCanHave();
     // Define normalized action for add_item and remove_item
     $specificities['normalized']['add'][] = 'add_item';
     $specificities['normalized']['remove'][] = 'remove_item';
     // Set the labels for add_item and remove_item
     $specificities['button_labels']['add_item'] = $specificities['button_labels']['add'];
     $specificities['button_labels']['remove_item'] = $specificities['button_labels']['remove'];
     return $specificities;
 }
開發者ID:pvasener,項目名稱:glpi,代碼行數:18,代碼來源:document_item.class.php

示例5: getRelationMassiveActionsSpecificities

 /**
  * @since version 0.85
  *
  * @see CommonDBRelation::getRelationMassiveActionsSpecificities()
  **/
 static function getRelationMassiveActionsSpecificities()
 {
     global $CFG_GLPI;
     $specificities = parent::getRelationMassiveActionsSpecificities();
     $specificities['itemtypes'] = $CFG_GLPI['contract_types'];
     return $specificities;
 }
開發者ID:GeorgeAlexandre,項目名稱:glpi,代碼行數:12,代碼來源:contract_item.class.php

示例6: Ticket

 function post_addItem()
 {
     if ($this->fields['itemtype'] == 'Ticket') {
         $ticket = new Ticket();
         $ticket->update(array('id' => $this->fields['items_id'], 'date_mod' => $_SESSION["glpi_currenttime"], '_forcenotif' => true, '_donotadddocs' => true));
     }
     parent::post_addItem();
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:8,代碼來源:document_item.class.php

示例7: prepareInputForAdd

 /**
  * @see CommonDBTM::prepareInputForAdd()
  **/
 function prepareInputForAdd($input)
 {
     // Avoid duplicate entry
     if (countElementsInTable($this->getTable(), ['projects_id' => $input['projects_id'], 'itemtype' => $input['itemtype'], 'items_id' => $input['items_id']]) > 0) {
         return false;
     }
     return parent::prepareInputForAdd($input);
 }
開發者ID:glpi-project,項目名稱:glpi,代碼行數:11,代碼來源:item_project.class.php

示例8: doSpecificMassiveActions

 /**
  * @see CommonDBTM::doSpecificMassiveActions()
  **/
 function doSpecificMassiveActions($input = array())
 {
     $res = array('ok' => 0, 'ko' => 0, 'noright' => 0);
     switch ($input['action']) {
         default:
             return parent::doSpecificMassiveActions($input);
     }
     return $res;
 }
開發者ID:korial29,項目名稱:tag,代碼行數:12,代碼來源:tagitem.class.php

示例9: prepareInputForAdd

 function prepareInputForAdd($input)
 {
     // TODO: check if the entities should not be inherited from the profile or the user
     if (!isset($input['entities_id']) || $input['entities_id'] < 0) {
         Session::addMessageAfterRedirect(__('No selected element or badly defined operation'), false, ERROR);
         return false;
     }
     return parent::prepareInputForAdd($input);
 }
開發者ID:gaforeror,項目名稱:glpi,代碼行數:9,代碼來源:profile_user.class.php

示例10: prepareInputForAdd

 /**
  * @see CommonDBTM::prepareInputForAdd()
  **/
 function prepareInputForAdd($input)
 {
     // Avoid duplicate entry
     $restrict = " `problems_id` = '" . $input['problems_id'] . "'\n                   AND `itemtype` = '" . $input['itemtype'] . "'\n                   AND `items_id` = '" . $input['items_id'] . "'";
     if (countElementsInTable($this->getTable(), $restrict) > 0) {
         return false;
     }
     return parent::prepareInputForAdd($input);
 }
開發者ID:JULIO8,項目名稱:respaldo_glpi,代碼行數:12,代碼來源:item_problem.class.php

示例11: Ticket

 function post_addItem()
 {
     $t = new Ticket();
     $no_stat_computation = true;
     if ($this->input['type'] == Ticket::ASSIGN) {
         $no_stat_computation = false;
     }
     $t->updateDateMod($this->fields['tickets_id'], $no_stat_computation);
     parent::post_addItem();
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:10,代碼來源:group_ticket.class.php

示例12: prepareInputForAdd

 function prepareInputForAdd($input)
 {
     // Well, if I remember my PHP: empty(0) == true ...
     if (empty($input['changes_id']) || $input['changes_id'] == 0) {
         return false;
     }
     // Avoid duplicate entry
     if (countElementsInTable($this->getTable(), ['changes_id' => $input['changes_id'], 'itemtype' => $input['itemtype'], 'items_id' => $input['items_id']]) > 0) {
         return false;
     }
     return parent::prepareInputForAdd($input);
 }
開發者ID:glpi-project,項目名稱:glpi,代碼行數:12,代碼來源:change_item.class.php

示例13: prepareInputForAdd

 function prepareInputForAdd($input)
 {
     // Well, if I remember my PHP: empty(0) == true ...
     if (empty($input['changes_id']) || $input['changes_id'] == 0) {
         return false;
     }
     // Avoid duplicate entry
     $restrict = "`changes_id` = '" . $input['changes_id'] . "'\n                   AND `itemtype` = '" . $input['itemtype'] . "'\n                   AND `items_id` = '" . $input['items_id'] . "'";
     if (countElementsInTable($this->getTable(), $restrict) > 0) {
         return false;
     }
     return parent::prepareInputForAdd($input);
 }
開發者ID:stweil,項目名稱:glpi,代碼行數:13,代碼來源:change_item.class.php

示例14: can

 /**
  * Check right on an contract - overloaded to check max_links_allowed
  *
  * @param $ID ID of the item (-1 if new item)
  * @param $right Right to check : r / w / recursive
  * @param $input array of input data (used for adding item)
  *
  * @return boolean
  **/
 function can($ID, $right, &$input = NULL)
 {
     if ($ID < 0) {
         // Ajout
         $contract = new Contract();
         if (!$contract->getFromDB($input['contracts_id'])) {
             return false;
         }
         if ($contract->fields['max_links_allowed'] > 0 && countElementsInTable($this->getTable(), "`contracts_id`='" . $input['contracts_id'] . "'") >= $contract->fields['max_links_allowed']) {
             return false;
         }
     }
     return parent::can($ID, $right, $input);
 }
開發者ID:ryukansent,項目名稱:Thesis-SideB,代碼行數:23,代碼來源:contract_item.class.php

示例15: can

 /**
  * Check right on an item - overloaded to check is_global
  *
  * @param $ID     ID of the item (-1 if new item)
  * @param $right  Right to check : r / w / recursive
  * @param $input  array of input data (used for adding item) (default NULL)
  *
  * @return boolean
  **/
 function can($ID, $right, array &$input = NULL)
 {
     if ($ID < 0) {
         // Ajout
         if (!($item = new $input['itemtype']())) {
             return false;
         }
         if (!$item->getFromDB($input['items_id'])) {
             return false;
         }
         if ($item->getField('is_global') == 0 && self::countForItem($ID) > 0) {
             return false;
         }
     }
     return parent::can($ID, $right, $input);
 }
開發者ID:picaro04,項目名稱:simcard,代碼行數:25,代碼來源:simcard_item.class.php


注:本文中的CommonDBRelation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。