|
1 | 1 | <?php |
| 2 | +/* |
| 3 | +------------------------------------------------------------------------- |
| 4 | +ProcessMaker plugin for GLPI |
| 5 | +Copyright (C) 2014-2022 by Raynet SAS a company of A.Raymond Network. |
| 6 | +
|
| 7 | +https://www.araymond.com/ |
| 8 | +------------------------------------------------------------------------- |
| 9 | +
|
| 10 | +LICENSE |
| 11 | +
|
| 12 | +This file is part of ProcessMaker plugin for GLPI. |
| 13 | +
|
| 14 | +This file is free software; you can redistribute it and/or modify |
| 15 | +it under the terms of the GNU General Public License as published by |
| 16 | +the Free Software Foundation; either version 2 of the License, or |
| 17 | +(at your option) any later version. |
| 18 | +
|
| 19 | +This plugin is distributed in the hope that it will be useful, |
| 20 | +but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | +GNU General Public License for more details. |
| 23 | +
|
| 24 | +You should have received a copy of the GNU General Public License |
| 25 | +along with this plugin. If not, see <http://www.gnu.org/licenses/>. |
| 26 | +-------------------------------------------------------------------------- |
| 27 | + */ |
| 28 | + |
2 | 29 | if (strpos($_SERVER['PHP_SELF'], "asynchronousdatas.php")) { |
3 | 30 | $AJAX_INCLUDE = 1; |
4 | 31 | define('GLPI_ROOT', '../../..'); |
|
27 | 54 |
|
28 | 55 | $asyncdata = new PluginProcessmakerCrontaskaction; |
29 | 56 | if (isset($datas['id']) && $asyncdata->getFromDB( $datas['id'] ) && $asyncdata->fields['state'] == PluginProcessmakerCrontaskaction::WAITING_DATA) { |
30 | | - $initialdatas = json_decode($asyncdata->fields['postdata'], true); |
| 57 | + $initialdatas = json_decode($asyncdata->fields['formdata'], true); |
31 | 58 | $initialdatas['form'] = array_merge( $initialdatas['form'], $datas['form'] ); |
32 | | - $postdata = json_encode($initialdatas, JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE); |
33 | | - $asyncdata->update( [ 'id' => $datas['id'], 'state' => PluginProcessmakerCrontaskaction::DATA_READY, 'postdata' => $postdata ] ); |
| 59 | + $formdata = json_encode($initialdatas, JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE); |
| 60 | + $asyncdata->update( [ 'id' => $datas['id'], 'state' => PluginProcessmakerCrontaskaction::DATA_READY, 'formdata' => $formdata ] ); |
34 | 61 | $ret = [ 'code' => '0', 'message' => 'Done' ]; |
35 | 62 | } else { |
36 | 63 | $ret = [ 'code' => '2', 'message' => 'Case is not existing, or state is not WAITING_DATA' ]; |
|
0 commit comments