* Added date_creation and date_mod to case table * Added PM document management as URL links in item host * Added caseDump.php and caseRestore.php to be able to dump and restore cases. * Added GLPI_TICKET_REQUESTTYPES_ID to RW requesttypes_id in tickets * Added possibility to read/write GLPI_ITEM_GLOBAL_VALIDATION * Added marketplace folder management * Added a badge for the case id on tasks in Tickets, Changes and Problems * Added group to Watcher for task to be claimed * Changed int(11) into int unsigned * Added some case fields to be searchable in tickets (changes or problems) * Removed tech auto-assignment to ticket * Removed task re-assign mandatory justification (is now optional in task, or process, or default) * Fixed issue with processes that don't appear in dropdown when in search list * Fixed first task not set as done when in simplified interface * Fixed missing comma in SQL document table creation * Fixes cancellation and deletion rights that were not independent * Fixed add solution that was not compliant with GLPI9.5 * Fixed task cat that were active after add or updates * Added a $DB->escape() to escape special chars before query * Improved global response time for GLPI <-> PM server Set version to 4.4.0 for GLPI 9.5
75 lines
3.0 KiB
PHP
75 lines
3.0 KiB
PHP
<?php
|
|
/*
|
|
-------------------------------------------------------------------------
|
|
ProcessMaker plugin for GLPI
|
|
Copyright (C) 2014-2022 by Raynet SAS a company of A.Raymond Network.
|
|
|
|
https://www.araymond.com/
|
|
-------------------------------------------------------------------------
|
|
|
|
LICENSE
|
|
|
|
This file is part of ProcessMaker plugin for GLPI.
|
|
|
|
This file 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.
|
|
|
|
This plugin 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 this plugin. If not, see <http://www.gnu.org/licenses/>.
|
|
--------------------------------------------------------------------------
|
|
*/
|
|
|
|
if (strpos($_SERVER['PHP_SELF'], "asynchronousdatas.php")) {
|
|
$AJAX_INCLUDE = 1;
|
|
define('GLPI_ROOT', '../../..');
|
|
include (GLPI_ROOT."/inc/includes.php");
|
|
Html::header_nocache();
|
|
}
|
|
|
|
if (!defined('GLPI_ROOT')) {
|
|
die("Can not access directly to this file");
|
|
}
|
|
|
|
include_once dirname(__FILE__)."/../inc/crontaskaction.class.php";
|
|
if (isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD']=='OPTIONS') {
|
|
header("Access-Control-Allow-Origin: *");
|
|
header("Access-Control-Allow-Methods: POST");
|
|
header("Access-Control-Allow-Headers: Content-Type");
|
|
} else {
|
|
header("Access-Control-Allow-Origin: *");
|
|
header("Content-Type: application/json; charset=UTF-8");
|
|
|
|
if (isset($_SERVER['REQUEST_METHOD'])) {
|
|
switch ($_SERVER['REQUEST_METHOD']) {
|
|
case 'POST' :
|
|
$request_body = file_get_contents('php://input');
|
|
$datas = json_decode($request_body, true);
|
|
|
|
$asyncdata = new PluginProcessmakerCrontaskaction;
|
|
if (isset($datas['id']) && $asyncdata->getFromDB( $datas['id'] ) && $asyncdata->fields['state'] == PluginProcessmakerCrontaskaction::WAITING_DATA) {
|
|
$initialdatas = json_decode($asyncdata->fields['formdata'], true);
|
|
$initialdatas['form'] = array_merge( $initialdatas['form'], $datas['form'] );
|
|
$formdata = json_encode($initialdatas, JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE);
|
|
$asyncdata->update( [ 'id' => $datas['id'], 'state' => PluginProcessmakerCrontaskaction::DATA_READY, 'formdata' => $formdata ] );
|
|
$ret = [ 'code' => '0', 'message' => 'Done' ];
|
|
} else {
|
|
$ret = [ 'code' => '2', 'message' => 'Case is not existing, or state is not WAITING_DATA' ];
|
|
}
|
|
|
|
break;
|
|
default:
|
|
$ret = [ 'code' => '1', 'message' => 'Method '.$_SERVER['REQUEST_METHOD'].' not supported' ];
|
|
}
|
|
|
|
echo json_encode( $ret, JSON_HEX_APOS | JSON_HEX_QUOT );
|
|
|
|
}
|
|
}
|