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