CODE STYLE Formating workflow/engine/methods/cases

Change format files in workflow/engine/methods/cases
This commit is contained in:
norahmollo
2012-10-18 15:08:40 +00:00
parent 23d74542be
commit c1de21c87f
6 changed files with 1848 additions and 2007 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -12,172 +12,146 @@
* *
* 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') {
G::LoadClass( 'case' );
if($actionAjax=='historyGridList_JXP'){ G::LoadClass( "BasePeer" );
G::LoadClass('case'); global $G_PUBLISH;
G::LoadClass("BasePeer" ); $c = Cases::getTransferHistoryCriteria( $_SESSION['APPLICATION'] );
global $G_PUBLISH; $result = new stdClass();
$c = Cases::getTransferHistoryCriteria($_SESSION['APPLICATION']); $aProcesses = Array ();
$result = new stdClass(); $rs = GulliverBasePeer::doSelectRs( $c );
$aProcesses = Array(); $rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$rs->next();
for ($j = 0; $j < $rs->getRecordCount(); $j ++) {
$rs = GulliverBasePeer::doSelectRs ($c); $result = $rs->getRow();
$rs->setFetchmode (ResultSet::FETCHMODE_ASSOC); $result["ID_HISTORY"] = $result["PRO_UID"] . '_' . $result["APP_UID"] . '_' . $result["TAS_UID"];
$rs->next(); $aProcesses[] = $result;
for($j=0;$j< $rs->getRecordCount() ;$j++) { $rs->next();
$result = $rs->getRow();
$result["ID_HISTORY"] = $result["PRO_UID"].'_'.$result["APP_UID"].'_'.$result["TAS_UID"];
$aProcesses[] = $result;
$rs->next();
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath ( $newDir );
$r->data = $aProcesses;
$r->totalCount = 2;
echo G::json_encode($r);
} }
if($actionAjax=='historyGridListChangeLogPanelBody_JXP'){ $newDir = '/tmp/test/directory';
//!dataInput $r = G::verifyPath( $newDir );
$idHistory = $_REQUEST["idHistory"]; $r->data = $aProcesses;
//!dataInput $r->totalCount = 2;
//!dataSytem echo G::json_encode( $r );
$idHistoryArray = explode("*",$idHistory ); }
$_REQUEST["PRO_UID"]= $idHistoryArray[0];
$_REQUEST["APP_UID"]= $idHistoryArray[1]; if ($actionAjax == 'historyGridListChangeLogPanelBody_JXP') {
$_REQUEST["TAS_UID"]= $idHistoryArray[2]; //!dataInput
$_REQUEST["DYN_UID"]= ""; $idHistory = $_REQUEST["idHistory"];
//!dataInput
?> //!dataSytem
$idHistoryArray = explode( "*", $idHistory );
$_REQUEST["PRO_UID"] = $idHistoryArray[0];
$_REQUEST["APP_UID"] = $idHistoryArray[1];
$_REQUEST["TAS_UID"] = $idHistoryArray[2];
$_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 style="width:100%; overflow-y: scroll; overflow-x: hidden; max-height: 310px;_height:310px;height:310px; visibility: inherit;" > <div
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> </div>
</td>
</tr>
<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">
<tr> </td>
<td class="x-btn-tl"> </tr>
<i>&nbsp;</i> <tr>
</td> <td height=30 valign=top>
<td class="x-btn-tc">
</td> <table align=center cellspacing="0" class="x-btn x-btn-noicon"
<td class="x-btn-tr"> id="ext-comp-1043" style="width: 75px; margin-top: 0px;">
<i>&nbsp;</i> <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 class="x-btn-ml"> <td class="x-btn-tr"><i>&nbsp;</i></td>
<i>&nbsp;</i> </tr>
</td> <tr>
<td class="x-btn-mc"> <td class="x-btn-ml"><i>&nbsp;</i></td>
<em unselectable="on" class=""> <td class="x-btn-mc"><em unselectable="on" class="">
<button type="button" id="ext-gen105" class=" x-btn-text"> <button type="button" id="ext-gen105" class=" x-btn-text">OK</button>
OK </em></td>
</button> <td class="x-btn-mr"><i>&nbsp;</i></td>
</em> </tr>
</td> <tr>
<td class="x-btn-mr"> <td class="x-btn-bl"><i>&nbsp;</i></td>
<i>&nbsp;</i> <td class="x-btn-bc"></td>
</td> <td class="x-btn-br"><i>&nbsp;</i></td>
</tr> </tr>
<tr> </tbody>
<td class="x-btn-bl"> </table>
<i>&nbsp;</i> </td>
</td> </tr>
<td class="x-btn-bc">
</td>
<td class="x-btn-br">
<i>&nbsp;</i>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</table> </table>
<?php <?php
}
if($actionAjax=="showDynaformHistoryGetNomDynaform_JXP"){
require_once 'classes/model/ContentPeer.php';
//!dataInput
$idDin = $_REQUEST['idDin'];
$dynDate = $_REQUEST["dynDate"];
//!dataOuput
$md5Hash = "";
$dynTitle = '';
$c = new Criteria();
$c0 = $c->getNewCriterion(ContentPeer::CON_ID,$idDin);
$c1 = $c->getNewCriterion(ContentPeer::CON_CATEGORY,'DYN_TITLE');
$c0->addAnd($c1);
$c->add($c0);
$contentObjeto = ContentPeer::doSelectOne($c);
if(is_object($contentObjeto)){ }
$dynTitle = $contentObjeto->getConValue();
}
$md5Hash = md5($idDin.$dynDate);
//assign task if ($actionAjax == "showDynaformHistoryGetNomDynaform_JXP") {
$result = new stdClass; require_once 'classes/model/ContentPeer.php';
$result->dynTitle = $dynTitle;
$result->md5Hash = $md5Hash; //!dataInput
$idDin = $_REQUEST['idDin'];
echo G::json_encode($result); $dynDate = $_REQUEST["dynDate"];
//!dataOuput
$md5Hash = "";
$dynTitle = '';
$c = new Criteria();
$c0 = $c->getNewCriterion( ContentPeer::CON_ID, $idDin );
$c1 = $c->getNewCriterion( ContentPeer::CON_CATEGORY, 'DYN_TITLE' );
$c0->addAnd( $c1 );
$c->add( $c0 );
$contentObjeto = ContentPeer::doSelectOne( $c );
if (is_object( $contentObjeto )) {
$dynTitle = $contentObjeto->getConValue();
} }
$md5Hash = md5( $idDin . $dynDate );
//assign task
$result = new stdClass();
$result->dynTitle = $dynTitle;
$result->md5Hash = $md5Hash;
echo G::json_encode( $result );
}

View File

@@ -12,65 +12,59 @@
* *
* 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') {
G::LoadClass( 'case' );
G::LoadClass( "BasePeer" );
global $G_PUBLISH;
$oCase = new Cases();
if($actionAjax=='messageHistoryGridList_JXP'){ $appMessageArray = $oCase->getHistoryMessagesTrackerExt( $_SESSION['APPLICATION'] );
G::LoadClass('case'); $result = new stdClass();
G::LoadClass("BasePeer" ); $aProcesses = Array ();
global $G_PUBLISH; $totalCount = 0;
$oCase = new Cases(); foreach ($appMessageArray as $index => $value) {
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'] . '_' . $appMessageArray[$index]['APP_MSG_UID'];
$appMessageArray = $oCase->getHistoryMessagesTrackerExt($_SESSION['APPLICATION']); $aProcesses[] = $appMessageArray[$index];
$totalCount ++;
$result = new stdClass();
$aProcesses = Array();
$totalCount = 0;
foreach( $appMessageArray as $index => $value){
$appMessageArray[$index]['ID_MESSAGE'] = $appMessageArray[$index]['APP_UID'].'_'.$appMessageArray[$index]['APP_MSG_UID'];
$aProcesses[] = $appMessageArray[$index];
$totalCount++;
}
$newDir = '/tmp/test/directory';
$r = G::verifyPath ( $newDir );
$r->data = $aProcesses;
$r->totalCount = $totalCount;
echo G::json_encode($r);
} }
if($actionAjax=='showHistoryMessage'){
?> $newDir = '/tmp/test/directory';
<link rel="stylesheet" type="text/css" href="/css/classic.css" /> $r = G::verifyPath( $newDir );
<style type="text/css"> $r->data = $aProcesses;
html{ $r->totalCount = $totalCount;
color:black !important;
} echo G::json_encode( $r );
body{ }
color:black !important; if ($actionAjax == 'showHistoryMessage') {
}
</style> ?>
<script language="Javascript"> <link rel="stylesheet" type="text/css" href="/css/classic.css" />
<style type="text/css">
html {
color: black !important;
}
body {
color: black !important;
}
</style>
<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 = "";
@@ -86,120 +80,96 @@
</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( $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']
'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( $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'
'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,72 +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' => ""); {
$result = array(); $validParams = array ('callback' => '','dir' => 'DESC','sort' => '','start' => 0,'limit' => 25,'filter' => '','search' => '','action' => '','xaction' => '','data' => '','status' => '','query' => '','fields' => ""
foreach ($validParams as $paramName => $paramDefault) { );
$result[$paramName] = isset($_REQUEST[$paramName]) ? $_REQUEST[$paramName] : isset($_REQUEST[$paramName]) ? $_REQUEST[$paramName] : $paramDefault; $result = array ();
} foreach ($validParams as $paramName => $paramDefault) {
return $result; $result[$paramName] = isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : isset( $_REQUEST[$paramName] ) ? $_REQUEST[$paramName] : $paramDefault;
} }
return $result;
function sendJsonResultGeneric($response, $callback) { }
header("Content-Type: application/json");
$finalResponse = G::json_encode($response); function sendJsonResultGeneric ($response, $callback)
if ($callback != '') { {
print $callback . "($finalResponse);"; header( "Content-Type: application/json" );
} else { $finalResponse = G::json_encode( $response );
print $finalResponse; if ($callback != '') {
} print $callback . "($finalResponse);";
} } else {
print $finalResponse;
function getNotesList() { }
extract(getExtJSParams()); }
require_once ( "classes/model/AppNotes.php" );
if ((isset($_REQUEST['appUid'])) && (trim($_REQUEST['appUid']) != "")) { function getNotesList ()
$appUid = $_REQUEST['appUid']; {
} else { extract( getExtJSParams() );
$appUid = $_SESSION['APPLICATION']; require_once ("classes/model/AppNotes.php");
} if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) {
$usrUid = (isset($_SESSION['USER_LOGGED'])) ? $_SESSION['USER_LOGGED'] : ""; $appUid = $_REQUEST['appUid'];
$appNotes = new AppNotes(); } else {
$response = $appNotes->getNotesList($appUid, '', $start, $limit); $appUid = $_SESSION['APPLICATION'];
sendJsonResultGeneric($response['array'], $callback); }
} $usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : "";
$appNotes = new AppNotes();
function postNote() { $response = $appNotes->getNotesList( $appUid, '', $start, $limit );
extract(getExtJSParams()); sendJsonResultGeneric( $response['array'], $callback );
if ((isset($_REQUEST['appUid'])) && (trim($_REQUEST['appUid']) != "")) { }
$appUid = $_REQUEST['appUid'];
} else { function postNote ()
$appUid = $_SESSION['APPLICATION']; {
} extract( getExtJSParams() );
$usrUid = (isset($_SESSION['USER_LOGGED'])) ? $_SESSION['USER_LOGGED'] : ""; if ((isset( $_REQUEST['appUid'] )) && (trim( $_REQUEST['appUid'] ) != "")) {
require_once ( "classes/model/AppNotes.php" ); $appUid = $_REQUEST['appUid'];
} else {
$noteContent=addslashes($_POST['noteText']); $appUid = $_SESSION['APPLICATION'];
}
$appNotes=new AppNotes(); $usrUid = (isset( $_SESSION['USER_LOGGED'] )) ? $_SESSION['USER_LOGGED'] : "";
$response=$appNotes->postNewNote($appUid, $usrUid, $noteContent); require_once ("classes/model/AppNotes.php");
sendJsonResultGeneric($response, $callback); $noteContent = addslashes( $_POST['noteText'] );
}
$appNotes = new AppNotes();
?> $response = $appNotes->postNewNote( $appUid, $usrUid, $noteContent );
sendJsonResultGeneric( $response, $callback );
}

File diff suppressed because it is too large Load Diff

View File

@@ -12,74 +12,70 @@
* *
* 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' );
$oCases = new Cases();
G::LoadClass('case');
$oCases = new Cases(); if (isset( $_POST['form'] )) {
$fields['CASE_NUMBER'] = $_POST['form']['CASE_NUMBER'];
if (isset($_POST['form'])) $fields['PROCESS'] = $_POST['form']['PROCESS'];
{ $fields['TASKS'] = $_POST['form']['TASKS'];
$fields['CASE_NUMBER'] = $_POST['form']['CASE_NUMBER']; $fields['CURRENT_USER'] = $_POST['form']['CURRENT_USER'];
$fields['PROCESS'] = $_POST['form']['PROCESS']; $fields['SENT_BY'] = $_POST['form']['SENT_BY'];
$fields['TASKS'] = $_POST['form']['TASKS']; $fields['LAST_MODIFICATION_F'] = $_POST['form']['LAST_MODIFICATION_F'];
$fields['CURRENT_USER'] = $_POST['form']['CURRENT_USER']; $fields['LAST_MODIFICATION_T'] = $_POST['form']['LAST_MODIFICATION_T'];
$fields['SENT_BY'] = $_POST['form']['SENT_BY']; $fields['APP_STATUS'] = $_POST['form']['APP_STATUS'];
$fields['LAST_MODIFICATION_F'] = $_POST['form']['LAST_MODIFICATION_F'];
$fields['LAST_MODIFICATION_T'] = $_POST['form']['LAST_MODIFICATION_T']; $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 );
$fields['APP_STATUS'] = $_POST['form']['APP_STATUS']; $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter', '', $fields );
} else {
$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); //list($Criteria,$xmlform) = $oCases->getConditionCasesList('gral');
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_advancedSearchFilter', '', $fields); $Criteria = $oCases->getAdvancedSearch( '', '', '', '', '', '', '', '', $permisse, $userlogged, $aSupervisor );
} $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'cases/cases_advancedSearchFilter' );
else }
{ $G_PUBLISH->AddContent( 'propeltable', 'paged-table', 'cases/cases_advancedSearch', $Criteria );
//list($Criteria,$xmlform) = $oCases->getConditionCasesList('gral');
$Criteria = $oCases->getAdvancedSearch('', '', '', '', '', '', '', '', $permisse, $userlogged, $aSupervisor); G::RenderPage( 'publish', 'blank' );
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'cases/cases_advancedSearchFilter');
}
$G_PUBLISH->AddContent('propeltable', 'paged-table', 'cases/cases_advancedSearch', $Criteria);
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>