Bugzilla – Attachment 10197 Details for
Bug 8230
Show the ordered status in catalogue page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0002-Bug-7294-Additional-patch-to-show-the-ordered-status.patch (text/plain), 11.30 KB, created by
Matthias Meusburger
on 2012-06-11 12:52:29 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Matthias Meusburger
Created:
2012-06-11 12:52:29 UTC
Size:
11.30 KB
patch
obsolete
>From e230e2b42b83485675878769d48236d2a39a5fd4 Mon Sep 17 00:00:00 2001 >From: Amit Gupta <amit.gupta@osslabs.biz> >Date: Mon, 30 Apr 2012 15:11:04 +0530 >Subject: [PATCH 2/2] Bug 7294:Additional patch to show the ordered status in catalogue page > >Show status as "Title has been ordered" in catalogue page of OPAC and staff interface when the order >is palced to the title.Specific fields from aqorders,aqbasket is been mapped to marc fields (using >ACQ bibliographic framework): >aqorders.basketno >aqbasket.booksellerid > >To test:map these two columns in the marc field where you have mapped the other aqorders columns. >Create an order,search for the title which you have placed the order you can see the "Title has >been ordered" in the catelog detail page.From the staff side you can use the link to go to the >corresponding order, the link will be visible only if the user has the acquisition permission. >--- > acqui/addorder.pl | 8 ++++++-- > admin/marc_subfields_structure.pl | 5 +++++ > catalogue/detail.pl | 16 ++++++++++++++++ > catalogue/search.pl | 10 ++++++++++ > .../prog/en/modules/catalogue/detail.tt | 8 ++++++++ > .../prog/en/modules/catalogue/results.tt | 3 +++ > koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 4 ++++ > .../opac-tmpl/prog/en/modules/opac-results.tt | 4 ++++ > opac/opac-detail.pl | 10 ++++++++++ > opac/opac-search.pl | 9 +++++++++ > 10 files changed, 75 insertions(+), 2 deletions(-) > >diff --git a/acqui/addorder.pl b/acqui/addorder.pl >index 8882621..88ab08b 100755 >--- a/acqui/addorder.pl >+++ b/acqui/addorder.pl >@@ -230,7 +230,9 @@ if ( $orderinfo->{quantity} ne '0' ) { > "aqorders.notes" => $$orderinfo{notes} ? $$orderinfo{notes} : "", > "aqorders.supplierreference" => $$orderinfo{supplierreference}?$$orderinfo{supplierreference}:"", > "aqorders.sort1" => $$orderinfo{sort1} ? $$orderinfo{sort1} : "", >- "aqorders.sort2" => $$orderinfo{sort2} ? $$orderinfo{sort2} : "" >+ "aqorders.sort2" => $$orderinfo{sort2} ? $$orderinfo{sort2} : "", >+ "aqorders.basketno" => $$orderinfo{basketno} ? $$orderinfo{basketno} : "", >+ "aqbasket.booksellerid" => $$orderinfo{booksellerid} ? $$orderinfo{booksellerid} : "" > } > ); > >@@ -288,10 +290,12 @@ if ( $orderinfo->{quantity} ne '0' ) { > > # Replacing or creating subfields > my ($t, $st); >- for my $tablefield (qw/branchcode quantity listprice uncertainprice rrp ecost notes supplierreference sort1 sort2/) { >+ for my $tablefield (qw/branchcode quantity listprice uncertainprice rrp ecost notes supplierreference sort1 sort2 basketno/) { > ($t, $st) = GetMarcFromKohaField("aqorders.$tablefield", 'ACQ'); > $_->update($st, $$orderinfo{$tablefield}) if ($$orderinfo{$tablefield} and $st); > } >+ ($t, $st) = GetMarcFromKohaField("aqbasket.booksellerid", 'ACQ'); >+ $_->update($st, $$orderinfo{booksellerid}) if ($$orderinfo{booksellerid} and $st); > ModBiblio($record, $$orderinfo{biblionumber}, 'ACQ'); > } > } >diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl >index 7751e4a..965fd11 100755 >--- a/admin/marc_subfields_structure.pl >+++ b/admin/marc_subfields_structure.pl >@@ -128,6 +128,11 @@ if ( $op eq 'add_form' ) { > while ( ( my $field ) = $sth2->fetchrow_array ) { > push @kohafields, "aqorders." . $field; > } >+ $sth2 = $dbh->prepare("SHOW COLUMNS from aqbasket"); >+ $sth2->execute; >+ while ( ( my $field ) = $sth2->fetchrow_array ) { >+ push @kohafields, "aqbasket." . $field; >+ } > > > # build authorised value list >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index de355fa..74bff4b 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -60,6 +60,22 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > my $biblionumber = $query->param('biblionumber'); > my $record = GetMarcBiblio($biblionumber); > >+my ($ordernofield ,$ordernosubfield) = GetMarcFromKohaField("aqorders.ordernumber",'ACQ'); >+my ($basketnofield ,$basketnosubfield) = GetMarcFromKohaField("aqorders.basketno",'ACQ'); >+my ($bookselleridfield ,$bookselleridsubfield) = GetMarcFromKohaField("aqbasket.booksellerid",'ACQ'); >+my $marcfield = GetMarcBiblio($biblionumber); >+if(my $fieldtag = $marcfield->field($ordernofield)) >+{ >+if(my $s = $fieldtag->as_string($ordernosubfield)) >+{ >+$template->param( field_flag => 1); >+$template->param( orderno => $fieldtag->as_string($ordernosubfield) , >+ basketno => $fieldtag->as_string($basketnosubfield) , >+ booksellerid => $fieldtag->as_string($bookselleridsubfield) ); >+} >+}else{ >+$template->param( field_flag => 0); >+} > if ( not defined $record ) { > # biblionumber invalid -> report and exit > $template->param( unknownbiblionumber => 1, >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 0052f66..65f2375 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -150,6 +150,7 @@ use C4::Members qw(GetMember); > use C4::VirtualShelves; > use POSIX qw(ceil floor); > use C4::Branch; # GetBranches >+use C4::Biblio; > > my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); > # create a new CGI object >@@ -594,6 +595,15 @@ for (my $i=0;$i<@servers;$i++) { > # in order to avoid problems generated by the default size value in TT > foreach my $line (@newresults) { > if ( not exists $line->{'size'} ) { $line->{'size'} = "" } >+ my $record = GetMarcBiblio($line->{'biblionumber'}); >+ my ($ordernofield ,$ordernosubfield) = GetMarcFromKohaField("aqorders.ordernumber",'ACQ'); >+ if(my $fieldtag = $record->field($ordernofield)) >+ { >+ if(my $s = $fieldtag->as_string($ordernosubfield)) >+ { >+ $line->{'field_flag'} = 1; >+ } >+ } > } > $template->param(SEARCH_RESULTS => \@newresults); > ## FIXME: add a global function for this, it's better than the current global one >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index c92a891..e98b996 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -441,8 +441,16 @@ function verify_images() { > <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding %]</div> > [% END %] > [% ELSE %] >+ [% IF ( field_flag ) %] >+ [% IF ( CAN_user_acquisition ) %] >+ <div id="noitems">Title has been <a href="/cgi-bin/koha/acqui/neworderempty.pl?ordernumber=[% orderno %]&booksellerid=[% booksellerid %]&basketno=[% basketno %]">ordered</a></div> >+ [% ELSE %] >+ <div id="noitems">Title has been ordered</div> >+ [% END %] >+ [% ELSE %] > <div id="noitems">No physical items for this record</div> > [% END %] >+ [% END %] > [% END %] > </div> > >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 5af106a..fb3e86d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -623,6 +623,9 @@ YAHOO.util.Event.onContentReady("searchheader", function () { > </li> > [% ELSE %] > <span class="unavailable">No items</span> >+ [% IF ( SEARCH_RESULT.field_flag ) %] >+ <span class="noitems">Title has been ordered</span> >+ [% END %] > [% END %] > [% END %] <!-- /items count --> > </div></td> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >index cc59fb2..5f02008 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt >@@ -752,8 +752,12 @@ YAHOO.util.Event.onContentReady("furtherm", function () { > <div id="alternateholdings"><span class="holdings_label">Holdings:</span> [% ALTERNATEHOLDING.holding %]</div> > [% END %] > [% ELSE %] >+ [% IF ( field_flag ) %] >+ <div id="noitems">Title has been ordered</div> >+ [% ELSE %] > <div id="noitems">No physical items for this record</div> > [% END %] >+ [% END %] > [% END %] > > [% IF ( OpenOPACShelfBrowser ) %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >index 2c12d44..ec8cc9a 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt >@@ -482,6 +482,10 @@ $(document).ready(function(){ > [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount %]),[% END %] > [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount %]),[% END %] > [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount %]),[% END %] >+ [% IF ( SEARCH_RESULT.field_flag ) %] >+ <span class="unavailable"> Title has been ordered </span> >+ [% END %] >+ </span> > </span> > </span> > [% END %] >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index afc9498..fafe579 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -71,6 +71,16 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > my $biblionumber = $query->param('biblionumber') || $query->param('bib'); > > my $record = GetMarcBiblio($biblionumber); >+my ($ordernofield ,$ordernosubfield) = GetMarcFromKohaField("aqorders.ordernumber",'ACQ'); >+if(my $fieldtag = $record->field($ordernofield)) >+{ >+if(my $s = $fieldtag->as_string($ordernosubfield)) >+{ >+$template->param( field_flag => 1); >+} >+}else{ >+$template->param( field_flag => 0); >+} > if ( ! $record ) { > print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early > exit; >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 176bc12..fbef33f 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -524,6 +524,15 @@ for (my $i=0;$i<@servers;$i++) { > if ( grep {$_ eq $line->{'biblionumber'}} @cart_list) { > $line->{'incart'} = 1; > } >+ my $record = GetMarcBiblio($line->{'biblionumber'}); >+ my ($ordernofield ,$ordernosubfield) = GetMarcFromKohaField("aqorders.ordernumber",'ACQ'); >+ if(my $fieldtag = $record->field($ordernofield)) >+ { >+ if(my $s = $fieldtag->as_string($ordernosubfield)) >+ { >+ $line->{'field_flag'} = 1; >+ } >+ } > } > > >-- >1.6.4.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 8230
:
10197
|
17651
|
21199
|
22047
|
22326
|
22524
|
22544
|
22545
|
23545
|
23546