public function displayItem($ID, $itemtype) { global $LANG, $CFG_GLPI, $ID; $welcome = " "; if (class_exists($itemtype)) { $classname = ucfirst($itemtype); $obj = new $classname(); $welcome = $obj->getTypeName() . " (" . $_REQUEST['id'] . ")"; } $table = $obj->getTable(); //saveActiveProfileAndApplyRead(); $common = new PluginMobileCommon(); $common->displayHeader($welcome, "search.php?menu=" . $_GET['menu'] . "&ssmenu=" . $_GET['ssmenu'] . "&itemtype={$itemtype}", '', '', 'item'); echo "<form action='" . $CFG_GLPI["root_doc"] . "/plugins/mobile/front/item.form.php?menu=" . $_GET['menu'] . "&ssmenu=" . $_GET['ssmenu'] . "&itemtype={$itemtype}&id={$ID}" . "' method='post'>"; if (largeScreen() && DISPLAYLEFTPANEL) { //if (true) { //if (false) { /*ob_start(); $obj->showForm($ID); $out = ob_get_contents(); ob_end_clean(); //delete script $out = preg_replace('/((<[\s\/]*script\b[^>]*>)([^>]*)(<\/script>))/i', '', $out); //hide tooltips $out = preg_replace('/(<a id=\'tooltip[^>])(.*?)(<\/a>)/', '', $out); $out = preg_replace('/(<img id=\'tooltip[^>])(.*?)(>)/', '', $out); //parse menu navigate $out = preg_replace('/(<a)(.*?)(search\.php[^>])(.*?)(<\/a> \:)/', '', $out); $out = preg_replace('/(item\.php\?id=[0-9]*)/', '$0'."&menu=".$_GET['menu']."&ssmenu=".$_GET['ssmenu']."&itemtype=$itemtype", $out); $out = preg_replace('/(<a[^.]*showHideDiv[^>])(.*?)(<\/a>)/', '', $out); preg_match_all('/(<div id=\'menu_navigate[^>])(.*?)(<\/div>)/', $out, $matches); $out = preg_replace('/(<div id=\'menu_navigate[^>])(.*?)(<\/div>)/', '', $out); //show select in native $out = str_replace('<select', "<select data-native-menu='true'", $out); $common->displayTabBar($matches[0]); ob_start(); $this->showButtons($itemtype, $ID); $buttons_form = ob_get_contents(); ob_end_clean(); $out .= $buttons_form; echo $out;*/ $savecolslimit = $_SESSION['plugin_mobile']['cols_limit']; $saverowslimit = $_SESSION['plugin_mobile']['rows_limit']; $_SESSION['plugin_mobile']['cols_limit'] = 1; $_SESSION['plugin_mobile']['rows_limit'] = 50; $_GET['showheader'] = false; echo "<div class='ui-grid-a' style='position:relative;'>"; echo "<div id='left_panel' class='ui-block-a'>"; echo "<div data-role='header' data-backbtn='false' data-theme='a' data-id='TabBar'>"; echo "<div data-theme='c' class='ui-btn-right' style='top:0' data-position='inline'>"; echo "<a data-role='button' data-theme='c'>test</a>"; echo "</div></div>"; echo "<div style='height:600px;'>"; PluginMobileSearch::manageGetValues($itemtype); //Search::manageParams($itemtype); $numrows = PluginMobileSearch::show(ucfirst($itemtype)); echo "</div>"; echo "</div>"; echo "<div class='ui-block-b' id='right_panel'>"; PluginMobileTab::displayTabBar(); echo "<div style='height:570px;'>"; $_SESSION['plugin_mobile']['cols_limit'] = $savecolslimit; $_SESSION['plugin_mobile']['rows_limit'] = $saverowslimit; } else { PluginMobileTab::displayTabBar(); } $obj->getFromDB($ID); $p['itemtype'] = $_REQUEST['itemtype']; //$p['itemtype'] = ''; $p['id'] = false; $p['return_fields'] = array(); $p['show_label'] = true; $p['show_name'] = true; foreach ($params as $key => $value) { $p[$key] = $value; } if (largeScreen()) { $obj = $this->removeBlacklistedField($obj); $nb_items = count($obj->fields); $tmp = array_chunk($obj->fields, ceil($nb_items / 2), true); $fields1 = $tmp[1]; $fields2 = $tmp[0]; $params1 = array('data' => $fields1, 'options' => $p, 'searchOptions' => $obj->getSearchOptions(), 'itemtype' => $itemtype); $params2 = $params1; $params2['data'] = $fields2; $this->getLabels($params1, $labels1); $this->getLabels($params2, $labels2); //echo $fields1 ."<br>"; //echo count($labels2)."<br>"; echo "<div class='ui-grid-a' id='tablet-grid'>"; echo "<div class='ui-block-a'>"; $this->showList($labels1, $itemtype); echo "</div>"; echo "<div class='ui-block-b'>"; $this->showList($labels2, $itemtype); echo "</div>"; echo "</div>"; } else { $params = array('data' => $obj->fields, 'options' => $p, 'searchOptions' => $obj->getSearchOptions(), 'itemtype' => $itemtype); $this->getLabels($params, $labels); unset($labels['id']); $this->showList($labels, $itemtype); } if (editMode()) { $this->showButtons($itemtype, $ID); } if (largeScreen() && DISPLAYLEFTPANEL) { echo "</div></div></div>"; } // restoreActiveProfile(); //Close Form //echo "</form>"; Html::closeForm(); $common->displayFooter(); }
along with GLPI; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -------------------------------------------------------------------------- */ // ---------------------------------------------------------------------- // Original Author of file: // Purpose of file: // ---------------------------------------------------------------------- // Entry menu case define('GLPI_ROOT', '../../..'); include GLPI_ROOT . "/inc/includes.php"; $welcome = PluginMobileTab::getTitle($_REQUEST['glpi_tab'], $_REQUEST['itemtype'], $_REQUEST['id']); $back = "item.php?itemtype=" . $_GET['itemtype'] . "&menu=" . $_GET['menu'] . "&ssmenu=" . $_GET['ssmenu'] . "computer&id=" . $_GET['id']; $common = new PluginMobileCommon(); $common->displayHeader($welcome, $back); PluginMobileTab::displayTabBar(); //Stevenes Donato $glpi_tab = $_REQUEST['glpi_tab']; $itemtype = $_REQUEST['itemtype']; //echo $glpi_tab."tab"; // Followup / acompanhamento if ($_REQUEST['glpi_tab'] == "TicketFollowup\$1") { global $DB; //add followup echo '<form action="followup.php?id=' . $_REQUEST['id'] . '" method="post"> <input type="submit" name="follow" value="' . $LANG['plugin_mobile']['common'][7] . '">'; Html::closeForm(); $sql_fup = "SELECT * \nFROM glpi_ticketfollowups\nWHERE tickets_id = " . $_REQUEST['id'] . "\nORDER BY glpi_ticketfollowups.date DESC"; $result_fup = $DB->query($sql_fup); echo '<ul class="ui-listview" data-theme="c" data-role="listview">'; while ($row = $DB->fetch_assoc($result_fup)) {