This is a minor change, but affects all templates:
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / 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 <!--TMPL_INCLUDE NAME="menu-serials.inc" -->
5 <div id="mainbloc">
6         <h1>Select borrowers or enter manually the names</h1>
7         <p>
8                 <form action="/cgi-bin/koha/serials/distributedto.pl" method="post" name="Aform">
9                         <table>
10                         <tr>
11                         <td>
12                                 <input type="text" name="searchfield" value="<!-- TMPL_VAR name="searchfield" -->">
13                                 <input type="submit" class="button" value="Filter">
14                         </td>
15                         <td rowspan="2">
16                                 <h2>Distributed to</h2>
17                                 <p>
18                                         <textarea name="distributedto" rows="15" cols="30"><!-- TMPL_VAR name="distributedto" --></textarea>
19                                 </p>
20                                 <p>
21                                         <!-- TMPL_IF name="save" -->
22                                                 saved</p><p>
23                                         <!-- /TMPL_IF -->
24                                         <input type="hidden" name="SaveList" value="0">
25                                         <input type="hidden" name="subscriptionid" value="<!-- TMPL_VAR name="subscriptionid" -->">
26                                         <input type="button" name="save" value="Save" class="button" onClick="FSaveList()">
27                                         <input type="button" name="clode" value="Close" class="button" onClick="javascript:window.close()">
28                         </td>
29                         </tr>
30                         <tr>
31                         <td>
32                                 <!-- TMPL_VAR NAME="borrowername" -->
33                                 <select name="borlist" size="15">
34                                         <!-- TMPL_LOOP name="borlist" -->
35                                                 <option value="<!-- TMPL_VAR name="surname" --><!-- TMPL_VAR name="firstname" -->">
36                                                         <!-- TMPL_VAR name="surname" --> <!-- TMPL_VAR name="firstname" -->
37                                                 </option>
38                                         <!-- /TMPL_LOOP -->
39                                 </select>
40                                 <input type="button" name="insert" value="&gt;&gt;" class="button" onclick="insertValueQuery()" title="Insert" />
41                         </td>
42                         </tr>
43                         </table>
44                 </form>
45         </p>
46         <script language="javascript" type="text/javascript">
47                 // GPL code coming from PhpMyAdmin
48                 function insertValueQuery() {
49                         var myQuery = document.Aform.distributedto;
50                         var myListBox = document.Aform.borlist;
51                 
52                         if(myListBox.options.length > 0) {
53                                 var chaineAj = "";
54                                 var NbSelect = 0;
55                                 for(var i=0; i<myListBox.options.length; i++) {
56                                         if (myListBox.options[i].selected){
57                                                 NbSelect++;
58                                                 if (NbSelect > 1)
59                                                         chaineAj += ", ";
60                                                 chaineAj += myListBox.options[i].value;
61                                         }
62                                 }
63                 
64                                 //IE support
65                                 if (document.selection) {
66                                         myQuery.focus();
67                                         sel = document.selection.createRange();
68                                         sel.text = chaineAj;
69                                         document.Aform.insert.focus();
70                                 }
71                                 //MOZILLA/NETSCAPE support
72                                 else if (document.Aform.distributedto.selectionStart || document.Aform.distributedto.selectionStart == "0") {
73                                         var startPos = document.Aform.distributedto.selectionStart;
74                                         var endPos = document.Aform.distributedto.selectionEnd;
75                                         var chaineSql = document.Aform.distributedto.value;
76                                         myQuery.value = chaineSql.substring(0, startPos) +''+ chaineAj+"\n" + chaineSql.substring(endPos, chaineSql.length);
77                                 } else {
78                                         myQuery.value += chaineAj;
79                                 }
80                         }
81                 }
82                 function FSaveList() {
83                         document.Aform.SaveList.value=1;
84                         document.Aform.submit();
85                 }
86         </script>
87 </div>
88 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->