Commit f44f64c0 authored by Johan Cwiklinski's avatar Johan Cwiklinski Committed by Johan Cwiklinski

Rename TicketTemplate to ITILTemplate

Migrate database schema
parent 08470784
......@@ -34,6 +34,8 @@ The present file will list all changes made to the project; according to the
- `DBMysql::isMySQLStrictMode()`
- `getAllDatasFromTable` renamed to `getAllDataFromTable()`
- Usage of `$order` parameter in `getAllDataFromTable()` (`DbUtils::getAllDataFromTable()`)
- All `TicketTemplate` classes has been renamed to `ITILTemplate`
- `Ticket::getTicketTemplateToUse()` renamed to `Ticket::getITILTemplateToUse()`
#### Removed
......
......@@ -32,5 +32,5 @@
include ('../inc/includes.php');
$dropdown = new TicketTemplate();
$dropdown = new ITILTemplate();
include (GLPI_ROOT . "/front/dropdown.common.form.php");
......@@ -32,5 +32,5 @@
include ('../inc/includes.php');
$dropdown = new TicketTemplate();
$dropdown = new ITILTemplate();
include (GLPI_ROOT . "/front/dropdown.common.php");
......@@ -34,15 +34,15 @@ use Glpi\Event;
include ('../inc/includes.php');
Session ::checkRight('tickettemplate', UPDATE);
Session ::checkRight('itiltemplate', UPDATE);
$item = new TicketTemplateHiddenField();
$item = new ITILTemplateHiddenField();
if (isset($_POST["add"])) {
$item->check(-1, UPDATE, $_POST);
if ($item->add($_POST)) {
Event::log($_POST["tickettemplates_id"], "tickettemplate", 4, "maintain",
Event::log($_POST["itiltemplates_id"], "itiltemplate", 4, "maintain",
//TRANS: %s is the user login
sprintf(__('%s adds hidden field'), $_SESSION["glpiname"]));
}
......
......@@ -34,15 +34,15 @@ use Glpi\Event;
include ('../inc/includes.php');
Session ::checkRight('tickettemplate', UPDATE);
Session ::checkRight('itiltemplate', UPDATE);
$item = new TicketTemplateMandatoryField();
$item = new ITILTemplateMandatoryField();
if (isset($_POST["add"])) {
$item->check(-1, UPDATE, $_POST);
if ($item->add($_POST)) {
Event::log($_POST["tickettemplates_id"], "tickettemplate", 4, "maintain",
Event::log($_POST["itiltemplates_id"], "itiltemplate", 4, "maintain",
//TRANS: %s is the user login
sprintf(__('%s adds mandatory field'), $_SESSION["glpiname"]));
}
......
......@@ -34,9 +34,9 @@ use Glpi\Event;
include ('../inc/includes.php');
Session ::checkRight('tickettemplate', UPDATE);
Session ::checkRight('itiltemplate', UPDATE);
$item = new TicketTemplatePredefinedField();
$item = new ITILTemplatePredefinedField();
// Use masiveaction system to manage add value
if (isset($_POST["massiveaction"])) {
......@@ -45,7 +45,7 @@ if (isset($_POST["massiveaction"])) {
$_POST['items_tickets_id'] = $_POST['items_tickets_id']."_".$_POST['add_items_id'];
}
if ($item->add($_POST)) {
Event::log($_POST["tickettemplates_id"], "tickettemplate", 4, "maintain",
Event::log($_POST["itiltemplates_id"], "itiltemplate", 4, "maintain",
//TRANS: %s is the user login
sprintf(__('%s adds predefined field'), $_SESSION["glpiname"]));
}
......
......@@ -1241,7 +1241,7 @@ abstract class API extends CommonGLPI {
// filter with entity
if ($item->isEntityAssign()
// some CommonDBChild classes may not have entities_id fields and isEntityAssign still return true (like TicketTemplateMandatoryField)
// some CommonDBChild classes may not have entities_id fields and isEntityAssign still return true (like ITILTemplateMandatoryField)
&& array_key_exists('entities_id', $item->fields)) {
$where.= " AND (". getEntitiesRestrictRequest("",
$itemtype::getTable(),
......
......@@ -268,6 +268,17 @@ function glpi_autoload($classname) {
return false;
}
//@since 9.5.0 -- WILL BE REMOVED IN FUTURE RELEASE
$deprecateds = [
'TicketTempate',
'TicketTemplateHiddenField',
'TicketTemplateMandatoryField',
'TicketTemplatePredefinedField'
];
if (in_array($classname, $deprecateds)) {
Toolbox::deprecated("$classname has been dropped from GLPI.");
}
if ($classname === 'phpCAS'
&& file_exists(stream_resolve_include_path("CAS.php"))) {
include_once('CAS.php');
......
......@@ -2530,9 +2530,9 @@ abstract class CommonITILObject extends CommonDBTM {
$mandatory = '';
// For ticket templates : mandatories
if (($itemtype == 'Ticket')
&& isset($options['_tickettemplate'])) {
$mandatory = $options['_tickettemplate']->getMandatoryMark("_groups_id_".$typename);
if ($options['_tickettemplate']->isMandatoryField("_groups_id_".$typename)
&& isset($options['_itiltemplate'])) {
$mandatory = $options['_itiltemplate']->getMandatoryMark("_groups_id_".$typename);
if ($options['_itiltemplate']->isMandatoryField("_groups_id_".$typename)
&& isset($this->groups[$type]) && (count($this->groups[$type])==1)) {
$candelete = false;
}
......@@ -2587,9 +2587,9 @@ abstract class CommonITILObject extends CommonDBTM {
$mandatory = '';
// For ticket templates : mandatories
if (($itemtype == 'Ticket')
&& isset($options['_tickettemplate'])) {
$mandatory = $options['_tickettemplate']->getMandatoryMark("_suppliers_id_".$typename);
if ($options['_tickettemplate']->isMandatoryField("_suppliers_id_".$typename)
&& isset($options['_itiltemplate'])) {
$mandatory = $options['_itiltemplate']->getMandatoryMark("_suppliers_id_".$typename);
if ($options['_itiltemplate']->isMandatoryField("_suppliers_id_".$typename)
&& isset($this->suppliers[$type]) && (count($this->suppliers[$type])==1)) {
$candelete = false;
}
......@@ -3642,9 +3642,9 @@ abstract class CommonITILObject extends CommonDBTM {
$mandatory = '';
// For ticket templates : mandatories
if (($itemtype == 'Ticket')
&& isset($options['_tickettemplate'])) {
$mandatory = $options['_tickettemplate']->getMandatoryMark("_users_id_".$typename);
if ($options['_tickettemplate']->isMandatoryField("_users_id_".$typename)
&& isset($options['_itiltemplate'])) {
$mandatory = $options['_itiltemplate']->getMandatoryMark("_users_id_".$typename);
if ($options['_itiltemplate']->isMandatoryField("_users_id_".$typename)
&& isset($this->users[$type]) && (count($this->users[$type])==1)) {
$candelete = false;
}
......@@ -3816,8 +3816,8 @@ abstract class CommonITILObject extends CommonDBTM {
echo self::getActorIcon('user', $type);
// For ticket templates : mandatories
if (($itemtype == 'Ticket')
&& isset($options['_tickettemplate'])) {
echo $options['_tickettemplate']->getMandatoryMark("_users_id_".$typename);
&& isset($options['_itiltemplate'])) {
echo $options['_itiltemplate']->getMandatoryMark("_users_id_".$typename);
}
echo " ";
......@@ -3980,8 +3980,8 @@ abstract class CommonITILObject extends CommonDBTM {
echo self::getActorIcon('supplier', 'assign');
// For ticket templates : mandatories
if (($itemtype == 'Ticket')
&& isset($options['_tickettemplate'])) {
echo $options['_tickettemplate']->getMandatoryMark("_suppliers_id_assign");
&& isset($options['_itiltemplate'])) {
echo $options['_itiltemplate']->getMandatoryMark("_suppliers_id_assign");
}
echo " ";
......@@ -4077,8 +4077,8 @@ abstract class CommonITILObject extends CommonDBTM {
'_users_id_assign', '_groups_id_assign',
'_suppliers_id_assign'] as $f) {
$is_hidden[$f] = false;
if (isset($options['_tickettemplate'])
&& $options['_tickettemplate']->isHiddenField($f)) {
if (isset($options['_itiltemplate'])
&& $options['_itiltemplate']->isHiddenField($f)) {
$is_hidden[$f] = true;
}
}
......@@ -4184,8 +4184,8 @@ abstract class CommonITILObject extends CommonDBTM {
&& !$is_hidden['_groups_id_requester']) {
echo self::getActorIcon('group', CommonITILActor::REQUESTER);
/// For ticket templates : mandatories
if (isset($options['_tickettemplate'])) {
echo $options['_tickettemplate']->getMandatoryMark('_groups_id_requester');
if (isset($options['_itiltemplate'])) {
echo $options['_itiltemplate']->getMandatoryMark('_groups_id_requester');
}
echo " ";
......@@ -4278,8 +4278,8 @@ abstract class CommonITILObject extends CommonDBTM {
&& !$is_hidden['_groups_id_observer']) {
echo self::getActorIcon('group', CommonITILActor::OBSERVER);
/// For ticket templates : mandatories
if (isset($options['_tickettemplate'])) {
echo $options['_tickettemplate']->getMandatoryMark('_groups_id_observer');
if (isset($options['_itiltemplate'])) {
echo $options['_itiltemplate']->getMandatoryMark('_groups_id_observer');
}
echo " ";
......@@ -4390,8 +4390,8 @@ abstract class CommonITILObject extends CommonDBTM {
&& $this->isAllowedStatus(CommonITILObject::INCOMING, CommonITILObject::ASSIGNED)) {
echo self::getActorIcon('group', CommonITILActor::ASSIGN);
/// For ticket templates : mandatories
if (isset($options['_tickettemplate'])) {
echo $options['_tickettemplate']->getMandatoryMark('_groups_id_assign');
if (isset($options['_itiltemplate'])) {
echo $options['_itiltemplate']->getMandatoryMark('_groups_id_assign');
}
echo " ";
$rand = mt_rand();
......
......@@ -153,7 +153,7 @@ class Document_Item extends CommonDBRelation{
$ticket = new Ticket();
$ticket->getFromDB($this->fields['items_id']);
$tt = $ticket->getTicketTemplateToUse(0, $ticket->fields['type'],
$tt = $ticket->getITILTemplateToUse(0, $ticket->fields['type'],
$ticket->fields['itilcategories_id'],
$ticket->fields['entities_id']);
......
......@@ -103,7 +103,7 @@ class Entity extends CommonTreeDropdown {
'autoclose_delay', 'inquest_config',
'inquest_rate', 'inquest_delay',
'inquest_duration','inquest_URL',
'max_closedate', 'tickettemplates_id',
'max_closedate', 'itiltemplates_id',
'suppliers_as_private'],
// Configuration
'config'
......@@ -903,7 +903,7 @@ class Entity extends CommonTreeDropdown {
$tab[] = [
'id' => '47',
'table' => $this->getTable(),
'field' => 'tickettemplates_id', // not a dropdown because of special value
'field' => 'itiltemplates_id', // not a dropdown because of special value
'name' => _n('Ticket template', 'Ticket templates', 1),
'massiveaction' => false,
'nosearch' => true,
......@@ -2262,18 +2262,18 @@ class Entity extends CommonTreeDropdown {
$toadd = [self::CONFIG_PARENT => __('Inheritance of the parent entity')];
}
$options = ['value' => $entity->fields["tickettemplates_id"],
$options = ['value' => $entity->fields["itiltemplates_id"],
'entity' => $ID,
'toadd' => $toadd];
TicketTemplate::dropdown($options);
ITILTemplate::dropdown($options);
if (($entity->fields["tickettemplates_id"] == self::CONFIG_PARENT)
if (($entity->fields["itiltemplates_id"] == self::CONFIG_PARENT)
&& ($ID != 0)) {
echo "<font class='green'>&nbsp;&nbsp;";
$tt = new TicketTemplate();
$tid = self::getUsedConfig('tickettemplates_id', $ID, '', 0);
$tt = new ITILTemplate();
$tid = self::getUsedConfig('itiltemplates_id', $ID, '', 0);
if (!$tid) {
echo Dropdown::EMPTY_VALUE;
} else if ($tt->getFromDB($tid)) {
......@@ -2879,11 +2879,11 @@ class Entity extends CommonTreeDropdown {
}
return Dropdown::getDropdownName('glpi_entities', $values[$field]);
case 'tickettemplates_id' :
case 'itiltemplates_id' :
if ($values[$field] == self::CONFIG_PARENT) {
return __('Inheritance of the parent entity');
}
return Dropdown::getDropdownName('glpi_tickettemplates', $values[$field]);
return Dropdown::getDropdownName('glpi_itiltemplates', $values[$field]);
case 'calendars_id' :
switch ($values[$field]) {
......
......@@ -226,9 +226,9 @@ class Item_Ticket extends CommonDBRelation{
}
// Get ticket template
$tt = new TicketTemplate();
if (isset($options['_tickettemplate'])) {
$tt = $options['_tickettemplate'];
$tt = new ITILTemplate();
if (isset($options['_itiltemplate'])) {
$tt = $options['_itiltemplate'];
if (isset($tt->fields['id'])) {
$opt['templates_id'] = $tt->fields['id'];
}
......
......@@ -87,11 +87,11 @@ class ITILCategory extends CommonTreeDropdown {
'label' => __('Visible for a change'),
'type' => 'bool',
'list' => true],
['name' => 'tickettemplates_id_demand',
['name' => 'itiltemplates_id_demand',
'label' => __('Template for a request'),
'type' => 'dropdownValue',
'list' => true],
['name' => 'tickettemplates_id_incident',
['name' => 'itiltemplates_id_incident',
'label' => __('Template for an incident'),
'type' => 'dropdownValue',
'list' => true],
......@@ -129,18 +129,18 @@ class ITILCategory extends CommonTreeDropdown {
$tab[] = [
'id' => '72',
'table' => 'glpi_tickettemplates',
'table' => 'glpi_itiltemplates',
'field' => 'name',
'linkfield' => 'tickettemplates_id_demand',
'linkfield' => 'itiltemplates_id_demand',
'name' => __('Template for a request'),
'datatype' => 'dropdown'
];
$tab[] = [
'id' => '73',
'table' => 'glpi_tickettemplates',
'table' => 'glpi_itiltemplates',
'field' => 'name',
'linkfield' => 'tickettemplates_id_incident',
'linkfield' => 'itiltemplates_id_incident',
'name' => __('Template for an incident'),
'datatype' => 'dropdown'
];
......@@ -266,7 +266,7 @@ class ITILCategory extends CommonTreeDropdown {
if (Session::haveRight(self::$rightname, READ)) {
switch ($item->getType()) {
case 'TicketTemplate' :
case 'ITILTemplate' :
$ong[1] = $this->getTypeName(Session::getPluralNumber());
return $ong;
}
......@@ -277,18 +277,18 @@ class ITILCategory extends CommonTreeDropdown {
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) {
if ($item->getType() == 'TicketTemplate') {
self::showForTicketTemplate($item, $withtemplate);
if ($item->getType() == 'ITILTemplate') {
self::showForITILTemplate($item, $withtemplate);
}
return parent::displayTabContentForItem($item, $tabnum, $withtemplate);
}
/**
* @param $tt TicketTemplate object
* @param $tt ITILTemplate object
* @param $withtemplate (default 0)
**/
static function showForTicketTemplate(TicketTemplate $tt, $withtemplate = 0) {
static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0) {
global $DB, $CFG_GLPI;
$itilcategory = new self();
......@@ -307,8 +307,8 @@ class ITILCategory extends CommonTreeDropdown {
'FROM' => 'glpi_itilcategories',
'WHERE' => [
'OR' => [
'tickettemplates_id_incident' => $ID,
'tickettemplates_id_demand' => $ID
'itiltemplates_id_incident' => $ID,
'itiltemplates_id_demand' => $ID
]
],
'ORDER' => 'name'
......@@ -333,7 +333,7 @@ class ITILCategory extends CommonTreeDropdown {
echo "<tr class='tab_bg_2'>";
$itilcategory->getFromDB($data['id']);
echo "<td>".$itilcategory->getLink(['comments' => true])."</td>";
if ($data['tickettemplates_id_incident'] == $ID) {
if ($data['itiltemplates_id_incident'] == $ID) {
echo "<td class='center'>
<img src='".$CFG_GLPI["root_doc"]."/pics/ok.png' alt=\"".__('OK').
"\" width='14' height='14'>
......@@ -342,7 +342,7 @@ class ITILCategory extends CommonTreeDropdown {
} else {
echo "<td>&nbsp;</td>";
}
if ($data['tickettemplates_id_demand'] == $ID) {
if ($data['itiltemplates_id_demand'] == $ID) {
echo "<td class='center'>
<img src='".$CFG_GLPI["root_doc"]."/pics/ok.png' alt=\"".__('OK').
"\" width='14' height='14'>
......
This diff is collapsed.
<?php
/**
* ---------------------------------------------------------------------
* GLPI - Gestionnaire Libre de Parc Informatique
* Copyright (C) 2015-2018 Teclib' and contributors.
*
* 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/>.
* ---------------------------------------------------------------------
*/
if (!defined('GLPI_ROOT')) {
die("Sorry. You can't access this file directly");
}
/// Hidden fields for ticket template class
/// since version 0.83
class ITILTemplateHiddenField extends CommonDBChild {
// From CommonDBChild
static public $itemtype = 'ITILTemplate';
static public $items_id = 'itiltemplates_id';
public $dohistory = true;
/**
* @since 0.84
**/
function getForbiddenStandardMassiveAction() {
$forbidden = parent::getForbiddenStandardMassiveAction();
$forbidden[] = 'update';
return $forbidden;
}
static function getTypeName($nb = 0) {
return _n('Hidden field', 'Hidden fields', $nb);
}
/**
* @see CommonDBTM::getRawName()
*
* @since 0.85
**/
function getRawName() {
$tt = new ITILTemplate();
$fields = $tt->getAllowedFieldsNames(true);
if (isset($fields[$this->fields["num"]])) {
return $fields[$this->fields["num"]];
}
return '';
}
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
// can exists for template
if (($item->getType() == 'ITILTemplate')
&& Session::haveRight("itiltemplate", READ)) {
$nb = 0;
if ($_SESSION['glpishow_count_on_tabs']) {
$nb = countElementsInTable($this->getTable(),
['itiltemplates_id' => $item->getID()]);
}
return self::createTabEntry(self::getTypeName(Session::getPluralNumber()), $nb);
}
return '';
}
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) {
self::showForITILTemplate($item, $withtemplate);
return true;
}
function post_purgeItem() {
global $DB;
parent::post_purgeItem();
$ticket = new Ticket();
$itemtype_id = $ticket->getSearchOptionIDByField('field', 'itemtype', 'glpi_tickets');
$items_id_id = $ticket->getSearchOptionIDByField('field', 'items_id', 'glpi_tickets');
// Try to delete itemtype -> delete items_id
if ($this->fields['num'] == $itemtype_id) {
$query = "SELECT `id`
FROM `".$this->getTable()."`
WHERE `".static::$items_id."` = '".$this->fields['itiltemplates_id']."'
AND `num` = '$items_id_id'";
if ($result = $DB->query($query)) {
if ($DB->numrows($result)) {
$a = new self();
$a->delete(['id'=>$DB->result($result, 0, 0)]);
}
}
}
}
/**
* Get hidden fields for a template
*
* @since 0.83
*
* @param $ID integer the template ID
* @param $withtypeandcategory boolean with type and category (false by default)
*
* @return an array of hidden fields
**/
function getHiddenFields($ID, $withtypeandcategory = false) {
global $DB;
$sql = "SELECT *
FROM `".$this->getTable()."`
WHERE `".static::$items_id."` = '$ID'
ORDER BY `id`";
$result = $DB->query($sql);
$tt = new ITILTemplate();
$allowed_fields = $tt->getAllowedFields($withtypeandcategory);
$fields = [];
while ($rule = $DB->fetchAssoc($result)) {
if (isset($allowed_fields[$rule['num']])) {
$fields[$allowed_fields[$rule['num']]] = $rule['num'];
}
}
return $fields;
}
/**
* Return fields who doesn't need to be used for this part of template
*
* @since 9.2
*
* @return array the excluded fields (keys and values are equals)
*/
static function getExcludedFields() {
return [
175 => 175, // ticket's tasks (template)
];
}
/**
* Print the hidden fields
*
* @since 0.83
*
* @param $tt Ticket Template
* @param $withtemplate boolean Template or basic item (default 0)
*
* @return Nothing (call to classes members)
**/
static function showForITILTemplate(ITILTemplate $tt, $withtemplate = 0) {
global $DB;
$ID = $tt->fields['id'];
if (!$tt->getFromDB($ID) || !$tt->can($ID, READ)) {
return false;
}
$ttm = new self();
$used = $ttm->getHiddenFields($ID);
$canedit = $tt->canEdit($ID);
$fields = $tt->getAllowedFieldsNames(false);
$fields = array_diff_key($fields, self::getExcludedFields());
$rand = mt_rand();
$query = "SELECT `glpi_itiltemplatehiddenfields`.*
FROM `glpi_itiltemplatehiddenfields`
WHERE (`itiltemplates_id` = '$ID')";
if ($result = $DB->query($query)) {
$hiddenfields = [];
$used = [];
if ($numrows = $DB->numrows($result)) {
while ($data = $DB->fetchAssoc($result)) {
$hiddenfields[$data['id']] = $data;
$used[$data['num']] = $data['num'];
}
}
if ($canedit) {
echo "<div class='firstbloc'>";
echo "<form name='changeproblem_form$rand' id='changeproblem_form$rand' method='post'
action='".Toolbox::getItemTypeFormURL(__CLASS__)."'>";
echo "<table class='tab_cadre_fixe'>";
echo "<tr class='tab_bg_2'><th colspan='2'>".__('Add a hidden field')."</th></tr>";
echo "<tr class='tab_bg_2'><td class='right'>";
echo "<input type='hidden' name='itiltemplates_id' value='$ID'>";
Dropdown::showFromArray('num', $fields, ['used'=> $used]);
echo "</td><td class='center'>";
echo "&nbsp;<input type='submit' name='add' value=\""._sx('button', 'Add').
"\" class='submit'>";
echo "</td></tr>";
echo "</table>";
Html::closeForm();
echo "</div>";
}
echo "<div class='spaced'>";
if ($canedit && $numrows) {
Html::openMassiveActionsForm('mass'.__CLASS__.$rand);
$massiveactionparams = ['num_displayed' => min($_SESSION['glpilist_limit'], $numrows),
'container' => 'mass'.__CLASS__.$rand];
Html::showMassiveActions($massiveactionparams);
}
echo "<table class='tab_cadre_fixehov'>";
echo "<tr class='noHover'><th colspan='2'>";
echo self::getTypeName($DB->numrows($result));
echo "</th></tr>";
if ($numrows) {
$header_begin = "<tr>";
$header_top = '';
$header_bottom = '';
$header_end = '';
if ($canedit) {
$header_top .= "<th width='10'>";
$header_top .= Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."</th>";
$header_bottom .= "<th width='10'>";
$header_bottom .= Html::getCheckAllAsCheckbox('mass'.__CLASS__.$rand)."</th>";
}
$header_end .= "<th>".__('Name')."</th>";
$header_end .= "</tr>";
echo $header_begin.$header_top.$header_end;
foreach ($hiddenfields as $data) {
echo "<tr class='tab_bg_2'>";
if ($canedit) {
echo "<td>".Html::getMassiveActionCheckBox(__CLASS__, $data["id"])."</td>";
}
echo "<td>".$fields[$data['num']]."</td>";
echo "</tr>";
}
echo $header_begin.$header_bottom.$header_end;
} else {
echo "<tr><th colspan='2'>".__('No item found')."</th></tr>";
}
echo "</table>";
if ($canedit && $numrows) {
$massiveactionparams['ontop'] = false;
Html::showMassiveActions($massiveactionparams);
Html::closeForm();
}
echo "</div>";
}
}
}
This diff is collapsed.
This diff is collapsed.
......@@ -240,7 +240,7 @@ abstract class LevelAgreement extends CommonDBChild {
*
* @param Ticket $ticket Ticket item
* @param integer $type
* @param TicketTemplate $tt ticket template object
* @param ITILTemplate $tt ticket template object
* @param bool $canupdate update right
*/
function showForTicket(Ticket $ticket, $type, $tt, $canupdate) {
......
......@@ -47,7 +47,7 @@ class Profile extends CommonDBTM {
'password_update', 'reminder_public',
'reservation', 'rssfeed_public',
'show_group_hardware', 'task', 'ticket',
'tickettemplates_id', 'ticket_cost',
'itiltemplates_id', 'ticket_cost',
'ticketvalidation', 'ticket_status','personalization'];
......@@ -671,7 +671,7 @@ class Profile extends CommonDBTM {
echo "<tr class='tab_bg_2'>";
echo "<td>".__('Default ticket template')."</td><td>";
// Only root entity ones and recursive
$options = ['value' => $this->fields["tickettemplates_id"],
$options = ['value' => $this->fields["itiltemplates_id"],
'entity' => 0];
if (Session::isMultiEntitiesMode()) {
$options['condition'] = ['is_recursive' => 1];
......@@ -680,7 +680,7 @@ class Profile extends CommonDBTM {
if (!isset($_SESSION['glpiactiveentities'][0])) {