From b075604bb8e14678ad9a0223e3b0764506757490 Mon Sep 17 00:00:00 2001 From: Jonathan Byrne Date: Wed, 27 Feb 2008 14:30:32 +0000 Subject: [PATCH] KTS-1888 "Expunge page in the DMS Administration section, pagination not working, links to consecutive pages do not work" --- plugins/ktcore/admin/expungeList.php | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++---- resources/js/expungeList.js | 2 +- templates/ktcore/document/admin/deletedlist.smarty | 2 ++ 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/plugins/ktcore/admin/expungeList.php b/plugins/ktcore/admin/expungeList.php index 229f292..7d23fc3 100644 --- a/plugins/ktcore/admin/expungeList.php +++ b/plugins/ktcore/admin/expungeList.php @@ -39,8 +39,9 @@ require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); require_once(KT_LIB_DIR . '/documentmanagement/DocumentTransaction.inc'); - -$aDocuments =& Document::getList("status_id=" . DELETED); + +$sWhere = "status_id=" . DELETED; +$aDocuments =& Document::getList($sWhere); $pageNum = $_REQUEST['page']; @@ -50,6 +51,11 @@ if(fmod($items, 10) > 0){ }else{ $pages = ($items/10); } + +for($i=1; $i<=$pages; $i++){ + $aPages[] = $i; +} + if($pageNum == 1){ $listStart = 0; $listEnd = 9; @@ -60,13 +66,53 @@ if($pageNum == 1){ $listStart = (10*($pageNum-1)); $listEnd = $listStart+9; } + + + +$output = " + + + + + + + + + '; + + for($i = $listStart; $i <= $listEnd; $i++){ - $output .= " - + $output .= " + + "; + } + + +$output .= ' + + + + + + + +
"._kt('Document Name').''._kt('Last Modification').''._kt('Deletion Comment').'
getId()."\"/> ".$aDocuments[$i]->getName()." ".$aDocuments[$i]->getLastModifiedDate()." ".$aDocuments[$i]->getLastDeletionComment()."
+ '.$items.' '._kt('items, 10 per page').' +
+
'; + + foreach($aPages as $page){ + $output .= ''.$page.' '; + } + +$output .= '
+
+ '; + echo $output; ?> diff --git a/resources/js/expungeList.js b/resources/js/expungeList.js index 3abebce..b7e06f9 100644 --- a/resources/js/expungeList.js +++ b/resources/js/expungeList.js @@ -16,7 +16,7 @@ function buildList(value){ function stateChanged(){ if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ - document.getElementById("output").innerHTML=xmlHttp.responseText; + document.getElementById("tableoutput").innerHTML=xmlHttp.responseText; } } diff --git a/templates/ktcore/document/admin/deletedlist.smarty b/templates/ktcore/document/admin/deletedlist.smarty index e80a6ac..a509af2 100644 --- a/templates/ktcore/document/admin/deletedlist.smarty +++ b/templates/ktcore/document/admin/deletedlist.smarty @@ -17,6 +17,7 @@ can restore them as necessary.{/i18n}

{foreach item=oFDoc from=$fullList} {/foreach} +
@@ -55,6 +56,7 @@ can restore them as necessary.{/i18n}

+
-- libgit2 0.21.4