Commit 310f885c2a49fe5fcaf9d8b0cc3dbaa35d534807
1 parent
f03e5e0f
Comment updates
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@194 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
3 additions
and
1 deletions
lib/foldermanagement/FolderManagemer.inc
| @@ -28,6 +28,7 @@ class FolderManager { | @@ -28,6 +28,7 @@ class FolderManager { | ||
| 28 | */ | 28 | */ |
| 29 | function insertFolder($sName, $sDescription, $iParentID, $iCreatorID, $iDocumentTypeID, $iUnitID, $bIsPublic = false) { | 29 | function insertFolder($sName, $sDescription, $iParentID, $iCreatorID, $iDocumentTypeID, $iUnitID, $bIsPublic = false) { |
| 30 | global $default, $lang_err_database; | 30 | global $default, $lang_err_database; |
| 31 | + //if the folder doesn't exist | ||
| 31 | if (!(FolderNamager::folderExistsName($sName, $iParentID)) { | 32 | if (!(FolderNamager::folderExistsName($sName, $iParentID)) { |
| 32 | $sql = new Owl_DB(); | 33 | $sql = new Owl_DB(); |
| 33 | $result = $sql->query("INSERT INTO " . $default->owl_folders_table . " (name, description, parent_id, creator_id, document_type_id, unit_id, is_public) " . | 34 | $result = $sql->query("INSERT INTO " . $default->owl_folders_table . " (name, description, parent_id, creator_id, document_type_id, unit_id, is_public) " . |
| @@ -51,7 +52,8 @@ class FolderManager { | @@ -51,7 +52,8 @@ class FolderManager { | ||
| 51 | * @return true on successfuly deletion, false otherwise and set $_SESSION["errorMessage"] | 52 | * @return true on successfuly deletion, false otherwise and set $_SESSION["errorMessage"] |
| 52 | */ | 53 | */ |
| 53 | function deleteFolder($iFolderID) { | 54 | function deleteFolder($iFolderID) { |
| 54 | - global $default, | 55 | + global $default,$lang_err_folder_not_exist; |
| 56 | + //if the folder exists | ||
| 55 | if (folderExistsID($iFolderID)) { | 57 | if (folderExistsID($iFolderID)) { |
| 56 | $sql = new Owl_DB(); | 58 | $sql = new Owl_DB(); |
| 57 | $result = $sql->query("DELETE FROM " . $default->owl_folders_table . " WHERE id = " . $iFolderID); | 59 | $result = $sql->query("DELETE FROM " . $default->owl_folders_table . " WHERE id = " . $iFolderID); |