Commit 0b65a15d0c0ab094ab5c58f317888f9c37dc67f2
1 parent
08707e23
Pretty up and make more understandable the sort criteria
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3069 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
34 additions
and
17 deletions
lib/browse/Browser.inc
| @@ -57,22 +57,39 @@ class Browser { | @@ -57,22 +57,39 @@ class Browser { | ||
| 57 | * @param array the sort criteria | 57 | * @param array the sort criteria |
| 58 | */ | 58 | */ |
| 59 | function Browser($sNewSortField, $sNewSortDirection, $aNewSortCriteria = array()) { | 59 | function Browser($sNewSortField, $sNewSortDirection, $aNewSortCriteria = array()) { |
| 60 | - // default sort criteria | ||
| 61 | - if (count($aNewSortCriteria) == 0) { | ||
| 62 | - $aNewSortCriteria = array ( "name" => array ("display" => _("Title")), | ||
| 63 | - "filename" => array ("display" => _("Description")), | ||
| 64 | - "creator_id" => array ("display" => _("Creator"), | ||
| 65 | - "lookup" => array ("table" => "users", | ||
| 66 | - "field" => "name")), | ||
| 67 | - | ||
| 68 | - "id" => array ("display" => _("Date Created"), | ||
| 69 | - "lookup" => array("table" => "document_transactions", | ||
| 70 | - "field" => "datetime", | ||
| 71 | - "joinColumn" => "document_id", | ||
| 72 | - "whereClause" => "transaction_id=1")), | ||
| 73 | - "document_type_id" => array ("display" => _("Document Type"), | ||
| 74 | - "lookup" => array ("table" => "document_types_lookup", | ||
| 75 | - "field" => "name")) ); | 60 | + // default sort criteria |
| 61 | + if (count($aNewSortCriteria) == 0) { | ||
| 62 | + $aNewSortCriteria = array ( | ||
| 63 | + "name" => array( | ||
| 64 | + "display" => _("Title"), | ||
| 65 | + ), | ||
| 66 | + "filename" => array( | ||
| 67 | + "display" => _("Description"), | ||
| 68 | + ), | ||
| 69 | + "creator_id" => array( | ||
| 70 | + "display" => _("Creator"), | ||
| 71 | + "lookup" => array( | ||
| 72 | + "table" => "users", | ||
| 73 | + "field" => "name", | ||
| 74 | + ), | ||
| 75 | + ), | ||
| 76 | + "id" => array( | ||
| 77 | + "display" => _("Date Created"), | ||
| 78 | + "lookup" => array( | ||
| 79 | + "table" => "document_transactions", | ||
| 80 | + "field" => "datetime", | ||
| 81 | + "joinColumn" => "document_id", | ||
| 82 | + "whereClause" => "transaction_id=1", | ||
| 83 | + ), | ||
| 84 | + ), | ||
| 85 | + "document_type_id" => array( | ||
| 86 | + "display" => _("Document Type"), | ||
| 87 | + "lookup" => array( | ||
| 88 | + "table" => "document_types_lookup", | ||
| 89 | + "field" => "name" | ||
| 90 | + ), | ||
| 91 | + ), | ||
| 92 | + ); | ||
| 76 | } | 93 | } |
| 77 | 94 | ||
| 78 | $this->aSortCriteria = $aNewSortCriteria; | 95 | $this->aSortCriteria = $aNewSortCriteria; |
| @@ -144,4 +161,4 @@ class Browser { | @@ -144,4 +161,4 @@ class Browser { | ||
| 144 | function browse() { | 161 | function browse() { |
| 145 | } | 162 | } |
| 146 | 163 | ||
| 147 | -} | ||
| 148 | \ No newline at end of file | 164 | \ No newline at end of file |
| 165 | +} |