Example #1
0
Inventaire
This file is part of GLPI.

GLPI is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

GLPI is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
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::getpluginTitle($_REQUEST['glpi_tab'], $_REQUEST['itemtype'], $_REQUEST['id']);
$common = new PluginMobileCommon();
$common->displayHeader($welcome);
$tab = new PluginMobileTab();
$tab->showPluginTab($_REQUEST['glpi_tab'], $_REQUEST['itemtype'], $_REQUEST['id']);
$url = Toolbox::getItemTypeTabsURL($_REQUEST['itemtype']);
Example #2
0
}
//historico perfil
if ($_REQUEST['glpi_tab'] == "Log\$1" && $_REQUEST['itemtype'] == "Profile") {
    PluginMobileTab::showLog($glpi_tab, $itemtype);
}
//historico rede
if ($_REQUEST['glpi_tab'] == "Log\$1" && $_REQUEST['itemtype'] == "Networkequipment") {
    PluginMobileTab::showLog($glpi_tab, $itemtype);
}
//historico grupo
if ($_REQUEST['glpi_tab'] == "Log\$1" && $_REQUEST['itemtype'] == "Group") {
    PluginMobileTab::showLog($glpi_tab, $itemtype);
}
//historico user
if ($_REQUEST['glpi_tab'] == "Log\$1" && $_REQUEST['itemtype'] == "user") {
    PluginMobileTab::showLog($glpi_tab, $itemtype);
}
// Grupos grupo
if ($_REQUEST['glpi_tab'] == "Group\$4" && $_REQUEST['itemtype'] == "Group") {
    global $DB;
    $sql_grp = "\nSELECT name \nFROM `glpi_groups` \nWHERE groups_id = " . $_REQUEST['id'] . "";
    $result_grp = $DB->query($sql_grp);
    echo '<ul class="ui-listview" data-theme="c" data-role="listview">';
    while ($row = $DB->fetch_assoc($result_grp)) {
        echo '<li class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-undefined" data-role="list-divider" role="heading">' . $LANG['Menu'][36] . ':</li>';
        echo '<li class="ui-li ui-li-static ui-body-c">' . $row['name'] . '</li>';
    }
    echo '</ul>';
}
// usuarios Grupos
if ($_REQUEST['glpi_tab'] == "Group_User\$1" && $_REQUEST['itemtype'] == "Group") {
Example #3
0
 public function displayItem($ID, $itemtype)
 {
     global $LANG, $CFG_GLPI, $ID;
     $welcome = "&nbsp;";
     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>&nbsp;\:)/', '', $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();
 }
Example #4
0
*/
if (!Session::haveRight("ticket", READ)) {
    return false;
}
$itemtype = $_REQUEST['itemtype'];
$welcome = "&nbsp;";
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');
PluginMobileTab::displayTabBar();
//ticket
if ($itemtype == "Ticket") {
    $sql_tick = "SELECT * \nFROM glpi_tickets\nWHERE id = " . $_REQUEST['id'] . " ";
    $result_tick = $DB->query($sql_tick);
    echo '<ul class="ui-listview" data-theme="c" data-role="listview">';
    while ($row = $DB->fetch_assoc($result_tick)) {
        //requester
        $sql_autor = "SELECT DISTINCT glpi_users.id AS id\n\tFROM glpi_tickets_users, glpi_users, glpi_tickets\n\tWHERE glpi_users.id = glpi_tickets_users.users_id\n\tAND glpi_tickets.id = " . $_REQUEST['id'] . "\n\tAND glpi_tickets_users.tickets_id = glpi_tickets.id \n\tAND  glpi_tickets_users.type = 1";
        $result_autor = $DB->query($sql_autor);
        $row_autor = $DB->fetch_assoc($result_autor);
        //technician
        $sql_tech = "SELECT DISTINCT glpi_users.id AS id\n\tFROM glpi_tickets_users, glpi_users, glpi_tickets\n\tWHERE glpi_users.id = glpi_tickets_users.users_id\n\tAND glpi_tickets.id = " . $_REQUEST['id'] . "\n\tAND glpi_tickets_users.tickets_id = glpi_tickets.id \n\tAND  glpi_tickets_users.type = 2";
        $result_tech = $DB->query($sql_tech);
        $row_tech = $DB->fetch_assoc($result_tech);
        //observer