Merge branch 'master' of github.com:ralpheav/processmaker

This commit is contained in:
ralpheav
2013-06-05 12:25:40 -04:00
26 changed files with 1397 additions and 569 deletions

View File

@@ -142,6 +142,7 @@ class dynaFormHandler
//attributes (String node-name, Array attributes(atribute-name =>attribute-value, ..., ...), Array childs(child-name=>child-content), Array Child-childs())
public function add($name, $attributes, $childs, $childs_childs = null)
{
$newnode = $this->root->appendChild($this->dom->createElement($name));
if (isset($attributes['#cdata'])) {
$newnode->appendChild($this->dom->createTextNode("\n"));
@@ -155,7 +156,11 @@ class dynaFormHandler
if (is_array($childs)) {
foreach ($childs as $child_name => $child_text) {
$newnode_child = $newnode->appendChild($this->dom->createElement($child_name));
if (strip_tags($child_text) !== $child_text) {
$newnode_child->appendChild($this->dom->createCDATASection($child_text));
} else {
$newnode_child->appendChild($this->dom->createTextNode($child_text));
}
if ($childs_childs != null and is_array($childs_childs)) {
foreach ($childs_childs as $cc) {
$ccmode = $newnode_child->appendChild($this->dom->createElement($cc['name']));

View File

@@ -3776,7 +3776,6 @@ class Cases
$oAppDelay = new AppDelay();
$oAppDelay->create($aData);
$aFields['APP_STATUS'] = 'PAUSED';
$oApplication->update($aFields);
//update searchindex

View File

@@ -1039,7 +1039,7 @@ class AppCacheView extends BaseAppCacheView
$criteria->getNewCriterion(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN"))
)->addOr(
//Paused
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, "PAUSED")->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::APP_STATUS, array("DRAFT", "TO_DO"), Criteria::IN)->addAnd(
$criteria->getNewCriterion(AppCacheViewPeer::APP_UID, AppCacheViewPeer::APP_UID . " IN ($sqlAppDelay)", Criteria::CUSTOM))
)->addOr(
//Cancelled - getCancelled()

View File

@@ -105,8 +105,8 @@ class AppNotes extends BaseAppNotes
$response['success'] = G::LoadTranslation("ID_FAILURE");
$response['message'] = $msg;
} else {
$response['success'] = G::LoadTranslation("ID_SUCCESS");
$response['message'] = G::LoadTranslation("ID_SAVED2");
$response['success'] = "success";
$response['message'] = G::LoadTranslation("ID_SAVED");
}
if ($notify) {

View File

@@ -1,5 +1,11 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
/**
* App controller
*
@@ -21,6 +27,13 @@ class AppProxy extends HttpProxyController
*/
function getNotesList ($httpData)
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
$appUid = null;
if (isset( $httpData->appUid ) && trim( $httpData->appUid ) != "") {
@@ -116,6 +129,13 @@ class AppProxy extends HttpProxyController
//Send the response to client
@ini_set("implicit_flush", 1);
ob_start();
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
echo G::json_encode($response);
@ob_flush();
@flush();

View File

@@ -33,7 +33,19 @@
//require_once 'classes/model/AppDelay.php';
//require_once 'classes/model/Process.php';
//require_once 'classes/model/Task.php';
if(isset($_REQUEST['action']) && $_REQUEST['action'] == "verifySession" ) {
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
} else {
$response = new stdclass();
print G::json_encode( $response );
die();
}
}
class Ajax
{
@@ -73,6 +85,13 @@ class Ajax
public function steps()
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
G::LoadClass('applications');
$applications = new Applications();
@@ -296,6 +315,13 @@ class Ajax
public function getProcessInformation()
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
$process = new Process();
$processData = $process->load($_SESSION['PROCESS']);
require_once 'classes/model/Users.php';
@@ -314,6 +340,13 @@ class Ajax
public function getTaskInformation()
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
$task = new Task();
if ($_SESSION['TASK'] == '-1') {
$_SESSION['TASK'] = $_SESSION['CURRENT_TASK'];
@@ -364,6 +397,13 @@ class Ajax
public function uploadedDocuments()
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
global $G_PUBLISH;
G::loadClass('configuration');
@@ -457,6 +497,13 @@ class Ajax
public function getUsersToReassign()
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
$case = new Cases();
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED']);
@@ -594,6 +641,13 @@ class Ajax
public function changeLogTab()
{
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
try {
global $G_PUBLISH;
require_once 'classes/model/AppHistory.php';

View File

@@ -1,4 +1,11 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
/**
* casesList_Ajax.php
*

View File

@@ -1,4 +1,12 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
$res = new stdclass();
$res->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$res->lostSession = true;
$res->success = true;
print G::json_encode( $res );
die();
}
if (! isset( $_REQUEST['action'] )) {
$res['success'] = 'failure';
$res['message'] = G::LoadTranslation( 'ID_REQUEST_ACTION' );

View File

@@ -1,4 +1,11 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
/**
* cases_Ajax.php
*

View File

@@ -21,7 +21,12 @@
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
parent.location = "../cases/casesListExtJs?action=selfservice";
</script>');
}
/* Permissions */
switch ($RBAC->userCanAccess( 'PM_CASES' )) {
case - 2:

View File

@@ -22,8 +22,12 @@
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*/
//validate the data post
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
parent.location = "../cases/casesStartPage?action=startCase";
</script>');
}
try {
if ($_GET['APP_UID'] !== $_SESSION['APPLICATION']) {
throw new Exception( G::LoadTranslation( 'ID_INVALID_APPLICATION_ID_MSG', array ('<a href=\'' . $_SERVER['HTTP_REFERER'] . '\'>{1}</a>',G::LoadTranslation( 'ID_REOPEN' ) ) ) );

View File

@@ -28,7 +28,19 @@
*/
require_once ("classes/model/AppDocumentPeer.php");
if(isset($_REQUEST['actionAjax']) && $_REQUEST['actionAjax'] == "verifySession" ) {
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
} else {
$response = new stdclass();
print G::json_encode( $response );
die();
}
}
//v = Version
//a = Case UID

View File

@@ -1,4 +1,11 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
/**
* cases_ShowOutputDocument.php
*

View File

@@ -1,4 +1,10 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
G::SendTemporalMessage( 'ID_LOGIN_AGAIN', 'warning', 'labels' );
die( '<script type="text/javascript">
parent.location = "../cases/casesStartPage?action=startCase";
</script>');
}
/**
* cases_Step.php
*

View File

@@ -1,8 +1,11 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
$result = new stdclass();
$result->error = G::LoadTranslation('ID_LOGIN_AGAIN');
die(G::json_encode($result));
$responseObject = new stdclass();
$responseObject->error = G::LoadTranslation('ID_LOGIN_AGAIN');
$responseObject->success = true;
$responseObject->lostSession = true;
print G::json_encode( $responseObject );
die();
}
//Getting the extJs parameters

View File

@@ -1,4 +1,11 @@
<?php
if (!isset($_SESSION['USER_LOGGED'])) {
$response = new stdclass();
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
$response->lostSession = true;
print G::json_encode( $response );
die();
}
$callback = isset( $_POST['callback'] ) ? $_POST['callback'] : 'stcCallback1001';
$dir = isset( $_POST['dir'] ) ? $_POST['dir'] : 'DESC';
$sort = isset( $_POST['sort'] ) ? $_POST['sort'] : '';

View File

@@ -162,6 +162,14 @@ switch ($REQUEST) {
foreach ($aUserIuds as $key => $val) {
$sData['USR_UID'] = $val;
$sData['ROL_UID'] = $ROL_UID;
if ($sData['USR_UID'] == '00000000000000000000000000000001') {
if ($sData['ROL_UID'] != 'PROCESSMAKER_ADMIN') {
$response = new stdclass();
$response->userRole = true;
echo G::json_encode($response);
break;
}
}
$RBAC->assignUserToRole( $sData );
}

View File

@@ -42,7 +42,7 @@ function openCaseNotesWindow(appUid1, modalSw, appTitle, proUid, taskUid)
limit:startRecord+loadSize
},
listeners:{
load:function(){
load:function(response){
Ext.MessageBox.hide();
if ( typeof(storeNotes.reader.jsonData.noPerms != 'undefined') &&
(storeNotes.reader.jsonData.noPerms == '1') ) {
@@ -68,6 +68,21 @@ function openCaseNotesWindow(appUid1, modalSw, appTitle, proUid, taskUid)
caseNotesWindow.show();
newNoteAreaActive = false;
newNoteHandler();
},
exception: function(dp, type, action, options, response, arg) {
responseObject = Ext.util.JSON.decode(response.responseText);
if (responseObject.lostSession) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: responseObject.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
}
}
}
});
@@ -350,8 +365,17 @@ function sendNote()
Ext.getCmp('addCancelBtn').setDisabled(false);
statusBarMessage( _('ID_CASES_NOTE_POST_SUCCESS'), false,true);
storeNotes.load();
} else if (data.lostSession) {
Ext.Msg.show({
title : _('ID_CASES_NOTE_POST_ERROR'),
msg : data.message,
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
fn : function(btn) {
location = location;
}
else {
});
} else {
Ext.getCmp('caseNoteText').setDisabled(false);
Ext.getCmp('sendBtn').setDisabled(false);
Ext.getCmp('addCancelBtn').setDisabled(false);
@@ -476,8 +500,17 @@ var openSummaryWindow = function(appUid, delIndex, action)
summaryWindow.add(summaryTabs);
summaryWindow.doLayout();
summaryWindow.show();
} else if (response.lostSession) {
Ext.Msg.show({
title : "ERROR",
msg : response.message,
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
fn : function(btn) {
location = location;
}
else {
});
} else {
PMExt.warning(_('ID_WARNING'), response.message);
}
summaryWindowOpened = false;

View File

@@ -453,6 +453,23 @@ function openActionDialog(caller, action, dataAux)
var urlDownload = ext_itemgrid.getSelectionModel().getSelected().get("downloadLink");
if (selectedRows.length == 1) {
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
if (ext_itemgrid.getSelectionModel().getSelected().get("appDocType") == "Output" && ext_itemgrid.getSelectionModel().getSelected().get("outDocGenerate") != "") {
dataAux = (dataAux != "")? dataAux : "pdf";
@@ -481,6 +498,14 @@ function openActionDialog(caller, action, dataAux)
streamFilefromPM(urlDownload);
}
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
/*
* if(document.location =

View File

@@ -349,6 +349,23 @@
var rowSelected = processesGrid.getSelectionModel().getSelected();
if( rowSelected ){
Ext.Ajax.request({
url : 'cases_ShowDocument' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
//generateDocumentGridGlobal construct
generateDocumentGridDownloadGlobal.APP_DOC_UID = rowSelected.data.APP_DOC_UID;
generateDocumentGridDownloadGlobal.FILEDOC = rowSelected.data.FILEDOC;
@@ -362,6 +379,14 @@
generateDocumentGridDownload();
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
else{
Ext.Msg.show({
title:'',
@@ -390,6 +415,23 @@
var rowSelected = processesGrid.getSelectionModel().getSelected();
if( rowSelected ){
Ext.Ajax.request({
url : 'cases_ShowDocument' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
//generateDocumentGridGlobal construct
generateDocumentGridDownloadGlobal.APP_DOC_UID = rowSelected.data.APP_DOC_UID;
generateDocumentGridDownloadGlobal.FILEDOC = rowSelected.data.FILEDOC;
@@ -403,6 +445,14 @@
generateDocumentGridDownload();
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
else{
Ext.Msg.show({
title:'',

View File

@@ -145,6 +145,23 @@ function jumpToCase(appNumber){
function deleteCase() {
var rows = grid.getSelectionModel().getSelections();
Ext.Ajax.request({
url : 'casesList_Ajax' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
if( rows.length > 0 ) {
ids = Array();
for(i=0; i<rows.length; i++)
@@ -192,6 +209,14 @@ function deleteCase() {
});
}
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
function pauseCase(date){
rowModel = grid.getSelectionModel().getSelected();
@@ -1280,10 +1305,34 @@ Ext.onReady ( function() {
menu: new Ext.menu.DateMenu({
//vtype: 'daterange',
handler: function(dp, date){
Ext.Ajax.request({
url : 'casesList_Ajax' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
pauseCase(date);
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
})
});
var optionMenuSummary = new Ext.Action({
@@ -1351,7 +1400,23 @@ Ext.onReady ( function() {
text: _('ID_REASSIGN'),
iconCls: 'ICON_CASES_TO_REASSIGN',
handler: function() {
Ext.Ajax.request({
url : 'casesList_Ajax' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
var casesGrid_ = Ext.getCmp('casesGrid');
var rowSelected = casesGrid_.getSelectionModel().getSelected();
var rowAllJsonArray = casesGrid_.store.reader.jsonData.data;
@@ -1446,6 +1511,14 @@ Ext.onReady ( function() {
winReassignInCasesList.show();
}
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
});
optionMenuDelete = new Ext.Action({
text: _('ID_DELETE'),
@@ -2129,6 +2202,23 @@ function reassign(){
storeReassignCases.rejectChanges();
var tasks = [];
var sw = 0;
Ext.Ajax.request({
url : 'proxyReassignCasesList' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
if( rows.length > 0 ) {
ids = '';
for(i=0; i<rows.length; i++) {
@@ -2164,6 +2254,14 @@ function reassign(){
});
}
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
function inArray(arr, obj) {
for(var i=0; i<arr.length; i++) {

View File

@@ -63,21 +63,96 @@ Ext.onReady(function() {
text : 'X',
ctCls : 'pm_search_x_button',
handler : function() {
Ext.Ajax.request({
url : 'casesStartPage_Ajax' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Ext.getCmp('processesFilter').setValue('');
startCaseFilter.clear();
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
}, ' ', ' ', {
iconCls : 'icon-expand-all',
tooltip : _('ID_EXPAND_ALL'),
handler : function() {
Ext.Ajax.request({
url : 'casesStartPage_Ajax' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Ext.getCmp("startCaseTreePanel").root.expand(true);
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
},
scope : this
}, '-', {
iconCls : 'icon-collapse-all',
tooltip : _('ID_COLLAPSE_ALL'),
handler : function() {
Ext.Ajax.request({
url : 'casesStartPage_Ajax' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Ext.getCmp("startCaseTreePanel").root.collapse(true);
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
},
scope : this
}, ' ', ' ', {
@@ -86,9 +161,34 @@ Ext.onReady(function() {
icon : '/images/refresh.gif',
handler : function() {
Ext.Ajax.request({
url : 'casesStartPage_Ajax' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
tree = Ext.getCmp('startCaseTreePanel');
tree.getLoader().load(tree.root);
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
}
],
listeners : {
@@ -96,7 +196,32 @@ Ext.onReady(function() {
openCaseA(n);
},
click : function(n) {
Ext.Ajax.request({
url : 'casesStartPage_Ajax' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
showDetailsA(n);
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
},
load: function(node){
if (node.childNodes.length == 0)
@@ -289,8 +414,17 @@ function openCaseA(n){
var res = Ext.util.JSON.decode(response.responseText);
if (res.openCase) {
window.location = res.openCase.PAGE;
}else if (res.lostSession) {
Ext.Msg.show({
title : TRANSLATIONS.ID_ERROR_CREATING_NEW_CASE, // 'Error creating a new Case',
msg : res.message,
icon : Ext.MessageBox.ERROR,
buttons : Ext.Msg.OK,
fn : function(btn) {
location = location;
}
else {
});
} else {
Ext.Msg.show({
title : TRANSLATIONS.ID_ERROR_CREATING_NEW_CASE, // 'Error creating a new Case',
msg : '<textarea cols="50" rows="10">'

View File

@@ -422,6 +422,23 @@
var rowSelected = processesGrid.getSelectionModel().getSelected();
if( rowSelected ){
Ext.Ajax.request({
url : 'cases_ShowDocument' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
top.location = '../login/login';
}
});
} else {
//uploadDocumentGridGlobal construct
uploadDocumentGridDownloadGlobal.APP_DOC_UID = rowSelected.data.APP_DOC_UID;
uploadDocumentGridDownloadGlobal.DOWNLOAD_LINK = rowSelected.data.DOWNLOAD_LINK;
@@ -433,7 +450,14 @@
uploadDocumentGridDownload();
}
else{
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
} else{
Ext.Msg.show({
title:'',
msg: TRANSLATIONS.ID_NO_SELECTION_WARNING,

View File

@@ -345,8 +345,33 @@ Ext.onReady(function(){
Actions.processMap = function()
{
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Actions.tabFrame('processMap');
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.processInformation = function()
{
@@ -355,7 +380,18 @@ Ext.onReady(function(){
params : {action : 'getProcessInformation'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
fieldset = {
xtype : 'fieldset',
autoHeight : true,
@@ -399,9 +435,9 @@ Ext.onReady(function(){
items: [frm]
});
win.show();
},
}},
failure: function ( result, request) {
Ext.MessageBox.alert( _('ID_FAILED') , result.responseText);
Ext.MessageBox.alert('Failed', result.responseText);
}
});
}
@@ -413,7 +449,18 @@ Ext.onReady(function(){
params : {action : 'getTaskInformation'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
fieldset = {
xtype : 'fieldset',
autoHeight : true,
@@ -458,6 +505,7 @@ Ext.onReady(function(){
items: [frm]
});
win.show();
}
},
failure: function ( result, request) {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
@@ -467,28 +515,153 @@ Ext.onReady(function(){
Actions.caseHistory = function()
{
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Actions.tabFrame('caseHistory');
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.messageHistory = function()
{
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Actions.tabFrame('messageHistory');
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.dynaformHistory = function()
{
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Actions.tabFrame('dynaformHistory');
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.uploadedDocuments = function()
{
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Actions.tabFrame('uploadedDocuments');
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.generatedDocuments = function()
{
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
Actions.tabFrame('generatedDocuments');
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.cancelCase = function()
{
@@ -641,8 +814,33 @@ Ext.onReady(function(){
maximizable: false,
items: [grid]
});
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
win.show();
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.reassignCase = function()
{
@@ -762,11 +960,53 @@ Ext.onReady(function(){
resizable: false,
items: [frm]
});
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
win.show();
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.pauseCase = function()
{
Ext.Ajax.request({
url : 'ajaxListener' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
if (Ext.getCmp('noteReason').getValue() != '') {
var noteReasonTxt = _('ID_CASE_PAUSE_LABEL_NOTE') + ' ' + Ext.getCmp('noteReason').getValue();
} else {
@@ -776,14 +1016,13 @@ Ext.onReady(function(){
var paramsNote = '&NOTE_REASON=' + noteReasonTxt + '&NOTIFY_PAUSE=' + notifyReasonVal;
var unpauseDate = Ext.getCmp('unpauseDate').getValue();
var vUnpauseTime = Ext.getCmp('unpauseTime').getValue();
if( unpauseDate == '') {
//Ext.getCmp('submitPauseCase').setDisabled(true);
return;
} else {
} else
//Ext.getCmp('submitPauseCase').enable();
unpauseDate = unpauseDate.format('Y-m-d');
}
Ext.getCmp('unpauseFrm').getForm().submit({
url:'ajaxListener',
@@ -791,16 +1030,15 @@ Ext.onReady(function(){
params : {
action: 'pauseCase',
unpauseDate:unpauseDate,
unpauseTime: vUnpauseTime,
NOTE_REASON: noteReasonTxt,
NOTIFY_PAUSE: notifyReasonVal
},
waitMsg: _("ID_PAUSING_CASE") + stringReplace("\\: ", "", _APP_NUM) + "...",
waitMsg:'Pausing Case '+stringReplace("\\: ", "", _APP_NUM)+'...',
timeout : 36000,
success : function(res, req) {
if(req.result.success) {
try {
parent.notify( _('ID_PAUSE_CASE') , req.result.msg);
parent.notify('PAUSE CASE', req.result.msg);
}
catch (e) {
}
@@ -811,6 +1049,14 @@ Ext.onReady(function(){
}
});
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
Actions.unpauseCase = function()
{
@@ -844,8 +1090,25 @@ Ext.onReady(function(){
Actions.deleteCase = function()
{
Ext.Ajax.request({
url : 'casesList_Ajax' ,
params : {actionAjax : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
PMExt.confirm(_('ID_CONFIRM'), _('ID_CONFIRM_DELETE_CASE'), function(){
var loadMask = new Ext.LoadMask(document.body, {msg: _('ID_DELETING_CASE') });
var loadMask = new Ext.LoadMask(document.body, {msg:'Deleting case...'});
loadMask.show();
Ext.Ajax.request({
url : '../adhocUserProxy/deleteCase',
@@ -864,11 +1127,14 @@ Ext.onReady(function(){
}
},
failure: function ( result, request) {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
Ext.MessageBox.alert('Failed', result.responseText);
}
});
});
}
}
});
}
Actions.reactivateCase = function()
{
@@ -902,6 +1168,23 @@ Ext.onReady(function(){
//
Actions.tabFrame = function(name)
{
Ext.Ajax.request({
url : 'casesList_Ajax' ,
params : {action : 'verifySession'},
success: function ( result, request ) {
var data = Ext.util.JSON.decode(result.responseText);
if( data.lostSession ) {
Ext.Msg.show({
title: _('ID_ERROR'),
msg: data.message,
animEl: 'elId',
icon: Ext.MessageBox.ERROR,
buttons: Ext.MessageBox.OK,
fn : function(btn) {
location = location;
}
});
} else {
tabId = name + 'MenuOption';
var uri = 'ajaxListener?action=' + name;
var TabPanel = Ext.getCmp('caseTabPanel');
@@ -1030,7 +1313,7 @@ Ext.onReady(function(){
title: menuSelectedTitle[name],
frameConfig:{name: name + 'Frame', id: name + 'Frame'},
defaultSrc : uri,
loadMask:{msg:_('ID_LOADING_GRID')},
loadMask:{msg:_('ID_LOADING_GRID')+'...'},
autoWidth: true,
closable:true,
autoScroll: true,
@@ -1040,6 +1323,14 @@ Ext.onReady(function(){
TabPanel.doLayout();
}
}
},
failure: function ( result, request) {
if (typeof(result.responseText) != 'undefined') {
Ext.MessageBox.alert( _('ID_FAILED'), result.responseText);
}
}
});
}
});

View File

@@ -753,7 +753,17 @@ SaveUsersRole = function(arr_usr, function_success, function_failure){
Ext.Ajax.request({
url: 'roles_Ajax',
params: {request: 'assignUserToRole', ROL_UID: ROLES.ROL_UID, aUsers: arr_usr.join(',')},
success: function(){
success: function( result, request ){
var data = Ext.util.JSON.decode(result.responseText);
if( data.userRole ) {
Ext.Msg.show({
title: _('ID_WARNING'),
msg: _('ID_ADMINISTRATOR_ROLE_CANT_CHANGED'),
animEl: 'elId',
icon: Ext.MessageBox.WARNING,
buttons: Ext.MessageBox.OK
});
}
viewport.getEl().unmask();
function_success();
},

View File

@@ -870,6 +870,17 @@ if (! defined( 'EXECUTE_BY_CRON' )) {
$noLoginFiles[] = 'appFolderAjax';
$noLoginFiles[] = 'steps_Ajax';
$noLoginFiles[] = 'proxyCasesList';
$noLoginFiles[] = 'casesStartPage_Ajax';
$noLoginFiles[] = 'appProxy';
$noLoginFiles[] = 'cases_Ajax';
$noLoginFiles[] = 'casesList_Ajax';
$noLoginFiles[] = 'proxyReassignCasesList';
$noLoginFiles[] = 'ajaxListener';
$noLoginFiles[] = 'cases_Step';
$noLoginFiles[] = 'cases_ShowOutputDocument';
$noLoginFiles[] = 'cases_ShowDocument';
$noLoginFiles[] = 'cases_CatchExecute';
$noLoginFiles[] = 'cases_SaveData';
$noLoginFolders[] = 'services';
$noLoginFolders[] = 'tracker';