- do not instanciate class LetoDMS_Email, it is done globaly

- send notification only if name has changed
This commit is contained in:
steinm 2010-11-18 14:37:55 +00:00
parent 0d695f57d6
commit d9f7bb09bc

View File

@ -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) {