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