Merge branch 'labels_recon' into to-push
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / labels / label-manage.tmpl
1     <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2     <title>Koha &rsaquo; Tools &rsaquo; Labels &rsaquo; Manage Label Elements</title>
3     <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4     <!-- TMPL_INCLUDE NAME="greybox.inc" -->
5     <!-- Uncomment the following script line to enable firebug lite for use on IE -->
6     <!-- <script type='text/javascript' src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script> -->
7     <script type="text/JavaScript" language="JavaScript">
8         //<![CDATA[
9             function DeleteConfirm() {
10                 var element_id = selected_layout("delete");
11                 if (element_id>-1) {
12                     var msg = "Are you sure you want to delete <!-- TMPL_VAR NAME="label_element" --> " + element_id + "?"
13                     var answer = confirm(msg);
14                     if (answer) {
15                         window.location = "/cgi-bin/koha/labels/label-manage.pl?op=delete&amp;label_element=<!-- TMPL_VAR NAME="label_element" -->&amp;element_id=" + element_id;
16                     }
17                     else {
18                         return; // abort delete
19                     }
20                 }
21                 else {
22                     return;     // no layout selected
23                 };
24             };
25             function Edit() {
26                 var element_id = selected_layout("edit");
27                 if (element_id>-1) {
28                     window.location = "/cgi-bin/koha/labels/label-edit-<!-- TMPL_VAR NAME="label_element" -->.pl?op=edit&amp;element_id=" + element_id;
29                 }
30                 else {
31                     return;     // no layout selected
32                 };
33             };
34             function Xport() {
35                 batches= new Array;
36                 if(document.layouts.action.length > 0) {
37                     for (var i=0; i < document.layouts.action.length; i++) {
38                         if (document.layouts.action[i].checked) {
39                             batches.push("batch_id=" +  document.layouts.action[i].value);
40                         }
41                     }
42                     if (batches.length < 1) {
43                         alert("Please select at least one batch to export.");
44                         return;     // no batch selected
45                     }
46                     getstr = batches.join("&");
47                 }
48                 else if (document.layouts.action.checked) {
49                     getstr = "batch_id="+document.layouts.action.value;
50                 }
51                 else {
52                     alert("Please select at least one batch to export.");
53                     return;     // no batch selected
54                 }
55                 return GB_showCenter('Export Labels', "/cgi-bin/koha/labels/label-print.pl?" + getstr, 700, 800);
56             };
57             function selected_layout(op) {
58                 var selected = new Array;
59                 if (document.layouts.action.length) {
60                     for (i=0;i<document.layouts.action.length;i++){
61                         if (document.layouts.action[i].checked){
62                             selected.push(i);
63                         }
64                     };
65                     if (selected.length == 1) {
66                         return(document.layouts.action[selected[0]].value);
67                     }
68                     else {
69                         alert("Please select only one <!-- TMPL_VAR NAME="label_element" --> to " + op + ".");
70                         return (-1);
71                     }
72                 }
73                 else {
74                     if (document.layouts.action.checked){
75                         return(document.layouts.action.value);
76                     }
77                 };
78                 alert("Please select a <!-- TMPL_VAR NAME="label_element" -->.");
79                 return (-1);
80             };
81         //]]>
82     </script>
83 </head>
84 <body>
85     <!-- TMPL_INCLUDE NAME="header.inc" -->
86     <!-- TMPL_INCLUDE NAME="cat-search.inc" -->
87     <div id="breadcrumbs">
88         <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; 
89         <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
90         <a href="/cgi-bin/koha/labels/label-home.pl">Labels Home</a> &rsaquo;
91         Manage Label <!-- TMPL_VAR NAME="label_element_title" -->
92     </div>
93     <div id="doc3" class="yui-t2">
94         <div id="bd">
95             <div id="yui-main">
96                 <div class="yui-b">
97                     <!-- TMPL_INCLUDE NAME="labels-toolbar.inc" -->
98                     <div class="yui-gc">
99                         <div class="yui-u first" id="manage-label-layouts">
100                             <div class="hint">Current Branch: <!-- TMPL_VAR NAME="LoginBranchname" --></div>
101                             <!-- TMPL_IF NAME="table_loop" -->
102                             <form name="layouts">
103                             <h2>Currently Available <!-- TMPL_VAR NAME="label_element_title" --></h2>
104                             <table>
105                                 <!-- TMPL_LOOP NAME="table_loop" -->
106                                 <!-- TMPL_IF NAME="header_fields" -->
107                                 <tr>
108                                 <!-- TMPL_LOOP NAME="header_fields" -->
109                                     <th><!-- TMPL_VAR NAME="field_label" --></th>
110                                 <!-- /TMPL_LOOP -->
111                                 </tr>
112                                 <!-- TMPL_ELSE -->
113                                 <tr>
114                                 <!-- TMPL_LOOP NAME="text_fields" -->
115                                 <!-- TMPL_IF NAME="select_field" -->
116                                     <td align="center"><input type="checkbox" name="action" value="<!-- TMPL_VAR NAME="field_value" -->"></td>
117                                 <!-- TMPL_ELSIF NAME="field_value" -->
118                                     <td><!-- TMPL_VAR NAME="field_value" --></td>
119                                 <!-- TMPL_ELSE -->
120                                     <td>&nbsp;</td>
121                                 <!-- /TMPL_IF -->
122                                 <!-- /TMPL_LOOP -->
123                                 </tr>
124                                 <!-- /TMPL_IF -->
125                                 <!-- /TMPL_LOOP -->
126                             </table>
127                             <div style="margin: 10px 10px 10px 0px;">
128                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="edit" onclick="Edit()" value="Edit"></span></span>
129                                 <span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="delete" onclick="DeleteConfirm()" value="Delete"></span></span>
130                                 <!-- TMPL_IF NAME="print" --><span class="yui-button yui-link-button"><span class="first-child"><input type="button" id="print" onclick="Xport()" value="Export"></span></span><!-- /TMPL_IF -->
131                             </div>
132                             </form>
133                             <!-- TMPL_ELSE -->
134                             <h2>There Are No <!-- TMPL_VAR NAME="label_element_title" --> Currently Available.</h2>
135                             <div class="hint"><h3>Use the toolbar above to create a new <!-- TMPL_VAR NAME="label_element" -->.</h3></div>
136                             <!-- /TMPL_IF -->
137                         </div>
138                         <!-- TMPL_IF NAME="error" -->
139                         <div class="yui-u">
140                             <div class="alert">
141                                 <strong>WARNING: An error was encountered and <!-- TMPL_VAR NAME="label_element" --> <!-- TMPL_VAR NAME="element_id" --> was not deleted. Please have your system administrator check the error log for details.</strong>
142                             </div>
143                         </div>
144                         <!-- /TMPL_IF -->
145                     </div>
146                 </div>
147             </div>
148             <div class="yui-b">
149                 <!-- TMPL_INCLUDE NAME="labels-menu.inc" -->
150             </div>
151         </div>
152     <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->