Bugzilla – Attachment 25756 Details for
Bug 8262
Special kohaadmin cannot create lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8262: Special kohaadmin cannot create lists
Bug-8262-Special-kohaadmin-cannot-create-lists.patch (text/plain), 4.53 KB, created by
Marcel de Rooy
on 2014-03-03 09:12:24 UTC
(
hide
)
Description:
Bug 8262: Special kohaadmin cannot create lists
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2014-03-03 09:12:24 UTC
Size:
4.53 KB
patch
obsolete
>From 42cb6220712a783e70f6904b64e3cdb6d410f668 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 3 Mar 2014 09:55:43 +0100 >Subject: [PATCH] Bug 8262: Special kohaadmin cannot create lists >Content-Type: text/plain; charset=utf-8 > >Since kohaadmin has no borrower number, it cannot create lists. >A database error is logged, but the user is not notified. >This patch alerts the user (kohaadmin). >In the incidental case that a normal user gets a database error, >he is notified too that the list could not be created. > >Test plan: >This patch should be applied on top of 9032 patches. >Login as kohaadmin under opac and staff. >Create a list in opac and staff. Check the message. >--- > C4/VirtualShelves.pm | 1 + > C4/VirtualShelves/Page.pm | 6 ++++-- > .../prog/en/modules/virtualshelves/shelves.tt | 1 + > .../opac-tmpl/prog/en/modules/opac-shelves.tt | 1 + > 4 files changed, 7 insertions(+), 2 deletions(-) > >diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm >index 116b614..9547d02 100644 >--- a/C4/VirtualShelves.pm >+++ b/C4/VirtualShelves.pm >@@ -334,6 +334,7 @@ sub AddShelf { > $hashref->{allow_add}//0, > $hashref->{allow_delete_own}//1, > $hashref->{allow_delete_other}//0 ); >+ return if $sth->err; > my $shelfnumber = $dbh->{'mysql_insertid'}; > return $shelfnumber; > } >diff --git a/C4/VirtualShelves/Page.pm b/C4/VirtualShelves/Page.pm >index 609dcca..dd46e61 100644 >--- a/C4/VirtualShelves/Page.pm >+++ b/C4/VirtualShelves/Page.pm >@@ -337,7 +337,7 @@ sub shelfpage { > #Add a shelf > if ( my $newshelf = $query->param('addshelf') ) { > >- # note: a user can always add a new shelf >+ # note: a user can always add a new shelf (except kohaadmin) > my $shelfnumber = AddShelf( { > shelfname => $newshelf, > sortfield => $query->param('sortfield'), >@@ -348,7 +348,9 @@ sub shelfpage { > }, > $query->param('owner') ); > $stay = 1; >- if ( $shelfnumber == -1 ) { #shelf already exists. >+ if( !$shelfnumber ) { >+ push @paramsloop, { kohaadmin => 1 }; >+ } elsif ( $shelfnumber == -1 ) { #shelf already exists. > $showadd = 1; > push @paramsloop, { already => $newshelf }; > $template->param( shelfnumber => $shelfnumber ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index b2db5e4..2d406f9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -228,6 +228,7 @@ function placeHold () { > <div class="yui-ge"> > <div class="yui-u first"> > [% IF ( paramsloo.already ) %]<div class="dialog alert">A List named [% paramsloo.already %] already exists!</div>[% END %] >+ [% IF ( paramsloo.kohaadmin ) %]<div class="dialog alert">List could not be created. (Do not use the special administrator account.)</div>[% END %] > [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %] > [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %] > [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >index 5bbebca..0db4293 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >@@ -261,6 +261,7 @@ $(document).ready(function() { > <div class="yui-ge"> > <div class="yui-u first"> > [% IF ( paramsloo.already ) %]<div class="dialog alert">A list named <b>[% paramsloo.already %]</b> already exists!</div>[% END %] >+ [% IF ( paramsloo.kohaadmin ) %]<div class="dialog alert">List could not be created. (Do not use the special administrator account.)</div>[% END %] > [% IF ( paramsloo.status ) %]<div class="dialog alert">[% paramsloo.string %]</div>[% END %] > [% IF ( paramsloo.nobarcode ) %]<div class="dialog alert">ERROR: No barcode given.</div>[% END %] > [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No shelfnumber given.</div>[% END %] >-- >1.7.7.6
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8262
:
25756
|
25757
|
25971
|
26066
|
26526