BUG 0000 "In HOME>Documents pager does not work" SOLVED
- In HOME>Documents pager does not work - Fixed, Added total records variable, The pager now work correctly * Available from version 2.0.46
This commit is contained in:
@@ -275,6 +275,8 @@ class AppFolder extends BaseAppFolder
|
||||
$oCriteria->add( AppDocumentPeer::APP_DOC_STATUS, 'ACTIVE' );
|
||||
}
|
||||
|
||||
$numRecTotal = AppDocumentPeer::doCount($oCriteria);
|
||||
|
||||
$oCase->verifyTable();
|
||||
|
||||
$oCriteria->addAscendingOrderByColumn( AppDocumentPeer::APP_DOC_INDEX );
|
||||
@@ -321,8 +323,10 @@ class AppFolder extends BaseAppFolder
|
||||
}
|
||||
$rs->next();
|
||||
}
|
||||
$response['totalDocumentsCount'] = count($response['documents']);
|
||||
return ($response);
|
||||
|
||||
$response["totalDocumentsCount"] = $numRecTotal;
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function getCompleteDocumentInfo ($appUid, $appDocUid, $docVersion, $docUid, $usrId)
|
||||
|
||||
@@ -121,30 +121,40 @@ function expandNode()
|
||||
$totalDocuments=0;
|
||||
|
||||
if (($_POST['sendWhat'] == "dirs") || ($_POST['sendWhat'] == "both")) {
|
||||
$folderListObj = $oPMFolder->getFolderList ($_POST ['node'] != 'root' ?
|
||||
$_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder, $limit, $start);
|
||||
//G::pr($folderListObj);
|
||||
$folderListObj = $oPMFolder->getFolderList(
|
||||
($_POST["node"] != "root")? (($_POST["node"] == "NA")? "" : $_POST["node"]) : $rootFolder,
|
||||
$limit,
|
||||
$start
|
||||
);
|
||||
|
||||
$folderList=$folderListObj['folders'];
|
||||
$totalFolders=$folderListObj['totalFoldersCount'];
|
||||
$totalItems+=count($folderList);
|
||||
//G::pr($folderListObj);
|
||||
}
|
||||
if (($_POST['sendWhat'] == "files") || ($_POST['sendWhat'] == "both")) {
|
||||
global $RBAC;
|
||||
|
||||
$user = ($RBAC->userCanAccess('PM_ALLCASES') == 1)? '' : $_SESSION['USER_LOGGED'];
|
||||
$folderContentObj = $oPMFolder->getFolderContent ($_POST ['node'] != 'root' ?
|
||||
$_POST ['node'] == 'NA' ? "" : $_POST ['node'] : $rootFolder, array(), null, null, $limit, $start, $user, true);
|
||||
|
||||
$folderContentObj = $oPMFolder->getFolderContent(
|
||||
($_POST["node"] != "root")? (($_POST["node"] == "NA")? "" : $_POST["node"]) : $rootFolder,
|
||||
array(),
|
||||
null,
|
||||
null,
|
||||
$limit,
|
||||
$start,
|
||||
$user,
|
||||
true
|
||||
);
|
||||
|
||||
$folderContent=$folderContentObj['documents'];
|
||||
$totalDocuments=$folderContentObj['totalDocumentsCount'];
|
||||
$totalItems+=count($folderContent);
|
||||
//G::pr($folderContent);
|
||||
}
|
||||
// G::pr($folderList);
|
||||
//var_dump(isset($folderList));
|
||||
|
||||
$processListTree=array();
|
||||
$tempTree=array();
|
||||
if (isset($folderList) && sizeof($folderList)>0) {
|
||||
//print'krlos';
|
||||
//$tempTree=array();
|
||||
foreach ($folderList as $key => $obj) {
|
||||
//$tempTree ['all-obj'] = $obj;
|
||||
@@ -339,15 +349,15 @@ function expandNode()
|
||||
$tempTree=array();
|
||||
}
|
||||
}
|
||||
//G::pr($processListTree);
|
||||
|
||||
if ((isset($_POST['option'])) && ($_POST['option'] == "gridDocuments")) {
|
||||
$processListTreeTemp['totalCount']=$totalFolders+count($processListTree);
|
||||
$processListTreeTemp["totalCount"] = $totalFolders + $totalDocuments;
|
||||
$processListTreeTemp['msg']='correct reload';
|
||||
$processListTreeTemp['items']=$processListTree;
|
||||
$processListTree = $processListTreeTemp;
|
||||
}
|
||||
//G::pr ($processListTree);die;
|
||||
print G::json_encode ($processListTree);
|
||||
|
||||
echo G::json_encode($processListTree);
|
||||
}
|
||||
|
||||
function openPMFolder()
|
||||
|
||||
@@ -1093,11 +1093,7 @@ var gridbb = new Ext.PagingToolbar({
|
||||
lastText : TRANSLATIONS.ID_LAST,
|
||||
nextText : TRANSLATIONS.ID_NEXT,
|
||||
prevText : TRANSLATIONS.ID_PREVIOUS,
|
||||
refreshText : TRANSLATIONS.ID_RELOAD,
|
||||
items : [ '-', ' ', ' ', ' ', ' ', ' ', new Ext.ux.StatusBar({
|
||||
defaultText : TRANSLATIONS.ID_DONE,
|
||||
id : 'statusPanel'
|
||||
}) ]
|
||||
refreshText: TRANSLATIONS.ID_RELOAD
|
||||
});
|
||||
|
||||
var grid;
|
||||
|
||||
Reference in New Issue
Block a user