From 43d3efe39175488ee81e8c6dd4cddaefb1f3f9e3 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Sun, 21 Oct 2007 21:23:25 -0500 Subject: [PATCH] classification sources part 1 - system preferences Database schema definitions and system preferences support for defining classification sources and filing rules. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/ClassSource.pm | 329 ++++++++++++++++++ admin/classsources.pl | 276 +++++++++++++++ admin/systempreferences.pl | 16 + installer/data/en/mandatory/class_sources.sql | 35 ++ installer/data/en/mandatory/class_sources.txt | 1 + installer/data/en/mandatory/sysprefs.sql | 1 + installer/kohastructure.sql | 29 ++ .../prog/en/includes/admin-menu.inc | 1 + .../prog/en/modules/admin/admin-home.tmpl | 4 +- .../prog/en/modules/admin/classsources.tmpl | 325 +++++++++++++++++ .../en/modules/admin/systempreferences.tmpl | 2 +- 11 files changed, 1017 insertions(+), 2 deletions(-) create mode 100644 C4/ClassSource.pm create mode 100755 admin/classsources.pl create mode 100644 installer/data/en/mandatory/class_sources.sql create mode 100644 installer/data/en/mandatory/class_sources.txt create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm new file mode 100644 index 0000000000..8d8478d10d --- /dev/null +++ b/C4/ClassSource.pm @@ -0,0 +1,329 @@ +package C4::ClassSource; + +# Copyright (C) 2007 LibLime +# +# 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 strict; +require Exporter; +use C4::Context; +use C4::Koha; + +use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); + +# set the version for version checking +$VERSION = 3.00; + +=head1 NAME + +C4::ClassSources - handle classification sources in Koha + +=head1 SYNOPSIS + +use C4::ClassSource; + +=head1 DESCRIPTION + +This module deals with manipulating classification +sources and sorting rules. + +=head1 FUNCTIONS + +=cut + + +@ISA = qw(Exporter); +@EXPORT = qw( + &GetClassSources + &AddClassSource + &GetClassSource + &ModClassSource + &DelClassSource + &GetClassSortRules + &AddClassSortRule + &GetClassSortRule + &ModClassSortRule + &DelClassSortRule + + &GetSourcesForSortRule +); + +=head2 GetClassSources + + my $sources = GetClassSources(); + + Returns reference to hash of references to + the class sources, keyed on cn_source. + +=head3 Example + +my $sources = GetClassSources(); +my @sources = (); +foreach my $cn_source (sort keys %$sources) { + my $source = $sources->{$cn_source}; + push @sources, + { + code => $source->{'cn_source'}, + description => $source->{'description'}, + used => $source->{'used'}, + sortrule => $source->{'class_sort_rule'} + } +} + +=cut + +sub GetClassSources { + + my %class_sources = (); + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("SELECT * FROM `class_sources`"); + $sth->execute(); + while (my $source = $sth->fetchrow_hashref) { + $class_sources{ $source->{'cn_source'} } = $source; + } + $sth->finish(); + + return \%class_sources; + +} + +=head2 AddClassSource + + AddClassSource($cn_source, $description, $used, $class_sort_rule); + + Adds a class_sources row. + +=cut + +sub AddClassSource { + + my ($cn_source, $description, $used, $class_sort_rule) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("INSERT INTO `class_sources` + (`cn_source`, `description`, `used`, `class_sort_rule`) + VALUES (?, ?, ?, ?)"); + $sth->execute($cn_source, $description, $used, $class_sort_rule); + $sth->finish(); + +} + +=head2 GetClassSource + + my $hashref = GetClassSource($cn_source); + + Retrieves a class_sources row by cn_source. + +=cut + +sub GetClassSource { + + my ($cn_source) = (@_); + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("SELECT * FROM `class_sources` WHERE cn_source = ?"); + $sth->execute($cn_source); + my $row = $sth->fetchrow_hashref(); + $sth->finish(); + return $row; +} + +=head2 ModClassSource + + ModClassSource($cn_source, $description, $used, $class_sort_rule); + + Updates a class_sources row. + +=cut + +sub ModClassSource { + + my ($cn_source, $description, $used, $class_sort_rule) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("UPDATE `class_sources` + SET `description` = ?, + `used` = ?, + `class_sort_rule` = ? + WHERE `cn_source` = ?"); + $sth->execute($description, $used, $class_sort_rule, $cn_source); + $sth->finish(); + +} + +=head2 DelClassSource + + DelClassSource($cn_source); + + Deletes class_sources row. + +=cut + +sub DelClassSource { + + my ($cn_source) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("DELETE FROM `class_sources` WHERE `cn_source` = ?"); + $sth->execute($cn_source); + $sth->finish(); + +} + +=head2 GetClassSortRules + + my $sort_rules = GetClassSortRules(); + + Returns reference to hash of references to + the class sorting rules, keyed on class_sort_rule + +=head3 Example + +my $sort_rules = GetClassSortRules(); +my @sort_rules = (); +foreach my $sort_rule (sort keys %$sort_rules) { + my $sort_rule = $sort_rules->{$sort_rule}; + push @sort_rules, + { + rule => $sort_rule->{'class_sort_rule'}, + description => $sort_rule->{'description'}, + sort_routine => $sort_rule->{'sort_routine'} + } +} + +=cut + +sub GetClassSortRules { + + my %class_sort_rules = (); + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("SELECT * FROM `class_sort_rules`"); + $sth->execute(); + while (my $sort_rule = $sth->fetchrow_hashref) { + $class_sort_rules{ $sort_rule->{'class_sort_rule'} } = $sort_rule; + } + $sth->finish(); + + return \%class_sort_rules; + +} + +=head2 AddClassSortRule + + AddClassSortRule($class_sort_rule, $description, $sort_routine); + + Adds a class_sort_rules row. + +=cut + +sub AddClassSortRule { + + my ($class_sort_rule, $description, $sort_routine) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("INSERT INTO `class_sort_rules` + (`class_sort_rule`, `description`, `sort_routine`) + VALUES (?, ?, ?)"); + $sth->execute($class_sort_rule, $description, $sort_routine); + $sth->finish(); + +} + +=head2 GetClassSortRule + + my $hashref = GetClassSortRule($class_sort_rule); + + Retrieves a class_sort_rules row by class_sort_rule. + +=cut + +sub GetClassSortRule { + + my ($class_sort_rule) = (@_); + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("SELECT * FROM `class_sort_rules` WHERE `class_sort_rule` = ?"); + $sth->execute($class_sort_rule); + my $row = $sth->fetchrow_hashref(); + $sth->finish(); + return $row; +} + +=head2 ModClassSortRule + + ModClassSortRule($class_sort_rule, $description, $sort_routine); + + Updates a class_sort_rules row. + +=cut + +sub ModClassSortRule { + + my ($class_sort_rule, $description, $sort_routine) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("UPDATE `class_sort_rules` + SET `description` = ?, + `sort_routine` = ? + WHERE `class_sort_rule` = ?"); + $sth->execute($description, $sort_routine, $class_sort_rule); + $sth->finish(); + +} + +=head2 DelClassSortRule + + DelClassSortRule($class_sort_rule); + + Deletes class_sort_rules row. + +=cut + +sub DelClassSortRule { + + my ($class_sort_rule) = @_; + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("DELETE FROM `class_sort_rules` WHERE `class_sort_rule` = ?"); + $sth->execute($class_sort_rule); + $sth->finish(); + +} + +=head2 GetSourcesForSortRule + + my @source = GetSourcesForSortRule($class_sort_rule); + + Retrieves an array class_source.cn_rule for each source + that uses the supplied $class_sort_rule. + +=cut + +sub GetSourcesForSortRule { + + my ($class_sort_rule) = @_; + + my $dbh = C4::Context->dbh; + my $sth = $dbh->prepare_cached("SELECT cn_source FROM class_sources WHERE class_sort_rule = ?"); + $sth->execute($class_sort_rule); + my @sources = (); + while (my ($source) = $sth->fetchrow_array()) { + push @sources, $source; + } + $sth->finish(); + return @sources; + +} + +1; + +=head1 AUTHOR + +Koha Developement team + +=cut diff --git a/admin/classsources.pl b/admin/classsources.pl new file mode 100755 index 0000000000..3e4bfe8220 --- /dev/null +++ b/admin/classsources.pl @@ -0,0 +1,276 @@ +#! /usr/bin/perl +# +# Copyright 2007 LibLime +# +# 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 strict; +use CGI; +use C4::Auth; +use C4::Context; +use C4::Output; +use C4::Koha; +use C4::ClassSource; + +my $script_name = "/cgi-bin/koha/admin/classsources.pl"; + +my $input = new CGI; +my $op = $input->param('op'); +my $source_code = $input->param('class_source'); +my $rule_code = $input->param('sort_rule'); + +my ($template, $loggedinuser, $cookie) + = get_template_and_user({template_name => "admin/classsources.tmpl", + query => $input, + type => "intranet", + authnotrequired => 0, + flagsrequired => {parameters => 1}, + debug => 1, + }); + +if ($op) { + $template->param(script_name => $script_name, $op => 1); +} else { + $template->param(script_name => $script_name); +} + +my $display_lists = 0; +if ($op eq "add_source") { + add_class_source_form($template); +} elsif ($op eq "add_source_confirmed") { + add_class_source($template, + $source_code, + $input->param('description'), + $input->param('used') eq "used" ? 1 : 0, + $rule_code); + $display_lists = 1; +} elsif ($op eq "delete_source") { + delete_class_source_form($template); +} elsif ($op eq "delete_source_confirmed") { + delete_class_source($template, $source_code); + $display_lists = 1; +} elsif ($op eq "edit_source") { + edit_class_source_form($template, $source_code); +} elsif ($op eq "edit_source_confirmed") { + edit_class_source($template, + $source_code, + $input->param('description'), + $input->param('used') eq "used" ? 1 : 0, + $rule_code); + $display_lists = 1; +} elsif ($op eq "add_sort_rule") { + add_class_sort_rule_form($template); +} elsif ($op eq "add_sort_rule_confirmed") { + add_class_sort_rule($template, + $rule_code, + $input->param('description'), + $input->param('sort_routine')); + $display_lists = 1; +} elsif ($op eq "delete_sort_rule") { + delete_sort_rule_form($template, $rule_code); +} elsif ($op eq "delete_sort_rule_confirmed") { + delete_sort_rule($template, $rule_code); + $display_lists = 1; +} elsif ($op eq "edit_sort_rule") { + edit_class_sort_rule_form($template, $rule_code); +} elsif ($op eq "edit_sort_rule_confirmed") { + edit_class_sort_rule($template, + $rule_code, + $input->param('description'), + $input->param('sort_routine')); + $display_lists = 1; +} else { + $display_lists = 1; +} + +if ($display_lists) { + $template->param(display_lists => 1); + class_source_list($template); + class_sort_rule_list($template); +} + +output_html_with_http_headers $input, $cookie, $template->output; + +exit 0; + +sub add_class_source_form { + my ($template) = @_; + $template->param( + class_source_form => 1, + confirm_op => "add_source_confirmed", + used => 0 + ); + get_sort_rule_codes($template, ''); +} + +sub add_class_source { + my ($template, $source_code, $description, $used, $sort_rule) = @_; + AddClassSource($source_code, $description, $used, $sort_rule); + $template->param(added_source => $source_code); +} + +sub edit_class_source_form { + my ($template, $source_code) = @_; + + my $source = GetClassSource($source_code); + $template->param( + class_source_form => 1, + edit_class_source => 1, + class_source => $source_code, + confirm_op => "edit_source_confirmed", + description => $source->{'description'}, + used => $source->{'used'}, + ); + + get_sort_rule_codes($template, $source->{'rule_code'}); +} + +sub edit_class_source { + my ($template, $source_code, $description, $used, $sort_rule) = @_; + ModClassSource($source_code, $description, $used, $sort_rule); + $template->param(edited_source => $source_code); +} + + +sub delete_class_source_form { + my ($template) = @_; + $template->param( + delete_class_source_form => 1, + confirm_op => "delete_source_confirmed", + class_source => $source_code, + ); +} + +sub delete_class_source { + my ($template, $source_code) = @_; + DelClassSource($source_code); + $template->param(deleted_source => $source_code); +} + +sub get_sort_rule_codes { + my ($template, $current_rule) = @_; + + my $sort_rules = GetClassSortRules(); + + my @sort_rules = (); + foreach my $sort_rule (sort keys %$sort_rules) { + my $sort_rule = $sort_rules->{$sort_rule}; + push @sort_rules, + { + rule => $sort_rule->{'class_sort_rule'}, + description => $sort_rule->{'description'}, + selected => $sort_rule->{'class_sort_rule'} eq $current_rule ? 1 : 0 + } + } + $template->param(rules_dropdown => \@sort_rules); + +} + +sub add_class_sort_rule_form { + my ($template) = @_; + $template->param( + sort_rule_form => 1, + confirm_op => "add_sort_rule_confirmed" + ); +} + +sub add_class_sort_rule { + my ($template, $rule_code, $description, $sort_routine) = @_; + AddClassSortRule($rule_code, $description, $sort_routine); + $template->param(added_rule => $rule_code); +} + +sub delete_sort_rule_form { + my ($template, $rule_code) = @_; + + my @sources = GetSourcesForSortRule($rule_code); + if ($#sources == -1) { + $template->param( + delete_sort_rule_form => 1, + confirm_op => "delete_sort_rule_confirmed", + sort_rule => $rule_code, + ); + } else { + $template->param( + delete_sort_rule_impossible => 1, + sort_rule => $rule_code + ); + } +} + +sub delete_sort_rule { + my ($template, $rule_code) = @_; + DelClassSortRule($rule_code); + $template->param(deleted_rule => $rule_code); +} + +sub edit_class_sort_rule_form { + my ($template, $rule_code) = @_; + + my $rule = GetClassSortRule($rule_code); + $template->param( + sort_rule_form => 1, + edit_sort_rule => 1, + confirm_op => "edit_sort_rule_confirmed", + sort_rule => $rule_code, + description => $rule->{'description'}, + sort_routine => $rule->{'sort_routine'} + ); + +} + +sub edit_class_sort_rule { + my ($template, $rule_code, $description, $sort_routine) = @_; + ModClassSortRule($rule_code, $description, $sort_routine); + $template->param(edited_rule => $rule_code); +} + +sub class_source_list { + my ($template) = @_; + my $sources = GetClassSources(); + + my @sources = (); + foreach my $cn_source (sort keys %$sources) { + my $source = $sources->{$cn_source}; + push @sources, + { + code => $source->{'cn_source'}, + description => $source->{'description'}, + used => $source->{'used'}, + sortrule => $source->{'class_sort_rule'} + } + } + $template->param(class_sources => \@sources); +} + +sub class_sort_rule_list { + + my ($template) = @_; + my $sort_rules = GetClassSortRules(); + + my @sort_rules = (); + foreach my $sort_rule (sort keys %$sort_rules) { + my $sort_rule = $sort_rules->{$sort_rule}; + push @sort_rules, + { + rule => $sort_rule->{'class_sort_rule'}, + description => $sort_rule->{'description'}, + sort_routine => $sort_rule->{'sort_routine'} + } + } + $template->param(class_sort_rules => \@sort_rules); +} diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index b96137b8a7..2a31c133bf 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -46,6 +46,7 @@ use C4::Auth; use C4::Context; use C4::Koha; use C4::Languages; +use C4::ClassSource; use C4::Output; use C4::Context; @@ -94,6 +95,7 @@ my %tabsysprefs; $tabsysprefs{NoZebra}="Catalogue"; $tabsysprefs{NoZebraIndexes}="Catalogue"; $tabsysprefs{ReceiveBackIssues}="Catalogue"; + $tabsysprefs{DefaultClassificationSource}="Catalogue"; # Circulation $tabsysprefs{maxoutstanding}="Circulation"; @@ -358,6 +360,20 @@ if ($op eq 'add_form') { push @options, { option => $theme, counter => $counter }; $counter++; } + } elsif ($data->{'type'} eq 'ClassSource') { + $template->param('type-choice' => 1); + my $type=''; + @options=(); + my $sources = GetClassSources(); + my $counter=0; + foreach my $cn_source (sort keys %$sources) { + if ($cn_source eq $data->{'value'}) { + push @options, { option => $cn_source, counter => $counter, selected => 1 }; + } else { + push @options, { option => $cn_source, counter => $counter }; + } + $counter++; + } } elsif ($data->{'type'} eq 'Languages') { $template->param('type-choice' => 1); my $type=''; diff --git a/installer/data/en/mandatory/class_sources.sql b/installer/data/en/mandatory/class_sources.sql new file mode 100644 index 0000000000..3f6c1f2882 --- /dev/null +++ b/installer/data/en/mandatory/class_sources.sql @@ -0,0 +1,35 @@ +-- +-- Default classification sources and filing rules +-- for Koha. +-- +-- Copyright (C) 2007 LiblimeA +-- +-- 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 + +-- class sorting (filing) rules +INSERT INTO `class_sort_rules` (`class_sort_rule`, `description`, `sort_routine`) VALUES + ('dewey', 'Default filing rules for DDC', 'Dewey'), + ('lcc', 'Default filing rules for LCC', 'LCC'), + ('generic', 'Generic call number filing rules', 'Generic'); + + +-- classification schemes or sources +INSERT INTO `class_sources` (`cn_source`, `description`, `used`, `class_sort_rule`) VALUES + ('ddc', 'Dewey Decimal Classification', 1, 'dewey'), + ('lcc', 'Library of Congress Classification', 1, 'lcc'), + ('udc', 'Universal Decimal Classification', 0, 'generic'), + ('sudocs', 'SuDoc Classification (U.S. GPO)', 0, 'generic'), + ('z', 'Other/Generic Classification Scheme', 0, 'generic'); diff --git a/installer/data/en/mandatory/class_sources.txt b/installer/data/en/mandatory/class_sources.txt new file mode 100644 index 0000000000..67487771b3 --- /dev/null +++ b/installer/data/en/mandatory/class_sources.txt @@ -0,0 +1 @@ +Default classification sources and filing rules diff --git a/installer/data/en/mandatory/sysprefs.sql b/installer/data/en/mandatory/sysprefs.sql index 66702f6431..9d80cb497a 100644 --- a/installer/data/en/mandatory/sysprefs.sql +++ b/installer/data/en/mandatory/sysprefs.sql @@ -39,6 +39,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IssuingInProcess','0','If ON, disables fines if the patron is issuing item that accumulate debt',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('item-level_itypes','1','If ON, enables Item-level Itemtype / Issuing Rules','','YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemcallnumber','082ab','The MARC field/subfield that is used to calculate the itemcallnumber (Dewey would be 082ab or 092ab; LOC would be 050ab or 090ab) could be 852hi from an item record',NULL,'free'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('DefaultClassificationSource','ddc','Default classification scheme used by the collection. E.g., Dewey, LCC, etc.', NULL,'ClassSources'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('KohaAdminEmailAddress','root@localhost','Define the email address where patron modification requests are sent','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('kohaspsuggest','','Track search queries, turn on by defining host:dbname:user:pass','',''); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('LabelMARCView','standard','Define how a MARC record will display','standard|economical','Choice'); diff --git a/installer/kohastructure.sql b/installer/kohastructure.sql index 2421c9573c..89841e72ae 100644 --- a/installer/kohastructure.sql +++ b/installer/kohastructure.sql @@ -610,6 +610,35 @@ CREATE TABLE `cities` ( PRIMARY KEY (`cityid`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +-- +-- Table structure for table `class_sort_rules` +-- + +DROP TABLE IF EXISTS `class_sort_rules`; +CREATE TABLE `class_sort_rules` ( + `class_sort_rule` varchar(10) NOT NULL default '', + `description` mediumtext, + `sort_routine` varchar(30) NOT NULL default '', + PRIMARY KEY (`class_sort_rule`), + UNIQUE KEY `class_sort_rule_idx` (`class_sort_rule`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Table structure for table `class_sources` +-- + +DROP TABLE IF EXISTS `class_sources`; +CREATE TABLE `class_sources` ( + `cn_source` varchar(10) NOT NULL default '', + `description` mediumtext, + `used` tinyint(4) NOT NULL default 0, + `class_sort_rule` varchar(10) NOT NULL default '', + PRIMARY KEY (`cn_source`), + UNIQUE KEY `cn_source_idx` (`cn_source`), + KEY `used_idx` (`used`), + CONSTRAINT `class_source_ibfk_1` FOREIGN KEY (`class_sort_rule`) REFERENCES `class_sort_rules` (`class_sort_rule`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + -- -- Table structure for table `currency` -- diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc index 05824c3332..0da665f7cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc @@ -27,6 +27,7 @@
  • Koha to MARC mapping
  • MARC Bibliographic framework test
  • MARC Authorities framework
  • +
  • Classification sources
  • Additional parameters
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl index 37e706c5b9..326f0d4c0d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/admin-home.tmpl @@ -55,11 +55,13 @@
    MARC Bibliographic framework
    Create and manage Bibliographic frameworks that define the characteristics of your MARC Records (field and subfield definitions) as well as templates for the MARC editor.
    Koha to MARC mapping
    -
    Define the mappingbetween the Koha transactional database (SQL) and the MARC Bibliographic records. Note that the mapping can be defined through MARC Bibliographic Framework. This tool is just a shortcut to speed up linkage.
    +
    Define the mapping between the Koha transactional database (SQL) and the MARC Bibliographic records. Note that the mapping can be defined through MARC Bibliographic Framework. This tool is just a shortcut to speed up linkage.
    MARC Bibliographic framework test
    Checks the MARC structure. If you change your MARC Bibliographic framework it's recommended that you run this tool to test for errors in your definition.
    MARC Authorities framework
    Create and manage Authorities frameworks that define the characteristics of your MARC Records (field and subfield definitions).
    +
    Classification sources
    +
    Define classification sources (i.e., call number schemes) used by your collection. Also define filing rules used for sorting call numbers.

    Additional parameters

    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl new file mode 100644 index 0000000000..b3fc5fcb72 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/classsources.tmpl @@ -0,0 +1,325 @@ + +Koha › Administration › Classification Sources +<!-- TMPL_IF name="class_source_form" --> + <!-- TMPL_IF name="edit_class_source" --> + › Modify classification source + <!-- TMPL_ELSE --> + › Add classification source + <!-- /TMPL_IF --> +<!-- /TMPL_IF --> +<!-- TMPL_IF name="sort_rule_form" --> + <!-- TMPL_IF name="edit_sort_rule" --> + › Modify filing rule + <!-- TMPL_ELSE --> + › Add filing rule + <!-- /TMPL_IF --> +<!-- /TMPL_IF --> +<!-- TMPL_IF name="delete_class_source_form" --> + › Confirm deletion of classification source <!-- TMPL_VAR name="class_source" --> +<!-- /TMPL_IF --> +<!-- TMPL_IF name="delete_sort_rule_form" --> + › Confirm deletion of filing rule <!-- TMPL_VAR name="sort_rule" --> +<!-- /TMPL_IF --> +<!-- TMPL_IF name="delete_sort_rule_impossible" --> + › Cannot delete filing rule <!-- TMPL_VAR name="sort_rule" --> +<!-- /TMPL_IF --> + + + + + + + + + + + +
    + +
    +
    +
    + + + +

    Modify classification source

    + +

    Add classification source

    + +
    " name="Aform" method="post"> + " /> +
    +
      +
    1. Classification source code + + " /> + + + + +
    2. +
    3. Description + " /> +
    4. +
    5. Source in use? + checked="yes" /> +
    6. +
    7. Filing Rule + +
    8. +
    +
    +

    + Save ChangesAdd Classification Source" + onclick="CheckSourceForm(this.form)" /> + +

    +
    + + + + +

    Modify filing rule

    + +

    Add filing rule

    + +
    " name="Aform" method="post"> + " /> +
    +
      +
    1. Filing rule code + + " /> + + + + +
    2. +
    3. Description + " /> +
    4. +
    5. Filing Routine + " /> +
    6. +
    +
    +

    + Save ChangesAdd Filing Rule" + onclick="CheckRuleForm(this.form)" /> + +

    +
    + + + +

    Confirm deletion of classification source ?

    +
    " name="Aform" method="post"> + " /> + " /> +

    + + +

    +
    + + + +

    Confirm deletion of filing rule ?

    +
    " name="Aform" method="post"> + " /> + " /> +

    + + +

    +
    + + + +

    Cannot delete filing rule

    +

    The filing rule is used by at least one classification source. Please +remove it from all classification source definitions before trying again. +

    +
    " name="Aform" method="post"> + " /> + " /> +

    + +

    + + + +

    Classification Sources

    + +Added classification source + + +Modified classification source + + +Deleted classification source + + + + + + + + + + + + + + + + + + +
    CodeDescriptionIn UseFiling RuleActions
    YesNo + ?op=edit_source&class_source=">Edit + ?op=delete_source&class_source="> +Delete +
    + +
    + +

    ?op=add_source">Add Classification Source

    + +
    +

    Classification Filing Rules

    + +Added filing rule + + +Modified filing rule + + +Deleted filing rule + + + + + + + + + + + + + + + + +
    CodeDescriptionSorting RoutineActions
    + ?op=edit_sort_rule&sort_rule=">Edit + ?op=delete_sort_rule&sort_rule="> +Delete +
    +
    + +

    ?op=add_sort_rule">Add Filing Rule

    + + + + + +
    +
    +
    + +
    +
    + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl index 5a546fce0b..8918406996 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/systempreferences.tmpl @@ -117,7 +117,7 @@

    Koha internal

    Note: you should have no reasons to modify the following default values - +
    " size="40" maxlength="40"> (Choice, YesNo, Integer, Textarea, Float, Themes, or Languages)
    " size="40" maxlength="40"> (Choice, YesNo, Integer, Textarea, Float, Themes, Languages, or ClassSource)
    " size="60" maxlength="80" />(a choice list for Choice (separated by |) or cols|rows for Texarea)
    -- 2.39.5