getMLText("invalid_folder_id"))),getMLText("invalid_folder_id")); } $targetid = $_GET["targetid"]; $targetFolder = $dms->getFolder($targetid); if (!is_object($targetFolder)) { UI::exitError(getMLText("folder_title", array("foldername" => getMLText("invalid_folder_id"))),getMLText("invalid_folder_id")); } if ($targetFolder->getAccessMode($user) < M_READWRITE) { UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied")); } $clipboard = $session->getClipboard(); foreach($clipboard['docs'] as $documentid) { $document = $dms->getDocument($documentid); if($document) { $oldFolder = $document->getFolder(); if ($document->getAccessMode($user) < M_READWRITE) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); } if ($targetid != $oldFolder->getID()) { if ($document->setFolder($targetFolder)) { // Send notification to subscribers. if($notifier) { $nl1 = $oldFolder->getNotifyList(); $nl2 = $document->getNotifyList(); $nl3 = $targetFolder->getNotifyList(); $nl = array( 'users'=>array_unique(array_merge($nl1['users'], $nl2['users'], $nl3['users']), SORT_REGULAR), 'groups'=>array_unique(array_merge($nl1['groups'], $nl2['groups'], $nl3['groups']), SORT_REGULAR) ); $subject = "document_moved_email_subject"; $message = "document_moved_email_body"; $params = array(); $params['name'] = $document->getName(); $params['old_folder_path'] = $oldFolder->getFolderPathPlain(); $params['new_folder_path'] = $targetFolder->getFolderPathPlain(); $params['username'] = $user->getFullName(); $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(); $params['sitename'] = $settings->_siteName; $params['http_root'] = $settings->_httpRoot; $notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); foreach ($nl["groups"] as $grp) { $notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); } // if user is not owner send notification to owner // if ($user->getID() != $document->getOwner()->getID()) // $notifier->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); } $session->removeFromClipboard($document); } else { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); } } else { $session->removeFromClipboard($document); } } } foreach($clipboard['folders'] as $folderid) { $folder = $dms->getFolder($folderid); if($folder) { if ($folder->getAccessMode($user) < M_READWRITE) { UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("access_denied")); } $oldFolder = $folder->getParent(); if ($folder->setParent($targetFolder)) { // Send notification to subscribers. if($notifier) { $nl1 = $oldFolder->getNotifyList(); $nl2 = $folder->getNotifyList(); $nl3 = $targetFolder->getNotifyList(); $nl = array( 'users'=>array_unique(array_merge($nl1['users'], $nl2['users'], $nl3['users']), SORT_REGULAR), 'groups'=>array_unique(array_merge($nl1['groups'], $nl2['groups'], $nl3['groups']), SORT_REGULAR) ); $subject = "folder_moved_email_subject"; $message = "folder_moved_email_body"; $params = array(); $params['name'] = $folder->getName(); $params['old_folder_path'] = $oldFolder->getFolderPathPlain(); $params['new_folder_path'] = $targetFolder->getFolderPathPlain(); $params['username'] = $user->getFullName(); $params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewFolder.php?folderid=".$folder->getID(); $params['sitename'] = $settings->_siteName; $params['http_root'] = $settings->_httpRoot; $notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); foreach ($nl["groups"] as $grp) { $notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); } // if user is not owner send notification to owner // if ($user->getID() != $folder->getOwner()->getID()) // $notifier->toIndividual($user, $folder->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER); } $session->removeFromClipboard($folder); } else { UI::exitError(getMLText("folder_title", array("foldername" => $folder->getName())),getMLText("error_occured")); } } } $session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_moved_clipboard'))); add_log_line(); if($_GET['refferer']) header("Location:".urldecode($_GET['refferer'])); else header("Location:../out/out.ViewFolder.php?folderid=".$targetid); ?>