Merged in bugfix/HOR-3618-C (pull request #5863)

HOR-3618

Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
Paula Quispe
2017-08-05 15:35:49 +00:00
3 changed files with 138 additions and 139 deletions

View File

@@ -23,14 +23,13 @@
* *
*/ */
G::LoadAllPluginModelClasses();
$id=get_ajax_value('ptID');
$ntable = unserialize(base64_decode($_SESSION['pagedTable[' . $id . ']']));
$page=get_ajax_value('page');
$function=get_ajax_value('function');
if (isset($ntable->filterForm_Id) && ($ntable->filterForm_Id!=='')) {
$id=get_ajax_value('ptID');
$ntable = unserialize(base64_decode($_SESSION['pagedTable[' . $id . ']']));
$page=get_ajax_value('page');
$function=get_ajax_value('function');
if (isset($ntable->filterForm_Id) && ($ntable->filterForm_Id!=='')) {
$filterForm=new filterForm(G::getUIDName( $ntable->filterForm_Id )); $filterForm=new filterForm(G::getUIDName( $ntable->filterForm_Id ));
$filterForm->values=$_SESSION[$filterForm->id]; $filterForm->values=$_SESSION[$filterForm->id];
parse_str( urldecode(get_ajax_value('filter')) , $newValues); parse_str( urldecode(get_ajax_value('filter')) , $newValues);
@@ -44,19 +43,19 @@
} }
$ntable->filter = $filter;//G::http_build_query($filter); $ntable->filter = $filter;//G::http_build_query($filter);
} }
} }
$fastSearch=get_ajax_value('fastSearch'); $fastSearch=get_ajax_value('fastSearch');
if (isset($fastSearch)) $ntable->fastSearch= urldecode($fastSearch); if (isset($fastSearch)) $ntable->fastSearch= urldecode($fastSearch);
$orderBy=get_ajax_value('order'); $orderBy=get_ajax_value('order');
if (isset($orderBy)) { if (isset($orderBy)) {
$orderBy=urldecode($orderBy); $orderBy=urldecode($orderBy);
$ntable->orderBy=$orderBy; $ntable->orderBy=$orderBy;
} }
if (isset($page) && $page!=='') $ntable->currentPage=(int) $page; if (isset($page) && $page!=='') $ntable->currentPage=(int) $page;
if (function_exists('pagedTable_BeforeQuery')) pagedTable_BeforeQuery($ntable); if (function_exists('pagedTable_BeforeQuery')) pagedTable_BeforeQuery($ntable);
$ntable->prepareQuery(); $ntable->prepareQuery();
switch ($function) switch ($function)
{ {
case "showHideField": case "showHideField":
$field=get_ajax_value('field'); $field=get_ajax_value('field');
$ntable->style[$field]['showInTable']= $ntable->style[$field]['showInTable']=
@@ -90,10 +89,10 @@
foreach($field as $key => $value) $field[$key]=urldecode($value); foreach($field as $key => $value) $field[$key]=urldecode($value);
$ntable->printForm(get_ajax_value('filename'),$field); $ntable->printForm(get_ajax_value('filename'),$field);
return ; return ;
} }
$ntable->renderTable( 'content' ); $ntable->renderTable( 'content' );
$conf = new Configurations(); $conf = new Configurations();
$conf->setConfig($ntable->__Configuration,$ntable,$conf->aConfig); $conf->setConfig($ntable->__Configuration,$ntable,$conf->aConfig);
$conf->saveConfig('pagedTable',$ntable->__OBJ_UID,'',$_SESSION['USER_LOGGED'],''); $conf->saveConfig('pagedTable',$ntable->__OBJ_UID,'',$_SESSION['USER_LOGGED'],'');
?> ?>

View File

@@ -24,13 +24,14 @@
*/ */
/* Includes */ /* Includes */
$id = get_ajax_value('ptID'); G::LoadAllPluginModelClasses();
$ntable = unserialize(base64_decode($_SESSION['pagedTable[' . $id . ']'])); $id = get_ajax_value('ptID');
$page = get_ajax_value('page'); $ntable = unserialize(base64_decode($_SESSION['pagedTable[' . $id . ']']));
$function = get_ajax_value('function'); $page = get_ajax_value('page');
$function = get_ajax_value('function');
//THIS BLOCK SET THE FILTER VARIABLES //THIS BLOCK SET THE FILTER VARIABLES
if (isset($ntable->filterForm_Id) && ($ntable->filterForm_Id!=='')) { if (isset($ntable->filterForm_Id) && ($ntable->filterForm_Id!=='')) {
$sPath = PATH_XMLFORM; $sPath = PATH_XMLFORM;
//if the xmlform file doesn't exist, then try with the plugins folders //if the xmlform file doesn't exist, then try with the plugins folders
@@ -61,31 +62,31 @@
} }
$ntable->filter = $filter;//G::http_build_query($filter); $ntable->filter = $filter;//G::http_build_query($filter);
} }
} }
$fastSearch = get_ajax_value('fastSearch'); $fastSearch = get_ajax_value('fastSearch');
if (isset($fastSearch)) { if (isset($fastSearch)) {
$ntable->fastSearch= htmlentities(urldecode($fastSearch), ENT_QUOTES, 'UTF-8'); $ntable->fastSearch= htmlentities(urldecode($fastSearch), ENT_QUOTES, 'UTF-8');
$page = 1; $page = 1;
} }
//order by //order by
$orderBy = get_ajax_value('order'); $orderBy = get_ajax_value('order');
if (isset($orderBy)) { if (isset($orderBy)) {
$orderBy = urldecode($orderBy); $orderBy = urldecode($orderBy);
$ntable->orderBy = $orderBy; $ntable->orderBy = $orderBy;
} }
if ( isset($page) && $page!=='' ) $ntable->currentPage = (int) $page; if ( isset($page) && $page!=='' ) $ntable->currentPage = (int) $page;
if ( function_exists('pagedTable_BeforeQuery')) if ( function_exists('pagedTable_BeforeQuery'))
pagedTable_BeforeQuery($ntable); pagedTable_BeforeQuery($ntable);
//$ntable->prepareQuery(); //$ntable->prepareQuery();
switch ($function) switch ($function)
{ {
case "showHideField": case "showHideField":
$field=get_ajax_value('field'); $field=get_ajax_value('field');
$ntable->style[$field]['showInTable']= $ntable->style[$field]['showInTable']=
@@ -119,7 +120,7 @@
foreach($field as $key => $value) $field[$key]=urldecode($value); foreach($field as $key => $value) $field[$key]=urldecode($value);
$ntable->printForm(get_ajax_value('filename'),$field); $ntable->printForm(get_ajax_value('filename'),$field);
return ; return ;
} }
$ntable->renderTable("content"); $ntable->renderTable("content");
@@ -131,4 +132,3 @@ if (isset($_SESSION["USER_LOGGED"])) {
} else { } else {
$conf->saveConfig("pagedTable", $ntable->__OBJ_UID); $conf->saveConfig("pagedTable", $ntable->__OBJ_UID);
} }

View File

@@ -33,7 +33,7 @@
* @access public * @access public
*/ */
class objectTemplate extends smarty class objectTemplate extends Smarty
{ {
/** /**