From chrisc at catalyst.net.nz Tue Feb 1 04:39:52 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Tue, 1 Feb 2011 16:39:52 +1300 Subject: [Koha-patches] [PATCH] Bug 5669: Adding a system preference to control whether a user can select a pick branch for their hold or not Message-ID: <1296531592-9867-1-git-send-email-chrisc@catalyst.net.nz> Default is on Part of bug 5609 --- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 3 ++- installer/data/mysql/it-IT/necessari/sysprefs.sql | 3 ++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 9 +++++++++ .../en/modules/admin/preferences/circulation.pref | 6 ++++++ .../opac-tmpl/prog/en/modules/opac-reserve.tmpl | 12 +++++++++--- kohaversion.pl | 2 +- opac/opac-reserve.pl | 9 +++++++-- 12 files changed, 44 insertions(+), 11 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 19f7c4d..8959ef6 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -283,3 +283,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index b597b02..743288d 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -283,3 +283,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index b051ba3..2b2d697 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -284,4 +284,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 06f279d..8000636 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -268,4 +268,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index c87729c..52bb566 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -281,4 +281,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index 993c6c3..d1e6b4d 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -336,4 +336,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 3416b2e..b802145 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -362,4 +362,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); \ No newline at end of file diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index f03f48f..18ee48a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3970,6 +3970,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.03.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo')"); + print "Upgrade to $DBversion done (Add syspref to control if user can choose pickup branch for holds)\n"; + SetVersion ($DBversion); +} + + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 3742b23..489473b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -254,6 +254,12 @@ Circulation: no: "Don't allow (with independent branches)" - a user from one library to place a hold on an item from another library - + - pref: OPACAllowUserToChooseBranch + choices: + yes: Allow + no: "Don't allow" + - a user to choose the branch to pick up a hold from. + - - pref: ReservesNeedReturns choices: yes: "Don't automatically" diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl index 61a7bea..970cfcd 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl @@ -245,7 +245,9 @@ Place On - Pickup Location + + Pickup Location + Title @@ -412,7 +414,9 @@ - + + + - + + + diff --git a/kohaversion.pl b/kohaversion.pl index f57080e..8330459 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.03.00.015'; + our $VERSION = '3.03.00.XXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index fca1e0b..865a7c4 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -88,7 +88,7 @@ if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { } # pass the pickup branch along.... -my $branch = $query->param('branch') || C4::Context->userenv->{branch} || '' ; +my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; ($branches->{$branch}) or $branch = ""; # Confirm branch is real $template->param( branch => $branch ); @@ -96,6 +96,11 @@ $template->param( branch => $branch ); my $CGIbranchloop = GetBranchesLoop($branch); $template->param( CGIbranch => $CGIbranchloop ); +# Is the person allowed to choose their branch +my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0; + +$template->param( choose_branch => $OPACChooseBranch); + # # # Build hashes of the requested biblio(item)s and items. @@ -175,7 +180,7 @@ if ( $query->param('place_reserve') ) { my $branch = shift(@selectedItems); # i.e., branch code, not name my $singleBranchMode = $template->param('singleBranchMode'); - if ($singleBranchMode) { + if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing $branch = $borr->{'branchcode'}; } -- 1.7.1 From f.demians at tamil.fr Tue Feb 1 08:42:59 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Tue, 1 Feb 2011 08:42:59 +0100 Subject: [Koha-patches] [PATCH] Bug 3977 Follow up. Suppress unnecessary table update Message-ID: <1296546179-2895-1-git-send-email-f.demians@tamil.fr> updatabase.pl try for v. 3.03.00.016 to add a new column 'privacy' to borrowers table, but this column already exists: introduced by 3.01.00.072 version. --- installer/data/mysql/updatedatabase.pl | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d91b295..1d24d66 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3974,7 +3974,6 @@ $DBversion = '3.03.00.016'; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { # reimplement OpacPrivacy system preference $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo')"); - $dbh->do("ALTER TABLE `borrowers` ADD `privacy` INTEGER NOT NULL DEFAULT 1;"); $dbh->do("ALTER TABLE `deletedborrowers` ADD `privacy` INTEGER NOT NULL DEFAULT 1;"); print "Upgrade to $DBversion done (OpacPrivacy reimplementation)\n"; SetVersion($DBversion); -- 1.7.3.5 From f.demians at tamil.fr Tue Feb 1 09:11:47 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Tue, 1 Feb 2011 09:11:47 +0100 Subject: [Koha-patches] [PATCH] Bug 5431: Separate state field for library addresses Message-ID: <1296547907-9160-1-git-send-email-f.demians@tamil.fr> From: Katrin Fischer [SIGNED-OFF] Go with coming bug 5422 in order to have harmonized city/state handling for branches and borrowers. Signed-off-by: Fr?d?ric Demians --- C4/Branch.pm | 10 ++++++---- admin/branches.pl | 3 ++- installer/data/mysql/kohastructure.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/branches.tmpl | 6 ++++-- kohaversion.pl | 2 +- 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/C4/Branch.pm b/C4/Branch.pm index 1f26e35..817aa38 100644 --- a/C4/Branch.pm +++ b/C4/Branch.pm @@ -203,7 +203,7 @@ sub ModBranch { my $query = " INSERT INTO branches (branchcode,branchname,branchaddress1, - branchaddress2,branchaddress3,branchzip,branchcity, + branchaddress2,branchaddress3,branchzip,branchcity,branchstate, branchcountry,branchphone,branchfax,branchemail, branchurl,branchip,branchprinter,branchnotes) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) @@ -213,7 +213,8 @@ sub ModBranch { $data->{'branchcode'}, $data->{'branchname'}, $data->{'branchaddress1'}, $data->{'branchaddress2'}, $data->{'branchaddress3'}, $data->{'branchzip'}, - $data->{'branchcity'}, $data->{'branchcountry'}, + $data->{'branchcity'}, $data->{'branchstate'}, + $data->{'branchcountry'}, $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, @@ -225,7 +226,7 @@ sub ModBranch { UPDATE branches SET branchname=?,branchaddress1=?, branchaddress2=?,branchaddress3=?,branchzip=?, - branchcity=?,branchcountry=?,branchphone=?, + branchcity=?,branchstate=?,branchcountry=?,branchphone=?, branchfax=?,branchemail=?,branchurl=?,branchip=?, branchprinter=?,branchnotes=? WHERE branchcode=? @@ -235,7 +236,8 @@ sub ModBranch { $data->{'branchname'}, $data->{'branchaddress1'}, $data->{'branchaddress2'}, $data->{'branchaddress3'}, $data->{'branchzip'}, - $data->{'branchcity'}, $data->{'branchcountry'}, + $data->{'branchcity'}, $data->{'branchstate'}, + $data->{'branchcountry'}, $data->{'branchphone'}, $data->{'branchfax'}, $data->{'branchemail'}, $data->{'branchurl'}, $data->{'branchip'}, $data->{'branchprinter'}, diff --git a/admin/branches.pl b/admin/branches.pl index 758fa32..b83fb67 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -343,7 +343,7 @@ sub branchinfotable { for my $field ( 'branchaddress1', 'branchaddress2', 'branchaddress3', 'branchzip', - 'branchcity', 'branchcountry', + 'branchcity', 'branchstate', 'branchcountry', 'branchphone', 'branchfax', 'branchemail', 'branchurl', 'branchip', 'branchprinter', 'branchnotes' @@ -402,6 +402,7 @@ sub _branch_to_template { branchaddress3 => $data->{'branchaddress3'}, branchzip => $data->{'branchzip'}, branchcity => $data->{'branchcity'}, + branchstate => $data->{'branchstate'}, branchcountry => $data->{'branchcountry'}, branchphone => $data->{'branchphone'}, branchfax => $data->{'branchfax'}, diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e7ad97f..4ea52cf 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -342,6 +342,7 @@ CREATE TABLE `branches` ( `branchaddress3` mediumtext, `branchzip` varchar(25) default NULL, `branchcity` mediumtext, + `branchstate` mediumtext, `branchcountry` text, `branchphone` mediumtext, `branchfax` mediumtext, diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4618636..c8e2bdb 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3987,6 +3987,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.0X.XX.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE branches ADD `branchstate` mediumtext AFTER `branchcity`;"); + print "Upgrade to $DBversion done (Add state to branch address)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl index 14da769..95ca011 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tmpl @@ -109,7 +109,8 @@
  • " />
  • " />
  • " />
  • -
  • " />
  • +
  • " />
  • +
  • " />
  • " />
  • " />
  • " />
  • @@ -211,7 +212,8 @@
    -
    +
    , +
    diff --git a/kohaversion.pl b/kohaversion.pl index e15f01b..3ece202 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.03.00.017'; + our $VERSION = '3.0X.XX.XXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install -- 1.7.3.5 From f.demians at tamil.fr Tue Feb 1 09:55:17 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Tue, 1 Feb 2011 09:55:17 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5669: Adding a system preference to control whether a user can select a pick branch for their hold or not Message-ID: <1296550517-19145-1-git-send-email-f.demians@tamil.fr> From: Chris Cormack Default is on Part of bug 5609 Signed-off-by: Fr?d?ric Demians --- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../1-Obligatoire/unimarc_standard_systemprefs.sql | 3 ++- installer/data/mysql/it-IT/necessari/sysprefs.sql | 3 ++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- installer/data/mysql/updatedatabase.pl | 7 +++++++ .../en/modules/admin/preferences/circulation.pref | 6 ++++++ .../opac-tmpl/prog/en/modules/opac-reserve.tmpl | 12 +++++++++--- kohaversion.pl | 2 +- opac/opac-reserve.pl | 9 +++++++-- 12 files changed, 42 insertions(+), 11 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 02511d8..4ff7831 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -285,3 +285,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..6e4913f 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,3 +285,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 757f255..bd01da0 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -286,4 +286,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 79c469c..b23bc34 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -271,4 +271,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 8689c4c..a820391 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -283,4 +283,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index c862e60..07a0b94 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -338,4 +338,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 82e285b..d5f6c7e 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -363,4 +363,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4618636..a7ddcec 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3987,6 +3987,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.03.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAllowUserToChooseBranch', 1, 'Allow the user to choose the branch they want to pickup their hold from','1','YesNo')"); + print "Upgrade to $DBversion done (Add syspref to control if user can choose pickup branch for holds)\n"; + SetVersion ($DBversion); + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 3742b23..489473b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -254,6 +254,12 @@ Circulation: no: "Don't allow (with independent branches)" - a user from one library to place a hold on an item from another library - + - pref: OPACAllowUserToChooseBranch + choices: + yes: Allow + no: "Don't allow" + - a user to choose the branch to pick up a hold from. + - - pref: ReservesNeedReturns choices: yes: "Don't automatically" diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl index 61a7bea..970cfcd 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl @@ -245,7 +245,9 @@ Place On - Pickup Location + + Pickup Location + Title @@ -412,7 +414,9 @@ - + + + - + + + diff --git a/kohaversion.pl b/kohaversion.pl index e15f01b..8330459 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts : use strict; sub kohaversion { - our $VERSION = '3.03.00.017'; + our $VERSION = '3.03.00.XXX'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index fca1e0b..865a7c4 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -88,7 +88,7 @@ if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { } # pass the pickup branch along.... -my $branch = $query->param('branch') || C4::Context->userenv->{branch} || '' ; +my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ; ($branches->{$branch}) or $branch = ""; # Confirm branch is real $template->param( branch => $branch ); @@ -96,6 +96,11 @@ $template->param( branch => $branch ); my $CGIbranchloop = GetBranchesLoop($branch); $template->param( CGIbranch => $CGIbranchloop ); +# Is the person allowed to choose their branch +my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0; + +$template->param( choose_branch => $OPACChooseBranch); + # # # Build hashes of the requested biblio(item)s and items. @@ -175,7 +180,7 @@ if ( $query->param('place_reserve') ) { my $branch = shift(@selectedItems); # i.e., branch code, not name my $singleBranchMode = $template->param('singleBranchMode'); - if ($singleBranchMode) { + if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing $branch = $borr->{'branchcode'}; } -- 1.7.3.5 From cnighswonger at foundations.edu Tue Feb 1 20:48:50 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Tue, 1 Feb 2011 14:48:50 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3881: OPAC Privacy reimplementation In-Reply-To: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> References: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> Message-ID: This patch does not apply cleanly to 3.2.x. Please fixup and resubmit with [3.2.x] in the subject line. Kind Regards, Chris cnighs at li24-93:~/koha.3.2.test (3.2.x *+)$ git status # On branch 3.2.x # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: C4/Auth.pm # modified: C4/Circulation.pm # modified: C4/Members.pm # modified: installer/data/mysql/de-DE/mandatory/sysprefs.sql # modified: installer/data/mysql/en/mandatory/sysprefs.sql # modified: installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql # modified: installer/data/mysql/it-IT/necessari/sysprefs.sql # modified: installer/data/mysql/pl-PL/mandatory/sysprefs.sql # modified: installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql # modified: installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql # modified: installer/data/mysql/updatedatabase.pl # modified: koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl # modified: koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc # new file: koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl # modified: members/moremember.pl # new file: opac/opac-privacy.pl # modified: opac/opac-suggestions.pl # # Unmerged paths: # (use "git reset HEAD ..." to unstage) # (use "git add/rm ..." as appropriate to mark resolution) # # both modified: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref # On Sun, Jan 30, 2011 at 12:48 AM, Nicole Engard < nengard at bywatersolutions.com> wrote: > From: Ian Walls > > Reimplements Paul Poulain's original OPAC Privacy patch, with some minor > improvements and changes to wording > > If the library enables the OPACPrivacy system preference along with the > opacreadinghistory preference, and sets > an AnonymousPatron (must be a valid patron number in the database), the > user will see a new tab upon login to > the OPAC, My Privacy. From there, the user can: > > - Set their OPAC Privacy to one of three values > 0 - Forever. This keeps their reading history unless they explicitly > delete it; the bulk anonymiser won't touch it > 1 - Default. Keep reading history until either they delete it or the > library does > 2 - Never. Instantly anonymises reading history upon item return > > - Instantly delete their reading history > There is a warning and a popup to confirm. I've removed Paul's extra > confirm checkbox, which seemed redundant > > A note of which preference the patron has selected is added to the Patorn > Details page in the staff client. This is read-only. > > This patch also consolidates Privacy system preferences into the Privacy > section of the OPAC tab. > > Thank you to BibLibre for the original implmentation of this patch, and Los > Gatos Public Library for funding and > testing the reimplementation. > > Signed-off-by: Nicole Engard > --- > C4/Auth.pm | 1 + > C4/Circulation.pm | 44 ++++++++++-- > C4/Members.pm | 26 +++++++ > installer/data/mysql/de-DE/mandatory/sysprefs.sql | 4 +- > installer/data/mysql/en/mandatory/sysprefs.sql | 4 +- > .../1-Obligatoire/unimarc_standard_systemprefs.sql | 4 +- > installer/data/mysql/it-IT/necessari/sysprefs.sql | 9 ++- > installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +- > ...m_preferences_full_optimal_for_install_only.sql | 4 +- > ...m_preferences_full_optimal_for_install_only.sql | 5 +- > installer/data/mysql/updatedatabase.pl | 10 +++ > .../prog/en/modules/admin/preferences/opac.pref | 37 +++++++--- > .../prog/en/modules/members/moremember.tmpl | 5 ++ > koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc | 3 + > .../opac-tmpl/prog/en/modules/opac-privacy.tmpl | 72 > ++++++++++++++++++++ > members/moremember.pl | 6 ++ > opac/opac-privacy.pl | 68 > ++++++++++++++++++ > opac/opac-suggestions.pl | 2 +- > 18 files changed, 279 insertions(+), 29 deletions(-) > create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl > create mode 100755 opac/opac-privacy.pl > > diff --git a/C4/Auth.pm b/C4/Auth.pm > index fc4e3e2..130974e 100644 > --- a/C4/Auth.pm > +++ b/C4/Auth.pm > @@ -418,6 +418,7 @@ sub get_template_and_user { > OpacNav => "" . > C4::Context->preference("OpacNav"), > OpacPasswordChange => > C4::Context->preference("OpacPasswordChange"), > OPACPatronDetails => > C4::Context->preference("OPACPatronDetails"), > + OPACPrivacy => > C4::Context->preference("OPACPrivacy"), > OPACFinesTab => > C4::Context->preference("OPACFinesTab"), > OpacTopissue => > C4::Context->preference("OpacTopissue"), > RequestOnOpac => > C4::Context->preference("RequestOnOpac"), > diff --git a/C4/Circulation.pm b/C4/Circulation.pm > index b741794..f7846ac 100644 > --- a/C4/Circulation.pm > +++ b/C4/Circulation.pm > @@ -1516,7 +1516,7 @@ sub AddReturn { > } > > if ($borrowernumber) { > - MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, > $circControlBranch); > + MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, > $circControlBranch, '', $borrower->{'privacy'}); > $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right? > This could be the borrower hash. > } > > @@ -1621,7 +1621,7 @@ sub AddReturn { > > =head2 MarkIssueReturned > > - MarkIssueReturned($borrowernumber, $itemnumber, $dropbox_branch, > $returndate); > + MarkIssueReturned($borrowernumber, $itemnumber, $dropbox_branch, > $returndate, $privacy); > > Unconditionally marks an issue as being returned by > moving the C row to C and > @@ -1633,6 +1633,9 @@ it's safe to do this, i.e. last non-holiday > > issuedate. > if C<$returndate> is specified (in iso format), it is used as the date > of the return. It is ignored when a dropbox_branch is passed in. > > +C<$privacy> contains the privacy parameter. If the patron has set privacy > to 2, > +the old_issue is immediately anonymised > + > Ideally, this function would be internal to C, > not exported, but it is currently needed by one > routine in C. > @@ -1640,7 +1643,7 @@ routine in C. > =cut > > sub MarkIssueReturned { > - my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate ) = > @_; > + my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate, > $privacy ) = @_; > my $dbh = C4::Context->dbh; > my $query = "UPDATE issues SET returndate="; > my @bind; > @@ -1664,6 +1667,16 @@ sub MarkIssueReturned { > WHERE borrowernumber = ? > AND itemnumber = ?"); > $sth_copy->execute($borrowernumber, $itemnumber); > + # anonymise patron checkout immediately if $privacy set to 2 and > AnonymousPatron is set to a valid borrowernumber > + if ( $privacy == 2) { > + # The default of 0 does not work due to foreign key constraints > + # The anonymisation will fail quietly if AnonymousPatron is not a > valid entry > + my $anonymouspatron = (C4::Context->preference('AnonymousPatron')) > ? C4::Context->preference('AnonymousPatron') : 0; > + my $sth_ano = $dbh->prepare("UPDATE old_issues SET > borrowernumber=? > + WHERE borrowernumber = ? > + AND itemnumber = ?"); > + $sth_ano->execute($anonymouspatron, $borrowernumber, $itemnumber); > + } > my $sth_del = $dbh->prepare("DELETE FROM issues > WHERE borrowernumber = ? > AND itemnumber = ?"); > @@ -2417,11 +2430,14 @@ sub DeleteTransfer { > > =head2 AnonymiseIssueHistory > > - $rows = AnonymiseIssueHistory($borrowernumber,$date) > + $rows = AnonymiseIssueHistory($date,$borrowernumber) > > This function write NULL instead of C<$borrowernumber> given on input arg > into the table issues. > if C<$borrowernumber> is not set, it will delete the issue history for all > borrower older than C<$date>. > > +If c<$borrowernumber> is set, it will delete issue history for only that > borrower, regardless of their opac privacy > +setting (force delete). > + > return the number of affected rows. > > =cut > @@ -2432,12 +2448,24 @@ sub AnonymiseIssueHistory { > my $dbh = C4::Context->dbh; > my $query = " > UPDATE old_issues > - SET borrowernumber = NULL > - WHERE returndate < '".$date."' > + SET borrowernumber = ? > + WHERE returndate < ? > AND borrowernumber IS NOT NULL > "; > - $query .= " AND borrowernumber = '".$borrowernumber."'" if defined > $borrowernumber; > - my $rows_affected = $dbh->do($query); > + > + # The default of 0 does not work due to foreign key constraints > + # The anonymisation will fail quietly if AnonymousPatron is not a > valid entry > + my $anonymouspatron = (C4::Context->preference('AnonymousPatron')) ? > C4::Context->preference('AnonymousPatron') : 0; > + my @bind_params = ($anonymouspatron, $date); > + if (defined $borrowernumber) { > + $query .= " AND borrowernumber = ?"; > + push @bind_params, $borrowernumber; > + } else { > + $query .= " AND (SELECT privacy FROM borrowers WHERE > borrowers.borrowernumber=old_issues.borrowernumber) <> 0"; > + } > + my $sth = $dbh->prepare($query); > + $sth->execute(@bind_params); > + my $rows_affected = $sth->rows; ### doublecheck row count return > function > return $rows_affected; > } > > diff --git a/C4/Members.pm b/C4/Members.pm > index 00716cd..fafc99b 100644 > --- a/C4/Members.pm > +++ b/C4/Members.pm > @@ -93,6 +93,7 @@ BEGIN { > push @EXPORT, qw( > &ModMember > &changepassword > + &ModPrivacy > ); > > #Delete data > @@ -2022,6 +2023,31 @@ sub DebarMember { > > } > > +=head2 ModPrivacy > + > +=over 4 > + > +my $success = ModPrivacy( $borrowernumber, $privacy ); > + > +Update the privacy of a patron. > + > +return : > +true on success, false on failure > + > +=back > + > +=cut > + > +sub ModPrivacy { > + my $borrowernumber = shift; > + my $privacy = shift; > + return unless defined $borrowernumber; > + return unless $borrowernumber =~ /^\d+$/; > + > + return ModMember( borrowernumber => $borrowernumber, > + privacy => $privacy ); > +} > + > =head2 AddMessage > > AddMessage( $borrowernumber, $message_type, $message, $branchcode ); > diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql > b/installer/data/mysql/de-DE/mandatory/sysprefs.sql > index 19f7c4d..02511d8 100644 > --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql > +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql > @@ -9,7 +9,8 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web > Services','US|CA|DE|FR|JP|UK','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AWSAccessKeyID','','See: http://aws.amazon.com','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonAssocTag','','See: http://aws.amazon.com','','free'); > -INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable > Anonymous suggestions',NULL,'free'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to > AnonymousPatron borrowernumber',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the > anonymous patron. Used for Suggestion and reading history privacy',NULL,''); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('Babeltheque',0,'Turn ON Babeltheque content - See babeltheque.comto subscribe to this service','','YesNo'); > > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('authoritysep','--','Used to separate a list of authorities in a > display. Usually --',10,'free'); > @@ -79,6 +80,7 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacNav','Important links here.','Use HTML tags to add navigational > links to the left-hand navigational bar in OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OPACNoResultsFound','','Display this HTML when no results are found > for a search in the OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password > change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy > rules (reading history)',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation > History in OPAC','','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacsmallimage','','Enter a complete URL to an image to replace the > default Koha logo','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout > stylesheet in OPAC','','free'); > diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql > b/installer/data/mysql/en/mandatory/sysprefs.sql > index b597b02..0b75e98 100644 > --- a/installer/data/mysql/en/mandatory/sysprefs.sql > +++ b/installer/data/mysql/en/mandatory/sysprefs.sql > @@ -9,7 +9,8 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web > Services','US|CA|DE|FR|JP|UK','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AWSAccessKeyID','','See: http://aws.amazon.com','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonAssocTag','','See: http://aws.amazon.com','','free'); > -INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable > Anonymous suggestions',NULL,'free'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to > AnonymousPatron borrowernumber',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the > anonymous patron. Used for Suggestion and reading history privacy',NULL,''); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('Babeltheque',0,'Turn ON Babeltheque content - See babeltheque.comto subscribe to this service','','YesNo'); > > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('authoritysep','--','Used to separate a list of authorities in a > display. Usually --',10,'free'); > @@ -79,6 +80,7 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacNav','Important links here.','Use HTML tags to add navigational > links to the left-hand navigational bar in OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OPACNoResultsFound','','Display this HTML when no results are found > for a search in the OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password > change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy > rules (reading history)',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation > History in OPAC','','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacsmallimage','','Enter a complete URL to an image to replace the > default Koha logo','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout > stylesheet in OPAC','','free'); > diff --git > a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > index b051ba3..757f255 100644 > --- > a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > +++ > b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql > @@ -10,7 +10,8 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonLocale','US','Utilis? pour d?finir la localisation des web > services Amazon','US|CA|DE|FR|JP|UK','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AWSAccessKeyID','','Voir : http://aws.amazon.com','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonAssocTag', '', 'Voir : > associates.amazon.com/gp/flex/associates/apply-login.html', '', ''); > -INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions', '0', 'Attribu?e au n? de l''emprunteur anonyme > pour activer les suggestions anonymes. 0, pas de suggestions anonymes.', '', > 'free'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to > AnonymousPatron borrowernumber',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the > anonymous patron. Used for Suggestion and reading history privacy',NULL,''); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('Babeltheque',0,'Active les contenus Babelth?que - Voir > babeltheque.com pour s''abonner','','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('authoritysep', '--', 'Le s?parateur utilis? dans les autorit?s. > Habituellement --', '10', 'free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('autoBarcode', 'OFF', 'Utilis? pour g?n?rer automatiquement les codes > barre: incremental sera de la forme 1, 2, 3; annual de la forme 2007-0001, > 2007-0002, hbyymmincr de la forme HB09010001 o? HB=la branche > d''appartenance', 'incremental|annual|hbyymmincr|OFF', 'Choice'); > @@ -91,6 +92,7 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacMainUserBlock','Bienvenue dans Koha...\r\n
    ','Bloc HTML > d?fini par la biblioth?que, qui appara?t sur la page principale de > l''OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacNav', '', 'Ce param?tre contient du code HTML, qui est mis au > d?but de la barre de navigation, sur la gauche, ? l''OPAC.','70|10', > 'Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPasswordChange', '1', 'Si ce param?tre est activ?, les adh?rents > peuvent modifier leur mot de passe ? l''OPAC. A d?sactiver si vous utilisez > l''authentification ldap', '', 'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy > rules (reading history)',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacreadinghistory', '1', 'Si ce param?tre est activ?, les adh?rents > peuvent consulter leur historique de lecture ? l''OPAC', '', 'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacsmallimage', '', 'Ce param?tre contient une URL. Il permet de > d?finir l''image qui est affich?e en haut, ? gauche de l''OPAC', '', > 'free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacstylesheet', '', 'Ce param?tre a la forme d''une URL. Il d?finit > la feuille de style utilis?e ? l''OPAC. S''il est vide, vous aurez la > feuille de style par d?fault de Koha', '', 'free'); > diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql > b/installer/data/mysql/it-IT/necessari/sysprefs.sql > index 06f279d..cc00e68 100644 > --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql > +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql > @@ -9,6 +9,7 @@ insert into `systempreferences` (`variable`, `value`, > `options`, `explanation`, > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('advancedMARCeditor','0','','Se su ON, nel > MARC editor non verranno visualizzati i campi/sottocampi delle > descrizioni.','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) > values('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Selezionare > quale set di campi comprender? la ricerca avanzata per tipo.','Choice'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AllowHoldsOnDamagedItems','1','','Permette > l\'inserimento di richieste di prenotazione su copie danneggiate','YesNo'); > +insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AllowNotForLoanOverride','0','','Se ON, > abilita il bibliotecario a poter scegliere di dare in prestito un documento > normalmente escluso.','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AllowOnShelfHolds','1','','Permette di > inserire prenotazioni su documenti non in prestito.','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AllowRenewalLimitOverride','1','','Se On, > permette che i limiti ai rinnovi possano essere superati dal bibliotecario > nel modulo della circolazione','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AmazonAssocTag','','','See: > http://aws.amazon.com','free'); > @@ -17,7 +18,9 @@ insert into `systempreferences` (`variable`, `value`, > `options`, `explanation`, > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AmazonLocale','US','US|CA|DE|FR|JP|UK','Usalo > per definire il tuo specifico Amazon.com Web Services','Choice'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AmazonReviews','0','','Visualizza Amazon > reviews sull\'interfaccia dello staff.','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AmazonSimilarItems','0','','Messa su ON > attiva l\' Amazon Similar Items feature - Devi settare i valori in > AWSAccessKeyID e in AmazonAssocTag per usarla','YesNo'); > -insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AnonSuggestions','0','','Imposta un utente > anonimo per abilitare i suggerimenti d\'acquisto da utenti non > registrati.','free'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to > AnonymousPatron borrowernumber',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the > anonymous patron. Used for Suggestion and reading history privacy',NULL,''); > +insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AuthDisplayHierarchy','0','','Se ON attiva la > gestione gerarchica dell\'authority. Da usare solo con thesaurus','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('authoritysep','--','10','Carattere usato > nella visualizzazione come separatore della lista delle authority. > Normalmente ? --','free'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) > values('autoBarcode','annual','incremental|annual|hbyymmincr|OFF','Da usare > per impostare la generazione automatica dei barcode: incremental per la > tipologia 1, 2, 3; annuale per 2007-0001, 2007-0002; hbyymmincr per > HB08010001 dove HB sta per Home Branch (sottobiblioteca > predefinita)','Choice'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('AutoEmailOpacUser','0','','Quando viene > creato un account, invia notifica via email all\'utente con i dettagli del > nuovo account.','YesNo'); > @@ -89,10 +92,12 @@ insert into `systempreferences` (`variable`, `value`, > `options`, `explanation`, > -- insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) > values('marcflavour','UNIMARC','MARC21|UNIMARC','Define global MARC flavor > (MARC21 or UNIMARC) used for character encoding','Choice'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('MARCOrgCode','0','','Il MARC Organization > Code - http://www.loc.gov/marc/organizations/orgshome.html','free'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('MaxFine','9999','','Multa massima che un > utente potrebbe avere per un singolo ritardo.','Integer'); > +insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('maxItemsInSearchResults','20','','Specifica > il numero massimo di copie visualizzate nelle pagine di risultati','free'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('maxoutstanding','5','','Definisci il numero > massimo di operazioni in corso (prestiti+prenotazioni) dopo il quale si > blocca la possibilit? di fare prenotazioni','Integer'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('maxreserves','2','','Definisce il numero > massimo di prenotazioni che un utente pu? effettuare.','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'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('memberofinstitution','0','','Se ON, gli > utenti possono essere linkati alle istituzioni.','YesNo'); > +insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('MergeAuthoritiesOnUpdate','1','','Se ON, > aggiornando le authorities saranno automaticamente aggiornati anche i record > bibliografici','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('minPasswordLength','3','','Specifica la > lunghezza minima della password sia per l\'utente che per lo staff','free'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('noissuescharge','5','','Definisce l?ammontare > massimo di multa che un utente pu? raggiungere prima di venir sospeso dal > prestito','Integer'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('noItemTypeImages','0','','Se Attivo, > disabilita le immagini relative al tipo documento','YesNo'); > @@ -130,6 +135,7 @@ insert into `systempreferences` (`variable`, `value`, > `options`, `explanation`, > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('OPACNoResultsFound','','Display this HTML > when no results are found for a search in the OPAC','70|10','Textarea'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('OPACnumSearchResults','20','','Specifica il > numero massimo di risposte da visualizzare nella pagina dei risultati > ','Integer'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('OpacPasswordChange','1','','Se ON, abilita > l\'utente alla modifica della password nell\'OPAC (disabiltare la funzione > quando ? usato LDAP auth)','YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy > rules (reading history)',NULL,'YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('opacreadinghistory','1','','Se ON, si abilita > la visualizzazione dello storico circolazione utente nell\'OPAC','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('OpacRenewalAllowed','0','','Se ON, gli utenti > possono rinnovare i propri prestiti direttamente dal proprio account > OPAC','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('OPACShelfBrowser','0','','Abilita/disabilita > una ricerca per scaffale (Shelf Browser) nella pagina dettagli documento. > ATTENZIONE: questa feature consuma molte risorse nelle collezioni molto > grandi.','YesNo'); > @@ -153,6 +159,7 @@ insert into `systempreferences` (`variable`, `value`, > `options`, `explanation`, > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('QueryStemming','0','','Se ON, abilita le > ricerche con lo stemming (uso di forme variabili)','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('QueryWeightFields','0','','Se ON, abilita le > opzioni di ricerca per dare uno peso diverso ai vari campi. Opzione > sperimentale','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('RandomizeHoldsQueueWeight','0','','Se ON, la > coda delle prenotazione nella circolazione avr? un ordine casuale per tutte > le collocazioni o solo per quelle collocazioni specificate sotto > StaticHoldsQueueWeight, se impostato.','YesNo'); > +insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('ReceiveBackIssues','5','','Numero di > periodici precedenti da visualizzare quando si guarda il dettaglio di una > sottoscrizione',''); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) > values('RenewalPeriodBase','date_due','date_due|now','Per impostare se la > data di rinnovo deve essere conteggiata a partire dalla data di scadenza del > prestito o a partire dal momento in cui l?utente ne chiede il > rinnovo.','Choice'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('RenewSerialAddsSuggestion','0','','Se ON, > puoi aggiungere un nuovo suggerimento durante il rinnovo di un > periodico','YesNo'); > insert into `systempreferences` (`variable`, `value`, `options`, > `explanation`, `type`) values('RequestOnOpac','1','','Se ON, si abilitano > gli utenti globalmente a inserire prenotazione nell\'OPAC','YesNo'); > diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > index c87729c..8689c4c 100644 > --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql > @@ -9,7 +9,8 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web > Services','US|CA|DE|FR|JP|UK','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AWSAccessKeyID','','See: http://aws.amazon.com','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonAssocTag','','See: http://aws.amazon.com','','free'); > -INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable > Anonymous suggestions',NULL,'free'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to > AnonymousPatron borrowernumber',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the > anonymous patron. Used for Suggestion and reading history privacy',NULL,''); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('Babeltheque',0,'Turn ON Babeltheque content - See babeltheque.comto subscribe to this service','','YesNo'); > > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('authoritysep','--','Used to separate a list of authorities in a > display. Usually --',10,'free'); > @@ -78,6 +79,7 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacMainUserBlock','Welcome to Koha...\r\n
    ','A user-defined > block of HTML in the main content area of the opac main > page','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacNav','Important links here.','Use HTML tags to add navigational > links to the left-hand navigational bar in OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password > change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy > rules (reading history)',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation > History in OPAC','','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacsmallimage','','Enter a complete URL to an image to replace the > default Koha logo','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout > stylesheet in OPAC','','free'); > diff --git > a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql > b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql > index 993c6c3..c862e60 100644 > --- > a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql > +++ > b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql > @@ -24,7 +24,8 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web > Services','US|CA|DE|FR|JP|UK','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AWSAccessKeyID','','See: http://aws.amazon.com','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonAssocTag','','See: http://aws.amazon.com','','free'); > -INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable > Anonymous suggestions',NULL,'free'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to > AnonymousPatron borrowernumber',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the > anonymous patron. Used for Suggestion and reading history privacy',NULL,''); > > > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('authoritysep','--','Used to separate a list of authorities in a > display. Usually --',10,'free'); > @@ -107,6 +108,7 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacMainUserBlock','????? ?????????? ? ???? Koha...\r\n
    ','A > user-defined block of HTML in the main content area of the opac main > page','50|20','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacNav','????? ????? ?????? ??????.','Use HTML tags to add > navigational links to the left-hand navigational bar in > OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password > change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy > rules (reading history)',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation > History in OPAC','','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacsmallimage','','Enter a complete URL to an image to replace the > default Koha logo','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout > stylesheet in OPAC','','free'); > diff --git > a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql > b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql > index 3416b2e..82e285b 100644 > --- > a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql > +++ > b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql > @@ -24,8 +24,8 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web > Services','US|CA|DE|FR|JP|UK','Choice'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AWSAccessKeyID','','See: http://aws.amazon.com','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AmazonAssocTag','','See: http://aws.amazon.com','','free'); > -INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable > Anonymous suggestions',NULL,'free'); > - > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to > AnonymousPatron borrowernumber',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the > anonymous patron. Used for Suggestion and reading history privacy',NULL,''); > > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('authoritysep','--','Used to separate a list of authorities in a > display. Usually --',10,'free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('autoBarcode','incremental','Used to autogenerate a barcode: > incremental will be of the form 1, 2, 3; annual of the form 2007-0001, > 2007-0002; hbyymmincr of the form HB08010001 where HB=Home > Branch','incremental|annual|hbyymmincr|OFF','Choice'); > @@ -107,6 +107,7 @@ INSERT INTO `systempreferences` > (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacMainUserBlock','??????? ? ???? Koha...\r\n
    ','A user-defined > block of HTML in the main content area of the opac main > page','50|20','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacNav','??? ?????? ??????? ?????????.','Use HTML tags to add > navigational links to the left-hand navigational bar in > OPAC','70|10','Textarea'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password > change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); > +INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy > rules (reading history)',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation > History in OPAC','','YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacsmallimage','','Enter a complete URL to an image to replace the > default Koha logo','','free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) > VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout > stylesheet in OPAC','','free'); > diff --git a/installer/data/mysql/updatedatabase.plb/installer/data/mysql/ > updatedatabase.pl > index f03f48f..2d89b02 100755 > --- a/installer/data/mysql/updatedatabase.pl > +++ b/installer/data/mysql/updatedatabase.pl > @@ -3970,6 +3970,16 @@ if (C4::Context->preference("Version") < > TransformToNum($DBversion)) { > SetVersion ($DBversion); > } > > +$DBversion = '3.03.00.xxx'; > +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > + # reimplement OpacPrivacy system preference > + $dbh->do("INSERT INTO systempreferences > (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, > allows patrons to define their privacy rules (reading > history)',NULL,'YesNo')"); > + $dbh->do("ALTER TABLE `borrowers` ADD `privacy` INTEGER NOT NULL > DEFAULT 1;"); > + $dbh->do("ALTER TABLE `deletedborrowers` ADD `privacy` INTEGER NOT > NULL DEFAULT 1;"); > + print "Upgrade to $DBversion done (OpacPrivacy reimplementation)\n"; > + SetVersion($DBversion); > +}; > + > =head1 FUNCTIONS > > =head2 DropAllForeignKeys($table) > diff --git > a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref > b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref > index 8707c25..3014e63 100644 > --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref > +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref > @@ -202,12 +202,6 @@ OPAC: > no: "Don't allow" > - patrons to store items in a temporary "Cart" on the OPAC. > - > - - pref: opacreadinghistory > - choices: > - yes: Allow > - no: "Don't allow" > - - patrons to see what books they have checked out in the past. > - - > - pref: OpacTopissue > choices: > yes: Allow > @@ -245,12 +239,6 @@ OPAC: > yes: Limit > no: "Don't limit" > - "patrons' searches to the library they are registered at." > - - > - - pref: AnonSuggestions > - choices: > - yes: Allow > - no: "Don't allow" > - - "patrons that aren't logged in to make purchase > suggestions." > # - > # This system preference does not actually affect anything > # - pref: OpacBrowser > @@ -288,12 +276,37 @@ OPAC: > - purchase suggestions from other patrons on the OPAC. > Privacy: > - > + - pref: AnonSuggestions > + choices: > + yes: Allow > + no: "Don't allow" > + - "patrons that aren't logged in to make purchase suggestions. > Suggestions are connected to the AnonymousPatron syspref" > + - > + - pref: opacreadinghistory > + choices: > + yes: Allow > + no: "Don't allow" > + - patrons to see what books they have checked out in the past. > + - > - pref: EnableOpacSearchHistory > default: 0 > choices: > yes: Keep > no: "Don't keep" > - patron search history in the OPAC. > + - > + - pref: OPACPrivacy > + default: 0 > + choices: > + yes: Allow > + no: "Don't allow" > + - patrons to choose their own privacy settings for their > reading history. This requires opacreadinghistory and AnonymousPatron > + - > + - Use borrowernumber > + - pref: AnonymousPatron > + class: integer > + - as the Anonymous Patron (for anonymous suggestions and > reading history) > + > Shelf Browser: > - > - pref: OPACShelfBrowser > diff --git > a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl > b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl > index 030c78a..2cdc13a 100644 > --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl > +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl > @@ -320,6 +320,11 @@ function validate1(date) { > >
  • Library:
  • > > +
  • Privacy > Pref: > + Forever > + Default > + Never > +
  • >
  • Sort field > 1:
  • >
  • Sort field > 2:
  • >
  • OPAC login:
  • > diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc > b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc > index b9e4f74..86ba2f6 100644 > --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc > +++ b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc > @@ -17,6 +17,9 @@ > > >
  • my > reading history
  • > + > +
  • my > privacy
  • > + > > > > diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl > b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl > new file mode 100644 > index 0000000..92c8973 > --- /dev/null > +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl > @@ -0,0 +1,72 @@ > +Koha Online Catalog › Privacy > management for > + > + > + > +
    > +
    > + > + > +
    > +
    > +
    > +

    's account src="l../../images/caret.gif" width="16" > height="16" alt=">" border="0" /> Privacy policy

    > + > + > +
    Your reading history has been > deleted.
    > + > + > +
    Your privacy rules have been > updated
    > + > + > +

    Privacy rule

    > + > +

    We take great care in protecting your privacy. On this > screen, you can define how long we keep your reading history.

    > +

    Your options are:

    > +

    id="opac-privacy-update-form"> > + > +
      > +
    • Forever: keep my reading history > without limit. This is the option for users who want to keep track of what > they are reading.
    • > +
    • Default: keep my reading history > according to local laws. This is the default option : the library will keep > your reading history for the duration permitted by local laws.
    • > +
    • Never: Delete my reading history > immediately. This will delete all record of the item that was checked-out > upon check-in.
    • > +
    > +

    Please note that information on any book still > checked-out must be kept by the library no matter which privacy option you > choose.

    > +

    Please also note that the library staff can't > update these values for you: it's your privacy!

    > + > + > + > +
    > +

    Immediate deletion

    > +
    id="opac-privacy-delete-form"> > + > +

    Whatever your privacy rule you choose, you can delete all > your reading history immediately by clicking here. BE CAREFUL. Once > you've confirmed the deletion, no one can retrieve the list!

    > + onclick="return confirmDelete(_('Warning: Cannot be undone. Please confirm > once again'));" /> > +
    > + > +
    > +
    > +
    > +
    > +
    > +
    > + > + > +
    > +
    > +
    > + > diff --git a/members/moremember.pl b/members/moremember.pl > index 7de3fb0..ac98e1e 100755 > --- a/members/moremember.pl > +++ b/members/moremember.pl > @@ -230,6 +230,12 @@ my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'} > ); > $template->param( lib1 => $lib1 ) if ($lib1); > $template->param( lib2 => $lib2 ) if ($lib2); > > +# Show OPAC privacy preference is system preference is set > +if ( C4::Context->preference('OPACPrivacy') ) { > + $template->param( OPACPrivacy => 1); > + $template->param( "privacy".$data->{'privacy'} => 1); > +} > + > # current issues > # > my $issue = GetPendingIssues($borrowernumber); > diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl > new file mode 100755 > index 0000000..ca50560 > --- /dev/null > +++ b/opac/opac-privacy.pl > @@ -0,0 +1,68 @@ > +#!/usr/bin/perl > +# This script lets the users change their privacy rules > +# > +# copyright 2009, BibLibre, paul.poulain at biblibre.com > +# > +# Koha is free software; you can redistribute it and/or modify it under > the > +# terms of the GNU General Public License as published by the Free > Software > +# Foundation; either version 2 of the License, or (at your option) any > later > +# version. > +# > +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY > +# WARRANTY; without even the implied warranty of MERCHANTABILITY or > FITNESS FOR > +# A PARTICULAR PURPOSE. See the GNU General Public License for more > details. > +# > +# You should have received a copy of the GNU General Public License along > with > +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple > Place, > +# Suite 330, Boston, MA 02111-1307 USA > + > +use strict; > +use CGI; > + > +use C4::Auth; # checkauth, getborrowernumber. > +use C4::Context; > +use C4::Circulation; > +use C4::Members; > +use C4::Output; > +use C4::Dates; > + > +my $query = new CGI; > +my $dbh = C4::Context->dbh; > + > +my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > + { > + template_name => "opac-privacy.tmpl", > + query => $query, > + type => "opac", > + authnotrequired => 0, > + flagsrequired => { borrow => 1 }, > + debug => 1, > + } > +); > + > +my $op = $query->param("op"); > +my $privacy = $query->param("privacy"); > + > +if ($op eq "update_privacy") > +{ > + ModPrivacy($borrowernumber,$privacy); > + $template->param('privacy_updated' => 1); > +} > +if ($op eq "delete_record") { > + # delete all reading records for items returned > + # uses a hardcoded date ridiculously far in the future > + AnonymiseIssueHistory('2999-12-12',$borrowernumber); > + # confirm the user the deletion has been done > + $template->param('deleted' => 1); > +} > +# get borrower privacy .... > +my ( $borr ) = GetMemberDetails( $borrowernumber ); > + > +$template->param( 'Ask_data' => '1', > + 'privacy'.$borr->{'privacy'} => 1, > + 'firstname' => $borr->{'firstname'}, > + 'surname' => $borr->{'surname'}, > + 'privacyview' => 1, > +); > + > +output_html_with_http_headers $query, $cookie, $template->output; > diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl > index a2a6670..2f0dc36 100755 > --- a/opac/opac-suggestions.pl > +++ b/opac/opac-suggestions.pl > @@ -48,7 +48,7 @@ if ( C4::Context->preference("AnonSuggestions") ) { > } > ); > if ( !$$suggestion{suggestedby} ) { > - $$suggestion{suggestedby} = > C4::Context->preference("AnonSuggestions"); > + $$suggestion{suggestedby} = > C4::Context->preference("AnonymousPatron"); > } > } > else { > -- > 1.5.6.5 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisc at catalyst.net.nz Tue Feb 1 20:55:07 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 2 Feb 2011 08:55:07 +1300 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3881: OPAC Privacy reimplementation In-Reply-To: References: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <20110201195507.GC27877@rorohiko> Hi Chris I don't think you want to pull this new feature to 3.2.x anyway ;) Chris -- Chris Cormack Catalyst IT Ltd. +64 4 803 2238 PO Box 11-053, Manners St, Wellington 6142, New Zealand -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From cnighswonger at foundations.edu Tue Feb 1 21:10:24 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Tue, 1 Feb 2011 15:10:24 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3881: OPAC Privacy reimplementation In-Reply-To: <20110201195507.GC27877@rorohiko> References: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> <20110201195507.GC27877@rorohiko> Message-ID: Sorry, I missed that one... :-) Please disregard.... On Tue, Feb 1, 2011 at 2:55 PM, Chris Cormack wrote: > Hi Chris > > I don't think you want to pull this new feature to 3.2.x anyway ;) > > Chris > -- > Chris Cormack > Catalyst IT Ltd. > +64 4 803 2238 > PO Box 11-053, Manners St, Wellington 6142, New Zealand > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (GNU/Linux) > > iEYEARECAAYFAk1IZRsACgkQZgbcHEvgMLOaOACffPQoehA7ja+RMjDjZ8I/dtrD > kA4Anj+baW79F9iHB9mu2gCj1jYHTXI+ > =AJLJ > -----END PGP SIGNATURE----- > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisc at catalyst.net.nz Wed Feb 2 05:01:42 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Wed, 2 Feb 2011 17:01:42 +1300 Subject: [Koha-patches] [PATCH] NormalizeString POD Fixing and variable renaming Message-ID: <1296619302-19177-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain POD was mistakenly telling that NFD was supposed to be the default encoding In fact, it is not, it is NFC So the variable $nfc to change to the not default encoding was misleading. Renaming it into $nfd (written by hdl) Refactored by Chris Cormack --- C4/Charset.pm | 20 +++++++++++--------- 1 files changed, 11 insertions(+), 9 deletions(-) diff --git a/C4/Charset.pm b/C4/Charset.pm index b3b4b72..712bd85 100644 --- a/C4/Charset.pm +++ b/C4/Charset.pm @@ -33,6 +33,7 @@ BEGIN { require Exporter; @ISA = qw(Exporter); @EXPORT = qw( + NormalizeString IsStringUTF8ish MarcToUTF8Record SetUTF8Flag @@ -148,27 +149,28 @@ sub SetUTF8Flag{ =head2 NormalizeString - my $normalized_string=NormalizeString($string); + my $normalized_string=NormalizeString($string,$nfd,$transform); Given a string - -nfc : If you want to set NFC and not NFD +nfd : If you want to set NFD and not NFC transform : If you expect all the signs to be removed + Sets the PERL UTF8 Flag on your initial data if need be -and applies cleaning if required +and applies cleaning if required -Returns a utf8 NFD normalized string +Returns a utf8 NFC normalized string Sample code : - my $string=NormalizeString ("l'ornithopt??re"); - #results into ornithopt??re in NFD form and sets UTF8 Flag + my $string=NormalizeString ("l'ornithopt??re"); + #results into ornithopt??re in NFC form and sets UTF8 Flag =cut + sub NormalizeString{ - my ($string,$nfc,$transform)=@_; + my ($string,$nfd,$transform)=@_; utf8::decode($string) unless (utf8::is_utf8($string)); - if ($nfc){ + if ($nfd){ $string= NFD($string); } else { -- 1.7.1 From Katrin.Fischer.83 at web.de Wed Feb 2 06:59:36 2011 From: Katrin.Fischer.83 at web.de (Katrin Fischer) Date: Wed, 2 Feb 2011 06:59:36 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 4103 In Pro Adv Search, superlibrarian search always all libraries Message-ID: <1296626376-435-1-git-send-email-Katrin.Fischer.83@web.de> From: Fr?d?ric Demians Now, when 'independantbranches' syspref is activated, 'Individual Libraries' combo list is set by default to the current user branch. It shouldn't be the case for superlibrarian user who is supposed to manage all libraries. Signed-off-by: Katrin Fischer The pull down for 'Individual Libaries' now shows 'All Libraries' as default setting for superlibrarians. Without being superlibrarian home branch is still default. --- catalogue/search.pl | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 8cb737d..b0fea2a 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -207,16 +207,20 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { # load the branches my $branches = GetBranches(); -my @branch_loop; -# we need to know the borrower branch code to set a default branch -my $borrowerbranchcode = C4::Context->userenv->{'branch'}; - -for my $branch_hash (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { - # if independantbranches is activated, set the default branch to the borrower branch - my $selected = (C4::Context->preference("independantbranches") and ($borrowerbranchcode eq $branch_hash)) ? 1 : undef; - push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, selected => $selected}; -} +# Populate branch_loop with all branches sorted by their name. If +# independantbranches is activated, set the default branch to the borrower +# branch, except for superlibrarian who need to search all libraries. +my $user = C4::Context->userenv; +my @branch_loop = map { + { + value => $_, + branchname => $branches->{$_}->{branchname}, + selected => $user->{branch} eq $_ && C4::Branch::onlymine(), + } +} sort { + $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} +} keys %$branches; my $categories = GetBranchCategories(undef,'searchdomain'); -- 1.7.1 From colin.campbell at ptfs-europe.com Wed Feb 2 10:31:19 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Wed, 02 Feb 2011 09:31:19 +0000 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3881: OPAC Privacy reimplementation In-Reply-To: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> References: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> Message-ID: <4D492467.2040107@ptfs-europe.com> On 30/01/11 05:48, Nicole Engard wrote: > From: Ian Walls > > Reimplements Paul Poulain's original OPAC Privacy patch, with some minor improvements and changes to wording > Patch adds privacy attribute to borrowers and deletedborrowers table. This is already done in db changes 3.1.0.72 and 3.3.0.6. Causes error in upgrade Colin -- Colin Campbell Chief Software Engineer, PTFS Europe Limited Content Management and Library Solutions +44 (0) 845 557 5634 (phone) +44 (0) 7759 633626 (mobile) colin.campbell at ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com From gmcharlt at gmail.com Wed Feb 2 15:30:07 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Wed, 2 Feb 2011 09:30:07 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3881: OPAC Privacy reimplementation In-Reply-To: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> References: <1296366516-3342-1-git-send-email-nengard@bywatersolutions.com> Message-ID: Hi, On Sun, Jan 30, 2011 at 12:48 AM, Nicole Engard wrote: > +use strict; > +use CGI; use warnings? Regards, Galen -- Galen Charlton gmcharlt at gmail.com From M.de.Rooy at rijksmuseum.nl Wed Feb 2 16:50:49 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Wed, 2 Feb 2011 15:50:49 +0000 Subject: [Koha-patches] [PATCH] [REVISED] 5622: Improve display of MARC21 773 field in XSLT detail view Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311DBEA1@S-MAIL-1B.rijksmuseum.intra> Applies change to OPAC and staff detail view. Chops punctuation. Adds 773g. Strips MARC org code from URL. Utils code is used as basis for patches #5662 and #5663 too. --- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 10 +++++----- .../intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 18 ++++++++++++++++++ .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 10 +++++----- .../opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 18 ++++++++++++++++++ 4 files changed, 46 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index edaf280..ebc8a86 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -565,19 +565,19 @@ - + at - + - - + /cgi-bin/koha/catalogue/search.pl?q=Control-number: + /cgi-bin/koha/catalogue/search.pl?q=Title: - + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl index d101723..559de13 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl @@ -65,6 +65,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -228,6 +232,7 @@ $(document).ready(function(){
    + " /> " /> " /> " /> @@ -241,6 +246,7 @@ $(document).ready(function(){ + " /> " /> " /> " /> diff --git a/tools/inventory.pl b/tools/inventory.pl index c87a7e9..f8903e5 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -49,6 +49,7 @@ $offset=0 unless $offset; my $pagesize = $input->param('pagesize'); $pagesize=50 unless $pagesize; my $branchcode = $input->param('branchcode'); +my $branch = $input->param('branch'); my $op = $input->param('op'); my $res; #contains the results loop # warn "uploadbarcodes : ".$uploadbarcodes; @@ -129,6 +130,7 @@ $template->param(branchloop => \@branch_loop, location=>$location, ignoreissued=>$ignoreissued, branchcode=>$branchcode, + branch => $branch, offset => $offset, pagesize => $pagesize, datelastseen => $datelastseen, @@ -183,7 +185,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa } } if ($markseen or $op) { - $res = GetItemsForInventory($minlocation,$maxlocation,$location, $ignoreissued,$itemtype,$datelastseen,$branchcode,$offset,$pagesize,$staton); + $res = GetItemsForInventory( $minlocation, $maxlocation, $location, $ignoreissued, $itemtype, $datelastseen, $branchcode, $branch, $offset, $pagesize, $staton ); $template->param(loop =>$res, nextoffset => ($offset+$pagesize), prevoffset => ($offset?$offset-$pagesize:0), -- 1.7.1 From cnighswonger at foundations.edu Thu Feb 3 01:40:10 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Wed, 2 Feb 2011 19:40:10 -0500 Subject: [Koha-patches] [PATCH] Bug 4931: Stocking can be by homebranch or holding branch Message-ID: <1296693610-11333-1-git-send-email-cnighswonger@foundations.edu> From: Chris Cormack Squashed commit of the following: commit 105de81639cbac5084e4a5c099b19569043e69ff Author: Nahuel ANGELINETTI Date: Tue Jul 13 11:58:01 2010 +0200 (bug #4931) fix forgottens input in buttons the previous patch missed an hidden input in next buttons that break next page. This fix it. commit db00295a6b9d1d36fc888ba6a0558011fd6884ba Author: Nahuel ANGELINETTI Date: Fri Jul 2 15:27:59 2010 +0200 (bug #4931) add the ability to choose home or holding branch in stocktaking This add radio box in stocktaking to base it on home or holdingbranch Signed-off-by: Chris Nighswonger Bug 4391 Followup: Adding back lost declaration of $branchcode --- C4/Items.pm | 12 ++++++++---- .../prog/en/modules/tools/inventory.tmpl | 6 ++++++ tools/inventory.pl | 4 +++- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index a7c190c..cc13736 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -954,7 +954,7 @@ $statushash requires a hashref that has the authorized values fieldname (intems. =cut sub GetItemsForInventory { - my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branch, $offset, $size, $statushash ) = @_; + my ( $minlocation, $maxlocation,$location, $itemtype, $ignoreissued, $datelastseen, $branchcode, $branch, $offset, $size, $statushash ) = @_; my $dbh = C4::Context->dbh; my ( @bind_params, @where_strings ); @@ -993,10 +993,14 @@ END_SQL push @where_strings, 'items.location = ?'; push @bind_params, $location; } - - if ( $branch ) { + + if ( $branchcode ) { + if($branch eq "homebranch"){ push @where_strings, 'items.homebranch = ?'; - push @bind_params, $branch; + }else{ + push @where_strings, 'items.holdingbranch = ?'; + } + push @bind_params, $branchcode; } if ( $itemtype ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl index 0b35000..480441d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tmpl @@ -76,6 +76,10 @@ $(document).ready(function(){
    Select items you want to check
    1. + + Home Branch + Holding Branch +
    2. " /> " /> " /> " /> @@ -241,6 +246,7 @@ $(document).ready(function(){ + " /> " /> " /> " /> diff --git a/tools/inventory.pl b/tools/inventory.pl index c87a7e9..f8903e5 100755 --- a/tools/inventory.pl +++ b/tools/inventory.pl @@ -49,6 +49,7 @@ $offset=0 unless $offset; my $pagesize = $input->param('pagesize'); $pagesize=50 unless $pagesize; my $branchcode = $input->param('branchcode'); +my $branch = $input->param('branch'); my $op = $input->param('op'); my $res; #contains the results loop # warn "uploadbarcodes : ".$uploadbarcodes; @@ -129,6 +130,7 @@ $template->param(branchloop => \@branch_loop, location=>$location, ignoreissued=>$ignoreissued, branchcode=>$branchcode, + branch => $branch, offset => $offset, pagesize => $pagesize, datelastseen => $datelastseen, @@ -183,7 +185,7 @@ if ( ! ($uploadbarcodes && length($uploadbarcodes)>0 ) || ( $input->param('compa } } if ($markseen or $op) { - $res = GetItemsForInventory($minlocation,$maxlocation,$location, $ignoreissued,$itemtype,$datelastseen,$branchcode,$offset,$pagesize,$staton); + $res = GetItemsForInventory( $minlocation, $maxlocation, $location, $ignoreissued, $itemtype, $datelastseen, $branchcode, $branch, $offset, $pagesize, $staton ); $template->param(loop =>$res, nextoffset => ($offset+$pagesize), prevoffset => ($offset?$offset-$pagesize:0), -- 1.7.0.4 From cnighswonger at foundations.edu Thu Feb 3 02:32:32 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Wed, 2 Feb 2011 20:32:32 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug: 4263 - Repeatable subfields in items Message-ID: <1296696752-12833-1-git-send-email-cnighswonger@foundations.edu> From: Chris Cormack Squashed commit of the following: commit f441094d5095d165eab18340c983a831cce8f6e0 Author: Henri-Damien LAURENT Date: Mon Jul 5 20:33:23 2010 +0200 bug4263 followup : Can't blank subfields Previous bug4263 reintroduced bug 2466: fix clearing item field This keeps bug4263 followup to be assigned (donot blank dateaccessioned) But also allow to blank item subfields. commit 92889b766c41b48bdd0e3a33ca4b183b1e259805 Author: Nahuel ANGELINETTI Date: Fri Apr 23 13:54:30 2010 +0200 (bug #4263) dateaccessionned is cleaned on item modification Every item modification, date accessionned is cleaned, if there is no modification made, we must'nt reset to "undef" the value. commit 5abb2db16b2564d32e84b7cc680acbc301d73179 Author: Nahuel ANGELINETTI Date: Tue Mar 2 09:57:33 2010 +0100 (bug #4263) fix the edition of items with repeatable subfields The subfield management in item level is broken, fields are concatenated in one field, and if the librarian edit it, the values are not selected. This big patch fix three things: 1) saving fields that are stocked in SQL(using koha2marc mapping) are now well cut and separated in _REAL_ subfields 2) loading records with repeatable subfields are now well returned 3) Editing items with repeatable fields works well Signed-off-by: Chris Nighswonger Bug 4263 Removing extranious block of code --- C4/Biblio.pm | 11 +- C4/Items.pm | 37 +++-- cataloguing/additem.pl | 443 +++++++++++++++++++++++++----------------------- 3 files changed, 268 insertions(+), 223 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index b151d71..7eb3124 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1680,13 +1680,18 @@ sub TransformKohaToMarcOneField { } $sth->execute( $frameworkcode, $kohafieldname ); if ( ( $tagfield, $tagsubfield ) = $sth->fetchrow ) { + my @values = split(/\s?\|\s?/, $value, -1); + + foreach my $itemvalue (@values){ my $tag = $record->field($tagfield); if ($tag) { - $tag->update( $tagsubfield => $value ); + $tag->add_subfields( $tagsubfield => $itemvalue ); $record->delete_field($tag); $record->insert_fields_ordered($tag); - } else { - $record->add_fields( $tagfield, " ", " ", $tagsubfield => $value ); + } + else { + $record->add_fields( $tagfield, " ", " ", $tagsubfield => $itemvalue ); + } } } return $record; diff --git a/C4/Items.pm b/C4/Items.pm index a7c190c..80877ca 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -402,7 +402,7 @@ my %default_values_for_mod_from_marc = ( 'items.cn_source' => undef, copynumber => undef, damaged => 0, - dateaccessioned => undef, +# dateaccessioned => undef, enumchron => undef, holdingbranch => undef, homebranch => undef, @@ -429,6 +429,18 @@ sub ModItemFromMarc { my $biblionumber = shift; my $itemnumber = shift; + my $dbh = C4::Context->dbh; + my $frameworkcode = GetFrameworkCode($biblionumber); + my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField( "items.itemnumber", $frameworkcode ); + + my $localitemmarc = MARC::Record->new; + $localitemmarc->append_fields( $item_marc->field($itemtag) ); + my $item = &TransformMarcToKoha( $dbh, $localitemmarc, $frameworkcode, 'items' ); + foreach my $item_field ( keys %default_values_for_mod_from_marc ) { + $item->{$item_field} = $default_values_for_mod_from_marc{$item_field} unless (exists $item->{$item_field}); + } + my $unlinked_item_subfields = _get_unlinked_item_subfields( $localitemmarc, $frameworkcode ); + my $dbh = C4::Context->dbh; my $frameworkcode = GetFrameworkCode( $biblionumber ); my ($itemtag,$itemsubfield)=GetMarcFromKohaField("items.itemnumber",$frameworkcode); @@ -2136,17 +2148,20 @@ sub _marc_from_item_hash { : () } keys %{ $item } }; my $item_marc = MARC::Record->new(); - foreach my $item_field (keys %{ $mungeditem }) { - my ($tag, $subfield) = GetMarcFromKohaField($item_field, $frameworkcode); - next unless defined $tag and defined $subfield; # skip if not mapped to MARC field - if (my $field = $item_marc->field($tag)) { - $field->add_subfields($subfield => $mungeditem->{$item_field}); - } else { - my $add_subfields = []; - if (defined $unlinked_item_subfields and ref($unlinked_item_subfields) eq 'ARRAY' and $#$unlinked_item_subfields > -1) { - $add_subfields = $unlinked_item_subfields; + foreach my $item_field ( keys %{$mungeditem} ) { + my ( $tag, $subfield ) = GetMarcFromKohaField( $item_field, $frameworkcode ); + next unless defined $tag and defined $subfield; # skip if not mapped to MARC field + my @values = split(/\s?\|\s?/, $mungeditem->{$item_field}, -1); + foreach my $value (@values){ + if ( my $field = $item_marc->field($tag) ) { + $field->add_subfields( $subfield => $value ); + } else { + my $add_subfields = []; + if (defined $unlinked_item_subfields and ref($unlinked_item_subfields) eq 'ARRAY' and $#$unlinked_item_subfields > -1) { + $add_subfields = $unlinked_item_subfields; + } + $item_marc->add_fields( $tag, " ", " ", $subfield => $value, @$add_subfields ); } - $item_marc->add_fields( $tag, " ", " ", $subfield => $mungeditem->{$item_field}, @$add_subfields); } } diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl index 6dc190a..b79e7f5 100755 --- a/cataloguing/additem.pl +++ b/cataloguing/additem.pl @@ -30,6 +30,7 @@ use C4::Koha; # XXX subfield_is_koha_internal_p use C4::Branch; # XXX subfield_is_koha_internal_p use C4::ClassSource; use C4::Dates; +use List::MoreUtils qw/any/; use MARC::File::XML; @@ -91,7 +92,176 @@ sub _increment_barcode { } -my $input = new CGI; +sub generate_subfield_form { + my ($tag, $subfieldtag, $value, $tagslib,$subfieldlib, $branches, $today_iso, $biblionumber, $temp, $loop_data, $i) = @_; + + my %subfield_data; + my $dbh = C4::Context->dbh; + my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib"); + + my $index_subfield = int(rand(1000000)); + if ($subfieldtag eq '@'){ + $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_subfield; + } else { + $subfield_data{id} = "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield; + } + + $subfield_data{tag} = $tag; + $subfield_data{subfield} = $subfieldtag; + $subfield_data{random} = int(rand(1000000)); # why do we need 2 different randoms? + $subfield_data{marc_lib} ="{lib}."\">".$subfieldlib->{lib}.""; + $subfield_data{mandatory} = $subfieldlib->{mandatory}; + $subfield_data{repeatable} = $subfieldlib->{repeatable}; + + $value =~ s/"/"/g; + if ( ! defined( $value ) || $value eq '') { + $value = $subfieldlib->{defaultvalue}; + # get today date & replace YYYY, MM, DD if provided in the default value + my ( $year, $month, $day ) = split ',', $today_iso; # FIXME: iso dates don't have commas! + $value =~ s/YYYY/$year/g; + $value =~ s/MM/$month/g; + $value =~ s/DD/$day/g; + } + + $subfield_data{visibility} = "display:none;" if (($subfieldlib->{hidden} > 4) || ($subfieldlib->{hidden} < -4)); + + my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); + if (!$value && $subfieldlib->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) { + my $CNtag = substr($pref_itemcallnumber, 0, 3); + my $CNsubfield = substr($pref_itemcallnumber, 3, 1); + my $CNsubfield2 = substr($pref_itemcallnumber, 4, 1); + my $temp2 = $temp->field($CNtag); + if ($temp2) { + $value = ($temp2->subfield($CNsubfield)).' '.($temp2->subfield($CNsubfield2)); + #remove any trailing space incase one subfield is used + $value =~ s/^\s+|\s+$//g; + } + } + + my $attributes_no_value = qq(tabindex="1" id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" ); + my $attributes = qq($attributes_no_value value="$value" ); + + if ( $subfieldlib->{authorised_value} ) { + my @authorised_values; + my %authorised_lib; + # builds list, depending on authorised value... + if ( $subfieldlib->{authorised_value} eq "branches" ) { + foreach my $thisbranch (@$branches) { + push @authorised_values, $thisbranch->{value}; + $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname}; + $value = $thisbranch->{value} if $thisbranch->{selected}; + } + } + elsif ( $subfieldlib->{authorised_value} eq "itemtypes" ) { + push @authorised_values, "" unless ( $subfieldlib->{mandatory} ); + my $sth = $dbh->prepare("SELECT itemtype,description FROM itemtypes ORDER BY description"); + $sth->execute; + while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) { + push @authorised_values, $itemtype; + $authorised_lib{$itemtype} = $description; + } + + unless ( $value ) { + my $itype_sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); + $itype_sth->execute( $biblionumber ); + ( $value ) = $itype_sth->fetchrow_array; + } + + #---- class_sources + } + elsif ( $subfieldlib->{authorised_value} eq "cn_source" ) { + push @authorised_values, "" unless ( $subfieldlib->{mandatory} ); + + my $class_sources = GetClassSources(); + my $default_source = C4::Context->preference("DefaultClassificationSource"); + + foreach my $class_source (sort keys %$class_sources) { + next unless $class_sources->{$class_source}->{'used'} or + ($value and $class_source eq $value) or + ($class_source eq $default_source); + push @authorised_values, $class_source; + $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'}; + } + $value = $default_source unless ($value); + + #---- "true" authorised value + } + else { + push @authorised_values, "" unless ( $subfieldlib->{mandatory} ); + $authorised_values_sth->execute( $subfieldlib->{authorised_value} ); + while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { + push @authorised_values, $value; + $authorised_lib{$value} = $lib; + } + } + + $subfield_data{marc_value} =CGI::scrolling_list( # FIXME: factor out scrolling_list + -name => "field_value", + -values => \@authorised_values, + -default => $value, + -labels => \%authorised_lib, + -override => 1, + -size => 1, + -multiple => 0, + -tabindex => 1, + -id => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield, + -class => "input_marceditor", + ); + + # it's a thesaurus / authority field + } + elsif ( $subfieldlib->{authtypecode} ) { + $subfield_data{marc_value} = " + {authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">... + "; + # it's a plugin field + } + elsif ( $subfieldlib->{value_builder} ) { + # opening plugin + my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $subfieldlib->{'value_builder'}; + if (do $plugin) { + my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data ); + my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data ); + my $change = index($javascript, 'function Change') > -1 ? + "return Change$function_name($subfield_data{random}, '$subfield_data{id}');" : + 'return 1;'; + $subfield_data{marc_value} = qq[ + ... + $javascript]; + } else { + warn "Plugin Failed: $plugin"; + $subfield_data{marc_value} = ""; # supply default input form + } + } + elsif ( $tag eq '' ) { # it's an hidden field + $subfield_data{marc_value} = qq(); + } + elsif ( $subfieldlib->{'hidden'} ) { # FIXME: shouldn't input type be "hidden" ? + $subfield_data{marc_value} = qq(); + } + elsif ( length($value) > 100 + or (C4::Context->preference("marcflavour") eq "UNIMARC" and + 300 <= $tag && $tag < 400 && $subfieldtag eq 'a' ) + or (C4::Context->preference("marcflavour") eq "MARC21" and + 500 <= $tag && $tag < 600 ) + ) { + # oversize field (textarea) + $subfield_data{marc_value} = "\n"; + } else { + # it's a standard field + $subfield_data{marc_value} = ""; + } + + return \%subfield_data; +} + + +my $input = new CGI; +my $dbh = C4::Context->dbh; my $error = $input->param('error'); my $biblionumber = $input->param('biblionumber'); my $itemnumber = $input->param('itemnumber'); @@ -318,30 +488,35 @@ my ( $itemtagfield, $itemtagsubfield) = &GetMarcFromKohaField("items.itemnumb my ($branchtagfield, $branchtagsubfield) = &GetMarcFromKohaField("items.homebranch", $frameworkcode); foreach my $field (@fields) { - next if ($field->tag()<10); - my @subf = $field->subfields or (); # don't use ||, as that forces $field->subfelds to be interpreted in scalar context + next if ( $field->tag() < 10 ); + + my @subf = $field->subfields or (); # don't use ||, as that forces $field->subfelds to be interpreted in scalar context my %this_row; -# loop through each subfield - for my $i (0..$#subf) { - next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} ne 10 - && ($field->tag() ne $itemtagfield - && $subf[$i][0] ne $itemtagsubfield)); + # loop through each subfield + my $i = 0; + foreach my $subfield (@subf){ + my $subfieldcode = $subfield->[0]; + my $subfieldvalue= $subfield->[1]; - $witness{$subf[$i][0]} = $tagslib->{$field->tag()}->{$subf[$i][0]}->{lib} if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} eq 10); - if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} eq 10) { - $this_row{$subf[$i][0]}=GetAuthorisedValueDesc( $field->tag(), - $subf[$i][0], $subf[$i][1], '', $tagslib) - || $subf[$i][1]; - } + next if ($tagslib->{$field->tag()}->{$subfieldcode}->{tab} ne 10 + && ($field->tag() ne $itemtagfield + && $subfieldcode ne $itemtagsubfield)); + $witness{$subfieldcode} = $tagslib->{$field->tag()}->{$subfieldcode}->{lib} if ($tagslib->{$field->tag()}->{$subfieldcode}->{tab} eq 10); + if ($tagslib->{$field->tag()}->{$subfieldcode}->{tab} eq 10) { + $this_row{$subfieldcode} .= " | " if($this_row{$subfieldcode}); + $this_row{$subfieldcode} .= GetAuthorisedValueDesc( $field->tag(), + $subfieldcode, $subfieldvalue, '', $tagslib) + || $subfieldvalue; + } - if (($field->tag eq $branchtagfield) && ($subf[$i][$0] eq $branchtagsubfield) && C4::Context->preference("IndependantBranches")) { + if (($field->tag eq $branchtagfield) && ($subfieldcode eq $branchtagsubfield) && C4::Context->preference("IndependantBranches")) { #verifying rights my $userenv = C4::Context->userenv(); - unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $subf[$i][1]))){ - $this_row{'nomod'}=1; + unless (($userenv->{'flags'} == 1) or (($userenv->{'branch'} eq $subfieldvalue))){ + $this_row{'nomod'} = 1; } } - $this_row{itemnumber} = $subf[$i][1] if ($field->tag() eq $itemtagfield && $subf[$i][0] eq $itemtagsubfield); + $this_row{itemnumber} = $subfieldvalue if ($field->tag() eq $itemtagfield && $subfieldcode eq $itemtagsubfield); } if (%this_row) { push(@big_array, \%this_row); @@ -374,202 +549,52 @@ foreach my $subfield_code (sort keys(%witness)) { my @loop_data =(); my $i=0; -my $branches = GetBranchesLoop(); # build once ahead of time, instead of multiple times later. my $pref_itemcallnumber = C4::Context->preference('itemcallnumber'); -# Getting the fields where the item location is -my ($location_field, $location_subfield) = GetMarcFromKohaField('items.location', $frameworkcode); - -# Getting the name of the authorised values' category for item location -my $item_location_category = $tagslib->{$location_field}->{$location_subfield}->{'authorised_value'}; - -foreach my $tag (sort keys %{$tagslib}) { -# loop through each subfield - foreach my $subfield (sort keys %{$tagslib->{$tag}}) { - next if subfield_is_koha_internal_p($subfield); - next if ($tagslib->{$tag}->{$subfield}->{'tab'} ne "10"); - my %subfield_data; - - my $index_subfield = int(rand(1000000)); - if ($subfield eq '@'){ - $subfield_data{id} = "tag_".$tag."_subfield_00_".$index_subfield; - } else { - $subfield_data{id} = "tag_".$tag."_subfield_".$subfield."_".$index_subfield; - } - $subfield_data{tag} = $tag; - $subfield_data{subfield} = $subfield; - $subfield_data{random} = int(rand(1000000)); # why do we need 2 different randoms? -# $subfield_data{marc_lib} = $tagslib->{$tag}->{$subfield}->{lib}; - $subfield_data{marc_lib} ="{$tag}->{$subfield}->{lib}."\">".$tagslib->{$tag}->{$subfield}->{lib}.""; - $subfield_data{mandatory} = $tagslib->{$tag}->{$subfield}->{mandatory}; - $subfield_data{repeatable} = $tagslib->{$tag}->{$subfield}->{repeatable}; - my ($x,$value); - ($x,$value) = find_value($tag,$subfield,$itemrecord) if ($itemrecord); - $value =~ s/"/"/g; - unless ($value) { - $value = $tagslib->{$tag}->{$subfield}->{defaultvalue}; - # get today date & replace YYYY, MM, DD if provided in the default value - my ( $year, $month, $day ) = split ',', $today_iso; # FIXME: iso dates don't have commas! - $value =~ s/YYYY/$year/g; - $value =~ s/MM/$month/g; - $value =~ s/DD/$day/g; - } - $subfield_data{visibility} = "display:none;" if (($tagslib->{$tag}->{$subfield}->{hidden} > 4) || ($tagslib->{$tag}->{$subfield}->{hidden} < -4)); - # testing branch value if IndependantBranches. - if (!$value && $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.itemcallnumber' && $pref_itemcallnumber) { - my $CNtag = substr($pref_itemcallnumber, 0, 3); - my $CNsubfield = substr($pref_itemcallnumber, 3, 1); - my $CNsubfield2 = substr($pref_itemcallnumber, 4, 1); - my $temp2 = $temp->field($CNtag); - if ($temp2) { - $value = ($temp2->subfield($CNsubfield)).' '.($temp2->subfield($CNsubfield2)); - #remove any trailing space incase one subfield is used - $value =~ s/^\s+|\s+$//g; - } - } +my $onlymine = C4::Context->preference('IndependantBranches') && + C4::Context->userenv && + C4::Context->userenv->{flags}!=1 && + C4::Context->userenv->{branch}; +my $branches = GetBranchesLoop(undef,$onlymine); # build once ahead of time, instead of multiple times later. - my $attributes_no_value = qq(id="$subfield_data{id}" name="field_value" class="input_marceditor" size="67" maxlength="255" ); - my $attributes = qq($attributes_no_value value="$value" ); - if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) { - my @authorised_values; - my %authorised_lib; - # builds list, depending on authorised value... - - if ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "branches" ) { - foreach my $thisbranch (@$branches) { - push @authorised_values, $thisbranch->{value}; - $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname}; - # in edit item this is set to the data value otherwise use default - if ($op ne 'edititem' && $thisbranch->{selected} ) { - $value = $thisbranch->{value}; - } - } - } - elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) { - push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); - my $sth = $dbh->prepare("select itemtype,description from itemtypes order by description"); - $sth->execute; - while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) { - push @authorised_values, $itemtype; - $authorised_lib{$itemtype} = $description; - } - - unless ( $value ) { - my $itype_sth = $dbh->prepare("SELECT itemtype FROM biblioitems WHERE biblionumber = ?"); - $itype_sth->execute( $biblionumber ); - ( $value ) = $itype_sth->fetchrow_array; - } - - #---- class_sources - } - elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "cn_source" ) { - push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); - - my $class_sources = GetClassSources(); - my $default_source = C4::Context->preference("DefaultClassificationSource"); - - foreach my $class_source (sort keys %$class_sources) { - next unless $class_sources->{$class_source}->{'used'} or - ($value and $class_source eq $value) or - ($class_source eq $default_source); - push @authorised_values, $class_source; - $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'}; - } - $value = $default_source unless ($value); - - #---- "true" authorised value - } - else { - push @authorised_values, "" unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); - - # Are we dealing with item location ? - my $item_location = ($tagslib->{$tag}->{$subfield}->{authorised_value} eq $item_location_category) ? 1 : 0; - - # If so, we sort by authorised_value, else by libelle - my $orderby = $item_location ? 'authorised_value' : 'lib'; - - my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY $orderby"); - - $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value}); - - - while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { - push @authorised_values, $value; - if ($tagslib->{$tag}->{$subfield}->{authorised_value} eq $item_location_category) { - $authorised_lib{$value} = $value . " - " . $lib; - } else { - $authorised_lib{$value} = $lib; - } - - # For item location, we show the code and the libelle - $authorised_lib{$value} = ($item_location) ? $value . " - " . $lib : $lib; - } - } - $subfield_data{marc_value} =CGI::scrolling_list( # FIXME: factor out scrolling_list - -name => "field_value", - -values => \@authorised_values, - -default => $value, - -labels => \%authorised_lib, - -override => 1, - -size => 1, - -multiple => 0, - # -tabindex => 1, - -id => "tag_".$tag."_subfield_".$subfield."_".$index_subfield, - -class => "input_marceditor", - ); - # it's a thesaurus / authority field - } - elsif ( $tagslib->{$tag}->{$subfield}->{authtypecode} ) { - $subfield_data{marc_value} = " - {$tag}->{$subfield}->{authtypecode}."&index=$subfield_data{id}','$subfield_data{id}'); return false;\" title=\"Tag Editor\">... - "; - # it's a plugin field - } - elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) { - # opening plugin - my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'}; - if (do $plugin) { - my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data ); - my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data ); - my $change = index($javascript, 'function Change') > -1 ? - "return Change$function_name($subfield_data{random}, '$subfield_data{id}');" : - 'return 1;'; - $subfield_data{marc_value} = qq[ - ... - $javascript]; - } else { - warn "Plugin Failed: $plugin"; - $subfield_data{marc_value} = ""; # supply default input form - } - } - elsif ( $tag eq '' ) { # it's an hidden field - $subfield_data{marc_value} = qq(); - } - elsif ( $tagslib->{$tag}->{$subfield}->{'hidden'} ) { # FIXME: shouldn't input type be "hidden" ? - $subfield_data{marc_value} = qq(); - } - elsif ( length($value) > 100 - or (C4::Context->preference("marcflavour") eq "UNIMARC" and - 300 <= $tag && $tag < 400 && $subfield eq 'a' ) - or (C4::Context->preference("marcflavour") eq "MARC21" and - 500 <= $tag && $tag < 600 ) - ) { - # oversize field (textarea) - $subfield_data{marc_value} = "\n"; - } else { - # it's a standard field - $subfield_data{marc_value} = ""; +# We generate form, from actuel record +my @fields; +if($itemrecord){ + foreach my $field ($itemrecord->fields()){ + my $tag = $field->{_tag}; + foreach my $subfield ( $field->subfields() ){ + + my $subfieldtag = $subfield->[0]; + my $value = $subfield->[1]; + my $subfieldlib = $tagslib->{$tag}->{$subfieldtag}; + + next if subfield_is_koha_internal_p($subfieldtag); + next if ($tagslib->{$tag}->{$subfieldtag}->{'tab'} ne "10"); + + my $subfield_data = generate_subfield_form($tag, $subfieldtag, $value, $tagslib, $subfieldlib, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); + + push @fields, "$tag$subfieldtag"; + push (@loop_data, $subfield_data); + $i++; + } + + } + } + # and now we add fields that are empty + +foreach my $tag ( keys %{$tagslib}){ + foreach my $subtag (keys %{$tagslib->{$tag}}){ + next if subfield_is_koha_internal_p($subtag); + next if ($tagslib->{$tag}->{$subtag}->{'tab'} ne "10"); + next if any { /^$tag$subtag$/ } @fields; + + my $value = ""; + my $subfield_data = generate_subfield_form($tag, $subtag, $value, $tagslib, $tagslib->{$tag}->{$subtag}, $branches, $today_iso, $biblionumber, $temp, \@loop_data, $i); + + push (@loop_data, $subfield_data); + $i++; } -# $subfield_data{marc_value}=""; - push (@loop_data, \%subfield_data); - $i++ } -} - # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit. $template->param( title => $record->title() ) if ($record ne "-1"); $template->param( -- 1.7.0.4 From f.demians at tamil.fr Thu Feb 3 10:54:20 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Thu, 3 Feb 2011 10:54:20 +0100 Subject: [Koha-patches] [PATCH] Bug 3212 Follow up Message-ID: <1296726860-6727-1-git-send-email-f.demians@tamil.fr> Fix a syntax error --- C4/Biblio.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index c3615ba..0c32d60 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1930,7 +1930,7 @@ sub TransformHtmlToMarc { length( $cgi->param($params->[$j+1]) ) == 24 ? $cgi->param( $params->[ $j + 1 ] ) : ' nam a22 4500' - ; + ); # between 001 and 009 (included) } elsif ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { $newfield = MARC::Field->new( $tag, $cgi->param( $params->[ $j + 1 ] ), ); -- 1.7.3.5 From colin.campbell at ptfs-europe.com Thu Feb 3 11:33:23 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Thu, 03 Feb 2011 10:33:23 +0000 Subject: [Koha-patches] Request to Pull Message-ID: <4D4A8473.9020809@ptfs-europe.com> The branch bug_5462_signoff on git://github.com/colinsc/koha.git is the branch new/awaiting_qa/bug_5462 rebased against current HEAD. -- Colin Campbell Chief Software Engineer, PTFS Europe Limited Content Management and Library Solutions +44 (0) 845 557 5634 (phone) +44 (0) 7759 633626 (mobile) colin.campbell at ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com From M.de.Rooy at rijksmuseum.nl Thu Feb 3 13:02:35 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Thu, 3 Feb 2011 12:02:35 +0000 Subject: [Koha-patches] [PATCH] Bug 5687: Add pref StaffAuthorisedValueImages for staff search results Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311DC100@S-MAIL-1B.rijksmuseum.intra> This patch contains the functionality, not the install stuff. --- catalogue/search.pl | 3 +++ .../en/modules/admin/preferences/staff-client.pref | 6 ++++++ .../prog/en/modules/catalogue/results.tmpl | 4 ++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 8cb737d..ec5015c 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -538,6 +538,9 @@ for (my $i=0;$i<@servers;$i++) { } exit; } + unless(C4::Context->preference("StaffAuthorisedValueImages")) { + $_->{noauthimg}=1 for @newresults; #enh 5687 + } if ($hits) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff-client.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff-client.pref index ab546f1..a95eb8b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff-client.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff-client.pref @@ -63,6 +63,12 @@ Staff Client: choices: local: "included with Koha (faster, will work if internet goes down)." "http://yui.yahooapis.com/2.5.1/build": "from Yahoo's own servers (less demand on your servers)." + - + - pref: StaffAuthorisedValueImages + choices: + yes: Show + no: "Don't show" + - images for authorized values (such as lost statuses and locations) in search results. Options: - - pref: viewMARC diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index 592f3f4..ff2c687 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -438,7 +438,7 @@ function GetZ3950Terms(){

      - +

      " alt="" /> @@ -446,7 +446,7 @@ function GetZ3950Terms(){

      - +

      No holds allowed -- 1.6.0.6 From M.de.Rooy at rijksmuseum.nl Thu Feb 3 13:02:50 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Thu, 3 Feb 2011 12:02:50 +0000 Subject: [Koha-patches] [PATCH] Bug 5687: Add pref StaffAuthorisedValueImages for staff search results Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311DC10B@S-MAIL-1B.rijksmuseum.intra> This patch contains only the install stuff. (Functionality in previous patch.) --- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..1bbcc64 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,3 +285,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('StaffAuthorisedValueImages','1','',NULL,'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4618636..d8ce9ed 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3987,6 +3987,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.03.00.999'; #FIXME: Change this number!! +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('StaffAuthorisedValueImages', '1', '', NULL, 'YesNo')"); + print "Upgrade to $DBversion done (System pref StaffAuthorisedValueImages)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) -- 1.6.0.6 From oleonard at myacpl.org Thu Feb 3 16:22:56 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 3 Feb 2011 10:22:56 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5532 - sysprefs editor should show names of saved prefs Message-ID: <1296746576-15542-1-git-send-email-oleonard@myacpl.org> --- .../intranet-tmpl/prog/en/css/preferences.css | 5 +++++ .../intranet-tmpl/prog/en/js/pages/preferences.js | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css b/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css index 095b007..d9fde24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/preferences.css @@ -61,3 +61,8 @@ h3.collapsed { cursor : pointer; padding-left : 12px; } + +.humanMsg strong { + display: block; + font-weight: normal; +} \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js index cbf98b8..06990b1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js @@ -9,7 +9,8 @@ $(document).ready(function() { KOHA.Preferences = { Save: function ( form ) { - data = $( form ).find( '.modified' ).serialize(); + modified_prefs = $( form ).find( '.modified' ); + data = modified_prefs.serialize(); if ( !data ) { humanMsg.displayAlert( 'Nothing to save' ); return; @@ -23,7 +24,13 @@ KOHA.Preferences = { } ); }, Success: function ( form ) { - humanMsg.displayAlert( 'Saved' ); + var msg = ""; + modified_prefs.each(function(){ + var modified_pref = $(this).attr("id"); + modified_pref = modified_pref.replace("pref_",""); + msg += 'Saved preference '+modified_pref+'\n'; + }); + humanMsg.displayAlert(msg); $( form ) .find( '.modified-warning' ).remove().end() -- 1.7.3 From chrisc at catalyst.net.nz Thu Feb 3 16:33:48 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Fri, 4 Feb 2011 04:33:48 +1300 Subject: [Koha-patches] [PATCH] Bug 3212 Follow up In-Reply-To: <1296726860-6727-1-git-send-email-f.demians@tamil.fr> References: <1296726860-6727-1-git-send-email-f.demians@tamil.fr> Message-ID: <20110203153348.GL27877@rorohiko> Thanks for that Frederic, But I have already pushed a fix for it :) Chris * Fr?d?ric Demians (f.demians at tamil.fr) wrote: > Fix a syntax error > --- > C4/Biblio.pm | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/C4/Biblio.pm b/C4/Biblio.pm > index c3615ba..0c32d60 100644 > --- a/C4/Biblio.pm > +++ b/C4/Biblio.pm > @@ -1930,7 +1930,7 @@ sub TransformHtmlToMarc { > length( $cgi->param($params->[$j+1]) ) == 24 > ? $cgi->param( $params->[ $j + 1 ] ) > : ' nam a22 4500' > - ; > + ); > # between 001 and 009 (included) > } elsif ( $cgi->param( $params->[ $j + 1 ] ) ne '' ) { > $newfield = MARC::Field->new( $tag, $cgi->param( $params->[ $j + 1 ] ), ); > -- > 1.7.3.5 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ -- Chris Cormack Catalyst IT Ltd. +64 4 803 2238 PO Box 11-053, Manners St, Wellington 6142, New Zealand -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From oleonard at myacpl.org Thu Feb 3 16:59:13 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 3 Feb 2011 10:59:13 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5689 - System preference notifications are not translatable Message-ID: <1296748753-15676-1-git-send-email-oleonard@myacpl.org> Defining strings in the template so that they can be translated. --- .../intranet-tmpl/prog/en/js/pages/preferences.js | 14 +++++++------- .../prog/en/modules/admin/preferences.tmpl | 12 +++++++++--- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js index cbf98b8..e7d84fd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/pages/preferences.js @@ -11,10 +11,10 @@ KOHA.Preferences = { Save: function ( form ) { data = $( form ).find( '.modified' ).serialize(); if ( !data ) { - humanMsg.displayAlert( 'Nothing to save' ); + humanMsg.displayAlert( MSG_NOTHING_TO_SAVE ); return; } - KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), _( 'Saving...' ) ); + KOHA.AJAX.MarkRunning( $( form ).find( '.save-all' ), _( MSG_SAVING ) ); KOHA.AJAX.Submit( { data: data, url: '/cgi-bin/koha/svc/config/systempreferences/', @@ -38,7 +38,7 @@ $( document ).ready( function () { $( this ).addClass( 'modified' ); var name_cell = $( this ).parents( '.name-row' ).find( '.name-cell' ); if ( !name_cell.find( '.modified-warning' ).length ) - name_cell.append( '(modified)' ); + name_cell.append( '('+MSG_MODIFIED+')' ); KOHA.Preferences.Modified = true; } @@ -54,7 +54,7 @@ $( document ).ready( function () { window.onbeforeunload = function () { if ( KOHA.Preferences.Modified ) { - return _( "You have made changes to system preferences." ); + return MSG_MADE_CHANGES; } } @@ -73,16 +73,16 @@ $( document ).ready( function () { return false; } ).nextAll( 'textarea, input[type=submit]' ).hide().css( { opacity: 0 } ); - $("h3").attr("class","expanded").attr("title",_("Click to expand this section")); + $("h3").attr("class","expanded").attr("title",MSG_CLICK_TO_EXPAND); var collapsible = $(".collapsed,.expanded"); $(collapsible).toggle( function () { - $(this).addClass("collapsed").removeClass("expanded").attr("title",_("Click to expand this section")); + $(this).addClass("collapsed").removeClass("expanded").attr("title",MSG_CLICK_TO_EXPAND); $(this).next("table").hide(); }, function () { - $(this).addClass("expanded").removeClass("collapsed").attr("title",_("Click to collapse this section")); + $(this).addClass("expanded").removeClass("collapsed").attr("title",MSG_CLICK_TO_COLLAPSE); $(this).next("table").show(); } ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl index 3ae0281..06a0592 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences.tmpl @@ -6,15 +6,21 @@ /css/humanmsg.css" /> - - + + -- 1.7.3 From oleonard at myacpl.org Thu Feb 3 20:49:39 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 3 Feb 2011 14:49:39 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5115, Tags JavaScript includes many untranslatable strings Message-ID: <1296762579-17543-1-git-send-email-oleonard@myacpl.org> --- .../opac-tmpl/prog/en/includes/doc-head-close.inc | 16 ++++++++++- koha-tmpl/opac-tmpl/prog/en/js/tags.js | 26 ++++++++++---------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index beda270..d8a4423 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -37,7 +37,6 @@ - - + - - + + -- 1.7.0.4 From cnighswonger at foundations.edu Fri Feb 4 00:01:19 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Thu, 3 Feb 2011 18:01:19 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5690 Message-ID: <1296774079-24271-1-git-send-email-cnighswonger@foundations.edu> From: Henri-Damien LAURENT MT3947: items.timestamp were not updated on edition If items.timestamp is used in the framework and hidden the fact that it is NOT deleted before update is done would input the previous timestamp, which is not the desired behaviour. Signed-off-by: Chris Nighswonger --- C4/Items.pm | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 4ab385c..c0d8701 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -1779,6 +1779,9 @@ sub _do_column_fixes_for_mod { if (exists $item->{'location'} && !exists $item->{'permanent_location'}) { $item->{'permanent_location'} = $item->{'location'}; } + if (exists $item->{'timestamp'}) { + delete $item->{'timestamp'}; + } } =head2 _get_single_item_column -- 1.7.0.4 From cnighswonger at foundations.edu Fri Feb 4 00:47:35 2011 From: cnighswonger at foundations.edu (Chris Nighswonger) Date: Thu, 3 Feb 2011 18:47:35 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5115, Tags JavaScript includes many untranslatable strings Message-ID: <1296776855-24891-1-git-send-email-cnighswonger@foundations.edu> From: Owen Leonard Signed-off-by: Chris Nighswonger --- .../opac-tmpl/prog/en/includes/doc-head-close.inc | 16 ++++++++++- koha-tmpl/opac-tmpl/prog/en/js/tags.js | 26 ++++++++++---------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc index beda270..d8a4423 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc @@ -37,7 +37,6 @@ - - + +"; + + return ( $function_name, $res ); +} + +sub plugin { + my ($input) = @_; + my $index = $input->param('index'); + my $result = $input->param('result'); + my $editor_found = $input->param('editor_found'); + my $authoritysep = C4::Context->preference("authoritysep"); + + my ( $template, $loggedinuser, $cookie ) = get_template_and_user( + { template_name => "cataloguing/value_builder/unimarc_field_210c_bis.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { editcatalogue => '*' }, + debug => 1, + } + ); + + $template->param( + index => $index, + ); + output_html_with_http_headers $input, $cookie, $template->output; +} + +1; diff --git a/cataloguing/value_builder/unimarc_field_225a.pl b/cataloguing/value_builder/unimarc_field_225a.pl index acd02e1..daba32e 100755 --- a/cataloguing/value_builder/unimarc_field_225a.pl +++ b/cataloguing/value_builder/unimarc_field_225a.pl @@ -94,7 +94,7 @@ sub plugin_javascript { } defaultvalue = document.getElementById(\"$field_number\").value; - window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_225a.pl&index=\"+index+\"&result=\"+defaultvalue+\"&editor_found=\"+editor_found,\"unimarc225a\",'width=500,height=200,toolbar=false,scrollbars=no'); + window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_225a.pl&index=\"+index+\"&result=\"+defaultvalue+\"&editor_found=\"+editor_found,\"unimarc225a\",'width=500,height=400,toolbar=false,scrollbars=no'); } diff --git a/cataloguing/ysearchzebra.pl b/cataloguing/ysearchzebra.pl new file mode 100644 index 0000000..3a626fd --- /dev/null +++ b/cataloguing/ysearchzebra.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl + +# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html) + +# Copyright 2010 BibLibre +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +=head1 ysearch.pl + + +=cut + +use strict; + +use CGI; +use C4::Context; +use C4::Search; +use C4::Auth qw/check_cookie_auth/; + +my $input = new CGI; +my $query = $input->param('query'); +my $index = $input->param('index'); + +#binmode STDOUT, ":utf8"; +print $input->header( -type => 'text/plain', -charset => 'UTF-8' ); + +my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { cataloguing => '*' } ); +if ( $auth_status ne "ok" ) { + exit 0; +} + +my $results = GetDistinctValues($index, $query); + +foreach (@$results) { + print $_->{'value'} . "\n"; + +} + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c_bis.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c_bis.tmpl new file mode 100644 index 0000000..93f986e --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c_bis.tmpl @@ -0,0 +1,73 @@ + + + + UNIMARC_Field 225a builder + + + + + /css/staff-global.css" /> + + + +

    3. -->
    4. ">Change Password
    5. -
    6. &print=page">Print Page
    7. +
    8. &category_type=">Duplicate
    9. +
    10. &print=page">Print Page
    11. &print=slip">Print Slip
    12. ">Renew Account
    13. ">Set Permissions
    14. Delete
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl index a746307..67ac528 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl @@ -1,6 +1,6 @@ Koha › Patrons › -<!-- TMPL_IF NAME="opadd" -->Add<!-- TMPL_ELSE --> Modify<!--/TMPL_IF--> <!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF --><!--TMPL_UNLESS Name="opadd"--> <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!--/TMPL_UNLESS--> +AddDuplicate Modify patron Organization patron Adult patron Child patron Professional patron Staff patron ,
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tmpl index adcafbc..0187cf9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tmpl @@ -114,7 +114,7 @@ to add to Batch inputField : "dateto", ifFormat : "", button : "openCalendarTo", - align : "Tl", + align : "Tl" });
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl index 2004a7d..58a5ad9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -307,7 +307,7 @@ function checkMultiHold() { ifFormat : "", button : "CalendarReserveDate", disableFunc : validate1, - dateStatusFunc : validate1, + dateStatusFunc : validate1 } ); //]]> @@ -338,7 +338,7 @@ function checkMultiHold() { ifFormat : "", button : "CalendarExpirationDate", disableFunc : validate1, - dateStatusFunc : validate1, + dateStatusFunc : validate1 } ); //]]> diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tmpl index f87aef1..a2f78ab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/checkexpiration.tmpl @@ -60,7 +60,7 @@ { button : "openCalendar", inputField : "date", - ifFormat : "", + ifFormat : "" } ); Required diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl index 3259497..331ec2c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/cleanborrowers.tmpl @@ -64,7 +64,7 @@ Calendar.setup( { inputField : "date1", - ifFormat : "", + ifFormat : "" } );

    @@ -76,7 +76,7 @@ Calendar.setup( { inputField : "date2", - ifFormat : "", + ifFormat : "" } );

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl index 342e51b..9ce264c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/koha-news.tmpl @@ -74,7 +74,7 @@ Edit News ItemAdd News Item { button : "timestampButton", inputField : "timestamp", - ifFormat : "", + ifFormat : "" } ); @@ -89,7 +89,7 @@ Edit News ItemAdd News Item { button : "openCalendar", inputField : "expirationdate", - ifFormat : "", + ifFormat : "" } ); diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl index 802d79b..b727361 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl @@ -330,7 +330,7 @@ ifFormat : "", button : "CalendarReserveDate", disableFunc : validate, - dateStatusFunc : validate, + dateStatusFunc : validate } ); //]]> @@ -360,7 +360,7 @@ ifFormat : "", button : "CalendarExpirationDate_", disableFunc : validate1, - dateStatusFunc : validate1, + dateStatusFunc : validate1 } ); //]]> -- 1.7.1 From chrisc at catalyst.net.nz Tue Feb 15 02:41:00 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Tue, 15 Feb 2011 14:41:00 +1300 Subject: [Koha-patches] [PATCH] Bug 5760 : MT3137 : Adding jquery.tablesorter and jquery.tablesorter.pager support for readingrec.pl Message-ID: <1297734060-29305-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain --- .../prog/en/modules/members/readingrec.tmpl | 31 ++++++++++++++++++-- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl index aa1bf22..a891feb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl @@ -1,6 +1,13 @@ Reading Record for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> + + + @@ -19,8 +26,26 @@

    Showing All Items | &limit=50">Show Last 50 Items Only Showing Last 50 Items | &limit=full">Show All Items

    - - + +  page(s) : + /prog/img/first.png" class="first"/> + /prog/img/prev.png" class="prev"/> + + /prog/img/next.png" class="next"/> + /prog/img/last.png" class="last"/> + , entries/page : + + + +
    + @@ -39,7 +64,7 @@ - + -- 1.7.1 From magnus at enger.priv.no Tue Feb 15 11:37:06 2011 From: magnus at enger.priv.no (Magnus Enger) Date: Tue, 15 Feb 2011 11:37:06 +0100 Subject: [Koha-patches] =?utf-8?q?=5BPATCH=5D_Bug_2742_Followup_patch_fixi?= =?utf-8?q?ng_Norwegian_bokm=C3=A5l=2C_adding_nynorsk?= Message-ID: <1297766226-20627-1-git-send-email-magnus@enger.priv.no> - Replace Norwegian with Norwegian bokm?l - Add Norwegian nynorsk, which was missing --- .../data/mysql/de-DE/mandatory/subtag_registry.sql | 32 ++++++++++++++++--- .../data/mysql/en/mandatory/subtag_registry.sql | 32 ++++++++++++++++--- .../mysql/fr-FR/1-Obligatoire/subtag_registry.sql | 32 ++++++++++++++++--- .../data/mysql/it-IT/necessari/subtag_registry.sql | 32 ++++++++++++++++--- .../data/mysql/pl-PL/mandatory/subtag_registry.sql | 32 ++++++++++++++++--- .../data/mysql/ru-RU/mandatory/subtag_registry.sql | 32 ++++++++++++++++--- .../data/mysql/uk-UA/mandatory/subtag_registry.sql | 32 ++++++++++++++++--- installer/data/mysql/updatedatabase.pl | 19 ++++++++++++ 8 files changed, 208 insertions(+), 35 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/subtag_registry.sql b/installer/data/mysql/de-DE/mandatory/subtag_registry.sql index 63c76d4..4121a59 100644 --- a/installer/data/mysql/de-DE/mandatory/subtag_registry.sql +++ b/installer/data/mysql/de-DE/mandatory/subtag_registry.sql @@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego'); INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'gl', 'language', 'en', 'Galician'); --- Norwegian +-- Norwegian (bokm?l) INSERT INTO language_subtag_registry( subtag, type, description, added) -VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); +VALUES ( 'nb', 'language', 'Norwegian bokmål','2005-10-16' ); INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nor'); +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nob'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norv?gien bokmål'); + +-- Norwegian (nynorsk) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nn','nno'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk'); + INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'nb', 'Norsk'); +VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'en', 'Norwegian'); +VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'fr', 'Norv?gien'); +VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk'); -- Persian INSERT INTO language_subtag_registry( subtag, type, description, added) diff --git a/installer/data/mysql/en/mandatory/subtag_registry.sql b/installer/data/mysql/en/mandatory/subtag_registry.sql index 94b48f2..90a3bed 100644 --- a/installer/data/mysql/en/mandatory/subtag_registry.sql +++ b/installer/data/mysql/en/mandatory/subtag_registry.sql @@ -388,21 +388,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego'); INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'gl', 'language', 'en', 'Galician'); --- Norwegian +-- Norwegian (bokm?l) INSERT INTO language_subtag_registry( subtag, type, description, added) -VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); +VALUES ( 'nb', 'language', 'Norwegian bokmål','2005-10-16' ); INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nor'); +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nob'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norv?gien bokmål'); + +-- Norwegian (nynorsk) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nn','nno'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk'); + INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'nb', 'Norsk'); +VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'en', 'Norwegian'); +VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'fr', 'Norv?gien'); +VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk'); -- Persian INSERT INTO language_subtag_registry( subtag, type, description, added) diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/subtag_registry.sql b/installer/data/mysql/fr-FR/1-Obligatoire/subtag_registry.sql index 5254c35..caa354b 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/subtag_registry.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/subtag_registry.sql @@ -332,21 +332,43 @@ VALUES( 'la', 'language', 'en', 'Latin'); INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'la', 'language', 'fr', 'Latin'); --- Norwegian +-- Norwegian (bokm?l) INSERT INTO language_subtag_registry( subtag, type, description, added) -VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); +VALUES ( 'nb', 'language', 'Norwegian bokmål','2005-10-16' ); INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nor'); +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nob'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norv?gien bokmål'); + +-- Norwegian (nynorsk) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nn','nno'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk'); + INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'nb', 'Norsk'); +VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'en', 'Norwegian'); +VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'fr', 'Norv?gien'); +VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk'); -- Persian INSERT INTO language_subtag_registry( subtag, type, description, added) diff --git a/installer/data/mysql/it-IT/necessari/subtag_registry.sql b/installer/data/mysql/it-IT/necessari/subtag_registry.sql index 48f4f6b..a8029d5 100644 --- a/installer/data/mysql/it-IT/necessari/subtag_registry.sql +++ b/installer/data/mysql/it-IT/necessari/subtag_registry.sql @@ -387,21 +387,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego'); INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'gl', 'language', 'en', 'Galician'); --- Norwegian +-- Norwegian (bokm?l) INSERT INTO language_subtag_registry( subtag, type, description, added) -VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); +VALUES ( 'nb', 'language', 'Norwegian bokmål','2005-10-16' ); INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nor'); +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nob'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norv?gien bokmål'); + +-- Norwegian (nynorsk) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nn','nno'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk'); + INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'nb', 'Norsk'); +VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'en', 'Norwegian'); +VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'fr', 'Norv?gien'); +VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk'); -- Persian INSERT INTO language_subtag_registry( subtag, type, description, added) diff --git a/installer/data/mysql/pl-PL/mandatory/subtag_registry.sql b/installer/data/mysql/pl-PL/mandatory/subtag_registry.sql index 665fee0..b246a7c 100644 --- a/installer/data/mysql/pl-PL/mandatory/subtag_registry.sql +++ b/installer/data/mysql/pl-PL/mandatory/subtag_registry.sql @@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego'); INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'gl', 'language', 'en', 'Galician'); --- Norwegian +-- Norwegian (bokm?l) INSERT INTO language_subtag_registry( subtag, type, description, added) -VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); +VALUES ( 'nb', 'language', 'Norwegian bokmål','2005-10-16' ); INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nor'); +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nob'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norv?gien bokmål'); + +-- Norwegian (nynorsk) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nn','nno'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk'); + INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'nb', 'Norsk'); +VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'en', 'Norwegian'); +VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'fr', 'Norv?gien'); +VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk'); -- Persian INSERT INTO language_subtag_registry( subtag, type, description, added) diff --git a/installer/data/mysql/ru-RU/mandatory/subtag_registry.sql b/installer/data/mysql/ru-RU/mandatory/subtag_registry.sql index 63c76d4..4121a59 100644 --- a/installer/data/mysql/ru-RU/mandatory/subtag_registry.sql +++ b/installer/data/mysql/ru-RU/mandatory/subtag_registry.sql @@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego'); INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'gl', 'language', 'en', 'Galician'); --- Norwegian +-- Norwegian (bokm?l) INSERT INTO language_subtag_registry( subtag, type, description, added) -VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); +VALUES ( 'nb', 'language', 'Norwegian bokmål','2005-10-16' ); INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nor'); +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nob'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norv?gien bokmål'); + +-- Norwegian (nynorsk) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nn','nno'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk'); + INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'nb', 'Norsk'); +VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'en', 'Norwegian'); +VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'fr', 'Norv?gien'); +VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk'); -- Persian INSERT INTO language_subtag_registry( subtag, type, description, added) diff --git a/installer/data/mysql/uk-UA/mandatory/subtag_registry.sql b/installer/data/mysql/uk-UA/mandatory/subtag_registry.sql index 63c76d4..4121a59 100644 --- a/installer/data/mysql/uk-UA/mandatory/subtag_registry.sql +++ b/installer/data/mysql/uk-UA/mandatory/subtag_registry.sql @@ -385,21 +385,43 @@ VALUES( 'gl', 'language', 'gl', 'Galego'); INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'gl', 'language', 'en', 'Galician'); --- Norwegian +-- Norwegian (bokm?l) INSERT INTO language_subtag_registry( subtag, type, description, added) -VALUES ( 'nb', 'language', 'Norwegian','2005-10-16' ); +VALUES ( 'nb', 'language', 'Norwegian bokmål','2005-10-16' ); INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nor'); +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nb','nob'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'nb', 'Norsk bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'en', 'Norwegian bokmål'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nb', 'language', 'fr', 'Norv?gien bokmål'); + +-- Norwegian (nynorsk) +INSERT INTO language_subtag_registry( subtag, type, description, added) +VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' ); + +INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) +VALUES( 'nn','nno'); + +INSERT INTO language_descriptions(subtag, type, lang, description) +VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk'); + INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'nb', 'Norsk'); +VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'en', 'Norwegian'); +VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk'); INSERT INTO language_descriptions(subtag, type, lang, description) -VALUES( 'nb', 'language', 'fr', 'Norv?gien'); +VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk'); -- Persian INSERT INTO language_subtag_registry( subtag, type, description, added) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index d9b546b..b647f27 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3995,6 +3995,25 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.03.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + # Fix bokm?l + $dbh->do("UPDATE language_subtag_registry SET description = 'Norwegian bokmål' WHERE subtag = 'nb';"); + $dbh->do("INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nb','nob');"); + $dbh->do("UPDATE language_descriptions SET description = 'Norsk bokmål' WHERE subtag = 'nb' AND lang = 'nb';"); + $dbh->do("UPDATE language_descriptions SET description = 'Norwegian bokmål' WHERE subtag = 'nb' AND lang = 'en';"); + $dbh->do("UPDATE language_descriptions SET description = 'Norv?gien bokmål' WHERE subtag = 'nb' AND lang = 'fr';"); + # Add nynorsk + $dbh->do("INSERT INTO language_subtag_registry( subtag, type, description, added) VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' )"); + $dbh->do("INSERT INTO language_rfc4646_to_iso639(rfc4646_subtag,iso639_2_code) VALUES( 'nn','nno')"); + $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'nb', 'Norsk nynorsk')"); + $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'nn', 'Norsk nynorsk')"); + $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk')"); + $dbh->do("INSERT INTO language_descriptions(subtag, type, lang, description) VALUES( 'nn', 'language', 'fr', 'Norv?gien nynorsk')"); + print "Upgrade to $DBversion done (Correct language descriptions for Norwegian)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) -- 1.6.3.3 From colin.campbell at ptfs-europe.com Tue Feb 15 12:02:55 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Tue, 15 Feb 2011 11:02:55 +0000 Subject: [Koha-patches] [PATCH] Bug 5762 Renew calendar gadget not working in IE Message-ID: <1297767775-22937-1-git-send-email-colin.campbell@ptfs-europe.com> From: Jonathan Field Remove erroneous trailing comma from javascript Signed-off-by: Colin Campbell --- .../prog/en/includes/checkouts-table-footer.inc | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc index 5d05b94..df1acbf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc @@ -14,7 +14,7 @@ ifFormat : "", button : "newduedate_button", disableFunc : validate1, - dateStatusFunc : validate1, + dateStatusFunc : validate1 } ); //]]> @@ -22,4 +22,4 @@

    - \ No newline at end of file + -- 1.7.4 From gmcharlt at gmail.com Tue Feb 15 13:33:05 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Tue, 15 Feb 2011 07:33:05 -0500 Subject: [Koha-patches] [PATCH] C4::Auth_with_ldap.pm refactoring In-Reply-To: <1297439666-2293-1-git-send-email-henridamien.laurent@biblibre.com> References: <1297439666-2293-1-git-send-email-henridamien.laurent@biblibre.com> Message-ID: Hi, On Fri, Feb 11, 2011 at 10:54 AM, Henri-Damien LAURENT wrote: > Here is a patch I am sending in order to support multiple branches for LDAP > This enables the user to add a PM with transformation rules, you find a direct exemple in the patch > > Package::Stash is a module that comes with PERL core No, it isn't. It is not on the list of core modules on perldoc.perl.org, and Debian includes it as a separate package. Not that there's anything wrong with a new dependency per se, but since this is definitely not core, it would have to be tracked in C4::Installer::PerlDependencies. Regards, Galen -- Galen Charlton gmcharlt at gmail.com From nengard at bywatersolutions.com Sat Feb 12 10:19:31 2011 From: nengard at bywatersolutions.com (Nicole Engard) Date: Sat, 12 Feb 2011 04:19:31 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5760 : MT3137 : Adding jquery.tablesorter and jquery.tablesorter.pager support for readingrec.pl Message-ID: <1297502371-6541-1-git-send-email-nengard@bywatersolutions.com> From: Paul Poulain Signed-off-by: Nicole Engard --- .../prog/en/modules/members/readingrec.tmpl | 31 ++++++++++++++++++-- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl index aa1bf22..682eaa9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl @@ -1,6 +1,13 @@ Reading Record for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> + + + @@ -19,8 +26,26 @@

    Showing All Items | &limit=50">Show Last 50 Items Only Showing Last 50 Items | &limit=full">Show All Items

    -
    &order=issuestimestamp&limit=">Date &order=returndate%20DESC&limit=">Return Date
    - + +
     page(s) : + /prog/img/first.png" class="first"/> + /prog/img/prev.png" class="prev"/> + + /prog/img/next.png" class="next"/> + /prog/img/last.png" class="last"/> + , entries/page : + + +
    +
    + @@ -39,7 +64,7 @@ - + -- 1.5.6.5 From henridamien.laurent at biblibre.com Tue Feb 15 15:10:45 2011 From: henridamien.laurent at biblibre.com (LAURENT Henri-Damien) Date: Tue, 15 Feb 2011 15:10:45 +0100 Subject: [Koha-patches] [PATCH] C4::Auth_with_ldap.pm refactoring In-Reply-To: References: <1297439666-2293-1-git-send-email-henridamien.laurent@biblibre.com> Message-ID: <4D5A8965.7090501@biblibre.com> Le 15/02/2011 13:33, Galen Charlton a ?crit : > Hi, > > On Fri, Feb 11, 2011 at 10:54 AM, Henri-Damien LAURENT > wrote: >> Here is a patch I am sending in order to support multiple branches for LDAP >> This enables the user to add a PM with transformation rules, you find a direct exemple in the patch >> >> Package::Stash is a module that comes with PERL core > > No, it isn't. It is not on the list of core modules on > perldoc.perl.org, and Debian includes it as a separate package. > > Not that there's anything wrong with a new dependency per se, but > since this is definitely not core, it would have to be tracked in > C4::Installer::PerlDependencies. > > Regards, > > Galen Ok could be done. But does any person have to do that same LDAP stuff ? Having to edit the C4::Auth_with_ldap.pm and keep up with local edits is quite annoying, this way to do things removes that. And it allows to use LDAP with multiple branches for authentication. I know this is not a patch with a bug number, I know this was not really asked or planned. But I thought this could be handy for some people out there. Friendly -- Henri-Damien LAURENT From dearden at sarsf.org Tue Feb 15 18:41:52 2011 From: dearden at sarsf.org (Doug Dearden) Date: Tue, 15 Feb 2011 10:41:52 -0700 Subject: [Koha-patches] bug5738 latest and hopefully final patch file Message-ID: Hello all, A few comments about this latest round. I have this working with the MARC21 display files for results and details on the OPAC. I also have it working for the Unimarc detail file on the OPAC. I was unable to get it working for the Unimarc results pages on the OPAC, as there is another conditional test around the 856u field looking for a '0' in ind2. It is also labeling this area 'Availability' instead of 'Online Resources'. I'm not sure what is going on there, but didn't want to mess up something by changing that around so left well enough alone. In addition I have a new preference for the staff client - and renamed the OPAC preference to distinguish the two. The xslt display file for Results is not working in the staff client, but I got the respective MARC21 and Unimarc intranet detail files working. As far as I can tell this is now ready for QA testing and hopefully inclusion in a future release. I will post the file up to the bug entry. Still to be done - text to be included in the documentation, and a script that will populate the 856q field with a MIME extension based on the URI in the 856u field. Thanks, Doug Dearden Director, IT School for Advanced Research (505)954-7220 sarweb.org -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-bug-5738-Display-the-URI-in-856u-as-an-image-enh.patch Type: application/octet-stream Size: 32543 bytes Desc: 0001-bug-5738-Display-the-URI-in-856u-as-an-image-enh.patch URL: From nengard at bywatersolutions.com Sat Feb 12 23:19:23 2011 From: nengard at bywatersolutions.com (Nicole Engard) Date: Sat, 12 Feb 2011 17:19:23 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Follow up on Bug 5462: fixing variable names breaks messaging preference form Message-ID: <1297549163-7796-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls The messaging prefs form was hardcoded to use 'transport-$transport_type', rather than 'transport_$transport_type'. The result was an uneditable messaging preferences form. Signed-off-by: Nicole Engard --- C4/Form/MessagingPreferences.pm | 2 +- C4/Members/Messaging.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/C4/Form/MessagingPreferences.pm b/C4/Form/MessagingPreferences.pm index 22b2048..bd1c22f 100644 --- a/C4/Form/MessagingPreferences.pm +++ b/C4/Form/MessagingPreferences.pm @@ -132,7 +132,7 @@ sub set_form_values { } ( 0..30 ); # FIXME: 30 is a magic number. } foreach my $transport ( @{$pref->{'transports'}} ) { - $option->{'transport-'.$transport} = 'checked="checked"'; + $option->{'transport_'.$transport} = 'checked="checked"'; } $option->{'digest'} = 'checked="checked"' if $pref->{'wants_digest'}; } diff --git a/C4/Members/Messaging.pm b/C4/Members/Messaging.pm index bc0f81b..2b39f11 100644 --- a/C4/Members/Messaging.pm +++ b/C4/Members/Messaging.pm @@ -213,7 +213,7 @@ END_SQL $choices->{ $row->{'message_name'} }->{'message_name'} = $row->{'message_name'}; $choices->{ $row->{'message_name'} }->{'takes_days'} = $row->{'takes_days'}; $choices->{ $row->{'message_name'} }->{'has_digest'} = 1 if $row->{'is_digest'}; - $choices->{ $row->{'message_name'} }->{'transport-' . $row->{'message_transport_type'}} = ' '; + $choices->{ $row->{'message_name'} }->{'transport_' . $row->{'message_transport_type'}} = ' '; } my @return = values %$choices; -- 1.5.6.5 From oleonard at myacpl.org Wed Feb 16 16:25:56 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Wed, 16 Feb 2011 10:25:56 -0500 Subject: [Koha-patches] [PATCH] Follow-up fix for Bug 5760 - Add the jquery table sorter to reading record Message-ID: <1297869956-26404-1-git-send-email-oleonard@myacpl.org> - Removing option to show 50 items/show all from script and template - Adding parser to exclude articles in title sort (en only, see Bug 5766) - Setting default sort to 'date due descending' as it was previously --- .../intranet-tmpl/prog/en/css/staff-global.css | 2 +- .../prog/en/modules/members/readingrec.tmpl | 40 +++++++------------ members/readingrec.pl | 16 +------ 3 files changed, 19 insertions(+), 39 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 7586185..66b092c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -304,7 +304,7 @@ tr.onissue td { background-color: #FFFFCC; } -tr.highlight.onissue td { +tr.odd.onissue td { background-color: #FFFFE1; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl index 682eaa9..6d65063 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl @@ -4,8 +4,16 @@ @@ -23,9 +31,7 @@

    Reading Record

    " /> -

    Showing All Items | - &limit=50">Show Last 50 Items Only Showing Last 50 Items | - &limit=full">Show All Items

    +
     page(s) : /prog/img/first.png" class="first"/> @@ -46,39 +52,23 @@
    &order=issuestimestamp&limit=">Date &order=returndate%20DESC&limit=">Return Date
    - - - + + + - + - - - - - + diff --git a/members/readingrec.pl b/members/readingrec.pl index bd6ca82..f7631db 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -50,21 +50,11 @@ if ($input->param('borrowernumber')) { $data = GetMember(borrowernumber => $borrowernumber); } -my $order=$input->param('order') || 'date_due desc'; -my $limit=$input->param('limit'); - -if ($limit){ - if ($limit eq 'full'){ - $limit=0; - } -} -else { - $limit=50; -} +my $order = 'date_due desc'; +my $limit = 0; my ( $issues ) = GetAllIssues($borrowernumber,$order,$limit); -my ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "members/readingrec.tmpl", +my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "members/readingrec.tmpl", query => $input, type => "intranet", authnotrequired => 0, -- 1.7.3 From f.demians at tamil.fr Wed Feb 16 17:00:12 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Wed, 16 Feb 2011 17:00:12 +0100 Subject: [Koha-patches] =?utf-8?q?=5BPATCH=5D_Bug_5755=3A_Syspref_to_contr?= =?utf-8?q?ol_facets_truncation?= Message-ID: <1297872012-6249-1-git-send-email-f.demians@tamil.fr> On OPAC/staff result page facets are truncated to 20 characters. On some OPAC layout, it's not enough. A new syspref FacetLabelTruncationLength defines the length to cut facets if necessary. This patch add the syspref to searching.pref and add it to syspref various language default values loaded into DB during installation process. It's not necessary to update DB since length is fixed to 20 (as before) when this syspref isn't defined in systemprefercences table. [Documentation] FacetLabelTruncationLength syspref in Searching tab [3.2] It applies. --- C4/Search.pm | 6 ++++-- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/it-IT/necessari/sysprefs.sql | 3 ++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- ...m_preferences_full_optimal_for_install_only.sql | 3 ++- .../en/modules/admin/preferences/searching.pref | 5 +++++ 8 files changed, 19 insertions(+), 6 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a469948..7a948fd 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -511,9 +511,11 @@ sub getRecords { # fix the length that will display in the label, my $facet_label_value = $one_facet; + my $facet_max_length = + C4::Context->preference('FacetLabelTruncationLength') || 20; $facet_label_value = - substr( $one_facet, 0, 20 ) . "..." - unless length($facet_label_value) <= 20; + substr( $one_facet, 0, $facet_max_length ) . "..." + if length($facet_label_value) > $facet_max_length; # if it's a branch, label by the name, not the code, if ( $link_value =~ /branch/ ) { diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 02511d8..5c0f518 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -142,6 +142,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..6e98dcf 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -143,6 +143,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 79c469c..94ee591 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -118,6 +118,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opaccredits','','70|10','Per impostare i credits HTML in fondo alla pagina dell\'OPAC','Textarea'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACdefaultSortField','relevance','relevance|popularity|call_number|pubdate|acqdate|title|author','Specifica il campo usato di default per l\'ordinamento','Choice'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACdefaultSortOrder','asc','asc|dsc|za|az','Specifica l\'ordine di default ','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OPACFRBRizeEditions','1','','Se ON, Koha far? delle richieste a uno o pi? ISBN web services per trovare gli ISBN associabili e li visualizzar? in un tab \'Edizioni\' nella visualizzazione dettagliata','YesNo'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('opacheader','','70|10','Inserire qui HTML da includere come header nell\'OPAC','Textarea'); insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('OpacHighlightedWords','1','','Se impostato, le parole cercate nell\'OPAC vengono poi evidenziate ','YesNo'); @@ -271,4 +272,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 8689c4c..63b9ed6 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -141,6 +141,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); @@ -283,4 +284,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index c862e60..129e3a2 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -170,6 +170,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); @@ -338,4 +339,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 82e285b..6c29739 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -169,6 +169,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('noItemTypeImages',0,'If ON, disables item-type images',NULL,'YesNo'); @@ -363,4 +364,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index cd924dc..c1d26d1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -133,3 +133,8 @@ Searching: yes: Show no: "Don't show" - "an item's branch, location and call number in OPAC search results." + - + - Truncate facets length to + - pref: FacetLabelTruncationLength + class: integer + - characters, in OPAC/staff interface. -- 1.7.4 From nengard at bywatersolutions.com Sun Feb 13 02:46:59 2011 From: nengard at bywatersolutions.com (Nicole Engard) Date: Sat, 12 Feb 2011 20:46:59 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5307: Language search fields Message-ID: <1297561619-8213-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls Previously, searching on language would turn up any code found in any 041 subfield. Unfortunately, this field is used for language information OTHER THAN the language of the material, like the original language (which may not be present anywhere in the material itself). Below are the subfields for 041, and whether they've been kept or removed by this patch. a: main language, kept b: summary/abstract, removed d: sung/spoken text for audio item, kept e: librettos, kept f: table of contents, removed g: other material, removed h: original language, removed j: subtitles/captions, kept Signed-off-by: Nicole Engard --- etc/zebradb/marc_defs/marc21/biblios/record.abs | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/etc/zebradb/marc_defs/marc21/biblios/record.abs b/etc/zebradb/marc_defs/marc21/biblios/record.abs index 85eaedd..81e4731 100755 --- a/etc/zebradb/marc_defs/marc21/biblios/record.abs +++ b/etc/zebradb/marc_defs/marc21/biblios/record.abs @@ -67,7 +67,10 @@ melm 034 Map-scale #melm 035 Local-number,Identifier-standard melm 037 Identifier-standard,Stock-number melm 040 Code-institution,Record-source -melm 041 ln +melm 041$a ln +melm 041$d ln +melm 041$e ln +melm 041$j ln melm 043 Code-geographic #melm 046 pubdate melm 050$b LC-call-number:w,LC-call-number:p,LC-call-number:s -- 1.5.6.5 From nengard at bywatersolutions.com Sun Feb 13 02:55:09 2011 From: nengard at bywatersolutions.com (Nicole Engard) Date: Sat, 12 Feb 2011 20:55:09 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Follow-up fix for Bug 5760 - Add the jquery table sorter to reading record Message-ID: <1297562109-8324-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard - Removing option to show 50 items/show all from script and template - Adding parser to exclude articles in title sort (en only, see Bug 5766) - Setting default sort to 'date due descending' as it was previously Signed-off-by: Nicole Engard --- .../intranet-tmpl/prog/en/css/staff-global.css | 2 +- .../prog/en/modules/members/readingrec.tmpl | 40 +++++++------------ members/readingrec.pl | 16 +------ 3 files changed, 19 insertions(+), 39 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 7586185..66b092c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -304,7 +304,7 @@ tr.onissue td { background-color: #FFFFCC; } -tr.highlight.onissue td { +tr.odd.onissue td { background-color: #FFFFE1; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl index 682eaa9..6d65063 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl @@ -4,8 +4,16 @@ @@ -23,9 +31,7 @@

    Reading Record

    " /> -

    Showing All Items | - &limit=50">Show Last 50 Items Only Showing Last 50 Items | - &limit=full">Show All Items

    +
     page(s) : /prog/img/first.png" class="first"/> @@ -46,39 +52,23 @@
    - &order=issuestimestamp&limit=">Date - - &order=title&limit=">Title - - &order=author&limit=">Author - DateTitleAuthor Call No. Barcode Number of Renewals Checked out on Checked out from Date Due - &order=returndate%20DESC&limit=">Return Date - Return Date
    - "> - - - ">
    - - - + + + - + - - - - - + diff --git a/members/readingrec.pl b/members/readingrec.pl index bd6ca82..f7631db 100755 --- a/members/readingrec.pl +++ b/members/readingrec.pl @@ -50,21 +50,11 @@ if ($input->param('borrowernumber')) { $data = GetMember(borrowernumber => $borrowernumber); } -my $order=$input->param('order') || 'date_due desc'; -my $limit=$input->param('limit'); - -if ($limit){ - if ($limit eq 'full'){ - $limit=0; - } -} -else { - $limit=50; -} +my $order = 'date_due desc'; +my $limit = 0; my ( $issues ) = GetAllIssues($borrowernumber,$order,$limit); -my ($template, $loggedinuser, $cookie) -= get_template_and_user({template_name => "members/readingrec.tmpl", +my ($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "members/readingrec.tmpl", query => $input, type => "intranet", authnotrequired => 0, -- 1.5.6.5 From nengard at bywatersolutions.com Sun Feb 13 06:25:08 2011 From: nengard at bywatersolutions.com (Nicole Engard) Date: Sun, 13 Feb 2011 00:25:08 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3154: Improving facets perfomance Message-ID: <1297574708-8827-1-git-send-email-nengard@bywatersolutions.com> From: Fridolyn SOMERS Reformated as a git patch, bug chrisc at catalyst.net.nz Signed-off-by: Fr?d?ric Demians Signed-off-by: Nicole Engard --- C4/Search.pm | 74 ++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 49 insertions(+), 25 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a469948..ea76acd 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -418,7 +418,6 @@ sub getRecords { for ( my $j = $offset ; $j < $times ; $j++ ) { my $records_hash; my $record; - my $facet_record; ## Check if it's an index scan if ($scan) { @@ -451,33 +450,58 @@ sub getRecords { # warn "RECORD $j:".$record; $results_hash->{'RECORDS'}[$j] = $record; - - # Fill the facets while we're looping, but only for the biblioserver - $facet_record = MARC::Record->new_from_usmarc($record) - if $servers[ $i - 1 ] =~ /biblioserver/; - - #warn $servers[$i-1]."\n".$record; #.$facet_record->title(); - if ($facet_record) { - for ( my $k = 0 ; $k <= @$facets ; $k++ ) { - ($facets->[$k]) or next; - my @fields = map {$facet_record->field($_)} @{$facets->[$k]->{'tags'}} ; - for my $field (@fields) { - my @subfields = $field->subfields(); - for my $subfield (@subfields) { - my ( $code, $data ) = @$subfield; - ($code eq $facets->[$k]->{'subfield'}) or next; - $facets_counter->{ $facets->[$k]->{'link_value'} }->{$data}++; - } - } - $facets_info->{ $facets->[$k]->{'link_value'} }->{'label_value'} = - $facets->[$k]->{'label_value'}; - $facets_info->{ $facets->[$k]->{'link_value'} }->{'expanded'} = - $facets->[$k]->{'expanded'}; - } - } } + } $results_hashref->{ $servers[ $i - 1 ] } = $results_hash; + + # Fill the facets while we're looping, but only for the biblioserver and not for a scan + if ( !$scan && $servers[ $i - 1 ] =~ /biblioserver/ ) { + + my $jmax = $size; + if ( $jmax > 500 ) { + $jmax = 500; # limit to 500 first records + } + + for ( my $k = 0 ; $k <= @$facets ; $k++ ) { + ($facets->[$k]) or next; + my @fcodes = @{$facets->[$k]->{'tags'}}; + my $sfcode = $facets->[$k]->{'subfield'}; + + for ( my $j = 0 ; $j < $jmax ; $j++ ) { + my $render_record = $results[ $i - 1 ]->record($j)->render(); + my @used_datas = (); + + foreach my $fcode (@fcodes) { + + # avoid first line + my $field_pattern = '\n'.$fcode.' ([^\n]+)'; + my @field_tokens = ( $render_record =~ /$field_pattern/g ) ; + + foreach my $field_token (@field_tokens) { + my $subfield_pattern = '\$'.$sfcode.' ([^\$]+)'; + my @subfield_values = ( $field_token =~ /$subfield_pattern/g ); + + foreach my $subfield_value (@subfield_values) { + + my $data = $subfield_value; + $data =~ s/^\s+//; # trim left + $data =~ s/\s+$//; # trim right + + unless ( $data ~~ @used_datas ) { + $facets_counter->{ $facets->[$k]->{'link_value'} }->{$data}++; + push @used_datas, $data; + } + } # subfields + } # fields + } # field codes + } # records + + $facets_info->{ $facets->[$k]->{'link_value'} }->{'label_value'} = $facets->[$k]->{'label_value'}; + $facets_info->{ $facets->[$k]->{'link_value'} }->{'expanded'} = $facets->[$k]->{'expanded'}; + } # facets + } + # End PROGILONE } # warn "connection ", $i-1, ": $size hits"; -- 1.5.6.5 From nengard at bywatersolutions.com Sun Feb 13 06:25:27 2011 From: nengard at bywatersolutions.com (Nicole Engard) Date: Sun, 13 Feb 2011 00:25:27 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3154 Re-activate facet count Message-ID: <1297574727-8868-1-git-send-email-nengard@bywatersolutions.com> From: Fr?d?ric Demians This patch complements and comments Fridolyn proposed patch. Facet count was disabled to hide that the count is wrong since it was calculated based on the first result displayed page. This patch reactivate facets count. I can confirm that Fridolyn trick is efficient and quick but: - Facets count are still wrong. The count are better (ie bigger) but still wrong as soon as result set is larger than examined set used to build facets. - Libraries facet remains misleading. If a biblio record contains a 'foo' library but is at the end of the resultset, 'foo' Library isn't displayed. A patron can conclude that the ressource he's not available at his library. - It reports a huge charge load on Zebra server which has to return a LOT of records to build facets. It should be tested with simultaneous requests in order to see if it impacts Zebra overall performances. Signed-off-by: Fr?d?ric Demians Signed-off-by: Nicole Engard --- .../opac-tmpl/prog/en/includes/opac-facets.inc | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc index 85719f3..8563d8b 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc @@ -18,7 +18,7 @@ Libraries -- 1.5.6.5 From nengard at bywatersolutions.com Sun Feb 13 06:44:07 2011 From: nengard at bywatersolutions.com (Nicole Engard) Date: Sun, 13 Feb 2011 00:44:07 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5140 - In Chrome, drop-down menus disappear after using pop-up calendar Message-ID: <1297575847-8997-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard Disabling that part of the calendar JavaScript which hides " /> + + + +
    • Header row could not be parsed
    • @@ -74,6 +81,7 @@
    + diff --git a/tools/import_borrowers.pl b/tools/import_borrowers.pl index d953667..5d05fa1 100755 --- a/tools/import_borrowers.pl +++ b/tools/import_borrowers.pl @@ -45,7 +45,9 @@ use C4::Members; use C4::Members::Attributes qw(:all); use C4::Members::AttributeTypes; use C4::Members::Messaging; - +use Date::Calc qw(Today_and_Now); +use Getopt::Long; +use File::Temp; use Text::CSV; # Text::CSV::Unicode, even in binary mode, fails to parse lines with these diacriticals: # ?? @@ -68,24 +70,41 @@ our $csv = Text::CSV->new({binary => 1}); # binary needed for non-ASCII Unicod # push @feedback, {feedback=>1, name=>'backend', value=>$csv->backend, backend=>$csv->backend}; my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ - template_name => "tools/import_borrowers.tmpl", - query => $input, - type => "intranet", - authnotrequired => 0, - flagsrequired => { tools => 'import_patrons' }, - debug => 1, -}); + template_name => "tools/import_borrowers.tmpl", + query => $input, + type => "intranet", + authnotrequired => $commandline, + flagsrequired => { tools => 'import_patrons' }, + debug => 1, + }); + +if (!$commandline) { + $template->param(columnkeys => $columnkeystpl); + $template->param( SCRIPT_NAME => $ENV{'SCRIPT_NAME'} ); + ($extended) and $template->param(ExtendedPatronAttributes => 1); -$template->param(columnkeys => $columnkeystpl); + if ($input->param('sample')) { + print $input->header( + -type => 'application/vnd.sun.xml.calc', # 'application/vnd.ms-excel' ? + -attachment => 'patron_import.csv', + ); + $csv->combine(@columnkeys); + print $csv->string, "\n"; + exit 1; + } -if ($input->param('sample')) { - print $input->header( - -type => 'application/vnd.sun.xml.calc', # 'application/vnd.ms-excel' ? - -attachment => 'patron_import.csv', - ); - $csv->combine(@columnkeys); - print $csv->string, "\n"; - exit 1; + if ($input->param('report')) { + open (FH, $input->param('errors_filename')); + print $input->header( + -type => 'text/plain', + -attachment => 'import_borrowers_report.txt' + ); + print ; + close FH; + #TODO : We surely want to check that is it really a temp file that we are unlinking + unlink $input->param('errors_filename'); + exit 1; + } } my $uploadborrowers = $input->param('uploadborrowers'); my $matchpoint = $input->param('matchpoint'); @@ -186,8 +205,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { $_->{surname} = $borrower{surname} || 'UNDEF'; } $invalid++; - (25 > scalar @errors) and push @errors, {missing_criticals=>\@missing_criticals}; - # The first 25 errors are enough. Keeping track of 30,000+ would destroy performance. + push @errors, {missing_criticals=>\@missing_criticals}; next LINE; } if ($extended) { @@ -288,7 +306,78 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { 'alreadyindb' => $alreadyindb, 'invalid' => $invalid, 'total' => $imported + $alreadyindb + $invalid + $overwritten, - ); + ) if (!$commandline); + + if (scalar(@errors) > 25 or $commandline) { + + my $total = $imported + $alreadyindb + $invalid + $overwritten; + my $output; + + my $timestamp = C4::Dates->new()->output . " " . POSIX::strftime("%H:%M:%S",localtime); + $output .= "Timestamp : $timestamp\n"; + $output .= "Import results\n"; + $output .= "$imported imported records\n"; + $output .= "$overwritten overwritten records\n"; + $output .= "$alreadyindb not imported because already in borrowers table and overwrite disabled\n"; + $output .= "(last was $lastalreadyindb)\n" if ($lastalreadyindb); + $output .= "$invalid not imported because they are not in the expected format\n"; + $output .= "(last was $lastinvalid)\n" if ($lastinvalid); + $output .= "$total records parsed\n"; + + + $output .= "\nError analysis\n"; + foreach my $hash (@errors) { + $output .= "Header row could not be parsed" if ($hash->{'badheader'}); + foreach my $array ($hash->{'missing_criticals'}) { + foreach (@$array) { + $output .= "Line $_->{'line'}: "; + if ($hash->{'badparse'}) { + $output .= "could not be parsed!"; + } elsif ($hash->{'bad_date'}) { + $output .= "has $_->{'key'} in unrecognized format: $_->{'value'} "; + } else { + $output .= "Critical field $_->{'key'}: "; + if ($_->{'branch_map'} || $_->{'category_map'}) { + $output .= "has unrecognized value: $_->{'value'}"; + } else { + $output .= " missing"; + } + $output .= " (borrowernumber: $_->{'borrowernumber'}; surname: $_->{'surname'})"; + } + $output .= "\n"; + $output .= $_->{'lineraw'} . "\n" if ($commandline); + } + } + } + + if (scalar(@errors) > 25 && !$commandline) { + my $tmpf = File::Temp->new(UNLINK => 0); + print $tmpf $output; + $template->param(download_errors => 1, errors_filename => $tmpf->filename); + close $tmpf; + } + + if ($commandline) { + # Write log file + my $logfile = "/var/log/koha/reports/import_borrowers.log"; + if (open (FH, ">>$logfile")) { + print FH $output; + close(FH); + } else { + $output .= "Unable to write to log file : $logfile\n"; + } + + + # Send email with log + my $mail = MIME::Lite->new( + To => C4::Context->preference('KohaAdminEmailAddress'), + Subject => "Import borrowers log email", + Type => 'text/plain', + Data => $output + ); + $mail->send() or print "Unable to send log email"; + } + } } else { if ($extended) { -- 1.7.1 From chrisc at catalyst.net.nz Thu Feb 17 23:24:48 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Fri, 18 Feb 2011 11:24:48 +1300 Subject: [Koha-patches] [PATCH] Bug 5772 : MT3113 : Showing cards should use marcflavour Message-ID: <1297981488-11646-1-git-send-email-chrisc@catalyst.net.nz> From: Paul Poulain filename for compact xsl is now based on marcflavour --- catalogue/cardview.pl | 3 ++- catalogue/showmarc.pl | 3 ++- .../intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl | 19 ++++++------------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/catalogue/cardview.pl b/catalogue/cardview.pl index f93323f..d41d7c8 100755 --- a/catalogue/cardview.pl +++ b/catalogue/cardview.pl @@ -32,7 +32,8 @@ $template->param(biblionumber => $biblionumber); my $xmlrecord = GetXmlBiblio($biblionumber); #my $xslfile = "/home/kohacat/etc/xslt/MARC21slim2HTML.xsl"; #my $xslfile = "/home/kohacat/etc/xslt/MARC21slim2English.xsl"; -my $xslfile = C4::Context->config('intranetdir')."/koha-tmpl/intranet-tmpl/prog/en/xslt/compact.xsl"; +my $filename=(C4::Context->preference('marcflavour') ne "MARC21"?C4::Context->preference('marcflavour')."_":"").'compact.xsl'; +my $xslfile = C4::Context->config('intranetdir')."/koha-tmpl/intranet-tmpl/prog/en/xslt/$filename"; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_string($xmlrecord); diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index d316833..3822ab5 100755 --- a/catalogue/showmarc.pl +++ b/catalogue/showmarc.pl @@ -69,7 +69,8 @@ if($importid) { if($view eq 'card') { $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; -my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/compact.xsl"; +my $filename=(C4::Context->preference('marcflavour') ne "MARC21"?C4::Context->preference('marcflavour')."_":"").'compact.xsl'; +my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/$filename"; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_string($xmlrecord); diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl index 6e70ee7..32e92ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARC_compact.xsl @@ -34,28 +34,21 @@ -

    +

    - -
    -

    - -

    -
    - - . - - - . + +

    + . +

    @@ -78,7 +71,7 @@
    - + -- -- 1.7.1 From f.demians at tamil.fr Fri Feb 18 08:33:24 2011 From: f.demians at tamil.fr (=?ISO-8859-1?Q?Fr=E9d=E9ric_DEMIANS?=) Date: Fri, 18 Feb 2011 08:33:24 +0100 Subject: [Koha-patches] [PATCH] Bug 4828: Clean diacritics from SIP-written messages In-Reply-To: <4D5D9225.7090402@ptfs-europe.com> References: <1297964596-11848-1-git-send-email-ian.walls@bywatersolutions.com> <4D5D6968.2070202@tamil.fr> <4D5D9225.7090402@ptfs-europe.com> Message-ID: <4D5E20C4.8050609@tamil.fr> Le 17/02/11 22:24, Colin Campbell a ?crit : > And the older ones largely support the windows "extensions" to Latin-1, > ( the standard specifically mentions an old dos copepage that has > probably not been seen in a long time...) > C. My experience is that all recent Self Check (SC) devices support UTF-8, are able to exchange with Koha SIP2 server and display diacritics and even Chinese, as soon as: * You disable SC error detection (the checksum calculated and sent by Koha seems to be wrong) * Force Perl STDOUT layer to UTF-8 by adding binmode(STDOUT, ':utf8') in SIPServer.pm I agree that a parameterizable solution, converting to configurable code page would allow to support legacy SC which are still in use. The trick is to test all combinations. -------------- next part -------------- An HTML attachment was scrubbed... URL: From f.demians at tamil.fr Fri Feb 18 08:33:45 2011 From: f.demians at tamil.fr (=?ISO-8859-1?Q?Fr=E9d=E9ric_DEMIANS?=) Date: Fri, 18 Feb 2011 08:33:45 +0100 Subject: [Koha-patches] [PATCH] Bug 4828: Clean diacritics from SIP-written messages In-Reply-To: <4D5D9225.7090402@ptfs-europe.com> References: <1297964596-11848-1-git-send-email-ian.walls@bywatersolutions.com> <4D5D6968.2070202@tamil.fr> <4D5D9225.7090402@ptfs-europe.com> Message-ID: <4D5E20D9.6030007@tamil.fr> Le 17/02/11 22:24, Colin Campbell a ?crit : > And the older ones largely support the windows "extensions" to Latin-1, > ( the standard specifically mentions an old dos copepage that has > probably not been seen in a long time...) > C. My experience is that all recent Self Check (SC) devices support UTF-8, are able to exchange with Koha SIP2 server and display diacritics and even Chinese, as soon as: * You disable SC error detection (the checksum calculated and sent by Koha seems to be wrong) * Force Perl STDOUT layer to UTF-8 by adding binmode(STDOUT, ':utf8') in SIPServer.pm I agree that a parameterizable solution, converting to configurable code page would allow to support legacy SC which are still in use. The trick is to test all combinations. -------------- next part -------------- An HTML attachment was scrubbed... URL: From henridamien.laurent at biblibre.com Fri Feb 18 11:01:03 2011 From: henridamien.laurent at biblibre.com (Henri-Damien LAURENT) Date: Fri, 18 Feb 2011 11:01:03 +0100 Subject: [Koha-patches] [PATCH] bug4438/MT5496 budget Exceeds total allocation Message-ID: <1298023263-32160-1-git-send-email-henridamien.laurent@biblibre.com> This is a followup : When editing a budget, the check for the total allocation would take into account the budget itself. Showing an improper error message --- admin/check_parent_total.pl | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/check_parent_total.pl b/admin/check_parent_total.pl index cb62f0d..fb78179 100755 --- a/admin/check_parent_total.pl +++ b/admin/check_parent_total.pl @@ -75,10 +75,16 @@ if ($parent) { # ELSE , IF NO PARENT PASSED, THEN CHECK UNALLOCATED FOR PERIOD, IF NOT THEN RETURN 2 else { my $query = qq| SELECT SUM(budget_amount) as sum - FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL|; + FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL |; + my @sql_params; + push @sql_params, $period_id; + if ($budget_id){ + $query.=qq| and budget_id <> ? |; + push @sql_params,$budget_id; + } my $sth = $dbh->prepare($query); - $sth->execute($period_id); + $sth->execute(@sql_params); $period_sum = $sth->fetchrow_hashref; $sth->finish; $budget_period_unalloc = $period->{'budget_period_total'} - $period_sum->{'sum'} if $period->{'budget_period_total'}; -- 1.7.1 From ian.walls at bywatersolutions.com Fri Feb 18 12:28:03 2011 From: ian.walls at bywatersolutions.com (Ian Walls) Date: Fri, 18 Feb 2011 06:28:03 -0500 Subject: [Koha-patches] [PATCH] Bug 4828: Clean diacritics from SIP-written messages In-Reply-To: <4D5E20D9.6030007@tamil.fr> References: <1297964596-11848-1-git-send-email-ian.walls@bywatersolutions.com> <4D5D6968.2070202@tamil.fr> <4D5D9225.7090402@ptfs-europe.com> <4D5E20D9.6030007@tamil.fr> Message-ID: Thank you everyone for your responses! I'm glad to hear that this can be solved other (more robust) ways that work better internationally. One of the many reasons I'm so proud to be part of this community. So, I'm seeing that Koha's checksum subroutine is the real cause of the problem. If we parameterize the section of the config to take an "encoding" attribute, we could use a different checksum subroutine as appropriate, as well as forcing the Perl STDOUT layer if need be. Unfortunately, I have no idea what the corrected checksum calculation should look like... scouring the web now... -Ian 2011/2/18 Fr?d?ric DEMIANS > Le 17/02/11 22:24, Colin Campbell a ?crit : > > And the older ones largely support the windows "extensions" to Latin-1, > > ( the standard specifically mentions an old dos copepage that has > probably not been seen in a long time...) > C. > > > My experience is that all recent Self Check (SC) devices support UTF-8, are > able to exchange with Koha SIP2 server and display diacritics and even > Chinese, as soon as: > > - You disable SC error detection (the checksum calculated and sent by > Koha seems to be wrong) > - Force Perl STDOUT layer to UTF-8 by adding binmode(STDOUT, ':utf8') > in SIPServer.pm > > I agree that a parameterizable solution, converting to configurable code > page would allow to support legacy SC which are still in use. > > The trick is to test all combinations. > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > -- Ian Walls Lead Development Specialist ByWater Solutions Phone # (888) 900-8944 http://bywatersolutions.com ian.walls at bywatersolutions.com Twitter: @sekjal -------------- next part -------------- An HTML attachment was scrubbed... URL: From M.de.Rooy at rijksmuseum.nl Fri Feb 18 14:57:26 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Fri, 18 Feb 2011 13:57:26 +0000 Subject: [Koha-patches] [PATCH] 3072: Search for Heading-Main in authorities In-Reply-To: <1298037228-10560-1-git-send-email-m.de.rooy@rijksmuseum.nl> References: <1298037228-10560-1-git-send-email-m.de.rooy@rijksmuseum.nl> Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311E0D7E@S-MAIL-1B.rijksmuseum.intra> Includes Heading-Main in authorities bib1 attribute set. Also includes Any in authorities bib1 (was still missing). Also removes temporary fix in AuthoritiesMarc.pm. --- C4/AuthoritiesMarc.pm | 7 +------ etc/zebradb/authorities/etc/bib1.att | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index e5808b0..c32369e 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -224,13 +224,8 @@ sub SearchAuthorities { for(my $i = 0 ; $i <= $#{$value} ; $i++) { if (@$value[$i]){ - ##If mainentry search $a tag if (@$tags[$i] eq "mainmainentry") { - -# FIXME: 'Heading-Main' index not yet defined in zebra -# $attr =" \@attr 1=Heading-Main "; - $attr =" \@attr 1=Heading "; - + $attr =" \@attr 1=Heading-Main "; #search only in $a }elsif (@$tags[$i] eq "mainentry") { $attr =" \@attr 1=Heading "; }else{ diff --git a/etc/zebradb/authorities/etc/bib1.att b/etc/zebradb/authorities/etc/bib1.att index c41a5e6..b34e6b5 100644 --- a/etc/zebradb/authorities/etc/bib1.att +++ b/etc/zebradb/authorities/etc/bib1.att @@ -2,6 +2,7 @@ name bib1 reference Bib-1 +att 1016 Any att 9000 authtype att 12 Local-Number att 9038 Descriptive-cataloging-rules @@ -65,6 +66,7 @@ att 9029 Term-genre-form-see-also-from att 8001 Heading att 8002 See-from att 8003 See-also-from +att 8004 Heading-Main att 8804 Match-heading att 8805 Match-subdivision att 8806 Subdivision -- 1.6.0.6 From colin.campbell at ptfs-europe.com Fri Feb 18 15:16:47 2011 From: colin.campbell at ptfs-europe.com (Colin Campbell) Date: Fri, 18 Feb 2011 14:16:47 +0000 Subject: [Koha-patches] [PATCH] Bug 4828: Clean diacritics from SIP-written messages In-Reply-To: References: <1297964596-11848-1-git-send-email-ian.walls@bywatersolutions.com> <4D5D6968.2070202@tamil.fr> <4D5D9225.7090402@ptfs-europe.com> <4D5E20D9.6030007@tamil.fr> Message-ID: <4D5E7F4F.9020106@ptfs-europe.com> On 18/02/11 11:28, Ian Walls wrote: > Unfortunately, I have no idea what the corrected checksum calculation should > look like... scouring the web now... My hunch is that the problem is the pack/unpack in Sip/Checksum which uses Unicode _character_ semantics. It should probably use bytes. Here's the calculation from the developers guide: > char * compute_checksum (char * message) > { > static char ascii_checksum[5]; > unsigned int checksum = 0; > int i = 0; > while (message[i] != ?\0?) > { > checksum += (unsigned) message[i]; > i++; > } > checksum = -(checksum & 0xFFFF); > sprintf (ascii_checksum, ?%4.4X?, checksum); > return (ascii_checksum); > } If someone has an example that we know calculates wrong we can set up a test Cheers Colin -- Colin Campbell Chief Software Engineer, PTFS Europe Limited Content Management and Library Solutions +44 (0) 845 557 5634 (phone) +44 (0) 7759 633626 (mobile) colin.campbell at ptfs-europe.com skype: colin_campbell2 http://www.ptfs-europe.com From oleonard at myacpl.org Fri Feb 18 20:52:36 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 18 Feb 2011 14:52:36 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5776 - menu on funds wraps when only 1 fund Message-ID: <1298058756-2349-1-git-send-email-oleonard@myacpl.org> --- .../prog/en/modules/admin/aqbudgets.tmpl | 3 --- 1 files changed, 0 insertions(+), 3 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 80d9156..39e341a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl @@ -431,9 +431,6 @@ - - -
    -- 1.7.3 From henridamien.laurent at biblibre.com Fri Feb 18 23:29:06 2011 From: henridamien.laurent at biblibre.com (Henri-Damien LAURENT) Date: Fri, 18 Feb 2011 23:29:06 +0100 Subject: [Koha-patches] [PATCH] bug4438/MT5496 budget Exceeds total allocation Message-ID: <1298068146-2883-1-git-send-email-henridamien.laurent@biblibre.com> This is a followup : When editing a budget, the check for the total allocation would take into account the budget itself. Showing an improper error message --- admin/check_parent_total.pl | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/admin/check_parent_total.pl b/admin/check_parent_total.pl index cb62f0d..fb78179 100755 --- a/admin/check_parent_total.pl +++ b/admin/check_parent_total.pl @@ -75,10 +75,16 @@ if ($parent) { # ELSE , IF NO PARENT PASSED, THEN CHECK UNALLOCATED FOR PERIOD, IF NOT THEN RETURN 2 else { my $query = qq| SELECT SUM(budget_amount) as sum - FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL|; + FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL |; + my @sql_params; + push @sql_params, $period_id; + if ($budget_id){ + $query.=qq| and budget_id <> ? |; + push @sql_params,$budget_id; + } my $sth = $dbh->prepare($query); - $sth->execute($period_id); + $sth->execute(@sql_params); $period_sum = $sth->fetchrow_hashref; $sth->finish; $budget_period_unalloc = $period->{'budget_period_total'} - $period_sum->{'sum'} if $period->{'budget_period_total'}; -- 1.7.1 From henridamien.laurent at biblibre.com Fri Feb 18 23:41:54 2011 From: henridamien.laurent at biblibre.com (Henri-Damien LAURENT) Date: Fri, 18 Feb 2011 23:41:54 +0100 Subject: [Koha-patches] [REPLACE] bug4438/MT5496 budget Exceeds total allocation Message-ID: <1298068914-4965-1-git-send-email-henridamien.laurent@biblibre.com> This is a followup : When editing a budget, the check for the total allocation would take into account the budget itself. Showing an improper error message The problem was solved when adding a child budget but not when editing the same budget. --- admin/check_parent_total.pl | 20 ++++++++++++++++---- 1 files changed, 16 insertions(+), 4 deletions(-) diff --git a/admin/check_parent_total.pl b/admin/check_parent_total.pl index d5b784d..f0f8c9b 100755 --- a/admin/check_parent_total.pl +++ b/admin/check_parent_total.pl @@ -62,7 +62,13 @@ my ($sub_unalloc , $period_sum, $budget_period_unalloc); if ($parent) { my $query = " SELECT SUM(budget_amount) as sum FROM aqbudgets where budget_parent_id = ? "; my $sth = $dbh->prepare($query); - $sth->execute( $parent->{'budget_id'} ); + my @sql_params; + push @sql_params, $parent->{'budget_id'} ; + if ($budget_id){ + $query.=qq| and budget_id <> ? |; + push @sql_params,$budget_id; + } + $sth->execute( @sql_params ); my $sum = $sth->fetchrow_hashref; $sth->finish; @@ -75,10 +81,16 @@ if ($parent) { # ELSE , IF NO PARENT PASSED, THEN CHECK UNALLOCATED FOR PERIOD, IF NOT THEN RETURN 2 else { my $query = qq| SELECT SUM(budget_amount) as sum - FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL|; + FROM aqbudgets WHERE budget_period_id = ? and budget_parent_id IS NULL |; + my @sql_params; + push @sql_params, $period_id; + if ($budget_id){ + $query.=qq| and budget_id <> ? |; + push @sql_params,$budget_id; + } - my $sth = $dbh->prepare($query); - $sth->execute( $period_id ); + my $sth = $dbh->prepare($query); + $sth->execute(@sql_params); $period_sum = $sth->fetchrow_hashref; $sth->finish; $budget_period_unalloc = $period->{'budget_period_total'} - $period_sum->{'sum'} if $period->{'budget_period_total'}; -- 1.7.1 From f.demians at tamil.fr Sat Feb 19 11:55:23 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Sat, 19 Feb 2011 11:55:23 +0100 Subject: [Koha-patches] [PATCH] Bug 5777 Update and install syspref tab titles Message-ID: <1298112923-24549-1-git-send-email-f.demians@tamil.fr> This allow also Save button label translation [3.2] It applies --- misc/translator/LangInstaller.pm | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/misc/translator/LangInstaller.pm b/misc/translator/LangInstaller.pm index 6b525e7..c38c53e 100644 --- a/misc/translator/LangInstaller.pm +++ b/misc/translator/LangInstaller.pm @@ -131,7 +131,7 @@ sub add_prefs { } } } - elsif ( $element ) { + elsif ( $element && $pref_name ) { $self->po_append( $self->{file} . "#$pref_name# $element", $comment ); } } @@ -173,7 +173,7 @@ sub update_tab_prefs { } } } - elsif ( $element ) { + elsif ( $element && $pref_name ) { my $id = $self->{file} . "#$pref_name# $element"; my $text = $self->get_trans_text( $id ); $p->[$i] = $text if $text; @@ -189,6 +189,8 @@ sub get_po_from_prefs { for my $file ( @{$self->{pref_files}} ) { my $pref = LoadFile( $self->{path_pref_en} . "/$file" ); $self->{file} = $file; + # Entries for tab titles + $self->po_append( $self->{file}, $_ ) for keys %$pref; while ( my ($tab, $tab_content) = each %$pref ) { if ( ref($tab_content) eq 'ARRAY' ) { $self->add_prefs( $tab, $tab_content ); @@ -254,6 +256,13 @@ sub install_prefs { for my $file ( @{$self->{pref_files}} ) { my $pref = LoadFile( $self->{path_pref_en} . "/$file" ); $self->{file} = $file; + # First, keys are replaced (tab titles) + $pref = do { + my %pref = map { + $self->get_trans_text( $self->{file} ) || $_ => $pref->{$_} + } keys %$pref; + \%pref; + }; while ( my ($tab, $tab_content) = each %$pref ) { if ( ref($tab_content) eq 'ARRAY' ) { $self->update_tab_prefs( $pref, $tab_content ); -- 1.7.4 From nengard at bywatersolutions.com Sat Feb 19 00:43:08 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Fri, 18 Feb 2011 18:43:08 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5776 - menu on funds wraps when only 1 fund Message-ID: <1298072588-9148-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard Signed-off-by: Nicole C. Engard --- .../prog/en/modules/admin/aqbudgets.tmpl | 3 --- 1 files changed, 0 insertions(+), 3 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 80d9156..39e341a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgets.tmpl @@ -431,9 +431,6 @@ - - -
    -- 1.7.2.3 From chrisc at catalyst.net.nz Sun Feb 20 22:30:35 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Mon, 21 Feb 2011 10:30:35 +1300 Subject: [Koha-patches] [PATCH] Bug 5780 - Export the URI as part of a RIS export Message-ID: <1298237435-15430-1-git-send-email-chrisc@catalyst.net.nz> Squashed commit of the following: commit 8486cd30caf879ddff93aaa5fab722838db946a1 Author: Chris Cormack Date: Mon Feb 21 10:23:07 2011 +1300 WR76962 - Fixing typos commit f3ac9d9233db2b410fded112e16e54b27280af0a Author: Chris Cormack Date: Mon Feb 21 09:56:43 2011 +1300 WR76962 - Extending RIS support to handle URI --- C4/Ris.pm | 19 +++++++++++++++++++ 1 files changed, 19 insertions(+), 0 deletions(-) diff --git a/C4/Ris.pm b/C4/Ris.pm index 11873d9..617b3a1 100644 --- a/C4/Ris.pm +++ b/C4/Ris.pm @@ -39,6 +39,7 @@ package C4::Ris; # Modified 2008 by BibLibre for Koha +# Modified 2011 by Catalyst # # This file is part of Koha. # @@ -274,6 +275,11 @@ sub marc2ris { else { ## assume marc21 &print_abstract($record->field('520')); } + + # 856u has the URI + if ($record->field('856')){ + print_uri($record->field('856')); + } ## end RIS dataset print "ER - \n"; @@ -584,6 +590,17 @@ sub print_issn { } } +### +# print_uri() prints info from 856 u +### +sub print_uri { + my $f856 = shift; + + if (my $uri = $f856->subfield('u')){ + print "UR - ", charconv($uri), "\n"; + } +} + ##******************************************************************** ## print_loc_callno(): gets info from MARC field 050 ## Arguments: field (050) @@ -933,6 +950,8 @@ sub print_abstract { } + + ##******************************************************************** ## charconv(): converts to a different charset based on a global var ## Arguments: string -- 1.7.1 From M.de.Rooy at rijksmuseum.nl Mon Feb 21 14:29:31 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Mon, 21 Feb 2011 13:29:31 +0000 Subject: [Koha-patches] [PATCH] Bug 5782: Add warning when ordering a duplicate record from external source Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F04D2@S-MAIL-1B.rijksmuseum.intra> Enhancement for Acquisitions/ordering from external source. Koha already checked for duplicates, but this patch warns the user. Offers the choice to use existing record, use new record or return without making an order. The new template is added for this interaction with the user. --- acqui/neworderempty.pl | 33 ++++++++++++++- .../en/modules/acqui/neworderempty_duplicate.tmpl | 43 ++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 84fc81e..6af057d 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -134,7 +134,14 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ my $duplicatetitle; #look for duplicates - if (! (($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord))){ + ($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord); + if($biblionumber && !$input->param('use_external_source')) { + #if duplicate record found and user did not decide yet, first warn user + #and let him choose between using new record or existing record + Load_Duplicate($duplicatetitle); + exit; + } + #from this point: add a new record if (C4::Context->preference("BiblioAddsAuthorities")){ my ($countlinked,$countcreated)=BiblioAddAuthorities($marcrecord, $params->{'frameworkcode'}); } @@ -163,7 +170,6 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ } } SetImportRecordStatus($params->{'breedingid'}, 'imported'); - } } @@ -471,3 +477,26 @@ sub MARCfindbreeding { return -1; } +sub Load_Duplicate { + my ($duplicatetitle)= @_; + ($template, $loggedinuser, $cookie) = get_template_and_user( + { + template_name => "acqui/neworderempty_duplicate.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { acquisition => 'order_manage' }, +# debug => 1, + } + ); + + $template->param( + biblionumber => $biblionumber, + basketno => $basketno, + booksellerid => $basket->{'booksellerid'}, + breedingid => $params->{'breedingid'}, + duplicatetitle => $duplicatetitle, + ); + + output_html_with_http_headers $input, $cookie, $template->output; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl new file mode 100644 index 0000000..c85f40f --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl @@ -0,0 +1,43 @@ + +Koha › Acquisitions › Basket <!-- TMPL_VAR NAME="basketno" --> › Duplicate warning + + + + + + + + + + + + + +
    + +
    +
    +
    + +

    Duplicate warning

    + +

    You selected a record from an external source that matches an existing record in your catalog!

    +

    Click Use Existing if you do not want to create a duplicate record, but you want to add an order from the existing record in your catalog. Click Create New if you still want to create a new record by importing the external (duplicate) record. Click Cancel to return to the basket without making a new order.

    +

    The existing catalog record can be viewed in a new window by clicking "> + +
    +

    + &basketno=&biblionumber='" /> + &basketno=&breedingid=&use_external_source=1'" /> + '" /> +
    + + +
    +
    +
    + +
    +
    + -- 1.6.0.6 From M.de.Rooy at rijksmuseum.nl Mon Feb 21 14:58:44 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Mon, 21 Feb 2011 13:58:44 +0000 Subject: [Koha-patches] [PATCH] 2742: Wrong language name in the preferences Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F04FB@S-MAIL-1B.rijksmuseum.intra> Follow up patch. Improvement suggested by Belgian translators (Hans Supply). --- koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl index 33ae21b..c958c2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl @@ -279,8 +279,8 @@
  • Hrvatski (Croatian)
  • čeština (Czech)
  • Dænsk (Danish)
  • -
  • Nederlands (Dutch) Sponsored by Rijksmuseum
  • -
  • Nederlands, Vlaams (Dutch as spoken in Belgium, Flemish)
  • +
  • Nederlands-Nederland (Dutch-The Netherlands) Sponsored by Rijksmuseum
  • +
  • Nederlands-Belgi? (Dutch-Belgium)
  • English
  • suomi, suomen kieli (Finnish) Pasi Korkalo
  • Français (French) Pascale Nalon (ENSMP) and Jean Yves Lemaire (Chatel Saint Germain)
  • -- 1.6.0.6 From f.demians at tamil.fr Mon Feb 21 15:40:44 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Mon, 21 Feb 2011 15:40:44 +0100 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] 2742: Wrong language name in the preferences Message-ID: <1298299244-29746-1-git-send-email-f.demians@tamil.fr> From: marcel at libdevelop.rijksmuseum.nl Follow up patch. Improvement suggested by Belgian translators (Hans Supply). Signed-off-by: Fr??d??ric Demians --- koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl index 33ae21b..11f5d28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl @@ -279,8 +279,8 @@
  • Hrvatski (Croatian)
  • čeština (Czech)
  • Dænsk (Danish)
  • -
  • Nederlands (Dutch) Sponsored by Rijksmuseum
  • -
  • Nederlands, Vlaams (Dutch as spoken in Belgium, Flemish)
  • +
  • Nederlands-Nederland (Dutch-The Netherlands) Sponsored by Rijksmuseum
  • +
  • Nederlands-Belgi? (Dutch-Belgium)
  • English
  • suomi, suomen kieli (Finnish) Pasi Korkalo
  • Français (French) Pascale Nalon (ENSMP) and Jean Yves Lemaire (Chatel Saint Germain)
  • -- 1.7.4 From tomascohen at gmail.com Mon Feb 21 15:40:03 2011 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Mon, 21 Feb 2011 11:40:03 -0300 Subject: [Koha-patches] [PATCH] [Bug 5783] Authorities edit logging Message-ID: <1298299203-8732-1-git-send-email-tomascohen@gmail.com> --- C4/AuthoritiesMarc.pm | 4 ++++ installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/logs.pref | 6 ++++++ .../prog/en/modules/tools/viewlog.tmpl | 7 ++++++- 5 files changed, 24 insertions(+), 1 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index e5808b0..7ccf381 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -26,6 +26,7 @@ use C4::Search; use C4::AuthoritiesMarc::MARC21; use C4::AuthoritiesMarc::UNIMARC; use C4::Charset; +use C4::Log; use vars qw($VERSION @ISA @EXPORT); @@ -701,6 +702,7 @@ sub AddAuthority { $sth->execute($authid,$authtypecode,$record->as_usmarc,$record->as_xml_record($format)); $sth->finish; } + logaction( "AUTHORITIES", "ADD", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); ModZebra($authid,'specialUpdate',"authorityserver",$oldRecord,$record); return ($authid); } @@ -718,6 +720,7 @@ sub DelAuthority { my ($authid) = @_; my $dbh=C4::Context->dbh; + logaction( "AUTHORITIES", "DELETE", $authid, "authority" ) if C4::Context->preference("AuthoritiesLog"); ModZebra($authid,"recordDelete","authorityserver",GetAuthority($authid),undef); $dbh->do("delete from auth_header where authid=$authid") ; @@ -748,6 +751,7 @@ sub ModAuthority { print AUTH $authid; close AUTH; } + logaction( "AUTHORITIES", "MODIFY", $authid, "BEFORE=>" . $oldrecord->as_formatted ) if C4::Context->preference("AuthoritiesLog"); return $authid; } diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..674326d 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,3 +285,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 31aa998..25f7707 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4014,6 +4014,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = 'XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','0','YesNo');"); + print "Upgrade to $DBversion done (Add AuthoritiesLog syspref)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref index 78140f8..ade8a13 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref @@ -18,6 +18,12 @@ Logging: off: "Don't log" - any changes to bibliographic or item records. Since this occurs whenever a book is checked in or out as well, it is not advisable to turn this on. - + - pref: AuthoritiesLog + choices: + on: Log + off: "Don't log" + - changes to authorities records. + - - pref: FinesLog choices: on: Log diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl index fa99af2..9984144 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl @@ -44,6 +44,7 @@
    @@ -208,11 +210,16 @@ function highlightOn() { -
    - &order=issuestimestamp&limit=">Date - - &order=title&limit=">Title - - &order=author&limit=">Author - DateTitleAuthor Call No. Barcode Number of Renewals Checked out on Checked out from Date Due - &order=returndate%20DESC&limit=">Return Date - Return Date
    - "> - - - "> - + + +
    . " title="View details for this title"> + . " title="View details for this title"> - " title="View details for this title"> - " title="View details for this title"> - + " title="View details for this title"> + " title="View details for this title"> + + + + + + by " title="Search for works by this author">  

    - -- 1.7.4 From paul.poulain at biblibre.com Mon Feb 21 17:20:40 2011 From: paul.poulain at biblibre.com (paul.poulain at biblibre.com) Date: Mon, 21 Feb 2011 17:20:40 +0100 Subject: [Koha-patches] [PATCH] BG5725 follow-up : permission is wrong Message-ID: <1298305240-12847-1-git-send-email-paul.poulain@biblibre.com> From: Paul Poulain The permission should not be "batchedit" but { tools=> "batchedit" } as it's a sub-permission --- tools/batchedit.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/batchedit.pl b/tools/batchedit.pl index f363a3a..d768fb9 100755 --- a/tools/batchedit.pl +++ b/tools/batchedit.pl @@ -61,7 +61,7 @@ if($input->param('field') and not defined $op){ query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => "batchedit", + flagsrequired => { tools => "batchedit" }, }); -- 1.7.1 From nengard at bywatersolutions.com Sat Feb 19 07:51:17 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sat, 19 Feb 2011 01:51:17 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5782: Add warning when ordering a duplicate record from external source Message-ID: <1298098277-13543-1-git-send-email-nengard@bywatersolutions.com> From: Marcel de Rooy Enhancement for Acquisitions/ordering from external source. Koha already checked for duplicates, but this patch warns the user. Offers the choice to use existing record, use new record or return without making an order. The new template is added for this interaction with the user. Signed-off-by: Nicole C. Engard --- acqui/neworderempty.pl | 33 ++++++++++++++- .../en/modules/acqui/neworderempty_duplicate.tmpl | 43 ++++++++++++++++++++ 2 files changed, 74 insertions(+), 2 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl diff --git a/acqui/neworderempty.pl b/acqui/neworderempty.pl index 84fc81e..6af057d 100755 --- a/acqui/neworderempty.pl +++ b/acqui/neworderempty.pl @@ -134,7 +134,14 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ my $duplicatetitle; #look for duplicates - if (! (($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord))){ + ($biblionumber,$duplicatetitle) = FindDuplicate($marcrecord); + if($biblionumber && !$input->param('use_external_source')) { + #if duplicate record found and user did not decide yet, first warn user + #and let him choose between using new record or existing record + Load_Duplicate($duplicatetitle); + exit; + } + #from this point: add a new record if (C4::Context->preference("BiblioAddsAuthorities")){ my ($countlinked,$countcreated)=BiblioAddAuthorities($marcrecord, $params->{'frameworkcode'}); } @@ -163,7 +170,6 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){ } } SetImportRecordStatus($params->{'breedingid'}, 'imported'); - } } @@ -471,3 +477,26 @@ sub MARCfindbreeding { return -1; } +sub Load_Duplicate { + my ($duplicatetitle)= @_; + ($template, $loggedinuser, $cookie) = get_template_and_user( + { + template_name => "acqui/neworderempty_duplicate.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { acquisition => 'order_manage' }, +# debug => 1, + } + ); + + $template->param( + biblionumber => $biblionumber, + basketno => $basketno, + booksellerid => $basket->{'booksellerid'}, + breedingid => $params->{'breedingid'}, + duplicatetitle => $duplicatetitle, + ); + + output_html_with_http_headers $input, $cookie, $template->output; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl new file mode 100644 index 0000000..c85f40f --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl @@ -0,0 +1,43 @@ + +Koha › Acquisitions › Basket <!-- TMPL_VAR NAME="basketno" --> › Duplicate warning + + + + + + + + + + + +

    + +
    + +
    +
    +
    + +

    Duplicate warning

    + +

    You selected a record from an external source that matches an existing record in your catalog!

    +

    Click Use Existing if you do not want to create a duplicate record, but you want to add an order from the existing record in your catalog. Click Create New if you still want to create a new record by importing the external (duplicate) record. Click Cancel to return to the basket without making a new order.

    +

    The existing catalog record can be viewed in a new window by clicking "> + +

    +
    + &basketno=&biblionumber='" /> + &basketno=&breedingid=&use_external_source=1'" /> + '" /> +
    +
    + +
    +
    +
    + +
    +
    + -- 1.7.2.3 From f.demians at tamil.fr Mon Feb 21 19:13:11 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Mon, 21 Feb 2011 19:13:11 +0100 Subject: [Koha-patches] [PATCH] Bug 3154 Limit facets computing on first 50 biblios Message-ID: <1298311991-8055-1-git-send-email-f.demians@tamil.fr> With this limitation to 50, we are sure that Fridolyn patch doesn't impact search performance. Branch: new/bug_3154 Now someone must add: - The ability to increase this number via a syspref, for example FacetFirstBiblios - The ability to hide facet count by syspref, for ex. FacetHideCount --- C4/Search.pm | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index ea76acd..371638d 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -457,12 +457,9 @@ sub getRecords { # Fill the facets while we're looping, but only for the biblioserver and not for a scan if ( !$scan && $servers[ $i - 1 ] =~ /biblioserver/ ) { - + my $facet_first_biblios = 50; #FIXME Should be a syspref my $jmax = $size; - if ( $jmax > 500 ) { - $jmax = 500; # limit to 500 first records - } - + $jmax = $facet_first_biblios if $jmax > $facet_first_biblios; for ( my $k = 0 ; $k <= @$facets ; $k++ ) { ($facets->[$k]) or next; my @fcodes = @{$facets->[$k]->{'tags'}}; -- 1.7.4 From chrisc at catalyst.net.nz Mon Feb 21 20:45:38 2011 From: chrisc at catalyst.net.nz (Chris Cormack) Date: Tue, 22 Feb 2011 08:45:38 +1300 Subject: [Koha-patches] [PATCH] Bug 5725 : Batch Modifications for Biblios Message-ID: <1298317538-8408-1-git-send-email-chrisc@catalyst.net.nz> Squashed commit of the following: commit 66282fed94564969f0368e27c7231116a2d1c0fe Author: Chris Cormack Date: Tue Feb 22 08:43:24 2011 +1300 Bug 5725 : Follow up fixing permissions thanks to Paul Poulain commit 4d0241aea5be13b00abbc6100dc98ec87f816081 Author: Paul Poulain Date: Mon Jan 10 17:22:31 2011 +0100 Bug 5725 follow up Owen noticed the batchedit was not working. This was because we made a patch months ago to change the GetBiblio API (the 1st returned arg is useless) This patch is not in main trunk, resulting in the error owen has noticed. This patch goes back to official API (even if it is clumsy : the patch we did does not apply anymore) commit 19b3e0ecc57af1c2151340328bf06e26882b7863 Author: Paul Poulain Date: Wed Dec 15 20:47:21 2010 +0100 Bug 5725 : MT #2991 (Feature) Batch biblio modifications This patch add a new feature of batch biblio modifications, it permit to select biblios from basket, and modify fields of them setting Rebased to fix whitespace issues. --- C4/Biblio.pm | 171 ++++++++++++++- koha-tmpl/intranet-tmpl/prog/en/js/basket.js | 6 + .../prog/en/modules/basket/basket.tmpl | 5 + .../prog/en/modules/tools/batchedit.tmpl | 231 ++++++++++++++++++++ tools/batchedit.pl | 222 +++++++++++++++++++ 5 files changed, 623 insertions(+), 12 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchedit.tmpl create mode 100755 tools/batchedit.pl diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8ea5da5..bafc2db 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -93,6 +93,8 @@ BEGIN { &ModBiblio &ModBiblioframework &ModZebra + + &BatchModField ); # To delete something @@ -376,7 +378,7 @@ sub ModBiblioframework { =head2 DelBiblio - my $error = &DelBiblio($dbh,$biblionumber); + my $error = &DelBiblio($biblionumber); Exported function (core API) for deleting a biblio in koha. Deletes biblio record from Zebra and Koha tables (biblio,biblioitems,items) @@ -1046,9 +1048,14 @@ The MARC record contains both biblio & item data. sub GetMarcBiblio { my $biblionumber = shift; + my $deletedtable = shift; my $dbh = C4::Context->dbh; - my $sth = $dbh->prepare("SELECT marcxml FROM biblioitems WHERE biblionumber=? "); - $sth->execute($biblionumber); + my $strsth = qq{SELECT marcxml FROM biblioitems WHERE biblionumber=?}; + $strsth .= qq{UNION SELECT marcxml FROM deletedbiblioitems WHERE biblionumber=?} if $deletedtable; + my $sth = $dbh->prepare($strsth); + my @params=($biblionumber); + push @params, $biblionumber if ($deletedtable); + $sth->execute(@params); my $row = $sth->fetchrow_hashref; my $marcxml = StripNonXmlChars( $row->{'marcxml'} ); MARC::File::XML->default_record_format( C4::Context->preference('marcflavour') ); @@ -1113,6 +1120,8 @@ sub GetCOinSBiblio { my $isbn = ''; my $issn = ''; my $publisher = ''; + my $place = ''; + my $tpages = ''; if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) { my $fmts6; @@ -1159,24 +1168,70 @@ sub GetCOinSBiblio { $genre = ( $mtx eq 'dc' ) ? "&rft.type=$genre" : "&rft.genre=$genre"; # Setting datas - $aulast = $record->subfield( '700', 'a' ); - $aufirst = $record->subfield( '700', 'b' ); - $oauthors = "&rft.au=$aufirst $aulast"; + + # authors + $aulast = $record->subfield( '700', 'a' ) || ''; + $aufirst = $record->subfield( '700', 'b' ) || ''; + + foreach my $field (qw/700 701/) { + my $author = ''; + $author = $record->subfield($field, 'a') || ''; + $author .= ", " . $record->subfield($field, 'b') if ($author and $record->subfield($field, 'b')); + $author .= " - " . join(' - ', $record->subfield($field, '4')) if ($record->subfield($field, '4')); + $author .= " (" . $record->subfield($field, 'f') . ")" if ($record->subfield($field, 'f')); + + $oauthors .= "&rft.au=$author" if ($author); + } + + foreach my $field (qw/710 711/) { + my $author = ''; + $author = $record->subfield($field, 'a') || ''; + $author .= ", " . $record->subfield($field, 'b') if ($author and $record->subfield($field, 'b')); + $author .= " - " . join(' - ', $record->subfield($field, '4')) if ($record->subfield($field, '4')); + $author .= " (" . $record->subfield($field, 'c') . ")" if ($record->subfield($field, 'c')); + + $oauthors .= "&rft.au=$author" if ($author); + } + # others authors if ( $record->field('200') ) { + for my $au ( $record->field('200')->subfield('f') ) { + $oauthors .= "&rft.au=$au"; + } for my $au ( $record->field('200')->subfield('g') ) { $oauthors .= "&rft.au=$au"; } + } + + # place + $place = join(" - ", $record->subfield('210', 'a')); + $place = "&rtf.place=$place" if ($place); + + # tpages + my $i = 0; + foreach my $field ($record->field('215')) { + $tpages .= " | " if ($i > 0); + $tpages .= join(" - ", $field->subfield('a')); + $tpages .= join(" ; ", $field->subfield('d')); + $tpages .= join(" + ", $field->subfield('e')); + $i++; + } + $tpages = "&rtf.tpages=$tpages" if ($tpages); + + # title + my $btitle = join(' ; ', $record->subfield('200', 'a')); + $btitle .= " : " . join(' : ', $record->subfield('200', 'e')) if ($record->subfield('200', 'e')); + $title = ( $mtx eq 'dc' ) ? "&rft.title=" . $record->subfield( '200', 'a' ) - : "&rft.title=" . $record->subfield( '200', 'a' ) . "&rft.btitle=" . $record->subfield( '200', 'a' ); - $pubyear = $record->subfield( '210', 'd' ); - $publisher = $record->subfield( '210', 'c' ); - $isbn = $record->subfield( '010', 'a' ); - $issn = $record->subfield( '011', 'a' ); + : "&rft.title=" . $record->subfield( '200', 'a' ) . "&rft.btitle=" . $btitle; + $pubyear = $record->subfield( '210', 'd' ) || ''; + $publisher = $record->subfield( '210', 'c' ) || ''; + $isbn = $record->subfield( '010', 'a' ) || ''; + $issn = $record->subfield( '011', 'a' ) || ''; } else { # MARC21 need some improve @@ -1205,7 +1260,7 @@ sub GetCOinSBiblio { } my $coins_value = -"ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3A$mtx$genre$title&rft.isbn=$isbn&rft.issn=$issn&rft.aulast=$aulast&rft.aufirst=$aufirst$oauthors&rft.pub=$publisher&rft.date=$pubyear"; +"ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3A$mtx$genre$title&rft.isbn=$isbn&rft.issn=$issn&rft.aulast=$aulast&rft.aufirst=$aufirst$oauthors&rft.pub=$publisher&rft.date=$pubyear$place$tpages"; $coins_value =~ s/(\ |&[^a])/\+/g; $coins_value =~ s/\"/\"\;/g; @@ -1750,6 +1805,7 @@ sub TransformHtmlToXml { @$values[$i] =~ s/>/>/g; @$values[$i] =~ s/"/"/g; @$values[$i] =~ s/'/'/g; + @$values[$i] = NormalizeString(@$values[$i]); # if ( !utf8::is_utf8( @$values[$i] ) ) { # utf8::decode( @$values[$i] ); @@ -2313,7 +2369,9 @@ sub PrepareItemrecordDisplay { push @authorised_values, $branchcode; $authorised_lib{$branchcode} = $branchname; } + $defaultvalue = C4::Context->userenv->{branch}; } + $defaultvalue = C4::Context->userenv->{branch}; #----- itemtypes } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) { @@ -3461,6 +3519,95 @@ sub get_biblio_authorised_values { return $authorised_values; } +=head3 BatchModField + + Mod subfields in field record + + returns 1,$record if succeed + returns 0,$record if Action was not processed + returns -1 if no record + returns -2 if no action done on record + +=cut + +sub BatchModField { + my ( $record, $field, $subfield, $action, $condval, $nocond, $repval ) = @_; + + return -1 unless $record; + $condval=NormalizeString($condval); + my $condition=qr/$condval/; + + if($action eq "add"){ + for my $rfield ($record->field($field)){ + $rfield->add_subfields( $subfield => $repval ); + } + return 1; + }elsif($action eq "addfield"){ + my $new_field = MARC::Field->new($field,'','', + $subfield => $repval); + $record->insert_fields_ordered($new_field); + return 1; + } else { + my $done=0; + for my $rfield ($record->field($field)) { + if ($subfield && $subfield ne "@"){ + my @subfields = $rfield->subfields(); + my @subfields_to_add; + foreach my $subf (@subfields) { + if ($subf->[0] eq $subfield){ + $subf->[1]=NormalizeString($subf->[1]); + if ( $action eq "mod" ) { + if ( $nocond ne "true" && $subf->[1] =~ s/$condition/$repval/) { + $done=1; + } + if ($nocond eq "true"){ + $subf->[1] = $repval; + $done=1; + } + } elsif ( $action eq "del" ) { + if ( $subf->[1] =~ m/$condition/ || $nocond eq "true" ) { + $done=1; + next; + } + } + } + push @subfields_to_add,@$subf; + } + if ($done){ + if (@subfields_to_add){ + $rfield->replace_with(MARC::Field->new($rfield->tag,$rfield->indicator(1),$rfield->indicator(2), at subfields_to_add)); + } + else { + my $count= $record->delete_field($rfield); + } + } + } + else { + if ($action eq "del"){ + my $count=$record->delete_field($rfield); + $done=1; + } + else { + if ($field < 10){ + my $value=$record->field($field)->data(); + if ($value=~ s/$condition/$repval/){ + $record->field($field)->update($value); + $done=1; + + } + if ( $nocond eq 'true'){ + $record->field($field)->update($repval); + $done=1; + } + } + } + } + } + return ($done,$record); + } + return -2; +} + 1; __END__ diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js index 9946cf7..03dc306 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/basket.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/basket.js @@ -433,4 +433,10 @@ $(document).ready(function(){ if(basketcount){ updateBasket(basketcount); } }); +function batchEdit(){ + var valCookie = readCookie(nameCookie); + var strCookie = nameParam + "=" + valCookie; + var loc = CGIBIN + "tools/batchedit.pl?" + strCookie; + window.opener.location = loc; +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl index d3d83ac..6699bde 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl @@ -86,6 +86,11 @@ function placeHold () { Brief DisplayMore Details +
  • + + Batch Edit + +
  • Send diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchedit.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchedit.tmpl new file mode 100644 index 0000000..f7b7589 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batchedit.tmpl @@ -0,0 +1,231 @@ + +Koha › Tools › Batch Deletion of Items + + + + + + + + + + + +
    +
    +
    +
    + +
    + +

    Batch records modification

    +
    + Use a file +
      +
    1. +
    +
    +
    + Or enter records one by one +
      +
    1. + + +
    2. +
    +
    + +

    List of records:

    + + + + + + + + + + + + + + + + +
    BiblionumberTitleAuthor Status
    + + + + OK + Nothing done + Some Actions failed. List Follow :
    +
    + + + +
    All operations processed
    + + +
    +

    Modification rules:

    + + +" /> + + + + + + + + + + + + + + + + + + + +
    FieldSubfieldActionCondition ValueValue 
    + + + + + + + + All + + +
    + +
    +
    + +
    +
    +
    +
    + + diff --git a/tools/batchedit.pl b/tools/batchedit.pl new file mode 100755 index 0000000..ccc0323 --- /dev/null +++ b/tools/batchedit.pl @@ -0,0 +1,222 @@ +#!/usr/bin/perl + + +# Copyright 2010 SARL BibLibre +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use CGI; +use strict; +use C4::Output; +use C4::Auth; +use C4::Branch; +use C4::Koha; +use C4::Biblio; +use C4::Context; +use C4::Debug; +use JSON; + +my $input = new CGI; +my $dbh = C4::Context->dbh; + +my $filefh = $input->param('uploadfile'); +my $recordslist = $input->param('recordslist'); +my $bib_list = $input->param('bib_list'); +my @biblionumbers; + +if ($filefh) { + while ( my $biblionumber = <$filefh> ) { + $biblionumber =~ s/[\r\n]*$//g; + push @biblionumbers, $biblionumber if $biblionumber; + } +} elsif ($recordslist) { + push @biblionumbers, split( /\s\n/, $recordslist ); +} elsif ($bib_list) { + push @biblionumbers, split('/', $bib_list); +} + +my $op = $input->param('op'); +my ($template, $loggedinuser, $cookie); + +my $frameworkcode=""; +my $tagslib = &GetMarcStructure(1,$frameworkcode); +my %report_actions; + +if($input->param('field') and not defined $op){ + ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "acqui/ajax.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => "batchedit", + }); + + + my $tag = $input->param('field'); + my $subfield = $input->param('subfield'); + + if($input->param('subfield')){ + my $branches = GetBranchesLoop(); + + my @authorised_values; + if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) { + if ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "branches" ) { + foreach my $thisbranch (@$branches) { + push @authorised_values, { + code => $thisbranch->{value}, + value => $thisbranch->{branchname}, + }; + # $value = $thisbranch->{value} if $thisbranch->{selected}; + } + }elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) { + my $sth = $dbh->prepare("SELECT itemtype,description FROM itemtypes ORDER BY description"); + $sth->execute(); + while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) { + push @authorised_values, { + code => $itemtype, + value => $description, + }; + } + + }else { + # Getting the fields where the item location is + my ($location_field, $location_subfield) = GetMarcFromKohaField('items.location', $frameworkcode); + + # Getting the name of the authorised values' category for item location + my $item_location_category = $tagslib->{$location_field}->{$location_subfield}->{'authorised_value'}; + # Are we dealing with item location ? + my $item_location = ($tagslib->{$tag}->{$subfield}->{authorised_value} eq $item_location_category) ? 1 : 0; + + # If so, we sort by authorised_value, else by libelle + my $orderby = $item_location ? 'authorised_value' : 'lib'; + + my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY $orderby"); + + $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value}); + + + while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { + push @authorised_values, { + code => $value, + value => ($item_location) ? $value . " - " . $lib : $lib, + }; + + } + } + } + $template->param('return' => to_json(\@authorised_values)); + }else{ + my @modifiablesubf; + + foreach my $subfield (sort keys %{$tagslib->{$tag}}) { + next if subfield_is_koha_internal_p($subfield); + next if $subfield eq "@"; + next if ($tagslib->{$tag}->{$subfield}->{'tab'} eq "10"); + my %subfield_data; + $subfield_data{subfield} = $subfield; + push @modifiablesubf, \%subfield_data; + } + $template->param('return' => to_json(\@modifiablesubf)); + } + + + output_html_with_http_headers $input, $cookie, $template->output; + exit; +}else{ + ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "tools/batchedit.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => { tools => "batchedit" }, + }); + + $template->param( inputform => 1, ) unless @biblionumbers; + + if(!defined $op) { + my @modifiablefields; + + foreach my $tag (sort keys %{$tagslib}) { + my %subfield_data; + foreach my $subfield (sort keys %{$tagslib->{$tag}}) { + next if $subfield_data{tag}; + next if subfield_is_koha_internal_p($subfield); + next if ($tagslib->{$tag}->{$subfield}->{'tab'} eq "10"); + + $subfield_data{tag} = $tag; + + push @modifiablefields, \%subfield_data; + } + } + + $template->param( marcfields => \@modifiablefields, + bib_list => $input->param('bib_list'), + ); + + }else{ + my @fields = $input->param('field'); + my @subfields = $input->param('subfield'); + my @actions = $input->param('action'); + my @condvals = $input->param('condval'); + my @nocondvals = $input->param('nocondval'); + my @repvals = $input->param('repval'); + foreach my $biblionumber ( @biblionumbers ){ + my $record = GetMarcBiblio($biblionumber); + my ($count, $biblio) = GetBiblio($biblionumber); + my $report = 0; + my @failed_actions; + for(my $i = 0 ; $i < scalar(@fields) ; $i++ ){ + my $field = $fields[$i]; + my $subfield = $subfields[$i]; + my $action = $actions[$i]; + my $condval = $condvals[$i]; + my $nocond = $nocondvals[$i]; + my $repval = $repvals[$i]; + + my ($result,$record) = BatchModField($record, $field, $subfield, $action, $condval, $nocond, $repval); + push @failed_actions, {action=>"$field $subfield $action ".($nocond eq "true"?"all":$condval)." $repval"} if ($result<=0); + } + if (@failed_actions == scalar(@fields)){ + $report_actions{$biblionumber}->{status}="No_Actions"; + } + elsif (@failed_actions>0 and @failed_actions < scalar(@fields)){ + $report_actions{$biblionumber}->{status}="Actions_Failed"; + $report_actions{$biblionumber}->{failed_actions}=\@failed_actions; + } + elsif (@failed_actions == 0){ + $report_actions{$biblionumber}->{status}="OK"; + } + ModBiblio($record, $biblionumber, $biblio->{frameworkcode}) unless ($report); + } + $template->param('moddone' => 1); + } + +} + +my @biblioinfos; + +for my $biblionumber (@biblionumbers){ + my ($count,$biblio) = GetBiblio($biblionumber); + if (defined $op){ + $biblio->{$report_actions{$biblionumber}->{status}}=1; + $biblio->{failed_actions}=$report_actions{$biblionumber}->{failed_actions}; + } + push @biblioinfos, $biblio; +} + +$template->param(biblioinfos => \@biblioinfos); +output_html_with_http_headers $input, $cookie, $template->output; +exit; -- 1.7.1 From nengard at bywatersolutions.com Sat Feb 19 11:38:32 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sat, 19 Feb 2011 05:38:32 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 3319 Followup: Fix compatibility with fix for bug 4945 Message-ID: <1298111912-15311-1-git-send-email-nengard@bywatersolutions.com> From: Ian Walls The fix for 3319 overwrote the @branchloop variable with output from GetBranchesLoop, which forces a selected branch. Removing the extra call, and just measuring the size of @branchloop as it was build, plus some dereferencing, fixes the issue. Signed-off-by: Nicole C. Engard --- members/members-home.pl | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/members/members-home.pl b/members/members-home.pl index 6cb60fa..00c6034 100755 --- a/members/members-home.pl +++ b/members/members-home.pl @@ -54,13 +54,12 @@ foreach (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} my @categories; my $no_categories; my $no_add = 0; -my $branchloop = (defined $branch?GetBranchesLoop($branch):GetBranchesLoop()); -if(scalar(@$branchloop) < 1){ +if(scalar(@branchloop) < 1){ $no_add = 1; $template->param(no_branches => 1); } else { - $template->param(branchloop=>\@$branchloop); + $template->param(branchloop=>\@branchloop); } @categories=C4::Category->all; -- 1.7.2.3 From tomascohen at gmail.com Tue Feb 22 20:48:34 2011 From: tomascohen at gmail.com (Tomas Cohen Arazi) Date: Tue, 22 Feb 2011 16:48:34 -0300 Subject: [Koha-patches] [PATCH] [Bug 5791] Robust handling of deleted biblios/authorities Message-ID: <1298404114-13936-1-git-send-email-tomascohen@gmail.com> --- authorities/detail.pl | 110 +++++++++++--------- catalogue/detail.pl | 21 +++-- .../prog/en/modules/authorities/detail.tmpl | 98 +++++++++--------- .../prog/en/modules/catalogue/detail.tmpl | 11 ++- 4 files changed, 131 insertions(+), 109 deletions(-) diff --git a/authorities/detail.pl b/authorities/detail.pl index f92e04b..9849f31 100755 --- a/authorities/detail.pl +++ b/authorities/detail.pl @@ -175,53 +175,65 @@ my $authid = $query->param('authid'); my $authtypecode = &GetAuthTypeCode($authid); -$tagslib = &GetTagsLabels(1,$authtypecode); - -my $record; -if (C4::Context->preference("AuthDisplayHierarchy")){ - my $trees=BuildUnimarcHierarchies($authid); - my @trees = split /;/,$trees ; - push @trees,$trees unless (@trees); - my @loophierarchies; - foreach my $tree (@trees){ - my @tree=split /,/,$tree; - push @tree,$tree unless (@tree); - my $cnt=0; - my @loophierarchy; - foreach my $element (@tree){ - my $elementdata = GetAuthority($element); - $record= $elementdata if ($authid==$element); - push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid); - $cnt++; - } - push @loophierarchies, { 'loopelement' =>\@loophierarchy}; - } - $template->param( - 'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"), - 'loophierarchies' =>\@loophierarchies, - ); -} else { - $record=GetAuthority($authid); -} -my $count = CountUsage($authid); - -# find the marc field/subfield used in biblio by this authority -my $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?"); -$sth->execute($authtypecode); -my $biblio_fields; -while (my ($tagfield) = $sth->fetchrow) { - $biblio_fields.= $tagfield."9,"; -} -chop $biblio_fields; +if ( defined $authtypecode ) { + # authid is valid + $tagslib = &GetTagsLabels(1,$authtypecode); + + my $record; + if (C4::Context->preference("AuthDisplayHierarchy")){ + my $trees=BuildUnimarcHierarchies($authid); + my @trees = split /;/,$trees ; + push @trees,$trees unless (@trees); + my @loophierarchies; + foreach my $tree (@trees){ + my @tree=split /,/,$tree; + push @tree,$tree unless (@tree); + my $cnt=0; + my @loophierarchy; + foreach my $element (@tree){ + my $elementdata = GetAuthority($element); + $record= $elementdata if ($authid==$element); + push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid); + $cnt++; + } + push @loophierarchies, { 'loopelement' =>\@loophierarchy}; + } + $template->param( + 'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"), + 'loophierarchies' =>\@loophierarchies, + ); + } else { + $record=GetAuthority($authid); + } + + my $count = CountUsage($authid); + + # find the marc field/subfield used in biblio by this authority + my $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?"); + $sth->execute($authtypecode); + my $biblio_fields; + while (my ($tagfield) = $sth->fetchrow) { + $biblio_fields.= $tagfield."9,"; + } + chop $biblio_fields; + + # loop through each tab 0 through 9 + # for (my $tabloop = 0; $tabloop<=10;$tabloop++) { + # loop through each tag + build_tabs ($template, $record, $dbh,"",$query); + + $template->param(authid => $authid, + count => $count, + biblio_fields => $biblio_fields, + ); -# fill arrays -my @loop_data =(); -my $tag; -# loop through each tab 0 through 9 -# for (my $tabloop = 0; $tabloop<=10;$tabloop++) { -# loop through each tag - build_tabs ($template, $record, $dbh,"",$query); +} else { + # authid invalid + # set default $authtypecode + $authtypecode = ''; + $template->param ( errauthid => $authid,unknownauthid => 1 ); +} my $authtypes = getauthtypes; my @authtypesloop; @@ -233,11 +245,9 @@ foreach my $thisauthtype (sort { $authtypes->{$b} cmp $authtypes->{$a} } keys %$ push @authtypesloop, \%row; } -$template->param(authid => $authid, - count => $count, - biblio_fields => $biblio_fields, +$template->param ( authtypetext => $authtypes->{$authtypecode}{'authtypetext'}, authtypesloop => \@authtypesloop, - ); -output_html_with_http_headers $query, $cookie, $template->output; +); +output_html_with_http_headers $query, $cookie, $template->output; \ No newline at end of file diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 6ee79e6..6682482 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -52,11 +52,21 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( ); my $biblionumber = $query->param('biblionumber'); -my $fw = GetFrameworkCode($biblionumber); ## get notes and subjects from MARC record -my $marcflavour = C4::Context->preference("marcflavour"); -my $record = GetMarcBiblio($biblionumber); +my $record = GetMarcBiblio($biblionumber); + +if ( not defined $record ) { + # biblionumber invalid -> report and exit + $template->param( unknownbiblionumber => 1, + biblionumber => $biblionumber + ); + output_html_with_http_headers $query, $cookie, $template->output; + exit; +} + +my $fw = GetFrameworkCode($biblionumber); +my $marcflavour = C4::Context->preference("marcflavour"); # XSLT processing of some stuff if (C4::Context->preference("XSLTDetailsDisplay") ) { @@ -81,11 +91,6 @@ $template->param( normalized_isbn => $isbn, ); -unless (defined($record)) { - print $query->redirect("/cgi-bin/koha/errors/404.pl"); - exit; -} - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl index 417581c..c51e697 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tmpl @@ -1,5 +1,5 @@ -Koha › Authorities › Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->) +Koha › Authorities › <!-- TMPL_IF NAME="unknownauthid" --> Unknown authority<!-- TMPL_ELSE -->Details for Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)<!-- /TMPL_IF --> @@ -21,7 +21,7 @@ - +
    @@ -29,7 +29,7 @@
    -

    Reading Record

    +

    Circulation History

    " />
    -- 1.7.2.3 From ruth at bywatersolutions.com Wed Feb 23 14:46:40 2011 From: ruth at bywatersolutions.com (ruth at bywatersolutions.com) Date: Wed, 23 Feb 2011 08:46:40 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF 2/2] Bug 5792 - Add reference icon to Bridge icon set Message-ID: <1298468800-1785-1-git-send-email-ruth@bywatersolutions.com> From: Nicole C. Engard Signed-off-by: D Ruth Bavousett --- .../prog/img/itemtypeimg/bridge/reference.gif | Bin 0 -> 1870 bytes .../prog/itemtypeimg/bridge/reference.gif | Bin 0 -> 1870 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/bridge/reference.gif create mode 100644 koha-tmpl/opac-tmpl/prog/itemtypeimg/bridge/reference.gif diff --git a/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/bridge/reference.gif b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/bridge/reference.gif new file mode 100644 index 0000000000000000000000000000000000000000..8400aa8db79208b4348376a696440096eec75e18 GIT binary patch literal 1870 zcmeHG?NgHZ0{uPkh at dEsfB~W at O39{`vQD|Hx1I+#R~{I+_WB zWUVU{yOGt3FKyO1DU*A1HfI6>!?woSbj7ri^(E6&Y5%O zB#9GaKauhP54-^%u(q~#?AWo1 at rUJy%Ma{7u)MUq^vBZk#pe?bC$vr4s_JT)RQh^l zWqE1oj~6dqJb%9M?AiR&r%&hR=4NMSrl)^*xgI}yG&wQxaD05+>2!{b{Wdy!Z+Q65 zFTdOx92~UU`>tQVa{2Pbj*j!^&NZJst3Q3ZUafxr{{6dm at 7}(BySlpi=FOXxl at +(! z{qp6@#l^*ig at yU~`Ptdo>FH^g%k|{RlgE$O9Ue_iPL7R at jgF2!c<|u<{rkhi!*}oA zy?y)k(9n?GZns*k7K`QP&71xG{Wosh=<8dzz24i~d+pjalgZTG-F@}y)vm6tD_7RD zT)uSaQhR&5(P(UGX}NIWLUVJo!C*LZ=8Rsyp6;|xr)z3zYHVygdGcgKLxV=6QLEKT zrBb0#)YQ}*J$kgdy1J^Ws?(b3ztZ{NCgYeYmucz8IM%MA?;<#0H`!NGxnfowLL#bPlS z41a%r8ja at X=SQJXyuH0iBocu at fMFPi!$AF6}ud;=8W z?@J+hg6358QQJ3VOj}w&fT#6*ast44)rAqoVx1(dO?bi$lX_$x50v$|(N5?~HOBlB z{3A=Y?8i&a^X;pcQrfeWVUM}ykao2hFDfRhWW14}y2C=#7YIgBF?=$alblXXJ!{)u zB0$gX)d6fO^C7o&Y9{t8s-sqFw4Z2)KZm_cmI26r$E%G~na3BH0`LR91BW&N3SZXw zQxVdrB=7v$w-++%(5Pd;{82ItT0h={2=fVkryDxMLA>%YAwY;Oh>BmCP at _l!J+uO%_1w zt5r67Jc=6R00h%+03)1Q%EwMkuo^O>4$n1~R=~-ks|J{r03~2z0FDE3GU9 at 0xE+Fe zq~h?s4F at aQ96IO~;uU(pfYhCc49HXh{1k%Wi5^&eXxm?s{LSBelb%TSr;l%F#Y1vW zPgV at +M>Iku_XK&!S`3l*?;Z~1^O}XWqg#6KO^1jI(Yh8-gkmv?!O2x_?`GEi1Cj zMF7=gIt=sj3A^RG{l;Ilu ztF%#8I1t8E)YM3h&3E at yX)XJ+5UrUK94YnKkP*cZ`l7v%C{qFVT zktK=W`7$QTX{7&-U!7yL)c{aRy$1BgkIZjHfoM{g+tO43MD$@un-oBu=sy_NXsD-0L$1rxA4E_;bOasN5hc?R&(0f~&#nkA}DbDO|F T at 1@Y at QBCl+`&ASY5ybrsw1=Hs literal 0 HcmV?d00001 diff --git a/koha-tmpl/opac-tmpl/prog/itemtypeimg/bridge/reference.gif b/koha-tmpl/opac-tmpl/prog/itemtypeimg/bridge/reference.gif new file mode 100644 index 0000000000000000000000000000000000000000..8400aa8db79208b4348376a696440096eec75e18 GIT binary patch literal 1870 zcmeHG?NgHZ0{uPkh at dEsfB~W at O39{`vQD|Hx1I+#R~{I+_WB zWUVU{yOGt3FKyO1DU*A1HfI6>!?woSbj7ri^(E6&Y5%O zB#9GaKauhP54-^%u(q~#?AWo1 at rUJy%Ma{7u)MUq^vBZk#pe?bC$vr4s_JT)RQh^l zWqE1oj~6dqJb%9M?AiR&r%&hR=4NMSrl)^*xgI}yG&wQxaD05+>2!{b{Wdy!Z+Q65 zFTdOx92~UU`>tQVa{2Pbj*j!^&NZJst3Q3ZUafxr{{6dm at 7}(BySlpi=FOXxl at +(! z{qp6@#l^*ig at yU~`Ptdo>FH^g%k|{RlgE$O9Ue_iPL7R at jgF2!c<|u<{rkhi!*}oA zy?y)k(9n?GZns*k7K`QP&71xG{Wosh=<8dzz24i~d+pjalgZTG-F@}y)vm6tD_7RD zT)uSaQhR&5(P(UGX}NIWLUVJo!C*LZ=8Rsyp6;|xr)z3zYHVygdGcgKLxV=6QLEKT zrBb0#)YQ}*J$kgdy1J^Ws?(b3ztZ{NCgYeYmucz8IM%MA?;<#0H`!NGxnfowLL#bPlS z41a%r8ja at X=SQJXyuH0iBocu at fMFPi!$AF6}ud;=8W z?@J+hg6358QQJ3VOj}w&fT#6*ast44)rAqoVx1(dO?bi$lX_$x50v$|(N5?~HOBlB z{3A=Y?8i&a^X;pcQrfeWVUM}ykao2hFDfRhWW14}y2C=#7YIgBF?=$alblXXJ!{)u zB0$gX)d6fO^C7o&Y9{t8s-sqFw4Z2)KZm_cmI26r$E%G~na3BH0`LR91BW&N3SZXw zQxVdrB=7v$w-++%(5Pd;{82ItT0h={2=fVkryDxMLA>%YAwY;Oh>BmCP at _l!J+uO%_1w zt5r67Jc=6R00h%+03)1Q%EwMkuo^O>4$n1~R=~-ks|J{r03~2z0FDE3GU9 at 0xE+Fe zq~h?s4F at aQ96IO~;uU(pfYhCc49HXh{1k%Wi5^&eXxm?s{LSBelb%TSr;l%F#Y1vW zPgV at +M>Iku_XK&!S`3l*?;Z~1^O}XWqg#6KO^1jI(Yh8-gkmv?!O2x_?`GEi1Cj zMF7=gIt=sj3A^RG{l;Ilu ztF%#8I1t8E)YM3h&3E at yX)XJ+5UrUK94YnKkP*cZ`l7v%C{qFVT zktK=W`7$QTX{7&-U!7yL)c{aRy$1BgkIZjHfoM{g+tO43MD$@un-oBu=sy_NXsD-0L$1rxA4E_;bOasN5hc?R&(0f~&#nkA}DbDO|F T at 1@Y at QBCl+`&ASY5ybrsw1=Hs literal 0 HcmV?d00001 -- 1.7.2.3 From M.de.Rooy at rijksmuseum.nl Thu Feb 24 11:36:21 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Thu, 24 Feb 2011 10:36:21 +0000 Subject: [Koha-patches] [PATCH] 3154 Preference for building facets Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F4D52@S-MAIL-1B.rijksmuseum.intra> Patch from Fridolyn Somers with input of Frederic Demians. I only added new Searching preference maxRecordsForFacets. This pref contains number of result records used in facet building. Pref not needed in update script; default 20 is used if it should not yet exist. --- C4/Search.pm | 72 +++++++++++++------- .../en/modules/admin/preferences/searching.pref | 6 ++ 2 files changed, 53 insertions(+), 25 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a469948..a33e5e2 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -309,6 +309,7 @@ sub getRecords { my $facets_counter = (); my $facets_info = (); my $facets = getFacets(); + my $facets_maxrecs = C4::Context->preference('maxRecordsForFacets')||20; my @facets_loop; # stores the ref to array of hashes for template facets loop @@ -418,7 +419,6 @@ sub getRecords { for ( my $j = $offset ; $j < $times ; $j++ ) { my $records_hash; my $record; - my $facet_record; ## Check if it's an index scan if ($scan) { @@ -451,33 +451,55 @@ sub getRecords { # warn "RECORD $j:".$record; $results_hash->{'RECORDS'}[$j] = $record; - - # Fill the facets while we're looping, but only for the biblioserver - $facet_record = MARC::Record->new_from_usmarc($record) - if $servers[ $i - 1 ] =~ /biblioserver/; - - #warn $servers[$i-1]."\n".$record; #.$facet_record->title(); - if ($facet_record) { - for ( my $k = 0 ; $k <= @$facets ; $k++ ) { - ($facets->[$k]) or next; - my @fields = map {$facet_record->field($_)} @{$facets->[$k]->{'tags'}} ; - for my $field (@fields) { - my @subfields = $field->subfields(); - for my $subfield (@subfields) { - my ( $code, $data ) = @$subfield; - ($code eq $facets->[$k]->{'subfield'}) or next; - $facets_counter->{ $facets->[$k]->{'link_value'} }->{$data}++; - } - } - $facets_info->{ $facets->[$k]->{'link_value'} }->{'label_value'} = - $facets->[$k]->{'label_value'}; - $facets_info->{ $facets->[$k]->{'link_value'} }->{'expanded'} = - $facets->[$k]->{'expanded'}; - } - } } + } $results_hashref->{ $servers[ $i - 1 ] } = $results_hash; + + # Fill the facets while we're looping, but only for the biblioserver and not for a scan + if ( !$scan && $servers[ $i - 1 ] =~ /biblioserver/ ) { + + my $jmax = $size>$facets_maxrecs? $facets_maxrecs: $size; + + for ( my $k = 0 ; $k <= @$facets ; $k++ ) { + ($facets->[$k]) or next; + my @fcodes = @{$facets->[$k]->{'tags'}}; + my $sfcode = $facets->[$k]->{'subfield'}; + + for ( my $j = 0 ; $j < $jmax ; $j++ ) { + my $render_record = $results[ $i - 1 ]->record($j)->render(); + my @used_datas = (); + + foreach my $fcode (@fcodes) { + + # avoid first line + my $field_pattern = '\n'.$fcode.' ([^\n]+)'; + my @field_tokens = ( $render_record =~ /$field_pattern/g ) ; + + foreach my $field_token (@field_tokens) { + my $subfield_pattern = '\$'.$sfcode.' ([^\$]+)'; + my @subfield_values = ( $field_token =~ /$subfield_pattern/g ); + + foreach my $subfield_value (@subfield_values) { + + my $data = $subfield_value; + $data =~ s/^\s+//; # trim left + $data =~ s/\s+$//; # trim right + + unless ( $data ~~ @used_datas ) { + $facets_counter->{ $facets->[$k]->{'link_value'} }->{$data}++; + push @used_datas, $data; + } + } # subfields + } # fields + } # field codes + } # records + + $facets_info->{ $facets->[$k]->{'link_value'} }->{'label_value'} = $facets->[$k]->{'label_value'}; + $facets_info->{ $facets->[$k]->{'link_value'} }->{'expanded'} = $facets->[$k]->{'expanded'}; + } # facets + } + # End PROGILONE } # warn "connection ", $i-1, ": $size hits"; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index cd924dc..ba969ae 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -122,6 +122,12 @@ Searching: class: integer - items per biblio in the search results - + - Build facets based on + - pref: maxRecordsForFacets + class: integer + default: 20 + - records from the search results. + - - By default, show - pref: OPACnumSearchResults class: integer -- 1.6.0.6 From M.de.Rooy at rijksmuseum.nl Thu Feb 24 11:54:35 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Thu, 24 Feb 2011 10:54:35 +0000 Subject: [Koha-patches] [PATCH] 3154 Preference for building facets In-Reply-To: <028B1A54D03E7B4482CDCA4EC8F06BFD01085E5A@Bodensee.bsz-bw.de> References: <809BE39CD64BFD4EB9036172EBCCFA311F4D52@S-MAIL-1B.rijksmuseum.intra> <028B1A54D03E7B4482CDCA4EC8F06BFD01085E5A@Bodensee.bsz-bw.de> Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F4D73@S-MAIL-1B.rijksmuseum.intra> Thanks for responding. Did not update the sql files and update script, because I hardcoded the default in the pref file and the Search module. Hoped to make that clear in the patch comments. So it is not really necessary. As soon as a user changes the pref, it will be saved in the db anyway. Lazy programmer ;) Marcel -----Oorspronkelijk bericht----- Van: Fischer, Katrin [mailto:Katrin.Fischer at bsz-bw.de] Verzonden: donderdag 24 februari 2011 11:45 Aan: Marcel de Rooy Onderwerp: RE: [Koha-patches] [PATCH] 3154 Preference for building facets Hi Marcel, I was looking at your patch and I think the syspref is not correctly implemented. Chris Cormack (rangi) explained on IRC yesterday what needs to be done: http://stats.workbuffer.org/irclog/koha/2011-02-23#i_605609 Hope this is helpful for you. Katrin > -----Original Message----- > From: koha-patches-bounces at lists.koha-community.org [mailto:koha- > patches-bounces at lists.koha-community.org] On Behalf Of Marcel de Rooy > Sent: Thursday, February 24, 2011 11:36 AM > To: koha-patches at lists.koha-community.org > Cc: Fr?d?ric DEMIANS; Fridolyn SOMERS > Subject: [Koha-patches] [PATCH] 3154 Preference for building facets > > Patch from Fridolyn Somers with input of Frederic Demians. > I only added new Searching preference maxRecordsForFacets. > This pref contains number of result records used in facet building. > Pref not needed in update script; default 20 is used if it should not > yet exist. > --- > C4/Search.pm | 72 > +++++++++++++------- > .../en/modules/admin/preferences/searching.pref | 6 ++ > 2 files changed, 53 insertions(+), 25 deletions(-) > > diff --git a/C4/Search.pm b/C4/Search.pm > index a469948..a33e5e2 100644 > --- a/C4/Search.pm > +++ b/C4/Search.pm > @@ -309,6 +309,7 @@ sub getRecords { > my $facets_counter = (); > my $facets_info = (); > my $facets = getFacets(); > + my $facets_maxrecs = C4::Context- > >preference('maxRecordsForFacets')||20; > > my @facets_loop; # stores the ref to array of hashes for > template facets loop > > @@ -418,7 +419,6 @@ sub getRecords { > for ( my $j = $offset ; $j < $times ; $j++ ) { > my $records_hash; > my $record; > - my $facet_record; > > ## Check if it's an index scan > if ($scan) { > @@ -451,33 +451,55 @@ sub getRecords { > > # warn "RECORD $j:".$record; > $results_hash->{'RECORDS'}[$j] = $record; > - > - # Fill the facets while we're looping, but only for the > biblioserver > - $facet_record = MARC::Record- > >new_from_usmarc($record) > - if $servers[ $i - 1 ] =~ /biblioserver/; > - > - #warn $servers[$i-1]."\n".$record; > #.$facet_record->title(); > - if ($facet_record) { > - for ( my $k = 0 ; $k <= @$facets ; $k++ ) > { > - ($facets->[$k]) or next; > - my @fields = map {$facet_record- > >field($_)} @{$facets->[$k]->{'tags'}} ; > - for my $field (@fields) { > - my @subfields = $field- > >subfields(); > - for my $subfield (@subfields) { > - my ( $code, $data ) = > @$subfield; > - ($code eq $facets->[$k]- > >{'subfield'}) or next; > - $facets_counter->{ $facets- > >[$k]->{'link_value'} }->{$data}++; > - } > - } > - $facets_info->{ $facets->[$k]- > >{'link_value'} }->{'label_value'} = > - $facets->[$k]->{'label_value'}; > - $facets_info->{ $facets->[$k]- > >{'link_value'} }->{'expanded'} = > - $facets->[$k]->{'expanded'}; > - } > - } > } > + > } > $results_hashref->{ $servers[ $i - 1 ] } = > $results_hash; > + > + # Fill the facets while we're looping, but only for > the biblioserver and not for a scan > + if ( !$scan && $servers[ $i - 1 ] =~ /biblioserver/ ) > { > + > + my $jmax = $size>$facets_maxrecs? $facets_maxrecs: > $size; > + > + for ( my $k = 0 ; $k <= @$facets ; $k++ ) { > + ($facets->[$k]) or next; > + my @fcodes = @{$facets->[$k]->{'tags'}}; > + my $sfcode = $facets->[$k]->{'subfield'}; > + > + for ( my $j = 0 ; $j < $jmax ; $j++ ) { > + my $render_record = $results[ $i - 1 ]- > >record($j)->render(); > + my @used_datas = (); > + > + foreach my $fcode (@fcodes) { > + > + # avoid first line > + my $field_pattern = '\n'.$fcode.' > ([^\n]+)'; > + my @field_tokens = ( $render_record =~ > /$field_pattern/g ) ; > + > + foreach my $field_token > (@field_tokens) { > + my $subfield_pattern = > '\$'.$sfcode.' ([^\$]+)'; > + my @subfield_values = ( > $field_token =~ /$subfield_pattern/g ); > + > + foreach my $subfield_value > (@subfield_values) { > + > + my $data = $subfield_value; > + $data =~ s/^\s+//; # trim left > + $data =~ s/\s+$//; # trim > right > + > + unless ( $data ~~ @used_datas > ) { > + $facets_counter->{ > $facets->[$k]->{'link_value'} }->{$data}++; > + push @used_datas, $data; > + } > + } # subfields > + } # fields > + } # field codes > + } # records > + > + $facets_info->{ $facets->[$k]->{'link_value'} > }->{'label_value'} = $facets->[$k]->{'label_value'}; > + $facets_info->{ $facets->[$k]->{'link_value'} > }->{'expanded'} = $facets->[$k]->{'expanded'}; > + } # facets > + } > + # End PROGILONE > } > > # warn "connection ", $i-1, ": $size hits"; > diff --git a/koha-tmpl/intranet- > tmpl/prog/en/modules/admin/preferences/searching.pref b/koha- > tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref > index cd924dc..ba969ae 100644 > --- a/koha-tmpl/intranet- > tmpl/prog/en/modules/admin/preferences/searching.pref > +++ b/koha-tmpl/intranet- > tmpl/prog/en/modules/admin/preferences/searching.pref > @@ -122,6 +122,12 @@ Searching: > class: integer > - items per biblio in the search results > - > + - Build facets based on > + - pref: maxRecordsForFacets > + class: integer > + default: 20 > + - records from the search results. > + - > - By default, show > - pref: OPACnumSearchResults > class: integer > -- > 1.6.0.6 > > _______________________________________________ > Koha-patches mailing list > Koha-patches at lists.koha-community.org > http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches > website : http://www.koha-community.org/ > git : http://git.koha-community.org/ > bugs : http://bugs.koha-community.org/ > From oleonard at myacpl.org Thu Feb 24 19:07:53 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 24 Feb 2011 13:07:53 -0500 Subject: [Koha-patches] [PATCH] Follow-up fix for Bug 4885 - Only 1 ISBN shows in non-XSL detail view Message-ID: <1298570873-7597-1-git-send-email-oleonard@myacpl.org> Fix for Bug 5551 overwrote the necessary changes to opac-detail.pl --- opac/opac-detail.pl | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 0685e13..3344e4b 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -198,6 +198,7 @@ for my $itm (@items) { my $dbh = C4::Context->dbh; my $marcflavour = C4::Context->preference("marcflavour"); my $marcnotesarray = GetMarcNotes ($record,$marcflavour); +my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); @@ -210,6 +211,7 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib MARCAUTHORS => $marcauthorsarray, MARCSERIES => $marcseriesarray, MARCURLS => $marcurlsarray, + MARCISBNS => $marcisbnsarray, norequests => $norequests, RequestOnOpac => C4::Context->preference("RequestOnOpac"), itemdata_ccode => $itemfields{ccode}, -- 1.7.3 From oleonard at myacpl.org Thu Feb 24 20:37:39 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 24 Feb 2011 14:37:39 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5804 - duplicate warning when ordering needs design work Message-ID: <1298576259-8486-1-git-send-email-oleonard@myacpl.org> --- .../en/modules/acqui/neworderempty_duplicate.tmpl | 60 +++++++++++++++----- 1 files changed, 45 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl index c85f40f..7203526 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl @@ -1,11 +1,6 @@ Koha › Acquisitions › Basket <!-- TMPL_VAR NAME="basketno" --> › Duplicate warning - - - - @@ -20,19 +15,54 @@
    -

    Duplicate warning

    +
    +

    Duplicate warning

    +

    You selected a record from an external source that matches an existing record in your catalog: "> +"> +"> +">

    +
    -

    You selected a record from an external source that matches an existing record in your catalog!

    -

    Click Use Existing if you do not want to create a duplicate record, but you want to add an order from the existing record in your catalog. Click Create New if you still want to create a new record by importing the external (duplicate) record. Click Cancel to return to the basket without making a new order.

    -

    The existing catalog record can be viewed in a new window by clicking "> +

    +
    +
    +
    +

    Use existing record

    +

    Do not create a duplicate record. Add an order from the existing record in your catalog.

    +" /> +" /> +" /> + +
    +
    +
    -
    -
    - &basketno=&biblionumber='" /> - &basketno=&breedingid=&use_external_source=1'" /> - '" /> -
    +
    +
    + +

    Cancel and return to order

    +

    Return to the basket without making a new order.

    +" /> + +
    +
    + +
    +
    +
    +

    Crete new record

    +

    Create a new record by importing the external (duplicate) record.

    +" /> +" /> +" /> + + +
    +
    +
    + +
    -- 1.7.3 From nengard at bywatersolutions.com Sun Feb 20 18:14:57 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 12:14:57 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5723: Font for 780s on staff client shrinks Message-ID: <1298222097-23079-1-git-send-email-nengard@bywatersolutions.com> From: Jared Camins-Esakov This patch fixes the bug that caused 780s in the staff client details XSLT to display in progressively smaller fonts. This also corrects the semantics of the 780 ind1. Signed-off-by: Nicole C. Engard --- .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index 952c41e..e3009d8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -579,6 +579,7 @@ + @@ -625,12 +626,11 @@ - - + - - + + -- 1.7.2.3 From nengard at bywatersolutions.com Sun Feb 20 18:18:50 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 12:18:50 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5804 - duplicate warning when ordering needs design work Message-ID: <1298222330-23260-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard Signed-off-by: Nicole C. Engard --- .../en/modules/acqui/neworderempty_duplicate.tmpl | 60 +++++++++++++++----- 1 files changed, 45 insertions(+), 15 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl index c85f40f..7203526 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl @@ -1,11 +1,6 @@ Koha › Acquisitions › Basket <!-- TMPL_VAR NAME="basketno" --> › Duplicate warning - - - - @@ -20,19 +15,54 @@
    -

    Duplicate warning

    +
    +

    Duplicate warning

    +

    You selected a record from an external source that matches an existing record in your catalog: "> +"> +"> +">

    +
    -

    You selected a record from an external source that matches an existing record in your catalog!

    -

    Click Use Existing if you do not want to create a duplicate record, but you want to add an order from the existing record in your catalog. Click Create New if you still want to create a new record by importing the external (duplicate) record. Click Cancel to return to the basket without making a new order.

    -

    The existing catalog record can be viewed in a new window by clicking "> +

    +
    +
    +
    +

    Use existing record

    +

    Do not create a duplicate record. Add an order from the existing record in your catalog.

    +" /> +" /> +" /> + +
    +
    +
    -
    -
    - &basketno=&biblionumber='" /> - &basketno=&breedingid=&use_external_source=1'" /> - '" /> -
    +
    +
    + +

    Cancel and return to order

    +

    Return to the basket without making a new order.

    +" /> + +
    +
    + +
    +
    +
    +

    Crete new record

    +

    Create a new record by importing the external (duplicate) record.

    +" /> +" /> +" /> + + +
    +
    +
    + +
    -- 1.7.2.3 From nengard at bywatersolutions.com Sun Feb 20 18:20:25 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 12:20:25 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] BZ1883 follow-up Message-ID: <1298222425-23359-1-git-send-email-nengard@bywatersolutions.com> From: Paul Poulain solve comment 10 from nengard: This patch added these types only on upgrade. We need them to be added to new installs to. Signed-off-by: Nicole C. Engard --- installer/data/mysql/en/optional/auth_val.sql | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/installer/data/mysql/en/optional/auth_val.sql b/installer/data/mysql/en/optional/auth_val.sql index 12856d0..4c81325 100644 --- a/installer/data/mysql/en/optional/auth_val.sql +++ b/installer/data/mysql/en/optional/auth_val.sql @@ -51,3 +51,7 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('MANUA -- custom borrower notes INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_NOTES','ADDR','Address Notes'); + +-- OPAC Suggestions reasons +INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','The copy on the shelf is damaged','The copy on the shelf is damaged'); +INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Upcoming title by popular author','Upcoming title by popular author'); -- 1.7.2.3 From nengard at bywatersolutions.com Sun Feb 20 18:28:30 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 12:28:30 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Follow-up fix for Bug 4885 - Only 1 ISBN shows in non-XSL detail view Message-ID: <1298222910-23524-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard Fix for Bug 5551 overwrote the necessary changes to opac-detail.pl Signed-off-by: Nicole C. Engard --- opac/opac-detail.pl | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 0685e13..3344e4b 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -198,6 +198,7 @@ for my $itm (@items) { my $dbh = C4::Context->dbh; my $marcflavour = C4::Context->preference("marcflavour"); my $marcnotesarray = GetMarcNotes ($record,$marcflavour); +my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); @@ -210,6 +211,7 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib MARCAUTHORS => $marcauthorsarray, MARCSERIES => $marcseriesarray, MARCURLS => $marcurlsarray, + MARCISBNS => $marcisbnsarray, norequests => $norequests, RequestOnOpac => C4::Context->preference("RequestOnOpac"), itemdata_ccode => $itemfields{ccode}, -- 1.7.2.3 From oleonard at myacpl.org Thu Feb 24 21:28:36 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Thu, 24 Feb 2011 15:28:36 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5156, JavaScript error when adding list Message-ID: <1298579316-11163-1-git-send-email-oleonard@myacpl.org> --- .../prog/en/modules/virtualshelves/shelves.tmpl | 2 +- .../opac-tmpl/prog/en/modules/opac-shelves.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl index 6fb3efa..0b3bf2d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tmpl @@ -100,7 +100,7 @@ function placeHold () { } if (_alertString.length==0) { - document.f.submit(); + f.submit(); } else { alertString2 = _("Form not submitted because of the following problem(s)"); alertString2 += "\n------------------------------------------------------------------------------------\n\n"; diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl index 1e1d2d5..6b48ca0 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl @@ -125,7 +125,7 @@ $(function() { } if (_alertString.length==0) { - document.f.submit(); + f.submit(); } else { alertString2 = _("Form not submitted because of the following problem(s)"); alertString2 += "\n------------------------------------------------------------------------------------\n\n"; -- 1.7.3 From jcamins at bywatersolutions.com Thu Feb 24 22:33:38 2011 From: jcamins at bywatersolutions.com (Jared Camins-Esakov) Date: Thu, 24 Feb 2011 16:33:38 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 4852 - rewrite the query to include limits if using ccl= Message-ID: <1298583218-6293-1-git-send-email-jcamins@bywatersolutions.com> From: Robin Sheat Signed-off-by: Jared Camins-Esakov --- C4/Search.pm | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a469948..45ebb24 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1043,7 +1043,13 @@ sub buildQuery { # for handling ccl, cql, pqf queries in diagnostic mode, skip the rest of the steps # DIAGNOSTIC ONLY!! if ( $query =~ /^ccl=/ ) { - return ( undef, $', $', "q=ccl=$'", $', '', '', '', '', 'ccl' ); + my $q=$'; + # This is needed otherwise ccl= and &limit won't work together, and + # this happens when selecting a subject on the opac-detail page + if (@limits) { + $q .= ' and '.join(' and ', @limits); + } + return ( undef, $q, $q, "q=ccl=$q", $q, '', '', '', '', 'ccl' ); } if ( $query =~ /^cql=/ ) { return ( undef, $', $', "q=cql=$'", $', '', '', '', '', 'cql' ); -- 1.7.2.3 From f.demians at tamil.fr Fri Feb 25 09:09:05 2011 From: f.demians at tamil.fr (=?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?=) Date: Fri, 25 Feb 2011 09:09:05 +0100 Subject: [Koha-patches] [PATCH] Bug 4852 - rewrite the query to include limits if using ccl= Message-ID: <1298621345-3956-1-git-send-email-f.demians@tamil.fr> From: Robin Sheat It applies on 3.2.x. Signed-off-by: Jared Camins-Esakov Signed-off-by: Fr?d?ric Demians --- C4/Search.pm | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a469948..45ebb24 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1043,7 +1043,13 @@ sub buildQuery { # for handling ccl, cql, pqf queries in diagnostic mode, skip the rest of the steps # DIAGNOSTIC ONLY!! if ( $query =~ /^ccl=/ ) { - return ( undef, $', $', "q=ccl=$'", $', '', '', '', '', 'ccl' ); + my $q=$'; + # This is needed otherwise ccl= and &limit won't work together, and + # this happens when selecting a subject on the opac-detail page + if (@limits) { + $q .= ' and '.join(' and ', @limits); + } + return ( undef, $q, $q, "q=ccl=$q", $q, '', '', '', '', 'ccl' ); } if ( $query =~ /^cql=/ ) { return ( undef, $', $', "q=cql=$'", $', '', '', '', '', 'cql' ); -- 1.7.4 From mjr at phonecoop.coop Fri Feb 25 14:12:45 2011 From: mjr at phonecoop.coop (MJ Ray) Date: Fri, 25 Feb 2011 13:12:45 +0000 Subject: [Koha-patches] [PATCH] Remove unnecessary empty file Message-ID: <1298639565-19413-1-git-send-email-mjr@phonecoop.coop> --- 0 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 -- diff --git a/-- b/-- deleted file mode 100644 index e69de29..0000000 -- 1.5.6.5 From gmcharlt at gmail.com Fri Feb 25 14:26:20 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Fri, 25 Feb 2011 08:26:20 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] bug 1953: Reduce risk of possible tainted supplierid call to C4::Serials::GetLateIssues Message-ID: <1298640380-26693-1-git-send-email-gmcharlt@gmail.com> From: MJ Ray Signed-off-by: Galen Charlton --- C4/Serials.pm | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 5e2fa22..da0f4bd 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -125,10 +125,11 @@ sub GetLateIssues { LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id WHERE ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3) - AND subscription.aqbooksellerid=$supplierid + AND subscription.aqbooksellerid=? ORDER BY title |; $sth = $dbh->prepare($query); + $sth->execute($supplierid); } else { my $query = qq| SELECT name,title,planneddate,serialseq,serial.subscriptionid @@ -140,8 +141,8 @@ sub GetLateIssues { ORDER BY title |; $sth = $dbh->prepare($query); + $sth->execute; } - $sth->execute; my @issuelist; my $last_title; my $odd = 0; -- 1.7.2.3 From nengard at bywatersolutions.com Mon Feb 21 00:24:38 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 18:24:38 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5805: Having items in-transit can cause derangement of the hold list Message-ID: <1298244278-24577-1-git-send-email-nengard@bywatersolutions.com> From: ruth at bywatersolutions.com If you have a list of holds on a biblio, and one or more are in-transit, then the array that is fed to modrequest.pl is not fully-populated, lacking the branch on the in-transit rows. If you then attempt to edit one of the remaining holds' pickup location, it doesn't modify the one you expect, but ones *above* that. Also, holds at the bottom of the list get the first pickup library in the list, since they are getting undef passed in. Signed-off-by: Nicole C. Engard --- .../prog/en/modules/reserve/request.tmpl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl index 58a5ad9..53ff7b7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -639,7 +639,7 @@ function checkMultiHold() { Item waiting at " /> - Waiting to be pulled + Waiting to be pulled " /> Item being transferred to " /> -- 1.7.2.3 From gmcharlt at gmail.com Fri Feb 25 14:40:08 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Fri, 25 Feb 2011 08:40:08 -0500 Subject: [Koha-patches] [PATCH 1/2] [3.0.x] [SIGNED-OFF] Security Bugfix: Bug 1953 Adding Placeholders to SQL To Avoid Potential Injection Attacks Message-ID: <1298641209-28078-1-git-send-email-gmcharlt@gmail.com> From: Chris Nighswonger This patch addresses both security issues mentioned in the summary of the report submitted by Fr?re S?bastien Marie included below. --------------------------- The problem is here: 'C4/AuthoritiesMarc.pm' in the function 'DelAuthority': The argument $authid is included directly (not via statement) in the SQL. For the exploit of this problem, you can use 'authorities/authorities-home.pl' with authid on the URL and op=delete (something like "authorities/authorities-home.pl?op=delete&authid=xxx"). This should successfully call DelAuthority, without authentification... (DelAuthority is call BEFORE get_template_and_user, so before authentification [This should be an issue also...]). Please note that the problem isn't only that anyone can delete an authority of this choose, it is more general: with "authid=1%20or%1=1" (after inclusion sql will be like: "delete from auth_header where authid=1 or 1=1") you delete all authorities ; with "authid=1;delete%20from%xxx" it is "delete from auth_header where authid=1;delete from xxx" and so delete what you want... SQL-INJECTION is very permissive: you can redirect the output in a file (with some MySQL function), so write thea file of you choose in the server, in order to create a backdoor, and compromise the server. Signed-off-by: Fr?re S?bastien Marie Signed-off-by: Chris Cormack Signed-off-by: Galen Charlton --- C4/AuthoritiesMarc.pm | 4 ++-- authorities/authorities-home.pl | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 7d9a2b4..6323f7d 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -634,8 +634,8 @@ sub DelAuthority { my $dbh=C4::Context->dbh; ModZebra($authid,"recordDelete","authorityserver",GetAuthority($authid),undef); - $dbh->do("delete from auth_header where authid=$authid") ; - + my $sth = prepare("DELETE FROM auth_header WHERE authid=?"); + $sth->execute($authid); } sub ModAuthority { diff --git a/authorities/authorities-home.pl b/authorities/authorities-home.pl index 1eb58b0..919be5b 100755 --- a/authorities/authorities-home.pl +++ b/authorities/authorities-home.pl @@ -136,9 +136,6 @@ if ( $op eq "do_search" ) { } elsif ( $op eq "delete" ) { - - &DelAuthority( $authid, 1 ); - ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "authorities/authorities-home.tmpl", @@ -152,6 +149,7 @@ elsif ( $op eq "delete" ) { # $template->param("statements" => \@statements, # "nbstatements" => $nbstatements); + &DelAuthority( $authid, 1 ); } else { ( $template, $loggedinuser, $cookie ) = get_template_and_user( -- 1.7.2.3 From gmcharlt at gmail.com Fri Feb 25 14:40:09 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Fri, 25 Feb 2011 08:40:09 -0500 Subject: [Koha-patches] [PATCH 2/2] [3.0.x] [SIGNED-OFF] bug 1953: Reduce risk of possible tainted supplierid call to C4::Serials::GetLateIssues In-Reply-To: <1298641209-28078-1-git-send-email-gmcharlt@gmail.com> References: <1298641209-28078-1-git-send-email-gmcharlt@gmail.com> Message-ID: <1298641209-28078-2-git-send-email-gmcharlt@gmail.com> From: MJ Ray Signed-off-by: Galen Charlton --- C4/Serials.pm | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 2f72762..22cfd46 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -135,12 +135,12 @@ sub GetLateIssues { LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id WHERE ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3) - AND subscription.aqbooksellerid=$supplierid + AND subscription.aqbooksellerid=? ORDER BY title |; $sth = $dbh->prepare($query); - } - else { + $sth->execute($supplierid); + } else { my $query = qq| SELECT name,title,planneddate,serialseq,serial.subscriptionid FROM subscription @@ -151,8 +151,8 @@ sub GetLateIssues { ORDER BY title |; $sth = $dbh->prepare($query); + $sth->execute; } - $sth->execute; my @issuelist; my $last_title; my $odd = 0; -- 1.7.2.3 From gmcharlt at gmail.com Fri Feb 25 14:51:03 2011 From: gmcharlt at gmail.com (Galen Charlton) Date: Fri, 25 Feb 2011 08:51:03 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] bug 5813: Remove unnecessary empty file Message-ID: <1298641863-28959-1-git-send-email-gmcharlt@gmail.com> From: MJ Ray Signed-off-by: Galen Charlton --- 0 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 -- diff --git a/-- b/-- deleted file mode 100644 index e69de29..0000000 -- 1.7.2.3 From oleonard at myacpl.org Fri Feb 25 15:16:49 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 25 Feb 2011 09:16:49 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5814 - Style error message on manage staged records page according to standard Message-ID: <1298643409-11925-1-git-send-email-oleonard@myacpl.org> --- .../prog/en/modules/tools/manage-marc-import.tmpl | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl index 9f11c66..f0bd761 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl @@ -69,8 +69,10 @@ $(document).ready(function(){ - No records have been staged. - Stage MARC records for import. +
    +

    No records have been staged.

    +

    Stage MARC records for import.

    +
    -- 1.7.3 From oleonard at myacpl.org Fri Feb 25 16:17:09 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Fri, 25 Feb 2011 10:17:09 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5812 - Tag Cloud - capitalized words come before lower-case words Message-ID: <1298647029-12433-1-git-send-email-oleonard@myacpl.org> --- opac/opac-tags.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index b98ce40..b5ce340 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -293,7 +293,7 @@ if ($add_op) { } } (scalar @errors ) and $template->param(ERRORS => \@errors); -my @orderedresult = sort { $a->{'term'} cmp $b->{'term'} } @$results; +my @orderedresult = sort { uc($a->{'term'}) cmp uc($b->{'term'}) } @$results; (scalar @$results) and $template->param(TAGLOOP => \@orderedresult ); (scalar @$my_tags) and $template->param(MY_TAGS => $my_tags); -- 1.7.3 From nengard at bywatersolutions.com Mon Feb 21 03:32:22 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 21:32:22 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5812 - Tag Cloud - capitalized words come before lower-case words Message-ID: <1298255542-25327-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard Signed-off-by: Nicole C. Engard --- opac/opac-tags.pl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index b98ce40..b5ce340 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -293,7 +293,7 @@ if ($add_op) { } } (scalar @errors ) and $template->param(ERRORS => \@errors); -my @orderedresult = sort { $a->{'term'} cmp $b->{'term'} } @$results; +my @orderedresult = sort { uc($a->{'term'}) cmp uc($b->{'term'}) } @$results; (scalar @$results) and $template->param(TAGLOOP => \@orderedresult ); (scalar @$my_tags) and $template->param(MY_TAGS => $my_tags); -- 1.7.2.3 From nengard at bywatersolutions.com Mon Feb 21 03:33:30 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 21:33:30 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5814 - Style error message on manage staged records page according to standard Message-ID: <1298255610-25418-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard Signed-off-by: Nicole C. Engard --- .../prog/en/modules/tools/manage-marc-import.tmpl | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl index 9f11c66..f0bd761 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl @@ -69,8 +69,10 @@ $(document).ready(function(){ - No records have been staged. - Stage MARC records for import. +
    +

    No records have been staged.

    +

    Stage MARC records for import.

    +
    -- 1.7.2.3 From nengard at bywatersolutions.com Mon Feb 21 03:55:03 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 20 Feb 2011 21:55:03 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5811: Add sysprefs to control overriding fines Message-ID: <1298256903-25751-1-git-send-email-nengard@bywatersolutions.com> From: Jared Camins-Esakov This patch adds two sysprefs to allow libraries more fine-grained control over when fines can and can't be overridden. The two sysprefs are: * AllFinesNeedOverride - when this syspref is set to "Require" (default) any fine will require a staffmember to override the fine in order to check out a book. When set to "Don't require," fines below noissuescharge will not need any override. * AllowFineOverride - when this syspref is set to "Allow," staff will be able to override fines that are above noissuescharge. When set to "Don't allow" (default), staff will not be able to check out items to patrons with fines greater than noissuescharge. Signed-off-by: Nicole C. Engard --- C4/Circulation.pm | 17 ++++++++++++----- C4/Members.pm | 2 +- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 ++ installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ .../1-Obligatoire/unimarc_standard_systemprefs.sql | 4 +++- installer/data/mysql/it-IT/necessari/sysprefs.sql | 4 +++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +++- ...m_preferences_full_optimal_for_install_only.sql | 4 +++- ...m_preferences_full_optimal_for_install_only.sql | 4 +++- installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../en/modules/admin/preferences/circulation.pref | 12 ++++++++++++ 11 files changed, 52 insertions(+), 11 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index f7846ac..2b4e86c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -730,17 +730,24 @@ sub CanBookBeIssued { # DEBTS my ($amount) = C4::Members::GetMemberAccountRecords( $borrower->{'borrowernumber'}, '' && $duedate->output('iso') ); + my $amountlimit = C4::Context->preference("noissuescharge"); + my $allowfineoverride = C4::Context->preference("AllowFineOverride"); + my $allfinesneedoverride = C4::Context->preference("AllFinesNeedOverride"); if ( C4::Context->preference("IssuingInProcess") ) { - my $amountlimit = C4::Context->preference("noissuescharge"); - if ( $amount > $amountlimit && !$inprocess ) { + if ( $amount > $amountlimit && !$inprocess && !$allowfineoverride) { $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); - } - elsif ( $amount > 0 && $amount <= $amountlimit && !$inprocess ) { + } elsif ( $amount > $amountlimit && !$inprocess && $allowfineoverride) { + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); + } elsif ( $allfinesneedoverride && $amount > 0 && $amount <= $amountlimit && !$inprocess ) { $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); } } else { - if ( $amount > 0 ) { + if ( $amount > $amountlimit && $allowfineoverride ) { + $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); + } elsif ( $amount > $amountlimit && !$allowfineoverride) { + $issuingimpossible{DEBT} = sprintf( "%.2f", $amount ); + } elsif ( $amount > 0 && $allfinesneedoverride ) { $needsconfirmation{DEBT} = sprintf( "%.2f", $amount ); } } diff --git a/C4/Members.pm b/C4/Members.pm index fafc99b..a292054 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -444,7 +444,7 @@ sub patronflags { my $noissuescharge = C4::Context->preference("noissuescharge") || 5; $flaginfo{'message'} = sprintf "Patron owes \$%.02f", $amount; $flaginfo{'amount'} = sprintf "%.02f", $amount; - if ( $amount > $noissuescharge ) { + if ( $amount > $noissuescharge && !C4::Context->preference("AllowFineOverride") ) { $flaginfo{'noissues'} = 1; } $flags{'CHARGES'} = \%flaginfo; diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 02511d8..221017a 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -285,3 +285,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..363774d 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,3 +285,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 757f255..9386fee 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -286,4 +286,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 79c469c..49da6ce 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -271,4 +271,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 8689c4c..5715de1 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -283,4 +283,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index c862e60..2b38cfa 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -338,4 +338,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 82e285b..874a6e4 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -363,4 +363,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 31aa998..c297810 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.03.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowFineOverride','0','If on, staff will be able to issue books to patrons with fines greater than noissuescharge.','0','YesNo')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllFinesNeedOverride','1','If on, staff will be asked to override every fine, even if it is below noissuescharge.','0','YesNo')"); + print "Upgrade to $DBversion done (Bug 5811: Add sysprefs controlling overriding fines)\n"; + SetVersion($DBversion); +}; + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 3742b23..87769b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -86,6 +86,18 @@ Circulation: no: "Don't allow" - staff to manually override the renewal limit and renew a checkout when it would go over the renewal limit. - + - pref: AllFinesNeedOverride + choices: + yes: Require + no: "Don't require" + - staff to manually override all fines, even fines less than noissuescharge. + - + - pref: AllowFineOverride + choices: + yes: Allow + no: "Don't allow" + - staff to manually override and check out items to patrons who have more than noissuescharge in fines. + - - pref: InProcessingToShelvingCart choices: yes: Move -- 1.7.2.3 From M.de.Rooy at rijksmuseum.nl Mon Feb 28 09:30:07 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Mon, 28 Feb 2011 08:30:07 +0000 Subject: [Koha-patches] [PATCH] Follow up fix on security patch Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F588C@S-MAIL-1B.rijksmuseum.intra> Fixing: Undefined subroutine prepare called on line 722. --- C4/AuthoritiesMarc.pm | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 9315e55..bd5fe64 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -719,7 +719,7 @@ sub DelAuthority { my $dbh=C4::Context->dbh; ModZebra($authid,"recordDelete","authorityserver",GetAuthority($authid),undef); - my $sth = prepare("DELETE FROM auth_header WHERE authid=?"); + my $sth = $dbh->prepare("DELETE FROM auth_header WHERE authid=?"); $sth->execute($authid); } -- 1.6.0.6 From M.de.Rooy at rijksmuseum.nl Mon Feb 28 12:42:45 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Mon, 28 Feb 2011 11:42:45 +0000 Subject: [Koha-patches] [PATCH] 3154 Preferences for building facets Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F58DE@S-MAIL-1B.rijksmuseum.intra> Based on patch from Fridolyn Somers with input of Frederic Demians. Added new Searching preference maxRecordsForFacets. This pref contains number of result records used in facet building. Also added pref displayFacetCount (with thanks to Frederic). Follow up patch takes care of install issues; functionality can already be tested with this patch only. --- C4/Search.pm | 72 +++++++++++++------- catalogue/search.pl | 1 + .../intranet-tmpl/prog/en/includes/facets.inc | 2 +- .../en/modules/admin/preferences/searching.pref | 14 ++++ .../opac-tmpl/prog/en/includes/opac-facets.inc | 2 +- opac/opac-search.pl | 1 + 6 files changed, 65 insertions(+), 27 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index a469948..a33e5e2 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -309,6 +309,7 @@ sub getRecords { my $facets_counter = (); my $facets_info = (); my $facets = getFacets(); + my $facets_maxrecs = C4::Context->preference('maxRecordsForFacets')||20; my @facets_loop; # stores the ref to array of hashes for template facets loop @@ -418,7 +419,6 @@ sub getRecords { for ( my $j = $offset ; $j < $times ; $j++ ) { my $records_hash; my $record; - my $facet_record; ## Check if it's an index scan if ($scan) { @@ -451,33 +451,55 @@ sub getRecords { # warn "RECORD $j:".$record; $results_hash->{'RECORDS'}[$j] = $record; - - # Fill the facets while we're looping, but only for the biblioserver - $facet_record = MARC::Record->new_from_usmarc($record) - if $servers[ $i - 1 ] =~ /biblioserver/; - - #warn $servers[$i-1]."\n".$record; #.$facet_record->title(); - if ($facet_record) { - for ( my $k = 0 ; $k <= @$facets ; $k++ ) { - ($facets->[$k]) or next; - my @fields = map {$facet_record->field($_)} @{$facets->[$k]->{'tags'}} ; - for my $field (@fields) { - my @subfields = $field->subfields(); - for my $subfield (@subfields) { - my ( $code, $data ) = @$subfield; - ($code eq $facets->[$k]->{'subfield'}) or next; - $facets_counter->{ $facets->[$k]->{'link_value'} }->{$data}++; - } - } - $facets_info->{ $facets->[$k]->{'link_value'} }->{'label_value'} = - $facets->[$k]->{'label_value'}; - $facets_info->{ $facets->[$k]->{'link_value'} }->{'expanded'} = - $facets->[$k]->{'expanded'}; - } - } } + } $results_hashref->{ $servers[ $i - 1 ] } = $results_hash; + + # Fill the facets while we're looping, but only for the biblioserver and not for a scan + if ( !$scan && $servers[ $i - 1 ] =~ /biblioserver/ ) { + + my $jmax = $size>$facets_maxrecs? $facets_maxrecs: $size; + + for ( my $k = 0 ; $k <= @$facets ; $k++ ) { + ($facets->[$k]) or next; + my @fcodes = @{$facets->[$k]->{'tags'}}; + my $sfcode = $facets->[$k]->{'subfield'}; + + for ( my $j = 0 ; $j < $jmax ; $j++ ) { + my $render_record = $results[ $i - 1 ]->record($j)->render(); + my @used_datas = (); + + foreach my $fcode (@fcodes) { + + # avoid first line + my $field_pattern = '\n'.$fcode.' ([^\n]+)'; + my @field_tokens = ( $render_record =~ /$field_pattern/g ) ; + + foreach my $field_token (@field_tokens) { + my $subfield_pattern = '\$'.$sfcode.' ([^\$]+)'; + my @subfield_values = ( $field_token =~ /$subfield_pattern/g ); + + foreach my $subfield_value (@subfield_values) { + + my $data = $subfield_value; + $data =~ s/^\s+//; # trim left + $data =~ s/\s+$//; # trim right + + unless ( $data ~~ @used_datas ) { + $facets_counter->{ $facets->[$k]->{'link_value'} }->{$data}++; + push @used_datas, $data; + } + } # subfields + } # fields + } # field codes + } # records + + $facets_info->{ $facets->[$k]->{'link_value'} }->{'label_value'} = $facets->[$k]->{'label_value'}; + $facets_info->{ $facets->[$k]->{'link_value'} }->{'expanded'} = $facets->[$k]->{'expanded'}; + } # facets + } + # End PROGILONE } # warn "connection ", $i-1, ": $size hits"; diff --git a/catalogue/search.pl b/catalogue/search.pl index 8cb737d..c2399be 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -641,6 +641,7 @@ $template->param( total => $total, opacfacets => 1, facets_loop => $facets, + displayFacetCount=> C4::Context->preference('displayFacetCount')||0, scan => $scan, search_error => $error, ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index 95d912d..ab0fb13 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -17,7 +17,7 @@ Series Libraries
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index cd924dc..6994d43 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -92,6 +92,14 @@ Searching: az: from A to Z. za: from Z to A. - + - pref: displayFacetCount + type: boolean + default: no + choices: + yes: Show + no: "Don't show" + - facet counts. The relevance of these numbers highly depends on the value of the maxRecordsForFacets preference. Applies to OPAC and staff interface. + - - By default, show - pref: numSearchResults class: integer @@ -122,6 +130,12 @@ Searching: class: integer - items per biblio in the search results - + - Build facets based on + - pref: maxRecordsForFacets + class: integer + default: 20 + - records from the search results. + - - By default, show - pref: OPACnumSearchResults class: integer diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc index 85719f3..241e66e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc @@ -18,7 +18,7 @@ Libraries diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 0f52650..271f501 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -628,6 +628,7 @@ $template->param( total => $total, opacfacets => 1, facets_loop => $facets, + displayFacetCount=> C4::Context->preference('displayFacetCount')||0, scan => $scan, search_error => $error, ); -- 1.6.0.6 From M.de.Rooy at rijksmuseum.nl Mon Feb 28 13:05:28 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Mon, 28 Feb 2011 12:05:28 +0000 Subject: [Koha-patches] [PATCH] 3154 Preferences for building facets (install) Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F5AA9@S-MAIL-1B.rijksmuseum.intra> Adds prefs for facets in sql install files and updatedatabase script. --- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 ++ installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ .../1-Obligatoire/unimarc_standard_systemprefs.sql | 4 +++- installer/data/mysql/it-IT/necessari/sysprefs.sql | 4 +++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +++- ...m_preferences_full_optimal_for_install_only.sql | 4 +++- ...m_preferences_full_optimal_for_install_only.sql | 4 +++- installer/data/mysql/updatedatabase.pl | 8 ++++++++ 8 files changed, 27 insertions(+), 5 deletions(-) diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 02511d8..7c9a35d 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -285,3 +285,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..7f018e2 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,3 +285,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 757f255..a18a8ae 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -286,4 +286,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 79c469c..9afa38a 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -271,4 +271,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 8689c4c..661b28f 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -283,4 +283,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index c862e60..943cadf 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -338,4 +338,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 82e285b..0c16983 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -363,4 +363,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 31aa998..662969e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.03.00.XXX'; #FIXME +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('displayFacetCount', '0', NULL, NULL, 'YesNo')"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('maxRecordsForFacets', '20', NULL, NULL, 'Integer')"); + print "Upgrade to $DBversion done (Preferences for facet count)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) -- 1.6.0.6 From oleonard at myacpl.org Mon Feb 28 14:51:59 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 28 Feb 2011 08:51:59 -0500 Subject: [Koha-patches] [PATCH] Follow-up fix for Bug 5804, acqui duplicate warning Message-ID: <1298901119-14837-1-git-send-email-oleonard@myacpl.org> Typo fix. Thanks for spotting it Marcel. --- .../en/modules/acqui/neworderempty_duplicate.tmpl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl index 7203526..006884f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl @@ -51,7 +51,7 @@
    -

    Crete new record

    +

    Create new record

    Create a new record by importing the external (duplicate) record.

    " /> " /> -- 1.7.3 From M.de.Rooy at rijksmuseum.nl Mon Feb 28 15:05:47 2011 From: M.de.Rooy at rijksmuseum.nl (Marcel de Rooy) Date: Mon, 28 Feb 2011 14:05:47 +0000 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Follow-up fix for Bug 5804, acqui duplicate warning Message-ID: <809BE39CD64BFD4EB9036172EBCCFA311F5B20@S-MAIL-1B.rijksmuseum.intra> From: Owen Leonard Typo fix. Thanks for spotting it Marcel. Signed-off-by: Marcel de Rooy --- .../en/modules/acqui/neworderempty_duplicate.tmpl | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl index 7203526..006884f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl @@ -51,7 +51,7 @@
    -

    Crete new record

    +

    Create new record

    Create a new record by importing the external (duplicate) record.

    " /> " /> -- 1.6.0.6 From nengard at bywatersolutions.com Sat Feb 26 22:04:51 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sat, 26 Feb 2011 16:04:51 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5810: Subject tracings search complete subfields Message-ID: <1298754291-6951-1-git-send-email-nengard@bywatersolutions.com> From: Jared Camins-Esakov This patch adds the syspref TraceCompleteSubfields. When TraceCompleteSubfields is set to "force," clicking on links in non-authority controlled subject tracings will only find other records where the entire subfields match. Leaving it at "don't force" keeps the current behavior of doing a keyword search of the subject indexes. This patch implements complete-subfield subject tracings in MARC21 XSLTs (OPAC and Staff) and all Normal mode interfaces. UNIMARC XSLTs have not been updated. This patch also adds the syspref UseAuthoritiesForTracings. When set to "Do not" tracings in the XSLT detail displays will never generate links using authority numbers, but rather use the heading strings (NB: the tracings currently use only subfield 'a' for generating links). Signed-off-by: Nicole C. Engard --- C4/Biblio.pm | 4 +++- C4/XSLT.pm | 2 +- installer/data/mysql/de-DE/mandatory/sysprefs.sql | 2 ++ installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ .../1-Obligatoire/unimarc_standard_systemprefs.sql | 4 +++- installer/data/mysql/it-IT/necessari/sysprefs.sql | 4 +++- installer/data/mysql/pl-PL/mandatory/sysprefs.sql | 4 +++- ...m_preferences_full_optimal_for_install_only.sql | 4 +++- ...m_preferences_full_optimal_for_install_only.sql | 4 +++- installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../en/modules/admin/preferences/authorities.pref | 7 +++++++ .../en/modules/admin/preferences/searching.pref | 7 +++++++ .../prog/en/xslt/MARC21slim2intranetDetail.xsl | 11 +++++++---- .../prog/en/xslt/MARC21slim2OPACDetail.xsl | 13 ++++++++----- 14 files changed, 60 insertions(+), 16 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8ea5da5..7c60666 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1390,6 +1390,8 @@ sub GetMarcSubjects { my $subfield = ""; my $marcsubject; + my $subject_limit = C4::Context->preference("TraceCompleteSubfields") ? 'su,complete-subfield' : 'su'; + foreach my $field ( $record->field('6..') ) { next unless $field->tag() >= $mintag && $field->tag() <= $maxtag; my @subfields_loop; @@ -1416,7 +1418,7 @@ sub GetMarcSubjects { @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } ); } if ( not $found9 ) { - push @link_loop, { 'limit' => 'su', link => $linkvalue, operator => $operator }; + push @link_loop, { 'limit' => $subject_limit, link => $linkvalue, operator => $operator }; } my $separator = C4::Context->preference("authoritysep") unless $counter == 0; diff --git a/C4/XSLT.pm b/C4/XSLT.pm index f1c5293..0c9e78b 100644 --- a/C4/XSLT.pm +++ b/C4/XSLT.pm @@ -128,7 +128,7 @@ sub XSLTParse4Display { my $itemsxml = buildKohaItemsNamespace($biblionumber); my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); my $sysxml = "\n"; - foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL/ ) { + foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL TraceCompleteSubfields UseAuthoritiesForTracings/ ) { my $sp = C4::Context->preference( $syspref ); next unless defined($sp); $sysxml .= "$sp\n"; diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 02511d8..3e6ff53 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -285,3 +285,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 0b75e98..f7c52c0 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -285,3 +285,5 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 757f255..f817d12 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -286,4 +286,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql index 79c469c..4a02e10 100644 --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql @@ -271,4 +271,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 8689c4c..c298a46 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -283,4 +283,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index c862e60..e87c078 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -338,4 +338,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index 82e285b..3f546d9 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -363,4 +363,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesLocation','1','Use the item location when finding items for the shelf browser.','1','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesHomeBranch','1','Use the item home branch when finding items for the shelf browser.','1','YesNo'); -INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); \ No newline at end of file +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ShelfBrowserUsesCcode','1','Use the item collection code when finding items for the shelf browser.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 31aa998..09aebb2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.03.00.XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('TraceCompleteSubfields','0','Force subject tracings to only match complete subfields.','0','YesNo')"); + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('UseAuthoritiesForTracings','1','Use authority record numbers for subject tracings instead of heading strings.','0','YesNo')"); + print "Upgrade to $DBversion done (Add syspref to force whole-subfield matching on subject tracings)\n"; + SetVersion($DBversion); +}; + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref index f06d983..3d19af8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref @@ -14,3 +14,10 @@ Authorities: yes: "Don't" no: Do - automatically update attached biblios when changing an authority record. If this is off, please ask your administrator to enable the merge_authorities.pl cronjob. + - + - pref: UseAuthoritiesForTracings + default: yes + choices: + yes: Use + no: "Don't use" + - authority record numbers instead of text strings for searches from subject tracings. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref index cd924dc..5ff267f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref @@ -55,6 +55,13 @@ Searching: yes: Use no: "Don't use" - PazPar2 to group similar results on the OPAC. This requires that PazPar2 is set up and running. + - + - pref: TraceCompleteSubfields + default: 0 + choices: + yes: Force + no: "Don't force" + - subject tracings in the OPAC and Staff Client to search only for complete-subfield matches. Search Form: - - Show checkboxes to search by diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index e3009d8..c96d82b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -19,6 +19,8 @@ + ,complete-subfield + @@ -121,8 +123,8 @@ - - + + Type: @@ -416,11 +418,11 @@ - + /cgi-bin/koha/catalogue/search.pl?q=an: - /cgi-bin/koha/catalogue/search.pl?q=su: + /cgi-bin/koha/catalogue/search.pl?q=su: @@ -791,6 +793,7 @@ +
    diff --git a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl index 5703059..01e88f6 100755 --- a/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl @@ -22,6 +22,9 @@ + + ,complete-subfield + @@ -128,7 +131,7 @@ - + /cgi-bin/koha/opac-search.pl?q=an: @@ -143,7 +146,7 @@ - + /cgi-bin/koha/opac-search.pl?q=an: @@ -165,7 +168,7 @@ - + /cgi-bin/koha/opac-search.pl?q=an: @@ -479,11 +482,11 @@ - + /cgi-bin/koha/opac-search.pl?q=an: - /cgi-bin/koha/opac-search.pl?q=su: + /cgi-bin/koha/opac-search.pl?q=su: -- 1.7.2.3 From nengard at bywatersolutions.com Sat Feb 26 22:21:33 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sat, 26 Feb 2011 16:21:33 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5815: Double clicking submits patron selection Message-ID: <1298755293-7136-1-git-send-email-nengard@bywatersolutions.com> From: Jared Camins-Esakov Double clicking on an item in the list of matching names now automatically submits the form when checking out to a patron by name rather than barcode. Signed-off-by: Nicole C. Engard --- circ/circulation.pl | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index ab681f1..8a184d1 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -494,6 +494,7 @@ if ($borrowerslist) { -id => 'borrowernumber', -values => \@values, -labels => \%labels, + -ondblclick => 'document.forms[\'mainform\'].submit()', -size => 7, -tabindex => '', -multiple => 0 -- 1.7.2.3 From oleonard at myacpl.org Mon Feb 28 22:10:19 2011 From: oleonard at myacpl.org (Owen Leonard) Date: Mon, 28 Feb 2011 16:10:19 -0500 Subject: [Koha-patches] [PATCH] Fix for Bug 5817, Malformed author search link breaks sorting on results page Message-ID: <1298927420-16189-1-git-send-email-oleonard@myacpl.org> --- .../prog/en/modules/catalogue/results.tmpl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index df09c4f..6740229 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -402,7 +402,7 @@ function GetZ3950Terms(){

    -
    " title="Search for this Author"> + " title="Search for this Author">   @@ -422,7 +422,7 @@ function GetZ3950Terms(){ - " title="Search for this Author"> + " title="Search for this Author">   -- 1.7.3 From nengard at bywatersolutions.com Sun Feb 27 00:04:56 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sat, 26 Feb 2011 18:04:56 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Fix for Bug 5817, Malformed author search link breaks sorting on results page Message-ID: <1298761496-7704-1-git-send-email-nengard@bywatersolutions.com> From: Owen Leonard Signed-off-by: Nicole C. Engard --- .../prog/en/modules/catalogue/results.tmpl | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl index df09c4f..6740229 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl @@ -402,7 +402,7 @@ function GetZ3950Terms(){

    - " title="Search for this Author"> + " title="Search for this Author">   @@ -422,7 +422,7 @@ function GetZ3950Terms(){ - " title="Search for this Author"> + " title="Search for this Author">   -- 1.7.2.3 From nengard at bywatersolutions.com Sun Feb 27 09:49:50 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 27 Feb 2011 03:49:50 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 5642: Item field serial enumeration (enumchron) should be longer Message-ID: <1298796590-9695-1-git-send-email-nengard@bywatersolutions.com> From: Marcel de Rooy Field enumchron in items table is now varchar(80). We have records that need a much longer field, even up to 400 or 500 chars. I suggest to change its type to TEXT (variable length with max 64K; tinytext goes up to 255 chars and is just too short). Mediumtext or longtext are not needed; as a side note these types are used in the items table for e.g. booksellerid and more_subfields_xml.. Revised original patch thanks to Ian Walls: update kohatructure.sql. Copied the change in deleteditems as well. Signed-off-by: Nicole C. Engard --- installer/data/mysql/kohastructure.sql | 4 ++-- installer/data/mysql/updatedatabase.pl | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index e7ad97f..da1528c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -750,7 +750,7 @@ CREATE TABLE `deleteditems` ( `uri` varchar(255) default NULL, `itype` varchar(10) default NULL, `more_subfields_xml` longtext default NULL, - `enumchron` varchar(80) default NULL, + `enumchron` text default NULL, `copynumber` varchar(32) default NULL, `stocknumber` varchar(32) default NULL, `marc` longblob, @@ -1015,7 +1015,7 @@ CREATE TABLE `items` ( `uri` varchar(255) default NULL, `itype` varchar(10) default NULL, `more_subfields_xml` longtext default NULL, - `enumchron` varchar(80) default NULL, + `enumchron` text default NULL, `copynumber` varchar(32) default NULL, `stocknumber` varchar(32) default NULL, PRIMARY KEY (`itemnumber`), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 31aa998..c219052 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4014,6 +4014,14 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.03.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("ALTER TABLE items MODIFY enumchron TEXT"); + $dbh->do("ALTER TABLE deleteditems MODIFY enumchron TEXT"); + print "Upgrade to $DBversion done (bug 5642: longer serial enumeration)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) -- 1.7.2.3 From nengard at bywatersolutions.com Sun Feb 27 10:20:33 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 27 Feb 2011 04:20:33 -0500 Subject: [Koha-patches] [PATCH] [SIGNED-OFF] Bug 4103 In Pro Adv Search, superlibrarian search always all libraries Message-ID: <1298798433-9997-1-git-send-email-nengard@bywatersolutions.com> From: Fr?d?ric Demians Now, when 'independantbranches' syspref is activated, 'Individual Libraries' combo list is set by default to the current user branch. It shouldn't be the case for superlibrarian user who is supposed to manage all libraries. Signed-off-by: Nicole C. Engard --- catalogue/search.pl | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 8cb737d..b0fea2a 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -207,16 +207,20 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) { # load the branches my $branches = GetBranches(); -my @branch_loop; -# we need to know the borrower branch code to set a default branch -my $borrowerbranchcode = C4::Context->userenv->{'branch'}; - -for my $branch_hash (sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} } keys %$branches) { - # if independantbranches is activated, set the default branch to the borrower branch - my $selected = (C4::Context->preference("independantbranches") and ($borrowerbranchcode eq $branch_hash)) ? 1 : undef; - push @branch_loop, {value => "$branch_hash" , branchname => $branches->{$branch_hash}->{'branchname'}, selected => $selected}; -} +# Populate branch_loop with all branches sorted by their name. If +# independantbranches is activated, set the default branch to the borrower +# branch, except for superlibrarian who need to search all libraries. +my $user = C4::Context->userenv; +my @branch_loop = map { + { + value => $_, + branchname => $branches->{$_}->{branchname}, + selected => $user->{branch} eq $_ && C4::Branch::onlymine(), + } +} sort { + $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} +} keys %$branches; my $categories = GetBranchCategories(undef,'searchdomain'); -- 1.7.2.3 From nengard at bywatersolutions.com Sun Feb 27 13:18:34 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 27 Feb 2011 07:18:34 -0500 Subject: [Koha-patches] [PATCH 2/2] [SIGNED-OFF] BZ5432 follow-up, removing test string Message-ID: <1298809114-11002-1-git-send-email-nengard@bywatersolutions.com> From: Paul Poulain Signed-off-by: Nicole C. Engard --- .../prog/en/modules/members/memberentrygen.tmpl | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl index 67ac528..6cee5b2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl @@ -73,7 +73,6 @@ "> DuplicateModify patron Organization patron Adult patron Child patron Professional patron Staff patron
    -tast
    -- 1.7.2.3 From nengard at bywatersolutions.com Sun Feb 27 13:18:21 2011 From: nengard at bywatersolutions.com (Nicole C. Engard) Date: Sun, 27 Feb 2011 07:18:21 -0500 Subject: [Koha-patches] [PATCH 1/2] Bug 5432 : (MT #4584b)Add duplicate support for borrowers Message-ID: <1298809101-10968-1-git-send-email-nengard@bywatersolutions.com> From: St?phane Delaune Signed-off-by: Nicole C. Engard --- .../prog/en/includes/members-toolbar.inc | 4 +- .../prog/en/modules/members/memberentrygen.tmpl | 117 ++++++++++---------- members/memberentry.pl | 39 ++++--- 3 files changed, 84 insertions(+), 76 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 6f22d46..98c6d07 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -82,6 +82,7 @@ function update_child() { new YAHOO.widget.Button("editpatron"); new YAHOO.widget.Button("addnote"); new YAHOO.widget.Button("changepassword"); + new YAHOO.widget.Button("duplicate"); new YAHOO.widget.Button("printslip"); new YAHOO.widget.Button("printpage"); new YAHOO.widget.Button("renewpatron"); @@ -110,7 +111,8 @@ function update_child() {
  • &category_type=C">Add child
  • ">Add Note -->
  • ">Change Password
  • -
  • &print=page">Print Page
  • +
  • &category_type=">Duplicate
  • +
  • &print=page">Print Page
  • &print=slip">Print Slip
  • ">Renew Account
  • ">Set Permissions
  • Delete
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl index a746307..67ac528 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl @@ -1,6 +1,6 @@ Koha › Patrons › -<!-- TMPL_IF NAME="opadd" -->Add<!-- TMPL_ELSE --> Modify<!--/TMPL_IF--> <!--TMPL_IF Name="categoryname"--> <!--TMPL_VAR Name="categoryname"--> patron<!-- TMPL_ELSE --><!--TMPL_IF Name="I"--> Organization patron<!--/TMPL_IF --><!--TMPL_IF Name="A"--> Adult patron<!--/TMPL_IF --><!--TMPL_IF Name="C"--> Child patron<!--/TMPL_IF --><!--TMPL_IF Name="P"--> Professional patron<!--/TMPL_IF --><!--TMPL_IF Name="S"--> Staff patron<!--/TMPL_IF --><!--/TMPL_IF --><!--TMPL_UNLESS Name="opadd"--> <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR name="firstname" --><!--/TMPL_UNLESS--> +AddDuplicate Modify patron Organization patron Adult patron Child patron Professional patron Staff patron ,