mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
- do not instanciate class LetoDMS_Email, it is done globaly
- send notification only if name has changed
This commit is contained in:
parent
0d695f57d6
commit
d9f7bb09bc
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user