|
Lines 1-6
Link Here
|
| 1 |
[% USE Koha %] |
1 |
[% USE Koha %] |
| 2 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
[% INCLUDE 'doc-head-open.inc' %] |
| 3 |
<title>Koha › Tools › Notices[% IF ( add_form ) %][% IF ( modify ) %] › Modify notice[% ELSE %] › Add notice[% END %][% END %][% IF ( add_validate ) %] › Notice added[% END %][% IF ( delete_confirm ) %] › Confirm deletion[% END %]</title> |
3 |
<title>Koha › Tools › Notices[% IF ( add_form or copy_form ) %][% IF ( modify ) %] › Modify notice[% ELSE %] › Add notice[% END %][% END %][% IF ( add_validate or copy_validate) %] › Notice added[% END %][% IF ( delete_confirm ) %] › Confirm deletion[% END %]</title> |
| 4 |
[% INCLUDE 'doc-head-close.inc' %] |
4 |
[% INCLUDE 'doc-head-close.inc' %] |
| 5 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
5 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
| 6 |
[% INCLUDE 'datatables.inc' %] |
6 |
[% INCLUDE 'datatables.inc' %] |
|
Lines 26-32
$(document).ready(function() {
Link Here
|
| 26 |
}); |
26 |
}); |
| 27 |
[% END %] |
27 |
[% END %] |
| 28 |
|
28 |
|
| 29 |
$("#submit").click( function(event) { |
29 |
$("#submit_form").click( function(event) { |
|
|
30 |
event.preventDefault(); |
| 30 |
var at_least_one_exists = 0; |
31 |
var at_least_one_exists = 0; |
| 31 |
$("fieldset.mtt").each( function(){ |
32 |
$("fieldset.mtt").each( function(){ |
| 32 |
var title = $(this).find('input[name="title"]').val(); |
33 |
var title = $(this).find('input[name="title"]').val(); |
|
Lines 40-46
$(document).ready(function() {
Link Here
|
| 40 |
msg = msg.replace( "%s", mtt ); |
41 |
msg = msg.replace( "%s", mtt ); |
| 41 |
at_least_one_exists = 1; |
42 |
at_least_one_exists = 1; |
| 42 |
alert(msg) |
43 |
alert(msg) |
| 43 |
event.preventDefault(); |
|
|
| 44 |
return false; |
44 |
return false; |
| 45 |
} else if ( title.length > 0 && content.length > 0 ) { |
45 |
} else if ( title.length > 0 && content.length > 0 ) { |
| 46 |
at_least_one_exists = 1; |
46 |
at_least_one_exists = 1; |
|
Lines 48-57
$(document).ready(function() {
Link Here
|
| 48 |
} ); |
48 |
} ); |
| 49 |
if ( ! at_least_one_exists ) { |
49 |
if ( ! at_least_one_exists ) { |
| 50 |
alert( _("Please fill at least one template.") ); |
50 |
alert( _("Please fill at least one template.") ); |
| 51 |
event.preventDefault(); |
|
|
| 52 |
return false; |
51 |
return false; |
| 53 |
} |
52 |
} |
| 54 |
return true; |
53 |
|
|
|
54 |
// Test if code already exists in DB |
| 55 |
var new_lettercode = $("#code").val(); |
| 56 |
[% IF copy_form %] |
| 57 |
if ( new_lettercode == '[% code %]' ) { |
| 58 |
alert( _("Please change the code.") ); |
| 59 |
return false; |
| 60 |
} |
| 61 |
[% END %] |
| 62 |
if ( new_lettercode != '[% code %]' ) { |
| 63 |
$.ajax({ |
| 64 |
data: { code: new_lettercode }, |
| 65 |
type: 'GET', |
| 66 |
url: '/cgi-bin/koha/svc/letters/', |
| 67 |
success: function (data) { |
| 68 |
if ( data.letters.length > 0 ) { |
| 69 |
alert( _("This letter code is already used for another letter.") ); |
| 70 |
return false; |
| 71 |
} else { |
| 72 |
$("#add_notice").submit(); |
| 73 |
} |
| 74 |
}, |
| 75 |
}); |
| 76 |
} else { |
| 77 |
$("#add_notice").submit(); |
| 78 |
} |
| 55 |
}); |
79 |
}); |
| 56 |
|
80 |
|
| 57 |
var sms_limit = 160; |
81 |
var sms_limit = 160; |
|
Lines 65-71
$(document).ready(function() {
Link Here
|
| 65 |
} |
89 |
} |
| 66 |
}); |
90 |
}); |
| 67 |
}); |
91 |
}); |
| 68 |
[% IF ( add_form ) %] |
92 |
[% IF add_form or copy_form %] |
| 69 |
|
93 |
|
| 70 |
function cancel(f) { |
94 |
function cancel(f) { |
| 71 |
$('#op').val(""); |
95 |
$('#op').val(""); |
|
Lines 117-125
$(document).ready(function() {
Link Here
|
| 117 |
[% INCLUDE 'header.inc' %] |
141 |
[% INCLUDE 'header.inc' %] |
| 118 |
[% INCLUDE 'letters-search.inc' %] |
142 |
[% INCLUDE 'letters-search.inc' %] |
| 119 |
|
143 |
|
| 120 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF ( add_form ) %][% IF ( modify ) %]<a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Modify notice[% ELSE %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Add notice[% END %][% ELSE %][% IF ( add_validate ) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Notice added[% ELSE %][% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Confirm deletion[% ELSE %]Notices & Slips[% END %][% END %][% END %]</div> |
144 |
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › [% IF ( add_form or copy_form) %][% IF ( modify ) %]<a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Modify notice[% ELSE %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Add notice[% END %][% ELSE %][% IF ( add_validate or copy_validate) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Notice added[% ELSE %][% IF ( delete_confirm ) %] <a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a> › Confirm deletion[% ELSE %]Notices & Slips[% END %][% END %][% END %]</div> |
| 121 |
|
145 |
|
| 122 |
[% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %] |
146 |
[% IF add_form or copy_form %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %] |
| 123 |
|
147 |
|
| 124 |
<div id="bd"> |
148 |
<div id="bd"> |
| 125 |
<div id="yui-main"> |
149 |
<div id="yui-main"> |
|
Lines 182-188
$(document).ready(function() {
Link Here
|
| 182 |
<td style="white-space: nowrap"> |
206 |
<td style="white-space: nowrap"> |
| 183 |
[% IF !independant_branch || !lette.branchcode %] |
207 |
[% IF !independant_branch || !lette.branchcode %] |
| 184 |
<form method="post" action="/cgi-bin/koha/tools/letter.pl"> |
208 |
<form method="post" action="/cgi-bin/koha/tools/letter.pl"> |
| 185 |
<input type="hidden" name="op" value="copy" /> |
209 |
<input type="hidden" name="op" value="copy_form" /> |
| 186 |
<input type="hidden" name="oldbranchcode" value="[% lette.branchcode %]" /> |
210 |
<input type="hidden" name="oldbranchcode" value="[% lette.branchcode %]" /> |
| 187 |
<input type="hidden" name="module" value="[% lette.module %]" /> |
211 |
<input type="hidden" name="module" value="[% lette.module %]" /> |
| 188 |
<input type="hidden" name="code" value="[% lette.code %]" /> |
212 |
<input type="hidden" name="code" value="[% lette.code %]" /> |
|
Lines 221-230
$(document).ready(function() {
Link Here
|
| 221 |
[% END %] |
245 |
[% END %] |
| 222 |
|
246 |
|
| 223 |
|
247 |
|
| 224 |
[% IF ( add_form ) %] |
248 |
[% IF add_form or copy_form %] |
| 225 |
<h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1> |
249 |
<h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1> |
| 226 |
<form name="Aform" method="post" enctype="multipart/form-data" class="validate"> |
250 |
<form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate"> |
| 227 |
<input type="hidden" name="op" id="op" value="add_validate" /> |
251 |
[% IF add_form %] |
|
|
252 |
<input type="hidden" name="op" id="op" value="add_validate" /> |
| 253 |
[% ELSE %] |
| 254 |
<input type="hidden" name="op" id="op" value="copy_validate" /> |
| 255 |
[% END %] |
| 256 |
|
| 228 |
<input type="hidden" name="checked" value="0" /> |
257 |
<input type="hidden" name="checked" value="0" /> |
| 229 |
[% IF ( modify ) %] |
258 |
[% IF ( modify ) %] |
| 230 |
<input type="hidden" name="add" value="0" /> |
259 |
<input type="hidden" name="add" value="0" /> |
|
Lines 232-238
$(document).ready(function() {
Link Here
|
| 232 |
<input type="hidden" name="add" value="1" /> |
261 |
<input type="hidden" name="add" value="1" /> |
| 233 |
[% END %] |
262 |
[% END %] |
| 234 |
<fieldset class="rows"> |
263 |
<fieldset class="rows"> |
| 235 |
<input type="hidden" name="oldbranchcode" value="[% branchcode %]" /> |
264 |
<input type="hidden" name="oldbranchcode" value="[% oldbranchcode %]" /> |
| 236 |
[% IF independant_branch %] |
265 |
[% IF independant_branch %] |
| 237 |
<input type="hidden" name="branchcode" value="[% independant_branch %]" /> |
266 |
<input type="hidden" name="branchcode" value="[% independant_branch %]" /> |
| 238 |
[% ELSE %] |
267 |
[% ELSE %] |
|
Lines 250-256
$(document).ready(function() {
Link Here
|
| 250 |
<li> |
279 |
<li> |
| 251 |
<label for="module">Koha module:</label> |
280 |
<label for="module">Koha module:</label> |
| 252 |
<input type="hidden" name="oldmodule" value="[% module %]" /> |
281 |
<input type="hidden" name="oldmodule" value="[% module %]" /> |
| 253 |
[% IF ( modify ) %]<select name="module" id="module">[% END %] [% IF ( adding ) %] <select name="module" id="module" onchange="javascript:window.location.href = unescape(window.location.pathname)+'?op=add_form&module='+this.value+'&content='+window.document.forms['Aform'].elements['content'].value;">[% END %] |
282 |
[% IF adding %] |
|
|
283 |
<select name="module" id="module" onchange="javascript:window.location.href = unescape(window.location.pathname)+'?op=add_form&module='+this.value+'&content='+window.document.forms['Aform'].elements['content'].value;"> |
| 284 |
[% ELSE %] |
| 285 |
<select name="module" id="module"> |
| 286 |
[% END %] |
| 254 |
[% IF ( module == "catalogue" ) %] |
287 |
[% IF ( module == "catalogue" ) %] |
| 255 |
<option value="catalogue" selected="selected">Catalog</option> |
288 |
<option value="catalogue" selected="selected">Catalog</option> |
| 256 |
[% ELSE %] |
289 |
[% ELSE %] |
|
Lines 294-313
$(document).ready(function() {
Link Here
|
| 294 |
</select> |
327 |
</select> |
| 295 |
</li> |
328 |
</li> |
| 296 |
<li> |
329 |
<li> |
| 297 |
[% IF adding %] |
330 |
<label for="code" class="required">Code:</label> |
| 298 |
<label for"code" class="required">Code:</label> |
331 |
<input type="text" id="code" name="code" size="20" maxlength="20" value="[% code %]" required="required"/> |
| 299 |
<input type="text" id="code" name="code" size="20" maxlength="20" required="required" /> |
332 |
<span class="required">Required</span> |
| 300 |
<span class="required">Required</span> |
333 |
[% IF copying %] |
| 301 |
[% ELSE %] |
334 |
You must change this code to reflect the copy. |
| 302 |
<label for="code">Code:</label> |
335 |
[% END %] |
| 303 |
<input type="hidden" id="code" name="code" value="[% code %]" />[% code %] |
336 |
<input type="hidden" id="code" name="oldcode" value="[% oldcode %]" /> |
| 304 |
[% END %] |
|
|
| 305 |
</li> |
337 |
</li> |
| 306 |
<li> |
338 |
<li> |
| 307 |
<label for="name" class="required">Name:</label> |
339 |
<label for="name" class="required">Name:</label> |
| 308 |
<input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" /> |
340 |
<input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" /> |
| 309 |
<span class="required">Required</span> |
341 |
<span class="required">Required</span> |
| 310 |
</li> |
342 |
</li> |
| 311 |
|
343 |
|
| 312 |
[% FOREACH letter IN letters %] |
344 |
[% FOREACH letter IN letters %] |
| 313 |
<li> |
345 |
<li> |
|
Lines 376-387
$(document).ready(function() {
Link Here
|
| 376 |
|
408 |
|
| 377 |
[% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %] |
409 |
[% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %] |
| 378 |
</fieldset> |
410 |
</fieldset> |
| 379 |
<fieldset class="action"><input type="submit" id="submit" value="Submit" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset> |
411 |
<fieldset class="action"><input type="submit" id="submit_form" value="Submit" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset> |
| 380 |
<input type="hidden" name="searchfield" value="[% searchfield %]" /> |
412 |
<input type="hidden" name="searchfield" value="[% searchfield %]" /> |
| 381 |
</form> |
413 |
</form> |
| 382 |
[% END %] |
414 |
[% END %] |
| 383 |
|
415 |
|
| 384 |
[% IF ( add_validate ) %] |
416 |
[% IF ( add_validate or copy_validate) %] |
| 385 |
Data recorded |
417 |
Data recorded |
| 386 |
<form action="[% action %]" method="post"> |
418 |
<form action="[% action %]" method="post"> |
| 387 |
<input type="submit" value="OK" /> |
419 |
<input type="submit" value="OK" /> |
|
Lines 431-437
$(document).ready(function() {
Link Here
|
| 431 |
|
463 |
|
| 432 |
</div> |
464 |
</div> |
| 433 |
</div> |
465 |
</div> |
| 434 |
[% UNLESS ( add_form ) %] |
466 |
[% UNLESS add_form or copy_form %] |
| 435 |
<div class="yui-b noprint"> |
467 |
<div class="yui-b noprint"> |
| 436 |
[% INCLUDE 'tools-menu.inc' %] |
468 |
[% INCLUDE 'tools-menu.inc' %] |
| 437 |
</div> |
469 |
</div> |