* @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 DocumentAccess 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_DocumentAccess extends SeedDMS_Theme_Style {
function printAccessModeSelection($defMode) { /* {{{ */
echo self::getAccessModeSelection($defMode);
} /* }}} */
function getAccessModeSelection($defMode) { /* {{{ */
$content = "\n";
return $content;
} /* }}} */
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'];
$document = $this->params['document'];
$folder = $this->params['folder'];
$allUsers = $this->params['allusers'];
$allGroups = $this->params['allgroups'];
$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_document_access"));
$this->rowStart();
$this->columnStart(4);
if ($user->isAdmin()) {
?>
contentHeading(getMLText("access_inheritance"));
if ($document->inheritsAccess()) {
$this->infoMsg(getMLText("inherits_access_msg"));
?>
columnEnd();
$this->rowEnd();
$this->contentEnd();
$this->htmlEndPage();
return;
}
?>
columnEnd();
$this->columnStart(4);
$accessList = $document->getAccessList();
?>
columnEnd();
$this->columnStart(4);
/* memorize users with access rights */
$memusers = array();
/* memorize groups with access rights */
$memgroups = array();
if (count($accessList["users"]) != 0 || count($accessList["groups"]) != 0) {
print "";
foreach ($accessList["users"] as $userAccess) {
$userObj = $userAccess->getUser();
$memusers[] = $userObj->getID();
print "\n";
print " | \n";
print "". htmlspecialchars($userObj->getFullName()) . " | \n";
print "\n";
print "\n";
print "
\n";
}
foreach ($accessList["groups"] as $groupAccess) {
$groupObj = $groupAccess->getGroup();
$memgroups[] = $groupObj->getID();
$mode = $groupAccess->getMode();
print "";
print " | ";
print "". htmlspecialchars($groupObj->getName()) . " | ";
print "";
print "
\n";
}
print "
";
}
$this->columnEnd();
$this->rowEnd();
$this->contentEnd();
$this->htmlEndPage();
} /* }}} */
}
?>