CODE STYLE Formating workflow/engine/methods/cases
Change format files in workflow/engine/methods/cases
This commit is contained in:
@@ -12,71 +12,63 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
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;
|
||||
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;
|
||||
if (isset( $_POST['form']['BTN_CANCEL'] )) {
|
||||
header( "Location: ../cases/main" );
|
||||
die();
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass('case');
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
$sAppUid = $_SESSION['APPLICATION'];
|
||||
$sAppUid = $_SESSION['APPLICATION'];
|
||||
$iDelIndex = $_SESSION['INDEX'];
|
||||
|
||||
$oAppDelegation = new AppDelegation();
|
||||
$aDelegation = $oAppDelegation->load($sAppUid, $iDelIndex);
|
||||
$aDelegation = $oAppDelegation->load( $sAppUid, $iDelIndex );
|
||||
|
||||
//if there are no user in the delegation row, this case is still in selfservice
|
||||
if ( $aDelegation['USR_UID'] == "" ) {
|
||||
if ($aDelegation['USR_UID'] == "") {
|
||||
$oCase->setCatchUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'] );
|
||||
} else {
|
||||
G::SendMessageText(G::LoadTranslation('ID_CASE_ALREADY_DERIVATED'), 'error');
|
||||
G::SendMessageText( G::LoadTranslation( 'ID_CASE_ALREADY_DERIVATED' ), 'error' );
|
||||
}
|
||||
|
||||
$validation = (SYS_SKIN != 'uxs')? 'true' : 'false';
|
||||
$validation = (SYS_SKIN != 'uxs') ? 'true' : 'false';
|
||||
|
||||
die('<script type="text/javascript">
|
||||
if ('.$validation.') {
|
||||
die( '<script type="text/javascript">
|
||||
if (' . $validation . ') {
|
||||
if (window.parent.frames.length != 0) {
|
||||
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] .
|
||||
'&action=unassigned";
|
||||
parent.location = "open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
|
||||
} else {
|
||||
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' .
|
||||
$_SESSION['INDEX'] . '&action=unassigned";
|
||||
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
|
||||
}
|
||||
} else {
|
||||
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' .
|
||||
$_SESSION['INDEX'] . '&action=unassigned";
|
||||
window.location = "../cases/cases_Open?APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] . '&action=unassigned";
|
||||
}
|
||||
</script>'
|
||||
);
|
||||
</script>' );
|
||||
|
||||
|
||||
@@ -12,84 +12,80 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
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');
|
||||
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' ] );
|
||||
$aProc = $objProc->load( $Fields['PRO_UID'] );
|
||||
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
|
||||
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load($Fields['TAS_UID' ] );
|
||||
$aTask = $objTask->load( $Fields['TAS_UID'] );
|
||||
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
|
||||
$Fields['STATUS'] .= ' ( '. G::LoadTranslation('ID_UNASSIGNED') . ' )';
|
||||
$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']) );
|
||||
$oAppDel->Load( $Fields['APP_UID'], ($Fields['DEL_PREVIOUS'] == 0 ? $Fields['DEL_PREVIOUS'] = 1 : $Fields['DEL_PREVIOUS']) );
|
||||
|
||||
$aAppDel = $oAppDel->toArray(BasePeer::TYPE_FIELDNAME);
|
||||
$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'] = '';
|
||||
$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' ] );
|
||||
$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();
|
||||
$oHeadPublisher->addScriptCode("
|
||||
$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('
|
||||
}" );
|
||||
$oHeadPublisher->addScriptCode( '
|
||||
var Cse = {};
|
||||
Cse.panels = {};
|
||||
var leimnud = new maborak();
|
||||
@@ -100,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');
|
||||
' );
|
||||
$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' );
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_CatchSelfService.xml', '', $Fields, 'cases_CatchExecute');
|
||||
G::RenderPage( 'publish', 'blank');
|
||||
|
||||
@@ -12,49 +12,46 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
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');
|
||||
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);
|
||||
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();
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -12,52 +12,48 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
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');
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* Process the info */
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove($_GET['DOC']);
|
||||
$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);
|
||||
$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']);
|
||||
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']);
|
||||
?>
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
|
||||
|
||||
@@ -12,40 +12,39 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
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');
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* Process the info */
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove($_GET['DOC']);
|
||||
$oAppDocument->remove( $_GET['DOC'] );
|
||||
|
||||
/* Redirect */
|
||||
G::header('location: ' . $_SERVER['HTTP_REFERER']);
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
|
||||
|
||||
@@ -12,182 +12,174 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
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');
|
||||
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){
|
||||
foreach ($_POST['form']['TASKS'] as $aValues) {
|
||||
}
|
||||
|
||||
try {
|
||||
//load data
|
||||
$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());
|
||||
//cleaning debug variables
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array();
|
||||
//load data
|
||||
$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() );
|
||||
//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');
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'ASSIGN_TASK', - 2, 'BEFORE' );
|
||||
|
||||
//if there are some triggers to execute
|
||||
if( sizeof($triggers) > 0) {
|
||||
//Execute triggers before derivation
|
||||
$appFields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'ASSIGN_TASK', -2, 'BEFORE', $appFields['APP_DATA'] );
|
||||
//if there are some triggers to execute
|
||||
if (sizeof( $triggers ) > 0) {
|
||||
//Execute triggers before derivation
|
||||
$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'];
|
||||
|
||||
$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'] );
|
||||
|
||||
$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 ) {
|
||||
$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);
|
||||
|
||||
// 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%');
|
||||
}
|
||||
// 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;
|
||||
// check if there are multiple derivations
|
||||
if( count($_POST['form']['TASKS'] ) >1 ) {
|
||||
$multipleDelegation = true;
|
||||
}
|
||||
// If the case has been delegated
|
||||
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']);
|
||||
//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;
|
||||
}
|
||||
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']);
|
||||
}
|
||||
|
||||
$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'] );
|
||||
|
||||
$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) {
|
||||
$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;
|
||||
}
|
||||
}
|
||||
//Events - End
|
||||
$debuggerAvailable = true;
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $appFields );
|
||||
|
||||
if (isset($_SESSION['user_experience'])) {
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector?ux=' . $_SESSION['user_experience'];
|
||||
$debuggerAvailable = false;
|
||||
}
|
||||
else {
|
||||
$aNextStep['PAGE'] = 'casesListExtJsRedirector';
|
||||
}
|
||||
// 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%' );
|
||||
}
|
||||
// Send notifications - End
|
||||
|
||||
if (isset($_SESSION['PMDEBUGGER']) && $_SESSION['PMDEBUGGER'] && $debuggerAvailable) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$loc = 'cases_Step?' .'breakpoint=triggerdebug';
|
||||
}
|
||||
else {
|
||||
$loc = $aNextStep['PAGE'];
|
||||
}
|
||||
|
||||
// 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;
|
||||
// check if there are multiple derivations
|
||||
if (count( $_POST['form']['TASKS'] ) > 1) {
|
||||
$multipleDelegation = true;
|
||||
}
|
||||
// If the case has been delegated
|
||||
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 {
|
||||
// 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'] );
|
||||
}
|
||||
}
|
||||
}
|
||||
//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'];
|
||||
}
|
||||
//Triggers After
|
||||
if (isset($_SESSION['TRIGGER_DEBUG']['ISSET'])) {
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET'] == 1 ) {
|
||||
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
|
||||
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);
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
|
||||
$_POST['NextStep'] = $loc;
|
||||
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameLoader');
|
||||
$G_PUBLISH->AddContent('view', 'cases/showDebugFrameBreaker');
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameLoader' );
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/showDebugFrameBreaker' );
|
||||
$_SESSION['TRIGGER_DEBUG']['ISSET'] == 0;
|
||||
G::RenderPage('publish', 'blank');
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
exit();
|
||||
} else {
|
||||
unset($_SESSION['TRIGGER_DEBUG']);
|
||||
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');
|
||||
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' );
|
||||
}
|
||||
|
||||
|
||||
@@ -12,45 +12,46 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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>
|
||||
* By Erik A.
|
||||
* O. <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
if (($RBAC_Response = $RBAC->userCanAccess("PM_CASES"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass('case');
|
||||
G::LoadClass('configuration');
|
||||
/* 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)) {
|
||||
if (! isset( $_GET['l'] )) {
|
||||
$confCasesList = $conf->loadObject( 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
if (is_array( $confCasesList )) {
|
||||
$sTypeList = $confCasesList['sTypeList'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sTypeList = 'to_do';
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sTypeList = $_GET['l'];
|
||||
$confCasesList=array('sTypeList'=>$sTypeList);
|
||||
$conf->saveObject($confCasesList,'ProcessMaker','cases_List','',$_SESSION['USER_LOGGED'],'');
|
||||
$confCasesList = array ('sTypeList' => $sTypeList
|
||||
);
|
||||
$conf->saveObject( $confCasesList, 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
}
|
||||
|
||||
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
|
||||
@@ -58,9 +59,11 @@ $_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'));
|
||||
/**
|
||||
* 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' ) );
|
||||
}
|
||||
|
||||
/* *
|
||||
@@ -68,44 +71,39 @@ if( $sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused')
|
||||
* By Erik
|
||||
*/
|
||||
|
||||
$aAdditionalFilter = Array();
|
||||
$aAdditionalFilter = Array ();
|
||||
|
||||
|
||||
if( isset($_GET['PROCESS_UID']) and $_GET['PROCESS_UID'] != "0" && $_GET['PROCESS_UID'] != ""){
|
||||
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" ){
|
||||
if (isset( $_GET['READ'] ) and $_GET['READ'] == "1") {
|
||||
$aAdditionalFilter['READ'] = $_GET['READ'];
|
||||
}
|
||||
if( isset($_GET['UNREAD']) and $_GET['UNREAD'] == "1" ){
|
||||
if (isset( $_GET['UNREAD'] ) and $_GET['UNREAD'] == "1") {
|
||||
$aAdditionalFilter['UNREAD'] = $_GET['UNREAD'];
|
||||
}
|
||||
|
||||
if( isset($_GET['APP_STATUS_FILTER']) and $_GET['APP_STATUS_FILTER'] != "ALL" ){
|
||||
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" ){
|
||||
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);
|
||||
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);
|
||||
default:
|
||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -120,54 +118,50 @@ $rs = ApplicationPeer::doSelectRS($aCriteria);
|
||||
g::pr($aRows1);die;*/
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
if( !isset($_GET['PROCESS_UID']) ) {
|
||||
if (! isset( $_GET['PROCESS_UID'] )) {
|
||||
$oCase = new Cases();
|
||||
$rs = ApplicationPeer::doSelectRS($aCriteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$rs = ApplicationPeer::doSelectRS( $aCriteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$aProcess = Array();
|
||||
while($rs->next()) {
|
||||
$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']));
|
||||
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);
|
||||
$_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 = new Publisher();
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
||||
|
||||
if ($sTypeList == 'to_reassign') {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', array('REASSIGN_BY' => 1));
|
||||
$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')
|
||||
$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_PUBLISH->AddContent( 'propeltable', 'paged-table', $xmlfile, $aCriteria, $aData );
|
||||
|
||||
G::RenderPage('publish', 'blank');
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
|
||||
|
||||
function InAssocArray($a, $k, $v){
|
||||
foreach($a as $item){
|
||||
if( isset($item[$k]) && $v == $item[$k]) return true;
|
||||
function InAssocArray ($a, $k, $v)
|
||||
{
|
||||
foreach ($a as $item) {
|
||||
if (isset( $item[$k] ) && $v == $item[$k])
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
@@ -181,7 +175,5 @@ function InAssocArray($a, $k, $v){
|
||||
parent.PANEL_EAST_OPEN = false;
|
||||
if(parent.refreshCountFolders) parent.refreshCountFolders();
|
||||
}catch(e){}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* cases_New.php
|
||||
*
|
||||
@@ -12,151 +13,150 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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']);
|
||||
//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';
|
||||
}
|
||||
}
|
||||
if (ConfigurationPeer::doCount( $oCriteria )) {
|
||||
$conf = ConfigurationPeer::doSelect( $oCriteria );
|
||||
return $conf[0]->getCfgValue();
|
||||
} else {
|
||||
return 'dropdown';
|
||||
}
|
||||
}
|
||||
|
||||
$_GET['change']=(isset($_GET['change']))?$_GET['change']:putTypeView();
|
||||
$_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;
|
||||
/* 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;
|
||||
}
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass('case');
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
/* 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';
|
||||
$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)
|
||||
{
|
||||
/* 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';
|
||||
$sXmlForm = 'cases/cases_New.xml';
|
||||
//$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] );
|
||||
$_DBArray['NewCase'] = $oCase->getStartCasesPerType( $_SESSION['USER_LOGGED'], $_GET['change'] );
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$sXmlForm = 'cases/cases_CannotInitiateCase.xml';
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset( $_SESSION['G_MESSAGE']) && strlen($_SESSION['G_MESSAGE']) > 0 ) {
|
||||
$aMessage = array();
|
||||
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']);
|
||||
}
|
||||
//$_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']);
|
||||
//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'] = '';
|
||||
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'] = '';
|
||||
$aData['PRO_UID'] = '';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_UID'] = '';
|
||||
|
||||
$oConfig = new Configuration();
|
||||
$oConfig->create($aData);
|
||||
$oConfig->create( $aData );
|
||||
$listType = 'dropdown';
|
||||
}
|
||||
else {
|
||||
} 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);
|
||||
$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'] = '';
|
||||
}
|
||||
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'] = '';
|
||||
$aData['PRO_UID'] = '';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_UID'] = '';
|
||||
|
||||
$oConfig = new Configuration();
|
||||
$oConfig->update($aData);
|
||||
}
|
||||
$oConfig->update( $aData );
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
$G_PUBLISH = new Publisher;
|
||||
$aFields['CHANGE_LINK'] = G::LoadTranslation( 'ID_CHANGE_VIEW' );
|
||||
/* 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 (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 == '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');
|
||||
}
|
||||
if ($listType == 'category') {
|
||||
if ($bCanStart)
|
||||
$sXmlForm = 'cases/cases_NewCategory.xml';
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_NewCategory' );
|
||||
}
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
?>
|
||||
<script>
|
||||
parent.outerLayout.hide('east');
|
||||
parent.PANEL_EAST_OPEN = false;
|
||||
</script>
|
||||
|
||||
|
||||
@@ -12,21 +12,21 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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');
|
||||
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']);
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
G::header('location: ' . $aNextStep['PAGE']);
|
||||
?>
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
|
||||
|
||||
@@ -12,35 +12,34 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
}
|
||||
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');
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$oCase = new Cases();
|
||||
|
||||
@@ -48,158 +47,157 @@ $oCase = new Cases();
|
||||
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']);
|
||||
//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 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']); ???????
|
||||
}
|
||||
|
||||
//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'] : '';
|
||||
|
||||
$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();
|
||||
//loading application data
|
||||
$aFields = $oCase->loadCase( $sAppUid, $iDelIndex );
|
||||
// g::pr($aFields);
|
||||
// die;
|
||||
|
||||
|
||||
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;
|
||||
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');
|
||||
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');
|
||||
}
|
||||
} 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' );
|
||||
}
|
||||
|
||||
|
||||
@@ -12,68 +12,64 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
}
|
||||
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');
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
if (isset($_SESSION['APPLICATION'])) {
|
||||
unset($_SESSION['APPLICATION']);
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
unset( $_SESSION['APPLICATION'] );
|
||||
}
|
||||
if (isset($_SESSION['PROCESS'])) {
|
||||
unset($_SESSION['PROCESS']);
|
||||
if (isset( $_SESSION['PROCESS'] )) {
|
||||
unset( $_SESSION['PROCESS'] );
|
||||
}
|
||||
if (isset($_SESSION['INDEX'])) {
|
||||
unset($_SESSION['INDEX']);
|
||||
if (isset( $_SESSION['INDEX'] )) {
|
||||
unset( $_SESSION['INDEX'] );
|
||||
}
|
||||
if (isset($_SESSION['STEP_POSITION'])) {
|
||||
unset($_SESSION['STEP_POSITION']);
|
||||
if (isset( $_SESSION['STEP_POSITION'] )) {
|
||||
unset( $_SESSION['STEP_POSITION'] );
|
||||
}
|
||||
|
||||
/* Process the info */
|
||||
$oCase = new Cases();
|
||||
$sAppUid = $_GET['APP_UID'];
|
||||
$sAppUid = $_GET['APP_UID'];
|
||||
$iDelIndex = $_GET['DEL_INDEX'];
|
||||
|
||||
|
||||
$_SESSION['APPLICATION'] = $_GET['APP_UID'];
|
||||
$_SESSION['INDEX'] = $_GET['DEL_INDEX'];
|
||||
|
||||
$aFields = $oCase->loadCase($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 */
|
||||
$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);
|
||||
$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 );
|
||||
|
||||
|
||||
?>
|
||||
@@ -12,15 +12,14 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
|
||||
@@ -28,76 +27,69 @@ try {
|
||||
require_once 'classes/model/Process.php';
|
||||
|
||||
$currentDynUid = '';
|
||||
if (isset($_GET['DYNUIDPRINT']) && $_GET['DYNUIDPRINT'] != '') {
|
||||
if (isset( $_GET['DYNUIDPRINT'] ) && $_GET['DYNUIDPRINT'] != '') {
|
||||
$currentDynUid = $_GET['DYNUIDPRINT'];
|
||||
} elseif (isset($_SESSION['DYN_UID_PRINT'])) {
|
||||
} elseif (isset( $_SESSION['DYN_UID_PRINT'] )) {
|
||||
$currentDynUid = $_SESSION['DYN_UID_PRINT'];
|
||||
} elseif (isset($_SESSION['CURRENT_DYN_UID'])) {
|
||||
} elseif (isset( $_SESSION['CURRENT_DYN_UID'] )) {
|
||||
$currentDynUid = $_SESSION['CURRENT_DYN_UID'];
|
||||
}
|
||||
|
||||
$oDynaform = new Dynaform();
|
||||
$aDyn = $oDynaform->load($currentDynUid);
|
||||
$aDyn = $oDynaform->load( $currentDynUid );
|
||||
|
||||
G::LoadClass('case');
|
||||
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());
|
||||
if (isset( $_SESSION['APPLICATION'] )) {
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||
} else {
|
||||
$Fields['APP_DATA'] = Array();
|
||||
$Fields['APP_DATA'] = Array ();
|
||||
}
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_ID_MENU_SELECTED = 'USERS';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$idProcess = (isset($Fields['APP_DATA']['PROCESS'])) ? $Fields['APP_DATA']['PROCESS'] : $_SESSION['PROCESS'];
|
||||
$idProcess = (isset( $Fields['APP_DATA']['PROCESS'] )) ? $Fields['APP_DATA']['PROCESS'] : $_SESSION['PROCESS'];
|
||||
$oProcess = new Process();
|
||||
$aProcessFieds = $oProcess->load($idProcess);
|
||||
$aProcessFieds = $oProcess->load( $idProcess );
|
||||
$sProcess = $oProcess->getProTitle();
|
||||
|
||||
$noShowTitle = 0;
|
||||
if (isset($aProcessFieds['PRO_SHOW_MESSAGE'])) {
|
||||
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');
|
||||
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['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');
|
||||
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');
|
||||
$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( 'smarty', 'cases/cases_PrintViewTitle', '', '', $array );
|
||||
}
|
||||
$G_PUBLISH->AddContent('dynaform',
|
||||
'xmlform',
|
||||
$aDyn['PRO_UID'] . '/' . $aDyn['DYN_UID'],
|
||||
'',
|
||||
$Fields['APP_DATA'],
|
||||
'',
|
||||
'',
|
||||
'view');
|
||||
G::RenderPage('publish', 'blank');
|
||||
$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());
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -12,110 +12,109 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) {
|
||||
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;
|
||||
}
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
|
||||
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;
|
||||
}
|
||||
|
||||
G::LoadSystem('templatePower');
|
||||
$tpl = new TemplatePower(PATH_TPL ."cases/cases_Reassign.html");
|
||||
$tpl->prepare();
|
||||
G::LoadSystem( 'templatePower' );
|
||||
$tpl = new TemplatePower( PATH_TPL . "cases/cases_Reassign.html" );
|
||||
$tpl->prepare();
|
||||
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->add(AppDelegationPeer::APP_UID, $_GET['APP_UID']);
|
||||
$oCriteria->add(AppDelegationPeer::DEL_INDEX, $_GET['DEL_INDEX']);
|
||||
$oCriteria->add(AppDelegationPeer::DEL_FINISH_DATE, null);
|
||||
$oDataset = AppDelegationPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset->next();
|
||||
$c=0;
|
||||
G::LoadClass('tasks');
|
||||
$oTasks=new Tasks();
|
||||
G::LoadClass('groups');
|
||||
$oGroups = new Groups();
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$name = '';
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$c++;
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->add( AppDelegationPeer::APP_UID, $_GET['APP_UID'] );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_INDEX, $_GET['DEL_INDEX'] );
|
||||
$oCriteria->add( AppDelegationPeer::DEL_FINISH_DATE, null );
|
||||
$oDataset = AppDelegationPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$c = 0;
|
||||
G::LoadClass( 'tasks' );
|
||||
$oTasks = new Tasks();
|
||||
G::LoadClass( 'groups' );
|
||||
$oGroups = new Groups();
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$name = '';
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$c ++;
|
||||
|
||||
$aUsr=array();
|
||||
$aUsrUid=array();
|
||||
$aAux1 = $oTasks->getGroupsOfTask($aRow['TAS_UID'], 1);
|
||||
foreach ($aAux1 as $value1) {
|
||||
$aAux2 = $oGroups->getUsersOfGroup($value1['GRP_UID']);
|
||||
foreach ($aAux2 as $value2) {
|
||||
if($aRow['USR_UID']!=$value2['USR_UID']) {
|
||||
if(!in_array($value2['USR_UID'], $aUsrUid)) {//var_dump($aRow['USR_UID'], $value2['USR_UID']);echo '<br /><br />';
|
||||
$aAux = $oUser->load($value2['USR_UID']);
|
||||
$aUsr[$aAux['USR_FIRSTNAME'] . ' ' . $aAux['USR_LASTNAME']] = $aAux;
|
||||
$aUsrUid[]=$value2['USR_UID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$aUsr = array ();
|
||||
$aUsrUid = array ();
|
||||
$aAux1 = $oTasks->getGroupsOfTask( $aRow['TAS_UID'], 1 );
|
||||
foreach ($aAux1 as $value1) {
|
||||
$aAux2 = $oGroups->getUsersOfGroup( $value1['GRP_UID'] );
|
||||
foreach ($aAux2 as $value2) {
|
||||
if ($aRow['USR_UID'] != $value2['USR_UID']) {
|
||||
if (! in_array( $value2['USR_UID'], $aUsrUid )) { //var_dump($aRow['USR_UID'], $value2['USR_UID']);echo '<br /><br />';
|
||||
$aAux = $oUser->load( $value2['USR_UID'] );
|
||||
$aUsr[$aAux['USR_FIRSTNAME'] . ' ' . $aAux['USR_LASTNAME']] = $aAux;
|
||||
$aUsrUid[] = $value2['USR_UID'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$aUsers=$oTasks->getUsersOfTask($aRow['TAS_UID'], 1);
|
||||
foreach($aUsers as $key => $value)
|
||||
{
|
||||
if($aRow['USR_UID']!=$value['USR_UID'])
|
||||
{ if(!in_array($value['USR_UID'], $aUsrUid))
|
||||
$aUsr[$value['USR_FIRSTNAME'] . ' ' . $value['USR_LASTNAME']]=$value;
|
||||
}
|
||||
}
|
||||
ksort($aUsr);
|
||||
//$users='';
|
||||
//$users='<select name="USERS"><option value="">Seleccione</option>';
|
||||
foreach($aUsr as $key => $value)
|
||||
{ $tpl->newBlock( "users" );
|
||||
$name=$value['USR_FIRSTNAME'].' '.$value['USR_LASTNAME'].' ('.$value['USR_USERNAME'].')';
|
||||
//$users=$users."<option value='".$value['USR_UID']."'>". $name ."</option>";
|
||||
$tpl->assign( "USR_UID", $value['USR_UID'] );
|
||||
$tpl->assign( "USERS", $name );
|
||||
}
|
||||
//$users=$users.' </select>';
|
||||
$aUsers = $oTasks->getUsersOfTask( $aRow['TAS_UID'], 1 );
|
||||
foreach ($aUsers as $key => $value) {
|
||||
if ($aRow['USR_UID'] != $value['USR_UID']) {
|
||||
if (! in_array( $value['USR_UID'], $aUsrUid ))
|
||||
$aUsr[$value['USR_FIRSTNAME'] . ' ' . $value['USR_LASTNAME']] = $value;
|
||||
}
|
||||
}
|
||||
ksort( $aUsr );
|
||||
//$users='';
|
||||
//$users='<select name="USERS"><option value="">Seleccione</option>';
|
||||
foreach ($aUsr as $key => $value) {
|
||||
$tpl->newBlock( "users" );
|
||||
$name = $value['USR_FIRSTNAME'] . ' ' . $value['USR_LASTNAME'] . ' (' . $value['USR_USERNAME'] . ')';
|
||||
//$users=$users."<option value='".$value['USR_UID']."'>". $name ."</option>";
|
||||
$tpl->assign( "USR_UID", $value['USR_UID'] );
|
||||
$tpl->assign( "USERS", $name );
|
||||
}
|
||||
//$users=$users.' </select>';
|
||||
|
||||
//$tpl->assign( "USERS", $users );
|
||||
|
||||
$oDataset->next();
|
||||
}
|
||||
$tpl->gotoBlock('_ROOT');
|
||||
$tpl->assign( "US", $name );
|
||||
$tpl->assign( "ID_NO_REASSIGN", '-');
|
||||
$tpl->assign( "APP_UID", $_GET['APP_UID']);
|
||||
$tpl->assign( "DEL_INDEX", $_GET['DEL_INDEX']);
|
||||
//$tpl->assign( "USERS", $users );
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('template', '', '', '', $tpl);
|
||||
G::RenderPage('publish', 'blank');
|
||||
|
||||
$oDataset->next();
|
||||
}
|
||||
$tpl->gotoBlock( '_ROOT' );
|
||||
$tpl->assign( "US", $name );
|
||||
$tpl->assign( "ID_NO_REASSIGN", '-' );
|
||||
$tpl->assign( "APP_UID", $_GET['APP_UID'] );
|
||||
$tpl->assign( "DEL_INDEX", $_GET['DEL_INDEX'] );
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'template', '', '', '', $tpl );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -12,15 +12,14 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -29,138 +28,123 @@
|
||||
*/
|
||||
|
||||
try {
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) {
|
||||
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;
|
||||
}
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
|
||||
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($_GET['REASSIGN_USER'])) {
|
||||
$_GET['REASSIGN_USER'] = '';
|
||||
}
|
||||
$_GET['REASSIGN_BY'] = 2;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
//////////////////
|
||||
///SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME, ' (', USR_USERNAME, ')') AS USER_FULLNAME FROM USERS WHERE USR_STATUS <> 'CLOSED'//////
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria=new Criteria();
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$oCriteria->addSelectColumn(UsersPeer::USR_EMAIL);
|
||||
$oCriteria->add(UsersPeer::USR_STATUS,'', Criteria::NOT_EQUAL);
|
||||
$oDataset=UsersPeer::doSelectRS($oCriteria);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
///////////////////////
|
||||
G::loadClass('configuration');
|
||||
$oConf = new Configurations;
|
||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS','');
|
||||
if (! isset( $_GET['REASSIGN_USER'] )) {
|
||||
$_GET['REASSIGN_USER'] = '';
|
||||
}
|
||||
$_GET['REASSIGN_BY'] = 2;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
//////////////////
|
||||
///SELECT USR_UID, CONCAT(USR_FIRSTNAME, ' ', USR_LASTNAME, ' (', USR_USERNAME, ')') AS USER_FULLNAME FROM USERS WHERE USR_STATUS <> 'CLOSED'//////
|
||||
require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria();
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_USERNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_EMAIL );
|
||||
$oCriteria->add( UsersPeer::USR_STATUS, '', Criteria::NOT_EQUAL );
|
||||
$oDataset = UsersPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
///////////////////////
|
||||
G::loadClass( 'configuration' );
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig( $obj, 'ENVIRONMENT_SETTINGS', '' );
|
||||
|
||||
$defaultOption = isset($oConf->aConfig['format'])? $oConf->aConfig['format']: '';
|
||||
$aUserInfo = array();
|
||||
$aUserInfo[] = array('USR_UID' => 'char','USER_FULLNAME' => 'char');
|
||||
while( $oDataset->next()){
|
||||
$aRow1 = $oDataset->getRow();
|
||||
$infoUser = G::getFormatUserList($defaultOption,$aRow1);
|
||||
$aUserInfo[]=array(
|
||||
'USR_UID' => $aRow1['USR_UID'],
|
||||
'USER_FULLNAME' => $infoUser
|
||||
);
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['aUserInfo'] = $aUserInfo;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
//////////////////
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', $_GET);
|
||||
$defaultOption = isset( $oConf->aConfig['format'] ) ? $oConf->aConfig['format'] : '';
|
||||
$aUserInfo = array ();
|
||||
$aUserInfo[] = array ('USR_UID' => 'char','USER_FULLNAME' => 'char'
|
||||
);
|
||||
while ($oDataset->next()) {
|
||||
$aRow1 = $oDataset->getRow();
|
||||
$infoUser = G::getFormatUserList( $defaultOption, $aRow1 );
|
||||
$aUserInfo[] = array ('USR_UID' => $aRow1['USR_UID'],'USER_FULLNAME' => $infoUser
|
||||
);
|
||||
}
|
||||
global $_DBArray;
|
||||
$_DBArray['aUserInfo'] = $aUserInfo;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
//////////////////
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', $_GET );
|
||||
|
||||
$sUserToReassign = trim($_GET['REASSIGN_USER']);
|
||||
$sUserToReassign = trim( $_GET['REASSIGN_USER'] );
|
||||
|
||||
if ($_GET['REASSIGN_USER'] != '') {
|
||||
if ($_GET['REASSIGN_USER'] != '') {
|
||||
|
||||
G::LoadClass('tasks');
|
||||
G::LoadClass('groups');
|
||||
$oTasks = new Tasks();
|
||||
$oGroups = new Groups();
|
||||
$oUser = new Users();
|
||||
G::LoadClass('case');
|
||||
$oCases = new Cases();
|
||||
G::LoadClass( 'tasks' );
|
||||
G::LoadClass( 'groups' );
|
||||
$oTasks = new Tasks();
|
||||
$oGroups = new Groups();
|
||||
$oUser = new Users();
|
||||
G::LoadClass( 'case' );
|
||||
$oCases = new Cases();
|
||||
|
||||
list($oCriteriaToDo,$sXMLFile) = $oCases->getConditionCasesList('to_do', $sUserToReassign);
|
||||
list($oCriteriaDraft,$sXMLFile) = $oCases->getConditionCasesList('draft', $sUserToReassign);
|
||||
list ($oCriteriaToDo, $sXMLFile) = $oCases->getConditionCasesList( 'to_do', $sUserToReassign );
|
||||
list ($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList( 'draft', $sUserToReassign );
|
||||
|
||||
$aCasesList = Array();
|
||||
$aCasesList = Array ();
|
||||
|
||||
$oDataset = ApplicationPeer::doSelectRS($oCriteriaToDo);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset = ApplicationPeer::doSelectRS( $oCriteriaToDo );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
while ( $oDataset->next() ) {
|
||||
array_push($aCasesList, $oDataset->getRow());
|
||||
}
|
||||
while ($oDataset->next()) {
|
||||
array_push( $aCasesList, $oDataset->getRow() );
|
||||
}
|
||||
|
||||
$oDataset = ApplicationPeer::doSelectRS($oCriteriaDraft);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$oDataset = ApplicationPeer::doSelectRS( $oCriteriaDraft );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
while ( $oDataset->next() ) {
|
||||
array_push($aCasesList, $oDataset->getRow());
|
||||
}
|
||||
while ($oDataset->next()) {
|
||||
array_push( $aCasesList, $oDataset->getRow() );
|
||||
}
|
||||
|
||||
$filedNames = Array (
|
||||
"APP_UID",
|
||||
"APP_NUMBER",
|
||||
"APP_UPDATE_DATE",
|
||||
"DEL_PRIORITY",
|
||||
"DEL_INDEX",
|
||||
"TAS_UID",
|
||||
"DEL_INIT_DATE",
|
||||
"DEL_FINISH_DATE",
|
||||
"USR_UID",
|
||||
"APP_STATUS",
|
||||
"DEL_TASK_DUE_DATE",
|
||||
"APP_CURRENT_USER",
|
||||
"APP_TITLE",
|
||||
"APP_PRO_TITLE",
|
||||
"APP_TAS_TITLE",
|
||||
"APP_DEL_PREVIOUS_USER",
|
||||
);
|
||||
$filedNames = Array ("APP_UID","APP_NUMBER","APP_UPDATE_DATE","DEL_PRIORITY","DEL_INDEX","TAS_UID","DEL_INIT_DATE","DEL_FINISH_DATE","USR_UID","APP_STATUS","DEL_TASK_DUE_DATE","APP_CURRENT_USER","APP_TITLE","APP_PRO_TITLE","APP_TAS_TITLE","APP_DEL_PREVIOUS_USER"
|
||||
);
|
||||
|
||||
$aCasesList = array_merge(Array($filedNames), $aCasesList);
|
||||
$aCasesList = array_merge( Array ($filedNames
|
||||
), $aCasesList );
|
||||
|
||||
// G::pr($aCasesList); die;
|
||||
// G::pr($aCasesList); die;
|
||||
|
||||
|
||||
require_once ( 'classes/class.xmlfield_InputPM.php' );
|
||||
require_once ('classes/class.xmlfield_InputPM.php');
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['reassign_byuser'] = $aCasesList;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
G::LoadClass('ArrayPeer');
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('reassign_byuser');
|
||||
global $_DBArray;
|
||||
$_DBArray['reassign_byuser'] = $aCasesList;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
G::LoadClass( 'ArrayPeer' );
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'reassign_byuser' );
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile ( '/jscore/cases/reassignByUser.js' );
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
||||
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-reassigByUser', 'cases/cases_ToReassignByUserList', $oCriteria, Array('FROM_USR_UID'=>$sUserToReassign));
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/cases/reassignByUser.js' );
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-reassigByUser', 'cases/cases_ToReassignByUserList', $oCriteria, Array ('FROM_USR_UID' => $sUserToReassign
|
||||
) );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
G::RenderPage('publish', 'blank');
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
?>
|
||||
<div id="publisherContent[10]" style="display:none"></div>
|
||||
<div id="publisherContent[10]" style="display: none"></div>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
*cases_Reassign_save.php
|
||||
* cases_Reassign_save.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
@@ -12,68 +12,64 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_REASSIGNCASE')) {
|
||||
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;
|
||||
}
|
||||
//print_r($_POST); die;
|
||||
G::LoadClass('case');
|
||||
$oCase = new Cases();
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess( 'PM_REASSIGNCASE' )) {
|
||||
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;
|
||||
}
|
||||
//print_r($_POST); die;
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
|
||||
if ($_POST['USERS'] != '') {
|
||||
$oCase->reassignCase($_POST['APP_UID'], $_POST['DEL_INDEX'], $_SESSION['USER_LOGGED'], $_POST['USERS']);
|
||||
$oCase->reassignCase( $_POST['APP_UID'], $_POST['DEL_INDEX'], $_SESSION['USER_LOGGED'], $_POST['USERS'] );
|
||||
|
||||
}
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load($_POST['USERS']);
|
||||
require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$aUser = $oUser->load( $_POST['USERS'] );
|
||||
|
||||
$Fields=array();
|
||||
$Fields = array ();
|
||||
|
||||
$Fields['USERS'] = $aUser['USR_FIRSTNAME'].' '.$aUser['USR_LASTNAME'].' ('.$aUser['USR_USERNAME'].')';
|
||||
$Fields['USERS'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')';
|
||||
|
||||
G::LoadClass( 'case' );
|
||||
$oCases = new Cases();
|
||||
$aCases = $oCases->loadCase( $_POST['APP_UID'], $_POST['DEL_INDEX'] );
|
||||
|
||||
$Fields['APP_NUMBER'] = $aCases['APP_NUMBER'];
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Reassign.xml', '', $Fields, '' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
//G::SendMessageText(G::LoadTranslation('ID_FINISHED'), 'info');
|
||||
//G::header('Location: cases_List');
|
||||
|
||||
|
||||
|
||||
G::LoadClass('case');
|
||||
$oCases=new Cases();
|
||||
$aCases=$oCases->loadCase($_POST['APP_UID'], $_POST['DEL_INDEX'] );
|
||||
|
||||
$Fields['APP_NUMBER']=$aCases['APP_NUMBER'];
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REASSIGN';
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Reassign.xml', '', $Fields, '');
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
//G::SendMessageText(G::LoadTranslation('ID_FINISHED'), 'info');
|
||||
//G::header('Location: cases_List');
|
||||
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -12,15 +12,14 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Created on 19-03-2009
|
||||
@@ -29,13 +28,12 @@
|
||||
*/
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$aFields = $oAppDocument->load($_GET['a']);
|
||||
$aFields = $oAppDocument->load( $_GET['a'] );
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aOD = $oOutputDocument->load($aFields['DOC_UID']);
|
||||
$a = $_GET['a'];
|
||||
$ext = strtolower($aOD['OUT_DOC_GENERATE']);
|
||||
$aOD = $oOutputDocument->load( $aFields['DOC_UID'] );
|
||||
$a = $_GET['a'];
|
||||
$ext = strtolower( $aOD['OUT_DOC_GENERATE'] );
|
||||
|
||||
G::header( 'location: cases_ShowOutputDocument?a=' . $a . '&ext=' . $ext );
|
||||
|
||||
G::header('location: cases_ShowOutputDocument?a='.$a.'&ext='.$ext );
|
||||
?>
|
||||
@@ -12,86 +12,84 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
}
|
||||
/* 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');
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* Menues */
|
||||
$_SESSION['bNoShowSteps'] = true;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'caseOptions';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = '_';
|
||||
/* Menues */
|
||||
$_SESSION['bNoShowSteps'] = true;
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'caseOptions';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = '_';
|
||||
|
||||
/* Prepare page before to show */
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
$participated = $oCase->userParticipatedInCase($_GET['APP_UID'], $_SESSION['USER_LOGGED']);
|
||||
/* Prepare page before to show */
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'], $_SESSION['INDEX'] );
|
||||
$participated = $oCase->userParticipatedInCase( $_GET['APP_UID'], $_SESSION['USER_LOGGED'] );
|
||||
|
||||
if ($RBAC->userCanAccess('PM_ALLCASES') < 0 && $participated == 0) {
|
||||
if ($RBAC->userCanAccess( 'PM_ALLCASES' ) < 0 && $participated == 0) {
|
||||
/*if (strtoupper($Fields['APP_STATUS']) != 'COMPLETED') {
|
||||
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'SHOW_MESSAGE');
|
||||
}*/
|
||||
$aMessage['MESSAGE'] = G::LoadTranslation('ID_NO_PERMISSION_NO_PARTICIPATED');
|
||||
$aMessage['MESSAGE'] = G::LoadTranslation( 'ID_NO_PERMISSION_NO_PARTICIPATED' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
die;
|
||||
}
|
||||
if (isset($aRow['APP_TYPE'])) {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
die();
|
||||
}
|
||||
if (isset( $aRow['APP_TYPE'] )) {
|
||||
switch ($aRow['APP_TYPE']) {
|
||||
case 'PAUSE':
|
||||
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_PAUSED')));
|
||||
break;
|
||||
case 'CANCEL':
|
||||
$Fields['STATUS'] = ucfirst(strtolower(G::LoadTranslation('ID_CANCELLED')));
|
||||
break;
|
||||
case 'PAUSE':
|
||||
$Fields['STATUS'] = ucfirst( strtolower( G::LoadTranslation( 'ID_PAUSED' ) ) );
|
||||
break;
|
||||
case 'CANCEL':
|
||||
$Fields['STATUS'] = ucfirst( strtolower( G::LoadTranslation( 'ID_CANCELLED' ) ) );
|
||||
break;
|
||||
}
|
||||
|
||||
//$Fields['STATUS'] = $aRow['APP_TYPE'];
|
||||
}
|
||||
}
|
||||
|
||||
$actions = 'false';
|
||||
if( $_GET['action'] == 'paused')
|
||||
$actions = 'false';
|
||||
if ($_GET['action'] == 'paused')
|
||||
$actions = 'true';
|
||||
|
||||
/* Render page */
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
/* Render page */
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addScriptCode("
|
||||
$oHeadPublisher->addScriptCode( "
|
||||
if (typeof parent != 'undefined') {
|
||||
if (parent.showCaseNavigatorPanel) {
|
||||
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
|
||||
}
|
||||
}");
|
||||
}" );
|
||||
|
||||
$oHeadPublisher->addScriptCode('
|
||||
$oHeadPublisher->addScriptCode( '
|
||||
var Cse = {};
|
||||
Cse.panels = {};
|
||||
var leimnud = new maborak();
|
||||
@@ -102,20 +100,21 @@
|
||||
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);
|
||||
');
|
||||
' );
|
||||
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
|
||||
$objProc = new Process();
|
||||
$aProc = $objProc->load($Fields['PRO_UID' ] );
|
||||
$Fields['PRO_TITLE'] = $aProc['PRO_TITLE'];
|
||||
$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'];
|
||||
$objTask = new Task();
|
||||
$aTask = $objTask->load( $Fields['TAS_UID'] );
|
||||
$Fields['TAS_TITLE'] = $aTask['TAS_TITLE'];
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addScriptFile( '/jscore/cases/core/cases_Step.js' );
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Resume.xml', '', $Fields, '' );
|
||||
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_Resume.xml', '', $Fields, '');
|
||||
G::RenderPage( 'publish', 'blank');
|
||||
|
||||
@@ -12,65 +12,67 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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;
|
||||
/* 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;
|
||||
}
|
||||
case - 1:
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
break;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass('case');
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
/* unset any variable, because we are starting a new case */
|
||||
if (isset($_SESSION['APPLICATION'])) unset($_SESSION['APPLICATION']);
|
||||
if (isset($_SESSION['PROCESS'])) unset($_SESSION['PROCESS']);
|
||||
if (isset($_SESSION['TASK'])) unset($_SESSION['TASK']);
|
||||
if (isset($_SESSION['INDEX'])) unset($_SESSION['INDEX']);
|
||||
if (isset($_SESSION['STEP_POSITION'])) unset($_SESSION['STEP_POSITION']);
|
||||
/* unset any variable, because we are starting a new case */
|
||||
if (isset( $_SESSION['APPLICATION'] ))
|
||||
unset( $_SESSION['APPLICATION'] );
|
||||
if (isset( $_SESSION['PROCESS'] ))
|
||||
unset( $_SESSION['PROCESS'] );
|
||||
if (isset( $_SESSION['TASK'] ))
|
||||
unset( $_SESSION['TASK'] );
|
||||
if (isset( $_SESSION['INDEX'] ))
|
||||
unset( $_SESSION['INDEX'] );
|
||||
if (isset( $_SESSION['STEP_POSITION'] ))
|
||||
unset( $_SESSION['STEP_POSITION'] );
|
||||
|
||||
/* Process */
|
||||
try {
|
||||
/* Process */
|
||||
try {
|
||||
$oCase = new Cases();
|
||||
$aData = $oCase->startCase( $_POST['form']['TAS_UID'], $_SESSION['USER_LOGGED'] );
|
||||
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
|
||||
$_SESSION['INDEX'] = $aData['INDEX'];
|
||||
$_SESSION['PROCESS'] = $aData['PROCESS'];
|
||||
$_SESSION['TASK'] = $_POST['form']['TAS_UID'];
|
||||
$_SESSION['APPLICATION'] = $aData['APPLICATION'];
|
||||
$_SESSION['INDEX'] = $aData['INDEX'];
|
||||
$_SESSION['PROCESS'] = $aData['PROCESS'];
|
||||
$_SESSION['TASK'] = $_POST['form']['TAS_UID'];
|
||||
$_SESSION['STEP_POSITION'] = 0;
|
||||
|
||||
$_SESSION['CASES_REFRESH'] = true;
|
||||
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
|
||||
$oCase = new Cases();
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
|
||||
|
||||
G::header('location: ' . $aNextStep['PAGE']);
|
||||
}
|
||||
catch ( Exception $e ) {
|
||||
$_SESSION['G_MESSAGE'] = $e->getMessage();
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
} catch (Exception $e) {
|
||||
$_SESSION['G_MESSAGE'] = $e->getMessage();
|
||||
$_SESSION['G_MESSAGE_TYPE'] = 'error';
|
||||
G::header('location: cases_New' );
|
||||
}
|
||||
?>
|
||||
G::header( 'location: cases_New' );
|
||||
}
|
||||
|
||||
|
||||
@@ -12,337 +12,309 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
//validate the data post
|
||||
|
||||
|
||||
try {
|
||||
|
||||
if ($_GET['APP_UID'] !== $_SESSION ['APPLICATION']) {
|
||||
throw new Exception(G::LoadTranslation('ID_INVALID_APPLICATION_ID_MSG', array('<a href=\''.$_SERVER['HTTP_REFERER'].'\'>{1}</a>', G::LoadTranslation('ID_REOPEN'))));
|
||||
}
|
||||
if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {
|
||||
throw new Exception( G::LoadTranslation( 'ID_INVALID_APPLICATION_ID_MSG', array ('<a href=\'' . $_SERVER['HTTP_REFERER'] . '\'>{1}</a>',G::LoadTranslation( 'ID_REOPEN' )
|
||||
) ) );
|
||||
}
|
||||
|
||||
$oForm = new Form($_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM);
|
||||
$oForm->validatePost();
|
||||
$oForm = new Form( $_SESSION["PROCESS"] . "/" . $_GET["UID"], PATH_DYNAFORM );
|
||||
$oForm->validatePost();
|
||||
|
||||
//Includes
|
||||
G::LoadClass("case");
|
||||
//Includes
|
||||
G::LoadClass( "case" );
|
||||
|
||||
//Load the variables
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List");
|
||||
$Fields = $oCase->loadCase($_SESSION["APPLICATION"]);
|
||||
//Load the variables
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List" );
|
||||
$Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
|
||||
|
||||
$Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], G::getSystemConstants());
|
||||
$Fields["APP_DATA"] = array_merge($Fields["APP_DATA"], $_POST["form"]);
|
||||
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() );
|
||||
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], $_POST["form"] );
|
||||
|
||||
#here we must verify if is a debug session
|
||||
$trigger_debug_session = $_SESSION ['TRIGGER_DEBUG'] ['ISSET']; #here we must verify if is a debugg session
|
||||
#here we must verify if is a debug session
|
||||
$trigger_debug_session = $_SESSION['TRIGGER_DEBUG']['ISSET']; #here we must verify if is a debugg session
|
||||
|
||||
#trigger debug routines...
|
||||
|
||||
#trigger debug routines...
|
||||
//cleaning debug variables
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
|
||||
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER' );
|
||||
|
||||
//cleaning debug variables
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['ERRORS'] = Array ();
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['DATA'] = Array ();
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_NAMES'] = Array ();
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_VALUES'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
|
||||
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
|
||||
$triggers = $oCase->loadTriggers ( $_SESSION ['TASK'], 'DYNAFORM', $_GET ['UID'], 'AFTER' );
|
||||
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
|
||||
//Execute after triggers - Start
|
||||
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'DYNAFORM', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
|
||||
//Execute after triggers - End
|
||||
}
|
||||
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] = count ( $triggers );
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['TIME'] = 'AFTER';
|
||||
if ($_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] != 0) {
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_NAMES'] = $oCase->getTriggerNames ( $triggers );
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
|
||||
if ($_SESSION ['TRIGGER_DEBUG'] ['NUM_TRIGGERS'] != 0) {
|
||||
//Execute after triggers - Start
|
||||
$Fields ['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION ['TASK'], 'DYNAFORM', $_GET ['UID'], 'AFTER', $Fields ['APP_DATA'] );
|
||||
//Execute after triggers - End
|
||||
}
|
||||
|
||||
//save data in PM Tables if necessary
|
||||
$newValues = array ();
|
||||
foreach ( $_POST ['form'] as $sField => $sAux ) {
|
||||
if (isset ( $oForm->fields [$sField]->pmconnection ) && isset ( $oForm->fields [$sField]->pmfield )) {
|
||||
if (($oForm->fields [$sField]->pmconnection != '') && ($oForm->fields [$sField]->pmfield != '')) {
|
||||
if (isset ( $oForm->fields [$oForm->fields [$sField]->pmconnection] )) {
|
||||
require_once PATH_CORE . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'AdditionalTables.php';
|
||||
$oAdditionalTables = new AdditionalTables ( );
|
||||
try {
|
||||
$aData = $oAdditionalTables->load ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, true );
|
||||
} catch ( Exception $oError ) {
|
||||
$aData = array ('FIELDS' => array () );
|
||||
}
|
||||
$aKeys = array ();
|
||||
$aAux = explode ( '|', $oForm->fields [$oForm->fields [$sField]->pmconnection]->keys );
|
||||
$i = 0;
|
||||
$aValues = array ();
|
||||
foreach ( $aData ['FIELDS'] as $aField ) {
|
||||
if ($aField ['FLD_KEY'] == '1') {
|
||||
$aKeys [$aField ['FLD_NAME']] = (isset ( $aAux [$i] ) ? G::replaceDataField ( $aAux [$i], $Fields ['APP_DATA'] ) : '');
|
||||
$i ++;
|
||||
}
|
||||
if ($aField ['FLD_NAME'] == $oForm->fields [$sField]->pmfield) {
|
||||
$aValues [$aField ['FLD_NAME']] = $Fields ['APP_DATA'] [$sField];
|
||||
} else {
|
||||
$aValues [$aField ['FLD_NAME']] = '';
|
||||
}
|
||||
}
|
||||
try {
|
||||
$aRow = $oAdditionalTables->getDataTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aKeys );
|
||||
} catch ( Exception $oError ) {
|
||||
$aRow = false;
|
||||
}
|
||||
if ($aRow) {
|
||||
foreach ( $aValues as $sKey => $sValue ) {
|
||||
if ($sKey != $oForm->fields [$sField]->pmfield) {
|
||||
$aValues [$sKey] = $aRow [$sKey];
|
||||
}
|
||||
}
|
||||
try {
|
||||
$oAdditionalTables->updateDataInTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aValues );
|
||||
} catch ( Exception $oError ) {
|
||||
//Nothing
|
||||
}
|
||||
}
|
||||
else {
|
||||
try {
|
||||
// assembling the field list in order to save the data ina new record of a pm table
|
||||
if (empty($newValues)){
|
||||
$newValues = $aValues;
|
||||
}
|
||||
else {
|
||||
foreach ($aValues as $aValueKey=>$aValueCont) {
|
||||
if (trim($newValues[$aValueKey])==''){
|
||||
$newValues[$aValueKey] = $aValueCont;
|
||||
}
|
||||
//save data in PM Tables if necessary
|
||||
$newValues = array ();
|
||||
foreach ($_POST['form'] as $sField => $sAux) {
|
||||
if (isset( $oForm->fields[$sField]->pmconnection ) && isset( $oForm->fields[$sField]->pmfield )) {
|
||||
if (($oForm->fields[$sField]->pmconnection != '') && ($oForm->fields[$sField]->pmfield != '')) {
|
||||
if (isset( $oForm->fields[$oForm->fields[$sField]->pmconnection] )) {
|
||||
require_once PATH_CORE . 'classes' . PATH_SEP . 'model' . PATH_SEP . 'AdditionalTables.php';
|
||||
$oAdditionalTables = new AdditionalTables();
|
||||
try {
|
||||
$aData = $oAdditionalTables->load( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, true );
|
||||
} catch (Exception $oError) {
|
||||
$aData = array ('FIELDS' => array ()
|
||||
);
|
||||
}
|
||||
$aKeys = array ();
|
||||
$aAux = explode( '|', $oForm->fields[$oForm->fields[$sField]->pmconnection]->keys );
|
||||
$i = 0;
|
||||
$aValues = array ();
|
||||
foreach ($aData['FIELDS'] as $aField) {
|
||||
if ($aField['FLD_KEY'] == '1') {
|
||||
$aKeys[$aField['FLD_NAME']] = (isset( $aAux[$i] ) ? G::replaceDataField( $aAux[$i], $Fields['APP_DATA'] ) : '');
|
||||
$i ++;
|
||||
}
|
||||
if ($aField['FLD_NAME'] == $oForm->fields[$sField]->pmfield) {
|
||||
$aValues[$aField['FLD_NAME']] = $Fields['APP_DATA'][$sField];
|
||||
} else {
|
||||
$aValues[$aField['FLD_NAME']] = '';
|
||||
}
|
||||
}
|
||||
try {
|
||||
$aRow = $oAdditionalTables->getDataTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aKeys );
|
||||
} catch (Exception $oError) {
|
||||
$aRow = false;
|
||||
}
|
||||
if ($aRow) {
|
||||
foreach ($aValues as $sKey => $sValue) {
|
||||
if ($sKey != $oForm->fields[$sField]->pmfield) {
|
||||
$aValues[$sKey] = $aRow[$sKey];
|
||||
}
|
||||
}
|
||||
try {
|
||||
$oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$sField]->pmconnection]->pmtable, $aValues );
|
||||
} catch (Exception $oError) {
|
||||
//Nothing
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
// assembling the field list in order to save the data ina new record of a pm table
|
||||
if (empty( $newValues )) {
|
||||
$newValues = $aValues;
|
||||
} else {
|
||||
foreach ($aValues as $aValueKey => $aValueCont) {
|
||||
if (trim( $newValues[$aValueKey] ) == '') {
|
||||
$newValues[$aValueKey] = $aValueCont;
|
||||
}
|
||||
}
|
||||
}
|
||||
//$oAdditionalTables->saveDataInTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aValues );
|
||||
} catch (Exception $oError) {
|
||||
//Nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//$oAdditionalTables->saveDataInTable ( $oForm->fields [$oForm->fields [$sField]->pmconnection]->pmtable, $aValues );
|
||||
} catch ( Exception $oError ) {
|
||||
//Nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//save data
|
||||
$aData = array ();
|
||||
$aData ['APP_NUMBER'] = $Fields ['APP_NUMBER'];
|
||||
$aData ['APP_PROC_STATUS'] = $Fields ['APP_PROC_STATUS'];
|
||||
$aData ['APP_DATA'] = $Fields ['APP_DATA'];
|
||||
$aData ['DEL_INDEX'] = $_SESSION ['INDEX'];
|
||||
$aData ['TAS_UID'] = $_SESSION ['TASK'];
|
||||
$aData ['CURRENT_DYNAFORM'] = $_GET ['UID'];
|
||||
$aData ['USER_UID'] = $_SESSION ['USER_LOGGED'];
|
||||
$aData ['APP_STATUS'] = $Fields ['APP_STATUS'];
|
||||
$aData ['PRO_UID'] = $_SESSION ['PROCESS'];
|
||||
//save data
|
||||
$aData = array ();
|
||||
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
|
||||
$aData['APP_DATA'] = $Fields['APP_DATA'];
|
||||
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$aData['TAS_UID'] = $_SESSION['TASK'];
|
||||
$aData['CURRENT_DYNAFORM'] = $_GET['UID'];
|
||||
$aData['USER_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_STATUS'] = $Fields['APP_STATUS'];
|
||||
$aData['PRO_UID'] = $_SESSION['PROCESS'];
|
||||
|
||||
$oCase->updateCase ( $_SESSION ['APPLICATION'], $aData );
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
|
||||
|
||||
// saving the data ina pm table in case that is a new record
|
||||
if (!empty($newValues)) {
|
||||
$id = key($newValues);
|
||||
if (! $oAdditionalTables->updateDataInTable( $oForm->fields [$oForm->fields[$id]->pmconnection]->pmtable, $newValues) ) {//<--This is to know if it is a new registry on the PM Table
|
||||
$oAdditionalTables->saveDataInTable( $oForm->fields [$oForm->fields[$id]->pmconnection]->pmtable, $newValues);
|
||||
// saving the data ina pm table in case that is a new record
|
||||
if (! empty( $newValues )) {
|
||||
$id = key( $newValues );
|
||||
if (! $oAdditionalTables->updateDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues )) { //<--This is to know if it is a new registry on the PM Table
|
||||
$oAdditionalTables->saveDataInTable( $oForm->fields[$oForm->fields[$id]->pmconnection]->pmtable, $newValues );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Save files
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
//Save files
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
|
||||
if (isset($_FILES["form"]["name"]) && count($_FILES["form"]["name"]) > 0) {
|
||||
$arrayField = array();
|
||||
$arrayFileName = array();
|
||||
$arrayFileTmpName = array();
|
||||
$arrayFileError = array();
|
||||
$i = 0;
|
||||
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
$arrayField = array ();
|
||||
$arrayFileName = array ();
|
||||
$arrayFileTmpName = array ();
|
||||
$arrayFileError = array ();
|
||||
$i = 0;
|
||||
|
||||
foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
|
||||
if (is_array($fieldValue)) {
|
||||
foreach ($fieldValue as $index => $value) {
|
||||
if (is_array($value)) {
|
||||
foreach ($value as $grdFieldIndex => $grdFieldValue) {
|
||||
$arrayField[$i]["grdName"] = $fieldIndex;
|
||||
$arrayField[$i]["grdFieldName"] = $grdFieldIndex;
|
||||
$arrayField[$i]["index"] = $index;
|
||||
foreach ($_FILES["form"]["name"] as $fieldIndex => $fieldValue) {
|
||||
if (is_array( $fieldValue )) {
|
||||
foreach ($fieldValue as $index => $value) {
|
||||
if (is_array( $value )) {
|
||||
foreach ($value as $grdFieldIndex => $grdFieldValue) {
|
||||
$arrayField[$i]["grdName"] = $fieldIndex;
|
||||
$arrayField[$i]["grdFieldName"] = $grdFieldIndex;
|
||||
$arrayField[$i]["index"] = $index;
|
||||
|
||||
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$i = $i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$arrayField[$i] = $fieldIndex;
|
||||
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex][$index][$grdFieldIndex];
|
||||
$i = $i + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$arrayField[$i] = $fieldIndex;
|
||||
|
||||
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
|
||||
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
|
||||
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
|
||||
$i = $i + 1;
|
||||
}
|
||||
}
|
||||
$arrayFileName[$i] = $_FILES["form"]["name"][$fieldIndex];
|
||||
$arrayFileTmpName[$i] = $_FILES["form"]["tmp_name"][$fieldIndex];
|
||||
$arrayFileError[$i] = $_FILES["form"]["error"][$fieldIndex];
|
||||
$i = $i + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (count($arrayField) > 0) {
|
||||
for ($i = 0; $i <= count($arrayField) - 1; $i++) {
|
||||
if ($arrayFileError[$i] == 0) {
|
||||
$indocUid = null;
|
||||
$fieldName = null;
|
||||
if (count( $arrayField ) > 0) {
|
||||
for ($i = 0; $i <= count( $arrayField ) - 1; $i ++) {
|
||||
if ($arrayFileError[$i] == 0) {
|
||||
$indocUid = null;
|
||||
$fieldName = null;
|
||||
|
||||
if (is_array($arrayField[$i])) {
|
||||
if (isset($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]]) &&
|
||||
!empty($_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]])
|
||||
) {
|
||||
$indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
|
||||
}
|
||||
if (is_array( $arrayField[$i] )) {
|
||||
if (isset( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]] )) {
|
||||
$indocUid = $_POST["INPUTS"][$arrayField[$i]["grdName"]][$arrayField[$i]["grdFieldName"]];
|
||||
}
|
||||
|
||||
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
|
||||
} else {
|
||||
if (isset($_POST["INPUTS"][$arrayField[$i]]) &&
|
||||
!empty($_POST["INPUTS"][$arrayField[$i]])
|
||||
) {
|
||||
$indocUid = $_POST["INPUTS"][$arrayField[$i]];
|
||||
}
|
||||
$fieldName = $arrayField[$i]["grdName"] . "_" . $arrayField[$i]["index"] . "_" . $arrayField[$i]["grdFieldName"];
|
||||
} else {
|
||||
if (isset( $_POST["INPUTS"][$arrayField[$i]] ) && ! empty( $_POST["INPUTS"][$arrayField[$i]] )) {
|
||||
$indocUid = $_POST["INPUTS"][$arrayField[$i]];
|
||||
}
|
||||
|
||||
$fieldName = $arrayField[$i];
|
||||
}
|
||||
$fieldName = $arrayField[$i];
|
||||
}
|
||||
|
||||
if ($indocUid != null) {
|
||||
require_once ("classes/model/AppFolder.php");
|
||||
require_once ("classes/model/InputDocument.php");
|
||||
if ($indocUid != null) {
|
||||
require_once ("classes/model/AppFolder.php");
|
||||
require_once ("classes/model/InputDocument.php");
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load($indocUid);
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load( $indocUid );
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder = new AppFolder();
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder = new AppFolder();
|
||||
|
||||
$aFields = array (
|
||||
"APP_UID" => $_SESSION["APPLICATION"],
|
||||
"DEL_INDEX" => $_SESSION["INDEX"],
|
||||
"USR_UID" => $_SESSION["USER_LOGGED"],
|
||||
"DOC_UID" => $indocUid,
|
||||
"APP_DOC_TYPE" => "INPUT",
|
||||
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
|
||||
"APP_DOC_COMMENT" => "",
|
||||
"APP_DOC_TITLE" => "",
|
||||
"APP_DOC_FILENAME" => $arrayFileName[$i],
|
||||
"FOLDER_UID" => $oFolder->createFromPath($aID["INP_DOC_DESTINATION_PATH"]),
|
||||
"APP_DOC_TAGS" => $oFolder->parseTags($aID["INP_DOC_TAGS"]),
|
||||
"APP_DOC_FIELDNAME" => $fieldName
|
||||
);
|
||||
} else {
|
||||
$aFields = array (
|
||||
"APP_UID" => $_SESSION["APPLICATION"],
|
||||
"DEL_INDEX" => $_SESSION["INDEX"],
|
||||
"USR_UID" => $_SESSION["USER_LOGGED"],
|
||||
"DOC_UID" => -1,
|
||||
"APP_DOC_TYPE" => "ATTACHED",
|
||||
"APP_DOC_CREATE_DATE" => date("Y-m-d H:i:s"),
|
||||
"APP_DOC_COMMENT" => "",
|
||||
"APP_DOC_TITLE" => "",
|
||||
"APP_DOC_FILENAME" => $arrayFileName[$i],
|
||||
"APP_DOC_FIELDNAME" => $fieldName
|
||||
);
|
||||
}
|
||||
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => $indocUid,"APP_DOC_TYPE" => "INPUT","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"FOLDER_UID" => $oFolder->createFromPath( $aID["INP_DOC_DESTINATION_PATH"] ),"APP_DOC_TAGS" => $oFolder->parseTags( $aID["INP_DOC_TAGS"] ),"APP_DOC_FIELDNAME" => $fieldName
|
||||
);
|
||||
} else {
|
||||
$aFields = array ("APP_UID" => $_SESSION["APPLICATION"],"DEL_INDEX" => $_SESSION["INDEX"],"USR_UID" => $_SESSION["USER_LOGGED"],"DOC_UID" => - 1,"APP_DOC_TYPE" => "ATTACHED","APP_DOC_CREATE_DATE" => date( "Y-m-d H:i:s" ),"APP_DOC_COMMENT" => "","APP_DOC_TITLE" => "","APP_DOC_FILENAME" => $arrayFileName[$i],"APP_DOC_FIELDNAME" => $fieldName
|
||||
);
|
||||
}
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->create($aFields);
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->create( $aFields );
|
||||
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$aInfo = pathinfo($oAppDocument->getAppDocFilename());
|
||||
$sExtension = ((isset($aInfo["extension"]))? $aInfo["extension"] : "");
|
||||
$sPathName = PATH_DOCUMENT . $_SESSION ["APPLICATION"] . PATH_SEP;
|
||||
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$aInfo = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$sExtension = ((isset( $aInfo["extension"] )) ? $aInfo["extension"] : "");
|
||||
$sPathName = PATH_DOCUMENT . $_SESSION["APPLICATION"] . PATH_SEP;
|
||||
$sFileName = $sAppDocUid . "_" . $iDocVersion . "." . $sExtension;
|
||||
|
||||
G::uploadFile($arrayFileTmpName[$i], $sPathName, $sFileName);
|
||||
G::uploadFile( $arrayFileTmpName[$i], $sPathName, $sFileName );
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = &PMPluginRegistry::getSingleton();
|
||||
|
||||
if ($oPluginRegistry->existsTrigger(PM_UPLOAD_DOCUMENT) && class_exists("uploadDocumentData")) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo(PM_UPLOAD_DOCUMENT);
|
||||
$documentData = new uploadDocumentData($_SESSION["APPLICATION"], $_SESSION["USER_LOGGED"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion);
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers(PM_UPLOAD_DOCUMENT, $documentData);
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( "uploadDocumentData" )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
$documentData = new uploadDocumentData( $_SESSION["APPLICATION"], $_SESSION["USER_LOGGED"], $sPathName . $sFileName, $aFields["APP_DOC_FILENAME"], $sAppDocUid, $iDocVersion );
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
|
||||
|
||||
if ($uploadReturn) {
|
||||
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
|
||||
if ($uploadReturn) {
|
||||
$aFields["APP_DOC_PLUGIN"] = $triggerDetail->sNamespace;
|
||||
|
||||
if (!isset($aFields["APP_DOC_UID"])) {
|
||||
$aFields["APP_DOC_UID"] = $sAppDocUid;
|
||||
}
|
||||
if (! isset( $aFields["APP_DOC_UID"] )) {
|
||||
$aFields["APP_DOC_UID"] = $sAppDocUid;
|
||||
}
|
||||
|
||||
if (!isset($aFields["DOC_VERSION"])) {
|
||||
$aFields["DOC_VERSION"] = $iDocVersion;
|
||||
}
|
||||
if (! isset( $aFields["DOC_VERSION"] )) {
|
||||
$aFields["DOC_VERSION"] = $iDocVersion;
|
||||
}
|
||||
|
||||
$oAppDocument->update($aFields);
|
||||
$oAppDocument->update( $aFields );
|
||||
|
||||
unlink($sPathName . $sFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
unlink( $sPathName . $sFileName );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Go to the next step
|
||||
$aNextStep = $oCase->getNextStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] );
|
||||
if (isset ( $_GET ['_REFRESH_'] )) {
|
||||
G::header ( 'location: ' . $_SERVER ['HTTP_REFERER'] );
|
||||
die ();
|
||||
}
|
||||
//Go to the next step
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
if (isset( $_GET['_REFRESH_'] )) {
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
die();
|
||||
}
|
||||
|
||||
$_SESSION ['STEP_POSITION'] = $aNextStep ['POSITION'];
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep ['PAGE'];
|
||||
$debuggerAvailable = true;
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
|
||||
$debuggerAvailable = true;
|
||||
|
||||
if (isset($_SESSION['current_ux']) && $_SESSION['current_ux'] == 'SIMPLIFIED') {
|
||||
$debuggerAvailable = false;
|
||||
}
|
||||
if (isset( $_SESSION['current_ux'] ) && $_SESSION['current_ux'] == 'SIMPLIFIED') {
|
||||
$debuggerAvailable = false;
|
||||
}
|
||||
|
||||
if ($trigger_debug_session && $debuggerAvailable) {
|
||||
$_SESSION ['TRIGGER_DEBUG'] ['BREAKPAGE'] = $aNextStep ['PAGE'];
|
||||
$aNextStep ['PAGE'] = $aNextStep ['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
if ($trigger_debug_session && $debuggerAvailable) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
|
||||
}
|
||||
|
||||
$oForm->validatePost ();
|
||||
$oJSON = new Services_JSON ( );
|
||||
$_POST ['__notValidateThisFields__'] = (isset($_POST ['__notValidateThisFields__']) && $_POST ['__notValidateThisFields__']!='')?$_POST ['__notValidateThisFields__']:$_POST ['DynaformRequiredFields'];
|
||||
if ($missing_req_values = $oForm->validateRequiredFields ( $_POST ['form'], $oJSON->decode ( stripslashes ( $_POST ['__notValidateThisFields__'] ) ) )) {
|
||||
$_POST ['next_step'] = $aNextStep;
|
||||
$_POST ['previous_step'] = $oCase->getPreviousStep ( $_SESSION ['PROCESS'], $_SESSION ['APPLICATION'], $_SESSION ['INDEX'], $_SESSION ['STEP_POSITION'] );
|
||||
$_POST ['req_val'] = $missing_req_values;
|
||||
$G_PUBLISH = new Publisher ( );
|
||||
$G_PUBLISH->AddContent ( 'view', 'cases/missRequiredFields' );
|
||||
G::RenderPage ( 'publish', 'blank' );
|
||||
exit ( 0 );
|
||||
}
|
||||
$oForm->validatePost();
|
||||
$oJSON = new Services_JSON();
|
||||
$_POST['__notValidateThisFields__'] = (isset( $_POST['__notValidateThisFields__'] ) && $_POST['__notValidateThisFields__'] != '') ? $_POST['__notValidateThisFields__'] : $_POST['DynaformRequiredFields'];
|
||||
if ($missing_req_values = $oForm->validateRequiredFields( $_POST['form'], $oJSON->decode( stripslashes( $_POST['__notValidateThisFields__'] ) ) )) {
|
||||
$_POST['next_step'] = $aNextStep;
|
||||
$_POST['previous_step'] = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$_POST['req_val'] = $missing_req_values;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/missRequiredFields' );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
exit( 0 );
|
||||
}
|
||||
|
||||
G::header ( 'location: ' . $aNextStep ['PAGE'] );
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
|
||||
} catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher();
|
||||
$aMessage = array ();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
die();
|
||||
}
|
||||
catch (Exception $e) {
|
||||
$G_PUBLISH = new Publisher;
|
||||
$aMessage = array();
|
||||
$aMessage['MESSAGE'] = $e->getMessage();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
die;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,46 +12,44 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
//validate the data post
|
||||
$oForm = new Form($_SESSION['PROCESS']. '/' . $_GET['UID'], PATH_DYNAFORM);
|
||||
$oForm->validatePost();
|
||||
//validate the data post
|
||||
$oForm = new Form( $_SESSION['PROCESS'] . '/' . $_GET['UID'], PATH_DYNAFORM );
|
||||
$oForm->validatePost();
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass('case');
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
//load the variables
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], $_POST['form']);
|
||||
//load the variables
|
||||
$oCase = new Cases();
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], $_POST['form'] );
|
||||
|
||||
//save data
|
||||
$aData = array();
|
||||
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
|
||||
$aData['APP_DATA'] = $Fields['APP_DATA'];
|
||||
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$aData['TAS_UID'] = $_SESSION['TASK'];
|
||||
$aData['CURRENT_DYNAFORM'] = $_GET['UID'];
|
||||
$aData['PRO_UID'] = $Fields['PRO_UID'];
|
||||
$aData['USER_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_STATUS'] = $Fields['APP_STATUS'];
|
||||
//save data
|
||||
$aData = array ();
|
||||
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
|
||||
$aData['APP_DATA'] = $Fields['APP_DATA'];
|
||||
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$aData['TAS_UID'] = $_SESSION['TASK'];
|
||||
$aData['CURRENT_DYNAFORM'] = $_GET['UID'];
|
||||
$aData['PRO_UID'] = $Fields['PRO_UID'];
|
||||
$aData['USER_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$aData['APP_STATUS'] = $Fields['APP_STATUS'];
|
||||
|
||||
//$aData = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
|
||||
|
||||
//go to the next step
|
||||
$aNextStep = $oCase->getNextSupervisorStep($_SESSION['PROCESS'], $_SESSION['STEP_POSITION']);
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
G::header('location: cases_StepToRevise?DYN_UID='.$aNextStep['UID'].'&APP_UID='.$_SESSION['APPLICATION'].'&DEL_INDEX='.$_SESSION['INDEX']);
|
||||
//$aData = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
|
||||
|
||||
//go to the next step
|
||||
$aNextStep = $oCase->getNextSupervisorStep( $_SESSION['PROCESS'], $_SESSION['STEP_POSITION'] );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
G::header( 'location: cases_StepToRevise?DYN_UID=' . $aNextStep['UID'] . '&APP_UID=' . $_SESSION['APPLICATION'] . '&DEL_INDEX=' . $_SESSION['INDEX'] );
|
||||
|
||||
@@ -12,281 +12,234 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*
|
||||
*/
|
||||
//try {
|
||||
//try {
|
||||
|
||||
//First review if there is no error with the uploaded document
|
||||
if ((isset($_FILES['form']))&&($_FILES['form']['error']['APP_DOC_FILENAME'] != 0)) {
|
||||
$code=$_FILES['form']['error']['APP_DOC_FILENAME'];
|
||||
switch ($code) {
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_INI_SIZE');
|
||||
break;
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_FORM_SIZE');
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_PARTIAL');
|
||||
break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_NO_FILE');
|
||||
break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_NO_TMP_DIR');
|
||||
break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_CANT_WRITE');
|
||||
break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_EXTENSION');
|
||||
break;
|
||||
|
||||
default:
|
||||
$message = G::LoadTranslation('ID_UPLOAD_ERR_UNKNOWN');
|
||||
break;
|
||||
}
|
||||
G::SendMessageText($message, "ERROR");
|
||||
$backUrlObj=explode("sys".SYS_SYS,$_SERVER['HTTP_REFERER']);
|
||||
G::header("location: "."/sys".SYS_SYS.$backUrlObj[1]);
|
||||
die;
|
||||
//First review if there is no error with the uploaded document
|
||||
if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME'] != 0)) {
|
||||
$code = $_FILES['form']['error']['APP_DOC_FILENAME'];
|
||||
switch ($code) {
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_INI_SIZE' );
|
||||
break;
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_FORM_SIZE' );
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_PARTIAL' );
|
||||
break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_NO_FILE' );
|
||||
break;
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_NO_TMP_DIR' );
|
||||
break;
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_CANT_WRITE' );
|
||||
break;
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_EXTENSION' );
|
||||
break;
|
||||
|
||||
default:
|
||||
$message = G::LoadTranslation( 'ID_UPLOAD_ERR_UNKNOWN' );
|
||||
break;
|
||||
}
|
||||
G::SendMessageText( $message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
$docUid = $_POST['form']['DOC_UID'];
|
||||
$appDocUid = $_POST['form']['APP_DOC_UID'];
|
||||
$docVersion = $_POST['form']['docVersion'];
|
||||
$actionType = $_POST['form']['actionType'];
|
||||
|
||||
//load the variables
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||
|
||||
#trigger debug routines...
|
||||
|
||||
|
||||
$docUid=$_POST['form']['DOC_UID'];
|
||||
$appDocUid=$_POST['form']['APP_DOC_UID'];
|
||||
$docVersion=$_POST['form']['docVersion'];
|
||||
$actionType=$_POST['form']['actionType'];
|
||||
//cleaning debug variables
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array ();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array ();
|
||||
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER' );
|
||||
|
||||
//load the variables
|
||||
G::LoadClass('case');
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
||||
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
|
||||
$Fields['APP_DATA'] = array_merge($Fields['APP_DATA'], G::getSystemConstants());
|
||||
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
|
||||
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames( $triggers );
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
|
||||
#trigger debug routines...
|
||||
|
||||
//cleaning debug variables
|
||||
$_SESSION['TRIGGER_DEBUG']['ERRORS'] = Array();
|
||||
$_SESSION['TRIGGER_DEBUG']['DATA'] = Array();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = Array();
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = Array();
|
||||
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER');
|
||||
|
||||
$_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] = count($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['TIME'] = 'AFTER';
|
||||
if($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0){
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_NAMES'] = $oCase->getTriggerNames($triggers);
|
||||
$_SESSION['TRIGGER_DEBUG']['TRIGGERS_VALUES'] = $triggers;
|
||||
}
|
||||
|
||||
if( $_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0 ) {
|
||||
//Execute after triggers - Start
|
||||
$Fields['APP_DATA'] = $oCase->ExecuteTriggers ( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
|
||||
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
|
||||
//Execute after triggers - Start
|
||||
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
|
||||
//Execute after triggers - End
|
||||
}
|
||||
}
|
||||
|
||||
//save data
|
||||
$aData = array ();
|
||||
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
|
||||
$aData['APP_DATA'] = $Fields['APP_DATA'];
|
||||
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$aData['TAS_UID'] = $_SESSION['TASK'];
|
||||
//$aData = $oCase->loadCase($_SESSION['APPLICATION']);
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
|
||||
|
||||
//save info
|
||||
|
||||
|
||||
//save data
|
||||
$aData = array();
|
||||
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
|
||||
$aData['APP_DATA'] = $Fields['APP_DATA'];
|
||||
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$aData['TAS_UID'] = $_SESSION['TASK'];
|
||||
//$aData = $oCase->loadCase($_SESSION['APPLICATION']);
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
require_once ('classes/model/AppFolder.php');
|
||||
require_once ('classes/model/InputDocument.php');
|
||||
|
||||
//save info
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load( $_GET['UID'] );
|
||||
|
||||
require_once ( "classes/model/AppDocument.php" );
|
||||
require_once ('classes/model/AppFolder.php');
|
||||
require_once ('classes/model/InputDocument.php');
|
||||
$oAppDocument = new AppDocument();
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load($_GET['UID']);
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder = new AppFolder();
|
||||
$folderId = $oFolder->createFromPath( $aID['INP_DOC_DESTINATION_PATH'] );
|
||||
|
||||
//Tags
|
||||
$fileTags = $oFolder->parseTags( $aID['INP_DOC_TAGS'] );
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
switch ($actionType) {
|
||||
case "R": //replace
|
||||
$aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DOC_VERSION' => $docVersion,'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
||||
);
|
||||
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder=new AppFolder();
|
||||
$folderId=$oFolder->createFromPath($aID['INP_DOC_DESTINATION_PATH']);
|
||||
|
||||
//Tags
|
||||
$fileTags=$oFolder->parseTags($aID['INP_DOC_TAGS']);
|
||||
|
||||
switch($actionType){
|
||||
case "R": //replace
|
||||
$aFields = array('APP_DOC_UID' => $appDocUid,
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DOC_VERSION' => $docVersion,
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
'USR_UID' => $_SESSION['USER_LOGGED'],
|
||||
'DOC_UID' => $docUid,
|
||||
'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],
|
||||
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
||||
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '',
|
||||
'APP_DOC_TITLE' => '',
|
||||
'APP_DOC_FILENAME' => isset($_FILES['form']['name']['APP_DOC_FILENAME']) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '',
|
||||
'FOLDER_UID' => $folderId,
|
||||
'APP_DOC_TAGS' => $fileTags);
|
||||
|
||||
|
||||
$oAppDocument->update($aFields);
|
||||
$oAppDocument->update( $aFields );
|
||||
break;
|
||||
case "NV": //New Version
|
||||
case "NV": //New Version
|
||||
|
||||
|
||||
$aFields = array('APP_DOC_UID' => $appDocUid,
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
'USR_UID' => $_SESSION['USER_LOGGED'],
|
||||
'DOC_UID' => $docUid,
|
||||
'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],
|
||||
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
||||
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '',
|
||||
'APP_DOC_TITLE' => '',
|
||||
'APP_DOC_FILENAME' => isset($_FILES['form']['name']['APP_DOC_FILENAME']) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '',
|
||||
'FOLDER_UID' => $folderId,
|
||||
'APP_DOC_TAGS' => $fileTags);
|
||||
$aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
||||
);
|
||||
|
||||
$oAppDocument->create($aFields);
|
||||
$oAppDocument->create( $aFields );
|
||||
break;
|
||||
default: //New
|
||||
$aFields = array(
|
||||
'APP_UID' => $_SESSION['APPLICATION'],
|
||||
'DEL_INDEX' => $_SESSION['INDEX'],
|
||||
'USR_UID' => $_SESSION['USER_LOGGED'],
|
||||
'DOC_UID' => $docUid,
|
||||
'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],
|
||||
'APP_DOC_CREATE_DATE' => date('Y-m-d H:i:s'),
|
||||
'APP_DOC_COMMENT' => isset($_POST['form']['APP_DOC_COMMENT']) ? $_POST['form']['APP_DOC_COMMENT'] : '',
|
||||
'APP_DOC_TITLE' => '',
|
||||
'APP_DOC_FILENAME' => isset($_FILES['form']['name']['APP_DOC_FILENAME']) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '',
|
||||
'FOLDER_UID' => $folderId,
|
||||
'APP_DOC_TAGS' => $fileTags);
|
||||
default: //New
|
||||
$aFields = array ('APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
||||
);
|
||||
|
||||
|
||||
$oAppDocument->create($aFields);
|
||||
$oAppDocument->create( $aFields );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$ext = (isset( $info['extension'] ) ? $info['extension'] : '');
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$ext = (isset($info['extension']) ? $info['extension'] : '');
|
||||
|
||||
//save the file
|
||||
if (!empty($_FILES['form'])) {
|
||||
if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
|
||||
//save the file
|
||||
if (! empty( $_FILES['form'] )) {
|
||||
if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
|
||||
$sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP;
|
||||
$sFileName = $sAppDocUid . "_".$iDocVersion. '.' . $ext;
|
||||
G::uploadFile($_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
|
||||
$sFileName = $sAppDocUid . "_" . $iDocVersion . '.' . $ext;
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
if ( $oPluginRegistry->existsTrigger ( PM_UPLOAD_DOCUMENT ) && class_exists ('uploadDocumentData' ) ) {
|
||||
$triggerDetail=$oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
$oData['APP_UID'] = $_SESSION['APPLICATION'];
|
||||
$documentData = new uploadDocumentData (
|
||||
$_SESSION['APPLICATION'],
|
||||
$_SESSION['USER_LOGGED'],
|
||||
$sPathName . $sFileName,
|
||||
$aFields['APP_DOC_FILENAME'],
|
||||
$sAppDocUid,
|
||||
$iDocVersion
|
||||
);
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
$oData['APP_UID'] = $_SESSION['APPLICATION'];
|
||||
$documentData = new uploadDocumentData( $_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid, $iDocVersion );
|
||||
|
||||
$uploadReturn=$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT , $documentData );
|
||||
if($uploadReturn){
|
||||
$aFields['APP_DOC_PLUGIN']=$triggerDetail->sNamespace;
|
||||
if(!isset($aFields['APP_DOC_UID'])){
|
||||
$aFields['APP_DOC_UID']=$sAppDocUid;
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
|
||||
if ($uploadReturn) {
|
||||
$aFields['APP_DOC_PLUGIN'] = $triggerDetail->sNamespace;
|
||||
if (! isset( $aFields['APP_DOC_UID'] )) {
|
||||
$aFields['APP_DOC_UID'] = $sAppDocUid;
|
||||
}
|
||||
if (! isset( $aFields['DOC_VERSION'] )) {
|
||||
$aFields['DOC_VERSION'] = $iDocVersion;
|
||||
}
|
||||
//$oAppDocument1 = new AppDocument();
|
||||
//G::pr($aFields);die;
|
||||
$oAppDocument->update( $aFields );
|
||||
unlink( $sPathName . $sFileName );
|
||||
}
|
||||
if(!isset($aFields['DOC_VERSION'])){
|
||||
$aFields['DOC_VERSION']=$iDocVersion;
|
||||
}
|
||||
//$oAppDocument1 = new AppDocument();
|
||||
//G::pr($aFields);die;
|
||||
$oAppDocument->update($aFields);
|
||||
unlink ( $sPathName . $sFileName );
|
||||
}
|
||||
}
|
||||
//end plugin
|
||||
}
|
||||
//end plugin
|
||||
}
|
||||
}
|
||||
|
||||
//go to the next step
|
||||
//if (!isset($_POST['form']['MORE'])) {
|
||||
if (false) {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] . '&breakpoint=triggerdebug' );
|
||||
die();
|
||||
}
|
||||
|
||||
//go to the next step
|
||||
//if (!isset($_POST['form']['MORE'])) {
|
||||
if (false) {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION']);
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
die();
|
||||
} else {
|
||||
if (isset( $_SERVER['HTTP_REFERER'] )) {
|
||||
if ($_SERVER['HTTP_REFERER'] != '') {
|
||||
|
||||
if($_SESSION['TRIGGER_DEBUG']['ISSET']){
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
G::header('location: ' . $aNextStep['PAGE'].'&breakpoint=triggerdebug');
|
||||
die;
|
||||
}
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $_SERVER['HTTP_REFERER'];
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] . '&breakpoint=triggerdebug' );
|
||||
die();
|
||||
}
|
||||
|
||||
G::header('location: ' . $aNextStep['PAGE']);
|
||||
die;
|
||||
}
|
||||
else {
|
||||
if (isset($_SERVER['HTTP_REFERER'])) {
|
||||
if ($_SERVER['HTTP_REFERER'] != '') {
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
die();
|
||||
} else {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
if($_SESSION['TRIGGER_DEBUG']['ISSET']){
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $_SERVER['HTTP_REFERER'];
|
||||
G::header('location: ' . $_SERVER['HTTP_REFERER'].'&breakpoint=triggerdebug');
|
||||
die;
|
||||
}
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] . '&breakpoint=triggerdebug' );
|
||||
die();
|
||||
}
|
||||
|
||||
G::header('location: ' . $_SERVER['HTTP_REFERER']);
|
||||
die;
|
||||
}
|
||||
else {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1);
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
die();
|
||||
}
|
||||
} else {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
if($_SESSION['TRIGGER_DEBUG']['ISSET']){
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
G::header('location: ' . $aNextStep['PAGE'].'&breakpoint=triggerdebug');
|
||||
die;
|
||||
}
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] . '&breakpoint=triggerdebug' );
|
||||
die();
|
||||
}
|
||||
|
||||
G::header('location: ' . $aNextStep['PAGE']);
|
||||
die;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1);
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
if($_SESSION['TRIGGER_DEBUG']['ISSET']){
|
||||
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
|
||||
G::header('location: ' . $aNextStep['PAGE'].'&breakpoint=triggerdebug');
|
||||
die;
|
||||
}
|
||||
|
||||
G::header('location: ' . $aNextStep['PAGE']);
|
||||
die;
|
||||
}
|
||||
}
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
|
||||
G::header( 'location: ' . $aNextStep['PAGE'] );
|
||||
die();
|
||||
}
|
||||
}
|
||||
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep;
|
||||
/*
|
||||
} catch ( Exception $e ) {
|
||||
|
||||
@@ -295,3 +248,4 @@
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
|
||||
G::RenderPage( 'publish' );
|
||||
}*/
|
||||
|
||||
|
||||
@@ -1,71 +1,77 @@
|
||||
<?php
|
||||
|
||||
if (! isset ( $_REQUEST ['action'] )) {
|
||||
$return ['success'] = 'failure';
|
||||
$return ['message'] = 'You may request an action';
|
||||
print G::json_encode ( $return );
|
||||
die ();
|
||||
if (! isset( $_REQUEST['action'] )) {
|
||||
$return['success'] = 'failure';
|
||||
$return['message'] = 'You may request an action';
|
||||
print G::json_encode( $return );
|
||||
die();
|
||||
}
|
||||
if (! function_exists ( $_REQUEST ['action'] )) {
|
||||
$return ['success'] = 'failure';
|
||||
$return ['message'] = 'The requested action doesn\'t exists';
|
||||
print G::json_encode ( $return );
|
||||
die ();
|
||||
if (! function_exists( $_REQUEST['action'] )) {
|
||||
$return['success'] = 'failure';
|
||||
$return['message'] = 'The requested action doesn\'t exists';
|
||||
print G::json_encode( $return );
|
||||
die();
|
||||
}
|
||||
|
||||
$functionName = $_REQUEST ['action'];
|
||||
$functionName = $_REQUEST['action'];
|
||||
//var_dump($functionName);
|
||||
$functionParams = isset($_REQUEST ['params'] ) ? $_REQUEST ['params'] : array ();
|
||||
$functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
|
||||
$functionName( $functionParams );
|
||||
|
||||
$functionName ( $functionParams );
|
||||
|
||||
function searchSavedJob($schUid){
|
||||
function searchSavedJob ($schUid)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
function pluginsList(){
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins();
|
||||
$selectedPlugin="";
|
||||
if((isset($_REQUEST['plg_uid']))&&($_REQUEST['plg_uid']!="")) $selectedPlugin=$_REQUEST['plg_uid'];
|
||||
if(!empty($activePluginsForCaseScheduler)){
|
||||
echo '<select style="width: 300px;" name="form[CASE_SH_PLUGIN_UID]" id="form[CASE_SH_PLUGIN_UID]" class="module_app_input___gray" required="1" onChange="showPluginSelection(this.options[this.selectedIndex].value,getField(\'PRO_UID\').value)">';
|
||||
echo "<option value=\"\">- Select -</option>";
|
||||
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){
|
||||
$sActionId=$caseSchedulerPluginDetail->sActionId;
|
||||
$sNamespace=$caseSchedulerPluginDetail->sNamespace;
|
||||
$optionId=$sNamespace."--".$sActionId;
|
||||
$selectedOption="";
|
||||
if($selectedPlugin==$optionId) $selectedOption="selected";
|
||||
echo "<option value=\"$optionId\" $selectedOption>".$sActionId."</option>";
|
||||
}
|
||||
echo '</select>';
|
||||
//G::pr($activePlugnsForCaseScheduler);
|
||||
}
|
||||
}
|
||||
function pluginCaseSchedulerForm(){
|
||||
if(!isset($_REQUEST ['selectedOption'])) die;
|
||||
$G_PUBLISH = new Publisher;
|
||||
$params=explode("--",$_REQUEST ['selectedOption']);
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins();
|
||||
|
||||
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){
|
||||
if(($caseSchedulerPluginDetail->sNamespace==$params[0])&&($caseSchedulerPluginDetail->sActionId==$params[1])){
|
||||
$caseSchedulerSelected=$caseSchedulerPluginDetail;
|
||||
function pluginsList ()
|
||||
{
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
||||
$selectedPlugin = "";
|
||||
if ((isset( $_REQUEST['plg_uid'] )) && ($_REQUEST['plg_uid'] != ""))
|
||||
$selectedPlugin = $_REQUEST['plg_uid'];
|
||||
if (! empty( $activePluginsForCaseScheduler )) {
|
||||
echo '<select style="width: 300px;" name="form[CASE_SH_PLUGIN_UID]" id="form[CASE_SH_PLUGIN_UID]" class="module_app_input___gray" required="1" onChange="showPluginSelection(this.options[this.selectedIndex].value,getField(\'PRO_UID\').value)">';
|
||||
echo "<option value=\"\">- Select -</option>";
|
||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
||||
$sActionId = $caseSchedulerPluginDetail->sActionId;
|
||||
$sNamespace = $caseSchedulerPluginDetail->sNamespace;
|
||||
$optionId = $sNamespace . "--" . $sActionId;
|
||||
$selectedOption = "";
|
||||
if ($selectedPlugin == $optionId)
|
||||
$selectedOption = "selected";
|
||||
echo "<option value=\"$optionId\" $selectedOption>" . $sActionId . "</option>";
|
||||
}
|
||||
echo '</select>';
|
||||
//G::pr($activePlugnsForCaseScheduler);
|
||||
}
|
||||
}
|
||||
if((isset($caseSchedulerSelected))&&(is_object($caseSchedulerSelected))){
|
||||
//Render the form
|
||||
if((isset($_REQUEST['sch_uid']))&&($_REQUEST['sch_uid']!="")){
|
||||
//$oData=$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionGetFields, array("SCH_UID"=>$_REQUEST['sch_uid']) );
|
||||
$oData=array("SCH_UID"=>$_REQUEST['sch_uid'],"PRO_UID"=>$_REQUEST['pro_uid']);
|
||||
}else{
|
||||
$oData=array("PRO_UID"=>$_REQUEST['pro_uid']);
|
||||
}
|
||||
|
||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionForm, $oData );
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
function pluginCaseSchedulerForm ()
|
||||
{
|
||||
if (! isset( $_REQUEST['selectedOption'] ))
|
||||
die();
|
||||
$G_PUBLISH = new Publisher();
|
||||
$params = explode( "--", $_REQUEST['selectedOption'] );
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
||||
|
||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
||||
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
||||
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
||||
}
|
||||
}
|
||||
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
||||
//Render the form
|
||||
if ((isset( $_REQUEST['sch_uid'] )) && ($_REQUEST['sch_uid'] != "")) {
|
||||
//$oData=$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionGetFields, array("SCH_UID"=>$_REQUEST['sch_uid']) );
|
||||
$oData = array ("SCH_UID" => $_REQUEST['sch_uid'],"PRO_UID" => $_REQUEST['pro_uid']
|
||||
);
|
||||
} else {
|
||||
$oData = array ("PRO_UID" => $_REQUEST['pro_uid']
|
||||
);
|
||||
}
|
||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionForm, $oData );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,38 +1,33 @@
|
||||
|
||||
<?php
|
||||
//$oUserId = '2963666854afbb1cea372c4011254883';
|
||||
$oUserId = $_POST['USR_UID'];
|
||||
$process = isset($_POST['PRO_UID'])?$_POST['PRO_UID']:$_SESSION['PROCESS'];
|
||||
$process = isset( $_POST['PRO_UID'] ) ? $_POST['PRO_UID'] : $_SESSION['PROCESS'];
|
||||
//echo '<select style="width: 300px;" readOnly name="form[PRO_UID]" id="form[PRO_UID]" class="module_app_input___gray" required="1" onChange="loadTasksDropdown(this.value,\''.$oUserId.'\');">';
|
||||
|
||||
require_once ("classes/model/TaskPeer.php");
|
||||
require_once ("classes/model/ProcessPeer.php");
|
||||
require_once ("classes/model/TaskUserPeer.php");
|
||||
G::LoadClass ( 'Content' );
|
||||
G::LoadClass( 'Content' );
|
||||
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn(ProcessPeer::PRO_UID);
|
||||
$oCriteria->setDistinct();
|
||||
$oCriteria->addSelectColumn(ContentPeer::CON_VALUE);
|
||||
$oCriteria->addJoin(ProcessPeer::PRO_UID, TaskPeer::PRO_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addJoin(ProcessPeer::PRO_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->addJoin(TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN);
|
||||
$oCriteria->add(TaskUserPeer::USR_UID, $oUserId);
|
||||
$oCriteria->add(TaskPeer::TAS_START, 'true');
|
||||
$oCriteria->add(ContentPeer::CON_CATEGORY, 'PRO_TITLE');
|
||||
$oCriteria->add(ContentPeer::CON_LANG, SYS_LANG);
|
||||
$oCriteria->addAnd(ProcessPeer::PRO_UID, $process);
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( ProcessPeer::PRO_UID );
|
||||
$oCriteria->setDistinct();
|
||||
$oCriteria->addSelectColumn( ContentPeer::CON_VALUE );
|
||||
$oCriteria->addJoin( ProcessPeer::PRO_UID, TaskPeer::PRO_UID, Criteria::LEFT_JOIN );
|
||||
$oCriteria->addJoin( ProcessPeer::PRO_UID, ContentPeer::CON_ID, Criteria::LEFT_JOIN );
|
||||
$oCriteria->addJoin( TaskPeer::TAS_UID, TaskUserPeer::TAS_UID, Criteria::LEFT_JOIN );
|
||||
$oCriteria->add( TaskUserPeer::USR_UID, $oUserId );
|
||||
$oCriteria->add( TaskPeer::TAS_START, 'true' );
|
||||
$oCriteria->add( ContentPeer::CON_CATEGORY, 'PRO_TITLE' );
|
||||
$oCriteria->add( ContentPeer::CON_LANG, SYS_LANG );
|
||||
$oCriteria->addAnd( ProcessPeer::PRO_UID, $process );
|
||||
|
||||
$resultSet = TaskUserPeer::doSelectRS($oCriteria);
|
||||
while ($resultSet->next()){
|
||||
$resultSet = TaskUserPeer::doSelectRS( $oCriteria );
|
||||
while ($resultSet->next()) {
|
||||
$row = $resultSet->getRow();
|
||||
|
||||
echo $row[1];
|
||||
echo "<input name=\"form[PRO_UID]\" id=\"form[PRO_UID]\" type=\"hidden\" value=\"".$row[0]."\"></input>";
|
||||
echo $row[1];
|
||||
echo "<input name=\"form[PRO_UID]\" id=\"form[PRO_UID]\" type=\"hidden\" value=\"" . $row[0] . "\"></input>";
|
||||
//var_dump($row);
|
||||
}
|
||||
|
||||
}
|
||||
//echo "</select>";
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
<select style="width: 300px;" name="form[TAS_UID]" id="form[TAS_UID]" class="module_app_input___gray" required="1">
|
||||
|
||||
<select style="width: 300px;" name="form[TAS_UID]" id="form[TAS_UID]"
|
||||
class="module_app_input___gray" required="1">
|
||||
<?php
|
||||
//$oUserId = '2963666854afbb1cea372c4011254883';
|
||||
//$oProcessId = '9977730834afd2a0deecaf3040551794';
|
||||
$oUserId = $_POST['USR_UID'];
|
||||
$oProcessId = $_POST['PRO_UID'];
|
||||
|
||||
G::LoadClass('case');
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$startTasks = $oCase->getStartCases( $oUserId );
|
||||
|
||||
foreach($startTasks as $task){
|
||||
if((isset($task['pro_uid']))&&($task['pro_uid'] == $oProcessId)){
|
||||
$taskValue = explode('(',$task['value']);
|
||||
$tasksLastIndex = count($taskValue)-1;
|
||||
$taskValue = explode(')',$taskValue[$tasksLastIndex]);
|
||||
|
||||
echo "<option value=\"".$task['uid']."\">".$taskValue[0]."</option>";
|
||||
}
|
||||
foreach ($startTasks as $task) {
|
||||
if ((isset( $task['pro_uid'] )) && ($task['pro_uid'] == $oProcessId)) {
|
||||
$taskValue = explode( '(', $task['value'] );
|
||||
$tasksLastIndex = count( $taskValue ) - 1;
|
||||
$taskValue = explode( ')', $taskValue[$tasksLastIndex] );
|
||||
echo "<option value=\"" . $task['uid'] . "\">" . $taskValue[0] . "</option>";
|
||||
}
|
||||
}
|
||||
//print_r($startTasks);
|
||||
// echo "<option value=\"".$value."\">".$label."</option>";
|
||||
?>
|
||||
</select>
|
||||
|
||||
|
||||
@@ -12,60 +12,59 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* process_SchedulerValidate_User
|
||||
* validates if the username and password are valid data and if the user assigned
|
||||
* to the process and task has the rights and persmissions required to create a cron task
|
||||
*/
|
||||
|
||||
$sWS_USER = trim( $_REQUEST['USERNAME'] );
|
||||
$sWS_PASS = trim( $_REQUEST['PASSWORD'] );
|
||||
|
||||
$sWS_USER = trim($_REQUEST['USERNAME']);
|
||||
$sWS_PASS = trim($_REQUEST['PASSWORD']);
|
||||
|
||||
if (G::is_https ())
|
||||
if (G::is_https()) {
|
||||
$http = 'https://';
|
||||
else
|
||||
} else {
|
||||
$http = 'http://';
|
||||
}
|
||||
|
||||
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
|
||||
@$client = new SoapClient ( $endpoint );
|
||||
@$client = new SoapClient( $endpoint );
|
||||
|
||||
$user = $sWS_USER;
|
||||
$pass = $sWS_PASS;
|
||||
|
||||
$params = array('userid' => $user, 'password' => $pass);
|
||||
$result = $client->__SoapCall('login', array($params));
|
||||
$params = array ('userid' => $user,'password' => $pass);
|
||||
$result = $client->__SoapCall( 'login', array ($params) );
|
||||
|
||||
if ($result->status_code == 0) {
|
||||
if (!class_exists('Users')) {
|
||||
require ("classes/model/UsersPeer.php");
|
||||
}
|
||||
$oCriteria = new Criteria('workflow');
|
||||
$oCriteria->addSelectColumn('USR_UID');
|
||||
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
|
||||
$resultSet = UsersPeer::doSelectRS($oCriteria);
|
||||
$resultSet->next();
|
||||
$user_id = $resultSet->getRow();
|
||||
$result->message = $user_id[0];
|
||||
if (! class_exists( 'Users' )) {
|
||||
require ("classes/model/UsersPeer.php");
|
||||
}
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( 'USR_UID' );
|
||||
$oCriteria->add( UsersPeer::USR_USERNAME, $sWS_USER );
|
||||
$resultSet = UsersPeer::doSelectRS( $oCriteria );
|
||||
$resultSet->next();
|
||||
$user_id = $resultSet->getRow();
|
||||
$result->message = $user_id[0];
|
||||
|
||||
G::LoadClass('case');
|
||||
$caseInstance = new Cases();
|
||||
if (!$caseInstance->canStartCase($result->message, $_REQUEST['PRO_UID'])) {
|
||||
$result->status_code = -1000;
|
||||
$result->message = G::LoadTranslation('ID_USER_CASES_NOT_START');
|
||||
}
|
||||
G::LoadClass( 'case' );
|
||||
$caseInstance = new Cases();
|
||||
if (! $caseInstance->canStartCase( $result->message, $_REQUEST['PRO_UID'] )) {
|
||||
$result->status_code = - 1000;
|
||||
$result->message = G::LoadTranslation( 'ID_USER_CASES_NOT_START' );
|
||||
}
|
||||
}
|
||||
|
||||
die(G::json_encode($result));
|
||||
die( G::json_encode( $result ) );
|
||||
|
||||
|
||||
@@ -12,15 +12,14 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
global $RBAC;
|
||||
/*
|
||||
@@ -46,11 +45,10 @@ switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
G::header('location: ' . $_SERVER['HTTP_REFERER']);
|
||||
*/
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
|
||||
// G::LoadClass('CaseScheduler');
|
||||
$oCaseScheduler= new CaseScheduler();
|
||||
$oCaseScheduler->changeStatus ( $_GET['SCH_UID'] );
|
||||
G::header('location: ' . $_SERVER['HTTP_REFERER']);
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$oCaseScheduler->changeStatus( $_GET['SCH_UID'] );
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
|
||||
@@ -39,15 +39,13 @@ switch ($RBAC->userCanAccess('PM_CASES'))
|
||||
break;
|
||||
}
|
||||
*/
|
||||
// print_r($_GET); print_r($_POST); die;
|
||||
|
||||
// print_r($_GET); print_r($_POST); die;
|
||||
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
if ( !isset($_GET['SCH_UID'] ) ) return;
|
||||
$oCaseScheduler->remove($_GET['SCH_UID']);
|
||||
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
if ( !isset($_GET['SCH_UID'] ) ) {
|
||||
return;
|
||||
}
|
||||
$oCaseScheduler->remove($_GET['SCH_UID']);
|
||||
/* Redirect */
|
||||
?>
|
||||
|
||||
|
||||
@@ -12,18 +12,17 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
global $RBAC;
|
||||
global $RBAC;
|
||||
|
||||
/*
|
||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
@@ -41,98 +40,96 @@ try {
|
||||
}
|
||||
*/
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
|
||||
// $G_MAIN_MENU = 'processmaker';
|
||||
// $G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_PUBLISH = new Publisher;
|
||||
// $G_MAIN_MENU = 'processmaker';
|
||||
// $G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass('case');
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
/* Prepare page before to show */
|
||||
/* Prepare page before to show */
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$aFields = $oCaseScheduler->load( $_GET['SCH_UID'] );
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$aFields = $oCaseScheduler->load($_GET['SCH_UID']);
|
||||
$aFields['UID_SCHEDULER'] = "scheduler";
|
||||
|
||||
// load according the scheduler option selected daily/weekly/monthly/one time
|
||||
$nOpt = $aFields['SCH_OPTION'];
|
||||
switch ($nOpt) {
|
||||
case 1:
|
||||
$aStartDay = explode( '|', $aFields['SCH_DAYS_PERFORM_TASK'] );
|
||||
if ($aStartDay[0] != 3) {
|
||||
$aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0];
|
||||
} else {
|
||||
$aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0];
|
||||
$aFields['SCH_DAYS_PERFORM_TASK_OPT_3'] = $aStartDay[1];
|
||||
}
|
||||
|
||||
$aFields['UID_SCHEDULER'] ="scheduler" ;
|
||||
break;
|
||||
case 2:
|
||||
$aFields['SCH_WEEK_DAYS_2'] = $aFields['SCH_WEEK_DAYS'];
|
||||
break;
|
||||
case 3: // $nStartDay = $aFields['SCH_START_DAY'];
|
||||
$aStartDay = explode( '|', $aFields['SCH_START_DAY'] );
|
||||
if ($aStartDay[0] == 1) {
|
||||
$aFields['SCH_START_DAY_OPT_1'] = $aStartDay[1];
|
||||
} else {
|
||||
$aFields['SCH_START_DAY_OPT_2_WEEKS'] = $aStartDay[1];
|
||||
$aFields['SCH_START_DAY_OPT_2_DAYS_WEEK'] = $aStartDay[2];
|
||||
}
|
||||
$aFields['SCH_START_DAY'] = $aStartDay[0];
|
||||
$aFields['SCH_MONTHS_2'] = $aFields['SCH_MONTHS'];
|
||||
$aFields['SCH_MONTHS_3'] = $aFields['SCH_MONTHS'];
|
||||
break;
|
||||
case 4:
|
||||
|
||||
// load according the scheduler option selected daily/weekly/monthly/one time
|
||||
$nOpt = $aFields['SCH_OPTION'];
|
||||
switch($nOpt){
|
||||
case 1 : $aStartDay = explode('|', $aFields['SCH_DAYS_PERFORM_TASK']);
|
||||
if($aStartDay[0] != 3) {
|
||||
$aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0];
|
||||
} else {
|
||||
$aFields['SCH_DAYS_PERFORM_TASK'] = $aStartDay[0];
|
||||
$aFields['SCH_DAYS_PERFORM_TASK_OPT_3'] = $aStartDay[1];
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
case 2 :
|
||||
$aFields['SCH_WEEK_DAYS_2'] = $aFields['SCH_WEEK_DAYS'];
|
||||
break;
|
||||
case 3 : // $nStartDay = $aFields['SCH_START_DAY'];
|
||||
$aStartDay = explode('|', $aFields['SCH_START_DAY']);
|
||||
if($aStartDay[0] == 1){
|
||||
$aFields['SCH_START_DAY_OPT_1'] = $aStartDay[1];
|
||||
} else {
|
||||
$aFields['SCH_START_DAY_OPT_2_WEEKS'] = $aStartDay[1];
|
||||
$aFields['SCH_START_DAY_OPT_2_DAYS_WEEK'] = $aStartDay[2];
|
||||
}
|
||||
$aFields['SCH_START_DAY'] = $aStartDay[0];
|
||||
$aFields['SCH_MONTHS_2'] = $aFields['SCH_MONTHS'];
|
||||
$aFields['SCH_MONTHS_3'] = $aFields['SCH_MONTHS'];
|
||||
break;
|
||||
case 4 :
|
||||
$aFields['SCH_START_TIME'] = date( 'H:i', strtotime( $aFields['SCH_START_TIME'] ) );
|
||||
$aFields['PREV_SCH_START_TIME'] = $aFields['SCH_START_TIME'];
|
||||
|
||||
break;
|
||||
}
|
||||
$aFields['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $aFields['SCH_START_DATE'] ) );
|
||||
$aFields['PREV_SCH_START_DATE'] = $aFields['SCH_START_DATE'];
|
||||
|
||||
$aFields['SCH_START_TIME'] = date('H:i' , strtotime($aFields['SCH_START_TIME']));
|
||||
$aFields['PREV_SCH_START_TIME'] = $aFields['SCH_START_TIME'];
|
||||
if (! empty( $aFields['SCH_END_DATE'] )) {
|
||||
$aFields['SCH_END_DATE'] = date( 'Y-m-d', strtotime( $aFields['SCH_END_DATE'] ) );
|
||||
$aFields['PREV_SCH_END_DATE'] = date( 'Y-m-d', strtotime( $aFields['SCH_END_DATE'] ) );
|
||||
}
|
||||
if ($aFields['SCH_REPEAT_STOP_IF_RUNNING'] == 0 || $aFields['SCH_REPEAT_STOP_IF_RUNNING'] == null) {
|
||||
$aFields['SCH_REPEAT_STOP_IF_RUNNING'] = null;
|
||||
} else {
|
||||
$aFields['SCH_REPEAT_STOP_IF_RUNNING'] = 'On';
|
||||
}
|
||||
|
||||
$aFields['SCH_START_DATE'] = date('Y-m-d', strtotime($aFields['SCH_START_DATE']));
|
||||
$aFields['PREV_SCH_START_DATE'] = $aFields['SCH_START_DATE'];
|
||||
$aFields['SCH_USER_NAME'] = $aFields['SCH_DEL_USER_NAME'];
|
||||
$aFields['SCH_USER_PASSWORD'] = 'DefaultPM';
|
||||
$aFields['SCH_USER_UID'] = $aFields['SCH_DEL_USER_UID'];
|
||||
$aFields['SCH_START_DATE'] = date( "Y-m-d", strtotime( $aFields['SCH_START_DATE'] ) );
|
||||
|
||||
if(!empty($aFields['SCH_END_DATE'])){
|
||||
$aFields['SCH_END_DATE'] = date('Y-m-d', strtotime($aFields['SCH_END_DATE']));
|
||||
$aFields['PREV_SCH_END_DATE'] = date('Y-m-d', strtotime($aFields['SCH_END_DATE']));
|
||||
}
|
||||
if($aFields['SCH_REPEAT_STOP_IF_RUNNING']==0 || $aFields['SCH_REPEAT_STOP_IF_RUNNING']==null){
|
||||
$aFields['SCH_REPEAT_STOP_IF_RUNNING']=null;
|
||||
}else {
|
||||
$aFields['SCH_REPEAT_STOP_IF_RUNNING']='On';
|
||||
}
|
||||
// validating if any of the advanced fields is non empty
|
||||
// var_dump($aFields['SCH_END_DATE']);
|
||||
// var_dump($aFields['SCH_REPEAT_EVERY']);
|
||||
// die();
|
||||
if ($aFields['SCH_END_DATE'] != NULL || trim( $aFields['SCH_REPEAT_EVERY'] ) != '') {
|
||||
$aFields['SCH_ADVANCED'] = 'true';
|
||||
} else {
|
||||
$aFields['SCH_ADVANCED'] = 'false';
|
||||
}
|
||||
|
||||
$aFields['SCH_USER_NAME'] = $aFields['SCH_DEL_USER_NAME'];
|
||||
$aFields['SCH_USER_PASSWORD'] = 'DefaultPM';
|
||||
$aFields['SCH_USER_UID'] = $aFields['SCH_DEL_USER_UID'];
|
||||
$aFields['SCH_START_DATE'] = date ("Y-m-d",strtotime($aFields['SCH_START_DATE']));
|
||||
$aFields['PRO_UID_TMP'] = isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : $_SESSION['PROCESS'];
|
||||
$aFields['PHP_START_DATE'] = date( 'Y-m-d' );
|
||||
$aFields['PHP_END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
|
||||
|
||||
// validating if any of the advanced fields is non empty
|
||||
// var_dump($aFields['SCH_END_DATE']);
|
||||
// var_dump($aFields['SCH_REPEAT_EVERY']);
|
||||
// die();
|
||||
if ($aFields['SCH_END_DATE']!=NULL||trim($aFields['SCH_REPEAT_EVERY'])!=''){
|
||||
$aFields['SCH_ADVANCED'] = 'true';
|
||||
} else {
|
||||
$aFields['SCH_ADVANCED'] = 'false';
|
||||
}
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_Edit.xml', '', $aFields, 'cases_Scheduler_Update' );
|
||||
|
||||
$aFields['PRO_UID_TMP'] = isset($_GET['PRO_UID'])?$_GET['PRO_UID']:$_SESSION['PROCESS'];
|
||||
$aFields['PHP_START_DATE'] = date('Y-m-d');
|
||||
$aFields['PHP_END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Scheduler_Edit.xml', '', $aFields, 'cases_Scheduler_Update');
|
||||
|
||||
G::RenderPage('publishBlank','blank');
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
} catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -12,18 +12,19 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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_LOGIN"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
global $RBAC;
|
||||
/*switch ($RBAC->userCanAccess('PM_USERS'))
|
||||
{
|
||||
@@ -39,138 +40,55 @@ global $RBAC;
|
||||
break;
|
||||
}*/
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_SCHEDULER';
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
$process = isset($_GET['PRO_UID'])?$_GET['PRO_UID']:$_SESSION['PROCESS'];
|
||||
$process = isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : $_SESSION['PROCESS'];
|
||||
$sDelimiter = DBAdapter::getStringDelimiter();
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$aRows = $oCaseScheduler->getAllByProcess($process);
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$aRows = $oCaseScheduler->getAllByProcess( $process );
|
||||
|
||||
//$oCaseScheduler->caseSchedulerCron();
|
||||
// g::pr($aRows); die;
|
||||
//$oCaseScheduler->caseSchedulerCron();
|
||||
// g::pr($aRows); die;
|
||||
|
||||
$fieldNames = Array(
|
||||
'SCH_UID' => 'char',
|
||||
'SCH_NAME' => 'char',
|
||||
'PRO_UID' => 'char',
|
||||
'TAS_UID' => 'char',
|
||||
'SCH_TIME_NEXT_RUN' => 'char',
|
||||
'SCH_LAST_RUN_TIME' => 'char',
|
||||
'SCH_STATE' => 'char',
|
||||
'SCH_LAST_STATE' => 'char',
|
||||
'USR_UID' => 'char',
|
||||
'SCH_OPTION' => 'char',
|
||||
'SCH_START_TIME' => 'char',
|
||||
'SCH_START_DATE' => 'char',
|
||||
'SCH_DAYS_PERFORM_TASK' => 'char',
|
||||
'SCH_EVERY_DAYS' => 'char',
|
||||
'SCH_WEEK_DAYS' => 'char',
|
||||
'SCH_START_DAY' => 'char',
|
||||
'SCH_MONTHS' => 'char',
|
||||
'SCH_END_DATE' => 'char',
|
||||
'SCH_REPEAT_EVERY' => 'char',
|
||||
'SCH_REPEAT_UNTIL' => 'char',
|
||||
'SCH_REPEAT_STOP_IF_RUNNING' => 'char',
|
||||
'PRO_PARENT' => 'char',
|
||||
'PRO_TIME' => 'char',
|
||||
'PRO_TIMEUNIT' => 'char',
|
||||
'PRO_STATUS' => 'char',
|
||||
'PRO_TYPE_DAY' => 'char',
|
||||
'PRO_TYPE' => 'char',
|
||||
'PRO_ASSIGNMENT' => 'char',
|
||||
'PRO_SHOW_MAP' => 'char',
|
||||
'PRO_SHOW_MESSAGE' => 'char',
|
||||
'PRO_SUBPROCESS' => 'char',
|
||||
'PRO_TRI_DELETED' => 'char',
|
||||
'PRO_TRI_CANCELED' => 'char',
|
||||
'PRO_TRI_PAUSED' => 'char',
|
||||
'PRO_TRI_REASSIGNED' => 'char',
|
||||
'PRO_SHOW_DELEGATE' => 'char',
|
||||
'PRO_SHOW_DYNAFORM' => 'char',
|
||||
'PRO_CATEGORY' => 'char',
|
||||
'PRO_SUB_CATEGORY' => 'char',
|
||||
'PRO_INDUSTRY' => 'char',
|
||||
'PRO_UPDATE_DATE' => 'char',
|
||||
'PRO_CREATE_DATE' => 'char',
|
||||
'PRO_CREATE_USER' => 'char',
|
||||
'PRO_HEIGHT' => 'char',
|
||||
'PRO_WIDTH' => 'char',
|
||||
'PRO_TITLE_X' => 'char',
|
||||
'PRO_TITLE_Y' => 'char',
|
||||
'PRO_DEBUG' => 'char',
|
||||
'PRO_TITLE' => 'char',
|
||||
'PRO_DESCRIPTION' => 'char',
|
||||
'TAS_TYPE' => 'char',
|
||||
'TAS_DURATION' => 'char',
|
||||
'TAS_DELAY_TYPE' => 'char',
|
||||
'TAS_TEMPORIZER' => 'char',
|
||||
'TAS_TYPE_DAY' => 'char',
|
||||
'TAS_TIMEUNIT' => 'char',
|
||||
'TAS_ALERT' => 'char',
|
||||
'TAS_PRIORITY_VARIABLE' => 'char',
|
||||
'TAS_ASSIGN_TYPE' => 'char',
|
||||
'TAS_ASSIGN_VARIABLE' => 'char',
|
||||
'TAS_ASSIGN_LOCATION' => 'char',
|
||||
'TAS_ASSIGN_LOCATION_ADHOC' => 'char',
|
||||
'TAS_TRANSFER_FLY' => 'char',
|
||||
'TAS_LAST_ASSIGNED' => 'char',
|
||||
'TAS_USER' => 'char',
|
||||
'TAS_CAN_UPLOAD' => 'char',
|
||||
'TAS_VIEW_UPLOAD' => 'char',
|
||||
'TAS_VIEW_ADDITIONAL_DOCUMENTATION' => 'char',
|
||||
'TAS_CAN_CANCEL' => 'char',
|
||||
'TAS_OWNER_APP' => 'char',
|
||||
'STG_UID' => 'char',
|
||||
'TAS_CAN_PAUSE' => 'char',
|
||||
'TAS_CAN_SEND_MESSAGE' => 'char',
|
||||
'TAS_CAN_DELETE_DOCS' => 'char',
|
||||
'TAS_SELF_SERVICE' => 'char',
|
||||
'TAS_START' => 'char',
|
||||
'TAS_TO_LAST_USER' => 'char',
|
||||
'TAS_SEND_LAST_EMAIL' => 'char',
|
||||
'TAS_DERIVATION' => 'char',
|
||||
'TAS_POSX' => 'char',
|
||||
'TAS_POSY' => 'char',
|
||||
'TAS_COLOR' => 'char',
|
||||
'TAS_TITLE' => 'char',
|
||||
'TAS_DESCRIPTION' => 'char',
|
||||
'TAS_DEF_TITLE' => 'char',
|
||||
'TAS_DEF_DESCRIPTION' => 'char',
|
||||
'TAS_DEF_PROC_CODE' => 'char',
|
||||
'TAS_DEF_MESSAGE' => 'char'
|
||||
|
||||
$fieldNames = Array ('SCH_UID' => 'char','SCH_NAME' => 'char','PRO_UID' => 'char','TAS_UID' => 'char','SCH_TIME_NEXT_RUN' => 'char','SCH_LAST_RUN_TIME' => 'char','SCH_STATE' => 'char','SCH_LAST_STATE' => 'char','USR_UID' => 'char','SCH_OPTION' => 'char','SCH_START_TIME' => 'char','SCH_START_DATE' => 'char','SCH_DAYS_PERFORM_TASK' => 'char','SCH_EVERY_DAYS' => 'char','SCH_WEEK_DAYS' => 'char','SCH_START_DAY' => 'char','SCH_MONTHS' => 'char','SCH_END_DATE' => 'char','SCH_REPEAT_EVERY' => 'char','SCH_REPEAT_UNTIL' => 'char','SCH_REPEAT_STOP_IF_RUNNING' => 'char','PRO_PARENT' => 'char','PRO_TIME' => 'char','PRO_TIMEUNIT' => 'char','PRO_STATUS' => 'char','PRO_TYPE_DAY' => 'char','PRO_TYPE' => 'char','PRO_ASSIGNMENT' => 'char','PRO_SHOW_MAP' => 'char','PRO_SHOW_MESSAGE' => 'char',
|
||||
'PRO_SUBPROCESS' => 'char','PRO_TRI_DELETED' => 'char','PRO_TRI_CANCELED' => 'char','PRO_TRI_PAUSED' => 'char','PRO_TRI_REASSIGNED' => 'char','PRO_SHOW_DELEGATE' => 'char','PRO_SHOW_DYNAFORM' => 'char','PRO_CATEGORY' => 'char','PRO_SUB_CATEGORY' => 'char','PRO_INDUSTRY' => 'char','PRO_UPDATE_DATE' => 'char','PRO_CREATE_DATE' => 'char','PRO_CREATE_USER' => 'char','PRO_HEIGHT' => 'char','PRO_WIDTH' => 'char','PRO_TITLE_X' => 'char','PRO_TITLE_Y' => 'char','PRO_DEBUG' => 'char','PRO_TITLE' => 'char','PRO_DESCRIPTION' => 'char','TAS_TYPE' => 'char','TAS_DURATION' => 'char','TAS_DELAY_TYPE' => 'char','TAS_TEMPORIZER' => 'char','TAS_TYPE_DAY' => 'char','TAS_TIMEUNIT' => 'char','TAS_ALERT' => 'char','TAS_PRIORITY_VARIABLE' => 'char','TAS_ASSIGN_TYPE' => 'char',
|
||||
'TAS_ASSIGN_VARIABLE' => 'char','TAS_ASSIGN_LOCATION' => 'char','TAS_ASSIGN_LOCATION_ADHOC' => 'char','TAS_TRANSFER_FLY' => 'char','TAS_LAST_ASSIGNED' => 'char','TAS_USER' => 'char','TAS_CAN_UPLOAD' => 'char','TAS_VIEW_UPLOAD' => 'char','TAS_VIEW_ADDITIONAL_DOCUMENTATION' => 'char','TAS_CAN_CANCEL' => 'char','TAS_OWNER_APP' => 'char','STG_UID' => 'char','TAS_CAN_PAUSE' => 'char','TAS_CAN_SEND_MESSAGE' => 'char','TAS_CAN_DELETE_DOCS' => 'char','TAS_SELF_SERVICE' => 'char','TAS_START' => 'char','TAS_TO_LAST_USER' => 'char','TAS_SEND_LAST_EMAIL' => 'char','TAS_DERIVATION' => 'char','TAS_POSX' => 'char','TAS_POSY' => 'char','TAS_COLOR' => 'char','TAS_TITLE' => 'char','TAS_DESCRIPTION' => 'char','TAS_DEF_TITLE' => 'char','TAS_DEF_DESCRIPTION' => 'char',
|
||||
'TAS_DEF_PROC_CODE' => 'char','TAS_DEF_MESSAGE' => 'char'
|
||||
);
|
||||
|
||||
|
||||
$aRows = array_merge(Array($fieldNames), $aRows);
|
||||
$aRows = array_merge( Array ($fieldNames
|
||||
), $aRows );
|
||||
//krumo ($aRows);
|
||||
for($j=0;$j<count($aRows);$j++){
|
||||
if ($aRows[$j]['SCH_STATE'] == 'PROCESSED'){
|
||||
for ($j = 0; $j < count( $aRows ); $j ++) {
|
||||
if ($aRows[$j]['SCH_STATE'] == 'PROCESSED') {
|
||||
$aRows[$j]['SCH_TIME_NEXT_RUN'] = '';
|
||||
}
|
||||
}
|
||||
// g::pr($aRows); die;
|
||||
|
||||
|
||||
global $_DBArray;
|
||||
$_DBArray['cases_scheduler'] = $aRows;
|
||||
$_DBArray['cases_scheduler'] = $aRows;
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
G::LoadClass('ArrayPeer');
|
||||
$oCriteria = new Criteria('dbarray');
|
||||
$oCriteria->setDBArrayTable('cases_scheduler');
|
||||
G::LoadClass( 'ArrayPeer' );
|
||||
$oCriteria = new Criteria( 'dbarray' );
|
||||
$oCriteria->setDBArrayTable( 'cases_scheduler' );
|
||||
//krumo ($oCriteria);
|
||||
//var_dump ($oCriteria);
|
||||
//$oCriteria->add('PRO_UID', $_SESSION['PROCESS']);
|
||||
//krumo($_SESSION);
|
||||
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 10;
|
||||
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_Scheduler_List', $oCriteria, array('CONFIRM' => G::LoadTranslation('ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER')));
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_Scheduler_List', $oCriteria, array ('CONFIRM' => G::LoadTranslation( 'ID_MSG_CONFIRM_DELETE_CASE_SCHEDULER' )
|
||||
) );
|
||||
$G_PUBLISH->oPropelTable->rowsPerPage = 10;
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
|
||||
@@ -13,32 +13,31 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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_LOGIN"))!=1) return $RBAC_Response;
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_LOGIN" )) != 1)
|
||||
return $RBAC_Response;
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
G::LoadClass('configuration');
|
||||
$G_PUBLISH = new Publisher();
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
||||
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
||||
$configPage = $c->getConfiguration( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$oHeadPublisher =& headPublisher::getSingleton();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
|
||||
$oHeadPublisher->addExtJsScript('cases/casesSchedulerLog', false); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent('cases/casesSchedulerLog'); //adding a html file .html.
|
||||
|
||||
$oHeadPublisher->assign('CONFIG', $Config);
|
||||
$oHeadPublisher->addExtJsScript( 'cases/casesSchedulerLog', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'cases/casesSchedulerLog' ); //adding a html file .html.
|
||||
|
||||
|
||||
G::RenderPage('publish', 'extJs');
|
||||
$oHeadPublisher->assign( 'CONFIG', $Config );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
?>
|
||||
|
||||
@@ -12,20 +12,19 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
global $RBAC;
|
||||
global $RBAC;
|
||||
|
||||
/*
|
||||
/*
|
||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
{
|
||||
case -2:
|
||||
@@ -54,39 +53,35 @@ try {
|
||||
$aFields['END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
|
||||
$aFields['USR_DUE_DATE']= date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1));
|
||||
*/
|
||||
if (!class_exists('LogCasesSchedulerPeer')){
|
||||
require_once('classes/model/LogCasesScheduler.php');
|
||||
}
|
||||
if (! class_exists( 'LogCasesSchedulerPeer' )) {
|
||||
require_once ('classes/model/LogCasesScheduler.php');
|
||||
}
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
|
||||
$oCriteria = new Criteria ('workflow');
|
||||
// var_dump(htmlspecialchars($_GET['WS_ROUTE']));
|
||||
// var_dump(htmlentities($_GET['WS_ROUTE']));
|
||||
|
||||
$oCriteria->add(LogCasesSchedulerPeer::LOG_CASE_UID,$_REQUEST['LOG_CASE_UID']);
|
||||
|
||||
$result = LogCasesSchedulerPeer::doSelectRS($oCriteria);
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
$aFields['PRO_UID'] = $row[1];
|
||||
$aFields['TAS_UID'] = $row[2];
|
||||
$aFields['SCH_UID'] = $row[7];
|
||||
$aFields['USR_NAME'] = $row[3];
|
||||
$aFields['EXEC_DATE'] = $row[4];
|
||||
$aFields['EXEC_HOUR'] = $row[5];
|
||||
$aFields['RESULT'] = $row[6];
|
||||
$aFields['WS_CREATE_CASE_STATUS'] = $row[8];
|
||||
$aFields['WS_ROUTE_CASE_STATUS'] = htmlentities($row[9]);
|
||||
//var_dump($aFields);
|
||||
//$aFields = $_GET;
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
// var_dump(htmlspecialchars($_GET['WS_ROUTE']));
|
||||
// var_dump(htmlentities($_GET['WS_ROUTE']));
|
||||
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Scheduler_Log_Detail.xml', '', $aFields, '');
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
$oCriteria->add( LogCasesSchedulerPeer::LOG_CASE_UID, $_REQUEST['LOG_CASE_UID'] );
|
||||
$result = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
|
||||
$result->next();
|
||||
$row = $result->getRow();
|
||||
$aFields['PRO_UID'] = $row[1];
|
||||
$aFields['TAS_UID'] = $row[2];
|
||||
$aFields['SCH_UID'] = $row[7];
|
||||
$aFields['USR_NAME'] = $row[3];
|
||||
$aFields['EXEC_DATE'] = $row[4];
|
||||
$aFields['EXEC_HOUR'] = $row[5];
|
||||
$aFields['RESULT'] = $row[6];
|
||||
$aFields['WS_CREATE_CASE_STATUS'] = $row[8];
|
||||
$aFields['WS_ROUTE_CASE_STATUS'] = htmlentities( $row[9] );
|
||||
//var_dump($aFields);
|
||||
//$aFields = $_GET;
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_Log_Detail.xml', '', $aFields, '' );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -12,20 +12,19 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
global $RBAC;
|
||||
global $RBAC;
|
||||
|
||||
/*
|
||||
/*
|
||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
{
|
||||
case -2:
|
||||
@@ -55,47 +54,43 @@ try {
|
||||
$aFields['USR_DUE_DATE']= date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 1));
|
||||
*/
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'cases';
|
||||
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_SCHEDULER';
|
||||
$G_ID_MENU_SELECTED = 'CASES';
|
||||
$G_ID_SUB_MENU_SELECTED = 'CASES_SCHEDULER';
|
||||
|
||||
$G_PUBLISH = new Publisher;
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
G::LoadClass('case');
|
||||
$aFields['PHP_START_DATE'] = date('Y-m-d');
|
||||
$aFields['PRO_UID'] = isset($_GET['PRO_UID'])?$_GET['PRO_UID']:$_SESSION['PROCESS'];
|
||||
$aFields['PHP_CURRENT_DATE'] = $aFields['PHP_START_DATE'];
|
||||
$aFields['PHP_END_DATE'] = date('Y-m-d', mktime(0, 0, 0, date('m'), date('d'), date('Y') + 5));
|
||||
G::LoadClass( 'case' );
|
||||
$aFields['PHP_START_DATE'] = date( 'Y-m-d' );
|
||||
$aFields['PRO_UID'] = isset( $_GET['PRO_UID'] ) ? $_GET['PRO_UID'] : $_SESSION['PROCESS'];
|
||||
$aFields['PHP_CURRENT_DATE'] = $aFields['PHP_START_DATE'];
|
||||
$aFields['PHP_END_DATE'] = date( 'Y-m-d', mktime( 0, 0, 0, date( 'm' ), date( 'd' ), date( 'Y' ) + 5 ) );
|
||||
|
||||
/* Prepare page before to show */
|
||||
/* Prepare page before to show */
|
||||
|
||||
/*-- Base
|
||||
$aFields = array();
|
||||
$oCase = new Cases();
|
||||
$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] );
|
||||
*/
|
||||
/*-- Base
|
||||
$aFields = array();
|
||||
$oCase = new Cases();
|
||||
$_DBArray['NewCase'] = $oCase->getStartCases( $_SESSION['USER_LOGGED'] );
|
||||
*/
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
//$_DBArray['NewProcess'] = $oCaseScheduler->getProcessDescription();
|
||||
//$_DBArray['NewTask'] = $oCaseScheduler->getTaskDescription();
|
||||
// var_dump($oCaseScheduler->getAllProcess()); die;
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
//$_DBArray['NewProcess'] = $oCaseScheduler->getProcessDescription();
|
||||
//$_DBArray['NewTask'] = $oCaseScheduler->getTaskDescription();
|
||||
|
||||
// var_dump($oCaseScheduler->getAllProcess()); die;
|
||||
|
||||
$aFields['UID_SCHEDULER'] ="scheduler" ;
|
||||
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_Scheduler_New.xml', '', $aFields, 'cases_Scheduler_Save');
|
||||
G::RenderPage('publishBlank', 'blank');
|
||||
$aFields['UID_SCHEDULER'] = "scheduler";
|
||||
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_Scheduler_New.xml', '', $aFields, 'cases_Scheduler_Save' );
|
||||
G::RenderPage( 'publishBlank', 'blank' );
|
||||
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -12,18 +12,17 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
/*
|
||||
/*
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
{
|
||||
@@ -40,236 +39,231 @@ try {
|
||||
}
|
||||
*/
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
if (empty( $_POST )) {
|
||||
die( 'The information sended is empty!' );
|
||||
}
|
||||
|
||||
if (empty($_POST)) {
|
||||
die('The information sended is empty!');
|
||||
}
|
||||
$aData['SCH_UID'] = G::generateUniqueID();
|
||||
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
|
||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
||||
$aData['SCH_DEL_USER_PASS'] = md5( $_POST['form']['SCH_USER_PASSWORD'] );
|
||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
||||
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
|
||||
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
|
||||
|
||||
$aData['SCH_UID'] = G::generateUniqueID();
|
||||
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
|
||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
||||
$aData['SCH_DEL_USER_PASS'] = md5($_POST['form']['SCH_USER_PASSWORD']);
|
||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
||||
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
|
||||
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
|
||||
$aData['SCH_STATE'] = 'ACTIVE';
|
||||
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
|
||||
$aData['SCH_STATE'] = 'ACTIVE';
|
||||
$aData['SCH_LAST_STATE'] = 'CREATED'; // 'ACTIVE';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$sOption = $_POST['form']['SCH_OPTION'];
|
||||
$aData['SCH_OPTION'] = $sOption;
|
||||
|
||||
$sOption = $_POST['form']['SCH_OPTION'];
|
||||
$aData['SCH_OPTION'] = $sOption;
|
||||
|
||||
|
||||
|
||||
if ($_POST['form']['SCH_START_DATE']!=''){
|
||||
$sDateTmp = $_POST['form']['SCH_START_DATE'];
|
||||
if ($_POST['form']['SCH_START_DATE'] != '') {
|
||||
$sDateTmp = $_POST['form']['SCH_START_DATE'];
|
||||
} else {
|
||||
$sDateTmp = date('Y-m-d');
|
||||
$sDateTmp = date( 'Y-m-d' );
|
||||
}
|
||||
$sTimeTmp = $_POST['form']['SCH_START_TIME'];
|
||||
$aData['SCH_START_TIME'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
|
||||
$aData['SCH_START_DATE'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
|
||||
$aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
||||
$aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
||||
|
||||
$nActualTime = $_POST['form']['SCH_START_TIME']; // time();
|
||||
// $nActualDate = date("Y-m-d H:i:s", $nActualTime);
|
||||
|
||||
$sValue = '';
|
||||
$sDaysPerformTask = '';
|
||||
$sWeeks = '';
|
||||
$sMonths = '';
|
||||
$sMonths = '';
|
||||
$sStartDay = '';
|
||||
$nSW = 0;
|
||||
$aData['SCH_START_DAY'] = '';
|
||||
$aData['SCH_REPEAT_EVERY'] = '';
|
||||
$aData['SCH_REPEAT_UNTIL'] = '';
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = '';
|
||||
switch($sOption){
|
||||
case '1' : // Option 1
|
||||
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
||||
switch($sValue){
|
||||
case '1' : $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
|
||||
break;
|
||||
case '2' :
|
||||
$aData['SCH_OPTION'] = '2';
|
||||
$aData['SCH_EVERY_DAYS'] = '1';
|
||||
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
|
||||
break;
|
||||
case '3' : // Every [n] Days
|
||||
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case '2' : // If the option is zero, set by default 1
|
||||
if(empty($_POST['form']['SCH_EVERY_DAYS']))
|
||||
$nEveryDays = 1;
|
||||
else
|
||||
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
|
||||
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
|
||||
$sWeeks = '';
|
||||
if(!empty($_POST['form']['SCH_WEEK_DAYS'])){
|
||||
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
|
||||
foreach($aWeekDays as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
}
|
||||
if(!empty($_POST['form']['SCH_WEEK_DAYS_2'])){
|
||||
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
|
||||
foreach($aWeekDays2 as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
}
|
||||
$sStartTime = $_POST['form']['SCH_START_TIME'];
|
||||
$aData['SCH_WEEK_DAYS'] = $sWeeks;
|
||||
$sValue = '';
|
||||
$sDaysPerformTask = '';
|
||||
$sWeeks = '';
|
||||
$sMonths = '';
|
||||
$sMonths = '';
|
||||
$sStartDay = '';
|
||||
$nSW = 0;
|
||||
$aData['SCH_START_DAY'] = '';
|
||||
$aData['SCH_REPEAT_EVERY'] = '';
|
||||
$aData['SCH_REPEAT_UNTIL'] = '';
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = '';
|
||||
switch ($sOption) {
|
||||
case '1': // Option 1
|
||||
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
||||
switch ($sValue) {
|
||||
case '1':
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
|
||||
break;
|
||||
case '2':
|
||||
$aData['SCH_OPTION'] = '2';
|
||||
$aData['SCH_EVERY_DAYS'] = '1';
|
||||
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
|
||||
break;
|
||||
case '3': // Every [n] Days
|
||||
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
break;
|
||||
case '3' :
|
||||
$nStartDay = $_POST['form']['SCH_START_DAY'];
|
||||
if($nStartDay == 1){
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
|
||||
} else {
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
|
||||
}
|
||||
case '2': // If the option is zero, set by default 1
|
||||
if (empty( $_POST['form']['SCH_EVERY_DAYS'] ))
|
||||
$nEveryDays = 1;
|
||||
else
|
||||
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
|
||||
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
|
||||
$sWeeks = '';
|
||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS'] )) {
|
||||
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
|
||||
foreach ($aWeekDays as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
}
|
||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS_2'] )) {
|
||||
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
|
||||
foreach ($aWeekDays2 as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
}
|
||||
$sStartTime = $_POST['form']['SCH_START_TIME'];
|
||||
$aData['SCH_WEEK_DAYS'] = $sWeeks;
|
||||
|
||||
$sMonths = '';
|
||||
if(!empty($_POST['form']['SCH_MONTHS'])){
|
||||
$aMonths = $_POST['form']['SCH_MONTHS'];
|
||||
foreach($aMonths as $value) {
|
||||
$sMonths = $sMonths . $value . '|' ;
|
||||
}
|
||||
}
|
||||
if(!empty($_POST['form']['SCH_MONTHS_2'])){
|
||||
$aMonths2 = $_POST['form']['SCH_MONTHS_2'];
|
||||
foreach($aMonths2 as $value) {
|
||||
$sMonths = $sMonths . $value . '|' ;
|
||||
}
|
||||
}
|
||||
if(!empty($_POST['form']['SCH_MONTHS_3'])){
|
||||
$aMonths3 = $_POST['form']['SCH_MONTHS_3'];
|
||||
foreach($aMonths3 as $value) {
|
||||
$sMonths = $sMonths . $value . '|' ;
|
||||
}
|
||||
}
|
||||
$aData['SCH_MONTHS'] = $sMonths;
|
||||
$sStartDay = $aData['SCH_START_DAY'];
|
||||
$sValue = $nStartDay;
|
||||
break;
|
||||
break;
|
||||
case '3':
|
||||
$nStartDay = $_POST['form']['SCH_START_DAY'];
|
||||
if ($nStartDay == 1) {
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
|
||||
} else {
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
|
||||
}
|
||||
|
||||
$sMonths = '';
|
||||
if (! empty( $_POST['form']['SCH_MONTHS'] )) {
|
||||
$aMonths = $_POST['form']['SCH_MONTHS'];
|
||||
foreach ($aMonths as $value) {
|
||||
$sMonths = $sMonths . $value . '|';
|
||||
}
|
||||
}
|
||||
if (! empty( $_POST['form']['SCH_MONTHS_2'] )) {
|
||||
$aMonths2 = $_POST['form']['SCH_MONTHS_2'];
|
||||
foreach ($aMonths2 as $value) {
|
||||
$sMonths = $sMonths . $value . '|';
|
||||
}
|
||||
}
|
||||
if (! empty( $_POST['form']['SCH_MONTHS_3'] )) {
|
||||
$aMonths3 = $_POST['form']['SCH_MONTHS_3'];
|
||||
foreach ($aMonths3 as $value) {
|
||||
$sMonths = $sMonths . $value . '|';
|
||||
}
|
||||
}
|
||||
$aData['SCH_MONTHS'] = $sMonths;
|
||||
$sStartDay = $aData['SCH_START_DAY'];
|
||||
$sValue = $nStartDay;
|
||||
break;
|
||||
|
||||
}
|
||||
echo "<br>sOption: ".$sOption;
|
||||
if(($sOption!='1') && ($sOption!='4') && ($sOption!='5') ) {
|
||||
if ($sStartDay==''){
|
||||
$sStartDay = date('Y-m-d');
|
||||
}
|
||||
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
|
||||
$dCurrentDay = date("d");
|
||||
$dCurrentMonth = date("m");
|
||||
$aStartDay = explode( "|" , $aData['SCH_START_DAY'] );
|
||||
if($sOption=='3'&&$aStartDay[0]=='1'){
|
||||
$monthsArray = explode("|",$sMonths);
|
||||
foreach ($monthsArray as $row){
|
||||
if ( $dCurrentMonth == $row && $dCurrentDay<$aStartDay[1] ){
|
||||
$startTime = $_POST['form']['SCH_START_TIME'].":00";
|
||||
$aData['SCH_TIME_NEXT_RUN'] = date('Y') . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
|
||||
break;
|
||||
echo "<br>sOption: " . $sOption;
|
||||
if (($sOption != '1') && ($sOption != '4') && ($sOption != '5')) {
|
||||
if ($sStartDay == '') {
|
||||
$sStartDay = date( 'Y-m-d' );
|
||||
}
|
||||
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
|
||||
$dCurrentDay = date( "d" );
|
||||
$dCurrentMonth = date( "m" );
|
||||
$aStartDay = explode( "|", $aData['SCH_START_DAY'] );
|
||||
if ($sOption == '3' && $aStartDay[0] == '1') {
|
||||
$monthsArray = explode( "|", $sMonths );
|
||||
foreach ($monthsArray as $row) {
|
||||
if ($dCurrentMonth == $row && $dCurrentDay < $aStartDay[1]) {
|
||||
$startTime = $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
$aData['SCH_TIME_NEXT_RUN'] = date( 'Y' ) . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
|
||||
break;
|
||||
} else {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp);
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
||||
}
|
||||
}
|
||||
// print_r ($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
} else {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp);
|
||||
if ($sOption == '4') {
|
||||
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
|
||||
}
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
|
||||
if ($sOption == 5) {
|
||||
$aData['SCH_START_TIME'] = time();
|
||||
$aData['SCH_START_DATE'] = $aData['SCH_START_TIME'];
|
||||
$nextRun = $_POST['form']['SCH_REPEAT_EVERY'] * 60 * 60;
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
$date = $aData['SCH_START_TIME'];
|
||||
$date += $nextRun;
|
||||
$date = date( "Y-m-d H:i", $date );
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $date;
|
||||
}
|
||||
}
|
||||
// print_r ($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
} else {
|
||||
if ($sOption=='4'){
|
||||
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
|
||||
if (trim( $_POST['form']['SCH_END_DATE'] ) != '') {
|
||||
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
|
||||
}
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
|
||||
if ($sOption == 5) {
|
||||
$aData['SCH_START_TIME'] = time();
|
||||
$aData['SCH_START_DATE'] = $aData['SCH_START_TIME'];
|
||||
$nextRun = $_POST['form']['SCH_REPEAT_EVERY']*60*60;
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
$date = $aData['SCH_START_TIME'];
|
||||
$date += $nextRun;
|
||||
$date = date("Y-m-d H:i", $date );
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $date;
|
||||
|
||||
if (! empty( $_POST['form']['SCH_REPEAT_TASK_CHK'] )) {
|
||||
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
|
||||
if ($nOptEvery == 2)
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
|
||||
else
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
|
||||
}
|
||||
}
|
||||
if(trim($_POST['form']['SCH_END_DATE'])!=''){
|
||||
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
|
||||
}
|
||||
|
||||
if(!empty($_POST['form']['SCH_REPEAT_TASK_CHK'])){
|
||||
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
|
||||
if($nOptEvery ==2)
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
|
||||
else
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
if((isset($_POST['form']['CASE_SH_PLUGIN_UID']))&&($_POST['form']['CASE_SH_PLUGIN_UID']!="")){
|
||||
$aData['CASE_SH_PLUGIN_UID'] = $_POST['form']['CASE_SH_PLUGIN_UID'];
|
||||
}
|
||||
//$aData['SCH_END_DATE'] = "2020-12-30";
|
||||
$oCaseScheduler->create($aData);
|
||||
$sch_uid = $oCaseScheduler->getSchUid();
|
||||
|
||||
if((isset($_POST['form']['CASE_SH_PLUGIN_UID']))&&($_POST['form']['CASE_SH_PLUGIN_UID']!="")){
|
||||
$params=explode("--",$_REQUEST ['form']['CASE_SH_PLUGIN_UID']);
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins();
|
||||
|
||||
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){
|
||||
if(($caseSchedulerPluginDetail->sNamespace==$params[0])&&($caseSchedulerPluginDetail->sActionId==$params[1])){
|
||||
$caseSchedulerSelected=$caseSchedulerPluginDetail;
|
||||
|
||||
}
|
||||
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
||||
$aData['CASE_SH_PLUGIN_UID'] = $_POST['form']['CASE_SH_PLUGIN_UID'];
|
||||
}
|
||||
if((isset($caseSchedulerSelected))&&(is_object($caseSchedulerSelected))){
|
||||
//Save the form
|
||||
$oData=$_POST['pluginFields'];
|
||||
$oData['SCH_UID'] =$aData['SCH_UID'];
|
||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
|
||||
//$aData['SCH_END_DATE'] = "2020-12-30";
|
||||
$oCaseScheduler->create( $aData );
|
||||
$sch_uid = $oCaseScheduler->getSchUid();
|
||||
|
||||
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
||||
$params = explode( "--", $_REQUEST['form']['CASE_SH_PLUGIN_UID'] );
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
||||
|
||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
||||
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
||||
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
||||
|
||||
}
|
||||
}
|
||||
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
||||
//Save the form
|
||||
$oData = $_POST['pluginFields'];
|
||||
$oData['SCH_UID'] = $aData['SCH_UID'];
|
||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// //Added by Qennix
|
||||
// //Update Start Time Event in BPMN
|
||||
//
|
||||
// echo $_POST['form']['TAS_UID']."<<----";
|
||||
// if (isset($_POST['form']['TAS_UID'])){
|
||||
// require_once 'classes/model/Event.php';
|
||||
// require_once 'classes/model/Task.php';
|
||||
// echo $_POST['form']['TAS_UID']."<<----";
|
||||
//
|
||||
// $oTask = new Task();
|
||||
// $oTask->load($_POST['form']['TAS_UID']);
|
||||
// $evn_uid = $oTask->getStartingEvent();
|
||||
// $event = new Event();
|
||||
// $editEvent = array();
|
||||
// $editEvent['EVN_UID'] = $evn_uid;
|
||||
// $editEvent['EVN_ACTION'] = $sch_uid;
|
||||
// $event->update($editEvent);
|
||||
// //End Adding
|
||||
// }
|
||||
|
||||
G::header('location: cases_Scheduler_List?PRO_UID='.$_POST['form']['PRO_UID']);
|
||||
// //Added by Qennix
|
||||
// //Update Start Time Event in BPMN
|
||||
//
|
||||
// echo $_POST['form']['TAS_UID']."<<----";
|
||||
// if (isset($_POST['form']['TAS_UID'])){
|
||||
// require_once 'classes/model/Event.php';
|
||||
// require_once 'classes/model/Task.php';
|
||||
// echo $_POST['form']['TAS_UID']."<<----";
|
||||
//
|
||||
// $oTask = new Task();
|
||||
// $oTask->load($_POST['form']['TAS_UID']);
|
||||
// $evn_uid = $oTask->getStartingEvent();
|
||||
// $event = new Event();
|
||||
// $editEvent = array();
|
||||
// $editEvent['EVN_UID'] = $evn_uid;
|
||||
// $editEvent['EVN_ACTION'] = $sch_uid;
|
||||
// $event->update($editEvent);
|
||||
// //End Adding
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
G::header( 'location: cases_Scheduler_List?PRO_UID=' . $_POST['form']['PRO_UID'] );
|
||||
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -12,18 +12,17 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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 {
|
||||
/*
|
||||
/*
|
||||
global $RBAC;
|
||||
switch ($RBAC->userCanAccess('PM_FACTORY'))
|
||||
{
|
||||
@@ -40,245 +39,243 @@ try {
|
||||
}
|
||||
*/
|
||||
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
require_once 'classes/model/CaseScheduler.php';
|
||||
|
||||
if (empty( $_POST )) {
|
||||
die( 'The information sended is empty!' );
|
||||
}
|
||||
$aData['SCH_UID'] = $_POST['form']['SCH_UID'];
|
||||
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
|
||||
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
|
||||
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
|
||||
|
||||
if (empty($_POST)) {
|
||||
die('The information sended is empty!');
|
||||
}
|
||||
$aData['SCH_UID'] = $_POST['form']['SCH_UID'];
|
||||
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
|
||||
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
|
||||
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$oCaseScheduler->Load( $aData['SCH_UID'] );
|
||||
|
||||
$oCaseScheduler = new CaseScheduler();
|
||||
$oCaseScheduler->Load($aData['SCH_UID']);
|
||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
||||
if ($_POST['form']['SCH_USER_PASSWORD'] != 'DefaultPM') {
|
||||
$aData['SCH_DEL_USER_PASS'] = md5( $_POST['form']['SCH_USER_PASSWORD'] );
|
||||
}
|
||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
||||
|
||||
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
|
||||
if ($_POST['form']['SCH_USER_PASSWORD'] != 'DefaultPM'){
|
||||
$aData['SCH_DEL_USER_PASS'] = md5($_POST['form']['SCH_USER_PASSWORD']);
|
||||
}
|
||||
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
|
||||
// $aData['SCH_TIME_NEXT_RUN'] = time();
|
||||
//$aData['SCH_LAST_RUN_TIME'] = time();
|
||||
// $aData['SCH_STATE'] = 'ACTIVE';
|
||||
// $aData['SCH_LAST_STATE'] = 'ACTIVE';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
|
||||
// $aData['SCH_TIME_NEXT_RUN'] = time();
|
||||
//$aData['SCH_LAST_RUN_TIME'] = time();
|
||||
// $aData['SCH_STATE'] = 'ACTIVE';
|
||||
// $aData['SCH_LAST_STATE'] = 'ACTIVE';
|
||||
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
|
||||
$sOption = $_POST['form']['SCH_OPTION'];
|
||||
$aData['SCH_OPTION'] = $sOption;
|
||||
|
||||
$sOption = $_POST['form']['SCH_OPTION'];
|
||||
$aData['SCH_OPTION'] = $sOption;
|
||||
$sDateTmp = $_POST['form']['SCH_START_DATE'];
|
||||
$sTimeTmp = $_POST['form']['SCH_START_TIME'];
|
||||
$aData['SCH_START_TIME'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
||||
$aData['SCH_START_DATE'] = date( 'Y-m-d', strtotime( $sDateTmp ) ) . ' ' . date( 'H:i:s', strtotime( $sTimeTmp ) );
|
||||
$previousStartTime = date( 'Y-m-d', strtotime( $_POST['form']['PREV_SCH_START_DATE'] ) ) . ' ' . date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) );
|
||||
$previousStartDate = date( 'Y-m-d', strtotime( $_POST['form']['PREV_SCH_START_DATE'] ) ) . ' ' . date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) );
|
||||
|
||||
$sDateTmp = $_POST['form']['SCH_START_DATE'];
|
||||
$sTimeTmp = $_POST['form']['SCH_START_TIME'];
|
||||
$aData['SCH_START_TIME'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
|
||||
$aData['SCH_START_DATE'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
|
||||
$previousStartTime = date('Y-m-d', strtotime($_POST['form']['PREV_SCH_START_DATE'])) . ' ' . date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME']));
|
||||
$previousStartDate = date('Y-m-d', strtotime($_POST['form']['PREV_SCH_START_DATE'])) . ' ' . date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME']));
|
||||
$sValue = '';
|
||||
$sDaysPerformTask = '';
|
||||
$sWeeks = '';
|
||||
$sMonths = '';
|
||||
$sMonths = '';
|
||||
$sStartDay = '';
|
||||
$nSW = 0;
|
||||
|
||||
$sValue = '';
|
||||
$sDaysPerformTask = '';
|
||||
$sWeeks = '';
|
||||
$sMonths = '';
|
||||
$sMonths = '';
|
||||
$sStartDay = '';
|
||||
$nSW = 0;
|
||||
|
||||
switch($sOption){
|
||||
case '1' : // Option 1
|
||||
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
||||
switch($sValue){
|
||||
case '1' : $aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
|
||||
break;
|
||||
case '2' :
|
||||
$aData['SCH_OPTION'] = '2';
|
||||
$aData['SCH_EVERY_DAYS'] = '1';
|
||||
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
|
||||
break;
|
||||
case '3' : // Every [n] Days
|
||||
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '2' : // If the option is zero, set by default 1
|
||||
if(empty($_POST['form']['SCH_EVERY_DAYS']))
|
||||
$nEveryDays = 1;
|
||||
else
|
||||
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
|
||||
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
|
||||
$sWeeks = '';
|
||||
if(!empty($_POST['form']['SCH_WEEK_DAYS'])){
|
||||
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
|
||||
foreach($aWeekDays as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
}
|
||||
if(!empty($_POST['form']['SCH_WEEK_DAYS_2'])){
|
||||
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
|
||||
foreach($aWeekDays2 as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
}
|
||||
$sStartTime = $_POST['form']['SCH_START_TIME'];
|
||||
$aData['SCH_WEEK_DAYS'] = $sWeeks;
|
||||
break;
|
||||
|
||||
case '3' :
|
||||
$nStartDay = $_POST['form']['SCH_START_DAY'];
|
||||
if($nStartDay == 1){
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
|
||||
} else {
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
|
||||
}
|
||||
|
||||
$sMonths = '';
|
||||
if(!empty($_POST['form']['SCH_MONTHS'])){
|
||||
$aMonths = $_POST['form']['SCH_MONTHS'];
|
||||
foreach($aMonths as $value) {
|
||||
$sMonths = $sMonths . $value . '|' ;
|
||||
}
|
||||
}
|
||||
if(!empty($_POST['form']['SCH_MONTHS_2'])){
|
||||
$aMonths2 = $_POST['form']['SCH_MONTHS_2'];
|
||||
foreach($aMonths2 as $value) {
|
||||
$sMonths = $sMonths . $value . '|' ;
|
||||
}
|
||||
}
|
||||
if(!empty($_POST['form']['SCH_MONTHS_3'])){
|
||||
$aMonths3 = $_POST['form']['SCH_MONTHS_3'];
|
||||
foreach($aMonths3 as $value) {
|
||||
$sMonths = $sMonths . $value . '|' ;
|
||||
}
|
||||
}
|
||||
$aData['SCH_MONTHS'] = $sMonths;
|
||||
$sStartDay = $aData['SCH_START_DAY'];
|
||||
$sValue = $nStartDay;
|
||||
break;
|
||||
|
||||
}
|
||||
if(trim($_POST['form']['SCH_END_DATE'])!=''){
|
||||
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
|
||||
}
|
||||
// if the start date has changed then recalculate the next run time
|
||||
if ($_POST['form']['SCH_START_DATE']==$_POST['form']['PREV_SCH_START_DATE']) {
|
||||
$recalculateDate = false;
|
||||
} else {
|
||||
$recalculateDate = true;
|
||||
}
|
||||
if (date('H:i:s', strtotime($_POST['form']['SCH_START_TIME']))==date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME']))){
|
||||
$recalculateTime = false;
|
||||
} else {
|
||||
$recalculateTime = true;
|
||||
}
|
||||
// if the start date has changed then recalculate the next run time
|
||||
|
||||
// var_dump($recalculateTime);
|
||||
// die();
|
||||
$nActualTime = $_POST['form']['SCH_START_TIME'];
|
||||
if(($sOption!='1') && ($sOption!='4') && ($sOption!='5')) {
|
||||
if ($sStartDay==''){
|
||||
$sStartDay = date('Y-m-d');
|
||||
switch ($sOption) {
|
||||
case '1': // Option 1
|
||||
$sValue = $_POST['form']['SCH_DAYS_PERFORM_TASK'];
|
||||
switch ($sValue) {
|
||||
case '1':
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|1';
|
||||
break;
|
||||
case '2':
|
||||
$aData['SCH_OPTION'] = '2';
|
||||
$aData['SCH_EVERY_DAYS'] = '1';
|
||||
$aData['SCH_WEEK_DAYS'] = '1|2|3|4|5|';
|
||||
break;
|
||||
case '3': // Every [n] Days
|
||||
$sDaysPerformTask = $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
$aData['SCH_DAYS_PERFORM_TASK'] = $_POST['form']['SCH_DAYS_PERFORM_TASK'] . '|' . $_POST['form']['SCH_DAYS_PERFORM_TASK_OPT_3'];
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '2': // If the option is zero, set by default 1
|
||||
if (empty( $_POST['form']['SCH_EVERY_DAYS'] ))
|
||||
$nEveryDays = 1;
|
||||
else
|
||||
$nEveryDays = $_POST['form']['SCH_EVERY_DAYS'];
|
||||
$aData['SCH_EVERY_DAYS'] = $nEveryDays;
|
||||
$sWeeks = '';
|
||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS'] )) {
|
||||
$aWeekDays = $_POST['form']['SCH_WEEK_DAYS'];
|
||||
foreach ($aWeekDays as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
|
||||
$dCurrentDay = date("d");
|
||||
$dCurrentMonth = date("m");
|
||||
$aStartDay = explode( "|" , $aData['SCH_START_DAY'] );
|
||||
if($sOption=='3'&&$aStartDay[0]=='1'){
|
||||
$monthsArray = explode("|",$sMonths);
|
||||
foreach ($monthsArray as $row){
|
||||
if ( $dCurrentMonth == $row && $dCurrentDay<$aStartDay[1] ){
|
||||
$startTime = $_POST['form']['SCH_START_TIME'].":00";
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = date('Y') . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
|
||||
} else if ($recalculateTime){
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp);
|
||||
} else if ($recalculateTime){
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty( $_POST['form']['SCH_WEEK_DAYS_2'] )) {
|
||||
$aWeekDays2 = $_POST['form']['SCH_WEEK_DAYS_2'];
|
||||
foreach ($aWeekDays2 as $value) {
|
||||
$sWeeks = $sWeeks . $value . '|';
|
||||
}
|
||||
}
|
||||
$sStartTime = $_POST['form']['SCH_START_TIME'];
|
||||
$aData['SCH_WEEK_DAYS'] = $sWeeks;
|
||||
break;
|
||||
|
||||
case '3':
|
||||
$nStartDay = $_POST['form']['SCH_START_DAY'];
|
||||
if ($nStartDay == 1) {
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_1'];
|
||||
} else {
|
||||
$aData['SCH_START_DAY'] = $nStartDay . '|' . $_POST['form']['SCH_START_DAY_OPT_2_WEEKS'] . '|' . $_POST['form']['SCH_START_DAY_OPT_2_DAYS_WEEK'];
|
||||
}
|
||||
|
||||
$sMonths = '';
|
||||
if (! empty( $_POST['form']['SCH_MONTHS'] )) {
|
||||
$aMonths = $_POST['form']['SCH_MONTHS'];
|
||||
foreach ($aMonths as $value) {
|
||||
$sMonths = $sMonths . $value . '|';
|
||||
}
|
||||
}
|
||||
if (! empty( $_POST['form']['SCH_MONTHS_2'] )) {
|
||||
$aMonths2 = $_POST['form']['SCH_MONTHS_2'];
|
||||
foreach ($aMonths2 as $value) {
|
||||
$sMonths = $sMonths . $value . '|';
|
||||
}
|
||||
}
|
||||
if (! empty( $_POST['form']['SCH_MONTHS_3'] )) {
|
||||
$aMonths3 = $_POST['form']['SCH_MONTHS_3'];
|
||||
foreach ($aMonths3 as $value) {
|
||||
$sMonths = $sMonths . $value . '|';
|
||||
}
|
||||
}
|
||||
$aData['SCH_MONTHS'] = $sMonths;
|
||||
$sStartDay = $aData['SCH_START_DAY'];
|
||||
$sValue = $nStartDay;
|
||||
break;
|
||||
|
||||
}
|
||||
if (trim( $_POST['form']['SCH_END_DATE'] ) != '') {
|
||||
$aData['SCH_END_DATE'] = $_POST['form']['SCH_END_DATE'];
|
||||
}
|
||||
// if the start date has changed then recalculate the next run time
|
||||
if ($_POST['form']['SCH_START_DATE'] == $_POST['form']['PREV_SCH_START_DATE']) {
|
||||
$recalculateDate = false;
|
||||
} else {
|
||||
$recalculateDate = true;
|
||||
}
|
||||
if (date( 'H:i:s', strtotime( $_POST['form']['SCH_START_TIME'] ) ) == date( 'H:i:s', strtotime( $_POST['form']['PREV_SCH_START_TIME'] ) )) {
|
||||
$recalculateTime = false;
|
||||
} else {
|
||||
$recalculateTime = true;
|
||||
}
|
||||
// if the start date has changed then recalculate the next run time
|
||||
|
||||
|
||||
// var_dump($recalculateTime);
|
||||
// die();
|
||||
$nActualTime = $_POST['form']['SCH_START_TIME'];
|
||||
if (($sOption != '1') && ($sOption != '4') && ($sOption != '5')) {
|
||||
if ($sStartDay == '') {
|
||||
$sStartDay = date( 'Y-m-d' );
|
||||
}
|
||||
// echo $sOption."*". $sValue."*". $nActualTime."*". $sDaysPerformTask."*". $sWeeks."*". $sStartDay ."*". $sMonths."<br>";
|
||||
$dCurrentDay = date( "d" );
|
||||
$dCurrentMonth = date( "m" );
|
||||
$aStartDay = explode( "|", $aData['SCH_START_DAY'] );
|
||||
if ($sOption == '3' && $aStartDay[0] == '1') {
|
||||
$monthsArray = explode( "|", $sMonths );
|
||||
foreach ($monthsArray as $row) {
|
||||
if ($dCurrentMonth == $row && $dCurrentDay < $aStartDay[1]) {
|
||||
$startTime = $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = date( 'Y' ) . '-' . $row . '-' . $aStartDay[1] . ' ' . $startTime;
|
||||
} else if ($recalculateTime) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
break;
|
||||
} else {
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun($sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp);
|
||||
} else if ($recalculateTime){
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
||||
} else if ($recalculateTime) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
}
|
||||
// print_r ($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
}
|
||||
} else {
|
||||
if ($sOption=='4'){
|
||||
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
|
||||
}
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
|
||||
} else if ($recalculateTime){
|
||||
|
||||
// $Fields = $oCaseScheduler->Load($aData['SCH_UID']);
|
||||
// $Fields['SCH_LAST_STATE'] = $aRow['SCH_STATE'];
|
||||
// $Fields['SCH_STATE'] = 'PROCESSED';
|
||||
// $this->Update($Fields);
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun("Y-m-d"). " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
// var_dump($recalculateTime);
|
||||
// var_dump($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
if ($sOption=='5') {
|
||||
$date = $oCaseScheduler->getSchLastRunTime();
|
||||
if ($date == null) {
|
||||
$date = $oCaseScheduler->getSchStartTime();
|
||||
}
|
||||
$date = strtotime($date);
|
||||
$nextRun = $_POST['form']['SCH_REPEAT_EVERY']*60*60;
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
$date += $nextRun;
|
||||
$date = date("Y-m-d H:i", $date );
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $date;
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->updateNextRun( $sOption, $sValue, $nActualTime, $sDaysPerformTask, $sWeeks, $sStartDay, $sMonths, $sDateTmp );
|
||||
} else if ($recalculateTime) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
}
|
||||
// print_r ($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
} else {
|
||||
if ($sOption == '4') {
|
||||
$aData['SCH_END_DATE'] = $aData['SCH_START_TIME'];
|
||||
}
|
||||
if ($recalculateDate) {
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $aData['SCH_START_TIME'];
|
||||
} else if ($recalculateTime) {
|
||||
|
||||
if(!empty($_POST['form']['SCH_REPEAT_TASK_CHK'])){
|
||||
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
|
||||
if($nOptEvery ==2)
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
|
||||
else
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
|
||||
|
||||
}
|
||||
// var_dump ($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
$oCaseScheduler ->Update($aData);
|
||||
if((isset($_POST['form']['CASE_SH_PLUGIN_UID']))&&($_POST['form']['CASE_SH_PLUGIN_UID']!="")){
|
||||
$params=explode("--",$_REQUEST ['form']['CASE_SH_PLUGIN_UID']);
|
||||
$oPluginRegistry =& PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler=$oPluginRegistry->getCaseSchedulerPlugins();
|
||||
|
||||
foreach($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail){
|
||||
if(($caseSchedulerPluginDetail->sNamespace==$params[0])&&($caseSchedulerPluginDetail->sActionId==$params[1])){
|
||||
$caseSchedulerSelected=$caseSchedulerPluginDetail;
|
||||
|
||||
}
|
||||
// $Fields = $oCaseScheduler->Load($aData['SCH_UID']);
|
||||
// $Fields['SCH_LAST_STATE'] = $aRow['SCH_STATE'];
|
||||
// $Fields['SCH_STATE'] = 'PROCESSED';
|
||||
// $this->Update($Fields);
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $oCaseScheduler->getSchTimeNextRun( "Y-m-d" ) . " " . $_POST['form']['SCH_START_TIME'] . ":00";
|
||||
}
|
||||
// var_dump($recalculateTime);
|
||||
// var_dump($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
if ($sOption == '5') {
|
||||
$date = $oCaseScheduler->getSchLastRunTime();
|
||||
if ($date == null) {
|
||||
$date = $oCaseScheduler->getSchStartTime();
|
||||
}
|
||||
$date = strtotime( $date );
|
||||
$nextRun = $_POST['form']['SCH_REPEAT_EVERY'] * 60 * 60;
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
$date += $nextRun;
|
||||
$date = date( "Y-m-d H:i", $date );
|
||||
$aData['SCH_TIME_NEXT_RUN'] = $date;
|
||||
}
|
||||
}
|
||||
if((isset($caseSchedulerSelected))&&(is_object($caseSchedulerSelected))){
|
||||
//Save the form
|
||||
$oData=$_POST['pluginFields'];
|
||||
$oData['SCH_UID'] =$aData['SCH_UID'];
|
||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
|
||||
|
||||
if (! empty( $_POST['form']['SCH_REPEAT_TASK_CHK'] )) {
|
||||
$nOptEvery = $_POST['form']['SCH_REPEAT_EVERY_OPT'];
|
||||
if ($nOptEvery == 2)
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'] * 60;
|
||||
else
|
||||
$aData['SCH_REPEAT_EVERY'] = $_POST['form']['SCH_REPEAT_EVERY'];
|
||||
|
||||
}
|
||||
}
|
||||
// var_dump ($aData['SCH_TIME_NEXT_RUN']);
|
||||
// die;
|
||||
$oCaseScheduler->Update( $aData );
|
||||
if ((isset( $_POST['form']['CASE_SH_PLUGIN_UID'] )) && ($_POST['form']['CASE_SH_PLUGIN_UID'] != "")) {
|
||||
$params = explode( "--", $_REQUEST['form']['CASE_SH_PLUGIN_UID'] );
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
$activePluginsForCaseScheduler = $oPluginRegistry->getCaseSchedulerPlugins();
|
||||
|
||||
G::header('location: cases_Scheduler_List?PRO_UID='.$_POST['form']['PRO_UID']);
|
||||
foreach ($activePluginsForCaseScheduler as $key => $caseSchedulerPluginDetail) {
|
||||
if (($caseSchedulerPluginDetail->sNamespace == $params[0]) && ($caseSchedulerPluginDetail->sActionId == $params[1])) {
|
||||
$caseSchedulerSelected = $caseSchedulerPluginDetail;
|
||||
|
||||
}
|
||||
}
|
||||
if ((isset( $caseSchedulerSelected )) && (is_object( $caseSchedulerSelected ))) {
|
||||
//Save the form
|
||||
$oData = $_POST['pluginFields'];
|
||||
$oData['SCH_UID'] = $aData['SCH_UID'];
|
||||
$oPluginRegistry->executeMethod( $caseSchedulerPluginDetail->sNamespace, $caseSchedulerPluginDetail->sActionSave, $oData );
|
||||
}
|
||||
}
|
||||
|
||||
G::header( 'location: cases_Scheduler_List?PRO_UID=' . $_POST['form']['PRO_UID'] );
|
||||
|
||||
} catch (Exception $oException) {
|
||||
die( $oException->getMessage() );
|
||||
}
|
||||
catch (Exception $oException) {
|
||||
die($oException->getMessage());
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
@@ -12,15 +12,14 @@
|
||||
*
|
||||
* 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
|
||||
* 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/>.
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* Created on 13-02-2008
|
||||
@@ -28,70 +27,63 @@
|
||||
* @author David Callizaya <davidsantos@colosa.com>
|
||||
*/
|
||||
|
||||
require_once ( "classes/model/AppDocumentPeer.php" );
|
||||
require_once ("classes/model/AppDocumentPeer.php");
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
if(!isset($_GET['v'])){//Load last version of the document
|
||||
$docVersion=$oAppDocument->getLastAppDocVersion($_GET['a']);
|
||||
}else{
|
||||
$docVersion=$_GET['v'];
|
||||
if (! isset( $_GET['v'] )) {
|
||||
//Load last version of the document
|
||||
$docVersion = $oAppDocument->getLastAppDocVersion( $_GET['a'] );
|
||||
} else {
|
||||
$docVersion = $_GET['v'];
|
||||
}
|
||||
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],$docVersion);
|
||||
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], $docVersion );
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$ext = $info['extension'];
|
||||
|
||||
if (isset($_GET['b'])) {
|
||||
if (isset( $_GET['b'] )) {
|
||||
if ($_GET['b'] == '0') {
|
||||
$bDownload = false;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$bDownload = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$bDownload = true;
|
||||
}
|
||||
|
||||
|
||||
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid .'_'.$iDocVersion . '.' . $ext ;
|
||||
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext ;
|
||||
$sw_file_exists=false;
|
||||
if(file_exists($realPath)){
|
||||
$sw_file_exists=true;
|
||||
}elseif(file_exists($realPath1)){
|
||||
$sw_file_exists=true;
|
||||
$realPath=$realPath1;
|
||||
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '_' . $iDocVersion . '.' . $ext;
|
||||
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/' . $sAppDocUid . '.' . $ext;
|
||||
$sw_file_exists = false;
|
||||
if (file_exists( $realPath )) {
|
||||
$sw_file_exists = true;
|
||||
} elseif (file_exists( $realPath1 )) {
|
||||
$sw_file_exists = true;
|
||||
$realPath = $realPath1;
|
||||
}
|
||||
|
||||
if(!$sw_file_exists){
|
||||
$error_message="'".$oAppDocument->Fields['APP_DOC_FILENAME']. "' ".G::LoadTranslation('ID_ERROR_STREAMING_FILE');
|
||||
if((isset($_POST['request']))&&($_POST['request']==true)){
|
||||
$res ['success'] = 'failure';
|
||||
$res ['message'] = $error_message;
|
||||
print G::json_encode ( $res );
|
||||
}else{
|
||||
G::SendMessageText($error_message, "ERROR");
|
||||
$backUrlObj=explode("sys".SYS_SYS,$_SERVER['HTTP_REFERER']);
|
||||
G::header("location: "."/sys".SYS_SYS.$backUrlObj[1]);
|
||||
die;
|
||||
if (! $sw_file_exists) {
|
||||
$error_message = "'" . $oAppDocument->Fields['APP_DOC_FILENAME'] . "' " . G::LoadTranslation( 'ID_ERROR_STREAMING_FILE' );
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'failure';
|
||||
$res['message'] = $error_message;
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::SendMessageText( $error_message, "ERROR" );
|
||||
$backUrlObj = explode( "sys" . SYS_SYS, $_SERVER['HTTP_REFERER'] );
|
||||
G::header( "location: " . "/sys" . SYS_SYS . $backUrlObj[1] );
|
||||
die();
|
||||
}
|
||||
|
||||
}else{
|
||||
if((isset($_POST['request']))&&($_POST['request']==true)){
|
||||
$res ['success'] = 'success';
|
||||
$res ['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
|
||||
print G::json_encode ( $res );
|
||||
}else{
|
||||
G::streamFile ( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
|
||||
} else {
|
||||
if ((isset( $_POST['request'] )) && ($_POST['request'] == true)) {
|
||||
$res['success'] = 'success';
|
||||
$res['message'] = $oAppDocument->Fields['APP_DOC_FILENAME'];
|
||||
print G::json_encode( $res );
|
||||
} else {
|
||||
G::streamFile( $realPath, $bDownload, $oAppDocument->Fields['APP_DOC_FILENAME'] );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
@@ -4,107 +4,97 @@
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
require_once ( "classes/model/AdditionalTables.php" );
|
||||
require_once ( "classes/model/Fields.php" );
|
||||
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 = 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);
|
||||
$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'] : '';
|
||||
$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'] : ''));
|
||||
$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));
|
||||
$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);
|
||||
$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" );
|
||||
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 = 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 = ApplicationPeer::doSelectRS( $Criteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aProcesses = array();
|
||||
$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);
|
||||
$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');
|
||||
$con = Propel::getConnection( 'workflow' );
|
||||
$stmt = $con->createStatement();
|
||||
$rs = $stmt->executeQuery($sql, ResultSet::FETCHMODE_ASSOC);
|
||||
$rs = $stmt->executeQuery( $sql, ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$i++;
|
||||
// if ( $i == 100 ) die;
|
||||
/* if ( strpos ( $aRow['APP_DATA'], 'cedula' ) !== false ) {
|
||||
$i ++;
|
||||
// if ( $i == 100 ) die;
|
||||
/* if ( strpos ( $aRow['APP_DATA'], 'cedula' ) !== false ) {
|
||||
print_r ( $aRow );
|
||||
print "<hr>";
|
||||
$i++;
|
||||
if ( $i == 10 ) die;
|
||||
}
|
||||
*/
|
||||
$oDataset->next();
|
||||
$oDataset->next();
|
||||
}
|
||||
print "--$i--";
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user