Merge pull request #817 from norahmollo/master

CODE STYLE Formating worflow/engine/methods/tracker/
This commit is contained in:
ferOnti
2012-10-18 10:29:14 -07:00
16 changed files with 1381 additions and 1432 deletions

View File

@@ -1,120 +1,113 @@
<?php <?php
/** /**
* authentication.php * authentication.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.
* */
*/ /*
/*
* Authentication for Case Tracker * Authentication for Case Tracker
* *
* @author Everth S. Berrios Morales <everth@colosa.com> * @author Everth S. Berrios Morales <everth@colosa.com>
* *
*/ */
if (!isset($_POST['form']) ) { if (! isset( $_POST['form'] )) {
G::SendTemporalMessage ('ID_USER_HAVENT_RIGHTS_SYSTEM', "error"); G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', "error" );
G::header ("location: login.php");die; G::header( "location: login.php" );
} die();
}
try {
$frm = $_POST['form']; try {
$case = ''; $frm = $_POST['form'];
$pin = ''; $case = '';
$pin = '';
if (isset($frm['CASE'])) {
$case = strtolower(trim($frm['CASE'])); if (isset( $frm['CASE'] )) {
$pin = trim($frm['PIN']); $case = strtolower( trim( $frm['CASE'] ) );
} $pin = trim( $frm['PIN'] );
}
G::LoadClass('case');
$cases = new Cases(); G::LoadClass( 'case' );
$cases = new Cases();
$uid = $cases->verifyCaseTracker($case, $pin);
switch ($uid) { $uid = $cases->verifyCaseTracker( $case, $pin );
//The case doesn't exist switch ($uid) {
case -1: //The case doesn't exist
G::SendTemporalMessage ('ID_CASE_NOT_EXISTS', "error"); case - 1:
break; G::SendTemporalMessage( 'ID_CASE_NOT_EXISTS', "error" );
//The pin is invalid break;
case -2: //The pin is invalid
G::SendTemporalMessage ('ID_PIN_INVALID', "error"); case - 2:
break; G::SendTemporalMessage( 'ID_PIN_INVALID', "error" );
} break;
}
if ($uid < 0 ) {
G::header ("location: login.php"); if ($uid < 0) {
die; G::header( "location: login.php" );
} die();
}
if(is_array($uid))
{ if (is_array( $uid )) {
require_once ("classes/model/CaseTracker.php"); require_once ("classes/model/CaseTracker.php");
require_once ("classes/model/CaseTrackerObject.php"); require_once ("classes/model/CaseTrackerObject.php");
$_SESSION['CASE'] = $case; $_SESSION['CASE'] = $case;
$_SESSION['PIN'] = $pin; $_SESSION['PIN'] = $pin;
$_SESSION['PROCESS'] = $uid['PRO_UID']; $_SESSION['PROCESS'] = $uid['PRO_UID'];
$_SESSION['APPLICATION'] = $uid['APP_UID']; $_SESSION['APPLICATION'] = $uid['APP_UID'];
$_SESSION['TASK'] = -1; $_SESSION['TASK'] = - 1;
$_SESSION['INDEX'] = -1; $_SESSION['INDEX'] = - 1;
$criteria = new Criteria(); $criteria = new Criteria();
$criteria->add(CaseTrackerPeer::PRO_UID, $_SESSION['PROCESS']); $criteria->add( CaseTrackerPeer::PRO_UID, $_SESSION['PROCESS'] );
$caseTracker = new CaseTracker(); $caseTracker = new CaseTracker();
if (CaseTrackerPeer::doCount($criteria) === 0) { if (CaseTrackerPeer::doCount( $criteria ) === 0) {
$permissionsCaseTracker = array('PRO_UID' => $_SESSION['PROCESS'], $permissionsCaseTracker = array ('PRO_UID' => $_SESSION['PROCESS'],'CT_MAP_TYPE' => 'PROCESSMAP','CT_DERIVATION_HISTORY' => 1,'CT_MESSAGE_HISTORY' => 1
'CT_MAP_TYPE' => 'PROCESSMAP', );
'CT_DERIVATION_HISTORY' => 1, $caseTracker->create( $permissionsCaseTracker );
'CT_MESSAGE_HISTORY' => 1); }
$caseTracker->create($permissionsCaseTracker); $caseTracker = $cases->caseTrackerPermissions( $_SESSION['PROCESS'] );
}
$caseTracker = $cases->caseTrackerPermissions( $_SESSION['PROCESS']); if ($caseTracker['CT_MAP_TYPE']) {
G::header( 'location: tracker_ViewMap' );
if ($caseTracker['CT_MAP_TYPE']) { } else {
G::header ('location: tracker_ViewMap'); if ($caseTracker['DYNADOC']) {
} G::header( "location: tracker_DynaDocs" );
else { } else {
if ($caseTracker['DYNADOC']) { if ($caseTracker['CT_DERIVATION_HISTORY']) {
G::header ("location: tracker_DynaDocs"); G::header( "location: tracker_History" );
} } else {
else { if ($caseTracker['CT_MESSAGE_HISTORY']) {
if ($caseTracker['CT_DERIVATION_HISTORY']) { G::header( "location: tracker_No" );
G::header ("location: tracker_History"); } else {
} G::header( "location: login.php" );
else { G::SendTemporalMessage( 'ID_ACCOUNT_DISABLED_CONTACT_ADMIN', "error" );
if ($caseTracker['CT_MESSAGE_HISTORY']) { }
G::header ("location: tracker_No"); }
} }
else { }
G::header ("location: login.php"); }
G::SendTemporalMessage ('ID_ACCOUNT_DISABLED_CONTACT_ADMIN', "error"); } catch (Exception $e) {
} $aMessage['MESSAGE'] = $e->getMessage();
} $G_PUBLISH = new Publisher();
} $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
} G::RenderPage( 'publish' );
} die();
} }
catch ( Exception $e ) {
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
die;
}

View File

@@ -1,45 +1,39 @@
<?php <?php
/** /**
* login.php * login.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.
* */
*/
/*
/* * Login for authentication of Case Tracker
* Login for authentication of Case Tracker *
* * @author Everth S. Berrios Morales <everth@colosa.com>
* @author Everth S. Berrios Morales <everth@colosa.com> *
* */
*/
$G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher;
//echo G::generateUniqueNumber(); //echo G::generateUniqueNumber();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/login', '', '', SYS_URI.'tracker/authentication.php'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/login', '', '', SYS_URI . 'tracker/authentication.php' );
G::RenderPage( "publish" ); G::RenderPage( "publish" );
session_destroy(); session_destroy();
session_start(); session_start();

View File

@@ -1,69 +1,68 @@
<?php <?php
/** /**
* trackerAjax.php * trackerAjax.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 { if (isset( $_POST['form']['action'] )) {
if (isset($_POST['form']['action'])) { $_POST['action'] = $_POST['form']['action'];
$_POST['action'] = $_POST['form']['action']; }
} switch ($_POST['action']) {
switch ($_POST['action']) { case 'availableCaseTrackerObjects':
case 'availableCaseTrackerObjects': G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $oProcessMap->availableCaseTrackerObjects( $_POST['PRO_UID'] );
$oProcessMap->availableCaseTrackerObjects($_POST['PRO_UID']); break;
break; case 'assignCaseTrackerObject':
case 'assignCaseTrackerObject': G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $cto_UID = $oProcessMap->assignCaseTrackerObject( $_POST['PRO_UID'], $_POST['OBJECT_TYPE'], $_POST['OBJECT_UID'] );
$cto_UID = $oProcessMap->assignCaseTrackerObject($_POST['PRO_UID'], $_POST['OBJECT_TYPE'], $_POST['OBJECT_UID']); $oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
$oProcessMap->getCaseTrackerObjectsCriteria($_POST['PRO_UID']); echo $cto_UID;
echo $cto_UID; break;
break; case 'removeCaseTrackerObject':
case 'removeCaseTrackerObject': G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $oProcessMap->removeCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
$oProcessMap->removeCaseTrackerObject($_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION']); $oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
$oProcessMap->getCaseTrackerObjectsCriteria($_POST['PRO_UID']); break;
break; case 'upCaseTrackerObject':
case 'upCaseTrackerObject': G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $oProcessMap->upCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
$oProcessMap->upCaseTrackerObject($_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION']); $oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
$oProcessMap->getCaseTrackerObjectsCriteria($_POST['PRO_UID']); break;
break; case 'downCaseTrackerObject':
case 'downCaseTrackerObject': G::LoadClass( 'processMap' );
G::LoadClass('processMap'); $oProcessMap = new ProcessMap();
$oProcessMap = new ProcessMap(); $oProcessMap->downCaseTrackerObject( $_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION'] );
$oProcessMap->downCaseTrackerObject($_POST['CTO_UID'], $_POST['PRO_UID'], $_POST['STEP_POSITION']); $oProcessMap->getCaseTrackerObjectsCriteria( $_POST['PRO_UID'] );
$oProcessMap->getCaseTrackerObjectsCriteria($_POST['PRO_UID']); break;
break; case 'editStagesMap':
case 'editStagesMap': $oTemplatePower = new TemplatePower( PATH_TPL . 'tracker/stages_Map.html' );
$oTemplatePower = new TemplatePower(PATH_TPL . 'tracker/stages_Map.html'); $oTemplatePower->prepare();
$oTemplatePower->prepare(); $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher; $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher =& headPublisher::getSingleton(); $oHeadPublisher->addScriptCode( '
$oHeadPublisher->addScriptCode('
var pb=leimnud.dom.capture("tag.body 0"); var pb=leimnud.dom.capture("tag.body 0");
Sm=new stagesmap(); Sm=new stagesmap();
Sm.options = { Sm.options = {
@@ -77,366 +76,361 @@ try {
rw : true, rw : true,
hideMenu : false hideMenu : false
}; };
Sm.make();'); Sm.make();' );
G::RenderPage('publish', 'raw'); G::RenderPage( 'publish', 'raw' );
break; break;
case 'showUploadedDocumentTracker': case 'showUploadedDocumentTracker':
require_once 'classes/model/AppDocument.php'; require_once 'classes/model/AppDocument.php';
require_once 'classes/model/AppDelegation.php'; require_once 'classes/model/AppDelegation.php';
require_once 'classes/model/InputDocument.php'; require_once 'classes/model/InputDocument.php';
require_once 'classes/model/Users.php'; require_once 'classes/model/Users.php';
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_POST['APP_DOC_UID']); $oAppDocument->Fields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
$oInputDocument = new InputDocument(); $oInputDocument = new InputDocument();
if ($oAppDocument->Fields['DOC_UID'] != -1) { if ($oAppDocument->Fields['DOC_UID'] != - 1) {
$Fields = $oInputDocument->load($oAppDocument->Fields['DOC_UID']); $Fields = $oInputDocument->load( $oAppDocument->Fields['DOC_UID'] );
} } else {
else { $Fields = array ('INP_DOC_FORM_NEEDED' => '','FILENAME' => $oAppDocument->Fields['APP_DOC_FILENAME']);
$Fields = array('INP_DOC_FORM_NEEDED' => '', 'FILENAME' => $oAppDocument->Fields['APP_DOC_FILENAME']); }
} $oCriteria = new Criteria( 'workflow' );
$oCriteria = new Criteria('workflow'); $oCriteria->add( AppDelegationPeer::DEL_INDEX, $oAppDocument->Fields['DEL_INDEX'] );
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $oAppDocument->Fields['DEL_INDEX']); $oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
$oDataset = AppDelegationPeer::doSelectRS($oCriteria); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next();
$oDataset->next(); $aRow = $oDataset->getRow();
$aRow = $oDataset->getRow(); $oTask = new Task();
$oTask = new Task(); $aTask = $oTask->load( $aRow['TAS_UID'] );
$aTask = $oTask->load($aRow['TAS_UID']); $Fields['ORIGIN'] = $aTask['TAS_TITLE'];
$Fields['ORIGIN'] = $aTask['TAS_TITLE']; $oUser = new Users();
$oUser = new Users(); $aUser = $oUser->load( $oAppDocument->Fields['USR_UID'] );
$aUser = $oUser->load($oAppDocument->Fields['USR_UID']); $Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME']; switch ($Fields['INP_DOC_FORM_NEEDED']) {
switch ($Fields['INP_DOC_FORM_NEEDED']) case 'REAL':
{ $sXmlForm = 'tracker/tracker_ViewAnyInputDocument2';
case 'REAL': break;
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument2'; case 'VIRTUAL':
break; $sXmlForm = 'tracker/tracker_ViewAnyInputDocument1';
case 'VIRTUAL': break;
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument1'; case 'VREAL':
break; $sXmlForm = 'tracker/tracker_ViewAnyInputDocument3';
case 'VREAL': break;
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument3'; default:
break; $sXmlForm = 'tracker/tracker_ViewAnyInputDocument';
default: break;
$sXmlForm = 'tracker/tracker_ViewAnyInputDocument'; }
break; $oAppDocument->Fields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
} $oAppDocument->Fields['FILE'] = 'tracker_ShowDocument?a=' . $_POST['APP_DOC_UID'] . '&r=' . rand();
$oAppDocument->Fields['VIEW'] = G::LoadTranslation('ID_OPEN');
$oAppDocument->Fields['FILE'] = 'tracker_ShowDocument?a=' . $_POST['APP_DOC_UID'] . '&r=' . rand(); //If plugin and trigger are defined for listing
if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
//If plugin and trigger are defined for listing $oPluginRegistry = & PMPluginRegistry::getSingleton();
if ( $oPluginRegistry->existsTrigger ( PM_CASE_DOCUMENT_LIST_ARR ) ) { $filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $_SESSION['APPLICATION'] );
$oPluginRegistry =& PMPluginRegistry::getSingleton(); //Now search for the file, if exists the change the download URL
$filesPluginArray=$oPluginRegistry->executeTriggers ( PM_CASE_DOCUMENT_LIST_ARR , $_SESSION['APPLICATION'] ); foreach ($filesPluginArray as $file) {
//Now search for the file, if exists the change the download URL if ($file->filename == $_POST['APP_DOC_UID']) {
foreach($filesPluginArray as $file){ $oAppDocument->Fields['FILE'] = $file->downloadScript;
if($file->filename==$_POST['APP_DOC_UID']){ }
$oAppDocument->Fields['FILE'] = $file->downloadScript; }
} }
}
} $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
G::RenderPage( 'publish', 'raw' );
$G_PUBLISH = new Publisher; break;
$G_PUBLISH->AddContent('xmlform', 'xmlform', $sXmlForm, '', G::array_merges($Fields, $oAppDocument->Fields), ''); case 'showGeneratedDocumentTracker':
G::RenderPage('publish', 'raw'); require_once 'classes/model/AppDocument.php';
break; require_once 'classes/model/AppDelegation.php';
case 'showGeneratedDocumentTracker': $oAppDocument = new AppDocument();
require_once 'classes/model/AppDocument.php'; $aFields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
require_once 'classes/model/AppDelegation.php'; require_once 'classes/model/OutputDocument.php';
$oAppDocument = new AppDocument(); $oOutputDocument = new OutputDocument();
$aFields = $oAppDocument->load($_POST['APP_DOC_UID']); $aOD = $oOutputDocument->load( $aFields['DOC_UID'] );
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument(); $oCriteria = new Criteria( 'workflow' );
$aOD = $oOutputDocument->load($aFields['DOC_UID']); $oCriteria->add( AppDelegationPeer::APP_UID, $aFields['APP_UID'] );
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $aFields['DEL_INDEX'] );
$oCriteria = new Criteria('workflow'); $oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
$oCriteria->add(AppDelegationPeer::APP_UID, $aFields['APP_UID']); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $aFields['DEL_INDEX']); $oDataset->next();
$oDataset = AppDelegationPeer::doSelectRS($oCriteria); $aRow = $oDataset->getRow();
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oTask = new Task();
$oDataset->next(); $aTask = $oTask->load( $aRow['TAS_UID'] );
$aRow = $oDataset->getRow(); $aFields['ORIGIN'] = $aTask['TAS_TITLE'];
$oTask = new Task(); require_once 'classes/model/Users.php';
$aTask = $oTask->load($aRow['TAS_UID']); $oUser = new Users();
$aFields['ORIGIN'] = $aTask['TAS_TITLE']; $aUser = $oUser->load( $aFields['USR_UID'] );
require_once 'classes/model/Users.php'; $aFields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oUser = new Users(); $aFields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
$aUser = $oUser->load($aFields['USR_UID']); $aFields['FILE1'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
$aFields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME']; $aFields['FILE2'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
$aFields['VIEW'] = G::LoadTranslation('ID_OPEN');
$aFields['FILE1'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand(); //If plugin and trigger are defined for listing
$aFields['FILE2'] = 'tracker_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand(); if ($oPluginRegistry->existsTrigger( PM_CASE_DOCUMENT_LIST_ARR )) {
$oPluginRegistry = & PMPluginRegistry::getSingleton();
$filesPluginArray = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST_ARR, $aFields['APP_UID'] );
//If plugin and trigger are defined for listing //Now search for the file, if exists the change the download URL
if ( $oPluginRegistry->existsTrigger ( PM_CASE_DOCUMENT_LIST_ARR ) ) { foreach ($filesPluginArray as $file) {
$oPluginRegistry =& PMPluginRegistry::getSingleton(); if ($file->filename == $_POST['APP_DOC_UID']) {
$filesPluginArray=$oPluginRegistry->executeTriggers ( PM_CASE_DOCUMENT_LIST_ARR , $aFields['APP_UID'] ); $aFields['FILE2'] = $file->downloadScript; // The PDF is the only one uploaded to KT
//Now search for the file, if exists the change the download URL }
foreach($filesPluginArray as $file){ }
if($file->filename==$_POST['APP_DOC_UID']){ }
$aFields['FILE2'] = $file->downloadScript;// The PDF is the only one uploaded to KT
} $G_PUBLISH = new Publisher();
} $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_ViewAnyOutputDocument', '', G::array_merges( $aOD, $aFields ), '' );
} G::RenderPage( 'publish', 'raw' );
break;
case 'load':
$oConnection = Propel::getConnection( 'workflow' );
$G_PUBLISH = new Publisher(); $oStatement = $oConnection->prepareStatement( "CREATE TABLE IF NOT EXISTS `STAGE` (
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/tracker_ViewAnyOutputDocument', '', G::array_merges($aOD, $aFields), '');
G::RenderPage('publish', 'raw');
break;
case 'load':
$oConnection = Propel::getConnection('workflow');
$oStatement = $oConnection->prepareStatement("CREATE TABLE IF NOT EXISTS `STAGE` (
`STG_UID` VARCHAR( 32 ) NOT NULL , `STG_UID` VARCHAR( 32 ) NOT NULL ,
`PRO_UID` VARCHAR( 32 ) NOT NULL , `PRO_UID` VARCHAR( 32 ) NOT NULL ,
`STG_POSX` INT( 11 ) NOT NULL DEFAULT '0', `STG_POSX` INT( 11 ) NOT NULL DEFAULT '0',
`STG_POSY` INT( 11 ) NOT NULL DEFAULT '0', `STG_POSY` INT( 11 ) NOT NULL DEFAULT '0',
`STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0', `STG_INDEX` INT( 11 ) NOT NULL DEFAULT '0',
PRIMARY KEY ( `STG_UID` ) PRIMARY KEY ( `STG_UID` )
);"); );" );
$oStatement->executeQuery(); $oStatement->executeQuery();
/***************************************************************************************************************/ /**
require_once 'classes/model/Stage.php'; * ************************************************************************************************************
require_once 'classes/model/Process.php'; */
require_once 'classes/model/Task.php'; require_once 'classes/model/Stage.php';
require_once 'classes/model/AppDelegation.php'; require_once 'classes/model/Process.php';
$oJSON = new Services_JSON(); require_once 'classes/model/Task.php';
$oData = $oJSON->decode(stripslashes($_POST['data'])); require_once 'classes/model/AppDelegation.php';
$oProcess = new Process(); $oJSON = new Services_JSON();
$aRow = $oProcess->load($oData->uid); $oData = $oJSON->decode( stripslashes( $_POST['data'] ) );
$oSM->title->label = strip_tags($aRow['PRO_TITLE']); $oProcess = new Process();
//$oSM->title->position->x = $aRow['PRO_TITLE_X']; $aRow = $oProcess->load( $oData->uid );
//$oSM->title->position->y = $aRow['PRO_TITLE_Y']; $oSM->title->label = strip_tags( $aRow['PRO_TITLE'] );
$oSM->title->position->x = 10; //$oSM->title->position->x = $aRow['PRO_TITLE_X'];
$oSM->title->position->y = 10; //$oSM->title->position->y = $aRow['PRO_TITLE_Y'];
$oSM->stages = array(); $oSM->title->position->x = 10;
$oCriteria = new Criteria('workflow'); $oSM->title->position->y = 10;
$oCriteria->addSelectColumn(StagePeer::STG_UID); $oSM->stages = array ();
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE); $oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn(StagePeer::STG_POSX); $oCriteria->addSelectColumn( StagePeer::STG_UID );
$oCriteria->addSelectColumn(StagePeer::STG_POSY); $oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
$aConditions = array(); $oCriteria->addSelectColumn( StagePeer::STG_POSX );
$aConditions[] = array(0 => StagePeer::STG_UID, 1 => ContentPeer::CON_ID); $oCriteria->addSelectColumn( StagePeer::STG_POSY );
$aConditions[] = array(0 => ContentPeer::CON_CATEGORY, 1 => DBAdapter::getStringDelimiter() . 'STG_TITLE' . DBAdapter::getStringDelimiter()); $aConditions = array ();
$aConditions[] = array(0 => ContentPeer::CON_LANG, 1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter()); $aConditions[] = array (0 => StagePeer::STG_UID,1 => ContentPeer::CON_ID);
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN); $aConditions[] = array (0 => ContentPeer::CON_CATEGORY,1 => DBAdapter::getStringDelimiter() . 'STG_TITLE' . DBAdapter::getStringDelimiter());
$oCriteria->add(StagePeer::PRO_UID, $oData->uid); $aConditions[] = array (0 => ContentPeer::CON_LANG,1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
$oCriteria->addAscendingOrderByColumn(StagePeer::STG_INDEX); $oCriteria->addJoinMC( $aConditions, Criteria::LEFT_JOIN );
$oDataset = StagePeer::doSelectRS($oCriteria); $oCriteria->add( StagePeer::PRO_UID, $oData->uid );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oCriteria->addAscendingOrderByColumn( StagePeer::STG_INDEX );
$oDataset->next(); $oDataset = StagePeer::doSelectRS( $oCriteria );
while ($aRow1 = $oDataset->getRow()) { $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oStage = null; $oDataset->next();
$oStage->uid = $aRow1['STG_UID']; while ($aRow1 = $oDataset->getRow()) {
$oStage->label = strip_tags($aRow1['CON_VALUE']); $oStage = null;
$oStage->position->x = (int)$aRow1['STG_POSX']; $oStage->uid = $aRow1['STG_UID'];
$oStage->position->y = (int)$aRow1['STG_POSY']; $oStage->label = strip_tags( $aRow1['CON_VALUE'] );
$oStage->derivation = null; $oStage->position->x = (int) $aRow1['STG_POSX'];
$oStage->derivation->to = array(); $oStage->position->y = (int) $aRow1['STG_POSY'];
if (!$oData->mode) { $oStage->derivation = null;
$oCriteria = new Criteria('workflow'); $oStage->derivation->to = array ();
$oCriteria->add(TaskPeer::STG_UID, $aRow1['STG_UID']); if (! $oData->mode) {
$oDataset1 = TaskPeer::doSelectRS($oCriteria); $oCriteria = new Criteria( 'workflow' );
$oDataset1->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oCriteria->add( TaskPeer::STG_UID, $aRow1['STG_UID'] );
$oDataset1->next(); $oDataset1 = TaskPeer::doSelectRS( $oCriteria );
$aTasks = array(); $oDataset1->setFetchmode( ResultSet::FETCHMODE_ASSOC );
while ($aRow2 = $oDataset1->getRow()) { $oDataset1->next();
$aTasks[] = $aRow2['TAS_UID']; $aTasks = array ();
$oDataset1->next(); while ($aRow2 = $oDataset1->getRow()) {
} $aTasks[] = $aRow2['TAS_UID'];
$oCriteria = new Criteria('workflow'); $oDataset1->next();
$oCriteria->add(AppDelegationPeer::APP_UID, $_SESSION['APPLICATION']); }
$oCriteria->add(AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN); $oCriteria = new Criteria( 'workflow' );
$oCriteria->add($oCriteria->getNewCriterion(AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL)->addOr($oCriteria->getNewCriterion(AppDelegationPeer::DEL_FINISH_DATE, ''))); $oCriteria->add( AppDelegationPeer::APP_UID, $_SESSION['APPLICATION'] );
if (AppDelegationPeer::doCount($oCriteria) > 0) { $oCriteria->add( AppDelegationPeer::TAS_UID, $aTasks, Criteria::IN );
$oStage->color = '#FF0000'; $oCriteria->add( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, null, Criteria::ISNULL )->addOr( $oCriteria->getNewCriterion( AppDelegationPeer::DEL_FINISH_DATE, '' ) ) );
} if (AppDelegationPeer::doCount( $oCriteria ) > 0) {
} $oStage->color = '#FF0000';
$oSM->stages[] = $oStage; }
$oDataset->next(); }
} $oSM->stages[] = $oStage;
foreach ($oSM->stages as $iKey => $oStage) { $oDataset->next();
if (isset($oSM->stages[$iKey + 1])) { }
$oDerivation = new StdClass(); foreach ($oSM->stages as $iKey => $oStage) {
$oDerivation->stage = $oSM->stages[$iKey + 1]->uid; if (isset( $oSM->stages[$iKey + 1] )) {
$oSM->stages[$iKey]->derivation->to = array($oDerivation); $oDerivation = new StdClass();
$oSM->stages[$iKey]->derivation->type = 0; $oDerivation->stage = $oSM->stages[$iKey + 1]->uid;
} $oSM->stages[$iKey]->derivation->to = array ($oDerivation);
} $oSM->stages[$iKey]->derivation->type = 0;
$oJSON = new Services_JSON(); }
echo $oJSON->encode($oSM); }
break; $oJSON = new Services_JSON();
case 'addStage': echo $oJSON->encode( $oSM );
require_once 'classes/model/Stage.php'; break;
$oJSON = new Services_JSON(); case 'addStage':
$oData = $oJSON->decode(stripslashes($_POST['data'])); require_once 'classes/model/Stage.php';
$oCriteria = new Criteria('workflow'); $oJSON = new Services_JSON();
$oCriteria->addSelectColumn('STG_UID'); $oData = $oJSON->decode( stripslashes( $_POST['data'] ) );
$oCriteria->add(StagePeer::PRO_UID, $oData->uid); $oCriteria = new Criteria( 'workflow' );
$oDataset = StagePeer::doSelectRS($oCriteria); $oCriteria->addSelectColumn( 'STG_UID' );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oCriteria->add( StagePeer::PRO_UID, $oData->uid );
$oDataset->next(); $oDataset = StagePeer::doSelectRS( $oCriteria );
$aStages = array(); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$iStageNumber = 0; $oDataset->next();
while ($aRow = $oDataset->getRow()) { $aStages = array ();
$aStages[] = $aRow['STG_UID']; $iStageNumber = 0;
$iStageNumber++; while ($aRow = $oDataset->getRow()) {
$oDataset->next(); $aStages[] = $aRow['STG_UID'];
} $iStageNumber ++;
if ($iStageNumber == 0) { $oDataset->next();
$iStageNumber = 1; }
} if ($iStageNumber == 0) {
$iIndex = $iStageNumber + 1; $iStageNumber = 1;
$bContinue = false; }
while (!$bContinue) { $iIndex = $iStageNumber + 1;
$oCriteria = new Criteria('workflow'); $bContinue = false;
$oCriteria->addSelectColumn('COUNT(*) AS TIMES'); while (! $bContinue) {
$oCriteria->add(ContentPeer::CON_ID, $aStages, Criteria::IN); $oCriteria = new Criteria( 'workflow' );
$oCriteria->add(ContentPeer::CON_CATEGORY, 'STG_TITLE'); $oCriteria->addSelectColumn( 'COUNT(*) AS TIMES' );
$oCriteria->add(ContentPeer::CON_LANG, SYS_LANG); $oCriteria->add( ContentPeer::CON_ID, $aStages, Criteria::IN );
$oCriteria->add(ContentPeer::CON_VALUE, G::LoadTranslation('ID_STAGE') . ' ' . $iStageNumber); $oCriteria->add( ContentPeer::CON_CATEGORY, 'STG_TITLE' );
$oDataset = ContentPeer::doSelectRS($oCriteria); $oCriteria->add( ContentPeer::CON_LANG, SYS_LANG );
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oCriteria->add( ContentPeer::CON_VALUE, G::LoadTranslation( 'ID_STAGE' ) . ' ' . $iStageNumber );
$oDataset->next(); $oDataset = ContentPeer::doSelectRS( $oCriteria );
$aRow = $oDataset->getRow(); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
if ((int)$aRow['TIMES'] > 0) { $oDataset->next();
$iStageNumber += 1; $aRow = $oDataset->getRow();
} if ((int) $aRow['TIMES'] > 0) {
else { $iStageNumber += 1;
$bContinue = true; } else {
} $bContinue = true;
} }
$oStage = new Stage(); }
$oNewStage->label = G::LoadTranslation('ID_STAGE') . ' ' . $iStageNumber; $oStage = new Stage();
$oNewStage->label = G::LoadTranslation( 'ID_STAGE' ) . ' ' . $iStageNumber;
if($oData->position->x < 0) $oData->position->x *= -1;
if($oData->position->y < 0) $oData->position->y *= -1; if ($oData->position->x < 0)
$oData->position->x *= - 1;
$oNewStage->uid = $oStage->create(array('PRO_UID' => $oData->uid, 'STG_TITLE' => $oNewStage->label, 'STG_POSX' => $oData->position->x, 'STG_POSY' => $oData->position->y, 'STG_INDEX' => $iIndex)); if ($oData->position->y < 0)
$oJSON = new Services_JSON(); $oData->position->y *= - 1;
echo $oJSON->encode($oNewStage);
break; $oNewStage->uid = $oStage->create( array ('PRO_UID' => $oData->uid,'STG_TITLE' => $oNewStage->label,'STG_POSX' => $oData->position->x,'STG_POSY' => $oData->position->y,'STG_INDEX' => $iIndex) );
case 'saveStagePosition': $oJSON = new Services_JSON();
require_once 'classes/model/Stage.php'; echo $oJSON->encode( $oNewStage );
$oJSON = new Services_JSON(); break;
$oData = $oJSON->decode(stripslashes($_POST['data'])); case 'saveStagePosition':
$oStage = new Stage(); require_once 'classes/model/Stage.php';
$aFields = $oStage->load($oData->uid); $oJSON = new Services_JSON();
$aFields['STG_UID'] = $oData->uid; $oData = $oJSON->decode( stripslashes( $_POST['data'] ) );
$aFields['STG_POSX'] = $oData->position->x; $oStage = new Stage();
$aFields['STG_POSY'] = $oData->position->y; $aFields = $oStage->load( $oData->uid );
$oStage->update($aFields); $aFields['STG_UID'] = $oData->uid;
break; $aFields['STG_POSX'] = $oData->position->x;
case 'deleteStage': $aFields['STG_POSY'] = $oData->position->y;
require_once 'classes/model/Stage.php'; $oStage->update( $aFields );
$oJSON = new Services_JSON(); break;
$oData = $oJSON->decode(stripslashes($_POST['data'])); case 'deleteStage':
$oStage = new Stage(); require_once 'classes/model/Stage.php';
$aFields = $oStage->load($oData->stg_uid); $oJSON = new Services_JSON();
$oStage->remove($oData->stg_uid); $oData = $oJSON->decode( stripslashes( $_POST['data'] ) );
$oStage->reorderPositions($aFields['PRO_UID'], $aFields['STG_INDEX']); $oStage = new Stage();
require_once 'classes/model/Task.php'; $aFields = $oStage->load( $oData->stg_uid );
$oCriteria1 = new Criteria('workflow'); $oStage->remove( $oData->stg_uid );
$oCriteria1->add(TaskPeer::STG_UID, $oData->stg_uid); $oStage->reorderPositions( $aFields['PRO_UID'], $aFields['STG_INDEX'] );
$oCriteria2 = new Criteria('workflow'); require_once 'classes/model/Task.php';
$oCriteria2->add(TaskPeer::STG_UID, ''); $oCriteria1 = new Criteria( 'workflow' );
BasePeer::doUpdate($oCriteria1, $oCriteria2, Propel::getConnection('workflow')); $oCriteria1->add( TaskPeer::STG_UID, $oData->stg_uid );
break; $oCriteria2 = new Criteria( 'workflow' );
case 'editStage': $oCriteria2->add( TaskPeer::STG_UID, '' );
require_once 'classes/model/Stage.php'; BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
$oJSON = new Services_JSON(); break;
$oData = $oJSON->decode(stripslashes($_POST['data'])); case 'editStage':
$oStage = new Stage(); require_once 'classes/model/Stage.php';
$aFields = $oStage->load($oData->stg_uid); $oJSON = new Services_JSON();
$aFields['THEINDEX'] = $oData->theindex; $oData = $oJSON->decode( stripslashes( $_POST['data'] ) );
$aFields['action'] = 'updateStage'; $oStage = new Stage();
global $G_PUBLISH; $aFields = $oStage->load( $oData->stg_uid );
$G_PUBLISH = new Publisher(); $aFields['THEINDEX'] = $oData->theindex;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/tracker_StageEdit', '', $aFields, '../tracker/tracker_Ajax'); $aFields['action'] = 'updateStage';
G::RenderPage('publish', 'raw'); global $G_PUBLISH;
break; $G_PUBLISH = new Publisher();
case 'updateStage': $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_StageEdit', '', $aFields, '../tracker/tracker_Ajax' );
require_once 'classes/model/Stage.php'; G::RenderPage( 'publish', 'raw' );
$oStage = new Stage(); break;
$aFields = $oStage->load($_POST['form']['STG_UID']); case 'updateStage':
$aFields['STG_TITLE'] = $_POST['form']['STG_TITLE']; require_once 'classes/model/Stage.php';
$oStage->update($aFields); $oStage = new Stage();
break; $aFields = $oStage->load( $_POST['form']['STG_UID'] );
case 'tasksAssigned': $aFields['STG_TITLE'] = $_POST['form']['STG_TITLE'];
require_once 'classes/model/Stage.php'; $oStage->update( $aFields );
require_once 'classes/model/Task.php'; break;
$oJSON = new Services_JSON(); case 'tasksAssigned':
$oData = $oJSON->decode(stripslashes($_POST['data'])); require_once 'classes/model/Stage.php';
$oCriteria = new Criteria('workflow'); require_once 'classes/model/Task.php';
$oCriteria->addSelectColumn(TaskPeer::TAS_UID); $oJSON = new Services_JSON();
$oCriteria->addAsColumn('TAS_TITLE', ContentPeer::CON_VALUE); $oData = $oJSON->decode( stripslashes( $_POST['data'] ) );
$aConditions = array(); $oCriteria = new Criteria( 'workflow' );
$aConditions[] = array(0 => TaskPeer::TAS_UID, 1 => ContentPeer::CON_ID); $oCriteria->addSelectColumn( TaskPeer::TAS_UID );
$aConditions[] = array(0 => ContentPeer::CON_CATEGORY, 1 => DBAdapter::getStringDelimiter() . 'TAS_TITLE' . DBAdapter::getStringDelimiter()); $oCriteria->addAsColumn( 'TAS_TITLE', ContentPeer::CON_VALUE );
$aConditions[] = array(0 => ContentPeer::CON_LANG, 1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter()); $aConditions = array ();
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN); $aConditions[] = array (0 => TaskPeer::TAS_UID,1 => ContentPeer::CON_ID);
$oCriteria->add(TaskPeer::STG_UID, $oData->stg_uid); $aConditions[] = array (0 => ContentPeer::CON_CATEGORY,1 => DBAdapter::getStringDelimiter() . 'TAS_TITLE' . DBAdapter::getStringDelimiter());
$oCriteria->addAscendingOrderByColumn('TAS_TITLE'); $aConditions[] = array (0 => ContentPeer::CON_LANG,1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
global $G_PUBLISH; $oCriteria->addJoinMC( $aConditions, Criteria::LEFT_JOIN );
$G_PUBLISH = new Publisher(); $oCriteria->add( TaskPeer::STG_UID, $oData->stg_uid );
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'tracker/tracker_StageTasks', $oCriteria, array('PRO_UID' => $oData->pro_uid, 'STG_UID' => $oData->stg_uid)); $oCriteria->addAscendingOrderByColumn( 'TAS_TITLE' );
G::RenderPage('publish', 'raw'); global $G_PUBLISH;
break; $G_PUBLISH = new Publisher();
case 'availableTasksForTheStage': $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_StageTasks', $oCriteria, array ('PRO_UID' => $oData->pro_uid,'STG_UID' => $oData->stg_uid) );
require_once 'classes/model/Process.php'; G::RenderPage( 'publish', 'raw' );
require_once 'classes/model/Task.php'; break;
$oCriteria = new Criteria('workflow'); case 'availableTasksForTheStage':
$oCriteria->addSelectColumn(TaskPeer::TAS_UID); require_once 'classes/model/Process.php';
$oCriteria->addAsColumn('TAS_TITLE', ContentPeer::CON_VALUE); require_once 'classes/model/Task.php';
$aConditions = array(); $oCriteria = new Criteria( 'workflow' );
$aConditions[] = array(0 => TaskPeer::TAS_UID, 1 => ContentPeer::CON_ID); $oCriteria->addSelectColumn( TaskPeer::TAS_UID );
$aConditions[] = array(0 => ContentPeer::CON_CATEGORY, 1 => DBAdapter::getStringDelimiter() . 'TAS_TITLE' . DBAdapter::getStringDelimiter()); $oCriteria->addAsColumn( 'TAS_TITLE', ContentPeer::CON_VALUE );
$aConditions[] = array(0 => ContentPeer::CON_LANG, 1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter()); $aConditions = array ();
$oCriteria->addJoinMC($aConditions, Criteria::LEFT_JOIN); $aConditions[] = array (0 => TaskPeer::TAS_UID,1 => ContentPeer::CON_ID );
$oCriteria->add(TaskPeer::PRO_UID, $_POST['PRO_UID']); $aConditions[] = array (0 => ContentPeer::CON_CATEGORY,1 => DBAdapter::getStringDelimiter() . 'TAS_TITLE' . DBAdapter::getStringDelimiter());
$oCriteria->add(TaskPeer::STG_UID, ''); $aConditions[] = array (0 => ContentPeer::CON_LANG,1 => DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter());
$oCriteria->addAscendingOrderByColumn('TAS_TITLE'); $oCriteria->addJoinMC( $aConditions, Criteria::LEFT_JOIN );
global $G_PUBLISH; $oCriteria->add( TaskPeer::PRO_UID, $_POST['PRO_UID'] );
$G_PUBLISH = new Publisher(); $oCriteria->add( TaskPeer::STG_UID, '' );
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'tracker/tracker_AvailableStageTasks', $oCriteria, array('STG_UID' => $_POST['STG_UID'])); $oCriteria->addAscendingOrderByColumn( 'TAS_TITLE' );
G::RenderPage('publish', 'raw'); global $G_PUBLISH;
break; $G_PUBLISH = new Publisher();
case 'assignTaskToStage': $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_AvailableStageTasks', $oCriteria, array ('STG_UID' => $_POST['STG_UID']) );
require_once 'classes/model/Task.php'; G::RenderPage( 'publish', 'raw' );
$oCriteria1 = new Criteria('workflow'); break;
$oCriteria1->add(TaskPeer::TAS_UID, $_POST['TAS_UID']); case 'assignTaskToStage':
$oCriteria2 = new Criteria('workflow'); require_once 'classes/model/Task.php';
$oCriteria2->add(TaskPeer::STG_UID, $_POST['STG_UID']); $oCriteria1 = new Criteria( 'workflow' );
BasePeer::doUpdate($oCriteria1, $oCriteria2, Propel::getConnection('workflow')); $oCriteria1->add( TaskPeer::TAS_UID, $_POST['TAS_UID'] );
break; $oCriteria2 = new Criteria( 'workflow' );
case 'removeTaskFromTheStage': $oCriteria2->add( TaskPeer::STG_UID, $_POST['STG_UID'] );
require_once 'classes/model/Task.php'; BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
$oCriteria1 = new Criteria('workflow'); break;
$oCriteria1->add(TaskPeer::TAS_UID, $_POST['TAS_UID']); case 'removeTaskFromTheStage':
$oCriteria2 = new Criteria('workflow'); require_once 'classes/model/Task.php';
$oCriteria2->add(TaskPeer::STG_UID, ''); $oCriteria1 = new Criteria( 'workflow' );
BasePeer::doUpdate($oCriteria1, $oCriteria2, Propel::getConnection('workflow')); $oCriteria1->add( TaskPeer::TAS_UID, $_POST['TAS_UID'] );
break; $oCriteria2 = new Criteria( 'workflow' );
$oCriteria2->add( TaskPeer::STG_UID, '' );
case "processMapLegend": BasePeer::doUpdate( $oCriteria1, $oCriteria2, Propel::getConnection( 'workflow' ) );
$arrayField = array(); break;
$arrayField["sLabel1"] = G::LoadTranslation("ID_TASK_IN_PROGRESS");
$arrayField["sLabel2"] = G::LoadTranslation("ID_COMPLETED_TASK"); case "processMapLegend":
$arrayField["sLabel3"] = G::LoadTranslation("ID_PENDING_TASK"); $arrayField = array ();
$arrayField["sLabel4"] = G::LoadTranslation("ID_PARALLEL_TASK"); $arrayField["sLabel1"] = G::LoadTranslation( "ID_TASK_IN_PROGRESS" );
$arrayField["tracker"] = 1; $arrayField["sLabel2"] = G::LoadTranslation( "ID_COMPLETED_TASK" );
$arrayField["sLabel3"] = G::LoadTranslation( "ID_PENDING_TASK" );
$G_PUBLISH = new Publisher(); $arrayField["sLabel4"] = G::LoadTranslation( "ID_PARALLEL_TASK" );
$G_PUBLISH->AddContent("smarty", "cases/cases_Leyends", "", "", $arrayField); $arrayField["tracker"] = 1;
G::RenderPage("publish", "raw"); $G_PUBLISH = new Publisher();
break; $G_PUBLISH->AddContent( "smarty", "cases/cases_Leyends", "", "", $arrayField );
} G::RenderPage( "publish", "raw" );
} break;
catch (Exception $oException) { }
die($oException->getMessage()); } catch (Exception $oException) {
} die( $oException->getMessage() );
?> }

View File

@@ -1,54 +1,51 @@
<?php <?php
/** /**
* tracker_ConditionsEdit.php * tracker_ConditionsEdit.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.
* */
*/ if (! isset( $_SESSION['PROCESS'] )) {
if (!isset($_SESSION['PROCESS'])) G::header( 'location: login' );
{ }
G::header('location: login'); try {
} global $RBAC;
try { switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
global $RBAC; case - 2:
switch ($RBAC->userCanAccess('PM_FACTORY')) { G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 1:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break; require_once 'classes/model/CaseTrackerObject.php';
} $oCaseTrackerObject = new CaseTrackerObject();
require_once 'classes/model/CaseTrackerObject.php'; $aFields = $oCaseTrackerObject->load( $_GET['CTO_UID'] );
$oCaseTrackerObject = new CaseTrackerObject(); G::LoadClass( 'xmlfield_InputPM' );
$aFields = $oCaseTrackerObject->load($_GET['CTO_UID']); $G_PUBLISH = new Publisher();
G::LoadClass('xmlfield_InputPM'); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_ConditionsEdit', '', $aFields, '../tracker/tracker_ConditionsSave' );
$G_PUBLISH = new Publisher(); G::RenderPage( 'publish-raw', 'raw' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/tracker_ConditionsEdit', '', $aFields, '../tracker/tracker_ConditionsSave'); } catch (Exception $oException) {
G::RenderPage('publish-raw' , 'raw'); die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,57 +1,54 @@
<?php <?php
/** /**
* tracker_ConditionsSave.php * tracker_ConditionsSave.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.
* */
*/ if (! isset( $_SESSION['PROCESS'] )) {
if (!isset($_SESSION['PROCESS'])) G::header( 'location: login' );
{ }
G::header('location: login'); try {
} global $RBAC;
try { switch ($RBAC->userCanAccess( 'PM_FACTORY' )) {
global $RBAC; case - 2:
switch ($RBAC->userCanAccess('PM_FACTORY')) { G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
case -2: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; case - 1:
break; G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
case -1: G::header( 'location: ../login/login' );
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels'); die();
G::header('location: ../login/login'); break;
die; }
break; require_once 'classes/model/CaseTrackerObject.php';
} $oCaseTrackerObject = new CaseTrackerObject();
require_once 'classes/model/CaseTrackerObject.php'; if (isset( $_POST['form'] ))
$oCaseTrackerObject = new CaseTrackerObject(); $value = $_POST['form'];
if(isset ($_POST['form'])) else
$value=$_POST['form']; $value = $_POST;
else
$value=$_POST; $aFields = $oCaseTrackerObject->load( $value['CTO_UID'] );
$aFields['CTO_CONDITION'] = $value['CTO_CONDITION'];
$aFields = $oCaseTrackerObject->load($value['CTO_UID']); $oCaseTrackerObject->update( $aFields );
$aFields['CTO_CONDITION'] = $value['CTO_CONDITION']; } catch (Exception $oException) {
$oCaseTrackerObject->update($aFields); die( $oException->getMessage() );
} }
catch (Exception $oException) {
die($oException->getMessage());
}
?>

View File

@@ -1,73 +1,69 @@
<?php <?php
/** /**
* tracker_ViewMap.php * tracker_ViewMap.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.
* */
*/
/* /*
* dynaforms & documents for Case Tracker * dynaforms & documents for Case Tracker
* *
* @author Everth S. Berrios Morales <everth@colosa.com> * @author Everth S. Berrios Morales <everth@colosa.com>
* *
*/ */
if (!isset($_SESSION['PROCESS'])) { if (! isset( $_SESSION['PROCESS'] )) {
G::header('location: login'); G::header( 'location: login' );
} }
$G_MAIN_MENU = 'caseTracker'; $G_MAIN_MENU = 'caseTracker';
$G_ID_MENU_SELECTED = 'DYNADOC'; $G_ID_MENU_SELECTED = 'DYNADOC';
G::LoadClass('processMap'); G::LoadClass( 'processMap' );
$oProcessMap = new processMap(); $oProcessMap = new processMap();
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$idProcess = $_SESSION['PROCESS']; $idProcess = $_SESSION['PROCESS'];
$oProcess = new Process(); $oProcess = new Process();
$aProcessFieds = $oProcess->load($idProcess); $aProcessFieds = $oProcess->load( $idProcess );
$noShowTitle = 0; $noShowTitle = 0;
if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) { if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE']; $noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
} }
$aFields = $oCase->loadCase($_SESSION['APPLICATION']); $aFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
if (isset($aFields['TITLE'])) { if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE']; $aFields['APP_TITLE'] = $aFields['TITLE'];
} }
if ($aFields['APP_PROC_CODE'] != '') { if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE']; $aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
} }
$aFields['CASE'] = G::LoadTranslation('ID_CASE'); $aFields['CASE'] = G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = G::LoadTranslation('ID_TITLE'); $aFields['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
if ($noShowTitle == 0) { if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $aFields); $G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $aFields );
} }
$G_PUBLISH->AddContent( 'propeltable', $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_DynaDocs', $oProcessMap->getCaseTrackerObjectsCriteria( $_SESSION['PROCESS'] ), array ('VIEW' => G::LoadTranslation( 'ID_VIEW' )
'paged-table', ) );
'tracker/tracker_DynaDocs',
$oProcessMap->getCaseTrackerObjectsCriteria($_SESSION['PROCESS']), G::RenderPage( 'publish' );
array('VIEW' => G::LoadTranslation('ID_VIEW')));
G::RenderPage('publish');

View File

@@ -1,70 +1,65 @@
<?php <?php
/** /**
* tracker_ViewMap.php * tracker_ViewMap.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.
* */
*/
/* /*
* Hystory case for Case Tracker * Hystory case for Case Tracker
* *
* @author Everth S. Berrios Morales <everth@colosa.com> * @author Everth S. Berrios Morales <everth@colosa.com>
* *
*/ */
if (!isset($_SESSION['PROCESS'])) { if (! isset( $_SESSION['PROCESS'] )) {
G::header('location: login'); G::header( 'location: login' );
} }
$G_MAIN_MENU = 'caseTracker'; $G_MAIN_MENU = 'caseTracker';
$G_ID_MENU_SELECTED = 'HISTORY'; $G_ID_MENU_SELECTED = 'HISTORY';
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$aFields = $oCase->loadCase($_SESSION['APPLICATION']); $aFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$idProcess = $_SESSION['PROCESS']; $idProcess = $_SESSION['PROCESS'];
$oProcess = new Process(); $oProcess = new Process();
$aProcessFieds = $oProcess->load($idProcess); $aProcessFieds = $oProcess->load( $idProcess );
$noShowTitle = 0; $noShowTitle = 0;
if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) { if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE']; $noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
} }
if (isset($aFields['TITLE'])) { if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE']; $aFields['APP_TITLE'] = $aFields['TITLE'];
} }
if ($aFields['APP_PROC_CODE'] != '') { if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE']; $aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
} }
$aFields['CASE'] = G::LoadTranslation('ID_CASE'); $aFields['CASE'] = G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = G::LoadTranslation('ID_TITLE'); $aFields['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
if ($noShowTitle == 0) { if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $aFields); $G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $aFields );
} }
$G_PUBLISH->AddContent( 'propeltable', $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_TransferHistory', Cases::getTransferHistoryCriteria( $_SESSION['APPLICATION'] ), array () );
'paged-table', G::RenderPage( 'publish' );
'tracker/tracker_TransferHistory',
Cases::getTransferHistoryCriteria($_SESSION['APPLICATION']),
array());
G::RenderPage('publish');

View File

@@ -1,70 +1,67 @@
<?php <?php
/** /**
* tracker_Messages.php * tracker_Messages.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.
* */
*/
/* /*
* History messages for Case Tracker * History messages for Case Tracker
* *
* @author Everth S. Berrios Morales <everth@colosa.com> * @author Everth S. Berrios Morales <everth@colosa.com>
* *
*/ */
if (!isset($_SESSION['PROCESS'])) { if (! isset( $_SESSION['PROCESS'] )) {
G::header('location: login'); G::header( 'location: login' );
} }
$G_MAIN_MENU = 'caseTracker'; $G_MAIN_MENU = 'caseTracker';
$G_ID_MENU_SELECTED = 'MESSAGES'; $G_ID_MENU_SELECTED = 'MESSAGES';
$oHeadPublisher->addScriptFile('/jscore/tracker/tracker.js'); $oHeadPublisher->addScriptFile( '/jscore/tracker/tracker.js' );
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$aFields = $oCase->loadCase($_SESSION['APPLICATION']); $aFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$idProcess = $_SESSION['PROCESS']; $idProcess = $_SESSION['PROCESS'];
$oProcess = new Process(); $oProcess = new Process();
$aProcessFieds = $oProcess->load($idProcess); $aProcessFieds = $oProcess->load( $idProcess );
$noShowTitle = 0; $noShowTitle = 0;
if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) { if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE']; $noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
} }
if (isset($aFields['TITLE'])) { if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE']; $aFields['APP_TITLE'] = $aFields['TITLE'];
} }
if ($aFields['APP_PROC_CODE'] != '') { if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE']; $aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
} }
$aFields['CASE'] = G::LoadTranslation('ID_CASE'); $aFields['CASE'] = G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = G::LoadTranslation('ID_TITLE'); $aFields['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
if ($noShowTitle == 0) { if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $aFields); $G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $aFields );
} }
$G_PUBLISH->AddContent( 'propeltable', $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_Messages', Cases::getHistoryMessagesTracker( $_SESSION['APPLICATION'] ), array ('VIEW' => G::LoadTranslation( 'ID_VIEW' )
'paged-table', ) );
'tracker/tracker_Messages', G::RenderPage( 'publish' );
Cases::getHistoryMessagesTracker($_SESSION['APPLICATION']),
array('VIEW' => G::LoadTranslation('ID_VIEW')));
G::RenderPage('publish');

View File

@@ -1,45 +1,44 @@
<?php <?php
/** /**
* tracker_MessagesView.php * tracker_MessagesView.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.
* */
*/
/*
/* * Messages for Case Tracker
* Messages for Case Tracker *
* * @author Everth S. Berrios Morales <everth@colosa.com>
* @author Everth S. Berrios Morales <everth@colosa.com> *
* */
*/ if (! isset( $_SESSION['PROCESS'] )) {
if (!isset($_SESSION['PROCESS'])) G::header( 'location: login' );
{ }
G::header('location: login'); $G_MAIN_MENU = 'caseTracker';
} $G_ID_MENU_SELECTED = 'MESSAGES';
$G_MAIN_MENU = 'caseTracker';
$G_ID_MENU_SELECTED = 'MESSAGES'; G::LoadClass( "case" );
$Fields = Cases::getHistoryMessagesTrackerView( $_GET['APP_UID'], $_GET['APP_MSG_UID'] );
G::LoadClass("case");
$Fields = Cases::getHistoryMessagesTrackerView($_GET['APP_UID'], $_GET['APP_MSG_UID']); $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_MessagesView', '', $Fields );
G::RenderPage( 'publish' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/tracker_MessagesView', '',$Fields);
G::RenderPage('publish');

View File

@@ -1,45 +1,44 @@
<?php <?php
/** /**
* tracker_No.php * tracker_No.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.
* */
*/
/*
/* * message for Case Tracker
* message for Case Tracker *
* * @author Everth S. Berrios Morales <everth@colosa.com>
* @author Everth S. Berrios Morales <everth@colosa.com> *
* */
*/ if (! isset( $_SESSION['PROCESS'] )) {
if (!isset($_SESSION['PROCESS'])) G::header( 'location: login' );
{ }
G::header('location: login'); $G_MAIN_MENU = 'caseTracker';
} //$G_ID_MENU_SELECTED = 'DYNADOC';
$G_MAIN_MENU = 'caseTracker';
//$G_ID_MENU_SELECTED = 'DYNADOC';
G::LoadClass( 'processMap' );
G::LoadClass('processMap');
$G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'tracker/tracker_No', '', '' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'tracker/tracker_No', '', '');
G::RenderPage( 'publish' );
G::RenderPage('publish');

View File

@@ -1,76 +1,72 @@
<?php <?php
/** /**
* Cases_PrintPreview.php * Cases_PrintPreview.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 {
if (! isset( $_SESSION['PROCESS'] )) {
if (!isset($_SESSION['PROCESS'])) G::header( 'location: login' );
{ }
G::header('location: login');
} global $_DBArray;
if (! isset( $_DBArray )) {
global $_DBArray; $_DBArray = array ();
if (!isset($_DBArray)) { }
$_DBArray = array();
} $G_MAIN_MENU = 'caseTracker';
$G_ID_MENU_SELECTED = 'DYNADOC';
$G_MAIN_MENU = 'caseTracker'; global $G_PUBLISH;
$G_ID_MENU_SELECTED = 'DYNADOC'; G::LoadClass( 'case' );
global $G_PUBLISH; $oCase = new Cases();
G::LoadClass('case'); $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] ); if (isset( $_SESSION['APPLICATION'] )) {
$array['CASE'] = G::LoadTranslation( 'ID_CASE' );
if(isset($_SESSION['APPLICATION'])){ $array['USER'] = G::LoadTranslation( 'ID_USER' );
$array['CASE'] = G::LoadTranslation('ID_CASE'); $array['WORKSPACE'] = G::LoadTranslation( 'ID_WORKSPACE' );
$array['USER'] = G::LoadTranslation('ID_USER'); $array['APP_NUMBER'] = $Fields['APP_NUMBER'];
$array['WORKSPACE'] = G::LoadTranslation('ID_WORKSPACE'); $array['APP_TITLE'] = $Fields['TITLE'];
$array['APP_NUMBER'] = $Fields['APP_NUMBER']; $array['USR_USERNAME'] = $Fields['APP_DATA']['USR_USERNAME'];
$array['APP_TITLE'] = $Fields['TITLE']; $array['USER_ENV'] = $Fields['APP_DATA']['SYS_SYS'];
$array['USR_USERNAME'] = $Fields['APP_DATA']['USR_USERNAME']; $array['DATEPRINT'] = date( 'Y-m-d H:m:s' );
$array['USER_ENV'] = $Fields['APP_DATA']['SYS_SYS']; }
$array['DATEPRINT'] = date('Y-m-d H:m:s'); $array['APP_PROCESS'] = $sProcess;
}
$array['APP_PROCESS'] = $sProcess; if (isset( $Fields['TITLE'] ) && strlen( $Fields['TITLE'] ) > 0)
$array['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
if(isset($Fields['TITLE']) && strlen($Fields['TITLE'])>0) else
$array['TITLE'] = G::LoadTranslation('ID_TITLE'); $array['TITLE'] = '';
else // $array['PROCESS'] = G::LoadTranslation('ID_PROCESS');
$array['TITLE'] = ''; $array['DATELABEL'] = G::LoadTranslation( 'DATE_LABEL' );
// $array['PROCESS'] = G::LoadTranslation('ID_PROCESS');
$array['DATELABEL'] = G::LoadTranslation('DATE_LABEL'); $G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'smarty', 'cases/cases_PrintViewTitle', '', '', $array );
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['CTO_UID_OBJ'], '', $Fields['APP_DATA'], '', '', 'view' );
$G_PUBLISH = new Publisher; G::RenderPage( 'publish', 'blank' );
$G_PUBLISH->AddContent('smarty', 'cases/cases_PrintViewTitle', '', '', $array);
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS']. '/' . $_GET['CTO_UID_OBJ'], '', $Fields['APP_DATA'], '', '', 'view'); } catch (Exception $oException) {
G::RenderPage('publish', 'blank'); die( $oException->getMessage() );
}
} catch (Exception $oException) {
die($oException->getMessage());
}
?> ?>
<script> <script>
@@ -101,4 +97,5 @@ try {
window.print(); window.print();
} catch(e){} } catch(e){}
</script> </script>

View File

@@ -1,16 +1,17 @@
<?php <?php
if(isset($_POST['form'])) if (isset( $_POST['form'] ))
$sValue = $_POST['form']; //For old processmap $sValue = $_POST['form']; //For old processmap
else else
$sValue = $_POST; $sValue = $_POST;
unset($sValue['SAVE']); unset( $sValue['SAVE'] );
if (!isset($sValue['CT_DERIVATION_HISTORY'])) { if (! isset( $sValue['CT_DERIVATION_HISTORY'] )) {
$sValue['CT_DERIVATION_HISTORY'] = 0; $sValue['CT_DERIVATION_HISTORY'] = 0;
} }
if (!isset($sValue['CT_MESSAGE_HISTORY'])) { if (! isset( $sValue['CT_MESSAGE_HISTORY'] )) {
$sValue['CT_MESSAGE_HISTORY'] = 0; $sValue['CT_MESSAGE_HISTORY'] = 0;
} }
require_once 'classes/model/CaseTracker.php'; require_once 'classes/model/CaseTracker.php';
$oCaseTracker = new CaseTracker(); $oCaseTracker = new CaseTracker();
$oCaseTracker->update($sValue); $oCaseTracker->update( $sValue );

View File

@@ -1,92 +1,88 @@
<?php <?php
/** /**
* tracker_Show.php * tracker_Show.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.
* */
*/
/*
/* * dynaforms & documents for Case Tracker
* dynaforms & documents for Case Tracker *
* * @author Everth S. Berrios Morales <everth@colosa.com>
* @author Everth S. Berrios Morales <everth@colosa.com> *
* */
*/
if (! isset( $_SESSION['PROCESS'] )) {
if (!isset($_SESSION['PROCESS'])) G::header( 'location: login' );
{ }
G::header('location: login');
} global $_DBArray;
if (! isset( $_DBArray )) {
global $_DBArray; $_DBArray = array ();
if (!isset($_DBArray)) { }
$_DBArray = array();
} $G_MAIN_MENU = 'caseTracker';
$G_ID_MENU_SELECTED = 'DYNADOC';
$G_MAIN_MENU = 'caseTracker'; global $G_PUBLISH;
$G_ID_MENU_SELECTED = 'DYNADOC';
global $G_PUBLISH; switch ($_GET['CTO_TYPE_OBJ']) {
case 'DYNAFORM':
switch ($_GET['CTO_TYPE_OBJ']) G::LoadClass( 'case' );
{ $oCase = new Cases();
case 'DYNAFORM': $Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
G::LoadClass('case'); $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$oCase = new Cases(); $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] ); $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'alert("Sample"); return false;';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = ''; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PRINT_PREVIEW'] = '#';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#'; $Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PRINT_PREVIEW_ACTION'] = 'tracker_PrintView?CTO_UID_OBJ=' . $_GET['CTO_UID_OBJ'] . '&CTO_TYPE_OBJ=PRINT_PREVIEW';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'alert("Sample"); return false;'; $_SESSION['CTO_UID_OBJ'] = $_GET['CTO_UID_OBJ'];
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PRINT_PREVIEW'] = '#'; $G_PUBLISH = new Publisher();
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PRINT_PREVIEW_ACTION'] = 'tracker_PrintView?CTO_UID_OBJ=' . $_GET['CTO_UID_OBJ'] . '&CTO_TYPE_OBJ=PRINT_PREVIEW'; $G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['CTO_UID_OBJ'], '', $Fields['APP_DATA'], '', '', 'view' );
$_SESSION['CTO_UID_OBJ'] = $_GET['CTO_UID_OBJ']; G::RenderPage( 'publish' );
$G_PUBLISH = new Publisher; break;
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS']. '/' . $_GET['CTO_UID_OBJ'], '', $Fields['APP_DATA'],'','','view');
G::RenderPage('publish'); case 'INPUT_DOCUMENT':
break; G::LoadClass( 'case' );
$oCase = new Cases();
case 'INPUT_DOCUMENT': $c = $oCase->getAllUploadedDocumentsCriteriaTracker( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_GET['CTO_UID_OBJ'] );
G::LoadClass('case');
$oCase = new Cases(); $oHeadPublisher = & headPublisher::getSingleton();
$c = $oCase->getAllUploadedDocumentsCriteriaTracker($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_GET['CTO_UID_OBJ']); $oHeadPublisher->addScriptFile( '/jscore/tracker/tracker.js' );
$oHeadPublisher =& headPublisher::getSingleton(); $G_PUBLISH = new Publisher();
$oHeadPublisher->addScriptFile('/jscore/tracker/tracker.js'); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_Inputdocs', $c );
G::RenderPage( 'publish' );
$G_PUBLISH = new Publisher; break;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'tracker/tracker_Inputdocs', $c);
G::RenderPage('publish'); case 'OUTPUT_DOCUMENT':
break; G::LoadClass( 'case' );
$oCase = new Cases();
case 'OUTPUT_DOCUMENT': $c = $oCase->getAllGeneratedDocumentsCriteriaTracker( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_GET['CTO_UID_OBJ'] );
G::LoadClass('case');
$oCase = new Cases(); $oHeadPublisher = & headPublisher::getSingleton();
$c = $oCase->getAllGeneratedDocumentsCriteriaTracker($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_GET['CTO_UID_OBJ']); $oHeadPublisher->addScriptFile( '/jscore/tracker/tracker.js' );
$oHeadPublisher =& headPublisher::getSingleton(); $G_PUBLISH = new Publisher();
$oHeadPublisher->addScriptFile('/jscore/tracker/tracker.js'); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'tracker/tracker_Outputdocs', $c );
G::RenderPage( 'publish' );
$G_PUBLISH = new Publisher(); break;
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'tracker/tracker_Outputdocs', $c); }
G::RenderPage('publish');
break;
}
?>

View File

@@ -1,85 +1,82 @@
<?php <?php
/** /**
* tracker_ShowDocument.php * tracker_ShowDocument.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.
* */
*/
require_once ("classes/model/AppDocumentPeer.php");
require_once ( "classes/model/AppDocumentPeer.php" );
$oAppDocument = new AppDocument();
$oAppDocument = new AppDocument(); if (! isset( $_GET['v'] )) { //Load last version of the document
if(!isset($_GET['v'])){//Load last version of the document $docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
$docVersion=$oAppDocument->getLastAppDocVersion($_GET['a']); } else {
}else{ $docVersion = $_GET['v'];
$docVersion=$_GET['v']; }
} $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],$docVersion);
$sAppDocUid = $oAppDocument->getAppDocUid();
$sAppDocUid = $oAppDocument->getAppDocUid(); $iDocVersion = $oAppDocument->getDocVersion();
$iDocVersion = $oAppDocument->getDocVersion(); $info = pathinfo( $oAppDocument->getAppDocFilename() );
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $ext = $info['extension'];
$ext = $info['extension'];
if (isset( $_GET['b'] )) {
if (isset($_GET['b'])) { if ($_GET['b'] == '0') {
if ($_GET['b'] == '0') { $bDownload = false;
$bDownload = false; } else {
} $bDownload = true;
else { }
$bDownload = true; } else {
} $bDownload = true;
} }
else {
$bDownload = true; $realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
} $realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext;
$sw_file_exists = false;
if (file_exists( $realPath )) {
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid .'_'.$iDocVersion . '.' . $ext ; $sw_file_exists = true;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext ; } elseif (file_exists( $realPath1 )) {
$sw_file_exists=false; $sw_file_exists = true;
if(file_exists($realPath)){ $realPath = $realPath1;
$sw_file_exists=true; }
}elseif(file_exists($realPath1)){
$sw_file_exists=true; if (! $sw_file_exists) {
$realPath=$realPath1; $error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
} if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$res['success'] = 'failure';
if(!$sw_file_exists){ $res['message'] = $error_message;
$error_message="'".$oAppDocument->Fields['APP_DOC_FILENAME']. "' ".G::LoadTranslation('ID_ERROR_STREAMING_FILE'); print G::json_encode( $res );
if((isset($_POST['request']))&&($_POST['request']==true)){ } else {
$res ['success'] = 'failure'; G::SendMessageText( $error_message, "ERROR" );
$res ['message'] = $error_message; $backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
print G::json_encode ( $res ); G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
}else{ die();
G::SendMessageText($error_message, "ERROR"); }
$backUrlObj=explode("sys".SYS_SYS,$_SERVER['HTTP_REFERER']);
G::header("location: "."/sys".SYS_SYS.$backUrlObj[1]); } else {
die; if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
} $res['success'] = 'success';
$res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
}else{ print G::json_encode( $res );
if((isset($_POST['request']))&&($_POST['request']==true)){ } else {
$res ['success'] = 'success'; G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
$res ['message'] = $oAppDocument->Fields['APP_DOC_FILENAME']; }
print G::json_encode ( $res ); }
}else{
G::streamFile ( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
}
}

View File

@@ -1,89 +1,86 @@
<?php <?php
/** /**
* cases_ShowOutputDocument.php * cases_ShowOutputDocument.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.
* */
*/
/* /*
* Created on 13-02-2008 * Created on 13-02-2008
* *
* @author David Callizaya <davidsantos@colosa.com> * @author David Callizaya <davidsantos@colosa.com>
*/ */
require_once ( "classes/model/AppDocumentPeer.php" ); require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument(); $oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],(isset($_GET['v']) )? $_GET['v'] : NULL ); $oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid(); $sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() ); $info = pathinfo( $oAppDocument->getAppDocFilename() );
if (!isset($_GET['ext'])) { if (! isset( $_GET['ext'] )) {
$ext = $info['extension']; $ext = $info['extension'];
} } else {
else { if ($_GET['ext'] != '') {
if ($_GET['ext'] != '') { $ext = $_GET['ext'];
$ext = $_GET['ext']; } else {
} $ext = $info['extension'];
else { }
$ext = $info['extension']; }
} $ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
}
$ver= (isset($_GET['v']) && $_GET['v']!='') ? '_'.$_GET['v'] : ''; if (! $ver) //This code is in the case the outputdocument won't be versioned
$ver = '_1';
if(!$ver) //This code is in the case the outputdocument won't be versioned
$ver='_1'; $realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid .$ver. '.' . $ext ; $realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] .$ver. '.' . $ext ; $sw_file_exists = false;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename']. '.' . $ext ; if (file_exists( $realPath )) {
$sw_file_exists=false; $sw_file_exists = true;
if(file_exists($realPath)){ } elseif (file_exists( $realPath1 )) {
$sw_file_exists=true; $sw_file_exists = true;
}elseif(file_exists($realPath1)){ $realPath = $realPath1;
$sw_file_exists=true; } elseif (file_exists( $realPath2 )) {
$realPath=$realPath1; $sw_file_exists = true;
}elseif(file_exists($realPath2)){ $realPath = $realPath2;
$sw_file_exists=true; }
$realPath=$realPath2; if (! $sw_file_exists) {
} $error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
if(!$sw_file_exists){ if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
$error_message="'".$info['basename'] .$ver. '.' . $ext."' ".G::LoadTranslation('ID_ERROR_STREAMING_FILE'); $res['success'] = 'failure';
if((isset($_POST['request']))&&($_POST['request']==true)){ $res['message'] = $error_message;
$res ['success'] = 'failure'; print G::json_encode( $res );
$res ['message'] = $error_message; } else {
print G::json_encode ( $res ); G::SendMessageText( $error_message, "ERROR" );
}else{ $backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
G::SendMessageText($error_message, "ERROR"); G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
$backUrlObj=explode("sys".SYS_SYS,$_SERVER['HTTP_REFERER']); die();
G::header("location: "."/sys".SYS_SYS.$backUrlObj[1]); }
die;
} } else {
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
}else{ $res['success'] = 'success';
if((isset($_POST['request']))&&($_POST['request']==true)){ $res['message'] = $info['basename'] . $ver . '.' . $ext;
$res ['success'] = 'success'; print G::json_encode( $res );
$res ['message'] = $info['basename'] .$ver. '.' . $ext; } else {
print G::json_encode ( $res ); G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext );
}else{ }
G::streamFile ( $realPath, true ,$info['basename'] .$ver. '.' . $ext ); }
} //G::streamFile ( $realPath, true);
}
//G::streamFile ( $realPath, true);
?>

View File

@@ -1,79 +1,78 @@
<?php <?php
/** /**
* tracker_ViewMap.php * tracker_ViewMap.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.
* */
*/
/* /*
* Map for Case Tracker * Map for Case Tracker
* *
* @author Everth S. Berrios Morales <everth@colosa.com> * @author Everth S. Berrios Morales <everth@colosa.com>
* *
*/ */
require_once 'classes/model/Process.php'; require_once 'classes/model/Process.php';
if (!isset($_SESSION['PROCESS'])) { if (! isset( $_SESSION['PROCESS'] )) {
G::header('location: login'); G::header( 'location: login' );
} }
$G_MAIN_MENU = 'caseTracker'; $G_MAIN_MENU = 'caseTracker';
$G_ID_MENU_SELECTED = 'MAP'; $G_ID_MENU_SELECTED = 'MAP';
require_once 'classes/model/CaseTracker.php'; require_once 'classes/model/CaseTracker.php';
$oCaseTracker = new CaseTracker(); $oCaseTracker = new CaseTracker();
$aCaseTracker = $oCaseTracker->load($_SESSION['PROCESS']); $aCaseTracker = $oCaseTracker->load( $_SESSION['PROCESS'] );
$idProcess = $_SESSION['PROCESS']; $idProcess = $_SESSION['PROCESS'];
$oProcess = new Process(); $oProcess = new Process();
$aProcessFieds = $oProcess->load($idProcess); $aProcessFieds = $oProcess->load( $idProcess );
$noShowTitle = 0; $noShowTitle = 0;
if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) { if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE']; $noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
} }
switch (($aCaseTracker['CT_MAP_TYPE'])) { switch (($aCaseTracker['CT_MAP_TYPE'])) {
case 'NONE': case 'NONE':
//Nothing //Nothing
break; break;
case 'PROCESSMAP': case 'PROCESSMAP':
G::LoadClass('case'); G::LoadClass( 'case' );
G::LoadClass('processMap'); G::LoadClass( 'processMap' );
$oCase = new Cases(); $oCase = new Cases();
$aFields = $oCase->loadCase($_SESSION['APPLICATION']); $aFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
if (isset($aFields['TITLE'])) { if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE']; $aFields['APP_TITLE'] = $aFields['TITLE'];
} }
if ($aFields['APP_PROC_CODE'] != '') { if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE']; $aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
} }
$aFields['CASE'] = G::LoadTranslation('ID_CASE'); $aFields['CASE'] = G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = G::LoadTranslation('ID_TITLE'); $aFields['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
$oTemplatePower = new TemplatePower(PATH_TPL . 'processes/processes_Map.html'); $oTemplatePower = new TemplatePower( PATH_TPL . 'processes/processes_Map.html' );
$oTemplatePower->prepare(); $oTemplatePower->prepare();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
if ($noShowTitle == 0) { if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $aFields); $G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $aFields );
} }
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oHeadPublisher = & headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode( '
var maximunX = ' . processMap::getMaximunTaskX($_SESSION['PROCESS']) . '; var maximunX = ' . processMap::getMaximunTaskX( $_SESSION['PROCESS'] ) . ';
leimnud.event.add(window,"load",function(){ leimnud.event.add(window,"load",function(){
var pb = leimnud.dom.capture("tag.body 0"); var pb = leimnud.dom.capture("tag.body 0");
pm = new processmap(); pm = new processmap();
@@ -133,30 +132,30 @@ switch (($aCaseTracker['CT_MAP_TYPE'])) {
}.extend(this); }.extend(this);
rpcRequest.make(); rpcRequest.make();
});'); });' );
G::RenderPage('publish'); G::RenderPage( 'publish' );
break; break;
case 'STAGES': case 'STAGES':
G::LoadClass('case'); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$aFields = $oCase->loadCase($_SESSION['APPLICATION']); $aFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
if (isset($aFields['TITLE'])) { if (isset( $aFields['TITLE'] )) {
$aFields['APP_TITLE'] = $aFields['TITLE']; $aFields['APP_TITLE'] = $aFields['TITLE'];
} }
if ($aFields['APP_PROC_CODE'] != '') { if ($aFields['APP_PROC_CODE'] != '') {
$aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE']; $aFields['APP_NUMBER'] = $aFields['APP_PROC_CODE'];
} }
$aFields['CASE'] = G::LoadTranslation('ID_CASE'); $aFields['CASE'] = G::LoadTranslation( 'ID_CASE' );
$aFields['TITLE'] = G::LoadTranslation('ID_TITLE'); $aFields['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
$oTemplatePower = new TemplatePower(PATH_TPL . 'tracker/stages_Map.html'); $oTemplatePower = new TemplatePower( PATH_TPL . 'tracker/stages_Map.html' );
$oTemplatePower->prepare(); $oTemplatePower->prepare();
$G_PUBLISH = new Publisher; $G_PUBLISH = new Publisher();
if ($noShowTitle == 0) { if ($noShowTitle == 0) {
$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $aFields); $G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $aFields );
} }
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower); $G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oHeadPublisher = & headPublisher::getSingleton(); $oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode(' $oHeadPublisher->addScriptCode( '
leimnud.Package.Load("stagesmap",{Type:"file",Absolute:true,Path:"/jscore/stagesmap/core/stagesmap.js"}); leimnud.Package.Load("stagesmap",{Type:"file",Absolute:true,Path:"/jscore/stagesmap/core/stagesmap.js"});
leimnud.event.add(window,"load",function(){ leimnud.event.add(window,"load",function(){
var pb=leimnud.dom.capture("tag.body 0"); var pb=leimnud.dom.capture("tag.body 0");
@@ -174,7 +173,8 @@ switch (($aCaseTracker['CT_MAP_TYPE'])) {
hideMenu : false hideMenu : false
}; };
Sm.make(); Sm.make();
});'); });' );
G::RenderPage('publish'); G::RenderPage( 'publish' );
break; break;
} }