本文整理汇总了PHP中_sn函数的典型用法代码示例。如果您正苦于以下问题:PHP _sn函数的具体用法?PHP _sn怎么用?PHP _sn使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_sn函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: helpHeader
/**
* Print a nice HTML head for help page
*
* @param $title title of the page
* @param $url not used anymore (default '')
**/
static function helpHeader($title, $url = '')
{
global $CFG_GLPI, $HEADER_LOADED, $PLUGIN_HOOKS;
// Print a nice HTML-head for help page
if ($HEADER_LOADED) {
return;
}
$HEADER_LOADED = true;
self::includeHeader($title);
// Body
$body_class = "layout_" . $_SESSION['glpilayout'];
if (strpos($_SERVER['REQUEST_URI'], "form.php") !== false && isset($_GET['id']) && $_GET['id'] > 0) {
if (!CommonGLPI::isLayoutExcludedPage()) {
$body_class .= " form";
} else {
$body_class = "";
}
}
echo "<body class='{$body_class}'>";
// Main Headline
echo "<div id='header'>";
echo "<div id='header_top'>";
echo "<div id='c_logo'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' accesskey='1' title=\"" . __s('Home') . "\"><span class='invisible'>Logo</span></a>";
echo "</div>";
// Les préférences + lien déconnexion
echo "<div id='c_preference' >";
echo "<ul>";
echo "<li id='deconnexion'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/logout.php";
/// logout witout noAuto login for extauth
if (isset($_SESSION['glpiextauth']) && $_SESSION['glpiextauth']) {
echo "?noAUTO=1";
}
echo "' title=\"" . __s('Logout') . "\">";
// check user id : header used for display messages when session logout
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/logout.png' title=\"" . __s('Logout') . "\" alt=\"" . __s('Logout') . "\" class='button-icon'>";
echo "</a>";
echo "</li>\n";
echo "<li id='preferences_link'><a href='" . $CFG_GLPI["root_doc"] . "/front/preference.php' title=\"" . __s('My settings') . "\">";
echo "<span id='preferences_icon' title=\"" . __s('My settings') . "\" alt=\"" . __s('My settings') . "\" class='button-icon' /></span>";
// check user id : header used for display messages when session logout
if (Session::getLoginUserID()) {
echo "<span id='myname'>";
echo formatUserName(0, $_SESSION["glpiname"], $_SESSION["glpirealname"], $_SESSION["glpifirstname"], 0, 20);
echo "</span>";
}
echo "</a></li>";
echo "<li>";
Ajax::createIframeModalWindow('loadbookmark', $CFG_GLPI["root_doc"] . "/front/bookmark.php?action=load", array('title' => __('Load a bookmark'), 'reloadonclose' => true));
echo "<a href='#' onClick=\"" . Html::jsGetElementbyID('loadbookmark') . ".dialog('open');\">";
echo "<img src='" . $CFG_GLPI["root_doc"] . "/pics/bookmark.png' title=\"" . __s('Load a bookmark') . "\" alt=\"" . __s('Load a bookmark') . "\" class='button-icon'>";
echo "</a></li>";
echo "<li id='help_link'>" . "<a href='" . (empty($CFG_GLPI["helpdesk_doc_url"]) ? "http://glpi-project.org/help-helpdesk" : $CFG_GLPI["helpdesk_doc_url"]) . "' target='_blank' title=\"" . __s('Help') . "\">" . "<img src='" . $CFG_GLPI["root_doc"] . "/pics/help.png' title=\"" . __s('Help') . "\" alt=\"" . __s('Help') . "\" class='button-icon'>";
"</a></li>";
echo "</ul>";
echo "</div>";
//-- Le moteur de recherche --
echo "<div id='c_recherche'></div>";
echo "</div>";
//-- Le menu principal --
echo "<div id='c_menu'>";
echo "<ul id='menu'>";
// Build the navigation-elements
// Home
echo "<li id='menu1'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\" class='itemP'>" . __('Home') . "</a>";
echo "</li>";
// Create ticket
if (Session::haveRight("ticket", CREATE)) {
echo "<li id='menu2'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1' " . "title=\"" . __s('Create a ticket') . "\" class='itemP'>" . __('Create a ticket') . "</a>";
echo "</li>";
}
// Suivi ticket
if (Session::haveRight("ticket", Ticket::READMY) || Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
echo "<li id='menu3'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.php' title=\"" . __s('Ticket followup') . "\" class='itemP'>" . _n('Ticket', 'Tickets', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// Reservation
if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
echo "<li id='menu4'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.php' title=\"" . _sn('Reservation', 'Reservations', Session::getPluralNumber()) . "\" class='itemP'>" . _n('Reservation', 'Reservations', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// FAQ
if (Session::haveRight('knowbase', KnowbaseItem::READFAQ)) {
echo "<li id='menu5' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.faq.php' title=\"" . __s('FAQ') . "\" class='itemP'>" . __('FAQ') . "</a>";
echo "</li>";
}
// PLUGINS
$plugins = array();
//.........这里部分代码省略.........
示例2: helpHeader
/**
* Print a nice HTML head for help page
*
* @param $title title of the page
* @param $url not used anymore (default '')
**/
static function helpHeader($title, $url = '')
{
global $CFG_GLPI, $HEADER_LOADED, $PLUGIN_HOOKS, $DB;
// Print a nice HTML-head for help page
if ($HEADER_LOADED) {
return;
}
$HEADER_LOADED = true;
self::includeHeader($title);
// Body
echo "<body>";
echo '
<nav class="navbar navbar-default" id="menuHeader">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="' . $CFG_GLPI["root_doc"] . '/front/central.php">
<img src="' . $CFG_GLPI["root_doc"] . '/pics/fd_logo1.png" style="margin-top:-4px;" />
<span class=\'invisible\'>Logo</span>
</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">';
echo "<li id='menu1'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php' title=\"" . __s('Home') . "\" class='itemP'>" . __('Home') . "</a>";
echo "</li>";
// Create ticket
if (Session::haveRight("ticket", CREATE)) {
echo "<li id='menu2'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.public.php?create_ticket=1' " . "title=\"" . __s('Create a ticket') . "\" class='itemP'>" . __('Create a ticket') . "</a>";
echo "</li>";
}
// Suivi ticket
if (Session::haveRight("ticket", Ticket::READMY) || Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
echo "<li id='menu3'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/ticket.php' title=\"" . __s('Ticket followup') . "\" class='itemP'>" . _n('Ticket', 'Tickets', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// Reservation
if (Session::haveRight("reservation", ReservationItem::RESERVEANITEM)) {
echo "<li id='menu4'>";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/reservationitem.php' title=\"" . _sn('Reservation', 'Reservations', Session::getPluralNumber()) . "\" class='itemP'>" . _n('Reservation', 'Reservations', Session::getPluralNumber()) . "</a>";
echo "</li>";
}
// FAQ
if (Session::haveRight('knowbase', KnowbaseItem::READFAQ)) {
echo "<li id='menu5' >";
echo "<a href='" . $CFG_GLPI["root_doc"] . "/front/helpdesk.faq.php' title=\"" . __s('FAQ') . "\" class='itemP'>" . __('FAQ') . "</a>";
echo "</li>";
}
// PLUGINS
$plugins = array();
if (isset($PLUGIN_HOOKS["helpdesk_menu_entry"]) && count($PLUGIN_HOOKS["helpdesk_menu_entry"])) {
foreach ($PLUGIN_HOOKS["helpdesk_menu_entry"] as $plugin => $active) {
if ($active) {
$plugins[$plugin] = Plugin::getInfo($plugin);
}
}
}
if (isset($plugins) && count($plugins) > 0) {
$list = array();
foreach ($plugins as $key => $val) {
$list[$key] = $val["name"];
}
asort($list);
//echo "<li id='menu5' onmouseover=\"javascript:menuAff('menu5','menu');\">";
echo "<li id='menu5'>";
echo "<a href='#' title=\"" . _sn('Plugin', 'Plugins', Session::getPluralNumber()) . "\" class='itemP'>" . __('Plugins') . "</a>";
// default none
echo "<ul class='ssmenu'>";
// list menu item
foreach ($list as $key => $val) {
$link = "";
if (is_string($PLUGIN_HOOKS["helpdesk_menu_entry"][$key])) {
$link = $PLUGIN_HOOKS["helpdesk_menu_entry"][$key];
}
echo "<li><a href='" . $CFG_GLPI["root_doc"] . "/plugins/" . $key . $link . "'>" . $plugins[$key]["name"] . "</a></li>\n";
}
echo "</ul></li>";
}
echo "<div class='sep'></div>";
echo '</ul>';
echo '<ul class="nav navbar-nav navbar-right">';
$sql_photo2 = "SELECT picture\n\t\t\t\t\t\t\t\tFROM glpi_users\n\t\t\t\t\t\t\t\tWHERE id = " . $_SESSION["glpiID"] . " ";
$res_photo2 = $DB->query($sql_photo2);
$pic2 = $DB->result($res_photo2, 0, 'picture');
//.........这里部分代码省略.........
示例3: dropdownMyDevices
//.........这里部分代码省略.........
$output = sprintf(__('%1$s - %2$s'), $type_name, $output);
if (isset($data['serial'])) {
$output = sprintf(__('%1$s - %2$s'), $output, $data['serial']);
}
if (isset($data['otherserial'])) {
$output = sprintf(__('%1$s - %2$s'), $output, $data['otherserial']);
}
$tmp_device .= "<option title=\"{$output}\" value='" . $itemtype . "_" . $data["id"] . "' " . ($my_item == $itemtype . "_" . $data["id"] ? "selected" : "") . ">" . Toolbox::substr($output, 0, $_SESSION["glpidropdown_chars_limit"]) . "</option>";
$already_add[$itemtype][] = $data["id"];
}
}
}
}
}
if (!empty($tmp_device)) {
$my_devices .= "<optgroup label=\"" . __s('Devices own by my groups') . "\">" . $tmp_device . "</optgroup>";
}
}
}
// Get linked items to computers
if (isset($already_add['Computer']) && count($already_add['Computer'])) {
$search_computer = " XXXX IN (" . implode(',', $already_add['Computer']) . ') ';
$tmp_device = "";
// Direct Connection
$types = array('Monitor', 'Peripheral', 'Phone', 'Printer');
foreach ($types as $itemtype) {
if (in_array($itemtype, $_SESSION["glpiactiveprofile"]["helpdesk_item_type"]) && ($item = getItemForItemtype($itemtype))) {
$itemtable = getTableForItemType($itemtype);
if (!isset($already_add[$itemtype])) {
$already_add[$itemtype] = array();
}
$query = "SELECT DISTINCT `{$itemtable}`.*\n FROM `glpi_computers_items`\n LEFT JOIN `{$itemtable}`\n ON (`glpi_computers_items`.`items_id` = `{$itemtable}`.`id`)\n WHERE `glpi_computers_items`.`itemtype` = '{$itemtype}'\n AND " . str_replace("XXXX", "`glpi_computers_items`.`computers_id`", $search_computer);
if ($item->maybeDeleted()) {
$query .= " AND `{$itemtable}`.`is_deleted` = '0' ";
}
if ($item->maybeTemplate()) {
$query .= " AND `{$itemtable}`.`is_template` = '0' ";
}
$query .= getEntitiesRestrictRequest("AND", $itemtable, "", $entity_restrict) . "\n ORDER BY `{$itemtable}`.`name`";
$result = $DB->query($query);
if ($DB->numrows($result) > 0) {
$type_name = $item->getTypeName();
while ($data = $DB->fetch_assoc($result)) {
if (!in_array($data["id"], $already_add[$itemtype])) {
$output = $data["name"];
if (empty($output) || $_SESSION["glpiis_ids_visible"]) {
$output = sprintf(__('%1$s (%2$s)'), $output, $data['id']);
}
$output = sprintf(__('%1$s - %2$s'), $type_name, $output);
if ($itemtype != 'Software') {
$output = sprintf(__('%1$s - %2$s'), $output, $data['otherserial']);
}
$tmp_device .= "<option title=\"{$output}\" value='" . $itemtype . "_" . $data["id"] . "' " . ($my_item == $itemtype . "_" . $data["id"] ? "selected" : "") . ">" . Toolbox::substr($output, 0, $_SESSION["glpidropdown_chars_limit"]) . "</option>";
$already_add[$itemtype][] = $data["id"];
}
}
}
}
}
if (!empty($tmp_device)) {
$my_devices .= "<optgroup label=\"" . __s('Connected devices') . "\">" . $tmp_device . "</optgroup>";
}
// Software
if (in_array('Software', $_SESSION["glpiactiveprofile"]["helpdesk_item_type"])) {
$query = "SELECT DISTINCT `glpi_softwareversions`.`name` AS version,\n `glpi_softwares`.`name` AS name, `glpi_softwares`.`id`\n FROM `glpi_computers_softwareversions`, `glpi_softwares`,\n `glpi_softwareversions`\n WHERE `glpi_computers_softwareversions`.`softwareversions_id` =\n `glpi_softwareversions`.`id`\n AND `glpi_softwareversions`.`softwares_id` = `glpi_softwares`.`id`\n AND " . str_replace("XXXX", "`glpi_computers_softwareversions`.`computers_id`", $search_computer) . "\n AND `glpi_softwares`.`is_helpdesk_visible` = '1' " . getEntitiesRestrictRequest("AND", "glpi_softwares", "", $entity_restrict) . "\n ORDER BY `glpi_softwares`.`name`";
$result = $DB->query($query);
if ($DB->numrows($result) > 0) {
$tmp_device = "";
$item = new Software();
$type_name = $item->getTypeName();
if (!isset($already_add['Software'])) {
$already_add['Software'] = array();
}
while ($data = $DB->fetch_assoc($result)) {
if (!in_array($data["id"], $already_add['Software'])) {
$output = sprintf(__('%1$s - %2$s'), $type_name, $data["name"]);
$output = sprintf(__('%1$s (%2$s)'), $output, sprintf(__('%1$s: %2$s'), __('version'), $data["version"]));
if ($_SESSION["glpiis_ids_visible"]) {
$output = sprintf(__('%1$s (%2$s)'), $output, $data["id"]);
}
$tmp_device .= "<option title=\"{$output}\" value='Software_" . $data["id"] . "' " . ($my_item == 'Software' . "_" . $data["id"] ? "selected" : "") . ">" . Toolbox::substr($output, 0, $_SESSION["glpidropdown_chars_limit"]) . "</option>";
$already_add['Software'][] = $data["id"];
}
}
if (!empty($tmp_device)) {
$my_devices .= "<optgroup label=\"" . _sn('Installed software', 'Installed software', 2) . "\">";
$my_devices .= $tmp_device . "</optgroup>";
}
}
}
}
echo "<div id='tracking_my_devices'>";
echo "<select id='my_items' name='_my_items'>";
echo "<option value=''>--- ";
echo __('General') . " ---</option>{$my_devices}</select></div>";
// Auto update summary of active or just solved tickets
$params = array('my_items' => '__VALUE__');
Ajax::updateItemOnSelectEvent("my_items", "item_ticket_selection_information", $CFG_GLPI["root_doc"] . "/ajax/ticketiteminformation.php", $params);
}
}
示例4: showMassiveActions
/**
* Display massive actions
*
* @since 0.84 (before Search::displayMassiveActions)
*
* @param $itemtype string itemtype for massive actions
* @param $options array of parameters
* may contains :
* - num_displayed : integer number of displayed items. Permit to check suhosin limit. (default -1 not to check)
* - ontop : boolean true if displayed on top (default true)
* - fixed : boolean true if used with fixed table display (default true)
* - forcecreate : boolean force creation of modal window (default = false).
* Modal is automatically created when displayed the ontop item.
* If only a bottom one is displayed use it
* - check_itemtype : string alternate itemtype to check right if different from main itemtype (default empty)
* - check_items_id : integer ID of the alternate item used to check right / optional (default empty)
* - is_deleted : boolean is massive actions for deleted items ?
* - extraparams : string extra URL parameters to pass to massive actions (default empty)
* - specific_actions : array of specific actions (do not use standard one)
* - confirm : string of confirm message before massive action
*
* @return nothing
**/
static function showMassiveActions($itemtype, $options = array())
{
global $CFG_GLPI;
$p['ontop'] = true;
$p['num_displayed'] = -1;
$p['fixed'] = true;
$p['forcecreate'] = false;
$p['check_itemtype'] = '';
$p['check_items_id'] = '';
$p['is_deleted'] = false;
$p['extraparams'] = array();
$p['width'] = 800;
$p['height'] = 400;
$p['specific_actions'] = array();
$p['confirm'] = '';
$p['rand'] = '';
foreach ($options as $key => $val) {
if (isset($p[$key])) {
$p[$key] = $val;
}
}
$p['extraparams']['itemtype'] = $itemtype;
$url = $CFG_GLPI['root_doc'] . "/ajax/massiveaction.php";
if ($p['is_deleted']) {
$p['extraparams']['is_deleted'] = 1;
}
if (!empty($p['check_itemtype'])) {
$p['extraparams']['check_itemtype'] = $p['check_itemtype'];
}
if (!empty($p['check_items_id'])) {
$p['extraparams']['check_items_id'] = $p['check_items_id'];
}
if (is_array($p['specific_actions']) && count($p['specific_actions'])) {
$p['extraparams']['specific_actions'] = $p['specific_actions'];
}
if ($p['fixed']) {
$width = '950px';
} else {
$width = '80%';
}
$identifier = md5($url . $itemtype . serialize($p['extraparams']) . $p['rand']);
$max = Toolbox::get_max_input_vars();
if ($p['num_displayed'] >= 0 && $max > 0 && $max < $p['num_displayed'] + 10) {
if (!$p['ontop'] || isset($p['forcecreate']) && $p['forcecreate']) {
echo "<table class='tab_cadre' width='{$width}'><tr class='tab_bg_1'>" . "<td><span class='b'>";
echo __('Selection too large, massive action disabled.') . "</span>";
if ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE) {
echo "<br>" . __('To increase the limit: change max_input_vars or suhosin.post.max_vars in php configuration.');
}
echo "</td></tr></table>";
}
} else {
// Create Modal window on top
if ($p['ontop'] || isset($p['forcecreate']) && $p['forcecreate']) {
echo "<div id='massiveactioncontent{$identifier}'></div>";
// echo "<script type='text/javascript' >\n";
// echo "Ext.DomHelper.append(document.body, {tag: 'div', id: 'massiveactioncontent$identifier'});";
// echo "</script>";
Ajax::createModalWindow('massiveaction_window' . $identifier, $url, array('title' => _n('Action', 'Actions', 2), 'container' => 'massiveactioncontent' . $identifier, 'extraparams' => $p['extraparams'], 'width' => $p['width'], 'height' => $p['height']));
}
echo "<table class='tab_glpi' width='{$width}'><tr>";
echo "<td width='30px'><img src='" . $CFG_GLPI["root_doc"] . "/pics/arrow-left" . ($p['ontop'] ? '-top' : '') . ".png' alt=''></td>";
echo "<td width='100%' class='left'>";
echo "<a class='vsubmit' ";
if (is_array($p['confirm'] || strlen($p['confirm']))) {
echo self::addConfirmationOnAction($p['confirm'], "massiveaction_window{$identifier}.show();");
} else {
echo "onclick='massiveaction_window{$identifier}.show();'";
}
echo "href='#modal_massaction_content{$identifier}' title=\"" . _sn('Action', 'Actions', 2) . "\">";
echo _n('Action', 'Actions', 2) . "</a>";
echo "</td>";
echo "</tr></table>";
if (!$p['ontop'] || isset($p['forcecreate']) && $p['forcecreate']) {
// Clean selection
$_SESSION['glpimassiveactionselected'][$itemtype] = array();
}
//.........这里部分代码省略.........
示例5: _sn
}
// Why this test ?? For me it's doing nothing
if (isset($_GET["dropdown"])) {
$_GET["dropdown"] = $_GET["dropdown"];
}
if (empty($_GET["dropdown"])) {
$_GET["dropdown"] = "ComputerType";
}
if (!isset($_GET['itemtype'])) {
$_GET['itemtype'] = 'Ticket';
}
Stat::title();
echo "<form method='get' name='form' action='stat.location.php'>";
echo "<table class='tab_cadre'><tr class='tab_bg_2'><td rowspan='2'>";
echo "<select name='dropdown'>";
echo "<optgroup label=\"" . _sn('Dropdown', 'Dropdowns', 2) . "\">";
echo "<option value='ComputerType' " . ($_GET["dropdown"] == "ComputerType" ? "selected" : "") . ">" . __('Type') . "</option>";
echo "<option value='ComputerModel' " . ($_GET["dropdown"] == "ComputerModel" ? "selected" : "") . ">" . __('Model') . "</option>";
echo "<option value='OperatingSystem' " . ($_GET["dropdown"] == "OperatingSystem" ? "selected" : "") . ">" . __('Operating system') . "</option>";
echo "<option value='Location' " . ($_GET["dropdown"] == "Location" ? "selected" : "") . ">" . __('Location') . "</option>";
echo "</optgroup>";
$devices = Dropdown::getDeviceItemTypes();
foreach ($devices as $label => $dp) {
echo "<optgroup label=\"{$label}\">";
foreach ($dp as $i => $name) {
echo "<option value='{$i}' " . ($_GET["dropdown"] == $i ? "selected" : "") . ">{$name}</option>";
}
echo "</optgroup>";
}
echo "</select></td>";
echo "<td class='right'>" . __('Start date') . "</td><td>";
示例6: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
global $LANG;
if ($item->getType() == 'Profile') {
return _sn('SIM card', 'SIM cards', 2, 'simcard');
}
return '';
}
示例7: plugin_simcard_getAddSearchOptions
function plugin_simcard_getAddSearchOptions($itemtype)
{
global $LANG;
$sopt = array();
$reservedTypeIndex = PluginSimcardConfig::RESERVED_TYPE_RANGE_MIN;
if (in_array($itemtype, PluginSimcardSimcard_Item::getClasses())) {
if (PluginSimcardSimcard::canView()) {
$sopt[$reservedTypeIndex]['table'] = 'glpi_plugin_simcard_simcards';
$sopt[$reservedTypeIndex]['field'] = 'name';
$sopt[$reservedTypeIndex]['name'] = _sn('SIM card', 'SIM cards', 2, 'simcard') . " - " . __s('Name');
$sopt[$reservedTypeIndex]['forcegroupby'] = true;
$sopt[$reservedTypeIndex]['massiveaction'] = false;
$sopt[$reservedTypeIndex]['datatype'] = 'itemlink';
$sopt[$reservedTypeIndex]['itemlink_type'] = 'PluginSimcardSimcard';
$sopt[$reservedTypeIndex]['joinparams'] = array('beforejoin' => array('table' => 'glpi_plugin_simcard_simcards_items', 'joinparams' => array('jointype' => 'itemtype_item')));
$reservedTypeIndex++;
$sopt[$reservedTypeIndex]['table'] = 'glpi_plugin_simcard_simcards';
$sopt[$reservedTypeIndex]['field'] = 'phonenumber';
$sopt[$reservedTypeIndex]['name'] = _sn('SIM card', 'SIM cards', 2, 'simcard') . " - " . __s('Phone number', 'simcard');
$sopt[$reservedTypeIndex]['massiveaction'] = false;
$sopt[$reservedTypeIndex]['forcegroupby'] = true;
$sopt[$reservedTypeIndex]['joinparams'] = array('beforejoin' => array('table' => 'glpi_plugin_simcard_simcards_items', 'joinparams' => array('jointype' => 'itemtype_item')));
$reservedTypeIndex++;
$sopt[$reservedTypeIndex]['table'] = 'glpi_plugin_simcard_simcards';
$sopt[$reservedTypeIndex]['field'] = 'serial';
$sopt[$reservedTypeIndex]['name'] = _sn('SIM card', 'SIM cards', 2, 'simcard') . " - " . __s('IMSI', 'simcard');
$sopt[$reservedTypeIndex]['massiveaction'] = false;
$sopt[$reservedTypeIndex]['forcegroupby'] = true;
$sopt[$reservedTypeIndex]['joinparams'] = array('beforejoin' => array('table' => 'glpi_plugin_simcard_simcards_items', 'joinparams' => array('jointype' => 'itemtype_item')));
}
}
return $sopt;
}
示例8: getAdditionalMenuLinks
/**
* @see CommonGLPI::getAdditionalMenuLinks()
**/
static function getAdditionalMenuLinks()
{
global $CFG_GLPI;
$links = array();
if (static::canView() || Session::haveRight('projecttask', ProjectTask::READMY)) {
$pic_validate = "<img title=\"" . _sn('Task', 'Tasks', 2) . "\" alt=\"" . _sn('Task', 'Tasks', 2) . "\" src='" . $CFG_GLPI["root_doc"] . "/pics/menu_showall.png' class='pointer'>";
$links[$pic_validate] = '/front/projecttask.php';
$links['summary'] = '/front/project.form.php?showglobalgantt=1';
}
if (count($links)) {
return $links;
}
return false;
}
示例9: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
global $LANG;
if (in_array(get_class($item), PluginSimcardSimcard_Item::getClasses()) || get_class($item) == 'Profile') {
return array(1 => _sn('SIM card', 'SIM cards', 2, 'simcard'));
} elseif (get_class($item) == __CLASS__) {
return _sn('SIM card', 'SIM cards', 2, 'simcard');
}
return '';
}
示例10: getTabNameForItem
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0)
{
global $LANG;
if (in_array(get_class($item), PluginSimcardSimcard_Item::getClasses())) {
return array(1 => _sn('SIM card', 'SIM cards', 2, 'simcard'));
} elseif (get_class($item) == 'PluginSimcardSimcard') {
return _n('Associated item', 'Associated items', 2);
return _n('connect');
}
return '';
}