Bugzilla – Attachment 41938 Details for
Bug 9468
Add ability to hide itemtypes from purchase suggestions forms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9468: use new SUGGEST_FORMAT list
Bug-9468-use-new-SUGGESTFORMAT-list.patch (text/plain), 12.49 KB, created by
Jonathan Druart
on 2015-08-25 16:32:41 UTC
(
hide
)
Description:
Bug 9468: use new SUGGEST_FORMAT list
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-08-25 16:32:41 UTC
Size:
12.49 KB
patch
obsolete
>From db2b2a7281acf5a15416abdb961ff80f6e4126a3 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Mon, 5 May 2014 00:23:19 +0000 >Subject: [PATCH] Bug 9468: use new SUGGEST_FORMAT list > >This patch uses the new SUGGEST_FORMAT authorized value list for >populating the list of suggestion item types/document types. It >also improves the display by using the staff or OPAC description of >the authorised value rather than the code. > >To test: > >[1] Enter a suggestion via the OPAC and select an item type (which > I will call "desired format" for the rest of this test plan). >[2] Verify that the saved suggestion displays the desired format > description in both staff and OPAC. >[3] Verify that organizing the list of suggestions by item type > now works in the staff interface, rather than displaying "Unknown" > in each tab header. >[4] Verify that existing suggestions' desired formats are displayed > correctly. >[5] Verify that suggestions can have their desired format edited > in the staff inteface. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../prog/en/modules/suggestion/suggestion.tt | 13 +++--------- > .../bootstrap/en/modules/opac-suggestions.tt | 15 ++------------ > opac/opac-suggestions.pl | 10 ---------- > suggestion/suggestion.pl | 23 ++++------------------ > 4 files changed, 9 insertions(+), 52 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index b3fedc4..e01daa7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -213,9 +213,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <li><span class="label">Publication place:</span>[% place |html %]</li> > <li><span class="label">Collection title:</span>[% collectiontitle |html %]</li> > <li><span class="label">Document type:</span> >- [% FOREACH itemtypeloo IN itemtypeloop %] >- [% IF ( itemtypeloo.selected ) %][% itemtypeloo.description %][% END %] >- [% END %] >+ [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', itemtype, 0 ) %] > </li> > [% IF ( patron_reason_loop ) %] > <li><span class="label">Reason for suggestion: </span> >@@ -336,12 +334,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <li><label for="place">Publication place:</label><input type="text" id="place" name="place" size="50" maxlength="80" value="[% place | html %]"/></li> > <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" size="50" maxlength="80" value="[% collectiontitle | html %]"/></li> > <li><label for="itemtype">Document type:</label> >- <select id="itemtype" name="itemtype" > >- [% FOREACH itemtypeloo IN itemtypeloop %] >- [% IF ( itemtypeloo.selected ) %]<option selected="selected" value="[% itemtypeloo.itemtype %]">[% ELSE %]<option value="[% itemtypeloo.itemtype %]">[% END %] >- [% itemtypeloo.description %]</option> >- [% END %] >- </select> >+ [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20, default=itemtype %] > </li> > [% IF ( patron_reason_loop ) %]<li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value=""> -- Choose -- </option>[% FOREACH patron_reason_loo IN patron_reason_loop %] > [% IF ( patron_reason_loo.selected ) %]<option value="[% patron_reason_loo.authorised_value %]" selected="selected">[% patron_reason_loo.lib %]</option>[% ELSE %]<option value="[% patron_reason_loo.authorised_value %]">[% patron_reason_loo.lib %]</option>[% END %] >@@ -526,7 +519,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > <br /> > [% IF ( suggestions_loo.copyrightdate ) %]© [% suggestions_loo.copyrightdate |html %] [% END %] > [% IF ( suggestions_loo.volumedesc ) %]; Volume:<i>[% suggestions_loo.volumedesc |html %]</i> [% END %] >- [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn |html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode |html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear |html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place |html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle |html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% suggestions_loo.itemtype |html %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<span class="note">[% suggestions_loo.note |html%]</span>[% END %] >+ [% IF ( suggestions_loo.isbn ) %]; ISBN:<i>[% suggestions_loo.isbn |html %]</i> [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode |html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear |html %]</i> [% END %][% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place |html %]</i> [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle |html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) %] [% END %]<br />[% IF ( suggestions_loo.note ) %]<span class="note">[% suggestions_loo.note |html%]</span>[% END %] > </td> > <td> > [% IF ( suggestions_loo.emailsuggestedby ) %]<a href="mailto:[% suggestions_loo.emailsuggestedby %]">[% END %][% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby %][% END %] [% IF (suggestions_loo.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby %])[% END %] [% IF ( suggestions_loo.emailsuggestedby ) %]</a>[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >index 09032e4..4d792f6 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-suggestions.tt >@@ -43,18 +43,7 @@ > <li><label for="collectiontitle">Collection title:</label><input type="text" id="collectiontitle" name="collectiontitle" class="span6" maxlength="80" /></li> > <li><label for="place">Publication place:</label><input type="text" id="place" name="place" maxlength="80" /></li> > <li><label for="itemtype">Item type:</label> >- <select name="itemtype" id="itemtype"> >- <option value="">Default</option> >- [% FOREACH itemtypeloo IN itemtypeloop %] >- [% IF ( itemtypeloo.selected ) %] >- <option value="[% itemtypeloo.itemtype %]" selected="selected"> >- [% ELSE %] >- <option value="[% itemtypeloo.itemtype %]"> >- [% END %] >- [% itemtypeloo.description %] >- </option> >- [% END %] >- </select> >+ [% PROCESS 'av-build-dropbox.inc' name="itemtype", category="SUGGEST_FORMAT", size = 20 %] > </li> > [% IF ( branchloop ) %] > <li><label for="branch">Library:</label> >@@ -195,7 +184,7 @@ > [% IF ( suggestions_loo.publishercode ) %] - [% suggestions_loo.publishercode |html %][% END %] > [% IF ( suggestions_loo.place ) %]([% suggestions_loo.place |html %])[% END %] > [% IF ( suggestions_loo.collectiontitle ) %] , [% suggestions_loo.collectiontitle |html %][% END %] >- [% IF ( suggestions_loo.itemtype ) %] - [% suggestions_loo.itemtype %][% END %] >+ [% IF ( suggestions_loo.itemtype ) %] - [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 1 ) %][% END %] > </p> > </td> > <td> >diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl >index 6b7f8d4..4fbd286 100755 >--- a/opac/opac-suggestions.pl >+++ b/opac/opac-suggestions.pl >@@ -148,15 +148,6 @@ if ( $op eq "delete_confirm" ) { > exit; > } > map{ $_->{'branchcodesuggestedby'}=GetBranchInfo($_->{'branchcodesuggestedby'})->[0]->{'branchname'}} @$suggestions_loop; >-my $supportlist=GetSupportList(); >-foreach my $support(@$supportlist){ >- if ($$support{'imageurl'}){ >- $$support{'imageurl'}= getitemtypeimagelocation( 'opac', $$support{'imageurl'} ); >- } >- else { >- delete $$support{'imageurl'} >- } >-} > > foreach my $suggestion(@$suggestions_loop) { > if($suggestion->{'suggestedby'} == $borrowernumber) { >@@ -189,7 +180,6 @@ if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) { > > $template->param( > %$suggestion, >- itemtypeloop=> $supportlist, > suggestions_loop => $suggestions_loop, > patron_reason_loop => $patron_reason_loop, > "op_$op" => 1, >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 43834f6..e772a2a 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -54,14 +54,13 @@ sub Init{ > sub GetCriteriumDesc{ > my ($criteriumvalue,$displayby)=@_; > if ($displayby =~ /status/i) { >- if ( grep { /^($criteriumvalue)$/ } qw(ASKED ACCEPTED REJECTED CHECKED ORDERED AVAILABLE) ) { >- return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))); >- } else { >- return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue) || $criteriumvalue; >+ unless ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED ORDERED AVAILABLE) ) { >+ return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || "Unknown"; > } >+ return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i); > } > return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/); >- return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/); >+ return GetAuthorisedValueByCode('SUGGEST_FORMAT', $criteriumvalue) || "Unknown" if ($displayby =~/itemtype/); > if ($displayby =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){ > my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue); > return "" unless $borr; >@@ -324,20 +323,6 @@ $branchfilter=C4::Context->userenv->{'branch'} if ($onlymine && !$branchfilter); > $template->param( branchloop => \@branchloop, > branchfilter => $branchfilter); > >-# the index parameter is different for item-level itemtypes >-my $supportlist = GetSupportList(); >- >-foreach my $support (@$supportlist) { >- $$support{'selected'} = (defined $$suggestion_ref{'itemtype'}) >- ? $$support{'itemtype'} eq $$suggestion_ref{'itemtype'} >- : 0; >- if ( $$support{'imageurl'} ) { >- $$support{'imageurl'} = getitemtypeimagelocation( 'intranet', $$support{'imageurl'} ); >- } else { >- delete $$support{'imageurl'}; >- } >-} >-$template->param(itemtypeloop=>$supportlist); > $template->param( returnsuggestedby => $returnsuggestedby ); > > my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'}); >-- >2.1.0
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 9468
:
14801
|
16647
|
16674
|
19086
|
21759
|
21760
|
22714
|
22715
|
27932
|
27933
|
27934
|
27935
|
37100
|
37101
|
37102
|
37103
|
38097
|
38163
|
38164
|
38165
|
38166
|
38167
|
38168
|
41822
|
41823
|
41824
|
41825
|
41826
|
41827
|
41828
|
41936
|
41937
|
41938
|
41939
|
41940
|
41941
|
41942
|
41943
|
44504
|
44505
|
44506
|
44507
|
44508
|
44509
|
44510