ticketsatisfaction.php 4.61 KB
Newer Older
yllen's avatar
yllen committed
1
<?php
2 3 4
/**
 * ---------------------------------------------------------------------
 * GLPI - Gestionnaire Libre de Parc Informatique
5
 * Copyright (C) 2015-2018 Teclib' and contributors.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
 *
 * http://glpi-project.org
 *
 * based on GLPI - Gestionnaire Libre de Parc Informatique
 * Copyright (C) 2003-2014 by the INDEPNET Development Team.
 *
 * ---------------------------------------------------------------------
 *
 * LICENSE
 *
 * 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, see <http://www.gnu.org/licenses/>.
 * ---------------------------------------------------------------------
yllen's avatar
yllen committed
31 32 33
 */

// Direct access to file
34
if (strpos($_SERVER['PHP_SELF'], "ticketsatisfaction.php")) {
yllen's avatar
yllen committed
35
   $AJAX_INCLUDE = 1;
36
   include ('../inc/includes.php');
yllen's avatar
yllen committed
37
   header("Content-Type: text/html; charset=UTF-8");
yllen's avatar
yllen committed
38
   Html::header_nocache();
yllen's avatar
yllen committed
39 40
}

41
$entity = new Entity();
yllen's avatar
yllen committed
42

43 44
if (isset($_POST['inquest_config']) && isset($_POST['entities_id'])) {
   if ($entity->getFromDB($_POST['entities_id'])) {
45 46 47 48
      $inquest_delay     = $entity->getfield('inquest_delay');
      $inquest_rate      = $entity->getfield('inquest_rate');
      $inquest_duration  = $entity->getfield('inquest_duration');
      $max_closedate     = $entity->getfield('max_closedate');
49
   } else {
50 51 52 53
      $inquest_delay     = -1;
      $inquest_rate      = -1;
      $inquest_duration  = -1;
      $max_closedate     = '';
54 55
   }

yllen's avatar
CS  
yllen committed
56
   if ($_POST['inquest_config'] > 0) {
yllen's avatar
yllen committed
57
      echo "<table class='tab_cadre_fixe' width='50%'>";
yllen's avatar
yllen committed
58
      echo "<tr class='tab_bg_1'><td width='50%'>".__('Create survey after')."</td>";
yllen's avatar
yllen committed
59
      echo "<td>";
moyooo's avatar
moyooo committed
60
      Dropdown::showNumber('inquest_delay',
61
                           ['value' => $inquest_delay,
moyooo's avatar
moyooo committed
62 63 64
                                 'min'   => 1,
                                 'max'   => 90,
                                 'step'  => 1,
65 66
                                 'toadd' => ['0' => __('As soon as possible')],
                                 'unit'  => 'day']);
moyooo's avatar
moyooo committed
67
      echo "</td></tr>";
yllen's avatar
yllen committed
68

yllen's avatar
yllen committed
69
      echo "<tr class='tab_bg_1'>".
tsmr's avatar
tsmr committed
70 71
           "<td>".__('Rate to trigger survey')."</td>";
      echo "<td>";
72
      Dropdown::showNumber('inquest_rate', ['value'   => $inquest_rate,
moyooo's avatar
moyooo committed
73 74 75
                                                 'min'     => 10,
                                                 'max'     => 100,
                                                 'step'    => 10,
76 77
                                                 'toadd'   => [0 => __('Disabled')],
                                                 'unit'    => '%']);
yllen's avatar
yllen committed
78
      echo "</td></tr>";
yllen's avatar
yllen committed
79

80 81 82
      echo "<tr class='tab_bg_1'><td width='50%'>".__('Duration of survey')."</td>";
      echo "<td>";
      Dropdown::showNumber('inquest_duration',
83
                           ['value' => $inquest_duration,
84 85 86
                                 'min'   => 1,
                                 'max'   => 180,
                                 'step'  => 1,
87 88
                                 'toadd' => ['0' => __('Unspecified')],
                                 'unit'  => 'day']);
89 90
      echo "</td></tr>";

yllen's avatar
yllen committed
91
      if ($max_closedate != '') {
yllen's avatar
yllen committed
92
         echo "<tr class='tab_bg_1'><td>". __('For tickets closed after')."</td><td>";
93 94
         Html::showDateTimeField("max_closedate", ['value'      => $max_closedate,
                                                        'timestep'   => 1]);
yllen's avatar
yllen committed
95
         echo "</td></tr>";
yllen's avatar
yllen committed
96
      }
yllen's avatar
yllen committed
97

98
      if ($_POST['inquest_config'] == 2) {
99
         echo "<tr class='tab_bg_1'>";
moyooo's avatar
moyooo committed
100
         echo "<td>".__('Valid tags')."</td><td>".
yllen's avatar
yllen committed
101
               "[TICKET_ID] [TICKET_NAME] [TICKET_CREATEDATE] [TICKET_SOLVEDATE] ".
102 103
               "[REQUESTTYPE_ID] [REQUESTTYPE_NAME] [TICKET_PRIORITY] [TICKET_PRIORITYNAME]  ".
               "[TICKETCATEGORY_ID] [TICKETCATEGORY_NAME] [TICKETTYPE_ID] ".
moyooo's avatar
moyooo committed
104
               "[TICKETTYPE_NAME] [SOLUTIONTYPE_ID] [SOLUTIONTYPE_NAME] ".
105
               "[SLA_TTO_ID] [SLA_TTO_NAME] [SLA_TTR_ID] [SLA_TTR_NAME] [SLALEVEL_ID] [SLALEVEL_NAME]</td></tr>";
yllen's avatar
yllen committed
106

tsmr's avatar
tsmr committed
107
         echo "<tr class='tab_bg_1'><td>" . __('URL') . "</td>";
yllen's avatar
yllen committed
108
         echo "<td>";
yllen's avatar
yllen committed
109
         Html::autocompletionTextField($entity, "inquest_URL");
yllen's avatar
yllen committed
110 111 112 113 114 115
         echo "</td></tr>";
      }

      echo "</table>";
   }
}