Commit 0d571b5a2f441659e7d5a68a26e4c84ba3c929d5
Merge branch 'edge' of git@github.com:ktgit/knowledgetree into edge
Showing
2 changed files
with
26 additions
and
2 deletions
dmsctl.sh
lib/documentmanagement/DocumentTransaction.inc
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | * KnowledgeTree Community Edition | 9 | * KnowledgeTree Community Edition |
| 10 | * Document Management Made Simple | 10 | * Document Management Made Simple |
| 11 | * Copyright (C) 2008, 2009 KnowledgeTree Inc. | 11 | * Copyright (C) 2008, 2009 KnowledgeTree Inc. |
| 12 | - * | 12 | + * |
| 13 | * | 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify it under | 14 | * This program is free software; you can redistribute it and/or modify it under |
| 15 | * the terms of the GNU General Public License version 3 as published by the | 15 | * the terms of the GNU General Public License version 3 as published by the |
| @@ -59,8 +59,23 @@ class DocumentTransaction extends KTEntity { | @@ -59,8 +59,23 @@ class DocumentTransaction extends KTEntity { | ||
| 59 | var $sFileName; | 59 | var $sFileName; |
| 60 | var $sComment; | 60 | var $sComment; |
| 61 | var $sTransactionNS; | 61 | var $sTransactionNS; |
| 62 | + var $iSessionId; | ||
| 62 | var $bAdminMode = 0; | 63 | var $bAdminMode = 0; |
| 63 | 64 | ||
| 65 | + var $_aFieldToSelect = array( | ||
| 66 | + 'iId' => 'id', | ||
| 67 | + 'iDocumentID' => 'document_id', | ||
| 68 | + 'sVersion' => 'version', | ||
| 69 | + 'iUserID' => 'user_id', | ||
| 70 | + 'dDateTime' => 'datetime', | ||
| 71 | + 'sIP' => 'ip', | ||
| 72 | + 'sFileName' => 'filename', | ||
| 73 | + 'sComment' => 'comment', | ||
| 74 | + 'sTransactionNS' => 'transaction_namespace', | ||
| 75 | + 'iSessionId' => 'session_id', | ||
| 76 | + 'bAdminMode' => 'admin_mode', | ||
| 77 | + ); | ||
| 78 | + | ||
| 64 | /** | 79 | /** |
| 65 | * Constructor | 80 | * Constructor |
| 66 | * | 81 | * |
| @@ -69,10 +84,17 @@ class DocumentTransaction extends KTEntity { | @@ -69,10 +84,17 @@ class DocumentTransaction extends KTEntity { | ||
| 69 | * @param Primary key of transaction type | 84 | * @param Primary key of transaction type |
| 70 | * | 85 | * |
| 71 | */ | 86 | */ |
| 72 | - function DocumentTransaction($oDocument, $sNewComment, $sTransactionNS, $aOptions = null) { | 87 | + function DocumentTransaction($oDocument = null, $sNewComment = null, $sTransactionNS = null, $aOptions = null) { |
| 73 | if (is_null($aOptions)) { | 88 | if (is_null($aOptions)) { |
| 74 | $aOptions = array(); | 89 | $aOptions = array(); |
| 75 | } | 90 | } |
| 91 | + | ||
| 92 | + // class breaks convention and passes the document object into the constructor | ||
| 93 | + // ktentity creates the object to get the sql columns, adding a workaround to exit if the document object is empty | ||
| 94 | + if(empty($oDocument)){ | ||
| 95 | + return ; | ||
| 96 | + } | ||
| 97 | + | ||
| 76 | //object not stored yet, id = -1 | 98 | //object not stored yet, id = -1 |
| 77 | $this->iId = -1; | 99 | $this->iId = -1; |
| 78 | 100 |