* @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ /** * Include parent class */ //require_once("class.Bootstrap.php"); /** * Class which outputs the html page for DocumentNotify view * * @category DMS * @package SeedDMS * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_View_DocumentNotify extends SeedDMS_Theme_Style { function js() { /* {{{ */ header('Content-Type: application/javascript; charset=UTF-8'); ?> function checkForm() { msg = new Array(); if ((document.form1.userid.options[document.form1.userid.selectedIndex].value == -1) && (document.form1.groupid.options[document.form1.groupid.selectedIndex].value == -1)) msg.push(""); if (msg != "") { noty({ text: msg.join('
'), type: 'error', dismissQueue: true, layout: 'topRight', theme: 'defaultTheme', _timeout: 1500, }); return false; } else return true; } $(document).ready( function() { $('body').on('submit', '#form1', function(ev){ if(checkForm()) return; ev.preventDefault(); }); }); params['dms']; $user = $this->params['user']; $folder = $this->params['folder']; $document = $this->params['document']; $sortusersinlist = $this->params['sortusersinlist']; $enableusersview = $this->params['enableusersview']; $notifyList = $document->getNotifyList(0, true); $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); $this->globalNavigation($folder); $this->contentStart(); $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); $this->contentHeading(getMLText("edit_existing_notify")); $userNotifyIDs = array(); foreach ($notifyList["users"] as $userNotify) { $userNotifyIDs[] = $userNotify->getID(); } $groupNotifyIDs = array(); foreach ($notifyList["groups"] as $groupNotify) { $groupNotifyIDs[] = $groupNotify->getID(); } $this->rowStart(); $this->columnStart(6); ?>
isAdmin()) { $allUsers = $dms->getAllUsers($sortusersinlist); foreach ($allUsers as $userObj) { if (!$userObj->isGuest() && !$userObj->isDisabled() && ($document->getAccessMode($userObj) >= M_READ) && !in_array($userObj->getID(), $userNotifyIDs)) $options[] = array($userObj->getID(), htmlspecialchars($userObj->getLogin().' - '.$userObj->getFullName()), false, array(array('data-subtitle', htmlspecialchars($userObj->getEmail())))); } } elseif (!$user->isGuest() && !in_array($user->getID(), $userNotifyIDs)) { $options[] = array($user->getID(), htmlspecialchars($user->getLogin() . " - " .$user->getFullName())); } $this->contentContainerStart(); $this->formField( getMLText("user"), array( 'element'=>'select', 'id'=>'userid', 'name'=>'userid', 'class'=>'chzn-select', 'options'=>$options ) ); $options = array(); $options[] = array('-1', getMLText("select_one")); $allGroups = $dms->getAllGroups(); foreach ($allGroups as $groupObj) { if (($user->isAdmin() || $groupObj->isMember($user,true)) && $document->getGroupAccessMode($groupObj) >= M_READ && !in_array($groupObj->getID(), $groupNotifyIDs)) { $options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName())); } } $this->formField( getMLText("group"), array( 'element'=>'select', 'id'=>'groupid', 'name'=>'groupid', 'class'=>'chzn-select', 'options'=>$options ) ); $this->contentContainerEnd(); $this->formSubmit(getMLText('add')); ?>
columnEnd(); $this->columnStart(6); if ((count($notifyList["users"]) == 0) && (count($notifyList["groups"]) == 0)) { $this->infoMsg(getMLText("empty_notify_list")); } else { print "\n"; foreach ($notifyList["users"] as $userNotify) { if ($user->isAdmin() || /*$enableusersview || */$user->getID() == $userNotify->getID()) { print ""; print ""; print ""; print "\n"; echo createHiddenFieldWithKey('documentnotify')."\n"; print "getID()."\">\n"; print "\n"; print "getID()."\">\n"; print ""; print "\n"; print ""; } } foreach ($notifyList["groups"] as $groupNotify) { /* admins and members of a group may see exiting notifications */ if ($user->isAdmin() || /*$enableusersview || */$groupNotify->isMember($user,false)) { print ""; print ""; print ""; print "\n"; echo createHiddenFieldWithKey('documentnotify')."\n"; print "getID()."\">\n"; print "\n"; print "getID()."\">\n"; print ""; print "\n"; print ""; } } print "
" . htmlspecialchars($userNotify->getLogin() . " - " . $userNotify->getFullName()) . "
"; print ""; print "
" . htmlspecialchars($groupNotify->getName()) . "
"; print ""; print "
\n"; } $this->columnEnd(); $this->rowEnd(); $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ } ?>