[25/40] More work on label export coded and interface. Adding icons for all export...
[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     <!-- TMPL_INCLUDE NAME="greybox.inc" -->
5     <script type="text/JavaScript" language="JavaScript">
6         //<![CDATA[
7             function Remove() {
8                 items= new Array;
9                 if(document.items.action.length > 0) {
10                     for (var i=0; i < document.items.action.length; i++) {
11                         if (document.items.action[i].checked) {
12                             items.push("label_id=" +  document.items.action[i].value);
13                         }
14                     }
15                     if (items.length < 1) {
16                         alert("Please select at least one item to delete.");
17                         return;     // no item selected
18                     }
19                     getstr = items.join("&");
20                 }
21                 else if (document.items.action.checked) {
22                     getstr = "label_id="+document.items.action.value;
23                 }
24                 else {
25                     alert("Please select at least one item to delete.");
26                     return;     // no item selected
27                 }
28                 var msg = "Are you sure you want to remove the selected item(s) from this batch?"
29                 var answer = confirm(msg);
30                 if (answer) {
31                     window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=remove&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->&amp;" + getstr;
32                 }
33                 else {
34                     return; // abort delete
35                 }
36             };
37             function Add() {
38                 window.location = "/cgi-bin/koha/labels/label-edit-batch.pl?op=add&amp;batch_id=<!-- TMPL_VAR NAME="batch_id" -->";
39             };
40             function Xport(mode) {
41                 if (mode == 'label') {
42                     labels= new Array;
43                     if(document.items.action.length > 0) {
44                         for (var i=0; i < document.items.action.length; i++) {
45                             if (document.items.action[i].checked) {
46                                 labels.push("label_id=" +  document.items.action[i].value);
47                             }
48                         }
49                         if (labels.length < 1) {
50                             alert("Please select at least one label to export.");
51                             return;     // no batch selected
52                         }
53                         getstr = labels.join("&");
54                     }
55                     else if (document.items.action.checked) {
56                         getstr = document.items.action.value;
57                     }
58                     else {
59                         alert("Please select at least one label to export.");
60                         return;     // no batch selected
61                     }
62                     //<td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=<!-- TMPL_VAR NAME="breedingid" -->" title="MARC" rel="gb_page_center[600,500]">MARC</a></td>
63                     //window.location = "/cgi-bin/koha/labels/label-print.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->&" + getstr;
64                     //return GB_show('Google', this.href)
65                     return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->&" + getstr, 700, 800);
66                 }
67                 else if (mode == 'batch') {
68                     //window.location = "/cgi-bin/koha/labels/label-print.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->";
69                     //$(".checkboxed").uncheckCheckboxes();
70                     return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?batch_id=<!-- TMPL_VAR NAME="batch_id" -->", 700, 800);
71                 }
72                 else {
73                     // some pass-thru error trapping just in case...
74                 }
75             };
76            function selected_layout() {
77                 if (document.items.action.length) {
78                 for (i=0;i<document.items.action.length;i++){
79                     if (document.items.action[i].checked==true){
80                         return(document.items.action[i].value);
81                     }
82                 };
83                 }
84                 else {
85                     if (document.items.action.checked){
86                         return(document.items.action.value);
87                     }
88                 };
89                 alert("Please select at least one item.");
90                 return (-1);
91             };
92         //]]>
93     </script>
94 </head>
95 <body>
96     <!-- TMPL_INCLUDE NAME="header.inc" -->
97     <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
98     <div id="breadcrumbs">
99         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; 
100         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
101         <a href="/cgi-bin/koha/labels/labels-home.pl">Labels</a> &rsaquo;
102         Manage Batch Number <!-- TMPL_VAR NAME="batch_id" -->
103     </div>
104     <div id="doc3" class="yui-t2">
105         <div id="bd">
106             <div id="yui-main">
107                 <div class="yui-b">
108                     <!-- TMPL_INCLUDE NAME="labels-batches-toolbar.inc" -->
109                     <div class="yui-gc">
110                         <div class="yui-u first" id="manage-label-batches">
111                             <div class="hint">Current Branch: <!-- TMPL_VAR NAME="LoginBranchname" --></div>
112                             <form name="items" class="checkboxed">
113                             <h2>Items in batch number <!-- TMPL_VAR NAME="batch_id" --></h2>
114                             <table>
115                                 <!-- TMPL_LOOP NAME="table_loop" -->
116                                 <!-- TMPL_IF NAME="header_fields" -->
117                                 <tr>
118                                 <!-- TMPL_LOOP NAME="header_fields" -->
119                                     <th><!-- TMPL_VAR NAME="field_label" --></th>
120                                 <!-- /TMPL_LOOP -->
121                                 </tr>
122                                 <!-- TMPL_ELSE -->
123                                 <tr>
124                                 <!-- TMPL_LOOP NAME="text_fields" -->
125                                 <!-- TMPL_IF NAME="select_field" -->
126                                     <td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
127                                 <!-- TMPL_ELSE -->
128                                     <td><!-- TMPL_VAR NAME="field_value" --></td>
129                                 <!-- /TMPL_IF -->
130                                 <!-- /TMPL_LOOP -->
131                                 </tr>
132                                 <!-- /TMPL_IF -->
133                                 <!-- /TMPL_LOOP -->
134                             </table>
135                             </form>
136                             <div style="margin: 10px 10px 10px 0px;">
137                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="add" onclick="Add()" value="Add Item(s)"></span></span>
138                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="remove" onclick="Remove()" value="Remove Item(s)"></span></span>
139                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="export_item" onclick="Xport('label')" value="Export Item(s)"></span></span>
140                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="export_batch" onclick="Xport('batch')" value="Export Batch"></span></span>
141                             </div>
142                         </div>
143                         <!-- TMPL_IF NAME="err" -->
144                         <div class="yui-u">
145                             <div class="alert">
146                                 <strong>WARNING: An error was encountered and <!-- TMPL_VAR NAME="errstr" --> Please have your system administrator check the syslog for details.</strong>
147                             </div>
148                         </div>
149                         <!-- /TMPL_IF -->
150                         <!-- TMPL_IF NAME="duplicate_message" -->
151                         <div class="yui-u">
152                             <div class="dialog">
153                                 <strong><!-- TMPL_VAR NAME="duplicate_count" --> duplicate item(s) found and removed from batch <!-- TMPL_VAR NAME="batch_id" -->.</strong>
154                             </div>
155                         </div>
156                         <!-- /TMPL_IF -->
157                     </div>
158                 </div>
159             </div>
160             <div class="yui-b">
161                 <!-- TMPL_INCLUDE NAME="labels-menu.inc" -->
162             </div>
163         </div>
164     <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->