|
Line 0
Link Here
|
| 0 |
- |
1 |
[% INCLUDE 'doc-head-open.inc' %] |
|
|
2 |
<title>Koha › Administration › Library groups</title> |
| 3 |
[% INCLUDE 'doc-head-close.inc' %] |
| 4 |
<script type="text/javascript" src="[% interface %]/lib/jquery-treegrid/js/jquery.treegrid.min.js"></script> |
| 5 |
<script type="text/javascript" src="[% interface %]/lib/jquery-treegrid/js/jquery.treegrid.bootstrap2.js"></script> |
| 6 |
<link rel="stylesheet" href="[% interface %]/lib/jquery-treegrid/css/jquery.treegrid.css"> |
| 7 |
<script type="text/javascript"> |
| 8 |
//<![CDATA[ |
| 9 |
$(document).ready(function() { |
| 10 |
$('#library-groups').treegrid( |
| 11 |
{ |
| 12 |
'saveState': true |
| 13 |
} |
| 14 |
); |
| 15 |
}); |
| 16 |
|
| 17 |
function add_group( parent_id ) { |
| 18 |
$('#add-group-modal-parent-id').val( parent_id ); |
| 19 |
|
| 20 |
$('#add-group-modal-description').val(""); |
| 21 |
$('#add-group-modal-title').val(""); |
| 22 |
|
| 23 |
$('#add-group-modal').on('shown', function() { |
| 24 |
$('#add-group-modal-title').focus(); |
| 25 |
}); |
| 26 |
|
| 27 |
$('#add-group-modal').modal('show'); |
| 28 |
} |
| 29 |
|
| 30 |
function edit_group( id, title, description ) { |
| 31 |
$('#edit-group-modal-id').val( id ); |
| 32 |
$('#edit-group-modal-title').val( title ); |
| 33 |
$('#edit-group-modal-description').val( description ); |
| 34 |
|
| 35 |
$('#edit-group-modal').on('shown', function() { |
| 36 |
$('#edit-group-modal-title').focus(); |
| 37 |
}); |
| 38 |
|
| 39 |
$('#edit-group-modal').modal('show'); |
| 40 |
} |
| 41 |
|
| 42 |
function remove_library( id ) { |
| 43 |
$('#remove-library-modal-id').val( id ); |
| 44 |
$('#remove-library-modal').modal('show'); |
| 45 |
} |
| 46 |
|
| 47 |
function delete_group( id ) { |
| 48 |
$('#delete-group-modal-id').val( id ); |
| 49 |
$('#delete-group-modal').modal('show'); |
| 50 |
} |
| 51 |
//]]> |
| 52 |
</script> |
| 53 |
</head> |
| 54 |
<body id="admin_library_groups" class="admin"> |
| 55 |
[% INCLUDE 'header.inc' %] |
| 56 |
[% INCLUDE 'cities-admin-search.inc' %] |
| 57 |
|
| 58 |
<div id="breadcrumbs"> |
| 59 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
| 60 |
› <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> |
| 61 |
› <a href="/cgi-bin/koha/admin/library_groups.pl">Library groups</a> |
| 62 |
</div> |
| 63 |
|
| 64 |
[% IF added %] |
| 65 |
<div class="dialog alert group-added"> |
| 66 |
[% IF added.branchcode %] |
| 67 |
<i>[% added.library.branchname %]</i> added to group. |
| 68 |
[% ELSE %] |
| 69 |
Group <i>[% added.title %]</i> created. |
| 70 |
[% END %] |
| 71 |
</div> |
| 72 |
[% ELSIF deleted %] |
| 73 |
<div class="dialog alert group-deleted"> |
| 74 |
[% IF deleted.title %] |
| 75 |
Group <i>[% deleted.title %]</i> has been deleted. |
| 76 |
[% ELSE %] |
| 77 |
<i>[% deleted.library %]</i> has been removed from group. |
| 78 |
[% END %] |
| 79 |
</div> |
| 80 |
[% END %] |
| 81 |
|
| 82 |
<div id="doc3" class="yui-t2"> |
| 83 |
<div id="bd"> |
| 84 |
<div id="yui-main"> |
| 85 |
<div class="yui-b"> |
| 86 |
<div class="yui-g"> |
| 87 |
<div id="toolbar" class="btn-toolbar"> |
| 88 |
<div class="btn-group"> |
| 89 |
<a id="add-group-[% group.id %]" class="btn btn-small" href="#" onclick="add_group()"> |
| 90 |
<i class="fa fa-plus-circle"></i> Add group |
| 91 |
</a> |
| 92 |
</div> |
| 93 |
</div> |
| 94 |
</div> |
| 95 |
|
| 96 |
[% FOREACH root_group IN root_groups %] |
| 97 |
<table id="library-groups" class="tree"> |
| 98 |
<tr> |
| 99 |
<th> </th> |
| 100 |
<th>Description</th> |
| 101 |
<th> </th> |
| 102 |
</tr> |
| 103 |
[% PROCESS tree group=root_group %] |
| 104 |
</table> |
| 105 |
[% END %] |
| 106 |
</div> |
| 107 |
</div> |
| 108 |
|
| 109 |
<div class="yui-b"> |
| 110 |
[% INCLUDE 'admin-menu.inc' %] |
| 111 |
</div> |
| 112 |
|
| 113 |
<div id="add-group-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="add-group-modal-label" aria-hidden="true"> |
| 114 |
<form id="add-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal"> |
| 115 |
<div class="modal-header"> |
| 116 |
<h3 id="add-group-modal-label">Add group</h3> |
| 117 |
</div> |
| 118 |
<div class="modal-body"> |
| 119 |
<input type="hidden" id="add-group-modal-parent-id" name="parent_id" value="" /> |
| 120 |
<input type="hidden" id="add-group-modal-action" name="action" value="add"> |
| 121 |
|
| 122 |
<p> |
| 123 |
<label for="title">Title: </label> |
| 124 |
<input type="text" name="title" id="add-group-modal-title" required="required" /> |
| 125 |
<i>required</i> |
| 126 |
</p> |
| 127 |
|
| 128 |
<p> |
| 129 |
<label for="description">Description: </label> |
| 130 |
<input type="text" name="description" id="add-group-modal-description" /> |
| 131 |
</p> |
| 132 |
</div> |
| 133 |
<div class="modal-footer"> |
| 134 |
<button type="submit" class="btn btn-primary">Save</button> |
| 135 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button> |
| 136 |
</div> |
| 137 |
</form> |
| 138 |
</div> |
| 139 |
|
| 140 |
<div id="edit-group-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="edit-library-modal-label" aria-hidden="true"> |
| 141 |
<form id="edit-group-form" action="/cgi-bin/koha/admin/library_groups.pl" class="form-horizontal"> |
| 142 |
<div class="modal-header"> |
| 143 |
<h3 id="edit-group-modal-label">Edit group</h3> |
| 144 |
</div> |
| 145 |
<div class="modal-body"> |
| 146 |
<input type="hidden" id="edit-group-modal-id" name="id" value="" /> |
| 147 |
<input type="hidden" id="edit-group-modal-action" name="action" value="edit" /> |
| 148 |
|
| 149 |
<p> |
| 150 |
<label for="title">Title: </label> |
| 151 |
<input type="text" id="edit-group-modal-title" name="title" value="" required="required" /> |
| 152 |
<i>required</i> |
| 153 |
</p> |
| 154 |
|
| 155 |
<p> |
| 156 |
<label for="description">Description: </label> |
| 157 |
<input type="text" id="edit-group-modal-description" name="description" value="" /> |
| 158 |
</p> |
| 159 |
</div> |
| 160 |
<div class="modal-footer"> |
| 161 |
<button type="submit" class="btn btn-primary">Update</button> |
| 162 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button> |
| 163 |
</div> |
| 164 |
</form> |
| 165 |
</div> |
| 166 |
|
| 167 |
<div id="delete-group-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="delete-group-modal-label" aria-hidden="true"> |
| 168 |
<form action="/cgi-bin/koha/admin/library_groups.pl" /> |
| 169 |
<input id="delete-group-modal-action" type="hidden" name="action" value="delete" /> |
| 170 |
<input id="delete-group-modal-id" type="hidden" name="id" value="" /> |
| 171 |
<div class="modal-header"> |
| 172 |
<h3 id="delete-group-modal-label">Delete group or library</h3> |
| 173 |
</div> |
| 174 |
<div class="modal-body"> |
| 175 |
Are you sure you want to delete this? |
| 176 |
</div> |
| 177 |
<div class="modal-footer"> |
| 178 |
<button type="submit" class="btn btn-danger"><i class="fa fa-trash"></i> Delete</button> |
| 179 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button> |
| 180 |
</div> |
| 181 |
</form> |
| 182 |
</div> |
| 183 |
|
| 184 |
<div id="remove-library-modal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="remove-library-modal-label" aria-hidden="true"> |
| 185 |
<form action="/cgi-bin/koha/admin/library_groups.pl" /> |
| 186 |
<input id="remove-library-modal-action" type="hidden" name="action" value="delete" /> |
| 187 |
<input id="remove-library-modal-id" type="hidden" name="id" value="" /> |
| 188 |
<div class="modal-header"> |
| 189 |
<h3 id="remove-library-modal-label">Remove library from group</h3> |
| 190 |
</div> |
| 191 |
<div class="modal-body"> |
| 192 |
Are you sure you want to remove this library? |
| 193 |
</div> |
| 194 |
<div class="modal-footer"> |
| 195 |
<button type="submit" class="btn btn-danger"><i class="fa fa-minus-circle"></i> Remove</button> |
| 196 |
<button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button> |
| 197 |
</div> |
| 198 |
</form> |
| 199 |
</div> |
| 200 |
|
| 201 |
</div> |
| 202 |
[% INCLUDE 'intranet-bottom.inc' %] |
| 203 |
|
| 204 |
[% BLOCK tree %] |
| 205 |
<tr class="treegrid-[% group.id %] treegrid-parent-[% group.parent_id %]"> |
| 206 |
<td> |
| 207 |
[% IF group.branchcode %] |
| 208 |
<i class="fa fa-home"></i> [% group.branchcode %] |
| 209 |
[% ELSE %] |
| 210 |
<i class="fa fa-object-group"></i> [% group.title %] |
| 211 |
[% END %] |
| 212 |
</td> |
| 213 |
<td> |
| 214 |
[% IF group.branchcode %] |
| 215 |
[% group.library.branchname %] |
| 216 |
[% ELSE %] |
| 217 |
[% group.description %] |
| 218 |
[% END %] |
| 219 |
</td> |
| 220 |
<td> |
| 221 |
[% IF group.branchcode %] |
| 222 |
<button class="btn btn-small delete-library" onclick="remove_library([% group.id %])"><i class="fa fa-minus-circle"></i> Remove from group</button> |
| 223 |
[% ELSE %] |
| 224 |
<div class="btn-group"> |
| 225 |
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-wrench"></i> Actions <span class="caret"></span></button> |
| 226 |
<ul class="dropdown-menu"> |
| 227 |
<li> |
| 228 |
<a id="add-group-[% group.id %]" href="#" onclick="add_group([% group.id %])"> |
| 229 |
<i class="fa fa-plus-circle"></i> Add sub-group |
| 230 |
</a> |
| 231 |
</li> |
| 232 |
|
| 233 |
<li> |
| 234 |
<a class="delete-group" id="delete-group-[% group.id %]" href="#" onclick="edit_group([% group.id %], '[% group.title | replace('\'', '\\\'') | html %]', '[% group.description | replace('\'', '\\\'') | html %]')"> |
| 235 |
<i class="fa fa-edit"></i> Edit |
| 236 |
</a> |
| 237 |
</li> |
| 238 |
|
| 239 |
<li> |
| 240 |
<a class="delete-group" id="delete-group-[% group.id %]" href="#" onclick="delete_group([% group.id %])"> |
| 241 |
<i class="fa fa-trash"></i> Delete |
| 242 |
</a> |
| 243 |
</li> |
| 244 |
</ul> |
| 245 |
</div> |
| 246 |
|
| 247 |
<div class="btn-group"> |
| 248 |
<button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="fa fa-home"></i> Add library <span class="caret"></span></button> |
| 249 |
<ul class="dropdown-menu"> |
| 250 |
[% FOREACH library IN group.libraries_not_direct_children %] |
| 251 |
<li> |
| 252 |
<a class="add-library" id="add-library-[% group.id %]" href="/cgi-bin/koha/admin/library_groups.pl?action=add&parent_id=[% group.id %]&branchcode=[% library.id %]"> |
| 253 |
[% library.branchname %] |
| 254 |
</a> |
| 255 |
</li> |
| 256 |
[% END %] |
| 257 |
</ul> |
| 258 |
</div> |
| 259 |
[% END %] |
| 260 |
</td> |
| 261 |
</tr> |
| 262 |
|
| 263 |
[% FOREACH g IN group.children %] |
| 264 |
[% PROCESS tree group=g %] |
| 265 |
[% END %] |
| 266 |
[% END %] |