Merge pull request #838 from ralpheav/master
Code Style change workflow/engine/methods/cases/
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_CatchExecute.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset( $_POST['form']['BTN_CANCEL'] )) {
|
||||
header( "Location: ../cases/main" );
|
||||
die();
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
$sAppUid = $_SESSION['APPLICATION'];
|
||||
$iDelIndex = $_SESSION['INDEX'];
|
||||
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* cases_CatchExecute.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset( $_POST['form']['BTN_CANCEL'] )) {
|
||||
header( "Location: ../cases/main" );
|
||||
die();
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
$sAppUid = $_SESSION['APPLICATION'];
|
||||
$iDelIndex = $_SESSION['INDEX'];
|
||||
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
|
||||
|
||||
//if there are no user in the delegation row, this case is still in selfservice
|
||||
if ($aDelegation['USR_UID'] == "") {
|
||||
$oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] );
|
||||
} else {
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
|
||||
}
|
||||
|
||||
$validation = (SYS_SKIN != 'uxs') ? 'true' : 'false';
|
||||
|
||||
if ($aDelegation['USR_UID'] == "") {
|
||||
$oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] );
|
||||
} else {
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
|
||||
}
|
||||
|
||||
$validation = (SYS_SKIN != 'uxs') ? 'true' : 'false';
|
||||
|
||||
die( '<script type="text/javascript">
|
||||
if (' . $validation . ') {
|
||||
if (window.parent.frames.length != 0) {
|
||||
@@ -70,5 +70,5 @@ die( '<script type="text/javascript">
|
||||
} else {
|
||||
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
|
||||
}
|
||||
</script>' );
|
||||
|
||||
</script>' );
|
||||
|
||||
|
||||
@@ -1,90 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_Resume.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
|
||||
/* Render page */
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
|
||||
$objProc = new Process();
|
||||
$aProc = $objProc->load( $Fields['PRO_UID'] );
|
||||
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
|
||||
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load( $Fields['TAS_UID'] );
|
||||
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
|
||||
$Fields['STATUS'] .= ' ( ' . G::LoadTranslation( 'ID_UNASSIGNED' ) . ' )';
|
||||
|
||||
<?php
|
||||
/**
|
||||
* cases_Resume.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
|
||||
/* Render page */
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
|
||||
$objProc = new Process();
|
||||
$aProc = $objProc->load( $Fields['PRO_UID'] );
|
||||
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
|
||||
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load( $Fields['TAS_UID'] );
|
||||
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
|
||||
$Fields['STATUS'] .= ' ( ' . G::LoadTranslation( 'ID_UNASSIGNED' ) . ' )';
|
||||
|
||||
//now getting information about the PREVIOUS task. If is the first task then no preious, use 1
|
||||
$oAppDel = new AppDelegation();
|
||||
$oAppDel->Load( $Fields['APP_UID'], ($Fields['DEL_PREVIOUS'] == 0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS']) );
|
||||
|
||||
$aAppDel = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
try {
|
||||
$oCurUser = new Users();
|
||||
$oCurUser->load( $aAppDel['USR_UID'] );
|
||||
$Fields['PREVIOUS_USER'] = $oCurUser->getUsrFirstname() . ' ' . $oCurUser->getUsrLastname();
|
||||
} catch (Exception $oError) {
|
||||
$Fields['PREVIOUS_USER'] = '';
|
||||
}
|
||||
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load( $aAppDel['TAS_UID'] );
|
||||
$Fields['PREVIOUS_TASK'] = $aTask['TAS_TITLE'];
|
||||
|
||||
$oAppDel = new AppDelegation();
|
||||
$oAppDel->Load( $Fields['APP_UID'], ($Fields['DEL_PREVIOUS'] == 0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS']) );
|
||||
|
||||
$aAppDel = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
try {
|
||||
$oCurUser = new Users();
|
||||
$oCurUser->load( $aAppDel['USR_UID'] );
|
||||
$Fields['PREVIOUS_USER'] = $oCurUser->getUsrFirstname() . ' ' . $oCurUser->getUsrLastname();
|
||||
} catch (Exception $oError) {
|
||||
$Fields['PREVIOUS_USER'] = '';
|
||||
}
|
||||
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load( $aAppDel['TAS_UID'] );
|
||||
$Fields['PREVIOUS_TASK'] = $aTask['TAS_TITLE'];
|
||||
|
||||
//To enable information (dynaforms, steps) before claim a case
|
||||
$_SESSION['bNoShowSteps'] = true;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'caseOptions';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = '_';
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$_SESSION['bNoShowSteps'] = true;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'caseOptions';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = '_';
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptCode( "
|
||||
if (typeof parent != 'undefined') {
|
||||
if (parent.showCaseNavigatorPanel) {
|
||||
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
|
||||
}
|
||||
}" );
|
||||
}" );
|
||||
$oHeadPublisher->addScriptCode( '
|
||||
var Cse = {};
|
||||
Cse.panels = {};
|
||||
@@ -96,11 +96,11 @@ $oHeadPublisher->addScriptCode( '
|
||||
leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases/core/cases_Step.js"});
|
||||
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
|
||||
leimnud.exec(leimnud.fix.memoryLeak);
|
||||
' );
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/cases/core/cases_Step.js' );
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
' );
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/cases/core/cases_Step.js' );
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
|
||||
@@ -1,57 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_Delete.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* Process the info */
|
||||
try {
|
||||
$oCase = new Cases();
|
||||
if (isset( $_POST['APP_UIDS'] )) {
|
||||
$ids = explode( ',', $_POST['APP_UIDS'] );
|
||||
foreach ($ids as $id)
|
||||
$oCase->removeCase( $id );
|
||||
|
||||
if (count( $_POST['APP_UIDS'] ) > 1)
|
||||
echo 'The Case was deleted successfully';
|
||||
else
|
||||
echo 'All Cases were deleted successfully';
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
<?php
|
||||
/**
|
||||
* cases_Delete.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* Process the info */
|
||||
try {
|
||||
$oCase = new Cases();
|
||||
if (isset( $_POST['APP_UIDS'] )) {
|
||||
$ids = explode( ',', $_POST['APP_UIDS'] );
|
||||
foreach ($ids as $id) {
|
||||
$oCase->removeCase( $id );
|
||||
}
|
||||
|
||||
if (count( $_POST['APP_UIDS'] ) > 1) {
|
||||
echo 'The Case was deleted successfully';
|
||||
} else {
|
||||
echo 'All Cases were deleted successfully';
|
||||
}
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,59 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_DeleteDocument.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* cases_DeleteDocument.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* Process the info */
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove( $_GET['DOC'] );
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
||||
if ($_GET['TYPE'] == 'INPUT') {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||
}
|
||||
if ($_GET['TYPE'] == 'OUTPUT') {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
}
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
/* Redirect */
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove( $_GET['DOC'] );
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
||||
if ($_GET['TYPE'] == 'INPUT') {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||
}
|
||||
if ($_GET['TYPE'] == 'OUTPUT') {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
}
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
/* Redirect */
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
|
||||
|
||||
@@ -1,50 +1,50 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_DeleteDocumentToRevise.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* cases_DeleteDocumentToRevise.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* Process the info */
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove( $_GET['DOC'] );
|
||||
|
||||
/* Redirect */
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove( $_GET['DOC'] );
|
||||
|
||||
/* Redirect */
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
|
||||
|
||||
@@ -1,185 +1,185 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_Derivate.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'pmScript' );
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( 'derivation' );
|
||||
|
||||
require_once 'classes/model/Event.php';
|
||||
|
||||
<?php
|
||||
/**
|
||||
* cases_Derivate.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'pmScript' );
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( 'derivation' );
|
||||
|
||||
require_once 'classes/model/Event.php';
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
/* Process the info */
|
||||
$sStatus = 'TO_DO';
|
||||
foreach ($_POST['form']['TASKS'] as $aValues) {
|
||||
}
|
||||
|
||||
try {
|
||||
$sStatus = 'TO_DO';
|
||||
foreach ($_POST['form']['TASKS'] as $aValues) {
|
||||
}
|
||||
|
||||
try {
|
||||
//load data
|
||||
$oCase = new Cases();
|
||||
$oCase = new Cases();
|
||||
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
|
||||
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
|
||||
//cleaning debug variables
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
|
||||
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE' );
|
||||
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
|
||||
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE' );
|
||||
|
||||
//if there are some triggers to execute
|
||||
if (sizeof( $triggers ) > 0) {
|
||||
if (sizeof( $triggers ) > 0) {
|
||||
//Execute triggers before derivation
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE', $appFields['APP_DATA'] );
|
||||
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE', $appFields['APP_DATA'] );
|
||||
|
||||
//save trigger variables for debugger
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = 'BEFORE';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
|
||||
$appFields['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$appFields['TAS_UID'] = $_SESSION['TASK'];
|
||||
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['NUM_TRIGGERS'] = sizeof( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TIME'] = 'BEFORE';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][0]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
|
||||
$appFields['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$appFields['TAS_UID'] = $_SESSION['TASK'];
|
||||
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $appFields ); //Save data
|
||||
|
||||
|
||||
|
||||
|
||||
//derivate case
|
||||
$oDerivation = new Derivation();
|
||||
$aCurrentDerivation = array ('APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'APP_STATUS' => $sStatus,'TAS_UID' => $_SESSION['TASK'],'ROU_TYPE' => $_POST['form']['ROU_TYPE']
|
||||
);
|
||||
|
||||
$oDerivation->derivate( $aCurrentDerivation, $_POST['form']['TASKS'] );
|
||||
|
||||
$oDerivation = new Derivation();
|
||||
$aCurrentDerivation = array ('APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'APP_STATUS' => $sStatus,'TAS_UID' => $_SESSION['TASK'],'ROU_TYPE' => $_POST['form']['ROU_TYPE']
|
||||
);
|
||||
|
||||
$oDerivation->derivate( $aCurrentDerivation, $_POST['form']['TASKS'] );
|
||||
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] ); //refresh appFields, because in derivations should change some values
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'AFTER' ); //load the triggers after derivation
|
||||
if (sizeof( $triggers ) > 0) {
|
||||
if (sizeof( $triggers ) > 0) {
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'AFTER', $appFields['APP_DATA'] ); //Execute triggers after derivation
|
||||
|
||||
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $appFields );
|
||||
|
||||
|
||||
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['NUM_TRIGGERS'] = sizeof( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TIME'] = 'AFTER';
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['info'][1]['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $appFields );
|
||||
|
||||
// Send notifications - Start
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load( $_SESSION['USER_LOGGED'] );
|
||||
if (trim( $aUser['USR_EMAIL'] ) == '') {
|
||||
$aUser['USR_EMAIL'] = 'info@' . $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <' . $aUser['USR_EMAIL'] . '>';
|
||||
try {
|
||||
$oCase->sendNotifications( $_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName );
|
||||
} catch (Exception $e) {
|
||||
G::SendTemporalMessage( G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%' );
|
||||
}
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load( $_SESSION['USER_LOGGED'] );
|
||||
if (trim( $aUser['USR_EMAIL'] ) == '') {
|
||||
$aUser['USR_EMAIL'] = 'info@' . $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
$sFromName = '"' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . '" <' . $aUser['USR_EMAIL'] . '>';
|
||||
try {
|
||||
$oCase->sendNotifications( $_SESSION['TASK'], $_POST['form']['TASKS'], $appFields['APP_DATA'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $sFromName );
|
||||
} catch (Exception $e) {
|
||||
G::SendTemporalMessage( G::loadTranslation( 'ID_NOTIFICATION_ERROR' ) . ' - ' . $e->getMessage(), 'warning', 'string', null, '100%' );
|
||||
}
|
||||
// Send notifications - End
|
||||
|
||||
|
||||
|
||||
|
||||
// Events - Start
|
||||
$oEvent = new Event();
|
||||
|
||||
$oEvent->closeAppEvents( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK'] );
|
||||
$oCurrentAppDel = AppDelegationPeer::retrieveByPk( $_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1 );
|
||||
$multipleDelegation = false;
|
||||
$oEvent = new Event();
|
||||
|
||||
$oEvent->closeAppEvents( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['TASK'] );
|
||||
$oCurrentAppDel = AppDelegationPeer::retrieveByPk( $_SESSION['APPLICATION'], $_SESSION['INDEX'] + 1 );
|
||||
$multipleDelegation = false;
|
||||
// check if there are multiple derivations
|
||||
if (count( $_POST['form']['TASKS'] ) > 1) {
|
||||
$multipleDelegation = true;
|
||||
}
|
||||
if (count( $_POST['form']['TASKS'] ) > 1) {
|
||||
$multipleDelegation = true;
|
||||
}
|
||||
// If the case has been delegated
|
||||
if (isset( $oCurrentAppDel )) {
|
||||
if (isset( $oCurrentAppDel )) {
|
||||
// if there is just a single derivation the TASK_UID can be set by the delegation data
|
||||
if (! $multipleDelegation) {
|
||||
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID'] );
|
||||
} else {
|
||||
if (! $multipleDelegation) {
|
||||
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $aCurrentAppDel['TAS_UID'] );
|
||||
} else {
|
||||
// else we need to check every task and create the events if it have any
|
||||
foreach ($_POST['form']['TASKS'] as $taskDelegated) {
|
||||
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($_POST['form']['TASKS'] as $taskDelegated) {
|
||||
$aCurrentAppDel = $oCurrentAppDel->toArray( BasePeer::TYPE_FIELDNAME );
|
||||
$oEvent->createAppEvents( $aCurrentAppDel['PRO_UID'], $aCurrentAppDel['APP_UID'], $aCurrentAppDel['DEL_INDEX'], $taskDelegated['TAS_UID'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
//Events - End
|
||||
$debuggerAvailable = true;
|
||||
|
||||
if (isset( $_SESSION['user_experience'] )) {
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector?ux=' . $_SESSION['user_experience'];
|
||||
$debuggerAvailable = false;
|
||||
} else {
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector';
|
||||
}
|
||||
|
||||
if (isset( $_SESSION['PMDEBUGGER'] ) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$loc = 'cases_Step?' . 'breakpoint=triggerdebug';
|
||||
} else {
|
||||
$loc = $aNextStep['PAGE'];
|
||||
}
|
||||
$debuggerAvailable = true;
|
||||
|
||||
if (isset( $_SESSION['user_experience'] )) {
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector?ux=' . $_SESSION['user_experience'];
|
||||
$debuggerAvailable = false;
|
||||
} else {
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector';
|
||||
}
|
||||
|
||||
if (isset( $_SESSION['PMDEBUGGER'] ) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$loc = 'cases_Step?' . 'breakpoint=triggerdebug';
|
||||
} else {
|
||||
$loc = $aNextStep['PAGE'];
|
||||
}
|
||||
//Triggers After
|
||||
if (isset( $_SESSION['TRIGGER_DEBUG']['ISSET'] )) {
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1) {
|
||||
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
|
||||
$oTemplatePower->prepare();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
|
||||
$_POST['NextStep'] = $loc;
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameLoader' );
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameBreaker' );
|
||||
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
exit();
|
||||
} else {
|
||||
unset( $_SESSION['TRIGGER_DEBUG'] );
|
||||
}
|
||||
}
|
||||
|
||||
G::header( "location: $loc" );
|
||||
} catch (Exception $e) {
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $e->getMessage() . '<br>' . $e->getTraceAsString();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
|
||||
if (isset( $_SESSION['TRIGGER_DEBUG']['ISSET'] )) {
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1) {
|
||||
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
|
||||
$oTemplatePower->prepare();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
|
||||
$_POST['NextStep'] = $loc;
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameLoader' );
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameBreaker' );
|
||||
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
exit();
|
||||
} else {
|
||||
unset( $_SESSION['TRIGGER_DEBUG'] );
|
||||
}
|
||||
}
|
||||
|
||||
G::header( "location: $loc" );
|
||||
} catch (Exception $e) {
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $e->getMessage() . '<br>' . $e->getTraceAsString();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,111 +1,113 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_List.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Cases list (Refactored)
|
||||
* By Erik A.
|
||||
* O. <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( 'configuration' );
|
||||
|
||||
<?php
|
||||
/**
|
||||
* cases_List.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Cases list (Refactored)
|
||||
* By Erik A.
|
||||
* O. <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( 'configuration' );
|
||||
|
||||
// $_GET['l'] has the type of cases list like todo,pause,cancel, all
|
||||
|
||||
|
||||
$conf = new Configurations();
|
||||
if (! isset( $_GET['l'] )) {
|
||||
$confCasesList = $conf->loadObject( 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
if (is_array( $confCasesList )) {
|
||||
$sTypeList = $confCasesList['sTypeList'];
|
||||
} else {
|
||||
$sTypeList = 'to_do';
|
||||
}
|
||||
} else {
|
||||
$sTypeList = $_GET['l'];
|
||||
$confCasesList = array ('sTypeList' => $sTypeList
|
||||
);
|
||||
$conf->saveObject( $confCasesList, 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
}
|
||||
|
||||
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
|
||||
$_SESSION['CASES_MENU_OPTION'] = $sTypeList;
|
||||
|
||||
$oCases = new Cases();
|
||||
|
||||
/**
|
||||
* here we verify if there is a any case with a unpause on this day
|
||||
*/
|
||||
if ($sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') {
|
||||
$oCases->ThrowUnpauseDaemon( date( 'Y-m-d' ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
$conf = new Configurations();
|
||||
if (! isset( $_GET['l'] )) {
|
||||
$confCasesList = $conf->loadObject( 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
if (is_array( $confCasesList )) {
|
||||
$sTypeList = $confCasesList['sTypeList'];
|
||||
} else {
|
||||
$sTypeList = 'to_do';
|
||||
}
|
||||
} else {
|
||||
$sTypeList = $_GET['l'];
|
||||
$confCasesList = array ('sTypeList' => $sTypeList
|
||||
);
|
||||
$conf->saveObject( $confCasesList, 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
}
|
||||
|
||||
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
|
||||
$_SESSION['CASES_MENU_OPTION'] = $sTypeList;
|
||||
|
||||
$oCases = new Cases();
|
||||
|
||||
/**
|
||||
* here we verify if there is a any case with a unpause on this day
|
||||
*/
|
||||
if ($sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') {
|
||||
$oCases->ThrowUnpauseDaemon( date( 'Y-m-d' ) );
|
||||
}
|
||||
|
||||
/* *
|
||||
* Prepare the addtional filters before to show
|
||||
* By Erik
|
||||
*/
|
||||
|
||||
$aAdditionalFilter = Array ();
|
||||
|
||||
if (isset( $_GET['PROCESS_UID'] ) and $_GET['PROCESS_UID'] != "0" && $_GET['PROCESS_UID'] != "") {
|
||||
$PRO_UID = $_GET['PROCESS_UID'];
|
||||
$aAdditionalFilter['PRO_UID'] = $PRO_UID;
|
||||
} else {
|
||||
$PRO_UID = "0";
|
||||
}
|
||||
if (isset( $_GET['READ'] ) and $_GET['READ'] == "1") {
|
||||
$aAdditionalFilter['READ'] = $_GET['READ'];
|
||||
}
|
||||
if (isset( $_GET['UNREAD'] ) and $_GET['UNREAD'] == "1") {
|
||||
$aAdditionalFilter['UNREAD'] = $_GET['UNREAD'];
|
||||
}
|
||||
|
||||
if (isset( $_GET['APP_STATUS_FILTER'] ) and $_GET['APP_STATUS_FILTER'] != "ALL") {
|
||||
$aAdditionalFilter['APP_STATUS_FILTER'] = $_GET['APP_STATUS_FILTER'];
|
||||
}
|
||||
|
||||
if (isset( $_GET['MINE'] ) and $_GET['MINE'] == "1") {
|
||||
$aAdditionalFilter['MINE'] = $_GET['MINE'];
|
||||
}
|
||||
|
||||
switch ($sTypeList) {
|
||||
case 'to_do':
|
||||
if (defined( 'ENABLE_CASE_LIST_OPTIMIZATION' )) {
|
||||
$aCriteria = $oCases->prepareCriteriaForToDo( $sUIDUserLogged );
|
||||
$xmlfile = 'cases/cases_ListTodoNew';
|
||||
} else
|
||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
||||
break;
|
||||
default:
|
||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
$aAdditionalFilter = Array ();
|
||||
|
||||
if (isset( $_GET['PROCESS_UID'] ) and $_GET['PROCESS_UID'] != "0" && $_GET['PROCESS_UID'] != "") {
|
||||
$PRO_UID = $_GET['PROCESS_UID'];
|
||||
$aAdditionalFilter['PRO_UID'] = $PRO_UID;
|
||||
} else {
|
||||
$PRO_UID = "0";
|
||||
}
|
||||
if (isset( $_GET['READ'] ) and $_GET['READ'] == "1") {
|
||||
$aAdditionalFilter['READ'] = $_GET['READ'];
|
||||
}
|
||||
if (isset( $_GET['UNREAD'] ) and $_GET['UNREAD'] == "1") {
|
||||
$aAdditionalFilter['UNREAD'] = $_GET['UNREAD'];
|
||||
}
|
||||
|
||||
if (isset( $_GET['APP_STATUS_FILTER'] ) and $_GET['APP_STATUS_FILTER'] != "ALL") {
|
||||
$aAdditionalFilter['APP_STATUS_FILTER'] = $_GET['APP_STATUS_FILTER'];
|
||||
}
|
||||
|
||||
if (isset( $_GET['MINE'] ) and $_GET['MINE'] == "1") {
|
||||
$aAdditionalFilter['MINE'] = $_GET['MINE'];
|
||||
}
|
||||
|
||||
switch ($sTypeList) {
|
||||
case 'to_do':
|
||||
if (defined( 'ENABLE_CASE_LIST_OPTIMIZATION' )) {
|
||||
$aCriteria = $oCases->prepareCriteriaForToDo( $sUIDUserLogged );
|
||||
$xmlfile = 'cases/cases_ListTodoNew';
|
||||
} else {
|
||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
||||
}
|
||||
|
||||
/*
|
||||
$rs = ApplicationPeer::doSelectRS($aCriteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
@@ -118,52 +120,52 @@ $rs = ApplicationPeer::doSelectRS($aCriteria);
|
||||
g::pr($aRows1);die;*/
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
if (! isset( $_GET['PROCESS_UID'] )) {
|
||||
$oCase = new Cases();
|
||||
$rs = ApplicationPeer::doSelectRS( $aCriteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$aProcess = Array ();
|
||||
while ($rs->next()) {
|
||||
$aRow = $rs->getRow();
|
||||
//g::pr($aRow); die;
|
||||
if (! InAssocArray( $aRow, 'PRO_UID', $aRow['PRO_UID'] )) {
|
||||
array_push( $aProcess, Array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['APP_PRO_TITLE'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
$_DBArray['_PROCESSES'] = array_merge( Array (Array ('PRO_UID' => 'char','PRO_TITLE' => 'char' ) ), $aProcess );
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
} else {
|
||||
$_DBArray = $_SESSION['_DBArray'];
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
||||
|
||||
if ($sTypeList == 'to_reassign') {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', array ('REASSIGN_BY' => 1 ) );
|
||||
}
|
||||
|
||||
$aData = Array ('PROCESS_FILTER' => $PRO_UID,'APP_STATUS_FILTER' => (isset( $_GET['APP_STATUS_FILTER'] ) ? $_GET['APP_STATUS_FILTER'] : '0')
|
||||
);
|
||||
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', $xmlfile, $aCriteria, $aData );
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
function InAssocArray ($a, $k, $v)
|
||||
{
|
||||
foreach ($a as $item) {
|
||||
if (isset( $item[$k] ) && $v == $item[$k])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
||||
if (! isset( $_GET['PROCESS_UID'] )) {
|
||||
$oCase = new Cases();
|
||||
$rs = ApplicationPeer::doSelectRS( $aCriteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$aProcess = Array ();
|
||||
while ($rs->next()) {
|
||||
$aRow = $rs->getRow();
|
||||
//g::pr($aRow); die;
|
||||
if (! InAssocArray( $aRow, 'PRO_UID', $aRow['PRO_UID'] )) {
|
||||
array_push( $aProcess, Array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['APP_PRO_TITLE'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
$_DBArray['_PROCESSES'] = array_merge( Array (Array ('PRO_UID' => 'char','PRO_TITLE' => 'char' ) ), $aProcess );
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
} else {
|
||||
$_DBArray = $_SESSION['_DBArray'];
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
||||
|
||||
if ($sTypeList == 'to_reassign') {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', array ('REASSIGN_BY' => 1 ) );
|
||||
}
|
||||
|
||||
$aData = Array ('PROCESS_FILTER' => $PRO_UID,'APP_STATUS_FILTER' => (isset( $_GET['APP_STATUS_FILTER'] ) ? $_GET['APP_STATUS_FILTER'] : '0')
|
||||
);
|
||||
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', $xmlfile, $aCriteria, $aData );
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
function InAssocArray ($a, $k, $v)
|
||||
{
|
||||
foreach ($a as $item) {
|
||||
if (isset( $item[$k] ) && $v == $item[$k]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
try{
|
||||
oPropelTable = document.getElementById('publisherContent[0]');
|
||||
@@ -175,5 +177,6 @@ function InAssocArray ($a, $k, $v)
|
||||
parent.PANEL_EAST_OPEN = false;
|
||||
if(parent.refreshCountFolders) parent.refreshCountFolders();
|
||||
}catch(e){}
|
||||
</script>
|
||||
|
||||
</script>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,162 +1,166 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* cases_New.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
<?php
|
||||
|
||||
/**
|
||||
* cases_New.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
//we're looking for the type of view
|
||||
function putTypeView ()
|
||||
{
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
|
||||
$oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
|
||||
|
||||
if (ConfigurationPeer::doCount( $oCriteria )) {
|
||||
$conf = ConfigurationPeer::doSelect( $oCriteria );
|
||||
return $conf[0]->getCfgValue();
|
||||
} else {
|
||||
return 'dropdown';
|
||||
}
|
||||
}
|
||||
|
||||
$_GET['change'] = (isset( $_GET['change'] )) ? $_GET['change'] : putTypeView();
|
||||
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
function putTypeView ()
|
||||
{
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
|
||||
$oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
|
||||
|
||||
if (ConfigurationPeer::doCount( $oCriteria )) {
|
||||
$conf = ConfigurationPeer::doSelect( $oCriteria );
|
||||
return $conf[0]->getCfgValue();
|
||||
} else {
|
||||
return 'dropdown';
|
||||
}
|
||||
}
|
||||
|
||||
$_GET['change'] = (isset( $_GET['change'] )) ? $_GET['change'] : putTypeView();
|
||||
|
||||
/* Permissions */
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* Menues */
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_DRAFT';
|
||||
|
||||
/* Prepare page before to show */
|
||||
$aFields = array ();
|
||||
$oCase = new Cases();
|
||||
$bCanStart = $oCase->canStartCase( $_SESSION['USER_LOGGED'] );
|
||||
if ($bCanStart) {
|
||||
$aFields['LANG'] = SYS_LANG;
|
||||
$aFields['USER'] = $_SESSION['USER_LOGGED'];
|
||||
$sXmlForm = 'cases/cases_New.xml';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_DRAFT';
|
||||
|
||||
/* Prepare page before to show */
|
||||
$aFields = array ();
|
||||
$oCase = new Cases();
|
||||
$bCanStart = $oCase->canStartCase( $_SESSION['USER_LOGGED'] );
|
||||
if ($bCanStart) {
|
||||
$aFields['LANG'] = SYS_LANG;
|
||||
$aFields['USER'] = $_SESSION['USER_LOGGED'];
|
||||
$sXmlForm = 'cases/cases_New.xml';
|
||||
//$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] );
|
||||
$_DBArray['NewCase'] = $oCase->getStartCasesPerType( $_SESSION['USER_LOGGED'], $_GET['change'] );
|
||||
|
||||
} else {
|
||||
$sXmlForm = 'cases/cases_CannotInitiateCase.xml';
|
||||
}
|
||||
|
||||
if (isset( $_SESSION['G_MESSAGE'] ) && strlen( $_SESSION['G_MESSAGE'] ) > 0) {
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $_SESSION['G_MESSAGE'];
|
||||
$_DBArray['NewCase'] = $oCase->getStartCasesPerType( $_SESSION['USER_LOGGED'], $_GET['change'] );
|
||||
|
||||
} else {
|
||||
$sXmlForm = 'cases/cases_CannotInitiateCase.xml';
|
||||
}
|
||||
|
||||
if (isset( $_SESSION['G_MESSAGE'] ) && strlen( $_SESSION['G_MESSAGE'] ) > 0) {
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $_SESSION['G_MESSAGE'];
|
||||
//$_SESSION['G_MESSAGE_TYPE'];
|
||||
unset( $_SESSION['G_MESSAGE'] );
|
||||
unset( $_SESSION['G_MESSAGE_TYPE'] );
|
||||
}
|
||||
|
||||
unset( $_SESSION['G_MESSAGE'] );
|
||||
unset( $_SESSION['G_MESSAGE_TYPE'] );
|
||||
}
|
||||
|
||||
//get the config parameter to show in dropdown or list
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
|
||||
$oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
|
||||
|
||||
if (ConfigurationPeer::doCount( $oCriteria ) == 0) {
|
||||
$aData['CFG_UID'] = 'StartNewCase';
|
||||
$aData['OBJ_UID'] = '';
|
||||
$aData['CFG_VALUE'] = 'dropdown';
|
||||
$aData['PRO_UID'] = '';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_UID'] = '';
|
||||
|
||||
$oConfig = new Configuration();
|
||||
$oConfig->create( $aData );
|
||||
$listType = 'dropdown';
|
||||
} else {
|
||||
$oConfiguration = new Configuration();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
|
||||
$oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
|
||||
$conf = ConfigurationPeer::doSelect( $oCriteria );
|
||||
|
||||
$listType = $conf[0]->getCfgValue();
|
||||
}
|
||||
if (isset( $_GET['change'] )) {
|
||||
$listType = $_GET['change'];
|
||||
$aData['CFG_UID'] = 'StartNewCase';
|
||||
$aData['OBJ_UID'] = '';
|
||||
$aData['CFG_VALUE'] = $listType;
|
||||
$aData['PRO_UID'] = '';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_UID'] = '';
|
||||
|
||||
$oConfig = new Configuration();
|
||||
$oConfig->update( $aData );
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aFields['CHANGE_LINK'] = G::LoadTranslation( 'ID_CHANGE_VIEW' );
|
||||
|
||||
if (isset( $aMessage )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
}
|
||||
if ($listType == 'dropdown')
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save' );
|
||||
|
||||
if ($listType == 'link') {
|
||||
if ($bCanStart)
|
||||
$sXmlForm = 'cases/cases_NewRadioGroup.xml';
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save' );
|
||||
}
|
||||
|
||||
if ($listType == 'category') {
|
||||
if ($bCanStart)
|
||||
$sXmlForm = 'cases/cases_NewCategory.xml';
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_NewCategory' );
|
||||
}
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
require_once 'classes/model/Configuration.php';
|
||||
$oConfiguration = new Configuration();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
|
||||
$oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
|
||||
|
||||
if (ConfigurationPeer::doCount( $oCriteria ) == 0) {
|
||||
$aData['CFG_UID'] = 'StartNewCase';
|
||||
$aData['OBJ_UID'] = '';
|
||||
$aData['CFG_VALUE'] = 'dropdown';
|
||||
$aData['PRO_UID'] = '';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_UID'] = '';
|
||||
|
||||
$oConfig = new Configuration();
|
||||
$oConfig->create( $aData );
|
||||
$listType = 'dropdown';
|
||||
} else {
|
||||
$oConfiguration = new Configuration();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( ConfigurationPeer::CFG_UID, 'StartNewCase' );
|
||||
$oCriteria->add( ConfigurationPeer::USR_UID, $_SESSION['USER_LOGGED'] );
|
||||
$conf = ConfigurationPeer::doSelect( $oCriteria );
|
||||
|
||||
$listType = $conf[0]->getCfgValue();
|
||||
}
|
||||
if (isset( $_GET['change'] )) {
|
||||
$listType = $_GET['change'];
|
||||
$aData['CFG_UID'] = 'StartNewCase';
|
||||
$aData['OBJ_UID'] = '';
|
||||
$aData['CFG_VALUE'] = $listType;
|
||||
$aData['PRO_UID'] = '';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_UID'] = '';
|
||||
|
||||
$oConfig = new Configuration();
|
||||
$oConfig->update( $aData );
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aFields['CHANGE_LINK'] = G::LoadTranslation( 'ID_CHANGE_VIEW' );
|
||||
|
||||
if (isset( $aMessage )) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
}
|
||||
if ($listType == 'dropdown') {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save' );
|
||||
}
|
||||
|
||||
if ($listType == 'link') {
|
||||
if ($bCanStart) {
|
||||
$sXmlForm = 'cases/cases_NewRadioGroup.xml';
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', $sXmlForm, '', $aFields, 'cases_Save' );
|
||||
}
|
||||
|
||||
if ($listType == 'category') {
|
||||
if ($bCanStart) {
|
||||
$sXmlForm = 'cases/cases_NewCategory.xml';
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_NewCategory' );
|
||||
}
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
?>
|
||||
<script>
|
||||
parent.outerLayout.hide('east');
|
||||
parent.PANEL_EAST_OPEN = false;
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,32 +1,33 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_NextStep.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1)
|
||||
return $RBAC_Response;
|
||||
<?php
|
||||
/**
|
||||
* cases_NextStep.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
//go to the next step
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
|
||||
|
||||
@@ -1,203 +1,202 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_Open.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
if ($RBAC->userCanAccess( 'PM_CASES' ) != 1) {
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
break;
|
||||
case - 1:
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
require_once 'classes/model/AppDelay.php';
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
|
||||
//cleaning the case session data
|
||||
Cases::clearCaseSessionData();
|
||||
|
||||
try {
|
||||
//Loading data for a Jump request
|
||||
if (! isset( $_GET['APP_UID'] ) && isset( $_GET['APP_NUMBER'] )) {
|
||||
$_GET['APP_UID'] = $oCase->getApplicationUIDByNumber( $_GET['APP_NUMBER'] );
|
||||
$_GET['DEL_INDEX'] = $oCase->getCurrentDelegation( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
|
||||
|
||||
//if the application doesn't exist
|
||||
if (is_null( $_GET['APP_UID'] )) {
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_DOES_NOT_EXISTS' ), 'info' );
|
||||
G::header( 'location: casesListExtJs' );
|
||||
exit();
|
||||
}
|
||||
|
||||
//if the application exists but the
|
||||
if (is_null( $_GET['DEL_INDEX'] )) {
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER' ), 'info' );
|
||||
G::header( 'location: casesListExtJs' );
|
||||
exit();
|
||||
}
|
||||
//wrong implemented, need refactored
|
||||
//$participated = $oCase->userParticipatedInCase($_GET['APP_UID'], $_SESSION['USER_LOGGED']); ???????
|
||||
}
|
||||
|
||||
$sAppUid = $_GET['APP_UID'];
|
||||
$iDelIndex = $_GET['DEL_INDEX'];
|
||||
$_action = isset( $_GET['action'] ) ? $_GET['action'] : '';
|
||||
|
||||
//loading application data
|
||||
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
|
||||
// g::pr($aFields);
|
||||
// die;
|
||||
|
||||
|
||||
switch ($aFields['APP_STATUS']) {
|
||||
case 'DRAFT':
|
||||
case 'TO_DO':
|
||||
//check if the case is in pause, check a valid record in table APP_DELAY
|
||||
if (AppDelay::isPaused( $sAppUid, $iDelIndex )) {
|
||||
//the case is paused show only the resume
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* these routine is to verify if the case was acceded from advaced search list
|
||||
*/
|
||||
if ($_action == 'search') {
|
||||
//verify if the case is with teh current user
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->add( AppDelegationPeer::APP_UID, $sAppUid );
|
||||
$c->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$oDataset = AppDelegationPeer::doSelectRs( $c );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aData = $oDataset->getRow();
|
||||
|
||||
if ($aData['USR_UID'] != $_SESSION['USER_LOGGED'] && $aData['USR_UID'] != "") //distinct "" for selfservice
|
||||
{
|
||||
//so we show just the resume
|
||||
$_SESSION['alreadyDerivated'] = true;
|
||||
//the case is paused show only the resume
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//proceed and try to open the case
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
|
||||
|
||||
//if there are no user in the delegation row, this case is in selfservice
|
||||
if ($aDelegation['USR_UID'] == "" /*&& $aDelegation['DEL_THREAD_STATUS'] == 'SELFSERVICE'*/ ) {
|
||||
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
$_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];
|
||||
|
||||
//if the task is in the valid selfservice tasks for this user, then catch the case, else just view the resume
|
||||
if ($oCase->isSelfService( $_SESSION['USER_LOGGED'], $aFields['TAS_UID'], $sAppUid )) {
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_CatchSelfService.php');
|
||||
} else {
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
//if the current users is in the AppDelegation row, then open the case
|
||||
if (($aDelegation['USR_UID'] == $_SESSION['USER_LOGGED']) && $_action != 'sent') {
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
|
||||
if (is_null( $aFields['DEL_INIT_DATE'] )) {
|
||||
$oCase->setDelInitDate( $sAppUid, $iDelIndex );
|
||||
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
|
||||
}
|
||||
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = $aFields['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
/* Redirect to next step */
|
||||
unset( $_SESSION['bNoShowSteps'] );
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$sPage = $aNextStep['PAGE'];
|
||||
G::header( 'location: ' . $sPage );
|
||||
|
||||
} else {
|
||||
//when the case have another user or current user doesnt have rights to this selfservice,
|
||||
//just view the case Resume
|
||||
|
||||
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
$_SESSION['CURRENT_TASK'] = $Fields['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
}
|
||||
break;
|
||||
|
||||
default: //APP_STATUS <> DRAFT and TO_DO
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex != "" ? $iDelIndex : $oCase->getCurrentDelegationCase( $_GET['APP_UID'] );
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
<?php
|
||||
/**
|
||||
* cases_Open.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
if ($RBAC->userCanAccess( 'PM_CASES' ) != 1) {
|
||||
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
break;
|
||||
case - 1:
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
require_once 'classes/model/AppDelay.php';
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
|
||||
//cleaning the case session data
|
||||
Cases::clearCaseSessionData();
|
||||
|
||||
try {
|
||||
//Loading data for a Jump request
|
||||
if (! isset( $_GET['APP_UID'] ) && isset( $_GET['APP_NUMBER'] )) {
|
||||
$_GET['APP_UID'] = $oCase->getApplicationUIDByNumber( $_GET['APP_NUMBER'] );
|
||||
$_GET['DEL_INDEX'] = $oCase->getCurrentDelegation( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
|
||||
|
||||
//if the application doesn't exist
|
||||
if (is_null( $_GET['APP_UID'] )) {
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_DOES_NOT_EXISTS' ), 'info' );
|
||||
G::header( 'location: casesListExtJs' );
|
||||
exit();
|
||||
}
|
||||
|
||||
//if the application exists but the
|
||||
if (is_null( $_GET['DEL_INDEX'] )) {
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_IS_CURRENTLY_WITH_ANOTHER_USER' ), 'info' );
|
||||
G::header( 'location: casesListExtJs' );
|
||||
exit();
|
||||
}
|
||||
//wrong implemented, need refactored
|
||||
//$participated = $oCase->userParticipatedInCase($_GET['APP_UID'], $_SESSION['USER_LOGGED']); ???????
|
||||
}
|
||||
|
||||
$sAppUid = $_GET['APP_UID'];
|
||||
$iDelIndex = $_GET['DEL_INDEX'];
|
||||
$_action = isset( $_GET['action'] ) ? $_GET['action'] : '';
|
||||
|
||||
//loading application data
|
||||
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
|
||||
// g::pr($aFields);
|
||||
// die;
|
||||
|
||||
|
||||
switch ($aFields['APP_STATUS']) {
|
||||
case 'DRAFT':
|
||||
case 'TO_DO':
|
||||
//check if the case is in pause, check a valid record in table APP_DELAY
|
||||
if (AppDelay::isPaused( $sAppUid, $iDelIndex )) {
|
||||
//the case is paused show only the resume
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
* these routine is to verify if the case was acceded from advaced search list
|
||||
*/
|
||||
if ($_action == 'search') {
|
||||
//verify if the case is with teh current user
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->add( AppDelegationPeer::APP_UID, $sAppUid );
|
||||
$c->addDescendingOrderByColumn( AppDelegationPeer::DEL_INDEX );
|
||||
$oDataset = AppDelegationPeer::doSelectRs( $c );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aData = $oDataset->getRow();
|
||||
|
||||
if ($aData['USR_UID'] != $_SESSION['USER_LOGGED'] && $aData['USR_UID'] != "") {
|
||||
//distinct "" for selfservice
|
||||
//so we show just the resume
|
||||
$_SESSION['alreadyDerivated'] = true;
|
||||
//the case is paused show only the resume
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
//proceed and try to open the case
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
|
||||
|
||||
//if there are no user in the delegation row, this case is in selfservice
|
||||
if ($aDelegation['USR_UID'] == "" /*&& $aDelegation['DEL_THREAD_STATUS'] == 'SELFSERVICE'*/ ) {
|
||||
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
$_SESSION['CURRENT_TASK'] = $aFields['TAS_UID'];
|
||||
|
||||
//if the task is in the valid selfservice tasks for this user, then catch the case, else just view the resume
|
||||
if ($oCase->isSelfService( $_SESSION['USER_LOGGED'], $aFields['TAS_UID'], $sAppUid )) {
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_CatchSelfService.php');
|
||||
} else {
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
}
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
//if the current users is in the AppDelegation row, then open the case
|
||||
if (($aDelegation['USR_UID'] == $_SESSION['USER_LOGGED']) && $_action != 'sent') {
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
|
||||
if (is_null( $aFields['DEL_INIT_DATE'] )) {
|
||||
$oCase->setDelInitDate( $sAppUid, $iDelIndex );
|
||||
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
|
||||
}
|
||||
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = $aFields['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
/* Redirect to next step */
|
||||
unset( $_SESSION['bNoShowSteps'] );
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$sPage = $aNextStep['PAGE'];
|
||||
G::header( 'location: ' . $sPage );
|
||||
|
||||
} else {
|
||||
//when the case have another user or current user doesnt have rights to this selfservice,
|
||||
//just view the case Resume
|
||||
|
||||
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex;
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
$_SESSION['CURRENT_TASK'] = $Fields['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
}
|
||||
break;
|
||||
default: //APP_STATUS <> DRAFT and TO_DO
|
||||
$_SESSION['APPLICATION'] = $sAppUid;
|
||||
$_SESSION['INDEX'] = $iDelIndex != "" ? $iDelIndex : $oCase->getCurrentDelegationCase( $_GET['APP_UID'] );
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = - 1;
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
require_once (PATH_METHODS . 'cases' . PATH_SEP . 'cases_Resume.php');
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,75 +1,76 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_Open.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_SUPERVISOR' ) != 1)
|
||||
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
unset( $_SESSION['APPLICATION'] );
|
||||
}
|
||||
if (isset( $_SESSION['PROCESS'] )) {
|
||||
unset( $_SESSION['PROCESS'] );
|
||||
}
|
||||
if (isset( $_SESSION['INDEX'] )) {
|
||||
unset( $_SESSION['INDEX'] );
|
||||
}
|
||||
if (isset( $_SESSION['STEP_POSITION'] )) {
|
||||
unset( $_SESSION['STEP_POSITION'] );
|
||||
}
|
||||
|
||||
/* Process the info */
|
||||
$oCase = new Cases();
|
||||
$sAppUid = $_GET['APP_UID'];
|
||||
$iDelIndex = $_GET['DEL_INDEX'];
|
||||
|
||||
$_SESSION['APPLICATION'] = $_GET['APP_UID'];
|
||||
$_SESSION['INDEX'] = $_GET['DEL_INDEX'];
|
||||
|
||||
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
|
||||
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = $aFields['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
/* Redirect to next step */
|
||||
$aNextStep = $oCase->getNextSupervisorStep( $_SESSION['PROCESS'], 0 );
|
||||
<?php
|
||||
/**
|
||||
* cases_Open.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/* Permissions */
|
||||
|
||||
if ($RBAC->userCanAccess( 'PM_SUPERVISOR' ) != 1) {
|
||||
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
|
||||
case - 2:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_SYSTEM', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
default:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
unset( $_SESSION['APPLICATION'] );
|
||||
}
|
||||
if (isset( $_SESSION['PROCESS'] )) {
|
||||
unset( $_SESSION['PROCESS'] );
|
||||
}
|
||||
if (isset( $_SESSION['INDEX'] )) {
|
||||
unset( $_SESSION['INDEX'] );
|
||||
}
|
||||
if (isset( $_SESSION['STEP_POSITION'] )) {
|
||||
unset( $_SESSION['STEP_POSITION'] );
|
||||
}
|
||||
|
||||
/* Process the info */
|
||||
$oCase = new Cases();
|
||||
$sAppUid = $_GET['APP_UID'];
|
||||
$iDelIndex = $_GET['DEL_INDEX'];
|
||||
|
||||
$_SESSION['APPLICATION'] = $_GET['APP_UID'];
|
||||
$_SESSION['INDEX'] = $_GET['DEL_INDEX'];
|
||||
|
||||
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
|
||||
|
||||
$_SESSION['PROCESS'] = $aFields['PRO_UID'];
|
||||
$_SESSION['TASK'] = $aFields['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
/* Redirect to next step */
|
||||
$aNextStep = $oCase->getNextSupervisorStep( $_SESSION['PROCESS'], 0 );
|
||||
$sPage = "cases_StepToRevise?type=DYNAFORM&PRO_UID=" . $aFields['PRO_UID'] . "&DYN_UID=" . $aNextStep['UID'] . "&APP_UID=$sAppUid&DEL_INDEX=$iDelIndex&position=1"; //$aNextStep['PAGE'];
|
||||
G::header( 'location: ' . $sPage );
|
||||
|
||||
G::header( 'location: ' . $sPage );
|
||||
|
||||
|
||||
@@ -1,96 +1,96 @@
|
||||
<?php
|
||||
/**
|
||||
* Cases_PrintPreview.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
try {
|
||||
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
|
||||
$currentDynUid = '';
|
||||
if (isset( $_GET['DYNUIDPRINT'] ) && $_GET['DYNUIDPRINT'] != '') {
|
||||
$currentDynUid = $_GET['DYNUIDPRINT'];
|
||||
} elseif (isset( $_SESSION['DYN_UID_PRINT'] )) {
|
||||
$currentDynUid = $_SESSION['DYN_UID_PRINT'];
|
||||
} elseif (isset( $_SESSION['CURRENT_DYN_UID'] )) {
|
||||
$currentDynUid = $_SESSION['CURRENT_DYN_UID'];
|
||||
}
|
||||
|
||||
$oDynaform = new Dynaform();
|
||||
$aDyn = $oDynaform->load( $currentDynUid );
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||
} else {
|
||||
$Fields['APP_DATA'] = Array ();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$idProcess = (isset( $Fields['APP_DATA']['PROCESS'] )) ? $Fields['APP_DATA']['PROCESS'] : $_SESSION['PROCESS'];
|
||||
$oProcess = new Process();
|
||||
$aProcessFieds = $oProcess->load( $idProcess );
|
||||
$sProcess = $oProcess->getProTitle();
|
||||
|
||||
$noShowTitle = 0;
|
||||
if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
|
||||
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
|
||||
}
|
||||
<?php
|
||||
/**
|
||||
* Cases_PrintPreview.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
try {
|
||||
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
|
||||
$currentDynUid = '';
|
||||
if (isset( $_GET['DYNUIDPRINT'] ) && $_GET['DYNUIDPRINT'] != '') {
|
||||
$currentDynUid = $_GET['DYNUIDPRINT'];
|
||||
} elseif (isset( $_SESSION['DYN_UID_PRINT'] )) {
|
||||
$currentDynUid = $_SESSION['DYN_UID_PRINT'];
|
||||
} elseif (isset( $_SESSION['CURRENT_DYN_UID'] )) {
|
||||
$currentDynUid = $_SESSION['CURRENT_DYN_UID'];
|
||||
}
|
||||
|
||||
$oDynaform = new Dynaform();
|
||||
$aDyn = $oDynaform->load( $currentDynUid );
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||
} else {
|
||||
$Fields['APP_DATA'] = Array ();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$idProcess = (isset( $Fields['APP_DATA']['PROCESS'] )) ? $Fields['APP_DATA']['PROCESS'] : $_SESSION['PROCESS'];
|
||||
$oProcess = new Process();
|
||||
$aProcessFieds = $oProcess->load( $idProcess );
|
||||
$sProcess = $oProcess->getProTitle();
|
||||
|
||||
$noShowTitle = 0;
|
||||
if (isset( $aProcessFieds['PRO_SHOW_MESSAGE'] )) {
|
||||
$noShowTitle = $aProcessFieds['PRO_SHOW_MESSAGE'];
|
||||
}
|
||||
//Add content content step - Start
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
$array['CASE'] = G::LoadTranslation( 'ID_CASE' );
|
||||
$array['USER'] = G::LoadTranslation( 'ID_USER' );
|
||||
$array['WORKSPACE'] = G::LoadTranslation( 'ID_WORKSPACE' );
|
||||
$array['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$array['APP_TITLE'] = $Fields['TITLE'];
|
||||
$array['USR_USERNAME'] = $Fields['APP_DATA']['USR_USERNAME'];
|
||||
$array['USER_ENV'] = $Fields['APP_DATA']['SYS_SYS'];
|
||||
$array['DATEPRINT'] = date( 'Y-m-d H:m:s' );
|
||||
}
|
||||
$array['APP_PROCESS'] = $sProcess;
|
||||
|
||||
if (isset( $Fields['TITLE'] ) && strlen( $Fields['TITLE'] ) > 0) {
|
||||
$array['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
|
||||
} else {
|
||||
$array['TITLE'] = '';
|
||||
}
|
||||
$array['PROCESS'] = G::LoadTranslation( 'ID_PROCESS' );
|
||||
$array['DATELABEL'] = G::LoadTranslation( 'DATE_LABEL' );
|
||||
|
||||
$aDyn['DYN_UID'] = $currentDynUid;
|
||||
if ($noShowTitle == 0) {
|
||||
$G_PUBLISH->AddContent( 'smarty', 'cases/cases_PrintViewTitle', '', '', $array );
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $aDyn['PRO_UID'] . '/' . $aDyn['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
$array['CASE'] = G::LoadTranslation( 'ID_CASE' );
|
||||
$array['USER'] = G::LoadTranslation( 'ID_USER' );
|
||||
$array['WORKSPACE'] = G::LoadTranslation( 'ID_WORKSPACE' );
|
||||
$array['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$array['APP_TITLE'] = $Fields['TITLE'];
|
||||
$array['USR_USERNAME'] = $Fields['APP_DATA']['USR_USERNAME'];
|
||||
$array['USER_ENV'] = $Fields['APP_DATA']['SYS_SYS'];
|
||||
$array['DATEPRINT'] = date( 'Y-m-d H:m:s' );
|
||||
}
|
||||
$array['APP_PROCESS'] = $sProcess;
|
||||
|
||||
if (isset( $Fields['TITLE'] ) && strlen( $Fields['TITLE'] ) > 0) {
|
||||
$array['TITLE'] = G::LoadTranslation( 'ID_TITLE' );
|
||||
} else {
|
||||
$array['TITLE'] = '';
|
||||
}
|
||||
$array['PROCESS'] = G::LoadTranslation( 'ID_PROCESS' );
|
||||
$array['DATELABEL'] = G::LoadTranslation( 'DATE_LABEL' );
|
||||
|
||||
$aDyn['DYN_UID'] = $currentDynUid;
|
||||
if ($noShowTitle == 0) {
|
||||
$G_PUBLISH->AddContent( 'smarty', 'cases/cases_PrintViewTitle', '', '', $array );
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $aDyn['PRO_UID'] . '/' . $aDyn['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
?>
|
||||
|
||||
<script>
|
||||
@@ -121,5 +121,7 @@ try {
|
||||
|
||||
window.print();
|
||||
} catch(e){}
|
||||
</script>
|
||||
|
||||
</script>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,100 +1,98 @@
|
||||
<?php
|
||||
/**
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
require_once ("classes/model/AdditionalTables.php");
|
||||
require_once ("classes/model/Fields.php");
|
||||
<?php
|
||||
/**
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
require_once ("classes/model/AdditionalTables.php");
|
||||
require_once ("classes/model/Fields.php");
|
||||
// passing the parameters
|
||||
$pmTableName = (isset( $_POST['tableName'] )) ? $_POST['tableName'] : 'contenders';
|
||||
$pmTableFields = (isset( $_POST['tableFields'] )) ? G::json_decode( $_POST['tableFields'] ) : array ();
|
||||
|
||||
$pmTableName = (isset( $_POST['tableName'] )) ? $_POST['tableName'] : 'contenders';
|
||||
$pmTableFields = (isset( $_POST['tableFields'] )) ? G::json_decode( $_POST['tableFields'] ) : array ();
|
||||
|
||||
// default parameters
|
||||
//$pmTableName = 'Sender';
|
||||
$pmTableFields = array (array ('FLD_NAME' => 'APP_UID'
|
||||
),array ('FLD_NAME' => 'CON_NAME'
|
||||
),array ('FLD_NAME' => 'CON_ADDR'
|
||||
),array ('FLD_NAME' => '_cedula'
|
||||
)
|
||||
);
|
||||
|
||||
$pmTableFields = array (array ('FLD_NAME' => 'APP_UID'
|
||||
),array ('FLD_NAME' => 'CON_NAME'
|
||||
),array ('FLD_NAME' => 'CON_ADDR'
|
||||
),array ('FLD_NAME' => '_cedula'
|
||||
)
|
||||
);
|
||||
|
||||
// setting the data to assemble the table
|
||||
$aData = array ();
|
||||
$aData['ADD_TAB_NAME'] = $pmTableName;
|
||||
$aData = array ();
|
||||
$aData['ADD_TAB_NAME'] = $pmTableName;
|
||||
// creating the objects to create the table and records
|
||||
$oFields = new Fields();
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
|
||||
$sAddTabUid = $oAdditionalTables->create( $aData, $pmTableFields );
|
||||
|
||||
foreach ($pmTableFields as $iRow => $aRow) {
|
||||
$pmTableFields[$iRow]['FLD_NAME'] = strtoupper( $aRow['FLD_NAME'] );
|
||||
$pmTableFields[$iRow]['FLD_DESCRIPTION'] = isset( $aRow['FLD_DESCRIPTION'] ) ? $aRow['FLD_DESCRIPTION'] : $aRow['FLD_NAME'];
|
||||
$pmTableFields[$iRow]['FLD_TYPE'] = isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR';
|
||||
$pmTableFields[$iRow]['FLD_SIZE'] = isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32';
|
||||
$pmTableFields[$iRow]['FLD_NULL'] = isset( $aRow['FLD_NULL'] ) ? $aRow['FLD_NULL'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_AUTO_INCREMENT'] = isset( $aRow['FLD_AUTO_INCREMENT'] ) ? $aRow['FLD_AUTO_INCREMENT'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_KEY'] = isset( $aRow['FLD_KEY'] ) ? $aRow['FLD_KEY'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_FOREIGN_KEY'] = isset( $aRow['FLD_FOREIGN_KEY'] ) ? $aRow['FLD_FOREIGN_KEY'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_FOREIGN_KEY_TABLE'] = isset( $aRow['FLD_FOREIGN_KEY_TABLE'] ) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : '';
|
||||
}
|
||||
|
||||
foreach ($pmTableFields as $iRow => $aRow) {
|
||||
|
||||
$oFields->create( array ('FLD_INDEX' => $iRow + 1,'ADD_TAB_UID' => $sAddTabUid,'FLD_NAME' => $aRow['FLD_NAME'],'FLD_DESCRIPTION' => isset( $aRow['FLD_DESCRIPTION'] ) ? $aRow['FLD_DESCRIPTION'] : '','FLD_TYPE' => isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR','FLD_SIZE' => isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32','FLD_NULL' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0),'FLD_AUTO_INCREMENT' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0),'FLD_KEY' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0),'FLD_FOREIGN_KEY' => ($aRow['FLD_FOREIGN_KEY'] == 'on' ? 1 : 0),'FLD_FOREIGN_KEY_TABLE' => isset( $aRow['FLD_FOREIGN_KEY_TABLE'] ) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : ''
|
||||
) );
|
||||
|
||||
$aFields[] = array ('sType' => isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR','iSize' => isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32','sFieldName' => $aRow['FLD_NAME'],'bNull' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0),'bAI' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0),'bPrimaryKey' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0)
|
||||
);
|
||||
}
|
||||
|
||||
$oAdditionalTables->createTable( strtoupper( $pmTableName ), 'wf', $aFields );
|
||||
$oAdditionalTables->createPropelClasses( strtoupper( $pmTableName ), $pmTableName, $pmTableFields, $sAddTabUid );
|
||||
|
||||
require_once ("classes/model/Application.php");
|
||||
require_once ("classes/model/AdditionalTables.php");
|
||||
require_once ("classes/model/Fields.php");
|
||||
|
||||
$Criteria = new Criteria( 'workflow' );
|
||||
$Criteria->addSelectColumn( ApplicationPeer::APP_UID );
|
||||
$Criteria->addSelectColumn( ApplicationPeer::APP_DATA );
|
||||
|
||||
$oFields = new Fields();
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
|
||||
$sAddTabUid = $oAdditionalTables->create( $aData, $pmTableFields );
|
||||
|
||||
foreach ($pmTableFields as $iRow => $aRow) {
|
||||
$pmTableFields[$iRow]['FLD_NAME'] = strtoupper( $aRow['FLD_NAME'] );
|
||||
$pmTableFields[$iRow]['FLD_DESCRIPTION'] = isset( $aRow['FLD_DESCRIPTION'] ) ? $aRow['FLD_DESCRIPTION'] : $aRow['FLD_NAME'];
|
||||
$pmTableFields[$iRow]['FLD_TYPE'] = isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR';
|
||||
$pmTableFields[$iRow]['FLD_SIZE'] = isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32';
|
||||
$pmTableFields[$iRow]['FLD_NULL'] = isset( $aRow['FLD_NULL'] ) ? $aRow['FLD_NULL'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_AUTO_INCREMENT'] = isset( $aRow['FLD_AUTO_INCREMENT'] ) ? $aRow['FLD_AUTO_INCREMENT'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_KEY'] = isset( $aRow['FLD_KEY'] ) ? $aRow['FLD_KEY'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_FOREIGN_KEY'] = isset( $aRow['FLD_FOREIGN_KEY'] ) ? $aRow['FLD_FOREIGN_KEY'] : 'off';
|
||||
$pmTableFields[$iRow]['FLD_FOREIGN_KEY_TABLE'] = isset( $aRow['FLD_FOREIGN_KEY_TABLE'] ) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : '';
|
||||
}
|
||||
|
||||
foreach ($pmTableFields as $iRow => $aRow) {
|
||||
|
||||
$oFields->create( array ('FLD_INDEX' => $iRow + 1,'ADD_TAB_UID' => $sAddTabUid,'FLD_NAME' => $aRow['FLD_NAME'],'FLD_DESCRIPTION' => isset( $aRow['FLD_DESCRIPTION'] ) ? $aRow['FLD_DESCRIPTION'] : '','FLD_TYPE' => isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR','FLD_SIZE' => isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32','FLD_NULL' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0),'FLD_AUTO_INCREMENT' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0),'FLD_KEY' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0),'FLD_FOREIGN_KEY' => ($aRow['FLD_FOREIGN_KEY'] == 'on' ? 1 : 0),'FLD_FOREIGN_KEY_TABLE' => isset( $aRow['FLD_FOREIGN_KEY_TABLE'] ) ? $aRow['FLD_FOREIGN_KEY_TABLE'] : '') );
|
||||
|
||||
$aFields[] = array ('sType' => isset( $aRow['FLD_TYPE'] ) ? $aRow['FLD_TYPE'] : 'VARCHAR','iSize' => isset( $aRow['FLD_SIZE'] ) ? $aRow['FLD_SIZE'] : '32','sFieldName' => $aRow['FLD_NAME'],'bNull' => ($aRow['FLD_NULL'] == 'on' ? 1 : 0),'bAI' => ($aRow['FLD_AUTO_INCREMENT'] == 'on' ? 1 : 0),'bPrimaryKey' => ($aRow['FLD_KEY'] == 'on' ? 1 : 0));
|
||||
}
|
||||
|
||||
$oAdditionalTables->createTable( strtoupper( $pmTableName ), 'wf', $aFields );
|
||||
$oAdditionalTables->createPropelClasses( strtoupper( $pmTableName ), $pmTableName, $pmTableFields, $sAddTabUid );
|
||||
|
||||
require_once ("classes/model/Application.php");
|
||||
require_once ("classes/model/AdditionalTables.php");
|
||||
require_once ("classes/model/Fields.php");
|
||||
|
||||
$Criteria = new Criteria( 'workflow' );
|
||||
$Criteria->addSelectColumn( ApplicationPeer::APP_UID );
|
||||
$Criteria->addSelectColumn( ApplicationPeer::APP_DATA );
|
||||
|
||||
// $Criteria->add (AppCacheViewPeer::DEL_THREAD_STATUS, 'OPEN');
|
||||
$oDataset = ApplicationPeer::doSelectRS( $Criteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aProcesses = array ();
|
||||
$i = 0;
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$appuid = $aRow['APP_UID'];
|
||||
$data = unserialize( $aRow['APP_DATA'] );
|
||||
$cedula = '234' . rand( 1000, 999999 );
|
||||
$nombre = 'nombre ' . rand( 1000, 999999 );
|
||||
$direccion = 'direccion ' . rand( 1000, 999999 );
|
||||
if (isset( $data['_cedula'] )) {
|
||||
$cedula = $data['_cedula'];
|
||||
$nombre = isset( $data['_nombre'] ) ? $data['_nombre'] : '';
|
||||
$direccion = isset( $data['_direccion'] ) ? $data['_direccion'] : '';
|
||||
print "$i $appuid $cedula <br>";
|
||||
}
|
||||
$oDataset = ApplicationPeer::doSelectRS( $Criteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aProcesses = array ();
|
||||
$i = 0;
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$appuid = $aRow['APP_UID'];
|
||||
$data = unserialize( $aRow['APP_DATA'] );
|
||||
$cedula = '234' . rand( 1000, 999999 );
|
||||
$nombre = 'nombre ' . rand( 1000, 999999 );
|
||||
$direccion = 'direccion ' . rand( 1000, 999999 );
|
||||
if (isset( $data['_cedula'] )) {
|
||||
$cedula = $data['_cedula'];
|
||||
$nombre = isset( $data['_nombre'] ) ? $data['_nombre'] : '';
|
||||
$direccion = isset( $data['_direccion'] ) ? $data['_direccion'] : '';
|
||||
print "$i $appuid $cedula <br>";
|
||||
}
|
||||
// print_r ( $aRow);
|
||||
$sql = "insert CONTENDERS VALUES ( '$appuid', '$nombre', '$direccion', '$cedula' )";
|
||||
|
||||
$con = Propel::getConnection( 'workflow' );
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$i ++;
|
||||
$sql = "insert CONTENDERS VALUES ( '$appuid', '$nombre', '$direccion', '$cedula' )";
|
||||
|
||||
$con = Propel::getConnection( 'workflow' );
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$i ++;
|
||||
// if ( $i == 100 ) die;
|
||||
/* if ( strpos ( $aRow['APP_DATA'], 'cedula' ) !== false ) {
|
||||
print_r ( $aRow );
|
||||
print "<hr>";
|
||||
print_r ( $aRow );
|
||||
print "<hr>";
|
||||
$i++;
|
||||
if ( $i == 10 ) die;
|
||||
}
|
||||
*/
|
||||
$oDataset->next();
|
||||
}
|
||||
print "--$i--";
|
||||
|
||||
}
|
||||
*/
|
||||
$oDataset->next();
|
||||
}
|
||||
print "--$i--";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user