Exemple #1
0
echo "</td></tr>";
echo "<input type='hidden' name='_from_followup' value='{$from_followup}'>";
echo "<input type='hidden' name='requesttypes_id' value='1'";
echo "<input type='hidden' name='is_private' value='0'";
echo "<input type='hidden' name='new' value='1'";
echo "<tr class='tab_bg_2'>";
echo "<td colspan='1' class='center'>";
echo "<input type='submit' value=\"" . __("Save") . "\" class='submit' onClick1=\"'history.go(-1)'\">";
echo "</td></tr>";
echo "</table>";
Html::closeForm();
if (isset($_REQUEST['new'])) {
    //echo "<div style='text-align:center; margin-top:20px;'> <b> ".$LANG['plugin_mobile']['common'][13]." </b></div>";
}
if (Session::haveRight("followup", TicketFollowup::SEEPUBLIC)) {
    global $key, $new;
    //$new = $_REQUEST['new'];
    if (isset($_REQUEST['new']) && $_POST['content'] != "") {
        $id = $_REQUEST['id'];
        $content = $_POST['content'];
        $query = "UPDATE glpi_tickets\n\t\t\tSET solvedate = NOW(), date_mod = NOW(), solution = '" . $content . "', status = 5, users_id_lastupdater = '" . $_SESSION['glpiID'] . "'\n\t\t\tWHERE id = " . $id . " \n\t\t\t";
        $result = $DB->query($query);
        Html::redirect($CFG_GLPI["root_doc"] . '/plugins/mobile/front/tab.php?glpi_tab=Ticket$2&id=' . $id . '&itemtype=Ticket&menu=maintain&ssmenu=ticketcomputer');
    }
    if (isset($new) && $_POST['content'] == "") {
        echo "<script>alert('Error');</script>";
    }
}
//PluginMobileFollowup::show(Session::getLoginUserID(),1);
$common->displayFooter();
Exemple #2
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();
 }