2 [% INCLUDE 'doc-head-open.inc' %]
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' %]
5 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.insertatcaret.js"></script>
8 <script type="text/javascript">
10 $(document).ready(function() {
11 $("#lettert:has(tbody tr)").dataTable($.extend(true, {}, dataTablesDefaults, {
14 { "aTargets": [ -1,-2, -3 ], "bSortable": false, "bSearchable": false }
19 $('#branch').change(function() {
21 $('#selectlibrary').submit();
23 $('#newnotice').click(function() {
24 $('#op').val("add_form");
29 $("#submit_form").click( function(event) {
30 event.preventDefault();
31 var at_least_one_exists = 0;
32 $("fieldset.mtt").each( function(){
33 var title = $(this).find('input[name="title"]').val();
34 var content = $(this).find('textarea[name="content"]').val();
36 ( title.length == 0 && content.length > 0 )
37 || ( title.length > 0 && content.length == 0 )
39 var mtt = $(this).find('input[name="message_transport_type"]').val();
40 var msg = _("Please specify title and content for %s");
41 msg = msg.replace( "%s", mtt );
42 at_least_one_exists = 1;
45 } else if ( title.length > 0 && content.length > 0 ) {
46 at_least_one_exists = 1;
49 if ( ! at_least_one_exists ) {
50 alert( _("Please fill at least one template.") );
54 // Test if code already exists in DB
55 var new_lettercode = $("#code").val();
57 if ( new_lettercode == '[% code %]' ) {
58 alert( _("Please change the code.") );
62 if ( new_lettercode != '[% code %]' ) {
64 data: { code: new_lettercode },
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.") );
72 $("#add_notice").submit();
77 $("#add_notice").submit();
82 $("#content_sms").on("keyup", function(){
83 var length = $(this).val().length;
84 $("#sms_counter").html(length + "/" + sms_limit + _(" characters"));
85 if ( length > sms_limit ) {
86 $("#sms_counter").css("color", "red");
88 $("#sms_counter").css("color", "black");
92 [% IF add_form or copy_form %]
100 function isNotNull(f,noalert) {
101 if (f.value.length ==0) {
107 function isNum(v,maybenull) {
108 var n = new Number(v.value);
112 if (maybenull==0 && v.value=='') {
117 function insertValueQuery(mtt_id) {
118 var fieldset = $("#" + mtt_id);
119 var myQuery = $(fieldset).find('textarea[name="content"]');
120 var myListBox = $(fieldset).find('select[name="SQLfieldname"]');
122 if($(myListBox).find('option').length > 0) {
125 $(myListBox).find('option').each( function (){
126 if ( $(this).attr('selected') ) {
130 chaineAj += $(this).val();
133 $(myQuery).insertAtCaret("<<" + chaineAj + ">>");
140 <body id="tools_letter" class="tools">
141 [% INCLUDE 'header.inc' %]
142 [% INCLUDE 'letters-search.inc' %]
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>
146 [% IF add_form or copy_form %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
152 [% IF ( no_op_set ) %]
153 <h1>Notices and Slips</h1>
154 <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
155 <input type="hidden" name="searchfield" value="[% searchfield %]" />
156 [% UNLESS independant_branch %]
159 <select name="branchcode" id="branch" style="width:20em;">
160 <option value="">All libraries</option>
161 [% FOREACH branchloo IN branchloop %]
162 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
167 <div id="toolbar" class="btn-toolbar">
168 <button type="submit" class="btn btn-small" id="newnotice"><i class="icon-plus"></i> New notice</button>
169 <input type="hidden" id="op" name="op" />
174 <p>You searched for <b>[% searchfield %]</b></p>
176 [% IF ( letter && !independant_branch) %]
177 [% select_for_copy = BLOCK %]
178 <select name="branchcode">
179 [% FOREACH branchloo IN branchloop %]
180 <option value="[% branchloo.value %]">Copy to [% branchloo.branchname %]</option>
199 [% FOREACH lette IN letter %]
200 [% can_edit = lette.branchcode || !independant_branch %]
202 <td>[% IF lette.branchname %][% lette.branchname %][% ELSE %](All libraries)[% END %]</td>
203 <td>[% lette.module %]</td>
204 <td>[% lette.code %]</td>
205 <td>[% lette.name %]</td>
206 <td style="white-space: nowrap">
207 [% IF !independant_branch || !lette.branchcode %]
208 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
209 <input type="hidden" name="op" value="copy_form" />
210 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode %]" />
211 <input type="hidden" name="module" value="[% lette.module %]" />
212 <input type="hidden" name="code" value="[% lette.code %]" />
213 [% IF independant_branch %]
214 <input type="hidden" name="branchcode" value="[% independant_branch %]" />
216 [% select_for_copy %]
218 <input type="submit" value="Copy" />
224 <a href="/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=[% lette.branchcode %]&module=[% lette.module %]&code=[% lette.code %]">Edit</a>
228 [% IF !lette.protected && can_edit %]
229 <a href="/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=[%lette.branchcode %]&module=[% lette.module %]&code=[% lette.code %]">Delete</a>
237 <div class="dialog message">
238 [% IF ( branchcode ) %]
239 <p>There are no notices for this library.</p>
241 <p>There are no notices.</p>
248 [% IF add_form or copy_form %]
249 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
250 <form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
252 <input type="hidden" name="op" id="op" value="add_validate" />
254 <input type="hidden" name="op" id="op" value="copy_validate" />
257 <input type="hidden" name="checked" value="0" />
259 <input type="hidden" name="add" value="0" />
261 <input type="hidden" name="add" value="1" />
263 <fieldset class="rows">
264 <input type="hidden" name="oldbranchcode" value="[% oldbranchcode %]" />
265 [% IF independant_branch %]
266 <input type="hidden" name="branchcode" value="[% independant_branch %]" />
270 <label for="branch">Library:</label>
271 <select name="branchcode" id="branch" style="width:20em;">
272 <option value="">All libraries</option>
273 [% FOREACH branchloo IN branchloop %]
274 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
280 <label for="module">Koha module:</label>
281 <input type="hidden" name="oldmodule" value="[% module %]" />
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;">
285 <select name="module" id="module">
287 [% IF ( module == "catalogue" ) %]
288 <option value="catalogue" selected="selected">Catalog</option>
290 <option value="catalogue" >Catalog</option>
292 [% IF ( module == "circulation" ) %]
293 <option value="circulation" selected="selected">Circulation</option>
295 <option value="circulation">Circulation</option>
297 [% IF ( module == "claimacquisition" ) %]
298 <option value="claimacquisition" selected="selected">Claim acquisition</option>
300 <option value="claimacquisition">Claim acquisition</option>
302 [% IF ( module == "claimissues" ) %]
303 <option value="claimissues" selected="selected">Claim serial issue</option>
305 <option value="claimissues">Claim serial issue</option>
307 [% IF ( module == "reserves" ) %]
308 <option value="reserves" selected="selected">Holds</option>
310 <option value="reserves">Holds</option>
312 [% IF ( module == "members" ) %]
313 <option value="members" selected="selected">Members</option>
315 <option value="members">Members</option>
317 [% IF ( module == "serial" ) %]
318 <option value="serial" selected="selected">Serials (routing list)</option>
320 <option value="serial">Serials (routing list)</option>
322 [% IF ( module == "suggestions" ) %]
323 <option value="suggestions" selected="selected">Suggestions</option>
325 <option value="suggestions">Suggestions</option>
330 <label for="code" class="required">Code:</label>
331 <input type="text" id="code" name="code" size="20" maxlength="20" value="[% code %]" required="required"/>
332 <span class="required">Required</span>
334 You must change this code to reflect the copy.
336 <input type="hidden" id="code" name="oldcode" value="[% oldcode %]" />
339 <label for="name" class="required">Name:</label>
340 <input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" />
341 <span class="required">Required</span>
344 [% FOREACH letter IN letters %]
346 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
347 <fieldset class="rows mtt" id="[% letter.message_transport_type %]" disabled="disabled">
348 <div class="dialog message">You should enable the SMSSendDriver preference to use the SMS templates.</div>
349 [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
350 <fieldset class="rows mtt" id="[% letter.message_transport_type %]" disabled="disabled">
351 <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
353 <fieldset class="rows mtt" id="[% letter.message_transport_type %]">
356 [% SWITCH letter.message_transport_type %]
368 [% letter.message_transport_type %]
373 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type %]" />
374 <label for="is_html_[% letter.message_transport_type %]">HTML message:</label>
375 [% IF letter.is_html %]
376 <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" checked="checked" />
378 <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" />
382 <label for="title">Message subject:</label><input type="text" id="title" name="title" size="60" value="[% letter.title %]" />
385 <label for="SQLfieldname">Message body:</label>
386 [% IF letter.message_transport_type == 'sms' %]
387 <span id="sms_counter">[% IF letter.content.length > 0 %][% letter.content.length %][% ELSE %]0[% END %]/160 characters</span>
392 <select name="SQLfieldname" multiple="multiple" size="9">
393 [% FOREACH SQLfieldnam IN SQLfieldname %]
394 <option value="[% SQLfieldnam.value %]">[% SQLfieldnam.text %]</option>
398 <td><input type="button" name="insert" value=">>" onclick="insertValueQuery('[% letter.message_transport_type %]')" title="Insert" /></td>
399 <td><textarea name="content" id="content_[% letter.message_transport_type %]" cols="80" rows="15">[% letter.content %]</textarea></td>
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 %]
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>
412 <input type="hidden" name="searchfield" value="[% searchfield %]" />
416 [% IF ( add_validate or copy_validate) %]
418 <form action="[% action %]" method="post">
419 <input type="submit" value="OK" />
423 [% IF ( delete_confirm ) %]
424 <div class="dialog alert"><h3>Delete notice?</h3>
435 <td>[% branchname %]</td>
436 <td>[% module %]</td>
441 <form action="[% action %]" method="post">
442 <input type="hidden" name="op" value="delete_confirmed">
443 <input type="hidden" name="branchcode" value="[% branchcode %]" />
444 <input type="hidden" name="code" value="[% code %]" />
445 <input type="hidden" name="module" value="[% module %]" />
446 <input type="hidden" name="message_transport_type" value="*" />
447 <input type="submit" value="Yes, delete" class="approve" />
450 <form action="[% action %]" method="get">
451 <input type="submit" value="No, do not delete" class="deny" />
457 [% IF ( delete_confirmed ) %]
459 <form action="[% action %]" method="post">
460 <input type="submit" value="OK" />
466 [% UNLESS add_form or copy_form %]
467 <div class="yui-b noprint">
468 [% INCLUDE 'tools-menu.inc' %]
472 [% INCLUDE 'intranet-bottom.inc' %]