From d9f7bb09bcecc37d05c6775d1e68cd432fd95b85 Mon Sep 17 00:00:00 2001 From: steinm Date: Thu, 18 Nov 2010 14:37:55 +0000 Subject: [PATCH] - do not instanciate class LetoDMS_Email, it is done globaly - send notification only if name has changed --- op/op.EditDocument.php | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/op/op.EditDocument.php b/op/op.EditDocument.php index cfa09574c..953bbf48b 100644 --- a/op/op.EditDocument.php +++ b/op/op.EditDocument.php @@ -47,12 +47,6 @@ if ($document->getAccessMode($user) < M_READWRITE) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); } -/* Create a notify object which is used to notify reporters, owners, etc. - * about changes on documents and folders - */ -$notifier = new LetoDMS_Email(); -$notifier->setSender($user); - $name = sanitizeString($_POST["name"]); $comment = sanitizeString($_POST["comment"]); $keywords = sanitizeString($_POST["keywords"]); @@ -61,7 +55,7 @@ if (!is_numeric($sequence)) { $sequence="keep"; } -if (($oldname = $document->getName()) == $name) { +if (($oldname = $document->getName()) != $name) { if($document->setName($name)) { // Send notification to subscribers. $document->getNotifyList(); @@ -90,9 +84,9 @@ if (($oldname = $document->getName()) == $name) { } } -} -else { - UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); + else { + UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); + } } if (($oldcomment = $document->getComment()) != $comment) {