Commit b075604bb8e14678ad9a0223e3b0764506757490
1 parent
93c6f9ce
KTS-1888
"Expunge page in the DMS Administration section, pagination not working, links to consecutive pages do not work" Fixed. Changed the php file to return the contents of a div and not just a table body so that pagination works in Internet Explorer. Committed By: Jonathan Byrne Reviewed By: Jalaloedien Abrahams git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@8170 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
53 additions
and
5 deletions
plugins/ktcore/admin/expungeList.php
| @@ -39,8 +39,9 @@ require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); | @@ -39,8 +39,9 @@ require_once(KT_LIB_DIR . '/browse/browseutil.inc.php'); | ||
| 39 | 39 | ||
| 40 | require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); | 40 | require_once(KT_LIB_DIR . '/documentmanagement/Document.inc'); |
| 41 | require_once(KT_LIB_DIR . '/documentmanagement/DocumentTransaction.inc'); | 41 | require_once(KT_LIB_DIR . '/documentmanagement/DocumentTransaction.inc'); |
| 42 | - | ||
| 43 | -$aDocuments =& Document::getList("status_id=" . DELETED); | 42 | + |
| 43 | +$sWhere = "status_id=" . DELETED; | ||
| 44 | +$aDocuments =& Document::getList($sWhere); | ||
| 44 | 45 | ||
| 45 | $pageNum = $_REQUEST['page']; | 46 | $pageNum = $_REQUEST['page']; |
| 46 | 47 | ||
| @@ -50,6 +51,11 @@ if(fmod($items, 10) > 0){ | @@ -50,6 +51,11 @@ if(fmod($items, 10) > 0){ | ||
| 50 | }else{ | 51 | }else{ |
| 51 | $pages = ($items/10); | 52 | $pages = ($items/10); |
| 52 | } | 53 | } |
| 54 | + | ||
| 55 | +for($i=1; $i<=$pages; $i++){ | ||
| 56 | + $aPages[] = $i; | ||
| 57 | +} | ||
| 58 | + | ||
| 53 | if($pageNum == 1){ | 59 | if($pageNum == 1){ |
| 54 | $listStart = 0; | 60 | $listStart = 0; |
| 55 | $listEnd = 9; | 61 | $listEnd = 9; |
| @@ -60,13 +66,53 @@ if($pageNum == 1){ | @@ -60,13 +66,53 @@ if($pageNum == 1){ | ||
| 60 | $listStart = (10*($pageNum-1)); | 66 | $listStart = (10*($pageNum-1)); |
| 61 | $listEnd = $listStart+9; | 67 | $listEnd = $listStart+9; |
| 62 | } | 68 | } |
| 69 | + | ||
| 70 | + | ||
| 71 | + | ||
| 72 | +$output = "<table class=\"kt_collection\"> | ||
| 73 | + <thead> | ||
| 74 | + <tr> | ||
| 75 | + <th style=\"width:2em\"><input type=\"checkbox\" onclick=\"toggleSelectFor(this, 'selected_docs')\" title=\"toggle all\"/></th> | ||
| 76 | + <th>"._kt('Document Name').'</th> | ||
| 77 | + <th>'._kt('Last Modification').'</th> | ||
| 78 | + <th>'._kt('Deletion Comment').'</th> | ||
| 79 | + </tr> | ||
| 80 | + </thead> | ||
| 81 | + <tbody>'; | ||
| 82 | + | ||
| 83 | + | ||
| 63 | for($i = $listStart; $i <= $listEnd; $i++){ | 84 | for($i = $listStart; $i <= $listEnd; $i++){ |
| 64 | - $output .= "<tr> | ||
| 65 | - <td><input type='checkbox' name='selected_docs[]' value='".$aDocuments[$i]->getId()."'/></td> | 85 | + $output .= " |
| 86 | + <tr> | ||
| 87 | + <td><input type=\"checkbox\" name=\"selected_docs[]\" value=\"".$aDocuments[$i]->getId()."\"/></td> | ||
| 66 | <td>".$aDocuments[$i]->getName()."</td> | 88 | <td>".$aDocuments[$i]->getName()."</td> |
| 67 | <td>".$aDocuments[$i]->getLastModifiedDate()."</td> | 89 | <td>".$aDocuments[$i]->getLastModifiedDate()."</td> |
| 68 | <td>".$aDocuments[$i]->getLastDeletionComment()."</td> | 90 | <td>".$aDocuments[$i]->getLastDeletionComment()."</td> |
| 69 | </tr>"; | 91 | </tr>"; |
| 92 | + | ||
| 70 | } | 93 | } |
| 94 | + | ||
| 95 | + | ||
| 96 | +$output .= '<tfoot> | ||
| 97 | + <tr> | ||
| 98 | + <td colspan="4"> | ||
| 99 | + <span style="float: left">'.$items.' '._kt('items, 10 per page').'</span> | ||
| 100 | + </td> | ||
| 101 | + </tr> | ||
| 102 | + <tr> | ||
| 103 | + <td colspan="4"> | ||
| 104 | + <div align="center">'; | ||
| 105 | + | ||
| 106 | + foreach($aPages as $page){ | ||
| 107 | + $output .= '<a href="#" onclick="buildList(this.innerHTML)">'.$page.'</a> '; | ||
| 108 | + } | ||
| 109 | + | ||
| 110 | +$output .= '</div> | ||
| 111 | + </td> | ||
| 112 | + </tr> | ||
| 113 | + </tfoot> | ||
| 114 | + </table> | ||
| 115 | + </tbody></table>'; | ||
| 116 | + | ||
| 71 | echo $output; | 117 | echo $output; |
| 72 | ?> | 118 | ?> |
resources/js/expungeList.js
| @@ -16,7 +16,7 @@ function buildList(value){ | @@ -16,7 +16,7 @@ function buildList(value){ | ||
| 16 | 16 | ||
| 17 | function stateChanged(){ | 17 | function stateChanged(){ |
| 18 | if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ | 18 | if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ |
| 19 | - document.getElementById("output").innerHTML=xmlHttp.responseText; | 19 | + document.getElementById("tableoutput").innerHTML=xmlHttp.responseText; |
| 20 | } | 20 | } |
| 21 | } | 21 | } |
| 22 | 22 |
templates/ktcore/document/admin/deletedlist.smarty
| @@ -17,6 +17,7 @@ can <strong>restore</strong> them as necessary.{/i18n}</p> | @@ -17,6 +17,7 @@ can <strong>restore</strong> them as necessary.{/i18n}</p> | ||
| 17 | {foreach item=oFDoc from=$fullList} | 17 | {foreach item=oFDoc from=$fullList} |
| 18 | <input type="hidden" name="docIds[]" value="{$oFDoc->getId()}"> | 18 | <input type="hidden" name="docIds[]" value="{$oFDoc->getId()}"> |
| 19 | {/foreach} | 19 | {/foreach} |
| 20 | +<div id="tableoutput"> | ||
| 20 | <table class="kt_collection"> | 21 | <table class="kt_collection"> |
| 21 | <thead> | 22 | <thead> |
| 22 | <tr> | 23 | <tr> |
| @@ -55,6 +56,7 @@ can <strong>restore</strong> them as necessary.{/i18n}</p> | @@ -55,6 +56,7 @@ can <strong>restore</strong> them as necessary.{/i18n}</p> | ||
| 55 | </tr> | 56 | </tr> |
| 56 | </tfoot> | 57 | </tfoot> |
| 57 | </table> | 58 | </table> |
| 59 | +</div> | ||
| 58 | <div class="form_actions"> | 60 | <div class="form_actions"> |
| 59 | <input type="submit" name="submit[expunge]" value="{i18n}Expunge{/i18n}" /> | 61 | <input type="submit" name="submit[expunge]" value="{i18n}Expunge{/i18n}" /> |
| 60 | <input type="submit" name="submit[restore]" value="{i18n}Restore{/i18n}" /> | 62 | <input type="submit" name="submit[restore]" value="{i18n}Restore{/i18n}" /> |