本文整理汇总了PHP中ObjectLock类的典型用法代码示例。如果您正苦于以下问题:PHP ObjectLock类的具体用法?PHP ObjectLock怎么用?PHP ObjectLock使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ObjectLock类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSearchOptions
//.........这里部分代码省略.........
$tab += Location::getSearchOptionsToAdd();
$tab[4]['table'] = 'glpi_networkequipmenttypes';
$tab[4]['field'] = 'name';
$tab[4]['name'] = __('Type');
$tab[4]['datatype'] = 'dropdown';
$tab[40]['table'] = 'glpi_networkequipmentmodels';
$tab[40]['field'] = 'name';
$tab[40]['name'] = __('Model');
$tab[40]['datatype'] = 'dropdown';
$tab[31]['table'] = 'glpi_states';
$tab[31]['field'] = 'completename';
$tab[31]['name'] = __('Status');
$tab[31]['datatype'] = 'dropdown';
$tab[31]['condition'] = "`is_visible_networkequipment`";
$tab[5]['table'] = $this->getTable();
$tab[5]['field'] = 'serial';
$tab[5]['name'] = __('Serial number');
$tab[5]['datatype'] = 'string';
$tab[6]['table'] = $this->getTable();
$tab[6]['field'] = 'otherserial';
$tab[6]['name'] = __('Inventory number');
$tab[6]['datatype'] = 'string';
$tab[7]['table'] = $this->getTable();
$tab[7]['field'] = 'contact';
$tab[7]['name'] = __('Alternate username');
$tab[7]['datatype'] = 'string';
$tab[8]['table'] = $this->getTable();
$tab[8]['field'] = 'contact_num';
$tab[8]['name'] = __('Alternate username number');
$tab[8]['datatype'] = 'string';
$tab[70]['table'] = 'glpi_users';
$tab[70]['field'] = 'name';
$tab[70]['name'] = __('User');
$tab[70]['datatype'] = 'dropdown';
$tab[70]['right'] = 'all';
$tab[71]['table'] = 'glpi_groups';
$tab[71]['field'] = 'completename';
$tab[71]['name'] = __('Group');
$tab[71]['datatype'] = 'dropdown';
$tab[71]['condition'] = '`is_itemgroup`';
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[121]['table'] = $this->getTable();
$tab[121]['field'] = 'date_creation';
$tab[121]['name'] = __('Creation date');
$tab[121]['datatype'] = 'datetime';
$tab[121]['massiveaction'] = false;
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'comment';
$tab[16]['name'] = __('Comments');
$tab[16]['datatype'] = 'text';
$tab[11]['table'] = 'glpi_networkequipmentfirmwares';
$tab[11]['field'] = 'name';
$tab[11]['name'] = _n('Firmware', 'Firmwares', 1);
$tab[11]['datatype'] = 'dropdown';
$tab[14]['table'] = $this->getTable();
$tab[14]['field'] = 'ram';
$tab[14]['name'] = sprintf(__('%1$s (%2$s)'), __('Memory'), __('Mio'));
$tab[14]['datatype'] = 'number';
$tab[32]['table'] = 'glpi_networks';
$tab[32]['field'] = 'name';
$tab[32]['name'] = __('Network');
$tab[32]['datatype'] = 'dropdown';
$tab[33]['table'] = 'glpi_domains';
$tab[33]['field'] = 'name';
$tab[33]['name'] = __('Domain');
$tab[33]['datatype'] = 'dropdown';
$tab[23]['table'] = 'glpi_manufacturers';
$tab[23]['field'] = 'name';
$tab[23]['name'] = __('Manufacturer');
$tab[23]['datatype'] = 'dropdown';
$tab[24]['table'] = 'glpi_users';
$tab[24]['field'] = 'name';
$tab[24]['linkfield'] = 'users_id_tech';
$tab[24]['name'] = __('Technician in charge of the hardware');
$tab[24]['datatype'] = 'dropdown';
$tab[24]['right'] = 'own_ticket';
$tab[49]['table'] = 'glpi_groups';
$tab[49]['field'] = 'completename';
$tab[49]['linkfield'] = 'groups_id_tech';
$tab[49]['name'] = __('Group in charge of the hardware');
$tab[49]['condition'] = '`is_assign`';
$tab[49]['datatype'] = 'dropdown';
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
return $tab;
}
示例2: display
/** Display item with tabs
*
* @since version 0.85
*
* @param $options array
**/
function display($options = array())
{
global $CFG_GLPI;
if (isset($options['id']) && !$this->isNewID($options['id'])) {
if (!$this->getFromDB($options['id'])) {
Html::displayNotFoundError();
}
}
// in case of lefttab layout, we couldn't see "right error" message
if ($this->get_item_to_display_tab) {
if (isset($_GET["id"]) && $_GET["id"] && !$this->can($_GET["id"], READ)) {
// This triggers from a profile switch.
// If we don't have right, redirect instead to central page
if (isset($_SESSION['_redirected_from_profile_selector']) && $_SESSION['_redirected_from_profile_selector']) {
unset($_SESSION['_redirected_from_profile_selector']);
Html::redirect($CFG_GLPI['root_doc'] . "/front/central.php");
}
html::displayRightError();
}
}
// try to lock object
// $options must contains the id of the object, and if locked by manageObjectLock will contains 'locked' => 1
ObjectLock::manageObjectLock(get_class($this), $options);
$this->showNavigationHeader($options);
if (!self::isLayoutExcludedPage() && self::isLayoutWithMain()) {
if (!isset($options['id'])) {
$options['id'] = 0;
}
$this->showPrimaryForm($options);
}
$this->showTabsContent($options);
}
示例3: getSearchOptions
//.........这里部分代码省略.........
$tab[1]['name'] = __('Name');
$tab[1]['datatype'] = 'itemlink';
$tab[1]['massiveaction'] = false;
$tab[1]['forcegroupby'] = true;
$tab[1]['massiveaction'] = false;
$tab[2]['table'] = $this->getTable();
$tab[2]['field'] = 'id';
$tab[2]['name'] = __('ID');
$tab[2]['massiveaction'] = false;
$tab[2]['datatype'] = 'number';
$tab[2]['forcegroupby'] = true;
$tab[2]['massiveaction'] = false;
$tab += Location::getSearchOptionsToAdd();
$tab[3]['table'] = $this->getTable();
$tab[3]['field'] = 'serial';
$tab[3]['name'] = __('Serial number');
$tab[3]['datatype'] = 'string';
$tab[4]['table'] = $this->getTable();
$tab[4]['field'] = 'number';
$tab[4]['name'] = _x('quantity', 'Number');
$tab[4]['datatype'] = 'number';
$tab[4]['max'] = 100;
$tab[4]['toadd'] = array(-1 => __('Unlimited'));
$tab[5]['table'] = 'glpi_softwarelicensetypes';
$tab[5]['field'] = 'name';
$tab[5]['name'] = __('Type');
$tab[5]['datatype'] = 'dropdown';
$tab[6]['table'] = 'glpi_softwareversions';
$tab[6]['field'] = 'name';
$tab[6]['linkfield'] = 'softwareversions_id_buy';
$tab[6]['name'] = __('Purchase version');
$tab[6]['datatype'] = 'dropdown';
$tab[6]['displaywith'] = array('states_id');
$tab[7]['table'] = 'glpi_softwareversions';
$tab[7]['field'] = 'name';
$tab[7]['linkfield'] = 'softwareversions_id_use';
$tab[7]['name'] = __('Version in use');
$tab[7]['datatype'] = 'dropdown';
$tab[7]['displaywith'] = array('states_id');
$tab[8]['table'] = $this->getTable();
$tab[8]['field'] = 'expire';
$tab[8]['name'] = __('Expiration');
$tab[8]['datatype'] = 'date';
$tab[9]['table'] = $this->getTable();
$tab[9]['field'] = 'is_valid';
$tab[9]['name'] = __('Valid');
$tab[9]['datatype'] = 'bool';
$tab[10]['table'] = 'glpi_softwares';
$tab[10]['field'] = 'name';
$tab[10]['name'] = __('Software');
$tab[10]['datatype'] = 'itemlink';
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'comment';
$tab[16]['name'] = __('Comments');
$tab[16]['datatype'] = 'text';
$tab[24]['table'] = 'glpi_users';
$tab[24]['field'] = 'name';
$tab[24]['linkfield'] = 'users_id_tech';
$tab[24]['name'] = __('Technician in charge of the hardware');
$tab[24]['datatype'] = 'dropdown';
$tab[24]['right'] = 'own_ticket';
$tab[31]['table'] = 'glpi_states';
$tab[31]['field'] = 'completename';
$tab[31]['name'] = __('Status');
$tab[31]['datatype'] = 'dropdown';
$tab[31]['condition'] = "`is_visible_softwarelicense`";
$tab[49]['table'] = 'glpi_groups';
$tab[49]['field'] = 'completename';
$tab[49]['linkfield'] = 'groups_id_tech';
$tab[49]['name'] = __('Group in charge of the hardware');
$tab[49]['condition'] = '`is_assign`';
$tab[49]['datatype'] = 'dropdown';
$tab[70]['table'] = 'glpi_users';
$tab[70]['field'] = 'name';
$tab[70]['name'] = __('User');
$tab[70]['datatype'] = 'dropdown';
$tab[70]['right'] = 'all';
$tab[71]['table'] = 'glpi_groups';
$tab[71]['field'] = 'completename';
$tab[71]['name'] = __('Group');
$tab[71]['condition'] = '`is_itemgroup`';
$tab[71]['datatype'] = 'dropdown';
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['datatype'] = 'dropdown';
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
$tab[162]['table'] = $this->getTable();
$tab[162]['field'] = 'otherserial';
$tab[162]['name'] = __('Inventory number');
$tab[162]['massiveaction'] = false;
$tab[162]['datatype'] = 'string';
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
return $tab;
}
示例4: getSearchOptions
function getSearchOptions()
{
$tab = array();
$tab['common'] = __('Characteristics');
$tab[1]['table'] = $this->getTable();
$tab[1]['field'] = 'name';
$tab[1]['name'] = __('Name');
$tab[1]['datatype'] = 'itemlink';
$tab[1]['massiveaction'] = false;
$tab[1]['forcegroupby'] = true;
$tab[2]['table'] = 'glpi_users';
$tab[2]['field'] = 'name';
$tab[2]['name'] = __('Creator');
$tab[2]['datatype'] = 'dropdown';
$tab[2]['massiveaction'] = false;
$tab[2]['right'] = 'all';
$tab[3]['table'] = $this->getTable();
$tab[3]['field'] = 'url';
$tab[3]['name'] = __('URL');
$tab[3]['datatype'] = 'string';
$tab[3]['massiveaction'] = false;
$tab[4]['table'] = $this->getTable();
$tab[4]['field'] = 'is_active';
$tab[4]['name'] = __('Active');
$tab[4]['datatype'] = 'bool';
$tab[4]['massiveaction'] = true;
$tab[6]['table'] = $this->getTable();
$tab[6]['field'] = 'have_error';
$tab[6]['name'] = __('Error');
$tab[6]['datatype'] = 'bool';
$tab[6]['massiveaction'] = true;
$tab[7]['table'] = $this->getTable();
$tab[7]['field'] = 'max_items';
$tab[7]['name'] = __('Number of items displayed');
$tab[7]['datatype'] = 'number';
$tab[7]['min'] = 5;
$tab[7]['max'] = 100;
$tab[7]['step'] = 5;
$tab[7]['toadd'] = array(1);
$tab[7]['massiveaction'] = true;
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'comment';
$tab[16]['name'] = __('Comments');
$tab[16]['datatype'] = 'text';
$tab[5]['table'] = $this->getTable();
$tab[5]['field'] = 'refresh_rate';
$tab[5]['name'] = __('Refresh rate');
$tab[5]['datatype'] = 'timestamp';
$tab[5]['min'] = HOUR_TIMESTAMP;
$tab[5]['max'] = DAY_TIMESTAMP;
$tab[5]['step'] = HOUR_TIMESTAMP;
$tab[5]['toadd'] = array(5 * MINUTE_TIMESTAMP, 15 * MINUTE_TIMESTAMP, 30 * MINUTE_TIMESTAMP, 45 * MINUTE_TIMESTAMP);
$tab[5]['display_emptychoice'] = false;
$tab[5]['massiveaction'] = true;
$tab[5]['searchtype'] = 'equals';
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[121]['table'] = $this->getTable();
$tab[121]['field'] = 'date_creation';
$tab[121]['name'] = __('Creation date');
$tab[121]['datatype'] = 'datetime';
$tab[121]['massiveaction'] = false;
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
return $tab;
}
示例5: getSearchOptions
//.........这里部分代码省略.........
$tab[17]['table'] = $this->getTable();
$tab[17]['field'] = 'language';
$tab[17]['name'] = __('Language');
$tab[17]['datatype'] = 'language';
$tab[17]['display_emptychoice'] = true;
$tab[17]['emptylabel'] = __('Default value');
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[20]['table'] = 'glpi_profiles';
$tab[20]['field'] = 'name';
$tab[20]['name'] = sprintf(__('%1$s (%2$s)'), _n('Profile', 'Profiles', Session::getPluralNumber()), _n('Entity', 'Entities', 1));
$tab[20]['forcegroupby'] = true;
$tab[20]['massiveaction'] = false;
$tab[20]['datatype'] = 'dropdown';
$tab[20]['joinparams'] = array('beforejoin' => array('table' => 'glpi_profiles_users', 'joinparams' => array('jointype' => 'child')));
$tab[21]['table'] = $this->getTable();
$tab[21]['field'] = 'user_dn';
$tab[21]['name'] = __('User DN');
$tab[21]['massiveaction'] = false;
$tab[21]['datatype'] = 'string';
$tab[22]['table'] = $this->getTable();
$tab[22]['field'] = 'registration_number';
$tab[22]['name'] = __('Administrative number');
$tab[22]['datatype'] = 'string';
$tab[23]['table'] = $this->getTable();
$tab[23]['field'] = 'date_sync';
$tab[23]['datatype'] = 'datetime';
$tab[23]['name'] = __('Last synchronization');
$tab[23]['massiveaction'] = false;
$tab[24]['table'] = $this->getTable();
$tab[24]['field'] = 'is_deleted_ldap';
$tab[24]['name'] = __('Deleted user in LDAP directory');
$tab[24]['datatype'] = 'bool';
$tab[24]['massiveaction'] = false;
$tab[80]['table'] = 'glpi_entities';
$tab[80]['linkfield'] = 'entities_id';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = sprintf(__('%1$s (%2$s)'), _n('Entity', 'Entities', Session::getPluralNumber()), _n('Profile', 'Profiles', 1));
$tab[80]['forcegroupby'] = true;
$tab[80]['datatype'] = 'dropdown';
$tab[80]['massiveaction'] = false;
$tab[80]['joinparams'] = array('beforejoin' => array('table' => 'glpi_profiles_users', 'joinparams' => array('jointype' => 'child')));
$tab[81]['table'] = 'glpi_usertitles';
$tab[81]['field'] = 'name';
$tab[81]['name'] = _x('person', 'Title');
$tab[81]['datatype'] = 'dropdown';
$tab[82]['table'] = 'glpi_usercategories';
$tab[82]['field'] = 'name';
$tab[82]['name'] = __('Category');
$tab[82]['datatype'] = 'dropdown';
$tab[79]['table'] = 'glpi_profiles';
$tab[79]['field'] = 'name';
$tab[79]['name'] = __('Default profile');
$tab[79]['datatype'] = 'dropdown';
$tab[77]['table'] = 'glpi_entities';
$tab[77]['field'] = 'name';
$tab[77]['massiveaction'] = true;
$tab[77]['name'] = __('Default entity');
$tab[77]['datatype'] = 'dropdown';
$tab[62]['table'] = $this->getTable();
$tab[62]['field'] = 'begin_date';
$tab[62]['name'] = __('Begin date');
$tab[62]['datatype'] = 'datetime';
$tab[63]['table'] = $this->getTable();
$tab[63]['field'] = 'end_date';
$tab[63]['name'] = __('End date');
$tab[63]['datatype'] = 'datetime';
$tab[60]['table'] = 'glpi_tickets';
$tab[60]['field'] = 'id';
$tab[60]['name'] = __('Number of tickets as requester');
$tab[60]['forcegroupby'] = true;
$tab[60]['usehaving'] = true;
$tab[60]['datatype'] = 'count';
$tab[60]['massiveaction'] = false;
$tab[60]['joinparams'] = array('beforejoin' => array('table' => 'glpi_tickets_users', 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type`
= ' . CommonITILActor::REQUESTER)));
$tab[61]['table'] = 'glpi_tickets';
$tab[61]['field'] = 'id';
$tab[61]['name'] = __('Number of written tickets');
$tab[61]['forcegroupby'] = true;
$tab[61]['usehaving'] = true;
$tab[61]['datatype'] = 'count';
$tab[61]['massiveaction'] = false;
$tab[61]['joinparams'] = array('jointype' => 'child', 'linkfield' => 'users_id_recipient');
$tab[64]['table'] = 'glpi_tickets';
$tab[64]['field'] = 'id';
$tab[64]['name'] = __('Number of assigned tickets');
$tab[64]['forcegroupby'] = true;
$tab[64]['usehaving'] = true;
$tab[64]['datatype'] = 'count';
$tab[64]['massiveaction'] = false;
$tab[64]['joinparams'] = array('beforejoin' => array('table' => 'glpi_tickets_users', 'joinparams' => array('jointype' => 'child', 'condition' => 'AND NEWTABLE.`type`
= ' . CommonITILActor::ASSIGN)));
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
return $tab;
}
示例6: getSearchOptionsMain
//.........这里部分代码省略.........
$tab[21]['field'] = 'content';
$tab[21]['name'] = __('Description');
$tab[21]['massiveaction'] = false;
$tab[21]['datatype'] = 'text';
if ($this->getType() == 'Ticket' && $CFG_GLPI["use_rich_text"]) {
$tab[21]['htmltext'] = true;
}
$tab[2]['table'] = $this->getTable();
$tab[2]['field'] = 'id';
$tab[2]['name'] = __('ID');
$tab[2]['massiveaction'] = false;
$tab[2]['datatype'] = 'number';
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'status';
$tab[12]['name'] = __('Status');
$tab[12]['searchtype'] = 'equals';
$tab[12]['datatype'] = 'specific';
$tab[10]['table'] = $this->getTable();
$tab[10]['field'] = 'urgency';
$tab[10]['name'] = __('Urgency');
$tab[10]['searchtype'] = 'equals';
$tab[10]['datatype'] = 'specific';
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'impact';
$tab[11]['name'] = __('Impact');
$tab[11]['searchtype'] = 'equals';
$tab[11]['datatype'] = 'specific';
$tab[3]['table'] = $this->getTable();
$tab[3]['field'] = 'priority';
$tab[3]['name'] = __('Priority');
$tab[3]['searchtype'] = 'equals';
$tab[3]['datatype'] = 'specific';
$tab[15]['table'] = $this->getTable();
$tab[15]['field'] = 'date';
$tab[15]['name'] = __('Opening date');
$tab[15]['datatype'] = 'datetime';
$tab[15]['massiveaction'] = false;
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'closedate';
$tab[16]['name'] = __('Closing date');
$tab[16]['datatype'] = 'datetime';
$tab[16]['massiveaction'] = false;
$tab[18]['table'] = $this->getTable();
$tab[18]['field'] = 'due_date';
$tab[18]['name'] = __('Time to resolve');
$tab[18]['datatype'] = 'datetime';
$tab[18]['maybefuture'] = true;
$tab[18]['massiveaction'] = false;
$tab[18]['additionalfields'] = array('status');
$tab[151]['table'] = $this->getTable();
$tab[151]['field'] = 'due_date';
$tab[151]['name'] = __('Time to resolve + Progress');
$tab[151]['massiveaction'] = false;
$tab[151]['nosearch'] = true;
$tab[151]['additionalfields'] = array('status');
$tab[82]['table'] = $this->getTable();
$tab[82]['field'] = 'is_late';
$tab[82]['name'] = __('Time to resolve exceedeed');
$tab[82]['datatype'] = 'bool';
$tab[82]['massiveaction'] = false;
$tab[82]['computation'] = "IF(TABLE.`due_date` IS NOT NULL\n AND TABLE.`status` <> " . self::WAITING . "\n AND (TABLE.`solvedate` > TABLE.`due_date`\n OR (TABLE.`solvedate` IS NULL\n AND TABLE.`due_date` < NOW())),\n 1, 0)";
$tab[17]['table'] = $this->getTable();
$tab[17]['field'] = 'solvedate';
$tab[17]['name'] = __('Resolution date');
$tab[17]['datatype'] = 'datetime';
$tab[17]['massiveaction'] = false;
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[7]['table'] = 'glpi_itilcategories';
$tab[7]['field'] = 'completename';
$tab[7]['name'] = __('Category');
$tab[7]['datatype'] = 'dropdown';
if (!Session::isCron() && isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk') {
$tab[7]['condition'] = "`is_helpdeskvisible`";
}
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[45]['table'] = $this->getTable();
$tab[45]['field'] = 'actiontime';
$tab[45]['name'] = __('Total duration');
$tab[45]['datatype'] = 'timestamp';
$tab[45]['massiveaction'] = false;
$tab[45]['nosearch'] = true;
$tab[64]['table'] = 'glpi_users';
$tab[64]['field'] = 'name';
$tab[64]['linkfield'] = 'users_id_lastupdater';
$tab[64]['name'] = __('Last edit by');
$tab[64]['massiveaction'] = false;
$tab[64]['datatype'] = 'dropdown';
$tab[64]['right'] = 'all';
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
return $tab;
}
示例7: getSearchOptions
//.........这里部分代码省略.........
$tab[42]['field'] = 'have_serial';
$tab[42]['name'] = __('Serial');
$tab[42]['datatype'] = 'bool';
$tab[43]['table'] = $this->getTable();
$tab[43]['field'] = 'have_parallel';
$tab[43]['name'] = __('Parallel');
$tab[43]['datatype'] = 'bool';
$tab[44]['table'] = $this->getTable();
$tab[44]['field'] = 'have_usb';
$tab[44]['name'] = __('USB');
$tab[44]['datatype'] = 'bool';
$tab[45]['table'] = $this->getTable();
$tab[45]['field'] = 'have_ethernet';
$tab[45]['name'] = __('Ethernet');
$tab[45]['datatype'] = 'bool';
$tab[46]['table'] = $this->getTable();
$tab[46]['field'] = 'have_wifi';
$tab[46]['name'] = __('Wifi');
$tab[46]['datatype'] = 'bool';
$tab[13]['table'] = $this->getTable();
$tab[13]['field'] = 'memory_size';
$tab[13]['name'] = __('Memory');
$tab[13]['datatype'] = 'string';
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'init_pages_counter';
$tab[11]['name'] = __('Initial page counter');
$tab[11]['datatype'] = 'number';
$tab[11]['nosearch'] = true;
// only display and histo, no index
$tab[12]['table'] = $this->getTable();
$tab[12]['field'] = 'last_pages_counter';
$tab[12]['name'] = __('Current counter of pages');
$tab[12]['datatype'] = 'number';
$tab[9]['table'] = 'glpi_printers';
$tab[9]['field'] = '_virtual';
$tab[9]['linkfield'] = '_virtual';
$tab[9]['name'] = _n('Cartridge', 'Cartridges', Session::getPluralNumber());
$tab[9]['datatype'] = 'specific';
$tab[9]['massiveaction'] = false;
$tab[9]['nosearch'] = true;
$tab[9]['nosort'] = true;
$tab[17]['table'] = 'glpi_cartridges';
$tab[17]['field'] = 'id';
$tab[17]['name'] = __('Number of used cartridges');
$tab[17]['datatype'] = 'count';
$tab[17]['forcegroupby'] = true;
$tab[17]['usehaving'] = true;
$tab[17]['massiveaction'] = false;
$tab[17]['joinparams'] = array('jointype' => 'child', 'condition' => "AND NEWTABLE.`date_use` IS NOT NULL\n AND NEWTABLE.`date_out` IS NULL");
$tab[18]['table'] = 'glpi_cartridges';
$tab[18]['field'] = 'id';
$tab[18]['name'] = __('Number of worn cartridges');
$tab[18]['datatype'] = 'count';
$tab[18]['forcegroupby'] = true;
$tab[18]['usehaving'] = true;
$tab[18]['massiveaction'] = false;
$tab[18]['joinparams'] = array('jointype' => 'child', 'condition' => "AND NEWTABLE.`date_out` IS NOT NULL");
$tab[32]['table'] = 'glpi_networks';
$tab[32]['field'] = 'name';
$tab[32]['name'] = __('Network');
$tab[32]['datatype'] = 'dropdown';
$tab[33]['table'] = 'glpi_domains';
$tab[33]['field'] = 'name';
$tab[33]['name'] = __('Domain');
$tab[33]['datatype'] = 'dropdown';
$tab[23]['table'] = 'glpi_manufacturers';
$tab[23]['field'] = 'name';
$tab[23]['name'] = __('Manufacturer');
$tab[23]['datatype'] = 'dropdown';
$tab[24]['table'] = 'glpi_users';
$tab[24]['field'] = 'name';
$tab[24]['linkfield'] = 'users_id_tech';
$tab[24]['name'] = __('Technician in charge of the hardware');
$tab[24]['datatype'] = 'dropdown';
$tab[24]['right'] = 'own_ticket';
$tab[49]['table'] = 'glpi_groups';
$tab[49]['field'] = 'completename';
$tab[49]['linkfield'] = 'groups_id_tech';
$tab[49]['name'] = __('Group in charge of the hardware');
$tab[49]['condition'] = '`is_assign`';
$tab[49]['datatype'] = 'dropdown';
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[82]['table'] = $this->getTable();
$tab[82]['field'] = 'is_global';
$tab[82]['name'] = __('Global management');
$tab[82]['datatype'] = 'bool';
$tab[82]['massiveaction'] = false;
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
return $tab;
}
示例8: getSearchOptions
//.........这里部分代码省略.........
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[121]['table'] = $this->getTable();
$tab[121]['field'] = 'date_creation';
$tab[121]['name'] = __('Creation date');
$tab[121]['datatype'] = 'datetime';
$tab[121]['massiveaction'] = false;
$tab[23]['table'] = 'glpi_manufacturers';
$tab[23]['field'] = 'name';
$tab[23]['name'] = __('Publisher');
$tab[23]['datatype'] = 'dropdown';
$tab[24]['table'] = 'glpi_users';
$tab[24]['field'] = 'name';
$tab[24]['linkfield'] = 'users_id_tech';
$tab[24]['name'] = __('Technician in charge of the hardware');
$tab[24]['datatype'] = 'dropdown';
$tab[24]['right'] = 'own_ticket';
$tab[49]['table'] = 'glpi_groups';
$tab[49]['field'] = 'completename';
$tab[49]['linkfield'] = 'groups_id_tech';
$tab[49]['name'] = __('Group in charge of the hardware');
$tab[49]['condition'] = '`is_assign`';
$tab[49]['datatype'] = 'dropdown';
$tab[70]['table'] = 'glpi_users';
$tab[70]['field'] = 'name';
$tab[70]['name'] = __('User');
$tab[70]['datatype'] = 'dropdown';
$tab[70]['right'] = 'all';
$tab[71]['table'] = 'glpi_groups';
$tab[71]['field'] = 'completename';
$tab[71]['name'] = __('Group');
$tab[71]['condition'] = '`is_itemgroup`';
$tab[71]['datatype'] = 'dropdown';
$tab[61]['table'] = $this->getTable();
$tab[61]['field'] = 'is_helpdesk_visible';
$tab[61]['name'] = __('Associable to a ticket');
$tab[61]['datatype'] = 'bool';
$tab[63]['table'] = $this->getTable();
$tab[63]['field'] = 'is_valid';
//TRANS: Indicator to know is all licenses of the software are valids
$tab[63]['name'] = __('Valid licenses');
$tab[63]['datatype'] = 'bool';
$tab += SoftwareLicense::getSearchOptionsToAdd();
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[72]['table'] = 'glpi_computers_softwareversions';
$tab[72]['field'] = 'id';
$tab[72]['name'] = _x('quantity', 'Number of installations');
$tab[72]['forcegroupby'] = true;
$tab[72]['usehaving'] = true;
$tab[72]['datatype'] = 'count';
$tab[72]['nometa'] = true;
$tab[72]['massiveaction'] = false;
if (Session::getLoginUserID()) {
$tab[72]['joinparams'] = array('jointype' => 'child', 'condition' => "AND NEWTABLE.`is_deleted_computer` = '0'\n AND NEWTABLE.`is_deleted` = '0'\n AND NEWTABLE.`is_template_computer` = '0'\n " . getEntitiesRestrictRequest('AND', 'NEWTABLE'), 'beforejoin' => array('table' => 'glpi_softwareversions', 'joinparams' => array('jointype' => 'child')));
}
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
$tab[86]['massiveaction'] = false;
$tab['versions'] = _n('Version', 'Versions', Session::getPluralNumber());
$tab[5]['table'] = 'glpi_softwareversions';
$tab[5]['field'] = 'name';
$tab[5]['name'] = __('Version name');
$tab[5]['forcegroupby'] = true;
$tab[5]['massiveaction'] = false;
$tab[5]['joinparams'] = array('jointype' => 'child');
$tab[5]['datatype'] = 'dropdown';
$tab[31]['table'] = 'glpi_states';
$tab[31]['field'] = 'completename';
$tab[31]['name'] = __('Status');
$tab[31]['datatype'] = 'dropdown';
$tab[31]['forcegroupby'] = true;
$tab[31]['massiveaction'] = false;
$tab[31]['joinparams'] = array('beforejoin' => array('table' => 'glpi_softwareversions', 'joinparams' => array('jointype' => 'child')));
$tab[170]['table'] = 'glpi_softwareversions';
$tab[170]['field'] = 'comment';
$tab[170]['name'] = __('Version comments');
$tab[170]['forcegroupby'] = true;
$tab[170]['datatype'] = 'text';
$tab[170]['massiveaction'] = false;
$tab[170]['joinparams'] = array('jointype' => 'child');
$tab[4]['table'] = 'glpi_operatingsystems';
$tab[4]['field'] = 'name';
$tab[4]['datatype'] = 'dropdown';
$tab[4]['name'] = __('Operating system');
$tab[4]['forcegroupby'] = true;
$tab[4]['joinparams'] = array('beforejoin' => array('table' => 'glpi_softwareversions', 'joinparams' => array('jointype' => 'child')));
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
return $tab;
}
示例9: getSearchOptions
//.........这里部分代码省略.........
$tab[31]['table'] = 'glpi_states';
$tab[31]['field'] = 'completename';
$tab[31]['name'] = __('Status');
$tab[31]['datatype'] = 'dropdown';
$tab[31]['condition'] = "`is_visible_phone`";
$tab[5]['table'] = $this->getTable();
$tab[5]['field'] = 'serial';
$tab[5]['name'] = __('Serial number');
$tab[5]['datatype'] = 'string';
$tab[6]['table'] = $this->getTable();
$tab[6]['field'] = 'otherserial';
$tab[6]['name'] = __('Inventory number');
$tab[6]['datatype'] = 'string';
$tab[7]['table'] = $this->getTable();
$tab[7]['field'] = 'contact';
$tab[7]['name'] = __('Alternate username');
$tab[7]['datatype'] = 'string';
$tab[8]['table'] = $this->getTable();
$tab[8]['field'] = 'contact_num';
$tab[8]['name'] = __('Alternate username number');
$tab[8]['datatype'] = 'string';
$tab[9]['table'] = $this->getTable();
$tab[9]['field'] = 'number_line';
$tab[9]['name'] = _x('quantity', 'Number of lines');
$tab[9]['datatype'] = 'string';
$tab[70]['table'] = 'glpi_users';
$tab[70]['field'] = 'name';
$tab[70]['name'] = __('User');
$tab[70]['datatype'] = 'dropdown';
$tab[70]['right'] = 'all';
$tab[71]['table'] = 'glpi_groups';
$tab[71]['field'] = 'completename';
$tab[71]['name'] = __('Group');
$tab[71]['condition'] = '`is_itemgroup`';
$tab[71]['datatype'] = 'dropdown';
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[121]['table'] = $this->getTable();
$tab[121]['field'] = 'date_creation';
$tab[121]['name'] = __('Creation date');
$tab[121]['datatype'] = 'datetime';
$tab[121]['massiveaction'] = false;
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'comment';
$tab[16]['name'] = __('Comments');
$tab[16]['datatype'] = 'text';
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'brand';
$tab[11]['name'] = __('Brand');
$tab[11]['datatype'] = 'string';
$tab[23]['table'] = 'glpi_manufacturers';
$tab[23]['field'] = 'name';
$tab[23]['name'] = __('Manufacturer');
$tab[23]['datatype'] = 'dropdown';
$tab[32]['table'] = $this->getTable();
$tab[32]['field'] = 'firmware';
$tab[32]['name'] = __('Firmware');
$tab[32]['datatype'] = 'string';
$tab[24]['table'] = 'glpi_users';
$tab[24]['field'] = 'name';
$tab[24]['linkfield'] = 'users_id_tech';
$tab[24]['name'] = __('Technician in charge of the hardware');
$tab[24]['datatype'] = 'dropdown';
$tab[24]['right'] = 'own_ticket';
$tab[49]['table'] = 'glpi_groups';
$tab[49]['field'] = 'completename';
$tab[49]['linkfield'] = 'groups_id_tech';
$tab[49]['name'] = __('Group in charge of the hardware');
$tab[49]['condition'] = '`is_assign`';
$tab[49]['datatype'] = 'dropdown';
$tab[42]['table'] = 'glpi_phonepowersupplies';
$tab[42]['field'] = 'name';
$tab[42]['name'] = __('Power supply');
$tab[42]['datatype'] = 'dropdown';
$tab[43]['table'] = $this->getTable();
$tab[43]['field'] = 'have_headset';
$tab[43]['name'] = __('Headset');
$tab[43]['datatype'] = 'bool';
$tab[44]['table'] = $this->getTable();
$tab[44]['field'] = 'have_hp';
$tab[44]['name'] = __('Speaker');
$tab[44]['datatype'] = 'bool';
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[82]['table'] = $this->getTable();
$tab[82]['field'] = 'is_global';
$tab[82]['name'] = __('Global management');
$tab[82]['datatype'] = 'bool';
$tab[82]['massiveaction'] = false;
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
return $tab;
}
示例10: getSearchOptions
function getSearchOptions()
{
global $CFG_GLPI;
$tab = array();
$tab['common'] = __('Characteristics');
$tab[1]['table'] = $this->getTable();
$tab[1]['field'] = 'name';
$tab[1]['name'] = __('Name');
$tab[1]['datatype'] = 'itemlink';
$tab[1]['massiveaction'] = false;
$tab[2]['table'] = $this->getTable();
$tab[2]['field'] = 'id';
$tab[2]['name'] = __('ID');
$tab[2]['massiveaction'] = false;
$tab[2]['datatype'] = 'number';
$tab[3]['table'] = $this->getTable();
$tab[3]['field'] = 'filename';
$tab[3]['name'] = __('File');
$tab[3]['massiveaction'] = false;
$tab[3]['datatype'] = 'string';
$tab[4]['table'] = $this->getTable();
$tab[4]['field'] = 'link';
$tab[4]['name'] = __('Web Link');
$tab[4]['datatype'] = 'weblink';
$tab[5]['table'] = $this->getTable();
$tab[5]['field'] = 'mime';
$tab[5]['name'] = __('MIME type');
$tab[5]['datatype'] = 'string';
if ($CFG_GLPI['use_rich_text']) {
$tab[6]['table'] = $this->getTable();
$tab[6]['field'] = 'tag';
$tab[6]['name'] = __('Tag');
$tab[6]['datatype'] = 'text';
$tab[6]['massiveaction'] = false;
}
$tab[7]['table'] = 'glpi_documentcategories';
$tab[7]['field'] = 'completename';
$tab[7]['name'] = __('Heading');
$tab[7]['datatype'] = 'dropdown';
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[121]['table'] = $this->getTable();
$tab[121]['field'] = 'date_creation';
$tab[121]['name'] = __('Creation date');
$tab[121]['datatype'] = 'datetime';
$tab[121]['massiveaction'] = false;
$tab[20]['table'] = $this->getTable();
$tab[20]['field'] = 'sha1sum';
$tab[20]['name'] = sprintf(__('%1$s (%2$s)'), __('Checksum'), __('SHA1'));
$tab[20]['massiveaction'] = false;
$tab[20]['datatype'] = 'string';
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'comment';
$tab[16]['name'] = __('Comments');
$tab[16]['datatype'] = 'text';
$tab[72]['table'] = 'glpi_documents_items';
$tab[72]['field'] = 'id';
$tab[72]['name'] = _x('quantity', 'Number of associated items');
$tab[72]['forcegroupby'] = true;
$tab[72]['usehaving'] = true;
$tab[72]['datatype'] = 'count';
$tab[72]['massiveaction'] = false;
$tab[72]['joinparams'] = array('jointype' => 'child');
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
return $tab;
}
示例11: array
if (!$item->can($_GET["id"], READ)) {
exit;
}
}
}
}
}
$notvalidoptions = array('_glpi_tab', '_itemtype', 'sort', 'order', 'withtemplate');
$options = $_GET;
foreach ($notvalidoptions as $key) {
if (isset($options[$key])) {
unset($options[$key]);
}
}
if (isset($options['locked'])) {
ObjectLock::setReadOnlyProfile();
}
CommonGLPI::displayStandardTab($item, $_GET['_glpi_tab'], $_GET["withtemplate"], $options);
if (isset($_GET['full_page_tab'])) {
echo "<div class='center' id='debugajax'>";
echo "<a href='" . htmlentities($_SERVER['REQUEST_URI']) . "' class='vsubmit'>Reload</a>";
echo "</div>";
// I think that we should display this warning, because tabs are not prepare
// for being used full space ...
if (!isset($_SESSION['glpi_warned_about_full_page_tab'])) {
// Debug string : not really need translation.
$msg = 'WARNING: full page tabs are only for debug/validation purpose !\\n';
$msg .= 'Actions on this page may have undefined result.';
echo "<script type='text/javascript' >\n";
echo "alert('{$msg}')";
echo "</script>";
示例12: getRights
/**
* Get rights for an item _ may be overload by object
*
* @since version 0.85
*
* @param $interface string (defalt 'central')
*
* @return array of rights to display
**/
function getRights($interface = 'central')
{
$values = array(CREATE => __('Create'), READ => __('Read'), UPDATE => __('Update'), PURGE => array('short' => __('Purge'), 'long' => _x('button', 'Delete permanently')));
$values += ObjectLock::getRightsToAdd(get_class($this), $interface);
if ($this->maybeDeleted()) {
$values[DELETE] = array('short' => __('Delete'), 'long' => _x('button', 'Put in dustbin'));
}
if ($this->usenotepad) {
$values[READNOTE] = array('short' => __('Read notes'), 'long' => __("Read the item's notes"));
$values[UPDATENOTE] = array('short' => __('Update notes'), 'long' => __("Update the item's notes"));
}
return $values;
}
示例13: getSearchOptions
//.........这里部分代码省略.........
$tab[12]['datafields'][1] = 'begin_date';
$tab[12]['datafields'][2] = 'duration';
$tab[12]['searchunit'] = 'DAY';
$tab[12]['delayunit'] = 'MONTH';
$tab[12]['maybefuture'] = true;
$tab[12]['massiveaction'] = false;
$tab[13]['table'] = $this->getTable();
$tab[13]['field'] = 'expire_notice';
$tab[13]['name'] = __('Expiration date + notice');
$tab[13]['datatype'] = 'date_delay';
$tab[13]['datafields'][1] = 'begin_date';
$tab[13]['datafields'][2] = 'duration';
$tab[13]['datafields'][3] = 'notice';
$tab[13]['searchunit'] = 'DAY';
$tab[13]['delayunit'] = 'MONTH';
$tab[13]['maybefuture'] = true;
$tab[13]['massiveaction'] = false;
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'comment';
$tab[16]['name'] = __('Comments');
$tab[16]['datatype'] = 'text';
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[59]['table'] = $this->getTable();
$tab[59]['field'] = 'alert';
$tab[59]['name'] = __('Email alarms');
$tab[59]['datatype'] = 'specific';
$tab[59]['searchtype'] = array('equals', 'notequals');
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
$tab[72]['table'] = 'glpi_contracts_items';
$tab[72]['field'] = 'id';
$tab[72]['name'] = _x('quantity', 'Number of items');
$tab[72]['forcegroupby'] = true;
$tab[72]['usehaving'] = true;
$tab[72]['datatype'] = 'count';
$tab[72]['massiveaction'] = false;
$tab[72]['joinparams'] = array('jointype' => 'child');
$tab[29]['table'] = 'glpi_suppliers';
$tab[29]['field'] = 'name';
$tab[29]['name'] = _n('Associated supplier', 'Associated suppliers', Session::getPluralNumber());
$tab[29]['forcegroupby'] = true;
$tab[29]['datatype'] = 'itemlink';
$tab[29]['massiveaction'] = false;
$tab[29]['joinparams'] = array('beforejoin' => array('table' => 'glpi_contracts_suppliers', 'joinparams' => array('jointype' => 'child')));
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
$tab['cost'] = __('Cost');
$tab[11]['table'] = 'glpi_contractcosts';
$tab[11]['field'] = 'totalcost';
$tab[11]['name'] = __('Total cost');
$tab[11]['datatype'] = 'decimal';
$tab[11]['forcegroupby'] = true;
$tab[11]['usehaving'] = true;
$tab[11]['massiveaction'] = false;
$tab[11]['joinparams'] = array('jointype' => 'child');
$tab[11]['computation'] = "(SUM(TABLE.`cost`) / COUNT(TABLE.`id`))\n * COUNT(DISTINCT TABLE.`id`)";
$tab[41]['table'] = 'glpi_contractcosts';
$tab[41]['field'] = 'cost';
$tab[41]['name'] = _n('Cost', 'Costs', Session::getPluralNumber());
$tab[41]['datatype'] = 'decimal';
$tab[41]['forcegroupby'] = true;
$tab[41]['massiveaction'] = false;
$tab[41]['joinparams'] = array('jointype' => 'child');
$tab[42]['table'] = 'glpi_contractcosts';
$tab[42]['field'] = 'begin_date';
$tab[42]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('Begin date'));
$tab[42]['datatype'] = 'date';
$tab[42]['forcegroupby'] = true;
$tab[42]['massiveaction'] = false;
$tab[42]['joinparams'] = array('jointype' => 'child');
$tab[43]['table'] = 'glpi_contractcosts';
$tab[43]['field'] = 'end_date';
$tab[43]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('End date'));
$tab[43]['datatype'] = 'date';
$tab[43]['forcegroupby'] = true;
$tab[43]['massiveaction'] = false;
$tab[43]['joinparams'] = array('jointype' => 'child');
$tab[44]['table'] = 'glpi_contractcosts';
$tab[44]['field'] = 'name';
$tab[44]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('Name'));
$tab[44]['forcegroupby'] = true;
$tab[44]['massiveaction'] = false;
$tab[44]['joinparams'] = array('jointype' => 'child');
$tab[44]['datatype'] = 'dropdown';
$tab[45]['table'] = 'glpi_budgets';
$tab[45]['field'] = 'name';
$tab[45]['name'] = sprintf(__('%1$s - %2$s'), __('Cost'), __('Budget'));
$tab[45]['datatype'] = 'dropdown';
$tab[45]['forcegroupby'] = true;
$tab[45]['massiveaction'] = false;
$tab[45]['joinparams'] = array('beforejoin' => array('table' => 'glpi_contractcosts', 'joinparams' => array('jointype' => 'child')));
return $tab;
}
示例14: getSearchOptions
function getSearchOptions()
{
$tab = array();
$tab['common'] = __('Characteristics');
$tab[2]['table'] = $this->getTable();
$tab[2]['field'] = 'id';
$tab[2]['name'] = __('ID');
$tab[2]['massiveaction'] = false;
$tab[2]['datatype'] = 'number';
$tab[4]['table'] = 'glpi_knowbaseitemcategories';
$tab[4]['field'] = 'name';
$tab[4]['name'] = __('Category');
$tab[4]['datatype'] = 'dropdown';
$tab[5]['table'] = $this->getTable();
$tab[5]['field'] = 'date';
$tab[5]['name'] = __('Date');
$tab[5]['datatype'] = 'datetime';
$tab[5]['massiveaction'] = false;
$tab[6]['table'] = $this->getTable();
$tab[6]['field'] = 'name';
$tab[6]['name'] = __('Subject');
$tab[6]['datatype'] = 'text';
$tab[7]['table'] = $this->getTable();
$tab[7]['field'] = 'answer';
$tab[7]['name'] = __('Content');
$tab[7]['datatype'] = 'text';
$tab[7]['htmltext'] = true;
$tab[8]['table'] = $this->getTable();
$tab[8]['field'] = 'is_faq';
$tab[8]['name'] = __('FAQ item');
$tab[8]['datatype'] = 'bool';
$tab[9]['table'] = $this->getTable();
$tab[9]['field'] = 'view';
$tab[9]['name'] = _n('View', 'Views', Session::getPluralNumber());
$tab[9]['datatype'] = 'integer';
$tab[9]['massiveaction'] = false;
$tab[10]['table'] = $this->getTable();
$tab[10]['field'] = 'begin_date';
$tab[10]['name'] = __('Visibility start date');
$tab[10]['datatype'] = 'datetime';
$tab[11]['table'] = $this->getTable();
$tab[11]['field'] = 'end_date';
$tab[11]['name'] = __('Visibility end date');
$tab[11]['datatype'] = 'datetime';
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[70]['table'] = 'glpi_users';
$tab[70]['field'] = 'name';
$tab[70]['name'] = __('User');
$tab[70]['massiveaction'] = false;
$tab[70]['datatype'] = 'dropdown';
$tab[70]['right'] = 'all';
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['massiveaction'] = false;
$tab[80]['datatype'] = 'dropdown';
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
return $tab;
}
示例15: getSearchOptions
//.........这里部分代码省略.........
$tab[21]['datatype'] = 'text';
$tab[3]['table'] = $this->getTable();
$tab[3]['field'] = 'priority';
$tab[3]['name'] = __('Priority');
$tab[3]['searchtype'] = 'equals';
$tab[3]['datatype'] = 'specific';
$tab[14]['table'] = 'glpi_projecttypes';
$tab[14]['field'] = 'name';
$tab[14]['name'] = __('Type');
$tab[14]['datatype'] = 'dropdown';
$tab[12]['table'] = 'glpi_projectstates';
$tab[12]['field'] = 'name';
$tab[12]['name'] = _x('item', 'State');
$tab[12]['datatype'] = 'dropdown';
$tab[15]['table'] = $this->getTable();
$tab[15]['field'] = 'date';
$tab[15]['name'] = __('Creation date');
$tab[15]['datatype'] = 'datetime';
$tab[15]['massiveaction'] = false;
$tab[5]['table'] = $this->getTable();
$tab[5]['field'] = 'percent_done';
$tab[5]['name'] = __('Percent done');
$tab[5]['datatype'] = 'number';
$tab[5]['unit'] = '%';
$tab[5]['min'] = 0;
$tab[5]['max'] = 100;
$tab[5]['step'] = 5;
$tab[6]['table'] = $this->getTable();
$tab[6]['field'] = 'show_on_global_gantt';
$tab[6]['name'] = __('Show on global GANTT');
$tab[6]['datatype'] = 'bool';
$tab[24]['table'] = 'glpi_users';
$tab[24]['field'] = 'name';
$tab[24]['linkfield'] = 'users_id';
$tab[24]['name'] = __('Manager');
$tab[24]['datatype'] = 'dropdown';
$tab[24]['right'] = 'see_project';
$tab[49]['table'] = 'glpi_groups';
$tab[49]['field'] = 'completename';
$tab[49]['linkfield'] = 'groups_id';
$tab[49]['name'] = __('Manager group');
$tab[49]['condition'] = '`is_manager`';
$tab[49]['datatype'] = 'dropdown';
$tab[7]['table'] = $this->getTable();
$tab[7]['field'] = 'plan_start_date';
$tab[7]['name'] = __('Planned start date');
$tab[7]['datatype'] = 'datetime';
$tab[8]['table'] = $this->getTable();
$tab[8]['field'] = 'plan_end_date';
$tab[8]['name'] = __('Planned end date');
$tab[8]['datatype'] = 'datetime';
$tab[17]['table'] = $this->getTable();
$tab[17]['field'] = '_virtual_planned_duration';
$tab[17]['name'] = __('Planned duration');
$tab[17]['datatype'] = 'specific';
$tab[17]['nosearch'] = true;
$tab[17]['massiveaction'] = false;
$tab[17]['nosort'] = true;
$tab[9]['table'] = $this->getTable();
$tab[9]['field'] = 'real_start_date';
$tab[9]['name'] = __('Real start date');
$tab[9]['datatype'] = 'datetime';
$tab[10]['table'] = $this->getTable();
$tab[10]['field'] = 'real_end_date';
$tab[10]['name'] = __('Real end date');
$tab[10]['datatype'] = 'datetime';
$tab[18]['table'] = $this->getTable();
$tab[18]['field'] = '_virtual_effective_duration';
$tab[18]['name'] = __('Effective duration');
$tab[18]['datatype'] = 'specific';
$tab[18]['nosearch'] = true;
$tab[18]['massiveaction'] = false;
$tab[18]['nosort'] = true;
$tab[16]['table'] = $this->getTable();
$tab[16]['field'] = 'comment';
$tab[16]['name'] = __('Comments');
$tab[16]['datatype'] = 'text';
$tab[19]['table'] = $this->getTable();
$tab[19]['field'] = 'date_mod';
$tab[19]['name'] = __('Last update');
$tab[19]['datatype'] = 'datetime';
$tab[19]['massiveaction'] = false;
$tab[121]['table'] = $this->getTable();
$tab[121]['field'] = 'date_creation';
$tab[121]['name'] = __('Creation date');
$tab[121]['datatype'] = 'datetime';
$tab[121]['massiveaction'] = false;
$tab[80]['table'] = 'glpi_entities';
$tab[80]['field'] = 'completename';
$tab[80]['name'] = __('Entity');
$tab[80]['datatype'] = 'dropdown';
$tab[86]['table'] = $this->getTable();
$tab[86]['field'] = 'is_recursive';
$tab[86]['name'] = __('Child entities');
$tab[86]['datatype'] = 'bool';
// add objectlock search options
$tab += ObjectLock::getSearchOptionsToAdd(get_class($this));
$tab += Notepad::getSearchOptionsToAdd();
return $tab;
}