Commit 230df98cf66d7c13f6a4a3b5be7091f2dda4af02
1 parent
1f371729
Added functionality to recurse down folder tree and update child paths
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1098 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
9 additions
and
2 deletions
presentation/lookAndFeel/knowledgeTree/store.php
| ... | ... | @@ -10,10 +10,11 @@ |
| 10 | 10 | * @package presentation.lookAndFeel.knowledgeTree.documentmanagement |
| 11 | 11 | */ |
| 12 | 12 | require_once("../../../config/dmsDefaults.php"); |
| 13 | +require_once("$default->fileSystemRoot/lib/documentmanagement/Document.inc"); | |
| 14 | +require_once("$default->fileSystemRoot/lib/foldermanagement/Folder.inc"); | |
| 13 | 15 | |
| 14 | 16 | $aKeys = array_keys($_POST); |
| 15 | - | |
| 16 | - | |
| 17 | +$iPrimaryKey; | |
| 17 | 18 | |
| 18 | 19 | for ($i = 0; $i < count($aKeys); $i++) { |
| 19 | 20 | $sRowStart = $aKeys[$i]; |
| ... | ... | @@ -134,6 +135,7 @@ for ($i = 0; $i < count($aKeys); $i++) { |
| 134 | 135 | //execute the query |
| 135 | 136 | $sql = $default->db; |
| 136 | 137 | $sql->query($sQuery); |
| 138 | + $iPrimaryKey = $sql->insert_id(); | |
| 137 | 139 | } else { |
| 138 | 140 | //perform an update |
| 139 | 141 | $sQuery = "UPDATE $sTableName SET "; |
| ... | ... | @@ -182,6 +184,11 @@ for ($i = 0; $i < count($aKeys); $i++) { |
| 182 | 184 | $sql->query($sQuery); |
| 183 | 185 | } |
| 184 | 186 | |
| 187 | + //need to do some special checks for folders | |
| 188 | + if (strcmp($sTableName, "folders") == 0) { | |
| 189 | + $oFolder = Folder::get($iPrimaryKey); | |
| 190 | + $oFolder->update(true); | |
| 191 | + } | |
| 185 | 192 | } |
| 186 | 193 | } |
| 187 | 194 | redirect(urldecode($fReturnURL)); | ... | ... |