From a8d672c77a7c9d60a97a1ae053b0b56d74f735bb Mon Sep 17 00:00:00 2001 From: Mason James Date: Sun, 16 Dec 2007 18:43:00 -0600 Subject: [PATCH] updated for update-child feature. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- .../prog/en/includes/members-toolbar.inc | 75 +++++++++---------- 1 file changed, 34 insertions(+), 41 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 12f3d5aa42..1ce76f0013 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -4,22 +4,36 @@ function confirm_deletion() { var is_confirmed = window.confirm('Are you sure you want to delete this patron? This cannot be undone.'); - var borrowernumbervalue = $("#borrowernumber").attr("value"); + var borrowernumbervalue=document.form.borrowernumber.value; + if (is_confirmed) { - window.location='/cgi-bin/koha/members/deletemem.pl?member='+borrowernumbervalue+''; - } else { - return false; - } + window.location='/cgi-bin/koha/members/deletemem.pl?member='+borrowernumbervalue+''; + } +} +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.'); + + if (is_confirmed) { + window.location='/cgi-bin/koha/members/update-child.pl?op=update&borrowernumber=&catcode='; + } } function confirm_reregistration() { var is_confirmed = window.confirm('Are you sure you want to renew this patron\'s registration?'); - var borrowernumbervalue1 = $("#borrowernumber").attr("value"); - if (is_confirmed) { + var borrowernumbervalue1=document.form.borrowernumber.value; if (is_confirmed) { window.location='/cgi-bin/koha/members/moremember.pl?reregistration=y&borrowernumber='+borrowernumbervalue1+''; } } +function update_child() { + var borrowernumbervalue=document.form.borrowernumber.value; + + window.open('update-child.pl?op=multi&borrowernumber=','UpdateChild','width=400,height=300,toolbar=no,scrollbars=no'); + + confirm_updatechild(); + +} + // prepare DOM for YUI Toolbar $(document).ready(function() { @@ -41,12 +55,9 @@ function confirm_reregistration() { var moremenu = [ { text: "Renew Patron", onclick: { fn: confirm_reregistration } }, - { text: "Set Permissions", url: "/cgi-bin/koha/members/member-flags.pl?member=", - - disabled: true, - - disabled: true, }, - { text: "Delete", disabled: true, onclick: { fn: confirm_deletion } }, + { text: "Set Permissions", url: "/cgi-bin/koha/members/member-flags.pl?member=",disabled: true, }, + { text: "Delete", onclick: { fn: confirm_deletion } }, + { text: "Update Child to Adult Patron" , onclick: { fn: update_child }, disabled: true, }, ] new YAHOO.widget.Button({ @@ -64,31 +75,25 @@ function confirm_reregistration() { menu: moremenu, container: "moremenuc" }); - + + new YAHOO.widget.Button("checkout"); new YAHOO.widget.Button("addchild"); new YAHOO.widget.Button("editpatron"); new YAHOO.widget.Button("addnote"); - new YAHOO.widget.Button("changepassword"); - new YAHOO.widget.Button("changepassword"); + new YAHOO.widget.Button("changepassword"); new YAHOO.widget.Button("printslilp"); new YAHOO.widget.Button("printpage"); new YAHOO.widget.Button("renewpatron"); - - - - new YAHOO.widget.Button("patronflags"); - - - new YAHOO.widget.Button("patronflags"); - - - new YAHOO.widget.Button("deletepatron"); - new YAHOO.widget.Button("deletepatron"); + new YAHOO.widget.Button("patronflags"); + new YAHOO.widget.Button("deletepatron"); + new YAHOO.widget.Button("updatechild"); } //]]> + -- 2.39.5