HOR-668 CLONE - Slow Query in /methods/cases/casesList_Ajax.php
up observations up observations in ; up observations
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!isset($_SESSION['USER_LOGGED'])) {
|
if (!isset($_SESSION['USER_LOGGED'])) {
|
||||||
$response = new stdclass();
|
$response = new stdClass();
|
||||||
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
$response->message = G::LoadTranslation('ID_LOGIN_AGAIN');
|
||||||
$response->lostSession = true;
|
$response->lostSession = true;
|
||||||
print G::json_encode($response);
|
print G::json_encode($response);
|
||||||
@@ -71,6 +71,7 @@ if ($actionAjax == "userValues") {
|
|||||||
//now get users, just for the Search action
|
//now get users, just for the Search action
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'search_simple':
|
case 'search_simple':
|
||||||
|
case 'to_reassign':
|
||||||
case 'search':
|
case 'search':
|
||||||
G::LoadClass("configuration");
|
G::LoadClass("configuration");
|
||||||
|
|
||||||
@@ -87,10 +88,10 @@ if ($actionAjax == "userValues") {
|
|||||||
$cUsers->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
$cUsers->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||||
|
|
||||||
if (!is_null($query)) {
|
if (!is_null($query)) {
|
||||||
$filters = $cUsers->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
|
$filters = $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $query . '%', Criteria::LIKE)
|
||||||
$cUsers->getNewCriterion( UsersPeer::USR_LASTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
|
->addOr($cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $query . '%', Criteria::LIKE)
|
||||||
$cUsers->getNewCriterion( UsersPeer::USR_USERNAME, '%'.$query.'%', Criteria::LIKE )));
|
->addOr($cUsers->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $query . '%', Criteria::LIKE)));
|
||||||
$cUsers->addOr( $filters );
|
$cUsers->addAnd($filters);
|
||||||
}
|
}
|
||||||
$cUsers->setLimit(20);
|
$cUsers->setLimit(20);
|
||||||
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
||||||
@@ -115,134 +116,60 @@ if ($actionAjax == "userValues") {
|
|||||||
|
|
||||||
if ($actionAjax == "processListExtJs") {
|
if ($actionAjax == "processListExtJs") {
|
||||||
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
|
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : null;
|
||||||
|
$query = isset($_REQUEST['query']) ? $_REQUEST['query'] : null;
|
||||||
$categoryUid = isset($_REQUEST['CATEGORY_UID']) ? $_REQUEST['CATEGORY_UID'] : null;
|
$categoryUid = isset($_REQUEST['CATEGORY_UID']) ? $_REQUEST['CATEGORY_UID'] : null;
|
||||||
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
$userUid = (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') ? $_SESSION['USER_LOGGED'] : null;
|
||||||
|
|
||||||
global $oAppCache;
|
$processes = array();
|
||||||
$oAppCache = new AppCacheView();
|
|
||||||
$processes = Array ();
|
|
||||||
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' )
|
|
||||||
);
|
|
||||||
|
|
||||||
//get the list based in the action provided
|
|
||||||
switch ($action) {
|
|
||||||
case 'draft':
|
|
||||||
$cProcess = $oAppCache->getDraftListCriteria( $userUid ); //fast enough
|
|
||||||
break;
|
|
||||||
case 'sent':
|
|
||||||
$cProcess = $oAppCache->getSentListProcessCriteria( $userUid ); // fast enough
|
|
||||||
break;
|
|
||||||
case 'simple_search':
|
|
||||||
case 'search':
|
|
||||||
//in search action, the query to obtain all process is too slow, so we need to query directly to
|
//in search action, the query to obtain all process is too slow, so we need to query directly to
|
||||||
//process and content tables, and for that reason we need the current language in AppCacheView.
|
//process and content tables, and for that reason we need the current language in AppCacheView.
|
||||||
G::loadClass( 'configuration' );
|
|
||||||
$oConf = new Configurations();
|
$oConf = new Configurations();
|
||||||
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '');
|
$oConf->loadConfig($x, 'APP_CACHE_VIEW_ENGINE', '', '', '', '');
|
||||||
$appCacheViewEngine = $oConf->aConfig;
|
$appCacheViewEngine = $oConf->aConfig;
|
||||||
$lang = isset($appCacheViewEngine['LANG']) ? $appCacheViewEngine['LANG'] : 'en';
|
$lang = isset($appCacheViewEngine['LANG']) ? $appCacheViewEngine['LANG'] : 'en';
|
||||||
|
|
||||||
$cProcess = new Criteria('workflow');
|
$cProcess = new Criteria('workflow');
|
||||||
|
//get the processes for this user in this action
|
||||||
$cProcess->clearSelectColumns();
|
$cProcess->clearSelectColumns();
|
||||||
$cProcess->addSelectColumn(ProcessPeer::PRO_UID);
|
$cProcess->addSelectColumn(ProcessPeer::PRO_UID);
|
||||||
$cProcess->addSelectColumn( ContentPeer::CON_VALUE );
|
$cProcess->addAsColumn('PRO_TITLE', ContentPeer::CON_VALUE);
|
||||||
if ($categoryUid) {
|
if ($categoryUid) {
|
||||||
$cProcess->add(ProcessPeer::PRO_CATEGORY, $categoryUid);
|
$cProcess->add(ProcessPeer::PRO_CATEGORY, $categoryUid);
|
||||||
}
|
}
|
||||||
$del = DBAdapter::getStringDelimiter();
|
|
||||||
|
$del = \DBAdapter::getStringDelimiter();
|
||||||
$conds = array();
|
$conds = array();
|
||||||
$conds[] = array(ProcessPeer::PRO_UID, ContentPeer::CON_ID);
|
$conds[] = array(ProcessPeer::PRO_UID, ContentPeer::CON_ID);
|
||||||
$conds[] = array(ContentPeer::CON_CATEGORY, $del . 'PRO_TITLE' . $del);
|
$conds[] = array(ContentPeer::CON_CATEGORY, $del . 'PRO_TITLE' . $del);
|
||||||
$conds[] = array(ContentPeer::CON_LANG, $del . $lang . $del);
|
$conds[] = array(ContentPeer::CON_LANG, $del . $lang . $del);
|
||||||
$cProcess->addJoinMC($conds, Criteria::LEFT_JOIN);
|
$cProcess->addJoinMC($conds, Criteria::LEFT_JOIN);
|
||||||
$cProcess->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
$cProcess->add(ProcessPeer::PRO_STATUS, 'ACTIVE');
|
||||||
|
|
||||||
|
if (!is_null($query)) {
|
||||||
|
$filters = $cProcess->getNewCriterion(ContentPeer::CON_VALUE, '%' . $query . '%', Criteria::LIKE);
|
||||||
|
$cProcess->addAnd($filters);
|
||||||
|
}
|
||||||
|
|
||||||
$cProcess->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
|
$cProcess->addAscendingOrderByColumn(ContentPeer::CON_VALUE);
|
||||||
|
|
||||||
$oDataset = ProcessPeer::doSelectRS($cProcess);
|
$oDataset = ProcessPeer::doSelectRS($cProcess);
|
||||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
$oDataset->next();
|
|
||||||
|
|
||||||
while ($aRow = $oDataset->getRow()) {
|
while ($oDataset->next()) {
|
||||||
$processes[] = array ($aRow['PRO_UID'],$aRow['CON_VALUE']
|
$aRow = $oDataset->getRow();
|
||||||
);
|
$processes[] = $aRow;
|
||||||
$oDataset->next();
|
|
||||||
}
|
|
||||||
return print G::json_encode( $processes );
|
|
||||||
break;
|
|
||||||
case 'unassigned':
|
|
||||||
$cProcess = $oAppCache->getUnassignedListCriteria( $userUid );
|
|
||||||
break;
|
|
||||||
case 'paused':
|
|
||||||
$cProcess = $oAppCache->getPausedListCriteria( $userUid );
|
|
||||||
break;
|
|
||||||
case 'to_revise':
|
|
||||||
$cProcess = $oAppCache->getToReviseListCriteria( $userUid );
|
|
||||||
break;
|
|
||||||
case 'to_reassign':
|
|
||||||
$cProcess = $oAppCache->getToReassignListCriteria($userUid);
|
|
||||||
break;
|
|
||||||
case 'gral':
|
|
||||||
$cProcess = $oAppCache->getGeneralListCriteria();
|
|
||||||
break;
|
|
||||||
case 'todo':
|
|
||||||
default:
|
|
||||||
$cProcess = $oAppCache->getToDoListCriteria( $userUid ); //fast enough
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
//get the processes for this user in this action
|
|
||||||
$cProcess->clearSelectColumns();
|
|
||||||
$cProcess->addSelectColumn( AppCacheViewPeer::PRO_UID );
|
|
||||||
$cProcess->addSelectColumn( AppCacheViewPeer::APP_PRO_TITLE );
|
|
||||||
$cProcess->setDistinct( AppCacheViewPeer::PRO_UID );
|
|
||||||
if ($categoryUid) {
|
|
||||||
require_once 'classes/model/Process.php';
|
|
||||||
$cProcess->addAlias( 'CP', 'PROCESS' );
|
|
||||||
$cProcess->add( 'CP.PRO_CATEGORY', $categoryUid, Criteria::EQUAL );
|
|
||||||
$cProcess->addJoin( AppCacheViewPeer::PRO_UID, 'CP.PRO_UID', Criteria::LEFT_JOIN );
|
|
||||||
$cProcess->addAsColumn( 'CATEGORY_UID', 'CP.PRO_CATEGORY' );
|
|
||||||
}
|
|
||||||
|
|
||||||
$cProcess->addAscendingOrderByColumn(AppCacheViewPeer::APP_PRO_TITLE);
|
|
||||||
|
|
||||||
$oDataset = AppCacheViewPeer::doSelectRS( $cProcess, Propel::getDbConnection('workflow_ro') );
|
|
||||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
|
||||||
$oDataset->next();
|
|
||||||
|
|
||||||
while ($aRow = $oDataset->getRow()) {
|
|
||||||
$processes[] = array ($aRow['PRO_UID'],$aRow['APP_PRO_TITLE']
|
|
||||||
);
|
|
||||||
$oDataset->next();
|
|
||||||
}
|
}
|
||||||
return print G::json_encode($processes);
|
return print G::json_encode($processes);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($actionAjax == "getUsersToReassign") {
|
if ($actionAjax == "getUsersToReassign") {
|
||||||
$taskUid = $_POST['taskUid'];
|
$_SESSION['TASK'] = $_REQUEST['TAS_UID'];
|
||||||
$search = $_POST['search'];
|
$case = new Cases();
|
||||||
$pageSize = $_POST['pageSize'];
|
$task = new Task();
|
||||||
|
$tasks = $task->load($_SESSION['TASK']);
|
||||||
$sortField = (isset($_POST['sort']))? $_POST['sort'] : '';
|
$result = new stdClass();
|
||||||
$sortDir = (isset($_POST['dir']))? $_POST['dir'] : '';
|
$result->data = $case->getUsersToReassign($_SESSION['TASK'], $_SESSION['USER_LOGGED'], $_SESSION['PRO_UID']);
|
||||||
$start = (isset($_POST['start']))? $_POST['start'] : 0;
|
print G::json_encode($result);
|
||||||
$limit = (isset($_POST['limit']))? $_POST['limit'] : $pageSize;
|
|
||||||
|
|
||||||
$response = [];
|
|
||||||
|
|
||||||
try {
|
|
||||||
$case = new \ProcessMaker\BusinessModel\Cases();
|
|
||||||
|
|
||||||
$result = $case->getUsersToReassign($_SESSION['USER_LOGGED'], $taskUid, ['filter' => $search], $sortField, $sortDir, $start, $limit);
|
|
||||||
|
|
||||||
$response['status'] = 'OK';
|
|
||||||
$response['success'] = true;
|
|
||||||
$response['resultTotal'] = $result['total'];
|
|
||||||
$response['resultRoot'] = $result['data'];
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$response['status'] = 'ERROR';
|
|
||||||
$response['message'] = $e->getMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
echo G::json_encode($response);
|
|
||||||
}
|
}
|
||||||
if ($actionAjax == 'reassignCase') {
|
if ($actionAjax == 'reassignCase') {
|
||||||
|
|
||||||
@@ -265,7 +192,7 @@ if ($actionAjax == 'reassignCase') {
|
|||||||
//print_r($caseData);
|
//print_r($caseData);
|
||||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||||
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
||||||
$result = new stdclass();
|
$result = new stdClass();
|
||||||
$result->status = 0;
|
$result->status = 0;
|
||||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
@@ -298,7 +225,8 @@ if ($actionAjax == 'showHistoryMessage') {
|
|||||||
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) {
|
||||||
}
|
}
|
||||||
//!
|
//!
|
||||||
@@ -316,6 +244,9 @@ if ($actionAjax == 'showHistoryMessage') {
|
|||||||
|
|
||||||
$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
|
||||||
@@ -355,26 +286,33 @@ if ($actionAjax == 'showDynaformListHistory') {
|
|||||||
function safe_add(x, y) {
|
function safe_add(x, y) {
|
||||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
|
||||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
||||||
return(msw<<16)|(lsw&0xFFFF)
|
return (msw << 16) | (lsw & 0xFFFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
function bit_rol(num, cnt) {
|
function bit_rol(num, cnt) {
|
||||||
return(num<<cnt)|(num>>>(32-cnt))
|
return (num << cnt) | (num >>> (32 - cnt));
|
||||||
}
|
}
|
||||||
|
|
||||||
function md5_cmn(q, a, b, x, s, t) {
|
function md5_cmn(q, a, b, x, s, t) {
|
||||||
return safe_add(bit_rol(safe_add(safe_add(a,q),safe_add(x,t)),s),b)
|
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b);
|
||||||
}
|
}
|
||||||
|
|
||||||
function md5_ff(a, b, c, d, x, s, t) {
|
function md5_ff(a, b, c, d, x, s, t) {
|
||||||
return md5_cmn((b&c)|((~b)&d),a,b,x,s,t)
|
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
function md5_gg(a, b, c, d, x, s, t) {
|
function md5_gg(a, b, c, d, x, s, t) {
|
||||||
return md5_cmn((b&d)|(c&(~d)),a,b,x,s,t)
|
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
function md5_hh(a, b, c, d, x, s, t) {
|
function md5_hh(a, b, c, d, x, s, t) {
|
||||||
return md5_cmn(b^c^d,a,b,x,s,t)
|
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
function md5_ii(a, b, c, d, x, s, t) {
|
function md5_ii(a, b, c, d, x, s, t) {
|
||||||
return md5_cmn(c^(b|(~d)),a,b,x,s,t)
|
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
function core_md5(x, len) {
|
function core_md5(x, len) {
|
||||||
x[len >> 5] |= 0x80 << ((len) % 32);
|
x[len >> 5] |= 0x80 << ((len) % 32);
|
||||||
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
x[(((len + 64) >>> 9) << 4) + 14] = len;
|
||||||
@@ -451,17 +389,43 @@ if ($actionAjax == 'showDynaformListHistory') {
|
|||||||
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
||||||
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
|
c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259);
|
||||||
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
|
b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551);
|
||||||
a=safe_add(a,olda);b=safe_add(b,oldb);
|
a = safe_add(a, olda);
|
||||||
c=safe_add(c,oldc);d=safe_add(d,oldd)
|
b = safe_add(b, oldb);
|
||||||
|
c = safe_add(c, oldc);
|
||||||
|
d = safe_add(d, oldd);
|
||||||
}
|
}
|
||||||
return[a,b,c,d]
|
return [a, b, c, d];
|
||||||
}
|
}
|
||||||
function str2binl(str){var bin=[];var mask=(1<<chrsz)-1;for(var i=0;i<str.length*chrsz;i+=chrsz){bin[i>>5]|=(str.charCodeAt(i/chrsz)&mask)<<(i%32)}
|
|
||||||
return bin}
|
function str2binl(str) {
|
||||||
function binl2str(bin){var str="";var mask=(1<<chrsz)-1;for(var i=0;i<bin.length*32;i+=chrsz){str+=String.fromCharCode((bin[i>>5]>>>(i%32))&mask)}return str}
|
var bin = [];
|
||||||
function binl2hex(binarray){var hex_tab=hexcase?"0123456789ABCDEF":"0123456789abcdef";var str="";for(var i=0;i<binarray.length*4;i++){str+=hex_tab.charAt((binarray[i>>2]>>((i%4)*8+4))&0xF)+hex_tab.charAt((binarray[i>>2]>>((i%4)*8))&0xF)}
|
var mask = (1 << chrsz) - 1;
|
||||||
return str}
|
for (var i = 0; i < str.length * chrsz; i += chrsz) {
|
||||||
return(raw?binl2str(core_md5(str2binl(s),s.length*chrsz)):binl2hex(core_md5(str2binl(s),s.length*chrsz)))};
|
bin[i >> 5] |= (str.charCodeAt(i / chrsz) & mask) << (i % 32);
|
||||||
|
}
|
||||||
|
return bin;
|
||||||
|
}
|
||||||
|
|
||||||
|
function binl2str(bin) {
|
||||||
|
var str = "";
|
||||||
|
var mask = (1 << chrsz) - 1;
|
||||||
|
for (var i = 0; i < bin.length * 32; i += chrsz) {
|
||||||
|
str += String.fromCharCode((bin[i >> 5] >>> (i % 32)) & mask);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
function binl2hex(binarray) {
|
||||||
|
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
|
||||||
|
var str = "";
|
||||||
|
for (var i = 0; i < binarray.length * 4; i++) {
|
||||||
|
str += hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8 + 4)) & 0xF) + hex_tab.charAt((binarray[i >> 2] >> ((i % 4) * 8)) & 0xF);
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (raw ? binl2str(core_md5(str2binl(s), s.length * chrsz)) : binl2hex(core_md5(str2binl(s), s.length * chrsz)));
|
||||||
|
};
|
||||||
|
|
||||||
//!Code that simulated reload library javascript maborak
|
//!Code that simulated reload library javascript maborak
|
||||||
var leimnud = {};
|
var leimnud = {};
|
||||||
@@ -471,7 +435,8 @@ if ($actionAjax == 'showDynaformListHistory') {
|
|||||||
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) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,6 +507,7 @@ if ($actionAjax == 'dynaformChangeLogViewHistory') {
|
|||||||
html {
|
html {
|
||||||
color: black !important;
|
color: black !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: black !important;
|
color: black !important;
|
||||||
}
|
}
|
||||||
@@ -555,7 +521,8 @@ if ($actionAjax == 'dynaformChangeLogViewHistory') {
|
|||||||
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) {
|
||||||
}
|
}
|
||||||
//!
|
//!
|
||||||
@@ -573,7 +540,8 @@ if ($actionAjax == 'dynaformChangeLogViewHistory') {
|
|||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP_LABEL'] = '';
|
||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
||||||
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
|
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '',
|
||||||
|
$Fields['APP_DATA'], '', '', 'view');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
@@ -594,6 +562,7 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
|||||||
html {
|
html {
|
||||||
color: black !important;
|
color: black !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
color: black !important;
|
color: black !important;
|
||||||
}
|
}
|
||||||
@@ -608,7 +577,8 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
|||||||
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) {
|
||||||
}
|
}
|
||||||
//!
|
//!
|
||||||
@@ -618,7 +588,6 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
|||||||
//!dataIndex
|
//!dataIndex
|
||||||
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
|
$_POST["DYN_UID"] = $_REQUEST["DYN_UID"];
|
||||||
|
|
||||||
G::LoadClass( 'case' );
|
|
||||||
|
|
||||||
$G_PUBLISH = new Publisher();
|
$G_PUBLISH = new Publisher();
|
||||||
$oCase = new Cases();
|
$oCase = new Cases();
|
||||||
@@ -628,7 +597,9 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
|||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_STEP'] = '#';
|
||||||
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
$Fields['APP_DATA']['__DYNAFORM_OPTIONS']['NEXT_ACTION'] = 'return false;';
|
||||||
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
|
$_SESSION['DYN_UID_PRINT'] = $_POST['DYN_UID'];
|
||||||
$G_PUBLISH->AddContent( 'dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '', $Fields['APP_DATA'], '', '', 'view' );
|
$G_PUBLISH->AddContent('dynaform', 'xmlform', $_SESSION['PROCESS'] . '/' . $_POST['DYN_UID'], '',
|
||||||
|
$Fields['APP_DATA'],
|
||||||
|
'', '', 'view');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
@@ -642,4 +613,3 @@ if ($actionAjax == 'historyDynaformGridPreview') {
|
|||||||
<?php
|
<?php
|
||||||
G::RenderPage('publish', 'raw');
|
G::RenderPage('publish', 'raw');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -925,13 +925,15 @@ Ext.onReady ( function() {
|
|||||||
|
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url : 'casesList_Ajax',
|
url : 'casesList_Ajax',
|
||||||
params : {actionAjax : 'processListExtJs',
|
params : {
|
||||||
|
actionAjax : 'processListExtJs',
|
||||||
action: action,
|
action: action,
|
||||||
CATEGORY_UID: filterCategory},
|
CATEGORY_UID: filterCategory
|
||||||
|
},
|
||||||
success: function ( result, request ) {
|
success: function ( result, request ) {
|
||||||
processValues = Ext.util.JSON.decode(result.responseText);
|
processValues = Ext.util.JSON.decode(result.responseText);
|
||||||
comboProcess.getStore().removeAll();
|
suggestProcess.getStore().removeAll();
|
||||||
comboProcess.getStore().loadData(processValues);
|
suggestProcess.getStore().loadData(processValues);
|
||||||
},
|
},
|
||||||
failure: function ( result, request) {
|
failure: function ( result, request) {
|
||||||
if (typeof(result.responseText) != 'undefined') {
|
if (typeof(result.responseText) != 'undefined') {
|
||||||
@@ -940,41 +942,57 @@ Ext.onReady ( function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var comboProcess = new Ext.form.ComboBox({
|
var processStore = new Ext.data.Store( {
|
||||||
width : 180,
|
proxy : new Ext.data.HttpProxy( {
|
||||||
boxMaxWidth : 200,
|
url : 'casesList_Ajax?actionAjax=processListExtJs',
|
||||||
editable : false,
|
method : 'POST'
|
||||||
displayField : 'APP_PRO_TITLE',
|
}),
|
||||||
|
reader : new Ext.data.JsonReader( {
|
||||||
|
fields : [ {
|
||||||
|
name : 'PRO_UID'
|
||||||
|
}, {
|
||||||
|
name : 'PRO_TITLE'
|
||||||
|
} ]
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
var suggestProcess = new Ext.form.ComboBox({
|
||||||
|
store: processStore,
|
||||||
valueField : 'PRO_UID',
|
valueField : 'PRO_UID',
|
||||||
forceSelection: false,
|
displayField:'PRO_TITLE',
|
||||||
|
typeAhead: false,
|
||||||
|
triggerAction: 'all',
|
||||||
emptyText : _('ID_EMPTY_PROCESSES'),
|
emptyText : _('ID_EMPTY_PROCESSES'),
|
||||||
selectOnFocus : true,
|
selectOnFocus : true,
|
||||||
tpl: resultTpl,
|
editable : true,
|
||||||
|
width: 150,
|
||||||
typeAhead: true,
|
allowBlank : true,
|
||||||
mode: 'local',
|
|
||||||
autocomplete: true,
|
autocomplete: true,
|
||||||
triggerAction: 'all',
|
minChars: 1,
|
||||||
|
hideTrigger:true,
|
||||||
store : new Ext.data.ArrayStore({
|
|
||||||
fields : ['PRO_UID','APP_PRO_TITLE'],
|
|
||||||
data : processValues
|
|
||||||
}),
|
|
||||||
listeners:{
|
listeners:{
|
||||||
scope: this,
|
scope: this,
|
||||||
'select': function() {
|
'select': function() {
|
||||||
filterProcess = comboProcess.value;
|
filterProcess = suggestProcess.value;
|
||||||
if ( action == 'search' ){
|
if ( action == 'search' ){
|
||||||
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
storeCases.setBaseParam('dateFrom', dateFrom.getValue());
|
||||||
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
storeCases.setBaseParam('dateTo', dateTo.getValue());
|
||||||
}
|
}
|
||||||
storeCases.setBaseParam('process', filterProcess);
|
storeCases.setBaseParam('process', filterProcess);
|
||||||
//
|
}
|
||||||
//storeCases.load({params:{process: filterProcess, start : 0 , limit : pageSize}});
|
}
|
||||||
}},
|
|
||||||
iconCls: 'no-icon' //use iconCls if placing within menu to shift to right side of menu
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var resetProcessButton = {
|
||||||
|
text:'X',
|
||||||
|
ctCls:"pm_search_x_button_des",
|
||||||
|
handler: function(){
|
||||||
|
storeCases.setBaseParam('process', '');
|
||||||
|
suggestProcess.setValue('');
|
||||||
|
doSearch();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var comboAllUsers = new Ext.form.ComboBox({
|
var comboAllUsers = new Ext.form.ComboBox({
|
||||||
width : 180,
|
width : 180,
|
||||||
boxMaxWidth : 180,
|
boxMaxWidth : 180,
|
||||||
@@ -1050,10 +1068,9 @@ Ext.onReady ( function() {
|
|||||||
CATEGORY_UID: filterCategory},
|
CATEGORY_UID: filterCategory},
|
||||||
success: function ( result, request ) {
|
success: function ( result, request ) {
|
||||||
var data = Ext.util.JSON.decode(result.responseText);
|
var data = Ext.util.JSON.decode(result.responseText);
|
||||||
comboProcess.getStore().removeAll();
|
suggestProcess.getStore().removeAll();
|
||||||
comboProcess.getStore().loadData( data );
|
suggestProcess.getStore().loadData( data );
|
||||||
comboProcess.setValue('');
|
suggestProcess.setValue('');
|
||||||
|
|
||||||
},
|
},
|
||||||
failure: function ( result, request) {
|
failure: function ( result, request) {
|
||||||
if (typeof(result.responseText) != 'undefined') {
|
if (typeof(result.responseText) != 'undefined') {
|
||||||
@@ -1803,7 +1820,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_('ID_PROCESS'),
|
_('ID_PROCESS'),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
'-',
|
'-',
|
||||||
textSearch,
|
textSearch,
|
||||||
resetSearchButton,
|
resetSearchButton,
|
||||||
@@ -1827,7 +1845,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_('ID_PROCESS'),
|
_('ID_PROCESS'),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
'-',
|
'-',
|
||||||
textSearch,
|
textSearch,
|
||||||
resetSearchButton,
|
resetSearchButton,
|
||||||
@@ -1851,7 +1870,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_('ID_PROCESS'),
|
_('ID_PROCESS'),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
'-',
|
'-',
|
||||||
textSearch,
|
textSearch,
|
||||||
resetSearchButton,
|
resetSearchButton,
|
||||||
@@ -1877,7 +1897,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_('ID_PROCESS'),
|
_('ID_PROCESS'),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
'-',
|
'-',
|
||||||
textSearch,
|
textSearch,
|
||||||
resetSearchButton,
|
resetSearchButton,
|
||||||
@@ -1896,7 +1917,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_('ID_PROCESS'),
|
_('ID_PROCESS'),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
'-',
|
'-',
|
||||||
textSearch,
|
textSearch,
|
||||||
resetSearchButton,
|
resetSearchButton,
|
||||||
@@ -1923,7 +1945,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_("ID_PROCESS"),
|
_("ID_PROCESS"),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
textSearch,
|
textSearch,
|
||||||
resetSearchButton,
|
resetSearchButton,
|
||||||
btnSearch,
|
btnSearch,
|
||||||
@@ -1943,7 +1966,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_('ID_PROCESS'),
|
_('ID_PROCESS'),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
'-',
|
'-',
|
||||||
_('ID_STATUS'),
|
_('ID_STATUS'),
|
||||||
comboStatus,
|
comboStatus,
|
||||||
@@ -2002,7 +2026,8 @@ Ext.onReady ( function() {
|
|||||||
comboCategory,
|
comboCategory,
|
||||||
"-",
|
"-",
|
||||||
_('ID_PROCESS'),
|
_('ID_PROCESS'),
|
||||||
comboProcess,
|
suggestProcess,
|
||||||
|
resetProcessButton,
|
||||||
'-',
|
'-',
|
||||||
_('ID_STATUS'),
|
_('ID_STATUS'),
|
||||||
comboStatus,
|
comboStatus,
|
||||||
@@ -2400,7 +2425,7 @@ Ext.onReady ( function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
comboCategory.setValue("");
|
comboCategory.setValue("");
|
||||||
comboProcess.setValue("");
|
suggestProcess.setValue("");
|
||||||
comboStatus.setValue("");
|
comboStatus.setValue("");
|
||||||
/*----------------------------------********---------------------------------*/
|
/*----------------------------------********---------------------------------*/
|
||||||
if (typeof valueFilterStatus != 'undefined') {
|
if (typeof valueFilterStatus != 'undefined') {
|
||||||
|
|||||||
Reference in New Issue
Block a user