Moving </head><body> into body of templates so that js and css can be embedded per...
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / serials / distributedto.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Serials &rsaquo; Select Supplier</title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 </head>
5 <body>
6 <!-- TMPL_INCLUDE NAME="header.inc" -->
7 <!--TMPL_INCLUDE NAME="menu-serials.inc" -->
8
9 <div id="doc3" class="yui-t2">
10    
11    <div id="bd">
12         <div id="yui-main">
13         <div class="yui-b"><div class="yui-g">
14
15         <h1>Select borrowers or enter manually the names</h1>
16         <p>
17                 <form action="/cgi-bin/koha/serials/distributedto.pl" method="post" name="Aform">
18                         <table>
19                         <tr>
20                         <td>
21                                 <input type="text" name="searchfield" value="<!-- TMPL_VAR name="searchfield" -->">
22                                 <input type="submit" class="button" value="Filter">
23                         </td>
24                         <td rowspan="2">
25                                 <h2>Distributed to</h2>
26                                 <p>
27                                         <textarea name="distributedto" rows="15" cols="30"><!-- TMPL_VAR name="distributedto" --></textarea>
28                                 </p>
29                                 <p>
30                                         <!-- TMPL_IF name="save" -->
31                                                 saved</p>
32                                         <!-- /TMPL_IF -->
33                                         <input type="hidden" name="SaveList" value="0">
34                                         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->">
35                                         <input type="button" name="save" value="Save" class="button" onclick="FSaveList()">
36                                         <input type="button" name="clode" value="Close" class="button" onclick="window.close()">
37                         </td>
38                         </tr>
39                         <tr>
40                         <td>
41                                 <!-- TMPL_VAR NAME="borrowername" -->
42                                 <select name="borlist" size="15">
43                                         <!-- TMPL_LOOP name="borlist" -->
44                                                 <option value="<!-- TMPL_VAR name="surname" --><!-- TMPL_VAR name="firstname" -->">
45                                                         <!-- TMPL_VAR name="surname" --> <!-- TMPL_VAR name="firstname" -->
46                                                 </option>
47                                         <!-- /TMPL_LOOP -->
48                                 </select>
49                                 <input type="button" name="insert" value="&gt;&gt;" class="button" onclick="insertValueQuery()" title="Insert" />
50                         </td>
51                         </tr>
52                         </table>
53                 </form>
54         </p>
55         <script language="javascript" type="text/javascript">
56                 // GPL code coming from PhpMyAdmin
57                 function insertValueQuery() {
58                         var myQuery = document.Aform.distributedto;
59                         var myListBox = document.Aform.borlist;
60                 
61                         if(myListBox.options.length > 0) {
62                                 var chaineAj = "";
63                                 var NbSelect = 0;
64                                 for(var i=0; i<myListBox.options.length; i++) {
65                                         if (myListBox.options[i].selected){
66                                                 NbSelect++;
67                                                 if (NbSelect > 1)
68                                                         chaineAj += ", ";
69                                                 chaineAj += myListBox.options[i].value;
70                                         }
71                                 }
72                 
73                                 //IE support
74                                 if (document.selection) {
75                                         myQuery.focus();
76                                         sel = document.selection.createRange();
77                                         sel.text = chaineAj;
78                                         document.Aform.insert.focus();
79                                 }
80                                 //MOZILLA/NETSCAPE support
81                                 else if (document.Aform.distributedto.selectionStart || document.Aform.distributedto.selectionStart == "0") {
82                                         var startPos = document.Aform.distributedto.selectionStart;
83                                         var endPos = document.Aform.distributedto.selectionEnd;
84                                         var chaineSql = document.Aform.distributedto.value;
85                                         myQuery.value = chaineSql.substring(0, startPos) +''+ chaineAj+"\n" + chaineSql.substring(endPos, chaineSql.length);
86                                 } else {
87                                         myQuery.value += chaineAj;
88                                 }
89                         }
90                 }
91                 function FSaveList() {
92                         document.Aform.SaveList.value="1";
93                         document.Aform.submit();
94                 }
95         </script>
96 </div>
97 </div>
98 </div>
99
100 <!-- TMPL_INCLUDE NAME="mainmenu.inc" -->
101 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
102