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