diff --git a/ajax/cancelticket.php b/ajax/cancelticket.php new file mode 100644 index 000000000..278a5ee20 --- /dev/null +++ b/ajax/cancelticket.php @@ -0,0 +1,38 @@ +. + * --------------------------------------------------------------------- + * @copyright Copyright © 2011 - 2019 Teclib' + * @license http://www.gnu.org/licenses/gpl.txt GPLv3+ + * @link https://github.com/pluginsGLPI/formcreator/ + * @link https://pluginsglpi.github.io/formcreator/ + * @link http://plugins.glpi-project.org/#/plugin/formcreator + * --------------------------------------------------------------------- + */ + +include ('../../../inc/includes.php'); +if (!isset($_POST['id'])) { + http_response_code(400); + exit; +} +$ticketId = (int) $_POST['id']; +PluginFormcreatorCommon::cancelMyTicket($ticketId); \ No newline at end of file diff --git a/css/styles.css b/css/styles.css index 9e27ef0f2..d0fad8b12 100644 --- a/css/styles.css +++ b/css/styles.css @@ -1459,6 +1459,9 @@ span.fc_list_icon { color: #a0a0a0; } +.plugin_formcreator_cancel_my_ticket { + background: #fec95c; +} /* ################--------------- Responsive ---------------#################### */ @media screen and (max-width: 700px) { diff --git a/hook.php b/hook.php index 7c04e4b98..9c82c7afc 100644 --- a/hook.php +++ b/hook.php @@ -483,3 +483,24 @@ function plugin_formcreator_dynamicReport($params) { return false; } + +/** + * Hook for timeline_actions; display a new action for a CommonITILObject + * @see CommonITILObject + * + * @return void + */ +function plugin_formcreator_timelineActions($options) { + $item = $options['item']; + if (!$item->canDeleteItem()) { + return; + } + + if (!(isset($_SESSION['glpiactiveprofile']) && + $_SESSION['glpiactiveprofile']['interface'] == 'helpdesk')) { + return; + } + echo "