/**
  * Display tab's content for each users
  *
  * @static
  * @param CommonGLPI $item
  * @param int $tabnum
  * @param int $withtemplate
  * @return bool|true
  */
 static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0)
 {
     $config = new PluginMoreticketConfig();
     if ($item->getType() == 'Ticket' && $item->fields['status'] == Ticket::CLOSED && $config->closeInformations()) {
         self::showForTicket($item);
     }
     return true;
 }
예제 #2
0
function plugin_moreticket_getAddSearchOptions($itemtype)
{
    $sopt = array();
    if ($itemtype == "Ticket") {
        if (Session::haveRight("plugin_moreticket", READ)) {
            $config = new PluginMoreticketConfig();
            $sopt[3451]['table'] = 'glpi_plugin_moreticket_waitingtickets';
            $sopt[3451]['field'] = 'date_report';
            $sopt[3451]['name'] = __('Postponement date', 'moreticket');
            $sopt[3451]['datatype'] = "datetime";
            $sopt[3451]['joinparams'] = array('jointype' => 'child');
            $sopt[3451]['massiveaction'] = false;
            $sopt[3452]['table'] = 'glpi_plugin_moreticket_waitingtypes';
            $sopt[3452]['field'] = 'name';
            $sopt[3452]['name'] = PluginMoreticketWaitingType::getTypeName(1);
            $sopt[3452]['datatype'] = "dropdown";
            $sopt[3452]['joinparams'] = array('beforejoin' => array('table' => 'glpi_plugin_moreticket_waitingtickets', 'joinparams' => array('jointype' => 'child')));
            $sopt[3452]['massiveaction'] = false;
            if ($config->closeInformations()) {
                $sopt[3453]['table'] = 'glpi_plugin_moreticket_closetickets';
                $sopt[3453]['field'] = 'date';
                $sopt[3453]['name'] = __('Close ticket informations', 'moreticket') . " : " . __('Date');
                $sopt[3453]['datatype'] = "datetime";
                $sopt[3453]['joinparams'] = array('jointype' => 'child');
                $sopt[3453]['massiveaction'] = false;
                $sopt[3454]['table'] = 'glpi_plugin_moreticket_closetickets';
                $sopt[3454]['field'] = 'comment';
                $sopt[3454]['name'] = __('Close ticket informations', 'moreticket') . " : " . __('Comments');
                $sopt[3454]['datatype'] = "text";
                $sopt[3454]['joinparams'] = array('jointype' => 'child');
                $sopt[3454]['massiveaction'] = false;
                $sopt[3455]['table'] = 'glpi_plugin_moreticket_closetickets';
                $sopt[3455]['field'] = 'requesters_id';
                $sopt[3455]['name'] = __('Close ticket informations', 'moreticket') . " : " . __('Writer');
                $sopt[3455]['datatype'] = "dropdown";
                $sopt[3455]['joinparams'] = array('jointype' => 'child');
                $sopt[3455]['massiveaction'] = false;
                $sopt[3486]['table'] = 'glpi_documents';
                $sopt[3486]['field'] = 'name';
                $sopt[3486]['name'] = __('Close ticket informations', 'moreticket') . " : " . _n('Document', 'Documents', Session::getPluralNumber());
                $sopt[3486]['forcegroupby'] = true;
                $sopt[3486]['usehaving'] = true;
                $sopt[3486]['datatype'] = 'dropdown';
                $sopt[3486]['massiveaction'] = false;
                $sopt[3486]['joinparams'] = array('beforejoin' => array('table' => 'glpi_documents_items', 'joinparams' => array('jointype' => 'itemtype_item', 'specific_itemtype' => 'PluginMoreticketCloseTicket', 'beforejoin' => array('table' => 'glpi_plugin_moreticket_closetickets', 'joinparams' => array()))));
            }
        }
    }
    return $sopt;
}