View | Details | Raw Unified | Return to bug 7936
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tt (-126 / +7 lines)
Lines 1-132 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; Check expiration</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'calendar.inc' %]
5
<script type="text/javascript" language="JavaScript">
6
// <![CDATA[
7
    /**
8
     *  Function CheckForm
9
     *  This function checks the form before submit
10
     */
11
     function CheckForm(form){
12
        if(form.date.value){
13
            return true;
14
        }
15
        else {
16
            alert(_("You must enter a date !"));
17
            document.f.date.focus();
18
            return false;
19
        }
20
     }
21
2
22
	function popup(subscriptionid) {
3
<h1>Check Serial Expiration</h1>
23
	   newin=window.open("subscription-renew.pl?mode=popup&subscriptionid="+subscriptionid,'popup','width=590,height=440,toolbar=false,scrollbars=yes,resize=yes');
24
	}
25
4
26
     // ]]>
5
<p>When adding serials you enter a subscription length, using the check expiration tool you can see when your subscriptions are about to expire. To use the tool click the link to 'Check expiration' on the serials menu.</p>
27
</script>
28
<!-- End of additions -->
29
</head>
30
<body id="ser_checkexpiration" class="ser">
31
[% INCLUDE 'header.inc' %]
32
[% INCLUDE 'serials-search.inc' %]
33
6
34
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Check expiration </div>
7
<p>In the form that appears you need to enter at least a date to search by.</p>
35
8
36
<div id="doc3" class="yui-t2">
9
<p>In your results you will see all subscriptions that will expire before the date you entered. From there you can choose to view the subscription further or renew it in one click.</P>
37
   
38
   <div id="bd">
39
	<div id="yui-main">
40
	<div class="yui-b">
41
10
42
<h1>Check expiration</h1>
11
<p><strong>See the full documentation for Checking Serial Expiration in the <a href="http://manual.koha-community.org/3.8/en/serialexpiration.html">manual</a> (online).</strong></p>
43
12
44
    <form name="f" action="/cgi-bin/koha/serials/checkexpiration.pl" method="post" onsubmit="return CheckForm(this);">
13
[% INCLUDE 'help-bottom.inc' %]
45
<fieldset class="rows">
46
    <legend>Filter results :</legend>
47
    
48
         <ol>
49
        <li><label for="title">Title:</label>
50
        <input id="title" type="text" name="title" size="15" value="[% title %]" /></li>
51
52
        <li><label for="issn">ISSN:</label>
53
        <input id="issn" type="text" name="issn" size="15" value="[% issn %]" /></li>
54
55
        <li><label for="date" class="required" title="Required field">Expiring before:</label>
56
        <input id="date" type="text" name="date" size="10" value="[% date %]" class="focus" />
57
                <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show calendar" border="0" id="openCalendar" style="cursor: pointer;" />
58
            <script type="text/javascript">
59
                Calendar.setup(
60
                 {
61
					button : "openCalendar",
62
                     inputField : "date",
63
                     ifFormat : "[% DHTMLcalendar_dateformat %]"
64
                 }
65
                );
66
            </script> <span class="required">Required</span>
67
			<div class="hint">[% INCLUDE 'date-format.inc' %]</div></li>
68
			</ol>
69
        
70
</fieldset>
71
<fieldset class="action"><input type="submit" value="Search" /></fieldset>
72
</form>
73
74
[% IF ( subscriptions_loop ) %]
75
<p>
76
    <b>[% numsubscription %]</b> subscription(s)
77
        [% IF ( title ) %]
78
        with title matching <span class="title">[% title %]</class>
79
        [% IF ( issn ) %]and [% END %]
80
    [% END %]
81
    [% IF ( issn ) %]
82
        with ISSN matching <b>[% issn %]</b>
83
    [% END %]
84
        will expire before <b>[% date %]</b>
85
</p>
86
<table>
87
        <tr>
88
            <th>ISSN</th>
89
            <th>Title</th>
90
            <th>Note</th>
91
            <th>Expiration date</th>
92
			<th colspan="2">&nbsp;</th>
93
        </tr>
94
    [% FOREACH subscriptions_loo IN subscriptions_loop %]
95
        [% IF ( subscriptions_loo.toogle ) %]
96
        <tr class="highlight">
97
        [% ELSE %]
98
        <tr>
99
        [% END %]
100
            <td>
101
                [% subscriptions_loo.issn %]
102
            </td>
103
            <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptions_loo.subscriptionid |url %]">[% IF ( subscriptions_loo.title ) %]
104
                    [% subscriptions_loo.title |html %]
105
                [% ELSE %]
106
                    |
107
                [% END %]
108
                </a>
109
            </td>
110
            <td>
111
                [% subscriptions_loo.notes %]
112
            </td>
113
            <td>
114
                [% subscriptions_loo.expirationdate %]
115
            </td>
116
			<td><a href="/cgi-bin/koha/serials/subscription-add.pl?op=mod&amp;subscriptionid=[% subscriptions_loo.subscriptionid %]">Edit</a></td>
117
			<td><a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscriptions_loo.subscriptionid %]" onclick="popup([% subscriptions_loo.subscriptionid %]); return false;">Renew</a></td>
118
        </tr>
119
    [% END %]
120
    </table>
121
[% ELSE %]
122
    <p>No results for your query</p>
123
[% END %]
124
125
</div>
126
</div>
127
128
<div class="yui-b">
129
[% INCLUDE 'serials-menu.inc' %]
130
</div>
131
</div>
132
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt (-399 / +9 lines)
Lines 1-408 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
    <title>Koha &rsaquo; Serials &rsaquo; Claims</title>
3
    [% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.uitablefilter.js"></script>
6
<script type="text/JavaScript" language="JavaScript">
7
//<![CDATA[
8
	 $(document).ready(function() {
9
		[% UNLESS ( preview ) %]$("#claimst").tablesorter({[% IF ( dateformat == 'metric' ) %]
10
			dateFormat: 'uk',[% END %]
11
			headers: { 0: { sorter: false },1:{sorter:false}}
12
		});[% END %]
13
	    $('#supplierid').change(function() {
14
    	    $('#claims').submit();
15
	    });
16
2
17
	    // Case-insensitive version of jquery's contains function
3
<h1>Serials Claims</h1>
18
	    jQuery.extend(
19
		jQuery.expr[':'], { 
20
		    icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" 
21
		}
22
	    );
23
4
5
<p>Koha can send email messages to your serial vendors if you have late issues. To the left of the main serials page there is a link to 'Claims'</p>
24
6
25
	    // Checkboxes : Select All / None
7
<p>The links to claims also appears to the left of the subscription detail page</p>
26
	    $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
27
	    $("span.exportSelected").html("<a id=\"ExportSelected\" href=\"/cgi-bin/koha/serials/claims.pl\"> "+_("Export selected items data") +"<\/a>");
28
8
29
        $("#CheckAll").click(function() {
9
<p>If you don't have a claim notice defined yet you will see a warning message that you need to first define a notice.</p>
30
            $("#claimst tr:visible :checkbox").attr('checked', $("#CheckAll").is(':checked'));
31
        });
32
10
33
	    // Generates a dynamic link for exporting the selection's data as CSV
11
<p>Clicking 'Claims' will open a report that will ask you to choose from your various serial vendors to generate claims for late issues.</p>
34
	    $("#ExportSelected").click(function() {
35
		// We use input:checked because it's faster, but if there must new checkboxes  
36
		// used for other purpose on this page, please use [name=serialid]:checked instead
37
		var selected = $("input:checked");
38
12
39
		if (selected.length == 0) {
13
<p>From the list of late issues you can choose which ones you want to send a claim email to by clicking the checkbox to the left of late issue, choosing the notice template to use and clicking the 'Send notification' button.</p>
40
			alert(_('Please select at least one item to export.'));
41
			return false;
42
		}
43
		
44
		// Building the url from currently checked boxes
45
		var url = '/cgi-bin/koha/serials/lateissues-excel.pl?supplierid=&amp;op=claims';
46
		for (var i = 0; i < selected.length; i++) {
47
		    url += '&amp;serialid=' + selected[i].value;
48
		}
49
		// And redirecting to the CSV page
50
		location.href = url;
51
		return false;
52
	    });	
53
14
54
        $("#titlefilter").keyup(function() {
15
<p><strong>See the full documentation for Serial Claims in the <a href="http://manual.koha-community.org/3.8/en/serialclaims.html">manual</a> (online).</strong></p>
55
            $.uiTableFilter($("#claimst"), $("#titlefilter").val())
56
	    });
57
16
58
        $("#branchfilter").keyup(function() {
17
[% INCLUDE 'help-bottom.inc' %]
59
            $.uiTableFilter($("#claimst"), $("#branchfilter").val())
60
	    });
61
	 });
62
18
63
	// Checks if the form can be sent (at least one checkbox must be checked)
64
	function checkForm() {
65
	    if ($("input:checked").length == 0) {
66
		alert(_('Please select at least one item.'));
67
		return false;
68
	    }
69
	}
70
71
	// Filter by status
72
	function filterByStatus() {
73
	    selectedStatus = $("#statusfilter").val();
74
	    if (selectedStatus == "all") {
75
		clearFilters();
76
	    } else {
77
		$("table#claimst tbody tr").hide();
78
		$("table#claimst tbody tr:contains(" + selectedStatus + ")").show();
79
	    }
80
	}
81
82
	// Filter by branch
83
	function filterByBranch() {
84
	    selectedBranch = $("#branchfilter").val();
85
	    if (selectedBranch == "all") {
86
		clearFilters();
87
	    } else {
88
		$("table#claimst tbody tr").hide();
89
		$("table#claimst tbody tr:contains(" + selectedBranch + ")").show();
90
	    }
91
	}
92
	// Filter by date
93
	function filterByDate() {
94
	    var beginDate = Date_from_syspref($("#begindate").val()).getTime();
95
	    var endDate   = Date_from_syspref($("#enddate").val()).getTime();
96
	    
97
	    // Checks if the beginning date is valid
98
	    if (!parseInt(beginDate)) {
99
		alert(_('The beginning date is missing or invalid.'));
100
		return false;
101
	    }
102
103
	    // Checks if the ending date is valid
104
	    if (!parseInt(endDate)) {
105
		alert(_('The ending date is missing or invalid.'));
106
		return false;
107
	    }
108
109
	    // Checks if beginning date is before ending date
110
	    if (beginDate > endDate) {
111
		// If not, we swap them
112
		var tmpDate = endDate;
113
		endDate = beginDate;
114
		beginDate = tmpDate;
115
	    }
116
	   
117
	    // We hide everything
118
	    $("table#claimst tbody tr").hide();
119
120
	    // For each date in the table
121
	    $(".planneddate").each(function() {
122
123
		// We make a JS Date Object, according to the locale
124
		var pdate = Date_from_syspref($(this).text()).getTime();
125
126
		// And checks if the date is between the beginning and ending dates
127
		if (pdate > beginDate && 
128
		    pdate < endDate) {
129
			// If so, we can show the row
130
			$(this).parent().show();
131
		    }
132
133
	    });
134
	}
135
136
	// Clears filters : shows everything
137
	function clearFilters() {
138
	    $("table#claimst tbody tr").show();
139
	}
140
141
	function popup(supplierid,serialid){
142
		window.open('claims.pl?supplierid='+ supplierid +'&amp;serialid='+ serialid +'&amp;op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
143
	}
144
145
//]]>
146
</script>
147
[% INCLUDE 'calendar.inc' %]
148
</head>
149
<body id="ser_claims" class="ser">
150
    [% INCLUDE 'header.inc' %]
151
[% UNLESS ( preview ) %]
152
    [% INCLUDE 'serials-search.inc' %]
153
[% END %]
154
155
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Claims</div>
156
157
[% UNLESS ( preview ) %]
158
159
<div id="doc3" class="yui-t2">
160
   
161
   <div id="bd">
162
	<div id="yui-main">
163
	<div class="yui-b">
164
165
    <h1>Claims</h1>
166
167
[% IF ( letter ) %][% UNLESS ( missingissues ) %][% IF ( supplierid ) %] <div class="dialog alert">No missing issues found.</div>[% ELSE %]<div class="dialog message">Please choose a vendor.</div>[% END %][% END %][% END %]
168
	
169
	     [% IF ( SHOWCONFIRMATION ) %]
170
     <div class="dialog alert">Your notification has been sent.</div>
171
     [% END %]
172
[% UNLESS ( letter ) %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
173
    <form id="claims" name="claims" action="claims.pl" method="post">
174
    <fieldset>
175
	    <label for="supplierid">Vendor: </label>
176
	    <select id="supplierid" name="supplierid">
177
	        [% FOREACH suploo IN suploop %]
178
	            [% IF ( suploo.selected ) %]
179
	            <option value="[% suploo.id %]" selected="selected" >
180
	            [% ELSE %]
181
	            <option value="[% suploo.id %]">
182
	            [% END %]
183
	                [% suploo.name %]
184
	                ([% suploo.count %])
185
	            </option>
186
	        [% END %]
187
	    </select>
188
        <input type="submit" value="OK" />
189
        [% IF ( phone ) %]Phone: [% phone %][% END %]
190
        [% IF ( booksellerfax ) %]Fax: [% booksellerfax %][% END %]
191
        [% IF ( bookselleremail ) %]</p><p><a href="mailto:[% bookselleremail %]">[% bookselleremail %]</a>[% END %]
192
    </fieldset>
193
</form>
194
195
   [% IF ( missingissues ) %]	
196
    <h3>Missing issues</h3>
197
    <form action="claims.pl" onsubmit="return false;">
198
	<fieldset class="rows">
199
	<legend>Filters :</legend>
200
	
201
	<ol>
202
	<li>
203
	    <label for="statusfilter">Status : </label>
204
	    <select id="statusfilter" onchange="filterByStatus();">
205
		<option value="all" selected="selected">(All)</option>
206
		<option>Expected</option>
207
		<option>Arrived</option>
208
		<option>Late</option>
209
		<option>Missing</option>
210
		<option>Claimed</option>
211
	    </select>
212
	</li>
213
	
214
	<li>
215
	    <label for="titlefilter">Title : </label>
216
	    <input id="titlefilter" type="text" />
217
	    <label for="branchfilter">Library: </label>
218
	    <select id="branchfilter" onchange="filterByBranch();">
219
            [% FOREACH branchloo IN branchloop %]
220
                [% IF ( branchloo.selected ) %]
221
                <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
222
                [% ELSE %]
223
                <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
224
                [% END %]
225
            [% END %]
226
        </select>
227
	</li>
228
	
229
	<li>
230
	    <label for="begindate">From</label>
231
        <img src="[% themelang %]/lib/calendar/cal.gif" id="begindatebutton" style="cursor: pointer;" alt="Show calendar" title="Show Calendar" />
232
	    <input type="text" name="begindate" id="begindate" value="[% begindate %]" size="10" maxlength="10" />
233
	    <script type="text/javascript">
234
		 //<![CDATA[ 
235
		Calendar.setup({
236
		    inputField	: "begindate", 
237
		    button		: "begindatebutton",
238
		    ifFormat	: "[% DHTMLcalendar_dateformat %]"
239
		});
240
		//]]>
241
	    </script>
242
243
	    <label for="enddate" style="float:none;">To</label>
244
        <img src="[% themelang %]/lib/calendar/cal.gif" id="enddatebutton" style="cursor: pointer;" alt="Show calendar" title="Show Calendar" />
245
	    <input type="text" name="enddate" id="enddate" value="[% enddate %]" size="10" maxlength="10" />
246
	    <script type="text/javascript">
247
		 //<![CDATA[ 
248
		 Calendar.setup({
249
		    inputField      : "enddate", 
250
		    button          : "enddatebutton",
251
		    ifFormat        : "[% DHTMLcalendar_dateformat %]"
252
		});
253
		//]]>
254
	    </script> <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
255
	    <input type="button" value="OK" onclick="filterByDate();" />
256
        </li>
257
	
258
	<li>
259
        <input type="reset" value="Clear filters" onclick="clearFilters();" />
260
	</li>
261
	</ol>
262
	</fieldset>
263
    </form>
264
265
    <fieldset>
266
	<form action="claims.pl" method="post" class="checkboxed" onsubmit="return checkForm()">
267
        <input type="hidden" name="order" value="[% order %]" />
268
         <table id="claimst">
269
                <thead><tr>
270
                    [% IF ( letter ) %]
271
                    <th><input type="checkbox" id="CheckAll"></th>
272
                    [% END %]
273
                    <th>Vendor</th>
274
                    <th>Library</th>
275
                    <th>Title</th>
276
                    <th>Issue number</th>
277
                    <th>Status</th>
278
                    <th>Since</th>
279
                    <th>Claim date</th>
280
                <th>Begin claim</th>
281
                </tr></thead>
282
                <tbody>[% FOREACH missingissue IN missingissues %]
283
                    <tr>
284
                        [% IF ( letter ) %]
285
                            <td>
286
                    <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
287
                            </td>
288
                        [% END %]
289
                        <td>
290
                        [% missingissue.name %]
291
                        </td>
292
                        <td>
293
                        [% missingissue.branchcode %]
294
                        </td>
295
                        <td>
296
                        <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
297
                        </td>
298
                        <td>
299
                        [% missingissue.serialseq %]
300
                        </td>
301
                        <td>
302
                            [% IF ( missingissue.status1 ) %]Expected[% END %]
303
                            [% IF ( missingissue.status2 ) %]Arrived[% END %]
304
                            [% IF ( missingissue.status3 ) %]Late[% END %]
305
                            [% IF ( missingissue.status4 ) %]Missing[% END %]
306
                            [% IF ( missingissue.status7 ) %]Claimed[% END %]
307
                        </td>
308
                        <td class="planneddate">
309
                        [% missingissue.planneddate %]
310
                        </td>
311
                        <td>
312
                        [% missingissue.claimdate %]
313
                        </td>
314
                        <td>
315
                            <a href="/cgi-bin/koha/serials/lateissues-excel.pl?supplierid=[% missingissue.supplieri %]&amp;serialid=[% missingissue.serialid %]&amp;op=claims">Export item data</a>
316
                        </td>
317
                    </tr>
318
                [% END %]</tbody>
319
            </table>
320
	     <p><span class="exportSelected"></span></p>
321
322
[% IF ( letter ) %]
323
        <fieldset class="action"> <label for="letter_code">Select notice:</label>
324
            <select name="letter_code" id="letter_code">
325
                [% FOREACH letter IN letters %]
326
                    <option value="[% letter.code %]">[% letter.name %]</option>
327
                [% END %]
328
			</select>
329
	    <input type="hidden" name="op" value="send_alert" /><input type="submit" name="submit" class="button" value="Send notification" /></fieldset>
330
            [% END %]
331
        </form>
332
    </fieldset>
333
[% END %]
334
335
[% ELSE %]
336
337
<div id="doc" class="yui-t7">
338
   <div id="bd">
339
	
340
[% IF ( supplierloop ) %]
341
        [% FOREACH supplierloo IN supplierloop %]
342
        [% IF ( supplierloo.name ) %]
343
        <p><b>[% supplierloo.name %]</b><br />
344
        [% END %]
345
        [% IF ( supplierloo.postal ) %]
346
        [% supplierloo.postal %]<br />
347
        [% END %]
348
        [% IF ( supplierloo.contphone ) %]
349
        Ph: [% supplierloo.contphone %]<br />
350
        [% END %]
351
        [% IF ( supplierloo.contfax ) %]
352
        Fax: [% supplierloo.contfax %]<br />
353
        [% END %]
354
        [% IF ( supplierloo.contemail ) %]
355
        Email: [% supplierloo.contemail %]<br />
356
        [% END %]
357
        [% IF ( supplierloo.accountnumber ) %]
358
        A/C: [% supplierloo.accountnumber %]</p>
359
        [% END %]
360
        [% IF ( supplierloo.contact ) %]
361
        <p>Dear [% supplierloo.contact %]</p>
362
        [% ELSE %]
363
        <p>To whom it may concern</p>
364
        [% END %]
365
        <p>The following items have not been received from you and are now considered missing:</p>
366
        [% END %]
367
[% END %]
368
        [% IF ( missingissues ) %]
369
        <h3>Missing issues</h3>
370
        <table>
371
            <tr>
372
                <td><b>Vendor<b></td>
373
                <td><b>Title</b></td>
374
                <td><b>Issue number</b></td>
375
                <td><b>Missing since</b></td>
376
            </tr>
377
            [% FOREACH missingissue IN missingissues %]
378
                <tr>
379
                    <td>
380
                    [% missingissue.name %]
381
                    </td>
382
                    <td>
383
                    [% missingissue.Title |html %]
384
                    </td>
385
                    <td>
386
                    [% missingissue.serialseq %]
387
                    </td>
388
                    <td>
389
                    [% missingissue.planneddate %]
390
                    </td>
391
                </tr>
392
            [% END %]
393
        </table>
394
        [% END %]
395
396
<p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> &nbsp; <a href="#" class="close">Close</a></p>
397
[% END %]
398
399
</div>
400
</div>
401
402
[% UNLESS ( preview ) %]
403
<div class="yui-b">
404
[% INCLUDE 'serials-menu.inc' %]
405
</div>
406
[% END %]
407
</div>
408
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/routing.tt (-87 / +11 lines)
Lines 1-97 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; [% title |html %] &rsaquo; [% IF ( op ) %]Create Routing List[% ELSE %]Edit routing list[% END %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script language="javascript" type="text/javascript">
5
<!--
6
2
7
function reorder_item(sid,rid,rank){
3
<h1>Routing Lists</h1>
8
    var mylocation = 'reorder_members.pl?subscriptionid='+sid+'&routingid='+rid+'&rank='+rank;
9
    window.location.href=mylocation; 
10
}
11
4
12
function search_member(subscriptionid){
5
<p>A routing list is a list of people who receive the serial before it goes to the shelf. When setting up your serial subscription you want to be sure to pick 'Routing List' from the 'Patron Notification' pull down.</p>
13
    var myurl = 'member-search.pl?subscriptionid='+subscriptionid; window.open(myurl,'FindAMember','width=550,height=480,toolbar=no,scrollbars=yes');
14
}
15
6
16
//-->
7
<p>When on the subscription page you will see a link to the left that reads 'Create Routing List.'</p>
17
</script>
18
</head>
19
<body id="ser_routing" class="ser">
20
[% INCLUDE 'header.inc' %]
21
[% INCLUDE 'serials-search.inc' %]
22
8
23
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% title |html %]</i></a> &rsaquo; [% IF ( op ) %]Create Routing List[% ELSE %]Edit routing list[% END %]</div>
9
<p>Clicking that link will bring you to the menu to add a new routing list.</p>
24
10
25
<div id="doc3" class="yui-t2">
11
<p>From here you want to click 'Add recipients' in order to add people to the routing list. In the menu that appears you can filter patrons by part of their name, their library and/or patron category.</p>
26
   
27
   <div id="bd">
28
	<div id="yui-main">
29
	<div class="yui-b">
30
12
13
<p>Clicking 'Add' to the right of each name will add them to the routing list. When you have chosen all of the people for the list, click the 'Close' link to be redirected to the routing list.</p>
31
14
32
[% IF ( op ) %]
15
<p>If the list looks the way you expect it to, then click 'Save'. Next you will be brought to a preview of the routing list. To print the list click 'Save and preview routing slip.' This will open a printable version of the list.</p>
33
<h1>Create routing list for <i>[% title |html %]</i></h1>
34
[% ELSE %]
35
<h1>Edit routing list for <i>[% title |html %]</i></h1>
36
[% END %]
37
16
38
<form method="post" action="routing.pl">
17
<p>If RoutingListAddReserves is set to on then patrons listed in the routing list will automatically be added to the holds list for the issue.</p>
39
<input type="hidden" name="op" value="save" />
40
<input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
41
<fieldset class="rows">
42
	<ol>
43
		<li><label for="date_selected">Issue: </label>
44
<select name="date_selected" id="date_selected">
45
[% FOREACH date IN dates %]
46
[% IF ( date.selected ) %]<option value="[% date.serialseq %] ([% date.planneddate %])" selected="selected">[% date.serialseq %] ([% date.planneddate %])</option>[% ELSE %]<option value="[% date.serialseq %] ([% date.planneddate %])">[% date.serialseq %] ([% date.planneddate %])</option>[% END %]
47
[% END %]
48
</select> [% issue %]</li>
49
18
50
[% IF memberloop %]
19
<p><strong>See the full documentation for Routing Lists in the <a href="http://manual.koha-community.org/3.8/en/routinglist.html">manual</a> (online).</strong></p>
51
<li><span class="label">Recipients:</span><table style="clear:none;margin:0;">
52
        <tr><th>Name</th>
53
            <th>Rank</th>
54
            <th>Delete</th>
55
        </tr>
56
        [% USE m_loop = iterator(memberloop) %]
57
        [% FOREACH member IN m_loop %]
58
        <tr><td>[% member.name %]</td>
59
            <td>
60
                <select name="itemrank" onchange="reorder_item([%- subscriptionid -%], [%- member.routingid -%], this.option[this.selectedIndex].value)">
61
                [% rankings = [1 .. m_loop.size] %]
62
                [% FOREACH r IN rankings %]
63
                    [% IF r == member.ranking %]
64
                      <option selected="selected" value="[% r %]">[% r %]</option>
65
                    [% ELSE %]
66
                      <option value="[% r %]">[% r %]</option>
67
                    [% END %]
68
                [% END %]
69
                </select>
70
            </td>
71
            <td><a href="/cgi-bin/koha/serials/routing.pl?routingid=[% member.routingid %]&amp;subscriptionid=[% subscriptionid %]&amp;op=delete">Delete</a></td>
72
        </tr>
73
        [% END %]
74
        </table><p style="margin-left:10em;"><a onclick="search_member([% subscriptionid %]); return false"
75
href="/cgi-bin/koha/serials/member-search.pl?subscriptionid=[% subscriptionid %]" class="button">Add recipients</a> &nbsp; <a
76
href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]&amp;op=delete" class="button">Delete all</a></p></li>
77
[% ELSE %]
78
<li><span class="label">Recipients:</span>
79
    <a onclick="search_member([% subscriptionid %]); return false" href="/cgi-bin/koha/serials/member-search.pl?subscriptionid=[% subscriptionid %]" class="button">Add recipients</a></li>
80
[% END %]
81
20
82
	<li><label for="notes">Notes:</label><textarea name="notes" id="notes" rows="3" cols="50">[% routingnotes %]</textarea></li>
21
[% INCLUDE 'help-bottom.inc' %]
83
	</ol>
84
85
</fieldset>
86
<fieldset class="action"><input type="submit" name="submit" value="Save" /></fieldset>
87
</form>
88
89
90
</div>
91
</div>
92
93
<div class="yui-b">
94
[% INCLUDE 'serials-menu.inc' %]
95
</div>
96
</div>
97
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt (-272 / +8 lines)
Lines 1-279 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; Serial collection information for [% bibliotitle %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
2
5
<script type="text/javascript">
3
<h1>Serial Collection</h1>
6
//<![CDATA[
7
function print_slip(subscriptionid,issue){
8
    var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue;
9
    window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
10
}
11
function addsubscriptionid()
12
{
13
	var tab=new Array();
14
    var serialids = document.edition.serialid;
15
    for (i=0; i<serialids.length; i++){
16
      if (serialids[i].checked == true){
17
        var found=false;
18
        for (var val in tab){
19
          if (tab[val] == document.getElementsByName("subs")[i].getAttribute('val')){found = true;}
20
        }
21
        if (found == false){
22
          tab=tab.concat((document.getElementsByName("subs")[i].getAttribute('val')));
23
        }
24
      }
25
    }
26
    var string="";
27
    for (var val in tab){
28
      string = string + tab[val] + ",";
29
    }
30
    string=string.substring(0,string.length -1);
31
    document.edition.subscriptionid.value=string;
32
}
33
function popup(subscriptionid) {
34
    newin=window.open('subscription-renew.pl?mode=popup&subscriptionid='+subscriptionid,'popup','width=500,height=400,toolbar=false,scrollbars=yes');
35
}
36
4
37
function generateNext(subscriptionid) {
5
<p>This page shows a short summary of the subscription along with all of the issues that have been received, are expected, or marked late.</p>
38
	if(confirm(_("Do you really want to generate next serial?"))){
39
		document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid;
40
	}
41
}
42
6
43
$(document).ready(function() {
7
<p>From here you can choose to edit specific issue or receive new issues.</p>
44
	$('#subscription_years > ul').tabs();
45
});
46
 
47
8
48
//]]>
9
<p>To edit or receive an issue, simply check the box in the 'Edit' column and click the 'Edit Serial' button.</p>
49
</script>
50
</head>
51
<body id="ser_serials-collection" class="yui-skin-sam ser">
52
[% INCLUDE 'header.inc' %]
53
[% INCLUDE 'serials-search.inc' %]
54
10
55
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Serial collection information for  <i>[% bibliotitle %]</i></div>
11
<p>If you are adding multiple issues at once or if the latest expected issue is late, you can click the 'Generate Next' button to generate the next issue based on the subscription pattern.</p>
56
12
57
<div id="doc3" class="yui-t2">
13
<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.8/en/serials.html">manual</a> (online).</strong></p>
58
   
59
   <div id="bd">
60
	<div id="yui-main">
61
	<div class="yui-b">
62
14
63
15
[% INCLUDE 'help-bottom.inc' %]
64
[% UNLESS ( popup ) %]
65
	[% INCLUDE 'serials-toolbar.inc' %]
66
67
	<h1>Serial collection information for  <i>[% bibliotitle %]</i>
68
        [% IF location %] ([% location %] ) [% END %]
69
		[% IF ( callnumber ) %]callnumber: [% callnumber %][% END %]</h1>
70
[% END %]
71
72
[% IF ( subscriptions ) %]
73
<table>
74
[% IF ( subscriptions.size == 1 ) %]
75
<caption> Subscription summary</caption>
76
[% ELSE %]
77
<caption> Subscription summaries</caption>
78
[% END %]
79
<tr>
80
  <th>Subscription num.</th>
81
  <th>Frequency</th>
82
  <th>Numbering pattern</th>
83
  <th>Library</th>
84
  <th>Call number</th>
85
  <th>Notes</th>
86
  [% IF ( routing && CAN_user_serials_routing ) %]<th>Routing</th>[% END %]
87
  <th>Renew</th>
88
</tr>
89
[% FOREACH subscription IN subscriptions %]
90
    [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
91
      <td><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]"># [% subscription.subscriptionid %]</a> </td>
92
      <td>         [% IF ( subscription.periodicity1 ) %]
93
                        1/day
94
                [% END %]
95
                [% IF ( subscription.periodicity2 ) %]
96
                        1/week
97
                [% END %]
98
                [% IF ( subscription.periodicity3 ) %]
99
                        1/2 weeks
100
                [% END %]
101
                [% IF ( subscription.periodicity4 ) %]
102
                        1/3 weeks
103
                [% END %]
104
                [% IF ( subscription.periodicity5 ) %]
105
                        1/Month
106
                [% END %]
107
                [% IF ( subscription.periodicity6 ) %]
108
                        1/2 Months (6/year)
109
                [% END %]
110
                [% IF ( subscription.periodicity7 ) %]
111
                        1/quarter
112
                [% END %]
113
                [% IF ( subscription.periodicity8 ) %]
114
                        1/quarter
115
                [% END %]
116
                [% IF ( subscription.periodicity9 ) %]
117
                        2/year
118
                [% END %]
119
                [% IF ( subscription.periodicity10 ) %]
120
                        1/year
121
                [% END %]
122
                [% IF ( subscription.periodicity11 ) %]
123
                        1/2 years
124
                [% END %]</td>
125
           <td>
126
                [% IF ( subscription.numberpattern1 ) %]
127
                    Number
128
                [% END %]
129
                [% IF ( subscription.numberpattern2 ) %]
130
                    Volume, number, issue
131
                [% END %]
132
                [% IF ( subscription.numberpattern3 ) %]
133
                    Volume, number
134
                [% END %]
135
                [% IF ( subscription.numberpattern4 ) %]
136
                    Volume, issue
137
                [% END %]
138
                [% IF ( subscription.numberpattern5 ) %]
139
                    Number, issue
140
                [% END %]
141
                [% IF ( subscription.numberpattern6 ) %]
142
                    Seasonal only
143
                [% END %]
144
                [% IF ( subscription.numberpattern7 ) %]
145
                    None of the above
146
                [% END %]</td>
147
            <td> [% subscription.branchcode %]</td>
148
            <td> [% subscription.callnumber %]</td>
149
        <td> [% subscription.notes %]        [% IF ( subscription.subscriptionexpired ) %]<br /><span class="problem"> Subscription expired</span>
150
        [% END %]
151
        </td>
152
        [% IF ( routing && CAN_user_serials_routing ) %]
153
        <td>
154
            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit routing list</a>
155
        </td>
156
        [% END %]
157
        [% IF ( subscription.abouttoexpire ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
158
        [% ELSE %]
159
        [% IF ( subscription.subscriptionexpired ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
160
        [% ELSE %]
161
        <td> &nbsp;</td>
162
        [% END %]
163
        [% END %]
164
165
      </tr>
166
[% END %]
167
[% IF ( subscr ) %]
168
[% IF ( subscriptioncount > 1 ) %]
169
<tr ><td colspan="8">  <a href="serials-collection.pl?biblionumber=[% biblionumber %]">See any subscription attached to this biblio</a></td>
170
</tr>
171
[% END %]
172
[% END %]
173
</table>
174
[% END %]
175
176
177
[% IF ( years ) %]<form name="edition" action="serials-edit.pl" method="post">
178
<div id="subscription_years" class="toptabs numbered">
179
<ul>
180
	[% FOREACH year IN years %]
181
        [% IF ( year.year ) %]
182
            <li><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% year.subscriptionid %]#subscription-year-[% year.year %]">[% year.year %]</a></li>
183
        [% END %]
184
    [% END %]
185
</ul>
186
187
 [% FOREACH year IN years %]
188
<div id="subscription-year-[% year.year %]">
189
    [% IF ( CAN_user_serials_receive_serials ) %]
190
        <p>
191
            <input type="submit" value="Edit serials" />&nbsp;
192
            <input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
193
        </p>
194
    [% END %]
195
196
        <table>
197
	  <tr>
198
[% IF ( subscriptions.size > 1 ) %]
199
                <th># Subs</th>
200
[% END %]
201
                <th>Date published
202
                </th>
203
                <th>Date received
204
                </th>
205
                <th>Number
206
                </th>
207
                <th>Status
208
                </th>
209
                <th>Notes
210
                </th>
211
                <th>Library
212
                </th>
213
                [% IF ( routing ) %]<th>Routing</th>[% END %]
214
                [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
215
            </tr>
216
      [% FOREACH serial IN year.serials %]
217
    [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
218
[% IF ( subscriptions.size > 1 ) %]
219
                 <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid %]">[% serial.subscriptionid %]</a></td>
220
[% END %]
221
                <td>
222
                    [% serial.publisheddate %]
223
                </td>
224
                <td>
225
                    [% serial.planneddate %]
226
                </td>
227
                <td>
228
                    [% serial.serialseq %]
229
                </td>
230
                <td>
231
                    [% IF ( serial.status1 ) %]Expected[% END %][% IF ( serial.status2 ) %]Arrived[% END %][% IF ( serial.status3 ) %]Late[% END %][% IF ( serial.status4 ) %]Missing[% END %][% IF ( serial.status5 ) %]Not Available[% END %][% IF ( serial.status7 ) %]Claimed[% END %]
232
                </td>
233
                <td>
234
                    [% serial.notes %]
235
                </td>
236
                <td>
237
                    [% serial.branchcode %]
238
                </td>
239
                [% IF ( routing ) %]
240
                <td>
241
                    <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %] ([% serial.planneddate %])'); return false" >Print list</a>
242
                </td>
243
                [% END %]
244
            [% IF ( CAN_user_serials_receive_serials ) %]
245
                <td>
246
                  [% IF ( serial.cannotedit ) %]
247
                    disabled
248
                  [% ELSE %]
249
                    [% IF ( serial.subscriptionexpired ) %]
250
                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" disabled="disabled" />
251
                    [% ELSE %]
252
                      [% IF ( serial.checked ) %]
253
                    <input type="checkbox" name="serialid" checked="checked" value="[% serial.serialid %]" />
254
                      [% ELSE %]
255
                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" />
256
                      [% END %]           
257
                    [% END %]
258
                  [% END %]
259
                </td>
260
            [% END %]
261
            </tr>
262
      [% END %]
263
        </table>
264
    </div>
265
    [% END %]
266
  <input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" />
267
268
</div>
269
</form>
270
[% END %]
271
272
</div>
273
</div>
274
275
<div class="yui-b">
276
[% INCLUDE 'serials-menu.inc' %]
277
</div>
278
</div>
279
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt (-430 / +16 lines)
Lines 1-443 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; Serial edition [% bibliotitle %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script language="JavaScript" type="text/javascript">
5
//<![CDATA[
6
function popup(subscriptionid) {
7
	window.open("subscription-renew.pl?subscriptionid="+subscriptionid,"subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
8
}
9
2
10
function barcode_check(){
3
<h1>Recieving Serials</h1>
11
    [% IF ( count ) %]
12
    var count = [% count %];
13
    for(var i=1;i<=count;i++){
14
4
15
        var barcodenum = "barcode"+i;
5
<p>Issues can be marked as received from several locations. To find a subscription, use the search box at the top of the Serials page to search for the serial you'd like to receive issues for</p>
16
        var statusnum = "status"+i;
17
        var elembarcode = "document.getElementById('"+barcodenum+"')";
18
        var elemstatus = "document.getElementById('"+statusnum+"')";
19
// alert(elembarcode+"\n"+eval(elembarcode+".value));
20
// alert(elemstatus+"\n"+eval(elemstatus+".value"));
21
        if(eval(elembarcode+".value") =='' && eval(elemstatus+".value") == 2){
22
            var answer = confirm("Leave barcode blank?\n - Note: unable to change this later");
23
            if (answer){
24
                document.f.submit();
25
            } else {
26
                return false;
27
            }
28
        }
29
        if(eval(elembarcode+".value".indexOf('TEMP')) > 0 && eval(elemstatus+".value") == 2){
30
            var answer = confirm("A barcode was not entered.\nDo you want to put in a barcode\nor do you want to use a system generated barcode?");
31
            if (answer){
32
                document.f.submit();
33
            } else {
34
                return false;
35
            }
36
        }
37
    }
38
    [% END %]
39
}
40
function unHideItems(index,labelindex, serialId) {
41
	subfield = document.getElementById(index);
42
	subfield.style.display = 'block';
43
	label = document.getElementById(labelindex);
44
	label.style.display='none';	
45
6
46
	// Prefilling 995$h with serial enumeration/issue number
7
<p>From the search results you can click the 'Serial Receive' link or you can click on the subscription title and then click the 'Receive' button.</p>
47
	// Getting item id
48
	itemid = $("fieldset#" + index + " div.cataloguing_additem_itemlist div.items").attr("id");
49
	// Getting subfield id
50
	subfieldid = "subfield" + itemid.substr(4) + "h";
51
	// Setting text field 
52
	$("#" + subfieldid + " input[type='text']").val($("#serialseq" + serialId).val());
53
8
54
}
9
<p>The final way to receive serials is from the 'Serial Collection' page. To the left of the Subscription summary page there is a menu with a link to 'Serial Collection'</p>
55
function HideItems(index,labelindex) {
56
	subfield = document.getElementById(index);
57
	subfield.style.display = 'none';
58
	label = document.getElementById(labelindex);
59
	label.style.display='block';	
60
}
61
function setStatus(serialid){
62
    $("#status"+serialid).val("2").attr("selected","selected");
63
}
64
function changeDate(elem, adate) {
65
    $(elem).closest('tr').find('#expecteddate').val(adate);
66
}
67
function changeDate2(adate) {
68
   var elem = document.getElementById("supexpecteddate");
69
    elem.value = adate;
70
}
71
function CloneSubfield(index){
72
    var original = document.getElementById(index); //original <div>
73
    var clone = original.cloneNode(true);
74
    var new_key = CreateKey();
75
    var old_id =  original.getAttribute('id');
76
    old_id=old_id.substr(12);
77
    var new_id  = old_id+new_key;
78
    
79
    // set the attribute for the new 'div' subfields
80
    var inputs     = clone.getElementsByTagName('input');
81
    var selects    = clone.getElementsByTagName('select');
82
    var textareas  = clone.getElementsByTagName('textarea');
83
        
84
    // input
85
    var id_input = "";
86
    for(var i=0,len=inputs.length; i<len ; i++ ){
87
        id_input = inputs[i].getAttribute('id')+new_key;
88
        inputs[i].setAttribute('id',id_input);
89
        inputs[i].setAttribute('name',inputs[i].getAttribute('name'));
90
    }
91
    
92
    // select 
93
    for(var i=0,len=selects.length; i<len ; i++ ){
94
        id_input = selects[i].getAttribute('id')+new_key;
95
        selects[i].setAttribute('id',selects[i].getAttribute('id')+new_key);
96
        selects[i].setAttribute('name',selects[i].getAttribute('name'));
97
    }
98
    
99
    // textarea
100
    for(var i=0,len=textareas.length; i<len ; i++ ){
101
        id_input = textareas[i].getAttribute('id')+new_key;
102
        textareas[i].setAttribute('id',textareas[i].getAttribute('id')+new_key);
103
        textareas[i].setAttribute('name',textareas[i].getAttribute('name'));
104
    }
105
    
106
    [% UNLESS ( advancedMARCEditor ) %]
107
    // when cloning a subfield, reset its label too.
108
    var label = clone.getElementsByTagName('label')[0];
109
    label.setAttribute('for',id_input);
110
    [% END %]
111
    
112
    // setting a new if for the parent div
113
    clone.setAttribute('id',new_id);
114
    
115
    var CloneButtonPlus;
116
    try {
117
      var spans = clone.getElementsByTagName('span');
118
      if(spans.length){
119
          for(var i = 0 ,lenspans = spans.length ; i < lenspans ; i++){
120
            if(spans[i].getAttribute('class') == 'buttonPlus'){
121
                    CloneButtonPlus = spans[i];
122
                    CloneButtonPlus.setAttribute('onclick',"CloneSubfield('" + new_id + "')");
123
                    var buttonUp = clone.getElementsByTagName('img')[0];
124
                    buttonUp.setAttribute('onclick',"upSubfield('" + new_id + "')");
125
                }
126
            }
127
        }
128
    }
129
    catch(e){
130
        // do nothig if ButtonPlus & CloneButtonPlus don't exist.
131
    }
132
    // insert this line on the page
133
    original.parentNode.insertBefore(clone,original.nextSibling);
134
}
135
$(document).ready(function() {
136
	$("form#serials_edit").submit(function() {
137
	    var total_errors = 0;
138
        $(".subfield_line:visible", this).each(function() {
139
            if ($("*[name=field_value]", this).val().length == 0 &&
140
                $("*[name=mandatory]", this).val() == 1) {
141
                total_errors++;
142
            }
143
        });
144
        if ( total_errors > 0 ) {
145
            var mes  = _("Form not submitted because of the following problem(s)");
146
            mes += "\n------------------------------------------------------------------------------------\n";
147
            mes += "\n- "+ total_errors+_(" mandatory fields empty (see bold subfields)");
148
            alert(mes);
149
            return false;
150
        }
151
    });
152
});
153
//]]>
154
</script>
155
<style type="text/css">#serials_edit fieldset.rows label, #serials_edit fieldset.rows span.label {
156
	font-size : 100%;
157
	width : 25%;
158
}
159
#serials_edit fieldset.rows select { max-width : 15em; }
160
#serials_edit fieldset.rows li {
161
	padding-bottom : 3px;
162
}
163
#serials_edit .input_marceditor {
164
	width : auto;
165
}</style>
166
</head>
167
<body id="ser_serials-edit" class="ser">
168
[% INCLUDE 'header.inc' %]
169
[% INCLUDE 'serials-search.inc' %]
170
10
171
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Serial edition <i>[% bibliotitle %] [% IF ( callnumber ) %]([% callnumber %])[% END %]</i></div>
11
<p>From the page that opens up you can click 'Edit Serial' with the issue you want to receive checked.</p>
172
12
173
<div id="doc3" class="yui-t2">
13
<p>All three of these options will open up the issue receive form:</p>
174
   
175
   <div id="bd">
176
	<div id="yui-main">
177
	<div class="yui-b">
178
14
179
<h1>Serial edition <i>[% bibliotitle %]</i>
180
	[% IF location %] ( [% location %] ) [% END %]
181
    [% IF ( callnumber ) %] callnumber: [% callnumber %][% END %]</h1>
182
<form method="post" name="f" action="serials-edit.pl" id="serials_edit">
183
<!--onsubmit="return barcode_check()">-->
184
185
[% IF ( Errors ) %]
186
<div class="dialog alert">
187
<ul>
15
<ul>
188
[% IF ( barcode_not_unique ) %]<li>Error: Barcode not unique for [% FOREACH errse IN errseq %]serialseq [% errse.serialseq %]<br/>[% END %]</li>[% END %]
16
	<li>Choose 'Arrived' from the status pull down to mark a serial as received.</li>
17
	<li>If you have decided to have an item record created for each issue an item add form will appear</li>
18
	<li>If your issue has a supplemental issue with it, fill in the Supplemental Issue information.</li>
19
	<li>If you have decided to have an item record created for each issue an item add form will appear for your supplement and for the issue itself</li>
20
	<li>Once you have entered your info you can click 'Save'</li>
189
</ul>
21
</ul>
190
</div>
191
[% END %]
192
193
    <input type="hidden" name="op" value="serialchangestatus" />
194
    [% FOREACH subscription IN subscriptions %]
195
    <input type="hidden" name="subscriptionid" value="[% subscription.subscriptionid %]" />
196
    [% END %]
197
	<table>
198
	<tr>
199
		<th>Numbered</th>
200
		<th>Published on</th>
201
		<th>Expected on</th>
202
		<th>Status</th>
203
		<th>Notes</th>
204
	</tr>
205
[% FOREACH serialslis IN serialslist %]
206
    [% UNLESS ( loop.odd ) %]
207
    <tr class="highlight">
208
    [% ELSE %]
209
    <tr>
210
    [% END %]
211
        <td>
212
            <input type="hidden" name="serialid" value="[% serialslis.serialid %]" />
213
            <input type="hidden" name="biblionumber" value="[% serialslis.biblionumber %]" />
214
            <input type="hidden" name="itemcount" value="[% serialslis.issuesatonce %]" />
215
            <input type="hidden" name="user" value="[% serialslis.librarian %]" />
216
            Issue <input type="text" name="serialseq" id="serialseq[% serialslis.serialid %]" value="[% serialslis.serialseq %]" size="20" maxlength="100" />
217
        </td>
218
        <td>
219
            <input type="text" name="publisheddate" value="[% serialslis.publisheddate %]" size="10" maxlength="15" />
220
        </td>
221
        <td>
222
            <input type="text" id="expecteddate" name="planneddate" value="[% serialslis.planneddate %]" size="10" maxlength="15" />
223
        </td>
224
        <td>
225
            [% IF ( serialslis.editdisable ) %]
226
              <input type="hidden" name="status" id="status[% serialslis.serialid %]" value="1">
227
              <select name="status" size="1"  disabled="disabled">
228
            [% ELSE %]
229
              [% IF ( serialslis.serialsadditems ) %]
230
              <select name="status" size="1" id="status[% serialslis.serialid %]" onchange="if (this.value==2){unHideItems('items'+[% serialslis.subscriptionid %][% serialslis.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]','[% serialslis.serialid %]'); changeDate(this, '[% serialslis.arriveddate %]')} else if (this.value==7){changeDate(this, '[% serialslis.arriveddate %]')} else { HideItems('items'+[% serialslis.subscriptionid %]+[% serialslis.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate(this, '[% serialslis.planneddate %]')}" >
231
               [% ELSE %]
232
              <select name="status" size="1" id="status[% serialslis.serialid %]" onchange="if (this.value==2 || this.value==7){changeDate(this, '[% serialslis.arriveddate %]')} else {changeDate(this, '[% serialslis.planneddate %]')}" >
233
               [% END %] 
234
            [% END %]
235
  [% IF ( serialslis.status1 ) %]
236
                    <option value="1" selected="selected">Expected</option>
237
  [% END %]
238
  [% IF ( serialslis.status2 ) %]
239
                    <option value="2" selected="selected">Arrived</option>
240
  [% ELSE %]
241
                    <option value="2">Arrived</option>
242
  [% END %]
243
  [% IF ( serialslis.status3 ) %]
244
                    <option value="3" selected="selected">Late</option>
245
  [% ELSE %]
246
                    <option value="3">Late</option>
247
  [% END %]
248
  [% IF ( serialslis.status4 ) %]
249
                    <option value="4" selected="selected">Missing</option>
250
  [% ELSE %]
251
                    <option value="4">Missing</option>
252
  [% END %]
253
  [% IF ( serialslis.status7 ) %]
254
                    <option value="7" selected="selected">Claimed</option>
255
  [% ELSE %]
256
                    <option value="7">Claimed</option>
257
  [% END %]
258
  [% IF ( serialslis.status5 ) %]
259
                    <option value="5" selected="selected">Not available</option>
260
  [% ELSE %]
261
                    <option value="5">Not available</option>
262
  [% END %]
263
  [% IF ( serialslis.status6 ) %]
264
                    <option value="6" selected="selected">Delete</option>
265
  [% ELSE %]
266
                    <option value="6">Delete</option>
267
  [% END %]
268
            </select>
269
270
        </td>
271
        <td>
272
            <input type="text" name="notes" value="[% serialslis.sernotes %]" size="20" maxlength="255" />
273
        </td>
274
    </tr>
275
  [% UNLESS ( serialslis.subscriptionexpired ) %]
276
  [% IF ( serialslis.serialsadditems ) %]
277
          <tr>
278
          <td colspan="5">
279
      <a id="label[% serialslis.subscriptionid %][% serialslis.serialid %]" style="color: grey; font-size: 80%; cursor: pointer;"  onclick="unHideItems('items[% serialslis.subscriptionid %][% serialslis.serialid %]','label[% serialslis.subscriptionid %][% serialslis.serialid %]',  '[% serialslis.serialid %]');setStatus([% serialslis.serialid %]);">
280
             Click to add item</a>
281
        <fieldset class="rows" style="display:none;" id="items[% serialslis.subscriptionid %][% serialslis.serialid %]">
282
        <legend><a style="cursor: pointer;"  onclick="HideItems('items[% serialslis.subscriptionid %][% serialslis.serialid %]','label[% serialslis.subscriptionid %][% serialslis.serialid %]')">
283
                Item</a>
284
        </legend>
285
          <div class="cataloguing_additem_itemlist">
286
        [% FOREACH item IN serialslis.items %]
287
        <div id="item[% item.serialid %][% item.countitems %]" class="items">
288
        <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li>
289
               <div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
290
                              
291
                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
292
                [% iteminformatio.marc_value %]
293
                <input type="hidden" name="itemid" value="[% item.itemid %]" />
294
                <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
295
                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
296
                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
297
                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
298
                [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
299
                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% item.serialid %][% item.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
300
                [% END %]
301
        
302
            </div></li>
303
        [% END %]</ol></div><!-- /iteminformation -->
304
        
305
        <input type="hidden" name="moditem" value="" /> 
306
        <input type="hidden" name="tag" value="[% item.itemtagfield %]" />
307
        <input type="hidden" name="subfield" value="[% item.itemtagsubfield %]" />
308
        <input type="hidden" name="serial" value="[% item.serialid %]" />
309
        <input type="hidden" name="bibnum" value="[% item.biblionumber %]" />
310
        <input type="hidden" name="itemid" value="[% item.itemid %]" />
311
        <input type="hidden" name="field_value" value="[% item.itemnumber %]" />
312
        [% END %] <!-- /items -->
313
        </div>
314
        </fieldset>
315
    </td>
316
    </tr>
317
  [% END %]
318
  [% END %]
319
[% END %]
320
[% FOREACH newserialloo IN newserialloop %]
321
    [% UNLESS ( newserialloo.subscriptionexpired ) %]
322
    <tr>
323
        <td>
324
            <input type="hidden" name="serialid" value="NEW" />
325
            <input type="hidden" name="biblionumber" value="[% newserialloo.biblionumber %]" />
326
            <input type="hidden" name="itemcount" value="[% newserialloo.issuesatonce %]" />
327
            <input type="hidden" name="user" value="[% newserialloo.librarian %]" />
328
            Supplemental issue <input type="text" name="serialseq" id="serialseq[% newserialloo.serialid %]" value="" size="20" maxlength="100" onchange="if (this.value!=''){unHideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]', '[% newserialloo.serialid %]')} else {HideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]')}" />
329
        </td>
330
        <td>
331
            <input type="text" name="publisheddate" value="[% newserialloo.publisheddate %]" size="10" maxlength="15" />
332
        </td>
333
        <td>
334
            <input type="text" name="planneddate" id="supexpecteddate" value="[% newserialloo.planneddate %]" size="10" maxlength="15" />
335
        </td>
336
        <td>
337
            <select name="status" size="1" id="addstatus[% newserialloo.serialid %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]','[% newserialloo.serialid %]'); changeDate2('[% newserialloo.arriveddate %]')} else if (this.value==7){changeDate('[% newserialloo.arriveddate %]')} else { HideItems('items'+'[% newserialloo.subscriptionid %]'+[% newserialloo.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate2('[% serialslis.planneddate %]')}" >
338
22
339
                    <option value="">----</option>
23
<p>If you are receiving multiple issues at once, or have marked an issue as 'Late' or 'Missing' there you can click the 'Generate Next' button below the list of issues.</p>
340
  [% IF ( newserialloo.status1 ) %]
341
                    <option value="1" selected="selected">Expected</option>
342
  [% END %]
343
  [% IF ( newserialloo.status2 ) %]
344
                    <option value="2" selected="selected">Arrived</option>
345
  [% ELSE %]
346
                    <option value="2">Arrived</option>
347
  [% END %]
348
  [% IF ( newserialloo.status3 ) %]
349
                    <option value="3" selected="selected">Late</option>
350
  [% ELSE %]
351
                    <option value="3">Late</option>
352
  [% END %]
353
  [% IF ( newserialloo.status4 ) %]
354
                    <option value="4" selected="selected">Missing</option>
355
  [% ELSE %]
356
                    <option value="4">Missing</option>
357
  [% END %]
358
  [% IF ( newserialloo.status7 ) %]
359
                    <option value="7" selected="selected">Claimed</option>
360
  [% ELSE %]
361
                    <option value="7">Claimed</option>
362
  [% END %]
363
  [% IF ( newserialloo.status5 ) %]
364
                    <option value="5" selected="selected">Not available</option>
365
  [% ELSE %]
366
                    <option value="5">Not available</option>
367
  [% END %]
368
  [% IF ( newserialloo.status6 ) %]
369
                    <option value="6" selected="selected">Delete</option>
370
  [% ELSE %]
371
                    <option value="6">Delete</option>
372
  [% END %]
373
            </select>
374
24
375
        </td>
25
<p>Clicking this button will generate the next issue for you and mark the previously expected issue as 'Late' automatically. You can then check the 'Edit' box to the right of each issue and edit the status on multiple issues at once.</p>
376
        <td>
377
            <input type="text" name="notes" value="" size="20" maxlength="255" />
378
        </td>
379
    </tr>
380
  [% IF ( newserialloo.serialsadditems ) %]
381
          <tr>
382
          <td colspan="5">
383
      <a id="label[% newserialloo.subscriptionid %][% newserialloo.serialid %]" style="color: grey; font-size: 80%; cursor: pointer;"  onclick="unHideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]', '[% newserialloo.serialid %]')">
384
             Click to add item</a>
385
        <fieldset  class="rows" style="display:none;" id="items[% newserialloo.subscriptionid %][% newserialloo.serialid %]">
386
        <legend><a style="cursor: pointer;"  onclick="HideItems('items[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]')">
387
                Item</a>
388
        </legend>
389
          <div class="cataloguing_additem_itemlist">
390
        <div id="item[% newserialloo.serialid %][% newserialloo.countitems %]" class="items">
391
        <ol>[% FOREACH iteminformatio IN newserialloo.iteminformation %]<li>
392
               <div class="subfield_line" style="[% iteminformatio.hidden %];" id="subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
393
   
394
                <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
395
                [% iteminformatio.marc_value %]
396
                <input type="hidden" name="itemid" value="[% newserialloo.itemid %]" />
397
                <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
398
                <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
399
                <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
400
                <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
401
                [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
402
                    <span class="buttonPlus" onclick="CloneSubfield('subfield[% newserialloo.serialid %][% newserialloo.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
403
                [% END %]
404
        </div>
405
       </li>[% END %]</ol>
406
        
407
        <input type="hidden" name="moditem" value="" /> 
408
        <input type="hidden" name="tag" value="[% newserialloo.itemtagfield %]" />
409
        <input type="hidden" name="subfield" value="[% newserialloo.itemtagsubfield %]" />
410
        <input type="hidden" name="serial" value="[% newserialloo.serialid %]" />
411
        <input type="hidden" name="bibnum" value="[% newserialloo.biblionumber %]" />
412
        <input type="hidden" name="itemid" value="[% newserialloo.itemid %]" />
413
        <input type="hidden" name="field_value" value="[% newserialloo.itemnumber %]" />
414
        </div>
415
        </div>
416
        </fieldset>
417
    </td>
418
    </tr>
419
  [% END %]
420
  [% END %]
421
[% END %]
422
26
423
</table>
27
<p><strong>See the full documentation for Receiving a Serial in the <a href="http://manual.koha-community.org/3.8/en/receiveissues.html">manual</a> (online).</strong></p>
424
    <fieldset class="action"><input type="submit" value="Save"  class="button" accesskey="w" />
425
</form>
426
28
427
</div>
29
[% INCLUDE 'help-bottom.inc' %]
428
</div>
429
430
<div class="yui-b">
431
[% INCLUDE 'serials-menu.inc' %]
432
<ul>
433
    [% FOREACH subscription IN subscriptions %]
434
        <li><a href="serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]" title="serial collection for [% subscription.bibliotitle %]">Serial collection #[% subscription.subscriptionid %]</a></li>
435
        <li><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" title="detail of the subscription">Subscription #[% subscription.subscriptionid %]</a></li>
436
        [% IF ( subscription.abouttoexpire ) %]
437
            <li><a href="#" onclick="javascript:popup([% subscription.subscriptionid %])">Renew #[% subscription.subscriptionid %]</a></li>
438
        [% END %]
439
    [% END %]
440
    <li><a href="/cgi-bin/koha/catalogue/[% default_bib_view %].pl?biblionumber=[% biblionumber %]" title="go to [% bibliotitle %]">Show biblio</a></li></ul>
441
</div>
442
</div>
443
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt (-153 / +6 lines)
Lines 1-159 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
<title>Koha &rsaquo; Serials [% biblionumber %]</title>
3
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
4
[% INCLUDE 'doc-head-close.inc' %]
5
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
6
[% INCLUDE 'datatables-strings.inc' %]
7
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
8
<script type="text/javascript">
9
//<![CDATA[
10
 $(document).ready(function() {
11
    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
12
        "aoColumnDefs": [
13
            { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
14
        ],
15
        "sPaginationType": "four_button"
16
    } ) );
17
2
18
    srlt.fnAddFilters("filter", 750);
3
<h1>Serials</h1>
19
 });
20
 //]]>
21
</script>
22
</head>
23
<body id="ser_serials-home" class="ser">
24
[% INCLUDE 'header.inc' %]
25
[% INCLUDE 'serials-search.inc' %]
26
4
27
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Search results[% ELSE %]Serials [% END %] </div>
5
<p>The serials module assists in managing your serial subscriptions (journals, magazines, and newspapers).</p>
28
6
29
<div id="doc3" class="yui-t2">
7
<p>You can search for existing subscriptions by using the search box at the top of the page. You can search for any part of the serial title or ISSN.</p>
30
   
31
   <div id="bd">
32
	<div id="yui-main">
33
	<div class="yui-b">
34
	[% INCLUDE 'serials-toolbar.inc' %]
35
	
36
[% IF ( information ) %]
37
Serials updated :
38
<table>
39
  <tr>
40
    <th>
41
      Serialseq
42
    </th>
43
    <th>
44
      Status
45
    </th>
46
    <th>
47
      Published date
48
    </th>
49
    <th>
50
      Planned date
51
    </th>
52
    <th>
53
      Notes
54
    </th>
55
  </tr>  
56
[% FOREACH informatio IN information %]
57
  <tr>
58
    <td>
59
      [% informatio.serialseq %]
60
    </td>
61
    <td>
62
      [% informatio.status %]
63
    </td>
64
    <td>
65
      [% informatio.publisheddate %]
66
    </td>
67
    <td>
68
      [% informatio.planneddate %]
69
    </td>
70
    <td>
71
      [% informatio.notes %]
72
    </td>
73
  </tr>  
74
[% END %]
75
</table>
76
[% END %]
77
        [% IF ( done_searched ) %]
78
<h2>Serials subscriptions</h2>
79
8
80
    <table id="srlt">
9
<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.8/en/serials.html">manual</a> (online).</strong></p>
81
	<thead>
82
        <tr>
83
            <th>ISSN</th>
84
            <th>Title</th>
85
            <th> Notes </th>
86
            <th>
87
                Library (callnumber)
88
            </th>
89
            [% IF ( routing && CAN_user_serials_routing ) %]
90
              <th>Routing list</th>
91
            [% END %]        
92
            <th>&nbsp;</th>
93
            <th>&nbsp;</th>
94
        </tr>
95
	</thead>
96
    <tfoot>
97
        <tr>
98
            <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
99
            <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
100
            <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
101
            <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
102
            [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
103
            <td></td>
104
            <td></td>
105
        </tr>
106
    </tfoot>
107
	<tbody> 
108
        [% FOREACH subscription IN subscriptions %]
109
            <tr>
110
                <td>
111
                [% IF ( subscription.issn ) %][% subscription.issn %]
112
                [% END %]
113
                </td>
114
                <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
115
                </td>
116
                <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
117
                [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
118
                </td>
119
                <td>
120
                [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
121
                [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %]
122
                </td>
123
                [% IF ( routing && CAN_user_serials_routing ) %]
124
                <td>
125
                    [% IF ( subscription.cannotedit ) %]
126
                        &nbsp;
127
                    [% ELSE %]
128
                        [% IF ( subscription.routingedit ) %]
129
                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
130
                        [% ELSE %]
131
                            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
132
                        [% END %]
133
                    [% END %]
134
                </td>
135
                [% END %]
136
                <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
137
                </td>
138
                <td>
139
                [% IF ( subscription.cannotedit ) %]
140
                  &nbsp;        
141
                [% ELSE %]
142
                  [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
143
                [% END %]
144
                </td>
145
            </tr>
146
        [% END %]
147
	</tbody>
148
    </table>
149
    
150
        [% END %]
151
10
152
</div>
11
[% INCLUDE 'help-bottom.inc' %]
153
</div>
154
12
155
<div class="yui-b">
156
[% INCLUDE 'serials-menu.inc' %]
157
</div>
158
</div>
159
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt (-1449 / +88 lines)
Lines 1-1450 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; [% IF ( modify ) %][% bibliotitle |html %] &rsaquo; Modify subscription[% ELSE %]New subscription[% END %]</title>
2
3
[% INCLUDE 'doc-head-close.inc' %]
3
<h1>Add A New Serial Subscription</h1>
4
[% INCLUDE 'calendar.inc' %]
4
5
<p>Subscriptions can be added by clicking the 'New' button on any bibliographic record or by visiting the Serials module and clicking 'New Subscription'</p>
6
7
<p>If you are entering a new subscription from the Serials module you will be presented with a blank form (if creating new from a bibliographic record the form will include the bib info).</p>
8
9
<ul>
10
	<li>'Librarian' field will show the logged in librarian's username</li>
11
	<li>'Vendor' can be found by either searching vendors entered via the Acquisitions module or entering the vendor ID number
12
<ul>
13
	<li>Vendor information is not required</li>
14
	<li>In order to claim missing and late issues you need to enter vendor information</li>
15
</ul>
16
</li>
17
	<li>'Biblio' is the MARC record you'd like to link this subscription to
18
<ul>
19
	<li>This can be done by searching for an existing record by clicking on the 'Search for Biblio' link below the boxes or by entering the bib number for a record in the first box. Only if you search with the field between the parenthesis.</li>
20
</ul>
21
</li>
22
	<li>Next you can choose whether a new item is created when receiving an issue</li>
23
	<li>'Location' is for the shelving location</li>
24
	<li>'Call Number' is for your item's call number prefix</li>
25
	<li>'Library' is the library that owns this subscription.
26
<ul>
27
	<li>If more than one library subscribes to this serial you will need to create a subscription for each library</li>
28
	<li>This can be done easily by using the 'Edit as New (Duplicate)' option found on the subscription information page and changing only the 'Library' field</li>
29
</ul>
30
</li>
31
	<li>The 'Grace Period' is the number of days before an issue is automatically moved from 'expected' status to 'waiting' and how many days before an issue is automatically moved from 'waiting' status to 'late'</li>
32
	<li>Use the 'Public Note' for any notes you would like to appear in the OPAC for the patrons</li>
33
	<li>'Nonpublic Note' should be used for notes that are only visible to the librarians via the staff client</li>
34
	<li>To set up a routing list for serials, choose 'Routing List' from the 'Patron notification' field.
35
<ul>
36
	<li>For this option to appear you need to make sure that you have a Routing List notice set up in the Notices Tool</li>
37
	<li>Learn more about Routing Lists later in this manual</li>
38
</ul>
39
</li>
40
	<li>The Staff and OPAC Display options allow you to control how many issues appear by default on bibliographic records in the Staff Client and the OPAC
41
<ul>
42
	<li>If no values are entered in these fields, they will use the OPACSerialIssueDisplayCount and StaffSerialIssueDisplayCount system preference values</li>
43
</ul>
44
</li>
45
	<li>In 'First issue publication date' you want to enter the date of the issue you have in your hand, the date from which the prediction pattern will start</li>
46
	<li>There are several pre-defined options for the 'Frequency' of publication
47
<ul>
48
	<li>Without periodicy: some very specific (usually high level science journals) don't have a true periodicity. When you subscribe to the title, you subscribe for 6 issues, which can arrive in 1 year... or 2... There is no regularity or known schedule.</li>
49
	<li>Unknown select this if none of the other choices are relevant</li>
50
	<li>Irregular: The journal is not "regular" but has a periodicity. You know that it comes out on January, then in October and December, it is irregular, but you know when it's going to arrive.</li>
51
	<li>2/day: Twice daily</li>
52
	<li>1/day: Daily</li>
53
	<li>3/week: Three times a week</li>
54
	<li>1/week: Weekly</li>
55
	<li>1/ 2 weeks: Twice monthly (fortnightly)</li>
56
	<li>1/ 3 weeks: Tri-weekly</li>
57
	<li>1/month: Monthly</li>
58
	<li>1/ 2 months (6/year): Bi-monthly</li>
59
	<li>1/ 3 months (1/quarter): Quarterly</li>
60
	<li>1/quarter (seasonal) : Quarterly related to seasons (ie. Summer, Autumn, Winter, Spring)</li>
61
	<li>2/year: Half yearly</li>
62
	<li>1/year: Annual</li>
63
	<li>1/ 2 years: Bi-annual</li>
64
</ul>
65
</li>
66
	<li>Checking the 'Manual history' box will allow you to enter serials outside the prediction pattern.</li>
67
	<li>'Numbering pattern' will help you determine how the numbers are printed for each issue
68
<ul>
69
	<li>Start with the numbering on the issue you have in hand, the numbering that matches the date you entered in the 'First issue publication' field</li>
70
	<li>If you have chosen any 'Numbering Format' other than 'Number' in the 'Rollover at' field, enter the last issue number before the volume number changes
71
<ul>
72
	<li>If you chose the 'Number' Numbering Format you will see 'issues expected' in which you will enter the total number of issues you expect to receive.</li>
73
</ul>
74
</li>
75
	<li>You can choose to create your own numbering pattern by choosing 'None of the above' and clicking the 'Show/Hide Advanced Pattern' button at the bottom of the form</li>
76
</ul>
77
</li>
78
	<li>'Subscription start date' is the date at which the subscription begins. This is used for setting up renewal alerts</li>
79
	<li>'Subscription length' is the number of issues or months in the subscription. This is also used for setting up renewal alerts</li>
80
	<li>'Subscription end date' should only be entered for subscriptions that have ended (if you're entering in a backlog of serials)</li>
81
	<li>The 'Numbering formula' is editable to match the way you'd like your numbering to print on the item record and subscription information pages</li>
82
</ul>
83
84
<p>Click 'Save Subscription' to save the information you have entered.</p>
85
86
<p><strong>See the full documentation for Adding a Subscription in the <a href="http://manual.koha-community.org/3.8/en/serials.html#newsubscription">manual</a> (online).</strong></p>
87
88
[% INCLUDE 'help-bottom.inc' %]
5
89
6
<style type="text/css">
7
fieldset.rows li.radio { width: 100%; } /* override staff-global.css */
8
.yui-u li p label.widelabel {
9
    width: 300px;  /* not enough for IE7 apparently */
10
}
11
</style>
12
<script type="text/javascript">
13
//<![CDATA[
14
15
// the english words used in display purposes
16
var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern"),
17
_("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
18
var weekno_label = _("Week # ");
19
var is_season = 0;
20
var is_hemisphere = 1;
21
var irregular_issues;   // will hold irregularity object.
22
23
function formatDate(myDate) {
24
    var d = new Array( myDate.getFullYear(), myDate.getMonth() + 1 ,myDate.getDate());
25
    if(d[1].toString().length == 1) { d[1] = '0'+d[1] };
26
    if(d[2].toString().length == 1) { d[2] = '0'+d[2] };
27
    [% IF ( dateformat_us ) %]
28
        return(d[1] + '/' + d[2] + '/' + d[0]) ;
29
    [% ELSIF ( dateformat_metric ) %]
30
        return(d[2] + '/' + d[1] + '/' + d[0]) ;
31
    [% ELSE %]
32
        return(''+d[0] + '-' + d[1] + '-' + d[2]) ;
33
    [% END %]    
34
}
35
36
Date.prototype.addDays = function(days) {
37
    this.setDate(this.getDate()+days);
38
}
39
40
function getWeeksArray(startDate,periodicity) {
41
// returns an array of syspref-formatted dates starting at the first day of startDate's year.
42
// This prediction method will not accurately predict irregularites beyond the first year.
43
// FIXME : Should replace with ajax query to get the first Monday of the year so that week numbers have correct dates.
44
    var incr=1;
45
    if(periodicity==3) {  // 1/2 wks
46
        incr=2;
47
    } else if(periodicity == 4) { // 1/3 wks
48
        incr=3;
49
    }
50
    var weeksArray = new Array;
51
    var jan01 = new Date();
52
    jan01.setDate(1);
53
    jan01.setMonth(0);
54
    jan01.setFullYear(startDate.getFullYear());
55
    for(var i=0;i<52;i++) {
56
        weeksArray[i] = formatDate(jan01) + ' ' + weekno_label + (i + 1);
57
        jan01.addDays( 7 ); 
58
    }
59
    return weeksArray;
60
}
61
62
function YMDaToYWDa(S) {
63
    with (new Date(Date.UTC(S[0], S[1] - 1, S[2]))) {
64
        var DoW = getUTCDay();
65
        setUTCDate(getUTCDate() - (DoW + 6) % 7 + 3);
66
        var ms = valueOf();
67
        setUTCMonth(0, 4);
68
        var WN = Math.round((ms - valueOf()) / 604800000) + 1;
69
        return [getUTCFullYear(), WN, DoW == 0 ? 7 : DoW];
70
    }
71
}
72
function dayofyear(d) { // d is a Date object
73
var yn = d.getFullYear();
74
var mn = d.getMonth();
75
var dn = d.getDate();
76
var d1 = new Date(yn,0,1,12,0,0); // noon on Jan. 1
77
var d2 = new Date(yn,mn,dn,12,0,0); // noon on input date
78
var ddiff = Math.round((d2-d1)/864e5);
79
return ddiff+1;
80
}
81
82
83
// create irregularity object.
84
function IrregularPattern() {
85
	this.months = new Array(_("January"),_("February"),_("March"),_("April"),_("May"),_("June"),_("July"),_("August"),_("September"),_("October"),_("November"),_("December"));
86
	this.seasons = new Array(_("Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"));
87
    this.daynames = new Array(_("Monday"),_("Tuesday"),_("Wednesday"),_("Thursday"),_("Friday"),_("Saturday"),_("Sunday"));
88
    // create weeks irregularity selection array:
89
    this.firstissue = new Date();
90
    this.firstissue.setDate(1);
91
    this.firstissue.setMonth(0);
92
    [% IF ( firstacquiyear ) %] // it's a mod, we already have a start date.
93
        this.firstissue.setFullYear( [% firstacquiyear %] );
94
    [% END %]
95
   	this.weeks = getWeeksArray(this.firstissue); 
96
97
    this.numskipped = 0;
98
    // init:
99
	var irregular = '[% irregularity %]';
100
    this.skipped = irregular.split(',');
101
}
102
103
IrregularPattern.prototype.update = function() {
104
		this.skipped= new Array;
105
		var cnt = 0;
106
		// daily periodicity, we interpret irregular array as which days of week to skip.
107
		// else if weekly periodicity, week numbers (starting from 01 Jan) to skip.
108
        // else  irregular array is list of issues to skip
109
		var summary_str = '';
110
		this.numskipped = 0;
111
        if(document.f.irregularity_select) {
112
            //$("#irregularity_select option:selected").each(...); //jquery can combine both conditionals and the for loop
113
            for( var i in document.f.irregularity_select.options ) {
114
                if( document.f.irregularity_select.options[i].selected ) {
115
                    this.skipped[cnt] = document.f.irregularity_select.options[i].value ;
116
                    summary_str += document.f.irregularity_select.options[i].text + "\n" ;
117
				    cnt++;
118
				    this.numskipped++;
119
			    }
120
		    }
121
		    var summary = document.getElementById("irregularity_summary");
122
		    if(summary) {
123
			    summary.value = summary_str;
124
			    summary.rows= ( cnt > 6 ) ? cnt : 6 ; // textarea will bre resized, but not more than 6 lines will show.
125
		    }
126
        }
127
}
128
129
IrregularPattern.prototype.irregular = function(index) { 
130
	for( var i in this.skipped) {
131
			if( this.skipped[i] == index) {
132
				return true;
133
			}
134
	}
135
	return false;
136
}
137
138
function init_pattern() {
139
	irregular_issues = new IrregularPattern();
140
}
141
function reset_pattern() {
142
	document.getElementById("numberpattern").value = '';
143
    document.getElementById("irregularity").innerHTML = '';
144
	init_pattern();
145
	reset_num_pattern();
146
}
147
148
// common pre defined number patterns
149
function reset_num_pattern() {
150
var patternchoice = document.getElementById("numberpattern").value;
151
    switch(patternchoice){
152
    case "2":
153
        document.f.add1.value=1;
154
        document.f.add2.value=1;
155
        document.f.add3.value=1;
156
        document.f.every1.value=12;
157
        document.f.every2.value=1;
158
        document.f.every3.value=1;
159
        document.f.whenmorethan1.value=9999999;
160
        document.f.whenmorethan2.value=12;
161
        document.f.whenmorethan3.value=4;
162
        document.f.setto1.value=0;
163
        document.f.setto2.value=1;
164
        document.f.setto3.value=1;
165
        document.f.lastvalue1.value=1;
166
        document.f.lastvalue2.value=1;
167
        document.f.lastvalue3.value=1;
168
        document.f.numberingmethod.value=_("Vol {X}, No {Y}, Issue {Z}");
169
        moreoptions(text[1],text[0],text[2]);
170
        display_table(0); // toggle info box on (1) or off (0)
171
        break;
172
    case "3":
173
        document.f.add1.value=1;
174
        document.f.add2.value=1;
175
        document.f.add3.value='';
176
        document.f.every1.value=12;
177
        document.f.every2.value=1;
178
        document.f.every3.value='';
179
        document.f.whenmorethan1.value=9999999;
180
        document.f.whenmorethan2.value=12;
181
        document.f.whenmorethan3.value='';
182
        document.f.setto1.value=0;
183
        document.f.setto2.value=1;
184
        document.f.setto3.value='';
185
        document.f.lastvalue1.value=1;
186
        document.f.lastvalue2.value=1;
187
        document.f.lastvalue3.value='';
188
        document.f.numberingmethod.value=_("Vol {X}, No {Y}");
189
        moreoptions(text[1],text[0]);
190
        display_table(0);
191
        break;
192
    case "4":
193
        document.f.add1.value=1;
194
        document.f.add2.value=1;
195
        document.f.add3.value='';
196
        document.f.every1.value=12;
197
        document.f.every2.value=1;
198
        document.f.every3.value='';
199
        document.f.whenmorethan1.value=9999999;
200
        document.f.whenmorethan2.value=12;
201
        document.f.whenmorethan3.value='';
202
        document.f.setto1.value=0;
203
        document.f.setto2.value=1;
204
        document.f.setto3.value='';
205
        document.f.lastvalue1.value=1;
206
        document.f.lastvalue2.value=1;
207
        document.f.lastvalue3.value='';
208
        document.f.numberingmethod.value=_("Vol {X}, Issue {Y}");
209
        moreoptions(text[1],text[2]);
210
        display_table(0);
211
        break;
212
    case "5":
213
//        var d = new Date(document.f.firstacquidate.value);
214
//        var smonth = d.getMonth();
215
        document.f.add1.value=1;
216
        document.f.add2.value=1;
217
        document.f.add3.value='';
218
        document.f.every1.value=12;
219
        document.f.every2.value=1;
220
        document.f.every3.value='';
221
        document.f.whenmorethan1.value=9999999;
222
        document.f.whenmorethan2.value=12;
223
        document.f.whenmorethan3.value='';
224
        document.f.setto1.value=0;
225
        document.f.setto2.value=1;
226
        document.f.setto3.value='';
227
        document.f.numberingmethod.value=_("No {X}, Issue {Y}");
228
        moreoptions(text[0],text[2]);
229
        display_table(0);
230
        break;
231
    case "6":
232
        var d = new Date(document.f.firstacquidate.value);
233
        var sYear = d.getFullYear();
234
        moreoptions_seasons(text[15],sYear);
235
        var d = new Date(document.f.firstacquidate.value);
236
        var sYear = d.getFullYear();
237
        document.f.add1.value=1;
238
        document.f.add2.value='1';
239
        document.f.add3.value='';
240
        document.f.every1.value=4;
241
        document.f.every2.value='1';
242
        document.f.every3.value='';
243
        document.f.whenmorethan1.value=9999999;
244
        document.f.whenmorethan2.value='4';
245
        document.f.whenmorethan3.value='';
246
        document.f.setto1.value=0;
247
        document.f.setto2.value='1';
248
        document.f.setto3.value='';
249
        document.f.periodicity.value='8';
250
        document.f.numberingmethod.value=_("{Y} {X}");
251
        moreoptions_seasons(text[15],sYear);
252
        document.f.lastvalue1temp.value=document.f.lastvalue1.value=sYear;
253
        display_table(0);
254
        is_season = 1;
255
        break;
256
    case "7":
257
        display_table(1);
258
        document.getElementById("more_options").innerHTML = '';
259
        document.f.irreg_check.value=1; 
260
        break;
261
    case "8":  // Year/Number
262
        var d = (document.f.firstacquidate.value) ? new Date( document.f.firstacquidate.value) : new Date() ;
263
        var sYear = d.getFullYear();
264
        document.f.add1.value=1;
265
        document.f.add2.value=1;
266
        document.f.add3.value='';
267
        document.f.every1.value=12;
268
        document.f.every2.value=1;
269
        document.f.every3.value='';
270
        document.f.whenmorethan1.value=9999999;
271
        document.f.whenmorethan2.value=12;
272
        document.f.whenmorethan3.value='';
273
        document.f.setto1.value=0;
274
        document.f.setto2.value=1;
275
        document.f.setto3.value='';
276
        document.f.lastvalue1.value=sYear;
277
          switch (document.f.periodicity.value){
278
            case 1:              
279
              var doy = dayofyear(d);
280
              document.f.lastvalue2.value=doy; 
281
              document.f.whenmorethan2.value=365; 
282
              break;      
283
            case 12:     
284
              var doy = dayofyear(d);
285
              document.f.lastvalue2.value=doy*2; 
286
              document.f.whenmorethan2.value=730; 
287
              break;      
288
            case 2:
289
            case 3:
290
            case 4:
291
              var YWDa = YMDaToYWDa(d);
292
              document.f.lastvalue2.value=YWDA[1]/(document.f.periodicity.value-1); 
293
              break;      
294
            case 5:
295
              var smonth = d.getMonth();
296
              document.f.lastvalue2.value=smonth;
297
              break;      
298
            case 6:
299
              var smonth = d.getMonth();
300
              document.f.lastvalue2.value=smonth/2;
301
              document.f.whenmorethan2.value=6;
302
              break;      
303
            case 7:
304
            case 8:      
305
              var smonth = d.getMonth();
306
              document.f.lastvalue2.value=smonth/3;
307
              document.f.whenmorethan2.value=4;
308
              break;      
309
            case 9:                        
310
              var smonth = d.getMonth();
311
              document.f.lastvalue2.value=smonth/6;
312
              document.f.whenmorethan2.value=2;
313
              break;      
314
            default:
315
          } 
316
        document.f.lastvalue3.value='';
317
        document.f.numberingmethod.value=_("{X} / {Y}");
318
        moreoptions(text[16],text[0]);
319
     //   document.f.lastvalue1temp.value=sYear;
320
     //   document.f.lastvalue2temp.value=document.f.lastvalue2.value;
321
        display_table(0);
322
        break;
323
    default:
324
        document.f.add1.value=1;
325
        document.f.add2.value='';
326
        document.f.add3.value='';
327
        document.f.every1.value=1;
328
        document.f.every2.value='';
329
        document.f.every3.value='';
330
        document.f.whenmorethan1.value=9999999;
331
        document.f.whenmorethan2.value='';
332
        document.f.whenmorethan3.value='';
333
        document.f.setto1.value=0;
334
        document.f.setto2.value='';
335
        document.f.setto3.value='';
336
        document.f.lastvalue1.value=1;
337
        document.f.lastvalue2.value='';
338
        document.f.lastvalue3.value='';
339
        document.f.numberingmethod.value='{X}';
340
//        moreoptions_daily_check(text[0]);
341
        moreoptions(text[0]);
342
        document.f.irreg_check.value=1;
343
        display_table(0);
344
        break;
345
    }
346
}
347
348
function display_table(n) {
349
    if(n==1){
350
        document.getElementById("basetable").style.display = 'block';
351
    } else if(n==0){
352
        document.getElementById("basetable").style.display = 'none';
353
    } else {
354
		var disp_val = ( document.getElementById("basetable").style.display == 'none' ) ? 'block' : 'none' ;
355
			document.getElementById("basetable").style.display = disp_val;
356
	}
357
}
358
359
function set_num_pattern_from_template_vars() {
360
	if(!document.getElementById("numberpattern")){ return false; }
361
    document.getElementById("numberpattern").value = '[% numberpattern %]';
362
    reset_num_pattern();
363
    
364
    document.f.add1.value='[% add1 %]';
365
    document.f.add2.value='[% add2 %]';
366
    document.f.add3.value='[% add3 %]';
367
    document.f.every1.value='[% every1 %]';
368
    document.f.every2.value='[% every2 %]';
369
    document.f.every3.value='[% every3 %]';
370
    document.f.whenmorethan1.value='[% whenmorethan1 %]';
371
    document.f.whenmorethan2.value='[% whenmorethan2 %]';
372
    document.f.whenmorethan3.value='[% whenmorethan3 %]';
373
    document.f.setto1.value='[% setto1 %]';
374
    document.f.setto2.value='[% setto2 %]';
375
    document.f.setto3.value='[% setto3 %]';
376
    document.f.lastvalue1.value='[% lastvalue1 %]';
377
    document.f.lastvalue2.value='[% lastvalue2 %]';
378
    document.f.lastvalue3.value='[% lastvalue3 %]';
379
    document.f.numberingmethod.value='[% numberingmethod %]';
380
381
    var more_strY;
382
    var more_strZ;
383
    [% IF ( add2 ) %]
384
    if([% add2 %] > 0){
385
        more_strY="Y";
386
    }
387
    [% END %]
388
    [% IF ( add3 ) %]
389
    if([% add3 %] > 0){
390
        more_strZ="Z";
391
    }
392
    [% END %]
393
    document.f.lastvalue1temp.value='[% lastvalue1 %]';
394
    if(more_strY){
395
        document.f.lastvalue2temp.value='[% lastvalue2 %]';
396
    document.f.whenmorethan2temp.value='[% whenmorethan2 %]';
397
    }
398
    if(more_strZ){
399
        document.f.lastvalue3temp.value='[% lastvalue3 %]';
400
    document.f.whenmorethan3temp.value='[% whenmorethan3 %]';
401
    }
402
}
403
404
// a pre check with more options to see if 'number' and '1/day' are chosen
405
function moreoptions_daily_check(x) {
406
    var periodicity = document.f.periodicity.value;
407
    var errortext='';
408
    if(periodicity == 1){ // i.e. daily
409
        document.getElementById("irregularity").innerHTML = '';
410
        errortext =_("Please indicate which days of the week you DO NOT expect to receive issues.")+"<br \/>";
411
        for(var j=0;j<irregular_issues.daynames.length;j++){
412
            errortext +="<input type='checkbox' name='irregular' id='irregular"+(j+1)+"' value='"+(j+1)+"' />"+irregular_issues.daynames[j]+" &nbsp; ";
413
        }
414
        var error = errortext;
415
        moreoptions(x);
416
        document.getElementById("irregularity").innerHTML = error;
417
    } else {
418
        document.getElementById("irregularity").innerHTML = '';
419
        document.getElementById("more_options").innerHTML = '';
420
        moreoptions(x);
421
    }
422
}
423
424
// to dispaly the more options section
425
function moreoptions(x,y,z){
426
document.getElementById("irregularity").innerHTML = '';
427
document.getElementById("more_options").innerHTML = '';
428
var textbox = '';
429
    // alert("X: "+x+"Y: "+y+"Z: "+z);
430
    if(x){
431
        textbox +="<table id='irregularity_table'>\n<tr><th>&nbsp;<\/th><th>"+x+"<\/th>";
432
        if(y){
433
            textbox +="<th>"+y+"<\/th>";
434
            if(z){
435
                textbox +="<th>"+z+"<\/th>";
436
            }
437
        }
438
        textbox +="<\/tr>\n";
439
        textbox +="<tr><th scope=\"row\">"+text[5]+"<\/td><td><input type='text' name='lastvalue1temp' id='lastvalue1temp' size='4' onkeyup='moreoptionsupdate(this)' value=\"" + document.f.lastvalue1.value +  "\" /><\/td>\n";
440
        if(y){
441
            textbox +="<td><input type=\"text\" name=\"lastvalue2temp\" id=\"lastvalue2temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this)\" value=\"" + document.f.lastvalue2.value + "\" /><\/td>\n";
442
            if(z){
443
                textbox +="<td><input type=\"text\" name=\"lastvalue3temp\" id=\"lastvalue3temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this)\" value=\"" + document.f.lastvalue3.value + "\" /><\/td>\n";
444
            }
445
        }
446
        textbox +="<\/tr>\n";
447
        if(y){
448
            textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
449
            textbox +="<td>&nbsp;<\/td>\n";
450
            textbox +="<td><input type=\"text\" name=\"whenmorethan2temp\" id=\"whenmorethan2temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,1)\"><\/td>\n";
451
            if(z){
452
                textbox +="<td><input type=\"text\" name=\"whenmorethan3temp\" id=\"whenmorethan3temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,1)\"><\/td>\n";
453
            }
454
            textbox +="<\/tr>";
455
        } else {
456
          textbox +="<tr> <td>"+_("issues expected")+"<\/td><td><input type=\"text\" name=\"issuesexpected1temp\" id=\"issuesexpected1temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,0)\" value=\"" + document.f.issuesexpected1.value + "\" ><\/td><\/tr>";
457
        }
458
        textbox +="<\/table>\n";
459
    }
460
    document.getElementById("more_options").innerHTML = textbox;
461
}
462
463
function hemispheres(chosen){
464
var selbox = document.getElementById("season1");
465
    if(selbox){
466
    var selboxselected = selbox.options[selbox.selectedIndex].value;
467
    selbox.options.length = 0;
468
469
    if ( (chosen == "1") || ( ! (chosen) && is_hemisphere == 1 )) {
470
        selbox.options[selbox.options.length] = new Option(text[11],'1');
471
        selbox.options[selbox.options.length] = new Option(text[12],'2');
472
        selbox.options[selbox.options.length] = new Option(text[13],'3');
473
        selbox.options[selbox.options.length] = new Option(text[14],'4');
474
        is_hemisphere = 1;
475
        selbox.options[selboxselected-1].selected = true;
476
    }
477
478
    if ( (chosen == "2") || ( ! (chosen) && is_hemisphere == 2 )) {
479
        selbox.options[selbox.options.length] = new Option(text[13],'1');
480
        selbox.options[selbox.options.length] = new Option(text[10],'2');
481
        selbox.options[selbox.options.length] = new Option(text[11],'3');
482
        selbox.options[selbox.options.length] = new Option(text[12],'4');
483
        is_hemisphere = 2;
484
        selbox.options[selboxselected-1].selected = true;
485
    }
486
    }
487
}
488
489
// to display the more options section for seasons
490
function moreoptions_seasons(x,y){
491
// x = 'Season'.  y = 'Year'.
492
document.getElementById("irregularity").innerHTML = '';
493
document.getElementById("more_options").innerHTML = '';
494
var textbox = '';
495
    //alert("X: "+x+"Year: "+y);
496
    if(x){
497
        var hemi_select = parseInt('[% hemisphere %]');
498
        textbox +="<li><label for=\"hemisphere\">"+ text[7]  +"<\/label><select name=\"hemisphere\" id=\"hemisphere\" onchange=\"hemispheres(this.options[this.selectedIndex].value)\">";
499
        for(var i = 1; i <= 2; i++){
500
            textbox +="<option value='"+i+"'";
501
            if(i == hemi_select){
502
                textbox += " selected "
503
            }
504
            textbox +=">"+text[i+7]+"<\/option>";
505
        }
506
        textbox +="<\/li>\n";
507
        textbox +="<table id=\"seasonal_irregularity\"><tr><th>&nbsp;<\/th><th>"+x+"<\/th>";
508
        textbox +="<th>"+text[16]+"<\/th>";
509
        textbox +="<\/tr>\n";
510
        textbox +="<tr><th scope=\"row\">"+text[5]+"<\/th><td><select name=\"lastvalue2temp\" id=\"lastvalue2temp\" id=\"season1\" onchange=\"moreoptionsupdate(this)\">";
511
        for(var j = 1; j <= 4; j++){
512
            textbox +="<option value='"+j+"'>"+text[j+9]+"<\/option>";
513
        }
514
        textbox +="<\/select><\/td>";
515
        var isyr = irregular_issues.firstissue;
516
        textbox += "<td>" + irregular_issues.firstissue.getFullYear() + "<\/td><\/tr>\n";
517
        textbox +="<tr><th scope=\"row\">"+text[6]+"<\/th>";
518
        textbox +="<td><input type=\"text\" name=\"whenmorethan2temp\" id=\"whenmorethan2temp\" size=\"4\" onkeyup=\"moreoptionsupdate(this,1)\"><\/td>\n";
519
        textbox +="<\/tr><\/table>\n";
520
    }
521
    document.getElementById("more_options").innerHTML = textbox;
522
}
523
524
function irregularity_check(){
525
    document.f.irreg_check.value = 1; // Irregularity button now pushed
526
    var periodicity = document.f.periodicity.value;
527
	var rollover = document.f.issuesexpected1.value;
528
    if( (document.f.whenmorethan2) && ( document.f.whenmorethan2.value > 0) ){
529
      rollover = document.f.whenmorethan2.value;
530
    }
531
    if((document.f.whenmorethan3) && document.f.whenmorethan3.value > 0 ){
532
        // FIXME: Irregularity check assumes that the full prediction pattern repeats each year.
533
		//  In cases where the outermost periodicity is > 1 year,  
534
		//  e.g. where a volume spans two years, the irregularity check will be incorrect, 
535
        // but you can safely ignore the check, submit the form, and the prediction pattern should be correct.
536
		//  a way to distinguish between these two cases is needed.
537
		rollover = document.f.whenmorethan3.value * document.f.whenmorethan2.value;
538
    }
539
    var error='';
540
    var toobig;
541
    var expected; 
542
    var errortext = "<b>"+_("Warning irregularity detected")+"</b><br \/>";
543
    switch(periodicity){
544
    case "12":
545
        if(rollover < 730) expected =730;
546
        if(rollover > 730) {
547
            expectedover=730;
548
            toobig=1;
549
        }
550
        break;
551
    case "1":
552
        if(rollover < 365) expected =365;
553
        if(rollover > 365) {
554
            expectedover=365;
555
            toobig=1;
556
        }
557
        break;
558
    case "2":
559
        if(rollover < 52) expected =52;
560
        if(rollover > 52){
561
            expectedover=52;
562
            toobig=1;
563
        }
564
        break;
565
    case "3":
566
        if(rollover < 26) expected =26;
567
        if(rollover > 26){
568
            expectedover=26;
569
            toobig=1;
570
        }
571
        break;
572
    case "4":
573
        if(rollover < 17) expected =17;
574
        if(rollover > 17){
575
            expectedover=17;
576
            toobig=1;
577
        }
578
        break;
579
    case "5":
580
        if(rollover < 12) expected =12;
581
        if(rollover > 12){
582
            expectedover=12;
583
            toobig=1;
584
        }
585
        break;
586
    case "6":
587
        if(rollover < 6) expected =6;
588
        if(rollover > 6){
589
            expectedover=6;
590
            toobig=1;
591
        }
592
        break;
593
    case "7":
594
        if(rollover < 4) expected =4;
595
        if(rollover > 4){
596
            expectedover=4;
597
            toobig=1;
598
        }
599
        break;
600
    case "8":
601
        if(rollover < 4) expected =4;
602
        if(rollover > 4){
603
            expectedover=4;
604
            toobig=1;
605
        }
606
        break;
607
    case "9":
608
        if(rollover < 2) expected =2;
609
        if(rollover > 2){
610
            expectedover=2;
611
            toobig=1;
612
        }
613
        break;
614
    case "10":
615
        if(rollover < 1) expected =1;
616
        if(rollover > 1){
617
            expectedover=1;
618
            toobig=1;
619
        }
620
        break;
621
    default:
622
        break;
623
    }
624
    if(expected){
625
        if(expected == 365 || expected==730){  // what about leap years ?
626
			// FIXME:  We interpret irregularity as which days per week for periodicity==1.
627
			//  We need two cases: one in which we're published n days/week, in which case irregularity should be per week,
628
			//  and a regular daily pub, where irregularity should be per year.
629
            errortext += _("Please indicate which days of the week you DO NOT expect to receive issues.")+"<br \/>";
630
        } else {
631
            errortext +=expected+_(" issues expected, ")+rollover+_(" were entered.")+"<br \/>"+_("Please indicate which date(s) an issue is not expected")+"<br \/>";
632
            irregular_issues.numskipped = expected - rollover;
633
		}
634
        errortext +="<select multiple id=\"irregularity_select\" name=\"irregularity_select\" onchange=\"irregular_issues.update();\">\n";
635
		errortext +=irregular_options(periodicity);
636
		errortext += "<\/select>\n <textarea rows=\"6\" width=\"18\" id=\"irregularity_summary\" name=\"irregularity_summary\" value=\"foo\"><\/textarea>";
637
        error=errortext;
638
    }
639
    if(toobig){
640
        errortext +=expectedover+_(" issues expected, ")+rollover+_(" were entered")+"<p class=\"warning\">"+_("You seem to have indicated more issues per year than expected.<\/p>");
641
        error=errortext;
642
    }
643
    if(error.length ==0){
644
        error=_("No irregularities noticed");
645
    }
646
	display_example(expected);
647
    document.getElementById("irregularity").innerHTML = error;
648
	irregular_issues.update();
649
}
650
651
function irregular_options(periodicity){
652
    var titles;
653
    var count;
654
    var errortext='';
655
    var numberpattern = document.getElementById('numberpattern').value;
656
    if(periodicity == 1) {
657
        expected = 7;
658
        titles = irregular_issues.daynames;
659
        count = 1;
660
    }
661
    if(periodicity == 2 || periodicity == 3 || periodicity == 4) { 
662
        titles = irregular_issues.weeks;
663
		count = 1;
664
        if(periodicity==3) {  // 1/2 wks
665
            expected = 26;
666
        } else if(periodicity == 4) { // 1/3 wks
667
            expected = 17;
668
        } else {
669
            expected = 52;
670
        }
671
    }
672
    if(periodicity == 5 || periodicity == 6 || periodicity == 7 || periodicity == 8 || periodicity == 9) {
673
        if(periodicity == 8 && numberpattern==8) {
674
            is_season = 1; // setting up from edit page
675
        } 
676
        if(is_season){
677
            titles = irregular_issues.seasons;
678
            expected = 4;
679
            if(is_hemisphere == 2){
680
                count = 2;
681
            } else {
682
                count = 1;
683
            }
684
        } else {
685
            titles = irregular_issues.months;
686
            expected = 12;
687
            count = 1;
688
        }
689
    }
690
	if( !expected) {
691
		return '';   // don't know how to deal with irregularity.
692
	} 	
693
    for(var j=0;j<expected;j++){   // rch - changed frrom (1..expected).
694
        if(isArray(titles)){
695
            if(count>expected){
696
                count = count-expected;
697
            }
698
            if(is_season && is_hemisphere == 1){
699
                errortext +="<option value='"+((count*3)-2)+"'>"+titles[j]+"<\/option>\n";
700
// alert("value: "+((count*3)-2)+" title: "+titles[j]);
701
            } else if(is_season && is_hemisphere == 2){
702
                errortext +="<option value='"+((count*3)-2)+"'>"+titles[j-1]+"<\/option>\n";
703
// alert("value: "+((count*3)-2)+" title: "+titles[j-1]);
704
            } else {  // all non-seasonal periodicities:
705
                var incr=1; // multiplier for ( 1/n weeks)  patterns; in this case the irreg calc relies on the week# , not the issue#.
706
                if(periodicity==3) {  // 1/2 wks
707
                    incr=2;
708
                } else if(periodicity == 4) { // 1/3 wks
709
                    incr=3;
710
                }
711
                errortext += "<option value='" + (1+j*incr) ;  
712
				if(irregular_issues.irregular(1+incr*j)) {
713
					errortext += "' selected='selected" ;
714
				}
715
				errortext += "'>"+titles[incr*j]+"<\/option>\n";
716
            }
717
            count++;
718
        } else { 
719
            errortext +="<option value='"+j+"'>"+titles+" "+j+"<\/option>\n";
720
        }
721
    }
722
    return errortext;
723
}
724
725
726
function display_example(expected){
727
    var startfrom1 = parseInt(document.f.lastvalue1.value);
728
    var startfrom2 = parseInt(document.f.lastvalue2.value);
729
    var startfrom3 = parseInt(document.f.lastvalue3.value);
730
    var every1 = parseInt(document.f.every1.value);
731
    var every2 = parseInt(document.f.every2.value);
732
    var every3 = parseInt(document.f.every3.value);
733
    var numberpattern = document.f.numberingmethod.value;
734
    var whenmorethan2 = parseInt(document.f.whenmorethan2.value);
735
    var whenmorethan3 = parseInt(document.f.whenmorethan3.value);
736
    var setto2 = parseInt(document.f.setto2.value);
737
    var setto3 = parseInt(document.f.setto3.value);
738
    var displaytext = _("Based on the information entered, the Numbering Pattern will look like this: ") + "<br \/><ul class=\"numpattern_preview\">";
739
    if(startfrom3>0){
740
        var count=startfrom3-1;
741
        var count2=startfrom2;
742
        for(var i = 0 ; i < 12; i++){
743
            if(count>=whenmorethan3){
744
                count=setto3;
745
                if(count2>=whenmorethan2){
746
                    startfrom1++;
747
                    count2=setto2;
748
                } else {
749
                    count2++;
750
                }
751
            } else {
752
                count++;
753
            }
754
            displaytext += '<li>' + numberpattern.replace(/{Z}/,count) + '<\/li>\n';
755
            displaytext = displaytext.replace(/{Y}/,count2);
756
            displaytext = displaytext.replace(/{X}/,startfrom1);
757
758
        }
759
    }
760
    if(startfrom2>0 && !startfrom3){
761
        var count=startfrom2-1;
762
        for(var i=0;i<12;i++){
763
            if(count>=whenmorethan2){
764
                startfrom1++;
765
                count=setto2;
766
            } else {
767
                count++;
768
            }
769
770
            if(is_season){
771
                if(is_hemisphere == 2){
772
                    if(count == 1) {
773
                        displaytext += numberpattern.replace(/{Y}/,text[count+12])+'\n';
774
                    } else {
775
                        displaytext += numberpattern.replace(/{Y}/,text[count+8])+'\n';
776
                    }
777
                } else {
778
                displaytext += numberpattern.replace(/{Y}/,text[count+10])+'\n';
779
                }
780
            } else {
781
                displaytext += numberpattern.replace(/{Y}/,count)+'\n';
782
            }
783
            displaytext = displaytext.replace(/{X}/,startfrom1)+'<br \/>\n';
784
        }
785
    }
786
    if(startfrom1>0 && !startfrom2 && !startfrom3){
787
        var offset=eval(document.f.issuesexpected1.value);
788
        if (!offset){
789
            offset = 12 
790
        }
791
        for(var i=startfrom1;i<(startfrom1+offset);i+=every1){
792
            displaytext += numberpattern.replace(/{X}/,i)+'<br \/>\n';
793
        }
794
    }
795
   //  displaytext = "<div style='padding: 5px; background-color: #CCCCCC'>"+displaytext+"<\/div>";
796
    document.getElementById("displayexample").innerHTML = displaytext;
797
}
798
799
function isArray(obj) {
800
if (obj.constructor.toString().indexOf("Array") == -1)
801
    return false;
802
else
803
    return true;
804
}
805
806
function moreoptionsupdate(inputfield,rollover){
807
    fieldname = inputfield.name;
808
    // find parent element in base table by stripping 'temp' from element name.
809
    basefield = document.getElementById(fieldname.slice(0,-4));
810
    var fieldnumber = fieldname.slice(-5,-4);
811
812
    basefield.value = inputfield.value;
813
    var patternchoice = document.getElementById("numberpattern").value;
814
    switch(patternchoice){
815
    case "2":
816
    case "4":
817
    case "5":
818
    case "8": // Year, Number.  -- Why not just use Vol, Number withvol==year??
819
                //  FIXME: this my conflict with innerloop calc below.
820
       if (document.f.lastvalue2temp.value > 0){document.f.innerloop1.value = document.f.lastvalue2temp.value - 1;}
821
      break;   
822
    }  
823
    if(basefield.name.slice(0,-1) == 'lastvalue' || 'whenmorethan' ) {
824
        // The enumeration string is held in a positional numeral notation with three positions, X,Y,Z.
825
        // The last values lastvalue1, lastvalue2,lastvalue3 should match the last received serial's X,Y,Z enumeration.
826
        // make array indexes start with 1 for consistency with variable names.
827
        var innerloop = new Array( undefined, document.getElementById('innerloop1'), document.getElementById('innerloop2'), document.getElementById('innerloop3') );
828
        var lastvalue = new Array( undefined, document.getElementById('lastvalue1').value *1 , document.getElementById('lastvalue2').value *1 , document.getElementById('lastvalue3').value *1  );
829
        var every = new Array( undefined, document.getElementById('every1').value *1 , document.getElementById('every2').value *1 , document.getElementById('every3').value *1  );
830
        var add = new Array( undefined, document.getElementById('add1').value *1 , document.getElementById('add2').value *1 , document.getElementById('add3').value *1  );
831
        var whenmorethan = new Array( undefined, document.getElementById('whenmorethan1').value *1 , document.getElementById('whenmorethan2').value *1 , document.getElementById('whenmorethan3').value *1  );
832
        
833
       if(rollover){
834
       // calculate rollover  for higher level of periodicity.
835
       // if there are two levels of periodicity, (e.g. vol{X},num{Y},issue{Z}, then every1=every2*whenmorethan2 / add2 .
836
          for(var N=3;N>1;N--){
837
            if( add[N] > 0){
838
                var addN = (add[N]) ? add[N] : 1 ;
839
                var everyN = (document.getElementById('every'+N)) ? document.getElementById('every'+N).value : 1 ;
840
                document.getElementById('every'+(N-1)).value = whenmorethan[N] * everyN / addN ;
841
            }
842
          }
843
        }
844
        innerloop[3].value = ( every[3] > 1 ) ? lastvalue[3] % every[3] : 0 ;
845
        innerloop[2].value = ( every[2] > 1 ) ? lastvalue[3] - 1 : 0 ;
846
        innerloop[1].value = ( every[1] > 1 ) ? 
847
                                    ( whenmorethan[3] > 0 ) ?  (lastvalue[2] - 1) * every[2] + 1* innerloop[2].value 
848
                                                            : lastvalue[2] - 1
849
                                               : 0 ;
850
    }
851
     //FIXME : add checks for innerloop || lastvalue .gt. rollover  
852
}
853
854
855
function check_input(e){
856
    var unicode=e.charCode? e.charCode : e.keyCode
857
    if (unicode!=8 && unicode !=46 && unicode!=9 && unicode !=13){ // if key isn't backspace or delete
858
        if (unicode<48||unicode>57) { // if not a number
859
            alert(_("Needs to be entered in digit form -eg 10"));
860
            return false // disable key press
861
        }
862
    }
863
}
864
865
function addbiblioPopup(biblionumber) {
866
	var destination = "/cgi-bin/koha/cataloguing/addbiblio.pl?mode=popup";
867
	if(biblionumber){ destination += "&biblionumber="+biblionumber; }
868
 window.open(destination,'AddBiblioPopup','width=1024,height=768,toolbar=no,scrollbars=yes');
869
}
870
871
function Plugin(f)
872
{
873
	 window.open('subscription-bib-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
874
}
875
876
function FindAcqui(f)
877
{
878
	 window.open('acqui-search.pl','FindASupplier','width=800,height=400,toolbar=no,scrollbars=yes');
879
}
880
881
function Find_ISSN(f)
882
{
883
	 window.open('issn-search.pl','FindABibIndex','width=800,height=400,toolbar=no,scrollbars=yes');
884
}
885
886
887
function Check(f) {
888
    if (f.aqbooksellerid.value.length==0) {
889
        input_box = confirm(_("If you wish to claim late or missing issues you must link this subscription to a vendor. Click OK to ignore or Cancel to return and enter a vendor"));
890
		if (input_box==true) {
891
		}
892
		else {
893
			return false;
894
		}
895
    }
896
	if (f.biblionumber.value.length==0) {
897
        alert(_("You must choose or create a biblio"));
898
    } else if(f.startdate.value.length != 0 && f.sublength.value > 0) {
899
        if (f.irreg_check.value == 1) {
900
            document.f.submit();
901
        } else {
902
            if(f.numbering_pattern.value == ''){
903
                alert(_("Please choose a numbering pattern"));
904
            } else {
905
                alert(_("Please check for irregularity by clicking 'Test Prediction Pattern'"));
906
            }
907
        }
908
    } else {
909
        alert(_("You must choose a start date and a subscription length"));
910
    }
911
	if(irregular_issues.numskipped < irregular_issues.skipped.length ) {
912
		alert(_("You have not accounted for all missing issues."));
913
	}
914
    return false;
915
}
916
917
$(document).ready(function() {
918
    init_pattern();
919
	
920
	[% IF ( history ) %] $("#subscription_form_history").show();[% END %]
921
	$("#cancel_manual_history").click(function(){
922
		$("#subscription_form_history").hide();
923
		$("#manuallist").attr("checked","");
924
	});
925
   	$("#manuallist").click( function(){
926
		if($(this).attr("checked")){
927
			$("#subscription_form_history").show();
928
		} else {
929
			$("#subscription_form_history").hide();
930
		}
931
	}
932
	);
933
   //  $(".widelabel").attr("width", "300px");  // labels stay skinny in IE7 anyway.
934
[% IF ( modify ) %]
935
    set_num_pattern_from_template_vars();
936
    [% IF ( hemisphere ) %]
937
	is_hemisphere = [% hemisphere %] ;
938
    hemispheres();
939
    [% END %]
940
[% END %]
941
[% IF ( irregularity ) %]
942
    irregularity_check();
943
[% END %]
944
    $('#numberpattern').change( function() { 
945
        reset_num_pattern(); 
946
    });
947
948
    var node;
949
    [% FOREACH field IN dont_export_field_loop %]
950
        node = $("#[% field.fieldid %]");
951
        if ( $(node).is('input') || $(node).is('textarea') ) {
952
            $(node).val("");
953
        } else if ( $(node).is('select') ) {
954
            $(node).find("option:first").attr('selected','selected');
955
        }
956
    [% END %]
957
});
958
//]]>
959
</script>
960
</head>
961
<body id="ser_subscription-add" class="ser">
962
[% INCLUDE 'header.inc' %]
963
[% INCLUDE 'serials-search.inc' %]
964
965
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; [% IF ( modify ) %]<a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]"><i>[% bibliotitle |html %]</i></a> &rsaquo; Modify subscription[% ELSE %]New subscription[% END %]</div>
966
967
<div id="doc3" class="yui-t7">
968
   
969
   <div id="bd">
970
<h1>[% IF ( modify ) %] Modify subscription for <i>[% bibliotitle |html %]</i>[% ELSE %]Add a new subscription[% END %]</h1>
971
   <div class="yui-g">
972
    <form method="post" name="f" action="/cgi-bin/koha/serials/subscription-add.pl">
973
[% IF ( modify ) %]
974
        <input type="hidden" name="op" value="modsubscription" />
975
        <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
976
[% ELSE %]
977
        <input type="hidden" name="op" value="addsubscription" />
978
[% END %]
979
<input type="hidden" name="user" value="[% loggedinusername %]" />
980
<input type="hidden" name="irreg_check" value="0" />
981
<input type="hidden" name="issuesexpected1" id="issuesexpected1" value="0" />
982
983
	<div class="yui-u first">
984
    <fieldset id="subscription_add_information" class="rows">
985
	<legend>Subscription details</legend>
986
	<ol>
987
	    [% IF ( subscriptionid ) %]
988
        <li><span class="label">Subscription #</span> [% subscriptionid %]</li>
989
        [% END %]
990
        <li>
991
            <label for="aqbooksellerid">Vendor: </label>
992
            <input type="text" name="aqbooksellerid" id="aqbooksellerid" value="[% aqbooksellerid %]" size="8" /> (<input type="text" name="aqbooksellername" value="[% aqbooksellername %]" disabled="disabled" readonly="readonly" />) <a href="#" onclick="FindAcqui(f)">Search for a vendor</a>
993
        </li>
994
        <li>
995
            <label for="biblionumber" class="required" title="Subscriptions must be associated with a bibliographic record">Biblio:</label>
996
            
997
                <input type="text" name="biblionumber" id="biblionumber" value="[% bibnum %]" size="8" /> 
998
                (<input type="text" name="title" value="[% bibliotitle %]" disabled="disabled" readonly="readonly" />) <span class="required" title="Subscriptions must be associated with a bibliographic record">Required</span>
999
               <div class="inputnote"> <a href="#" onclick="Plugin(f)">Search for Biblio</a>
1000
		    [% IF ( CAN_user_editcatalogue ) %] 
1001
		       [% IF ( modify ) %]
1002
		       | <a href="#" onclick="addbiblioPopup([% bibnum %]); return false;">Edit biblio</a>
1003
		       [% ELSE %]
1004
		       | <a href="#" onclick="addbiblioPopup(); return false;">Create Biblio</a>
1005
		       [% END %]
1006
		    [% END %]
1007
	       </div>
1008
            
1009
        </li>
1010
        <li class="radio">
1011
            [% IF ( serialsadditems ) %]
1012
                <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1" checked="checked" /><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
1013
                <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial </label></p>
1014
            [% ELSE %]
1015
                <p><input type="radio" id="serialsadditems-yes" name="serialsadditems" value="1"/><label class="widelabel" for="serialsadditems-yes">create an item record when receiving this serial</label></p>
1016
                <p><input type="radio" id="serialsadditems-no" name="serialsadditems" value="0" checked="checked" /><label class="widelabel" for="serialsadditems-no">do not create an item record when receiving this serial</label></p>
1017
            [% END %]
1018
        </li>
1019
        <li>
1020
            <label for="branchcode">Library:</label>
1021
            
1022
                <select name="branchcode" id="branchcode" style="width: 20em;">
1023
                    [% UNLESS ( Independantbranches ) %]<option value="">None</option>[% END %]
1024
                    [% FOREACH branchloo IN branchloop %][% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
1025
				[% ELSE %]
1026
				<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
1027
				[% END %]
1028
                    [% END %]
1029
                </select> (select a library)
1030
            
1031
        </li>
1032
        <li>
1033
            <label for="location">Location:</label>
1034
            <select name="location" id="location">
1035
                <option value="">None</option>
1036
                [% FOREACH locations_loo IN locations_loop %][% IF ( locations_loo.selected ) %]<option value="[% locations_loo.authorised_value %]" selected="selected">[% locations_loo.lib %]</option>[% ELSE %]<option value="[% locations_loo.authorised_value %]">[% locations_loo.lib %]</option>[% END %][% END %]
1037
            </select>
1038
        </li>
1039
         <li>
1040
            <label for="callnumber">Call number:</label>
1041
            <input type="text" name="callnumber" id="callnumber" value="[% callnumber %]" size="20" />
1042
        </li>
1043
        <li>
1044
            <label for="graceperiod">Grace period:</label> <input type="text" name="graceperiod" id="graceperiod" value="[% graceperiod %]" size="5"/> day(s)
1045
        </li>
1046
        <li>
1047
            <label for="notes">OPAC note:</label>
1048
            <textarea name="notes" id="notes" cols="30" rows="2">[% notes %]</textarea>
1049
        </li>
1050
        <li>
1051
            <label for="internalnotes">Nonpublic note:</label>
1052
            <textarea name="internalnotes" id="internalnotes" cols="30" rows="2">[% internalnotes %]</textarea>
1053
        </li>
1054
        <li>
1055
            
1056
               [% IF ( letterloop ) %]
1057
            <label for="letter">Patron notification: </label>
1058
			   <select name="letter" id="letter">
1059
                    <option value="">None</option>
1060
                [% FOREACH letterloo IN letterloop %]
1061
				[% IF ( letterloo.selected ) %]
1062
                    <option value="[% letterloo.value %]" selected="selected">[% letterloo.lettername %]</option>
1063
[% ELSE %]
1064
                    <option value="[% letterloo.value %]">[% letterloo.lettername %]</option>
1065
[% END %]
1066
                [% END %]
1067
                </select> 
1068
                <div class="hint">Select a notice and subscribers will be notified when new issues are received.</div>
1069
            	[% ELSE %]
1070
            <span class="label">Patron notification: </span>
1071
				<div class="hint">To notify patrons of new serial issues, you must <a href="/cgi-bin/koha/tools/letter.pl">define a notice</a>.</div>
1072
				[% END %]
1073
        </li>
1074
		<li>
1075
			 <label class="widelabel" for="staffdisplaycount">Number of issues to display to staff: </label>
1076
			 <input type="text" name="staffdisplaycount" id="staffdisplaycount" value="[% staffdisplaycount %]" size="4"/>
1077
		 </li>
1078
		 <li>
1079
            <label class="widelabel" for="opacdisplaycount">Number of issues to display in OPAC: </label>
1080
			<input type="text" name="opacdisplaycount" id="opacdisplaycount" value="[% opacdisplaycount %]" size="4"/>
1081
		</li>
1082
	</ol>
1083
	</fieldset>
1084
	</div>
1085
	
1086
<div id="subscription_form_history" class="yui-u" style="display:none">
1087
<div><h3 style="display:inline">Subscription history</h3> <a href="#" id="cancel_manual_history">[cancel manual history]</a></div>
1088
        <p>Hint: you can update the serial history manually. This can be useful for an old subscription or to clean the existing history. Modify these fields with care, as future serial receive will continue to update them automatically.</p>
1089
        <fieldset class="rows">
1090
            <ol>
1091
                <li>
1092
                <label for="histstartdate">Subscription start date</label>
1093
                <input type="text" name="histstartdate" id="histstartdate" value="[% histstartdate %]" /><div class="hint"> (start date of the 1st subscription)</div>
1094
                </li>
1095
                <li>
1096
                <label for="histenddate">Subscription end date</label>
1097
                <input type="text" name="histenddate" id="histenddate" value="[% histenddate %]" /> <div class="hint">(if empty, subscription is still active)</div>
1098
                </li>
1099
                <li>
1100
                <label for="recievedlist">Received issues</label>
1101
                <textarea name="recievedlist" id="recievedlist" cols="60" rows="5">[% recievedlist %]</textarea>
1102
                </li>
1103
                <li>
1104
                <label for="missinglist">Missing issues</label>
1105
                <textarea name="missinglist" id="missinglist" cols="60" rows="5">[% missinglist %]</textarea>
1106
                </li>
1107
                <li>
1108
                <label for="opacnote">Note for OPAC</label>
1109
                <textarea name="opacnote" id="opacnote" cols="60" rows="5">[% opacnote %]</textarea>
1110
                </li>
1111
                <li>
1112
                <label for="librariannote">Note for staff</label>
1113
                <textarea name="librariannote" id="librariannote" cols="60" rows="5">[% librariannote %]</textarea>
1114
                </li>
1115
            </ol>
1116
        </fieldset>
1117
    <fieldset class="action"><input type="submit" value="Save subscription history"  /></fieldset>
1118
</div>
1119
1120
<div class="yui-g">
1121
<div id="subscription_form_planning">
1122
	<fieldset class="rows">
1123
	<legend>Serials planning</legend>
1124
    <ol>
1125
        <li>
1126
           <label for="acqui_date"> First issue publication date:</label>
1127
                [% UNLESS ( modify ) %]<img src="[% themelang %]/lib/calendar/cal.gif" id="acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />[% END %]
1128
                [% IF ( modify ) %]<input type="text" name="firstacquidate" value="[% firstacquidate %]"  size="13" maxlength="10" id="acqui_date" disabled="disabled" />
1129
                [% ELSE %]<input type="text" name="firstacquidate" value="[% firstacquidate %]"  size="13" maxlength="10" id="acqui_date" />[% END %]
1130
        </li>
1131
           [% IF ( modify ) %]<li><label for="next_acqui_date"> Next issue publication date:</label>
1132
                <img src="[% themelang %]/lib/calendar/cal.gif" id="next_acqui_button" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1133
                <input type="text" name="nextacquidate" value="[% nextacquidate %]" size="13" maxlength="10" id="next_acqui_date" />
1134
                </li>[% END %]
1135
                
1136
        <li><!-- both scripts for calendar must follow the input field --> 
1137
                <script type="text/javascript">
1138
                    Calendar.setup({
1139
                        inputField      :   "[% IF ( modify ) %]next_[% END %]acqui_date",
1140
                        ifFormat       :   "[% DHTMLcalendar_dateformat %]",
1141
                        button         :   "[% IF ( modify ) %]next_[% END %]acqui_button",
1142
                        align          :   "Tl",
1143
                        onUpdate        :    function(cal) { 
1144
                                                             irregular_issues.weeks = getWeeksArray(cal.date);
1145
                                                            irregular_issues.firstissue = cal.date;
1146
                                                            if(document.irregularity_summary) {
1147
                                                                irregular_issues.update();
1148
                                                            }
1149
                                                            if(document.getElementById("seasonal_irregularity")) {
1150
                                                                moreoptions_seasons(text[15]);
1151
                                                            }
1152
                                                        } 
1153
                        });
1154
                    Calendar.setup({
1155
                        inputField      :   "[% IF ( modify ) %]next_[% END %]acqui_date",
1156
                        ifFormat       :   "[% DHTMLcalendar_dateformat %]",
1157
                        button         :   "[% IF ( modify ) %]next_[% END %]acqui_date",
1158
                        align          :   "Tl",
1159
                        onUpdate        :    function(cal) { irregular_issues.weeks = getWeeksArray(cal.date);
1160
                                                            irregular_issues.firstissue = cal.date;
1161
                                                            if(document.irregularity_summary) {
1162
                                                                irregular_issues.update();
1163
                                                            }
1164
                                                            if(document.getElementById("seasonal_irregularity")) {
1165
                                                                moreoptions_seasons(text[15]);
1166
                                                            }
1167
                                                        } 
1168
                        });
1169
                </script>
1170
            <label for="periodicity" class="required">Frequency:</label>
1171
            
1172
                <select name="periodicity" size="1" id="periodicity" onchange="javascript:document.getElementsByName('manualhist')[0].checked=(this.value==1); reset_num_pattern();">
1173
                <option value="" selected="selected">-- please choose --</option>
1174
                [% IF ( periodicity16 ) %]
1175
                <option value="16" selected="selected">Without periodicity</option>
1176
                [% ELSE %]
1177
                    <option value="16">Without periodicity</option>
1178
                [% END %]
1179
                [% IF ( periodicity48 ) %]
1180
                <option value="48" selected="selected">Unknown</option>
1181
                [% ELSE %]
1182
                <option value="48">Unknown</option>
1183
                [% END %]
1184
                [% IF ( periodicity32 ) %]
1185
                <option value="32" selected="selected">Irregular</option>
1186
                [% ELSE %]
1187
                    <option value="32">Irregular</option>
1188
                [% END %]
1189
1190
                [% IF ( periodicity12 ) %]
1191
                    <option value="12" selected="selected">2/day</option>
1192
                [% ELSE %]
1193
                    <option value="12">2/day</option>
1194
                [% END %]
1195
                [% IF ( periodicity1 ) %]
1196
                    <option value="1" selected="selected">daily (n/week)</option>
1197
                [% ELSE %]
1198
                    <option value="1">daily (n/week)</option>
1199
                [% END %]
1200
                [% IF ( periodicity2 ) %]
1201
                    <option value="2" selected="selected">1/week</option>
1202
                [% ELSE %]
1203
                    <option value="2">1/week</option>
1204
                [% END %]
1205
                [% IF ( periodicity3 ) %]
1206
                    <option value="3" selected="selected">1/2 weeks </option>
1207
                [% ELSE %]
1208
                    <option value="3">1/2 weeks </option>
1209
                [% END %]
1210
                [% IF ( periodicity4 ) %]
1211
                    <option value="4" selected="selected">1/3 weeks</option>
1212
                [% ELSE %]
1213
                    <option value="4">1/3 weeks</option>
1214
                [% END %]
1215
                [% IF ( periodicity5 ) %]
1216
                    <option value="5" selected="selected">1/month</option>
1217
                [% ELSE %]
1218
                    <option value="5">1/month</option>
1219
                [% END %]
1220
                [% IF ( periodicity6 ) %]
1221
                    <option value="6" selected="selected">1/2 months (6/year)</option>
1222
                [% ELSE %]
1223
                    <option value="6">1/2 months (6/year)</option>
1224
                [% END %]
1225
                [% IF ( periodicity7 ) %]
1226
                    <option value="7" selected="selected">1/3 months (1/quarter)</option>
1227
                [% ELSE %]
1228
                    <option value="7">1/3 months (1/quarter)</option>
1229
                [% END %]
1230
                <!-- periodicity8 is 1/quarter, exactly like periodicity7 but will use it for seasonal option -->
1231
                [% IF ( periodicity8 ) %]
1232
                    <option value="8" selected="selected">1/quarter (seasonal)</option>
1233
                [% ELSE %]
1234
                    <option value="8">1/quarter (seasonal)</option>
1235
                [% END %]
1236
                [% IF ( periodicity13 ) %]
1237
                    <option value="13" selected="selected">1/4 months (3/year)</option>
1238
                [% ELSE %]
1239
                    <option value="13">1/4 months (3/year)</option>
1240
                [% END %]
1241
1242
                [% IF ( periodicity9 ) %]
1243
                    <option value="9" selected="selected">2/years</option>
1244
                [% ELSE %]
1245
                    <option value="9">2/year</option>
1246
                [% END %]
1247
                [% IF ( periodicity10 ) %]
1248
                    <option value="10" selected="selected">1/year</option>
1249
                [% ELSE %]
1250
                    <option value="10">1/year</option>
1251
                [% END %]
1252
                [% IF ( periodicity11 ) %]
1253
                    <option value="11" selected="selected">1/2 years</option>
1254
                [% ELSE %]
1255
                    <option value="11">1/2 years</option>
1256
                [% END %]
1257
                </select> <span class="required">Required</span></li>
1258
                <li>
1259
                    <label for="manuallist"> Manual history:</label>
1260
                    [% IF ( manualhistory ) %]
1261
                        <input type="checkbox" name="manualhist" id="manuallist" value="1" checked="checked" />
1262
                    [% ELSE %]
1263
                        <input type="checkbox" name="manualhist" id="manuallist" value="1" />
1264
                    [% END %]
1265
                </li>
1266
        <li>
1267
           <label for="numberpattern"> Numbering pattern:</label>
1268
            
1269
                <select name="numbering_pattern" size="1" id="numberpattern" >
1270
                    <option value="" selected="selected">-- please choose --</option>
1271
                    [% IF ( numberpattern1 ) %]
1272
                        <option value="1" selected="selected">Number</option>
1273
                    [% ELSE %]
1274
                        <option value="1">Number</option>
1275
                    [% END %]
1276
                    [% IF ( numberpattern2 ) %]
1277
                        <option value="2" selected="selected">Volume, number, issue</option>
1278
                    [% ELSE %]
1279
                        <option value="2">Volume, number, issue</option>
1280
                    [% END %]
1281
                    [% IF ( numberpattern3 ) %]
1282
                        <option value="3" selected="selected">Volume, number</option>
1283
                    [% ELSE %]
1284
                        <option value="3">Volume, number</option>
1285
                    [% END %]
1286
                    [% IF ( numberpattern4 ) %]
1287
                        <option value="4" selected="selected">Volume, issue</option>
1288
                    [% ELSE %]
1289
                        <option value="4">Volume, issue</option>
1290
                    [% END %]
1291
                    [% IF ( numberpattern5 ) %]
1292
                        <option value="5" selected="selected">Number, issue</option>
1293
                    [% ELSE %]
1294
                        <option value="5">Number, issue</option>
1295
                    [% END %]
1296
                    [% IF ( numberpattern6 ) %]
1297
                        <option value="6" selected="selected">Seasonal only</option>
1298
                    [% ELSE %]
1299
                        <option value="6">Seasonal only</option>
1300
                    [% END %]
1301
                    [% IF ( numberpattern8 ) %]
1302
                        <option value="8" selected="selected">Year/Number</option>
1303
                    [% ELSE %]
1304
                        <option value="8">Year/Number</option>
1305
                    [% END %]          
1306
                    [% IF ( numberpattern7 ) %]
1307
                        <option value="7" selected="selected">None of the above</option>
1308
                    [% ELSE %]
1309
                        <option value="7">None of the above</option>
1310
                    [% END %]
1311
                </select>
1312
        </li>
1313
                <li id="more_options"></li>
1314
                <li id="irregularity"></li>
1315
   	           <li id="displayexample"></li>
1316
        <li>
1317
           <label for="beginning_date" class="required"> Subscription start date:</label>
1318
            
1319
                <img src="[% themelang %]/lib/calendar/cal.gif" id="button1" style="cursor: pointer;" alt="Show calendar" title="Show calendar" />
1320
                <input type="text" name="startdate" value="[% startdate %]" size="13" maxlength="10" id="beginning_date" />
1321
                <!-- both scripts for calendar must follow the input field --> 
1322
                <script type="text/javascript">
1323
                    Calendar.setup({
1324
                        inputField   : "beginning_date",
1325
                        ifFormat     : "[% DHTMLcalendar_dateformat %]",
1326
                        button       : "button1",
1327
                        align        : "Tl"
1328
                    });
1329
                    Calendar.setup({
1330
                        inputField   : "beginning_date",
1331
                        ifFormat     : "[% DHTMLcalendar_dateformat %]",
1332
                        button       : "beginning_date",
1333
                        align        : "Tl"
1334
                    });
1335
                </script>
1336
            <span class="required">Required</span>
1337
        </li>
1338
        <li>
1339
            <label for="subtype" class="required">Subscription length:</label>
1340
            
1341
                <select name="subtype" id="subtype">
1342
                    [% IF ( subtype_monthlength ) %]<option value="monthlength" selected="selected">[% ELSE %]<option value="monthlength">[% END %] Number of months</option>
1343
                    [% IF ( subtype_numberlength ) %]<option value="numberlength" selected="selected">[% ELSE %]<option value="numberlength">[% END %] Number of issues</option>
1344
                    [% IF ( subtype_weeklength ) %]<option value="weeklength" selected="selected">[% ELSE %]<option value="weeklength">[% END %] Number of weeks</option>
1345
                </select>
1346
                <input type="text" id="numberlength" name="sublength" value="[% sublength %]" size="3" onkeypress="return check_input(event)" /> (enter amount in numerals)
1347
            <span class="required">Required</span>
1348
        </li>
1349
        <li>
1350
           <label for="ending_date"> Subscription end date:</label>
1351
            
1352
                <img src="[% themelang %]/lib/calendar/cal.gif" id="buttonend1" style="cursor: pointer;" alt="Show Calendar" title="Show Calendar" />
1353
                <input type="text" name="enddate" value="[% enddate %]" size="13" maxlength="10" id="ending_date" />
1354
                <!-- both scripts for calendar must follow the input field --> 
1355
                <script type="text/javascript">
1356
                    Calendar.setup({
1357
                        inputField   : "ending_date",
1358
                        ifFormat     : "[% DHTMLcalendar_dateformat %]",
1359
                        button       : "buttonend1",
1360
                        align        : "Tl"
1361
                    });
1362
                    Calendar.setup({
1363
                        inputField   : "ending_date",
1364
                        ifFormat     : "[% DHTMLcalendar_dateformat %]",
1365
                        button       : "ending_date",
1366
                        align        : "Tl"
1367
                    });
1368
                </script>
1369
        </li>
1370
    <li><label for="numberingmethod">Numbering formula:</label> <input type="text" name="numberingmethod" id="numberingmethod" value="[% numberingmethod %]" />
1371
    </li>
1372
    </ol>
1373
	</fieldset>
1374
</div>
1375
	<fieldset class="action">
1376
    <input type="button" class="action_test" value="Test prediction pattern" onclick="javascript:irregularity_check()" />
1377
    <input type="button" class="action_reset" value="Reset pattern" onclick="javascript:reset_pattern()" />
1378
    <input type="button" class="action_save"  value="Save subscription" onclick="Check(this.form)" accesskey="w" />
1379
	</fieldset>
1380
    <fieldset class="action">
1381
    <input type="button" class="action_advanced" value="Show/Hide advanced pattern" onclick="javascript:display_table()" />
1382
    </fieldset>
1383
           <div id="basetable"  style="display: none;">
1384
            <table class="small">
1385
                <tr><th colspan="4">Advanced prediction pattern</th></tr>
1386
				<tr>
1387
                    <th>&nbsp;</th>
1388
                    <th>X</th>
1389
                    <th>Y</th>
1390
                    <th>Z</th>
1391
                </tr>
1392
                <tr>
1393
                    <td>Add</td>
1394
                    <td>
1395
                        <input type="text" name="add1" id="add1" value="[% add1 %]" />
1396
                    </td>
1397
                    <td>
1398
                        <input type="text" name="add2" id="add2" value="[% add2 %]" />
1399
                    </td>
1400
                    <td>
1401
                        <input type="text" name="add3" id="add3" value="[% add3 %]" />
1402
                    </td>
1403
                </tr>
1404
                <tr>
1405
                    <td>once every</td>
1406
                    <td><input type="text" name="every1" id="every1" value="[% every1 %]" /></td>
1407
                    <td><input type="text" name="every2" id="every2" value="[% every2 %]" /></td>
1408
                    <td><input type="text" name="every3" id="every3" value="[% every3 %]" /></td>
1409
                </tr>
1410
                <tr>
1411
                    <td>When more than</td>
1412
                    <td><input type="text" name="whenmorethan1" id="whenmorethan1" value="[% whenmorethan1 %]" /></td>
1413
                    <td><input type="text" name="whenmorethan2" id="whenmorethan2" value="[% whenmorethan2 %]" /></td>
1414
                    <td><input type="text" name="whenmorethan3" id="whenmorethan3" value="[% whenmorethan3 %]" /></td>
1415
                </tr>
1416
                <tr>
1417
                    <td>inner counter</td>
1418
                    <td><input type="text" name="innerloop1" id="innerloop1" value="[% innerloop1 %]" /></td>
1419
                    <td><input type="text" name="innerloop2" id="innerloop2" value="[% innerloop2 %]" /></td>
1420
                    <td><input type="text" name="innerloop3" id="innerloop3" value="[% innerloop3 %]" /></td>
1421
                </tr>
1422
                <tr>
1423
                    <td>Set back to</td>
1424
                    <td><input type="text" name="setto1" id="setto1" value="[% setto1 %]" /></td>
1425
                    <td><input type="text" name="setto2" id="setto2" value="[% setto2 %]" /></td>
1426
                    <td><input type="text" name="setto3" id="setto3" value="[% setto3 %]" /></td>
1427
                </tr>
1428
                <tr>
1429
                    <td>
1430
                        [% IF ( modify ) %]
1431
                            Last value
1432
                        [% ELSE %]
1433
                            Begins with
1434
                        [% END %]
1435
                    </td>
1436
                    <td><input type="text" name="lastvalue1" id="lastvalue1" value="[% lastvalue1 %]" /></td>
1437
                    <td><input type="text" name="lastvalue2" id="lastvalue2" value="[% lastvalue2 %]" /></td>
1438
                    <td><input type="text" name="lastvalue3" id="lastvalue3" value="[% lastvalue3 %]" /></td>
1439
                </tr>
1440
            </table>
1441
        </div>
1442
1443
</div>
1444
1445
</form>
1446
</div>
1447
1448
</div>
1449
1450
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt (-387 / +6 lines)
Lines 1-391 Link Here
1
[% INCLUDE 'doc-head-open.inc' %]
1
[% INCLUDE 'help-top.inc' %]
2
<title>Koha &rsaquo; Serials &rsaquo; Details for subscription #[% subscriptionid %]</title>
3
[% INCLUDE 'doc-head-close.inc' %]
4
<script type="text/javascript">
5
//<![CDATA[
6
// the english words used in display purposes
7
var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
8
"Autumn"),_("Winter"),_("Spring"),_("Summer"),_("Fall"),_("Season"),_("Year"));
9
2
3
<h1>Subscription Detail</h1>
10
4
11
// to display the options section
5
<p>This page shows you all of the information about your subscription including issue history.</p>
12
function options(x,y,z){
13
var textbox = '';
14
    // alert("X: "+x+"Y: "+y+"Z: "+z);
15
    if(x){
16
        document.f.xfield.value = x;
17
        if(y){
18
            document.f.yfield.value = y;
19
            if(z){
20
                document.f.zfield.value = z;
21
            }
22
        }
23
    }
24
}
25
6
26
function confirm_deletion() {
7
<p>From here you can edit your subscription, renew it and/or recieve issues.</p>
27
    var is_confirmed = confirm(_("Are you sure you want to delete this subscription?"));
28
    if (is_confirmed) {
29
        window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=del";
30
    }
31
}
32
function popup(subscriptionid) {
33
    newin=window.open("subscription-renew.pl?mode=popup&subscriptionid="+subscriptionid,'popup','width=590,height=440,toolbar=false,scrollbars=yes');
34
}
35
$(document).ready(function() {
36
    $("#subscription_description > ul").tabs();
37
});
38
//]]>
39
</script>
40
</head>
41
<body id="ser_subscription-detail" class="ser">
42
[% INCLUDE 'header.inc' %]
43
[% INCLUDE 'serials-search.inc' %]
44
8
45
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> &rsaquo; Details for subscription #[% subscriptionid %]</div>
9
<p><strong>See the full documentation for Serials in the <a href="http://manual.koha-community.org/3.8/en/serials.html">manual</a> (online).</strong></p>
46
10
47
<div id="doc3" class="yui-t2">
11
[% INCLUDE 'help-bottom.inc' %]
48
   
49
   <div id="bd">
50
	<div id="yui-main">
51
	<div class="yui-b">
52
	[% INCLUDE 'serials-toolbar.inc' %]
53
54
    <h1>Subscription for [% bibliotitle %] </h1>
55
    [% IF ( abouttoexpire ) %]<div class="problem">Subscription is near its end. It should be renewed now.</div>[% END %]
56
    [% IF ( NEEDSCONFIRMATION ) %]
57
    <div id="circ_needsconfirmation" class="dialog alert">
58
			<h3>Please Confirm Subscription deletion</h3>
59
60
			<ul>
61
			[% IF ( NOTEXPIRED ) %] <li>The subscription has not expired yet</li> [% END %] 
62
			[% IF ( LINKEDISSUES ) %] <li>The subscription has linked issues</li> [% END %]
63
			[% IF ( LINKEDITEMS ) %] <li>The subscription has linked items<br /> Those items won't be deleted</li> [% END %]
64
			</ul>
65
			<form method="post" action="/cgi-bin/koha/serials/subscription-detail.pl">
66
			<input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
67
			<input type="hidden" name="issueconfirmed" value="1" />
68
			<input type="hidden" name="op" value="del" />
69
            <input type="submit" class="approve" value="Yes, delete (Y)" accesskey="y" />
70
			</form>
71
			<form method="get" action="/cgi-bin/koha/serials/subscription-detail.pl">
72
			<input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
73
            <input type="submit" class="deny" value="No, don't delete (N)" accesskey="n" />
74
			</form>
75
76
	</div>
77
	[% END %] <!-- NEEDSCONFIRMATION -->
78
79
<div id="subscription_description" class="toptabs">
80
<ul class="ui-tabs-nav">
81
    <li><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]#subscription_info">Information</a></li>
82
    <li><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]#subscription_planning">Planning</a></li>
83
    <li><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]#subscription_issues">Issues</a></li>
84
    <li><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscriptionid %]#subscription_summary">Summary</a></li>
85
</ul>
86
87
<div id="subscription_info">
88
    <div class="yui-g">
89
    <div class="yui-u first">
90
    <div class="rows">
91
		<ol>
92
		<li><span class="label">Subscription ID: </span>[% subscriptionid %]</li>
93
        <li><span class="label">Librarian identity:</span> [% librarian %]</li>
94
        <li><span class="label">Vendor:</span> <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% aqbooksellerid %]">[% aqbooksellername %]</a></li>
95
        <li><span class="label">Biblio:</span>  <a href="/cgi-bin/koha/catalogue/[% default_bib_view %].pl?biblionumber=[% bibnum %]">[% bibliotitle %]</a> <i>([% bibnum %])</i></li>
96
[% IF ( branchcode ) %]<li><span class="label">Library:</span> [% branchcode %]</li>[% END %]
97
        [% IF ( serialsadditems ) %]
98
            <li><span class="label">Items:</span> Serial receipt creates an item record.</li>
99
        [% ELSE %]
100
            <li><span class="label">Items:</span> Serial receipt does not create an item record.</li>
101
        [% END %]
102
        <li><span class="label">Grace period:</span> [% graceperiod %]</li>
103
        </ol>
104
    </div>
105
    </div>
106
    <div class="yui-u">
107
    <div class="rows">
108
        <ol>
109
        [% IF ( location ) %]<li><span class="label">Location:</span> [% location %]</li>[% END %]
110
        [% IF ( callnumber ) %]<li><span class="label">Call number:</span> [% callnumber %]</li>[% END %]
111
		[% IF ( staffdisplaycount ) %]<li><span class="label">Number of issues to display to staff:</span>[% staffdisplaycount %]</li>[% END %]
112
        [% IF ( opacdisplaycount ) %]<li><span class="label">Number of issues to display in OPAC:</span>[% opacdisplaycount %]</li>[% END %]
113
        [% IF ( letter ) %]
114
            <li>
115
                <span class="label">Patron notification:</span> [% letter %]
116
                (<a href="/cgi-bin/koha/serials/viewalerts.pl?subscriptionid=[% subscriptionid %]">subscribers</a>)
117
            </li>
118
        [% END %]
119
        [% IF ( hasRouting ) %]<li><span class="label">Routing:</span> yes</li>[% END %]
120
     </ol>
121
     </div>
122
     </div>
123
</div>
124
</div>
125
    <div id="subscription_planning">
126
    <div class="yui-g">
127
    <div class="rows">
128
        <ol>
129
            <li><span class="label">Beginning date:</span> [% startdate %]
130
            </li>
131
            <li><span class="label">Frequency (*):</span>
132
                [% IF ( periodicity16 ) %]
133
                        Without regularity
134
                [% END %]
135
                [% IF ( periodicity32 ) %]
136
                        Irregular
137
                [% END %]
138
                [% IF ( periodicity0 ) %]
139
                        Unknown
140
                [% END %]
141
                [% IF ( periodicity12 ) %]
142
                        2/day
143
                [% END %]
144
                [% IF ( periodicity1 ) %]
145
                        1/day
146
                [% END %]
147
                [% IF ( periodicity13 ) %]
148
                        1/4 months (3/year)
149
                [% END %]
150
                [% IF ( periodicity2 ) %]
151
                        1/week
152
                [% END %]
153
                [% IF ( periodicity3 ) %]
154
                        1/2 weeks
155
                [% END %]
156
                [% IF ( periodicity4 ) %]
157
                        1/3 weeks
158
                [% END %]
159
                [% IF ( periodicity5 ) %]
160
                        1/month
161
                [% END %]
162
                [% IF ( periodicity6 ) %]
163
                        1/2 months (6/year)
164
                [% END %]
165
                [% IF ( periodicity7 ) %]
166
                        1/quarter
167
                [% END %]
168
                [% IF ( periodicity8 ) %]
169
                        1/quarter
170
                [% END %]
171
                [% IF ( periodicity9 ) %]
172
                        2/year
173
                [% END %]
174
                [% IF ( periodicity10 ) %]
175
                        1/year
176
                [% END %]
177
                [% IF ( periodicity11 ) %]
178
                        1/2 years
179
                [% END %]
180
            </li>
181
            <li>
182
              <span class="label">Manual history: </span>
183
                [% IF ( manualhistory ) %]
184
                    Disabled
185
                [% ELSE %]
186
                    Enabled
187
                [% END %]
188
            </li>
189
            <li><span class="label">Number pattern:</span>
190
                [% IF ( numberpattern1 ) %]
191
                    Number only
192
                [% END %]
193
                [% IF ( numberpattern2 ) %]
194
                    Volume, number, issue
195
                [% END %]
196
                [% IF ( numberpattern3 ) %]
197
                    Volume, number
198
                [% END %]
199
                [% IF ( numberpattern4 ) %]
200
                    Volume, issue
201
                [% END %]
202
                [% IF ( numberpattern5 ) %]
203
                    Number, issue
204
                [% END %]
205
                [% IF ( numberpattern8 ) %]
206
                    Year/Number
207
                [% END %]
208
                [% IF ( numberpattern6 ) %]
209
                    Seasonal only
210
                [% END %]
211
                [% IF ( numberpattern7 ) %]
212
                    None of the above
213
                [% END %]
214
            </li>
215
            <li><table>
216
            <tr><td>Starting with:</td>
217
                <td align="center">[% lastvalue1 %]</td>
218
            [% IF ( lastvalue2 ) %]
219
                <td align="center">&nbsp; 
220
                    [% lastvalue2 %]
221
                </td>
222
            [% END %]
223
            [% IF ( lastvalue3 ) %]
224
                <td align="center">&nbsp; 
225
                    [% lastvalue3 %]
226
                </td>
227
            [% END %]
228
            </tr>
229
            <tr><td>Rollover:</td>
230
                <td align="center">
231
                    [% IF ( whenmorethan1 < 9999999 ) %][% whenmorethan1 %][% ELSE %]Never[% END %]
232
                </td>
233
            [% IF ( whenmorethan2 ) %]
234
                <td align="center">&nbsp;
235
                    [% IF ( whenmorethan2 < 9999999 ) %][% whenmorethan2 %][% ELSE %]Never[% END %]
236
                </td>
237
            [% END %]
238
            [% IF ( whenmorethan3 ) %]
239
                <td align="center">&nbsp;
240
                    [% IF ( whenmorethan3 < 9999999 ) %][% whenmorethan3 %][% ELSE %]Never[% END %]
241
                </td>
242
            [% END %]
243
            </tr>
244
            </table></li>
245
            [% IF ( irregular_issues ) %]
246
            <li><span class="label">Irregularity:</span> [% irregular_issues %] issues
247
            </li>
248
            [% END %]
249
            <li><span class="label">First arrival:</span> [% firstacquidate %]
250
            </li>
251
        [% IF ( numberlength ) %]<li><span class="label">Number of issues:</span> [% numberlength %]</li>[% END %]
252
        [% IF ( weeklength ) %]<li><span class="label">Number of weeks:</span> [% weeklength %]</li>[% END %]
253
        [% IF ( monthlength ) %]<li><span class="label">Number of months:</span> [% monthlength %]</li>[% END %]
254
        </ol>
255
    </div>
256
    </div>
257
    </div>
258
    <div id="subscription_numbering" style="display:none;">
259
        <h3>Numbering calculation</h3>
260
        <p><label>Numbering formula:</label> [% numberingmethod %]</p>
261
        <table>
262
            <tr>
263
                <th>&nbsp;</th>
264
                <th>X</th>
265
                <th>Y</th>
266
                <th>Z</th>
267
                </tr>
268
                <tr>
269
                    <td>Add</td>
270
                    <td>
271
                        [% add1 %]
272
                    </td>
273
                    <td>
274
                        [% add2 %]
275
                    </td>
276
                    <td>
277
                        [% add3 %]
278
                    </td>
279
                </tr>
280
                <tr>
281
                    <td>once every</td>
282
                    <td>[% every1 %]</td>
283
                    <td>[% every2 %]</td>
284
                    <td>[% every3 %]</td>
285
                </tr>
286
                <tr>
287
                    <td>When more than</td>
288
                    <td>[% whenmorethan1 %] [% IF ( innerloop1 ) %]<br />
289
                        <i>(is [% innerloop1 %])</i>[% END %]</td>
290
                    <td>[% whenmorethan2 %] [% IF ( innerloop2 ) %]<br />
291
                        <i>(is [% innerloop2 %])</i>[% END %]</td>
292
                    <td>[% whenmorethan3 %] [% IF ( innerloop3 ) %]<br />
293
                        <i>(is [% innerloop3 %])</i>[% END %]</td>
294
                </tr>
295
                <tr>
296
                    <td>Set back to</td>
297
                    <td>[% setto1 %]</td>
298
                    <td>[% setto2 %]</td>
299
                    <td>[% setto3 %]</td>
300
                </tr>
301
                <tr>
302
                    <td>
303
                            Inner counter
304
                    </td>
305
                    <td>[% innerloop1 %]</td>
306
                    <td>[% innerloop2 %]</td>
307
                    <td>[% innerloop3 %]</td>
308
                </tr>
309
                <tr>
310
                    <td>
311
                            Last value
312
                    </td>
313
                    <td>[% lastvalue1 %]</td>
314
                    <td>[% lastvalue2 %]</td>
315
                    <td>[% lastvalue3 %]</td>
316
                </tr>
317
            </table>
318
    </div>
319
    <div id="subscription_issues">
320
        <table>
321
        <tr>
322
            <th>Issue number</th>
323
            <th>Planned date</th>
324
            <th>Published date</th>
325
            <th>Status</th>
326
        </tr>
327
        [% FOREACH serialslis IN serialslist %]
328
            <tr>
329
                <td>
330
                    [% serialslis.serialseq %]
331
                </td>
332
                <td>
333
                    [% serialslis.planneddate %]
334
                </td>
335
                <td>
336
                    [% serialslis.publisheddate %]
337
                </td>
338
                <td>
339
                        [% IF ( serialslis.status1 ) %]
340
                            Expected
341
                        [% END %]
342
                        [% IF ( serialslis.status2 ) %]
343
                            Arrived
344
                        [% END %]
345
                        [% IF ( serialslis.status3 ) %]
346
                            Late
347
                        [% END %]
348
                        [% IF ( serialslis.status4 ) %]
349
                            Missing
350
                        [% END %]
351
                        [% IF ( serialslis.status5 ) %]
352
                            Not available
353
                        [% END %]
354
                        [% IF ( serialslis.status7 ) %]
355
                            Claimed
356
                             [% IF ( serialslis.claimdate ) %]
357
                             [% serialslis.claimdate %]
358
                             [% END %]
359
                        [% END %]
360
                </td>
361
            </tr>
362
        [% END %]
363
        </table>
364
    </div>
365
    <div id="subscription_summary">
366
    <div class="yui-g">
367
    <div class="rows">
368
        <ol>
369
            <li><span class="label">Start date:</span> [% startdate %] </li>
370
            <li><span class="label">End date:</span> [% enddate %]</li>
371
            <li><span class="label">History start date:</span> [% histstartdate %] </li>
372
            <li><span class="label">History end date:</span> [% histenddate %]</li>
373
            <li><span class="label">Received issues:</span>[% recievedlist %]</li>
374
            <li><span class="label">Missing issues:</span>[% missinglist %]</li>
375
            <li><span class="label">Nonpublic note:</span>[% internalnotes %]</li>
376
            <li><span class="label">OPAC note:</span>[% notes %]</li>
377
            <li><span class="label">History staff note</span>[% librariannote %]</li>
378
            <li><span class="label">History OPAC note</span>[% opacnote %]</li>
379
        </ol>
380
    </div>
381
    </div>
382
    </div>
383
    </div>
384
</div>
385
</div>
386
387
<div class="yui-b">
388
[% INCLUDE 'serials-menu.inc' %]
389
</div>
390
</div>
391
[% INCLUDE 'intranet-bottom.inc' %]
392
- 

Return to bug 7936