BUG 0000 Adjustment for the standardization of code. CODE_STYLE
This commit is contained in:
@@ -1,53 +1,49 @@
|
||||
<?php
|
||||
try {
|
||||
$form = $_POST['form'];
|
||||
$FolderUid = $form['FOLDER_UID'];
|
||||
$FolderParentUid = $form['FOLDER_PARENT_UID'];
|
||||
$FolderName = $form['FOLDER_NAME'];
|
||||
$FolderCreateDate = 'now';
|
||||
$FolderUpdateDate = 'now';
|
||||
<?php
|
||||
|
||||
try {
|
||||
$form = $_POST['form'];
|
||||
$FolderUid = $form['FOLDER_UID'];
|
||||
$FolderParentUid = $form['FOLDER_PARENT_UID'];
|
||||
$FolderName = $form['FOLDER_NAME'];
|
||||
$FolderCreateDate = 'now';
|
||||
$FolderUpdateDate = 'now';
|
||||
|
||||
|
||||
require_once ( "classes/model/AppFolder.php" );
|
||||
require_once ( "classes/model/AppFolder.php" );
|
||||
|
||||
//if exists the row in the database propel will update it, otherwise will insert.
|
||||
$tr = AppFolderPeer::retrieveByPK( $FolderUid );
|
||||
if ( ! ( is_object ( $tr ) && get_class ($tr) == 'AppFolder' ) ) {
|
||||
$tr = new AppFolder();
|
||||
}
|
||||
$tr->setFolderUid( $FolderUid );
|
||||
$tr->setFolderParentUid( $FolderParentUid );
|
||||
$tr->setFolderName( $FolderName );
|
||||
$tr->setFolderCreateDate( $FolderCreateDate );
|
||||
$tr->setFolderUpdateDate( $FolderUpdateDate );
|
||||
//if exists the row in the database propel will update it, otherwise will insert.
|
||||
$tr = AppFolderPeer::retrieveByPK($FolderUid);
|
||||
if (!( is_object($tr) && get_class($tr) == 'AppFolder' )) {
|
||||
$tr = new AppFolder();
|
||||
}
|
||||
$tr->setFolderUid($FolderUid);
|
||||
$tr->setFolderParentUid($FolderParentUid);
|
||||
$tr->setFolderName($FolderName);
|
||||
$tr->setFolderCreateDate($FolderCreateDate);
|
||||
$tr->setFolderUpdateDate($FolderUpdateDate);
|
||||
|
||||
if ($tr->validate() ) {
|
||||
// we save it, since we get no validation errors, or do whatever else you like.
|
||||
$res = $tr->save();
|
||||
}
|
||||
else {
|
||||
// Something went wrong. We can now get the validationFailures and handle them.
|
||||
$msg = '';
|
||||
$validationFailuresArray = $tr->getValidationFailures();
|
||||
foreach($validationFailuresArray as $objValidationFailure) {
|
||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||
}
|
||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
||||
}
|
||||
if ($tr->validate()) {
|
||||
// we save it, since we get no validation errors, or do whatever else you like.
|
||||
$res = $tr->save();
|
||||
} else {
|
||||
// Something went wrong. We can now get the validationFailures and handle them.
|
||||
$msg = '';
|
||||
$validationFailuresArray = $tr->getValidationFailures();
|
||||
foreach ($validationFailuresArray as $objValidationFailure) {
|
||||
$msg .= $objValidationFailure->getMessage() . "<br/>";
|
||||
}
|
||||
//return array ( 'codError' => -100, 'rowsAffected' => 0, 'message' => $msg );
|
||||
}
|
||||
//return array ( 'codError' => 0, 'rowsAffected' => $res, 'message' => '');
|
||||
|
||||
//to do: uniform coderror structures for all classes
|
||||
|
||||
//if ( $res['codError'] < 0 ) {
|
||||
// G::SendMessageText ( $res['message'] , 'error' );
|
||||
//}
|
||||
G::Header('location: appFolderList');
|
||||
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
//if ( $res['codError'] < 0 ) {
|
||||
// G::SendMessageText ( $res['message'] , 'error' );
|
||||
//}
|
||||
G::Header('location: appFolderList');
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher;
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||
G::RenderPage('publish', 'blank');
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @date Jan 3th, 2010
|
||||
*/
|
||||
|
||||
//require_once 'classes/model/Application.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/AppThread.php';
|
||||
@@ -38,26 +37,26 @@
|
||||
class Ajax
|
||||
{
|
||||
|
||||
public function getCaseMenu ($params)
|
||||
public function getCaseMenu($params)
|
||||
{
|
||||
|
||||
G::LoadClass( "configuration" );
|
||||
G::LoadClass( "case" );
|
||||
G::LoadClass("configuration");
|
||||
G::LoadClass("case");
|
||||
global $G_TMP_MENU;
|
||||
global $sStatus;
|
||||
$sStatus = $params['app_status'];
|
||||
$oCase = new Cases();
|
||||
$conf = new Configurations();
|
||||
$oMenu = new Menu();
|
||||
$oMenu->load( 'caseOptions' );
|
||||
$oMenu->load('caseOptions');
|
||||
|
||||
$menuOptions = Array ();
|
||||
$menuOptions = Array();
|
||||
foreach ($oMenu->Options as $i => $action) {
|
||||
$option = Array ('id' => $oMenu->Id[$i],'label' => $oMenu->Labels[$i],'action' => $action);
|
||||
$option = Array('id' => $oMenu->Id[$i], 'label' => $oMenu->Labels[$i], 'action' => $action);
|
||||
|
||||
switch ($option['id']) {
|
||||
case 'STEPS':
|
||||
$option['options'] = Array ();
|
||||
$option['options'] = Array();
|
||||
break;
|
||||
case 'ACTIONS':
|
||||
$option['options'] = $this->getActionOptions();
|
||||
@@ -69,20 +68,20 @@ class Ajax
|
||||
$menuOptions[] = $option;
|
||||
}
|
||||
|
||||
echo G::json_encode( $menuOptions );
|
||||
echo G::json_encode($menuOptions);
|
||||
}
|
||||
|
||||
public function steps ()
|
||||
public function steps()
|
||||
{
|
||||
G::LoadClass( 'applications' );
|
||||
G::LoadClass('applications');
|
||||
$applications = new Applications();
|
||||
|
||||
$proUid = isset( $_SESSION['PROCESS'] ) ? $_SESSION['PROCESS'] : '';
|
||||
$tasUid = isset( $_SESSION['TASK'] ) ? $_SESSION['TASK'] : '';
|
||||
$appUid = isset( $_SESSION['APPLICATION'] ) ? $_SESSION['APPLICATION'] : '';
|
||||
$index = isset( $_SESSION['INDEX'] ) ? $_SESSION['INDEX'] : '';
|
||||
$steps = $applications->getSteps( $appUid, $index, $tasUid, $proUid );
|
||||
$list = array ();
|
||||
$proUid = isset($_SESSION['PROCESS']) ? $_SESSION['PROCESS'] : '';
|
||||
$tasUid = isset($_SESSION['TASK']) ? $_SESSION['TASK'] : '';
|
||||
$appUid = isset($_SESSION['APPLICATION']) ? $_SESSION['APPLICATION'] : '';
|
||||
$index = isset($_SESSION['INDEX']) ? $_SESSION['INDEX'] : '';
|
||||
$steps = $applications->getSteps($appUid, $index, $tasUid, $proUid);
|
||||
$list = array();
|
||||
|
||||
foreach ($steps as $step) {
|
||||
$item['id'] = $item['idtodraw'] = $step['id'];
|
||||
@@ -112,89 +111,89 @@ class Ajax
|
||||
$list[] = $item;
|
||||
}
|
||||
|
||||
echo G::json_encode( $list );
|
||||
echo G::json_encode($list);
|
||||
}
|
||||
|
||||
public function getInformationOptions ()
|
||||
public function getInformationOptions()
|
||||
{
|
||||
$options = Array ();
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_MAP' ),'fn' => 'processMap' );
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PROCESS_INFORMATION' ),'fn' => 'processInformation');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_TASK_INFORMATION' ),'fn' => 'taskInformation');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CASE_HISTORY' ),'fn' => 'caseHistory');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_HISTORY_MESSAGE_CASE' ),'fn' => 'messageHistory');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_DYNAFORMS' ),'fn' => 'dynaformHistory' );
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UPLOADED_DOCUMENTS' ),'fn' => 'uploadedDocuments');
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_GENERATED_DOCUMENTS' ),'fn' => 'generatedDocuments');
|
||||
$options = Array();
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PROCESS_MAP'), 'fn' => 'processMap');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PROCESS_INFORMATION'), 'fn' => 'processInformation');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_TASK_INFORMATION'), 'fn' => 'taskInformation');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_CASE_HISTORY'), 'fn' => 'caseHistory');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_HISTORY_MESSAGE_CASE'), 'fn' => 'messageHistory');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_DYNAFORMS'), 'fn' => 'dynaformHistory');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_UPLOADED_DOCUMENTS'), 'fn' => 'uploadedDocuments');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_GENERATED_DOCUMENTS'), 'fn' => 'generatedDocuments');
|
||||
|
||||
return $options;
|
||||
}
|
||||
|
||||
public function getActionOptions ()
|
||||
public function getActionOptions()
|
||||
{
|
||||
$APP_UID = $_SESSION['APPLICATION'];
|
||||
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c = new Criteria('workflow');
|
||||
$c->clearSelectColumns();
|
||||
$c->addSelectColumn( AppThreadPeer::APP_THREAD_PARENT );
|
||||
$c->add( AppThreadPeer::APP_UID, $APP_UID );
|
||||
$c->add( AppThreadPeer::APP_THREAD_STATUS, 'OPEN' );
|
||||
$cant = AppThreadPeer::doCount( $c );
|
||||
$c->addSelectColumn(AppThreadPeer::APP_THREAD_PARENT);
|
||||
$c->add(AppThreadPeer::APP_UID, $APP_UID);
|
||||
$c->add(AppThreadPeer::APP_THREAD_STATUS, 'OPEN');
|
||||
$cant = AppThreadPeer::doCount($c);
|
||||
|
||||
$oCase = new Cases();
|
||||
$aFields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
$aFields = $oCase->loadCase($_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||
|
||||
GLOBAL $RBAC;
|
||||
|
||||
$options = Array ();
|
||||
$options = Array();
|
||||
|
||||
switch ($aFields['APP_STATUS']) {
|
||||
case 'DRAFT':
|
||||
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate');
|
||||
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PAUSED_CASE'), 'fn' => 'setUnpauseCaseDate');
|
||||
} else {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase');
|
||||
}
|
||||
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_DELETE' ),'fn' => 'deleteCase');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_DELETE'), 'fn' => 'deleteCase');
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign');
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
||||
}
|
||||
break;
|
||||
case 'TO_DO':
|
||||
if (! AppDelay::isPaused( $_SESSION['APPLICATION'], $_SESSION['INDEX'] )) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_PAUSED_CASE' ),'fn' => 'setUnpauseCaseDate');
|
||||
if (!AppDelay::isPaused($_SESSION['APPLICATION'], $_SESSION['INDEX'])) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_PAUSED_CASE'), 'fn' => 'setUnpauseCaseDate');
|
||||
if ($cant == 1) {
|
||||
if ($RBAC->userCanAccess( 'PM_CANCELCASE' ) == 1) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase');
|
||||
if ($RBAC->userCanAccess('PM_CANCELCASE') == 1) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_CANCEL'), 'fn' => 'cancelCase');
|
||||
} else {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_CANCEL' ),'fn' => 'cancelCase','hide' => 'hiden');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_CANCEL'), 'fn' => 'cancelCase', 'hide' => 'hiden');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_UNPAUSE' ),'fn' => 'unpauseCase');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_UNPAUSE'), 'fn' => 'unpauseCase');
|
||||
}
|
||||
if ($RBAC->userCanAccess( 'PM_REASSIGNCASE' ) == 1) {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REASSIGN' ),'fn' => 'getUsersToReassign');
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_REASSIGN'), 'fn' => 'getUsersToReassign');
|
||||
}
|
||||
break;
|
||||
case 'CANCELLED':
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_REACTIVATE' ),'fn' => 'reactivateCase');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_REACTIVATE'), 'fn' => 'reactivateCase');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($_SESSION['TASK'] != '-1') {
|
||||
$oTask = new Task();
|
||||
$aTask = $oTask->load( $_SESSION['TASK'] );
|
||||
$aTask = $oTask->load($_SESSION['TASK']);
|
||||
if ($aTask['TAS_TYPE'] == 'ADHOC') {
|
||||
$options[] = Array ('text' => G::LoadTranslation( 'ID_ADHOC_ASSIGNMENT' ),'fn' => 'adhocAssignmentUsers');
|
||||
$options[] = Array('text' => G::LoadTranslation('ID_ADHOC_ASSIGNMENT'), 'fn' => 'adhocAssignmentUsers');
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
public function processMap ()
|
||||
public function processMap()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
global $G_CONTENT;
|
||||
@@ -202,17 +201,17 @@ class Ajax
|
||||
global $G_TABLE;
|
||||
global $RBAC;
|
||||
|
||||
G::LoadClass( 'processMap' );
|
||||
G::LoadClass('processMap');
|
||||
|
||||
$oTemplatePower = new TemplatePower( PATH_TPL . 'processes/processes_Map.html' );
|
||||
$oTemplatePower = new TemplatePower(PATH_TPL . 'processes/processes_Map.html');
|
||||
$oTemplatePower->prepare();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
|
||||
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
|
||||
//$oHeadPublisher->addScriptfile('/jscore/processmap/core/processmap.js');
|
||||
$oHeadPublisher->addScriptCode( '
|
||||
var maximunX = ' . processMap::getMaximunTaskX( $_SESSION['PROCESS'] ) . ';
|
||||
$oHeadPublisher->addScriptCode('
|
||||
var maximunX = ' . processMap::getMaximunTaskX($_SESSION['PROCESS']) . ';
|
||||
window.onload = function(){
|
||||
var pb=leimnud.dom.capture("tag.body 0");
|
||||
Pm=new processmap();
|
||||
@@ -290,146 +289,146 @@ class Ajax
|
||||
oLeyendsPanel.addContent(rpc.xmlhttp.responseText);
|
||||
}.extend(this);
|
||||
oRPC.make();
|
||||
}' );
|
||||
}');
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
G::RenderPage('publish', 'blank');
|
||||
}
|
||||
|
||||
public function getProcessInformation ()
|
||||
public function getProcessInformation()
|
||||
{
|
||||
$process = new Process();
|
||||
$processData = $process->load( $_SESSION['PROCESS'] );
|
||||
$processData = $process->load($_SESSION['PROCESS']);
|
||||
require_once 'classes/model/Users.php';
|
||||
$user = new Users();
|
||||
try {
|
||||
$userData = $user->load( $processData['PRO_CREATE_USER'] );
|
||||
$userData = $user->load($processData['PRO_CREATE_USER']);
|
||||
$processData['PRO_AUTHOR'] = $userData['USR_FIRSTNAME'] . ' ' . $userData['USR_LASTNAME'];
|
||||
} catch (Exception $oError) {
|
||||
$processData['PRO_AUTHOR'] = '(USER DELETED)';
|
||||
}
|
||||
|
||||
$processData['PRO_CREATE_DATE'] = date( 'F j, Y', strtotime( $processData['PRO_CREATE_DATE'] ) );
|
||||
$processData['PRO_CREATE_DATE'] = date('F j, Y', strtotime($processData['PRO_CREATE_DATE']));
|
||||
|
||||
print (G::json_encode( $processData )) ;
|
||||
print (G::json_encode($processData));
|
||||
}
|
||||
|
||||
public function getTaskInformation ()
|
||||
public function getTaskInformation()
|
||||
{
|
||||
$task = new Task();
|
||||
if ($_SESSION['TASK'] == '-1') {
|
||||
$_SESSION['TASK'] = $_SESSION['CURRENT_TASK'];
|
||||
}
|
||||
$taskData = $task->getDelegatedTaskData( $_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
$taskData = $task->getDelegatedTaskData($_SESSION['TASK'], $_SESSION['APPLICATION'], $_SESSION['INDEX']);
|
||||
|
||||
print (G::json_encode( $taskData )) ;
|
||||
print (G::json_encode($taskData));
|
||||
}
|
||||
|
||||
public function caseHistory ()
|
||||
public function caseHistory()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/caseHistory', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/caseHistory' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/caseHistory', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseHistory'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function messageHistory ()
|
||||
public function messageHistory()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/caseMessageHistory', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/caseMessageHistory' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/caseMessageHistory', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseMessageHistory'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function dynaformHistory ()
|
||||
public function dynaformHistory()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/caseHistoryDynaformPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/caseHistoryDynaformPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/caseHistoryDynaformPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/caseHistoryDynaformPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function uploadedDocuments ()
|
||||
public function uploadedDocuments()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesUploadedDocumentsPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesUploadedDocumentsPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/casesUploadedDocumentsPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesUploadedDocumentsPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function uploadedDocumentsSummary ()
|
||||
public function uploadedDocumentsSummary()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesUploadedDocumentsPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesUploadedDocumentsPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/casesUploadedDocumentsPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesUploadedDocumentsPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function generatedDocuments ()
|
||||
public function generatedDocuments()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/casesGenerateDocumentPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesGenerateDocumentPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function generatedDocumentsSummary ()
|
||||
public function generatedDocumentsSummary()
|
||||
{
|
||||
global $G_PUBLISH;
|
||||
G::loadClass( 'configuration' );
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$conf = new Configurations();
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
$oHeadPublisher->addExtJsScript('cases/casesGenerateDocumentPage', true); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesGenerateDocumentPage'); //adding a html file .html.
|
||||
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
|
||||
G::RenderPage('publish', 'extJs');
|
||||
}
|
||||
|
||||
public function cancelCase ()
|
||||
public function cancelCase()
|
||||
{
|
||||
$oCase = new Cases();
|
||||
$multiple = false;
|
||||
|
||||
if (isset( $_POST['APP_UID'] ) && isset( $_POST['DEL_INDEX'] )) {
|
||||
if (isset($_POST['APP_UID']) && isset($_POST['DEL_INDEX'])) {
|
||||
$APP_UID = $_POST['APP_UID'];
|
||||
$DEL_INDEX = $_POST['DEL_INDEX'];
|
||||
|
||||
$appUids = explode( ',', $APP_UID );
|
||||
$delIndexes = explode( ',', $DEL_INDEX );
|
||||
if (count( $appUids ) > 1 && count( $delIndexes ) > 1) {
|
||||
$appUids = explode(',', $APP_UID);
|
||||
$delIndexes = explode(',', $DEL_INDEX);
|
||||
if (count($appUids) > 1 && count($delIndexes) > 1) {
|
||||
$multiple = true;
|
||||
}
|
||||
} elseif (isset( $_POST['sApplicationUID'] ) && isset( $_POST['iIndex'] )) {
|
||||
} elseif (isset($_POST['sApplicationUID']) && isset($_POST['iIndex'])) {
|
||||
$APP_UID = $_POST['sApplicationUID'];
|
||||
$DEL_INDEX = $_POST['iIndex'];
|
||||
} else {
|
||||
@@ -441,31 +440,30 @@ class Ajax
|
||||
if ($_POST['NOTE_REASON'] != '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes( $_POST['NOTE_REASON'] );
|
||||
$appNotes->postNewNote( $APP_UID, $_SESSION['USER_LOGGED'], $noteContent, $_POST['NOTIFY_PAUSE'] );
|
||||
$noteContent = addslashes($_POST['NOTE_REASON']);
|
||||
$appNotes->postNewNote($APP_UID, $_SESSION['USER_LOGGED'], $noteContent, $_POST['NOTIFY_PAUSE']);
|
||||
}
|
||||
// End save
|
||||
|
||||
|
||||
if ($multiple) {
|
||||
foreach ($appUids as $i => $appUid) {
|
||||
$oCase->cancelCase( $appUid, $delIndexes[$i], $_SESSION['USER_LOGGED'] );
|
||||
$oCase->cancelCase($appUid, $delIndexes[$i], $_SESSION['USER_LOGGED']);
|
||||
}
|
||||
} else {
|
||||
$oCase->cancelCase( $APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'] );
|
||||
$oCase->cancelCase($APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED']);
|
||||
}
|
||||
}
|
||||
|
||||
public function getUsersToReassign ()
|
||||
public function getUsersToReassign()
|
||||
{
|
||||
$case = new Cases();
|
||||
$result->data = $case->getUsersToReassign( $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
|
||||
|
||||
print G::json_encode( $result );
|
||||
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED']);
|
||||
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
public function reassignCase ()
|
||||
public function reassignCase()
|
||||
{
|
||||
$cases = new Cases();
|
||||
$user = new Users();
|
||||
@@ -473,31 +471,31 @@ class Ajax
|
||||
|
||||
$TO_USR_UID = $_POST['USR_UID'];
|
||||
try {
|
||||
$cases->reassignCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID );
|
||||
$caseData = $app->load( $_SESSION['APPLICATION'] );
|
||||
$userData = $user->load( $TO_USR_UID );
|
||||
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID);
|
||||
$caseData = $app->load($_SESSION['APPLICATION']);
|
||||
$userData = $user->load($TO_USR_UID);
|
||||
//print_r($caseData);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
||||
$result->status = 0;
|
||||
$result->msg = G::LoadTranslation( 'ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data );
|
||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||
} catch (Exception $e) {
|
||||
$result->status = 1;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
public function pauseCase ()
|
||||
public function pauseCase()
|
||||
{
|
||||
try {
|
||||
$unpauseDate = $_REQUEST['unpauseDate'];
|
||||
$oCase = new Cases();
|
||||
if (isset( $_POST['APP_UID'] ) && isset( $_POST['DEL_INDEX'] )) {
|
||||
if (isset($_POST['APP_UID']) && isset($_POST['DEL_INDEX'])) {
|
||||
$APP_UID = $_POST['APP_UID'];
|
||||
$DEL_INDEX = $_POST['DEL_INDEX'];
|
||||
} elseif (isset( $_POST['sApplicationUID'] ) && isset( $_POST['iIndex'] )) {
|
||||
} elseif (isset($_POST['sApplicationUID']) && isset($_POST['iIndex'])) {
|
||||
$APP_UID = $_POST['sApplicationUID'];
|
||||
$DEL_INDEX = $_POST['iIndex'];
|
||||
} else {
|
||||
@@ -509,92 +507,92 @@ class Ajax
|
||||
if ($_REQUEST['NOTE_REASON'] != '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
$appNotes = new AppNotes();
|
||||
$noteContent = addslashes( $_REQUEST['NOTE_REASON'] );
|
||||
$appNotes->postNewNote( $APP_UID, $_SESSION['USER_LOGGED'], $noteContent, $_REQUEST['NOTIFY_PAUSE'] );
|
||||
$noteContent = addslashes($_REQUEST['NOTE_REASON']);
|
||||
$appNotes->postNewNote($APP_UID, $_SESSION['USER_LOGGED'], $noteContent, $_REQUEST['NOTIFY_PAUSE']);
|
||||
}
|
||||
// End save
|
||||
|
||||
|
||||
$oCase->pauseCase( $APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'], $unpauseDate );
|
||||
$oCase->pauseCase($APP_UID, $DEL_INDEX, $_SESSION['USER_LOGGED'], $unpauseDate);
|
||||
$app = new Application();
|
||||
$caseData = $app->load( $APP_UID );
|
||||
$caseData = $app->load($APP_UID);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
$data['UNPAUSE_DATE'] = $unpauseDate;
|
||||
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation( 'ID_CASE_PAUSED_SUCCESSFULLY', SYS_LANG, $data );
|
||||
$result->msg = G::LoadTranslation('ID_CASE_PAUSED_SUCCESSFULLY', SYS_LANG, $data);
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
echo G::json_encode( $result );
|
||||
echo G::json_encode($result);
|
||||
}
|
||||
|
||||
public function unpauseCase ()
|
||||
public function unpauseCase()
|
||||
{
|
||||
try {
|
||||
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
$delIndex = (isset( $_POST['DEL_INDEX'] )) ? $_POST['DEL_INDEX'] : $_SESSION['INDEX'];
|
||||
$applicationUID = (isset($_POST['APP_UID'])) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
$delIndex = (isset($_POST['DEL_INDEX'])) ? $_POST['DEL_INDEX'] : $_SESSION['INDEX'];
|
||||
$oCase = new Cases();
|
||||
$oCase->unpauseCase( $applicationUID, $delIndex, $_SESSION['USER_LOGGED'] );
|
||||
$oCase->unpauseCase($applicationUID, $delIndex, $_SESSION['USER_LOGGED']);
|
||||
|
||||
$app = new Application();
|
||||
$caseData = $app->load( $applicationUID );
|
||||
$caseData = $app->load($applicationUID);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation( 'ID_CASE_UNPAUSED_SUCCESSFULLY', SYS_LANG, $data );
|
||||
$result->msg = G::LoadTranslation('ID_CASE_UNPAUSED_SUCCESSFULLY', SYS_LANG, $data);
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
public function deleteCase ()
|
||||
public function deleteCase()
|
||||
{
|
||||
try {
|
||||
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
$applicationUID = (isset($_POST['APP_UID'])) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
$app = new Application();
|
||||
$caseData = $app->load( $applicationUID );
|
||||
$caseData = $app->load($applicationUID);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
|
||||
$oCase = new Cases();
|
||||
$oCase->removeCase( $applicationUID );
|
||||
$oCase->removeCase($applicationUID);
|
||||
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation( 'ID_CASE_DELETED_SUCCESSFULLY', SYS_LANG, $data );
|
||||
$result->msg = G::LoadTranslation('ID_CASE_DELETED_SUCCESSFULLY', SYS_LANG, $data);
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
public function reactivateCase ()
|
||||
public function reactivateCase()
|
||||
{
|
||||
try {
|
||||
$applicationUID = (isset( $_POST['APP_UID'] )) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
$delIndex = (isset( $_POST['DEL_INDEX'] )) ? $_POST['DEL_INDEX'] : $_SESSION['INDEX'];
|
||||
$applicationUID = (isset($_POST['APP_UID'])) ? $_POST['APP_UID'] : $_SESSION['APPLICATION'];
|
||||
$delIndex = (isset($_POST['DEL_INDEX'])) ? $_POST['DEL_INDEX'] : $_SESSION['INDEX'];
|
||||
$app = new Application();
|
||||
$caseData = $app->load( $applicationUID );
|
||||
$caseData = $app->load($applicationUID);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
|
||||
$oCase = new Cases();
|
||||
$oCase->reactivateCase( $applicationUID, $delIndex, $_SESSION['USER_LOGGED'] );
|
||||
$oCase->reactivateCase($applicationUID, $delIndex, $_SESSION['USER_LOGGED']);
|
||||
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation( 'ID_CASE_REACTIVATED_SUCCESSFULLY', SYS_LANG, $data );
|
||||
$result->msg = G::LoadTranslation('ID_CASE_REACTIVATED_SUCCESSFULLY', SYS_LANG, $data);
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
public function changeLogTab ()
|
||||
public function changeLogTab()
|
||||
{
|
||||
try {
|
||||
global $G_PUBLISH;
|
||||
@@ -603,169 +601,168 @@ class Ajax
|
||||
//!dataInput
|
||||
$idHistory = $_REQUEST["idHistory"];
|
||||
//!dataInput
|
||||
|
||||
|
||||
//!dataSytem
|
||||
$idHistoryArray = explode( "_", $idHistory );
|
||||
$idHistoryArray = explode("_", $idHistory);
|
||||
$_REQUEST["PRO_UID"] = $idHistoryArray[0];
|
||||
$_REQUEST["APP_UID"] = $idHistoryArray[1];
|
||||
$_REQUEST["TAS_UID"] = $idHistoryArray[2];
|
||||
$_REQUEST["DYN_UID"] = "";
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
|
||||
$G_PUBLISH->AddContent('view', 'cases/cases_DynaformHistory');
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
<style type="text/css">
|
||||
html {
|
||||
color: black !important;
|
||||
}
|
||||
html {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
body {
|
||||
color: black !important;
|
||||
}
|
||||
body {
|
||||
color: black !important;
|
||||
}
|
||||
</style>
|
||||
<script language="javascript">
|
||||
function ajaxPostRequest(url, callback_function, id){
|
||||
var d = new Date();
|
||||
var time = d.getTime();
|
||||
url = url + '&nocachetime='+time;
|
||||
var return_xml=false;
|
||||
var http_request = false;
|
||||
function ajaxPostRequest(url, callback_function, id) {
|
||||
var d = new Date();
|
||||
var time = d.getTime();
|
||||
url = url + '&nocachetime=' + time;
|
||||
var return_xml = false;
|
||||
var http_request = false;
|
||||
|
||||
if (window.XMLHttpRequest) {
|
||||
// Mozilla, Safari,...
|
||||
http_request = new XMLHttpRequest();
|
||||
if (http_request.overrideMimeType){
|
||||
http_request.overrideMimeType('text/xml');
|
||||
}
|
||||
}
|
||||
elseif (window.ActiveXObject) {
|
||||
// IE
|
||||
try {
|
||||
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
if (window.XMLHttpRequest) {
|
||||
// Mozilla, Safari,...
|
||||
http_request = new XMLHttpRequest();
|
||||
if (http_request.overrideMimeType) {
|
||||
http_request.overrideMimeType('text/xml');
|
||||
}
|
||||
}
|
||||
elseif (window.ActiveXObject) {
|
||||
// IE
|
||||
try {
|
||||
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
http_request = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!http_request) {
|
||||
alert('This browser is not supported.');
|
||||
return false;
|
||||
}
|
||||
|
||||
http_request.onreadystatechange = function() {
|
||||
if (http_request.readyState == 4) {
|
||||
if (http_request.status == 200) {
|
||||
if (return_xml) {
|
||||
eval(callback_function + '(http_request.responseXML)');
|
||||
}
|
||||
else {
|
||||
eval(callback_function + '(http_request.responseText, \'' + id + '\')');
|
||||
}
|
||||
}
|
||||
else {
|
||||
alert('Error found on request:(Code: ' + http_request.status + ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
http_request.open('GET', url, true);
|
||||
http_request.send(null);
|
||||
}
|
||||
catch (e) {
|
||||
try {
|
||||
http_request = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
|
||||
function toggleTable(tablename) {
|
||||
table = document.getElementById(tablename);
|
||||
|
||||
if (table.style.display == '') {
|
||||
table.style.display = 'none';
|
||||
} else {
|
||||
table.style.display = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!http_request){
|
||||
alert('This browser is not supported.');
|
||||
return false;
|
||||
}
|
||||
|
||||
http_request.onreadystatechange = function(){
|
||||
if (http_request.readyState == 4){
|
||||
if (http_request.status == 200){
|
||||
if (return_xml){
|
||||
eval(callback_function + '(http_request.responseXML)');
|
||||
}
|
||||
else{
|
||||
eval(callback_function + '(http_request.responseText, \''+id+'\')');
|
||||
}
|
||||
function noesFuncion(idIframe) {
|
||||
window.parent.tabIframeWidthFix2(idIframe);
|
||||
}
|
||||
else {
|
||||
alert('Error found on request:(Code: ' + http_request.status + ')');
|
||||
|
||||
function onResizeIframe(idIframe) {
|
||||
window.onresize = noesFuncion(idIframe);
|
||||
}
|
||||
}
|
||||
}
|
||||
http_request.open('GET', url, true);
|
||||
http_request.send(null);
|
||||
}
|
||||
|
||||
function toggleTable(tablename) {
|
||||
table= document.getElementById(tablename);
|
||||
function showDynaformHistoryGetNomDynaform_RSP(response, id) {
|
||||
//!showDynaformHistoryGlobal
|
||||
showDynaformHistoryGlobal.idDin = showDynaformHistoryGlobal.idDin;
|
||||
showDynaformHistoryGlobal.idHistory = showDynaformHistoryGlobal.idHistory;
|
||||
showDynaformHistoryGlobal.dynDate = showDynaformHistoryGlobal.dynDate;
|
||||
|
||||
if(table.style.display == ''){
|
||||
table.style.display = 'none';
|
||||
}else{
|
||||
table.style.display = '';
|
||||
}
|
||||
}
|
||||
//!dataSystem
|
||||
var idDin = showDynaformHistoryGlobal.idDin;
|
||||
var idHistory = showDynaformHistoryGlobal.idHistory;
|
||||
var dynDate = showDynaformHistoryGlobal.dynDate;
|
||||
|
||||
function noesFuncion(idIframe) {
|
||||
window.parent.tabIframeWidthFix2(idIframe);
|
||||
}
|
||||
//!windowParent
|
||||
window.parent.historyGridListChangeLogGlobal.viewIdDin = idDin;
|
||||
window.parent.historyGridListChangeLogGlobal.viewIdHistory = idHistory;
|
||||
window.parent.historyGridListChangeLogGlobal.viewDynaformName = response;
|
||||
window.parent.historyGridListChangeLogGlobal.dynDate = dynDate;
|
||||
|
||||
function onResizeIframe(idIframe){
|
||||
window.onresize = noesFuncion(idIframe);
|
||||
}
|
||||
window.parent.Actions.tabFrame('dynaformViewFromHistory');
|
||||
}
|
||||
|
||||
function showDynaformHistoryGetNomDynaform_RSP(response,id) {
|
||||
//!showDynaformHistoryGlobal
|
||||
showDynaformHistoryGlobal.idDin = showDynaformHistoryGlobal.idDin;
|
||||
showDynaformHistoryGlobal.idHistory = showDynaformHistoryGlobal.idHistory;
|
||||
showDynaformHistoryGlobal.dynDate = showDynaformHistoryGlobal.dynDate;
|
||||
showDynaformHistoryGlobal = {};
|
||||
showDynaformHistoryGlobal.idDin = "";
|
||||
showDynaformHistoryGlobal.idHistory = "";
|
||||
showDynaformHistoryGlobal.dynDate = "";
|
||||
|
||||
//!dataSystem
|
||||
var idDin = showDynaformHistoryGlobal.idDin;
|
||||
var idHistory = showDynaformHistoryGlobal.idHistory;
|
||||
var dynDate = showDynaformHistoryGlobal.dynDate;
|
||||
function showDynaformHistory(idDin, idHistory, dynDate) {
|
||||
//!showDynaformHistoryGlobal
|
||||
showDynaformHistoryGlobal.idDin = showDynaformHistoryGlobal.idDin;
|
||||
showDynaformHistoryGlobal.idHistory = showDynaformHistoryGlobal.idHistory;
|
||||
showDynaformHistoryGlobal.dynDate = showDynaformHistoryGlobal.dynDate;
|
||||
|
||||
//!windowParent
|
||||
window.parent.historyGridListChangeLogGlobal.viewIdDin = idDin;
|
||||
window.parent.historyGridListChangeLogGlobal.viewIdHistory = idHistory;
|
||||
window.parent.historyGridListChangeLogGlobal.viewDynaformName = response;
|
||||
window.parent.historyGridListChangeLogGlobal.dynDate = dynDate;
|
||||
//!dataSystem
|
||||
showDynaformHistoryGlobal.idDin = idDin;
|
||||
showDynaformHistoryGlobal.idHistory = idHistory;
|
||||
showDynaformHistoryGlobal.dynDate = dynDate;
|
||||
|
||||
window.parent.Actions.tabFrame('dynaformViewFromHistory');
|
||||
}
|
||||
|
||||
showDynaformHistoryGlobal = {};
|
||||
showDynaformHistoryGlobal.idDin = "";
|
||||
showDynaformHistoryGlobal.idHistory = "";
|
||||
showDynaformHistoryGlobal.dynDate = "";
|
||||
|
||||
function showDynaformHistory(idDin, idHistory, dynDate) {
|
||||
//!showDynaformHistoryGlobal
|
||||
showDynaformHistoryGlobal.idDin = showDynaformHistoryGlobal.idDin;
|
||||
showDynaformHistoryGlobal.idHistory = showDynaformHistoryGlobal.idHistory;
|
||||
showDynaformHistoryGlobal.dynDate = showDynaformHistoryGlobal.dynDate;
|
||||
|
||||
//!dataSystem
|
||||
showDynaformHistoryGlobal.idDin = idDin;
|
||||
showDynaformHistoryGlobal.idHistory = idHistory;
|
||||
showDynaformHistoryGlobal.dynDate = dynDate;
|
||||
|
||||
var url = "caseHistory_Ajax.php?actionAjax=showDynaformHistoryGetNomDynaform_JXP&idDin="+idDin+"&dynDate="+dynDate;ajaxPostRequest(url, 'showDynaformHistoryGetNomDynaform_RSP');
|
||||
}
|
||||
var url = "caseHistory_Ajax.php?actionAjax=showDynaformHistoryGetNomDynaform_JXP&idDin=" + idDin + "&dynDate=" + dynDate;
|
||||
ajaxPostRequest(url, 'showDynaformHistoryGetNomDynaform_RSP');
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
G::RenderPage('publish', 'raw');
|
||||
|
||||
$result->success = true;
|
||||
$result->msg = G::LoadTranslation( 'ID_CASE_REACTIVATED_SUCCESSFULLY', SYS_LANG, "success" );
|
||||
$result->msg = G::LoadTranslation('ID_CASE_REACTIVATED_SUCCESSFULLY', SYS_LANG, "success");
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public function dynaformViewFromHistory ()
|
||||
public function dynaformViewFromHistory()
|
||||
{
|
||||
?>
|
||||
<link rel="stylesheet" type="text/css" href="/css/classic.css" />
|
||||
|
||||
<script type="text/javascript">
|
||||
//!Code that simulated reload library javascript maborak
|
||||
var leimnud = {};
|
||||
leimnud.exec = "";
|
||||
leimnud.fix = {};
|
||||
leimnud.fix.memoryLeak = "";
|
||||
leimnud.browser = {};
|
||||
leimnud.browser.isIphone = "";
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function () {};
|
||||
function ajax_function(ajax_server, funcion, parameters, method)
|
||||
{
|
||||
}
|
||||
//!
|
||||
<script type="text/javascript">
|
||||
//!Code that simulated reload library javascript maborak
|
||||
var leimnud = {};
|
||||
leimnud.exec = "";
|
||||
leimnud.fix = {};
|
||||
leimnud.fix.memoryLeak = "";
|
||||
leimnud.browser = {};
|
||||
leimnud.browser.isIphone = "";
|
||||
leimnud.iphone = {};
|
||||
leimnud.iphone.make = function() {
|
||||
};
|
||||
function ajax_function(ajax_server, funcion, parameters, method)
|
||||
{
|
||||
}
|
||||
//!
|
||||
</script>
|
||||
|
||||
<?php
|
||||
@@ -775,37 +772,37 @@ class Ajax
|
||||
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$FieldsHistory = unserialize( $_SESSION["HISTORY_DATA"] );
|
||||
$FieldsHistory = unserialize($_SESSION["HISTORY_DATA"]);
|
||||
$Fields["APP_DATA"] = $FieldsHistory[$_POST["HISTORY_ID"]]; //isset($FieldsHistory[$_POST["HISTORY_ID"]])? $FieldsHistory[$_POST["HISTORY_ID"]] : "";
|
||||
$Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["PREVIOUS_STEP_LABEL"] = "";
|
||||
$Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_STEP_LABEL"] = "";
|
||||
$Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_STEP"] = "#";
|
||||
$Fields["APP_DATA"]["__DYNAFORM_OPTIONS"]["NEXT_ACTION"] = "return false;";
|
||||
$G_PUBLISH->AddContent( "dynaform", "xmlform", $_SESSION["PROCESS"] . "/" . $_POST["DYN_UID"], "", $Fields["APP_DATA"], "", "", "view" );
|
||||
$G_PUBLISH->AddContent("dynaform", "xmlform", $_SESSION["PROCESS"] . "/" . $_POST["DYN_UID"], "", $Fields["APP_DATA"], "", "", "view");
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
<?php
|
||||
global $G_FORM;
|
||||
global $G_FORM;
|
||||
?>
|
||||
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
G::RenderPage( "publish", "raw" );
|
||||
G::RenderPage("publish", "raw");
|
||||
?>
|
||||
|
||||
<style type="text/css">
|
||||
html {
|
||||
color: black !important;
|
||||
}
|
||||
html {
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
body {
|
||||
color: black !important;
|
||||
}
|
||||
body {
|
||||
color: black !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
@@ -814,15 +811,15 @@ class Ajax
|
||||
global $G_FORM;
|
||||
?>
|
||||
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
function loadForm_<?php echo $G_FORM->id; ?>(parametro1) {
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
$pluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$pluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
if ($pluginRegistry->existsTrigger(PM_GET_CASES_AJAX_LISTENER)) {
|
||||
$ajax = $pluginRegistry->executeTriggers(PM_GET_CASES_AJAX_LISTENER, null);
|
||||
} else {
|
||||
@@ -833,10 +830,11 @@ if (!($ajax instanceof Ajax)) {
|
||||
$ajax = new Ajax();
|
||||
}
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass('case');
|
||||
|
||||
$action = $_REQUEST['action'];
|
||||
|
||||
unset( $_REQUEST['action'] );
|
||||
unset($_REQUEST['action']);
|
||||
|
||||
$ajax->$action($_REQUEST);
|
||||
|
||||
$ajax->$action( $_REQUEST );
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* processes/ajaxListener.php Ajax Listener for Cases rpc requests
|
||||
*
|
||||
@@ -21,67 +22,64 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @date Jan 10th, 2010
|
||||
*/
|
||||
|
||||
$action = $_REQUEST['action'];
|
||||
unset( $_REQUEST['action'] );
|
||||
unset($_REQUEST['action']);
|
||||
|
||||
$ajax = new Ajax();
|
||||
$ajax->$action( $_REQUEST );
|
||||
$ajax->$action($_REQUEST);
|
||||
|
||||
class Ajax
|
||||
{
|
||||
|
||||
function categoriesList ()
|
||||
public function categoriesList()
|
||||
{
|
||||
require_once "classes/model/ProcessCategory.php";
|
||||
|
||||
$processCategory = new ProcessCategory();
|
||||
$defaultOption = Array ();
|
||||
$defaultOption[] = Array ('CATEGORY_UID' => '<reset>','CATEGORY_NAME' => G::LoadTranslation( 'ID_ALL' )
|
||||
);
|
||||
$defaultOption[] = Array ('CATEGORY_UID' => '','CATEGORY_NAME' => G::LoadTranslation( 'ID_PROCESS_NO_CATEGORY' )
|
||||
);
|
||||
$defaultOption = Array();
|
||||
$defaultOption[] = Array('CATEGORY_UID' => '<reset>', 'CATEGORY_NAME' => G::LoadTranslation('ID_ALL'));
|
||||
$defaultOption[] = Array('CATEGORY_UID' => '', 'CATEGORY_NAME' => G::LoadTranslation('ID_PROCESS_NO_CATEGORY'));
|
||||
|
||||
$response->rows = array_merge( $defaultOption, $processCategory->getAll( 'array' ) );
|
||||
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
|
||||
|
||||
echo G::json_encode( $response );
|
||||
echo G::json_encode($response);
|
||||
}
|
||||
|
||||
function processCategories ()
|
||||
public function processCategories()
|
||||
{
|
||||
require_once "classes/model/ProcessCategory.php";
|
||||
|
||||
$processCategory = new ProcessCategory();
|
||||
$defaultOption = Array ();
|
||||
$defaultOption[] = Array ('CATEGORY_UID' => '','CATEGORY_NAME' => G::LoadTranslation( 'ID_PROCESS_NO_CATEGORY' )
|
||||
);
|
||||
$defaultOption = Array();
|
||||
$defaultOption[] = Array('CATEGORY_UID' => '', 'CATEGORY_NAME' => G::LoadTranslation('ID_PROCESS_NO_CATEGORY'));
|
||||
|
||||
$response->rows = array_merge( $defaultOption, $processCategory->getAll( 'array' ) );
|
||||
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
|
||||
|
||||
echo G::json_encode( $response );
|
||||
echo G::json_encode($response);
|
||||
}
|
||||
|
||||
function saveProcess ()
|
||||
public function saveProcess()
|
||||
{
|
||||
try {
|
||||
require_once 'classes/model/Task.php';
|
||||
G::LoadClass( 'processMap' );
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new ProcessMap();
|
||||
|
||||
if (! isset( $_POST['PRO_UID'] )) {
|
||||
if (!isset($_POST['PRO_UID'])) {
|
||||
|
||||
if (Process::existsByProTitle( $_POST['PRO_TITLE'] )) {
|
||||
$result = array ('success' => false,'msg' => 'Process Save Error','errors' => array ('PRO_TITLE' => G::LoadTranslation( 'ID_PROCESSTITLE_ALREADY_EXISTS', SYS_LANG, $_POST )
|
||||
)
|
||||
if (Process::existsByProTitle($_POST['PRO_TITLE'])) {
|
||||
$result = array(
|
||||
'success' => false,
|
||||
'msg' => 'Process Save Error',
|
||||
'errors' => array('PRO_TITLE' => G::LoadTranslation('ID_PROCESSTITLE_ALREADY_EXISTS', SYS_LANG, $_POST))
|
||||
);
|
||||
print G::json_encode( $result );
|
||||
exit( 0 );
|
||||
print G::json_encode($result);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$processData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
@@ -89,138 +87,135 @@ class Ajax
|
||||
$processData['PRO_DESCRIPTION'] = $_POST['PRO_DESCRIPTION'];
|
||||
$processData['PRO_CATEGORY'] = $_POST['PRO_CATEGORY'];
|
||||
|
||||
$sProUid = $oProcessMap->createProcess( $processData );
|
||||
$sProUid = $oProcessMap->createProcess($processData);
|
||||
|
||||
//call plugins
|
||||
$oData['PRO_UID'] = $sProUid;
|
||||
$oData['PRO_TEMPLATE'] = (isset( $_POST['PRO_TEMPLATE'] ) && $_POST['PRO_TEMPLATE'] != '') ? $_POST['form']['PRO_TEMPLATE'] : '';
|
||||
$oData['PRO_TEMPLATE'] = (isset($_POST['PRO_TEMPLATE']) && $_POST['PRO_TEMPLATE'] != '') ? $_POST['form']['PRO_TEMPLATE'] : '';
|
||||
$oData['PROCESSMAP'] = $oProcessMap;
|
||||
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$oPluginRegistry->executeTriggers( PM_NEW_PROCESS_SAVE, $oData );
|
||||
|
||||
$oPluginRegistry->executeTriggers(PM_NEW_PROCESS_SAVE, $oData);
|
||||
} else {
|
||||
//$oProcessMap->updateProcess($_POST['form']);
|
||||
$sProUid = $_POST['PRO_UID'];
|
||||
}
|
||||
|
||||
//Save Calendar ID for this process
|
||||
if (isset( $_POST['PRO_CALENDAR'] )) {
|
||||
G::LoadClass( "calendar" );
|
||||
if (isset($_POST['PRO_CALENDAR'])) {
|
||||
G::LoadClass("calendar");
|
||||
$calendarObj = new Calendar();
|
||||
$calendarObj->assignCalendarTo( $sProUid, $_POST['PRO_CALENDAR'], 'PROCESS' );
|
||||
$calendarObj->assignCalendarTo($sProUid, $_POST['PRO_CALENDAR'], 'PROCESS');
|
||||
}
|
||||
|
||||
$result->success = true;
|
||||
$result->PRO_UID = $sProUid;
|
||||
$result->msg = G::LoadTranslation( 'ID_CREATE_PROCESS_SUCCESS' );
|
||||
$result->msg = G::LoadTranslation('ID_CREATE_PROCESS_SUCCESS');
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function changeStatus ()
|
||||
public function changeStatus()
|
||||
{
|
||||
$ids = explode( ',', $_REQUEST['UIDS'] );
|
||||
$ids = explode(',', $_REQUEST['UIDS']);
|
||||
|
||||
G::LoadClass( 'processes' );
|
||||
G::LoadClass('processes');
|
||||
$oProcess = new Processes();
|
||||
if (count( $ids ) > 0) {
|
||||
foreach ($ids as $id)
|
||||
$oProcess->changeStatus( $id );
|
||||
if (count($ids) > 0) {
|
||||
foreach ($ids as $id) {
|
||||
$oProcess->changeStatus($id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function changeDebugMode ()
|
||||
public function changeDebugMode()
|
||||
{
|
||||
$ids = explode( ',', $_REQUEST['UIDS'] );
|
||||
$ids = explode(',', $_REQUEST['UIDS']);
|
||||
|
||||
G::LoadClass( 'processes' );
|
||||
G::LoadClass('processes');
|
||||
$oProcess = new Processes();
|
||||
if (count( $ids ) > 0) {
|
||||
foreach ($ids as $id)
|
||||
$oProcess->changeDebugMode( $id );
|
||||
if (count($ids) > 0) {
|
||||
foreach ($ids as $id) {
|
||||
$oProcess->changeDebugMode($id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getUsers ($params)
|
||||
public function getUsers($params)
|
||||
{
|
||||
require_once 'classes/model/Users.php';
|
||||
G::LoadClass( 'configuration' );
|
||||
G::LoadClass('configuration');
|
||||
$conf = new Configurations();
|
||||
|
||||
$search = isset( $params['search'] ) ? $params['search'] : null;
|
||||
$users = Users::getAll( $params['start'], $params['limit'], $search );
|
||||
$search = isset($params['search']) ? $params['search'] : null;
|
||||
$users = Users::getAll($params['start'], $params['limit'], $search);
|
||||
|
||||
foreach ($users->data as $i => $user) {
|
||||
$users->data[$i]['USER'] = $conf->getEnvSetting( 'format', Array ('userName' => $user['USR_USERNAME'],'firstName' => $user['USR_FIRSTNAME'],'lastName' => $user['USR_LASTNAME']
|
||||
) );
|
||||
$users->data[$i]['USER'] = $conf->getEnvSetting('format', Array('userName' => $user['USR_USERNAME'], 'firstName' => $user['USR_FIRSTNAME'], 'lastName' => $user['USR_LASTNAME']));
|
||||
}
|
||||
print G::json_encode( $users );
|
||||
print G::json_encode($users);
|
||||
}
|
||||
|
||||
function getGroups ($params)
|
||||
public function getGroups($params)
|
||||
{
|
||||
require_once 'classes/model/Groupwf.php';
|
||||
$search = isset( $params['search'] ) ? $params['search'] : null;
|
||||
$groups = Groupwf::getAll( $params['start'], $params['limit'], $search );
|
||||
$search = isset($params['search']) ? $params['search'] : null;
|
||||
$groups = Groupwf::getAll($params['start'], $params['limit'], $search);
|
||||
|
||||
print G::json_encode( $groups );
|
||||
print G::json_encode($groups);
|
||||
}
|
||||
|
||||
function assignUsersTask ($param)
|
||||
public function assignUsersTask($param)
|
||||
{
|
||||
try {
|
||||
require_once 'classes/model/TaskUser.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
$oTaskUser = new TaskUser();
|
||||
$UIDS = explode( ',', $param['UIDS'] );
|
||||
$UIDS = explode(',', $param['UIDS']);
|
||||
$TU_TYPE = 1;
|
||||
|
||||
foreach ($UIDS as $UID) {
|
||||
if ($_POST['TU_RELATION'] == 1)
|
||||
$oTaskUser->create( array ('TAS_UID' => $param['TAS_UID'],'USR_UID' => $UID,'TU_TYPE' => $TU_TYPE,'TU_RELATION' => 1
|
||||
) );
|
||||
else
|
||||
$oTaskUser->create( array ('TAS_UID' => $param['TAS_UID'],'USR_UID' => $UID,'TU_TYPE' => $TU_TYPE,'TU_RELATION' => 2
|
||||
) );
|
||||
if ($_POST['TU_RELATION'] == 1) {
|
||||
$oTaskUser->create(array('TAS_UID' => $param['TAS_UID'], 'USR_UID' => $UID, 'TU_TYPE' => $TU_TYPE, 'TU_RELATION' => 1));
|
||||
} else {
|
||||
$oTaskUser->create(array('TAS_UID' => $param['TAS_UID'], 'USR_UID' => $UID, 'TU_TYPE' => $TU_TYPE, 'TU_RELATION' => 2));
|
||||
}
|
||||
}
|
||||
$task = TaskPeer::retrieveByPk( $param['TAS_UID'] );
|
||||
$task = TaskPeer::retrieveByPk($param['TAS_UID']);
|
||||
|
||||
$result->success = true;
|
||||
if (count( $UIDS ) > 1)
|
||||
$result->msg = __( 'ID_ACTORS_ASSIGNED_SUCESSFULLY', SYS_LANG, Array (count( $UIDS ),$task->getTasTitle()
|
||||
) );
|
||||
else
|
||||
$result->msg = __( 'ID_ACTOR_ASSIGNED_SUCESSFULLY', SYS_LANG, Array ('tas_title' => $task->getTasTitle()
|
||||
) );
|
||||
if (count($UIDS) > 1) {
|
||||
$result->msg = __('ID_ACTORS_ASSIGNED_SUCESSFULLY', SYS_LANG, Array(count($UIDS), $task->getTasTitle()));
|
||||
} else {
|
||||
$result->msg = __('ID_ACTOR_ASSIGNED_SUCESSFULLY', SYS_LANG, Array('tas_title' => $task->getTasTitle()));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function removeUsersTask ($param)
|
||||
public function removeUsersTask($param)
|
||||
{
|
||||
try {
|
||||
require_once 'classes/model/TaskUser.php';
|
||||
$oTaskUser = new TaskUser();
|
||||
$USR_UIDS = explode( ',', $param['USR_UID'] );
|
||||
$TU_RELATIONS = explode( ',', $param['TU_RELATION'] );
|
||||
$USR_UIDS = explode(',', $param['USR_UID']);
|
||||
$TU_RELATIONS = explode(',', $param['TU_RELATION']);
|
||||
$TU_TYPE = 1;
|
||||
|
||||
foreach ($USR_UIDS as $i => $USR_UID) {
|
||||
if ($TU_RELATIONS[$i] == 1) {
|
||||
|
||||
$oTaskUser->remove( $param['TAS_UID'], $USR_UID, $TU_TYPE, 1 );
|
||||
|
||||
$oTaskUser->remove($param['TAS_UID'], $USR_UID, $TU_TYPE, 1);
|
||||
} else {
|
||||
$oTaskUser->remove( $param['TAS_UID'], $USR_UID, $TU_TYPE, 2 );
|
||||
$oTaskUser->remove($param['TAS_UID'], $USR_UID, $TU_TYPE, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -231,19 +226,19 @@ class Ajax
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function getUsersTask ($param)
|
||||
public function getUsersTask($param)
|
||||
{
|
||||
require_once 'classes/model/TaskUser.php';
|
||||
G::LoadClass( 'configuration' );
|
||||
$usersTaskList = Array ();
|
||||
G::LoadClass('configuration');
|
||||
$usersTaskList = Array();
|
||||
$task = new TaskUser();
|
||||
$conf = new Configurations();
|
||||
$TU_TYPE = 1;
|
||||
|
||||
$usersTask = $task->getUsersTask( $param['TAS_UID'], $TU_TYPE );
|
||||
$usersTask = $task->getUsersTask($param['TAS_UID'], $TU_TYPE);
|
||||
|
||||
foreach ($usersTask->data as $userTask) {
|
||||
$usersTaskListItem['TAS_UID'] = $userTask['TAS_UID'];
|
||||
@@ -251,8 +246,9 @@ class Ajax
|
||||
$usersTaskListItem['USR_USERNAME'] = $userTask['USR_USERNAME'];
|
||||
$usersTaskListItem['USR_FIRSTNAME'] = $userTask['USR_FIRSTNAME'];
|
||||
$usersTaskListItem['USR_LASTNAME'] = $userTask['USR_LASTNAME'];
|
||||
} else
|
||||
} else {
|
||||
$usersTaskListItem['NAME'] = $userTask['GRP_TITLE'];
|
||||
}
|
||||
|
||||
$usersTaskListItem['TU_RELATION'] = $userTask['TU_RELATION'];
|
||||
$usersTaskListItem['USR_UID'] = $userTask['USR_UID'];
|
||||
@@ -263,33 +259,33 @@ class Ajax
|
||||
$result->data = $usersTaskList;
|
||||
$result->totalCount = $usersTask->totalCount;
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function getProcessDetail ($param)
|
||||
public function getProcessDetail($param)
|
||||
{
|
||||
require_once 'classes/model/Process.php';
|
||||
|
||||
$PRO_UID = $param['PRO_UID'];
|
||||
|
||||
G::loadClass( 'tasks' );
|
||||
G::loadClass('tasks');
|
||||
$tasks = new Tasks();
|
||||
$process = ProcessPeer::retrieveByPk( $PRO_UID );
|
||||
$process = ProcessPeer::retrieveByPk($PRO_UID);
|
||||
|
||||
$tasksList = $tasks->getAllTasks( $PRO_UID );
|
||||
$tasksList = $tasks->getAllTasks($PRO_UID);
|
||||
|
||||
$rootNode->id = $process->getProUid();
|
||||
$rootNode->type = 'process';
|
||||
$rootNode->typeLabel = G::LoadTranslation( 'ID_PROCESS' );
|
||||
$rootNode->typeLabel = G::LoadTranslation('ID_PROCESS');
|
||||
$rootNode->text = $process->getProTitle();
|
||||
$rootNode->leaf = count( $tasksList ) > 0 ? false : true;
|
||||
$rootNode->leaf = count($tasksList) > 0 ? false : true;
|
||||
$rootNode->iconCls = 'ss_sprite ss_application';
|
||||
$rootNode->expanded = true;
|
||||
foreach ($tasksList as $task) {
|
||||
$node = new stdClass();
|
||||
$node->id = $task['TAS_UID'];
|
||||
$node->type = 'task';
|
||||
$node->typeLabel = G::LoadTranslation( 'ID_TASK' );
|
||||
$node->typeLabel = G::LoadTranslation('ID_TASK');
|
||||
$node->text = $task['TAS_TITLE'];
|
||||
$node->iconCls = 'ss_sprite ss_layout';
|
||||
$node->leaf = true;
|
||||
@@ -297,23 +293,23 @@ class Ajax
|
||||
}
|
||||
|
||||
$treeDetail[] = $rootNode;
|
||||
print G::json_encode( $treeDetail );
|
||||
print G::json_encode($treeDetail);
|
||||
}
|
||||
|
||||
function getProperties ($param)
|
||||
public function getProperties($param)
|
||||
{
|
||||
switch ($param['type']) {
|
||||
case 'process':
|
||||
require_once 'classes/model/ProcessCategory.php';
|
||||
require_once 'classes/model/CalendarDefinition.php';
|
||||
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new processMap( new DBConnection() );
|
||||
$process = $oProcessMap->editProcessNew( $param['UID'] );
|
||||
$category = ProcessCategoryPeer::retrieveByPk( $process['PRO_CATEGORY'] );
|
||||
$categoryName = is_object( $category ) ? $category->getCategoryName() : '';
|
||||
$calendar = CalendarDefinitionPeer::retrieveByPk( $process['PRO_CALENDAR'] );
|
||||
$calendarName = is_object( $calendar ) ? $calendar->getCalendarName() : '';
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new processMap(new DBConnection());
|
||||
$process = $oProcessMap->editProcessNew($param['UID']);
|
||||
$category = ProcessCategoryPeer::retrieveByPk($process['PRO_CATEGORY']);
|
||||
$categoryName = is_object($category) ? $category->getCategoryName() : '';
|
||||
$calendar = CalendarDefinitionPeer::retrieveByPk($process['PRO_CALENDAR']);
|
||||
$calendarName = is_object($calendar) ? $calendar->getCalendarName() : '';
|
||||
|
||||
$properties['Title'] = $process['PRO_TITLE'];
|
||||
$properties['Description'] = $process['PRO_DESCRIPTION'];
|
||||
@@ -324,11 +320,10 @@ class Ajax
|
||||
$result->sucess = true;
|
||||
$result->prop = $properties;
|
||||
break;
|
||||
|
||||
case 'task':
|
||||
require_once 'classes/model/Task.php';
|
||||
$task = new Task();
|
||||
$taskData = $task->load( $param['UID'] );
|
||||
$taskData = $task->load($param['UID']);
|
||||
|
||||
$properties['Title'] = $taskData['TAS_TITLE'];
|
||||
$properties['Description'] = $taskData['TAS_DESCRIPTION'];
|
||||
@@ -341,10 +336,10 @@ class Ajax
|
||||
break;
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function saveProperties ($param)
|
||||
public function saveProperties($param)
|
||||
{
|
||||
try {
|
||||
$result->sucess = true;
|
||||
@@ -354,7 +349,7 @@ class Ajax
|
||||
case 'process':
|
||||
require_once 'classes/model/ProcessCategory.php';
|
||||
require_once 'classes/model/CalendarDefinition.php';
|
||||
G::LoadClass( 'processMap' );
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new ProcessMap();
|
||||
$process['PRO_UID'] = $param['UID'];
|
||||
|
||||
@@ -371,25 +366,24 @@ class Ajax
|
||||
break;
|
||||
case 'Category':
|
||||
$fieldName = 'PRO_CATEGORY';
|
||||
$category = ProcessCategory::loadByCategoryName( $param['value'] );
|
||||
$category = ProcessCategory::loadByCategoryName($param['value']);
|
||||
$param['value'] = $category[0]['CATEGORY_UID'];
|
||||
break;
|
||||
case 'Calendar':
|
||||
$fieldName = 'PRO_CALENDAR';
|
||||
$calendar = CalendarDefinition::loadByCalendarName( $param['value'] );
|
||||
$calendar = CalendarDefinition::loadByCalendarName($param['value']);
|
||||
|
||||
G::LoadClass( "calendar" );
|
||||
G::LoadClass("calendar");
|
||||
$calendarObj = new Calendar();
|
||||
$calendarObj->assignCalendarTo( $process['PRO_UID'], $calendar['CALENDAR_UID'], 'PROCESS' );
|
||||
$calendarObj->assignCalendarTo($process['PRO_UID'], $calendar['CALENDAR_UID'], 'PROCESS');
|
||||
break;
|
||||
}
|
||||
|
||||
if ($fieldName != 'PRO_CALENDAR') {
|
||||
$process[$fieldName] = $param['value'];
|
||||
$oProcessMap->updateProcess( $process );
|
||||
$oProcessMap->updateProcess($process);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'task':
|
||||
require_once 'classes/model/Task.php';
|
||||
$oTask = new Task();
|
||||
@@ -407,12 +401,12 @@ class Ajax
|
||||
break;
|
||||
case 'Starting Task':
|
||||
$fieldName = 'TAS_START';
|
||||
$param['value'] = strtoupper( $param['value'] );
|
||||
$param['value'] = strtoupper($param['value']);
|
||||
break;
|
||||
}
|
||||
$task[$fieldName] = $param['value'];
|
||||
print_r( $task );
|
||||
$oTask->update( $task );
|
||||
print_r($task);
|
||||
$oTask->update($task);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -421,47 +415,43 @@ class Ajax
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function getCategoriesList ()
|
||||
public function getCategoriesList()
|
||||
{
|
||||
require_once "classes/model/ProcessCategory.php";
|
||||
|
||||
$processCategory = new ProcessCategory();
|
||||
$defaultOption = Array ();
|
||||
$defaultOption[] = Array ('CATEGORY_UID' => '','CATEGORY_NAME' => ''
|
||||
);
|
||||
$defaultOption = Array();
|
||||
$defaultOption[] = Array('CATEGORY_UID' => '', 'CATEGORY_NAME' => '');
|
||||
|
||||
$response->rows = array_merge( $defaultOption, $processCategory->getAll( 'array' ) );
|
||||
$response->rows = array_merge($defaultOption, $processCategory->getAll('array'));
|
||||
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
}
|
||||
|
||||
function getCaledarList ()
|
||||
public function getCaledarList()
|
||||
{
|
||||
G::LoadClass( 'calendar' );
|
||||
G::LoadClass('calendar');
|
||||
$calendar = new CalendarDefinition();
|
||||
$calendarObj = $calendar->getCalendarList( true, true );
|
||||
$calendarObj['array'][0] = Array ('CALENDAR_UID' => '','CALENDAR_NAME' => ''
|
||||
);
|
||||
$calendarObj = $calendar->getCalendarList(true, true);
|
||||
$calendarObj['array'][0] = Array('CALENDAR_UID' => '', 'CALENDAR_NAME' => '');
|
||||
|
||||
$response->rows = $calendarObj['array'];
|
||||
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
}
|
||||
|
||||
function getPMVariables ($param)
|
||||
public function getPMVariables($param)
|
||||
{
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new processMap( new DBConnection() );
|
||||
$response->rows = getDynaformsVars( $param['PRO_UID'] );
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new processMap(new DBConnection());
|
||||
$response->rows = getDynaformsVars($param['PRO_UID']);
|
||||
foreach ($response->rows as $i => $var) {
|
||||
$response->rows[$i]['sName'] = "@@{$var['sName']}";
|
||||
}
|
||||
print G::json_encode( $response );
|
||||
print G::json_encode($response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* tools/ajaxListener.php Ajax Listener for Cases rpc requests
|
||||
*
|
||||
@@ -21,47 +22,45 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com>
|
||||
* @date Jan 10th, 2010
|
||||
*/
|
||||
|
||||
require "classes/model/Translation.php";
|
||||
|
||||
$action = $_REQUEST['action'];
|
||||
unset( $_REQUEST['action'] );
|
||||
unset($_REQUEST['action']);
|
||||
$ajax = new Ajax();
|
||||
$ajax->$action( $_REQUEST );
|
||||
$ajax->$action($_REQUEST);
|
||||
|
||||
class Ajax
|
||||
{
|
||||
|
||||
function getList ($params)
|
||||
public function getList($params)
|
||||
{
|
||||
$search = isset( $params['search'] ) ? $params['search'] : null;
|
||||
$params['dateFrom'] = str_replace( 'T00:00:00', '', $params['dateFrom'] );
|
||||
$params['dateTo'] = str_replace( 'T00:00:00', '', $params['dateTo'] );
|
||||
$result = Translation::getAll( 'en', $params['start'], $params['limit'], $search, $params['dateFrom'], $params['dateTo'] );
|
||||
$search = isset($params['search']) ? $params['search'] : null;
|
||||
$params['dateFrom'] = str_replace('T00:00:00', '', $params['dateFrom']);
|
||||
$params['dateTo'] = str_replace('T00:00:00', '', $params['dateTo']);
|
||||
$result = Translation::getAll('en', $params['start'], $params['limit'], $search, $params['dateFrom'], $params['dateTo']);
|
||||
//$result = Translation::getAll('en', $params['start'], $params['limit'], $search);
|
||||
|
||||
|
||||
/*foreach($result->data as $i=>$row){
|
||||
$result->data[$i]['TRN_VALUE'] = substr($row['TRN_VALUE'], 0, 15) . '...';
|
||||
}*/
|
||||
/* foreach($result->data as $i=>$row){
|
||||
$result->data[$i]['TRN_VALUE'] = substr($row['TRN_VALUE'], 0, 15) . '...';
|
||||
} */
|
||||
|
||||
echo G::json_encode( $result );
|
||||
echo G::json_encode($result);
|
||||
}
|
||||
|
||||
function save ()
|
||||
public function save()
|
||||
{
|
||||
try {
|
||||
require_once ("classes/model/Translation.php");
|
||||
$id = $_POST['id'];
|
||||
$label = preg_replace( "[\n|\r|\n\r]", ' ', $_POST['label'] );
|
||||
$label = preg_replace("[\n|\r|\n\r]", ' ', $_POST['label']);
|
||||
|
||||
$res = Translation::addTranslation( 'LABEL', $id, 'en', $label );
|
||||
$res = Translation::addTranslation('LABEL', $id, 'en', $label);
|
||||
if ($res['codError'] < 0) {
|
||||
$result->success = false;
|
||||
$result->msg = $res['message'];
|
||||
@@ -69,51 +68,48 @@ class Ajax
|
||||
$result->success = true;
|
||||
$result->msg = 'Label ' . $id . ' saved Successfully!';
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function delete ()
|
||||
public function delete()
|
||||
{
|
||||
require_once ("classes/model/Translation.php");
|
||||
$ids = explode( ',', $_POST['IDS'] );
|
||||
$ids = explode(',', $_POST['IDS']);
|
||||
$category = 'LABEL';
|
||||
|
||||
try {
|
||||
foreach ($ids as $id) {
|
||||
$tr = TranslationPeer::retrieveByPK( $category, $id, 'en' );
|
||||
if ((is_object( $tr ) && get_class( $tr ) == 'Translation')) {
|
||||
$tr = TranslationPeer::retrieveByPK($category, $id, 'en');
|
||||
if ((is_object($tr) && get_class($tr) == 'Translation')) {
|
||||
$tr->delete();
|
||||
}
|
||||
}
|
||||
|
||||
$result->success = true;
|
||||
$result->msg = 'Deleted Successfully!';
|
||||
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
|
||||
function rebuild ()
|
||||
public function rebuild()
|
||||
{
|
||||
try {
|
||||
require_once ("classes/model/Translation.php");
|
||||
$t = new Translation();
|
||||
$result = Translation::generateFileTranslation( 'en' );
|
||||
$result = Translation::generateFileTranslation('en');
|
||||
$result['success'] = true;
|
||||
|
||||
} catch (Exception $e) {
|
||||
$result->success = false;
|
||||
$result->msg = $e->getMessage();
|
||||
}
|
||||
print G::json_encode( $result );
|
||||
print G::json_encode($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* triggers_WizardSave.php
|
||||
*
|
||||
@@ -21,20 +22,19 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||
if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
require_once ('classes/model/Triggers.php');
|
||||
$oTrigger = new Triggers();
|
||||
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new processMap( new DBConnection() );
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new processMap(new DBConnection());
|
||||
|
||||
$aDataTriggers = $_POST;
|
||||
|
||||
$aInfoFunction = explode( ",", $aDataTriggers['ALLFUNCTION'] );
|
||||
$aInfoFunctionType = explode( ",", $aDataTriggers['ALLFUNCTION_TYPE'] );
|
||||
$aInfoFunction = explode(",", $aDataTriggers['ALLFUNCTION']);
|
||||
$aInfoFunctionType = explode(",", $aDataTriggers['ALLFUNCTION_TYPE']);
|
||||
|
||||
$sPMfunction = "
|
||||
/***************************************************
|
||||
@@ -42,75 +42,73 @@ $sPMfunction = "
|
||||
* Generated by ProcessMaker Trigger Wizard
|
||||
* Library: " . $aDataTriggers['LIBRARY_NAME'] . "
|
||||
* Method: " . $aDataTriggers['PMFUNTION_LABEL'] . "
|
||||
* Date: " . date( "Y-m-d H:i:s" ) . "
|
||||
* Date: " . date("Y-m-d H:i:s") . "
|
||||
*
|
||||
* ProcessMaker " . date( "Y" ) . "
|
||||
* ProcessMaker " . date("Y") . "
|
||||
*
|
||||
****************************************************/
|
||||
|
||||
";
|
||||
|
||||
$methodParamsFinal = array ();
|
||||
$methodParamsFinal = array();
|
||||
//Generate params to send
|
||||
$i = 0;
|
||||
foreach ($aInfoFunction as $k => $v) {
|
||||
if ($v != '') {
|
||||
|
||||
$sOptionTrigger = trim( str_replace( "$", "", $v ) );
|
||||
if (strstr( $sOptionTrigger, "=" )) {
|
||||
$aOptionParameters = explode( "=", $sOptionTrigger );
|
||||
$sOptionTrigger = trim( $aOptionParameters[0] );
|
||||
$sOptionTrigger = trim(str_replace("$", "", $v));
|
||||
if (strstr($sOptionTrigger, "=")) {
|
||||
$aOptionParameters = explode("=", $sOptionTrigger);
|
||||
$sOptionTrigger = trim($aOptionParameters[0]);
|
||||
}
|
||||
if ($aDataTriggers[$sOptionTrigger] != '') {
|
||||
|
||||
if ((strstr( $aDataTriggers[$sOptionTrigger], "@@" ))) {
|
||||
$option = trim( $aDataTriggers[$sOptionTrigger] );
|
||||
if ((strstr($aDataTriggers[$sOptionTrigger], "@@"))) {
|
||||
$option = trim($aDataTriggers[$sOptionTrigger]);
|
||||
} else {
|
||||
|
||||
$aDataTriggers[$sOptionTrigger] = (strstr( $aDataTriggers[$sOptionTrigger], 'array' )) ? str_replace( "'", '"', $aDataTriggers[$sOptionTrigger] ) : str_replace( "'", "\'", $aDataTriggers[$sOptionTrigger] );
|
||||
switch(trim($aInfoFunctionType[$i])) {
|
||||
case 'boolean' :
|
||||
$option = $aDataTriggers[$sOptionTrigger];
|
||||
break;
|
||||
case 'int' :
|
||||
$option = intval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
case 'float' :
|
||||
case 'real' :
|
||||
case 'double' :
|
||||
$option = floatval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
default:
|
||||
$option = (is_numeric( $aDataTriggers[$sOptionTrigger] ) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim( $aDataTriggers[$sOptionTrigger] ) : (strstr( $aDataTriggers[$sOptionTrigger], "array" )) ? trim( $aDataTriggers[$sOptionTrigger] ) : "'" . trim( $aDataTriggers[$sOptionTrigger] ) . "'";
|
||||
break;
|
||||
$aDataTriggers[$sOptionTrigger] = (strstr($aDataTriggers[$sOptionTrigger], 'array')) ? str_replace("'", '"', $aDataTriggers[$sOptionTrigger]) : str_replace("'", "\'", $aDataTriggers[$sOptionTrigger]);
|
||||
switch (trim($aInfoFunctionType[$i])) {
|
||||
case 'boolean':
|
||||
$option = $aDataTriggers[$sOptionTrigger];
|
||||
break;
|
||||
case 'int':
|
||||
$option = intval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
case 'float':
|
||||
case 'real':
|
||||
case 'double':
|
||||
$option = floatval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
default:
|
||||
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$option = "''";
|
||||
}
|
||||
$methodParamsFinal[] = $option;
|
||||
|
||||
}
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
//G::pr($methodParamsFinal);die;
|
||||
$sPMfunction .= (isset( $aDataTriggers['TRI_ANSWER'] ) && $aDataTriggers['TRI_ANSWER'] != '') ? $aDataTriggers['TRI_ANSWER'] . " = " : "";
|
||||
$sPMfunction .= $aDataTriggers['PMFUNTION_NAME'] . " (" . implode( ",", $methodParamsFinal ) . ");";
|
||||
$sPMfunction .= (isset($aDataTriggers['TRI_ANSWER']) && $aDataTriggers['TRI_ANSWER'] != '') ? $aDataTriggers['TRI_ANSWER'] . " = " : "";
|
||||
$sPMfunction .= $aDataTriggers['PMFUNTION_NAME'] . " (" . implode(",", $methodParamsFinal) . ");";
|
||||
|
||||
//Create Trigger
|
||||
$aDataTriggers['TRI_WEBBOT'] = $sPMfunction;
|
||||
$aDataTriggersParams = array ();
|
||||
$aDataTriggersParams['hash'] = md5( $sPMfunction );
|
||||
$aDataTriggersParams = array();
|
||||
$aDataTriggersParams['hash'] = md5($sPMfunction);
|
||||
$aDataTriggersParams['params'] = $aDataTriggers;
|
||||
|
||||
$aDataTriggers['TRI_PARAM'] = serialize( $aDataTriggersParams );
|
||||
$oTrigger->create( $aDataTriggers );
|
||||
$aDataTriggers['TRI_PARAM'] = serialize($aDataTriggersParams);
|
||||
$oTrigger->create($aDataTriggers);
|
||||
|
||||
//Update Info
|
||||
$aDataTriggers['TRI_UID'] = $oTrigger->getTriUid();
|
||||
$oTrigger->update( $aDataTriggers );
|
||||
$oTrigger->update($aDataTriggers);
|
||||
|
||||
//Update Trigger Array
|
||||
$oProcessMap->triggersList( $aDataTriggers['PRO_UID'] );
|
||||
$oProcessMap->triggersList($aDataTriggers['PRO_UID']);
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* triggers_WizardUpdate.php
|
||||
*
|
||||
@@ -21,101 +22,98 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||
if (($RBAC_Response = $RBAC->userCanAccess("PM_FACTORY")) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
if (! class_exists( 'Triggers' )) {
|
||||
if (!class_exists('Triggers')) {
|
||||
require_once ('classes/model/Triggers.php');
|
||||
}
|
||||
$oTrigger = new Triggers();
|
||||
|
||||
G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new processMap( new DBConnection() );
|
||||
G::LoadClass('processMap');
|
||||
$oProcessMap = new processMap(new DBConnection());
|
||||
|
||||
$aDataTriggers = $_POST;
|
||||
$triUid = $_POST['TRI_UID'];
|
||||
|
||||
$aInfoFunction = explode( ",", $aDataTriggers['ALLFUNCTION'] );
|
||||
$aInfoFunctionType = explode( ",", $aDataTriggers['ALLFUNCTION_TYPE'] );
|
||||
$aInfoFunction = explode(",", $aDataTriggers['ALLFUNCTION']);
|
||||
$aInfoFunctionType = explode(",", $aDataTriggers['ALLFUNCTION_TYPE']);
|
||||
$sPMfunction = "
|
||||
/***************************************************
|
||||
*
|
||||
* Generated by ProcessMaker Trigger Wizard
|
||||
* Library: " . $aDataTriggers['LIBRARY_NAME'] . "
|
||||
* Method: " . $aDataTriggers['PMFUNTION_LABEL'] . "
|
||||
* Date: " . date( "Y-m-d H:i:s" ) . "
|
||||
* Date: " . date("Y-m-d H:i:s") . "
|
||||
*
|
||||
* ProcessMaker " . date( "Y" ) . "
|
||||
* ProcessMaker " . date("Y") . "
|
||||
*
|
||||
****************************************************/
|
||||
|
||||
";
|
||||
|
||||
|
||||
$methodParamsFinal = array ();
|
||||
$methodParamsFinal = array();
|
||||
//Generate params to send
|
||||
$i = 0;
|
||||
foreach ($aInfoFunction as $k => $v) {
|
||||
if ($v != '') {
|
||||
|
||||
$sOptionTrigger = trim( str_replace( "$", "", $v ) );
|
||||
if (strstr( $sOptionTrigger, "=" )) {
|
||||
$aOptionParameters = explode( "=", $sOptionTrigger );
|
||||
$sOptionTrigger = trim( $aOptionParameters[0] );
|
||||
$sOptionTrigger = trim(str_replace("$", "", $v));
|
||||
if (strstr($sOptionTrigger, "=")) {
|
||||
$aOptionParameters = explode("=", $sOptionTrigger);
|
||||
$sOptionTrigger = trim($aOptionParameters[0]);
|
||||
}
|
||||
if ($aDataTriggers[$sOptionTrigger] != '') {
|
||||
|
||||
if ((strstr( $aDataTriggers[$sOptionTrigger], "@@" ))) {
|
||||
if ((strstr($aDataTriggers[$sOptionTrigger], "@@"))) {
|
||||
$option = $aDataTriggers[$sOptionTrigger];
|
||||
} else {
|
||||
|
||||
$aDataTriggers[$sOptionTrigger] = (strstr( $aDataTriggers[$sOptionTrigger], 'array' )) ? str_replace( "'", '"', $aDataTriggers[$sOptionTrigger] ) : str_replace( "'", "\'", $aDataTriggers[$sOptionTrigger] );
|
||||
switch(trim($aInfoFunctionType[$i])) {
|
||||
case 'boolean' :
|
||||
$option = $aDataTriggers[$sOptionTrigger];
|
||||
break;
|
||||
case 'int' :
|
||||
$option = intval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
case 'float' :
|
||||
case 'real' :
|
||||
case 'double' :
|
||||
$option = floatval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
default:
|
||||
$option = (is_numeric( $aDataTriggers[$sOptionTrigger] ) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim( $aDataTriggers[$sOptionTrigger] ) : (strstr( $aDataTriggers[$sOptionTrigger], "array" )) ? trim( $aDataTriggers[$sOptionTrigger] ) : "'" . trim( $aDataTriggers[$sOptionTrigger] ) . "'";
|
||||
break;
|
||||
$aDataTriggers[$sOptionTrigger] = (strstr($aDataTriggers[$sOptionTrigger], 'array')) ? str_replace("'", '"', $aDataTriggers[$sOptionTrigger]) : str_replace("'", "\'", $aDataTriggers[$sOptionTrigger]);
|
||||
switch (trim($aInfoFunctionType[$i])) {
|
||||
case 'boolean':
|
||||
$option = $aDataTriggers[$sOptionTrigger];
|
||||
break;
|
||||
case 'int':
|
||||
$option = intval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
case 'float':
|
||||
case 'real':
|
||||
case 'double':
|
||||
$option = floatval($aDataTriggers[$sOptionTrigger]);
|
||||
break;
|
||||
default:
|
||||
$option = (is_numeric($aDataTriggers[$sOptionTrigger]) || is_bool($aDataTriggers[$sOptionTrigger]) ) ? trim($aDataTriggers[$sOptionTrigger]) : (strstr($aDataTriggers[$sOptionTrigger], "array")) ? trim($aDataTriggers[$sOptionTrigger]) : "'" . trim($aDataTriggers[$sOptionTrigger]) . "'";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$option = "' '";
|
||||
}
|
||||
$methodParamsFinal[] = $option;
|
||||
|
||||
}
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
|
||||
$sPMfunction .= (isset( $aDataTriggers['TRI_ANSWER'] ) && $aDataTriggers['TRI_ANSWER'] != '') ? $aDataTriggers['TRI_ANSWER'] . " = " : "";
|
||||
$sPMfunction .= $aDataTriggers['PMFUNTION_NAME'] . " (" . implode( ",", $methodParamsFinal ) . ");";
|
||||
$sPMfunction .= (isset($aDataTriggers['TRI_ANSWER']) && $aDataTriggers['TRI_ANSWER'] != '') ? $aDataTriggers['TRI_ANSWER'] . " = " : "";
|
||||
$sPMfunction .= $aDataTriggers['PMFUNTION_NAME'] . " (" . implode(",", $methodParamsFinal) . ");";
|
||||
|
||||
//Create Trigger
|
||||
$aDataTriggers['TRI_WEBBOT'] = $sPMfunction;
|
||||
$aDataTriggersParams = array ();
|
||||
$aDataTriggersParams['hash'] = md5( $sPMfunction );
|
||||
$aDataTriggersParams = array();
|
||||
$aDataTriggersParams['hash'] = md5($sPMfunction);
|
||||
$aDataTriggersParams['params'] = $aDataTriggers;
|
||||
|
||||
$aDataTriggers['TRI_PARAM'] = serialize( $aDataTriggersParams );
|
||||
$aDataTriggers['TRI_PARAM'] = serialize($aDataTriggersParams);
|
||||
//$oTrigger->create ( $aDataTriggers );
|
||||
$aDataTriggerLoaded = $oTrigger->load( $triUid );
|
||||
$aDataTriggerLoaded = $oTrigger->load($triUid);
|
||||
//var_dump($aDataTriggerLoaded);
|
||||
//die;
|
||||
//Update Info
|
||||
$aDataTriggers['TRI_UID'] = $oTrigger->getTriUid();
|
||||
$oTrigger->update( $aDataTriggers );
|
||||
$oTrigger->update($aDataTriggers);
|
||||
|
||||
//Update Trigger Array
|
||||
$oProcessMap->triggersList( $aDataTriggers['PRO_UID'] );
|
||||
$oProcessMap->triggersList($aDataTriggers['PRO_UID']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user