2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* triggers_Edit.php
|
|
|
|
|
*
|
|
|
|
|
* ProcessMaker Open Source Edition
|
|
|
|
|
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-10-18 14:32:01 -04:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2010-12-02 23:34:41 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
2012-10-18 14:32:01 -04:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2010-12-02 23:34:41 +00:00
|
|
|
*
|
|
|
|
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
|
|
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
|
|
|
*/
|
2012-10-18 14:32:01 -04:00
|
|
|
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
|
|
|
|
return $RBAC_Response;
|
|
|
|
|
}
|
|
|
|
|
require_once ('classes/model/Triggers.php');
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-10-18 14:32:01 -04:00
|
|
|
if (isset( $_GET['TRI_UID'] )) {
|
|
|
|
|
$oTrigger = new Triggers();
|
|
|
|
|
// check if its necessary bypass the wizard editor
|
|
|
|
|
if (isset( $_GET['BYPASS'] ) && $_GET['BYPASS'] == '1') {
|
|
|
|
|
$editWizardSource = true;
|
|
|
|
|
} else {
|
|
|
|
|
$editWizardSource = false;
|
|
|
|
|
}
|
|
|
|
|
$aFields = $oTrigger->load( $_GET['TRI_UID'] );
|
|
|
|
|
$aTriggerData = unserialize( $aFields['TRI_PARAM'] );
|
|
|
|
|
// if trigger has been created with the wizard the TRI_PARAM field cant be empty
|
|
|
|
|
if ($aFields['TRI_PARAM'] != '' && ! $editWizardSource) {
|
|
|
|
|
$aTriggerData = unserialize( $aFields['TRI_PARAM'] );
|
|
|
|
|
// if the trigger has been modified manually, it cant be edited with the wizard.
|
2015-03-26 11:22:37 -04:00
|
|
|
if (G::encryptOld( $aFields['TRI_WEBBOT'] ) == $aTriggerData['hash']) {
|
2012-10-18 14:32:01 -04:00
|
|
|
$triUid = $_GET['TRI_UID'];
|
2013-11-28 17:05:58 -04:00
|
|
|
$STEP_UID = isset($_GET['STEP_UID'])?$_GET['STEP_UID']:'';
|
|
|
|
|
$ST_TYPE = isset($_GET['ST_TYPE'])?$_GET['ST_TYPE']:'';
|
2012-10-18 14:32:01 -04:00
|
|
|
$_GET = $aTriggerData['params'];
|
|
|
|
|
$_GET['TRI_UID'] = $triUid;
|
2014-11-04 16:44:53 -04:00
|
|
|
$_GET['PRO_UID'] = $aFields['PRO_UID'];
|
2013-11-28 17:05:58 -04:00
|
|
|
$_GET['STEP_UID']=$STEP_UID;
|
|
|
|
|
$_GET['ST_TYPE']=$ST_TYPE;
|
2012-10-18 14:32:01 -04:00
|
|
|
require_once ('triggers_EditWizard.php');
|
|
|
|
|
die();
|
|
|
|
|
} else {
|
2010-12-02 23:34:41 +00:00
|
|
|
// custom trigger edit
|
|
|
|
|
$xmlform = 'triggers/triggers_Edit';
|
|
|
|
|
$xmlform_action = '../triggers/triggers_Save';
|
|
|
|
|
}
|
2012-10-18 14:32:01 -04:00
|
|
|
} else {
|
|
|
|
|
// custom trigger edit
|
|
|
|
|
$xmlform = 'triggers/triggers_Edit';
|
2010-12-02 23:34:41 +00:00
|
|
|
$xmlform_action = '../triggers/triggers_Save';
|
2012-10-18 14:32:01 -04:00
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
//if its a new trigger
|
|
|
|
|
$aFields['PRO_UID'] = $_GET['PRO_UID'];
|
|
|
|
|
$aFields['TRI_TYPE'] = 'SCRIPT';
|
|
|
|
|
$xmlform = 'triggers/triggersProperties';
|
|
|
|
|
$xmlform_action = '../triggers/triggers_Save';
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2013-11-28 17:05:58 -04:00
|
|
|
$aFields['STEP_UID'] = isset($_GET['STEP_UID'])?$_GET['STEP_UID']:'';
|
|
|
|
|
$aFields['ST_TYPE'] = isset($_GET['ST_TYPE'])?$_GET['ST_TYPE']:'';
|
2017-02-14 21:24:08 +00:00
|
|
|
|
2010-12-02 23:34:41 +00:00
|
|
|
$G_PUBLISH = new Publisher();
|
2012-10-18 14:32:01 -04:00
|
|
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $xmlform, '', $aFields, $xmlform_action );
|
2013-03-22 15:52:26 -04:00
|
|
|
$oHeadPublisher =& headPublisher::getSingleton();
|
BUG-12604-12174-13122 Problema de despliegue de contenido de la librería CodeMirror cuando se usa el navegador Internet Explorer 8, 9, 10, en la sección '/DESIGNER/', dbl-click al seleccionar un proceso, opción TRIGGERS, opciónes: 'New / Custom Trigger', 'New / Copy & Import Trigger from a Process', Edit. Todo el campo de visualización se comporta de manera anormal, y los scrolls horizontal y vertical se pierden, en otros casos cuando el contenido es muy largo el visualización simplemente se pierde y solo se puede recuperar haciendo un click sobre el area.
2013-11-08 17:39:53 -04:00
|
|
|
$oHeadPublisher->addCssFile('/js/codemirror/lib/codemirror.css', 1);
|
|
|
|
|
$oHeadPublisher->addCssFile('/js/codemirror/addon/hint/show-hint.css', 1);
|
2013-04-02 09:39:03 -04:00
|
|
|
$oHeadPublisher->addScriptFile('/js/codemirror/lib/codemirror.js', 1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/addon/edit/matchbrackets.js",1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/mode/xml/xml.js",1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/mode/javascript/javascript.js",1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/mode/css/css.js",1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/mode/clike/clike.js",1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/addon/hint/show-hint.js",1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/addon/hint/php-hint.js",1);
|
|
|
|
|
$oHeadPublisher->addScriptFile("/js/codemirror/mode/php/php.js",1);
|
|
|
|
|
|
BUG-12604-12174-13122 Problema de despliegue de contenido de la librería CodeMirror cuando se usa el navegador Internet Explorer 8, 9, 10, en la sección '/DESIGNER/', dbl-click al seleccionar un proceso, opción TRIGGERS, opciónes: 'New / Custom Trigger', 'New / Copy & Import Trigger from a Process', Edit. Todo el campo de visualización se comporta de manera anormal, y los scrolls horizontal y vertical se pierden, en otros casos cuando el contenido es muy largo el visualización simplemente se pierde y solo se puede recuperar haciendo un click sobre el area.
2013-11-08 17:39:53 -04:00
|
|
|
//Hack: CodeMirror needed to run Internet Explorer
|
|
|
|
|
$ie = (strrpos($_SERVER['HTTP_USER_AGENT'], "MSIE") === false ) ? false : true;
|
|
|
|
|
if ($ie) {
|
|
|
|
|
echo "<!DOCTYPE html>\n";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
G::RenderPage( 'publish', 'blank' );
|
2012-10-18 14:32:01 -04:00
|
|
|
|