|
Line 0
Link Here
|
|
|
1 |
[% USE raw %] |
| 2 |
[% USE Asset %] |
| 3 |
[% SET footerjs = 1 %] |
| 4 |
[% USE Branches %] |
| 5 |
[% USE Categories %] |
| 6 |
[% USE KohaDates %] |
| 7 |
[% PROCESS 'html_helpers.inc' %] |
| 8 |
[% PROCESS 'i18n.inc' %] |
| 9 |
[% INCLUDE 'doc-head-open.inc' %] |
| 10 |
[% FILTER collapse %] |
| 11 |
<title>[% t("Restore deleted patrons") | html %] › [% t("Tools") | html %] › [% t("Koha") | html %]</title> |
| 12 |
[% END %] |
| 13 |
[% INCLUDE 'doc-head-close.inc' %] |
| 14 |
</head> |
| 15 |
|
| 16 |
<body id="tools_restore_deleted_borrowers" class="tools"> |
| 17 |
[% WRAPPER 'header.inc' %] |
| 18 |
[% INCLUDE 'patron-search-header.inc' %] |
| 19 |
[% END %] |
| 20 |
[% WRAPPER 'sub-header.inc' %] |
| 21 |
[% WRAPPER breadcrumbs %] |
| 22 |
[% WRAPPER breadcrumb_item %] |
| 23 |
<a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> |
| 24 |
[% END %] |
| 25 |
[% IF ( view == 'restored' ) %] |
| 26 |
[% WRAPPER breadcrumb_item %] |
| 27 |
<a href="/cgi-bin/koha/tools/restore_deleted_borrowers.pl">Restore deleted patrons</a> |
| 28 |
[% END %] |
| 29 |
[% WRAPPER breadcrumb_item bc_active=1 %] |
| 30 |
<span>Restored patrons</span> |
| 31 |
[% END %] |
| 32 |
[% ELSE %] |
| 33 |
[% WRAPPER breadcrumb_item bc_active=1 %] |
| 34 |
<span>Restore deleted patrons</span> |
| 35 |
[% END %] |
| 36 |
[% END %] |
| 37 |
[% END #/ WRAPPER breadcrumbs %] |
| 38 |
[% END #/ WRAPPER sub-header.inc %] |
| 39 |
|
| 40 |
<div class="main container-fluid"> |
| 41 |
<div class="row"> |
| 42 |
<div class="col-sm-10 col-sm-push-2 order-sm-1"> |
| 43 |
<main> |
| 44 |
[% IF view == "search" %] |
| 45 |
<h1>Restore deleted patrons</h1> |
| 46 |
|
| 47 |
<div id="search_deleted_borrowers"> |
| 48 |
<form method="get" action="/cgi-bin/koha/tools/restore_deleted_borrowers.pl" id="search_form"> |
| 49 |
<fieldset class="rows"> |
| 50 |
<legend>Search for deleted patrons:</legend> |
| 51 |
<ol> |
| 52 |
<li> |
| 53 |
<label for="cardnumber">Cardnumber:</label> |
| 54 |
<input type="text" id="cardnumber" name="cardnumber" value="[% cardnumber | html %]" /> |
| 55 |
</li> |
| 56 |
<li> |
| 57 |
<label for="borrowernumber">Borrowernumber:</label> |
| 58 |
<input type="text" id="borrowernumber" name="borrowernumber" value="[% borrowernumber | html %]" /> |
| 59 |
</li> |
| 60 |
<li> |
| 61 |
<label for="firstname">First name:</label> |
| 62 |
<input type="text" id="firstname" name="firstname" value="[% firstname | html %]" /> |
| 63 |
</li> |
| 64 |
<li> |
| 65 |
<label for="surname">Surname:</label> |
| 66 |
<input type="text" id="surname" name="surname" value="[% surname | html %]" /> |
| 67 |
</li> |
| 68 |
<li> |
| 69 |
<label for="categorycode">Patron category:</label> |
| 70 |
<select name="categorycode" id="categorycode"> |
| 71 |
<option value="">All categories</option> |
| 72 |
[% FOREACH cat IN Categories.all() %] |
| 73 |
<option value="[% cat.categorycode | html %]"> [% cat.description | html %] </option> |
| 74 |
[% END %] |
| 75 |
</select> |
| 76 |
</li> |
| 77 |
<li> |
| 78 |
<label for="branchcode">Library:</label> |
| 79 |
<select name="branchcode" id="branchcode"> |
| 80 |
<option value="">All libraries</option> |
| 81 |
[% PROCESS options_for_libraries libraries => Branches.all() %] |
| 82 |
</select> |
| 83 |
</li> |
| 84 |
</ol> |
| 85 |
</fieldset> |
| 86 |
<fieldset class="action"> |
| 87 |
<input type="hidden" name="op" value="search" /> |
| 88 |
<input type="submit" class="btn btn-primary" value="Search" /> |
| 89 |
</fieldset> |
| 90 |
</form> |
| 91 |
</div> |
| 92 |
[% ELSIF view == "results" %] |
| 93 |
<h1>Restore deleted patrons</h1> |
| 94 |
|
| 95 |
[% IF deleted_patrons.size > 0 %] |
| 96 |
<div id="results_wrapper" class="page-section"> |
| 97 |
<h3>Deleted patrons found: [% deleted_patrons.size | html %]</h3> |
| 98 |
|
| 99 |
<form method="post" action="/cgi-bin/koha/tools/restore_deleted_borrowers.pl" id="restore_form"> |
| 100 |
[% INCLUDE 'csrf-token.inc' %] |
| 101 |
<input type="hidden" name="op" value="cud-restore" /> |
| 102 |
|
| 103 |
<table id="deleted_patrons_table"> |
| 104 |
<thead> |
| 105 |
<tr> |
| 106 |
<th><input type="checkbox" id="select_all" /></th> |
| 107 |
<th>Card number</th> |
| 108 |
<th>Borrowernumber</th> |
| 109 |
<th>Surname</th> |
| 110 |
<th>First name</th> |
| 111 |
<th>Category</th> |
| 112 |
<th>Library</th> |
| 113 |
<th>Date deleted</th> |
| 114 |
</tr> |
| 115 |
</thead> |
| 116 |
<tbody> |
| 117 |
[% FOREACH patron IN deleted_patrons %] |
| 118 |
<tr> |
| 119 |
<td> |
| 120 |
<input type="checkbox" name="borrowernumber" value="[% patron.borrowernumber | html %]" /> |
| 121 |
</td> |
| 122 |
<td>[% patron.cardnumber | html %]</td> |
| 123 |
<td>[% patron.borrowernumber | html %]</td> |
| 124 |
<td>[% patron.surname | html %]</td> |
| 125 |
<td>[% patron.firstname | html %]</td> |
| 126 |
<td>[% patron.category.description | html %]</td> |
| 127 |
<td>[% patron.library.branchname | html %]</td> |
| 128 |
<td>[% patron.updated_on | $KohaDates %]</td> |
| 129 |
</tr> |
| 130 |
[% END %] |
| 131 |
</tbody> |
| 132 |
</table> |
| 133 |
|
| 134 |
<fieldset class="action"> |
| 135 |
<input type="submit" class="btn btn-primary" value="Restore selected patrons" id="restore_button" /> |
| 136 |
</fieldset> |
| 137 |
</form> |
| 138 |
</div> |
| 139 |
[% ELSE %] |
| 140 |
<div class="dialog message"> No deleted patrons found matching your search criteria. </div> |
| 141 |
<fieldset class="action"> |
| 142 |
<a class="btn btn-default" href="/cgi-bin/koha/tools/restore_deleted_borrowers.pl">New search</a> |
| 143 |
</fieldset> |
| 144 |
[% END %] |
| 145 |
[% ELSIF view == "restored" %] |
| 146 |
<h1>Patrons restored</h1> |
| 147 |
|
| 148 |
[% IF restored_patrons.size > 0 %] |
| 149 |
<div class="dialog message"> |
| 150 |
<p>Successfully restored [% restored_patrons.size | html %] patron(s).</p> |
| 151 |
</div> |
| 152 |
|
| 153 |
<div id="restored_results" class="page-section"> |
| 154 |
<table id="restored_patrons_table"> |
| 155 |
<thead> |
| 156 |
<tr> |
| 157 |
<th>Card number</th> |
| 158 |
<th>Borrowernumber</th> |
| 159 |
<th>Name</th> |
| 160 |
<th>Category</th> |
| 161 |
<th>Library</th> |
| 162 |
<th>Actions</th> |
| 163 |
</tr> |
| 164 |
</thead> |
| 165 |
<tbody> |
| 166 |
[% FOREACH patron IN restored_patrons %] |
| 167 |
<tr> |
| 168 |
<td>[% patron.cardnumber | html %]</td> |
| 169 |
<td>[% patron.borrowernumber | html %]</td> |
| 170 |
<td>[% patron.firstname | html %] [% patron.surname | html %]</td> |
| 171 |
<td>[% patron.category.description | html %]</td> |
| 172 |
<td>[% patron.library.branchname | html %]</td> |
| 173 |
<td> |
| 174 |
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-xs"> <i class="fa fa-user"></i> View patron </a> |
| 175 |
</td> |
| 176 |
</tr> |
| 177 |
[% END %] |
| 178 |
</tbody> |
| 179 |
</table> |
| 180 |
</div> |
| 181 |
[% END %] |
| 182 |
|
| 183 |
[% IF errors.size > 0 %] |
| 184 |
<div class="dialog alert"> |
| 185 |
<h3>Errors occurred:</h3> |
| 186 |
<ul> |
| 187 |
[% FOREACH error IN errors %] |
| 188 |
<li>[% error | html %]</li> |
| 189 |
[% END %] |
| 190 |
</ul> |
| 191 |
</div> |
| 192 |
[% END %] |
| 193 |
|
| 194 |
<fieldset class="action"> |
| 195 |
<a class="btn btn-default" href="/cgi-bin/koha/tools/restore_deleted_borrowers.pl">Restore more patrons</a> |
| 196 |
</fieldset> |
| 197 |
[% END %] |
| 198 |
</main> |
| 199 |
</div> |
| 200 |
<!-- /.col-sm-10.col-sm-push-2 --> |
| 201 |
|
| 202 |
<div class="col-sm-2 col-sm-pull-10"> |
| 203 |
<aside> [% INCLUDE 'tools-menu.inc' %] </aside> |
| 204 |
</div> |
| 205 |
<!-- /.col-sm-2.col-sm-pull-10 --> |
| 206 |
</div> |
| 207 |
<!-- /.row --> |
| 208 |
</div> |
| 209 |
<!-- /.main.container-fluid --> |
| 210 |
|
| 211 |
[% MACRO jsinclude BLOCK %] |
| 212 |
[% Asset.js("js/tools-menu.js") | $raw %] |
| 213 |
[% INCLUDE 'datatables.inc' %] |
| 214 |
<script> |
| 215 |
$(document).ready(function() { |
| 216 |
// Select all checkbox functionality |
| 217 |
$("#select_all").on("click", function() { |
| 218 |
$("#deleted_patrons_table tbody input[type='checkbox']").prop('checked', this.checked); |
| 219 |
}); |
| 220 |
|
| 221 |
// Initialize #deleted_patrons_table table |
| 222 |
[% IF view == "results" && deleted_patrons.size > 0 %] |
| 223 |
$("#deleted_patrons_table").kohaTable({ |
| 224 |
"paging": true, |
| 225 |
"order": [[1, 'asc']] |
| 226 |
}); |
| 227 |
[% END %] |
| 228 |
|
| 229 |
// Initialize #restored_patrons_table table |
| 230 |
[% IF view == "restored" && restored_patrons.size > 0 %] |
| 231 |
$("#restored_patrons_table").kohaTable({ |
| 232 |
"paging": true, |
| 233 |
"order": [[1, 'asc']] |
| 234 |
}); |
| 235 |
[% END %] |
| 236 |
|
| 237 |
}); |
| 238 |
</script> |
| 239 |
[% END %] |
| 240 |
|
| 241 |
[% INCLUDE 'intranet-bottom.inc' %] |