CODE STYLE Formating workflow/engine/methods/cases

Change format files in workflow/engine/methods/cases
This commit is contained in:
norahmollo
2012-10-18 16:05:43 +00:00
parent 2cb0b136d1
commit fd5ff3da77
37 changed files with 5031 additions and 4881 deletions

View File

@@ -167,3 +167,4 @@ catch ( Exception $e ){
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage('publish');
}

View File

@@ -12,138 +12,128 @@
*
* 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.
*
*/
$actionAjax = isset($_REQUEST['actionAjax'])?$_REQUEST['actionAjax']: null;
function casesShowOuputDocumentExist($url){
$urlArray = explode("?",$url);
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
function casesShowOuputDocumentExist ($url)
{
$urlArray = explode( "?", $url );
$urlParametroString = $urlArray[1];
parse_str($urlParametroString, $_GET);
parse_str( $urlParametroString, $_GET );
require_once ("classes/model/AppDocumentPeer.php");
require_once ( "classes/model/AppDocumentPeer.php" );
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],(isset($_GET['v']) )? $_GET['v'] : NULL );
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (!isset($_GET['ext'])) {
if (! isset( $_GET['ext'] )) {
$ext = $info['extension'];
}
else {
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
}
else {
} else {
$ext = $info['extension'];
}
}
$ver= (isset($_GET['v']) && $_GET['v']!='') ? '_'.$_GET['v'] : '';
if(!$ver) //This code is in the case the outputdocument won't be versioned
$ver='_1';
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid .$ver. '.' . $ext ;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] .$ver. '.' . $ext ;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename']. '.' . $ext ;
$sw_file_exists=false;
if(file_exists($realPath)){
$sw_file_exists=true;
}elseif(file_exists($realPath1)){
$sw_file_exists=true;
$realPath=$realPath1;
}elseif(file_exists($realPath2)){
$sw_file_exists=true;
$realPath=$realPath2;
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
if (! $ver) //This code is in the case the outputdocument won't be versioned
$ver = '_1';
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . '.' . $ext;
$sw_file_exists = false;
if (file_exists( $realPath )) {
$sw_file_exists = true;
} elseif (file_exists( $realPath1 )) {
$sw_file_exists = true;
$realPath = $realPath1;
} elseif (file_exists( $realPath2 )) {
$sw_file_exists = true;
$realPath = $realPath2;
}
$swFileExist = 0;
if($sw_file_exists){
if ($sw_file_exists) {
$swFileExist = 1;
}
return $swFileExist;
}
if($actionAjax=='casesGenerateDocumentPage'){
global $G_PUBLISH;
$oHeadPublisher =& headPublisher::getSingleton();
G::loadClass('configuration');
$conf = new Configurations;
$oHeadPublisher->addExtJsScript('cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent ('cases/casesGenerateDocumentPage'); //adding a html file .html.
$oHeadPublisher->assign('pageSize', $conf->getEnvSetting('casesListRowNumber'));
G::RenderPage('publish', 'extJs');
}
if($actionAjax=='generateDocumentGrid_Ajax'){
G::LoadClass('case');
G::LoadClass("BasePeer" );
global $G_PUBLISH;
$oCase = new Cases();
$aProcesses = Array();
}
return $swFileExist;
}
$G_PUBLISH = new Publisher();
$c = $oCase->getAllGeneratedDocumentsCriteria($_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED']);
if ( $c->getDbName() == 'dbarray' ){
$rs = ArrayBasePeer::doSelectRs ($c);
}
else{
$rs = GulliverBasePeer::doSelectRs ($c);
}
$rs->setFetchmode (ResultSet::FETCHMODE_ASSOC);
$rs->next();
$totalCount = 0;
for($j=0;$j< $rs->getRecordCount() ;$j++) {
$result = $rs->getRow();
$result["FILEDOCEXIST"] = casesShowOuputDocumentExist($result["FILEDOC"]);
$result["FILEPDFEXIST"] = casesShowOuputDocumentExist($result["FILEPDF"]);
$aProcesses[] = $result;
if ($actionAjax == 'casesGenerateDocumentPage') {
global $G_PUBLISH;
$rs->next();
$totalCount++;
}
//!dateFormat
G::LoadClass ( 'configuration' );
$conf = new Configurations();
try {
$generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '' );
}
catch (Exception $e){
$generalConfCasesList = array();
}
$dateFormat = "";
if (isset($generalConfCasesList['casesListDateFormat'])&&!empty($generalConfCasesList['casesListDateFormat'])) {
$oHeadPublisher = & headPublisher::getSingleton();
G::loadClass( 'configuration' );
$conf = new Configurations();
$oHeadPublisher->addExtJsScript( 'cases/casesGenerateDocumentPage', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesGenerateDocumentPage' ); //adding a html file .html.
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
G::RenderPage( 'publish', 'extJs' );
}
if ($actionAjax == 'generateDocumentGrid_Ajax') {
G::LoadClass( 'case' );
G::LoadClass( "BasePeer" );
global $G_PUBLISH;
$oCase = new Cases();
$aProcesses = Array ();
$G_PUBLISH = new Publisher();
$c = $oCase->getAllGeneratedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
if ($c->getDbName() == 'dbarray') {
$rs = ArrayBasePeer::doSelectRs( $c );
} else {
$rs = GulliverBasePeer::doSelectRs( $c );
}
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
$totalCount = 0;
for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
$result = $rs->getRow();
$result["FILEDOCEXIST"] = casesShowOuputDocumentExist( $result["FILEDOC"] );
$result["FILEPDFEXIST"] = casesShowOuputDocumentExist( $result["FILEPDF"] );
$aProcesses[] = $result;
$rs->next();
$totalCount ++;
}
//!dateFormat
G::LoadClass( 'configuration' );
$conf = new Configurations();
try {
$generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
} catch (Exception $e) {
$generalConfCasesList = array ();
}
$dateFormat = "";
if (isset( $generalConfCasesList['casesListDateFormat'] ) && ! empty( $generalConfCasesList['casesListDateFormat'] )) {
$dateFormat = $generalConfCasesList['casesListDateFormat'];
}
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath( $newDir );
$r->data = $aProcesses;
$r->totalCount = $totalCount;
$r->dataFormat = $dateFormat;
echo G::json_encode( $r );
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath ( $newDir );
$r->data = $aProcesses;
$r->totalCount = $totalCount;
$r->dataFormat = $dateFormat;
echo G::json_encode($r);
}
?>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +1,31 @@
<script>
if (typeof window.parent != 'undefined') {
<?php
if (isset($_GET['ux'])) {
switch ($_GET['ux']) {
case 'SIMPLIFIED':
case 'SWITCHABLE':
case 'SINGLE':
$url = '../home';
break;
default:
$url = 'casesListExtJs';
}
}
else {
$url = 'casesListExtJs';
}
if (isset($_GET['ux'])) {
echo 'if (typeof window.parent.ux_env != \'undefined\') {';
}
echo " window.parent.location.href = '$url';";
if (isset($_GET['ux'])) {
echo '} else { window.parent.location.href = \'casesListExtJs\'; }';
}
<?php
if (isset( $_GET['ux'] )) {
switch ($_GET['ux']) {
case 'SIMPLIFIED':
case 'SWITCHABLE':
case 'SINGLE':
$url = '../home';
break;
default:
$url = 'casesListExtJs';
}
} else {
$url = 'casesListExtJs';
}
if (isset( $_GET['ux'] )) {
echo 'if (typeof window.parent.ux_env != \'undefined\') {';
}
echo " window.parent.location.href = '$url';";
if (isset( $_GET['ux'] )) {
echo '} else { window.parent.location.href = \'casesListExtJs\'; }';
}
?>
}
</script>
</script>

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
<?php
<?php
/**
* cases_SaveData.php
*
@@ -12,73 +12,72 @@
*
* 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 ();
/* @author Alvaro Campos Sanchez */
/* Includes */
G::LoadClass ( 'case' );
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'] );
$Fields ['APP_DATA'] = array_merge ( $Fields ['APP_DATA'], G::getSystemConstants () );
$Fields ['APP_DATA'] = array_merge ( $Fields ['APP_DATA'], ( array ) $_POST ['form'] );
$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'], (array) $_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
$trigger_debug_session = $_SESSION['TRIGGER_DEBUG']['ISSET']; #here we must verify if is a debugg session
#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' );
$_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
$_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' );
$_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
}
//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 ();
$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['STEP_POSITION'] = $aNextStep['POSITION'];
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep ['PAGE'];
$_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep['PAGE'];
if ($trigger_debug_session) {
$_SESSION ['TRIGGER_DEBUG'] ['BREAKPAGE'] = $aNextStep ['PAGE'];
$aNextStep ['PAGE'] = $aNextStep ['PAGE'] . '&breakpoint=triggerdebug';
$_SESSION['TRIGGER_DEBUG']['BREAKPAGE'] = $aNextStep['PAGE'];
$aNextStep['PAGE'] = $aNextStep['PAGE'] . '&breakpoint=triggerdebug';
}
G::header ( 'location: ' . $aNextStep ['PAGE'] );
G::header( 'location: ' . $aNextStep['PAGE'] );

View File

@@ -1,44 +1,42 @@
<?php
/**
* casesSchedulerLog_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
<?php
/**
* casesSchedulerLog_Ajax.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
//if (($RBAC_Response=$RBAC->userCanAccess("PM_USERS"))!=1) return $RBAC_Response;
G::LoadInclude('ajax');
$_POST['action'] = get_ajax_value('action');
switch ($_POST['action'])
{
case 'updatePageSize':
G::LoadClass('configuration');
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date('Y-m-d H:i:s');
$config = Array();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']);
echo '{success: true}';
break;
break;
}
?>
G::LoadInclude( 'ajax' );
$_POST['action'] = get_ajax_value( 'action' );
switch ($_POST['action']) {
case 'updatePageSize':
G::LoadClass( 'configuration' );
$c = new Configurations();
$arr['pageSize'] = $_REQUEST['size'];
$arr['dateSave'] = date( 'Y-m-d H:i:s' );
$config = Array ();
$config[] = $arr;
$c->aConfig = $config;
$c->saveConfig( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
echo '{success: true}';
break;
break;
}

View File

@@ -1,47 +1,48 @@
<?php
unset($_SESSION['__currentTabDashboard']);
if(isset($_GET['action'])){
$_SESSION['__currentTabDashboard']=$_GET['action'];
}
$page="";
if(isset($_GET['action'])){
$page=$_GET['action'];
}
$oHeadPublisher =& headPublisher::getSingleton();
global $RBAC;
switch($page){
case "startCase":
$oHeadPublisher->addExtJsScript('cases/casesStartCase', true); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesStartCase'); //adding a html file .html.
G::LoadClass('configuration');
$c = new Configurations();
$oHeadPublisher->assign('FORMATS',$c->getFormats());
break;
case "documents":
G::LoadClass('configuration');
$c = new Configurations();
$configPage = $c->getConfiguration('documentsModule', 'pageSize','',$_SESSION['USER_LOGGED']);
$configEnv = $c->getConfiguration('ENVIRONMENT_SETTINGS', '');
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
$oHeadPublisher->assign('CONFIG', $Config);
$oHeadPublisher->assign('FORMATS',$c->getFormats());
$oHeadPublisher->assign('permitodelete' ,$RBAC->userCanAccess('PM_FOLDER_DELETE') );
$oHeadPublisher->assign('permitoaddfile' ,$RBAC->userCanAccess('PM_FOLDERS_ADD_FILE') );
$oHeadPublisher->assign('permitoaddfolder',$RBAC->userCanAccess('PM_FOLDERS_ADD_FOLDER'));
$oHeadPublisher->addExtJsScript('cases/casesDocuments', false); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesDocuments'); //adding a html file .html.
break;
default:
$oHeadPublisher->addExtJsScript('cases/casesStartPage', false); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesStartPage'); //adding a html file .html.
break;
}
G::RenderPage('publish', 'extJs');
<?php
unset( $_SESSION['__currentTabDashboard'] );
if (isset( $_GET['action'] )) {
$_SESSION['__currentTabDashboard'] = $_GET['action'];
}
$page = "";
if (isset( $_GET['action'] )) {
$page = $_GET['action'];
}
$oHeadPublisher = & headPublisher::getSingleton();
global $RBAC;
switch ($page) {
case "startCase":
$oHeadPublisher->addExtJsScript( 'cases/casesStartCase', true ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesStartCase' ); //adding a html file .html.
G::LoadClass( 'configuration' );
$c = new Configurations();
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
break;
case "documents":
G::LoadClass( 'configuration' );
$c = new Configurations();
$configPage = $c->getConfiguration( 'documentsModule', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$configEnv = $c->getConfiguration( 'ENVIRONMENT_SETTINGS', '' );
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
$oHeadPublisher->assign( 'CONFIG', $Config );
$oHeadPublisher->assign( 'FORMATS', $c->getFormats() );
$oHeadPublisher->assign( 'permitodelete', $RBAC->userCanAccess( 'PM_FOLDER_DELETE' ) );
$oHeadPublisher->assign( 'permitoaddfile', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FILE' ) );
$oHeadPublisher->assign( 'permitoaddfolder', $RBAC->userCanAccess( 'PM_FOLDERS_ADD_FOLDER' ) );
$oHeadPublisher->addExtJsScript( 'cases/casesDocuments', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesDocuments' ); //adding a html file .html.
break;
default:
$oHeadPublisher->addExtJsScript( 'cases/casesStartPage', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesStartPage' ); //adding a html file .html.
break;
}
G::RenderPage( 'publish', 'extJs' );

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,14 @@
<?php
<?php
// $oHeadPublisher =& headPublisher::getSingleton();
// $TRANSLATIONS = array_merge($TRANSLATIONS, $TRANSLATIONS2);
$delIndex = $_GET['DEL_INDEX'];
$appUid = $_GET['APP_UID'];
$delIndex = $_GET['DEL_INDEX'];
$appUid = $_GET['APP_UID'];
// $oHeadPublisher->assign( 'TRANSLATIONS', $TRANSLATIONS); //translations
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID='.$appUid.'&DEL_INDEX='.$delIndex;
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl); //translations
$oHeadPublisher->assign( 'treeTitle', G::loadtranslation('ID_STEP_LIST')); //translations
$oHeadPublisher->addExtJsScript('cases/casesToRevisePanel', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesToRevisePanel'); //adding a html file .html.
G::RenderPage('publish', 'extJs');
$casesPanelUrl = 'casesToReviseTreeContent?APP_UID=' . $appUid . '&DEL_INDEX=' . $delIndex;
$oHeadPublisher->assign( 'casesPanelUrl', $casesPanelUrl ); //translations
$oHeadPublisher->assign( 'treeTitle', G::loadtranslation( 'ID_STEP_LIST' ) ); //translations
$oHeadPublisher->addExtJsScript( 'cases/casesToRevisePanel', false ); //adding a javascript file .js
$oHeadPublisher->addContent( 'cases/casesToRevisePanel' ); //adding a html file .html.
G::RenderPage( 'publish', 'extJs' );

View File

@@ -1,93 +1,99 @@
<?php
class TreeNode {
public $text = "";
public $id = "";
public $iconCls = "";
public $leaf = true;
public $draggable = false;
public $href = "#";
public $hrefTarget = "";
function __construct($id,$text,$iconCls,$leaf,$draggable,$href,$hrefTarget) {
$this->id = $id;
$this->text = $text;
$this->iconCls = $iconCls;
$this->leaf = $leaf;
$this->draggable = $draggable;
$this->href = $href;
$this->hrefTarget = $hrefTarget;
}
function toJson() {
return G::json_encode($this);
}
}
class ExtJsTreeNode extends TreeNode {
public $children = array();
function add($object) {
$this->children[] = $object;
}
function toJson() {
return G::json_encode($this);
}
}
G::LoadClass('case');
$o = new Cases();
$PRO_UID = $_SESSION['PROCESS'];
$treeArray = array();
<?php
class TreeNode
{
public $text = "";
public $id = "";
public $iconCls = "";
public $leaf = true;
public $draggable = false;
public $href = "#";
public $hrefTarget = "";
function __construct ($id, $text, $iconCls, $leaf, $draggable, $href, $hrefTarget)
{
$this->id = $id;
$this->text = $text;
$this->iconCls = $iconCls;
$this->leaf = $leaf;
$this->draggable = $draggable;
$this->href = $href;
$this->hrefTarget = $hrefTarget;
}
function toJson ()
{
return G::json_encode( $this );
}
}
class ExtJsTreeNode extends TreeNode
{
public $children = array ();
function add ($object)
{
$this->children[] = $object;
}
function toJson ()
{
return G::json_encode( $this );
}
}
G::LoadClass( 'case' );
$o = new Cases();
$PRO_UID = $_SESSION['PROCESS'];
$treeArray = array ();
//if (isset($_GET['action'])&&$_GET['action']=='test'){
echo "[";
// dynaforms assemble
$extTreeDynaforms = new ExtJsTreeNode("node-dynaforms", G::loadtranslation('ID_DYNAFORMS'), "", false, false, "", "");
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllDynaformsStepsToRevise($_GET['APP_UID']);
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/Dynaform.php';
$od = new Dynaform();
$dynaformF = $od->Load($step['STEP_UID_OBJ']);
$n = $step['STEP_POSITION'];
$TITLE = " - ".$dynaformF['DYN_TITLE'];
$DYN_UID = $dynaformF['DYN_UID'];
$href = "cases_StepToRevise?type=DYNAFORM&ex=$i&PRO_UID=$PRO_UID&DYN_UID=$DYN_UID&APP_UID=$APP_UID&position=".$step['STEP_POSITION']."&DEL_INDEX=$DEL_INDEX";
$extTreeDynaforms->add(new TreeNode($DYN_UID,$TITLE,"datasource",true,false,$href,"openCaseFrame"));
$i++;
$steps->next();
}
echo $extTreeDynaforms->toJson();
// end the dynaforms tree menu
echo ",";
// assembling the input documents tree menu
$extTreeInputDocs = new ExtJsTreeNode("node-input-documents", G::loadtranslation('ID_REQUEST_DOCUMENTS'), "", false, false, "", "");
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllInputsStepsToRevise($_GET['APP_UID']);
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/InputDocument.php';
$od = new InputDocument();
$IDF = $od->Load($step['STEP_UID_OBJ']);
$n = $step['STEP_POSITION'];
$TITLE = " - ".$IDF['INP_DOC_TITLE'];
$INP_DOC_UID = $IDF['INP_DOC_UID'];
$href = "cases_StepToReviseInputs?type=INPUT_DOCUMENT&ex=$i&PRO_UID=$PRO_UID&INP_DOC_UID=$INP_DOC_UID&APP_UID=$APP_UID&position=".$step['STEP_POSITION']."&DEL_INDEX=$DEL_INDEX";
$extTreeInputDocs->add(new TreeNode($INP_DOC_UID,$TITLE,"datasource",true,false,$href,"openCaseFrame"));
$i++;
$steps->next();
}
echo $extTreeInputDocs->toJson();
echo "]";
echo "[";
// dynaforms assemble
$extTreeDynaforms = new ExtJsTreeNode( "node-dynaforms", G::loadtranslation( 'ID_DYNAFORMS' ), "", false, false, "", "" );
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllDynaformsStepsToRevise( $_GET['APP_UID'] );
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/Dynaform.php';
$od = new Dynaform();
$dynaformF = $od->Load( $step['STEP_UID_OBJ'] );
$n = $step['STEP_POSITION'];
$TITLE = " - " . $dynaformF['DYN_TITLE'];
$DYN_UID = $dynaformF['DYN_UID'];
$href = "cases_StepToRevise?type=DYNAFORM&ex=$i&PRO_UID=$PRO_UID&DYN_UID=$DYN_UID&APP_UID=$APP_UID&position=" . $step['STEP_POSITION'] . "&DEL_INDEX=$DEL_INDEX";
$extTreeDynaforms->add( new TreeNode( $DYN_UID, $TITLE, "datasource", true, false, $href, "openCaseFrame" ) );
$i ++;
$steps->next();
}
echo $extTreeDynaforms->toJson();
// end the dynaforms tree menu
echo ",";
// assembling the input documents tree menu
$extTreeInputDocs = new ExtJsTreeNode( "node-input-documents", G::loadtranslation( 'ID_REQUEST_DOCUMENTS' ), "", false, false, "", "" );
$i = 0;
$APP_UID = $_GET['APP_UID'];
$DEL_INDEX = $_GET['DEL_INDEX'];
$steps = $o->getAllInputsStepsToRevise( $_GET['APP_UID'] );
$steps->next();
while ($step = $steps->getRow()) {
require_once 'classes/model/InputDocument.php';
$od = new InputDocument();
$IDF = $od->Load( $step['STEP_UID_OBJ'] );
$n = $step['STEP_POSITION'];
$TITLE = " - " . $IDF['INP_DOC_TITLE'];
$INP_DOC_UID = $IDF['INP_DOC_UID'];
$href = "cases_StepToReviseInputs?type=INPUT_DOCUMENT&ex=$i&PRO_UID=$PRO_UID&INP_DOC_UID=$INP_DOC_UID&APP_UID=$APP_UID&position=" . $step['STEP_POSITION'] . "&DEL_INDEX=$DEL_INDEX";
$extTreeInputDocs->add( new TreeNode( $INP_DOC_UID, $TITLE, "datasource", true, false, $href, "openCaseFrame" ) );
$i ++;
$steps->next();
}
echo $extTreeInputDocs->toJson();
echo "]";

View File

@@ -1,90 +1,87 @@
<?php
/**
* cases_ShowOutputDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
<?php
/**
* cases_ShowOutputDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/*
* Created on 13-02-2008
*
* @author David Callizaya <davidsantos@colosa.com>
*/
require_once ( "classes/model/AppDocumentPeer.php" );
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a'],(isset($_GET['v']) )? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (!isset($_GET['ext'])) {
$ext = $info['extension'];
}
else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
}
else {
$ext = $info['extension'];
}
}
$ver= (isset($_GET['v']) && $_GET['v']!='') ? '_'.$_GET['v'] : '';
if(!$ver) //This code is in the case the outputdocument won't be versioned
$ver='_1';
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid .$ver. '.' . $ext ;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] .$ver. '.' . $ext ;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename']. '.' . $ext ;
$sw_file_exists=false;
if(file_exists($realPath)){
$sw_file_exists=true;
}elseif(file_exists($realPath1)){
$sw_file_exists=true;
$realPath=$realPath1;
}elseif(file_exists($realPath2)){
$sw_file_exists=true;
$realPath=$realPath2;
}
if(!$sw_file_exists){
$error_message="'".$info['basename'] .$ver. '.' . $ext."' ".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'] = $info['basename'] .$ver. '.' . $ext;
print G::json_encode ( $res );
}else{
G::streamFile ( $realPath, true ,$info['basename'] .$ver. '.' . $ext );
}
}
//G::streamFile ( $realPath, true);
?>
*/
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'], (isset( $_GET['v'] )) ? $_GET['v'] : NULL );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (! isset( $_GET['ext'] )) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$ver = (isset( $_GET['v'] ) && $_GET['v'] != '') ? '_' . $_GET['v'] : '';
if (! $ver) //This code is in the case the outputdocument won't be versioned
$ver = '_1';
$realPath = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $sAppDocUid . $ver . '.' . $ext;
$realPath1 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . $ver . '.' . $ext;
$realPath2 = PATH_DOCUMENT . $oAppDocument->Fields['APP_UID'] . '/outdocs/' . $info['basename'] . '.' . $ext;
$sw_file_exists = false;
if (file_exists( $realPath )) {
$sw_file_exists = true;
} elseif (file_exists( $realPath1 )) {
$sw_file_exists = true;
$realPath = $realPath1;
} elseif (file_exists( $realPath2 )) {
$sw_file_exists = true;
$realPath = $realPath2;
}
if (! $sw_file_exists) {
$error_message = "'" . $info['basename'] . $ver . '.' . $ext . "' " . 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'] = $info['basename'] . $ver . '.' . $ext;
print G::json_encode( $res );
} else {
G::streamFile( $realPath, true, $info['basename'] . $ver . '.' . $ext );
}
}
//G::streamFile ( $realPath, true);

View File

@@ -1,66 +1,62 @@
<?php
/**
* cases_ShowOutputDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
<?php
/**
* cases_ShowOutputDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/*
* Created on 13-02-2008
*
* @author David Callizaya <davidsantos@colosa.com>
*/
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
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;
}
require_once ( "classes/model/AppDocumentPeer.php" );
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['a']);
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (!isset($_GET['ext'])) {
$ext = $info['extension'];
}
else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
}
else {
$ext = $info['extension'];
}
}
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext ;
G::streamFile ( $realPath, true );
?>
*/
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
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;
}
require_once ("classes/model/AppDocumentPeer.php");
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['a'] );
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
if (! isset( $_GET['ext'] )) {
$ext = $info['extension'];
} else {
if ($_GET['ext'] != '') {
$ext = $_GET['ext'];
} else {
$ext = $info['extension'];
}
}
$realPath = PATH_DOCUMENT . $_SESSION['APPLICATION'] . '/outdocs/' . $info['basename'] . '.' . $ext;
G::streamFile( $realPath, true );

File diff suppressed because it is too large Load Diff

View File

@@ -1,77 +1,76 @@
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
// die("first");
/* Permissions */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
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 ((int)$_SESSION['INDEX'] < 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
/* Includes */
G::LoadClass('case');
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
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 ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
/* Includes */
G::LoadClass( 'case' );
G::LoadClass( 'derivation' );
/* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher;
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode("
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode( "
if (typeof parent != 'undefined') {
if (parent.showCaseNavigatorPanel) {
parent.showCaseNavigatorPanel('{$Fields['APP_STATUS']}');
}
}");
}" );
// DEPRECATED this script call is marked for removal since almost all the interface is extJS based
$oHeadPublisher->addScriptCode('
$oHeadPublisher->addScriptCode( '
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
@@ -83,52 +82,51 @@ $oHeadPublisher->addScriptCode('
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').'
' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '
});
');
' );
// DEPRECATED this script call is marked for removal
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
if (!isset($_GET['type'])) {
$_GET['type'] = 'DYNAFORM';
}
if (!isset($_GET['position'])) {
$_GET['position'] = 1;
}
$_SESSION['STEP_POSITION'] = (int)$_GET['position'];
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
if (! isset( $_GET['type'] )) {
$_GET['type'] = 'DYNAFORM';
}
if (! isset( $_GET['position'] )) {
$_GET['position'] = 1;
}
$_SESSION['STEP_POSITION'] = (int) $_GET['position'];
//Obtain previous and next step - Start
if (isset($_GET['type'])) {
$sType = $_GET['type'];
} else {
$sType = '';
}
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
/** Added By erik
* date: 16-05-08
* Description: this was added for the additional database connections */
G::LoadClass('dbConnections');
$oDbConnections = new dbConnections($_SESSION['PROCESS']);
$oDbConnections->loadAdditionalConnections();
$G_PUBLISH = new Publisher;
if ($_GET['DYN_UID'] != '') {
$_SESSION['CURRENT_DYN_UID'] = $_GET['DYN_UID'];
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '',
$Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID='.$_GET['DYN_UID']);
}
G::RenderPage('publish', 'blank');
if (!isset($_GET['ex'])) {
$_GET['ex']=$_GET['position'];
}
if (isset( $_GET['type'] )) {
$sType = $_GET['type'];
} else {
$sType = '';
}
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['PREVIOUS_STEP_LABEL'] = '';
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
/**
* Added By erik
* date: 16-05-08
* Description: this was added for the additional database connections
*/
G::LoadClass( 'dbConnections' );
$oDbConnections = new dbConnections( $_SESSION['PROCESS'] );
$oDbConnections->loadAdditionalConnections();
$G_PUBLISH = new Publisher();
if ($_GET['DYN_UID'] != '') {
$_SESSION['CURRENT_DYN_UID'] = $_GET['DYN_UID'];
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_GET['DYN_UID'], '', $Fields['APP_DATA'], 'cases_SaveDataSupervisor?UID=' . $_GET['DYN_UID'] );
}
G::RenderPage( 'publish', 'blank' );
if (! isset( $_GET['ex'] )) {
$_GET['ex'] = $_GET['position'];
}
?>
<script>
@@ -149,4 +147,5 @@ function setSelect()
return 0;
}
}
</script>
</script>

View File

@@ -1,68 +1,67 @@
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
//die("second");
/* Permissions */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
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 ((int)$_SESSION['INDEX'] < 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
/* Includes */
G::LoadClass('case');
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
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 ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
/* Includes */
G::LoadClass( 'case' );
G::LoadClass( 'derivation' );
/* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher;
$oHeadPublisher =& headPublisher::getSingleton();
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
$oHeadPublisher = & headPublisher::getSingleton();
// Check if these code needs to be removed since the interface ar now moving to ExtJS
$oHeadPublisher->addScriptCode('
$oHeadPublisher->addScriptCode( '
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
@@ -74,64 +73,62 @@ $oHeadPublisher->addScriptCode('
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').'
' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '
});
');
' );
// Check if these code needs to be removed since the interface ar now moving to ExtJS
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
if (!isset($_GET['position'])) {
$_GET['position'] = 1;
}
$_SESSION['STEP_POSITION'] = (int)$_GET['position'];
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
$G_PUBLISH = new Publisher;
if (!isset($_GET['ex'])) {
$_GET['ex']=0;
}
if (!isset($_GET['INP_DOC_UID'])) {
G::LoadClass('case');
$oCase = new Cases();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_InputdocsListToRevise',
$oCase->getInputDocumentsCriteriaToRevise($_SESSION['APPLICATION']), '');
} else {
$oInputDocument = new InputDocument();
$Fields = $oInputDocument->load($_GET['INP_DOC_UID']);
switch ($Fields['INP_DOC_FORM_NEEDED']) {
case 'REAL':
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_NEW');
$sXmlForm = 'cases/cases_AttachInputDocument2';
break;
case 'VIRTUAL':
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_ATTACH');
$sXmlForm = 'cases/cases_AttachInputDocument1';
break;
case 'VREAL':
$Fields['TYPE_LABEL'] = G::LoadTranslation('ID_ATTACH');
$sXmlForm = 'cases/cases_AttachInputDocument3';
break;
}
$Fields['MESSAGE1'] = G::LoadTranslation('ID_PLEASE_ENTER_COMMENTS');
$Fields['MESSAGE2'] = G::LoadTranslation('ID_PLEASE_SELECT_FILE');
$docName = $Fields['INP_DOC_TITLE'];
$oHeadPublisher->addScriptCode('var documentName=\'Reviewing Input Document<br>'.$docName.'\';');
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
if (! isset( $_GET['position'] )) {
$_GET['position'] = 1;
}
$_SESSION['STEP_POSITION'] = (int) $_GET['position'];
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
$G_PUBLISH = new Publisher();
if (! isset( $_GET['ex'] )) {
$_GET['ex'] = 0;
}
if (! isset( $_GET['INP_DOC_UID'] )) {
G::LoadClass( 'case' );
$oCase = new Cases();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_InputdocsListToRevise', $oCase->getInputDocumentsCriteriaToRevise( $_SESSION['APPLICATION'] ), '' );
} else {
$oInputDocument = new InputDocument();
$Fields = $oInputDocument->load( $_GET['INP_DOC_UID'] );
switch ($Fields['INP_DOC_FORM_NEEDED']) {
case 'REAL':
$Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_NEW' );
$sXmlForm = 'cases/cases_AttachInputDocument2';
break;
case 'VIRTUAL':
$Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_ATTACH' );
$sXmlForm = 'cases/cases_AttachInputDocument1';
break;
case 'VREAL':
$Fields['TYPE_LABEL'] = G::LoadTranslation( 'ID_ATTACH' );
$sXmlForm = 'cases/cases_AttachInputDocument3';
break;
}
$Fields['MESSAGE1'] = G::LoadTranslation( 'ID_PLEASE_ENTER_COMMENTS' );
$Fields['MESSAGE2'] = G::LoadTranslation( 'ID_PLEASE_SELECT_FILE' );
$docName = $Fields['INP_DOC_TITLE'];
$oHeadPublisher->addScriptCode( 'var documentName=\'Reviewing Input Document<br>' . $docName . '\';' );
// $G_PUBLISH->AddContent('xmlform', 'xmlform', $sXmlForm, '', $Fields, 'cases_SupervisorSaveDocument?UID=' .
//$_GET['INP_DOC_UID'] . '&APP_UID=' . $_GET['APP_UID'] . '&position=' . $_GET['position']);
$G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocumentsToRevise', 'cases/cases_ToReviseInputdocsList',
$oCase->getInputDocumentsCriteria($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['INP_DOC_UID']),
array_merge(array('DOC_UID'=>$_GET['INP_DOC_UID']),$Fields));
$G_PUBLISH->AddContent( 'propeltable', 'cases/paged-table-inputDocumentsToRevise', 'cases/cases_ToReviseInputdocsList', $oCase->getInputDocumentsCriteria( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_GET['INP_DOC_UID'] ), array_merge( array ('DOC_UID' => $_GET['INP_DOC_UID']
), $Fields ) );
//$aFields
// $G_PUBLISH->AddContent('propeltable', 'cases/paged-table-inputDocuments', 'cases/cases_InputdocsList',
//$oCase->getInputDocumentsCriteria($_SESSION['APPLICATION']));//$aFields
}
G::RenderPage('publish', 'blank');
}
G::RenderPage( 'publish', 'blank' );
?>
<script>
@@ -152,4 +149,5 @@ function setSelect()
return 0;
}
}
</script>
</script>

View File

@@ -1,59 +1,57 @@
<?php
/**
* cases_StepToReviseOutputs.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/* Permissions */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
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');
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher;
$oHeadPublisher =& headPublisher::getSingleton();
<?php
/**
* cases_StepToReviseOutputs.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
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' );
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
$oHeadPublisher = & headPublisher::getSingleton();
// check if the code for the addScriptCode is necessary since the interface is now based in ExtJs
$oHeadPublisher->addScriptCode('
$oHeadPublisher->addScriptCode( '
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
@@ -65,17 +63,16 @@ leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').'});
');
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
$oCase = new Cases();
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_OutputdocsListToRevise',
$oCase->getOutputDocumentsCriteriaToRevise($_SESSION['APPLICATION']), '');
G::RenderPage('publish', 'blank');
if (!isset($_GET['ex'])) {
$_GET['ex']=0;
}
' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '});
' );
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
$oCase = new Cases();
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_OutputdocsListToRevise', $oCase->getOutputDocumentsCriteriaToRevise( $_SESSION['APPLICATION'] ), '' );
G::RenderPage( 'publish', 'blank' );
if (! isset( $_GET['ex'] )) {
$_GET['ex'] = 0;
}
?>
@@ -97,4 +94,5 @@ function setSelect()
return 0;
}
}
</script>
</script>

View File

@@ -1,86 +1,72 @@
<?php
/**
* cases_SupervisorSaveDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
<?php
/**
* cases_SupervisorSaveDocument.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
try {
//save info
G::LoadClass('case');
$oAppDocument = new AppDocument();
$aFields = array('APP_UID' => $_GET['APP_UID'],
'DEL_INDEX' => 100000,
'USR_UID' => $_SESSION['USER_LOGGED'],
'DOC_UID' => $_GET['UID'],
'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'] : '');
$oAppDocument->create($aFields);
$sAppDocUid = $oAppDocument->getAppDocUid();
$info = pathinfo( $oAppDocument->getAppDocFilename() );
$ext = (isset($info['extension']) ? $info['extension'] : '');
G::LoadClass( 'case' );
$oAppDocument = new AppDocument();
$aFields = array ('APP_UID' => $_GET['APP_UID'],'DEL_INDEX' => 100000,'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $_GET['UID'],'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'] : ''
);
$oAppDocument->create( $aFields );
$sAppDocUid = $oAppDocument->getAppDocUid();
$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) {
$sPathName = PATH_DOCUMENT . $_GET['APP_UID'] . PATH_SEP;
$sFileName = $sAppDocUid . '.' . $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' ) ) {
$oData['APP_UID'] = $_GET['APP_UID'];
$documentData = new uploadDocumentData (
$_GET['APP_UID'],
$_SESSION['USER_LOGGED'],
$sPathName . $sFileName,
$aFields['APP_DOC_FILENAME'],
$sAppDocUid
);
$oPluginRegistry->executeTriggers ( PM_UPLOAD_DOCUMENT , $documentData );
unlink ( $sPathName . $sFileName );
}
//end plugin
}
}
//go to the next step
if (!isset($_POST['form']['MORE'])) {
$oCase = new Cases();
$aFields = $oCase->loadCase($_GET['APP_UID']);
$aNextStep = $oCase->getNextSupervisorStep($aFields['PRO_UID'], $_GET['position'], 'INPUT_DOCUMENT');
G::header('location: ' . 'cases_StepToReviseInputs?type=INPUT_DOCUMENT&INP_DOC_UID='.$aNextStep['UID'].'&position='.$aNextStep['POSITION'].'&APP_UID='.$_GET['APP_UID'].'&DEL_INDEX=');
die;
}
else {
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
} catch ( Exception $e ) {
/* Render Error page */
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
}
if (! empty( $_FILES['form'] )) {
if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
$sPathName = PATH_DOCUMENT . $_GET['APP_UID'] . PATH_SEP;
$sFileName = $sAppDocUid . '.' . $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' )) {
$oData['APP_UID'] = $_GET['APP_UID'];
$documentData = new uploadDocumentData( $_GET['APP_UID'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid );
$oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
unlink( $sPathName . $sFileName );
}
//end plugin
}
}
//go to the next step
if (! isset( $_POST['form']['MORE'] )) {
$oCase = new Cases();
$aFields = $oCase->loadCase( $_GET['APP_UID'] );
$aNextStep = $oCase->getNextSupervisorStep( $aFields['PRO_UID'], $_GET['position'], 'INPUT_DOCUMENT' );
G::header( 'location: ' . 'cases_StepToReviseInputs?type=INPUT_DOCUMENT&INP_DOC_UID=' . $aNextStep['UID'] . '&position=' . $aNextStep['POSITION'] . '&APP_UID=' . $_GET['APP_UID'] . '&DEL_INDEX=' );
die();
} else {
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
} catch (Exception $e) {
/* Render Error page */
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', '', $aMessage );
G::RenderPage( 'publish' );
}

View File

@@ -1,82 +1,79 @@
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/* Permissions */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
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 ((int)$_SESSION['INDEX'] < 1) {
G::SendTemporalMessage('ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels');
G::header('location: ' . $_SERVER['HTTP_REFERER']);
die;
}
/* Includes */
G::LoadClass('case');
G::LoadClass('derivation');
/* GET , POST & $_SESSION Vars */
<?php
/**
* cases_Step.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
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 ((int) $_SESSION['INDEX'] < 1) {
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
die();
}
/* Includes */
G::LoadClass( 'case' );
G::LoadClass( 'derivation' );
/* GET , POST & $_SESSION Vars */
//$_SESSION['STEP_POSITION'] = (int)$_GET['POSITION'];
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$oCase = new Cases();
$Fields = $oCase->loadCase($_SESSION['APPLICATION']);
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$G_PUBLISH = new Publisher;
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load($_GET['DOC']);
$oo = $oAppDocument->load($_GET['DOC']);
$oUser = new Users();
$aUser = $oUser->load($oAppDocument->Fields['USR_UID']);
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oAppDocument->Fields['VIEW'] = G::LoadTranslation('ID_OPEN');
$oAppDocument->Fields['FILE'] = 'cases_ShowDocument?a=' . $_GET['DOC'] . '&r=' . rand();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges($Fields, $oAppDocument->Fields), '');
G::RenderPage( 'publish' );
?>
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$oCase = new Cases();
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
require_once 'classes/model/AppDocument.php';
require_once 'classes/model/Users.php';
$G_PUBLISH = new Publisher();
$oAppDocument = new AppDocument();
$oAppDocument->Fields = $oAppDocument->load( $_GET['DOC'] );
$oo = $oAppDocument->load( $_GET['DOC'] );
$oUser = new Users();
$aUser = $oUser->load( $oAppDocument->Fields['USR_UID'] );
$Fields['CREATOR'] = $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'];
$oAppDocument->Fields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
$oAppDocument->Fields['FILE'] = 'cases_ShowDocument?a=' . $_GET['DOC'] . '&r=' . rand();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewInputDocumentToRevise', '', G::array_merges( $Fields, $oAppDocument->Fields ), '' );
G::RenderPage( 'publish' );

View File

@@ -1,59 +1,57 @@
<?php
/**
* cases_ToReviseOutputDocView.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/* Permissions */
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
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');
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower(PATH_TPL . 'cases/cases_Step.html');
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher;
$oHeadPublisher =& headPublisher::getSingleton();
$oHeadPublisher->addScriptCode('
<?php
/**
* cases_ToReviseOutputDocView.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
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' );
/* Menues */
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
/* Prepare page before to show */
$oTemplatePower = new TemplatePower( PATH_TPL . 'cases/cases_Step.html' );
$oTemplatePower->prepare();
$G_PUBLISH = new Publisher();
$oHeadPublisher = & headPublisher::getSingleton();
$oHeadPublisher->addScriptCode( '
var Cse = {};
Cse.panels = {};
var leimnud = new maborak();
@@ -65,37 +63,38 @@ leimnud.Package.Load("cases_Step",{Type:"file",Absolute:true,Path:"/jscore/cases
leimnud.Package.Load("processmap",{Type:"file",Absolute:true,Path:"/jscore/processmap/core/processmap.js"});
leimnud.exec(leimnud.fix.memoryLeak);
leimnud.event.add(window,"load",function(){
'.(isset($_SESSION['showCasesWindow'])?'try{'.$_SESSION['showCasesWindow'].'}catch(e){}':'').'});
');
$G_PUBLISH->AddContent('template', '', '', '', $oTemplatePower);
' . (isset( $_SESSION['showCasesWindow'] ) ? 'try{' . $_SESSION['showCasesWindow'] . '}catch(e){}' : '') . '});
' );
$G_PUBLISH->AddContent( 'template', '', '', '', $oTemplatePower );
//
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load($_GET['UID']);
require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument();
$aFields = $oAppDocument->load($_GET['DOC']);
$aFields['VIEW'] = G::LoadTranslation('ID_OPEN');
switch ($aOD ['OUT_DOC_GENERATE']) {
case 'DOC':
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
break;
case 'PDF':
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
break;
case 'BOTH':
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
break;
}
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ViewOutputDocumentToRevise', '', G::array_merges($aOD, $aFields), '');
require_once 'classes/model/OutputDocument.php';
$oOutputDocument = new OutputDocument();
$aOD = $oOutputDocument->load( $_GET['UID'] );
require_once 'classes/model/AppDocument.php';
$oAppDocument = new AppDocument();
$aFields = $oAppDocument->load( $_GET['DOC'] );
$aFields['VIEW'] = G::LoadTranslation( 'ID_OPEN' );
switch ($aOD['OUT_DOC_GENERATE']) {
case 'DOC':
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
break;
case 'PDF':
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
break;
case 'BOTH':
$aFields['FILE1'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=doc&random=' . rand();
$aFields['FILE2'] = 'cases_ShowOutputDocument?a=' . $aFields['APP_DOC_UID'] . '&ext=pdf&random=' . rand();
break;
}
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ViewOutputDocumentToRevise', '', G::array_merges( $aOD, $aFields ), '' );
//
G::RenderPage('publish', 'blank');
if(!isset($_GET['ex'])) $_GET['ex']=0;
G::RenderPage( 'publish', 'blank' );
if (! isset( $_GET['ex'] ))
$_GET['ex'] = 0;
?>
<script type="text/javascript">
/*------------------------------ To Revise Routines ---------------------------*/
@@ -116,4 +115,5 @@ function setSelect()
return 0;
}
}
</script>
</script>

View File

@@ -1,75 +1,74 @@
<?php
/**
* cases_UsersReassign.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
try {
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::LoadClass('case');
$oCase = new Cases();
$aCases = array();
$aUsers = array();
if (isset($_POST['USERS']) && is_array($_POST['USERS'])) {
foreach ($_POST['USERS'] as $sKey => $sUser) {
if ($sUser != '') {
$oCase->reassignCase($_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser);
$aCases[] = $_POST['APPLICATIONS'][$sKey];
$aUsers[] = $sUser;
}
}
}
G::LoadClass('case');
$oCase = new Cases();
require_once 'classes/model/Users.php';
$oUser = new Users();
$sText = '';
foreach ($aCases as $sKey => $sCase) {
$aCase = $oCase->loadCase($sCase);
$aUser = $oUser->load($aUsers[$sKey]);
$sText .= '(' . $aCase['APP_NUMBER'] . ') ' . $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
}
$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;
$aMessage['MESSAGE'] = $sText;
$aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID'];
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage);
G::RenderPage('publish');
}
catch (Exception $oException) {
die($oException->getMessage());
}
<?php
/**
* cases_UsersReassign.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
try {
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::LoadClass( 'case' );
$oCase = new Cases();
$aCases = array ();
$aUsers = array ();
if (isset( $_POST['USERS'] ) && is_array( $_POST['USERS'] )) {
foreach ($_POST['USERS'] as $sKey => $sUser) {
if ($sUser != '') {
$oCase->reassignCase( $_POST['APPLICATIONS'][$sKey], $_POST['INDEXES'][$sKey], $_POST['USR_UID'], $sUser );
$aCases[] = $_POST['APPLICATIONS'][$sKey];
$aUsers[] = $sUser;
}
}
}
G::LoadClass( 'case' );
$oCase = new Cases();
require_once 'classes/model/Users.php';
$oUser = new Users();
$sText = '';
foreach ($aCases as $sKey => $sCase) {
$aCase = $oCase->loadCase( $sCase );
$aUser = $oUser->load( $aUsers[$sKey] );
$sText .= '(' . $aCase['APP_NUMBER'] . ') ' . $aCase['TITLE'] . ' => ' . $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' (' . $aUser['USR_USERNAME'] . ')' . '<br />';
}
$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();
$aMessage['MESSAGE'] = $sText;
$aMessage['URL'] = 'cases_ReassignByUser?REASSIGN_USER=' . $_POST['USR_UID'];
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignShowInfo', '', $aMessage );
G::RenderPage( 'publish' );
} catch (Exception $oException) {
die( $oException->getMessage() );
}

View File

@@ -1,29 +1,29 @@
<?php
switch ($RBAC->userCanAccess('PM_SUPERVISOR')) {
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 (($RBAC_Response = $RBAC->userCanAccess("PM_USERS")) != 1)
return $RBAC_Response;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('view', 'cases/cases_toRevise');
$G_PUBLISH->AddContent('smarty', 'cases/cases_toReviseIn', '', '', array());
G::RenderPage("publish-treeview");
<?php
switch ($RBAC->userCanAccess( 'PM_SUPERVISOR' )) {
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 (($RBAC_Response = $RBAC->userCanAccess( "PM_USERS" )) != 1)
return $RBAC_Response;
$G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_TO_REVISE';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_toRevise' );
$G_PUBLISH->AddContent( 'smarty', 'cases/cases_toReviseIn', '', '', array () );
G::RenderPage( "publish-treeview" );

View File

@@ -1,89 +1,86 @@
<?php
/**
* data_casesSchedulerLog.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
require_once 'classes/model/LogCasesSchedulerPeer.php';
require_once 'classes/model/LogCasesScheduler.php';
G::LoadClass('configuration');
$co = new Configurations();
$config = $co->getConfiguration('casesSchedulerLogList', 'pageSize','',$_SESSION['USER_LOGGED']);
$limit_size = isset($config['pageSize']) ? $config['pageSize'] : 20;
$start = isset($_REQUEST['start'])? $_REQUEST['start'] : 0;
$limit = isset($_REQUEST['limit'])? $_REQUEST['limit'] : $limit_size;
$filter = (isset($_POST['textFilter'])) ? $_POST['textFilter'] : '';
$oCriteria = new Criteria('workflow');
$oCriteria->clearSelectColumns();
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::LOG_CASE_UID);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::PRO_UID);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::TAS_UID);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::USR_NAME);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_DATE);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::EXEC_HOUR);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::RESULT);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::SCH_UID);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS);
$oCriteria->addSelectColumn(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS);
if ($filter != ''){
$c_or = $oCriteria->getNewCriterion(LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, '%'.$filter.'%', Criteria::LIKE)->addOr(
$oCriteria->getNewCriterion(LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS,'%'.$filter.'%', Criteria::LIKE));
$oCriteria->add($c_or);
}
$oDataset = LogCasesSchedulerPeer::doSelectRS ( $oCriteria );
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$addTables = Array();
while( $oDataset->next() ) {
$addTables[] = $oDataset->getRow();
}
$results = count($addTables);
$oCriteria->setOffset($start);
$oCriteria->setLimit($limit);
$oCriteria->addDescendingOrderByColumn(LogCasesSchedulerPeer::EXEC_DATE);
$oCriteria->addDescendingOrderByColumn(LogCasesSchedulerPeer::EXEC_HOUR);
$oDataset = LogCasesSchedulerPeer::doSelectRS ( $oCriteria );
$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
<?php
/**
* data_casesSchedulerLog.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
require_once 'classes/model/LogCasesSchedulerPeer.php';
require_once 'classes/model/LogCasesScheduler.php';
G::LoadClass( 'configuration' );
$co = new Configurations();
$config = $co->getConfiguration( 'casesSchedulerLogList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
$limit_size = isset( $config['pageSize'] ) ? $config['pageSize'] : 20;
$start = isset( $_REQUEST['start'] ) ? $_REQUEST['start'] : 0;
$limit = isset( $_REQUEST['limit'] ) ? $_REQUEST['limit'] : $limit_size;
$filter = (isset( $_POST['textFilter'] )) ? $_POST['textFilter'] : '';
$oCriteria = new Criteria( 'workflow' );
$oCriteria->clearSelectColumns();
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::LOG_CASE_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::PRO_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::TAS_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::USR_NAME );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::RESULT );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::SCH_UID );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS );
$oCriteria->addSelectColumn( LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS );
if ($filter != '') {
$c_or = $oCriteria->getNewCriterion( LogCasesSchedulerPeer::WS_CREATE_CASE_STATUS, '%' . $filter . '%', Criteria::LIKE )->addOr( $oCriteria->getNewCriterion( LogCasesSchedulerPeer::WS_ROUTE_CASE_STATUS, '%' . $filter . '%', Criteria::LIKE ) );
$oCriteria->add( $c_or );
}
$oDataset = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$addTables = Array ();
while ($oDataset->next()) {
$addTables[] = $oDataset->getRow();
}
$results = count( $addTables );
$oCriteria->setOffset( $start );
$oCriteria->setLimit( $limit );
$oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_DATE );
$oCriteria->addDescendingOrderByColumn( LogCasesSchedulerPeer::EXEC_HOUR );
$oDataset = LogCasesSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
//$oDataset = LogCasesSchedulerPeer::doSelectRS ( $oCriteria );
//$oDataset->setFetchmode ( ResultSet::FETCHMODE_ASSOC );
$addTables = Array();
while( $oDataset->next() ) {
$addTables[] = $oDataset->getRow();
}
$addTables = Array ();
while ($oDataset->next()) {
$addTables[] = $oDataset->getRow();
}
//$oLogCasesScheduler = new LogCasesScheduler();
//$arrData = $oLogCasesScheduler->getAll();
echo '{results: '.$results.', rows: '.G::json_encode($addTables).'}';
echo '{results: ' . $results . ', rows: ' . G::json_encode( $addTables ) . '}';

View File

@@ -1,72 +1,73 @@
<?php
if( isset($_SESSION['TRIGGER_DEBUG']['info']) ) {
$aTriggers = $_SESSION['TRIGGER_DEBUG']['info'];
} else {
$aTriggers[0] = $_SESSION['TRIGGER_DEBUG'];
}
<?php
if (isset( $_SESSION['TRIGGER_DEBUG']['info'] )) {
$aTriggers = $_SESSION['TRIGGER_DEBUG']['info'];
} else {
$aTriggers[0] = $_SESSION['TRIGGER_DEBUG'];
}
//print_r($aTriggers);die;
$triggersList = Array();
$i = 0;
foreach($aTriggers as $aTrigger) {
if($aTrigger['NUM_TRIGGERS'] != 0) {
foreach($aTrigger['TRIGGERS_NAMES'] as $index=>$name) {
$triggersList[$i]['name'] = $name;
$triggersList[$i]['execution_time'] = strtolower($aTrigger['TIME']);
//$t_code = $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
//$t_code = str_replace('"', '\'',$t_code);
//$t_code = addslashes($t_code);
//$t_code = Only1br($t_code);
//highlighting the trigger code using the geshi third party library
G::LoadThirdParty('geshi', 'geshi');
$geshi = new GeSHi($aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'], 'php');
$geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 2);
$geshi->set_line_style('background: #f0f0f0;');
$triggersList[$i]['code'] = $geshi->parse_code(); //$aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
$i++;
}
} else {
}
}
$triggersList = Array ();
$i = 0;
foreach ($aTriggers as $aTrigger) {
if ($aTrigger['NUM_TRIGGERS'] != 0) {
foreach ($aTrigger['TRIGGERS_NAMES'] as $index => $name) {
$triggersList[$i]['name'] = $name;
$triggersList[$i]['execution_time'] = strtolower( $aTrigger['TIME'] );
//$t_code = $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
//$t_code = str_replace('"', '\'',$t_code);
//$t_code = addslashes($t_code);
//$t_code = Only1br($t_code);
//highlighting the trigger code using the geshi third party library
G::LoadThirdParty( 'geshi', 'geshi' );
$geshi = new GeSHi( $aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'], 'php' );
$geshi->enable_line_numbers( GESHI_FANCY_LINE_NUMBERS, 2 );
$geshi->set_line_style( 'background: #f0f0f0;' );
$triggersList[$i]['code'] = $geshi->parse_code(); //$aTrigger['TRIGGERS_VALUES'][$index]['TRI_WEBBOT'];
$i ++;
}
} else {
}
}
//print_r($_SESSION['TRIGGER_DEBUG']['ERRORS']); die;
$DEBUG_ERRORS = array_unique($_SESSION['TRIGGER_DEBUG']['ERRORS']);
foreach($DEBUG_ERRORS as $error){
if(isset($error['ERROR']) and $error['ERROR'] != ''){
$triggersList[$i]['name'] = 'Error';
$triggersList[$i]['execution_time'] = 'error';
$triggersList[$i]['code'] = $error['ERROR'];
$i++;
}
if(isset($error['FATAL']) and $error['FATAL'] != ''){
$error['FATAL'] = str_replace("<br />", "\n", $error['FATAL']);
$tmp = explode("\n", $error['FATAL']);
$triggersList[$i]['name'] = isset($tmp[0])? $tmp[0]: 'Fatal Error in trigger';
$triggersList[$i]['execution_time'] = 'Fatal error';
$triggersList[$i]['code'] = $error['FATAL'];
$i++;
}
}
$DEBUG_ERRORS = array_unique( $_SESSION['TRIGGER_DEBUG']['ERRORS'] );
foreach ($DEBUG_ERRORS as $error) {
if (isset( $error['ERROR'] ) and $error['ERROR'] != '') {
$triggersList[$i]['name'] = 'Error';
$triggersList[$i]['execution_time'] = 'error';
$triggersList[$i]['code'] = $error['ERROR'];
$i ++;
}
if (isset( $error['FATAL'] ) and $error['FATAL'] != '') {
$error['FATAL'] = str_replace( "<br />", "\n", $error['FATAL'] );
$tmp = explode( "\n", $error['FATAL'] );
$triggersList[$i]['name'] = isset( $tmp[0] ) ? $tmp[0] : 'Fatal Error in trigger';
$triggersList[$i]['execution_time'] = 'Fatal error';
$triggersList[$i]['code'] = $error['FATAL'];
$i ++;
}
}
/*echo '{total:5, data:[
{name:"trigger1", execution_time:"after"},
{name:"trigger2", execution_time:"before"},
{name:"trigger13", execution_time:"before"},
]}';
*/
$triggersRet->total = count($triggersList);
$triggersRet->data = $triggersList;
echo G::json_encode($triggersRet);
*/
$triggersRet->total = count( $triggersList );
$triggersRet->data = $triggersList;
echo G::json_encode( $triggersRet );

View File

@@ -1,98 +1,104 @@
<?php
$request = isset($_POST['request']) ? $_POST['request'] : '';
switch ($request) {
case 'getRows':
$fieldname = $_POST['fieldname'];
G::LoadClass('case');
$oApp = new Cases();
$aFields = $oApp->loadCase($_SESSION['APPLICATION']);
$aVars = Array();
for ($i = 0; $i < count($_SESSION['TRIGGER_DEBUG']['DATA']); $i++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge($aFields['APP_DATA'], $aVars);
$field = $aVars[$fieldname];
$response->headers = Array();
$response->columns = Array();
$response->rows = Array();
$sw = true;
$j = 0;
if (is_array($field)) {
foreach ($field as $row) {
if ($sw) {
foreach ($row as $key => $value) {
$response->headers[] = Array('name' => $key);
$response->columns[] = Array('header' => $key, 'width' => 100, 'dataIndex' => $key);
}
$sw = false;
}
$tmp = Array();
foreach ($row as $key => $value) {
$tmp[] = $value;
}
$response->rows[$j++] = $tmp;
}
} else {
if (is_object($field)) {
$response->headers = Array(Array('name' => 'name'), Array('name' => 'value'));
$response->columns = Array(Array('header' => 'Property', 'width' => 100, 'dataIndex' => 'name'),
Array('header' => 'Value', 'width' => 100, 'dataIndex' => 'value'));
foreach ($field as $key => $value) {
$response->rows[] = Array($key, $value);
}
}
}
echo G::json_encode($response);
break;
default:
G::LoadClass('case');
$oApp = new Cases();
$aFields = $oApp->loadCase($_SESSION['APPLICATION']);
$aVars = Array();
for ($i = 0; $i < count($_SESSION['TRIGGER_DEBUG']['DATA']); $i++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge($aFields['APP_DATA'], $aVars);
if (isset($_POST['filter']) && $_POST['filter'] == 'dyn') {
$sysVars = array_keys(G::getSystemConstants());
$varNames = array_keys($aVars);
foreach ($varNames as $var) {
if (in_array($var, $sysVars)) {
unset($aVars[$var]);
}
}
}
if (isset($_POST['filter']) && $_POST['filter'] == 'sys') {
$aVars = G::getSystemConstants();
}
ksort($aVars);
$return_object->totalCount = 1;
foreach ($aVars as $i => $var) {
if (is_array($var) || is_object($var)) {
$aVars[$i] = print_r($var, true);
}
}
$return_object->data[0] = $aVars;
echo G::json_encode($return_object);
break;
}
<?php
$request = isset( $_POST['request'] ) ? $_POST['request'] : '';
switch ($request) {
case 'getRows':
$fieldname = $_POST['fieldname'];
G::LoadClass( 'case' );
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
$field = $aVars[$fieldname];
$response->headers = Array ();
$response->columns = Array ();
$response->rows = Array ();
$sw = true;
$j = 0;
if (is_array( $field )) {
foreach ($field as $row) {
if ($sw) {
foreach ($row as $key => $value) {
$response->headers[] = Array ('name' => $key
);
$response->columns[] = Array ('header' => $key,'width' => 100,'dataIndex' => $key
);
}
$sw = false;
}
$tmp = Array ();
foreach ($row as $key => $value) {
$tmp[] = $value;
}
$response->rows[$j ++] = $tmp;
}
} else {
if (is_object( $field )) {
$response->headers = Array (Array ('name' => 'name'
),Array ('name' => 'value'
)
);
$response->columns = Array (Array ('header' => 'Property','width' => 100,'dataIndex' => 'name'
),Array ('header' => 'Value','width' => 100,'dataIndex' => 'value'
)
);
foreach ($field as $key => $value) {
$response->rows[] = Array ($key,$value
);
}
}
}
echo G::json_encode( $response );
break;
default:
G::LoadClass( 'case' );
$oApp = new Cases();
$aFields = $oApp->loadCase( $_SESSION['APPLICATION'] );
$aVars = Array ();
for ($i = 0; $i < count( $_SESSION['TRIGGER_DEBUG']['DATA'] ); $i ++) {
$aVars[$_SESSION['TRIGGER_DEBUG']['DATA'][$i]['key']] = $_SESSION['TRIGGER_DEBUG']['DATA'][$i]['value'];
}
$aVars = array_merge( $aFields['APP_DATA'], $aVars );
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'dyn') {
$sysVars = array_keys( G::getSystemConstants() );
$varNames = array_keys( $aVars );
foreach ($varNames as $var) {
if (in_array( $var, $sysVars )) {
unset( $aVars[$var] );
}
}
}
if (isset( $_POST['filter'] ) && $_POST['filter'] == 'sys') {
$aVars = G::getSystemConstants();
}
ksort( $aVars );
$return_object->totalCount = 1;
foreach ($aVars as $i => $var) {
if (is_array( $var ) || is_object( $var )) {
$aVars[$i] = print_r( $var, true );
}
}
$return_object->data[0] = $aVars;
echo G::json_encode( $return_object );
break;
}

View File

@@ -1,29 +1,27 @@
<?php
/**
* index.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
//$newFile = str_replace ( 'index.php', 'cases_List.php' , __FILE__ ) ;
$newFile = str_replace ( 'index.php', 'main.php' , __FILE__ ) ;
return $newFile;
<?php
/**
* index.php
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
//$newFile = str_replace ( 'index.php', 'cases_List.php' , __FILE__ ) ;
$newFile = str_replace( 'index.php', 'main.php', __FILE__ );
return $newFile;

View File

@@ -1,36 +1,35 @@
<?php
/**
* main.php Cases List main processor
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
$RBAC->requirePermissions('PM_CASES');
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES';
$_POST['qs'] = isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
$G_PUBLISH = new Publisher;
$G_PUBLISH->AddContent('view', 'cases/cases_Load');
G::RenderPage('publish');
<?php
/**
* main.php Cases List main processor
*
* ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
$RBAC->requirePermissions( 'PM_CASES' );
$G_MAIN_MENU = 'processmaker';
$G_ID_MENU_SELECTED = 'CASES';
$_POST['qs'] = isset( $_SERVER['QUERY_STRING'] ) && $_SERVER['QUERY_STRING'] != '' ? '?' . $_SERVER['QUERY_STRING'] : '';
$G_PUBLISH = new Publisher();
$G_PUBLISH->AddContent( 'view', 'cases/cases_Load' );
G::RenderPage( 'publish' );

View File

@@ -12,85 +12,81 @@
*
* 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.
*
*/
G::LoadClass("configuration");
G::LoadClass( "configuration" );
$conf = new Configurations();
$oHeadPublisher = &headPublisher::getSingleton();
$oHeadPublisher->addExtJsScript("cases/main", false); //Adding a javascript file .js
$oHeadPublisher->addContent("cases/main"); //Adding a html file .html.
$oHeadPublisher->addExtJsScript( "cases/main", false ); //Adding a javascript file .js
$oHeadPublisher->addContent( "cases/main" ); //Adding a html file .html.
$keyMem = "USER_PREFERENCES" . $_SESSION["USER_LOGGED"];
$memcache = &PMmemcached::getSingleton(SYS_SYS);
$memcache = &PMmemcached::getSingleton( SYS_SYS );
if (($arrayConfig = $memcache->get($keyMem)) === false) {
$conf->loadConfig($x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "");
if (($arrayConfig = $memcache->get( $keyMem )) === false) {
$conf->loadConfig( $x, "USER_PREFERENCES", "", "", $_SESSION["USER_LOGGED"], "" );
$arrayConfig = $conf->aConfig;
$memcache->set($keyMem, $arrayConfig, PMmemcached::ONE_HOUR);
$memcache->set( $keyMem, $arrayConfig, PMmemcached::ONE_HOUR );
}
$confDefaultOption = "";
if (isset($arrayConfig["DEFAULT_CASES_MENU"])) { //this user has a configuration record
if (isset( $arrayConfig["DEFAULT_CASES_MENU"] )) { //this user has a configuration record
$confDefaultOption = $arrayConfig["DEFAULT_CASES_MENU"];
global $G_TMP_MENU;
$oMenu = new Menu();
$oMenu->load("cases");
$oMenu->load( "cases" );
$defaultOption = "";
foreach ($oMenu->Id as $i => $id) {
if ($id == $confDefaultOption) {
$defaultOption = $oMenu->Options[$i];
break;
$defaultOption = $oMenu->Options[$i];
break;
}
}
$defaultOption = ($defaultOption != "")? $defaultOption : "casesListExtJs";
} else {
$defaultOption = ($defaultOption != "") ? $defaultOption : "casesListExtJs";
} else {
$defaultOption = "casesListExtJs";
$confDefaultOption = "CASES_INBOX";
}
if (isset($_GET["id"]) && isset($_GET["id"])) {
if (isset( $_GET["id"] ) && isset( $_GET["id"] )) {
$defaultOption = "../cases/open?APP_UID=" . $_GET["id"] . "&DEL_INDEX=" . $_GET["i"];
if (isset($_GET["a"])) {
if (isset( $_GET["a"] )) {
$defaultOption .= "&action=" . $_GET["a"];
}
}
$oServerConf =& serverConf::getSingleton();
if ($oServerConf->isRtl(SYS_LANG)) {
$oServerConf = & serverConf::getSingleton();
if ($oServerConf->isRtl( SYS_LANG )) {
$regionTreePanel = 'east';
$regionDebug = 'west';
} else {
} else {
$regionTreePanel = 'west';
$regionDebug = 'east';
}
$oHeadPublisher->assign('regionTreePanel', $regionTreePanel);
$oHeadPublisher->assign('regionDebug', $regionDebug);
$oHeadPublisher->assign("defaultOption", $defaultOption); //User menu permissions
$oHeadPublisher->assign("_nodeId", isset($confDefaultOption)? $confDefaultOption : "PM_USERS"); //User menu permissions
$oHeadPublisher->assign("FORMATS", $conf->getFormats());
}
$oHeadPublisher->assign( 'regionTreePanel', $regionTreePanel );
$oHeadPublisher->assign( 'regionDebug', $regionDebug );
$oHeadPublisher->assign( "defaultOption", $defaultOption ); //User menu permissions
$oHeadPublisher->assign( "_nodeId", isset( $confDefaultOption ) ? $confDefaultOption : "PM_USERS" ); //User menu permissions
$oHeadPublisher->assign( "FORMATS", $conf->getFormats() );
$_SESSION["current_ux"] = "NORMAL";
G::RenderPage("publish", "extJs");
G::RenderPage( "publish", "extJs" );

Some files were not shown because too many files have changed in this diff Show More