Commit 9a019455be0e7e3b846ae4e6cc69683c8b1a62aa
1 parent
3899a512
Bug fixes
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@316 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
3 changed files
with
18 additions
and
10 deletions
lib/documentmanagement/Document.inc
| ... | ... | @@ -161,8 +161,8 @@ class Document { |
| 161 | 161 | if ($sql->next_record()) { |
| 162 | 162 | $doc = & new Document(stripslashes($sql->f("name")), $sql->f("size"), $sql->f("creator_id"), stripslashes($sql->f("description")), $sql->f("mime_id"), $sql->f("folder_id")); |
| 163 | 163 | $doc->setDocumentTypeID($sql->f("document_type_id")); |
| 164 | - $doc->setMajorRevision($sql->f("major_revision")); | |
| 165 | - $doc->setMinorRevision($sql->f("minor_revision")); | |
| 164 | + $doc->setMajorVersionNumber($sql->f("major_version")); | |
| 165 | + $doc->setMinorVersionNumber($sql->f("minor_version")); | |
| 166 | 166 | $doc->setIsCheckedOut($sql->f("is_checked_out")); |
| 167 | 167 | return $doc; |
| 168 | 168 | } | ... | ... |
lib/foldermanagement/FolderManager.inc
lib/visualpatterns/PatternListBox.inc
| ... | ... | @@ -22,23 +22,26 @@ class PatternListBox { |
| 22 | 22 | var $sValueColumn; |
| 23 | 23 | /** Select name */ |
| 24 | 24 | var $sSelectName; |
| 25 | + /** Where clause */ | |
| 26 | + var $sWhereClause; | |
| 25 | 27 | /** Order columns ascending*/ |
| 26 | 28 | var $bOrderAsc; |
| 27 | 29 | |
| 28 | 30 | /** |
| 29 | 31 | * Constructor |
| 30 | 32 | * |
| 31 | - * @param $sNewTableName Table in database that information will come from | |
| 32 | - * @param $sNewDisplayColumn Column in table that will be display in list box | |
| 33 | - * @param $sNewValueColumn Column in table that will be assigned to the 'option' attribute | |
| 34 | - * @param $sNewSelectName 'name' attribute of 'select' tab | |
| 35 | - * @param $iNewWidth Width of list box | |
| 33 | + * @param Table in database that information will come from | |
| 34 | + * @param Column in table that will be display in list box | |
| 35 | + * @param Column in table that will be assigned to the 'option' attribute | |
| 36 | + * @param 'name' attribute of 'select' tab | |
| 37 | + * @param Where clause | |
| 36 | 38 | */ |
| 37 | - function PatternListBox($sNewTableName, $sNewDisplayColumn, $sNewValueColumn, $sNewSelectName, $bNewOrderAsc = true) { | |
| 39 | + function PatternListBox($sNewTableName, $sNewDisplayColumn, $sNewValueColumn, $sNewSelectName, $sNewWhereClause = null, $bNewOrderAsc = true) { | |
| 38 | 40 | $this->sTableName = $sNewTableName; |
| 39 | 41 | $this->sDisplayColumn = $sNewDisplayColumn; |
| 40 | 42 | $this->sValueColumn = $sNewValueColumn; |
| 41 | 43 | $this->sSelectName = $sNewSelectName; |
| 44 | + $this->sWhereClause = $sNewWhereClause; | |
| 42 | 45 | $this->bOrderAsc = $bNewOrderAsc; |
| 43 | 46 | } |
| 44 | 47 | |
| ... | ... | @@ -50,7 +53,13 @@ class PatternListBox { |
| 50 | 53 | */ |
| 51 | 54 | function & render() { |
| 52 | 55 | $sql = new Owl_DB(); |
| 53 | - $sql->query("SELECT DISTINCT $this->sDisplayColumn AS display, $this->sValueColumn AS value FROM $this->sTableName ORDER BY $this->sDisplayColumn " . ($this->bOrderAsc ? "ASC" : "DESC")); | |
| 56 | + $sQuery = "SELECT DISTINCT $this->sDisplayColumn AS display, $this->sValueColumn AS value FROM $this->sTableName "; | |
| 57 | + if (isset($this->sWhereClause)) { | |
| 58 | + $sQuery .= "WHERE " . $this->sWhereClause . " "; | |
| 59 | + } | |
| 60 | + | |
| 61 | + $sQuery .= "ORDER BY $this->sDisplayColumn " . ($this->bOrderAsc ? "ASC" : "DESC"); | |
| 62 | + $sql->query($sQuery); | |
| 54 | 63 | $sToRender = "<SELECT NAME = \"$this->sSelectName\">\n"; |
| 55 | 64 | while ($sql->next_record()) { |
| 56 | 65 | $sToRender .= "<OPTION value=\"" . $sql->f("value") . "\">" . $sql->f("display") . "</OPTION>\n"; | ... | ... |