[Koha-patches] [PATCH] (BUG #4521) aqbudgets.pl - Transform undefined budget spent value to 0.00 value
This patch tranform the undefined value of budget spent to a money value which equals 0.00. --- admin/aqbudgets.pl |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/admin/aqbudgets.pl b/admin/aqbudgets.pl index 8c6d2b4..569124a 100755 --- a/admin/aqbudgets.pl +++ b/admin/aqbudgets.pl @@ -294,6 +294,9 @@ if ($op eq 'add_form') { $$budget{$_} = $num-format_price( $$budget{$_} ) if defined($$budget{$_}) } +# Value of budget_spent equals 0 instead of undefined value +$$budget{budget_spent} = $num-format_price(0) unless defined($$budget{budget_spent}); + my $borrower = GetMember( borrowernumber=$budget-{budget_owner_id} ); $budget-{budget_owner_name} = $borrower-{'firstname'} . ' ' . $borrower-{'surname'}; $budget-{budget_borrowernumber} = $borrower-{'borrowernumber'}; -- 1.6.3.3 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches
[Koha-patches] [PATCH] Display item type description when no image is available
On OPAC search result page, when item type is at biblio level, biblio item type is displayed in resultset table 2nd column. If an icon is linked to an itemtype, the icon is displayed. When no icon is available, item type description was displayed in 3.0 but not anymore in 3.2. This patch get it back. --- .../opac-tmpl/prog/en/modules/opac-results.tmpl|2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl index d5d87a2..acde03e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl @@ -376,6 +376,8 @@ $(document).ready(function(){ td class=itypecol !-- TMPL_IF name=imageurl -- img src=!-- TMPL_VAR name=imageurl -- title=!-- TMPL_VAR name=description -- alt=!-- TMPL_VAR name=description -- / +!-- TMPL_ELSE -- + !-- TMPL_VAR name=description -- !-- /TMPL_IF -- /td !-- /TMPL_UNLESS-- -- 1.7.1 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches
[Koha-patches] [PATCH] Bug 4510 Script processes single supplier not an array
Script was written as though it had an array rather than a single supplier. Replaced the excess punctuation with a single supplier variable replaced the C-style currency loop with a simpler perl-style one Changed variable name $GST to $tax it's not magical and not a constant and we all know what tax is Be explicit over which Contract routines are imported and called as C4::Contract redefines subroutines in the Acquisitions module causing compile time errors removed introduction of unneeded variable to test contract returns --- acqui/supplier.pl | 186 ++--- 1 files changed, 92 insertions(+), 94 deletions(-) diff --git a/acqui/supplier.pl b/acqui/supplier.pl index c3a5db4..bc475c6 100755 --- a/acqui/supplier.pl +++ b/acqui/supplier.pl @@ -1,10 +1,8 @@ #!/usr/bin/perl - -#script to show display basket of orders - # Copyright 2000-2002 Katipo Communications # Copyright 2008-2009 BibLibre SARL +# Copyright 2010 PTFS Europe Ltd # # This file is part of Koha. # @@ -43,11 +41,11 @@ To know the bookseller this script has to display details. use strict; use warnings; use C4::Auth; -use C4::Acquisition; -use C4::Contract; +use C4::Acquisition qw/GetContracts/; use C4::Biblio; use C4::Output; use C4::Dates qw/format_date /; +use C4::Contract qw/GetContract/; use CGI; use C4::Bookseller; @@ -55,33 +53,35 @@ use C4::Budgets; my $query = new CGI; my $id = $query-param('supplierid'); -my @booksellers = GetBookSellerFromId($id) if $id; -my $count = scalar @booksellers; +my $supplier= GetBookSellerFromId($id); +if (!$supplier) { +print $query-redirect('/cgi-bin/koha/acqui/acqui-home.pl'); +exit; +} my $op = $query-param('op') || display; my ($template, $loggedinuser, $cookie) = get_template_and_user( - { template_name = acqui/supplier.tmpl, - query = $query, - type= intranet, - authnotrequired = 0, - flagsrequired = { acquisition = 'vendors_manage' }, - debug = 1, - } +{ template_name = 'acqui/supplier.tmpl', +query = $query, +type= 'intranet', +authnotrequired = 0, +flagsrequired = { acquisition = 'vendors_manage' }, +debug = 1, +} ); -my $seller_gstrate = $booksellers[0]-{'gstrate'}; +my $seller_gstrate = $supplier-{'gstrate'}; # A perl-ism: '0'==false, '0.000'==true, but 0=='0.000' - this accounts for that undef $seller_gstrate if ($seller_gstrate == 0); -my $GST = $seller_gstrate || C4::Context-preference(gist); -$GST *= 100; +my $tax = $seller_gstrate || C4::Context-preference('gist'); +$tax *= 100; my @contracts = GetContracts($id); -my $contractcount = scalar(@contracts); -$template-param(hascontracts = 1) if ($contractcount 0); +$template-param(hascontracts = 1) if (@contracts); #build array for currencies -if ($op eq display) { +if ($op eq 'display') { # get contracts -my @contracts = @{GetContract( { booksellerid = $id } )}; +my @contracts = @{C4::Contract::GetContract( { booksellerid = $id } )}; # format dates for ( @contracts ) { @@ -89,92 +89,90 @@ if ($op eq display) { $$_{contractenddate} = format_date($$_{contractenddate}); } - $template-param( - id= $id, - name = $booksellers[0]-{'name'}, - postal= $booksellers[0]-{'postal'}, - address1 = $booksellers[0]-{'address1'}, - address2 = $booksellers[0]-{'address2'}, - address3 = $booksellers[0]-{'address3'}, - address4 = $booksellers[0]-{'address4'}, - phone = $booksellers[0]-{'phone'}, - fax = $booksellers[0]-{'fax'}, - url = $booksellers[0]-{'url'}, - contact = $booksellers[0]-{'contact'}, - contpos = $booksellers[0]-{'contpos'}, - contphone = $booksellers[0]-{'contphone'}, - contaltphone = $booksellers[0]-{'contaltphone'}, - contfax = $booksellers[0]-{'contfax'}, - contemail = $booksellers[0]-{'contemail'}, - contnotes = $booksellers[0]-{'contnotes'}, - notes = $booksellers[0]-{'notes'}, - active= $booksellers[0]-{'active'}, - gstreg= $booksellers[0]-{'gstreg'}, - listincgst= $booksellers[0]-{'listincgst'}, - invoiceincgst = $booksellers[0]-{'invoiceincgst'}, - gstrate = $booksellers[0]-{'gstrate'}*100, - discount = $booksellers[0]-{'discount'}, - invoiceprice = $booksellers[0]-{'invoiceprice'}, - listprice = $booksellers[0]-{'listprice'}, - GST =
[Koha-patches] [PATCH] (bug #4523) possibility to show / hide the filters menu
--- .../prog/en/modules/admin/aqbudgets.tmpl | 24 +++ 1 files changed, 19 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl index fdb7410..0017e5e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl @@ -130,6 +130,17 @@ $(#budgeth).treeTable(); !-- /TMPL_IF -- }); +function showHideFilters() { +var menuFilters = document.getElementById(fundfilters); +var content = document.getElementById(content); +if (menuFilters.style.display == none) { +menuFilters.style.display = block; +content.style.marginLeft = 15em; +} else { +menuFilters.style.display = none; +content.style.marginLeft = 4em; +} +} //]] /script !-- /TMPL_IF -- @@ -147,7 +158,7 @@ div id=doc3 class=yui-t2 div id=bd div id=yui-main -div class=yui-b +div class=yui-b id=content !-- TMPL_UNLESS name=delete_confirm --!-- TMPL_INCLUDE NAME=budgets-admin-toolbar.inc --!-- /TMPL_UNLESS -- !-- TMPL_IF name=else -- @@ -385,8 +396,12 @@ /div /div div class=yui-b -!-- TMPL_IF NAME=else --form action=/cgi-bin/koha/admin/aqbudgets.pl method=get -fieldset class=brief +!-- TMPL_IF NAME=else -- + + +form action=/cgi-bin/koha/admin/aqbudgets.pl method=get +a href=# onclick=showHideFilters()Filters/a +fieldset class=brief id=fundfilters h4Fund filters/h4 ol li @@ -413,8 +428,7 @@ input type=hidden name=budget_period_id value=!-- TMPL_VAR NAME=budget_period_id -- / input type=submit class=submit name=filter value=Go / /fieldset -/form!-- /TMPL_IF -- - +/form!-- /TMPL_IF -- /div /div !-- TMPL_INCLUDE NAME=intranet-bottom.inc -- -- 1.6.3.3 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches
[Koha-patches] [PATCH] Remove obsolete variables from basket.pl
basket.pl calculates variables i, odd and count which are no longer used in the template removing them allows some simplification of the main loop and cuts out on an extra db call Loop through basketgroups also made more readable Try to dimish the number of undef warnings filling the logs --- acqui/basket.pl | 46 ++ 1 files changed, 22 insertions(+), 24 deletions(-) diff --git a/acqui/basket.pl b/acqui/basket.pl index 7c2456a..afdc460 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -114,7 +114,6 @@ if ( $op eq 'delete_confirm' ) { $basket-{creationdate} = unless ( $basket-{creationdate} ); $basket-{authorisedby} = $loggedinuser unless ( $basket-{authorisedby} ); my $contract = GetContract($basket-{contractnumber}); -my $count = scalar GetOrders( $basketno); $template-param( basketno = $basketno, basketname = $basket-{'basketname'}, @@ -133,7 +132,6 @@ if ( $op eq 'delete_confirm' ) { address2 = $bookseller-{'address2'}, address3 = $bookseller-{'address3'}, address4 = $bookseller-{'address4'}, -count = $count, ); } elsif ($op eq 'attachbasket' $template-{'param_map'}-{'CAN_user_acquisition_group_manage'} == 1) { print $query-redirect('/cgi-bin/koha/acqui/basketgroup.pl?basketno=' . $basket-{'basketno'} . 'op=attachbasketbooksellerid=' . $booksellerid); @@ -172,7 +170,7 @@ if ( $op eq 'delete_confirm' ) { basketgroupname = $basket-{'basketname'}); } -} elsif ($query-param('op') eq 'reopen') { +} elsif ($op eq 'reopen') { my $basket; $basket-{basketno} = $query-param('basketno'); $basket-{closedate} = undef; @@ -198,9 +196,9 @@ if ( $op eq 'delete_confirm' ) { my $member = GetMember(borrowernumber = $loggedinuser); if ($basket-{closedate} haspermission({ flagsrequired = { acquisition = 'group_manage'} })) { $basketgroups = GetBasketgroups($basket-{booksellerid}); -for (my $i=0; $i scalar(@$basketgroups); $i++) { -if ($basket-{basketgroupid} == @$basketgroups[$i]-{id}){ -@$basketgroups[$i]-{default} = 1; +for my $bg ( @{$basketgroups} ) { +if ($basket-{basketgroupid} == $bg-{id}){ +$bg-{default} = 1; } } my %emptygroup = ( id = undef, @@ -219,7 +217,6 @@ if ( $op eq 'delete_confirm' ) { $basket-{creationdate}, $basket-{authorisedby}; my @results = GetOrders( $basketno ); -my $count = scalar @results; my $gist = $bookseller-{gstrate} || C4::Context-preference(gist) || 0; my $discount = $bookseller-{'discount'} / 100; @@ -231,38 +228,40 @@ if ( $op eq 'delete_confirm' ) { my $qty_total; my @books_loop; -for ( my $i = 0 ; $i $count ; $i++ ) { -my $rrp = $results[$i]-{'listprice'}; - my $qty = $results[$i]-{'quantity'} || 0; -if (!defined $results[$i]-{quantityreceived}) { -$results[$i]-{quantityreceived} = 0; +for my $order ( @results ) { +my $rrp = $order-{'listprice'} || 0; + my $qty = $order-{'quantity'} || 0; +if (!defined $order-{quantityreceived}) { +$order-{quantityreceived} = 0; +} +for ( qw(rrp ecost quantityreceived)) { +if (!defined $order-{$_}) { +$order-{$_} = 0; +} } -my $budget = GetBudget( $results[$i]-{'budget_id'} ); -$rrp = ConvertCurrency( $results[$i]-{'currency'}, $rrp ); +my $budget = GetBudget( $order-{'budget_id'} ); +$rrp = ConvertCurrency( $order-{'currency'}, $rrp ); -$total_rrp += $qty * $results[$i]-{'rrp'}; -my $line_total = $qty * $results[$i]-{'ecost'}; +$total_rrp += $qty * $order-{'rrp'}; +my $line_total = $qty * $order-{'ecost'}; # FIXME: what about the actual cost field? $qty_total += $qty; -my %line = %{ $results[$i] }; - ($i%2) and $line{toggle} = 1; +my %line = %{ $order }; -$line{order_received} = ( $qty == $results[$i]-{'quantityreceived'} ); +$line{order_received} = ( $qty == $order-{'quantityreceived'} ); $line{basketno} = $basketno; -$line{i} = $i; $line{budget_name}= $budget-{budget_name}; $line{rrp}= sprintf( %.2f, $line{'rrp'} ); $line{ecost} = sprintf( %.2f, $line{'ecost'} ); $line{line_total} = sprintf( %.2f, $line_total ); -$line{odd}= $i % 2; if ($line{uncertainprice}) { $template-param( uncertainprices = 1 ); $line{rrp} .= ' (Uncertain)'; } if ($line{'title'}){ - my $volume = $results[$i]-{'volume'}; - my $seriestitle =
[Koha-patches] [PATCH] Alternate fix for Bug 2981, removing onclick redirect
--- circ/circulation.pl |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 4b67920..ac00ab0 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -524,7 +524,6 @@ if ($borrowerslist) { -id = 'borrowernumber', -values = \...@values, -labels = \%labels, - -onclick = window.location = '/cgi-bin/koha/circ/circulation.pl?borrowernumber=' + this.value;, -size = 7, -tabindex = '', -multiple = 0 -- 1.7.0.4 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches
[Koha-patches] [PATCH] On OPAC detail page, display itemtype image and description
When item type is at biblio level, item type image or description is displayed on search result page. It used to be also displayed on detail page but it isn't the case anymore in 3.2. This patch restore displaying item type image/description when XSLT is enabled/disabled. --- .../opac-tmpl/prog/en/modules/opac-detail.tmpl | 16 ++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index b1fdf84..2458948 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -91,6 +91,16 @@ YAHOO.util.Event.onContentReady(furtherm, function () { !-- TMPL_IF NAME=OPACXSLTDetailsDisplay -- !-- TMPL_VAR NAME=XSLTBloc -- +!-- TMPL_UNLESS NAME=item-level_itypes --span class=results_summaryspan class=labelItem type : /span +!-- TMPL_IF name=description -- +!-- TMPL_VAR NAME=description -- +!-- TMPL_ELSE -- +!-- TMPL_VAR NAME=itemtype -- +!-- /TMPL_IF -- +!-- TMPL_IF name=imageurl -- + img src=!-- TMPL_VAR NAME=imageurl -- alt=!-- TMPL_VAR NAME=description -- title=!-- TMPL_VAR NAME=description -- / +!-- /TMPL_IF -- +/span!-- /TMPL_UNLESS -- !-- TMPL_ELSE -- h1!-- TMPL_VAR NAME=title escape=html --!-- TMPL_IF NAME=subtitle -- span class=subtitle!-- TMPL_LOOP NAME=subtitle --!-- TMPL_VAR NAME=subfield -- !-- /TMPL_LOOP --/span!-- /TMPL_IF --/h1 !-- TMPL_IF NAME=author --h5 class=authorby a href=/cgi-bin/koha/opac-search.pl?q=au:!-- TMPL_VAR NAME=author ESCAPE=URL --!-- TMPL_VAR NAME=author ESCAPE=HTML --/a/h5!-- /TMPL_IF -- @@ -177,13 +187,15 @@ YAHOO.util.Event.onContentReady(furtherm, function () { !-- TMPL_IF name=copyrightdate -- span class=results_summaryspan class=labelYear : /span!-- TMPL_VAR NAME=copyrightdate --/span !-- /TMPL_IF -- -!-- TMPL_UNLESS NAME=item-level_itypes --img src=!-- TMPL_VAR NAME=imageurl -- alt=!-- TMPL_VAR NAME=description -- title=!-- TMPL_VAR NAME=description -- / -span class=results_summaryspan class=labelItem type : /span +!-- TMPL_UNLESS NAME=item-level_itypes --span class=results_summaryspan class=labelItem type : /span !-- TMPL_IF name=description -- !-- TMPL_VAR NAME=description -- !-- TMPL_ELSE -- !-- TMPL_VAR NAME=itemtype -- !-- /TMPL_IF -- +!-- TMPL_IF name=imageurl -- + img src=!-- TMPL_VAR NAME=imageurl -- alt=!-- TMPL_VAR NAME=description -- title=!-- TMPL_VAR NAME=description -- / +!-- /TMPL_IF -- /span!-- /TMPL_UNLESS -- !-- TMPL_IF name=MARCURLS -- -- 1.7.1 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches
[Koha-patches] [PATCH] Bug 4525: Invalid XHTML in currency.tmpl.
--- .../prog/en/modules/admin/currency.tmpl|2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl index 97f6399..e19e5e2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl @@ -202,7 +202,7 @@ /tr !-- /TMPL_LOOP -- /table -br +br / !-- TMPL_IF NAME=offsetgtzero -- a href=!-- TMPL_VAR NAME=script_name --?offset=!-- TMPL_VAR NAME=prevpage --lt;lt; Previous/a -- 1.5.6.5 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches
[Koha-patches] [PATCH 2/2] Fixes bug 4481: Limit to Available filters out many available items.
From: Ian Walls ian.wa...@med.nyu.edu --- C4/Search.pm | 25 - 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 229ee40..e7c9c76 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1256,21 +1256,20 @@ sub buildQuery { my $group_OR_limits; my $availability_limit; foreach my $this_limit (@limits) { -#if ( $this_limit =~ /available/ ) { -# -## 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) -## In English: -## all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 -#$availability_limit .= -#( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) ); #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) ); -#$limit_cgi .= limit=available; -#$limit_desc .= ; -#} -# +if ( $this_limit =~ /available/ ) { + +# 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0) +# In English: +# all records not indexed in the onloan register (zebra) and all records with a value of lost equal to 0 +$availability_limit .= +( ( allrecords,AlwaysMatches='' not onloan,AlwaysMatches='') and (lost,st-numeric=0) ); #or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='')) ); +$limit_cgi .= limit=available; +$limit_desc .= ; +} + # group_OR_limits, prefixed by mc- # OR every member of the group -#elsif ( $this_limit =~ /mc/ ) { -if ( $this_limit =~ /mc/ ) { +elsif ( $this_limit =~ /mc/ ) { $group_OR_limits .= or if $group_OR_limits; $limit_desc .= or if $group_OR_limits; $group_OR_limits .= $this_limit; -- 1.6.4 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches
[Koha-patches] [PATCH] Support newlines in the notes field when displaying
--- catalogue/detail.pl |3 +++ opac/opac-detail.pl |4 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 85819c0..c3c3c74 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -93,6 +93,9 @@ my $marcseriesarray = GetMarcSeries($record,$marcflavour); my $marcurlsarray= GetMarcUrls($record,$marcflavour); my $subtitle = GetRecordValue('subtitle', $record, $fw); +# Turn newlines into HTML-y newlines +$_-{marcnote} =~ s{\n}{br /}g foreach (@$marcnotesarray); + # Get Branches, Itemtypes and Locations my $branches = GetBranches(); my $itemtypes = GetItemTypes(); diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 629ebd2..7a0f2e2 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -205,6 +205,10 @@ my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray= GetMarcUrls($record,$marcflavour); my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber)); +# Support newlines in the notes content +$_-{marcnote} =~ s{\n}{br /}g foreach (@$marcnotesarray); + + $template-param( MARCNOTES = $marcnotesarray, MARCSUBJCTS = $marcsubjctsarray, -- 1.7.0.4 ___ Koha-patches mailing list Koha-patches@lists.koha.org http://lists.koha.org/mailman/listinfo/koha-patches