Improving and Bug Fixing Membersearch
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / guarantor_search.tmpl
old mode 100755 (executable)
new mode 100644 (file)
index 330146c..7fa5099
@@ -1,44 +1,89 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Guarantor Search</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+    <style type="text/css">
+    #custom-doc { width:44.46em;*width:43.39em;min-width:578px; margin:auto; text-align:left; }
+    </style>
+    <script type="text/javascript">
+        <!--
+        function fillguarantor(id, surname, firstname, streetnumber, address, city, zipcode) {
+            var $ = window.opener.$;
+            var form = $('#entryform').get(0);
+
+            if (form.guarantorid.value) {
+                $("#contact-details").find('a').remove();
+                $("#contactname, #contactfirstname").parent().find('span').remove();
+            }
+
+            form.guarantorid.value = id;
+            $('#contact-details')
+                .show()
+                .find('span')
+                .after('<a target="blank" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=' + id + '">' + id + '</a>');
+
+            $(form.contactname)
+                .val(surname)
+                .before('<span>' + surname + '</span>').get(0).type = 'hidden';
+            $(form.contactfirstname)
+                .val(firstname)
+                .before('<span>' + firstname + '</span>').get(0).type = 'hidden';
+
+            form.streetnumber.value = streetnumber;
+            form.address.value = address;
+            form.city.value = city;
+            form.zipcode.value = zipcode;
+
+            form.guarantorsearch.value = 'Change';
+            self.close();
+        }
+        // -->
+    </script>
 </head>
-<body>
 
-<div id="doc" class="yui-t7">
+<div id="custom-doc" class="yui-t7">
    <div id="bd">
+       <div class="yui-g">
        
 
-<h1>Search for guarantor</h1>
+<h3>Search for guarantor</h3>
        <form action="/cgi-bin/koha/members/guarantor_search.pl" method="post">
-               <input type="text" name="member" value="<!-- TMPL_VAR NAME="member" -->" /> Ordered by
+               <fieldset>
+               <input type="text" name="member" id="member" value="<!-- TMPL_VAR NAME="member" -->" class="focus" /> Ordered by
                <select name="orderby">
                        <option value="surname,firstname">Surname</option>
                        <option value="cardnumber">Cardnumber</option>
-               </select>
-               <input type="submit" class="button" value="Search" />
+               </select> <input type="submit" class="button" value="Search" /></fieldset>
        </form>
 
 <!--TMPL_IF NAME="results" -->
-       <p>Searched for <!-- TMPL_VAR NAME="member" -->, <!-- TMPL_VAR Name ="numresults" --> borrower(s) found:</p>
+       <p>Searched for <span class="ex"><!-- TMPL_VAR NAME="member" --></span>, <!-- TMPL_VAR Name ="numresults" --> patron(s) found:</p>
        <table>
                <tr>
                        <th>Cardnumber</th>
-                       <th>Surname</th>
-                       <th>Firstname</th>
+                       <th>Name</th>
                        <th>Date of birth</th>
                        <th>Address</th>
+            <th>Select?</th>
                </tr>
                <!-- TMPL_LOOP NAME="resultsloop" -->
                        <tr>
                                <td><!-- TMPL_VAR NAME="cardnumber" --></td>
-                               <td><p><a href="javascript:window.opener.document.form.guarantorid.value=<!-- TMPL_VAR NAME="borrowernumber" -->;window.opener.document.form.guarantorsearch.value='Modify Guarantor';window.opener.document.form.guarantorinfo.value='<!-- TMPL_VAR NAME="guarantorinfo" -->';self.close();"><!-- TMPL_VAR NAME="surname" --></a></p>
-                               <td><b><!-- TMPL_VAR NAME="firstname" --></b></td> 
+                <td>
+                    <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" -->
+                </td> 
                                <td><!-- TMPL_VAR NAME="dateofbirth" --></td>
                                <td><p><!-- TMPL_VAR NAME="address" --> <!-- TMPL_VAR NAME="city" --></p></td>
+                <td>
+                    <form action="">
+                        <input type="button" onclick="fillguarantor('<!-- TMPL_VAR NAME="borrowernumber" -->', '<!-- TMPL_VAR NAME="surname" ESCAPE=JS -->', '<!-- TMPL_VAR NAME="firstname" ESCAPE=JS -->', '<!-- TMPL_VAR NAME="streetnumber" ESCAPE=JS -->', '<!-- TMPL_VAR NAME="address" ESCAPE=JS -->', '<!-- TMPL_VAR NAME="city" ESCAPE=JS -->', '<!-- TMPL_VAR NAME="zipcode" ESCAPE=JS -->'); return false;" value="Select"/>
+                    </form>
+                </td>
                        </tr>
                <!-- /TMPL_LOOP -->
        </table>
 <!--/TMPL_IF-->
 
+<div id="closewindow"><a href="#" class="close">Cancel</a></div>
+</div>
 </div>
 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->