Merge pull request #835 from ralpheav/master

Code Style change  workflow/engine/methods/cases/
This commit is contained in:
ferOnti
2012-10-19 08:44:28 -07:00
5 changed files with 1145 additions and 1171 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,157 +1,149 @@
<?php <?php
/** /**
* processes_List.php * processes_List.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc. * Copyright (C) 2004 - 2008 Colosa Inc.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null; $actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
if ($actionAjax == 'historyGridList_JXP') { if ($actionAjax == 'historyGridList_JXP') {
G::LoadClass( 'case' ); G::LoadClass( 'case' );
G::LoadClass( "BasePeer" ); G::LoadClass( "BasePeer" );
global $G_PUBLISH; global $G_PUBLISH;
$c = Cases::getTransferHistoryCriteria( $_SESSION['APPLICATION'] ); $c = Cases::getTransferHistoryCriteria( $_SESSION['APPLICATION'] );
$result = new stdClass(); $result = new stdClass();
$aProcesses = Array (); $aProcesses = Array ();
$rs = GulliverBasePeer::doSelectRs( $c ); $rs = GulliverBasePeer::doSelectRs( $c );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next(); $rs->next();
for ($j = 0; $j < $rs->getRecordCount(); $j ++) { for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
$result = $rs->getRow(); $result = $rs->getRow();
$result["ID_HISTORY"] = $result["PRO_UID"] . '_' . $result["APP_UID"] . '_' . $result["TAS_UID"]; $result["ID_HISTORY"] = $result["PRO_UID"] . '_' . $result["APP_UID"] . '_' . $result["TAS_UID"];
$aProcesses[] = $result; $aProcesses[] = $result;
$rs->next(); $rs->next();
} }
$newDir = '/tmp/test/directory'; $newDir = '/tmp/test/directory';
$r = G::verifyPath( $newDir ); $r = G::verifyPath( $newDir );
$r->data = $aProcesses; $r->data = $aProcesses;
$r->totalCount = 2; $r->totalCount = 2;
echo G::json_encode( $r ); echo G::json_encode( $r );
} }
if ($actionAjax == 'historyGridListChangeLogPanelBody_JXP') { if ($actionAjax == 'historyGridListChangeLogPanelBody_JXP') {
//!dataInput //!dataInput
$idHistory = $_REQUEST["idHistory"]; $idHistory = $_REQUEST["idHistory"];
//!dataInput //!dataInput
//!dataSytem //!dataSytem
$idHistoryArray = explode( "*", $idHistory ); $idHistoryArray = explode( "*", $idHistory );
$_REQUEST["PRO_UID"] = $idHistoryArray[0]; $_REQUEST["PRO_UID"] = $idHistoryArray[0];
$_REQUEST["APP_UID"] = $idHistoryArray[1]; $_REQUEST["APP_UID"] = $idHistoryArray[1];
$_REQUEST["TAS_UID"] = $idHistoryArray[2]; $_REQUEST["TAS_UID"] = $idHistoryArray[2];
$_REQUEST["DYN_UID"] = ""; $_REQUEST["DYN_UID"] = "";
?> ?>
<table bgcolor="white" height=100% width=100%> <table bgcolor="white" height=100% width=100%>
<tr> <tr>
<td height=99%> <td height=99%>
<div <div
style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;"> style="width: 100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px; _height: 310px; height: 310px; visibility: inherit;">
<?php
<?php require_once 'classes/model/AppHistory.php';
require_once 'classes/model/AppHistory.php'; $G_PUBLISH = new Publisher();
$G_PUBLISH = new Publisher(); $G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' );
$G_PUBLISH->AddContent( 'view', 'cases/cases_DynaformHistory' ); G::RenderPage( 'publish', 'raw' );
G::RenderPage( 'publish', 'raw' ); ?>
?> </div>
</td>
</tr>
</div> <tr>
<td height=30 valign=top>
<table align=center cellspacing="0" class="x-btn x-btn-noicon"
id="ext-comp-1043" style="width: 75px; margin-top: 0px;">
<tbody class="x-btn-small x-btn-icon-small-left">
</td> <tr>
</tr> <td class="x-btn-tl"><i>&nbsp;</i></td>
<tr> <td class="x-btn-tc"></td>
<td height=30 valign=top> <td class="x-btn-tr"><i>&nbsp;</i></td>
</tr>
<table align=center cellspacing="0" class="x-btn x-btn-noicon" <tr>
id="ext-comp-1043" style="width: 75px; margin-top: 0px;"> <td class="x-btn-ml"><i>&nbsp;</i></td>
<tbody class="x-btn-small x-btn-icon-small-left"> <td class="x-btn-mc"><em unselectable="on" class="">
<tr> <button type="button" id="ext-gen105" class=" x-btn-text">OK</button>
<td class="x-btn-tl"><i>&nbsp;</i></td> </em></td>
<td class="x-btn-tc"></td> <td class="x-btn-mr"><i>&nbsp;</i></td>
<td class="x-btn-tr"><i>&nbsp;</i></td> </tr>
</tr> <tr>
<tr> <td class="x-btn-bl"><i>&nbsp;</i></td>
<td class="x-btn-ml"><i>&nbsp;</i></td> <td class="x-btn-bc"></td>
<td class="x-btn-mc"><em unselectable="on" class=""> <td class="x-btn-br"><i>&nbsp;</i></td>
<button type="button" id="ext-gen105" class=" x-btn-text">OK</button> </tr>
</em></td> </tbody>
<td class="x-btn-mr"><i>&nbsp;</i></td> </table>
</tr> </td>
<tr> </tr>
<td class="x-btn-bl"><i>&nbsp;</i></td> </table>
<td class="x-btn-bc"></td> <?php
<td class="x-btn-br"><i>&nbsp;</i></td>
</tr> }
</tbody>
</table> if ($actionAjax == "showDynaformHistoryGetNomDynaform_JXP") {
</td> require_once 'classes/model/ContentPeer.php';
</tr>
</table> //!dataInput
<?php $idDin = $_REQUEST['idDin'];
$dynDate = $_REQUEST["dynDate"];
}
//!dataOuput
if ($actionAjax == "showDynaformHistoryGetNomDynaform_JXP") { $md5Hash = "";
require_once 'classes/model/ContentPeer.php'; $dynTitle = '';
//!dataInput $c = new Criteria();
$idDin = $_REQUEST['idDin']; $c0 = $c->getNewCriterion( ContentPeer::CON_ID, $idDin );
$dynDate = $_REQUEST["dynDate"]; $c1 = $c->getNewCriterion( ContentPeer::CON_CATEGORY, 'DYN_TITLE' );
$c0->addAnd( $c1 );
//!dataOuput $c->add( $c0 );
$md5Hash = ""; $contentObjeto = ContentPeer::doSelectOne( $c );
$dynTitle = '';
if (is_object( $contentObjeto )) {
$c = new Criteria(); $dynTitle = $contentObjeto->getConValue();
$c0 = $c->getNewCriterion( ContentPeer::CON_ID, $idDin ); }
$c1 = $c->getNewCriterion( ContentPeer::CON_CATEGORY, 'DYN_TITLE' );
$c0->addAnd( $c1 ); $md5Hash = md5( $idDin . $dynDate );
$c->add( $c0 );
$contentObjeto = ContentPeer::doSelectOne( $c ); //assign task
$result = new stdClass();
if (is_object( $contentObjeto )) { $result->dynTitle = $dynTitle;
$dynTitle = $contentObjeto->getConValue(); $result->md5Hash = $md5Hash;
}
echo G::json_encode( $result );
$md5Hash = md5( $idDin . $dynDate );
}
//assign task
$result = new stdClass();
$result->dynTitle = $dynTitle;
$result->md5Hash = $md5Hash;
echo G::json_encode( $result );
}

View File

@@ -1,175 +1,175 @@
<?php <?php
/** /**
* processes_List.php * processes_List.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc. * Copyright (C) 2004 - 2008 Colosa Inc.
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/ */
$actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null; $actionAjax = isset( $_REQUEST['actionAjax'] ) ? $_REQUEST['actionAjax'] : null;
if ($actionAjax == 'messageHistoryGridList_JXP') { if ($actionAjax == 'messageHistoryGridList_JXP') {
G::LoadClass( 'case' ); G::LoadClass( 'case' );
G::LoadClass( "BasePeer" ); G::LoadClass( "BasePeer" );
global $G_PUBLISH; global $G_PUBLISH;
$oCase = new Cases(); $oCase = new Cases();
$appMessageArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION'] ); $appMessageArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION'] );
$result = new stdClass(); $result = new stdClass();
$aProcesses = Array (); $aProcesses = Array ();
$totalCount = 0; $totalCount = 0;
foreach ($appMessageArray as $index => $value) { foreach ($appMessageArray as $index => $value) {
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID']; $appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
$aProcesses[] = $appMessageArray[$index]; $aProcesses[] = $appMessageArray[$index];
$totalCount ++; $totalCount ++;
} }
$newDir = '/tmp/test/directory'; $newDir = '/tmp/test/directory';
$r = G::verifyPath( $newDir ); $r = G::verifyPath( $newDir );
$r->data = $aProcesses; $r->data = $aProcesses;
$r->totalCount = $totalCount; $r->totalCount = $totalCount;
echo G::json_encode( $r ); echo G::json_encode( $r );
} }
if ($actionAjax == 'showHistoryMessage') { if ($actionAjax == 'showHistoryMessage') {
?> ?>
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css"> <style type="text/css">
html { html {
color: black !important; color: black !important;
} }
body { body {
color: black !important; color: black !important;
} }
</style> </style>
<script language="Javascript"> <script language="Javascript">
//!Code that simulated reload library javascript maborak //!Code that simulated reload library javascript maborak
var leimnud = {}; var leimnud = {};
leimnud.exec = ""; leimnud.exec = "";
leimnud.fix = {}; leimnud.fix = {};
leimnud.fix.memoryLeak = ""; leimnud.fix.memoryLeak = "";
leimnud.browser = {}; leimnud.browser = {};
leimnud.browser.isIphone = ""; leimnud.browser.isIphone = "";
leimnud.iphone = {}; leimnud.iphone = {};
leimnud.iphone.make = function(){}; leimnud.iphone.make = function(){};
function ajax_function(ajax_server, funcion, parameters, method){ function ajax_function(ajax_server, funcion, parameters, method){
} }
//! //!
</script> </script>
<?php <?php
G::LoadClass( 'case' ); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
$_POST["APP_UID"] = $_REQUEST["APP_UID"]; $_POST["APP_UID"] = $_REQUEST["APP_UID"];
$_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"]; $_POST['APP_MSG_UID'] = $_REQUEST["APP_MSG_UID"];
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
$oCase = new Cases(); $oCase = new Cases();
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_MessagesView', '', $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ) );
?> ?>
<script language="javascript"> <script language="javascript">
<?php <?php
global $G_FORM; global $G_FORM;
?> ?>
function loadForm_<?php echo $G_FORM->id;?>(parametro1){ function loadForm_<?php echo $G_FORM->id;?>(parametro1){
} }
</script> </script>
<?php <?php
G::RenderPage( 'publish', 'raw' ); G::RenderPage( 'publish', 'raw' );
} }
if ($actionAjax == 'sendMailMessage_JXP') { if ($actionAjax == 'sendMailMessage_JXP') {
//!dataSystem //!dataSystem
$errorMessage = ""; $errorMessage = "";
try { try {
//!dataInput //!dataInput
$_POST['APP_UID'] = $_REQUEST['APP_UID']; $_POST['APP_UID'] = $_REQUEST['APP_UID'];
$_POST['APP_MSG_UID'] = $_REQUEST['APP_MSG_UID']; $_POST['APP_MSG_UID'] = $_REQUEST['APP_MSG_UID'];
G::LoadClass( 'case' ); G::LoadClass( 'case' );
$oCase = new Cases(); $oCase = new Cases();
require_once 'classes/model/Configuration.php'; require_once 'classes/model/Configuration.php';
G::LoadClass( 'spool' ); G::LoadClass( 'spool' );
$oCase = new Cases(); $oCase = new Cases();
$data = $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] ); $data = $oCase->getHistoryMessagesTrackerView( $_POST['APP_UID'], $_POST['APP_MSG_UID'] );
//print_r($data); //print_r($data);
$oConfiguration = new Configuration(); $oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter(); $sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria( 'workflow' ); $oCriteria = new Criteria( 'workflow' );
$oCriteria->add( ConfigurationPeer::CFG_UID, 'Emails' ); $oCriteria->add( ConfigurationPeer::CFG_UID, 'Emails' );
$oCriteria->add( ConfigurationPeer::OBJ_UID, '' ); $oCriteria->add( ConfigurationPeer::OBJ_UID, '' );
$oCriteria->add( ConfigurationPeer::PRO_UID, '' ); $oCriteria->add( ConfigurationPeer::PRO_UID, '' );
$oCriteria->add( ConfigurationPeer::USR_UID, '' ); $oCriteria->add( ConfigurationPeer::USR_UID, '' );
$oCriteria->add( ConfigurationPeer::APP_UID, '' ); $oCriteria->add( ConfigurationPeer::APP_UID, '' );
if (ConfigurationPeer::doCount( $oCriteria ) == 0) { if (ConfigurationPeer::doCount( $oCriteria ) == 0) {
$oConfiguration->create( array ('CFG_UID' => 'Emails','OBJ_UID' => '','CFG_VALUE' => '','PRO_UID' => '','USR_UID' => '','APP_UID' => '' $oConfiguration->create( array ('CFG_UID' => 'Emails','OBJ_UID' => '','CFG_VALUE' => '','PRO_UID' => '','USR_UID' => '','APP_UID' => ''
) ); ) );
$aConfiguration = array (); $aConfiguration = array ();
} else { } else {
$aConfiguration = $oConfiguration->load( 'Emails', '', '', '', '' ); $aConfiguration = $oConfiguration->load( 'Emails', '', '', '', '' );
if ($aConfiguration['CFG_VALUE'] != '') { if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize( $aConfiguration['CFG_VALUE'] ); $aConfiguration = unserialize( $aConfiguration['CFG_VALUE'] );
} else { } else {
$aConfiguration = array (); $aConfiguration = array ();
} }
} }
$passwd = $aConfiguration['MESS_PASSWORD']; $passwd = $aConfiguration['MESS_PASSWORD'];
$passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' ); $passwdDec = G::decrypt( $passwd, 'EMAILENCRYPT' );
$auxPass = explode( 'hash:', $passwdDec ); $auxPass = explode( 'hash:', $passwdDec );
if (count( $auxPass ) > 1) { if (count( $auxPass ) > 1) {
if (count( $auxPass ) == 2) { if (count( $auxPass ) == 2) {
$passwd = $auxPass[1]; $passwd = $auxPass[1];
} else { } else {
array_shift( $auxPass ); array_shift( $auxPass );
$passwd = implode( '', $auxPass ); $passwd = implode( '', $auxPass );
} }
} }
$aConfiguration['MESS_PASSWORD'] = $passwd; $aConfiguration['MESS_PASSWORD'] = $passwd;
$oSpool = new spoolRun(); $oSpool = new spoolRun();
$oSpool->setConfig( array ('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],'MESS_SERVER' => $aConfiguration['MESS_SERVER'],'MESS_PORT' => $aConfiguration['MESS_PORT'],'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],'MESS_PASSWORD' => $passwd,'SMTPAuth' => $aConfiguration['MESS_RAUTH'] $oSpool->setConfig( array ('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'],'MESS_SERVER' => $aConfiguration['MESS_SERVER'],'MESS_PORT' => $aConfiguration['MESS_PORT'],'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'],'MESS_PASSWORD' => $passwd,'SMTPAuth' => $aConfiguration['MESS_RAUTH']
) ); ) );
$oSpool->create( array ('msg_uid' => $data['MSG_UID'],'app_uid' => $data['APP_UID'],'del_index' => $data['DEL_INDEX'],'app_msg_type' => $data['APP_MSG_TYPE'],'app_msg_subject' => $data['APP_MSG_SUBJECT'],'app_msg_from' => $data['APP_MSG_FROM'],'app_msg_to' => $data['APP_MSG_TO'],'app_msg_body' => $data['APP_MSG_BODY'],'app_msg_cc' => $data['APP_MSG_CC'],'app_msg_bcc' => $data['APP_MSG_BCC'],'app_msg_attach' => $data['APP_MSG_ATTACH'],'app_msg_template' => $data['APP_MSG_TEMPLATE'],'app_msg_status' => 'pending' $oSpool->create( array ('msg_uid' => $data['MSG_UID'],'app_uid' => $data['APP_UID'],'del_index' => $data['DEL_INDEX'],'app_msg_type' => $data['APP_MSG_TYPE'],'app_msg_subject' => $data['APP_MSG_SUBJECT'],'app_msg_from' => $data['APP_MSG_FROM'],'app_msg_to' => $data['APP_MSG_TO'],'app_msg_body' => $data['APP_MSG_BODY'],'app_msg_cc' => $data['APP_MSG_CC'],'app_msg_bcc' => $data['APP_MSG_BCC'],'app_msg_attach' => $data['APP_MSG_ATTACH'],'app_msg_template' => $data['APP_MSG_TEMPLATE'],'app_msg_status' => 'pending'
) ); ) );
$oSpool->sendMail(); $oSpool->sendMail();
} catch (Exception $e) { } catch (Exception $e) {
$errorMessage = $e->getMessage(); $errorMessage = $e->getMessage();
} }
echo $errorMessage; echo $errorMessage;
} }

View File

@@ -1,76 +1,76 @@
<?php <?php
if (! isset( $_REQUEST['action'] )) { if (! isset( $_REQUEST['action'] )) {
$res['success'] = 'failure'; $res['success'] = 'failure';
$res['message'] = 'You may request an action'; $res['message'] = 'You may request an action';
print G::json_encode( $res ); print G::json_encode( $res );
die(); die();
} }
if (! function_exists( $_REQUEST['action'] )) { if (! function_exists( $_REQUEST['action'] )) {
$res['success'] = 'failure'; $res['success'] = 'failure';
$res['message'] = 'The requested action does not exist'; $res['message'] = 'The requested action does not exist';
header( "Content-Type: application/json" ); header( "Content-Type: application/json" );
print G::json_encode( $res ); print G::json_encode( $res );
die(); die();
} }
$functionName = $_REQUEST['action']; $functionName = $_REQUEST['action'];
$functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array (); $functionParams = isset( $_REQUEST['params'] ) ? $_REQUEST['params'] : array ();
$functionName( $functionParams ); $functionName( $functionParams );
function getExtJSParams () function getExtJSParams ()
{ {
$validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => "" $validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => "");
); $result = array ();
$result = array (); foreach ($validParams as $paramName => $paramDefault) {
foreach ($validParams as $paramName => $paramDefault) { $result[$paramName] = isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : $paramDefault;
$result[$paramName] = isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : $paramDefault; }
} return $result;
return $result; }
}
function sendJsonResultGeneric ($response, $callback)
function sendJsonResultGeneric ($response, $callback) {
{ header( "Content-Type: application/json" );
header( "Content-Type: application/json" ); $finalResponse = G::json_encode( $response );
$finalResponse = G::json_encode( $response ); if ($callback != '') {
if ($callback != '') { print $callback . "($finalResponse);";
print $callback . "($finalResponse);"; } else {
} else { print $finalResponse;
print $finalResponse; }
} }
}
function getNotesList ()
function getNotesList () {
{ extract( getExtJSParams() );
extract( getExtJSParams() ); require_once ("classes/model/AppNotes.php");
require_once ("classes/model/AppNotes.php"); if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) {
if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) { $appUid = $_REQUEST['appUid'];
$appUid = $_REQUEST['appUid']; } else {
} else { $appUid = $_SESSION['APPLICATION'];
$appUid = $_SESSION['APPLICATION']; }
} $usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : "";
$usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : ""; $appNotes = new AppNotes();
$appNotes = new AppNotes(); $response = $appNotes->getNotesList( $appUid, '', $start, $limit );
$response = $appNotes->getNotesList( $appUid, '', $start, $limit );
sendJsonResultGeneric( $response['array'], $callback ); sendJsonResultGeneric( $response['array'], $callback );
} }
function postNote () function postNote ()
{ {
extract( getExtJSParams() ); extract( getExtJSParams() );
if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) { if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) {
$appUid = $_REQUEST['appUid']; $appUid = $_REQUEST['appUid'];
} else { } else {
$appUid = $_SESSION['APPLICATION']; $appUid = $_SESSION['APPLICATION'];
} }
$usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : ""; $usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : "";
require_once ("classes/model/AppNotes.php"); require_once ("classes/model/AppNotes.php");
$noteContent = addslashes( $_POST['noteText'] ); $noteContent = addslashes( $_POST['noteText'] );
$appNotes = new AppNotes(); $appNotes = new AppNotes();
$response = $appNotes->postNewNote( $appUid, $usrUid, $noteContent ); $response = $appNotes->postNewNote( $appUid, $usrUid, $noteContent );
sendJsonResultGeneric( $response, $callback ); sendJsonResultGeneric( $response, $callback );
} }

View File

@@ -1,81 +1,82 @@
<?php <?php
/** /**
* cases_advancedSearch.php * cases_advancedSearch.php
* *
* ProcessMaker Open Source Edition * ProcessMaker Open Source Edition
* Copyright (C) 2004 - 2008 Colosa Inc.23 * Copyright (C) 2004 - 2008 Colosa Inc.23
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as * it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the * published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details. * GNU Affero General Public License for more details.
* *
* You should have received a copy of the GNU Affero General Public License * You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* *
* For more information, contact Colosa Inc, 2566 Le Jeune Rd., * For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com. * Coral Gables, FL, 33134, USA, or email info@colosa.com.
* by The Answer * by The Answer
*/ */
$G_MAIN_MENU = 'processmaker'; $G_MAIN_MENU = 'processmaker';
$G_SUB_MENU = 'cases'; $G_SUB_MENU = 'cases';
$G_ID_MENU_SELECTED = 'CASES'; $G_ID_MENU_SELECTED = 'CASES';
$G_ID_SUB_MENU_SELECTED = 'CASES_ADVANCEDSEARCH'; $G_ID_SUB_MENU_SELECTED = 'CASES_ADVANCEDSEARCH';
$G_PUBLISH = new Publisher(); $G_PUBLISH = new Publisher();
global $RBAC; global $RBAC;
$permisse = $RBAC->userCanAccess( 'PM_ALLCASES' ); $permisse = $RBAC->userCanAccess( 'PM_ALLCASES' );
$userlogged = $_SESSION['USER_LOGGED']; $userlogged = $_SESSION['USER_LOGGED'];
require_once ("classes/model/ProcessUser.php"); require_once ("classes/model/ProcessUser.php");
$oCriteria = new Criteria( 'workflow' ); $oCriteria = new Criteria( 'workflow' );
$oCriteria->addSelectColumn( ProcessUserPeer::PU_UID ); $oCriteria->addSelectColumn( ProcessUserPeer::PU_UID );
$oCriteria->addSelectColumn( ProcessUserPeer::PRO_UID ); $oCriteria->addSelectColumn( ProcessUserPeer::PRO_UID );
$oCriteria->add( ProcessUserPeer::USR_UID, $userlogged ); $oCriteria->add( ProcessUserPeer::USR_UID, $userlogged );
$oCriteria->add( ProcessUserPeer::PU_TYPE, "SUPERVISOR" ); $oCriteria->add( ProcessUserPeer::PU_TYPE, "SUPERVISOR" );
$oDataset = ProcessUserPeer::doSelectRS( $oCriteria ); $oDataset = ProcessUserPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$oDataset->next(); $oDataset->next();
$aSupervisor = array (); $aSupervisor = array ();
while ($aRow = $oDataset->getRow()) { while ($aRow = $oDataset->getRow()) {
$aSupervisor[] = $aRow['PRO_UID']; $aSupervisor[] = $aRow['PRO_UID'];
$oDataset->next(); $oDataset->next();
} }
G::LoadClass( 'case' ); G::LoadClass( 'case' );
$oCases = new Cases(); $oCases = new Cases();
if (isset( $_POST['form'] )) { if (isset( $_POST['form'] )) {
$fields['CASE_NUMBER'] = $_POST['form']['CASE_NUMBER']; $fields['CASE_NUMBER'] = $_POST['form']['CASE_NUMBER'];
$fields['PROCESS'] = $_POST['form']['PROCESS']; $fields['PROCESS'] = $_POST['form']['PROCESS'];
$fields['TASKS'] = $_POST['form']['TASKS']; $fields['TASKS'] = $_POST['form']['TASKS'];
$fields['CURRENT_USER'] = $_POST['form']['CURRENT_USER']; $fields['CURRENT_USER'] = $_POST['form']['CURRENT_USER'];
$fields['SENT_BY'] = $_POST['form']['SENT_BY']; $fields['SENT_BY'] = $_POST['form']['SENT_BY'];
$fields['LAST_MODIFICATION_F'] = $_POST['form']['LAST_MODIFICATION_F']; $fields['LAST_MODIFICATION_F'] = $_POST['form']['LAST_MODIFICATION_F'];
$fields['LAST_MODIFICATION_T'] = $_POST['form']['LAST_MODIFICATION_T']; $fields['LAST_MODIFICATION_T'] = $_POST['form']['LAST_MODIFICATION_T'];
$fields['APP_STATUS'] = $_POST['form']['APP_STATUS']; $fields['APP_STATUS'] = $_POST['form']['APP_STATUS'];
$Criteria = $oCases->getAdvancedSearch( $fields['CASE_NUMBER'], $fields['PROCESS'], $fields['TASKS'], $fields['CURRENT_USER'], $fields['SENT_BY'], $fields['LAST_MODIFICATION_F'], $fields['LAST_MODIFICATION_T'], $fields['APP_STATUS'], $permisse, $userlogged, $aSupervisor ); $Criteria = $oCases->getAdvancedSearch( $fields['CASE_NUMBER'], $fields['PROCESS'], $fields['TASKS'], $fields['CURRENT_USER'], $fields['SENT_BY'], $fields['LAST_MODIFICATION_F'], $fields['LAST_MODIFICATION_T'], $fields['APP_STATUS'], $permisse, $userlogged, $aSupervisor );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter', '', $fields ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter', '', $fields );
} else { } else {
//list($Criteria,$xmlform) = $oCases->getConditionCasesList('gral'); //list($Criteria,$xmlform) = $oCases->getConditionCasesList('gral');
$Criteria = $oCases->getAdvancedSearch( '', '', '', '', '', '', '', '', $permisse, $userlogged, $aSupervisor ); $Criteria = $oCases->getAdvancedSearch( '', '', '', '', '', '', '', '', $permisse, $userlogged, $aSupervisor );
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter' ); $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter' );
} }
$G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_advancedSearch', $Criteria ); $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_advancedSearch', $Criteria );
G::RenderPage( 'publish', 'blank' ); G::RenderPage( 'publish', 'blank' );
?> ?>
<script> <script>
parent.outerLayout.hide('east'); parent.outerLayout.hide('east');
parent.PANEL_EAST_OPEN = false; parent.PANEL_EAST_OPEN = false;
</script> </script>
<?php