(bug #3284) fix borrower deletion in independantbranches mode
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / members-toolbar.inc
index 3adcfdb..8da6db2 100644 (file)
@@ -4,14 +4,12 @@
 
 function confirm_deletion() {
     var is_confirmed = window.confirm('Are you sure you want to delete this patron? This cannot be undone.');
-    var borrowernumbervalue=document.form.borrowernumber.value; 
-   
     if (is_confirmed) {
-            window.location='/cgi-bin/koha/members/deletemem.pl?member='+borrowernumbervalue+'';
+            window.location='/cgi-bin/koha/members/deletemem.pl?member=<!-- TMPL_VAR NAME="borrowernumber" -->';
     }
 }
 function confirm_updatechild() {
-    var is_confirmed = window.confirm('Are you sure you want to update this child to an Adult catergory? This cannot be undone.');
+    var is_confirmed = window.confirm('Are you sure you want to update this child to an Adult category?  This cannot be undone.');
    
     if (is_confirmed) {
             window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&catcode=<!-- TMPL_VAR NAME="catcode" -->&catcode_multi=<!-- TMPL_VAR NAME="CATCODE_MULTI" -->';
@@ -20,13 +18,12 @@ function confirm_updatechild() {
 
 function confirm_reregistration() {
     var is_confirmed = window.confirm('Are you sure you want to renew this patron\'s registration?');
-    var borrowernumbervalue1=document.form.borrowernumber.value;   if (is_confirmed) {
-    window.location='/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber='+borrowernumbervalue1+'';
+    if (is_confirmed) {
+    window.location='/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->';
     }
 }
 
 function update_child() {
-    var borrowernumbervalue=document.form.borrowernumber.value; 
 <!-- TMPL_IF NAME="CATCODE_MULTI" -->
  window.open('update-child.pl?op=multi&borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->','UpdateChild','width=400,height=300,toolbar=no,scrollbars=no,resizable=yes');
 <!-- TMPL_ELSE -->
@@ -46,19 +43,23 @@ function update_child() {
         });
 
        // YUI Toolbar Functions
+       function printx_window(print_type) {
+               window.open("/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=" + print_type, "printwindow");
+               return false;
+       }
 
        function yuiToolbar() {
            var printmenu = [
-               { text: _("Print Page"), url: "/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=page" },
-               { text: _("Print Slip"), url: "/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=slip" }
+               { text: _("Print Page"), onclick: {fn: function(){printx_window("page")}} },
+               { text: _("Print Slip"), onclick: {fn: function(){printx_window("slip")}} }
            ];
        
                var moremenu = [
                        { text: _("Renew Patron"),  onclick: { fn: confirm_reregistration } },
                        { text: _("Set Permissions"), url: "/cgi-bin/koha/members/member-flags.pl?member=<!-- TMPL_VAR NAME="borrowernumber" -->"<!-- TMPL_UNLESS NAME="CAN_user_permissions" -->, disabled: true<!-- /TMPL_UNLESS -->},
-                       { text: _("Delete"), onclick: { fn: confirm_deletion } },
+                       { text: _("Delete"), onclick: { fn: confirm_deletion}<!-- TMPL_UNLESS NAME="samebranch" -->, disabled: true<!-- /TMPL_IF --> },
                        { text: _("Update Child to Adult Patron") , onclick: { fn: update_child }<!-- TMPL_UNLESS NAME="is_child" -->, disabled: true<!-- /TMPL_UNLESS -->}
-               ]
+               ];
 
            new YAHOO.widget.Button({
                type: "menu",