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>
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 %]/[% theme %]/en/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").click( function(event) {
30 var at_least_one_exists = 0;
31 $("fieldset.mtt").each( function(){
32 var title = $(this).find('input[name="title"]').val();
33 var content = $(this).find('textarea[name="content"]').val();
35 ( title.length == 0 && content.length > 0 )
36 || ( title.length > 0 && content.length == 0 )
38 var mtt = $(this).find('input[name="message_transport_type"]').val();
39 var msg = _("Please specify title and content for %s");
40 msg = msg.replace( "%s", mtt );
41 at_least_one_exists = 1;
43 event.preventDefault();
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.") );
51 event.preventDefault();
58 $("#content_sms").on("keyup", function(){
59 var length = $(this).val().length;
60 $("#sms_counter").html(length + "/" + sms_limit + _(" characters"));
61 if ( length > sms_limit ) {
62 $("#sms_counter").css("color", "red");
64 $("#sms_counter").css("color", "black");
76 function isNotNull(f,noalert) {
77 if (f.value.length ==0) {
83 function isNum(v,maybenull) {
84 var n = new Number(v.value);
88 if (maybenull==0 && v.value=='') {
93 function insertValueQuery(mtt_id) {
94 var fieldset = $("#" + mtt_id);
95 var myQuery = $(fieldset).find('textarea[name="content"]');
96 var myListBox = $(fieldset).find('select[name="SQLfieldname"]');
98 if($(myListBox).find('option').length > 0) {
101 $(myListBox).find('option').each( function (){
102 if ( $(this).attr('selected') ) {
106 chaineAj += $(this).val();
109 $(myQuery).insertAtCaret("<<" + chaineAj + ">>");
116 <body id="tools_letter" class="tools">
117 [% INCLUDE 'header.inc' %]
118 [% INCLUDE 'letters-search.inc' %]
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>
122 [% IF ( add_form ) %]<div id="doc" class="yui-t7">[% ELSE %]<div id="doc3" class="yui-t2">[% END %]
128 [% IF ( no_op_set ) %]
129 <h1>Notices and Slips</h1>
130 <form method="get" action="/cgi-bin/koha/tools/letter.pl" id="selectlibrary">
131 <input type="hidden" name="searchfield" value="[% searchfield %]" />
132 [% UNLESS independant_branch %]
135 <select name="branchcode" id="branch" style="width:20em;">
136 <option value="">All libraries</option>
137 [% FOREACH branchloo IN branchloop %]
138 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
143 <div id="toolbar" class="btn-toolbar">
144 <button type="submit" class="btn btn-small" id="newnotice"><i class="icon-plus"></i> New notice</button>
145 <input type="hidden" id="op" name="op" />
150 <p>You searched for <b>[% searchfield %]</b></p>
152 [% IF ( letter && !independant_branch) %]
153 [% select_for_copy = BLOCK %]
154 <select name="branchcode">
155 [% FOREACH branchloo IN branchloop %]
156 <option value="[% branchloo.value %]">Copy to [% branchloo.branchname %]</option>
175 [% FOREACH lette IN letter %]
176 [% can_edit = lette.branchcode || !independant_branch %]
178 <td>[% IF lette.branchname %][% lette.branchname %][% ELSE %](All libraries)[% END %]</td>
179 <td>[% lette.module %]</td>
180 <td>[% lette.code %]</td>
181 <td>[% lette.name %]</td>
182 <td style="white-space: nowrap">
183 [% IF !independant_branch || !lette.branchcode %]
184 <form method="post" action="/cgi-bin/koha/tools/letter.pl">
185 <input type="hidden" name="op" value="copy" />
186 <input type="hidden" name="oldbranchcode" value="[% lette.branchcode %]" />
187 <input type="hidden" name="module" value="[% lette.module %]" />
188 <input type="hidden" name="code" value="[% lette.code %]" />
189 [% IF independant_branch %]
190 <input type="hidden" name="branchcode" value="[% independant_branch %]" />
192 [% select_for_copy %]
194 <input type="submit" value="Copy" />
200 <a href="/cgi-bin/koha/tools/letter.pl?op=add_form&branchcode=[% lette.branchcode %]&module=[% lette.module %]&code=[% lette.code %]">Edit</a>
204 [% IF !lette.protected && can_edit %]
205 <a href="/cgi-bin/koha/tools/letter.pl?op=delete_confirm&branchcode=[%lette.branchcode %]&module=[% lette.module %]&code=[% lette.code %]">Delete</a>
213 <div class="dialog message">
214 [% IF ( branchcode ) %]
215 <p>There are no notices for this library.</p>
217 <p>There are no notices.</p>
224 [% IF ( add_form ) %]
225 <h1>[% IF ( modify ) %]Modify notice[% ELSE %]Add notice[% END %]</h1>
226 <form name="Aform" method="post" enctype="multipart/form-data" class="validate">
227 <input type="hidden" name="op" id="op" value="add_validate" />
228 <input type="hidden" name="checked" value="0" />
230 <input type="hidden" name="add" value="0" />
232 <input type="hidden" name="add" value="1" />
234 <fieldset class="rows">
235 <input type="hidden" name="oldbranchcode" value="[% branchcode %]" />
236 [% IF independant_branch %]
237 <input type="hidden" name="branchcode" value="[% independant_branch %]" />
241 <label for="branch">Library:</label>
242 <select name="branchcode" id="branch" style="width:20em;">
243 <option value="">All libraries</option>
244 [% FOREACH branchloo IN branchloop %]
245 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
251 <label for="module">Koha module:</label>
252 <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 %]
254 [% IF ( module == "catalogue" ) %]
255 <option value="catalogue" selected="selected">Catalog</option>
257 <option value="catalogue" >Catalog</option>
259 [% IF ( module == "circulation" ) %]
260 <option value="circulation" selected="selected">Circulation</option>
262 <option value="circulation">Circulation</option>
264 [% IF ( module == "claimacquisition" ) %]
265 <option value="claimacquisition" selected="selected">Claim acquisition</option>
267 <option value="claimacquisition">Claim acquisition</option>
269 [% IF ( module == "claimissues" ) %]
270 <option value="claimissues" selected="selected">Claim serial issue</option>
272 <option value="claimissues">Claim serial issue</option>
274 [% IF ( module == "reserves" ) %]
275 <option value="reserves" selected="selected">Holds</option>
277 <option value="reserves">Holds</option>
279 [% IF ( module == "members" ) %]
280 <option value="members" selected="selected">Members</option>
282 <option value="members">Members</option>
284 [% IF ( module == "serial" ) %]
285 <option value="serial" selected="selected">Serials (routing list)</option>
287 <option value="serial">Serials (routing list)</option>
289 [% IF ( module == "suggestions" ) %]
290 <option value="suggestions" selected="selected">Suggestions</option>
292 <option value="suggestions">Suggestions</option>
298 <label for"code" class="required">Code:</label>
299 <input type="text" id="code" name="code" size="20" maxlength="20" required="required" />
300 <span class="required">Required</span>
302 <label for="code">Code:</label>
303 <input type="hidden" id="code" name="code" value="[% code %]" />[% code %]
307 <label for="name" class="required">Name:</label>
308 <input type="text" id="name" name="name" size="60" value="[% letter_name %]" required="required" />
309 <span class="required">Required</span>
312 [% FOREACH letter IN letters %]
314 [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
315 <fieldset class="rows mtt" id="[% letter.message_transport_type %]" disabled="disabled">
316 <div class="dialog message">You should enable the SMSSendDriver preference to use the sms templates.</div>
317 [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
318 <fieldset class="rows mtt" id="[% letter.message_transport_type %]" disabled="disabled">
319 <div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
321 <fieldset class="rows mtt" id="[% letter.message_transport_type %]">
324 [% SWITCH letter.message_transport_type %]
336 [% letter.message_transport_type %]
341 <input type="hidden" name="message_transport_type" value="[% letter.message_transport_type %]" />
342 <label for="is_html_[% letter.message_transport_type %]">HTML message:</label>
343 [% IF letter.is_html %]
344 <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" checked="checked" />
346 <input type="checkbox" name="is_html_[% letter.message_transport_type %]" id="is_html_[% letter.message_transport_type %]" value="1" />
350 <label for="title">Message subject:</label><input type="text" id="title" name="title" size="60" value="[% letter.title %]" />
353 <label for="SQLfieldname">Message body:</label>
354 [% IF letter.message_transport_type == 'sms' %]
355 <span id="sms_counter">[% IF letter.content.length > 0 %][% letter.content.length %][% ELSE %]0[% END %]/160 characters</span>
360 <select name="SQLfieldname" multiple="multiple" size="9">
361 [% FOREACH SQLfieldnam IN SQLfieldname %]
362 <option value="[% SQLfieldnam.value %]">[% SQLfieldnam.text %]</option>
366 <td><input type="button" name="insert" value=">>" onclick="insertValueQuery('[% letter.message_transport_type %]')" title="Insert" /></td>
367 <td><textarea name="content" id="content_[% letter.message_transport_type %]" cols="80" rows="15">[% letter.content %]</textarea></td>
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 %]
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>
380 <input type="hidden" name="searchfield" value="[% searchfield %]" />
384 [% IF ( add_validate ) %]
386 <form action="[% action %]" method="post">
387 <input type="submit" value="OK" />
391 [% IF ( delete_confirm ) %]
392 <div class="dialog alert"><h3>Delete notice?</h3>
403 <td>[% branchname %]</td>
404 <td>[% module %]</td>
409 <form action="[% action %]" method="post">
410 <input type="hidden" name="op" value="delete_confirmed">
411 <input type="hidden" name="branchcode" value="[% branchcode %]" />
412 <input type="hidden" name="code" value="[% code %]" />
413 <input type="hidden" name="module" value="[% module %]" />
414 <input type="hidden" name="message_transport_type" value="*" />
415 <input type="submit" value="Yes, delete" class="approve" />
418 <form action="[% action %]" method="get">
419 <input type="submit" value="No, do not delete" class="deny" />
425 [% IF ( delete_confirmed ) %]
427 <form action="[% action %]" method="post">
428 <input type="submit" value="OK" />
434 [% UNLESS ( add_form ) %]
435 <div class="yui-b noprint">
436 [% INCLUDE 'tools-menu.inc' %]
440 [% INCLUDE 'intranet-bottom.inc' %]