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