From 28ab13b60d983589fbd9868589512b171fe12486 Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Mon, 5 Sep 2011 18:10:53 +0200 Subject: [PATCH] Bug 5916 : (MT #2685) don't show authority edition menu this patch add a check of rights to show the authority edition menu, if the user have no rights of authority edition, we hide the menu. (original patch from Nahuel Angelinetti, rewritten for T::T) --- .../prog/en/includes/authorities-toolbar.inc | 43 ++++++++++---------- 1 files changed, 22 insertions(+), 21 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc index 214bc20..410e181 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc @@ -14,28 +14,29 @@ function yuiToolbar() { - var newmenu = [ - [% FOREACH authtypesloo IN authtypesloop %]{ text: "[% authtypesloo.authtypetext %]", url: "/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authtypesloo.value %]"}, -[% END %] - ] + [% IF ( CAN_user_editauthorities ) %] + var newmenu = [ + [% FOREACH authtypesloo IN authtypesloop %]{ text: "[% authtypesloo.authtypetext %]", url: "/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authtypesloo.value %]"}, + [% END %] + ] + new YAHOO.widget.Button({ + type: "menu", + label: _("New Authority"), + name: "newmenubutton", + menu: newmenu, + container: "newmenuc" + }); + + var editButton = new YAHOO.widget.Button("editAuth"); - new YAHOO.widget.Button({ - type: "menu", - label: _("New Authority"), - name: "newmenubutton", - menu: newmenu, - container: "newmenuc" - }); - - var editButton = new YAHOO.widget.Button("editAuth"); - - var delAuthButton = new YAHOO.widget.Button({ - id: "delAuth", - type: "button", - label: _("Delete"), - container: "delAuthc", - onclick: {fn: confirm_deletion } - }); + var delAuthButton = new YAHOO.widget.Button({ + id: "delAuth", + type: "button", + label: _("Delete"), + container: "delAuthc", + onclick: {fn: confirm_deletion } + }); + [% END %] } //]]> -- 1.7.4.1