Automatic merge with the upstream master branch
This commit is contained in:
@@ -28,12 +28,12 @@
|
||||
* @date Jan 3th, 2010
|
||||
*/
|
||||
|
||||
require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/AppThread.php';
|
||||
require_once 'classes/model/AppDelay.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
//require_once 'classes/model/Application.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/AppThread.php';
|
||||
//require_once 'classes/model/AppDelay.php';
|
||||
//require_once 'classes/model/Process.php';
|
||||
//require_once 'classes/model/Task.php';
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$action = $_REQUEST['action'];
|
||||
|
||||
@@ -434,12 +434,27 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['DYNUIDPRINT'] = $_POST['DYN_UID'];
|
||||
?>
|
||||
|
||||
<script language="javascript">
|
||||
window.onload = function () {
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
for(var i= 0; i<inputs.length; i++) {
|
||||
if(inputs[i].type == 'button' || inputs[i].type == 'submit')
|
||||
{
|
||||
inputs[i].disabled = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<?php
|
||||
|
||||
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
|
||||
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
|
||||
|
||||
?>
|
||||
<script language="javascript">
|
||||
|
||||
function popUp(URL, width, height, left, top, resizable) {
|
||||
window.open(URL, '', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable='+resizable+',width='+width+',height='+height+',left = '+left+',top = '+top+'');
|
||||
}
|
||||
|
||||
@@ -9,10 +9,10 @@ if ($action == 'selfservice') {
|
||||
|
||||
G::LoadClass( "BasePeer" );
|
||||
G::LoadClass( 'configuration' );
|
||||
require_once ("classes/model/Fields.php");
|
||||
require_once ("classes/model/AppCacheView.php");
|
||||
require_once ("classes/model/Process.php");
|
||||
require_once ("classes/model/Users.php");
|
||||
//require_once ("classes/model/Fields.php");
|
||||
//require_once ("classes/model/AppCacheView.php");
|
||||
//require_once ("classes/model/Process.php");
|
||||
//require_once ("classes/model/Users.php");
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
// oHeadPublisher->setExtSkin( 'xtheme-blue');
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
require_once 'classes/model/Application.php';
|
||||
/*require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/AppThread.php';
|
||||
require_once 'classes/model/AppDelay.php';
|
||||
@@ -30,7 +30,7 @@ require_once 'classes/model/Task.php';
|
||||
require_once ("classes/model/AppCacheView.php");
|
||||
require_once ("classes/model/AppDelegation.php");
|
||||
require_once ("classes/model/AdditionalTables.php");
|
||||
require_once ("classes/model/AppDelay.php");
|
||||
require_once ("classes/model/AppDelay.php");*/
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
|
||||
|
||||
@@ -31,7 +31,7 @@ G::LoadClass( 'case' );
|
||||
|
||||
//load the variables
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs' );
|
||||
$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'] );
|
||||
|
||||
@@ -148,7 +148,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showProcessInformation':
|
||||
require_once 'classes/model/Process.php';
|
||||
//require_once 'classes/model/Process.php';
|
||||
$oProcess = new Process();
|
||||
$aFields = $oProcess->load( $_SESSION['PROCESS'] );
|
||||
require_once 'classes/model/Users.php';
|
||||
@@ -173,14 +173,14 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showDynaformListHistory':
|
||||
require_once 'classes/model/AppHistory.php';
|
||||
//require_once 'classes/model/AppHistory.php';
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showTaskInformation':
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
//require_once 'classes/model/AppDelegation.php';
|
||||
//require_once 'classes/model/Task.php';
|
||||
$oTask = new Task();
|
||||
$aFields = $oTask->load( $_SESSION['TASK'] );
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
@@ -201,9 +201,9 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showTaskDetails':
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/AppDelegation.php';
|
||||
//require_once 'classes/model/Task.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
$oTask = new Task();
|
||||
$aRow = $oTask->load( $_POST['sTaskUID'] );
|
||||
$sTitle = $aRow['TAS_TITLE'];
|
||||
@@ -423,7 +423,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
}
|
||||
}
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
$c = new Criteria( 'workflow' );
|
||||
$c->addSelectColumn( UsersPeer::USR_UID );
|
||||
$c->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
@@ -457,10 +457,10 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'showUploadedDocument':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/InputDocument.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/AppDocument.php';
|
||||
//require_once 'classes/model/AppDelegation.php';
|
||||
//require_once 'classes/model/InputDocument.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
|
||||
$oInputDocument = new InputDocument();
|
||||
@@ -615,8 +615,8 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
echo G::json_encode( $r );
|
||||
break;
|
||||
case 'showGeneratedDocument':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
//require_once 'classes/model/AppDocument.php';
|
||||
//require_once 'classes/model/AppDelegation.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$aFields = $oAppDocument->load( $_POST['APP_DOC_UID'] );
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
@@ -701,7 +701,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
$aAdhocUsers[] = $aUser['USR_UID'];
|
||||
}
|
||||
}
|
||||
require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_UID );
|
||||
$oCriteria->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
@@ -729,14 +729,14 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
G::RenderPage( 'publish', 'raw' );
|
||||
break;
|
||||
case 'deleteUploadedDocument':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
//require_once 'classes/model/AppDocument.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove( $_POST['DOC'] );
|
||||
$oCase = new Cases();
|
||||
$oCase->getAllUploadedDocumentsCriteria( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['TASK'], $_SESSION['USER_LOGGED'] );
|
||||
break;
|
||||
case 'deleteGeneratedDocument':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
//require_once 'classes/model/AppDocument.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove( $_POST['DOC'] );
|
||||
$oCase = new Cases();
|
||||
@@ -744,7 +744,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
break;
|
||||
/* @Author Erik Amaru Ortiz <erik@colosa.com> */
|
||||
case 'resendMessage':
|
||||
require_once 'classes/model/Configuration.php';
|
||||
//require_once 'classes/model/Configuration.php';
|
||||
G::LoadClass( 'spool' );
|
||||
|
||||
$oCase = new Cases();
|
||||
@@ -888,7 +888,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
//G::pr($aCases);
|
||||
|
||||
|
||||
require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
$oUser = new Users();
|
||||
$sText = '';
|
||||
foreach ($aCases as $aCase) {
|
||||
@@ -948,7 +948,7 @@ switch (($_POST['action']) ? $_POST['action'] : $_REQUEST['action']) {
|
||||
}
|
||||
break;
|
||||
case "previusJump":
|
||||
require_once 'classes/model/Application.php';
|
||||
//require_once 'classes/model/Application.php';
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$response = array ("success" => true );
|
||||
|
||||
@@ -45,7 +45,7 @@ G::LoadClass( 'case' );
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->remove( $_GET['DOC'] );
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs' );
|
||||
if ($_GET['TYPE'] == 'INPUT') {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ G::LoadClass( 'pmScript' );
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( 'derivation' );
|
||||
|
||||
require_once 'classes/model/Event.php';
|
||||
//require_once 'classes/model/Event.php';
|
||||
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
/* Process the info */
|
||||
@@ -53,7 +53,7 @@ try {
|
||||
//load data
|
||||
$oCase = new Cases();
|
||||
//warning: we are not using the result value of function thisIsTheCurrentUser, so I'm commenting to optimize speed.
|
||||
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
||||
//$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs');
|
||||
$appFields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$appFields['APP_DATA'] = array_merge( $appFields['APP_DATA'], G::getSystemConstants() );
|
||||
//cleaning debug variables
|
||||
|
||||
@@ -1,182 +1,3 @@
|
||||
<?php
|
||||
/**
|
||||
* cases_List.php
|
||||
*
|
||||
* ProcessMaker Open Source Edition
|
||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Cases list (Refactored)
|
||||
* By Erik A.
|
||||
* O. <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
*/
|
||||
|
||||
/* Permissions */
|
||||
if (($RBAC_Response = $RBAC->userCanAccess( "PM_CASES" )) != 1) {
|
||||
return $RBAC_Response;
|
||||
}
|
||||
|
||||
/* Includes */
|
||||
G::LoadClass( 'case' );
|
||||
G::LoadClass( 'configuration' );
|
||||
|
||||
// $_GET['l'] has the type of cases list like todo,pause,cancel, all
|
||||
|
||||
|
||||
$conf = new Configurations();
|
||||
if (! isset( $_GET['l'] )) {
|
||||
$confCasesList = $conf->loadObject( 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
if (is_array( $confCasesList )) {
|
||||
$sTypeList = $confCasesList['sTypeList'];
|
||||
} else {
|
||||
$sTypeList = 'to_do';
|
||||
}
|
||||
} else {
|
||||
$sTypeList = $_GET['l'];
|
||||
$confCasesList = array ('sTypeList' => $sTypeList
|
||||
);
|
||||
$conf->saveObject( $confCasesList, 'ProcessMaker', 'cases_List', '', $_SESSION['USER_LOGGED'], '' );
|
||||
}
|
||||
|
||||
$sUIDUserLogged = $_SESSION['USER_LOGGED'];
|
||||
$_SESSION['CASES_MENU_OPTION'] = $sTypeList;
|
||||
|
||||
$oCases = new Cases();
|
||||
|
||||
/**
|
||||
* here we verify if there is a any case with a unpause on this day
|
||||
*/
|
||||
if ($sTypeList === 'to_do' or $sTypeList === 'draft' or $sTypeList === 'paused') {
|
||||
$oCases->ThrowUnpauseDaemon( date( 'Y-m-d' ) );
|
||||
}
|
||||
|
||||
/* *
|
||||
* Prepare the addtional filters before to show
|
||||
* By Erik
|
||||
*/
|
||||
|
||||
$aAdditionalFilter = Array ();
|
||||
|
||||
if (isset( $_GET['PROCESS_UID'] ) and $_GET['PROCESS_UID'] != "0" && $_GET['PROCESS_UID'] != "") {
|
||||
$PRO_UID = $_GET['PROCESS_UID'];
|
||||
$aAdditionalFilter['PRO_UID'] = $PRO_UID;
|
||||
} else {
|
||||
$PRO_UID = "0";
|
||||
}
|
||||
if (isset( $_GET['READ'] ) and $_GET['READ'] == "1") {
|
||||
$aAdditionalFilter['READ'] = $_GET['READ'];
|
||||
}
|
||||
if (isset( $_GET['UNREAD'] ) and $_GET['UNREAD'] == "1") {
|
||||
$aAdditionalFilter['UNREAD'] = $_GET['UNREAD'];
|
||||
}
|
||||
|
||||
if (isset( $_GET['APP_STATUS_FILTER'] ) and $_GET['APP_STATUS_FILTER'] != "ALL") {
|
||||
$aAdditionalFilter['APP_STATUS_FILTER'] = $_GET['APP_STATUS_FILTER'];
|
||||
}
|
||||
|
||||
if (isset( $_GET['MINE'] ) and $_GET['MINE'] == "1") {
|
||||
$aAdditionalFilter['MINE'] = $_GET['MINE'];
|
||||
}
|
||||
|
||||
switch ($sTypeList) {
|
||||
case 'to_do':
|
||||
if (defined( 'ENABLE_CASE_LIST_OPTIMIZATION' )) {
|
||||
$aCriteria = $oCases->prepareCriteriaForToDo( $sUIDUserLogged );
|
||||
$xmlfile = 'cases/cases_ListTodoNew';
|
||||
} else {
|
||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
list ($aCriteria, $xmlfile) = $oCases->getConditionCasesList( $sTypeList, $sUIDUserLogged, true, $aAdditionalFilter );
|
||||
}
|
||||
|
||||
/*
|
||||
$rs = ApplicationPeer::doSelectRS($aCriteria);
|
||||
$rs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$aRows1 = Array();
|
||||
while($rs->next()) {
|
||||
$aRows1[] = $rs->getRow();
|
||||
|
||||
}
|
||||
|
||||
g::pr($aRows1);die;*/
|
||||
/* GET , POST & $_SESSION Vars */
|
||||
|
||||
if (! isset( $_GET['PROCESS_UID'] )) {
|
||||
$oCase = new Cases();
|
||||
$rs = ApplicationPeer::doSelectRS( $aCriteria );
|
||||
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
|
||||
$aProcess = Array ();
|
||||
while ($rs->next()) {
|
||||
$aRow = $rs->getRow();
|
||||
//g::pr($aRow); die;
|
||||
if (! InAssocArray( $aRow, 'PRO_UID', $aRow['PRO_UID'] )) {
|
||||
array_push( $aProcess, Array ('PRO_UID' => $aRow['PRO_UID'],'PRO_TITLE' => $aRow['APP_PRO_TITLE'] ) );
|
||||
}
|
||||
}
|
||||
|
||||
$_DBArray['_PROCESSES'] = array_merge( Array (Array ('PRO_UID' => 'char','PRO_TITLE' => 'char' ) ), $aProcess );
|
||||
$_SESSION['_DBArray'] = $_DBArray;
|
||||
} else {
|
||||
$_DBArray = $_SESSION['_DBArray'];
|
||||
}
|
||||
|
||||
/* Render page */
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->ROWS_PER_PAGE = 12;
|
||||
|
||||
if ($sTypeList == 'to_reassign') {
|
||||
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_ReassignBy', '', array ('REASSIGN_BY' => 1 ) );
|
||||
}
|
||||
|
||||
$aData = Array ('PROCESS_FILTER' => $PRO_UID,'APP_STATUS_FILTER' => (isset( $_GET['APP_STATUS_FILTER'] ) ? $_GET['APP_STATUS_FILTER'] : '0')
|
||||
);
|
||||
|
||||
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', $xmlfile, $aCriteria, $aData );
|
||||
|
||||
G::RenderPage( 'publish', 'blank' );
|
||||
|
||||
function InAssocArray ($a, $k, $v)
|
||||
{
|
||||
foreach ($a as $item) {
|
||||
if (isset( $item[$k] ) && $v == $item[$k]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
||||
<script>
|
||||
try{
|
||||
oPropelTable = document.getElementById('publisherContent[0]');
|
||||
oTable = oPropelTable.getElementsByTagName('table');
|
||||
oTable[0].style.width = '98%';
|
||||
oTable[1].style.width = '98%';
|
||||
|
||||
parent.outerLayout.hide('east');
|
||||
parent.PANEL_EAST_OPEN = false;
|
||||
if(parent.refreshCountFolders) parent.refreshCountFolders();
|
||||
}catch(e){}
|
||||
</script>
|
||||
<?php
|
||||
|
||||
G::header('Location: ../cases/casesListExtJs');
|
||||
die();
|
||||
@@ -93,11 +93,11 @@ try {
|
||||
$oTasks = new Tasks();
|
||||
$oGroups = new Groups();
|
||||
$oUser = new Users();
|
||||
G::LoadClass( 'case' );
|
||||
$oCases = new Cases();
|
||||
|
||||
list ($oCriteriaToDo, $sXMLFile) = $oCases->getConditionCasesList( 'to_do', $sUserToReassign );
|
||||
list ($oCriteriaDraft, $sXMLFile) = $oCases->getConditionCasesList( 'draft', $sUserToReassign );
|
||||
$oAppCache = new AppCacheView();
|
||||
|
||||
$oCriteriaToDo = $oAppCache->getToDoListCriteria($sUserToReassign);
|
||||
$oCriteriaDraft = $oAppCache->getDraftListCriteria($sUserToReassign);
|
||||
|
||||
$aCasesList = Array ();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ try {
|
||||
|
||||
//Load the variables
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "cases_List" );
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs" );
|
||||
$Fields = $oCase->loadCase( $_SESSION["APPLICATION"] );
|
||||
|
||||
$Fields["APP_DATA"] = array_merge( $Fields["APP_DATA"], G::getSystemConstants() );
|
||||
@@ -162,7 +162,7 @@ try {
|
||||
}
|
||||
|
||||
//Save files
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
//require_once ("classes/model/AppDocument.php");
|
||||
|
||||
if (isset( $_FILES["form"]["name"] ) && count( $_FILES["form"]["name"] ) > 0) {
|
||||
$arrayField = array ();
|
||||
@@ -218,8 +218,8 @@ try {
|
||||
}
|
||||
|
||||
if ($indocUid != null) {
|
||||
require_once ("classes/model/AppFolder.php");
|
||||
require_once ("classes/model/InputDocument.php");
|
||||
//require_once ("classes/model/AppFolder.php");
|
||||
//require_once ("classes/model/InputDocument.php");
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load( $indocUid );
|
||||
@@ -296,9 +296,9 @@ try {
|
||||
}
|
||||
|
||||
$oForm->validatePost();
|
||||
$oJSON = new Services_JSON();
|
||||
//$oJSON = new Services_JSON();
|
||||
$_POST['__notValidateThisFields__'] = (isset( $_POST['__notValidateThisFields__'] ) && $_POST['__notValidateThisFields__'] != '') ? $_POST['__notValidateThisFields__'] : $_POST['DynaformRequiredFields'];
|
||||
if ($missing_req_values = $oForm->validateRequiredFields( $_POST['form'], $oJSON->decode( stripslashes( $_POST['__notValidateThisFields__'] ) ) )) {
|
||||
if ($missing_req_values = $oForm->validateRequiredFields( $_POST['form'], Bootstrap::json_decode( stripslashes( $_POST['__notValidateThisFields__'] ) ) )) {
|
||||
$_POST['next_step'] = $aNextStep;
|
||||
$_POST['previous_step'] = $oCase->getPreviousStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$_POST['req_val'] = $missing_req_values;
|
||||
|
||||
@@ -59,136 +59,86 @@ if ((isset( $_FILES['form'] )) && ($_FILES['form']['error']['APP_DOC_FILENAME']
|
||||
die();
|
||||
}
|
||||
|
||||
$docUid = $_POST['form']['DOC_UID'];
|
||||
$appDocUid = $_POST['form']['APP_DOC_UID'];
|
||||
$docVersion = $_POST['form']['docVersion'];
|
||||
$actionType = $_POST['form']['actionType'];
|
||||
G::LoadClass("case");
|
||||
|
||||
//load the variables
|
||||
G::LoadClass( 'case' );
|
||||
$oCase = new Cases();
|
||||
$oCase->thisIsTheCurrentUser( $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List' );
|
||||
$Fields = $oCase->loadCase( $_SESSION['APPLICATION'] );
|
||||
$Fields['APP_DATA'] = array_merge( $Fields['APP_DATA'], G::getSystemConstants() );
|
||||
$inputDocumentUid = $_GET["UID"]; //$_POST["form"]["DOC_UID"]
|
||||
$appDocUid = $_POST["form"]["APP_DOC_UID"];
|
||||
$docVersion = intval($_POST["form"]["docVersion"]);
|
||||
$appDocType = $_POST["form"]["APP_DOC_TYPE"];
|
||||
$appDocComment = (isset($_POST["form"]["APP_DOC_COMMENT"]))? $_POST["form"]["APP_DOC_COMMENT"] : "";
|
||||
$actionType = $_POST["form"]["actionType"];
|
||||
|
||||
#trigger debug routines...
|
||||
$case = new Cases();
|
||||
$case->thisIsTheCurrentUser($_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["USER_LOGGED"], "REDIRECT", "casesListExtJs");
|
||||
|
||||
//Load the fields
|
||||
$arrayField = $case->loadCase($_SESSION["APPLICATION"]);
|
||||
$arrayField["APP_DATA"] = array_merge($arrayField["APP_DATA"], G::getSystemConstants());
|
||||
|
||||
//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
|
||||
$arrayTrigger = $case->loadTriggers($_SESSION["TASK"], "INPUT_DOCUMENT", $inputDocumentUid, "AFTER");
|
||||
|
||||
$triggers = $oCase->loadTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER' );
|
||||
//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();
|
||||
|
||||
$_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;
|
||||
$_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] = count($arrayTrigger);
|
||||
$_SESSION["TRIGGER_DEBUG"]["TIME"] = "AFTER";
|
||||
|
||||
if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) {
|
||||
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_NAMES"] = $case->getTriggerNames($arrayTrigger);
|
||||
$_SESSION["TRIGGER_DEBUG"]["TRIGGERS_VALUES"] = $arrayTrigger;
|
||||
}
|
||||
|
||||
if ($_SESSION['TRIGGER_DEBUG']['NUM_TRIGGERS'] != 0) {
|
||||
//Execute after triggers - Start
|
||||
$Fields['APP_DATA'] = $oCase->ExecuteTriggers( $_SESSION['TASK'], 'INPUT_DOCUMENT', $_GET['UID'], 'AFTER', $Fields['APP_DATA'] );
|
||||
//Execute after triggers - End
|
||||
if ($_SESSION["TRIGGER_DEBUG"]["NUM_TRIGGERS"] > 0) {
|
||||
//Trigger - Execute after - Start
|
||||
$arrayField["APP_DATA"] = $case->executeTriggers(
|
||||
$_SESSION["TASK"],
|
||||
"INPUT_DOCUMENT",
|
||||
$inputDocumentUid,
|
||||
"AFTER",
|
||||
$arrayField["APP_DATA"]
|
||||
);
|
||||
//Trigger - Execute after - End
|
||||
}
|
||||
|
||||
//save data
|
||||
$aData = array ();
|
||||
$aData['APP_NUMBER'] = $Fields['APP_NUMBER'];
|
||||
$aData['APP_PROC_STATUS'] = $Fields['APP_PROC_STATUS'];
|
||||
$aData['APP_DATA'] = $Fields['APP_DATA'];
|
||||
$aData['DEL_INDEX'] = $_SESSION['INDEX'];
|
||||
$aData['TAS_UID'] = $_SESSION['TASK'];
|
||||
//$aData = $oCase->loadCase($_SESSION['APPLICATION']);
|
||||
$oCase->updateCase( $_SESSION['APPLICATION'], $aData );
|
||||
//Save data
|
||||
$arrayData = array();
|
||||
$arrayData["APP_NUMBER"] = $arrayField["APP_NUMBER"];
|
||||
$arrayData["APP_PROC_STATUS"] = $arrayField["APP_PROC_STATUS"];
|
||||
$arrayData["APP_DATA"] = $arrayField["APP_DATA"];
|
||||
$arrayData["DEL_INDEX"] = $_SESSION["INDEX"];
|
||||
$arrayData["TAS_UID"] = $_SESSION["TASK"];
|
||||
|
||||
//save info
|
||||
$case->updateCase($_SESSION["APPLICATION"], $arrayData);
|
||||
|
||||
|
||||
require_once ("classes/model/AppDocument.php");
|
||||
require_once ('classes/model/AppFolder.php');
|
||||
require_once ('classes/model/InputDocument.php');
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
$aID = $oInputDocument->load( $_GET['UID'] );
|
||||
|
||||
$oAppDocument = new AppDocument();
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder = new AppFolder();
|
||||
$folderId = $oFolder->createFromPath( $aID['INP_DOC_DESTINATION_PATH'] );
|
||||
|
||||
//Tags
|
||||
$fileTags = $oFolder->parseTags( $aID['INP_DOC_TAGS'] );
|
||||
|
||||
switch ($actionType) {
|
||||
case "R": //replace
|
||||
$aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DOC_VERSION' => $docVersion,'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
||||
);
|
||||
|
||||
$oAppDocument->update( $aFields );
|
||||
break;
|
||||
case "NV": //New Version
|
||||
|
||||
|
||||
$aFields = array ('APP_DOC_UID' => $appDocUid,'APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
||||
);
|
||||
|
||||
$oAppDocument->create( $aFields );
|
||||
break;
|
||||
default: //New
|
||||
$aFields = array ('APP_UID' => $_SESSION['APPLICATION'],'DEL_INDEX' => $_SESSION['INDEX'],'USR_UID' => $_SESSION['USER_LOGGED'],'DOC_UID' => $docUid,'APP_DOC_TYPE' => $_POST['form']['APP_DOC_TYPE'],'APP_DOC_CREATE_DATE' => date( 'Y-m-d H:i:s' ),'APP_DOC_COMMENT' => isset( $_POST['form']['APP_DOC_COMMENT'] ) ? $_POST['form']['APP_DOC_COMMENT'] : '','APP_DOC_TITLE' => '','APP_DOC_FILENAME' => isset( $_FILES['form']['name']['APP_DOC_FILENAME'] ) ? $_FILES['form']['name']['APP_DOC_FILENAME'] : '','FOLDER_UID' => $folderId,'APP_DOC_TAGS' => $fileTags
|
||||
);
|
||||
|
||||
$oAppDocument->create( $aFields );
|
||||
break;
|
||||
}
|
||||
|
||||
$sAppDocUid = $oAppDocument->getAppDocUid();
|
||||
$iDocVersion = $oAppDocument->getDocVersion();
|
||||
$info = pathinfo( $oAppDocument->getAppDocFilename() );
|
||||
$ext = (isset( $info['extension'] ) ? $info['extension'] : '');
|
||||
|
||||
//save the file
|
||||
if (! empty( $_FILES['form'] )) {
|
||||
if ($_FILES['form']['error']['APP_DOC_FILENAME'] == 0) {
|
||||
$sPathName = PATH_DOCUMENT . $_SESSION['APPLICATION'] . PATH_SEP;
|
||||
$sFileName = $sAppDocUid . "_" . $iDocVersion . '.' . $ext;
|
||||
G::uploadFile( $_FILES['form']['tmp_name']['APP_DOC_FILENAME'], $sPathName, $sFileName );
|
||||
|
||||
//Plugin Hook PM_UPLOAD_DOCUMENT for upload document
|
||||
$oPluginRegistry = & PMPluginRegistry::getSingleton();
|
||||
if ($oPluginRegistry->existsTrigger( PM_UPLOAD_DOCUMENT ) && class_exists( 'uploadDocumentData' )) {
|
||||
$triggerDetail = $oPluginRegistry->getTriggerInfo( PM_UPLOAD_DOCUMENT );
|
||||
$oData['APP_UID'] = $_SESSION['APPLICATION'];
|
||||
$documentData = new uploadDocumentData( $_SESSION['APPLICATION'], $_SESSION['USER_LOGGED'], $sPathName . $sFileName, $aFields['APP_DOC_FILENAME'], $sAppDocUid, $iDocVersion );
|
||||
|
||||
$uploadReturn = $oPluginRegistry->executeTriggers( PM_UPLOAD_DOCUMENT, $documentData );
|
||||
if ($uploadReturn) {
|
||||
$aFields['APP_DOC_PLUGIN'] = $triggerDetail->sNamespace;
|
||||
if (! isset( $aFields['APP_DOC_UID'] )) {
|
||||
$aFields['APP_DOC_UID'] = $sAppDocUid;
|
||||
}
|
||||
if (! isset( $aFields['DOC_VERSION'] )) {
|
||||
$aFields['DOC_VERSION'] = $iDocVersion;
|
||||
}
|
||||
//$oAppDocument1 = new AppDocument();
|
||||
//G::pr($aFields);die;
|
||||
$oAppDocument->update( $aFields );
|
||||
unlink( $sPathName . $sFileName );
|
||||
}
|
||||
}
|
||||
//end plugin
|
||||
}
|
||||
//Add Input Document
|
||||
if (isset($_FILES) && isset($_FILES["form"]) && count($_FILES["form"]) > 0) {
|
||||
$appDocUid = $case->addInputDocument(
|
||||
$inputDocumentUid,
|
||||
$appDocUid,
|
||||
$docVersion,
|
||||
$appDocType,
|
||||
$appDocComment,
|
||||
$actionType,
|
||||
$_SESSION["APPLICATION"],
|
||||
$_SESSION["INDEX"],
|
||||
$_SESSION["TASK"],
|
||||
$_SESSION["USER_LOGGED"],
|
||||
"xmlform",
|
||||
$_FILES["form"]["name"]["APP_DOC_FILENAME"],
|
||||
$_FILES["form"]["error"]["APP_DOC_FILENAME"],
|
||||
$_FILES["form"]["tmp_name"]["APP_DOC_FILENAME"]
|
||||
);
|
||||
}
|
||||
|
||||
//go to the next step
|
||||
//if (!isset($_POST['form']['MORE'])) {
|
||||
if (false) {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] );
|
||||
$aNextStep = $case->getNextStep($_SESSION["PROCESS"], $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["STEP_POSITION"]);
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
@@ -212,7 +162,7 @@ if (false) {
|
||||
G::header( 'location: ' . $_SERVER['HTTP_REFERER'] );
|
||||
die();
|
||||
} else {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||
$aNextStep = $case->getNextStep($_SESSION["PROCESS"], $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["STEP_POSITION"] - 1);
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
@@ -225,7 +175,7 @@ if (false) {
|
||||
die();
|
||||
}
|
||||
} else {
|
||||
$aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] - 1 );
|
||||
$aNextStep = $case->getNextStep($_SESSION["PROCESS"], $_SESSION["APPLICATION"], $_SESSION["INDEX"], $_SESSION["STEP_POSITION"] - 1);
|
||||
$_SESSION['STEP_POSITION'] = $aNextStep['POSITION'];
|
||||
|
||||
if ($_SESSION['TRIGGER_DEBUG']['ISSET']) {
|
||||
|
||||
@@ -160,7 +160,7 @@ if (isset( $_GET['breakpoint'] )) {
|
||||
#end trigger debug session.......
|
||||
|
||||
|
||||
//$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'cases_List');
|
||||
//$oCase->thisIsTheCurrentUser($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], 'REDIRECT', 'casesListExtJs');
|
||||
|
||||
|
||||
//Save data - Start
|
||||
@@ -297,8 +297,8 @@ try {
|
||||
$oHeadPublisher->addScriptCode( "documentName='{$titleDocument}';" );
|
||||
break;
|
||||
case 'VIEW':
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
//require_once 'classes/model/AppDocument.php';
|
||||
//require_once 'classes/model/Users.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$oAppDocument->Fields = $oAppDocument->load( $_GET['DOC'], $_GET['VERSION'] );
|
||||
$Fields['POSITION'] = $_SESSION['STEP_POSITION'];
|
||||
@@ -325,7 +325,7 @@ try {
|
||||
case 'OUTPUT_DOCUMENT':
|
||||
//$G_PUBLISH->AddContent('smarty', 'cases/cases_title', '', '', $array);
|
||||
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
//require_once 'classes/model/OutputDocument.php';
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aOD = $oOutputDocument->load( $_GET['UID'] );
|
||||
if (! $aPreviousStep) {
|
||||
@@ -347,8 +347,8 @@ try {
|
||||
//END: If there is a Break Step registered from Plugin
|
||||
|
||||
$sFilenameOriginal = $sFilename = preg_replace( '[^A-Za-z0-9_]', '_', G::replaceDataField( $aOD['OUT_DOC_FILENAME'], $Fields['APP_DATA'] ) );
|
||||
require_once 'classes/model/AppFolder.php';
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
//require_once 'classes/model/AppFolder.php';
|
||||
//require_once 'classes/model/AppDocument.php';
|
||||
|
||||
//Get the Custom Folder ID (create if necessary)
|
||||
$oFolder = new AppFolder();
|
||||
@@ -581,7 +581,7 @@ try {
|
||||
if ($noShowTitle == 0) {
|
||||
$G_PUBLISH->AddContent( 'smarty', 'cases/cases_title', '', '', $array );
|
||||
}
|
||||
require_once 'classes/model/AppDocument.php';
|
||||
//require_once 'classes/model/AppDocument.php';
|
||||
$oAppDocument = new AppDocument();
|
||||
$lastVersion = $oAppDocument->getLastAppDocVersion( $_GET['DOC'], $_SESSION['APPLICATION'] );
|
||||
$aFields = $oAppDocument->load( $_GET['DOC'], $lastVersion );
|
||||
@@ -594,7 +594,7 @@ try {
|
||||
$listing = $oPluginRegistry->executeTriggers( PM_CASE_DOCUMENT_LIST, $folderData );
|
||||
}
|
||||
|
||||
require_once 'classes/model/OutputDocument.php';
|
||||
//require_once 'classes/model/OutputDocument.php';
|
||||
$oOutputDocument = new OutputDocument();
|
||||
$aGields = $oOutputDocument->load( $aFields['DOC_UID'] );
|
||||
|
||||
|
||||
@@ -30,8 +30,6 @@ if (($RBAC_Response = $RBAC->userCanAccess( "PM_FACTORY" )) != 1) {
|
||||
require_once ('classes/model/Dynaform.php');
|
||||
require_once ('classes/model/Content.php');
|
||||
|
||||
$oJSON = new Services_JSON();
|
||||
|
||||
if (isset( $_POST['function'] )) {
|
||||
$sfunction = $_POST['function'];
|
||||
} elseif (isset( $_POST['functions'] )) {
|
||||
|
||||
@@ -94,6 +94,118 @@ switch ($request) {
|
||||
$o->remove( '___pm_boot_strap___' );
|
||||
}
|
||||
break;
|
||||
case 'showImportForm':
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
require_once 'classes/model/Content.php';
|
||||
$uidDynafom = $_POST['DYN_UID'];
|
||||
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->clearSelectColumns();
|
||||
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
|
||||
$oCriteria->addAsColumn( 'DYNA_NAME', 'C_DYNA.CON_VALUE' );
|
||||
$oCriteria->addAsColumn( 'PROC_NAME', 'C_PROC.CON_VALUE' );
|
||||
|
||||
$oCriteria->addAlias("C_DYNA", "CONTENT");
|
||||
$oCriteria->addAlias("C_PROC", "CONTENT");
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(DynaformPeer::DYN_UID, "C_DYNA.CON_ID");
|
||||
$oCriteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
|
||||
$arrayCondition = array();
|
||||
$arrayCondition[] = array(DynaformPeer::PRO_UID, "C_PROC.CON_ID");
|
||||
$oCriteria->addJoinMC($arrayCondition, Criteria::LEFT_JOIN);
|
||||
|
||||
$oCriteria->add( 'C_DYNA.CON_LANG', SYS_LANG );
|
||||
$oCriteria->add( 'C_DYNA.CON_CATEGORY', 'DYN_TITLE' );
|
||||
|
||||
$oCriteria->add( 'C_PROC.CON_LANG', SYS_LANG );
|
||||
$oCriteria->add( 'C_PROC.CON_CATEGORY', 'PRO_TITLE' );
|
||||
|
||||
$oCriteria->add( DynaformPeer::DYN_UID, $uidDynafom, Criteria::NOT_EQUAL);
|
||||
|
||||
$oCriteria->addAscendingOrderByColumn ('PROC_NAME');
|
||||
$oCriteria->addAscendingOrderByColumn ('DYNA_NAME');
|
||||
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
|
||||
$select = '<select name="form[IMPORT_DYNA]" id="form[IMPORT_DYNA]" width="300" style="width: 300px" class="module_app_input___gray">';
|
||||
$selectGroup = '';
|
||||
while (is_array( $aRow )) {
|
||||
if ($selectGroup != $aRow['PROC_NAME']) {
|
||||
if ($selectGroup != '') {
|
||||
$select .= '</optgroup>';
|
||||
}
|
||||
$selectGroup = $aRow['PROC_NAME'];
|
||||
$select .= '<optgroup label="' . $aRow['PROC_NAME'] . '">';
|
||||
}
|
||||
$select .= '<option value="' . $aRow['DYN_FILENAME'] . '">' . $aRow['DYNA_NAME'] . '</option>';
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
}
|
||||
|
||||
$select .= '</optgroup></select>';
|
||||
$html = '<div id="importForm"><table width="100%" cellspacing="3" cellpadding="3" border="0">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="" colspan="2" style="background: none repeat scroll 0 0 #E0E7EF; border-bottom: 1px solid #C3D1DF;
|
||||
color: #000000; font-weight: bold; padding-left: 5px; text-shadow: 0 1px 0 #FFFFFF;
|
||||
font: 8px">
|
||||
<span>' . G::LoadTranslation('ID_SELECT_DYNAFORM_IMPORT') . '</span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="40%" style="font: 11px/180% sans-serif,MiscFixed; color: #808080; text-align: right;">
|
||||
<label for="form[IMPORT_DYNA]">' . G::LoadTranslation('ID_DYNAFORM') . '</label>
|
||||
</td>
|
||||
<td width="615" class="FormFieldContent">' . $select . '
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="2" class="FormButton">
|
||||
<input type="button" onclick="dynaformEditor.import(document.getElementById('form[IMPORT_DYNA]').value);" value="' . G::LoadTranslation('ID_IMPORT') . '" class="module_app_button___gray " style="">
|
||||
<input type="button" onclick="panelImportDyna.remove();" value="' . G::LoadTranslation('ID_CANCEL') . '" class="module_app_button___gray " style="">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table><div>';
|
||||
echo $html;
|
||||
break;
|
||||
case 'import':
|
||||
require_once 'classes/model/Dynaform.php';
|
||||
$uidDynafom = $_POST['DYN_UID'];
|
||||
$oCriteria = new Criteria( 'workflow' );
|
||||
$oCriteria->clearSelectColumns();
|
||||
$oCriteria->addSelectColumn( DynaformPeer::DYN_FILENAME );
|
||||
$oCriteria->add( DynaformPeer::DYN_UID, $uidDynafom, Criteria::EQUAL);
|
||||
$oDataset = DynaformPeer::doSelectRS( $oCriteria );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
$aRow = $oDataset->getRow();
|
||||
|
||||
$dynaFile = PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '.xml';
|
||||
$importFile = PATH_DYNAFORM . $_POST['FILE'] . '.xml';
|
||||
|
||||
$importFp = fopen ($importFile, "r+");
|
||||
$fileText = fread($importFp, filesize($importFile));
|
||||
fclose ( $importFp );
|
||||
$newFile = str_replace($_POST['FILE'], $aRow['DYN_FILENAME'], $fileText);
|
||||
|
||||
$dynaFileTmp = PATH_DYNAFORM . $aRow['DYN_FILENAME'] . '_tmp0.xml';
|
||||
$dynafmFp = fopen ($dynaFileTmp,"w+");
|
||||
fwrite ( $dynafmFp, $newFile);
|
||||
fclose ( $dynafmFp );
|
||||
|
||||
/*
|
||||
$dynafmFp = fopen ($dynaFile,"w+");
|
||||
fwrite ( $dynafmFp, $newFile);
|
||||
fclose ( $dynafmFp );
|
||||
*/
|
||||
echo 'success';
|
||||
break;
|
||||
default:
|
||||
echo 'no request param.';
|
||||
}
|
||||
|
||||
@@ -36,16 +36,17 @@ try {
|
||||
break;
|
||||
}
|
||||
|
||||
$sfunction = '';
|
||||
if (isset( $_POST['function'] )) {
|
||||
$sfunction = $_POST['function'];
|
||||
} else {
|
||||
} elseif (isset( $_POST['functions'] )){
|
||||
$sfunction = $_POST['functions'];
|
||||
}
|
||||
|
||||
}
|
||||
// Bootstrap::mylog("post:".$_POST['function']);
|
||||
switch ($sfunction) {
|
||||
case 'lookForNameInput':
|
||||
require_once ('classes/model/Content.php');
|
||||
require_once ("classes/model/InputDocument.php");
|
||||
//require_once ('classes/model/Content.php');
|
||||
//require_once ("classes/model/InputDocument.php");
|
||||
|
||||
$snameInput = urldecode( $_POST['NAMEINPUT'] );
|
||||
$sPRO_UID = urldecode( $_POST['proUid'] );
|
||||
@@ -77,7 +78,7 @@ try {
|
||||
print $flag;
|
||||
break;
|
||||
default:
|
||||
require_once 'classes/model/InputDocument.php';
|
||||
//require_once 'classes/model/InputDocument.php';
|
||||
G::LoadClass( 'processMap' );
|
||||
|
||||
$oInputDocument = new InputDocument();
|
||||
|
||||
@@ -48,11 +48,11 @@ if (!isset($_SESSION['FAILED_LOGINS'])) {
|
||||
|
||||
$sFailedLogins = $_SESSION['FAILED_LOGINS'];
|
||||
|
||||
require_once 'classes/model/LoginLog.php';
|
||||
|
||||
$aFields['LOGIN_VERIFY_MSG'] = G::loadTranslation('LOGIN_VERIFY_MSG');
|
||||
//$aFields['LOGIN_VERIFY_MSG'] = Bootstrap::loadTranslation('LOGIN_VERIFY_MSG');
|
||||
|
||||
if (isset ($_SESSION['USER_LOGGED'])) {
|
||||
require_once 'classes/model/LoginLog.php';
|
||||
//close the session, if the current session_id was used in PM.
|
||||
$oCriteria = new Criteria('workflow');
|
||||
|
||||
@@ -120,7 +120,9 @@ if (strlen($msgType) > 0) {
|
||||
$_SESSION['FAILED_LOGINS'] = $sFailedLogins;
|
||||
|
||||
//translation
|
||||
$Translations = G::getModel("Translation");
|
||||
//$Translations = G::getModel("Translation");
|
||||
//require_once "classes/model/Translation.php";
|
||||
$Translations = new Translation();
|
||||
$translationsTable = $Translations->getTranslationEnvironments();
|
||||
|
||||
$availableLangArray = array ();
|
||||
@@ -141,6 +143,7 @@ global $_DBArray;
|
||||
$_DBArray ['langOptions'] = $availableLangArray;
|
||||
|
||||
G::LoadClass('configuration');
|
||||
//BootStrap::LoadClass('configuration');
|
||||
|
||||
$oConf = new Configurations();
|
||||
$oConf->loadConfig($obj, 'ENVIRONMENT_SETTINGS', '');
|
||||
@@ -151,7 +154,7 @@ $aFields['USER_LANG'] = isset($oConf->aConfig['login_defaultLanguage'])
|
||||
$G_PUBLISH = new Publisher();
|
||||
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/login', '', $aFields, SYS_URI . 'login/authentication.php');
|
||||
G::LoadClass('serverConfiguration');
|
||||
|
||||
//Bootstrap::LoadClass('serverConfiguration');
|
||||
//get the serverconf singleton, and check if we can send the heartbeat
|
||||
$oServerConf = & serverConf::getSingleton();
|
||||
|
||||
@@ -190,12 +193,7 @@ if ($flagGettingStarted == 0) {
|
||||
|
||||
$dummy = '';
|
||||
|
||||
G::loadClass('configuration');
|
||||
|
||||
$oConf = new Configurations();
|
||||
|
||||
$oConf->loadConfig($dummy, 'ENVIRONMENT_SETTINGS', '');
|
||||
|
||||
$flagForgotPassword = isset($oConf->aConfig['login_enableForgotPassword'])
|
||||
? $oConf->aConfig['login_enableForgotPassword']
|
||||
: 'off';
|
||||
|
||||
@@ -83,10 +83,13 @@ function getWorkspacesAvailable()
|
||||
sort ($filesArray, SORT_STRING);
|
||||
return $filesArray;
|
||||
}
|
||||
|
||||
$availableWorkspace = getWorkspacesAvailable ();
|
||||
|
||||
//Translations
|
||||
$Translations = G::getModel("Translation");
|
||||
//$Translations = G::getModel("Translation"); <-- ugly way to get a class
|
||||
require_once "classes/model/Translation.php";
|
||||
$Translations = new Translation();
|
||||
$translationsTable = $Translations->getTranslationEnvironments();
|
||||
|
||||
$availableLangArray = array ();
|
||||
@@ -103,7 +106,6 @@ foreach ($translationsTable as $locale) {
|
||||
$availableLangArray [] = $aFields;
|
||||
}
|
||||
|
||||
|
||||
$availableWorkspaceArray = array ();
|
||||
$availableWorkspaceArray [] = array ('ENV_ID' => 'char', 'ENV_NAME' => 'char');
|
||||
foreach ($availableWorkspace as $envKey => $envName) {
|
||||
@@ -120,8 +122,9 @@ $_SESSION ['_DBArray'] = $_DBArray;
|
||||
|
||||
$aField ['LOGIN_VERIFY_MSG'] = G::loadTranslation ('LOGIN_VERIFY_MSG');
|
||||
$aField['USER_LANG'] = SYS_LANG;
|
||||
|
||||
//Get Server Configuration
|
||||
G::LoadClass ('serverConfiguration');
|
||||
//G::LoadClass ('serverConfiguration'); //already called
|
||||
$oServerConf = & serverConf::getSingleton ();
|
||||
|
||||
$G_PUBLISH = new Publisher ();
|
||||
@@ -131,8 +134,8 @@ if ($oServerConf->getProperty ('LOGIN_NO_WS')) {
|
||||
$G_PUBLISH->AddContent ('xmlform', 'xmlform', 'login/sysLogin', '', $aField, 'sysLogin');
|
||||
}
|
||||
|
||||
|
||||
G::RenderPage ("publish");
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var oInfoPanel;
|
||||
|
||||
90
workflow/engine/methods/mails/emailList.php
Normal file
90
workflow/engine/methods/mails/emailList.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
/**
|
||||
* emailList.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.
|
||||
*/
|
||||
|
||||
global $RBAC;
|
||||
if ($RBAC->userCanAccess( 'PM_SETUP_ADVANCE' ) != 1) {
|
||||
G::SendTemporalMessage( 'ID_USER_HAVENT_RIGHTS_PAGE', 'error', 'labels' );
|
||||
G::header( 'location: ../login/login' );
|
||||
die();
|
||||
}
|
||||
|
||||
G::LoadClass( 'configuration' );
|
||||
$c = new Configurations();
|
||||
$configPage = $c->getConfiguration( 'eventList', 'pageSize', '', $_SESSION['USER_LOGGED'] );
|
||||
$Config['pageSize'] = isset( $configPage['pageSize'] ) ? $configPage['pageSize'] : 20;
|
||||
|
||||
$G_MAIN_MENU = 'processmaker';
|
||||
$G_SUB_MENU = 'logs';
|
||||
$G_ID_MENU_SELECTED = 'logs';
|
||||
$G_ID_SUB_MENU_SELECTED = 'EMAILS';
|
||||
|
||||
//get values for the comboBoxes
|
||||
$userUid = (isset( $_SESSION['USER_LOGGED'] ) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||
$status = array (
|
||||
array ('',G::LoadTranslation( 'ID_ALL' )),
|
||||
array ("sent", "Sent"),
|
||||
array ("pending", "Pending")
|
||||
);
|
||||
|
||||
$processes = getProcessArray( $userUid );
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
$oHeadPublisher->addExtJsScript( 'mails/emailList', false ); //adding a javascript file .js
|
||||
$oHeadPublisher->addContent( 'mails/emailList' ); //adding a html file .html.
|
||||
//sending the columns to display in grid
|
||||
$oHeadPublisher->assign( 'statusValues', $status );
|
||||
$oHeadPublisher->assign( 'processValues', $processes );
|
||||
|
||||
function getProcessArray ($userUid)
|
||||
{
|
||||
global $oAppCache;
|
||||
require_once ("classes/model/AppCacheView.php");
|
||||
|
||||
$processes = Array ();
|
||||
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' ));
|
||||
|
||||
$cProcess = new Criteria( 'workflow' );
|
||||
$cProcess->clearSelectColumns();
|
||||
$cProcess->addSelectColumn( AppCacheViewPeer::PRO_UID );
|
||||
$cProcess->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
|
||||
$cProcess->setDistinct( AppCacheViewPeer::PRO_UID );
|
||||
|
||||
$cProcess->addAscendingOrderByColumn( AppCacheViewPeer::APP_PRO_TITLE );
|
||||
|
||||
$oDataset = AppCacheViewPeer::doSelectRS( $cProcess );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$processes[] = array ($aRow['PRO_UID'],$aRow['APP_PRO_TITLE']);
|
||||
$oDataset->next();
|
||||
}
|
||||
|
||||
return $processes;
|
||||
}
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
154
workflow/engine/methods/mails/emailsAjax.php
Normal file
154
workflow/engine/methods/mails/emailsAjax.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?php
|
||||
$req = (isset($_POST['request']))? $_POST['request']:((isset($_REQUEST['request']))? $_REQUEST['request'] : 'No hayyy tal');
|
||||
|
||||
require_once 'classes/model/Content.php';
|
||||
require_once 'classes/model/AppMessage.php';
|
||||
require_once 'classes/model/AppDelegation.php';
|
||||
require_once 'classes/model/Application.php';
|
||||
switch($req){
|
||||
case 'MessageList':
|
||||
$start = (isset($_REQUEST['start']))? $_REQUEST['start'] : '0';
|
||||
$limit = (isset($_REQUEST['limit']))? $_REQUEST['limit'] : '25';
|
||||
$proUid = (isset($_REQUEST['process']))? $_REQUEST['process'] : '';
|
||||
$eventype = (isset($_REQUEST['type']))? $_REQUEST['type'] : '';
|
||||
$emailStatus = (isset($_REQUEST['status']))? $_REQUEST['status'] : '';
|
||||
$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';
|
||||
$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';
|
||||
$dateFrom = isset( $_POST["dateFrom"] ) ? substr( $_POST["dateFrom"], 0, 10 ) : "";
|
||||
$dateTo = isset( $_POST["dateTo"] ) ? substr( $_POST["dateTo"], 0, 10 ) : "";
|
||||
|
||||
$response = new stdclass();
|
||||
$response->status = 'OK';
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID);
|
||||
if ($emailStatus != '') {
|
||||
$criteria->add( AppMessagePeer::APP_MSG_STATUS, $emailStatus, Criteria::LESS_EQUAL );
|
||||
}
|
||||
if ($proUid != '') {
|
||||
$criteria->add( ApplicationPeer::PRO_UID, $proUid);
|
||||
}
|
||||
if ($dateFrom != '') {
|
||||
if ($dateTo != '') {
|
||||
$criteria->add( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL )->addAnd( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
} else {
|
||||
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
}
|
||||
} elseif ($dateTo != '') {
|
||||
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
}
|
||||
|
||||
$result = AppMessagePeer::doSelectRS($criteria);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = Array();
|
||||
while ( $result->next() ) {
|
||||
$data[] = $result->getRow();
|
||||
}
|
||||
$totalCount = count($data);
|
||||
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_UID);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_UID);
|
||||
$criteria->addSelectColumn(AppMessagePeer::DEL_INDEX);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TYPE);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SUBJECT);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_FROM);
|
||||
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_TO);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_BODY);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_STATUS);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_DATE);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SEND_DATE);
|
||||
$criteria->addSelectColumn(AppMessagePeer::APP_MSG_SHOW_MESSAGE);
|
||||
|
||||
$criteria->addSelectColumn(ApplicationPeer::PRO_UID);
|
||||
|
||||
$criteria->addAsColumn('PRO_TITLE', 'C2.CON_VALUE');
|
||||
$criteria->addAlias('C2', 'CONTENT');
|
||||
|
||||
if ($emailStatus != '') {
|
||||
$criteria->add( AppMessagePeer::APP_MSG_STATUS, $emailStatus, Criteria::LESS_EQUAL );
|
||||
}
|
||||
if ($proUid != '') {
|
||||
$criteria->add( ApplicationPeer::PRO_UID, $proUid);
|
||||
}
|
||||
if ($dateFrom != '') {
|
||||
if ($dateTo != '') {
|
||||
$criteria->add( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL )->addAnd( $criteria->getNewCriterion( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL ) ) );
|
||||
} else {
|
||||
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateFrom, Criteria::GREATER_EQUAL );
|
||||
}
|
||||
} elseif ($dateTo != '') {
|
||||
$criteria->add( AppMessagePeer::APP_MSG_DATE, $dateTo, Criteria::LESS_EQUAL );
|
||||
}
|
||||
|
||||
if ($sort != '') {
|
||||
if ($dir == 'ASC') {
|
||||
$criteria->addAscendingOrderByColumn($sort);
|
||||
} else {
|
||||
$criteria->addDescendingOrderByColumn($sort);
|
||||
}
|
||||
} else {
|
||||
$oCriteria->addDescendingOrderByColumn(AppMessagePeer::APP_MSG_SEND_DATE );
|
||||
}
|
||||
if ($limit != '') {
|
||||
$criteria->setLimit($limit);
|
||||
$criteria->setOffset($start);
|
||||
}
|
||||
$criteria->addJoin(AppMessagePeer::APP_UID, ApplicationPeer::APP_UID);
|
||||
|
||||
$conditions = array();
|
||||
$conditions[] = array(ApplicationPeer::PRO_UID, 'C2.CON_ID');
|
||||
$conditions[] = array(
|
||||
'C2.CON_CATEGORY', DBAdapter::getStringDelimiter() . 'PRO_TITLE' . DBAdapter::getStringDelimiter()
|
||||
);
|
||||
$conditions[] = array(
|
||||
'C2.CON_LANG', DBAdapter::getStringDelimiter() . SYS_LANG . DBAdapter::getStringDelimiter()
|
||||
);
|
||||
$criteria->addJoinMC($conditions, Criteria::LEFT_JOIN);
|
||||
$result = AppMessagePeer::doSelectRS($criteria);
|
||||
$result->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$data = Array();
|
||||
$dataPro = array();
|
||||
$index = 0;
|
||||
$content = new Content();
|
||||
$tasTitleDefault = G::LoadTranslation('ID_TASK_NOT_RELATED');
|
||||
while ( $result->next() ) {
|
||||
|
||||
$row = $result->getRow();
|
||||
$row['APP_MSG_FROM'] =htmlentities($row['APP_MSG_FROM'], ENT_QUOTES, "UTF-8");
|
||||
$row['APP_MSG_STATUS'] = ucfirst ( $row['APP_MSG_STATUS']);
|
||||
$row['TAS_TITLE'] = $tasTitleDefault;
|
||||
if ($row['DEL_INDEX'] != 0) {
|
||||
$criteria = new Criteria();
|
||||
$criteria->addSelectColumn(AppDelegationPeer::PRO_UID);
|
||||
$criteria->addSelectColumn(AppDelegationPeer::TAS_UID);
|
||||
$criteria->addSelectColumn(AppDelegationPeer::DEL_INDEX);
|
||||
$criteria->add(AppDelegationPeer::APP_UID, $row['APP_UID']);
|
||||
$resultDelegation = AppDelegationPeer::doSelectRS($criteria);
|
||||
$resultDelegation->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
$row['TAS_TITLE'] = '-';
|
||||
while ($resultDelegation->next()) {
|
||||
$rowDelegation = $resultDelegation->getRow();
|
||||
if ($row['DEL_INDEX'] == $rowDelegation['DEL_INDEX']) {
|
||||
$row['TAS_TITLE'] = $content->load( 'TAS_TITLE', '', $rowDelegation['TAS_UID'], SYS_LANG );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data[] = $row;
|
||||
}
|
||||
$response = array();
|
||||
$response['totalCount'] = $totalCount;
|
||||
$response['data'] = $data;
|
||||
die(G::json_encode($response));
|
||||
break;
|
||||
case 'updateStatusMessage':
|
||||
if (isset($_REQUEST['APP_MSG_UID']) && isset($_REQUEST['APP_MSG_STATUS'])) {
|
||||
$message = new AppMessage();
|
||||
$result = $message->updateStatus($_REQUEST['APP_MSG_UID'], $_REQUEST['APP_MSG_STATUS']);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ $G_ID_MENU_SELECTED = 'PROCESSES';
|
||||
$G_ID_SUB_MENU_SELECTED = '-';
|
||||
|
||||
$G_PUBLISH = new Publisher();
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
// $oHeadPublisher = & headPublisher::getSingleton();
|
||||
//$oHeadPublisher->addScriptFile('/jscore/processes/main.js');
|
||||
$G_PUBLISH->AddContent( 'view', 'processes/mainLoad' );
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
|
||||
$oHeadPublisher = & headPublisher::getSingleton();
|
||||
//$oHeadPublisher = & headPublisher::getSingleton();
|
||||
|
||||
G::loadClass( 'configuration' );
|
||||
$conf = new Configurations();
|
||||
|
||||
@@ -33,4 +34,3 @@ $oHeadPublisher->addContent( 'processes/main' ); //adding a html file .html.
|
||||
$oHeadPublisher->assign( 'pageSize', $conf->getEnvSetting( 'casesListRowNumber' ) );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ $limit = isset( $_POST['limit'] ) ? $_POST['limit'] : '';
|
||||
|
||||
$oProcess = new Process();
|
||||
|
||||
$memcache = & PMmemcached::getSingleton( SYS_SYS );
|
||||
//$memcache = & PMmemcached::getSingleton( SYS_SYS );
|
||||
|
||||
$memkey = 'no memcache';
|
||||
$memcacheUsed = 'not used';
|
||||
|
||||
@@ -36,13 +36,16 @@ try {
|
||||
die;
|
||||
break;
|
||||
}*/
|
||||
$oJSON = new Services_JSON();
|
||||
//$oJSON = new Services_JSON();
|
||||
|
||||
if (isset( $_REQUEST['data'] )) {
|
||||
$oData = $oJSON->decode( stripslashes( $_REQUEST['data'] ) );
|
||||
$oData = G::json_decode( stripslashes( $_REQUEST['data'] ) );
|
||||
//$oData = $oJSON->decode( stripslashes( $_REQUEST['data'] ) );
|
||||
$sOutput = '';
|
||||
$sTask = '';
|
||||
}
|
||||
|
||||
G::LoadClass( 'processMap' );
|
||||
//G::LoadClass( 'processMap' );
|
||||
$oProcessMap = new processMap( new DBConnection() );
|
||||
|
||||
switch ($_REQUEST['action']) {
|
||||
|
||||
@@ -871,6 +871,28 @@
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="addCaseNoteRequest">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="sessionId" type="xs:string"/>
|
||||
<xs:element name="caseUid" type="xs:string"/>
|
||||
<xs:element name="processUid" type="xs:string"/>
|
||||
<xs:element name="taskUid" type="xs:string"/>
|
||||
<xs:element name="userUid" type="xs:string"/>
|
||||
<xs:element name="note" type="xs:string"/>
|
||||
<xs:element name="sendMail" minOccurs="0" maxOccurs="unbounded" type="xs:integer"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
<xs:element name="addCaseNoteResponse">
|
||||
<xs:complexType>
|
||||
<xs:sequence>
|
||||
<xs:element name="status_code" type="xs:integer"/>
|
||||
<xs:element name="message" type="xs:string"/>
|
||||
<xs:element name="timestamp" type="xs:string"/>
|
||||
</xs:sequence>
|
||||
</xs:complexType>
|
||||
</xs:element>
|
||||
</xs:schema>
|
||||
</types>
|
||||
|
||||
@@ -1099,6 +1121,12 @@
|
||||
<message name="unpauseCaseResponse">
|
||||
<part name="parameters" element="xs0:unpauseCaseResponse"/>
|
||||
</message>
|
||||
<message name="addCaseNoteRequest">
|
||||
<part name="parameters" element="xs0:addCaseNoteRequest"/>
|
||||
</message>
|
||||
<message name="addCaseNoteResponse">
|
||||
<part name="parameters" element="xs0:addCaseNoteResponse"/>
|
||||
</message>
|
||||
|
||||
<portType name="ProcessMakerServiceSoap">
|
||||
<operation name="login">
|
||||
@@ -1261,6 +1289,10 @@
|
||||
<input message="xs0:unpauseCaseRequest"/>
|
||||
<output message="xs0:unpauseCaseResponse"/>
|
||||
</operation>
|
||||
<operation name="addCaseNote">
|
||||
<input message="xs0:addCaseNoteRequest"/>
|
||||
<output message="xs0:addCaseNoteResponse"/>
|
||||
</operation>
|
||||
</portType>
|
||||
|
||||
<binding name="ProcessMakerServiceSoap" type="xs0:ProcessMakerServiceSoap">
|
||||
@@ -1625,6 +1657,15 @@
|
||||
<soap12:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
<operation name="addCaseNote">
|
||||
<soap12:operation soapAction="urn:addCaseNote" soapActionRequired="true" style="document"/>
|
||||
<input>
|
||||
<soap12:body use="literal"/>
|
||||
</input>
|
||||
<output>
|
||||
<soap12:body use="literal"/>
|
||||
</output>
|
||||
</operation>
|
||||
</binding>
|
||||
|
||||
<service name="ProcessMakerService">
|
||||
|
||||
@@ -1190,6 +1190,33 @@ function unpauseCase ($params)
|
||||
return $result;
|
||||
}
|
||||
|
||||
function addCaseNote($params)
|
||||
{
|
||||
$result = isValidSession($params->sessionId);
|
||||
|
||||
if ($result->status_code != 0) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
if (ifPermission($params->sessionId, "PM_CASES") == 0) {
|
||||
$result = new wsResponse(2, "You do not have privileges");
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
$ws = new wsBase();
|
||||
$result = $ws->addCaseNote(
|
||||
$params->caseUid,
|
||||
$params->processUid,
|
||||
$params->taskUid,
|
||||
$params->userUid,
|
||||
$params->note,
|
||||
(isset($params->sendMail))? $params->sendMail : 1
|
||||
);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
$server = new SoapServer($wsdl);
|
||||
|
||||
$server->addFunction("Login");
|
||||
@@ -1233,5 +1260,6 @@ $server->addFunction("deleteCase");
|
||||
$server->addFunction("cancelCase");
|
||||
$server->addFunction("pauseCase");
|
||||
$server->addFunction("unpauseCase");
|
||||
$server->addFunction("addCaseNote");
|
||||
$server->handle();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ $request = isset( $_REQUEST['request'] ) ? $_REQUEST['request'] : null;
|
||||
switch ($request) {
|
||||
case 'getLangList':
|
||||
|
||||
$Translations = G::getModel( 'Translation' );
|
||||
$Translations = new Translation();
|
||||
$result = new stdClass();
|
||||
$result->rows = Array ();
|
||||
|
||||
|
||||
@@ -15,8 +15,9 @@ try {
|
||||
break;
|
||||
}
|
||||
|
||||
$oJSON = new Services_JSON();
|
||||
$aData = get_object_vars( $oJSON->decode( $_POST['oData'] ) );
|
||||
//$oJSON = new Services_JSON();
|
||||
$aData = get_object_vars( G::json_decode( $_POST['oData'] ));
|
||||
//$aData = get_object_vars( $oJSON->decode( $_POST['oData'] ) );
|
||||
|
||||
if (isset( $_POST['function'] )) {
|
||||
$sAction = $_POST['function'];
|
||||
|
||||
Reference in New Issue
Block a user