* @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"); /** * Include class to preview documents */ require_once("SeedDMS/Preview.php"); /** * Class which outputs the html page for GroupMgr 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_GroupMgr extends SeedDMS_Theme_Style { function js() { /* {{{ */ $selgroup = $this->params['selgroup']; $strictformcheck = $this->params['strictformcheck']; header('Content-Type: application/javascript; charset=UTF-8'); ?> function checkForm1() { msg = new Array(); if($("#name").val() == "") msg.push(""); if($("#comment").val() == "") msg.push(""); if (msg != "") { noty({ text: msg.join('
'), type: 'error', dismissQueue: true, layout: 'topRight', theme: 'defaultTheme', _timeout: 1500, }); return false; } else return true; } function checkForm2() { msg = ""; if($("#userid").val() == -1) msg += "\n"; if (msg != "") { noty({ text: msg, type: 'error', dismissQueue: true, layout: 'topRight', theme: 'defaultTheme', _timeout: 1500, }); return false; } else return true; } $(document).ready( function() { $('body').on('submit', '#form_1', function(ev){ if(checkForm1()) return; ev.preventDefault(); }); $('body').on('submit', '#form_2', function(ev){ if(checkForm2()) return; ev.preventDefault(); }); $( "#selector" ).change(function() { $('div.ajax').trigger('update', {groupid: $(this).val()}); window.history.pushState({"html":"","pageTitle":""},"", '../out/out.GroupMgr.php?groupid=' + $(this).val()); }); }); params['dms']; $selgroup = $this->params['selgroup']; $cachedir = $this->params['cachedir']; $previewwidth = $this->params['previewWidthList']; $workflowmode = $this->params['workflowmode']; $timeout = $this->params['timeout']; $xsendfile = $this->params['xsendfile']; if($selgroup) { $previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout, $xsendfile); $this->contentHeading(getMLText("group_info")); echo "\n"; if($workflowmode == "traditional") { $reviewstatus = $selgroup->getReviewStatus(); $i = 0; foreach($reviewstatus as $rv) { if($rv['status'] == 0) { $i++; } } echo ""; } if($workflowmode == "traditional" || $workflowmode == 'traditional_only_approval') { $approvalstatus = $selgroup->getApprovalStatus(); $i = 0; foreach($approvalstatus as $rv) { if($rv['status'] == 0) { $i++; } } echo ""; } if($workflowmode == 'advanced') { $workflowStatus = $selgroup->getWorkflowStatus(); if($workflowStatus) echo "\n"; } echo "
".getMLText('pending_reviews')."".$i."
".getMLText('pending_approvals')."".$i."
".getMLText('pending_workflows')."".count($workflowStatus)."
"; } } /* }}} */ function actionmenu() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $selgroup = $this->params['selgroup']; if($selgroup) { $button = array( 'label'=>getMLText('action'), 'menuitems'=>array( ) ); $button['menuitems'][] = array('label'=>' '.getMLText("rm_group"), 'link'=>'../out/out.RemoveGroup.php?groupid='.$selgroup->getID()); if($selgroup->getUsers()) $button['menuitems'][] = array('label'=>' '.getMLText("export_user_list_csv"), 'link'=>'../op/op.UserListCsv.php?groupid='.$selgroup->getID()); self::showButtonwithMenu($button); } } /* }}} */ function showGroupForm($group) { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $allUsers = $this->params['allusers']; $groups = $this->params['allgroups']; ?>
formField( getMLText("name"), array( 'element'=>'input', 'type'=>'text', 'id'=>'name', 'name'=>'name', 'value'=>($group ? htmlspecialchars($group->getName()) : '') ) ); $this->formField( getMLText("comment"), array( 'element'=>'textarea', 'id'=>'comment', 'name'=>'comment', 'rows'=>4, 'value'=>($group ? htmlspecialchars($group->getComment()) : '') ) ); $this->formSubmit(" ".getMLText('save')); ?>
contentSubHeading(getMLText("group_members")); ?> getUsers(); if (count($members) == 0) print ""; else { foreach ($members as $member) { print ""; print ""; print ""; print ""; print ""; } } ?>
".getMLText("no_group_members")."
" . htmlspecialchars($member->getFullName()) . "" . ($group->isMember($member,true)?getMLText("manager"):" ") . ""; print "
getID()."\" />getID()."\" />".createHiddenFieldWithKey('rmmember')."
"; print " "; print "
getID()."\" />getID()."\" />".createHiddenFieldWithKey('tmanager')."
"; print "
contentSubHeading(getMLText("add_member")); ?>
getAllUsers($sortusersinlist); foreach ($allUsers as $currUser) { if (!$group->isMember($currUser)) $options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin().' - '.$currUser->getFullName()), ($currUser->getID()==$user->getID()), array(array('data-subtitle', htmlspecialchars($currUser->getEmail())))); } $this->formField( getMLText("user"), array( 'element'=>'select', 'id'=>'userid', 'name'=>'userid', 'class'=>'chzn-select', 'options'=>$options ) ); $this->formField( getMLText("manager"), array( 'element'=>'input', 'type'=>'checkbox', 'name'=>'manager', 'value'=>1 ) ); $this->formSubmit(" ".getMLText('add')); ?>
params['selgroup']; $this->showGroupForm($selgroup); } /* }}} */ function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $selgroup = $this->params['selgroup']; $allUsers = $this->params['allusers']; $allGroups = $this->params['allgroups']; $strictformcheck = $this->params['strictformcheck']; $this->htmlStartPage(getMLText("admin_tools")); $this->globalNavigation(); $this->contentStart(); $this->pageNavigation(getMLText("admin_tools"), "admin_tools"); $this->contentHeading(getMLText("group_management")); $this->rowStart(); $this->columnStart(4); ?>
getID(), htmlspecialchars($group->getName()), $selgroup && $group->getID()==$selgroup->getID()); } $this->formField( null, //getMLText("selection"), array( 'element'=>'select', 'id'=>'selector', 'class'=>'chzn-select', 'options'=>$options, 'placeholder'=>getMLText('select_groups'), ) ); ?>
getID()."\"" : "") ?>>
getID()."\"" : "") ?>>
columnEnd(); $this->columnStart(8); $this->contentContainerStart(); ?>
getID()."\"" : "") ?>>
contentContainerEnd(); $this->columnEnd(); $this->rowEnd(); $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ } ?>