Bugzilla – Attachment 26526 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]
[PASSED QA] Bug 8262: Special kohaadmin cannot create lists
PASSED-QA-Bug-8262-Special-kohaadmin-cannot-create.patch (text/plain), 6.21 KB, created by
Katrin Fischer
on 2014-03-23 20:36:36 UTC
(
hide
)
Description:
[PASSED QA] Bug 8262: Special kohaadmin cannot create lists
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-03-23 20:36:36 UTC
Size:
6.21 KB
patch
obsolete
>From dda01a17e0b4d0eb6efb6ad042176c6e10dbd276 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] [PASSED QA] Bug 8262: Special kohaadmin cannot create lists > >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 (for prog and bootstrap): >This patch should be applied on top of 9032 patches. >Login as kohaadmin. >Create a list in opac and staff. Check the message. >Login as a normal user. >Force a database error on list creation (I renamed category >in the table with alter table change column..) >You should have a different error message. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >Works as described, passes tests and QA script. >--- > C4/VirtualShelves.pm | 1 + > C4/VirtualShelves/Page.pm | 6 ++++-- > koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 1 + > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 1 + > koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt | 1 + > 5 files changed, 8 insertions(+), 2 deletions(-) > >diff --git a/C4/VirtualShelves.pm b/C4/VirtualShelves.pm >index 7ab875e..cb69469 100644 >--- a/C4/VirtualShelves.pm >+++ b/C4/VirtualShelves.pm >@@ -331,6 +331,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 259e12d..e753950 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, { addshelf_failed => 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 aca9485..e963b51 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.addshelf_failed ) %]<div class="dialog alert">List could not be created. [% IF loggedinuser==0 %](Do not use the database administrator account.)[% END %]</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/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index eb9f65b..f1e4912 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -102,6 +102,7 @@ > [% IF ( paramsloop ) %] > [% FOREACH paramsloo IN paramsloop %] > [% IF ( paramsloo.already ) %]<div class="alert">A list named <b>[% paramsloo.already %]</b> already exists!</div>[% END %] >+ [% IF ( paramsloo.addshelf_failed ) %]<div class="dialog alert">List could not be created. [% IF loggedinuser==0 %](Do not use the database administrator account.)[% END %]</div>[% END %] > [% IF ( paramsloo.status ) %]<div class="alert">[% paramsloo.string %]</div>[% END %] > [% IF ( paramsloo.nobarcode ) %]<div class="alert">ERROR: No barcode given.</div>[% END %] > [% IF ( paramsloo.noshelfnumber ) %]<div class="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 0ccd7b6..6b512e4 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt >@@ -251,6 +251,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.addshelf_failed ) %]<div class="dialog alert">List could not be created. [% IF loggedinuser==0 %](Do not use the database administrator account.)[% END %]</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.8.3.2
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