[15/40] Initial work on label batch edit interface.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-edit-batch.tmpl
1     <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2     <title>Koha &rsaquo; Tools &rsaquo; Labels &rsaquo; Manage Label Batches</title>
3     <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4     <script type="text/JavaScript" language="JavaScript">
5         //<![CDATA[
6             function RemoveConfirm() {
7                 var label_id = selected_layout();
8                 if (label_id>-1) {
9                     var msg = "Are you sure you want to the selected item from this batch?"
10                     var answer = confirm(msg);
11                     if (answer) {
12                         window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;label_id=" + label_id;
13                     }
14                     else {
15                         return; // abort delete
16                     }
17                 }
18                 else {
19                     return;     // no layout selected
20                 };
21             };
22             function Add() {
23                 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=add&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->";
24             };
25             function Print(mode) {
26                 if (mode == 'batch') {
27                     alert("Print batch <!-- TMPL_VAR NAME="batch_id" -->.");
28 //                    window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=print&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->";
29                 }
30                 else {
31                     var label_id = selected_layout();
32                     alert("Print item " + label_id + ".");
33 //                    if (label_id>-1) {
34 //                       window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=print&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;label_id=" + label_id;
35 //                    }
36 //                    else {
37 //                        return;     // no layout selected
38 //                    };
39                 };
40             };
41            function selected_layout() {
42                 if (document.layouts.action.length) {
43                 for (i=0;i<document.layouts.action.length;i++){
44                     if (document.layouts.action[i].checked==true){
45                         return(document.layouts.action[i].value);
46                     }
47                 };
48                 }
49                 else {
50                     if (document.layouts.action.checked){
51                         return(document.layouts.action.value);
52                     }
53                     //var x=document.getElementsByName("action");
54                     //if (x[0].checked) {
55                     //    alert(x[0].value);
56                     //    return(x[0].value);
57                     //};
58                 };
59                 alert("Please select an item.");
60                 return (-1);
61             };
62         //]]>
63     </script>
64 </head>
65 <body>
66     <!-- TMPL_INCLUDE NAME="header.inc" -->
67     <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
68     <div id="breadcrumbs">
69         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; 
70         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
71         <a href="/cgi-bin/koha/labels/labels-home.pl">Labels</a> &rsaquo;
72         Manage Batch Number <!-- TMPL_VAR NAME="batch_id" -->
73     </div>
74     <div id="doc3" class="yui-t2">
75         <div id="bd">
76             <div id="yui-main">
77                 <div class="yui-b">
78                     <!-- TMPL_INCLUDE NAME="labels-batches-toolbar.inc" -->
79                     <div class="yui-gc">
80                         <div class="yui-u first" id="manage-label-batches">
81                             <div class="hint">Current Branch: <!-- TMPL_VAR NAME="LoginBranchname" --></div>
82                             <form name="layouts">
83                             <h2>Items in batch number <!-- TMPL_VAR NAME="batch_id" --></h2>
84                             <table>
85                                 <!-- TMPL_LOOP NAME="table_loop" -->
86                                 <!-- TMPL_IF NAME="header_fields" -->
87                                 <tr>
88                                 <!-- TMPL_LOOP NAME="header_fields" -->
89                                     <th><!-- TMPL_VAR NAME="field_label" --></th>
90                                 <!-- /TMPL_LOOP -->
91                                 </tr>
92                                 <!-- TMPL_ELSE -->
93                                 <tr>
94                                 <!-- TMPL_LOOP NAME="text_fields" -->
95                                 <!-- TMPL_IF NAME="select_field" -->
96                                     <td align="center"><input type="radio" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
97                                 <!-- TMPL_ELSE -->
98                                     <td><!-- TMPL_VAR NAME="field_value" --></td>
99                                 <!-- /TMPL_IF -->
100                                 <!-- /TMPL_LOOP -->
101                                 </tr>
102                                 <!-- /TMPL_IF -->
103                                 <!-- /TMPL_LOOP -->
104                             </table>
105                             </form>
106                             <div style="margin: 10px 10px 10px 0px;">
107                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="add" onclick="Add()" value="Add Item"></span></span>
108                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="remove" onclick="RemoveConfirm()" value="Remove Item"></span></span>
109                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="print_item" onclick="Print(item)" value="Print Item"></span></span>
110                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="print_batch" onclick="Print(batch)" value="Print Batch"></span></span>
111                             </div>
112                         </div>
113                         <!-- TMPL_IF NAME="err" -->
114                         <div class="yui-u">
115                             <div class="dialog alert">
116                                 <strong>WARNING: An error was encountered and <!-- TMPL_VAR NAME="errstr" --> Please have your system administrator check the syslog for details.</strong>
117                             </div>
118                         </div>
119                         <!-- /TMPL_IF -->
120                     </div>
121                 </div>
122             </div>
123             <div class="yui-b">
124                 <!-- TMPL_INCLUDE NAME="labels-menu.inc" -->
125             </div>
126         </div>
127     <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->