From dpavlin at rot13.org Sun Apr 1 00:29:59 2012 From: dpavlin at rot13.org (Dobrica Pavlinusic) Date: Sun, 1 Apr 2012 00:29:59 +0200 Subject: [Koha-patches] [PATCH] Bug 7863 - opac-addbybiblionumber.pl plack scoping Message-ID: <1333232999-17579-1-git-send-email-dpavlin@rot13.org> Test scenario: 1. issue search query 2. select 1 result 3. add to: new list, list-1, private 4. select 2 results 5. add to (exiting) list-1 4. select 3 results 6. add to: new list, list-2, public 7. using lists drop-down, view and delete list-1 and list-2 --- opac/opac-addbybiblionumber.pl | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index bea130d..b1a460e 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -31,18 +31,18 @@ use C4::VirtualShelves qw/:DEFAULT GetAllShelves/; use C4::Output; use C4::Auth; -my $query = new CGI; -my @biblionumber = $query->param('biblionumber'); -my $selectedshelf = $query->param('selectedshelf'); -my $newshelf = $query->param('newshelf'); -my $shelfnumber = $query->param('shelfnumber'); -my $newvirtualshelf = $query->param('newvirtualshelf'); -my $category = $query->param('category'); -my $authorized = 1; -my $errcode = 0; -my @biblios; +our $query = new CGI; +our @biblionumber = $query->param('biblionumber'); +our $selectedshelf = $query->param('selectedshelf'); +our $newshelf = $query->param('newshelf'); +our $shelfnumber = $query->param('shelfnumber'); +our $newvirtualshelf = $query->param('newvirtualshelf'); +our $category = $query->param('category'); +our $authorized = 1; +our $errcode = 0; +our @biblios; -my ( $template, $loggedinuser, $cookie ) = get_template_and_user( +our ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "opac-addbybiblionumber.tmpl", query => $query, -- 1.7.2.5 From tajoli at cilea.it Sun Apr 1 11:28:57 2012 From: tajoli at cilea.it (Zeno Tajoli) Date: Sun, 01 Apr 2012 11:28:57 +0200 Subject: [Koha-patches] [BUG 7861] Update of Italian sql files for 3.8 Message-ID: <4F781FD9.4020302@cilea.it> This only on update of Italian SQL files. A lien around my changes is longer of 998 chars -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Update-of-italian-sql-files-for-3.8.patch Type: text/x-patch Size: 59744 bytes Desc: not available URL: From srdjan at catalyst.net.nz Mon Apr 2 03:00:26 2012 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 2 Apr 2012 13:00:26 +1200 Subject: [Koha-patches] [PATCH] bug_7420: Added overduefinescap to issuingrules In-Reply-To: References: Message-ID: <1333328426-29205-1-git-send-email-srdjan@catalyst.net.nz> Replaced existing MaxFine syspref logic with overduefinescap. Repurposed MaxFine to be the overall overdue limit for all items overdue. Implemented new MaxFine logic in UpdateFine(). --- C4/Overdues.pm | 48 +++++++++++++++----- C4/Search.pm | 2 +- admin/smart-rules.pl | 9 ++-- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 15 ++++++ .../prog/en/modules/admin/preferences/patrons.pref | 3 +- .../prog/en/modules/admin/smart-rules.tt | 3 + 8 files changed, 64 insertions(+), 19 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 7676a87..25bb3c9 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -241,8 +241,8 @@ C<$amount> is the fine owed by the patron (see above). C<$chargename> is the chargename field from the applicable record in the categoryitem table, whatever that is. -C<$daycount> is the number of days between start and end dates, Calendar adjusted (where needed), -minus any applicable grace period. +C<$unitcount> is the number of chargeable units (days between start and end dates, Calendar adjusted where needed, +minus any applicable grace period, or hours) FIXME - What is chargename supposed to be ? @@ -281,10 +281,9 @@ sub CalcFine { } else { # a zero (or null) chargeperiod means no charge. } - if(C4::Context->preference('maxFine') && ( $amount > C4::Context->preference('maxFine'))) { - $amount = C4::Context->preference('maxFine'); - } - return ($amount, $data->{chargename}, $days_minus_grace); + $amount = $data->{overduefinescap} if $data->{overduefinescap} && $amount > $data->{overduefinescap}; + $debug and warn sprintf("CalcFine returning (%s, %s, %s, %s)", $amount, $data->{'chargename'}, $days_minus_grace, $chargeable_units); + return ($amount, $data->{'chargename'}, $days_minus_grace, $chargeable_units); # FIXME: chargename is NEVER populated anywhere. } @@ -492,14 +491,39 @@ sub UpdateFine { # "REF" is Cash Refund my $sth = $dbh->prepare( "SELECT * FROM accountlines - WHERE itemnumber=? - AND borrowernumber=? - AND accounttype IN ('FU','O','F','M') - AND description like ? " + WHERE borrowernumber=? + AND accounttype IN ('FU','O','F','M')" ); - $sth->execute( $itemnum, $borrowernumber, "%$due%" ); + $sth->execute( $borrowernumber ); + my $data; + my $total_amount_other = 0.00; + my $due_qr = qr/$due/; + # Cycle through the fines and + # - find line that relates to the requested $itemnum + # - accumulate fines for other items + # so we can update $itemnum fine taking in account fine caps + while (my $rec = $sth->fetchrow_hashref) { + if ($rec->{itemnumber} == $itemnum && $rec->{description} =~ /$due_qr/) { + if ($data) { + warn "Not a unique accountlines record for item $itemnum borrower $borrowernumber"; + } else { + $data = $rec; + next; + } + } + $total_amount_other += $rec->{'amount'}; + } + if (my $maxfine = C4::Context->preference('MaxFine')) { + if ($total_amount_other + $amount > $maxfine) { + my $new_amount = $maxfine - $total_amount_other; + warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; + return if $new_amount <= 0.00; + + $amount = $new_amount; + } + } - if ( my $data = $sth->fetchrow_hashref ) { + if ( $data ) { # we're updating an existing fine. Only modify if amount changed # Note that in the current implementation, you cannot pay against an accruing fine diff --git a/C4/Search.pm b/C4/Search.pm index 56468b5..5aaa1f4 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -26,7 +26,7 @@ use C4::Search::PazPar2; use XML::Simple; use C4::Dates qw(format_date); use C4::Members qw(GetHideLostItemsPreference); -use C4::XSLT; +# use C4::XSLT; use C4::Branch; use C4::Reserves; # CheckReserves use C4::Debug; diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 0b8012f..264b333 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -101,8 +101,8 @@ elsif ($op eq 'delete-branch-item') { # save the values entered elsif ($op eq 'add') { my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?'); - my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); - my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); + my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); + my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); my $br = $branch; # branch my $bor = $input->param('categorycode'); # borrower category @@ -122,14 +122,15 @@ elsif ($op eq 'add') { $hardduedate = format_date_in_iso($hardduedate); my $hardduedatecompare = $input->param('hardduedatecompare'); my $rentaldiscount = $input->param('rentaldiscount'); + my $overduefinescap = $input->param('overduefinescap') || undef; $debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty"; $sth_search->execute($br,$bor,$cat); my $res = $sth_search->fetchrow_hashref(); if ($res->{total}) { - $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat); + $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); } else { - $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount); + $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); } } elsif ($op eq "set-branch-defaults") { diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index fda0bac..ed57922 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -995,6 +995,7 @@ CREATE TABLE `issuingrules` ( `renewalsallowed` smallint(6) NOT NULL default "0", `reservesallowed` smallint(6) NOT NULL default "0", `branchcode` varchar(10) NOT NULL default '', + overduefinescap decimal default NULL, PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`), KEY `categorycode` (`categorycode`), KEY `itemtype` (`itemtype`) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 34ac684..1250e45 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -62,7 +62,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- this is selected by the web installer now -- INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('marcflavour','MARC21','Define global MARC flavor (MARC21 or UNIMARC) used for character encoding','MARC21|UNIMARC','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MARCOrgCode','OSt','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','','free'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',9999,'Maximum fine a patron can have for a single late return','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',NULL,'Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxoutstanding',5,'maximum amount withstanding to be able make holds','','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxreserves',50,'Define maximum number of holds a patron can place','','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to display for each result on a page of results',NULL,'free'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c297677..904365b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5139,6 +5139,21 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } + + +$DBversion = '3.07.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE issuingrules ADD overduefinescap decimal DEFAULT NULL"); + my $maxfine = C4::Context->preference('MaxFine'); + if ($maxfine && $maxfine < 900) { # an arbitrary value that tells us it's not "some huge value" + $dbh->do("UPDATE issuingrules SET overduefinescap=?",undef,$maxfine); + $dbh->do("UPDATE systempreferences SET value = NULL WHERE variable = 'MaxFine'"); + } + $dbh->do("UPDATE systempreferences SET explanation = 'Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.' WHERE variable = 'MaxFine'"); + print "Upgrade to $DBversion done (Bug 7420 add overduefinescap to circulation matrix)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 3d88883..a438435 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -73,10 +73,11 @@ Patrons: no: "Don't allow" - "staff to access a patron's checkout history (it is stored regardless)." - - - The late fine for a specific checkout will only go up to + - The late fine for all checkouts will only go up to - pref: MaxFine class: currency - '[% local_currency %].' + - Empty value means no limit. Single item caps are specified in the circulation rules matrix. - - pref: memberofinstitution choices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 7b01ac7..3c693a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -78,6 +78,7 @@ for="tobranch">Clone these rules to: Clone these rules to: [% rule.finedays %] [% rule.renewalsallowed %] [% rule.reservesallowed %] @@ -182,6 +184,7 @@ for="tobranch">Clone these rules to: + -- 1.7.5.4 From srdjan at catalyst.net.nz Mon Apr 2 03:28:25 2012 From: srdjan at catalyst.net.nz (Srdjan) Date: Mon, 2 Apr 2012 13:28:25 +1200 Subject: [Koha-patches] [PATCH] bug_7420: Added overduefinescap to issuingrules In-Reply-To: References: Message-ID: <1333330105-30461-1-git-send-email-srdjan@catalyst.net.nz> Replaced existing MaxFine syspref logic with overduefinescap. Repurposed MaxFine to be the overall overdue limit for all items overdue. Implemented new MaxFine logic in UpdateFine(). --- C4/Overdues.pm | 48 +++++++++++++++----- admin/smart-rules.pl | 9 ++-- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 15 ++++++ .../prog/en/modules/admin/preferences/patrons.pref | 3 +- .../prog/en/modules/admin/smart-rules.tt | 3 + 8 files changed, 64 insertions(+), 19 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index 7676a87..25bb3c9 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -241,8 +241,8 @@ C<$amount> is the fine owed by the patron (see above). C<$chargename> is the chargename field from the applicable record in the categoryitem table, whatever that is. -C<$daycount> is the number of days between start and end dates, Calendar adjusted (where needed), -minus any applicable grace period. +C<$unitcount> is the number of chargeable units (days between start and end dates, Calendar adjusted where needed, +minus any applicable grace period, or hours) FIXME - What is chargename supposed to be ? @@ -281,10 +281,9 @@ sub CalcFine { } else { # a zero (or null) chargeperiod means no charge. } - if(C4::Context->preference('maxFine') && ( $amount > C4::Context->preference('maxFine'))) { - $amount = C4::Context->preference('maxFine'); - } - return ($amount, $data->{chargename}, $days_minus_grace); + $amount = $data->{overduefinescap} if $data->{overduefinescap} && $amount > $data->{overduefinescap}; + $debug and warn sprintf("CalcFine returning (%s, %s, %s, %s)", $amount, $data->{'chargename'}, $days_minus_grace, $chargeable_units); + return ($amount, $data->{'chargename'}, $days_minus_grace, $chargeable_units); # FIXME: chargename is NEVER populated anywhere. } @@ -492,14 +491,39 @@ sub UpdateFine { # "REF" is Cash Refund my $sth = $dbh->prepare( "SELECT * FROM accountlines - WHERE itemnumber=? - AND borrowernumber=? - AND accounttype IN ('FU','O','F','M') - AND description like ? " + WHERE borrowernumber=? + AND accounttype IN ('FU','O','F','M')" ); - $sth->execute( $itemnum, $borrowernumber, "%$due%" ); + $sth->execute( $borrowernumber ); + my $data; + my $total_amount_other = 0.00; + my $due_qr = qr/$due/; + # Cycle through the fines and + # - find line that relates to the requested $itemnum + # - accumulate fines for other items + # so we can update $itemnum fine taking in account fine caps + while (my $rec = $sth->fetchrow_hashref) { + if ($rec->{itemnumber} == $itemnum && $rec->{description} =~ /$due_qr/) { + if ($data) { + warn "Not a unique accountlines record for item $itemnum borrower $borrowernumber"; + } else { + $data = $rec; + next; + } + } + $total_amount_other += $rec->{'amount'}; + } + if (my $maxfine = C4::Context->preference('MaxFine')) { + if ($total_amount_other + $amount > $maxfine) { + my $new_amount = $maxfine - $total_amount_other; + warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached"; + return if $new_amount <= 0.00; + + $amount = $new_amount; + } + } - if ( my $data = $sth->fetchrow_hashref ) { + if ( $data ) { # we're updating an existing fine. Only modify if amount changed # Note that in the current implementation, you cannot pay against an accruing fine diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 0b8012f..264b333 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -101,8 +101,8 @@ elsif ($op eq 'delete-branch-item') { # save the values entered elsif ($op eq 'add') { my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?'); - my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); - my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); + my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)'); + my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=? WHERE branchcode=? AND categorycode=? AND itemtype=?"); my $br = $branch; # branch my $bor = $input->param('categorycode'); # borrower category @@ -122,14 +122,15 @@ elsif ($op eq 'add') { $hardduedate = format_date_in_iso($hardduedate); my $hardduedatecompare = $input->param('hardduedatecompare'); my $rentaldiscount = $input->param('rentaldiscount'); + my $overduefinescap = $input->param('overduefinescap') || undef; $debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty"; $sth_search->execute($br,$bor,$cat); my $res = $sth_search->fetchrow_hashref(); if ($res->{total}) { - $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat); + $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat); } else { - $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount); + $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap); } } elsif ($op eq "set-branch-defaults") { diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index fda0bac..ed57922 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -995,6 +995,7 @@ CREATE TABLE `issuingrules` ( `renewalsallowed` smallint(6) NOT NULL default "0", `reservesallowed` smallint(6) NOT NULL default "0", `branchcode` varchar(10) NOT NULL default '', + overduefinescap decimal default NULL, PRIMARY KEY (`branchcode`,`categorycode`,`itemtype`), KEY `categorycode` (`categorycode`), KEY `itemtype` (`itemtype`) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 34ac684..1250e45 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -62,7 +62,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES -- this is selected by the web installer now -- INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('marcflavour','MARC21','Define global MARC flavor (MARC21 or UNIMARC) used for character encoding','MARC21|UNIMARC','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MARCOrgCode','OSt','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','','free'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',9999,'Maximum fine a patron can have for a single late return','','Integer'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',NULL,'Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxoutstanding',5,'maximum amount withstanding to be able make holds','','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxreserves',50,'Define maximum number of holds a patron can place','','Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to display for each result on a page of results',NULL,'free'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index c297677..904365b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5139,6 +5139,21 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } + + +$DBversion = '3.07.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE issuingrules ADD overduefinescap decimal DEFAULT NULL"); + my $maxfine = C4::Context->preference('MaxFine'); + if ($maxfine && $maxfine < 900) { # an arbitrary value that tells us it's not "some huge value" + $dbh->do("UPDATE issuingrules SET overduefinescap=?",undef,$maxfine); + $dbh->do("UPDATE systempreferences SET value = NULL WHERE variable = 'MaxFine'"); + } + $dbh->do("UPDATE systempreferences SET explanation = 'Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.' WHERE variable = 'MaxFine'"); + print "Upgrade to $DBversion done (Bug 7420 add overduefinescap to circulation matrix)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 3d88883..a438435 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -73,10 +73,11 @@ Patrons: no: "Don't allow" - "staff to access a patron's checkout history (it is stored regardless)." - - - The late fine for a specific checkout will only go up to + - The late fine for all checkouts will only go up to - pref: MaxFine class: currency - '[% local_currency %].' + - Empty value means no limit. Single item caps are specified in the circulation rules matrix. - - pref: memberofinstitution choices: diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt index 7b01ac7..3c693a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -78,6 +78,7 @@ for="tobranch">Clone these rules to: Clone these rules to: [% rule.finedays %] [% rule.renewalsallowed %] [% rule.reservesallowed %] @@ -182,6 +184,7 @@ for="tobranch">Clone these rules to: + -- 1.7.5.4 From adrien.saurat at biblibre.com Mon Apr 2 10:45:42 2012 From: adrien.saurat at biblibre.com (Adrien Saurat) Date: Mon, 2 Apr 2012 10:45:42 +0200 Subject: [Koha-patches] [PATCH] Bug 7866: z39.50 search list ordered by rank Message-ID: <1333356342-4259-1-git-send-email-adrien.saurat@biblibre.com> In the z39.50 cataloging search page, the servers are now sorted by rank and name. --- cataloguing/z3950_search.pl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index 10320e2..6e6b417 100755 --- a/cataloguing/z3950_search.pl +++ b/cataloguing/z3950_search.pl @@ -82,7 +82,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ $template->param( frameworkcode => $frameworkcode, ); if ( $op ne "do_search" ) { - my $sth = $dbh->prepare("select id,host,name,checked from z3950servers order by host"); + my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers ORDER BY rank, name"); $sth->execute(); my $serverloop = $sth->fetchall_arrayref( {} ); $template->param( @@ -168,7 +168,7 @@ for my $i (1..$nterms-1) { warn "query ".$query if $DEBUG; foreach my $servid (@id) { - my $sth = $dbh->prepare("select * from z3950servers where id=?"); + my $sth = $dbh->prepare("SELECT * FROM z3950servers WHERE id=? ORDER BY rank, name"); $sth->execute($servid); while ( $server = $sth->fetchrow_hashref ) { warn "serverinfo ".join(':',%$server) if $DEBUG; -- 1.7.4.1 From adrien.saurat at biblibre.com Mon Apr 2 12:31:04 2012 From: adrien.saurat at biblibre.com (Adrien Saurat) Date: Mon, 2 Apr 2012 12:31:04 +0200 Subject: [Koha-patches] [PATCH] Bug 7868: cleans logs when doing a Search on the intranet Message-ID: <1333362664-5637-1-git-send-email-adrien.saurat@biblibre.com> --- .../prog/en/modules/catalogue/results.tt | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) 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 bed9a84..5001fab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -70,8 +70,10 @@ $(".addtocart").show(); param1 += "<\/optgroup>";[% END %] [% IF ( addpubshelves ) %]param1 += ""[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"