1 [% PROCESS 'permissions.inc' %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Patrons › Set permissions for [% surname %], [% firstname %]</title>
4 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/treeview/jquery.treeview.css"/>
5 [% INCLUDE 'doc-head-close.inc' %]
6 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.treeview.pack.js"></script>
8 <script type="text/javascript">
9 $(document).ready(function() {
10 $("#permissionstree").treeview({animated: "fast", collapsed: true});
12 // Enforce Superlibrarian Privilege Mutual Exclusivity
13 if($('input[id="flag-0"]:checked').length){
14 if ($('input[name="flag"]:checked').length > 1){
15 alert(_("Inconsistency detected! The superlibrarian privilege is mutually exclusive of other privileges, as it includes them all. This patron's privileges will now be reset to include only superlibrarian."));
18 $('input[name="flag"]').each(function() {
19 if($(this).attr('id') != "flag-0"){
20 $(this).prop('disabled', true);
21 $(this).prop('checked', false);
26 $('input#flag-0').click(function() {
27 if($('input[id="flag-0"]:checked').length){
28 $('input[name="flag"]').each(function() {
29 if($(this).attr('id') != "flag-0"){
30 $(this).prop('disabled', true);
31 $(this).prop('checked', false);
36 $('input[name="flag"]').each(function() {
37 $(this).prop('disabled', false);
42 $(".flag").on("change",function(){
43 if( $(this).hasClass("parent") ){
52 // manage checking/unchecking parent permissions
53 var originalChildStates = {}; /* keep track of subpermission checkbox values
54 so that user can recover from accidentally
55 toggling a parent/module permission */
56 function selectChildren(parentInput) {
57 var childListId = parentInput.id + '-children';
58 var list = document.getElementById(childListId);
61 var inputs = list.getElementsByTagName('input');
62 for (var i = 0; i < inputs.length; i++) {
63 if (inputs[i].type == 'checkbox') {
64 children.push(inputs[i]);
72 function toggleChildren(parentInput) {
73 var children = selectChildren(parentInput);
74 if (children.length == 0) {
77 var checked = parentInput.checked;
78 if (checked && parentInput.parentNode.className == 'expandable') {
80 $(".hitarea", parentInput.parentNode).click();
82 for (var i = 0; i < children.length; i++) {
84 originalChildStates[children[i].id] = children[i].checked;
85 children[i].checked = checked;
87 if (children[i].id in originalChildStates) {
88 children[i].checked = originalChildStates[children[i].id];
90 children[i].checked = checked;
96 function toggleParent(childInput) {
97 originalChildStates[childInput.id] = childInput.checked;
98 if (childInput.checked) {
101 var parentId = childInput.parentNode.parentNode.id.replace(/-children$/, '');;
102 var parentInput = document.getElementById(parentId);
104 parentInput.checked = false;
110 <body id="pat_member-flags" class="pat">
111 [% INCLUDE 'header.inc' %]
112 [% INCLUDE 'patron-search.inc' %]
114 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Set permissions for [% surname %], [% firstname %]</div>
116 <div id="doc3" class="yui-t2">
121 [% INCLUDE 'members-toolbar.inc' %]
123 <form method="post" action="/cgi-bin/koha/members/member-flags.pl">
124 <input type="hidden" name="member" id="borrowernumber" value="[% borrowernumber %]" />
125 <input type="hidden" name="newflags" value="1" />
126 <h1>Set permissions for [% surname %], [% firstname %]</h1>
127 <!-- <ul id="permissionstree"><li class="root">All privileges<ul> -->
128 <ul id="permissionstree" class="treeview-grey">
129 <!-- <li class="folder-close">One level down<ul> -->
130 [% FOREACH loo IN loop %]
131 [% IF ( loo.expand ) %]
136 [% IF ( loo.checked ) %]
137 <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" checked="checked" />
139 <input type="checkbox" class="flag parent" id="flag-[% loo.bit %]" name="flag" value="[% loo.flag %]" />
141 <label class="permissioncode" for="flag-[% loo.bit %]">[% loo.flag %]</label>
142 <span class="permissiondesc">[% PROCESS main_permissions name=loo.flag %]</span>
143 [% IF ( loo.sub_perm_loop ) %]
144 <ul id="flag-[% loo.bit %]-children">
145 [% FOREACH sub_perm_loo IN loo.sub_perm_loop %]
147 [% IF ( sub_perm_loo.checked ) %]
148 <input type="checkbox" class="flag child" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" checked="checked" />
150 <input type="checkbox" class="flag child" id="[% sub_perm_loo.id %]" name="flag" value="[% sub_perm_loo.perm %]" />
152 <label class="permissioncode" for="[% sub_perm_loo.id %]">[% sub_perm_loo.code %]</label>
153 <span class="permissiondesc">[% PROCESS sub_permissions name=sub_perm_loo.code %]</span>
163 <!-- </ul></li></ul> -->
166 <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
173 [% INCLUDE 'circ-menu.inc' %]
176 [% INCLUDE 'intranet-bottom.inc' %]