mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
check for duplicate names if this is turn on in the settings
This commit is contained in:
parent
d18a3389bc
commit
7fc98be1be
|
@ -62,6 +62,13 @@ if($document->isLocked()) {
|
|||
}
|
||||
}
|
||||
|
||||
/* Check if name already exists in the folder */
|
||||
if(!$settings->_enableDuplicateDocNames) {
|
||||
if($targetFolder->hasDocumentByName($document->getName())) {
|
||||
UI::exitError(getMLText("folder_title", array("documentname" => htmlspecialchars($document->getName()))),getMLText("document_duplicate_name"));
|
||||
}
|
||||
}
|
||||
|
||||
if ($targetid != $oldFolder->getID()) {
|
||||
if ($document->setFolder($targetFolder)) {
|
||||
// Send notification to subscribers.
|
||||
|
|
|
@ -60,6 +60,13 @@ if ($folder->getAccessMode($user, 'moveFolder') < M_READWRITE || $targetFolder->
|
|||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied"));
|
||||
}
|
||||
|
||||
/* Check if name already exists in the folder */
|
||||
if(!$settings->_enableDuplicateSubFolderNames) {
|
||||
if($targetFolder->hasSubFolderByName($folder->getName())) {
|
||||
UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("subfolder_duplicate_name"));
|
||||
}
|
||||
}
|
||||
|
||||
$oldFolder = $folder->getParent();
|
||||
if ($folder->setParent($targetFolder)) {
|
||||
// Send notification to subscribers.
|
||||
|
|
Loading…
Reference in New Issue
Block a user