Merge remote branch 'upstream/master'
This commit is contained in:
@@ -8,379 +8,496 @@ error_reporting(E_ALL);
|
|||||||
ini_set('memory_limit', '128M');
|
ini_set('memory_limit', '128M');
|
||||||
|
|
||||||
if (!defined('SYS_LANG')) {
|
if (!defined('SYS_LANG')) {
|
||||||
define('SYS_LANG', 'en');
|
define('SYS_LANG', 'en');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('PATH_HOME')) {
|
if (!defined('PATH_HOME')) {
|
||||||
if ( !defined('PATH_SEP') ) {
|
if (!defined('PATH_SEP')) {
|
||||||
define('PATH_SEP', ( substr(PHP_OS, 0, 3) == 'WIN' ) ? '\\' : '/');
|
define('PATH_SEP', (substr(PHP_OS, 0, 3) == 'WIN') ? '\\' : '/');
|
||||||
}
|
}
|
||||||
$docuroot = explode(PATH_SEP, str_replace('engine' . PATH_SEP . 'methods' . PATH_SEP . 'services', '', dirname(__FILE__)));
|
|
||||||
array_pop($docuroot);
|
|
||||||
array_pop($docuroot);
|
|
||||||
$pathhome = implode(PATH_SEP, $docuroot) . PATH_SEP;
|
|
||||||
//try to find automatically the trunk directory where are placed the RBAC and Gulliver directories
|
|
||||||
//in a normal installation you don't need to change it.
|
|
||||||
array_pop($docuroot);
|
|
||||||
$pathTrunk = implode(PATH_SEP, $docuroot) . PATH_SEP ;
|
|
||||||
array_pop($docuroot);
|
|
||||||
$pathOutTrunk = implode( PATH_SEP, $docuroot) . PATH_SEP ;
|
|
||||||
// to do: check previous algorith for Windows $pathTrunk = "c:/home/";
|
|
||||||
|
|
||||||
define('PATH_HOME', $pathhome);
|
$pathServices = 'engine' . PATH_SEP . 'methods' . PATH_SEP . 'services';
|
||||||
define('PATH_TRUNK', $pathTrunk);
|
$docuroot = explode(PATH_SEP, str_replace($pathServices, '', dirname(__FILE__)));
|
||||||
define('PATH_OUTTRUNK', $pathOutTrunk);
|
|
||||||
|
|
||||||
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
array_pop($docuroot);
|
||||||
|
array_pop($docuroot);
|
||||||
|
|
||||||
G::LoadThirdParty('pear/json','class.json');
|
$pathHome = implode(PATH_SEP, $docuroot) . PATH_SEP;
|
||||||
G::LoadThirdParty('smarty/libs','Smarty.class');
|
|
||||||
G::LoadSystem('error');
|
//try to find automatically the trunk directory where are placed the RBAC and Gulliver directories
|
||||||
G::LoadSystem('dbconnection');
|
//in a normal installation you don't need to change it.
|
||||||
G::LoadSystem('dbsession');
|
|
||||||
G::LoadSystem('dbrecordset');
|
array_pop($docuroot);
|
||||||
G::LoadSystem('dbtable');
|
|
||||||
G::LoadSystem('rbac' );
|
$pathTrunk = implode(PATH_SEP, $docuroot) . PATH_SEP;
|
||||||
G::LoadSystem('publisher');
|
|
||||||
G::LoadSystem('templatePower');
|
array_pop($docuroot);
|
||||||
G::LoadSystem('xmlDocument');
|
|
||||||
G::LoadSystem('xmlform');
|
$pathOutTrunk = implode(PATH_SEP, $docuroot) . PATH_SEP;
|
||||||
G::LoadSystem('xmlformExtension');
|
|
||||||
G::LoadSystem('form');
|
//to do: check previous algorith for Windows $pathTrunk = "c:/home/";
|
||||||
G::LoadSystem('menu');
|
|
||||||
G::LoadSystem("xmlMenu");
|
define('PATH_HOME', $pathHome);
|
||||||
G::LoadSystem('dvEditor');
|
define('PATH_TRUNK', $pathTrunk);
|
||||||
G::LoadSystem('table');
|
define('PATH_OUTTRUNK', $pathOutTrunk);
|
||||||
G::LoadSystem('pagedTable');
|
|
||||||
G::LoadClass ( 'system' );
|
require_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||||
require_once ( "propel/Propel.php" );
|
|
||||||
require_once ( "creole/Creole.php" );
|
G::LoadThirdParty('pear/json','class.json');
|
||||||
|
G::LoadThirdParty('smarty/libs','Smarty.class');
|
||||||
|
G::LoadSystem('error');
|
||||||
|
G::LoadSystem('dbconnection');
|
||||||
|
G::LoadSystem('dbsession');
|
||||||
|
G::LoadSystem('dbrecordset');
|
||||||
|
G::LoadSystem('dbtable');
|
||||||
|
G::LoadSystem('rbac' );
|
||||||
|
G::LoadSystem('publisher');
|
||||||
|
G::LoadSystem('templatePower');
|
||||||
|
G::LoadSystem('xmlDocument');
|
||||||
|
G::LoadSystem('xmlform');
|
||||||
|
G::LoadSystem('xmlformExtension');
|
||||||
|
G::LoadSystem('form');
|
||||||
|
G::LoadSystem('menu');
|
||||||
|
G::LoadSystem("xmlMenu");
|
||||||
|
G::LoadSystem('dvEditor');
|
||||||
|
G::LoadSystem('table');
|
||||||
|
G::LoadSystem('pagedTable');
|
||||||
|
G::LoadClass ( 'system' );
|
||||||
|
require_once ( "propel/Propel.php" );
|
||||||
|
require_once ( "creole/Creole.php" );
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once 'classes/model/AppDelegation.php';
|
require_once ("classes/model/Configuration.php");
|
||||||
require_once 'classes/model/Event.php';
|
require_once ("classes/model/AppCacheView.php");
|
||||||
require_once 'classes/model/AppEvent.php';
|
require_once ("classes/model/AppDelegation.php");
|
||||||
require_once 'classes/model/CaseScheduler.php';
|
require_once ("classes/model/Event.php");
|
||||||
//G::loadClass('pmScript');
|
require_once ("classes/model/AppEvent.php");
|
||||||
|
require_once ("classes/model/CaseScheduler.php");
|
||||||
|
//G::loadClass("pmScript");
|
||||||
|
|
||||||
//default values
|
//default values
|
||||||
$bCronIsRunning = false;
|
$bCronIsRunning = false;
|
||||||
$sLastExecution = '';
|
$sLastExecution = '';
|
||||||
if ( file_exists(PATH_DATA . 'cron') ) {
|
|
||||||
$aAux = unserialize( trim( @file_get_contents(PATH_DATA . 'cron')) );
|
if (file_exists(PATH_DATA . 'cron')) {
|
||||||
$bCronIsRunning = (boolean)$aAux['bCronIsRunning'];
|
$arrayAux = unserialize(trim(@file_get_contents(PATH_DATA . 'cron')));
|
||||||
$sLastExecution = $aAux['sLastExecution'];
|
$bCronIsRunning = (boolean)($arrayAux['bCronIsRunning']);
|
||||||
}
|
$sLastExecution = $arrayAux['sLastExecution'];
|
||||||
else {
|
} else {
|
||||||
//if not exists the file, just create a new one with current date
|
//if not exists the file, just create a new one with current date
|
||||||
@file_put_contents(PATH_DATA . 'cron', serialize(array('bCronIsRunning' => '1', 'sLastExecution' => date('Y-m-d H:i:s'))));
|
$arrayAux = array('bCronIsRunning' => '1', 'sLastExecution' => date('Y-m-d H:i:s'));
|
||||||
|
|
||||||
|
@file_put_contents(PATH_DATA . 'cron', serialize($arrayAux));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('SYS_SYS')) {
|
if (!defined('SYS_SYS')) {
|
||||||
$sObject = $argv[1];
|
$sObject = $argv[1];
|
||||||
$sNow = $argv[2];
|
$sNow = $argv[2];
|
||||||
$sFilter = '';
|
$sFilter = '';
|
||||||
|
|
||||||
for($i=3; $i<count($argv); $i++){
|
|
||||||
$sFilter .= ' '.$argv[$i];
|
|
||||||
}
|
|
||||||
|
|
||||||
$oDirectory = dir(PATH_DB);
|
for ($i = 3; $i < count($argv); $i++) {
|
||||||
|
$sFilter .= ' ' . $argv[$i];
|
||||||
if (is_dir(PATH_DB . $sObject)) {
|
|
||||||
saveLog ( 'main', 'action', "checking folder " . PATH_DB . $sObject );
|
|
||||||
if (file_exists(PATH_DB . $sObject . PATH_SEP . 'db.php')) {
|
|
||||||
|
|
||||||
define('SYS_SYS', $sObject);
|
|
||||||
|
|
||||||
include_once(PATH_HOME.'engine'.PATH_SEP.'config'.PATH_SEP.'paths_installed.php');
|
|
||||||
include_once(PATH_HOME.'engine'.PATH_SEP.'config'.PATH_SEP.'paths.php');
|
|
||||||
|
|
||||||
//***************** PM Paths DATA **************************
|
|
||||||
define( 'PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
|
|
||||||
define( 'PATH_DOCUMENT', PATH_DATA_SITE . 'files/' );
|
|
||||||
define( 'PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/' );
|
|
||||||
define( 'PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/' );
|
|
||||||
define( 'PATH_DATA_REPORTS', PATH_DATA_SITE . 'reports/' );
|
|
||||||
define( 'PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/' );
|
|
||||||
define( 'PATH_IMAGES_ENVIRONMENT_FILES', PATH_DATA_SITE . 'usersFiles'.PATH_SEP);
|
|
||||||
define( 'PATH_IMAGES_ENVIRONMENT_USERS', PATH_DATA_SITE . 'usersPhotographies'.PATH_SEP);
|
|
||||||
|
|
||||||
if(is_file(PATH_DATA_SITE.PATH_SEP.'.server_info')){
|
|
||||||
$SERVER_INFO = file_get_contents(PATH_DATA_SITE.PATH_SEP.'.server_info');
|
|
||||||
$SERVER_INFO = unserialize($SERVER_INFO);
|
|
||||||
//print_r($SERVER_INFO);
|
|
||||||
define( 'SERVER_NAME', $SERVER_INFO ['SERVER_NAME']);
|
|
||||||
define( 'SERVER_PORT', $SERVER_INFO ['SERVER_PORT']);
|
|
||||||
} else {
|
|
||||||
eprintln("WARNING! No server info found!", 'red');
|
|
||||||
}
|
|
||||||
|
|
||||||
$sContent = file_get_contents(PATH_DB . $sObject . PATH_SEP . 'db.php');
|
|
||||||
|
|
||||||
$sContent = str_replace('<?php', '', $sContent);
|
|
||||||
$sContent = str_replace('<?', '', $sContent);
|
|
||||||
$sContent = str_replace('?>', '', $sContent);
|
|
||||||
$sContent = str_replace('define', '', $sContent);
|
|
||||||
$sContent = str_replace("('", "$", $sContent);
|
|
||||||
$sContent = str_replace("',", '=', $sContent);
|
|
||||||
$sContent = str_replace(");", ';', $sContent);
|
|
||||||
|
|
||||||
eval($sContent);
|
|
||||||
$dsn = $DB_ADAPTER . '://' . $DB_USER . ':' . $DB_PASS . '@' . $DB_HOST . '/' . $DB_NAME;
|
|
||||||
$dsnRbac = $DB_ADAPTER . '://' . $DB_RBAC_USER . ':' . $DB_RBAC_PASS . '@' . $DB_RBAC_HOST . '/' . $DB_RBAC_NAME;
|
|
||||||
$dsnRp = $DB_ADAPTER . '://' . $DB_REPORT_USER . ':' . $DB_REPORT_PASS . '@' . $DB_REPORT_HOST . '/' . $DB_REPORT_NAME;
|
|
||||||
switch ($DB_ADAPTER) {
|
|
||||||
case 'mysql':
|
|
||||||
$dsn .= '?encoding=utf8';
|
|
||||||
$dsnRbac .= '?encoding=utf8';
|
|
||||||
break;
|
|
||||||
case 'mssql':
|
|
||||||
//$dsn .= '?sendStringAsUnicode=false';
|
|
||||||
//$dsnRbac .= '?sendStringAsUnicode=false';
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$pro['datasources']['workflow']['connection'] = $dsn;
|
|
||||||
$pro['datasources']['workflow']['adapter'] = $DB_ADAPTER;
|
|
||||||
$pro['datasources']['rbac']['connection'] = $dsnRbac;
|
|
||||||
$pro['datasources']['rbac']['adapter'] = $DB_ADAPTER;
|
|
||||||
$pro['datasources']['rp']['connection'] = $dsnRp;
|
|
||||||
$pro['datasources']['rp']['adapter'] = $DB_ADAPTER;
|
|
||||||
//$pro['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
|
|
||||||
//$pro['datasources']['dbarray']['adapter'] = 'dbarray';
|
|
||||||
$oFile = fopen(PATH_CORE . 'config/_databases_.php', 'w');
|
|
||||||
fwrite($oFile, '<?php global $pro;return $pro; ?>');
|
|
||||||
fclose($oFile);
|
|
||||||
Propel::init(PATH_CORE . 'config/_databases_.php');
|
|
||||||
//Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
|
|
||||||
|
|
||||||
eprintln("Processing workspace: " . $sObject, 'green');
|
|
||||||
try{
|
|
||||||
processWorkspace();
|
|
||||||
}catch(Exception $e){
|
|
||||||
echo $e->getMessage();
|
|
||||||
eprintln("Probelm in workspace: " . $sObject.' it was omitted.', 'red');
|
|
||||||
}
|
|
||||||
eprintln();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
unlink(PATH_CORE . 'config/_databases_.php');
|
$oDirectory = dir(PATH_DB);
|
||||||
}
|
|
||||||
else {
|
if (is_dir(PATH_DB . $sObject)) {
|
||||||
processWorkspace();
|
saveLog('main', 'action', "checking folder " . PATH_DB . $sObject);
|
||||||
|
|
||||||
|
if (file_exists(PATH_DB . $sObject . PATH_SEP . 'db.php')) {
|
||||||
|
define('SYS_SYS', $sObject);
|
||||||
|
|
||||||
|
include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths_installed.php');
|
||||||
|
include_once (PATH_HOME . 'engine' . PATH_SEP . 'config' . PATH_SEP . 'paths.php');
|
||||||
|
|
||||||
|
//***************** PM Paths DATA **************************
|
||||||
|
define('PATH_DATA_SITE', PATH_DATA . 'sites/' . SYS_SYS . '/');
|
||||||
|
define('PATH_DOCUMENT', PATH_DATA_SITE . 'files/');
|
||||||
|
define('PATH_DATA_MAILTEMPLATES', PATH_DATA_SITE . 'mailTemplates/');
|
||||||
|
define('PATH_DATA_PUBLIC', PATH_DATA_SITE . 'public/');
|
||||||
|
define('PATH_DATA_REPORTS', PATH_DATA_SITE . 'reports/');
|
||||||
|
define('PATH_DYNAFORM', PATH_DATA_SITE . 'xmlForms/');
|
||||||
|
define('PATH_IMAGES_ENVIRONMENT_FILES', PATH_DATA_SITE . 'usersFiles' . PATH_SEP);
|
||||||
|
define('PATH_IMAGES_ENVIRONMENT_USERS', PATH_DATA_SITE . 'usersPhotographies' . PATH_SEP);
|
||||||
|
|
||||||
|
if (is_file(PATH_DATA_SITE.PATH_SEP . '.server_info')) {
|
||||||
|
$SERVER_INFO = file_get_contents(PATH_DATA_SITE.PATH_SEP.'.server_info');
|
||||||
|
$SERVER_INFO = unserialize($SERVER_INFO);
|
||||||
|
|
||||||
|
define('SERVER_NAME', $SERVER_INFO ['SERVER_NAME']);
|
||||||
|
define('SERVER_PORT', $SERVER_INFO ['SERVER_PORT']);
|
||||||
|
} else {
|
||||||
|
eprintln("WARNING! No server info found!", 'red');
|
||||||
|
}
|
||||||
|
|
||||||
|
$sContent = file_get_contents(PATH_DB . $sObject . PATH_SEP . 'db.php');
|
||||||
|
|
||||||
|
$sContent = str_replace('<?php', '', $sContent);
|
||||||
|
$sContent = str_replace('<?', '', $sContent);
|
||||||
|
$sContent = str_replace('?>', '', $sContent);
|
||||||
|
$sContent = str_replace('define', '', $sContent);
|
||||||
|
$sContent = str_replace("('", "$", $sContent);
|
||||||
|
$sContent = str_replace("',", '=', $sContent);
|
||||||
|
$sContent = str_replace(");", ';', $sContent);
|
||||||
|
|
||||||
|
eval($sContent);
|
||||||
|
|
||||||
|
$dsn = $DB_ADAPTER . '://' . $DB_USER . ':' . $DB_PASS . '@' . $DB_HOST . '/' . $DB_NAME;
|
||||||
|
|
||||||
|
$dsnRbac = $DB_ADAPTER . '://' . $DB_RBAC_USER . ':' . $DB_RBAC_PASS . '@' . $DB_RBAC_HOST . '/';
|
||||||
|
$dsnRbac = $dsnRbac . $DB_RBAC_NAME;
|
||||||
|
|
||||||
|
$dsnRp = $DB_ADAPTER . '://' . $DB_REPORT_USER . ':' . $DB_REPORT_PASS . '@' . $DB_REPORT_HOST . '/';
|
||||||
|
$dsnRp = $dsnRp . $DB_REPORT_NAME;
|
||||||
|
|
||||||
|
switch ($DB_ADAPTER) {
|
||||||
|
case 'mysql':
|
||||||
|
$dsn .= '?encoding=utf8';
|
||||||
|
$dsnRbac .= '?encoding=utf8';
|
||||||
|
break;
|
||||||
|
case 'mssql':
|
||||||
|
//$dsn .= '?sendStringAsUnicode=false';
|
||||||
|
//$dsnRbac .= '?sendStringAsUnicode=false';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pro['datasources']['workflow']['connection'] = $dsn;
|
||||||
|
$pro['datasources']['workflow']['adapter'] = $DB_ADAPTER;
|
||||||
|
$pro['datasources']['rbac']['connection'] = $dsnRbac;
|
||||||
|
$pro['datasources']['rbac']['adapter'] = $DB_ADAPTER;
|
||||||
|
$pro['datasources']['rp']['connection'] = $dsnRp;
|
||||||
|
$pro['datasources']['rp']['adapter'] = $DB_ADAPTER;
|
||||||
|
//$pro['datasources']['dbarray']['connection'] = 'dbarray://user:pass@localhost/pm_os';
|
||||||
|
//$pro['datasources']['dbarray']['adapter'] = 'dbarray';
|
||||||
|
|
||||||
|
$oFile = fopen(PATH_CORE . 'config/_databases_.php', 'w');
|
||||||
|
fwrite($oFile, '<?php global $pro;return $pro; ?>');
|
||||||
|
fclose($oFile);
|
||||||
|
|
||||||
|
Propel::init(PATH_CORE . 'config/_databases_.php');
|
||||||
|
//Creole::registerDriver('dbarray', 'creole.contrib.DBArrayConnection');
|
||||||
|
|
||||||
|
eprintln("Processing workspace: " . $sObject, "green");
|
||||||
|
|
||||||
|
try {
|
||||||
|
processWorkspace();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
echo $e->getMessage();
|
||||||
|
|
||||||
|
eprintln("Probelm in workspace: " . $sObject . " it was omitted.", "red");
|
||||||
|
}
|
||||||
|
|
||||||
|
eprintln();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unlink(PATH_CORE . 'config/_databases_.php');
|
||||||
|
} else {
|
||||||
|
processWorkspace();
|
||||||
}
|
}
|
||||||
|
|
||||||
//finally update the file
|
//finally update the file
|
||||||
@file_put_contents(PATH_DATA . 'cron', serialize(array('bCronIsRunning' => '0', 'sLastExecution' => date('Y-m-d H:i:s'))));
|
$arrayAux = array('bCronIsRunning' => '0', 'sLastExecution' => date('Y-m-d H:i:s'));
|
||||||
|
@file_put_contents(PATH_DATA . 'cron', serialize($arrayAux));
|
||||||
|
|
||||||
|
function processWorkspace()
|
||||||
|
{
|
||||||
|
global $sLastExecution;
|
||||||
|
|
||||||
function processWorkspace() {
|
try {
|
||||||
global $sLastExecution;
|
resendEmails();
|
||||||
try {
|
unpauseApplications();
|
||||||
resendEmails();
|
calculateDuration();
|
||||||
unpauseApplications();
|
executePlugins();
|
||||||
calculateDuration();
|
executeEvents($sLastExecution);
|
||||||
executePlugins();
|
executeScheduledCases();
|
||||||
executeEvents($sLastExecution);
|
executeUpdateAppTitle();
|
||||||
executeScheduledCases();
|
} catch (Exception $oError) {
|
||||||
}
|
saveLog("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n");
|
||||||
catch (Exception $oError) {
|
|
||||||
saveLog ("main", "error", "Error processing workspace : " . $oError->getMessage() . "\n" );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function resendEmails() {
|
|
||||||
global $sFilter;
|
|
||||||
if($sFilter!='' && strpos($sFilter, 'emails') === false) return false;
|
|
||||||
|
|
||||||
setExecutionMessage("Resending emails");
|
|
||||||
|
|
||||||
try {
|
|
||||||
G::LoadClass('spool');
|
|
||||||
$oSpool = new spoolRun();
|
|
||||||
$oSpool->resendEmails();
|
|
||||||
saveLog('resendEmails', 'action', 'Resending Emails', "c");
|
|
||||||
|
|
||||||
$aSpoolWarnings = $oSpool->getWarnings();
|
|
||||||
if( $aSpoolWarnings !== false ) {
|
|
||||||
foreach($aSpoolWarnings as $sWarning){
|
|
||||||
print('MAIL SPOOL WARNING: ' . $sWarning."\n");
|
|
||||||
saveLog('resendEmails', 'warning', 'MAIL SPOOL WARNING: ' . $sWarning);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
setExecutionResultMessage('DONE');
|
|
||||||
}
|
|
||||||
catch (Exception $oError) {
|
|
||||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
|
||||||
eprintln(" '-".$oError->getMessage(), 'red');
|
|
||||||
saveLog('resendEmails', 'error', 'Error Resending Emails: ' . $oError->getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function unpauseApplications() {
|
function resendEmails()
|
||||||
global $sFilter;
|
{
|
||||||
global $sNow;
|
global $sFilter;
|
||||||
if($sFilter!='' && strpos($sFilter, 'unpause') === false) return false;
|
|
||||||
setExecutionMessage("Unpausing applications");
|
|
||||||
|
|
||||||
try {
|
if ($sFilter != '' && strpos($sFilter, 'emails') === false) {
|
||||||
G::LoadClass('case');
|
return false;
|
||||||
$oCases = new Cases();
|
}
|
||||||
$oCases->ThrowUnpauseDaemon($sNow);
|
|
||||||
setExecutionResultMessage('DONE');
|
|
||||||
saveLog('unpauseApplications', 'action', 'Unpausing Applications');
|
|
||||||
}
|
|
||||||
catch (Exception $oError) {
|
|
||||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
|
||||||
eprintln(" '-".$oError->getMessage(), 'red');
|
|
||||||
saveLog('unpauseApplications', 'error', 'Error Unpausing Applications: ' . $oError->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function executePlugins(){
|
setExecutionMessage("Resending emails");
|
||||||
global $sFilter;
|
|
||||||
if($sFilter!='' && strpos($sFilter, 'plugins') === false) return false;
|
|
||||||
|
|
||||||
$pathCronPlugins = PATH_CORE.'bin'.PATH_SEP.'plugins'.PATH_SEP;
|
try {
|
||||||
|
G::LoadClass('spool');
|
||||||
//erik: verify if the plugin dir exists
|
|
||||||
if (!is_dir($pathCronPlugins)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($handle = opendir( $pathCronPlugins )) {
|
|
||||||
while ( false !== ($file = readdir($handle))) {
|
|
||||||
if ( strpos($file, '.php',1) && is_file($pathCronPlugins . $file) ) {
|
|
||||||
$filename = str_replace('.php' , '', $file) ;
|
|
||||||
$className = $filename . 'ClassCron';
|
|
||||||
|
|
||||||
include_once ( $pathCronPlugins . $file ); //$filename. ".php"
|
$oSpool = new spoolRun();
|
||||||
$oPlugin = new $className();
|
$oSpool->resendEmails();
|
||||||
if (method_exists($oPlugin, 'executeCron')) {
|
|
||||||
$oPlugin->executeCron();
|
saveLog('resendEmails', 'action', 'Resending Emails', "c");
|
||||||
setExecutionMessage("Executing Plugins");
|
|
||||||
setExecutionResultMessage('DONE');
|
$aSpoolWarnings = $oSpool->getWarnings();
|
||||||
|
|
||||||
|
if ( $aSpoolWarnings !== false ) {
|
||||||
|
foreach ($aSpoolWarnings as $sWarning) {
|
||||||
|
print('MAIL SPOOL WARNING: ' . $sWarning."\n");
|
||||||
|
saveLog('resendEmails', 'warning', 'MAIL SPOOL WARNING: ' . $sWarning);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
setExecutionResultMessage('DONE');
|
||||||
|
} catch (Exception $oError) {
|
||||||
|
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||||
|
eprintln(" '-".$oError->getMessage(), 'red');
|
||||||
|
saveLog('resendEmails', 'error', 'Error Resending Emails: ' . $oError->getMessage());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
function calculateDuration() {
|
|
||||||
global $sFilter;
|
|
||||||
if($sFilter!='' && strpos($sFilter, 'calculate') === false) return false;
|
|
||||||
setExecutionMessage("Calculating Duration");
|
|
||||||
|
|
||||||
try {
|
|
||||||
$oAppDelegation = new AppDelegation();
|
|
||||||
$oAppDelegation->calculateDuration();
|
|
||||||
setExecutionResultMessage('DONE');
|
|
||||||
saveLog('calculateDuration', 'action', 'Calculating Duration');
|
|
||||||
}
|
|
||||||
catch (Exception $oError) {
|
|
||||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
|
||||||
eprintln(" '-".$oError->getMessage(), 'red');
|
|
||||||
saveLog('calculateDuration', 'error', 'Error Calculating Duration: ' . $oError->getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function executeEvents($sLastExecution, $sNow=null) {
|
function unpauseApplications()
|
||||||
|
{
|
||||||
global $sFilter;
|
|
||||||
global $sNow;
|
|
||||||
$log = array();
|
|
||||||
|
|
||||||
if($sFilter!='' && strpos($sFilter, 'events') === false) return false;
|
|
||||||
|
|
||||||
setExecutionMessage("Executing events");
|
|
||||||
setExecutionResultMessage('PROCESSING');
|
|
||||||
try {
|
|
||||||
$oAppEvent = new AppEvent();
|
|
||||||
saveLog('executeEvents', 'action', "Executing Events $sLastExecution, $sNow ");
|
|
||||||
$n = $oAppEvent->executeEvents($sNow, false, $log);
|
|
||||||
foreach ($log as $value) {
|
|
||||||
saveLog('executeEvents', 'action', "Execute Events : $value, $sNow ");
|
|
||||||
}
|
|
||||||
setExecutionMessage("|- End Execution events");
|
|
||||||
setExecutionResultMessage("Processed $n");
|
|
||||||
//saveLog('executeEvents', 'action', $res );
|
|
||||||
}
|
|
||||||
catch (Exception $oError) {
|
|
||||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
|
||||||
eprintln(" '-".$oError->getMessage(), 'red');
|
|
||||||
saveLog('calculateAlertsDueDate', 'Error', 'Error Executing Events: ' . $oError->getMessage());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function executeScheduledCases($sNow=null){
|
|
||||||
try{
|
|
||||||
global $sFilter;
|
global $sFilter;
|
||||||
global $sNow;
|
global $sNow;
|
||||||
$log = array();
|
|
||||||
|
|
||||||
if($sFilter!='' && strpos($sFilter, 'scheduler') === false) return false;
|
if ($sFilter != '' && strpos($sFilter, 'unpause') === false) {
|
||||||
|
return false;
|
||||||
setExecutionMessage("Executing the scheduled starting cases");
|
}
|
||||||
|
|
||||||
|
setExecutionMessage("Unpausing applications");
|
||||||
|
|
||||||
|
try {
|
||||||
|
G::LoadClass('case');
|
||||||
|
|
||||||
|
$oCases = new Cases();
|
||||||
|
$oCases->ThrowUnpauseDaemon($sNow);
|
||||||
|
|
||||||
|
setExecutionResultMessage('DONE');
|
||||||
|
saveLog('unpauseApplications', 'action', 'Unpausing Applications');
|
||||||
|
} catch (Exception $oError) {
|
||||||
|
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||||
|
eprintln(" '-".$oError->getMessage(), 'red');
|
||||||
|
saveLog('unpauseApplications', 'error', 'Error Unpausing Applications: ' . $oError->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function executePlugins()
|
||||||
|
{
|
||||||
|
global $sFilter;
|
||||||
|
|
||||||
|
if ($sFilter!='' && strpos($sFilter, 'plugins') === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$pathCronPlugins = PATH_CORE.'bin'.PATH_SEP.'plugins'.PATH_SEP;
|
||||||
|
|
||||||
|
//erik: verify if the plugin dir exists
|
||||||
|
if (!is_dir($pathCronPlugins)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($handle = opendir($pathCronPlugins)) {
|
||||||
|
while (false !== ($file = readdir($handle))) {
|
||||||
|
if (strpos($file, '.php',1) && is_file($pathCronPlugins . $file)) {
|
||||||
|
$filename = str_replace('.php' , '', $file);
|
||||||
|
$className = $filename . 'ClassCron';
|
||||||
|
|
||||||
|
include_once ( $pathCronPlugins . $file ); //$filename. ".php"
|
||||||
|
|
||||||
|
$oPlugin = new $className();
|
||||||
|
|
||||||
|
if (method_exists($oPlugin, 'executeCron')) {
|
||||||
|
$oPlugin->executeCron();
|
||||||
|
setExecutionMessage("Executing Plugins");
|
||||||
|
setExecutionResultMessage('DONE');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function calculateDuration()
|
||||||
|
{
|
||||||
|
global $sFilter;
|
||||||
|
|
||||||
|
if ($sFilter != '' && strpos($sFilter, 'calculate') === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
setExecutionMessage("Calculating Duration");
|
||||||
|
|
||||||
|
try {
|
||||||
|
$oAppDelegation = new AppDelegation();
|
||||||
|
$oAppDelegation->calculateDuration();
|
||||||
|
|
||||||
|
setExecutionResultMessage('DONE');
|
||||||
|
saveLog('calculateDuration', 'action', 'Calculating Duration');
|
||||||
|
} catch (Exception $oError) {
|
||||||
|
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||||
|
eprintln(" '-".$oError->getMessage(), 'red');
|
||||||
|
saveLog('calculateDuration', 'error', 'Error Calculating Duration: ' . $oError->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function executeEvents($sLastExecution, $sNow=null)
|
||||||
|
{
|
||||||
|
global $sFilter;
|
||||||
|
global $sNow;
|
||||||
|
|
||||||
|
$log = array();
|
||||||
|
|
||||||
|
if ($sFilter != '' && strpos($sFilter, 'events') === false) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
setExecutionMessage("Executing events");
|
||||||
setExecutionResultMessage('PROCESSING');
|
setExecutionResultMessage('PROCESSING');
|
||||||
|
|
||||||
$sNow = isset($sNow)? $sNow: date('Y-m-d H:i:s');
|
|
||||||
$oCaseScheduler = new CaseScheduler;
|
|
||||||
|
|
||||||
$oCaseScheduler->caseSchedulerCron($sNow, $log);
|
try {
|
||||||
|
$oAppEvent = new AppEvent();
|
||||||
foreach ($log as $value) {
|
saveLog('executeEvents', 'action', "Executing Events $sLastExecution, $sNow ");
|
||||||
saveLog('executeScheduledCases', 'action', "OK Case# $value");
|
$n = $oAppEvent->executeEvents($sNow, false, $log);
|
||||||
|
|
||||||
|
foreach ($log as $value) {
|
||||||
|
saveLog('executeEvents', 'action', "Execute Events : $value, $sNow ");
|
||||||
|
}
|
||||||
|
|
||||||
|
setExecutionMessage("|- End Execution events");
|
||||||
|
setExecutionResultMessage("Processed $n");
|
||||||
|
//saveLog('executeEvents', 'action', $res );
|
||||||
|
} catch (Exception $oError) {
|
||||||
|
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||||
|
eprintln(" '-".$oError->getMessage(), 'red');
|
||||||
|
saveLog('calculateAlertsDueDate', 'Error', 'Error Executing Events: ' . $oError->getMessage());
|
||||||
}
|
}
|
||||||
setExecutionResultMessage('DONE');
|
|
||||||
} catch(Exception $oError){
|
|
||||||
setExecutionResultMessage('WITH ERRORS', 'error');
|
|
||||||
eprintln(" '-".$oError->getMessage(), 'red');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveLog($sSource, $sType, $sDescription) {
|
function executeScheduledCases($sNow=null)
|
||||||
try {
|
{
|
||||||
global $isDebug;
|
try {
|
||||||
if ( $isDebug )
|
global $sFilter;
|
||||||
print date('H:i:s') ." ($sSource) $sType $sDescription <br>\n";
|
global $sNow;
|
||||||
@fwrite($oFile, date('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n");
|
|
||||||
|
$log = array();
|
||||||
G::verifyPath(PATH_DATA . 'log' . PATH_SEP, true);
|
|
||||||
if ($sType == 'action') {
|
if ($sFilter != '' && strpos($sFilter, 'scheduler') === false) {
|
||||||
$oFile = @fopen(PATH_DATA . 'log' . PATH_SEP . 'cron.log', 'a+');
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
setExecutionMessage("Executing the scheduled starting cases");
|
||||||
|
setExecutionResultMessage('PROCESSING');
|
||||||
|
|
||||||
|
$sNow = isset($sNow)? $sNow : date('Y-m-d H:i:s');
|
||||||
|
|
||||||
|
$oCaseScheduler = new CaseScheduler();
|
||||||
|
$oCaseScheduler->caseSchedulerCron($sNow, $log);
|
||||||
|
|
||||||
|
foreach ($log as $value) {
|
||||||
|
saveLog('executeScheduledCases', 'action', "OK Case# $value");
|
||||||
|
}
|
||||||
|
|
||||||
|
setExecutionResultMessage('DONE');
|
||||||
|
} catch (Exception $oError) {
|
||||||
|
setExecutionResultMessage('WITH ERRORS', 'error');
|
||||||
|
eprintln(" '-".$oError->getMessage(), 'red');
|
||||||
}
|
}
|
||||||
else {
|
}
|
||||||
$oFile = @fopen(PATH_DATA . 'log' . PATH_SEP . 'cronError.log', 'a+');
|
|
||||||
|
function executeUpdateAppTitle()
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$criteriaConf = new Criteria("workflow");
|
||||||
|
|
||||||
|
$criteriaConf->addSelectColumn(ConfigurationPeer::OBJ_UID);
|
||||||
|
$criteriaConf->addSelectColumn(ConfigurationPeer::CFG_VALUE);
|
||||||
|
$criteriaConf->add(ConfigurationPeer::CFG_UID, "TAS_APP_TITLE_UPDATE");
|
||||||
|
|
||||||
|
$rsCriteriaConf = ConfigurationPeer::doSelectRS($criteriaConf);
|
||||||
|
$rsCriteriaConf->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
setExecutionMessage("Update case labels");
|
||||||
|
saveLog("updateCaseLabels", "action", "Update case labels", "c");
|
||||||
|
|
||||||
|
while ($rsCriteriaConf->next()) {
|
||||||
|
$row = $rsCriteriaConf->getRow();
|
||||||
|
|
||||||
|
$taskUid = $row["OBJ_UID"];
|
||||||
|
$lang = $row["CFG_VALUE"];
|
||||||
|
|
||||||
|
//Update case labels
|
||||||
|
$appcv = new AppCacheView();
|
||||||
|
$appcv->appTitleByTaskCaseLabelUpdate($taskUid, $lang);
|
||||||
|
|
||||||
|
//Delete record
|
||||||
|
$criteria = new Criteria("workflow");
|
||||||
|
|
||||||
|
$criteria->add(ConfigurationPeer::CFG_UID, "TAS_APP_TITLE_UPDATE");
|
||||||
|
$criteria->add(ConfigurationPeer::OBJ_UID, $taskUid);
|
||||||
|
$criteria->add(ConfigurationPeer::CFG_VALUE, $lang);
|
||||||
|
|
||||||
|
$numRowDeleted = ConfigurationPeer::doDelete($criteria);
|
||||||
|
|
||||||
|
saveLog("updateCaseLabels", "action", "OK Task $taskUid");
|
||||||
|
}
|
||||||
|
|
||||||
|
setExecutionResultMessage("DONE");
|
||||||
|
} catch (Exception $e) {
|
||||||
|
setExecutionResultMessage("WITH ERRORS", "error");
|
||||||
|
eprintln(" '-" . $e->getMessage(), "red");
|
||||||
|
saveLog("updateCaseLabels", "error", "Error updating case labels: " . $e->getMessage());
|
||||||
}
|
}
|
||||||
@fwrite($oFile, date('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n");
|
|
||||||
@fclose($oFile);
|
|
||||||
}
|
|
||||||
catch (Exception $oError) {
|
|
||||||
//CONTINUE
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function saveLog($sSource, $sType, $sDescription)
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
global $isDebug;
|
||||||
|
|
||||||
function setExecutionMessage($m){
|
if ($isDebug) {
|
||||||
$len = strlen($m);
|
print date('H:i:s') ." ($sSource) $sType $sDescription <br />\n";
|
||||||
$linesize = 60;
|
}
|
||||||
$rOffset = $linesize - $len;
|
|
||||||
|
|
||||||
eprint("* $m");
|
@fwrite($oFile, date('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n");
|
||||||
for($i=0; $i<$rOffset; $i++) eprint('.');
|
|
||||||
|
G::verifyPath(PATH_DATA . 'log' . PATH_SEP, true);
|
||||||
|
|
||||||
|
if ($sType == 'action') {
|
||||||
|
$oFile = @fopen(PATH_DATA . 'log' . PATH_SEP . 'cron.log', 'a+');
|
||||||
|
} else {
|
||||||
|
$oFile = @fopen(PATH_DATA . 'log' . PATH_SEP . 'cronError.log', 'a+');
|
||||||
|
}
|
||||||
|
|
||||||
|
@fwrite($oFile, date('Y-m-d H:i:s') . '(' . $sSource . ') ' . $sDescription . "\n");
|
||||||
|
@fclose($oFile);
|
||||||
|
} catch (Exception $oError) {
|
||||||
|
//CONTINUE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setExecutionResultMessage($m, $t=''){
|
function setExecutionMessage($m)
|
||||||
$c='green';
|
{
|
||||||
if($t=='error') $c = 'red';
|
$len = strlen($m);
|
||||||
if($t=='info') $c = 'yellow';
|
$linesize = 60;
|
||||||
eprintln("[$m]", $c);
|
$rOffset = $linesize - $len;
|
||||||
|
|
||||||
|
eprint("* $m");
|
||||||
|
|
||||||
|
for ($i = 0; $i < $rOffset; $i++) {
|
||||||
|
eprint('.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setExecutionResultMessage($m, $t='')
|
||||||
|
{
|
||||||
|
$c = 'green';
|
||||||
|
|
||||||
|
if ($t == 'error') {
|
||||||
|
$c = 'red';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($t == 'info') {
|
||||||
|
$c = 'yellow';
|
||||||
|
}
|
||||||
|
|
||||||
|
eprintln("[$m]", $c);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -76,7 +76,7 @@ var saveDataTaskTemporal = function(iForm)
|
|||||||
oTaskData.TAS_TYPE_DAY = getField('TAS_TYPE_DAY').value;
|
oTaskData.TAS_TYPE_DAY = getField('TAS_TYPE_DAY').value;
|
||||||
oTaskData.TAS_CALENDAR = getField('TAS_CALENDAR').value;
|
oTaskData.TAS_CALENDAR = getField('TAS_CALENDAR').value;
|
||||||
oTaskData.TAS_TRANSFER_FLY = (getField('TAS_TRANSFER_FLY').checked ? 'TRUE' : 'FALSE');
|
oTaskData.TAS_TRANSFER_FLY = (getField('TAS_TRANSFER_FLY').checked ? 'TRUE' : 'FALSE');
|
||||||
|
|
||||||
var fieldEval = new input(getField('TAS_DURATION'));
|
var fieldEval = new input(getField('TAS_DURATION'));
|
||||||
if (getField('TAS_DURATION').value.trim() == '') {
|
if (getField('TAS_DURATION').value.trim() == '') {
|
||||||
fieldEval.failed();
|
fieldEval.failed();
|
||||||
@@ -178,45 +178,73 @@ var saveDataTaskTemporal = function(iForm)
|
|||||||
var saveTaskData = function(oForm, iForm, iType)
|
var saveTaskData = function(oForm, iForm, iType)
|
||||||
{
|
{
|
||||||
iLastTab = iForm;
|
iLastTab = iForm;
|
||||||
if ( !saveDataTaskTemporal(iForm)) {
|
|
||||||
|
if (!saveDataTaskTemporal(iForm)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
oTaskData.TAS_UID = getField('TAS_UID').value;
|
|
||||||
/* while (oTaskData.TAS_TITLE.charAt(0)==' '){
|
|
||||||
oTaskData.TAS_TITLE = oTaskData.TAS_TITLE.substring(1,oTaskData.TAS_TITLE.length) ;
|
|
||||||
} */
|
|
||||||
oTaskData.TAS_TITLE=oTaskData.TAS_TITLE.trim();
|
|
||||||
if(oTaskData.TAS_TITLE==''){
|
|
||||||
alert(G_STRINGS.ID_REQ_TITLE );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var sParameters = 'function=saveTaskData';
|
oTaskData.TAS_UID = getField("TAS_UID").value;
|
||||||
|
|
||||||
|
/*
|
||||||
|
while (oTaskData.TAS_TITLE.charAt(0)==" "){
|
||||||
|
oTaskData.TAS_TITLE = oTaskData.TAS_TITLE.substring(1,oTaskData.TAS_TITLE.length) ;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
oTaskData.TAS_TITLE = oTaskData.TAS_TITLE.trim();
|
||||||
|
|
||||||
|
if (oTaskData.TAS_TITLE == "") {
|
||||||
|
alert(G_STRINGS.ID_REQ_TITLE );
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Set AJAX
|
||||||
|
var sParameters = "function=saveTaskData";
|
||||||
|
|
||||||
var oRPC = new leimnud.module.rpc.xmlhttp({
|
var oRPC = new leimnud.module.rpc.xmlhttp({
|
||||||
url : '../tasks/tasks_Ajax',
|
url: "../tasks/tasks_Ajax",
|
||||||
async : false,
|
method: "POST",
|
||||||
method: 'POST',
|
args: sParameters + "&oData=" + oTaskData.toJSONString()
|
||||||
args : sParameters + '&oData=' + oTaskData.toJSONString()
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
oRPC.callback = function (rpc) {
|
||||||
|
var res = rpc.xmlhttp.responseText.parseJSON();
|
||||||
|
|
||||||
|
if (oTaskData.TAS_TITLE) {
|
||||||
|
Pm.data.db.task[getField("INDEX").value].label = Pm.data.db.task[getField("INDEX").value].object.elements.label.innerHTML = oTaskData.TAS_TITLE.replace(re2, "&");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (oTaskData.TAS_START) {
|
||||||
|
oTaskData.TAS_START = ((oTaskData.TAS_START == "TRUE")? true : false);
|
||||||
|
Pm.data.render.setTaskINI({task: oTaskData.TAS_UID, value: oTaskData.TAS_START});
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
var option = {
|
||||||
|
label: changesSavedLabel
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (res.status) {
|
||||||
|
case "CRONCL":
|
||||||
|
option = {
|
||||||
|
label: changesSavedLabel + "<br /><br />" + _("APP_TITLE_CASE_LABEL_UPDATE"),
|
||||||
|
width: 350,
|
||||||
|
height: 175
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
new leimnud.module.app.info().make(option);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
//No show confirmation
|
||||||
|
}
|
||||||
|
|
||||||
|
Pm.tmp.propertiesPanel.remove();
|
||||||
|
}.extend(this);
|
||||||
|
|
||||||
oRPC.make();
|
oRPC.make();
|
||||||
if (oTaskData.TAS_TITLE)
|
|
||||||
{
|
|
||||||
Pm.data.db.task[getField('INDEX').value].label = Pm.data.db.task[getField('INDEX').value].object.elements.label.innerHTML = oTaskData.TAS_TITLE.replace(re2, "&");
|
|
||||||
}
|
|
||||||
if (oTaskData.TAS_START)
|
|
||||||
{
|
|
||||||
oTaskData.TAS_START = (oTaskData.TAS_START == 'TRUE' ? true : false);
|
|
||||||
Pm.data.render.setTaskINI({task: oTaskData.TAS_UID, value: oTaskData.TAS_START});
|
|
||||||
}
|
|
||||||
try {
|
|
||||||
new leimnud.module.app.info().make( {
|
|
||||||
label: changesSavedLabel
|
|
||||||
});
|
|
||||||
}
|
|
||||||
catch (e) {
|
|
||||||
// No show confirmation
|
|
||||||
}
|
|
||||||
Pm.tmp.propertiesPanel.remove();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
var showTriggers = function(sStep, sType)
|
var showTriggers = function(sStep, sType)
|
||||||
|
|||||||
@@ -1,87 +1,81 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
|
||||||
* tasks_Ajax.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
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
try {
|
try {
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
switch ($RBAC->userCanAccess('PM_FACTORY')) {
|
|
||||||
case -2:
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
break;
|
|
||||||
case -1:
|
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
|
||||||
G::header('location: ../login/login');
|
|
||||||
die;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
$oJSON = new Services_JSON();
|
switch ($RBAC->userCanAccess('PM_FACTORY')) {
|
||||||
$aData = get_object_vars($oJSON->decode($_POST['oData']));
|
case -2:
|
||||||
if(isset($_POST['function']))
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||||
$sAction = $_POST['function'];
|
G::header('location: ../login/login');
|
||||||
else
|
die;
|
||||||
$sAction = $_POST['functions'];
|
break;
|
||||||
|
case -1:
|
||||||
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
|
G::header('location: ../login/login');
|
||||||
|
die;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($sAction) {
|
$oJSON = new Services_JSON();
|
||||||
case 'saveTaskData':
|
$aData = get_object_vars($oJSON->decode($_POST['oData']));
|
||||||
require_once 'classes/model/Task.php';
|
|
||||||
$oTask = new Task();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* routine to replace @amp@ by &
|
|
||||||
* that why the char "&" can't be passed by XmlHttpRequest directly
|
|
||||||
* @autor erik <erik@colosa.com>
|
|
||||||
*/
|
|
||||||
foreach($aData as $k=>$v) {
|
|
||||||
$aData[$k] = str_replace('@amp@', '&', $v);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($aData['SEND_EMAIL'])) {
|
|
||||||
$aData['TAS_SEND_LAST_EMAIL'] = $aData['SEND_EMAIL'] == 'TRUE' ? 'TRUE' : 'FALSE';
|
|
||||||
} else {
|
|
||||||
$aData['TAS_SEND_LAST_EMAIL'] = 'FALSE';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Additional configuration
|
|
||||||
if (isset($aData['TAS_DEF_MESSAGE_TYPE']) && isset($aData['TAS_DEF_MESSAGE_TEMPLATE'])) {
|
|
||||||
G::loadClass('configuration');
|
|
||||||
$oConf = new Configurations;
|
|
||||||
$oConf->aConfig = Array(
|
|
||||||
'TAS_DEF_MESSAGE_TYPE' => $aData['TAS_DEF_MESSAGE_TYPE'],
|
|
||||||
'TAS_DEF_MESSAGE_TEMPLATE'=> $aData['TAS_DEF_MESSAGE_TEMPLATE']
|
|
||||||
);
|
|
||||||
$oConf->saveConfig('TAS_EXTRA_PROPERTIES', $aData['TAS_UID'], '', '');
|
|
||||||
unset($aData['TAS_DEF_MESSAGE_TYPE']);
|
|
||||||
unset($aData['TAS_DEF_MESSAGE_TEMPLATE']);
|
|
||||||
}
|
|
||||||
|
|
||||||
$oTask->update($aData);
|
if (isset($_POST['function'])) {
|
||||||
break;
|
$sAction = $_POST['function'];
|
||||||
}
|
} else {
|
||||||
|
$sAction = $_POST['functions'];
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($sAction) {
|
||||||
|
case "saveTaskData":
|
||||||
|
require_once ("classes/model/Task.php");
|
||||||
|
|
||||||
|
$response = array();
|
||||||
|
|
||||||
|
$oTask = new Task();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* routine to replace @amp@ by &
|
||||||
|
* that why the char "&" can't be passed by XmlHttpRequest directly
|
||||||
|
* @autor erik <erik@colosa.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
foreach ($aData as $k => $v) {
|
||||||
|
$aData[$k] = str_replace('@amp@', '&', $v);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($aData['SEND_EMAIL'])) {
|
||||||
|
$aData['TAS_SEND_LAST_EMAIL'] = $aData['SEND_EMAIL'] == 'TRUE' ? 'TRUE' : 'FALSE';
|
||||||
|
} else {
|
||||||
|
$aData['TAS_SEND_LAST_EMAIL'] = 'FALSE';
|
||||||
|
}
|
||||||
|
|
||||||
|
//Additional configuration
|
||||||
|
if (isset($aData['TAS_DEF_MESSAGE_TYPE']) && isset($aData['TAS_DEF_MESSAGE_TEMPLATE'])) {
|
||||||
|
G::LoadClass('configuration');
|
||||||
|
|
||||||
|
$oConf = new Configurations();
|
||||||
|
$oConf->aConfig = array(
|
||||||
|
'TAS_DEF_MESSAGE_TYPE' => $aData['TAS_DEF_MESSAGE_TYPE'],
|
||||||
|
'TAS_DEF_MESSAGE_TEMPLATE' => $aData['TAS_DEF_MESSAGE_TEMPLATE']
|
||||||
|
);
|
||||||
|
|
||||||
|
$oConf->saveConfig('TAS_EXTRA_PROPERTIES', $aData['TAS_UID'], '', '');
|
||||||
|
|
||||||
|
unset($aData['TAS_DEF_MESSAGE_TYPE']);
|
||||||
|
unset($aData['TAS_DEF_MESSAGE_TEMPLATE']);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $oTask->update($aData);
|
||||||
|
|
||||||
|
$response["status"] = "OK";
|
||||||
|
|
||||||
|
if ($result == 3) {
|
||||||
|
$response["status"] = "CRONCL";
|
||||||
|
}
|
||||||
|
|
||||||
|
echo G::json_encode($response);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} catch (Exception $oException) {
|
||||||
|
die($oException->getMessage());
|
||||||
}
|
}
|
||||||
catch (Exception $oException) {
|
|
||||||
die($oException->getMessage());
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* usersGroups.php
|
* usersGroups.php
|
||||||
*
|
*
|
||||||
@@ -22,33 +23,34 @@
|
|||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
if (($RBAC_Response=$RBAC->userCanAccess("PM_LOGIN"))!=1) return $RBAC_Response;
|
if (($RBAC_Response = $RBAC->userCanAccess("PM_LOGIN")) != 1) {
|
||||||
|
return $RBAC_Response;
|
||||||
|
}
|
||||||
global $RBAC;
|
global $RBAC;
|
||||||
|
|
||||||
$access = $RBAC->userCanAccess('PM_USERS');
|
$access = $RBAC->userCanAccess('PM_USERS');
|
||||||
if( $access != 1 ){
|
if ($access != 1) {
|
||||||
switch ($access)
|
switch ($access) {
|
||||||
{
|
case -1:
|
||||||
case -1:
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::header('location: ../login/login');
|
||||||
G::header('location: ../login/login');
|
die;
|
||||||
die;
|
break;
|
||||||
break;
|
case -2:
|
||||||
case -2:
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels');
|
G::header('location: ../login/login');
|
||||||
G::header('location: ../login/login');
|
die;
|
||||||
die;
|
break;
|
||||||
break;
|
default:
|
||||||
default:
|
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
||||||
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
|
G::header('location: ../login/login');
|
||||||
G::header('location: ../login/login');
|
die;
|
||||||
die;
|
break;
|
||||||
break;
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$G_MAIN_MENU = 'processmaker';
|
$G_MAIN_MENU = 'processmaker';
|
||||||
$G_SUB_MENU = 'users';
|
$G_SUB_MENU = 'users';
|
||||||
$G_ID_MENU_SELECTED = 'USERS';
|
$G_ID_MENU_SELECTED = 'USERS';
|
||||||
$G_ID_SUB_MENU_SELECTED = 'USERS';
|
$G_ID_SUB_MENU_SELECTED = 'USERS';
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher;
|
$G_PUBLISH = new Publisher;
|
||||||
@@ -69,10 +71,16 @@ $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
|||||||
$oDataset->next();
|
$oDataset->next();
|
||||||
$aRow = $oDataset->getRow();
|
$aRow = $oDataset->getRow();
|
||||||
|
|
||||||
switch($_REQUEST['type']){
|
switch ($_REQUEST['type']) {
|
||||||
case 'summary': $ctab = 0; break;
|
case 'summary':
|
||||||
case 'group': $ctab = 1; break;
|
$ctab = 0;
|
||||||
case 'auth': $ctab = 2; break;
|
break;
|
||||||
|
case 'group':
|
||||||
|
$ctab = 1;
|
||||||
|
break;
|
||||||
|
case 'auth':
|
||||||
|
$ctab = 2;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$users = Array();
|
$users = Array();
|
||||||
@@ -83,11 +91,12 @@ $users['USR_USERNAME'] = $aRow['USR_USERNAME'];
|
|||||||
$users['fullNameFormat'] = $Config['fullNameFormat'];
|
$users['fullNameFormat'] = $Config['fullNameFormat'];
|
||||||
$users['CURRENT_TAB'] = $ctab;
|
$users['CURRENT_TAB'] = $ctab;
|
||||||
|
|
||||||
$oHeadPublisher =& headPublisher::getSingleton();
|
$oHeadPublisher = & headPublisher::getSingleton();
|
||||||
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
|
$oHeadPublisher->addExtJsScript('users/usersGroups', false); //adding a javascript file .js
|
||||||
// $oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
|
// $oHeadPublisher->addContent('users/usersGroups'); //adding a html file .html.
|
||||||
$oHeadPublisher->assign('USERS', $users);
|
$oHeadPublisher->assign('USERS', $users);
|
||||||
|
|
||||||
$oHeadPublisher->assign('hasAuthPerm', ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1));
|
$oHeadPublisher->assign('hasAuthPerm', ($RBAC->userCanAccess('PM_SETUP_ADVANCE') == 1));
|
||||||
|
|
||||||
G::RenderPage('publish', 'extJs');
|
G::RenderPage('publish', 'extJs');
|
||||||
|
|
||||||
@@ -1,149 +1,164 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* triggers_CreateWizard.php
|
* triggers_CreateWizard.php
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Affero General Public License for more details.
|
* GNU Affero General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
G::LoadClass ( 'triggerLibrary' );
|
G::LoadClass ( 'triggerLibrary' );
|
||||||
$triggerLibrary = triggerLibrary::getSingleton ();
|
$triggerLibrary = triggerLibrary::getSingleton ();
|
||||||
$libraryClassName = $_GET ['LIBRARY'];
|
$libraryClassName = $_GET ['LIBRARY'];
|
||||||
$libraryMethod = $_GET ['NAME_FUN'];
|
$libraryMethod = $_GET ['NAME_FUN'];
|
||||||
$sProUid = $_GET ['PRO_UID'];
|
$sProUid = $_GET ['PRO_UID'];
|
||||||
$libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName );
|
$libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName );
|
||||||
|
|
||||||
$libraryName = $libraryO->info ['name'];
|
$libraryName = $libraryO->info ['name'];
|
||||||
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) );
|
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) );
|
||||||
$libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "") ? $libraryO->info ['icon'] : "/images/browse.gif";
|
$libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "")
|
||||||
$aDataTrigger = $_GET;
|
? $libraryO->info ['icon'] : "/images/browse.gif";
|
||||||
|
$aDataTrigger = $_GET;
|
||||||
$sProUid = $aDataTrigger ['PRO_UID'];
|
|
||||||
$sNameFun = $aDataTrigger ['NAME_FUN'];
|
$sProUid = $aDataTrigger ['PRO_UID'];
|
||||||
|
$sNameFun = $aDataTrigger ['NAME_FUN'];
|
||||||
$methodObject = $libraryO->methods [$sNameFun];
|
|
||||||
|
$methodObject = $libraryO->methods [$sNameFun];
|
||||||
$methodName = $methodObject->info ['name'];
|
|
||||||
$methodLabel = $methodObject->info ['label'];
|
$methodName = $methodObject->info ['name'];
|
||||||
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) );
|
$methodLabel = $methodObject->info ['label'];
|
||||||
$methodReturn = $methodObject->info ['return'];
|
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) );
|
||||||
$methodParameters = array_keys ( $methodObject->params );
|
$methodReturn = $methodObject->info ['return'];
|
||||||
$methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "") ? $methodObject->info ['link'] : "";
|
$methodParameters = array_keys ( $methodObject->params );
|
||||||
$methodreturnA = explode ( "|", $methodReturn );
|
$methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "")
|
||||||
|
? $methodObject->info ['link'] : "";
|
||||||
$bReturnValue = true;
|
|
||||||
$displayMode = 'display:block';
|
$methodreturnA = explode ( "|", $methodReturn );
|
||||||
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
|
|
||||||
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
|
$bReturnValue = true;
|
||||||
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1])) && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
|
$displayMode = 'display:block';
|
||||||
$methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1];
|
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )
|
||||||
$methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]);
|
? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
|
||||||
}
|
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
|
||||||
else {
|
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1]))
|
||||||
$bReturnValue = false;
|
&& (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
|
||||||
$displayMode = 'display:none';
|
$methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )
|
||||||
}
|
? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1];
|
||||||
$aParametersFun = $methodParameters;
|
$methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]);
|
||||||
$triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_CreateWizard.html';
|
} else {
|
||||||
$template = new TemplatePower ( $triggerWizardTemplate );
|
$bReturnValue = false;
|
||||||
$template->prepare ();
|
$displayMode = 'display:none';
|
||||||
|
}
|
||||||
$tds = '';
|
$aParametersFun = $methodParameters;
|
||||||
$nrows = 2;
|
$triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_CreateWizard.html';
|
||||||
|
$template = new TemplatePower ( $triggerWizardTemplate );
|
||||||
$template->assign ( 'LIBRARY_NAME', $libraryName );
|
$template->prepare ();
|
||||||
$template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription );
|
|
||||||
$template->assign ( 'LIBRARY_ICON', $libraryIcon );
|
$tds = '';
|
||||||
$template->assign ( 'LIBRARY_CLASS', $libraryClassName );
|
$nrows = 2;
|
||||||
if ($methodLink != "") {
|
|
||||||
$template->newBlock ( 'methodLink' );
|
$template->assign ( 'LIBRARY_NAME', $libraryName );
|
||||||
$template->assign ( 'LIBRARY_METHOD_LINK', $methodLink );
|
$template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription );
|
||||||
$template->assign ( 'MORE_INFO', G::LoadTranslation ( 'ID_MORE_INFO' ) );
|
$template->assign ( 'LIBRARY_ICON', $libraryIcon );
|
||||||
$template->gotoBlock ( '_ROOT' );
|
$template->assign ( 'LIBRARY_CLASS', $libraryClassName );
|
||||||
}
|
if ($methodLink != "") {
|
||||||
|
$template->newBlock ( 'methodLink' );
|
||||||
$template->assign ( 'PMFUNTION', $sNameFun );
|
$template->assign ( 'LIBRARY_METHOD_LINK', $methodLink );
|
||||||
$template->assign ( 'PMFUNTION_LABEL', $methodLabel );
|
$template->assign ( 'MORE_INFO', G::LoadTranslation ( 'ID_MORE_INFO' ) );
|
||||||
$template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription );
|
$template->gotoBlock ( '_ROOT' );
|
||||||
$template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) );
|
}
|
||||||
$template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) );
|
|
||||||
$template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) );
|
$template->assign ( 'PMFUNTION', $sNameFun );
|
||||||
$template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) );
|
$template->assign ( 'PMFUNTION_LABEL', $methodLabel );
|
||||||
if ( $bReturnValue ) {
|
$template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription );
|
||||||
$template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) );
|
$template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) );
|
||||||
}
|
$template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) );
|
||||||
$template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) );
|
$template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) );
|
||||||
$template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 );
|
$template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) );
|
||||||
$template->assign ( 'TRIGGER_INFORMATION', 'Trigger Information' );
|
if ( $bReturnValue ) {
|
||||||
$template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardSave' );
|
$template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) );
|
||||||
$template->assign ( 'PRO_UID', $sProUid );
|
}
|
||||||
$template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] );
|
$template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) );
|
||||||
$template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel );
|
$template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 );
|
||||||
$template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) );
|
$template->assign ( 'TRIGGER_INFORMATION', 'Trigger Information' );
|
||||||
$template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) );
|
$template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardSave' );
|
||||||
$template->assign ( 'DISPLAY_MODE', $displayMode );
|
$template->assign ( 'PRO_UID', $sProUid );
|
||||||
|
$template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] );
|
||||||
$sPMfunction = $sNameFun . " (";
|
$template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel );
|
||||||
$methodParametersOnlyNames = array ();
|
$template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) );
|
||||||
if (count ( $aParametersFun ) > 0) {
|
$template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) );
|
||||||
$template->newBlock ( 'paremetersTriggersGroup' );
|
$template->assign ( 'DISPLAY_MODE', $displayMode );
|
||||||
$template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) );
|
|
||||||
foreach ( $aParametersFun as $k => $v ) {
|
$sPMfunction = $sNameFun . " (";
|
||||||
if ($v != '') {
|
$methodParametersOnlyNames = array ();
|
||||||
$aParametersFunA = explode ( "|", $v );
|
if (count ( $aParametersFun ) > 0) {
|
||||||
$paramType = $aParametersFunA [0];
|
$template->newBlock ( 'paremetersTriggersGroup' );
|
||||||
$paramDefinition = $aParametersFunA [1];
|
$template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) );
|
||||||
$paramDefinitionA = explode ( "=", $paramDefinition );
|
foreach ($aParametersFun as $k => $v) {
|
||||||
$paramName = $paramDefinitionA [0];
|
if ($v != '') {
|
||||||
$methodParametersOnlyNames [] = $paramName;
|
$aParametersFunA = explode ( "|", $v );
|
||||||
$paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : "";
|
$paramType = $aParametersFunA [0];
|
||||||
$paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName;
|
$paramDefinition = $aParametersFunA [1];
|
||||||
$paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : "";
|
$paramDefinitionA = explode ( "=", $paramDefinition );
|
||||||
$sPMfunction .= ($nrows != 2) ? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"' : '"' . trim ( str_replace ( "$", "", $paramName ) . '"' );
|
$paramName = $paramDefinitionA [0];
|
||||||
$template->newBlock ( 'paremetersTriggers' );
|
$methodParametersOnlyNames [] = $paramName;
|
||||||
$template->assign ( 'LABEL_PARAMETER', $paramLabel );
|
$paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : "";
|
||||||
$template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) );
|
$paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName;
|
||||||
$sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name';
|
$paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : "";
|
||||||
$sNameTag = trim ( $sNameTag );
|
$sPMfunction .= ($nrows != 2)
|
||||||
$template->assign ( 'SNAMETAG', $sNameTag );
|
? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"'
|
||||||
$tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , \"$sProUid\" , \"@@\");return;' >";
|
: '"' . trim ( str_replace ( "$", "", $paramName ) . '"' );
|
||||||
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
|
|
||||||
$template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "", str_replace ( '"', '', $paramDefaultValue ) ) );
|
$template->newBlock ( 'paremetersTriggers' );
|
||||||
$fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":"";
|
$template->assign ( 'LABEL_PARAMETER', $paramLabel );
|
||||||
$fieldDescription .= $paramDefaultValue != "" ? $paramDefaultValue . " | " . $paramType : G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType;
|
$template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) );
|
||||||
$template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription );
|
$sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name';
|
||||||
$nrows ++;
|
$sNameTag = trim ( $sNameTag );
|
||||||
}
|
$template->assign ( 'SNAMETAG', $sNameTag );
|
||||||
}
|
$tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' "
|
||||||
|
. "onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , "
|
||||||
}
|
. " \"$sProUid\" , \"@@\");return;' >";
|
||||||
$template->gotoBlock ( '_ROOT' );
|
|
||||||
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) );
|
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
|
||||||
$sPMfunction .= ");";
|
$template->assign ( 'ADD_TRI_VALUE',
|
||||||
$content = $template->getOutputContent ();
|
str_replace ( "'", "", str_replace ( '"', '', $paramDefaultValue ) ) );
|
||||||
print $content;
|
|
||||||
|
$fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":"";
|
||||||
} catch ( Exception $oException ) {
|
$fieldDescription .= $paramDefaultValue != ""
|
||||||
die ( $oException->getMessage () );
|
? $paramDefaultValue . " | " . $paramType
|
||||||
}
|
: G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType;
|
||||||
unset ( $_SESSION ['PROCESS'] );
|
$template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription );
|
||||||
?>
|
$nrows ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
$template->gotoBlock ( '_ROOT' );
|
||||||
|
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) );
|
||||||
|
$sPMfunction .= ");";
|
||||||
|
$content = $template->getOutputContent ();
|
||||||
|
print $content;
|
||||||
|
|
||||||
|
} catch ( Exception $oException ) {
|
||||||
|
die ( $oException->getMessage () );
|
||||||
|
}
|
||||||
|
unset ($_SESSION ['PROCESS']);
|
||||||
|
|
||||||
@@ -1,154 +1,168 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* triggers_CreateWizard.php
|
* triggers_CreateWizard.php
|
||||||
*
|
*
|
||||||
* ProcessMaker Open Source Edition
|
* ProcessMaker Open Source Edition
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU Affero General Public License as
|
* it under the terms of the GNU Affero General Public License as
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
* License, or (at your option) any later version.
|
* License, or (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This program is distributed in the hope that it will be useful,
|
* This program is distributed in the hope that it will be useful,
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* GNU Affero General Public License for more details.
|
* GNU Affero General Public License for more details.
|
||||||
*
|
*
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
try {
|
try {
|
||||||
G::LoadClass ( 'triggerLibrary' );
|
G::LoadClass ( 'triggerLibrary' );
|
||||||
$triggerLibrary = triggerLibrary::getSingleton ();
|
$triggerLibrary = triggerLibrary::getSingleton ();
|
||||||
$libraryClassName = $_GET ['LIBRARY_CLASS'];
|
$libraryClassName = $_GET ['LIBRARY_CLASS'];
|
||||||
$libraryMethod = $_GET ['PMFUNTION_NAME'];
|
$libraryMethod = $_GET ['PMFUNTION_NAME'];
|
||||||
$sProUid = $_GET ['PRO_UID'];
|
$sProUid = $_GET ['PRO_UID'];
|
||||||
$libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName );
|
$libraryO = $triggerLibrary->getLibraryDefinition ( $libraryClassName );
|
||||||
|
|
||||||
$libraryName = $libraryO->info ['name'];
|
$libraryName = $libraryO->info ['name'];
|
||||||
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) );
|
$libraryDescription = trim ( str_replace ( "*", "", implode ( " ", $libraryO->info ['description'] ) ) );
|
||||||
$libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "") ? $libraryO->info ['icon'] : "/images/browse.gif";
|
$libraryIcon = isset ( $libraryO->info ['icon'] ) && ($libraryO->info ['icon'] != "")
|
||||||
$aDataTrigger = $_GET;
|
? $libraryO->info ['icon'] : "/images/browse.gif";
|
||||||
|
$aDataTrigger = $_GET;
|
||||||
$sProUid = $aDataTrigger ['PRO_UID'];
|
|
||||||
$sNameFun = $aDataTrigger ['PMFUNTION_NAME'];
|
$sProUid = $aDataTrigger ['PRO_UID'];
|
||||||
|
$sNameFun = $aDataTrigger ['PMFUNTION_NAME'];
|
||||||
$methodObject = $libraryO->methods [$sNameFun];
|
|
||||||
|
$methodObject = $libraryO->methods [$sNameFun];
|
||||||
$methodName = $methodObject->info ['name'];
|
|
||||||
$methodLabel = $methodObject->info ['label'];
|
$methodName = $methodObject->info ['name'];
|
||||||
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) );
|
$methodLabel = $methodObject->info ['label'];
|
||||||
$methodReturn = $methodObject->info ['return'];
|
$methodDescription = trim ( str_replace ( "*", "", implode ( " ", $methodObject->info ['description'] ) ) );
|
||||||
$methodParameters = array_keys ( $methodObject->params );
|
$methodReturn = $methodObject->info ['return'];
|
||||||
$methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "") ? $methodObject->info ['link'] : "";
|
$methodParameters = array_keys ( $methodObject->params );
|
||||||
$methodreturnA = explode ( "|", $methodReturn );
|
$methodLink = isset ( $methodObject->info ['link'] ) && ($methodObject->info ['link'] != "")
|
||||||
|
? $methodObject->info ['link'] : "";
|
||||||
$bReturnValue = true;
|
$methodreturnA = explode ( "|", $methodReturn );
|
||||||
$displayMode = 'display:block';
|
|
||||||
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
|
$bReturnValue = true;
|
||||||
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
|
$displayMode = 'display:block';
|
||||||
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1])) && (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
|
$methodreturnDescription = (trim(strtoupper($methodreturnA [3])) == strtoupper(G::LoadTranslation ( 'ID_NONE')) )
|
||||||
$methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1];
|
? G::LoadTranslation ( 'ID_NOT_REQUIRED') : $methodreturnA [3];
|
||||||
$methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]);
|
$methodReturnLabel = isset ( $methodreturnA [3] ) ? $methodreturnDescription : $methodReturn;
|
||||||
}
|
if ( (isset($methodreturnA[0]) && isset($methodreturnA[1]))
|
||||||
else {
|
&& (trim(strtoupper($methodreturnA[0]) ) != strtoupper(G::LoadTranslation ( 'ID_NONE')) ) ) {
|
||||||
$bReturnValue = false;
|
$methodReturnLabelRequired = (trim( $methodreturnA[1] ) != "" )
|
||||||
$displayMode = 'display:none';
|
? G::LoadTranslation ( "ID_REQUIRED_FIELD" ) : $methodreturnA[1];
|
||||||
}
|
$methodReturnLabel .= "<br>" . trim( $methodReturnLabelRequired ) . " | " . trim($methodreturnA[0]);
|
||||||
$aParametersFun = $methodParameters;
|
} else {
|
||||||
$triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_EditWizard.html';
|
$bReturnValue = false;
|
||||||
$template = new TemplatePower ( $triggerWizardTemplate );
|
$displayMode = 'display:none';
|
||||||
$template->prepare ();
|
}
|
||||||
|
$aParametersFun = $methodParameters;
|
||||||
$tds = '';
|
$triggerWizardTemplate = PATH_TPL . 'triggers' . PATH_SEP . 'triggers_EditWizard.html';
|
||||||
$nrows = 2;
|
$template = new TemplatePower ( $triggerWizardTemplate );
|
||||||
|
$template->prepare ();
|
||||||
$template->assign ( 'LIBRARY_NAME', $libraryName );
|
|
||||||
$template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription );
|
$tds = '';
|
||||||
$template->assign ( 'LIBRARY_ICON', $libraryIcon );
|
$nrows = 2;
|
||||||
$template->assign ( 'LIBRARY_CLASS', $libraryClassName );
|
|
||||||
if ($methodLink != "") {
|
$template->assign ( 'LIBRARY_NAME', $libraryName );
|
||||||
$template->newBlock ( 'methodLink' );
|
$template->assign ( 'LIBRARY_DESCRIPTION', $libraryDescription );
|
||||||
$template->assign ( 'LIBRARY_METHOD_LINK', $methodLink );
|
$template->assign ( 'LIBRARY_ICON', $libraryIcon );
|
||||||
$template->gotoBlock ( '_ROOT' );
|
$template->assign ( 'LIBRARY_CLASS', $libraryClassName );
|
||||||
}
|
if ($methodLink != "") {
|
||||||
|
$template->newBlock ( 'methodLink' );
|
||||||
$template->assign ( 'PMFUNTION', $sNameFun );
|
$template->assign ( 'LIBRARY_METHOD_LINK', $methodLink );
|
||||||
$template->assign ( 'PMFUNTION_LABEL', $methodLabel );
|
$template->gotoBlock ( '_ROOT' );
|
||||||
$template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription );
|
}
|
||||||
$template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) );
|
|
||||||
$template->assign ( 'TITLE_CONTENT', $_GET['TRI_TITLE'] );
|
$template->assign ( 'PMFUNTION', $sNameFun );
|
||||||
$template->assign ( 'TRI_UID', $_GET['TRI_UID'] );
|
$template->assign ( 'PMFUNTION_LABEL', $methodLabel );
|
||||||
$template->assign ( 'SOURCE_LINK', G::LoadTranslation ( 'ID_TRIGGER_SOURCE_LINK' ) );
|
$template->assign ( 'PMFUNTION_DESCRIPTION', $methodDescription );
|
||||||
$template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) );
|
$template->assign ( 'TITLE', G::LoadTranslation ( 'ID_TITLE' ) );
|
||||||
$template->assign ( 'DESCRIPTION_CONTENT', $_GET['TRI_DESCRIPTION'] );
|
$template->assign ( 'TITLE_CONTENT', $_GET['TRI_TITLE'] );
|
||||||
$template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) );
|
$template->assign ( 'TRI_UID', $_GET['TRI_UID'] );
|
||||||
$template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) );
|
$template->assign ( 'SOURCE_LINK', G::LoadTranslation ( 'ID_TRIGGER_SOURCE_LINK' ) );
|
||||||
if ( $bReturnValue ) {
|
$template->assign ( 'DESCRIPTION', G::LoadTranslation ( 'ID_DESCRIPTION' ) );
|
||||||
$template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) );
|
$template->assign ( 'DESCRIPTION_CONTENT', $_GET['TRI_DESCRIPTION'] );
|
||||||
}
|
$template->assign ( 'DETAILS_LABEL', G::LoadTranslation ( 'ID_DETAILS' ) );
|
||||||
$template->assign ( 'RETURN_VALUE', $_GET['TRI_ANSWER'] );
|
$template->assign ( 'RETURN_TITLE', G::LoadTranslation ( 'ID_TRIGGER_RETURN_TITLE' ) );
|
||||||
$template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) );
|
if ( $bReturnValue ) {
|
||||||
$template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 );
|
$template->assign ( 'RETURN_LABEL', G::LoadTranslation ( 'ID_TRIGGER_RETURN_LABEL' ) );
|
||||||
$template->assign ( 'TRIGGER_INFORMATION', 'Triggers Edit Form' );
|
}
|
||||||
$template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardUpdate' );
|
$template->assign ( 'RETURN_VALUE', $_GET['TRI_ANSWER'] );
|
||||||
$template->assign ( 'PRO_UID', $sProUid );
|
$template->assign ( 'METHOD_LABEL', G::LoadTranslation ( 'ID_METHOD' ) );
|
||||||
$template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] );
|
$template->assign ( 'ROWS', sizeof ( $aParametersFun ) + 3 );
|
||||||
$template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel );
|
$template->assign ( 'TRIGGER_INFORMATION', 'Triggers Edit Form' );
|
||||||
$template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) );
|
$template->assign ( 'TRIGGER_ACTION', '../triggers/triggers_WizardUpdate' );
|
||||||
$template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) );
|
$template->assign ( 'PRO_UID', $sProUid );
|
||||||
$template->assign ( 'DISPLAY_MODE', $displayMode );
|
$template->assign ( 'PAGED_TABLE_ID', $aDataTrigger ['PAGED_TABLE_ID'] );
|
||||||
|
$template->assign ( 'RETURN_DESCRIPTION', $methodReturnLabel );
|
||||||
$sPMfunction = $sNameFun . " (";
|
$template->assign ( 'ID_SAVE', G::LoadTranslation ( 'ID_SAVE' ) );
|
||||||
$methodParametersOnlyNames = array ();
|
$template->assign ( 'ID_CANCEL', G::LoadTranslation ( 'ID_CANCEL' ) );
|
||||||
if (count ( $aParametersFun ) > 0) {
|
$template->assign ( 'DISPLAY_MODE', $displayMode );
|
||||||
$template->newBlock ( 'paremetersTriggersGroup' );
|
|
||||||
$template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) );
|
$sPMfunction = $sNameFun . " (";
|
||||||
foreach ( $aParametersFun as $k => $v ) {
|
$methodParametersOnlyNames = array ();
|
||||||
if ($v != '') {
|
if (count ( $aParametersFun ) > 0) {
|
||||||
$aParametersFunA = explode ( "|", $v );
|
$template->newBlock ( 'paremetersTriggersGroup' );
|
||||||
$paramType = $aParametersFunA [0];
|
$template->assign ( 'PARAMETERS_LABEL', G::LoadTranslation ( 'ID_PARAMETERS' ) );
|
||||||
$paramDefinition = $aParametersFunA [1];
|
foreach ($aParametersFun as $k => $v) {
|
||||||
$paramDefinitionA = explode ( "=", $paramDefinition );
|
if ($v != '') {
|
||||||
$paramName = $paramDefinitionA [0];
|
$aParametersFunA = explode ( "|", $v );
|
||||||
$methodParametersOnlyNames [] = $paramName;
|
$paramType = $aParametersFunA [0];
|
||||||
$paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : "";
|
$paramDefinition = $aParametersFunA [1];
|
||||||
$paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName;
|
$paramDefinitionA = explode ( "=", $paramDefinition );
|
||||||
$paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : "";
|
$paramName = $paramDefinitionA [0];
|
||||||
$sPMfunction .= ($nrows != 2) ? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"' : '"' . trim ( str_replace ( "$", "", $paramName ) . '"' );
|
$methodParametersOnlyNames [] = $paramName;
|
||||||
$template->newBlock ( 'paremetersTriggers' );
|
$paramDefaultValue = isset ( $paramDefinitionA [1] ) ? $paramDefinitionA [1] : "";
|
||||||
$template->assign ( 'LABEL_PARAMETER', $paramLabel );
|
$paramLabel = isset ( $aParametersFunA [2] ) ? $aParametersFunA [2] : $paramName;
|
||||||
$template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) );
|
$paramDescription = isset ( $aParametersFunA [3] ) ? $aParametersFunA [3] : "";
|
||||||
$sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name';
|
$sPMfunction .= ($nrows != 2)
|
||||||
$sNameTag = trim ( $sNameTag );
|
? ', "' . trim ( str_replace ( "$", "", $paramName ) ) . '"'
|
||||||
$template->assign ( 'SNAMETAG', $sNameTag );
|
: '"' . trim ( str_replace ( "$", "", $paramName ) . '"' );
|
||||||
$tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , \"$sProUid\" , \"@@\");return;' >";
|
|
||||||
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
|
$template->newBlock ( 'paremetersTriggers' );
|
||||||
// $template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "", str_replace ( '"', '', $paramDefaultValue ) ) );
|
$template->assign ( 'LABEL_PARAMETER', $paramLabel );
|
||||||
$paramValue = $_GET[trim( str_replace( "$", "", $paramName ) )];
|
$template->assign ( 'OPT_PARAMETER', trim ( str_replace ( "$", "", $paramName ) ) );
|
||||||
$template->assign ( 'ADD_TRI_VALUE', str_replace("\'", "'", $paramValue) );
|
$sNameTag = 'form.' . trim ( str_replace ( "$", "", $paramName ) ) . '.name';
|
||||||
$fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":"";
|
$sNameTag = trim ( $sNameTag );
|
||||||
$fieldDescription .= $paramDefaultValue != "" ? $paramDefaultValue . " | " . $paramType : G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType;
|
$template->assign ( 'SNAMETAG', $sNameTag );
|
||||||
$template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription );
|
$tri_Button = "<input type='button' name='INSERT_VARIABLE' value='@@' "
|
||||||
$nrows ++;
|
. "onclick='showDynaformsFormVars($sNameTag , \"../controls/varsAjax\" , "
|
||||||
}
|
. " \"$sProUid\" , \"@@\");return;' >";
|
||||||
}
|
|
||||||
|
$template->assign ( 'ADD_TRI_VARIABLE', $tri_Button );
|
||||||
}
|
// $template->assign ( 'ADD_TRI_VALUE', str_replace ( "'", "",
|
||||||
$template->gotoBlock ( '_ROOT' );
|
// str_replace ( '"', '', $paramDefaultValue ) ) );
|
||||||
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) );
|
$paramValue = $_GET[trim( str_replace( "$", "", $paramName ) )];
|
||||||
$sPMfunction .= ");";
|
$template->assign ( 'ADD_TRI_VALUE', str_replace("\'", "'", $paramValue) );
|
||||||
$content = $template->getOutputContent ();
|
$fieldDescription = ($paramDescription!="")?$paramDescription . "<br>":"";
|
||||||
print $content;
|
$fieldDescription .= $paramDefaultValue != ""
|
||||||
|
? $paramDefaultValue . " | " . $paramType
|
||||||
} catch ( Exception $oException ) {
|
: G::LoadTranslation ( "ID_REQUIRED_FIELD" ) . " | " . $paramType;
|
||||||
die ( $oException->getMessage () );
|
|
||||||
}
|
$template->assign ( 'ADD_TRI_DESCRIPTION', $fieldDescription );
|
||||||
unset ( $_SESSION ['PROCESS'] );
|
$nrows ++;
|
||||||
?>
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
$template->gotoBlock ( '_ROOT' );
|
||||||
|
$template->assign ( 'ALLFUNCTION', implode ( ",", $methodParametersOnlyNames ) );
|
||||||
|
$sPMfunction .= ");";
|
||||||
|
$content = $template->getOutputContent ();
|
||||||
|
print $content;
|
||||||
|
|
||||||
|
} catch ( Exception $oException ) {
|
||||||
|
die ( $oException->getMessage () );
|
||||||
|
}
|
||||||
|
unset ( $_SESSION ['PROCESS'] );
|
||||||
|
|
||||||
Reference in New Issue
Block a user