- 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")); 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"]); $name = sanitizeString($_POST["name"]);
$comment = sanitizeString($_POST["comment"]); $comment = sanitizeString($_POST["comment"]);
$keywords = sanitizeString($_POST["keywords"]); $keywords = sanitizeString($_POST["keywords"]);
@ -61,7 +55,7 @@ if (!is_numeric($sequence)) {
$sequence="keep"; $sequence="keep";
} }
if (($oldname = $document->getName()) == $name) { if (($oldname = $document->getName()) != $name) {
if($document->setName($name)) { if($document->setName($name)) {
// Send notification to subscribers. // Send notification to subscribers.
$document->getNotifyList(); $document->getNotifyList();
@ -90,10 +84,10 @@ if (($oldname = $document->getName()) == $name) {
} }
} }
}
else { else {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
} }
}
if (($oldcomment = $document->getComment()) != $comment) { if (($oldcomment = $document->getComment()) != $comment) {
if($document->setComment($comment)) { if($document->setComment($comment)) {