Bugzilla – Attachment 72495 Details for
Bug 17218
New list add attempt while logged in as dbadmin on staff side should be prevented pre-emptively
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17218: [FOLLOW-UP] Removing pointless code and putting checks in missed places
Bug-17218-FOLLOW-UP-Removing-pointless-code-and-pu.patch (text/plain), 6.33 KB, created by
Aleisha Amohia
on 2018-03-07 03:07:49 UTC
(
hide
)
Description:
Bug 17218: [FOLLOW-UP] Removing pointless code and putting checks in missed places
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2018-03-07 03:07:49 UTC
Size:
6.33 KB
patch
obsolete
>From 43b3fb575842165ac87b418318fd0b2196a7eb9a Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 7 Mar 2018 02:59:16 +0000 >Subject: [PATCH] Bug 17218: [FOLLOW-UP] Removing pointless code and putting > checks in missed places > >To test: >1) Log in as admin >2) View contents of a public list >3) Click drop-down for 'Add to' - there should be no [New list] option >4) Click on an item in the list >5) Click drop-down for 'Add to' in nav bar, click List >6) There should be no option to add a new list in the pop-up window >7) Do a catalog search that will return multiple results >8) Click drop-down for 'Add to list' - there should be no New list >option > >Sponsored-by: Catalyst IT >--- > catalogue/search.pl | 1 + > .../prog/en/includes/virtualshelves-toolbar.inc | 20 -------------------- > .../prog/en/modules/catalogue/results.tt | 11 +++++++---- > .../en/modules/virtualshelves/addbybiblionumber.tt | 5 ++++- > .../prog/en/modules/virtualshelves/shelves.tt | 4 +++- > virtualshelves/addbybiblionumber.pl | 1 + > 6 files changed, 16 insertions(+), 26 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 79ba83f..de875fb 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -727,6 +727,7 @@ $template->param( > displayFacetCount=> C4::Context->preference('displayFacetCount')||0, > scan => $scan, > search_error => $error, >+ loggedinuser => $borrowernumber, > ); > > if ($query_desc || $limit_desc) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >index e6b6952..1c88804 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >@@ -11,26 +11,6 @@ $(document).ready(function(){ > [% END %] > }); > >-[% IF op == 'view' %] >- function sendList(){ >- open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); >- } >- >- $(document).ready(function() { >- $("#sendlist").click(function(){ >- sendList(); >- return false; >- }); >- $("#deleteshelf").click(function(e){ >- if(confirm(_("Are you sure you want to delete this list?"))){ >- return true; >- } else { >- e.preventDefault(); >- } >- }); >- }); >-[% END %] >- > //]]> > </script> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index 459bc08..58f7af4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -72,6 +72,7 @@ > [% END %] > > [% IF Koha.Preference('virtualshelves') %] >+ [% UNLESS add_to_some_private_shelves.count == 0 && add_to_some_public_shelves.count == 0 %] > <div class="btn-group"> > <button type="button" class="btn btn-default btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> > <i class="fa fa-list"></i> Add to list <span class="caret"></span> >@@ -109,12 +110,14 @@ > <a href="#" class="addtolist morelists">More lists</a> > </li> > [% END %] >- <li> >- <a href="#" class="addtolist newlist">New list</a> >- </li> >+ [% UNLESS loggedinuser == 0 %] >+ <li> >+ <a href="#" class="addtolist newlist">New list</a> >+ </li> >+ [% END %] > </ul> > </div> >- [% END %] >+ [% END %][% END %] > > > [% IF ( CAN_user_reserveforothers && DisplayMultiPlaceHold ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt >index 2c12401..dfeef92 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/addbybiblionumber.tt >@@ -72,10 +72,12 @@ > <input type="hidden" name="biblionumbers" value="[% biblionumbers %]" /> > [% END %] > </fieldset> >+[% UNLESS loggedinuser == 0 %]<p>... or...</p>[% END %] > >- <p>... or...</p> > [% END %] > >+[% UNLESS loggedinuser == 0 %] >+ > <fieldset class="rows"><legend>Add to a new list:</legend> > <ol><li> > <label for="newvirtualshelf"> >@@ -99,6 +101,7 @@ > </li></ol> > </fieldset> > >+[% END %] > > [% END %] > >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 1cc962c..ad69254 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -577,7 +577,9 @@ > [% IF add_to_some_private_shelves.count > 10 or add_to_some_public_shelves.count > 10 %] > param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>"; > [% END %] >- param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>" >+ [% UNLESS loggedinuser == 0 %] >+ param1 +="<option value=\"newlist\">"+_("[ New list ]")+"<\/option>" >+ [% END %] > [% END %] > param1 += "<\/select> <button id=\"cartsubmit\" type=\"submit\" class=\"btn btn-default btn-xs\">"+_("Save")+"</button>"; > $("span.addto").html(param1); >diff --git a/virtualshelves/addbybiblionumber.pl b/virtualshelves/addbybiblionumber.pl >index a60c88f..06b2682 100755 >--- a/virtualshelves/addbybiblionumber.pl >+++ b/virtualshelves/addbybiblionumber.pl >@@ -205,5 +205,6 @@ $template->param( > newshelf => $newshelf || 0, > authorized => $authorized, > errcode => $errcode, >+ loggedinuser => $loggedinuser, > ); > output_html_with_http_headers $query, $cookie, $template->output; >-- >2.1.4
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 17218
:
62348
|
66604
|
68155
|
68156
|
72298
|
72299
|
72495
|
72506
|
72507
|
72508