当前位置: 首页>>代码示例>>PHP>>正文


PHP Search::showItem方法代码示例

本文整理汇总了PHP中Search::showItem方法的典型用法代码示例。如果您正苦于以下问题:PHP Search::showItem方法的具体用法?PHP Search::showItem怎么用?PHP Search::showItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Search的用法示例。


在下文中一共展示了Search::showItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: showMinimalList


//.........这里部分代码省略.........
     }
     $query .= $ORDER;
     // Get it from database
     if ($result = $DB->query($query)) {
         $numrows = $DB->numrows($result);
         $globallinkto = Search::getArrayUrlLink("field", $p['field']) . Search::getArrayUrlLink("link", $p['link']) . Search::getArrayUrlLink("contains", $p['contains']) . Search::getArrayUrlLink("field2", $p['field2']) . Search::getArrayUrlLink("contains2", $p['contains2']) . Search::getArrayUrlLink("itemtype2", $p['itemtype2']) . Search::getArrayUrlLink("link2", $p['link2']);
         $parameters = "sort=" . $p['sort'] . "&order=" . $p['order'] . $globallinkto;
         if ($output_type == Search::GLOBAL_SEARCH) {
             if (class_exists($itemtype)) {
                 echo "<div class='center'><h2>" . $this->getTypeName();
                 // More items
                 if ($numrows > $p['start'] + Search::GLOBAL_DISPLAY_COUNT) {
                     echo " <a href='{$target}?{$parameters}'>" . __('All') . "</a>";
                 }
                 echo "</h2></div>\n";
             } else {
                 return false;
             }
         }
         if ($p['start'] < $numrows) {
             // Pager
             if ($output_type == Search::HTML_OUTPUT) {
                 Html::printPager($p['start'], $numrows, $target, $parameters, $itemtype);
             }
             //massive action
             $sel = "";
             if (isset($_GET["select"]) && $_GET["select"] == "all") {
                 $sel = "checked";
             }
             // Add toview elements
             $nbcols = $toview_count;
             if ($output_type == Search::HTML_OUTPUT) {
                 // HTML display - massive modif
                 $nbcols++;
             }
             // Define begin and end var for loop
             // Search case
             $begin_display = $p['start'];
             $end_display = $p['start'] + $LIST_LIMIT;
             // Export All case
             if ($p['export_all']) {
                 $begin_display = 0;
                 $end_display = $numrows;
             }
             // Display List Header
             echo Search::showHeader($output_type, $end_display - $begin_display + 1, $nbcols);
             $header_num = 1;
             // Display column Headers for toview items
             echo Search::showNewLine($output_type);
             // Display column Headers for toview items
             foreach ($toview as $key => $val) {
                 $linkto = '';
                 if (!isset($searchopt[$itemtype][$val]['nosort']) || !$searchopt[$itemtype][$val]['nosort']) {
                     $linkto = "{$target}?itemtype={$itemtype}&amp;sort=" . $val . "&amp;order=" . ($p['order'] == "ASC" ? "DESC" : "ASC") . "&amp;start=" . $p['start'] . $globallinkto;
                 }
                 echo Search::showHeaderItem($output_type, $searchopt[$itemtype][$val]["name"], $header_num, $linkto, $p['sort'] == $val, $p['order']);
             }
             // End Line for column headers
             echo Search::showEndLine($output_type);
             $DB->data_seek($result, $p['start']);
             // Define begin and end var for loop
             // Search case
             $i = $begin_display;
             // Init list of items displayed
             if ($output_type == Search::HTML_OUTPUT) {
                 Session::initNavigateListItems($itemtype);
             }
             // Num of the row (1=header_line)
             $row_num = 1;
             // Display Loop
             while ($i < $numrows && $i < $end_display) {
                 $item_num = 1;
                 $data = $DB->fetch_array($result);
                 $i++;
                 $row_num++;
                 echo Search::showNewLine($output_type, $i % 2);
                 Session::addToNavigateListItems($itemtype, $data['id']);
                 foreach ($toview as $key => $val) {
                     echo Search::showItem($output_type, Search::giveItem($itemtype, $val, $data, $key), $item_num, $row_num, Search::displayConfigItem($itemtype, $val, $data, $key));
                 }
                 echo Search::showEndLine($output_type);
             }
             // Close Table
             $title = "";
             // Create title
             if ($output_type == Search::PDF_OUTPUT_PORTRAIT || $output_type == Search::PDF_OUTPUT_LANDSCAPE) {
                 $title .= __('List of non contract periods', 'resources');
             }
             // Display footer
             echo Search::showFooter($output_type, $title);
             // Pager
             if ($output_type == Search::HTML_OUTPUT) {
                 echo "<br>";
                 Html::printPager($p['start'], $numrows, $target, $parameters);
             }
         } else {
             echo Search::showError($output_type);
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:resourceresting.class.php

示例2: showDocItem

 function showDocItem($output_type, $item_num, $row_num, $documents_id = null)
 {
     $doc = new document();
     if ($doc->getFromDB($documents_id)) {
         return Search::showItem($output_type, $doc->getDownloadLink(), $item_num, $row_num);
     }
     return Search::showItem($output_type, "", $item_num, $row_num);
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:8,代码来源:manufacturer.class.php

示例3: showAccountsList

 public static function showAccountsList($values, $list)
 {
     global $CFG_GLPI;
     $ID = $values["id"];
     $aeskey = $values["aeskey"];
     $PluginAccountsHash = new PluginAccountsHash();
     $PluginAccountsHash->getFromDB($ID);
     $hash = $PluginAccountsHash->fields["hash"];
     $default_values["start"] = $start = 0;
     $default_values["id"] = $id = 0;
     $default_values["export"] = $export = false;
     foreach ($default_values as $key => $val) {
         if (isset($values[$key])) {
             ${$key} = $values[$key];
         }
     }
     // Set display type for export if define
     $output_type = Search::HTML_OUTPUT;
     if (isset($values["display_type"])) {
         $output_type = $values["display_type"];
     }
     $header_num = 1;
     $nbcols = 4;
     $row_num = 1;
     $numrows = 1;
     $parameters = "id=" . $ID . "&amp;aeskey=" . $aeskey;
     if ($output_type == Search::HTML_OUTPUT && !empty($list)) {
         self::printPager($start, $numrows, $_SERVER['PHP_SELF'], $parameters, "PluginAccountsReport");
     }
     echo Search::showHeader($output_type, 1, $nbcols, 1);
     echo Search::showNewLine($output_type);
     echo Search::showHeaderItem($output_type, __('Name'), $header_num);
     if (Session::isMultiEntitiesMode()) {
         echo Search::showHeaderItem($output_type, __('Entity'), $header_num);
     }
     echo Search::showHeaderItem($output_type, __('Type'), $header_num);
     echo Search::showHeaderItem($output_type, __('Login'), $header_num);
     echo Search::showHeaderItem($output_type, __('Uncrypted password', 'accounts'), $header_num);
     echo Search::showEndLine($output_type);
     if (!empty($list)) {
         foreach ($list as $user => $field) {
             $row_num++;
             $item_num = 1;
             echo Search::showNewLine($output_type);
             $IDc = $field["id"];
             if ($output_type == Search::HTML_OUTPUT) {
                 echo "<input type='hidden' name='hash_id' value='" . $ID . "'>";
                 echo "<input type='hidden' name='id[{$IDc}]' value='" . $IDc . "'>";
             }
             $name = "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/accounts/front/account.form.php?id=" . $IDc . "'>" . $field["name"];
             if ($_SESSION["glpiis_ids_visible"]) {
                 $name .= " (" . $IDc . ")";
             }
             $name .= "</a>";
             echo Search::showItem($output_type, $name, $item_num, $row_num);
             if ($output_type == Search::HTML_OUTPUT) {
                 echo "<input type='hidden' name='name[{$IDc}]' value='" . $field["name"] . "'>";
             }
             if (Session::isMultiEntitiesMode()) {
                 echo Search::showItem($output_type, $field['entities_id'], $item_num, $row_num);
                 if ($output_type == Search::HTML_OUTPUT) {
                     echo "<input type='hidden' name='entities_id[{$IDc}]' value='" . $field["entities_id"] . "'>";
                 }
             }
             echo Search::showItem($output_type, $field["type"], $item_num, $row_num);
             if ($output_type == Search::HTML_OUTPUT) {
                 echo "<input type='hidden' name='type[{$IDc}]' value='" . $field["type"] . "'>";
             }
             echo Search::showItem($output_type, $field["login"], $item_num, $row_num);
             if ($output_type == Search::HTML_OUTPUT) {
                 echo "<input type='hidden' name='login[{$IDc}]' value='" . $field["login"] . "'>";
             }
             if ($output_type == Search::HTML_OUTPUT) {
                 $encrypted = $field["password"];
                 echo "<input type='hidden' name='password[{$IDc}]'>";
                 $pass = "<p name='show_password' id='show_password\${$IDc}'></p>";
                 $pass .= "<script language='javascript'>\n               var good_hash=\"{$hash}\";\n               var hash=SHA256(SHA256(\"{$aeskey}\"));\n               if (hash != good_hash) {\n               pass = \"" . __('Wrong encryption key', 'accounts') . "\";\n            } else {\n            pass = AESDecryptCtr(\"{$encrypted}\",SHA256(\"{$aeskey}\"), 256);\n            };\n\n            document.getElementsByName(\"password[{$IDc}]\").item(0).value = pass;\n\n            document.getElementById(\"show_password\${$IDc}\").innerHTML = pass;\n            </script>";
                 echo Search::showItem($output_type, $pass, $item_num, $row_num);
             } else {
                 echo Search::showItem($output_type, $field["password"], $item_num, $row_num);
             }
             echo Search::showEndLine($output_type);
         }
     }
     if ($output_type == Search::HTML_OUTPUT) {
         Html::closeForm();
     }
     // Display footer
     echo Search::showFooter($output_type, __('Linked accounts list', 'accounts'));
 }
开发者ID:puchadesc,项目名称:accounts,代码行数:90,代码来源:report.class.php

示例4: showHardware

 /**
  * show  hardware to be identified, or identified and imported, or just the hardware with agents installed on them
  * @param type $hardware array
  * @param type $lim integer
  * @param int|type $start integer
  * @param type $ipAdress string
  * @param type $status string
  * @param $subnet
  * @param $action
  * @global type $CFG_GLPI
  */
 static function showHardware($hardware, $lim, $start = 0, $ipAdress, $status, $subnet, $action)
 {
     global $CFG_GLPI, $DB;
     $output_type = Search::HTML_OUTPUT;
     //0
     $link = $CFG_GLPI['root_doc'] . "/plugins/ocsinventoryng/front/ipdiscover.import.php";
     $return = $CFG_GLPI['root_doc'] . "/plugins/ocsinventoryng/front/ipdiscover.php";
     $returnargs = "subnetsChoice={$subnet}&action={$action}";
     $reload = "ip={$ipAdress}&status={$status}&action={$action}";
     $backValues = "?b[]={$ipAdress}&b[]={$status}";
     if ($status == "inventoried") {
         $status_name = __('Inventoried', 'ocsinventoryng');
     } elseif ($status == "imported") {
         $status_name = __('Imported / Linked', 'ocsinventoryng');
     } elseif ($status == "noninventoried") {
         $status_name = __('Non Inventoried', 'ocsinventoryng');
     } else {
         $status_name = __('Identified', 'ocsinventoryng');
     }
     $subnet_name = self::getSubnetNamebyIP($ipAdress);
     echo "<div class='center'>";
     echo "<h2>" . __('Subnet', 'ocsinventoryng') . " " . $subnet_name . " (" . $ipAdress . ") - " . $status_name;
     echo "&nbsp;";
     $refresh = $CFG_GLPI['root_doc'] . "/plugins/ocsinventoryng/front/ipdiscover.import.php?" . $reload;
     Html::showSimpleForm($refresh, 'refresh', _sx('button', 'Refresh'), array(), $CFG_GLPI["root_doc"] . "/plugins/ocsinventoryng/pics/synchro.png");
     echo "</h2>";
     echo "</div>";
     if ($subnet >= 0) {
         $back = __('Back');
         echo "<div class='center'><a href='{$return}?{$returnargs}'>{$back}</div>";
     }
     echo Html::printPager($start, count($hardware), $link, $reload);
     echo Search::showNewLine($output_type, true);
     if (empty($hardware)) {
         echo "<div class='center b'><br>" . __('No new IPDiscover device to import', 'ocsinventoryng') . "</div>";
         Html::displayBackLink();
     } else {
         $header_num = 1;
         switch ($status) {
             case "inventoried":
                 echo "<table width='100%'class='tab_cadrehov'>\n";
                 echo Search::showHeaderItem($output_type, __('User'), $header_num);
                 echo Search::showHeaderItem($output_type, __('Name'), $header_num);
                 echo Search::showHeaderItem($output_type, __('System'), $header_num);
                 echo Search::showHeaderItem($output_type, __('Version of the operating system'), $header_num);
                 echo Search::showHeaderItem($output_type, __('IP address'), $header_num);
                 echo Search::showHeaderItem($output_type, __('Last OCSNG inventory date', 'ocsinventoryng'), $header_num);
                 echo Search::showEndLine($output_type);
                 $row_num = 1;
                 for ($i = $start; $i < $lim + $start; $i++) {
                     if (isset($hardware[$i])) {
                         $row_num++;
                         $item_num = 1;
                         echo Search::showNewLine($output_type, $row_num % 2);
                         echo Search::showItem($output_type, $hardware[$i]["userid"], $item_num, $row_num);
                         echo Search::showItem($output_type, $hardware[$i]["name"], $item_num, $row_num);
                         echo Search::showItem($output_type, $hardware[$i]["osname"], $item_num, $row_num);
                         echo Search::showItem($output_type, $hardware[$i]["osversion"], $item_num, $row_num);
                         echo Search::showItem($output_type, $hardware[$i]["ipaddr"], $item_num, $row_num);
                         echo Search::showItem($output_type, Html::convDateTime($hardware[$i]["lastdate"]), $item_num, $row_num);
                         echo Search::showEndLine($output_type);
                     }
                 }
                 echo "</table>\n";
                 break;
             case "imported":
                 $target = $CFG_GLPI['root_doc'] . "/plugins/ocsinventoryng/front/ipdiscover.import.php" . $backValues;
                 self::checkBox($target);
                 echo "<form method='post' id='ipdiscover_form' name='ipdiscover_form' action='{$target}'>";
                 echo "<div class='center' style=\"width=100%\">";
                 echo "<input type='submit' class='submit' name='deletelink'  value=\"" . _sx('button', 'Delete link', 'ocsinventoryng') . "\"></div>";
                 echo "<table width='100%'class='tab_cadrehov'>\n";
                 echo Search::showHeaderItem($output_type, __('Item'), $header_num);
                 echo Search::showHeaderItem($output_type, __('Item type'), $header_num);
                 echo Search::showHeaderItem($output_type, __('MAC address'), $header_num);
                 echo Search::showHeaderItem($output_type, __('IP address'), $header_num);
                 echo Search::showHeaderItem($output_type, __('Location'), $header_num);
                 echo Search::showHeaderItem($output_type, __('Import date in GLPI', 'ocsinventoryng'), $header_num);
                 echo Search::showHeaderItem($output_type, __('Subnet'), $header_num);
                 echo Search::showHeaderItem($output_type, __('&nbsp;'), $header_num);
                 echo Search::showEndLine($output_type);
                 $row_num = 1;
                 for ($i = $start; $i < $lim + $start; $i++) {
                     if (isset($hardware[$i])) {
                         $row_num++;
                         $item_num = 1;
                         echo Search::showNewLine($output_type, $row_num % 2);
                         $class = getItemForItemtype($hardware[$i]["itemtype"]);
                         $class->getFromDB($hardware[$i]["items_id"]);
//.........这里部分代码省略.........
开发者ID:pluginsGLPI,项目名称:ocsinventoryng,代码行数:101,代码来源:ipdiscoverocslink.class.php

示例5: showHierarchy

 static function showHierarchy($ID, $parents = 0)
 {
     global $DB, $CFG_GLPI;
     $first = false;
     $projet = new PluginProjetTask();
     $query = "SELECT `glpi_plugin_projet_tasks`.*  ";
     if ($parents != 0) {
         $parent = "plugin_projet_tasks_id_1";
         $child = "plugin_projet_tasks_id_2";
     } else {
         $parent = "plugin_projet_tasks_id_2";
         $child = "plugin_projet_tasks_id_1";
     }
     $query .= " FROM `glpi_plugin_projet_tasks`";
     $query .= " LEFT JOIN `glpi_plugin_projet_tasks_tasks` \n                  ON (`glpi_plugin_projet_tasks_tasks`.`{$child}` = `glpi_plugin_projet_tasks`.`id`)";
     $query .= " WHERE `glpi_plugin_projet_tasks_tasks`.`{$parent}` = '{$ID}' ";
     if ($projet->maybeTemplate()) {
         $LINK = " AND ";
         if ($first) {
             $LINK = " ";
             $first = false;
         }
         $query .= $LINK . "`glpi_plugin_projet_tasks`.`is_template` = '0' ";
     }
     // Add is_deleted if item have it
     if ($projet->maybeDeleted()) {
         $LINK = " AND ";
         if ($first) {
             $LINK = " ";
             $first = false;
         }
         $query .= $LINK . "`glpi_plugin_projet_tasks`.`is_deleted` = '0' ";
     }
     $LINK = " AND ";
     $query .= getEntitiesRestrictRequest(" AND ", "glpi_plugin_projet_tasks", '', '', $projet->maybeRecursive());
     $query .= " ORDER BY `glpi_plugin_projet_tasks`.`name`";
     $result = $DB->query($query);
     $number = $DB->numrows($result);
     $i = 0;
     if (Session::isMultiEntitiesMode()) {
         $colsup = 1;
     } else {
         $colsup = 0;
     }
     if ($number != "0") {
         echo "<div align='center'><table class='tab_cadre_fixe'>";
         $title = _n('Child task', 'Child tasks', 2, 'projet');
         if ($parents != 0) {
             $title = __('Parent task', 'projet');
         }
         echo "<tr><th colspan='" . (7 + $colsup) . "'>" . $title . "</th></tr>";
         echo "<tr><th>" . __('Name') . "</th>";
         if (Session::isMultiEntitiesMode()) {
             echo "<th>" . __('Entity') . "</th>";
         }
         echo "<th>" . __('Progress') . "</th>";
         echo "<th>" . _n('User', 'Users', 1) . "</th>";
         echo "<th>" . _n('Group', 'Groups', 1) . "</th>";
         echo "<th>" . __('State') . "</th>";
         echo "</tr>";
         while ($data = $DB->fetch_array($result)) {
             $start = 0;
             $output_type = Search::HTML_OUTPUT;
             $del = false;
             if ($data["is_deleted"] == '0') {
                 echo "<tr class='tab_bg_1'>";
             } else {
                 echo "<tr class='tab_bg_1" . ($data["is_deleted"] == '1' ? "_2" : "") . "'>";
             }
             echo Search::showItem($output_type, "<a href=\"./task.form.php?id=" . $data["id"] . "\">" . $data["name"] . ($_SESSION["glpiis_ids_visible"] || empty($data["name"]) ? ' (' . $data["id"] . ') ' : '') . "</a>", $item_num, $i - $start + 1, '');
             if (Session::isMultiEntitiesMode()) {
                 echo "<td class='center'>" . Dropdown::getDropdownName("glpi_entities", $data['entities_id']) . "</td>";
             }
             echo Search::showItem($output_type, PluginProjetProjet::displayProgressBar('100', $data["advance"], array("simple" => true)), $item_num, $i - $start + 1, "align='center'");
             echo Search::showItem($output_type, getUserName($data['users_id']), $item_num, $i - $start + 1, '');
             echo Search::showItem($output_type, Dropdown::getDropdownName("glpi_groups", $data['groups_id']), $item_num, $i - $start + 1, '');
             echo Search::showItem($output_type, Dropdown::getDropdownName("glpi_plugin_projet_taskstates", $data['plugin_projet_taskstates_id']), $item_num, $i - $start + 1, "bgcolor='" . PluginProjetTaskState::getStatusColor($data['plugin_projet_taskstates_id']) . "' align='center'");
             echo "</tr>";
         }
         echo "</table></div>";
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:82,代码来源:task_task.class.php

示例6: showShort

 /**
  * Display a line for an object
  *
  * @since version 0.85 (befor in each object with differents parameters)
  *
  * @param $id                 Integer  ID of the object
  * @param $options            array    of options
  *      output_type            : Default output type (see Search class / default Search::HTML_OUTPUT)
  *      row_num                : row num used for display
  *      type_for_massiveaction : itemtype for massive action
  *      id_for_massaction      : default 0 means no massive action
  *      followups              : only for Tickets : show followup columns
  */
 static function showShort($id, $options = array())
 {
     global $CFG_GLPI, $DB;
     $p['output_type'] = Search::HTML_OUTPUT;
     $p['row_num'] = 0;
     $p['type_for_massiveaction'] = 0;
     $p['id_for_massiveaction'] = 0;
     if (count($options)) {
         foreach ($options as $key => $val) {
             $p[$key] = $val;
         }
     }
     $rand = mt_rand();
     // Prints a job in short form
     // Should be called in a <table>-segment
     // Print links or not in case of user view
     // Make new job object and fill it from database, if success, print it
     $item = new static();
     $candelete = static::canDelete();
     $canupdate = Session::haveRight(static::$rightname, UPDATE);
     $align = "class='center";
     $align_desc = "class='left";
     $align .= "'";
     $align_desc .= "'";
     if ($item->getFromDB($id)) {
         $item_num = 1;
         $bgcolor = $_SESSION["glpipriority_" . $item->fields["priority"]];
         echo Search::showNewLine($p['output_type'], $p['row_num'] % 2);
         $check_col = '';
         if (($candelete || $canupdate) && $p['output_type'] == Search::HTML_OUTPUT && $p['id_for_massiveaction']) {
             $check_col = Html::getMassiveActionCheckBox($p['type_for_massiveaction'], $p['id_for_massiveaction']);
         }
         echo Search::showItem($p['output_type'], $check_col, $item_num, $p['row_num'], $align);
         $id_col = $item->fields["id"];
         echo Search::showItem($p['output_type'], $id_col, $item_num, $p['row_num'], $align);
         // First column
         $first_col = '';
         $color = '';
         if ($item->fields["projectstates_id"]) {
             $query = "SELECT `color`\n                      FROM `glpi_projectstates`\n                      WHERE `id` = '" . $item->fields["projectstates_id"] . "'";
             foreach ($DB->request($query) as $color) {
                 $color = $color['color'];
             }
             $first_col = Dropdown::getDropdownName('glpi_projectstates', $item->fields["projectstates_id"]);
         }
         echo Search::showItem($p['output_type'], $first_col, $item_num, $p['row_num'], "{$align} bgcolor='{$color}'");
         // Second column
         $second_col = sprintf(__('Opened on %s'), ($p['output_type'] == Search::HTML_OUTPUT ? '<br>' : '') . Html::convDateTime($item->fields['date']));
         echo Search::showItem($p['output_type'], $second_col, $item_num, $p['row_num'], $align . " width=130");
         // Second BIS column
         $second_col = Html::convDateTime($item->fields["date_mod"]);
         echo Search::showItem($p['output_type'], $second_col, $item_num, $p['row_num'], $align . " width=90");
         // Second TER column
         if (count($_SESSION["glpiactiveentities"]) > 1) {
             $second_col = Dropdown::getDropdownName('glpi_entities', $item->fields['entities_id']);
             echo Search::showItem($p['output_type'], $second_col, $item_num, $p['row_num'], $align . " width=100");
         }
         // Third Column
         echo Search::showItem($p['output_type'], "<span class='b'>" . CommonITILObject::getPriorityName($item->fields["priority"]) . "</span>", $item_num, $p['row_num'], "{$align} bgcolor='{$bgcolor}'");
         // Fourth Column
         $fourth_col = "";
         if ($item->fields["users_id"]) {
             $userdata = getUserName($item->fields["users_id"], 2);
             $fourth_col .= sprintf(__('%1$s %2$s'), "<span class='b'>" . $userdata['name'] . "</span>", Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false)));
         }
         echo Search::showItem($p['output_type'], $fourth_col, $item_num, $p['row_num'], $align);
         // Fifth column
         $fifth_col = "";
         if ($item->fields["groups_id"]) {
             $fifth_col .= Dropdown::getDropdownName("glpi_groups", $item->fields["groups_id"]);
             $fifth_col .= "<br>";
         }
         echo Search::showItem($p['output_type'], $fifth_col, $item_num, $p['row_num'], $align);
         // Eigth column
         $eigth_column = "<span class='b'>" . $item->fields["name"] . "</span>&nbsp;";
         // Add link
         if ($item->canViewItem()) {
             $eigth_column = "<a id='" . $item->getType() . $item->fields["id"] . "{$rand}' href=\"" . $item->getLinkURL() . "&amp;forcetab=Project\$\">{$eigth_column}</a>";
         }
         if ($p['output_type'] == Search::HTML_OUTPUT) {
             $eigth_column = sprintf(__('%1$s %2$s'), $eigth_column, Html::showToolTip($item->fields['content'], array('display' => false, 'applyto' => $item->getType() . $item->fields["id"] . $rand)));
         }
         echo Search::showItem($p['output_type'], $eigth_column, $item_num, $p['row_num'], $align_desc . "width='200'");
         // Finish Line
         echo Search::showEndLine($p['output_type']);
     } else {
         echo "<tr class='tab_bg_2'>";
//.........这里部分代码省略.........
开发者ID:glpi-project,项目名称:glpi,代码行数:101,代码来源:project.class.php

示例7: showShort

 /**
  * Display a line for a ticket
  *
  * @param $id                 Integer  ID of the ticket
  * @param $followups          Boolean  show followup columns
  * @param $output_type        Integer  type of output (default Search::HTML_OUTPUT)
  * @param $row_num            Integer  row number (default 0)
  * @param $id_for_massaction  Integer  default 0 means no massive action (default 0)
  *
  */
 static function showShort($id, $followups, $output_type = Search::HTML_OUTPUT, $row_num = 0, $id_for_massaction = 0)
 {
     global $CFG_GLPI;
     $rand = mt_rand();
     /// TODO to be cleaned. Get datas and clean display links
     // Prints a job in short form
     // Should be called in a <table>-segment
     // Print links or not in case of user view
     // Make new job object and fill it from database, if success, print it
     $job = new self();
     $candelete = Session::haveRight("delete_ticket", "1");
     $canupdate = Session::haveRight("update_ticket", "1");
     $showprivate = Session::haveRight("show_full_ticket", "1");
     $align = "class='center";
     $align_desc = "class='left";
     if ($followups) {
         $align .= " top'";
         $align_desc .= " top'";
     } else {
         $align .= "'";
         $align_desc .= "'";
     }
     if ($job->getFromDB($id)) {
         $item_num = 1;
         $bgcolor = $_SESSION["glpipriority_" . $job->fields["priority"]];
         echo Search::showNewLine($output_type, $row_num % 2);
         $check_col = '';
         if (($candelete || $canupdate) && $output_type == Search::HTML_OUTPUT && $id_for_massaction) {
             $check_col = Html::getMassiveActionCheckBox(__CLASS__, $id_for_massaction);
         }
         echo Search::showItem($output_type, $check_col, $item_num, $row_num, $align);
         // First column
         $first_col = sprintf(__('%1$s: %2$s'), __('ID'), $job->fields["id"]);
         if ($output_type == Search::HTML_OUTPUT) {
             $first_col .= "<br><img src='" . self::getStatusIconURL($job->fields["status"]) . "'\n                                alt=\"" . self::getStatus($job->fields["status"]) . "\" title=\"" . self::getStatus($job->fields["status"]) . "\">";
         } else {
             $first_col = sprintf(__('%1$s - %2$s'), $first_col, self::getStatus($job->fields["status"]));
         }
         echo Search::showItem($output_type, $first_col, $item_num, $row_num, $align);
         // Second column
         if ($job->fields['status'] == self::CLOSED) {
             $second_col = sprintf(__('Closed on %s'), ($output_type == Search::HTML_OUTPUT ? '<br>' : '') . Html::convDateTime($job->fields['closedate']));
         } else {
             if ($job->fields['status'] == self::SOLVED) {
                 $second_col = sprintf(__('Solved on %s'), ($output_type == Search::HTML_OUTPUT ? '<br>' : '') . Html::convDateTime($job->fields['solvedate']));
             } else {
                 if ($job->fields['begin_waiting_date']) {
                     $second_col = sprintf(__('Put on hold on %s'), ($output_type == Search::HTML_OUTPUT ? '<br>' : '') . Html::convDateTime($job->fields['begin_waiting_date']));
                 } else {
                     if ($job->fields['due_date']) {
                         $second_col = sprintf(__('%1$s: %2$s'), __('Due date'), ($output_type == Search::HTML_OUTPUT ? '<br>' : '') . Html::convDateTime($job->fields['due_date']));
                     } else {
                         $second_col = sprintf(__('Opened on %s'), ($output_type == Search::HTML_OUTPUT ? '<br>' : '') . Html::convDateTime($job->fields['date']));
                     }
                 }
             }
         }
         echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align . " width=130");
         // Second BIS column
         $second_col = Html::convDateTime($job->fields["date_mod"]);
         echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align . " width=90");
         // Second TER column
         if (count($_SESSION["glpiactiveentities"]) > 1) {
             $second_col = Dropdown::getDropdownName('glpi_entities', $job->fields['entities_id']);
             echo Search::showItem($output_type, $second_col, $item_num, $row_num, $align . " width=100");
         }
         // Third Column
         echo Search::showItem($output_type, "<span class='b'>" . parent::getPriorityName($job->fields["priority"]) . "</span>", $item_num, $row_num, "{$align} bgcolor='{$bgcolor}'");
         // Fourth Column
         $fourth_col = "";
         if (isset($job->users[CommonITILActor::REQUESTER]) && count($job->users[CommonITILActor::REQUESTER])) {
             foreach ($job->users[CommonITILActor::REQUESTER] as $d) {
                 $userdata = getUserName($d["users_id"], 2);
                 $fourth_col .= sprintf(__('%1$s %2$s'), "<span class='b'>" . $userdata['name'] . "</span>", Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false)));
                 $fourth_col .= "<br>";
             }
         }
         if (isset($job->groups[CommonITILActor::REQUESTER]) && count($job->groups[CommonITILActor::REQUESTER])) {
             foreach ($job->groups[CommonITILActor::REQUESTER] as $d) {
                 $fourth_col .= Dropdown::getDropdownName("glpi_groups", $d["groups_id"]);
                 $fourth_col .= "<br>";
             }
         }
         echo Search::showItem($output_type, $fourth_col, $item_num, $row_num, $align);
         // Fifth column
         $fifth_col = "";
         if (isset($job->users[CommonITILActor::ASSIGN]) && count($job->users[CommonITILActor::ASSIGN])) {
             foreach ($job->users[CommonITILActor::ASSIGN] as $d) {
                 $userdata = getUserName($d["users_id"], 2);
                 $fifth_col .= sprintf(__('%1$s %2$s'), "<span class='b'>" . $userdata['name'] . "</span>", Html::showToolTip($userdata["comment"], array('link' => $userdata["link"], 'display' => false)));
//.........这里部分代码省略.........
开发者ID:gaforeror,项目名称:glpi,代码行数:101,代码来源:ticket.class.php

示例8: showMinimalList


//.........这里部分代码省略.........
                 $end_display = $numrows;
             }
             //massive action
             $sel = "";
             if (isset($_GET["select"]) && $_GET["select"] == "all") {
                 $sel = "checked";
             }
             if ($item->canCreate() && $canedit && $output_type == Search::HTML_OUTPUT && $p['withtemplate'] != 2) {
                 Html::openMassiveActionsForm('massform' . $itemtype);
                 $massiveactionparams = array('num_displayed' => $end_display - $begin_display, 'fixed' => false, 'is_deleted' => $p['is_deleted']);
                 Html::showMassiveActions("PluginResourcesDirectory", $massiveactionparams);
             }
             // Add toview elements
             $nbcols = $toview_count;
             if ($output_type == Search::HTML_OUTPUT) {
                 // HTML display - massive modif
                 $nbcols++;
             }
             // Display List Header
             echo Search::showHeader($output_type, $end_display - $begin_display + 1, $nbcols);
             $header_num = 1;
             // Display column Headers for toview items
             $headers_line = '';
             $headers_line_top = '';
             $headers_line_bottom = '';
             echo Search::showNewLine($output_type);
             if ($output_type == Search::HTML_OUTPUT && $item->canCreate() && $canedit) {
                 // HTML display - massive modif
                 $headers_line_top .= Search::showHeaderItem($output_type, Html::getCheckAllAsCheckbox('massform' . $itemtype), $header_num, "", 0, $p['order']);
                 $headers_line_bottom .= Search::showHeaderItem($output_type, Html::getCheckAllAsCheckbox('massform' . $itemtype), $header_num, "", 0, $p['order']);
             }
             // Display column Headers for toview items
             foreach ($toview as $key => $val) {
                 $linkto = '';
                 if (!isset($searchopt["PluginResourcesDirectory"][$val]['nosort']) || !$searchopt["PluginResourcesDirectory"][$val]['nosort']) {
                     $linkto = "javascript:reloadTab('sort=" . $val . "&amp;order=" . ($p['order'] == "ASC" ? "DESC" : "ASC") . "&amp;start=" . $p['start'] . $globallinkto . "')";
                 }
                 $headers_line .= Search::showHeaderItem($output_type, $searchopt["PluginResourcesDirectory"][$val]["name"], $header_num, $linkto, $p['sort'] == $val, $p['order']);
             }
             // End Line for column headers
             $headers_line .= Search::showEndLine($output_type);
             $headers_line_top .= $headers_line;
             $headers_line_bottom .= $headers_line;
             echo $headers_line_top;
             $DB->data_seek($result, $p['start']);
             // Define begin and end var for loop
             // Search case
             $i = $begin_display;
             // Init list of items displayed
             if ($output_type == Search::HTML_OUTPUT) {
                 Session::initNavigateListItems($itemtype);
             }
             // Num of the row (1=header_line)
             $row_num = 1;
             // Display Loop
             while ($i < $numrows && $i < $end_display) {
                 $item_num = 1;
                 $data = $DB->fetch_array($result);
                 $i++;
                 $row_num++;
                 echo Search::showNewLine($output_type, $i % 2);
                 Session::addToNavigateListItems($itemtype, $data['id']);
                 $tmpcheck = "";
                 if ($item->canCreate() && $canedit && $output_type == Search::HTML_OUTPUT && $p['withtemplate'] != 2) {
                     $sel = "";
                     $tmpcheck = "<input type='checkbox' name='item[" . $data["id"] . "]' value='1' {$sel}>";
                     echo Search::showItem($output_type, $tmpcheck, $item_num, $row_num, "width='10'");
                 }
                 foreach ($toview as $key => $val) {
                     echo Search::showItem($output_type, Search::giveItem("PluginResourcesDirectory", $val, $data, $key), $item_num, $row_num, Search::displayConfigItem("PluginResourcesDirectory", $val, $data, $key));
                 }
                 echo Search::showEndLine($output_type);
             }
             // Close Table
             $title = "";
             // Create title
             if ($output_type == Search::PDF_OUTPUT_PORTRAIT || $output_type == Search::PDF_OUTPUT_LANDSCAPE) {
                 $title .= self::getTypeName(1);
             }
             // Display footer
             echo Search::showFooter($output_type, $title);
             //massive action
             if ($item->canCreate() && $canedit && $output_type == Search::HTML_OUTPUT && $p['withtemplate'] != 2) {
                 $massiveactionparams['ontop'] = false;
                 $massiveactionparams['fixed'] = false;
                 Html::showMassiveActions("PluginResourcesDirectory", $massiveactionparams);
                 Html::closeForm();
             } else {
                 echo "</table></div>";
             }
             // Pager
             if ($output_type == Search::HTML_OUTPUT) {
                 echo "<br>";
                 Html::printPager($p['start'], $numrows, $target, $parameters, "PluginResourcesDirectory", 0, $search_config);
             }
         } else {
             echo Search::showError($output_type);
         }
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:directory.class.php

示例9: showList


//.........这里部分代码省略.........
             // Pager
             $parameters = "start=" . $params["start"] . "&amp;knowbaseitemcategories_id=" . $params['knowbaseitemcategories_id'] . "&amp;contains=" . $params["contains"] . "&amp;is_faq=" . $params['faq'];
             if (isset($options['item_itemtype']) && isset($options['item_items_id'])) {
                 $parameters .= "&amp;item_items_id=" . $options['item_items_id'] . "&amp;item_itemtype=" . $options['item_itemtype'];
             }
             if ($output_type == Search::HTML_OUTPUT) {
                 Html::printPager($params['start'], $numrows, Toolbox::getItemTypeSearchURL('KnowbaseItem'), $parameters, 'KnowbaseItem');
             }
             $nbcols = 1;
             // Display List Header
             echo Search::showHeader($output_type, $numrows_limit + 1, $nbcols);
             echo Search::showNewLine($output_type);
             $header_num = 1;
             echo Search::showHeaderItem($output_type, __('Subject'), $header_num);
             if ($output_type != Search::HTML_OUTPUT) {
                 echo Search::showHeaderItem($output_type, __('Content'), $header_num);
             }
             if ($showwriter) {
                 echo Search::showHeaderItem($output_type, __('Writer'), $header_num);
             }
             echo Search::showHeaderItem($output_type, __('Category'), $header_num);
             if (isset($options['item_itemtype']) && isset($options['item_items_id']) && $output_type == Search::HTML_OUTPUT) {
                 echo Search::showHeaderItem($output_type, '&nbsp;', $header_num);
             }
             // Num of the row (1=header_line)
             $row_num = 1;
             for ($i = 0; $i < $numrows_limit; $i++) {
                 $data = $DB->fetch_assoc($result_limit);
                 Session::addToNavigateListItems('KnowbaseItem', $data["id"]);
                 // Column num
                 $item_num = 1;
                 $row_num++;
                 echo Search::showNewLine($output_type, $i % 2);
                 $item = new self();
                 $item->getFromDB($data["id"]);
                 $name = $data["name"];
                 $answer = $data["answer"];
                 // Manage translations
                 if (isset($data['transname']) && !empty($data['transname'])) {
                     $name = $data["transname"];
                 }
                 if (isset($data['transanswer']) && !empty($data['transanswer'])) {
                     $answer = $data["transanswer"];
                 }
                 if ($output_type == Search::HTML_OUTPUT) {
                     $toadd = '';
                     if (isset($options['item_itemtype']) && isset($options['item_items_id'])) {
                         $href = " href='#' onClick=\"" . Html::jsGetElementbyID('kbshow' . $data["id"]) . ".dialog('open');\"";
                         $toadd = Ajax::createIframeModalWindow('kbshow' . $data["id"], $CFG_GLPI["root_doc"] . "/front/knowbaseitem.form.php?id=" . $data["id"], array('display' => false));
                     } else {
                         $href = " href=\"" . $CFG_GLPI['root_doc'] . "/front/knowbaseitem.form.php?id=" . $data["id"] . "\" ";
                     }
                     echo Search::showItem($output_type, "<div class='kb'>{$toadd}<a " . ($data['is_faq'] ? " class='pubfaq' title='" . __("This item is part of the FAQ") . "' " : " class='knowbase' ") . " {$href}>" . Html::resume_text($name, 80) . "</a></div>\n                                          <div class='kb_resume'>" . Html::resume_text(Html::clean(Toolbox::unclean_cross_side_scripting_deep($answer)), 600) . "</div>", $item_num, $row_num);
                 } else {
                     echo Search::showItem($output_type, $name, $item_num, $row_num);
                     echo Search::showItem($output_type, Html::clean(Toolbox::unclean_cross_side_scripting_deep(html_entity_decode($answer, ENT_QUOTES, "UTF-8"))), $item_num, $row_num);
                 }
                 $showuserlink = 0;
                 if (Session::haveRight('user', READ)) {
                     $showuserlink = 1;
                 }
                 if ($showwriter) {
                     echo Search::showItem($output_type, getUserName($data["users_id"], $showuserlink), $item_num, $row_num);
                 }
                 $categ = $data["category"];
                 if ($output_type == Search::HTML_OUTPUT) {
                     $cathref = $ki->getSearchURL() . "?knowbaseitemcategories_id=" . $data["knowbaseitemcategories_id"] . '&amp;forcetab=Knowbase$2';
                     $categ = "<a href='{$cathref}'>" . $categ . '</a>';
                 }
                 echo Search::showItem($output_type, $categ, $item_num, $row_num);
                 if (isset($options['item_itemtype']) && isset($options['item_items_id']) && $output_type == Search::HTML_OUTPUT) {
                     $forcetab = $options['item_itemtype'];
                     if (!$_SESSION['glpiticket_timeline'] || $_SESSION['glpiticket_timeline_keep_replaced_tabs']) {
                         $forcetab .= '$2';
                         //Solution tab
                     } else {
                         $forcetab .= '$1';
                         //Timeline tab
                     }
                     $content = "<a href='" . Toolbox::getItemTypeFormURL($options['item_itemtype']) . "?load_kb_sol=" . $data['id'] . "&amp;id=" . $options['item_items_id'] . "&amp;forcetab=" . $forcetab . "'>" . __('Use as a solution') . "</a>";
                     echo Search::showItem($output_type, $content, $item_num, $row_num);
                 }
                 // End Line
                 echo Search::showEndLine($output_type);
             }
             // Display footer
             if ($output_type == Search::PDF_OUTPUT_LANDSCAPE || $output_type == Search::PDF_OUTPUT_PORTRAIT) {
                 echo Search::showFooter($output_type, Dropdown::getDropdownName("glpi_knowbaseitemcategories", $params['knowbaseitemcategories_id']));
             } else {
                 echo Search::showFooter($output_type);
             }
             echo "<br>";
             if ($output_type == Search::HTML_OUTPUT) {
                 Html::printPager($params['start'], $numrows, Toolbox::getItemTypeSearchURL('KnowbaseItem'), $parameters, 'KnowbaseItem');
             }
         } else {
             echo "<div class='center b'>" . __('No item found') . "</div>";
         }
     }
 }
开发者ID:jose-martins,项目名称:glpi,代码行数:101,代码来源:knowbaseitem.class.php

示例10: afficheTableau

 function afficheTableau($date, $display, $output_type, $itemtable, $end_display, $start, $nbcols, $titre, $total, $items, $locations_id)
 {
     global $DB, $CFG_GLPI;
     $first = true;
     $deleted = 0;
     $master_total = 0;
     $master_total += $total;
     if ($total != 0) {
         if ($output_type == Search::HTML_OUTPUT) {
             echo "<br>";
             echo Search::showHeader($output_type, $end_display - $start + 1, $nbcols, 1);
         } else {
             echo Search::showNewLine($output_type);
             echo Search::showEndLine($output_type);
         }
         echo Search::showNewLine($output_type);
         //tr
         if ($output_type == Search::HTML_OUTPUT) {
             if ($total != -1) {
                 echo "<th>" . $titre . "</th><th><font color='red'>" . Html::formatNumber($total) . " " . _n('Euro', 'Euros', 2, 'financialreports') . "</font></th><th>";
             } else {
                 echo "<th>" . $titre . "</th><th></th><th>";
             }
             if ($_SESSION[$display]) {
                 $status = "false";
             } else {
                 $status = "true";
             }
             echo "<a href='" . $CFG_GLPI["root_doc"] . "/plugins/financialreports/front/financialreport.php?" . $display . "=" . $status . "&date=" . $date . "&locations_id=" . $locations_id . "'>";
             if ($_SESSION[$display]) {
                 echo __('Hide', 'financialreports');
             } else {
                 echo __('Display', 'financialreports');
             }
             echo "</a>";
             if ($itemtable != 'disposal') {
                 echo "</th><th colspan='4'><th>";
             } else {
                 echo "</th><th colspan='3'><th>";
             }
         } else {
             echo Search::showHeaderItem($output_type, $titre, $header_num);
             //th
             echo Search::showHeaderItem($output_type, __('Total'), $header_num);
             if ($total != -1) {
                 echo Search::showHeaderItem($output_type, Html::formatNumber($total) . " " . _n('Euro', 'Euros', 2, 'financialreports'), $header_num);
             }
         }
         echo Search::showEndLine($output_type);
         //tr
         echo Search::showNewLine($output_type);
         $header_num = 1;
         echo Search::showHeaderItem($output_type, __('Name'), $header_num);
         echo Search::showHeaderItem($output_type, __('Inventory number'), $header_num);
         echo Search::showHeaderItem($output_type, __('Date of purchase'), $header_num);
         if ($itemtable != 'disposal') {
             echo Search::showHeaderItem($output_type, __('User / Group', 'financialreports'), $header_num);
             echo Search::showHeaderItem($output_type, __('Location'), $header_num);
         }
         echo Search::showHeaderItem($output_type, __('Model'), $header_num);
         echo Search::showHeaderItem($output_type, __('Supplier'), $header_num);
         if ($itemtable == 'disposal') {
             echo Search::showHeaderItem($output_type, __('Disposal date', 'financialreports'), $header_num);
             echo Search::showHeaderItem($output_type, __('Comments'), $header_num);
         } else {
             echo Search::showHeaderItem($output_type, __('Purchase Price HT in', 'financialreports') . " " . _n('Euro', 'Euros', 2, 'financialreports'), $header_num);
         }
         // End Line for column headers
         echo Search::showEndLine($output_type);
         $row_num = 1;
         if ($_SESSION[$display]) {
             foreach ($items as $data) {
                 $row_num++;
                 $item_num = 1;
                 echo Search::showNewLine($output_type, $row_num % 2);
                 //name
                 $link = Toolbox::getItemTypeFormURL($data["TYPE"]);
                 $output_iddev = "<a href='" . $link . "?id=" . $data["id"] . "'>" . $data["ITEM_0"] . ($_SESSION["glpiis_ids_visible"] ? " (" . $data["id"] . ")" : "") . "</a>";
                 echo Search::showItem($output_type, $output_iddev, $item_num, $row_num);
                 //otherserial
                 echo Search::showItem($output_type, $data["ITEM_2"], $item_num, $row_num);
                 //buy_date
                 echo Search::showItem($output_type, Html::convdate($data["ITEM_3"]), $item_num, $row_num);
                 if ($itemtable != 'disposal') {
                     //user
                     $username_computer = formatUserName($data["ITEM_4_3"], $data["ITEM_4"], $data["ITEM_4_2"], $data["ITEM_4_4"]);
                     $output_iduser = "<a href='" . $CFG_GLPI["root_doc"] . "/front/user.form.php?id=" . $data["ITEM_4_3"] . "'>" . $username_computer . "</a>";
                     if ($data["ITEM_4_3"] && $data["ITEM_5"]) {
                         $output_iduser .= " / <a href='" . $CFG_GLPI["root_doc"] . "/front/group.form.php?id=" . $data["ITEM_5_1"] . "'>" . $data["ITEM_5"] . ($_SESSION["glpiis_ids_visible"] ? " (" . $data["ITEM_5_1"] . ")" : "") . "</a>";
                     } else {
                         if (!isset($data["ITEM_4_3"]) && $data["ITEM_5"]) {
                             $output_iduser = "<a href='" . $CFG_GLPI["root_doc"] . "/front/group.form.php?id=" . $data["ITEM_5_1"] . "'>" . $data["ITEM_5"] . ($_SESSION["glpiis_ids_visible"] ? " (" . $data["ITEM_5_1"] . ")" : "") . "</a>";
                         } else {
                             if (!isset($data["ITEM_4_3"]) && !isset($data["ITEM_5"])) {
                                 $output_iduser = __('In stock / available', 'financialreports');
                             }
                         }
                     }
                     echo Search::showItem($output_type, $output_iduser, $item_num, $row_num);
                     //location
//.........这里部分代码省略.........
开发者ID:geldarr,项目名称:hack-space,代码行数:101,代码来源:financialreport.class.php

示例11: showTotal

 function showTotal($output_type, &$num, $row_num)
 {
     echo Search::showItem($output_type, $this->withtotal ? $this->displayTotal($output_type) : '', $num, $row_num, $this->extrabold);
 }
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:4,代码来源:column.class.php

示例12: showImport

 static function showImport($row_num, $item_num, $line, $output_type, $configID, $status, $imported)
 {
     global $DB, $CFG_GLPI;
     $infocom = new Infocom();
     $canedit = Session::haveRight(static::$rightname, UPDATE) && $infocom->canUpdate();
     $config = new PluginManufacturersimportsConfig();
     $config->getFromDB($configID);
     $suppliername = $config->fields["name"];
     $supplierUrl = $config->fields["supplier_url"];
     $supplierId = $config->fields["suppliers_id"];
     $supplierWarranty = $config->fields["warranty_duration"];
     $supplierkey = $config->fields["supplier_key"];
     $supplierclass = "PluginManufacturersimports" . $suppliername;
     $supplier = new $supplierclass();
     $row_num++;
     if ($suppliername) {
         $model = new PluginManufacturersimportsModel();
         $otherSerial = $model->checkIfModelNeeds($line["itemtype"], $line["id"]);
         echo Search::showNewLine($output_type, $row_num % 2);
         $ic = new Infocom();
         $output_check = "";
         if ($canedit && $output_type == Search::HTML_OUTPUT) {
             $sel = "";
             if (isset($_GET["select"]) && $_GET["select"] == "all") {
                 $sel = "checked";
             }
             $output_check = $supplier->showCheckbox($line["id"], $sel, $otherSerial);
         }
         echo Search::showItem($output_type, $output_check, $item_num, $row_num);
         $link = Toolbox::getItemTypeFormURL($line["itemtype"]);
         $ID = "";
         if ($_SESSION["glpiis_ids_visible"] || empty($line["name"])) {
             $ID .= " (" . $line["id"] . ")";
         }
         $output_link = "<a href='" . $link . "?id=" . $line["id"] . "'>" . $line["name"] . $ID . "</a><br>" . $line["model_name"];
         echo Search::showItem($output_type, $output_link, $item_num, $row_num);
         if (Session::isMultiEntitiesMode()) {
             echo Search::showItem($output_type, Dropdown::getDropdownName("glpi_entities", $line['entities_id']), $item_num, $row_num);
         }
         $url = self::selectSupplier($suppliername, $line["serial"], $otherSerial, $supplierkey);
         //serial
         echo Search::showItem($output_type, $line["serial"], $item_num, $row_num);
         //otherserial
         echo $supplier->showItem($output_type, $otherSerial, $item_num, $row_num);
         //display infocoms
         $output_ic = "";
         if ($ic->getfromDBforDevice($line["itemtype"], $line["id"])) {
             $output_ic .= _n('Supplier', 'Suppliers', 1) . ":" . Dropdown::getDropdownName("glpi_suppliers", $ic->fields["suppliers_id"]) . "<br>";
             $output_ic .= __('Date of purchase') . " : " . Html::convdate($ic->fields["buy_date"]) . "<br>";
             $output_ic .= __('Start date of warranty') . ":" . Html::convdate($ic->fields["warranty_date"]) . "<br>";
             if ($ic->fields["warranty_duration"] == -1) {
                 $output_ic .= __('Warranty duration') . ":" . __('Lifelong') . "<br>";
             } else {
                 $output_ic .= __('Warranty duration') . ":" . $ic->fields["warranty_duration"] . " " . __('month') . "<br>";
             }
             $tmpdat = Infocom::getWarrantyExpir($ic->fields["warranty_date"], $ic->fields["warranty_duration"]);
             $output_ic .= sprintf(__('Valid to %s'), $tmpdat);
         } else {
             $output_ic .= "";
         }
         echo Search::showItem($output_type, $output_ic, $item_num, $row_num);
         if ($imported != self::IMPORTED) {
             //display enterprise and warranty selection
             echo "<td>";
             if (Session::isMultiEntitiesMode() && $supplierId) {
                 $item = new Supplier();
                 $item->getFromDB($supplierId);
                 if ($item->fields["is_recursive"] || $item->fields["entities_id"] == $line['entities_id']) {
                     Dropdown::show('Supplier', array('name' => "to_suppliers_id" . $line["id"], 'value' => $supplierId, 'comments' => 0, 'entity' => $line['entities_id']));
                 } else {
                     echo "<span class='plugin_manufacturersimports_import_KO'>";
                     echo __('The choosen supplier is not recursive', 'manufacturersimports') . "</span>";
                     echo "<input type='hidden' name='to_suppliers_id" . $line["id"] . "' value='-1'>";
                 }
             } else {
                 Dropdown::show('Supplier', array('name' => "to_suppliers_id" . $line["id"], 'value' => $supplierId, 'comments' => 0, 'entity' => $line['entities_id']));
             }
             echo "</td>";
             $supplier->showWarrantyItem($line["id"], $supplierWarranty);
         } else {
             //display enterprise and warranty selection
             echo "<td>" . Dropdown::getDropdownName("glpi_suppliers", $ic->fields["suppliers_id"]) . "</td>";
             if ($ic->fields["warranty_duration"] == -1) {
                 echo "<td>" . __('Lifelong') . "</td>";
             } else {
                 echo "<td>" . $ic->fields["warranty_duration"] . "</td>";
             }
         }
         //supplier url
         //url to supplier
         $output_url = "<a href='" . $url . "' target='_blank'>" . __('Manufacturer information', 'manufacturersimports') . "</a>";
         echo Search::showItem($output_type, $output_url, $item_num, $row_num);
         //status
         if ($imported != self::IMPORTED) {
             if ($status != 2) {
                 $output_doc = __('Not yet imported', 'manufacturersimports');
             } else {
                 $output_doc = "<span class='plugin_manufacturersimports_import_KO'>" . __('Problem during the importation', 'manufacturersimports');
                 if (!empty($data["date_import"])) {
                     $output_doc .= " (" . Html::convdate($data["date_import"]) . ")";
//.........这里部分代码省略.........
开发者ID:paisdelconocimiento,项目名称:glpi-smartcities,代码行数:101,代码来源:preimport.class.php

示例13:

                    echo Search::showItem($output_type, Html::timestampToString($timetask), $num, $row_num);
                } else {
                    echo Search::showItem($output_type, Html::formatNumber($timetask / 3600, false, 5), $num, $row_num);
                }
                if ($output_type == Search::HTML_OUTPUT || $output_type == Search::PDF_OUTPUT_PORTRAIT || $output_type == Search::PDF_OUTPUT_LANDSCAPE) {
                    echo Search::showItem($output_type, Html::timestampToString($time), $num, $row_num);
                } else {
                    echo Search::showItem($output_type, Html::formatNumber($time / 3600, false, 5), $num, $row_num);
                }
            }
        }
        $total = $ticket->fields["close_delay_stat"];
        if ($output_type == Search::HTML_OUTPUT || $output_type == Search::PDF_OUTPUT_PORTRAIT || $output_type == Search::PDF_OUTPUT_LANDSCAPE) {
            echo Search::showItem($output_type, Html::timestampToString($total), $num, $row_num);
        } else {
            echo Search::showItem($output_type, Html::formatNumber($total / 3600, false, 5), $num, $row_num);
        }
        echo Search::showEndLine($output_type);
    }
    echo Search::showFooter($output_type, $title);
}
if ($output_type == Search::HTML_OUTPUT) {
    Html::footer();
}
/**
 * Display the column title and allow the sort
 *
 * @param $output_type
 * @param $num
 * @param $title
 * @param $columnname
开发者ID:pluginsGLPI,项目名称:timelineticket,代码行数:31,代码来源:statSpentTimeByGroup.php

示例14:

        echo Search::showNewLine($output_type);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, Html::formatNumber($totalvolbudget, '', 0), $num, $row_num);
        echo Search::showItem($output_type, Html::formatNumber($totalvolemployment, '', 2), $num, $row_num);
        echo Search::showItem($output_type, Html::formatNumber($totalvolresource, '', 4), $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, Html::formatNumber($totalamountbudget, '', 2), $num, $row_num);
        echo Search::showItem($output_type, Html::formatNumber($totalamountemployment, '', 2), $num, $row_num);
        echo Search::showItem($output_type, Html::formatNumber($totalamountresource, '', 2), $num, $row_num);
        echo Search::showItem($output_type, Html::formatNumber($totalbudgetemployment, '', 2), $num, $row_num);
        echo Search::showEndLine($output_type);
        echo Search::showFooter($output_type, $title);
    }
}
if ($output_type == Search::HTML_OUTPUT) {
    Html::footer();
}
/**
 * Display the column title and allow the sort
 *
 * @param $output_type
 * @param $num
 * @param $title
 * @param $columnname
 * @param bool $sort
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:budgetsummary.php

示例15: __

        echo Search::showNewLine($output_type);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, '', $num, $row_num);
        echo Search::showItem($output_type, __('Total'), $num, $row_num);
        echo Search::showItem($output_type, $message, $num, $row_num);
        echo Search::showEndLine($output_type);
        $row_num++;
        $num = 1;
        echo Search::showNewLine($output_type);
        if ($output_type == Search::HTML_OUTPUT) {
            echo Search::showItem($output_type, '', $num, $row_num, "colspan = '4' style='{$styleItemTitle}'");
        } else {
            echo Search::showItem($output_type, '', $num, $row_num);
            echo Search::showItem($output_type, '', $num, $row_num);
            echo Search::showItem($output_type, '', $num, $row_num);
            echo Search::showItem($output_type, '', $num, $row_num);
        }
        echo Search::showEndLine($output_type);
    }
    echo Search::showFooter($output_type, $title);
}
if ($output_type == Search::HTML_OUTPUT) {
    Html::footer();
}
/**
 * Display the column title and allow the sort
 *
 * @param $output_type
 * @param $num
 * @param $title
 * @param $columnname
开发者ID:geldarr,项目名称:hack-space,代码行数:31,代码来源:typologyreport.php


注:本文中的Search::showItem方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。