Merge remote branch 'kc/new/enh/bug_1962' into kcmaster
authorChris Cormack <chrisc@catalyst.net.nz>
Sun, 27 Mar 2011 08:12:40 +0000 (21:12 +1300)
committerChris Cormack <chrisc@catalyst.net.nz>
Sun, 27 Mar 2011 08:12:40 +0000 (21:12 +1300)
Conflicts:
circ/returns.pl
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
installer/data/mysql/it-IT/necessari/sysprefs.sql
installer/data/mysql/pl-PL/mandatory/sysprefs.sql
installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/updatedatabase.pl
kohaversion.pl

232 files changed:
-- [deleted file]
C4/Auth.pm
C4/AuthoritiesMarc.pm
C4/Biblio.pm
C4/Bookseller.pm
C4/Breeding.pm
C4/Circulation.pm
C4/Form/MessagingPreferences.pm
C4/ImportBatch.pm
C4/Items.pm
C4/Koha.pm
C4/Members.pm
C4/Members/Attributes.pm
C4/Overdues.pm
C4/Record.pm
C4/Reserves.pm
C4/Search.pm
C4/Serials.pm
C4/Suggestions.pm
C4/VirtualShelves/Page.pm
C4/XSLT.pm
INSTALL
INSTALL.debian
INSTALL.opensuse
INSTALL.ubuntu
INSTALL.ubuntu.lucid
acqui/basket.pl
acqui/booksellers.pl
acqui/lateorders.pl
acqui/neworderbiblio.pl
acqui/neworderempty.pl
acqui/newordersuggestion.pl
acqui/orderreceive.pl
acqui/parcel.pl
acqui/parcels.pl
acqui/supplier.pl
acqui/updatesupplier.pl
admin/auth_tag_structure.pl
admin/branch_transfer_limits.pl
admin/categorie.pl
admin/check_parent_total.pl
admin/patron-attr-types.pl
admin/smart-rules.pl
admin/systempreferences.pl
authorities/detail.pl
basket/sendbasket.pl
catalogue/ISBDdetail.pl
catalogue/MARCdetail.pl
catalogue/cardview.pl
catalogue/detail.pl
catalogue/labeledMARCdetail.pl
catalogue/moredetail.pl
catalogue/search.pl
catalogue/showmarc.pl
catalogue/updateitem.pl
cataloguing/addbiblio.pl
cataloguing/additem.pl
cataloguing/value_builder/marc21_field_006.pl
cataloguing/value_builder/marc21_field_008.pl
circ/branchtransfers.pl
circ/circulation.pl
circ/overdue.pl
circ/returns.pl
circ/waitingreserves.pl
docs/history.txt
etc/koha-httpd.conf
etc/zebradb/ccl.properties
installer/data/mysql/de-DE/mandatory/sysprefs.sql
installer/data/mysql/de-DE/optional/sample_notices_message_attributes.sql
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/en/optional/auth_val.sql
installer/data/mysql/en/optional/sample_notices_message_attributes.sql
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
installer/data/mysql/it-IT/necessari/sample_notices_message_attributes.sql
installer/data/mysql/it-IT/necessari/sysprefs.sql
installer/data/mysql/kohastructure.sql
installer/data/mysql/pl-PL/mandatory/sysprefs.sql
installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/ru-RU/optional/sample_notices_message_attributes.sql
installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
installer/data/mysql/uk-UA/optional/sample_notices_message_attributes.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/circ-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close-receipt.inc
koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc
koha-tmpl/intranet-tmpl/prog/en/includes/help-top.inc
koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc
koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc
koha-tmpl/intranet-tmpl/prog/en/includes/reports-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/search_indexes.inc
koha-tmpl/intranet-tmpl/prog/en/js/acq.js
koha-tmpl/intranet-tmpl/prog/en/js/ajax.js
koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js [new file with mode: 0755]
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/about.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty_duplicate.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/authorities.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.tmpl [changed mode: 0644->0755]
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml [new file with mode: 0755]
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.tmpl [changed mode: 0644->0755]
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml [new file with mode: 0755]
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd [new file with mode: 0755]
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/issuehistory.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/catalogue/search.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/addbiblio.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/cataloguing/additem.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/boraccount.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/mancredit.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/maninvoice.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-password.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/memberentry.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/members-home.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/messaging.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/moremember.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/notices.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/pay.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/readingrec.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/labels/search.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/printfeercpt.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/printinvoice.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/bor_issues_top.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/reports-home.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tmpl
koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tmpl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl
koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/bridge/reference.gif [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc
koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc
koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiesdetail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-authoritiessearchresultlist.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-suggestions.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-userupdate.tmpl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACResults.xsl
koha-tmpl/opac-tmpl/prog/itemtypeimg/bridge/reference.gif [new file with mode: 0644]
kohaversion.pl
labels/label-create-pdf.pl
members/mancredit.pl
members/maninvoice.pl
members/member.pl
members/memberentry.pl
members/members-home.pl
members/moremember.pl
members/pay.pl
members/setstatus.pl
misc/admin/koha-preferences [new file with mode: 0755]
misc/commit_biblios_file.pl
misc/cronjobs/notifyMailsOp.pl
misc/cronjobs/overdue_notices.pl
misc/cronjobs/purge_suggestions.pl [new file with mode: 0755]
misc/cronjobs/runreport.pl
misc/cronjobs/smsoverdues.pl
misc/maintenance/borrowers-force-messaging-defaults [new file with mode: 0755]
misc/migration_tools/rebuild_zebra.pl
offline_circ/process_koc.pl
opac/opac-ISBDdetail.pl
opac/opac-MARCdetail.pl
opac/opac-authoritiesdetail.pl
opac/opac-detail.pl
opac/opac-reserve.pl
opac/opac-search.pl
opac/opac-sendbasket.pl
opac/opac-sendshelf.pl
opac/opac-suggestions.pl
opac/opac-tags.pl
opac/opac-user.pl
reports/bor_issues_top.pl
reports/borrowers_out.pl
reports/reserves_stats.pl [new file with mode: 0755]
reserve/renewscript.pl
serials/acqui-search-result.pl
serials/claims.pl
suggestion/suggestion.pl
t/00-testcritic.t [new file with mode: 0755]
t/db_dependent/Acquisition.t
t/db_dependent/Koha.t [new file with mode: 0644]
t/db_dependent/Members.t
t/db_dependent/lib/KohaTest.pm
t/db_dependent/lib/KohaTest/ImportBatch/BatchStageCommitRevert.pm
t/perlcriticrc [new file with mode: 0644]
tools/import_borrowers.pl
tools/manage-marc-import.pl
tools/viewlog.pl
virtualshelves/sendshelf.pl
xt/author/translatable-templates.t

diff --git a/-- b/--
deleted file mode 100644 (file)
index e69de29..0000000
index 39eb50f..5f28d5c 100644 (file)
@@ -232,7 +232,7 @@ sub get_template_and_user {
         }
                # Logged-in opac search history
                # If the requested template is an opac one and opac search history is enabled
-               if ($in->{'type'} == "opac" && C4::Context->preference('EnableOpacSearchHistory')) {
+               if ($in->{type} eq 'opac' && C4::Context->preference('EnableOpacSearchHistory')) {
                        my $dbh = C4::Context->dbh;
                        my $query = "SELECT COUNT(*) FROM search_history WHERE userid=?";
                        my $sth = $dbh->prepare($query);
@@ -337,7 +337,6 @@ sub get_template_and_user {
             singleBranchMode             => C4::Context->preference("singleBranchMode"),
             XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
             XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
-            BranchesLoop                 => GetBranchesLoop(),
             using_https                  => $in->{'query'}->https() ? 1 : 0,
             noItemTypeImages            => C4::Context->preference("noItemTypeImages"),
     );
@@ -360,6 +359,7 @@ sub get_template_and_user {
             advancedMARCEditor          => C4::Context->preference("advancedMARCEditor"),
             canreservefromotherbranches => C4::Context->preference('canreservefromotherbranches'),
             intranetcolorstylesheet     => C4::Context->preference("intranetcolorstylesheet"),
+            IntranetFavicon             => C4::Context->preference("IntranetFavicon"),
             intranetreadinghistory      => C4::Context->preference("intranetreadinghistory"),
             intranetstylesheet          => C4::Context->preference("intranetstylesheet"),
             IntranetUserCSS             => C4::Context->preference("IntranetUserCSS"),
@@ -380,17 +380,17 @@ sub get_template_and_user {
         # variables passed from CGI: opac_css_override and opac_search_limits.
         my $opac_search_limit = $ENV{'OPAC_SEARCH_LIMIT'};
         my $opac_limit_override = $ENV{'OPAC_LIMIT_OVERRIDE'};
-        my $mylibraryfirst = C4::Context->preference("SearchMyLibraryFirst");
-        my $opac_name;
-        if($opac_limit_override && ($opac_search_limit =~ /branch:(\w+)/) ){
-             $opac_name = C4::Branch::GetBranchName($1)   # opac_search_limit is a branch, so we use it.
-        } elsif($mylibraryfirst){
-            $opac_name = C4::Branch::GetBranchName($mylibraryfirst);
+        my $opac_name = '';
+        if (($opac_search_limit =~ /branch:(\w+)/ && $opac_limit_override) || $in->{'query'}->param('limit') =~ /branch:(\w+)/){
+            $opac_name = $1;   # opac_search_limit is a branch, so we use it.
+        } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
+            $opac_name = C4::Context->userenv->{'branch'};
         }
         $template->param(
             AmazonContent             => "" . C4::Context->preference("AmazonContent"),
             AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
             AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
+            BranchesLoop              => GetBranchesLoop($opac_name),
             LibraryName               => "" . C4::Context->preference("LibraryName"),
             LibraryNameTitle          => "" . $LibraryNameTitle,
             LoginBranchname           => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"",
@@ -408,7 +408,6 @@ sub get_template_and_user {
             OpacAuthorities           => C4::Context->preference("OpacAuthorities"),
             OPACBaseURL               => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} .
                    ($ENV{'SERVER_PORT'} eq ($in->{'query'}->https() ? "443" : "80") ? '' : ":$ENV{'SERVER_PORT'}"),
-            opac_name             => $opac_name,
             opac_css_override           => $ENV{'OPAC_CSS_OVERRIDE'},
             opac_search_limit         => $opac_search_limit,
             opac_limit_override       => $opac_limit_override,
@@ -430,6 +429,7 @@ sub get_template_and_user {
             opacstylesheet            => "" . C4::Context->preference("opacstylesheet"),
             opacbookbag               => "" . C4::Context->preference("opacbookbag"),
             opaccredits               => "" . C4::Context->preference("opaccredits"),
+            OpacFavicon               => C4::Context->preference("OpacFavicon"),
             opacheader                => "" . C4::Context->preference("opacheader"),
             opaclanguagesdisplay      => "" . C4::Context->preference("opaclanguagesdisplay"),
             opacreadinghistory        => C4::Context->preference("opacreadinghistory"),
@@ -922,6 +922,7 @@ sub checkauth {
         opacuserlogin        => C4::Context->preference("opacuserlogin"),
         OpacNav              => C4::Context->preference("OpacNav"),
         opaccredits          => C4::Context->preference("opaccredits"),
+        OpacFavicon          => C4::Context->preference("OpacFavicon"),
         opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
         opacsmallimage       => C4::Context->preference("opacsmallimage"),
         opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
index 9315e55..1eeb964 100644 (file)
@@ -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);
 
@@ -623,6 +624,7 @@ sub AddAuthority {
       $f5->update($time.".0");
     }
 
+    SetUTF8Flag($record);
        if ($format eq "MARC21") {
                if (!$record->leader) {
                        $record->leader($leader);
@@ -649,7 +651,7 @@ sub AddAuthority {
        }
 
   if (($format eq "UNIMARCAUTH") && (!$record->subfield('100','a'))){
-        $record->leader("     nx  j22             ");
+        $record->leader("     nx  j22             ") unless ($record->leader());
         my $date=POSIX::strftime("%Y%m%d",localtime);    
         if ($record->field('100')){
           $record->field('100')->update('a'=>$date."afrey50      ba0");
@@ -700,6 +702,7 @@ sub AddAuthority {
     my $sth=$dbh->prepare("insert into auth_header (authid,datecreated,authtypecode,marc,marcxml) values (?,now(),?,?,?)");
     $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,8 +721,9 @@ 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);
-    my $sth = prepare("DELETE FROM auth_header WHERE authid=?");
+    my $sth = $dbh->prepare("DELETE FROM auth_header WHERE authid=?");
     $sth->execute($authid);
 }
 
@@ -748,6 +752,7 @@ sub ModAuthority {
       print AUTH $authid;
       close AUTH;
   }
+  logaction( "AUTHORITIES", "MODIFY", $authid, "BEFORE=>" . $oldrecord->as_formatted ) if C4::Context->preference("AuthoritiesLog");
   return $authid;
 }
 
@@ -1038,7 +1043,7 @@ sub BuildSummary{
             $narrowerterms =~s/-- \n$//;
             $seealso =~s/-- \n$//;
             $see =~s/-- \n$//;
-      $summary = "<b><a href=\"detail.pl?authid=$authid\">".$heading."</a></b><br />".($notes?"$notes <br />":"");
+      $summary = "<b>".$heading."</b><br />".($notes?"$notes <br />":"");
       $summary.= '<p><div class="label">TG : '.$broaderterms.'</div></p>' if ($broaderterms);
       $summary.= '<p><div class="label">TS : '.$narrowerterms.'</div></p>' if ($narrowerterms);
       $summary.= '<p><div class="label">TA : '.$seealso.'</div></p>' if ($seealso);
@@ -1177,16 +1182,17 @@ sub BuildUnimarcHierarchy{
   my $class = shift @_;
   my $authid_constructed = shift @_;
   return undef unless ($record);
-  my $authid=$record->subfield('2..','3');
+  my $authid=$record->field('001')->data();
   my %cell;
   my $parents=""; my $children="";
   my (@loopparents,@loopchildren);
-  foreach my $field ($record->field('550')){
+  foreach my $field ($record->field('5..')){
+       my $subfauthid=_get_authid_subfield($field);
     if ($field->subfield('5') && $field->subfield('a')){
       if ($field->subfield('5') eq 'h'){
-        push @loopchildren, { "childauthid"=>$field->subfield('3'),"childvalue"=>$field->subfield('a')};
+        push @loopchildren, { "childauthid"=>$subfauthid,"childvalue"=>$field->subfield('a')};
       }elsif ($field->subfield('5') eq 'g'){
-        push @loopparents, { "parentauthid"=>$field->subfield('3'),"parentvalue"=>$field->subfield('a')};
+        push @loopparents, { "parentauthid"=>$subfauthid,"parentvalue"=>$field->subfield('a')};
       }
           # brothers could get in there with an else
     }
@@ -1202,6 +1208,10 @@ sub BuildUnimarcHierarchy{
   return \%cell;
 }
 
+sub _get_authid_subfield{
+    my ($field)=@_;
+    return $field->subfield('9')||$field->subfield('3');
+}
 =head2 GetHeaderAuthority
 
   $ref= &GetHeaderAuthority( $authid)
index 8ea5da5..1b378df 100644 (file)
@@ -1,6 +1,7 @@
 package C4::Biblio;
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -249,6 +250,7 @@ sub AddBiblio {
     my $dbh = C4::Context->dbh;
 
     # transform the data into koha-table style data
+    SetUTF8Flag($record);
     my $olddata = TransformMarcToKoha( $dbh, $record, $frameworkcode );
     ( $biblionumber, $error ) = _koha_add_biblio( $dbh, $olddata, $frameworkcode );
     $olddata->{'biblionumber'} = $biblionumber;
@@ -293,6 +295,7 @@ sub ModBiblio {
         logaction( "CATALOGUING", "MODIFY", $biblionumber, "BEFORE=>" . $newrecord->as_formatted );
     }
 
+    SetUTF8Flag($record);
     my $dbh = C4::Context->dbh;
 
     $frameworkcode = "" unless $frameworkcode;
@@ -317,10 +320,15 @@ sub ModBiblio {
     foreach my $fielditem (@fields) {
         my $field;
         foreach ( $fielditem->subfields() ) {
+            # re-encode the subfield only if it isn't already in utf-8.
+            my ($tag, $value) = @$_;
+            $tag = Encode::encode('utf-8', $tag) unless utf8::is_utf8($tag);
+            $value = Encode::encode('utf-8', $value) unless utf8::is_utf8($value);
+
             if ($field) {
-                $field->add_subfields( Encode::encode( 'utf-8', $_->[0] ) => Encode::encode( 'utf-8', $_->[1] ) );
+                $field->add_subfields( $tag => $value );
             } else {
-                $field = MARC::Field->new( "$itemtag", '', '', Encode::encode( 'utf-8', $_->[0] ) => Encode::encode( 'utf-8', $_->[1] ) );
+                $field = MARC::Field->new( "$itemtag", '', '', $tag => $value );
             }
         }
         $record->append_fields($field);
@@ -755,7 +763,7 @@ sub GetISBDView {
     my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype );
     my $tagslib = &GetMarcStructure( 1, $itemtype );
 
-    my $ISBD = C4::Context->preference('ISBD');
+    my $ISBD = C4::Context->preference('isbd');
     my $bloc = $ISBD;
     my $res;
     my $blocres;
@@ -1390,6 +1398,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 +1426,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;
 
@@ -1610,7 +1620,7 @@ sub GetMarcSeries {
             if ($volume_number) {
                 push @subfields_loop, { volumenum => $value };
             } else {
-                push @subfields_loop, { code => $code, value => $value, link_loop => \@link_loop, separator => $separator, volumenum => $volume_number };
+                push @subfields_loop, { code => $code, value => $value, link_loop => \@link_loop, separator => $separator, volumenum => $volume_number } unless ( $series_subfield->[0] eq '9' );
             }
             $counter++;
         }
@@ -2287,6 +2297,14 @@ sub PrepareItemrecordDisplay {
                         $defaultvalue = $defaultvalues->{branchcode} if $defaultvalues;
                     }
                 }
+                if (   ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.location' )
+                    && $defaultvalues
+                    && $defaultvalues->{'location'} ) {
+                    my $temp = $itemrecord->field($subfield) if ($itemrecord);
+                    unless ($temp) {
+                        $defaultvalue = $defaultvalues->{location} if $defaultvalues;
+                    }
+                }
                 if ( $tagslib->{$tag}->{$subfield}->{authorised_value} ) {
                     my @authorised_values;
                     my %authorised_lib;
index 21ad348..4ad42cb 100644 (file)
@@ -1,6 +1,7 @@
 package C4::Bookseller;
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 PTFS Europe
 #
 # This file is part of Koha.
 #
@@ -18,23 +19,18 @@ package C4::Bookseller;
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
-#use warnings; FIXME - Bug 2505
-
-use vars qw($VERSION @ISA @EXPORT);
-
-BEGIN {
-       # set the version for version checking
-       $VERSION = 3.01;
-    require Exporter;
-       @ISA    = qw(Exporter);
-       @EXPORT = qw(
-               &GetBookSeller &GetBooksellersWithLateOrders &GetBookSellerFromId
-               &ModBookseller
-               &DelBookseller
-               &AddBookseller
-       );
-}
+use warnings;
+
+use base qw( Exporter );
 
+# set the version for version checking
+our $VERSION   = 4.01;
+our @EXPORT_OK = qw(
+  GetBookSeller GetBooksellersWithLateOrders GetBookSellerFromId
+  ModBookseller
+  DelBookseller
+  AddBookseller
+);
 
 =head1 NAME
 
@@ -54,92 +50,67 @@ a bookseller.
 
 =head2 GetBookSeller
 
-@results = &GetBookSeller($searchstring);
+@results = GetBookSeller($searchstring);
 
 Looks up a book seller. C<$searchstring> may be either a book seller
 ID, or a string to look for in the book seller's name.
 
-C<@results> is an array of references-to-hash, whose keys are the fields of of the
+C<@results> is an array of hash_refs whose keys are the fields of of the
 aqbooksellers table in the Koha database.
 
 =cut
 
-# FIXME: This function is badly named.  It should be something like 
-# SearchBookSellersByName.  It is NOT a singular return value.
+sub GetBookSeller {
+    my $searchstring = shift;
+    $searchstring = q{%} . $searchstring . q{%};
+    my $query =
+'select aqbooksellers.*, count(*) as basketcount from aqbooksellers left join aqbasket '
+      . 'on aqbasket.booksellerid = aqbooksellers.id where name lIke ? group by aqbooksellers.id order by name';
+
+    my $dbh           = C4::Context->dbh;
+    my $sth           = $dbh->prepare($query);
+    $sth->execute($searchstring);
+    my $resultset_ref = $sth->fetchall_arrayref( {} );
+    return @{$resultset_ref};
+}
 
-sub GetBookSeller($) {
-    my ($searchstring) = @_;
+sub GetBookSellerFromId {
+    my $id = shift or return;
     my $dbh = C4::Context->dbh;
-    my $query = "SELECT * FROM aqbooksellers WHERE name LIKE ?";
-    my $sth =$dbh->prepare($query);
-    $sth->execute( "%$searchstring%" );
-    my @results;
-    # count how many baskets this bookseller has.
-    # if it has none, the bookseller can be deleted
-    my $sth2 = $dbh->prepare("SELECT count(*) FROM aqbasket WHERE booksellerid=?");
-    while ( my $data = $sth->fetchrow_hashref ) {
-        $sth2->execute($data->{id});
-        $data->{basketcount} = $sth2->fetchrow();
-        push( @results, $data );
+    my $vendor =
+      $dbh->selectrow_hashref( 'SELECT * FROM aqbooksellers WHERE id = ?',
+        {}, $id );
+    if ($vendor) {
+        ( $vendor->{basketcount} ) = $dbh->selectrow_array(
+            'SELECT count(*) FROM aqbasket where booksellerid = ?',
+            {}, $id );
     }
-    $sth->finish;
-    return  @results ;
+    return $vendor;
 }
 
-
-sub GetBookSellerFromId($) {
-       my $id = shift or return;
-       my $dbh = C4::Context->dbh();
-       my $query = "SELECT * FROM aqbooksellers WHERE id = ?";
-       my $sth =$dbh->prepare($query);
-       $sth->execute( $id );
-       if (my $data = $sth->fetchrow_hashref()){
-               my $sth2 = $dbh->prepare("SELECT count(*) FROM aqbasket WHERE booksellerid=?");
-               $sth2->execute($id);
-               $data->{basketcount}=$sth2->fetchrow();
-               return $data;
-       }
-       return;
-}
 #-----------------------------------------------------------------#
 
 =head2 GetBooksellersWithLateOrders
 
-%results = &GetBooksellersWithLateOrders;
+%results = GetBooksellersWithLateOrders($delay);
 
 Searches for suppliers with late orders.
 
 =cut
 
 sub GetBooksellersWithLateOrders {
-    my ($delay,$branch) = @_;  # FIXME: Branch argument unused.
+    my $delay = shift;
     my $dbh   = C4::Context->dbh;
 
-# FIXME NOT quite sure that this operation is valid for DBMs different from Mysql, HOPING so
-# should be tested with other DBMs
-
-    my $strsth;
-    my $dbdriver = C4::Context->config("db_scheme") || "mysql";
-    if ( $dbdriver eq "mysql" ) {
-        $strsth = "
-            SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
-            FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
-            LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
-            WHERE (closedate < DATE_SUB(CURDATE( ),INTERVAL $delay DAY)
-                AND (datereceived = '' OR datereceived IS NULL))
-        ";
-    }
-    else {
-        $strsth = "
-            SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
-            FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
-            LEFT JOIN aqbooksellers ON aqbasket.aqbooksellerid = aqbooksellers.id
-            WHERE (closedate < (CURDATE( )-(INTERVAL $delay DAY)))
-                AND (datereceived = '' OR datereceived IS NULL))
-        ";
-    }
+    # TODO delay should be verified
+    my $query_string =
+      "SELECT DISTINCT aqbasket.booksellerid, aqbooksellers.name
+    FROM aqorders LEFT JOIN aqbasket ON aqorders.basketno=aqbasket.basketno
+    LEFT JOIN aqbooksellers ON aqbasket.booksellerid = aqbooksellers.id
+    WHERE (closedate < DATE_SUB(CURDATE( ),INTERVAL $delay DAY)
+    AND (datereceived = '' OR datereceived IS NULL))";
 
-    my $sth = $dbh->prepare($strsth);
+    my $sth = $dbh->prepare($query_string);
     $sth->execute;
     my %supplierlist;
     while ( my ( $id, $name ) = $sth->fetchrow ) {
@@ -165,8 +136,8 @@ Returns the ID of the newly-created bookseller.
 
 sub AddBookseller {
     my ($data) = @_;
-    my $dbh = C4::Context->dbh;
-    my $query = "
+    my $dbh    = C4::Context->dbh;
+    my $query  = q|
         INSERT INTO aqbooksellers
             (
                 name,      address1,      address2,   address3,      address4,
@@ -176,8 +147,8 @@ sub AddBookseller {
                 listincgst,invoiceincgst, gstrate,    discount,
                 notes
             )
-        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
-    ";
+        VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) |
+      ;
     my $sth = $dbh->prepare($query);
     $sth->execute(
         $data->{'name'},         $data->{'address1'},
@@ -196,21 +167,14 @@ sub AddBookseller {
     );
 
     # return the id of this new supplier
-    # FIXME: no protection against simultaneous addition: max(id) might be wrong!
-    $query = "
-        SELECT max(id)
-        FROM   aqbooksellers
-    ";
-    $sth = $dbh->prepare($query);
-    $sth->execute;
-    return scalar($sth->fetchrow);
+    return $dbh->{'mysql_insertid'};
 }
 
 #-----------------------------------------------------------------#
 
 =head2 ModBookseller
 
-&ModBookseller($bookseller);
+ModBookseller($bookseller);
 
 Updates the information for a given bookseller. C<$bookseller> is a
 reference-to-hash whose keys are the fields of the aqbooksellers table
@@ -226,17 +190,15 @@ C<&ModBookseller> with the result.
 sub ModBookseller {
     my ($data) = @_;
     my $dbh    = C4::Context->dbh;
-    my $query = "
-        UPDATE aqbooksellers
+    my $query  = 'UPDATE aqbooksellers
         SET name=?,address1=?,address2=?,address3=?,address4=?,
             postal=?,phone=?,fax=?,url=?,contact=?,contpos=?,
             contphone=?,contfax=?,contaltphone=?,contemail=?,
             contnotes=?,active=?,listprice=?, invoiceprice=?,
             gstreg=?,listincgst=?,invoiceincgst=?,
-            discount=?, notes=?, gstrate=?
-        WHERE id=?
-    ";
-    my $sth    = $dbh->prepare($query);
+            discount=?,notes=?,gstrate=?
+        WHERE id=?';
+    my $sth = $dbh->prepare($query);
     $sth->execute(
         $data->{'name'},         $data->{'address1'},
         $data->{'address2'},     $data->{'address3'},
@@ -249,27 +211,27 @@ sub ModBookseller {
         $data->{'active'},       $data->{'listprice'},
         $data->{'invoiceprice'}, $data->{'gstreg'},
         $data->{'listincgst'},   $data->{'invoiceincgst'},
-        $data->{'discount'},
-        $data->{'notes'},        $data->{'gstrate'},
-        $data->{'id'}
+        $data->{'discount'},     $data->{'notes'},
+        $data->{'gstrate'},      $data->{'id'}
     );
-    $sth->finish;
+    return;
 }
 
 =head2 DelBookseller
 
-&DelBookseller($booksellerid);
+DelBookseller($booksellerid);
 
-delete the supplier identified by $booksellerid
-This sub can be called only if the supplier has no order.
+delete the supplier record identified by $booksellerid
+This sub assumes it is called only if the supplier has no order.
 
 =cut
 
 sub DelBookseller {
-    my ($id) = @_;
-    my $dbh=C4::Context->dbh;
-    my $sth=$dbh->prepare("DELETE FROM aqbooksellers WHERE id=?");
+    my $id  = shift;
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare('DELETE FROM aqbooksellers WHERE id=?');
     $sth->execute($id);
+    return;
 }
 
 1;
index 2b73729..9003f9a 100644 (file)
@@ -169,7 +169,7 @@ C<import_biblios> tables of the Koha database.
 =cut
 
 sub BreedingSearch {
-    my ($title,$isbn,$z3950random) = @_;
+    my ($search,$isbn,$z3950random) = @_;
     my $dbh   = C4::Context->dbh;
     my $count = 0;
     my ($query,@bind);
@@ -185,12 +185,13 @@ sub BreedingSearch {
         $query .= "z3950random = ?";
         @bind=($z3950random);
     } else {
+        $search =~ s/(\s+)/\%/g;
         @bind=();
-        if ($title) {
-            $query .= "title like ?";
-            push(@bind,"$title%");
+    if ($search) {
+            $query .= "title like ? OR author like ?";
+            push(@bind,"%$search%", "%$search%");
         }
-        if ($title && $isbn) {
+        if ($search && $isbn) {
             $query .= " and ";
         }
         if ($isbn) {
index f7846ac..516a111 100644 (file)
@@ -1,6 +1,7 @@
 package C4::Circulation;
 
 # Copyright 2000-2002 Katipo Communications
+# copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -730,17 +731,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 );
         }
     }
index bd1c22f..808719f 100644 (file)
@@ -122,6 +122,7 @@ sub set_form_values {
     my $messaging_options = C4::Members::Messaging::GetMessagingOptions();
     PREF: foreach my $option ( @$messaging_options ) {
         my $pref = C4::Members::Messaging::GetMessagingPreferences( { %{ $target_params }, message_name => $option->{'message_name'} } );
+        $option->{ $option->{'message_name'} } = 1;
         # make a hashref of the days, selecting one.
         if ( $option->{'takes_days'} ) {
             my $days_in_advance = $pref->{'days_in_advance'} ? $pref->{'days_in_advance'} : 0;
index f5b42a9..145e5d9 100644 (file)
@@ -389,13 +389,14 @@ sub BatchFindBibDuplicates {
 =head2 BatchCommitBibRecords
 
   my ($num_added, $num_updated, $num_items_added, $num_items_errored, 
-      $num_ignored) = BatchCommitBibRecords($batch_id, 
+      $num_ignored) = BatchCommitBibRecords($batch_id, $framework,
                       $progress_interval, $progress_callback);
 
 =cut
 
 sub BatchCommitBibRecords {
     my $batch_id = shift;
+    my $framework = shift;
 
     # optional callback to monitor status 
     # of job
@@ -451,7 +452,7 @@ sub BatchCommitBibRecords {
 
         if ($bib_result eq 'create_new') {
             $num_added++;
-            my ($biblionumber, $biblioitemnumber) = AddBiblio($marc_record, '');
+            my ($biblionumber, $biblioitemnumber) = AddBiblio($marc_record, $framework);
             my $sth = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?");
             $sth->execute($biblionumber, $rowref->{'import_record_id'});
             $sth->finish();
index 05df0c5..d293608 100644 (file)
@@ -1897,7 +1897,8 @@ sub _koha_new_item {
             uri = ?,
             enumchron           = ?,
             more_subfields_xml  = ?,
-            copynumber          = ?
+            copynumber          = ?,
+            stocknumber         = ?
           ";
     my $sth = $dbh->prepare($query);
    $sth->execute(
@@ -1934,6 +1935,7 @@ sub _koha_new_item {
             $item->{'enumchron'},
             $item->{'more_subfields_xml'},
             $item->{'copynumber'},
+            $item->{'stocknumber'},
     );
     my $itemnumber = $dbh->{'mysql_insertid'};
     if ( defined $sth->errstr ) {
index 2bdcc28..0836669 100644 (file)
@@ -2,6 +2,7 @@ package C4::Koha;
 
 # Copyright 2000-2002 Katipo Communications
 # Parts Copyright 2010 Nelsonville Public Library
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -57,6 +58,8 @@ BEGIN {
                &GetKohaAuthorisedValues
                &GetKohaAuthorisedValuesFromField
     &GetKohaAuthorisedValueLib
+    &GetAuthorisedValueByCode
+    &GetKohaImageurlFromAuthorisedValues
                &GetAuthValCode
                &GetNormalizedUPC
                &GetNormalizedISBN
@@ -941,6 +944,25 @@ sub displayServers {
     return \@primaryserverloop;
 }
 
+
+=head2 GetKohaImageurlFromAuthorisedValues
+
+$authhorised_value = GetKohaImageurlFromAuthorisedValues( $category, $authvalcode );
+
+Return the first url of the authorised value image represented by $lib.
+
+=cut
+
+sub GetKohaImageurlFromAuthorisedValues {
+    my ( $category, $lib ) = @_;
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare("SELECT imageurl FROM authorised_values WHERE category=? AND lib =?");
+    $sth->execute( $category, $lib );
+    while ( my $data = $sth->fetchrow_hashref ) {
+        return $data->{'imageurl'};
+    }
+}
+
 =head2 GetAuthValCode
 
   $authvalcode = GetAuthValCode($kohafield,$frameworkcode);
@@ -1035,6 +1057,26 @@ sub GetAuthorisedValueCategories {
     return \@results;
 }
 
+=head2 GetAuthorisedValueByCode
+
+$authhorised_value = GetAuthorisedValueByCode( $category, $authvalcode );
+
+Return the lib attribute from authorised_values from the row identified
+by the passed category and code
+
+=cut
+
+sub GetAuthorisedValueByCode {
+    my ( $category, $authvalcode ) = @_;
+
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category=? AND authorised_value =?");
+    $sth->execute( $category, $authvalcode );
+    while ( my $data = $sth->fetchrow_hashref ) {
+        return $data->{'lib'};
+    }
+}
+
 =head2 GetKohaAuthorisedValues
 
 Takes $kohafield, $fwcode as parameters.
index fafc99b..ace939d 100644 (file)
@@ -1,6 +1,7 @@
 package C4::Members;
 
 # Copyright 2000-2003 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -278,22 +279,30 @@ C<&searchtype> is a string telling the type of search you want todo : start_with
 =cut
 
 sub Search {
-    my ($filter,$orderby, $limit, $columns_out, $search_on_fields,$searchtype) = @_;
-       my @filters;
-       if (ref($filter) eq "ARRAY"){
-               push @filters,@$filter;
-       }
-       else {
-               push @filters,$filter;
-       }
-    if (C4::Context->preference('ExtendedPatronAttributes')) {
-               my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($filter);
-               push @filters,@$matching_records;
-    }
-       $searchtype||="start_with";
-       my $data=SearchInTable("borrowers",\@filters,$orderby,$limit,$columns_out,$search_on_fields,$searchtype);
-
-    return ( $data );
+    my ( $filter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype ) = @_;
+    my @filters;
+    my %filtersmatching_record;
+    my @finalfilter;
+    if ( ref($filter) eq "ARRAY" ) {
+        push @filters, @$filter;
+    } else {
+        push @filters, $filter;
+    }
+    if ( C4::Context->preference('ExtendedPatronAttributes') ) {
+        my $matching_records = C4::Members::Attributes::SearchIdMatchingAttribute($filter);
+        if(scalar(@$matching_records)>0) {
+                       foreach my $matching_record (@$matching_records) {
+                               $filtersmatching_record{$$matching_record[0]}=1;
+                       }
+                       foreach my $k (keys(%filtersmatching_record)) {
+                               push @filters, {"borrowernumber"=>$k};
+                       }
+               }
+    }
+    $searchtype ||= "start_with";
+       push @finalfilter, \@filters;
+       my $data = SearchInTable( "borrowers", \@finalfilter, $orderby, $limit, $columns_out, $search_on_fields, $searchtype );
+    return ($data);
 }
 
 =head2 GetMemberDetails
@@ -444,7 +453,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;
index 70c34b4..1db9424 100644 (file)
@@ -102,8 +102,8 @@ sub GetBorrowerAttributes {
 
 sub SearchIdMatchingAttribute{
     my $filter = shift;
-
-    my $dbh = C4::Context->dbh();
+    my $finalfilter=$filter->[0];
+    my $dbh   = C4::Context->dbh();
     my $query = qq{
 SELECT borrowernumber
 FROM borrower_attributes
@@ -111,8 +111,8 @@ JOIN borrower_attribute_types USING (code)
 WHERE staff_searchable = 1
 AND attribute like ?};
     my $sth = $dbh->prepare_cached($query);
-    $sth->execute($filter);
-       return $sth->fetchall_arrayref;
+    $sth->execute("%$finalfilter%");
+    return $sth->fetchall_arrayref;
 }
 
 =head2 CheckUniqueness
index adba979..a9af9d6 100644 (file)
@@ -2,6 +2,7 @@ package C4::Overdues;
 
 
 # Copyright 2000-2002 Katipo Communications
+# copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -488,12 +489,12 @@ sub UpdateFine {
 
     if ( my $data = $sth->fetchrow_hashref ) {
 
-               # we're updating an existing fine.  Only modify if we're adding to the charge.
+               # we're updating an existing fine.  Only modify if amount changed
         # Note that in the current implementation, you cannot pay against an accruing fine
         # (i.e. , of accounttype 'FU').  Doing so will break accrual.
        if ( $data->{'amount'} != $amount ) {
             my $diff = $amount - $data->{'amount'};
-            $diff = 0 if ( $data->{amount} > $amount);
+           #3341: diff could be positive or negative!
             my $out  = $data->{'amountoutstanding'} + $diff;
             my $query = "
                 UPDATE accountlines
index 497c03d..b313fb8 100644 (file)
@@ -1,7 +1,7 @@
 package C4::Record;
 #
 # Copyright 2006 (C) LibLime
-# Joshua Ferraro <jmf@liblime.com>
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index 2dd2688..87e2325 100644 (file)
@@ -2,7 +2,7 @@ package C4::Reserves;
 
 # Copyright 2000-2002 Katipo Communications
 #           2006 SAN Ouest Provence
-#           2007 BibLibre Paul POULAIN
+#           2007-2010 BibLibre Paul POULAIN
 #
 # This file is part of Koha.
 #
@@ -804,6 +804,12 @@ sub CheckReserves {
             } else {
                 # See if this item is more important than what we've got so far
                 if ( $res->{'priority'} && $res->{'priority'} < $priority ) {
+                    my $borrowerinfo=C4::Members::GetMemberDetails($res->{'borrowernumber'});
+                    my $iteminfo=C4::Items::GetItem($itemnumber);
+                    my $branch=C4::Circulation::_GetCircControlBranch($iteminfo,$borrowerinfo);
+                    my $branchitemrule = C4::Circulation::GetBranchItemRule($branch,$iteminfo->{'itype'});
+                    next if ($branchitemrule->{'holdallowed'} == 0);
+                    next if (($branchitemrule->{'holdallowed'} == 1) && ($branch ne $borrowerinfo->{'branchcode'}));
                     $priority = $res->{'priority'};
                     $highest  = $res;
                 }
index a469948..cd970b7 100644 (file)
@@ -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";
@@ -511,9 +533,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/ ) {
@@ -855,7 +879,9 @@ sub getIndexes{
                     'id-other',
                     'Illustration-code',
                     'ISBN',
+                    'isbn',
                     'ISSN',
+                    'issn',
                     'itemtype',
                     'kw',
                     'Koha-Auth-Number',
@@ -874,12 +900,14 @@ sub getIndexes{
                     'mc-itemtype',
                     'mc-rtype',
                     'mus',
+                    'name',
                     'Name-geographic',
                     'Name-geographic-heading',
                     'Name-geographic-see',
                     'Name-geographic-seealso',
                     'nb',
                     'Note',
+                    'notes',
                     'ns',
                     'nt',
                     'pb',
@@ -1043,7 +1071,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' );
@@ -1270,7 +1304,14 @@ sub buildQuery {
         # group_OR_limits, prefixed by mc-
         # OR every member of the group
         elsif ( $this_limit =~ /mc/ ) {
-#        if ( $this_limit =~ /mc/ ) {
+        
+            if ( $this_limit =~ /mc-ccode:/ ) {
+                # in case the mc-ccode value has complicating chars like ()'s inside it we wrap in quotes
+                $this_limit =~ tr/"//d;
+                my ($k,$v) = split(/:/, $this_limit,2);
+                $this_limit = $k.":\"".$v."\"";
+            }
+
             $group_OR_limits .= " or " if $group_OR_limits;
             $limit_desc      .= " or " if $group_OR_limits;
             $group_OR_limits .= "$this_limit";
@@ -1674,12 +1715,17 @@ sub searchResults {
             # FIXME note that XSLTResultsDisplay (use of XSLT to format staff interface bib search results)
             # is not implemented yet
             $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, 'Results', 
-                                                                $search_context);
+                                                                $search_context, 1);
+                # the last parameter tells Koha to clean up the problematic ampersand entities that Zebra outputs
+
         }
 
-        # last check for norequest : if itemtype is notforloan, it can't be reserved either, whatever the items
-        $can_place_holds = 0
-          if $itemtypes{ $oldbiblio->{itemtype} }->{notforloan};
+        # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either
+        if (!C4::Context->preference("item-level_itypes")) {
+            if ($itemtypes{ $oldbiblio->{itemtype} }->{notforloan}) {
+                $can_place_holds = 0;
+            }
+        }
         $oldbiblio->{norequests} = 1 unless $can_place_holds;
         $oldbiblio->{itemsplural}          = 1 if $items_count > 1;
         $oldbiblio->{items_count}          = $items_count;
index 5e2fa22..32c9bcb 100644 (file)
@@ -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;
@@ -1480,9 +1481,9 @@ sub ItemizeSerials {
     my $fwk = GetFrameworkCode( $data->{'biblionumber'} );
     if ( $info->{barcode} ) {
         my @errors;
-        my $exists = itemdata( $info->{'barcode'} );
-        push @errors, "barcode_not_unique" if ($exists);
-        unless ($exists) {
+        if ( is_barcode_in_use( $info->{barcode} ) ) {
+            push @errors, 'barcode_not_unique';
+        } else {
             my $marcrecord = MARC::Record->new();
             my ( $tag, $subfield ) = GetMarcFromKohaField( "items.barcode", $fwk );
             my $newField = MARC::Field->new( "$tag", '', '', "$subfield" => $info->{barcode} );
@@ -2337,29 +2338,24 @@ sub GetNextDate(@) {
     return "$resultdate";
 }
 
-=head2 itemdata
-
-  $item = itemdata($barcode);
+=head2 is_barcode_in_use
 
-Looks up the item with the given barcode, and returns a
-reference-to-hash containing information about that item. The keys of
-the hash are the fields from the C<items> and C<biblioitems> tables in
-the Koha database.
+Returns number of occurence of the barcode in the items table
+Can be used as a boolean test of whether the barcode has
+been deployed as yet
 
 =cut
 
-#'
-sub itemdata {
-    my ($barcode) = @_;
+sub is_barcode_in_use {
+    my $barcode = shift;
     my $dbh       = C4::Context->dbh;
-    my $sth       = $dbh->prepare(
-        "Select * from items LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber 
-        WHERE barcode=?"
+    my $occurences = $dbh->selectall_arrayref(
+        'SELECT itemnumber from items where barcode = ?',
+        {}, $barcode
+
     );
-    $sth->execute($barcode);
-    my $data = $sth->fetchrow_hashref;
-    $sth->finish;
-    return ($data);
+
+    return @{$occurences};
 }
 
 1;
index 81ff731..9cb2c18 100644 (file)
@@ -1,6 +1,7 @@
 package C4::Suggestions;
 
 # Copyright 2000-2002 Katipo Communications
+# Parts Copyright Biblibre 2011
 #
 # This file is part of Koha.
 #
@@ -43,9 +44,9 @@ our @EXPORT  = qw<
     ModSuggestion
     NewSuggestion
     SearchSuggestion
+    DelSuggestionsOlderThan
 >;
 
-
 =head1 NAME
 
 C4::Suggestions - Some useful functions for dealings with aqorders.
@@ -429,6 +430,23 @@ sub DelSuggestion {
     }
 }
 
+=head2 DelSuggestionsOlderThan
+    &DelSuggestionsOlderThan($days)
+    
+    Delete all suggestions older than TODAY-$days , that have be accepted or rejected.
+    
+=cut
+sub DelSuggestionsOlderThan {
+    my ($days) = @_;
+    return if not $days;
+    my $dbh = C4::Context->dbh;
+    
+    my $sth = $dbh->prepare("
+        DELETE FROM suggestions WHERE STATUS <> 'ASKED' AND date < ADDDATE(NOW(), ?);
+    ");
+    $sth->execute("-$days");
+}
+
 1;
 __END__
 
index 66c614d..3614c24 100644 (file)
@@ -35,6 +35,7 @@ use C4::Tags qw(get_tags);
 use Exporter;
 use Data::Dumper;
 use C4::Csv;
+use C4::XSLT;
 
 use vars qw($debug @EXPORT @ISA $VERSION);
 
@@ -201,7 +202,11 @@ sub shelfpage ($$$$$) {
                 }
                 ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset );
                 for my $this_item (@$items) {
-                    my $record = GetMarcBiblio( $this_item->{'biblionumber'} );
+                    my $biblionumber = $this_item->{'biblionumber'};
+                    my $record = GetMarcBiblio($biblionumber);
+                    $this_item->{XSLTBloc} =
+                        XSLTParse4Display($biblionumber, $record, 'Results', 'opac')
+                            if C4::Context->preference("OPACXSLTResultsDisplay");
 
                     # the virtualshelfcontents table does not store these columns nor are they retrieved from the items
                     # and itemtypes tables, so I'm commenting them out for now to quiet the log -crn
index f1c5293..2d1facc 100644 (file)
@@ -120,7 +120,7 @@ sub getAuthorisedValues4MARCSubfields {
 my $stylesheet;
 
 sub XSLTParse4Display {
-    my ( $biblionumber, $orig_record, $xsl_suffix, $interface ) = @_;
+    my ( $biblionumber, $orig_record, $xsl_suffix, $interface, $fixamps ) = @_;
     $interface = 'opac' unless $interface;
     # grab the XML, run it through our stylesheet, push it out to the browser
     my $record = transformMARCXML4XSLT($biblionumber, $orig_record);
@@ -128,15 +128,22 @@ sub XSLTParse4Display {
     my $itemsxml  = buildKohaItemsNamespace($biblionumber);
     my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour'));
     my $sysxml = "<sysprefs>\n";
-    foreach my $syspref ( qw/OPACURLOpenInNewWindow DisplayOPACiconsXSLT URLLinkText viewISBD OPACBaseURL/ ) {
+    foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow
+                              DisplayOPACiconsXSLT URLLinkText viewISBD
+                              OPACBaseURL TraceCompleteSubfields
+                              UseAuthoritiesForTracings / )
+    {
         my $sp = C4::Context->preference( $syspref );
         next unless defined($sp);
         $sysxml .= "<syspref name=\"$syspref\">$sp</syspref>\n";
     }
     $sysxml .= "</sysprefs>\n";
     $xmlrecord =~ s/\<\/record\>/$itemsxml$sysxml\<\/record\>/;
+    if ($fixamps) { # We need to correct the ampersand entities that Zebra outputs
+        $xmlrecord =~ s/\&amp;amp;/\&amp;/g;
+    }
     $xmlrecord =~ s/\& /\&amp\; /;
-    $xmlrecord=~ s/\&amp\;amp\; /\&amp\; /;
+    $xmlrecord =~ s/\&amp\;amp\; /\&amp\; /;
 
     my $parser = XML::LibXML->new();
     # don't die when you find &, >, etc
diff --git a/INSTALL b/INSTALL
index 9498fc5..e2dd28d 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -36,7 +36,7 @@ Default installation instructions:
 5. sudo ln -s /etc/koha/koha-httpd.conf /etc/apache2/sites-available/koha
   (note that the path to koha-httpd.conf may be different depending on your
   installation choices)
-6. sudo a2enmod rewrite
+6. sudo a2enmod rewrite deflate
 7. sudo a2ensite koha && /etc/init.d/apache2 reload
 8. sudo zebrasrv -f /etc/koha/koha-conf.xml
   (note that you will want to run Zebra in daemon mode for a production
index e5c560d..345bdb1 100644 (file)
@@ -186,7 +186,7 @@ Add the following lines to /etc/apache2/ports.conf:
 
 Run the following commands:
 
-    $ sudo a2enmod rewrite
+    $ sudo a2enmod rewrite deflate
     $ sudo a2ensite koha
     $ sudo apache2ctl restart
 
index 4f23279..2ffb2fc 100644 (file)
@@ -2753,13 +2753,13 @@ Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not i
 
 
 
-== Enable the mod_rewrite Apache module ==
+== Enable the mod_rewrite and mod_deflate Apache modules ==
 
-OK... It seems that we need to enable the mod_rewrite Apache module:
+OK... It seems that we need to enable the mod_rewrite and the mod_deflate Apache module:
 |--------------------
-myhost:/etc/sysconfig # a2enmod rewrite
+myhost:/etc/sysconfig # a2enmod rewrite deflate
 |--------------------
-[If the above command seems NOT to work, for some reason, do this - edit /etc/sysconfig/apache2 and add the word "rewrite" (without the quotes) at the end of the APACHE_MODULES line, right before the right quote]
+[If the above command seems NOT to work, for some reason, do this - edit /etc/sysconfig/apache2 and add the words "rewrite" -and "deflate"- (without the quotes) at the end of the APACHE_MODULES line, right before the right quote]
 |--------------------
 myhost:/etc/sysconfig # service apache2 restart
 Syntax OK
index 58220ca..23214ae 100644 (file)
@@ -257,7 +257,7 @@ If not running named virtual hosts (The default koha installation does not use n
 
 Run the following commands:
 
-    $ sudo a2enmod rewrite
+    $ sudo a2enmod rewrite deflate
     $ sudo a2ensite koha
     $ sudo apache2ctl restart
 
index 4d77227..e569f3b 100644 (file)
@@ -191,7 +191,7 @@ named virtual hosts.), comment out the following line:
 
 Run the following commands:
 
-    $ sudo a2enmod rewrite
+    $ sudo a2enmod rewrite deflate
     $ sudo a2ensite koha
     $ sudo apache2ctl restart
 
index 221a26b..0261e86 100755 (executable)
@@ -29,7 +29,7 @@ use CGI;
 use C4::Acquisition;
 use C4::Budgets;
 
-use C4::Bookseller;
+use C4::Bookseller qw( GetBookSellerFromId);
 use C4::Dates qw/format_date/;
 use C4::Debug;
 
@@ -217,6 +217,10 @@ if ( $op eq 'delete_confirm' ) {
       "loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
       $basket->{creationdate}, $basket->{authorisedby};
 
+       #to get active currency
+       my $cur = GetCurrency();
+
+
     my @results = GetOrders( $basketno );
     
        my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
@@ -310,7 +314,8 @@ if ( $op eq 'delete_confirm' ) {
         gist_rrp             => sprintf( "%.2f", $gist_rrp ),        
         total_rrp_gsti       => sprintf( "%.2f", $total_rrp_gsti ),
         total_est_gsti       => sprintf( "%.2f", $total_est_gsti ),
-        currency             => $bookseller->{'listprice'},
+#        currency             => $bookseller->{'listprice'},
+       currency                => $cur->{'currency'},
         qty_total            => $qty_total,
         GST                  => $gist,
         basketgroups         => $basketgroups,
index 7641e68..88dbaa9 100755 (executable)
@@ -4,6 +4,7 @@
 
 # Copyright 2000-2002 Katipo Communications
 # Copyright 2008-2009 BibLibre SARL
+# Copyright 2010 PTFS Europe
 #
 # This file is part of Koha.
 #
 # with Koha; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-
 =head1 NAME
 
 booksellers.pl
 
 =head1 DESCRIPTION
 
-this script displays the list of suppliers & orders like C<$supplier> given on input arg.
+this script displays the list of suppliers & baskets like C<$supplier> given on input arg.
 thus, this page brings differents features like to display supplier's details,
 to add an order for a specific supplier or to just add a new supplier.
 
@@ -37,40 +37,34 @@ to add an order for a specific supplier or to just add a new supplier.
 
 =item supplier
 
-C<$supplier> is the suplier we have to search order.
-=back
-
-=item op
+C<$supplier> is the string with which we search for a supplier
 
-C<OP> can be equals to 'close' if we have to close a basket before building the page.
+=back
 
-=item basket
+=item id or supplierid
 
-the C<basket> we have to close if op is equal to 'close'.
+The id of the supplier whose baskets we will display
 
 =back
 
 =cut
 
 use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
 use C4::Auth;
 use C4::Biblio;
 use C4::Output;
 use CGI;
 
-
-use C4::Acquisition;
 use C4::Dates qw/format_date/;
-use C4::Bookseller;
+use C4::Bookseller qw/ GetBookSellerFromId GetBookSeller /;
 use C4::Members qw/GetMember/;
 
-my $query = new CGI;
+my $query = CGI->new;
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-    {
-        template_name   => "acqui/booksellers.tmpl",
+    {   template_name   => 'acqui/booksellers.tmpl',
         query           => $query,
-        type            => "intranet",
+        type            => 'intranet',
         authnotrequired => 0,
         flagsrequired   => { acquisition => 'vendors_manage' },
         debug           => 1,
@@ -79,56 +73,78 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 
 #parameters
 my $supplier = $query->param('supplier');
-my $id       = $query->param('id') || $query->param('supplierid');
+my $id = $query->param('id') || $query->param('supplierid');
 my @suppliers;
 
 if ($id) {
-       push @suppliers, GetBookSellerFromId($id);
+    push @suppliers, GetBookSellerFromId($id);
 } else {
-       @suppliers = GetBookSeller($supplier);
+    @suppliers = GetBookSeller($supplier);
+}
+
+my $supplier_count = @suppliers;
+if ( $supplier_count == 1 ) {
+    $template->param(
+        supplier_name => $suppliers[0]->{'name'},
+        id            => $suppliers[0]->{'id'}
+    );
 }
-my $count = scalar @suppliers;
-if ($count == 1){
-       $template->param( supplier_name => $suppliers[0]->{'name'},
-               id => $suppliers[0]->{'id'}
-       );
+
+my $uid;
+if ($loggedinuser) {
+    $uid = GetMember( borrowernumber => $loggedinuser )->{userid};
 }
 
 #build result page
-my @loop_suppliers;
-for ( my $i = 0 ; $i < $count ; $i++ ) {
-    my $orders  = GetBasketsByBookseller( $suppliers[$i]->{'id'}, {groupby => "aqbasket.basketno", orderby => "aqbasket.basketname"} );
-    my $ordcount = scalar @$orders;
-    my %line;
-
-    $line{supplierid} = $suppliers[$i]->{'id'};
-    $line{name}       = $suppliers[$i]->{'name'};
-    $line{active}     = $suppliers[$i]->{'active'};
-    my @loop_basket;
-    my $uid = GetMember(borrowernumber => $loggedinuser)->{userid} if $loggedinuser;
-    for ( my $i2 = 0 ; $i2 < $ordcount ; $i2++ ) {
-        if ( $orders->[$i2]{'authorisedby'} eq $loggedinuser || haspermission($uid, { flagsrequired   => { 'acquisition' => '*' } } ) ) {
-            my %inner_line;
-            $inner_line{basketno}     = $orders->[$i2]{'basketno'};
-            $inner_line{basketname}     = $orders->[$i2]{'basketname'};
-            $inner_line{total}        = scalar GetOrders($orders->[$i2]{'basketno'});
-            $inner_line{authorisedby} = $orders->[$i2]{'authorisedby'};
-            my $authby = GetMember(borrowernumber => $orders->[$i2]{'authorisedby'});
-            $inner_line{surname}      = $authby->{'firstname'};
-            $inner_line{firstname}    = $authby->{'surname'};
-            $inner_line{creationdate} = format_date( $orders->[$i2]{'creationdate'} );
-            $inner_line{closedate}    = format_date( $orders->[$i2]{'closedate'}    );
-            $inner_line{uncertainprice} = $orders->[$i2]{'uncertainprice'};
-            push @loop_basket, \%inner_line;
+my $loop_suppliers = [];
+
+for my $vendor (@suppliers) {
+    my $baskets = get_vendors_baskets( $vendor->{id} );
+
+    my $loop_basket = [];
+    for my $basket ( @{$baskets} ) {
+        if ((      $basket->{authorisedby}
+                && $basket->{authorisedby} eq $loggedinuser
+            )
+            || haspermission( $uid, { flagsrequired => { acquisition => q{*} } } )
+          ) {
+            for my $date_field (qw( creationdate closedate)) {
+                if ( $basket->{$date_field} ) {
+                    $basket->{$date_field} =
+                      format_date( $basket->{$date_field} );
+                }
+            }
+            push @{$loop_basket}, $basket;
         }
     }
-    $line{loop_basket} = \@loop_basket;
-    push @loop_suppliers, \%line;
+
+    push @{$loop_suppliers},
+      { loop_basket => $loop_basket,
+        supplierid  => $vendor->{id},
+        name        => $vendor->{name},
+        active      => $vendor->{active},
+      };
+
 }
 $template->param(
-    loop_suppliers          => \@loop_suppliers,
-    supplier                => ($id || $supplier),
-    count                   => $count,
+    loop_suppliers => $loop_suppliers,
+    supplier       => ( $id || $supplier ),
+    count          => $supplier_count,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
+
+sub get_vendors_baskets {
+    my $supplier_id = shift;
+    my $dbh         = C4::Context->dbh;
+    my $sql         = <<'ENDSQL';
+select aqbasket.*, count(*) as total,  borrowers.firstname, borrowers.surname
+from aqbasket left join aqorders on aqorders.basketno = aqbasket.basketno
+left join borrowers on aqbasket.authorisedby = borrowers.borrowernumber
+where booksellerid = ?
+AND ( aqorders.quantity > aqorders.quantityreceived OR quantityreceived IS NULL)
+AND datecancellationprinted IS NULL
+group by basketno
+ENDSQL
+    return $dbh->selectall_arrayref( $sql, { Slice => {} }, $supplier_id );
+}
index e948d2f..810f665 100755 (executable)
@@ -45,7 +45,7 @@ To know on which branch this script have to display late order.
 use strict;
 use warnings;
 use CGI;
-use C4::Bookseller;
+use C4::Bookseller qw( GetBooksellersWithLateOrders );
 use C4::Auth;
 use C4::Koha;
 use C4::Output;
@@ -76,7 +76,7 @@ unless ($delay =~ /^\d{1,3}$/) {
        $delay = 30;    #default value for delay
 }
 
-my %supplierlist = GetBooksellersWithLateOrders($delay,$branch);
+my %supplierlist = GetBooksellersWithLateOrders($delay);
 my (@sloopy);  # supplier loop
 foreach (keys %supplierlist){
        push @sloopy, (($supplierid and $supplierid eq $_ )            ? 
index 2333f89..9e63492 100755 (executable)
@@ -60,7 +60,7 @@ use strict;
 
 use C4::Search;
 use CGI;
-use C4::Bookseller;
+use C4::Bookseller qw/ GetBookSellerFromId /;
 use C4::Biblio;
 use C4::Auth;
 use C4::Output;
index 6af057d..0ba7180 100755 (executable)
@@ -77,7 +77,7 @@ use C4::Budgets;
 use C4::Input;
 use C4::Dates;
 
-use C4::Bookseller;            # GetBookSellerFromId
+use C4::Bookseller  qw/ GetBookSellerFromId /;
 use C4::Acquisition;
 use C4::Suggestions;   # GetSuggestion
 use C4::Biblio;                        # GetBiblioData
@@ -173,7 +173,6 @@ if ( $ordernumber eq '' and defined $params->{'breedingid'}){
 }
 
 
-my $cur = GetCurrency();
 
 if ( $ordernumber eq '' ) {    # create order
     $new = 'yes';
@@ -201,17 +200,35 @@ else {    #modify order
 }
 
 # get currencies (for change rates calcs if needed)
+my $active_currency = GetCurrency();
+my $default_currency;
+if (! $data->{currency} ) { # New order no currency set
+    if ( $bookseller->{listprice} ) {
+        $default_currency = $bookseller->{listprice};
+    }
+    else {
+        $default_currency = $active_currency->{currency};
+    }
+}
+
 my @rates = GetCurrencies();
-my $count = scalar @rates;
 
 # ## @rates
 
 my @loop_currency = ();
-for ( my $i = 0 ; $i < $count ; $i++ ) {
-    my %line;
-    $line{currency} = $rates[$i]->{'currency'};
-    $line{rate}     = $rates[$i]->{'rate'};
-    push @loop_currency, \%line;
+for my $curr ( @rates ) {
+    my $selected;
+    if ($data->{currency} ) {
+        $selected = $curr->{currency} eq $data->{currency};
+    }
+    else {
+        $selected = $curr->{currency} eq $default_currency;
+    }
+    push @loop_currency, {
+        currcode => $curr->{currency},
+        rate     => $curr->{rate},
+        selected => $selected,
+    }
 }
 
 # build branches list
@@ -340,9 +357,8 @@ $template->param(
     listincgst       => $bookseller->{'listincgst'},
     invoiceincgst    => $bookseller->{'invoiceincgst'},
     name             => $bookseller->{'name'},
-    cur_active_sym   => $cur->{'symbol'},
-    cur_active       => $cur->{'currency'},
-    currency         => $bookseller->{'listprice'} || $cur->{'currency'}, # eg: 'EUR'
+    cur_active_sym   => $active_currency->{'symbol'},
+    cur_active       => $active_currency->{'currency'},
     loop_currencies  => \@loop_currency,
     orderexists      => ( $new eq 'yes' ) ? 0 : 1,
     title            => $data->{'title'},
@@ -354,7 +370,7 @@ $template->param(
     quantity         => $data->{'quantity'},
     quantityrec      => $data->{'quantity'},
     rrp              => $data->{'rrp'},
-    listprice        => sprintf("%.2f", $data->{'listprice'}||$listprice),
+    listprice        => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
     total            => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
     ecost            => $data->{'ecost'},
     notes            => $data->{'notes'},
index 156dab8..b65e4ea 100755 (executable)
@@ -93,7 +93,7 @@ use CGI;
 use C4::Auth;    # get_template_and_user
 use C4::Output;
 use C4::Suggestions;
-use C4::Bookseller;
+use C4::Bookseller qw/ GetBookSellerFromId /;
 use C4::Biblio;
 
 my $input = new CGI;
index 96e4556..98ba544 100755 (executable)
@@ -69,7 +69,7 @@ use C4::Acquisition;
 use C4::Auth;
 use C4::Output;
 use C4::Dates qw/format_date/;
-use C4::Bookseller;
+use C4::Bookseller qw/ GetBookSellerFromId /;
 use C4::Members;
 use C4::Branch;    # GetBranches
 use C4::Items;
index 6c8f5f0..ad95944 100755 (executable)
@@ -61,7 +61,7 @@ use strict;
 use C4::Auth;
 use C4::Acquisition;
 use C4::Budgets;
-use C4::Bookseller;
+use C4::Bookseller qw/ GetBookSellerFromId /;
 use C4::Biblio;
 use C4::Items;
 use CGI;
index 33792b4..1e8d44e 100755 (executable)
@@ -74,7 +74,7 @@ use C4::Output;
 
 use C4::Dates qw/format_date/;
 use C4::Acquisition;
-use C4::Bookseller;
+use C4::Bookseller qw/ GetBookSellerFromId /;
 
 my $input          = CGI->new;
 my $supplierid     = $input->param('supplierid');
index 80660d9..52d940c 100755 (executable)
@@ -49,7 +49,7 @@ use C4::Output;
 use C4::Dates qw/format_date /;
 use CGI;
 
-use C4::Bookseller;
+use C4::Bookseller qw( GetBookSellerFromId DelBookseller );
 use C4::Budgets;
 
 my $query    = CGI->new;
index 1d487cb..7c7aa2c 100755 (executable)
@@ -48,7 +48,8 @@ use strict;
 #use warnings; FIXME - Bug 2505
 use C4::Context;
 use C4::Auth;
-use C4::Bookseller;
+
+use C4::Bookseller qw( ModBookseller AddBookseller );
 use C4::Biblio;
 use C4::Output;
 use CGI;
index 27c48e9..9c55df3 100755 (executable)
@@ -188,9 +188,10 @@ if ($op eq 'add_form') {
 # called by delete_confirm, used to effectively confirm deletion of data in DB
 } elsif ($op eq 'delete_confirmed') {
        unless (C4::Context->config('demo') eq 1) {
-               $dbh->do("delete from auth_tag_structure where tagfield='$searchfield' and authtypecode='$authtypecode'");
-               $dbh->do("delete from auth_subfield_structure where tagfield='$searchfield' and authtypecode='$authtypecode'");
-        # FIXME: Secuity vulnerability -- use placeholders, prepare and execute!
+               my $sth = $dbh->prepare("delete from auth_tag_structure where tagfield=? and authtypecode=?");
+               $sth->execute($searchfield,$authtypecode);
+               my $sth = $dbh->prepare("delete from auth_subfield_structure where tagfield=? and authtypecode=?");
+               $sth->execute($searchfield,$authtypecode);
        }
     print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=auth_tag_structure.pl?searchfield=".$input->param('tagfield')."&authtypecode=$authtypecode\">";
     exit;
index 64d2a70..1d85937 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index bda7674..4a5d683 100755 (executable)
@@ -240,9 +240,11 @@ sub _get_brief_messaging_prefs {
         my $pref = C4::Members::Messaging::GetMessagingPreferences( { categorycode => $categorycode,
                                                                     message_name       => $option->{'message_name'} } );
         next unless  $pref->{'transports'};
-        my $brief_pref = { message_attribute_id => $option->{'message_attribute_id'},
-                           message_name => $option->{'message_name'},
-                         };
+        my $brief_pref = {
+            message_attribute_id    => $option->{'message_attribute_id'},
+            message_name            => $option->{'message_name'},
+            $option->{'message_name'} => 1
+        };
         foreach my $transport ( @{$pref->{'transports'}} ) {
             push @{ $brief_pref->{'transports'} }, { transport => $transport };
         }
index d5b784d..f0f8c9b 100755 (executable)
@@ -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'};
index 188b040..1dfe442 100755 (executable)
@@ -1,6 +1,7 @@
 #! /usr/bin/perl
 #
 # Copyright 2008 LibLime
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index fdd9b91..9ad132c 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
-# vim: et ts=4 sw=4
 # Copyright 2000-2002 Katipo Communications
+# copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -481,7 +481,7 @@ $template->param(categoryloop => \@category_loop,
                         rules => \@sorted_row_loop,
                         branchloop => \@branchloop,
                         humanbranch => ($branch ne '*' ? $branches->{$branch}->{branchname} : ''),
-                        branch => $branch,
+                        current_branch => $branch,
                         definedbranch => scalar(@sorted_row_loop)>0 
                         );
 output_html_with_http_headers $input, $cookie, $template->output;
index b33c7ec..4e72229 100755 (executable)
@@ -380,6 +380,7 @@ $tabsysprefs{OPACGroupResults}     = "OPAC";
 $tabsysprefs{XSLTDetailsDisplay}   = "OPAC";
 $tabsysprefs{XSLTResultsDisplay}   = "OPAC";
 $tabsysprefs{OPACShowCheckoutName}   = "OPAC";
+$tabsysprefs{AllowPurchaseSuggestionBranchChoice}   = "OPAC";
 
 # Serials
 $tabsysprefs{RoutingListAddReserves}      = "Serials";
index f92e04b..59273c1 100755 (executable)
@@ -174,7 +174,8 @@ my $authid = $query->param('authid');
 
 
 
-my $authtypecode = &GetAuthTypeCode($authid);
+# Using default authtypecode, so all fields are seen
+my $authtypecode = '';
 $tagslib = &GetTagsLabels(1,$authtypecode);
 
 my $record;
index 6efa6bc..107a737 100755 (executable)
@@ -20,6 +20,7 @@ use warnings;
 
 use CGI;
 use Encode qw(encode);
+use Carp;
 
 use Mail::Sendmail;
 use MIME::QuotedPrint;
@@ -164,7 +165,7 @@ END_OF_BODY
     }
     else {
         # do something if it doesnt work....
-        warn "Error sending mail: $Mail::Sendmail::error \n";
+        carp "Error sending mail: $Mail::Sendmail::error \n";
         $template->param( error => 1 );
     }
     $template->param( email_add => $email_add );
index 7ebe8e0..df84a3a 100755 (executable)
@@ -43,6 +43,7 @@ use CGI;
 use C4::Koha;
 use C4::Biblio;
 use C4::Items;
+use C4::Members; # to use GetMember
 use C4::Branch;     # GetBranchDetail
 use C4::Serials;    # CountSubscriptionFromBiblionumber
 use C4::Search;                # enabled_staff_search_views
@@ -66,6 +67,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
+if($query->cookie("holdfor")){ 
+    my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor"));
+    $template->param(
+        holdfor => $query->cookie("holdfor"),
+        holdfor_surname => $holdfor_patron->{'surname'},
+        holdfor_firstname => $holdfor_patron->{'firstname'},
+        holdfor_cardnumber => $holdfor_patron->{'cardnumber'},
+    );
+}
+
 # my @blocs = split /\@/,$ISBD;
 # my @fields = $record->fields();
 my $res = GetISBDView($biblionumber, "intranet");
index d73c5d9..c3cc5d4 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -54,6 +55,7 @@ use MARC::Record;
 use C4::Biblio;
 use C4::Items;
 use C4::Acquisition;
+use C4::Members; # to use GetMember
 use C4::Serials;    #uses getsubscriptionsfrombiblionumber GetSubscriptionsFromBiblionumber
 use C4::Search;                # enabled_staff_search_views
 
@@ -84,6 +86,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
+if($query->cookie("holdfor")){ 
+    my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor"));
+    $template->param(
+        holdfor => $query->cookie("holdfor"),
+        holdfor_surname => $holdfor_patron->{'surname'},
+        holdfor_firstname => $holdfor_patron->{'firstname'},
+        holdfor_cardnumber => $holdfor_patron->{'cardnumber'},
+    );
+}
+
 #count of item linked
 my $itemcount = GetItemsCount($biblionumber);
 $template->param( count => $itemcount,
index f93323f..a288d4a 100755 (executable)
@@ -1,5 +1,21 @@
 #!/usr/bin/perl
 use strict;
+# parts 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.
+
 #use warnings; FIXME - Bug 2505
 
 use CGI;
index 6ee79e6..3d42326 100755 (executable)
@@ -30,7 +30,7 @@ use C4::Items;
 use C4::Circulation;
 use C4::Branch;
 use C4::Reserves;
-use C4::Members;
+use C4::Members; # to use GetMember
 use C4::Serials;
 use C4::XISBN qw(get_xisbns get_biblionumber_from_isbn);
 use C4::External::Amazon;
@@ -51,6 +51,16 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     }
 );
 
+if($query->cookie("holdfor")){ 
+    my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor"));
+    $template->param(
+        holdfor => $query->cookie("holdfor"),
+        holdfor_surname => $holdfor_patron->{'surname'},
+        holdfor_firstname => $holdfor_patron->{'firstname'},
+        holdfor_cardnumber => $holdfor_patron->{'cardnumber'},
+    );
+}
+
 my $biblionumber = $query->param('biblionumber');
 my $fw = GetFrameworkCode($biblionumber);
 
index e72a6d1..8faecfc 100755 (executable)
@@ -26,6 +26,7 @@ use C4::Context;
 use C4::Output;
 use C4::Biblio;
 use C4::Items;
+use C4::Members; # to use GetMember
 use C4::Search;                # enabled_staff_search_views
 
 my $query        = new CGI;
@@ -52,6 +53,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
+if($query->cookie("holdfor")){ 
+    my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor"));
+    $template->param(
+        holdfor => $query->cookie("holdfor"),
+        holdfor_surname => $holdfor_patron->{'surname'},
+        holdfor_firstname => $holdfor_patron->{'firstname'},
+        holdfor_cardnumber => $holdfor_patron->{'cardnumber'},
+    );
+}
+
 #count of item linked
 my $itemcount = GetItemsCount($biblionumber);
 $template->param( count => $itemcount,
index 4f40b04..054229f 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2003 Katipo Communications
+# parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -31,6 +32,7 @@ use C4::Auth;
 use C4::Serials;
 use C4::Dates qw/format_date/;
 use C4::Circulation;  # to use itemissues
+use C4::Members; # to use GetMember
 use C4::Search;                # enabled_staff_search_views
 
 my $query=new CGI;
@@ -48,6 +50,16 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user({
     flagsrequired   => {catalogue => 1},
     });
 
+if($query->cookie("holdfor")){ 
+    my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor"));
+    $template->param(
+        holdfor => $query->cookie("holdfor"),
+        holdfor_surname => $holdfor_patron->{'surname'},
+        holdfor_firstname => $holdfor_patron->{'firstname'},
+        holdfor_cardnumber => $holdfor_patron->{'cardnumber'},
+    );
+}
+
 # get variables
 
 my $biblionumber=$query->param('biblionumber');
index 8cb737d..b22837a 100755 (executable)
@@ -3,6 +3,7 @@
 # For documentation try 'perldoc /path/to/search'
 #
 # Copyright 2006 LibLime
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha
 #
@@ -145,6 +146,7 @@ use C4::Auth qw(:DEFAULT get_session);
 use C4::Search;
 use C4::Languages qw(getAllLanguages);
 use C4::Koha;
+use C4::Members qw(GetMember);
 use C4::VirtualShelves qw(GetRecentShelves);
 use POSIX qw(ceil floor);
 use C4::Branch; # GetBranches
@@ -181,6 +183,16 @@ if (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
     $template->param('UNIMARC' => 1);
 }
 
+if($cgi->cookie("holdfor")){ 
+    my $holdfor_patron = GetMember('borrowernumber' => $cgi->cookie("holdfor"));
+    $template->param(
+        holdfor => $cgi->cookie("holdfor"),
+        holdfor_surname => $holdfor_patron->{'surname'},
+        holdfor_firstname => $holdfor_patron->{'firstname'},
+        holdfor_cardnumber => $holdfor_patron->{'cardnumber'},
+    );
+}
+
 ## URI Re-Writing
 # Deprecated, but preserved because it's interesting :-)
 # The same thing can be accomplished with mod_rewrite in
@@ -207,16 +219,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');
 
@@ -641,6 +657,7 @@ $template->param(
             total => $total,
             opacfacets => 1,
             facets_loop => $facets,
+           displayFacetCount=> C4::Context->preference('displayFacetCount')||0,
             scan => $scan,
             search_error => $error,
 );
index d316833..bd557e9 100755 (executable)
@@ -1,13 +1,11 @@
 #!/usr/bin/perl
 
-# $Id: showmarc.pl,v 1.1.2.1 2007/06/18 21:57:23 rangi Exp $
-
-
 # Koha library project  www.koha-community.org
 
 # Licensed under the GPL
 
 # Copyright 2007 Liblime
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index 01a1605..e8ce20d 100755 (executable)
@@ -31,7 +31,7 @@ use C4::Reserves;
 
 my $cgi= new CGI;
 
-my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {circulate => 1}, 'intranet');
+my ($loggedinuser, $cookie, $sessionID) = checkauth($cgi, 0, {circulate => 'circulate_remaining_permissions'}, 'intranet');
 
 my $biblionumber=$cgi->param('biblionumber');
 my $itemnumber=$cgi->param('itemnumber');
index da58166..cd5691e 100755 (executable)
@@ -933,7 +933,7 @@ if ( $op eq "addbiblio" ) {
         else {
             ( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode );
         }
-        if ($mode ne "popup" && !$is_a_modif && $redirect eq "items"){
+        if ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view")){
             print $input->redirect(
                 "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode"
             );
index c5dd7d9..b2b1192 100755 (executable)
@@ -570,7 +570,7 @@ 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 $branches = GetBranchesLoop(C4::Context->userenv->{branch},$onlymine);  # build once ahead of time, instead of multiple times later.
 
 # We generate form, from actuel record
 my @fields;
index 6d84cb4..6a4445a 100755 (executable)
@@ -26,6 +26,8 @@ use C4::Context;
 use C4::Search;
 use C4::Output;
 
+use XML::LibXML;
+
 =head1 DESCRIPTION
 
 plugin_parameters : other parameters added when the plugin is called by the dopop function
@@ -82,46 +84,25 @@ sub plugin {
     );
     $result = "a|||||r|||| 00| 0 " unless $result;
 
-    #  $result = "a     r     00  0 " unless $result;
-    my $f0   = substr($result, 0,  1);
-    my $f014 = substr($result, 1,  4);
-    my $f5   = substr($result, 5,  1);
-    my $f6   = substr($result, 6,  1);
-    my $f710 = substr($result, 7,  4);
-    my $f11  = substr($result, 11, 1);
-    my $f12  = substr($result, 12, 1);
-    my $f13  = substr($result, 13, 1);
-    my $f14  = substr($result, 14, 1);
-    my $f15  = substr($result, 15, 1);
-    my $f16  = substr($result, 16, 1);
-    my $f17  = substr($result, 17, 1);
-
-    $template->param(
-        index       => $index,
-        f0          => $f0,
-        "f0$f0"     => $f0,
-        f014        => $f014,
-        "f014$f014" => $f014,
-        f5          => $f5,
-        "f5$f5"     => $f5,
-        f6          => $f6,
-        "f6$f6"     => $f6,
-        f710        => $f710,
-        "f710$f710" => $f710,
-        f11         => $f11,
-        "f11$f11"   => $f11,
-        f12         => $f12,
-        "f12$f12"   => $f12,
-        f13         => $f13,
-        "f13$f13"   => $f13,
-        f14         => $f14,
-        "f14$f14"   => $f14,
-        f15         => $f15,
-        "f15$f15"   => $f15,
-        f16         => $f16,
-        "f16$f16"   => $f16,
-        f17         => $f17,
-        "f17$f17"   => $f17,
+    my $errorXml = '';
+    # Check if the xml, xsd exists and is validated
+    my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/';
+    if (-r $dir . 'marc21_field_006.xml') {
+        my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_006.xml');
+        if (-r $dir . 'marc21_field_CF.xsd') {
+            my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd');
+            eval {
+                $xmlschema->validate( $doc );
+            };
+            $errorXml = 'Can\'t validate the xml data from ' . $dir . 'marc21_field_006.xml' if ($@);
+        }
+    } else {
+        $errorXml = 'Can\'t read the xml file ' . $dir . 'marc21_field_006.xml';
+    }
+    $template->param(tagfield => '006',
+            index => $index,
+            result => $result,
+            errorXml => $errorXml,
     );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
index 57e0690..8b5db26 100755 (executable)
@@ -26,6 +26,8 @@ use C4::Context;
 use C4::Search;
 use C4::Output;
 
+use XML::LibXML;
+
 =head1 DESCRIPTION
 
 plugin_parameters : other parameters added when the plugin is called by the dopop function
@@ -96,65 +98,25 @@ sub plugin {
 
     #  $result = "      t        xxu           00  0 eng d" unless $result;
     $result = "$dateentered" . "t        xxu||||| |||| 00| 0 eng d" unless $result;
-    my $f1    = substr($result, 0,  6);
-    my $f6    = substr($result, 6,  1);
-    my $f710  = substr($result, 7,  4);
-    my $f1114 = substr($result, 11, 4);
-    my $f1517 = substr($result, 15, 3);
-    my $f1821 = substr($result, 18, 4);
-    my $f22   = substr($result, 22, 1);
-    my $f23   = substr($result, 23, 1);
-    my $f2427 = substr($result, 24, 4);
-    my $f28   = substr($result, 28, 1);
-    my $f29   = substr($result, 29, 1);
-    my $f30   = substr($result, 30, 1);
-    my $f31   = substr($result, 31, 1);
-    my $f33   = substr($result, 33, 1);
-    my $f34   = substr($result, 34, 1);
-    my $f3537 = substr($result, 35, 3);
-    my $f38   = substr($result, 38, 1);
-    my $f39   = substr($result, 39, 1);
-
-    # bug 2563
-    $f710  = "" if ($f710  =~ /^\s*$/);
-    $f1114 = "" if ($f1114 =~ /^\s*$/);
-
-    if ((!$f1) || ($f1 =~ m/ /)) {
-        $f1 = $dateentered;
+    my $errorXml = '';
+    # Check if the xml, xsd exists and is validated
+    my $dir = C4::Context->config('intrahtdocs') . '/prog/' . $template->param('lang') . '/modules/cataloguing/value_builder/';
+    if (-r $dir . 'marc21_field_008.xml') {
+        my $doc = XML::LibXML->new->parse_file($dir . 'marc21_field_008.xml');
+        if (-r $dir . 'marc21_field_CF.xsd') {
+            my $xmlschema = XML::LibXML::Schema->new(location => $dir . 'marc21_field_CF.xsd');
+            eval {
+                $xmlschema->validate( $doc );
+            };
+            $errorXml = 'Can\'t validate the xml data from ' . $dir . 'marc21_field_008.xml' if ($@);
+        }
+    } else {
+        $errorXml = 'Can\'t read the xml file ' . $dir . 'marc21_field_008.xml';
     }
-
-    $template->param(
-        index       => $index,
-        f1          => $f1,
-        f6          => $f6,
-        "f6$f6"     => $f6,
-        f710        => $f710,
-        f1114       => $f1114,
-        f1517       => $f1517,
-        f1821       => $f1821,
-        f22         => $f22,
-        "f22$f22"   => $f22,
-        f23         => $f23,
-        "f23$f23"   => $f23,
-        f2427       => $f2427,
-        "f24$f2427" => $f2427,
-        f28         => $f28,
-        "f28$f28"   => $f28,
-        f29         => $f29,
-        "f29$f29"   => $f29,
-        f30         => $f30,
-        "f30$f30"   => $f30,
-        f31         => $f31,
-        "f31$f31"   => $f31,
-        f33         => $f33,
-        "f33$f33"   => $f33,
-        f34         => $f34,
-        "f34$f34"   => $f34,
-        f3537       => $f3537,
-        f38         => $f38,
-        "f38$f38"   => $f38,
-        f39         => $f39,
-        "f39$f39"   => $f39,
+    $template->param(tagfield => '008',
+            index => $index,
+            result => $result,
+            errorXml => $errorXml,
     );
     output_html_with_http_headers $input, $cookie, $template->output;
 }
index ab38749..7e0cb75 100755 (executable)
@@ -1,10 +1,9 @@
 #!/usr/bin/perl
-# WARNING: This file uses 4-character tabs!
 
-#written 11/3/2002 by Finlay
 #script to execute branch transfers of books
 
 # Copyright 2000-2002 Katipo Communications
+# copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index ab681f1..1ed4afd 100755 (executable)
@@ -1,9 +1,9 @@
 #!/usr/bin/perl
 
-# written 8/5/2002 by Finlay
 # script to execute issuing of books
 
 # Copyright 2000-2002 Katipo Communications
+# copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -494,6 +494,7 @@ if ($borrowerslist) {
         -id       => 'borrowernumber',
         -values   => \@values,
         -labels   => \%labels,
+        -ondblclick => 'document.forms[\'mainform\'].submit()',
         -size     => 7,
         -tabindex => '',
         -multiple => 0
@@ -614,6 +615,11 @@ if($bor_messages_loop){ $template->param(flagged => 1 ); }
 my (undef, $roadttype_hashref) = &GetRoadTypes();
 my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
 
+my $fast_cataloging = 0;
+    if (defined getframeworkinfo('FA')) {
+    $fast_cataloging = 1 
+    }
+
 $template->param(
     lib_messages_loop => $lib_messages_loop,
     bor_messages_loop => $bor_messages_loop,
@@ -657,6 +663,7 @@ $template->param(
     is_child          => ($borrower->{'category_type'} eq 'C'),
     circview => 1,
     soundon           => C4::Context->preference("SoundOn"),
+    fast_cataloging   => $fast_cataloging,
 );
 
 # save stickyduedate to session
index cad8e6d..3510a2b 100755 (executable)
@@ -2,6 +2,7 @@
 
 
 # Copyright 2000-2002 Katipo Communications
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index 214c11f..262c126 100755 (executable)
@@ -2,7 +2,7 @@
 
 # Copyright 2000-2002 Katipo Communications
 #           2006 SAN-OP
-#           2007 BibLibre, Paul POULAIN
+#           2007-2010 BibLibre, Paul POULAIN
 #
 # This file is part of Koha.
 #
index 0183f19..9850114 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index 1affa37..f156661 100644 (file)
@@ -530,4 +530,9 @@ February 1 2011     #koha moves from irc.katipo.co.nz to irc.oftc.net
 February 2 2011        General IRC meeting http://wiki.koha-community.org/wiki/General_IRC_Meeting,_2_February_2011
 February 3 2011        Frédérick Capovilla becomes the 132nd developer to have a patch pushed
 February 4 2011        Christopher Hall becomes the 133rd developer to have a patch pushed
-
+February 22 2011       Koha 3.2.4 released
+February 24 2011       Koha 3.2.5 released
+March 13 2011  Janusz Kaczmarek becomes the 134th developer to have a patch pushed
+March 13 2011  Salvador Zaragoza Rubio becomes the 135th developer to have a patch pushed
+March 17 2011  Julian Maurice becomes the 136th developer to have a patch pushed
+March 17 2011  Sophie Meynieux becomes the 137th developer to have a patch pushed
index 2c8dfa0..bc2b4d8 100644 (file)
@@ -32,6 +32,7 @@
      mod_gzip_item_exclude mime ^image/.*
      mod_gzip_item_exclude rspheader Content-Type:image/*
      mod_gzip_item_include file \.js$
+     mod_gzip_item_include mime ^application/javascript$
      mod_gzip_item_include mime ^application/x-javascript$
      mod_gzip_item_include file \.php$
      mod_gzip_item_include mime ^text/html$
      mod_gzip_item_exclude mime ^image/.*
      mod_gzip_item_exclude rspheader Content-Type:image/*
      mod_gzip_item_include file \.js$
+     mod_gzip_item_include mime ^application/javascript$
      mod_gzip_item_include mime ^application/x-javascript$
      mod_gzip_item_include file \.php$
      mod_gzip_item_include mime ^text/html$
index e8f124b..709410d 100644 (file)
@@ -1119,19 +1119,20 @@ sort3 7=3
 
 ###################################################
 # Rules for a few bath atts
-keyTitle         = 1=33
-possessingInstitution    = 1=1044
-name             = 1=1002
-personalName     = 1=1
-corporateName    = 1=2
-conferenceName   = 1=3
-uniformTitle     = 1=6
-isbn             = 1=7
-issn             = 1=8
-geographicName   = 1=58
-notes            = 1=63
-topicalSubject   = 1=1079
-genreForm        = 1=1075
+# For recent changes in this section, see Bugzilla #3735
+#keyTitle 1=33
+#possessingInstitution 1=1044
+name 1=1002
+#personalName 1=1
+#corporateName 1=2
+#conferenceName 1=3
+#uniformTitle 1=6
+isbn 1=7
+issn 1=8
+#geographicName 1=58
+notes 1=63
+#topicalSubject 1=1079
+#genreForm 1=1075
 
 ###################################################
 # Rules for a few GILS fields
index f66ff2c..0e7dc67 100644 (file)
@@ -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');
@@ -286,3 +287,15 @@ 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');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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');
+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');
+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');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo    ');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
+
index b019a3d..627b617 100644 (file)
@@ -1,9 +1,8 @@
 insert into `message_attributes`
 (`message_attribute_id`, message_name, `takes_days`)
 values
-(1, 'Fälligkeitsbenachrichtigung', 0),
-(2, 'Erinnerungsbenachrichtigung', 1),
-(4, 'Vormerkbenachrichtigung', 0),
-(5, 'Rückgabequittung', 0),
-(6, 'Ausleihquittung', 0);
-
+(1, 'Item DUE', 0),
+(2, 'Advance Notice', 1),
+(4, 'Hold Filled', 0),
+(5, 'Item Check-in', 0),
+(6, 'Item Checkout', 0);
\ No newline at end of file
index 87bcf4e..b2824f0 100644 (file)
@@ -144,6 +144,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');
@@ -286,3 +287,15 @@ 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');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','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');
+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');
+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');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
+
index 12856d0..4c81325 100644 (file)
@@ -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');
index 1834063..6dab837 100644 (file)
@@ -1,7 +1,7 @@
 insert into `message_attributes`
 (`message_attribute_id`, message_name, `takes_days`)
 values
-(1, 'Item DUE', 0),
+(1, 'Item Due', 0),
 (2, 'Advance Notice', 1),
 (4, 'Hold Filled', 0),
 (5, 'Item Check-in', 0),
index 16ff529..99a60aa 100644 (file)
@@ -288,3 +288,16 @@ 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');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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');
+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');
+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');
+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 ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
+
index aec38b5..231af9c 100644 (file)
@@ -3,10 +3,10 @@ SET FOREIGN_KEY_CHECKS=0;
 insert into `message_attributes`
 (`message_attribute_id`, message_name, `takes_days`)
 values
-(1, 'Copia scaduta', 0),
-(2, 'Avviso preventivo', 1),
-(4, 'Prenotazione compilata', 0),
-(5, 'Check In', 0),
-(6, 'Check Out', 0);
+(1, 'Item DUE', 0),
+(2, 'Advance Notice', 1),
+(4, 'Hold Filled', 0),
+(5, 'Item Check-in', 0),
+(6, 'Item Checkout', 0);
 
 SET FOREIGN_KEY_CHECKS=1;
index 7a8cb1e..07ee6a4 100644 (file)
@@ -119,6 +119,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');
@@ -273,3 +274,14 @@ 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');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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');
+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');
+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');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
index e7ad97f..a62e07c 100644 (file)
@@ -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`),
@@ -2352,6 +2352,9 @@ CREATE TABLE `aqbasketgroups` (
   `name` varchar(50) default NULL,
   `closed` tinyint(1) default NULL,
   `booksellerid` int(11) NOT NULL,
+  `deliveryplace` varchar(10) default NULL,
+  `deliverycomment` varchar(255) default NULL,
+  `billingplace` varchar(10) default NULL,
   PRIMARY KEY  (`id`),
   KEY `booksellerid` (`booksellerid`),
   CONSTRAINT `aqbasketgroups_ibfk_1` FOREIGN KEY (`booksellerid`) REFERENCES `aqbooksellers` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
index 516e5de..0edc8fc 100644 (file)
@@ -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');
@@ -285,3 +286,14 @@ 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');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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');
+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');
+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');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
index 8d8a303..deaa0d5 100644 (file)
@@ -171,6 +171,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');
@@ -340,3 +341,14 @@ 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');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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');
+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');
+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');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
index 8ec1d69..7cf9a7a 100644 (file)
@@ -3,8 +3,8 @@ truncate message_attributes;
 insert into `message_attributes`
 (`message_attribute_id`, message_name, `takes_days`)
 values
-(1, 'Единица задолжена',           0),
-(2, 'Предварительное уведомление', 1),
+(1, 'Item DUE',                    0),
+(2, 'Advance Notice',              1),
 (4, 'Hold Filled',                 0),
 (5, 'Item Check-in',               0),
 (6, 'Item Checkout',               0);
index 7ce4426..d1c1079 100644 (file)
@@ -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');
@@ -365,3 +366,14 @@ 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');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AuthoritiesLog','0','If ON, log edit/create/delete actions on authorities.','','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');
+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');
+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');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
index fabdc00..dd12938 100644 (file)
@@ -3,8 +3,8 @@ truncate message_attributes;
 insert into `message_attributes`
 (`message_attribute_id`, `message_name`, `takes_days`)
 values
-(1, 'Одиниця заборгована'   , 0),
-(2, 'Попереднє повідомлення', 1),
+(1, 'Item DUE'              , 0),
+(2, 'Advance Notice'        , 1),
 (4, 'Hold Filled'           , 0),
 (5, 'Item Check-in'         , 0),
 (6, 'Item Checkout'         , 0);
index b4c4dd7..2383703 100755 (executable)
@@ -4,8 +4,22 @@
 # Database Updater
 # This script checks for required updates to the database.
 
+# Parts copyright Catalyst IT 2011
+
 # Part of the Koha Library Software www.koha-community.org
-# Licensed under the GPL.
+# 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
+#
 
 # Bugs/ToDo:
 # - Would also be a good idea to offer to do a backup at this time...
@@ -4106,7 +4120,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
-$DBversion = "3.03.00.XXX";
+$DBversion = "3.03.00.031";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FineNotifyAtCheckin',0,'If ON notify librarians of overdue fines on the items they are checking in.',NULL,'YesNo');");
     print "Upgrade to $DBversion done (Add syspref FineNotifyAtCheckin)\n";
index 66b092c..49ed8c3 100644 (file)
@@ -439,6 +439,7 @@ ul.toolbar {
 
 ul.toolbar button {
        padding-bottom : 2px;
+       font-family: arial, verdana, helvetica, sans-serif;
 }
 .yui-menu-button  {
        
@@ -927,13 +928,16 @@ fieldset.rows .inputnote {
 }
 
 #placehold a,
-#placehold button {
+#placehold button,
+#holdfor .first-child {
        padding-left : 34px;
        background-image: url("../../img/toolbar-hold.gif");
        background-position : center left;
        background-repeat : no-repeat;
 }
 
+#holdfor .first-child { padding-left : 17px; }
+
 #editmenuc .first-child, #deleteshelf .first-child,#newmenuc .first-child, #addbiblio .first-child, #z3950search .first-child, #printmenuc .first-child, #newsupplier .first-child, #savemenuc .first-child, #budgets_menuc .first-child, #periods_menuc .first-child {
        padding-left : 15px;
 }
@@ -1417,6 +1421,11 @@ li.email {
        padding : .1em 0 .1em 1em;
 }
 
+/* Hack just for Firefox */
+html>/**/body #searchheader button, x:-moz-any-link, x:default {
+       padding-bottom : 3px;
+}
+
 #searchheader h3 {
 }
 
index 97b642f..123e71c 100644 (file)
@@ -24,7 +24,7 @@
     <!-- TMPL_IF NAME="holdsview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_IF NAME="object" --><!-- TMPL_VAR NAME="object" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="biblionumber" --><!-- /TMPL_IF -->">Holds</a></li>
     <!-- /TMPL_IF -->
 
-    <!-- TMPL_IF name="subscriptionsnumber" --><li><a href="/cgi-bin/koha/serials/serials-home.pl?searched=1&amp;title_filter=<!-- TMPL_VAR NAME="subscriptiontitle" -->">Subscription(s)</a></li><!-- /TMPL_IF -->
+    <!-- TMPL_IF name="subscriptionsnumber" --><li><a href="/cgi-bin/koha/serials/serials-home.pl?searched=1&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Subscription(s)</a></li><!-- /TMPL_IF -->
 </ul>
 <ul>
 <!-- TMPL_IF NAME="issuehistoryview" --><li class="active"><!-- TMPL_ELSE --><li><!-- /TMPL_IF -->
index 8d4e02e..6cf3899 100644 (file)
@@ -15,7 +15,7 @@
        function GetZ3950Terms(){
                var strQuery="&frameworkcode=";
                <!-- TMPL_LOOP NAME='z3950_search_params' -->
-                       strQuery += "&" + "<!-- TMPL_VAR NAME="name" -->" + "=" + "<!-- TMPL_VAR NAME="encvalue" -->";
+                       strQuery += "&" + "<!-- TMPL_VAR NAME="name" ESCAPE=HTML -->" + "=" + "<!-- TMPL_VAR NAME="encvalue" ESCAPE=HTML -->";
                <!-- /TMPL_LOOP -->
                return strQuery;
        }
@@ -148,7 +148,31 @@ function confirm_items_deletion() {
                container: this,
                        onclick: {fn: printBiblio }
                });
+               <!-- TMPL_IF NAME="CAN_user_reserveforothers" --><!-- TMPL_UNLESS NAME="norequests" -->
+               <!-- TMPL_IF NAME="holdfor" -->
+               //      Create an array of YAHOO.widget.MenuItem configuration properties
+               var onButtonClick = function () { 
+                       location.href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->";
+               }
+               var HoldForButtonMenu = [
+                       { text: "Place hold", url: "/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" },
+                       { text: "Place hold for <!-- TMPL_VAR NAME="holdfor_firstname" --> <!-- TMPL_VAR NAME="holdfor_surname" --> (<!-- TMPL_VAR NAME="holdfor_cardnumber" -->)", url: "/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&findborrower=<!-- TMPL_VAR NAME="holdfor_cardnumber" -->" }
+               ];
 
+               //      Instantiate a Split Button using the array of YAHOO.widget.MenuItem 
+               //      configuration properties as the value for the "menu" 
+               //      configuration attribute.
+
+               var HoldForButton = new YAHOO.widget.Button({
+                               id: "holdfor",
+                               type: "split",
+                               label: "Place hold",
+                               name: "holdfor",
+                               menu: HoldForButtonMenu,
+                               container: this,
+                               onclick: { fn: onButtonClick }
+               });
+           <!-- TMPL_ELSE -->
            new YAHOO.widget.Button({
                        id: "placehold",
                        type: "link",
@@ -156,6 +180,8 @@ function confirm_items_deletion() {
                        container: this,
                        href: "/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"
             });
+           <!-- /TMPL_IF -->
+           <!-- /TMPL_IF --><!-- /TMPL_IF -->
            <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_catalogue" -->
                new YAHOO.widget.Button({
                        id: "z3950search",
index 976de15..e14590d 100644 (file)
@@ -36,11 +36,8 @@ function update_child() {
        // prepare DOM for YUI Toolbar
 
         $(document).ready(function() {
-           $("#printslip").parent().remove();
-               $("#patronflags").parent().remove();
-               $("#deletepatron").parent().remove();
-               $("#moremenuc").empty();
-           $("#printmenuc").empty();
+           $("#printslip,#patronflags,#deletepatron").parent().remove();
+               $("#moremenuc,#printmenuc,#searchtoholdc").empty();
            yuiToolbar();
         });
 
@@ -49,7 +46,12 @@ function update_child() {
                window.open("/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=" + print_type, "printwindow");
                return false;
        }
-
+       function searchToHold(){
+               var date = new Date();
+               date.setTime(date.getTime() + (10 * 60 * 1000));
+           $.cookie("holdfor", "<!-- TMPL_VAR NAME="borrowernumber" -->", { path: "/", expires: date });
+           location.href="/cgi-bin/koha/catalogue/search.pl";
+       }
        function yuiToolbar() {
            var printmenu = [
             <!-- TMPL_IF NAME="CAN_user_borrowers" -->
@@ -76,8 +78,14 @@ function update_child() {
                name: "printmenubutton",
                menu: printmenu,
                container: "printmenuc"
-           });   
-       
+           });
+           new YAHOO.widget.Button({
+               id: "searchtohold",
+               type: "button",
+               label: _("Search to hold"),
+               container: "searchtoholdc",
+                       onclick: {fn: searchToHold }
+               });
            new YAHOO.widget.Button({
                type: "menu",
                label: _("More"),
@@ -85,7 +93,7 @@ function update_child() {
                menu: moremenu,
                container: "moremenuc"
            });
-       
+
            <!-- TMPL_IF name="adultborrower" -->new YAHOO.widget.Button("addchild");<!-- /TMPL_IF -->
            new YAHOO.widget.Button("editpatron");
            new YAHOO.widget.Button("addnote");
@@ -93,7 +101,7 @@ function update_child() {
             <!-- TMPL_ELSE--> new YAHOO.widget.Button("changepassword"); <!-- /TMPL_IF -->
            new YAHOO.widget.Button("printslip");
                new YAHOO.widget.Button("printpage");
-           new YAHOO.widget.Button("renewpatron");              
+           new YAHOO.widget.Button("renewpatron");
         <!-- TMPL_IF NAME="CAN_user_permissions" -->
           <!-- TMPL_IF NAME="StaffMember" -->
             <!-- TMPL_IF NAME="CAN_user_staffaccess" -->
@@ -127,12 +135,12 @@ function update_child() {
        <!-- /TMPL_IF -->
        <!-- TMPL_IF NAME="CAN_user_borrowers" -->
        <!-- TMPL_IF name="adultborrower" --><li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;category_type=C">Add child</a></li><!-- /TMPL_IF -->
-<!--   <li><a id="addnote" href="/cgi-bin/koha/members/addnotes.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Add Note</a></li> -->
 <!-- TMPL_IF NAME="StaffMember" --><!-- TMPL_IF NAME="CAN_user_staffaccess" --> <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=<!-- TMPL_VAR NAME="borrowernumber" -->">Change Password</a></li><!-- /TMPL_IF-->
           <!-- TMPL_ELSE--> <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=<!-- TMPL_VAR NAME="borrowernumber" -->">Change Password</a></li><!-- /TMPL_IF -->        
          <!-- /TMPL_IF -->
        <li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=page">Print Page</a></li>
        <li><a id="printslip" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=slip">Print Slip</a></li>
+       <li id="searchtoholdc"><a id="searchtohold" href="#">Search to hold</a></li>
        <li id="moremenuc"><a id="renewpatron" href="/cgi-bin/koha/members/moremember.pl?reregistration=y&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Renew Account</a></li>
     <!-- TMPL_IF NAME="CAN_user_permissions" -->
         <!-- TMPL_IF NAME="StaffMember" -->
index 0491a89..03087c2 100644 (file)
@@ -1,4 +1,4 @@
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" media="print" href="<!-- TMPL_VAR name="themelang" -->/css/print.css" />
 
index 42f9df2..3ea2381 100644 (file)
@@ -1,5 +1,5 @@
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/lib/jquery/plugins/ui.tabs.css" />
 <link rel="stylesheet" type="text/css" media="print" href="<!-- TMPL_VAR name="themelang" -->/css/print.css" />
 <!-- TMPL_IF name="intranetstylesheet" -->
@@ -30,6 +30,7 @@
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/jquery.js"></script>
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/ui.tabs.js"></script>
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.hotkeys.min.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.cookie.min.js"></script>
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.highlight-3.js"></script>
 
 <!-- TMPL_IF NAME="js_libs" -->
index 95d912d..710dc23 100644 (file)
@@ -3,7 +3,7 @@
 <div id="search-facets">
 <h4>Refine your search</h4>
 <ul>
-       <li>Availability<ul><li><!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF --></li></ul>
+       <li>Availability<ul><li><!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF --></li></ul>
        <!-- TMPL_IF NAME="related" --> <li>(related searches: <!-- TMPL_LOOP NAME="related" --><!-- TMPL_VAR NAME="related_search" --><!-- /TMPL_LOOP -->)</li><!-- /TMPL_IF -->
        </li>
 
@@ -17,8 +17,8 @@
 <!-- TMPL_IF NAME="type_label_Series" -->Series<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="type_label_Libraries" -->Libraries<!-- /TMPL_IF -->
 <ul>
-        <!-- TMPL_LOOP NAME="facets" --><li><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=<!-- TMPL_VAR NAME="type_link_value" -->:<!-- TMPL_VAR NAME="facet_link_value" -->" title="<!-- TMPL_VAR NAME="facet_title_value" -->"><!-- TMPL_VAR NAME="facet_label_value" --></a> <!-- (<!-- TMPL_VAR NAME="facet_count" -->) --></li><!-- /TMPL_LOOP --><!-- TMPL_IF NAME="expandable" -->
-        <li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;expand=<!-- TMPL_VAR NAME="expand" -->#<!-- TMPL_VAR NAME="type_id" -->">Show More</a></li>
+        <!-- TMPL_LOOP NAME="facets" --><li><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML"--><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=<!-- TMPL_VAR NAME="type_link_value" -->:<!-- TMPL_VAR NAME="facet_link_value" -->" title="<!-- TMPL_VAR NAME="facet_title_value" -->"><!-- TMPL_VAR NAME="facet_label_value" --></a> <!-- TMPL_IF NAME="displayFacetCount" -->(<!-- TMPL_VAR NAME="facet_count" -->)<!-- /TMPL_IF --></li><!-- /TMPL_LOOP --><!-- TMPL_IF NAME="expandable" -->
+        <li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;expand=<!-- TMPL_VAR NAME="expand" -->#<!-- TMPL_VAR NAME="type_id" -->">Show More</a></li>
 <!-- /TMPL_IF -->
 </ul></li>
 <!-- /TMPL_LOOP -->
index aa71d73..1ae7de5 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Online Help</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" media="print" href="<!-- TMPL_VAR name="themelang" -->/css/print.css" />
 <!-- TMPL_IF name="intranetstylesheet" -->
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="intranetstylesheet" -->" />
index 6f22d46..c079cb9 100644 (file)
@@ -34,11 +34,8 @@ function update_child() {
        // prepare DOM for YUI Toolbar
 
         $(document).ready(function() {
-           $("#printslip").parent().remove();
-               $("#patronflags").parent().remove();
-               $("#deletepatron").parent().remove();
-               $("#moremenuc").empty();
-           $("#printmenuc").empty();
+           $("#printslip,#patronflags,#deletepatron").parent().remove();
+               $("#moremenuc,#printmenuc,#searchtoholdc").empty();
            yuiToolbar();
         });
 
@@ -47,7 +44,12 @@ function update_child() {
                window.open("/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=" + print_type, "printwindow");
                return false;
        }
-
+       function searchToHold(){
+               var date = new Date();
+               date.setTime(date.getTime() + (10 * 60 * 1000));
+           $.cookie("holdfor", "<!-- TMPL_VAR NAME="borrowernumber" -->", { path: "/", expires: date });
+           location.href="/cgi-bin/koha/catalogue/search.pl";
+       }
        function yuiToolbar() {
            var printmenu = [
                { text: _("Print Page"), onclick: {fn: function(){printx_window("page")}} },
@@ -71,6 +73,14 @@ function update_child() {
            });
 
            new YAHOO.widget.Button({
+               id: "searchtohold",
+               type: "button",
+               label: _("Search to hold"),
+               container: "searchtoholdc",
+                       onclick: {fn: searchToHold }
+               });
+
+           new YAHOO.widget.Button({
                type: "menu",
                label: _("More"),
                name: "moremenubutton",
@@ -82,6 +92,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");
@@ -108,9 +119,10 @@ function update_child() {
             <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
        <!-- TMPL_IF name="adultborrower" --><li><a id="addchild" href="/cgi-bin/koha/members/memberentry.pl?op=add&amp;guarantorid=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;category_type=C">Add child</a></li><!-- /TMPL_IF -->
-<!--   <li><a id="addnote" href="/cgi-bin/koha/members/addnotes.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Add Note</a></li> -->
        <li><a id="changepassword" href="/cgi-bin/koha/members/member-password.pl?member=<!-- TMPL_VAR NAME="borrowernumber" -->">Change Password</a></li>
-       <li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=page">Print Page</a></li>
+       <li><a id="duplicate" href="/cgi-bin/koha/members/memberentry.pl?op=duplicate&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;category_type=<!-- TMPL_VAR NAME="category_type"-->">Duplicate</a></li>
+    <li id="printmenuc"><a id="printpage" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=page">Print Page</a></li>
        <li><a id="printslip" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->&amp;print=slip">Print Slip</a></li>
+       <li id="searchtoholdc"><a id="searchtohold" href="#">Search to hold</a></li>
        <li id="moremenuc"><a id="renewpatron" href="/cgi-bin/koha/members/moremember.pl?reregistration=y&amp;borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->">Renew Account</a></li><!-- TMPL_IF NAME="CAN_user_permissions" --><li><a id="patronflags" href="/cgi-bin/koha/members/member-flags.pl?member=<!-- TMPL_VAR NAME="borrowernumber" -->">Set Permissions</a></li><!-- /TMPL_IF --><li><a id="deletepatron" href="javascript:confirm_deletion();">Delete</a></li>
 </ul></div>
index 28dc633..f9af076 100644 (file)
     </tr>
     <!-- TMPL_LOOP name="messaging_preferences" -->
     <tr>
-      <td><!-- TMPL_VAR NAME="message_name" --></td>
+      <td><!-- TMPL_IF NAME="Item DUE" -->Item DUE
+          <!-- TMPL_ELSIF NAME="Advance Notice" -->Advance Notice
+          <!-- TMPL_ELSIF NAME="Upcoming Events" -->Upcoming Events
+          <!-- TMPL_ELSIF NAME="Hold Filled" -->Hold Filled
+          <!-- TMPL_ELSIF NAME="Item Check-in" -->Item Check-in
+          <!-- TMPL_ELSIF NAME="Item Checkout" -->Item Checkout
+          <!-- TMPL_ELSE -->Unknown <!-- /TMPL_IF --></td>
       <!-- TMPL_IF NAME="takes_days" -->
       <td>
           <!-- TMPL_IF NAME="messaging_form_inactive" -->
@@ -45,7 +51,7 @@
       <!-- TMPL_ELSE -->
       <td>-</td>
       <!-- /TMPL_IF -->
-      <!-- TMPL_IF NAME="transport_sms" -->
+<!--      <!-- TMPL_IF NAME="transport_sms" -->
       <!-- TMPL_IF NAME="SMSSendDriver" --><td>
           <!-- TMPL_IF NAME="messaging_form_inactive" -->
                  <input type="checkbox"
@@ -61,7 +67,7 @@
       </td><!-- /TMPL_IF -->
       <!-- TMPL_ELSE -->
       <td>-</td>
-      <!-- /TMPL_IF -->
+      <!-- /TMPL_IF --> -->
 
       <!-- TMPL_IF NAME="transport_email" -->
       <td>
index a9b8575..4c1ca90 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_IF NAME="PAGE_NUMBERS" --><div class="pages">
     <!-- Row of numbers corresponding to search result pages -->
-        <!-- TMPL_IF NAME="previous_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="previous_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">&lt;&lt; Previous</a><!-- /TMPL_IF -->
-    <!-- TMPL_LOOP NAME="PAGE_NUMBERS" --><!-- TMPL_IF NAME="highlight" --><span class="current"><!-- TMPL_VAR NAME="pg" --></span><!-- TMPL_ELSE -->        <a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->"><!-- TMPL_VAR NAME="pg" --></a><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="previous_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" -->&amp;offset=<!-- TMPL_VAR NAME="previous_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">&lt;&lt; Previous</a><!-- /TMPL_IF -->
+    <!-- TMPL_LOOP NAME="PAGE_NUMBERS" --><!-- TMPL_IF NAME="highlight" --><span class="current"><!-- TMPL_VAR NAME="pg" --></span><!-- TMPL_ELSE -->        <a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" -->&amp;offset=<!-- TMPL_VAR NAME="offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->"><!-- TMPL_VAR NAME="pg" --></a><!-- /TMPL_IF -->
     <!-- /TMPL_LOOP -->
-        <!-- TMPL_IF NAME="next_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="next_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Next &gt;&gt;</a><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="next_page_offset" --><a class="nav" href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" -->&amp;offset=<!-- TMPL_VAR NAME="next_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Next &gt;&gt;</a><!-- /TMPL_IF -->
 </div><!-- /TMPL_IF -->
index 25ed4ad..8b2df92 100644 (file)
@@ -9,7 +9,8 @@
                <li><a href="/cgi-bin/koha/reports/borrowers_stats.pl">Patrons</a></li>
                <li><a href="/cgi-bin/koha/reports/catalogue_stats.pl">Catalog</a></li>
                <li><a href="/cgi-bin/koha/reports/issues_stats.pl">Circulation</a></li>
-                <li><a href="/cgi-bin/koha/reports/serials_stats.pl">Serials</a></li>
+        <li><a href="/cgi-bin/koha/reports/serials_stats.pl">Serials</a></li>
+        <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>        
        </ul>
 
 
index fe58c61..aa140f2 100644 (file)
@@ -1,4 +1,4 @@
-<select name="idx">
+<select class="advsearch" name="idx">
     <option value="kw">Keyword</option>
     <option value="au">Author</option>
     <option value="au,phr">&nbsp;&nbsp;&nbsp;&nbsp; Author as Phrase</option>
index 326062d..b5ec994 100644 (file)
@@ -645,11 +645,14 @@ function calcNeworderTotal(){
     var quantity = new Number(f.quantity.value);
     var discount = new Number(f.discount.value);
     var listinc  = new Number (f.listinc.value);
-    var currency = f.currency.value;
+    //var currency = f.currency.value;
     var applygst = new Number (f.applygst.value);
     var listprice   =  new Number(f.listprice.value);
     var invoiceingst =  new Number (f.invoiceincgst.value);
-    var exchangerate =  new Number(f.elements[currency].value);      //get exchange rate
+//    var exchangerate =  new Number(f.elements[currency].value);      //get exchange rate
+        var currcode = new String(document.getElementById('currency').value);
+       var exchangerate =  new Number(document.getElementById(currcode).value);
+
     var gst_on=(!listinc && invoiceingst);
 
     //do real stuff
index 95d59e7..dfc0444 100644 (file)
@@ -7,7 +7,7 @@ KOHA.AJAX = {
             cache: false,
             dataType: 'json',
             type: 'POST',
-            error: function ( xhr, stat, error ) { KOHA.AJAX.BaseError( error_callback, xhr, stat, error ) },
+            error: function ( xhr, stat, error ) { KOHA.AJAX.BaseError( error_callback, xhr, stat, error ) }
         } );
         $.ajax( options );
     },
@@ -37,7 +37,9 @@ KOHA.AJAX = {
             .attr( 'disabled', 'disabled' )
             .each( function () {
                 var $image = $( '<img src="/intranet-tmpl/prog/img/spinner-small.gif" alt="" class="spinner" />' );
-                switch ( this.localName.toLowerCase() ) {
+                var selector_type = this.localName;
+                if (selector_type == undefined) selector_type = this.nodeName; // IE only
+                switch ( selector_type.toLowerCase() ) {
                     case 'input':
                         $( this ).data( 'original-text', this.value );
                         this.value = text;
@@ -62,7 +64,9 @@ KOHA.AJAX = {
         $( selector )
             .removeAttr( 'disabled' )
             .each( function () {
-                switch ( this.localName.toLowerCase() ) {
+                var selector_type = this.localName;
+                if (selector_type == undefined) selector_type = this.nodeName; // IE only
+                switch ( selector_type.toLowerCase() ) {
                     case 'input':
                         this.value = $( this ).data( 'original-text' );
                         break;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js b/koha-tmpl/intranet-tmpl/prog/en/js/xmlControlfield.js
new file mode 100755 (executable)
index 0000000..dca6e75
--- /dev/null
@@ -0,0 +1,340 @@
+
+
+// Add an option to a select form field
+function add_option(select, text, value, selected)
+{
+    var option = document.createElement('option');
+    option.text = text;
+    option.value = value;
+    if (selected) option.selected = true;
+    try {
+        select.add(option, null);
+    }
+    catch(ex) {
+        select.add(option);
+    }
+}//add_option
+
+
+// Return the value of a parameter from the url
+function returnValueParam(param)
+{
+    var params = location.search.substr(1);
+    var arr = params.split("&");
+    var pattern = param + "=";
+    for (var i=0; i < arr.length; i++) {
+        if (arr[i].indexOf(pattern) == 0) {
+            return unescape(arr[i].substr(pattern.length));
+        }
+    }
+    return "";
+}//returnValueParam
+
+
+// Return a value from a position on the result string
+function returnValuePosFromResult(result, pos)
+{
+    var index;
+    if ((index = pos.indexOf("-")) > 0) {
+        var ini = parseInt(pos.substring(0, index) ,10);
+        var end = parseInt(pos.substr(index + 1) ,10);
+        return result.substring(ini, end + 1);
+    } else {
+        return result.substr(pos, 1);
+    }
+}//returnValuePosFromResult
+
+
+// Build string from form fields
+function returnResultFromValues(form)
+{
+    var resultStr = form.result.value;
+    var pos;
+    var value;
+    for (var i=0; i < form.elements.length; i++) {
+        var pattern = new RegExp("f[0-9]+(?:[0-9]+)?");
+        if (pattern.test(form.elements[i].name)) {
+            pos = form.elements[i].name.substr(1);
+            value = (pos.indexOf("-") > 0)?form.elements[i].value:form.elements[i].options[form.elements[i].selectedIndex].value;
+            resultStr = changePosResult(pos, value, resultStr);
+        }
+    }
+    return resultStr;
+}//returnResultFromValues
+
+
+// Build/modify result string for a position and a value
+function changePosResult(pos, value, resultStr)
+{
+    var index;
+    var result = "";
+    if ((index = pos.indexOf("-")) > 0) {
+        var ini = parseInt(pos.substring(0, index) ,10);
+        var end = parseInt(pos.substr(index + 1) ,10);
+        var roffset = (1 + end - ini)- value.length;
+        if (roffset > 0) for (var i=0; i < roffset; i++) value += " ";
+        if (ini == 0)
+            result = value + resultStr.substr(end + 1);
+        else {
+            result = resultStr.substring(0, ini) + value;
+            if (end < resultStr.length)
+                result += resultStr.substr(end + 1);
+        }
+    } else {
+        var ini = parseInt(pos, 10);
+        if (ini == 0)
+            result = value + resultStr.substr(1);
+        else {
+            result = resultStr.substring(0, ini) + value;
+            if (ini < resultStr.length)
+                result += resultStr.substr(ini + 1);
+        }
+    }
+    result = result.replace(/#/g, " ");
+    return result;
+}//changePosResult
+
+
+// Display the result string on a row of a table indicating positions and coloring them if they are incorrect or they are selected
+function renderResult(tr_result, result)
+{
+    if (tr_result) {
+        var td;
+        if (tr_result.cells.length != result.length) {
+            for (var i = tr_result.cells.length - 1; i >= 0; i--)
+                tr_result.deleteCell(i);
+            for (var i=0; i < result.length; i++) {
+                value = result.charAt(i);
+                td = tr_result.insertCell(tr_result.cells.length);
+            }
+        }
+        var value;
+        var ini = -1;
+        var end = -1;
+        var args = renderResult.arguments;
+        var whiteAllTD = false;
+        if (args.length > 2) {
+            if (typeof(args[2]) == "boolean") {
+                whiteAllTD = args[2];
+            } else {
+                var index;
+                if ((index = args[2].indexOf("-")) > 0) {
+                    ini = parseInt(args[2].substring(0, index) ,10);
+                    end = parseInt(args[2].substr(index + 1) ,10);
+                } else ini = parseInt(args[2], 10);
+            }
+        }
+        for (var i=0; i < result.length; i++) {
+            value = result.charAt(i);
+            td = tr_result.cells[i];
+            if (td.style.backgroundColor != "yellow" || whiteAllTD) td.style.backgroundColor = "white";
+            td.innerHTML = (value == " ")?"&nbsp;":value;
+            td.title = "Pos " + i + ". Value: \"" + value + "\"";
+            if (ini >= 0) {
+                if (end > 0) {
+                    if (ini <= i && i <= end) td.style.backgroundColor = "#cccccc";
+                } else if (i == ini) td.style.backgroundColor = "#cccccc";
+            } else {
+                var pos = (i < 10)?'0' + i:i + '';
+                var obj;
+                if ((obj = document.getElementById('f' + pos)) != null) {
+                    var found = false;
+                    for (var j=0; j < obj.options.length && !found; j++)
+                        if (obj.options[j].value == value) found = true;
+                    if (!found) {
+                        td.style.backgroundColor = "yellow";
+                        td.title = "Pos " + i + ". Incorrect Value: \"" + value + "\"";
+                    }
+                }
+            }
+        }//for
+    }
+}//renderResult
+
+
+// Change displaying of result in the page
+function changeH4Result(form, h4_result, tr_result, pos, value)
+{
+    var resultStr = form.result.value;
+    var result = changePosResult(pos, value, resultStr);
+    renderResult(tr_result, result, pos);
+    h4_result.innerHTML = "&quot;" + result + "&quot;";
+    form.result.value = result;
+}//changeH4Result
+
+
+
+// Class to read the xml and render the type of material
+(function()
+{
+
+    xmlControlField = function(tagfield, form_id, select, table, h4_result, tr_result, idMaterial)
+    {
+        this.tagfield = tagfield;
+        this.idMaterial = idMaterial;
+        this.form_id = form_id;
+        this.form = document.getElementById(form_id);
+        this.select = select;
+        this.table = table;
+        this.h4_result = h4_result;
+        this.tr_result = tr_result;
+    };//xmlControlField
+
+
+    xmlControlField.prototype =
+    {
+        tagfield: "",
+        idMaterial: "",
+        root: null,
+        form_id: "",
+        form: null,
+        select: null,
+        table: null,
+        h4_result: "",
+        tr_result: "",
+
+
+        setIdMaterial: function(idMaterial)
+        {
+            this.idMaterial = idMaterial;
+        },//setIdMaterial
+
+        loadXmlValues: function()
+        {
+            this.xmlDoc = $.ajax({
+                type: "GET",
+                url: "/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_" + this.tagfield + ".xml",
+                dataType: "xml",
+                async: false
+            }).responseXML;
+            if (this.xmlDoc) this.renderTemplate();
+            $("*").ajaxError(function(evt, request, settings){
+                alert("AJAX error: receiving data from " + settings.url);
+            });
+        },//loadXmlValues
+
+
+        renderTemplate: function()
+        {
+            this.root = this.xmlDoc.documentElement;
+            if (this.root.nodeName == "Tagfield" && this.root.nodeType == 1 && this.root.hasChildNodes()) {
+                var tag = this.root.attributes.getNamedItem("tag").nodeValue;
+                var nodeMaterial = this.root.getElementsByTagName('Material');
+                if (nodeMaterial != null && nodeMaterial.length > 0) {
+                    if (this.idMaterial == "") this.idMaterial = nodeMaterial[0].attributes.getNamedItem("id").nodeValue;
+                    this.renderSelectMaterial(nodeMaterial);
+                    this.renderPositions(nodeMaterial, (this.form.result.value != "")?this.form.result.value:returnValueParam("result"));
+                }
+            }
+        },//renderTemplate
+
+
+        renderSelectMaterial: function(nodeMaterial)
+        {
+            if (this.select != null && nodeMaterial != null && nodeMaterial.length > 0) {
+                if (this.select.options.length <= 1) {
+                    var id;
+                    var name;
+                    var arrSort = new Array();
+                    var arrEquiv = new Array();
+                    for (var i=0; i < nodeMaterial.length; i++) {
+                        id = nodeMaterial[i].attributes.getNamedItem("id").nodeValue;
+                        name = nodeMaterial[i].attributes.getNamedItem("name").nodeValue;
+                        arrEquiv[id] = i;
+                        arrSort.push(id);
+                    }
+                    arrSort.sort();
+                    var j;
+                    for (var i=0; i < arrSort.length; i++) {
+                        j = arrEquiv[arrSort[i]];
+                        add_option(this.select, arrSort[i] + " - " + nodeMaterial[j].attributes.getNamedItem("name").nodeValue, arrSort[i], (this.idMaterial != "" && arrSort[i] == this.idMaterial)?true:false);
+                    }
+                } else if (this.idMaterial != "") {
+                    for (var i=0; i < this.select.options.length; i++) {
+                        if (this.select.options[i].value == this.idMaterial) this.select.options[i].selected = true;
+                    }
+                }
+            }
+        },//renderSelectMaterial
+
+
+        renderPositions: function(nodeMaterial, result)
+        {
+            var materialNode;
+            try {
+                var resultXPath = this.xmlDoc.evaluate("//a:Material[@id='" + this.idMaterial + "']", this.xmlDoc.documentElement, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null);
+                materialNode = resultXPath.singleNodeValue;
+            } catch (e) {
+                for (var i=0; i < nodeMaterial.length; i++) {
+                    if (this.idMaterial == nodeMaterial[i].attributes.getNamedItem("id").nodeValue) {
+                        materialNode = nodeMaterial[i];
+                        break;
+                    }
+                }
+            }
+            if (this.table != null) { // Render table
+                var tbody = this.table.tBodies[0];
+                // Clean up table
+                if (tbody.rows.length > 0)
+                    for (var i = tbody.rows.length - 1; i >= 1; i--)
+                        tbody.deleteRow(i);
+                // Parse Material node
+                if (materialNode != undefined && materialNode != null && materialNode.nodeType == 1 && materialNode.hasChildNodes()) {
+                    var nodePos = materialNode.firstChild;
+                    var tr;
+                    var td;
+                    var title;
+                    var pos;
+                    var value;
+                    var strInnerHTML = "";
+                    var selected;
+                    var index;
+                    var url;
+                    while (nodePos != null) {
+                        if (nodePos.nodeType == 1 && nodePos.nodeName == "Position") {
+                            tr = tbody.insertRow(tbody.rows.length);
+                            td = tr.insertCell(tr.cells.length);
+                            pos = nodePos.attributes.getNamedItem("pos").nodeValue;
+                            title = ((nodePos.getAttributeNode("description") || nodePos.hasAttribute("description")) && nodePos.getAttribute("description") != "")?nodePos.attributes.getNamedItem("description").nodeValue:nodePos.attributes.getNamedItem("name").nodeValue;
+                            try {
+                                url = ((nodePos.getAttributeNode("url") || nodePos.hasAttribute("url")) && nodePos.getAttribute("url") != "" && nodePos.getAttribute("urltext") != "")?"&nbsp;<a href='" + nodePos.attributes.getNamedItem("url").nodeValue + "' target='_blank'>" + nodePos.attributes.getNamedItem("urltext").nodeValue + "</a>":"";
+                            } catch (e) { url = "";}
+                            td.innerHTML = "<label for='" + pos + "' title='" + title + "'>" + pos + " - " + nodePos.attributes.getNamedItem("name").nodeValue + url + "</label>";
+                            td = tr.insertCell(tr.cells.length);
+                            value = returnValuePosFromResult(result, pos);
+                            if ((index = pos.indexOf("-")) > 0) { // Position interval
+                                var ini = parseInt(pos.substring(0, index) ,10);
+                                var end = parseInt(pos.substr(index + 1) ,10);
+                                value = value.replace(/ /g, "#");
+                                strInnerHTML = "<input type='text' name='f" + pos + "' id='f" + pos + "' value='" + value + "' size='" + (1 + end - ini) + "' maxlength='" + (1 + end - ini) + "' onkeyup='this.value = this.value.replace(/ /g, \"#\"); changeH4Result(document.getElementById(\"" + this.form_id + "\"), document.getElementById(\"" + this.h4_result + "\"), document.getElementById(\"" + this.tr_result + "\"), \"" + pos + "\", this.value)' onfocus='changeH4Result(document.getElementById(\"" + this.form_id + "\"), document.getElementById(\"" + this.h4_result + "\"), document.getElementById(\"" + this.tr_result + "\"), \"" + pos + "\", this.value)' />";
+                            } else {
+                                strInnerHTML = "<select name='f" + pos + "' id='f" + pos + "' style='width:400px' onchange='changeH4Result(document.getElementById(\"" + this.form_id + "\"), document.getElementById(\"" + this.h4_result + "\"), document.getElementById(\"" + this.tr_result + "\"), \"" + pos + "\", this.options[this.selectedIndex].value)' onfocus='changeH4Result(document.getElementById(\"" + this.form_id + "\"), document.getElementById(\"" + this.h4_result + "\"), document.getElementById(\"" + this.tr_result + "\"), \"" + pos + "\", this.options[this.selectedIndex].value)'>";
+                                value = value.replace("#", " ");
+                                if (nodePos.hasChildNodes()) {
+                                    var nodeValue = nodePos.firstChild;
+                                    while (nodeValue != null) {
+                                        if (nodeValue.nodeType == 1 && nodeValue.nodeName == "Value" && nodeValue.hasChildNodes()) {
+                                            var valNode = nodeValue.firstChild.nodeValue;
+                                            valNode = valNode.replace("#", " ");
+                                            selected = (value == valNode)?"selected='selected'":"";
+                                            strInnerHTML += "<option value='"  + valNode + "' " + selected + ">" + nodeValue.firstChild.nodeValue + " - " + nodeValue.attributes.getNamedItem("description").nodeValue +  "</option>";
+                                        }
+                                        nodeValue = nodeValue.nextSibling;
+                                    }
+                                } else {
+                                    strInnerHTML += "<option value=' ' " + ((value == " ")?"selected='selected'":"") + "># - " + title +  "</option>";
+                                    strInnerHTML += "<option value='|' " + ((value == "|")?"selected='selected'":"") + ">| - " + title +  "</option>";
+                                }
+                                strInnerHTML += "</select>";
+                            }
+                            td.innerHTML = strInnerHTML;
+                        }
+                        nodePos = nodePos.nextSibling;
+                    }
+                }
+            }
+        }//renderPositions
+    };
+
+})();
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery.cookie.min.js
new file mode 100644 (file)
index 0000000..eb129db
--- /dev/null
@@ -0,0 +1 @@
+jQuery.cookie=function(b,j,m){if(typeof j!="undefined"){m=m||{};if(j===null){j="";m.expires=-1}var e="";if(m.expires&&(typeof m.expires=="number"||m.expires.toUTCString)){var f;if(typeof m.expires=="number"){f=new Date();f.setTime(f.getTime()+(m.expires*24*60*60*1000))}else{f=m.expires}e="; expires="+f.toUTCString()}var l=m.path?"; path="+(m.path):"";var g=m.domain?"; domain="+(m.domain):"";var a=m.secure?"; secure":"";document.cookie=[b,"=",encodeURIComponent(j),e,l,g,a].join("")}else{var d=null;if(document.cookie&&document.cookie!=""){var k=document.cookie.split(";");for(var h=0;h<k.length;h++){var c=jQuery.trim(k[h]);if(c.substring(0,b.length+1)==(b+"=")){d=decodeURIComponent(c.substring(b.length+1));break}}}return d}};
\ No newline at end of file
index 11f5d28..c7f8b4d 100644 (file)
 <li><strong>&#x010D;e&#353;tina (Czech)</strong></li>
 <li><strong>D&aelig;nsk (Danish)</strong></li>
 <li><strong>Nederlands-Nederland (Dutch-The Netherlands)</strong> Sponsored by Rijksmuseum</li>
-<li><strong>Nederlands-België (Dutch-Belgium)</strong></li>
+<li><strong>Nederlands-Belgi&euml; (Dutch-Belgium)</strong></li>
 <li><strong>English</strong></li>
 <li><strong>suomi, suomen kieli (Finnish)</strong> Pasi Korkalo</li>
 <li><strong>Fran&ccedil;ais (French) </strong> Pascale Nalon (ENSMP) and Jean Yves Lemaire (Chatel Saint Germain)</li>
index 45ef2ef..76f5a3f 100644 (file)
@@ -143,7 +143,7 @@ ff.submit();
         <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR NAME="biblioitemnumber" -->" />
         <input type="hidden" name="discount" value="<!-- TMPL_VAR NAME="discount" -->" />
         <input type="hidden" name="listinc" value="<!-- TMPL_VAR NAME="listincgst" -->" />
-        <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />
+<!--        <input type="hidden" name="currency" value="<!-- TMPL_VAR NAME="currency" -->" />-->
         <input type="hidden" name="applygst" value="<!-- TMPL_VAR NAME="gstreg" -->" />
         <input type="hidden" name="invoiceincgst" value="<!-- TMPL_VAR NAME="invoiceincgst" -->" />
         <input type="hidden" name="gstrate" value="<!-- TMPL_VAR NAME="gstrate" -->" />
@@ -151,7 +151,7 @@ ff.submit();
         <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
 
         <!-- TMPL_LOOP NAME="loop_currencies" -->
-            <input type="hidden" name="<!-- TMPL_VAR NAME="currency" -->" value="<!-- TMPL_VAR NAME="rate" -->" />
+            <input type="hidden" id="<!-- TMPL_VAR NAME="currcode" -->"  name="<!-- TMPL_VAR NAME="currcode" -->" value="<!-- TMPL_VAR NAME="rate" -->" />
         <!-- /TMPL_LOOP -->
         <ol><li>
             <!-- TMPL_IF name="biblionumber" -->
@@ -264,10 +264,10 @@ ff.submit();
             </li>
             <li>
                 <!-- TMPL_IF name="close" -->
-            <span class="label">Budget: </span>
+            <span class="label">Fund: </span>
                     <input type="hidden" size="20" name="budget_id" id="budget_id" value="<!-- TMPL_VAR NAME="budget_id" -->" /><!-- TMPL_VAR NAME="Budget_name" -->
                 <!-- TMPL_ELSE -->
-                <label for="budget_id">Budget: </label>
+                <label for="budget_id">Fund: </label>
                 <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
                 <!-- TMPL_LOOP NAME="budget_loop" -->
                     <!-- TMPL_IF NAME="b_sel" -->
@@ -279,14 +279,25 @@ ff.submit();
                 </select>
                 <!--/TMPL_IF-->
             </li>
+               <li>
+                <!-- TMPL_IF name="close" -->
+                       <span class="label">Currency: </span>
+                       <input type="hidden" size="10" name="currency" id="currency" value="<!-- TMPL_VAR NAME="currency" -->" /><!-- TMPL_VAR NAME="currency" -->
+                <!-- TMPL_ELSE -->
+                       <label for="currency">Currency:</label>
+                       <select name="currency" id="currency" onchange="calcNeworderTotal();">
+                       <!-- TMPL_LOOP name="loop_currencies" -->
+                       <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="currcode" -->" selected="selected"><!-- TMPL_VAR name="currcode" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="currcode" -->"><!-- TMPL_VAR name="currcode" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
+                       </select>
+               <!-- /TMPL_IF-->
+                </li>
             <li>
                 <!-- TMPL_IF name="close" -->
             <span class="label">Vendor price: </span>
                     <input type="hidden" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" /><!-- TMPL_VAR NAME="listprice" -->
                 <!-- TMPL_ELSE -->
                 <label for="listprice">Vendor price: </label>
-                    <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" /> (entered as <!-- TMPL_VAR NAME="currency" -->)
-
+                    <input type="text" size="20" name="listprice" id="listprice" value="<!-- TMPL_VAR NAME="listprice" -->" onchange="calcNeworderTotal()" />
                 <!--/TMPL_IF-->
             </li>
             <!-- TMPL_UNLESS NAME="close" -->
index c85f40f..006884f 100644 (file)
@@ -1,11 +1,6 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket <!-- TMPL_VAR NAME="basketno" --> &rsaquo; Duplicate warning</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-
-<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
-<script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/additem.js"></script>
-<script type="text/javascript">
-</script>
 </head>
 <body>
 
     <div id="yui-main">
     <div class="yui-b">
 
-<h2>Duplicate warning</h2>
+<div class="dialog alert">
+<h4>Duplicate warning</h4>
+<p>You selected a record from an external source that matches an existing record in your catalog: <!-- TMPL_IF name="BiblioDefaultViewmarc" --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
+<!-- TMPL_ELSIF NAME="BiblioDefaultViewlabeled_marc" --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
+<!-- TMPL_ELSIF NAME="BiblioDefaultViewisbd" --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
+<!-- TMPL_ELSE --><a class="popup" target="_blank" title="Open in new window" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="duplicatetitle" --></a></p>
+</div>
 
-<p>You selected a record from an external source that matches an existing record in your catalog!</p>
-<p>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.</p>
-<p>The existing catalog record can be viewed in a new window by clicking <a target="_blank" href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="duplicatetitle" --></a>
+<div class="yui-gb">
+<div class="yui-u first">
+<div style="border: 1px solid #DDD; padding:1em;">
+<form action="/cgi-bin/koha/acqui/neworderempty.pl">
+<h4>Use existing record</h4>
+<p>Do not create a duplicate record. Add an order from the existing record in your catalog.</p>
+<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
+<input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
+<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
+<input type="submit" value="Use Existing" />
+</form>
+</div>
+</div>
 
-<form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform">
-    <fieldset class="action">
-        <input type="button" value="Use Existing" onclick="window.location='/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&basketno=<!-- TMPL_VAR NAME="basketno" -->&biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'" />
-        <input type="button" value="Create New" onclick="window.location='/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=<!-- TMPL_VAR NAME="booksellerid" -->&basketno=<!-- TMPL_VAR NAME="basketno" -->&breedingid=<!-- TMPL_VAR NAME="breedingid" -->&use_external_source=1'" />
-        <input type="button" value="Cancel" onclick="window.location='/cgi-bin/koha/acqui/basket.pl?basketno=<!-- TMPL_VAR NAME="basketno" -->'" />
-    </fieldset>
+<div class="yui-u">
+<div style="border: 1px solid #DDD; padding:1em;">
+<form action="/cgi-bin/koha/acqui/basket.pl">
+<h4>Cancel and return to order</h4>
+<p>Return to the basket without making a new order.</p>
+<input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
+<input type="submit" value="Cancel" />
 </form>
+</div>
+</div>
+
+<div class="yui-u">
+<div style="border: 1px solid #DDD; padding:1em;">
+<form action="/cgi-bin/koha/acqui/neworderempty.pl">
+<h4>Create new record</h4>
+<p>Create a new record by importing the external (duplicate) record.</p>
+<input type="hidden" name="booksellerid" value="<!-- TMPL_VAR NAME="booksellerid" -->" />
+<input type="hidden" name="basketno" value="<!-- TMPL_VAR NAME="basketno" -->" />
+<input type="hidden" name="breedingid" value="<!-- TMPL_VAR NAME="breedingid" -->" />
+<input type="hidden" name="use_external_source" value="1" />
+<input type="submit" value="Create New" />
+</form>
+</div>
+</div>
+
+</div>
 
 </div>
 </div>
index 736f3bb..ba9e468 100644 (file)
@@ -323,7 +323,13 @@ Confirm Deletion of Category <!-- TMPL_VAR NAME="categorycode" escape="html" -->
                         <td>
                             <!-- TMPL_IF NAME="messaging_prefs" -->
                                 <!-- TMPL_LOOP NAME="messaging_prefs" -->
-                                    <!-- TMPL_VAR NAME="message_name" --> :
+                                    <!-- TMPL_IF NAME="Item DUE" -->Item DUE
+                                    <!-- TMPL_ELSIF NAME="Advance Notice" -->Advance Notice
+                                    <!-- TMPL_ELSIF NAME="Upcoming Events" -->Upcoming Events
+                                    <!-- TMPL_ELSIF NAME="Hold Filled" -->Hold Filled
+                                    <!-- TMPL_ELSIF NAME="Item Check-in" -->Item Check-in
+                                    <!-- TMPL_ELSIF NAME="Item Checkout" -->Item Checkout
+                                    <!-- TMPL_ELSE -->Unknown <!-- /TMPL_IF --> :
                                     <!-- TMPL_LOOP NAME="transports" -->
                                         <!-- TMPL_VAR NAME="transport" -->
                                     <!-- /TMPL_LOOP -->
index f06d983..3d19af8 100644 (file)
@@ -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.
index e683307..e0eac4d 100644 (file)
@@ -92,6 +92,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
@@ -260,6 +272,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"
index 78140f8..67cb299 100644 (file)
@@ -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 authority records.
+    -
         - pref: FinesLog
           choices:
               on: Log
index 3014e63..b9411b1 100644 (file)
@@ -97,6 +97,11 @@ OPAC:
               class: url
             - in the OPAC header, instead of the Koha logo. If this image is a different size than the Koha logo, you will need to customize the CSS. (This should be a complete URL, starting with <code>http://</code>.)
         -
+            - Use the image at
+            - pref: OpacFavicon
+              class: url
+            - for the OPAC's favicon. (This should be a complete URL, starting with <code>http://</code>.)
+        -
             - "Include the following JavaScript on all pages in the OPAC:"
             - pref: opacuserjs
               type: textarea
@@ -274,6 +279,19 @@ OPAC:
                   yes: Show
                   no: "Don't show"
             - purchase suggestions from other patrons on the OPAC.
+        -
+            - pref: AllowPurchaseSuggestionBranchChoice
+              default: 0
+              choices:
+                  no: "Don't allow"
+                  yes: Allow
+            - patrons to select branch when making a purchase suggestion
+        -
+            - pref: SearchMyLibraryFirst
+              choices:
+                  yes: Limit
+                  no: "Don't limit"
+            - "patrons' searches to the library they are registered at."
     Privacy:
         -
             - pref: AnonSuggestions
index cd924dc..039c121 100644 (file)
@@ -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
@@ -92,6 +99,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 +137,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
@@ -133,3 +154,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.
index 0d7fedc..50dae66 100644 (file)
@@ -46,6 +46,11 @@ Staff Client:
               type: textarea
               class: code
         -
+            - Use the image at
+            - pref: IntranetFavicon
+              class: url
+            - for the Staff Client's favicon. (This should be a complete URL, starting with <code>http://</code>.)
+        -
             - Show biblio records on result page in the staff client
             - pref: XSLTResultsDisplay
               choices:
index eaa0d43..92a44ce 100644 (file)
@@ -56,7 +56,8 @@ $(document).ready(function() {
             <!-- /TMPL_LOOP -->
             </select>
         </form>
-<!-- TMPL_IF Name="definedbranch" --><form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="<!-- TMPL_VAR NAME="branch" -->" />
+<!-- TMPL_IF Name="definedbranch" --><form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label 
+for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="<!-- TMPL_VAR NAME="current_branch" -->" />
             <select name="tobranch" id="tobranch"><!-- TMPL_LOOP NAME="branchloop" --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_LOOP --></select> <input type="submit" value="Clone" /></form><!-- /TMPL_IF --></fieldset>
 
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
@@ -109,7 +110,7 @@ $(document).ready(function() {
                                                        <td><!-- TMPL_VAR NAME="reservesallowed" --></td>
                                                        <td><!-- TMPL_VAR NAME="rentaldiscount" --></td>
                                                        <td>
-                                                               <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=<!-- TMPL_VAR NAME="itemtype" -->&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a>
+                                                               <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&amp;itemtype=<!-- TMPL_VAR NAME="itemtype" -->&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->&amp;branch=<!-- TMPL_VAR NAME="current_branch" -->">Delete</a>
                                                        </td>
                        </tr>
                <!-- /TMPL_LOOP -->
@@ -139,7 +140,7 @@ $(document).ready(function() {
                     <td><input name="renewalsallowed" size="2" /></td>
                     <td><input name="reservesallowed" size="2" /></td>
                    <td><input name="rentaldiscount" size="2" /></td>
-                    <td><input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/><input type="submit" value="Add" class="submit" /></td>
+                    <td><input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/><input type="submit" value="Add" class="submit" /></td>
                 </tr>
             </table>
         </form>
@@ -149,7 +150,7 @@ $(document).ready(function() {
         <p>You can set a default maximum number of checkouts and hold policy that will be used if none is defined below for a particular item type or category.</p>
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
             <input type="hidden" name="op" value="set-branch-defaults" />
-            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/>
+            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/>
             <table>
                 <tr>
                     <th>&nbsp;</th>
@@ -188,7 +189,7 @@ $(document).ready(function() {
                     </td>
                     <td><input type="submit" value="Save" class="submit" /></td>
                     <td>
-                        <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Unset</a>
+                        <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=*&amp;branch=<!-- TMPL_VAR NAME="current_branch" -->">Unset</a>
                     </td>
                 </tr>
             </table>
@@ -205,7 +206,7 @@ $(document).ready(function() {
         </p>
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
             <input type="hidden" name="op" value="add-branch-cat" />
-            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/>
+            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/>
             <table>
                 <tr>
                     <th>Patron Category</th>
@@ -231,7 +232,7 @@ $(document).ready(function() {
                             <!-- /TMPL_IF -->
                         </td>
                         <td>
-                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a>
+                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&amp;categorycode=<!-- TMPL_VAR NAME="categorycode" -->&amp;branch=<!-- TMPL_VAR NAME="current_branch" -->">Delete</a>
                         </td>
                     </tr>
                 <!-- /TMPL_LOOP -->
@@ -274,7 +275,7 @@ $(document).ready(function() {
 
         <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
             <input type="hidden" name="op" value="add-branch-item" />
-            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->"/>
+            <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="current_branch" -->"/>
             <table>
                 <tr>
                     <th>Item Type</th>
@@ -302,7 +303,7 @@ $(document).ready(function() {
                             <!-- /TMPL_IF -->
                         </td>
                         <td>
-                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&amp;itemtype=<!-- TMPL_VAR NAME="itemtype" -->&amp;branch=<!-- TMPL_VAR NAME="branch" -->">Delete</a>
+                            <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&amp;itemtype=<!-- TMPL_VAR NAME="itemtype" -->&amp;branch=<!-- TMPL_VAR NAME="current_branch" -->">Delete</a>
                         </td>
                     </tr>
                 <!-- /TMPL_LOOP -->
index d3d83ac..5048839 100644 (file)
@@ -3,7 +3,7 @@
     <!-- TMPL_IF NAME="print_basket" -->
 
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <meta http-equiv="Content-Language" content="en-us" />
 <style type="text/css">
     @import url(<!-- TMPL_VAR NAME="themelang" -->/css/print.css);
index 8f53e80..e3b0a8f 100644 (file)
@@ -82,6 +82,7 @@ function verify_images() {
             <!-- /TMPL_LOOP -->
             </span>
         <!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="holdcount" --><span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="holdcount" --></a></span></span><!-- TMPL_ELSE --><!-- /TMPL_IF -->
 
         <!-- TMPL_IF NAME="AmazonEnabled" --><!-- TMPL_IF NAME="AmazonCoverImages" --></div><div class="yui-u" id="bookcoverimg">
         <a href="http://www.amazon<!-- TMPL_VAR NAME="AmazonTld" -->/gp/reader/<!-- TMPL_VAR NAME="normalized_isbn" -->/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/<!-- TMPL_VAR NAME="normalized_isbn" -->.01.MZZZZZZZ.jpg" alt="" /></a><!-- /TMPL_IF --><!-- /TMPL_IF -->
index 5156341..13b0e07 100644 (file)
                     <!-- TMPL_ELSE -->
                         &nbsp;
                     <!-- /TMPL_IF --></td>
-                <td><!-- TMPL_IF NAME="issuedate" -->
-                        <!-- TMPL_VAR NAME="issuedate" -->
-                    <!-- TMPL_ELSE -->
-                        &nbsp;
-                    <!-- /TMPL_IF --></td>
                 <td><!-- TMPL_IF NAME="date_due" -->
                         <!-- TMPL_VAR NAME="date_due" -->
                     <!-- TMPL_ELSE -->
index 87741d7..c8c0c06 100644 (file)
@@ -67,6 +67,7 @@
             <ol class="bibliodetails">
             <li><span class="label">Current Location:</span> <!-- TMPL_VAR NAME="holdingbranchname" -->&nbsp;</li>
             <li><span class="label">Checkout Status:</span> <!-- TMPL_IF NAME="issue" -->Checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR NAME="cardnumber" --></a>, Due back on <!-- TMPL_VAR NAME="datedue" --><!-- TMPL_ELSE -->Not Checked out <!-- /TMPL_IF --></li>
+            <li><span class="label">Current Renewals:</span> <!-- TMPL_VAR NAME="renewals" -->&nbsp;</li>
             <!-- TMPL_IF name="itemlostloop" -->
                 <li><span class="label">Lost Status:</span>
                     <!-- TMPL_IF NAME="CAN_user_circulate" -->
@@ -75,6 +76,7 @@
                         <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" />
                         <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
                         <select name="itemlost" >
+                                    <option value="">Choose</option>
                         <!-- TMPL_LOOP NAME="itemlostloop" -->
                             <!-- TMPL_IF NAME="selected" -->
                                     <option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option>
                     <input type="hidden" name="biblioitemnumber" value="<!-- TMPL_VAR Name="biblioitemnumber" -->" />
                     <input type="hidden" name="itemnumber" value="<!-- TMPL_VAR Name="itemnumber" -->" />
                     <select name="damaged" >
+                    <option value="">Choose</option>
             <!-- TMPL_LOOP NAME="itemdamagedloop" -->
                 <!-- TMPL_IF NAME="selected" -->
                     <option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option>
                     <!-- TMPL_VAR NAME="dateaccessioned" -->
                 <!-- /TMPL_IF --> </li>
 
-                <li><span class="label">Total Renewals:</span> <!-- TMPL_VAR NAME="renewals" -->&nbsp;</li>
-
+                
                 <li><span class="label">Total Checkouts:</span><!-- TMPL_IF NAME="issues" --><!-- TMPL_VAR NAME="issues" --><!-- TMPL_ELSE -->0<!-- /TMPL_IF -->  (<a href="/cgi-bin/koha/circ/bookcount.pl?&amp;biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;bi=<!-- TMPL_VAR NAME="biblioitemnumber" -->&amp;itm=<!-- TMPL_VAR NAME="itemnumber" -->">View item's checkout history</a>)</li>
 
                 <li><span class="label">Last seen:</span> <!-- TMPL_VAR NAME="datelastseen" -->&nbsp;</li>
                 <!-- TMPL_IF NAME="card1" --><li><span class="label">Previous Borrower:</span> <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=<!-- TMPL_VAR NAME="borrower1" -->"><!-- TMPL_VAR NAME="card1" --></a>&nbsp;</li><!-- /TMPL_IF -->
                <!-- TMPL_IF NAME="card2" --><li><span class="label">Previous Borrower:</span> <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=<!-- TMPL_VAR NAME="borrower2" -->"><!-- TMPL_VAR NAME="card2" --></a>&nbsp;</li><!-- /TMPL_IF -->
                 <li><span class="label">Paid for?:</span> <!-- TMPL_VAR NAME="paidfor" -->&nbsp;</li>
+            <li><span class="label">Serial enumeration/chronology:</span> <!-- TMPL_VAR NAME="enumchron" -->&nbsp;</li>
             <li><span class="label">Public Note:</span>
                 <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_items" -->
               <form class="inline" action="updateitem.pl" method="post"><input type="hidden" name="biblionumber" value="<!-- TMPL_VAR Name="biblionumber" -->" />
index df09c4f..e98cfd3 100644 (file)
@@ -5,7 +5,8 @@
 <script type="text/javascript">
 //<![CDATA[
 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
-var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved.");
+var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be placed on hold.");
+var q_array = new Array();  // will hold search terms, if present
 <!-- TMPL_IF NAME="AmazonEnabled" -->
 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
 function verify_images() {
@@ -21,7 +22,6 @@ function verify_images() {
         }
     });
 }
-var q_array = new Array();  // will hold search terms, if present
 
 $(window).load(function() {
         verify_images();
@@ -30,13 +30,33 @@ $(window).load(function() {
 function Dopop(link) {
         newin=window.open(link,'popup','width=500,height=500,toolbar=false,scrollbars=yes,resizeable=yes');
 }
+function cartList(){
+    if($("#addto").find("option:selected").attr("value") == "addtolist"){
+        var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
+        if (vShelfAdd()) {
+             Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vShelfAdd());
+        }
+        return false;
+    } else if($("#addto").find("option:selected").attr("value") == "newlist"){
+        if (vShelfAdd()) {
+            Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
+        }
+        return false;
+    }
+    if($("#addto").find("option:selected").attr("value") == "addtocart"){
+        addMultiple();
+        return false;
+    }
+}
+$(window).load(function() {
+        new YAHOO.widget.Button("cartsubmit", { onclick: { fn: cartList }});
+});
 $(document).ready(function() {
+$("#placeholdc").empty();
 $('#sortbyform').find("input:submit").hide();
 $('#sort_by').change(function() {
         $('#sortbyform').submit();
     });
-
-
 $(".addtocart").show();
         var param1 = "<label for=\"addto\">"+_("Add to:")+"<\/label><select name=\"addto\" id=\"addto\"><option value=\"\"><\/option>";
         <!-- TMPL_IF name="intranetbookbag" -->     param1 += "<option value=\"addtocart\">"+_("Cart")+"<\/option>"; <!-- /TMPL_IF -->
@@ -48,7 +68,7 @@ $(".addtocart").show();
         param1 +="<\/optgroup><option value=\"newlist\">"+_("[ New List ]")+"<\/option>"
 <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
-        param1 += "<\/select> <input type=\"submit\" class=\"submit\" value=\""+_("Save")+"\" />";
+        param1 += "<\/select> <input id=\"cartsubmit\" type=\"submit\" class=\"submit\" value=\""+_("Save")+"\" />";
  $('#sortsubmit').hide();
         $("span.clearall").html("<a id=\"CheckNone\" href=\"#\">"+_("Clear All")+"<\/a>");
         $("span.checkall").html("<a id=\"CheckAll\" href=\"#\">"+_("Select All")+"<\/a>");
@@ -63,26 +83,6 @@ $(".addtocart").show();
 
  $("#tagsel_span").html("<input id=\"tagsel_tag\" class=\"submit\" type=\"submit\" value=\"Tag\"/>");
 
-        function cartList(){
-                        if($("#addto").find("option:selected").attr("value") == "addtolist"){
-                        var shelfnumber = $("#addto").find("option:selected").attr("id").replace("s","");
-                        if (vShelfAdd()) {
-                           Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?shelfnumber='+shelfnumber+'&confirm=1&' + vShelfAdd());
-                        }
-                        return false;
-                } else if($("#addto").find("option:selected").attr("value") == "newlist"){
-                        if (vShelfAdd()) {
-                           Dopop('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?newshelf=1&' + vShelfAdd());
-                        }
-                        return false;
-                }
-               if($("#addto").find("option:selected").attr("value") == "addtocart"){
-                        addMultiple();
-                        return false;
-                 }
-
-        }
-
     $("#selection_ops").show();
     $(".selection").show();
     <!-- TMPL_IF NAME="query_desc" -->
@@ -167,6 +167,41 @@ function GetZ3950Terms(){
        <!-- /TMPL_LOOP -->
        return strQuery;
 }
+
+YAHOO.util.Event.onContentReady("searchheader", function () {
+        new YAHOO.widget.Button( "z3950submit", { onclick: { fn: PopupZ3950 }});
+        <!-- TMPL_IF NAME="holdfor" -->
+        var holdFor = function (){
+            $("#holdFor").val("");
+            placeHold();
+        }
+        var holdForPatron = function () {
+            $("#holdFor").val("<!-- TMPL_VAR NAME="holdfor_cardnumber" -->");
+            placeHold();
+        }
+        var HoldForButtonMenu = [
+            { text: "Place hold", onclick: { fn: holdFor }},
+            { text: "Place hold for <!-- TMPL_VAR NAME="holdfor_firstname" --> <!-- TMPL_VAR NAME="holdfor_surname" --> (<!-- TMPL_VAR NAME="holdfor_cardnumber" -->)", onclick: { fn: holdForPatron }}
+        ];
+
+        var HoldForButton = new YAHOO.widget.Button({
+                type: "split",
+                label: "Place hold",
+                name: "holdfor",
+                menu: HoldForButtonMenu,
+                container: "placeholdc",
+                onclick: { fn: holdFor }
+        });
+        <!-- TMPL_ELSE -->
+        new YAHOO.widget.Button({
+            id: "placehold",
+            type: "link",
+            label: _("Place hold"),
+            container: "placeholdc",
+            onclick: { fn: placeHold }
+         });
+        <!-- /TMPL_IF -->
+}); // YAHOO onContentReady
 //]]>
 </script>
 </head>
@@ -231,14 +266,15 @@ function GetZ3950Terms(){
                 |
                 <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
                 <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
+                |
+               <span class="addto"></span>
                 <!-- TMPL_IF NAME="CAN_user_reserveforothers" -->
-                       <!-- TMPL_IF NAME="DisplayMultiPlaceHold" -->
-                  <input type="button" onclick="placeHold(); return false;" value="Place Hold"/>
-                       <!-- /TMPL_IF -->
+                    <!-- TMPL_IF NAME="DisplayMultiPlaceHold" -->
+                  | <span id="placeholdc"><input type="button" id="placehold" onclick="placeHold(); return false;" value="Place Hold"/></span>
+                    <!-- /TMPL_IF -->
                 <!-- /TMPL_IF -->
-               <span class="addto"></span>
 
-                               <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_catalogue" --><input type="button" onclick="PopupZ3950(); return false;" value="Z39.50 Search"/><!-- /TMPL_IF -->
+                               <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_catalogue" --> | <input type="button" id="z3950submit" onclick="PopupZ3950(); return false;" value="Z39.50 Search"/><!-- /TMPL_IF -->
             </div>
         </div>
     <!-- TMPL_IF NAME="stopwords_removed" --><div><p class="tip">Ignored the following common words: "<!-- TMPL_VAR NAME="stopwords_removed" -->"<p></div><!-- /TMPL_IF -->
@@ -451,6 +487,7 @@ function GetZ3950Terms(){
                                   <span class="noholdstext">No holds allowed</span>
                               <!-- TMPL_ELSE -->
                                   <a id="reserve_<!-- TMPL_VAR NAME="biblionumber" -->" href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Holds</a>
+                                  <!-- TMPL_IF NAME="holdfor" --> | <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;findborrower=<!-- TMPL_VAR NAME="holdfor_cardnumber" -->">Hold for <!-- TMPL_VAR NAME="holdfor_firstname" --> <!-- TMPL_VAR NAME="holdfor_surname" --> (<!-- TMPL_VAR NAME="holdfor_cardnumber" -->)</a><!-- /TMPL_IF -->
                               <!-- /TMPL_IF -->
                           <!-- TMPL_IF NAME="CAN_user_editcatalogue_edit_catalogue" -->
                           | <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Edit record</a>
@@ -539,7 +576,7 @@ function GetZ3950Terms(){
     <!-- TMPL_IF NAME="inner_sup_results_loop" -->
         <!-- TMPL_VAR NAME="servername" -->
         <!-- TMPL_LOOP NAME="inner_sup_results_loop" -->
-        <div><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_VAR NAME="sort_by" --><!-- TMPL_VAR NAME="link" -->"><!-- TMPL_VAR NAME="title" ESCAPE="html" --></a></div>
+        <div><a href="/cgi-bin/koha/catalogue/search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" --><!-- TMPL_VAR NAME="sort_by" --><!-- TMPL_VAR NAME="link" -->"><!-- TMPL_VAR NAME="title" ESCAPE="html" --></a></div>
         <!-- /TMPL_LOOP -->
     <!-- /TMPL_IF -->
 <!-- </div> -->
@@ -551,6 +588,7 @@ function GetZ3950Terms(){
 <form id="hold_form" method="get" action="/cgi-bin/koha/reserve/request.pl">
     <!-- Value will be set here by placeHold() -->
     <input id="hold_form_biblios" type="hidden" name="biblionumbers" value="" />
+    <input type="hidden" name="findborrower" id="holdFor" value="" />
     <input type="hidden" name="multi_hold" value="1"/>
 </form>
 
index be98543..ba59280 100644 (file)
@@ -130,9 +130,11 @@ function AreMandatoriesNotOk(){
         var tag=mandatories[i].substr(4,3);
         var subfield=mandatories[i].substr(17,1);
         var tagnumber=mandatories[i].substr(19,mandatories[i].lastIndexOf("_")-19);
-        tabflag[tag+subfield+tagnumber]=new Array();
-        tabflag[tag+subfield+tagnumber][0]=0;
-        if( ! document.getElementById(mandatories[i]).value){
+        if (tabflag[tag+subfield+tagnumber] ==  null) { 
+           tabflag[tag+subfield+tagnumber]=new Array();
+            tabflag[tag+subfield+tagnumber][0]=0; 
+       }
+        if( tabflag[tag+subfield+tagnumber][0] != 1 && (document.getElementById(mandatories[i]) != null && ! document.getElementById(mandatories[i]).value || document.getElementById(mandatories[i]) == null)){
             tabflag[tag+subfield+tagnumber][0] = 0 + tabflag[tag+subfield+tagnumber] ;
             document.getElementById(mandatories[i]).setAttribute('class','subfield_not_filled');
             document.getElementById(mandatories[i]).focus();
old mode 100644 (file)
new mode 100755 (executable)
index ab2a079..2b90f48
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Cataloging &rsaquo; 006 builder</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-</head>
-<body style="padding:1em;">
-<h3>006 Fixed-length data elements--Additional material characteristics--General information</h3>
-<form name="f_pop" onsubmit="report()" action="">
-<input type="hidden" name="plugin_name" value="marc21_field_006.pl" />
-<table>
-       <tr>
-               <td><label for="f0">0 Form of material</label></td>
-                <td>
-                        <select name="f0" id="f0" size="1">
-                        <!-- TMPL_IF name="f0a" -->
-                                <option value="a" selected="selected">a- Language material</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="a">a- Language material</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0c" -->
-                                <option value="c" selected="selected">c - Notated music</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="c">c - Notated music</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0d" -->
-                                <option value="d" selected="selected">d - Manuscript notated music</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="d">d - Manuscript notated music</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0e" -->
-                                <option value="e" selected="selected">e - Cartographic material</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="e">e - Cartographic material</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0f" -->
-                                <option value="f" selected="selected">f - Manuscript cartographic material</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="f">f - Manuscript cartographic material</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0g" -->
-                                <option value="g" selected="selected">g - Projected medium</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="g">g - Projected medium</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0i" -->
-                                <option value="i" selected="selected">i - Nonmusical sound recording</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="i">i - Nonmusical sound recording</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0j" -->
-                                <option value="j" selected="selected">j - Musical sound recording</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="j">j - Musical sound recording</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0k" -->
-                                <option value="k" selected="selected">k - Two-dimensional nonprojectable graphic</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="k">k - Two-dimensional nonprojectable graphic</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0m" -->
-                                <option value="m" selected="selected">m - Computer file/Electronic resource</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="m">m - Computer file/Electronic resource</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0o" -->
-                                <option value="o" selected="selected">o - Kit</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="o">o - Kit</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0p" -->
-                                <option value="p" selected="selected">p - Mixed material</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="p">p - Mixed material</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0r" -->
-                                <option value="r" selected="selected">r - Three-dimensional artifact or naturally occurring object</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="r">r - Three-dimensional artifact or naturally occurring object</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0s" -->
-                                <option value="s" selected="selected">s - Serial/Integrating resource</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="s">s - Serial/Integrating resource</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f0t" -->
-                                <option value="t" selected="selected">t - Manuscript language material</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="t">t - Manuscript language material</option>
-                        <!-- /TMPL_IF -->
-                        </select>
-               </td>
-       </tr>
-       <tr>
-                <td>01-04 Illustrations </td>
-                <td>(auto-filled from 300)<input type="hidden" name="f014" size="4"  maxlength="4" value="<!-- TMPL_VAR NAME="f014" -->"/></td>
-        </tr>
-               <tr>
-                <!-- 5 Target Audience -->
-                <td><label for="f5">5- Target Audience</label></td>
-                <td>
-                <select name="f5" id="f5" size="1">
-
-                        <!-- TMPL_IF name="f5|" -->
-                        <option value="|" selected="selected">|- Default</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="|">|- Default</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f50" -->
-                        <option value=" " selected="selected">#- Unknown or not specified</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- Unknown or not specified</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5a" -->
-                         <option value="a" selected="selected">a- Preschool</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="a">a- Preschool</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5b" -->
-                         <option value="b" selected="selected">b- Primary</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="b">b- Primary</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5c" -->
-                         <option value="c" selected="selected">c- Elementary and junior high</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">c- Elementary and junior high</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5d" -->
-                         <option value="d" selected="selected">d- Secondary (senior high)</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Secondary (senior high)</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5e" -->
-                         <option value="e" selected="selected">e- Adult</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="e">e- Adult</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5f" -->
-                         <option value="f" selected="selected">f- Specialized</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Specialized</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5g" -->
-                         <option value="g" selected="selected">g- General</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="g">g- General</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f5j" -->
-                         <option value="j" selected="selected">j- Juvenile</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="j">j- Juvenile</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-        </tr>
-        <tr>
-                <!-- 06 Form of an item -->
-                <td><label for="f6">06- Form of an item</label></td>
-                <td>
-                <select name="f6" id="f6" size="1">
-
-                        <!-- TMPL_IF name="f60" -->
-                        <option value=" " selected="selected">#- None of the following</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- None of the following</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f6a" -->
-                        <option value="a" selected="selected">a- Microfilm</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="a">a- Microfilm</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f6b" -->
-                        <option value="b" selected="selected">b- Microfiche</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="b">b- Microfiche</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f6c" -->
-                        <option value="c" selected="selected">a- Microopaque</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">a- Microopaque</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f6d" -->
-                        <option value="d" selected="selected">d- Large Print</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Large Print</option>
-                        <!-- /TMPL_IF -->
 
-                        <!-- TMPL_IF name="f6f" -->
-                        <option value="f" selected="selected">f- Braille</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Braille</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f6r" -->
-                        <option value="r" selected="selected">r- Regular print reproduction</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="r">r- Regular print reproduction</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f6s" -->
-                        <option value="s" selected="selected">s- Electronic</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="s">s- Electronic</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f6!" -->
-                        <option value="!" selected="selected">!- No attempt to code</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="!">!- No attempt to code</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-        </tr>
-       <tr>
-                <td>7-10 Nature of contents </td>
-                <td>(Derived value)
-                        <input type="hidden" name="f710" size="4" maxlength="4" value="<!-- TMPL_VAR NAME="f710" -->"/>                </td>
-        </tr>
-        <tr>
-                <td><label for="f11">11- Government Publication</label></td>
-                <td>
-                <select name="f11" id="f11" size="1">
-               
-                        <!-- TMPL_IF name="f11|" -->
-                        <option value="|" selected="selected">|- Default</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="|">|- Default</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f110" -->
-                        <option value=" " selected="selected">#- Not a government publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- Not a government publication</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f11a" -->
-                        <option value="a" selected="selected">a- Autonomous or semi-autonomous component</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="a">a- Autonomous or semi-autonomous component</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f11c" -->
-                        <option value="c" selected="selected">c- Multilocal</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">c- Multilocal</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f11f" -->
-                        <option value="f" selected="selected">f- Federal/national</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Federal/national</option>
-                        <!-- /TMPL_IF -->
-
-
-                        <!-- TMPL_IF name="f11i" -->
-                        <option value="i" selected="selected">i- International intergovernmental</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="i">i- International intergovernmental</option>
-                        <!-- /TMPL_IF -->
-
-
-                        <!-- TMPL_IF name="f11l" -->
-                        <option value="l" selected="selected">l- Local</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="l">l- Local</option>
-                        <!-- /TMPL_IF -->
-
-
-                        <!-- TMPL_IF name="f11m" -->
-                        <option value="m" selected="selected">m- Multistate</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="m">m- Multistate</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f11o" -->
-                        <option value="o" selected="selected">o- Government publication - level undetermined</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="o">o- Government publication - level undetermined</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f11s" -->
-                        <option value="s" selected="selected">s- State, provincial,territorial,dependent,etc.</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="s">s- State,provincial,territorial,dependent,etc.</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f11u" -->
-                        <option value="u" selected="selected">u- Unknown if item is government publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="u">u- Unknown if item is government publication</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f11z" -->
-                        <option value="z" selected="selected">z- Other</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="z">z- Other</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-        </tr>
-        <tr>
-                <td><label for="f12">12- Conference publication</label></td>
-                <td>
-                <select name="f12" id="f12" size="1">
-                        <!-- TMPL_IF name="f120" -->
-                        <option value="0" selected="selected">0- Not a conference publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- Not a conference publication</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f121" -->
-                        <option value="1" selected="selected">1- Conference publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Conference publication</option>
-                        <!-- /TMPL_IF -->
-
-               </select>
-               </td>
-       </tr>
-       <tr>
-                <td><label for="f13">13- Festschrift</label></td>
-                <td>
-                <select name="f13" id="f13" size="1">
-                        <!-- TMPL_IF name="f130" -->
-                        <option value="0" selected="selected">0- Not a festschrift</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- Not a festschrift</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f131" -->
-                        <option value="1" selected="selected">1- Festschrift</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Festschrift</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-        </tr>
-
-        <tr>
-                <td><label for="f14">14- Index</label></td>
-                <td>
-                <select name="f14" id="f14" size="1">
-                        <!-- TMPL_IF name="f14|" -->
-                        <option value="|" selected="selected">|- Default</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="|">|- Default</option>
-                        <!-- /TMPL_IF -->
-       
-                        <!-- TMPL_IF name="f140" -->
-                        <option value="0" selected="selected">0- No Index</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- No Index</option>
-                        <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="f141" -->
-                        <option value="1" selected="selected">1- Index present</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Index present</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-               </tr>
-               <tr><td>15 Undefined</td><td></td>
-               </tr>
-               <tr>
-                <td><label for="f16">16- Literary form</label></td>
-                <td>
-                <select name="f16" id="f16" size="1">
-                        <!-- TMPL_IF name="f160" -->
-                        <option value="0" selected="selected">0- Not fiction</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- Not fiction</option>
-                        <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="f161" -->
-                        <option value="1" selected="selected">1- Fiction</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Fiction</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f16c" -->
-                        <option value="c" selected="selected">c- Comic strips</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">c- Comic strips</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f16d" -->
-                        <option value="d" selected="selected">d- Dramas</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Dramas</option>
-                        <!-- /TMPL_IF -->
-
-
-                        <!-- TMPL_IF name="f16e" -->
-                        <option value="e" selected="selected">e- Essays</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="e">e- Essays</option>
-                        <!-- /TMPL_IF -->
-
-                       
-                        <!-- TMPL_IF name="f16f" -->
-                        <option value="f" selected="selected">f- Novels</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Novels</option>
-                        <!-- /TMPL_IF -->
-
-                       
-                        <!-- TMPL_IF name="f16h" -->
-                        <option value="h" selected="selected">h- Humor,satires,etc.</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="h">h- Humor,satires,etc.</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f16i" -->
-                        <option value="i" selected="selected">i- Letters</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="i">i- Letters</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f16j" -->
-                        <option value="j" selected="selected">j- Short stories</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="j">j- Short stories</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f16m" -->
-                        <option value="m" selected="selected">m- Mixed forms</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="m">m- Mixed forms</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f16p" -->
-                        <option value="p" selected="selected">p- Poetry</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="p">p- Poetry</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f16s" -->
-                        <option value="s" selected="selected">s- Speeches</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="s">s- Speeches</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f16u" -->
-                        <option value="u" selected="selected">u- Unknown</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="u">u- Unknown</option>
-                        <!-- /TMPL_IF -->
-
-                </select>
-                </td>
-        </tr>
-       <tr>
-                <td><label for="f17">17- Biography</label></td>
-                <td>
-                <select name="f17" id="f17" size="1">
-                        <!-- TMPL_IF name="f170" -->
-                        <option value=" " selected="selected">#- No biographical material</option>                              <!-- TMPL_ELSE -->
-                        <option value=" ">#- No biographical material</option>
-                        <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="f17a" -->
-                        <option value="a" selected="selected">a- Autobiography</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="a">a- Autobiography</option>
-                        <!-- /TMPL_IF -->
+<script type="text/javascript" src='<!-- TMPL_VAR name="themelang" -->/js/xmlControlfield.js'></script>
+<script type="text/javascript">
+    var objXmlControlField;
+    var tr_result;
+    var h4_result;
+
+    function loadXmlValues()
+    {
+        <!-- TMPL_IF NAME="errorXml" -->
+        alert("<!--TMPL_VAR Name="errorXml"-->");
+        <!-- TMPL_ELSE -->
+        var form = document.f_pop;
+        h4_result = document.getElementById("h4_result");
+        tr_result = document.getElementById("tr_result");
+        objXmlControlField = new xmlControlField('<!--TMPL_VAR Name="tagfield"-->', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '');
+        objXmlControlField.loadXmlValues();
+        renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result"));
+        <!-- /TMPL_IF -->
+    }//loadXmlValues
+
+    function changeTypeofMaterial(form)
+    {
+        if (form.material_type.options[form.material_type.selectedIndex].value != "" && confirm('Show values for \'' + form.material_type.options[form.material_type.selectedIndex].text + '\' material type?')) {
+            objXmlControlField.setIdMaterial(form.material_type.options[form.material_type.selectedIndex].value);
+            objXmlControlField.renderTemplate();
+            renderResult(tr_result, form.result.value, true);
+        }
+    }//changeTypeofMaterial
+</script>
 
-                        <!-- TMPL_IF name="f17b" -->
-                        <option value="b" selected="selected">b- Individual biography</option>                              <!-- TMPL_ELSE -->
-                        <option value="b">b- Individual biography</option>
-                        <!-- /TMPL_IF -->
+</head>
+<body style="padding:1em;" onload="loadXmlValues()">
+<h3>006 Fixed-length data elements--Additional material characteristics--General information</h3>
 
-                        <!-- TMPL_IF name="f17c" -->
-                        <option value="c" selected="selected">c- Collective biography</option>                              <!-- TMPL_ELSE -->
-                        <option value="c">c- Collective biography</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f17d" -->
-                        <option value="d" selected="selected">d- Contains biographical information</option>                              <!-- TMPL_ELSE -->
-                        <option value="d">d- Contains biographical information</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-        </tr>
+<table border="1">
+    <tr id="tr_result">
+    </tr>
+</table>
+<h4 id="h4_result">&quot;<!--TMPL_VAR Name="result"-->&quot;</h4>
 
+<form name="f_pop" id="f_pop" onsubmit="report()" action="">
+<input type="hidden" name="plugin_name" value="marc21_field_006.pl" />
+<input type="hidden" id="<!-- TMPL_VAR NAME='index'-->" name="index" value="<!-- TMPL_VAR NAME='index'-->" />
+<input type="hidden" id="result" name="result" value="<!--TMPL_VAR Name="result"-->" />
+<table id="table_material_types">
+    <tr id="tr_material_types">
+        <td><label for="material_type" title="Select a type of material to specify the variable values">Type of Material</label></td>
+        <td>
+            <select name="material_type" id="material_type" title="Select a type of material to specify the variable values" onchange="changeTypeofMaterial(this.form)">
+                <option value="">Select a type of material</option>
+            </select>
+        </td>
+    </tr>
 </table>
 <fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
 </form>
 <script type="text/javascript">//<![CDATA[
 function report() {
-            var doc   = opener.document; 
-            var field = doc.getElementById("<!-- TMPL_VAR NAME='index'-->");
-        
-            field.value = 
-                       '<!-- TMPL_VAR NAME="dateentered" -->'+
-                       document.f_pop.f0.value+
-                       document.f_pop.f014.value+
-                       document.f_pop.f5.value+
-                       document.f_pop.f6.value+
-                       document.f_pop.f710.value+
-                       document.f_pop.f11.value+
-                       document.f_pop.f12.value+
-                       document.f_pop.f13.value+
-                       document.f_pop.f14.value+ ' '+
-                       document.f_pop.f16.value+
-                       document.f_pop.f17.value;
-               self.close();
-               return false;
-       }
-       //]]>
+        var doc   = opener.document;
+        var field = doc.getElementById("<!-- TMPL_VAR NAME='index'-->");
+        field.value = document.getElementById("result").value;
+        self.close();
+        return false;
+    }
+    //]]>
 </script>
 
 <!-- TMPL_INCLUDE NAME="popup-bottom.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_006.xml
new file mode 100755 (executable)
index 0000000..c7a9e3b
--- /dev/null
@@ -0,0 +1,795 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Tagfield tag="006" xmlns="http://koha-community.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "./marc21_field_CF.xsd">
+  <Material id="BKS" name="Books" description="">
+    <Position pos="00" name="Form of material" description="">
+      <Value description="Language material">a</Value>
+      <Value description="Manuscript language material">t</Value>
+    </Position>
+    <Position pos="01-04" name="Illustrations" description="Up to four (4) one-character alphabetic codes (recorded in alphabetical order) that indicate the presence of types of illustrations in the item. If fewer than four alphabetic codes are assigned, the codes are left justified and unused positions contain blanks (#)">
+      <Value description="No illustrations">#</Value>
+      <Value description="Illustrations">a</Value>
+      <Value description="Maps">b</Value>
+      <Value description="Portraits">c</Value>
+      <Value description="Charts">d</Value>
+      <Value description="Plans">e</Value>
+      <Value description="Plates">f</Value>
+      <Value description="Music">g</Value>
+      <Value description="Facsimiles">h</Value>
+      <Value description="Coats of arms">i</Value>
+      <Value description="Genealogical tables">j</Value>
+      <Value description="Forms">k</Value>
+      <Value description="Samples">l</Value>
+      <Value description="Phonodisc, phonowire, etc">m</Value>
+      <Value description="Photographs">o</Value>
+      <Value description="Illuminations">p</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="05" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="06" name="Form of item" description="One character alphabetic code that specifies the form of material for the item">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille">f</Value>
+      <Value description="Online">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Nature of contents" description="Up to four one-character codes that indicate whether a significant part of the item is or contains certain types of material. If fewer than four codes are assigned, the codes are left justified and unused positions contain blanks (#)">
+      <Value description="No specified nature of contents">#</Value>
+      <Value description="Offprints.Publication that originally was published as an article in a monograph or a serial and that is also issued separately and independently. Includes prepints and postprints">2</Value>
+      <Value description="Calendars">5</Value>
+      <Value description="Comics/graphic novels">6</Value>
+      <Value description="Abstracts/summaries. Abstracts or summaries of other publications. Not used when a publication includes an abstract or summary of its own content.">a</Value>
+      <Value description="Bibliographies">b</Value>
+      <Value description="Catalogs">c</Value>
+      <Value description="Dictionaries. Also used for a glossary or a gazetteer.">d</Value>
+      <Value description="Encyclopedias">e</Value>
+      <Value description="Handbooks">f</Value>
+      <Value description="Legal articles">g</Value>
+      <Value description="Indexes. Index to bibliographical material other than itself. Not used when a publication contains an index to its own content.">i</Value>
+      <Value description="Patent document">j</Value>
+      <Value description="Discographies">k</Value>
+      <Value description="Legislation. Full or partial text of enactments of legislative bodies, published either in statute or in code form, or text of rules and regulations issued by executive or adminitrative agencies.">l</Value>
+      <Value description="Theses. Thesis, dissertation, or work identified as having been created to satisfy the requirements for an academic certification or degree.">m</Value>
+      <Value description="Surveys of literature in a subject area. Composed entirely of authored surveys that summarize what has been published about a subject.">n</Value>
+      <Value description="Reviews. Devoted entirely to critical reviews of published or performed works (e.g., books, films, sound recordings, theater)">o</Value>
+      <Value description="Programmed texts">p</Value>
+      <Value description="Filmographies. Entire item, or a significant part of it, is a filmography or other  bibliografy of moving images.">q</Value>
+      <Value description="Directories">r</Value>
+      <Value description="Statistics">s</Value>
+      <Value description="Technical reports">t</Value>
+      <Value description="Standars/specifications">u</Value>
+      <Value description="Legal cases and case notes">v</Value>
+      <Value description="Law reports and digests">w</Value>
+      <Value description="Yearbooks">y</Value>
+      <Value description="Treaties. Treaty or accord negotiated between two or more parties to settle a disagreement, establish a relationship, gran rights,etc.">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="11" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="12" name="Conference publication" description="One-character code that indicates whether the item consists of the proceedings, reports, or summaries of a conference.">
+      <Value description="Not a conference publication">0</Value>
+      <Value description="Conference">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="13" name="Festschrift" description="One-character code that indicates whether the item is a festschrift">
+      <Value description="Not a festschrift">0</Value>
+      <Value description="Festschrift">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="14" name="Index" description="One-character numeric code that indicates whether the item includes an index to its own contents">
+      <Value description="No index">0</Value>
+      <Value description="Index present">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="15" name="Undefined" description="Contains a blank (#) or a fill character (|)."/>
+    <Position pos="16" name="Literary form" description="One-character code used to indicate the literary form of an item. Numeric codes 0 and 1 provide a generic identification of whether or not the item is a work of fiction. Alphabetic codes may be used to identify specific literary forms.">
+      <Value description="Not fiction (not further specified)">0</Value>
+      <Value description="Fiction (not further specified)">1</Value>
+      <Value description="Dramas">d</Value>
+      <Value description="Essays">e</Value>
+      <Value description="Novels">f</Value>
+      <Value description="Humor, satires, etc.">h</Value>
+      <Value description="Letters. Single letter or collection of correspondence">i</Value>
+      <Value description="Short stories. Short story or collection of short stories.">j</Value>
+      <Value description="Mixed forms. Represents a variety of literary forms (e.g., poetry and short stories)">m</Value>
+      <Value description="Poetry">p</Value>
+      <Value description="Speeches">s</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="17" name="Biography" description="One-character alphabetic code that indicates whether or not an item contains biographical material, and if so, what the biographical characteristics are.">
+      <Value description="No biographical material">#</Value>
+      <Value description="Autobiography">a</Value>
+      <Value description="Individual biography">b</Value>
+      <Value description="Collective biography">c</Value>
+      <Value description="Contains biographical information">d</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="CF" name="Computer Files" description="">
+    <Position pos="00" name="Form of material" description="">
+      <Value description="Computer file/ Electronic resource">m</Value>
+    </Position>
+    <Position pos="01-04" name="Undefined" description="Each one contains a blank (#) or a fill character (|)"/>
+    <Position pos="05" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="06" name="Form of item" description="One-character alphabetic code that specifies the form of material for the item">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Online">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-08" name="Undefined" description="Two undefined character positions; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="09" name="Type of computer file " description="One-character alphabetic code that indicates the type of computer file described in the bibliographic record">
+      <Value description="Numeric data">a</Value>
+      <Value description="Computer program">b</Value>
+      <Value description="Representational. Pictorial or graphic information that can be manipulated in conjunction with other types of files to produce graphic patterns that can be used to interpret and give meaning to the information. Does not include a document in image format.">c</Value>
+      <Value description="Document">d</Value>
+      <Value description="Bibliographic data">e</Value>
+      <Value description="Font">f</Value>
+      <Value description="Game">g</Value>
+      <Value description="Sound">h</Value>
+      <Value description="Interactive multimedia">i</Value>
+      <Value description="Online system or service">j</Value>
+      <Value description="Combination">m</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="10" name="Undefined" description="One-character code that contains a blank (#) or a fill character (|)."/>
+    <Position pos="11" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="12-18" name="Undefined" description="Six undefined character positions; each contains a blank (#) or a fill character (|)."/>
+  </Material>
+  <Material id="MP" name="Maps" description="">
+    <Position pos="00" name="Form of material" description="">
+      <Value description="Cartographic material">e</Value>
+      <Value description="Manuscript cartographic material">f</Value>
+    </Position>
+    <Position pos="01-04" name="Relief" description="Up to four one-character alphabetic codes that indicate the relief type specified on the item. Codes are recorded in order of their importance to the described item. If fewer than four codes are assigned, the codes are left justified and each unused position contains a blank (#).">
+      <Value description="No relief shown"># </Value>
+      <Value description="Contours">a</Value>
+      <Value description="Shading">b</Value>
+      <Value description="Gradient and bathymetric tints">c</Value>
+      <Value description="Hachures">d</Value>
+      <Value description="Bathymetry/soundings">e</Value>
+      <Value description="Form lines">f</Value>
+      <Value description="Spot heights">g</Value>
+      <Value description="Pictorially">i</Value>
+      <Value description="Land forms">j</Value>
+      <Value description="Bathymetry/ isolines">k</Value>
+      <Value description="Rock drawings">m</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="05-06" name="Projection" description="Two-character alphabetic code that indicates the projection used in producing the item.">
+      <Value description="Projection not specified">##</Value>
+      <Value description="Aitoff ">aa</Value>
+      <Value description="Gnomic">ab</Value>
+      <Value description="Lambert's azimuthal equal area">ac</Value>
+      <Value description="Orthographic">ad</Value>
+      <Value description="Azimuthal equidistant">ae</Value>
+      <Value description="Stereographic">af</Value>
+      <Value description="General vertical near-sided">ag</Value>
+      <Value description="Modified stereographic for Alaska">am</Value>
+      <Value description="Chamberlin trimetric">an</Value>
+      <Value description="Polar stereographic">ap</Value>
+      <Value description="Azimuthal, specific type unknown">au</Value>
+      <Value description="Azimutal, other">az</Value>
+      <Value description="Gall ">ba</Value>
+      <Value description="Goode's homolographic">bb</Value>
+      <Value description="Lambert's cylindrical equal area">bc</Value>
+      <Value description="Mercator">bd</Value>
+      <Value description="Miller ">be</Value>
+      <Value description="Mollweide ">bf</Value>
+      <Value description="Sinusoidal ">bg</Value>
+      <Value description="Transverse Mercator">bh</Value>
+      <Value description="Gauss-Kruger ">bi</Value>
+      <Value description="Equirectangular ">bj</Value>
+      <Value description="Krovak">bk</Value>
+      <Value description="Cassini-Soldner">bl</Value>
+      <Value description="Oblique Mercator">bo</Value>
+      <Value description="Robinson ">br</Value>
+      <Value description="Space oblique Mercator">bs</Value>
+      <Value description="Cylindrical, specific type unknown">bu</Value>
+      <Value description="Cylindrical, other">bz</Value>
+      <Value description="Albers equal area">ca</Value>
+      <Value description="Bonne ">cb</Value>
+      <Value description="Lambert's conformal conic">cc</Value>
+      <Value description="Equidistant conic">ce</Value>
+      <Value description="Polyconic">cp</Value>
+      <Value description="Conic, specific type unknown">cu</Value>
+      <Value description="Conic, other">cz</Value>
+      <Value description="Armadillo ">da</Value>
+      <Value description="Butterfly ">db</Value>
+      <Value description="Eckert ">dc</Value>
+      <Value description="Goode's homolosine">dd</Value>
+      <Value description="Miller's bipolar oblique conformal conic">de</Value>
+      <Value description="Van Der Grinten ">df</Value>
+      <Value description="Dimaxión ">dg</Value>
+      <Value description="Cordiform">dh</Value>
+      <Value description="Lambert conformal ">dl</Value>
+      <Value description="Other">zz</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="08" name="Type of cartographic material" description="One-character alphabetic code that indicates the type of cartographic item described.">
+      <Value description="Single map">a</Value>
+      <Value description="Map Series. Number of related but physically separate and bibliographically distinct cartographic units intended by the producer(s) or issuing body(s) to form a single group.">b</Value>
+      <Value description="Map serial. Issued in successive parts bearing numerical or chronological designations and intended to be continued indefinitely">c</Value>
+      <Value description="Globe">d</Value>
+      <Value description="Atlas ">e</Value>
+      <Value description="Separate supplement to another work">f</Value>
+      <Value description="Bound as part of another work">g</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="09-10" name="Undefined" description="Each contains a blank (#) or a fill character (|)"/>
+    <Position pos="11" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="12" name="Form of item" description="One-character alphabetic code that indicates the form of material for the item.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic. Storage on a directly accessible tangible recording medium, e.g. disc, tape, playaway device, flashdrive, portable hard drive, etc. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not require the use of a computer (e.g., music compact discs, videodiscs). This code can be used as a generic code for any form of electronic resource. Codes o and q may be used if there is a need to separately identify online and direct electronic resources.">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="13" name="Undefined" description="Contains a blank (#) or a fill character (|)."/>
+    <Position pos="14" name="Index" description="One-character numeric code that indicates whether the item or accompanying material includes a location index or gazetteer.">
+      <Value description="No index">0</Value>
+      <Value description="Index present">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="15" name="Undefined" description="Contains a blank (#) or a fill character (|)."/>
+    <Position pos="16-17" name="Special format characteristics" description="Up to two one-character alphabetic codes that indicate the special format characteristics of the map. Codes are recorded in order of their importance to the described item. If only one code is assigned, it is left justified and the unused position contains a blank (#).">
+      <Value description="No specified special format characteristics">#</Value>
+      <Value description="Manuscript">e</Value>
+      <Value description="Picture card, post card">j</Value>
+      <Value description="Calendar">k</Value>
+      <Value description="Puzzle">l</Value>
+      <Value description="Game">n</Value>
+      <Value description="Wall map">o</Value>
+      <Value description="Playing cards">p</Value>
+      <Value description="Loose-leaf">r</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="MU" name="Music" description="">
+    <Position pos="00" name="Form of material" description="">
+      <Value description="Notated music">c</Value>
+      <Value description="Manuscript notated music">d</Value>
+      <Value description="Nonmusical sound recording">i</Value>
+      <Value description="Musical sound recording">j</Value>
+    </Position>
+    <Position pos="01-02" name="Form of composition" description="">
+      <Value description="Anthems">an</Value>
+      <Value description="Ballads">bd</Value>
+      <Value description="Bluegrass music">bg</Value>
+      <Value description="Blues ">bl</Value>
+      <Value description="Ballets ">bt</Value>
+      <Value description="Chaconnes">ca</Value>
+      <Value description="Chants, Other religions">cb</Value>
+      <Value description="Chants, Christian">cc</Value>
+      <Value description="Concerti grossi ">cg</Value>
+      <Value description="Chorales">ch</Value>
+      <Value description="Chorale preludes">cl</Value>
+      <Value description="Canons and rounds">cn</Value>
+      <Value description="Concertos">co</Value>
+      <Value description="Chansons, polyphonic">cp</Value>
+      <Value description="Carols">cr</Value>
+      <Value description="Chance compositions">cs</Value>
+      <Value description="Cantatas">ct</Value>
+      <Value description="Country music">cy</Value>
+      <Value description="Canzonas">cz</Value>
+      <Value description="Dance forms">df</Value>
+      <Value description="Divertimentos, serenades, cassations, divertissements, and notturni">dv</Value>
+      <Value description="Fugues">fg</Value>
+      <Value description="Flamenco">fl</Value>
+      <Value description="Folk music">fm</Value>
+      <Value description="Fantasias ">ft</Value>
+      <Value description="Gospel music">gm</Value>
+      <Value description="Hymns">hy</Value>
+      <Value description="Jazz">jz</Value>
+      <Value description="Musical revues and comedies">mc</Value>
+      <Value description="Madrigals">md</Value>
+      <Value description="Minuets ">mi</Value>
+      <Value description="Motets">mo</Value>
+      <Value description="Motion picture music">mp</Value>
+      <Value description="Marches">mr</Value>
+      <Value description="Masses">ms</Value>
+      <Value description="Multiple forms">mu</Value>
+      <Value description="Mazurkas">mz</Value>
+      <Value description="Nocturnes">nc</Value>
+      <Value description="Not applicable">nn</Value>
+      <Value description="Operas">op</Value>
+      <Value description="Oratorios ">or</Value>
+      <Value description="Overtures">ov</Value>
+      <Value description="Program music">pg</Value>
+      <Value description="Passion music">pm</Value>
+      <Value description="Polonaises">po</Value>
+      <Value description="Popular music">pp</Value>
+      <Value description="Preludes">pr</Value>
+      <Value description="Passacaglias">ps</Value>
+      <Value description="Part-songs">pt</Value>
+      <Value description="Pavans">pv</Value>
+      <Value description=" Rock music">rc</Value>
+      <Value description="Rondos">rd</Value>
+      <Value description="Ragtime music">rg</Value>
+      <Value description="Ricercars ">ri</Value>
+      <Value description="Rhapsodies">rp</Value>
+      <Value description="Requiems ">rq</Value>
+      <Value description="Square dance music">sd</Value>
+      <Value description="Songs">sg</Value>
+      <Value description="Sonatas ">sn</Value>
+      <Value description="Symphonic poems">sp</Value>
+      <Value description="Studies and exercises">st</Value>
+      <Value description="Suites ">su</Value>
+      <Value description="Symphonies">sy</Value>
+      <Value description="Toccatas">tc</Value>
+      <Value description="Teatro lirico">tl</Value>
+      <Value description="Trio-sonatas">ts</Value>
+      <Value description="Unknown">uu</Value>
+      <Value description="Villacincos">vi</Value>
+      <Value description="Variations">vr</Value>
+      <Value description="Waltzers">wz</Value>
+      <Value description="Zarzuelas">za</Value>
+      <Value description="Other">zz</Value>
+      <Value description="No attempt to code">||</Value>
+    </Position>
+    <Position pos="03" name="Format of music" description="One-character code that indicates the format of a musical composition (e.g., piano-conductor score).">
+      <Value description="Full score">a</Value>
+      <Value description="Full score, miniature or study size">b</Value>
+      <Value description="Accompaniment reduced for keyboard">c</Value>
+      <Value description="Voice score">d</Value>
+      <Value description="Condensed score or piano-conductor score">e</Value>
+      <Value description="Close score">g</Value>
+      <Value description="Chorus score">h</Value>
+      <Value description="Condensed score">i</Value>
+      <Value description="Performer-conductor part">j</Value>
+      <Value description="Multiple score formats">m</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="04" name="Music Parts" description="">
+      <Value description="No parts in hand or not specified">#</Value>
+      <Value description="Instrumental and vocal parts">d</Value>
+      <Value description="Instrumental parts">e</Value>
+      <Value description="Vocal parts">f</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="05" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="06" name="Form of item" description="One-character alphabetic code that indicates the form of material for the item.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic. Storage on a directly accessible tangible recording medium, e.g. disc, tape, playaway device, flashdrive, portable hard drive, etc. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not require the use of a computer (e.g., music compact discs, videodiscs). This code can be used as a generic code for any form of electronic resource. Codes o and q may be used if there is a need to separately identify online and direct electronic resources.">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-12" name="Accompanying matter" description="Up to six one-character alphabetic codes (recorded in alphabetical order) that indicate the contents of program notes and other accompanying material for sound recording, music manuscripts, or notated music. If fewer than six codes are assigned, the codes are left justified and each unused position contains a blank (#).">
+      <Value description="No accompanying matter">#</Value>
+      <Value description="Discography">a</Value>
+      <Value description="Bibliography">b</Value>
+      <Value description="Thematic indez">c</Value>
+      <Value description="Libretto or text">d</Value>
+      <Value description="Bibliography of composer or autor">e</Value>
+      <Value description="Biography of performer or history of ensemble">f</Value>
+      <Value description="Technical and/or historical information on instruments">g</Value>
+      <Value description="Technical information on music">h</Value>
+      <Value description="Historical information">i</Value>
+      <Value description="Ethnological information">k</Value>
+      <Value description="Instrutional materials">r</Value>
+      <Value description="Music">s</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="13-14" name="Literary text for sound recordings " description="Up to two one-character codes (recorded in the order of the following list) that indicate the type of literary text contained in a nonmusical sound recording. If only one code is assigned, it is left justified and the unused position contains a blank (#).">
+      <Value description="Item is a music sound recording">#</Value>
+      <Value description="Autobiography">a</Value>
+      <Value description="Biography">b</Value>
+      <Value description="Conference proceedings">c</Value>
+      <Value description="Drama ">d</Value>
+      <Value description="Essays">e</Value>
+      <Value description="Fiction">f</Value>
+      <Value description="Reporting">g</Value>
+      <Value description="History">h</Value>
+      <Value description="Instruction">i</Value>
+      <Value description="Language instruction">j</Value>
+      <Value description="Comedy">k</Value>
+      <Value description="Lectures, speeches">l</Value>
+      <Value description="Memoirs">m</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Folktales">o</Value>
+      <Value description="Poetry">p</Value>
+      <Value description="Rehearsals">r</Value>
+      <Value description="Sounds">s</Value>
+      <Value description="Interviews">t</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="15" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="16" name="Transposition and arrangement" description="Whether all or part of the item being cataloged is a transposition and/or arrangement of another work.">
+      <Value description="Not arrangement or transposition or not specified">#</Value>
+      <Value description="Transposition">a</Value>
+      <Value description="Arragement">b</Value>
+      <Value description="Both transposed and arranged">c</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="17" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+  </Material>
+  <Material id="CR" name="Continuing Resources" description="">
+    <Position pos="00" name="Form of material" description="">
+      <Value description="Serial / Integrating resource">s</Value>
+    </Position>
+    <Position pos="01" name="Frequency" description="One-character alphabetic code that indicates the frequency of an item; used in conjunction with 008/19 (Regularity).">
+      <Value description="No determinable frequency">#</Value>
+      <Value description="Annual">a</Value>
+      <Value description="Bimonthly">b</Value>
+      <Value description="Semiweekly">c</Value>
+      <Value description="Daily">d</Value>
+      <Value description="Biweekly">e</Value>
+      <Value description="Semiannual">f</Value>
+      <Value description="Biennial">g</Value>
+      <Value description="Triennial">h</Value>
+      <Value description="Three times a week">i</Value>
+      <Value description="Three times a month">j</Value>
+      <Value description="Continuously updated">k</Value>
+      <Value description="Monthly">m</Value>
+      <Value description="Quarterly">q</Value>
+      <Value description="Semimonthly">s</Value>
+      <Value description="Three times a year">t</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Weekly">w</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="02" name="Regularity" description="One-character alphabetic code that indicates the intended regularity of an item; used in conjunction with 008/18 (Frequency).">
+      <Value description="Normalized irregular">n</Value>
+      <Value description="Regular ">r</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Completely irregular">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="03" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="04" name="Type of continuing resource" description="One-character alphabetic code that indicates the type of continuing resource.">
+      <Value description="None of the following">#</Value>
+      <Value description="Updating database">d</Value>
+      <Value description="Updating loose-leaf">l</Value>
+      <Value description="Monographic series">m</Value>
+      <Value description="Newspaper">n</Value>
+      <Value description="Periodical">p</Value>
+      <Value description="Updating web site">w</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="05" name="Form of original item" description="One-character alphabetic code that indicates the form of material in which an item was originally published.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Newspaper format">e</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not requi">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="06" name="Form of item" description="One-character alphabetic code that specifies the form of material for the item being described">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not requi">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07" name="Nature of entire work" description="">
+      <Value description="Not specified">#</Value>
+      <Value description="Calendars">5</Value>
+      <Value description="Comics/graphic novels">6</Value>
+      <Value description="Abstracts/ summaries">a</Value>
+      <Value description="Bibliographies">b</Value>
+      <Value description="Catalogs">c</Value>
+      <Value description="Dictionaries. Also used for a glossary or a gazetteer.">d</Value>
+      <Value description="Encyclopedias">e</Value>
+      <Value description="Handbooks">f</Value>
+      <Value description="Legal articles">g</Value>
+      <Value description="Biography">h</Value>
+      <Value description="Indexes. Index to bibliographical material other than itself. Not used when a publication contains an index to its own content.">i</Value>
+      <Value description="Discographies">k</Value>
+      <Value description="Legislation. Full or partial text of enactments of legislative bodies, published either in statute or in code form, or text of rules and regulations issued by executive or adminitrative agencies.">l</Value>
+      <Value description="Theses">m</Value>
+      <Value description="Survey of literature in a subject area">n</Value>
+      <Value description="Reviews">o</Value>
+      <Value description="Programmed texts">p</Value>
+      <Value description="Filmographies">q</Value>
+      <Value description="Directories">r</Value>
+      <Value description="Statistics">s</Value>
+      <Value description="Technical reports">t</Value>
+      <Value description="Standards/ specifications">u</Value>
+      <Value description="Legal cases and case notes">v</Value>
+      <Value description="Law reorts and digests">w</Value>
+      <Value description="Yearbooks">y</Value>
+      <Value description="Teatries">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="08-10" name="Nature of contents" description="">
+      <Value description="Not specified">#</Value>
+      <Value description="Calendars">5</Value>
+      <Value description="Comics/graphic novels">6</Value>
+      <Value description="Abstracts/ summaries">a</Value>
+      <Value description="Bibliographies">b</Value>
+      <Value description="Catalogs">c</Value>
+      <Value description="Dictionaries. Also used for a glossary or a gazetteer.">d</Value>
+      <Value description="Encyclopedias">e</Value>
+      <Value description="Handbooks">f</Value>
+      <Value description="Legal articles">g</Value>
+      <Value description="Biography">h</Value>
+      <Value description="Indexes. Index to bibliographical material other than itself. Not used when a publication contains an index to its own content.">i</Value>
+      <Value description="Discographies">k</Value>
+      <Value description="Legislation. Full or partial text of enactments of legislative bodies, published either in statute or in code form, or text of rules and regulations issued by executive or adminitrative agencies.">l</Value>
+      <Value description="Theses">m</Value>
+      <Value description="Survey of literature in a subject area">n</Value>
+      <Value description="Reviews">o</Value>
+      <Value description="Programmed texts">p</Value>
+      <Value description="Filmographies">q</Value>
+      <Value description="Directories">r</Value>
+      <Value description="Statistics">s</Value>
+      <Value description="Technical reports">t</Value>
+      <Value description="Standars/specifications">u</Value>
+      <Value description="Legal cases and case notes">v</Value>
+      <Value description="Law reports and digests">w</Value>
+      <Value description="Treaties">z</Value>
+      <Value description="No attempt to code">|||</Value>
+    </Position>
+    <Position pos="11" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="12" name="Conference publication" description="One-character numeric code that indicates whether an item consists of the proceedings, reports, or summaries of a conference.">
+      <Value description="Not a conference publication">0</Value>
+      <Value description="Conference publication">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="13-15" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="16" name="Original alphabet or script of title" description="One-character alphabetic code that indicates the original alphabet or script of the language of the title on the source item upon which the key title (field 222) is based.">
+      <Value description="No alphabet or script given / No key title">#</Value>
+      <Value description="Basic Roman">a</Value>
+      <Value description="Extended Roman">b</Value>
+      <Value description="Cyrillic">c</Value>
+      <Value description="Japanese">d</Value>
+      <Value description="Chinese">e</Value>
+      <Value description="Arabic">f</Value>
+      <Value description="Greek">g</Value>
+      <Value description="Hebrew">h</Value>
+      <Value description="Thai ">i</Value>
+      <Value description="Devanagari ">j</Value>
+      <Value description="Korean">k</Value>
+      <Value description="Tamil ">l</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="17" name="Entry convention" description="One-character numeric code that indicates whether the item was cataloged according to successive entry, latest entry, or integrated entry cataloging conventions.">
+      <Value description="Succesive entry.New bibliographic record is created each time 1) a title changes, or 2) a corporate body used as main entry or uniform title qualifier, changes. The earlier or later title or author/title is recorded in a linking field (field 780/785) on each record.">0</Value>
+      <Value description="Latest entry. Cataloged under its latest (most recent) title or issuing body (pre-AACR cataloging rules). All former titles and/or issuing bodies are given in notes (fields 247, 547, and 550).">1</Value>
+      <Value description="Integrated entry. Cataloged under its latest (most recent) title and/or responsible person or corporate body. Used for integrating resources and electronic serials that do not retain their earlier titles.">2</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="VM" name="Visual Materials" description="">
+    <Position pos="00" name="Form of material" description="">
+      <Value description="Projected medium">g</Value>
+      <Value description="Two-dimensional nonprojectable graphic">k</Value>
+      <Value description="Kit">o</Value>
+      <Value description="Tree- dimensional artifact or naturally occurring object">r</Value>
+    </Position>
+    <Position pos="01-03" name="Running time for motion pictures and videorecordings " description="Three-digit number that indicates the total running time of the motion picture or videorecording. The number is right justified and each unused position contains a zero.">
+      <Value description="Running time exceeds three characters">000</Value>
+      <Value description="Running time">001-999</Value>
+      <Value description="Not applicable">nnn</Value>
+      <Value description="No attempt to code">|||</Value>
+      <Value description="Unknown">                         --- </Value>
+    </Position>
+    <Position pos="04" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="05" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="06-10" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="11" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="12" name="Form of item" description="One-character alphabetic code that indicates the form of material for the item.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic. Storage on a directly accessible tangible recording medium, e.g. disc, tape, playaway device, flashdrive, portable hard drive, etc. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not require the use of a computer (e.g., music compact discs, videodiscs). This code can be used as a generic code for any form of electronic resource. Codes o and q may be used if there is a need to separately identify online and direct electronic resources.">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="13-15" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="16" name="Type of visual material" description="One-character alphabetic code that indicates the type of visual material being described.">
+      <Value description="Art original ">a</Value>
+      <Value description="Kit.Mixture of components from two or more categories, that is, sound recording, maps, filmstrips, etc., no one of which is the predominant constituent of the item.">b</Value>
+      <Value description="Art reproduction">c</Value>
+      <Value description="Diorama ">d</Value>
+      <Value description="Filmstrip">f</Value>
+      <Value description="Game">g</Value>
+      <Value description="Picture">i</Value>
+      <Value description="Graphic">k</Value>
+      <Value description="Technical drawing">l</Value>
+      <Value description="Motion picture">m</Value>
+      <Value description="Chart">n</Value>
+      <Value description="Flash card">o</Value>
+      <Value description="Microscope slide">p</Value>
+      <Value description="Model">q</Value>
+      <Value description="Realia ">r</Value>
+      <Value description="Slide">s</Value>
+      <Value description="Transparency">t</Value>
+      <Value description="Videorecording">v</Value>
+      <Value description="Toy">w</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="17" name="Technique" description="One-character alphabetic code that indicates the technique used in creating motion in motion pictures or videorecordings.">
+      <Value description="Animation">a</Value>
+      <Value description="Animation and live action">c</Value>
+      <Value description="Live action">l</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="MX" name="Mixed Materials" description="">
+    <Position pos="00" name="Form of material" description="">
+      <Value description="Mixed material">p</Value>
+    </Position>
+    <Position pos="01-05" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="06" name="Form of item" description="One-character alphabetic code that specifies the form of material for the item being described">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not requi">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-17" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+  </Material>
+</Tagfield>
old mode 100644 (file)
new mode 100755 (executable)
index 9dddccb..9638287
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Cataloging &rsaquo; 008 builder</title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-</head>
-<body style="padding:1em;">
-<h3> 008 Fixed-length data elements--General information</h3>
-<form name="f_pop" onsubmit="report()" action="">
-<input type="hidden" name="plugin_name" value="marc21_field_008.pl" />
-<table>
-       <tr>
-               <td>1-5 Date entered on file (auto-filled)</td>
-               <td><input type="text" name="f1" maxlength="6" size="7" value="<!-- TMPL_VAR name="f1" -->" /></td>
-       </tr>
-       <tr>
-               <!-- 06 Type of date / Publication status -->
-               <td><label for="f6">06- Type of date / Publication Status</label></td>
-               <td>
-                       <!-- NO DATE; B.C. DATE -->
-
-                       <select name="f6" id="f6" size="1">
-                       <!-- TMPL_IF name="f60" -->
-                                <option value=" " selected="selected">#- Blank</option>
-                        <!-- TMPL_ELSE -->
-                                <option value=" ">#- Blank</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f6b" -->
-                               <option value="b" selected="selected">b- B.C. Date</option>
-                       <!-- TMPL_ELSE -->
-                               <option value="b">b- B.C. Date</option>
-                       <!-- /TMPL_IF -->
-
-                       <!-- SINGLE DATE -->
-                       <!-- TMPL_IF name="f6e" -->
-                                <option value="e" selected="selected">e- Detailed date</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="e">e- Detailed date</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f6s" -->
-                                <option value="s" selected="selected">s- Single date</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="s">s- Single date</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- MULTIPLE DATES -->
-                       <!-- TMPL_IF name="f6i" -->
-                                <option value="i" selected="selected">i- Inclusive dates of collection</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="i">i- Inclusive dates of collection</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f6k" -->
-                                <option value="k" selected="selected">k- Range of years of bulk collection</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="k">k- Range of years of bulk collection</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f6m" -->
-                                <option value="m" selected="selected">m- Multiple dates</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="m">m- Multiple dates</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f6p" -->
-                                <option value="p" selected="selected">p- Distribution/production date</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="p">p- Distribution/production date</option>
-                       <!-- /TMPL_IF -->
-       
-                       <!-- TMPL_IF name="f6r" -->
-                               <option value="r" selected="selected">r- Reprint/original date</option>
-                       <!-- TMPL_ELSE -->
-                               <option value="r">r- Reprint/original date</option>
-                       <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f6t" -->
-                                <option value="t" selected="selected">t- Publication date and copyright date</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="t">t- Publication date and copyright date</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- UNKNOWN DATES -->
-                       <!-- TMPL_IF name="f6n" -->
-                                <option value="n" selected="selected">n- Dates unknown</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="n">n- Dates unknown</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f6q" -->
-                                <option value="q" selected="selected">q- Questionable date</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="q">q- Questionable date</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f6c" -->
-                                <option value="c" selected="selected">c- Serial item currently published</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="c">c- Serial item currently published</option>
-                        <!-- /TMPL_IF -->
-                               
-                       <!-- TMPL_IF name="f6d" -->
-                                <option value="d" selected="selected">d- Serial item ceased publication (Dead status)</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="d">d- Serial item ceased publication (Dead status)</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f6u" -->
-                                <option value="u" selected="selected">u- Serial item status unknown</option>
-                        <!-- TMPL_ELSE -->
-                                <option value="u">u- Serial item status unknown</option>
-                        <!-- /TMPL_IF -->
-
-
-       
-                       </select>
-               </td>
-       </tr>
-       <tr>
-               <td><label for="f710">7-10 Date1 / Beginning date of publication</label> </td>
-               <td>
-                       <input type="text" name="f710" id="f710" size="4" maxlength="4" value="<!-- TMPL_VAR NAME="f710" -->"/>
-               </td>
-       </tr>
-       <tr>
-                <td><label for="f1114">11-14 Date2 / ending date of publication</label> </td>
-                <td>
-                        <input type="text" name="f1114" id="f1114" size="4" maxlength="4" value="<!-- TMPL_VAR NAME="f1114" -->"/>                </td>
-        </tr>
-
-       <tr>
-                <td><label for="f1517">15-17 Place of publication, production, or execution</label> See <a href="http://www.loc.gov/marc/countries/countries_code.html">MARC Code List for Countries</a> </td>
-                <td>
-                        <input type="text" name="f1517" id="f1517" size="3"  maxlength="3" value="<!-- TMPL_VAR NAME="f1517" -->"/>
-                </td>
-        </tr>
-        <tr>
-                <td><label for="f1821">18-21 Illustrations</label> </td>
-               <td><input type="text" name="f1821" id="f1821" size="4"  maxlength="4" value="<!-- TMPL_VAR NAME="f1821" -->"/></td>
-        </tr>
-       <tr>
-                <!-- 22 Target Audience -->
-                <td><label for="f22">22- Target Audience</label></td>
-                <td>                        
-                <select name="f22" id="f22" size="1">
-
-                        <!-- TMPL_IF name="f22|" -->
-                        <option value="|" selected="selected">|- Default</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="|">|- Default</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f220" -->
-                        <option value=" " selected="selected">#- Unknown or not specified</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- Unknown or not specified</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f22a" -->
-                         <option value="a" selected="selected">a- Preschool</option>
-                       <!-- TMPL_ELSE -->
-                       <option value="a">a- Preschool</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f22b" -->
-                         <option value="b" selected="selected">b- Primary</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="b">b- Primary</option>
-                        <!-- /TMPL_IF -->      
-
-                       <!-- TMPL_IF name="f22c" -->
-                         <option value="c" selected="selected">c- Elementary and junior high</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">c- Elementary and junior high</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f22d" -->
-                         <option value="d" selected="selected">d- Secondary (senior high)</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Secondary (senior high)</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f22e" -->
-                         <option value="e" selected="selected">e- Adult</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="e">e- Adult</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f22f" -->
-                         <option value="f" selected="selected">f- Specialized</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Specialized</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f22g" -->
-                         <option value="g" selected="selected">g- General</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="g">g- General</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f22j" -->
-                         <option value="j" selected="selected">j- Juvenile</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="j">j- Juvenile</option>
-                        <!-- /TMPL_IF -->
-               </select>
-               </td>
-       </tr>
-       <tr>
-                <!-- 23 Form of an item -->
-                <td><label for="f23">23- Form of an item</label></td>
-                <td>
-                <select name="f23" id="f23" size="1">
-
-                        <!-- TMPL_IF name="f230" -->
-                        <option value=" " selected="selected">#- None of the following</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- None of the following</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f23a" -->
-                        <option value="a" selected="selected">a- Microfilm</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="a">a- Microfilm</option>
-                        <!-- /TMPL_IF -->
-                       
-                       <!-- TMPL_IF name="f23b" -->
-                        <option value="b" selected="selected">b- Microfiche</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="b">b- Microfiche</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f23c" -->
-                        <option value="c" selected="selected">a- Microopaque</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">a- Microopaque</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f23d" -->
-                        <option value="d" selected="selected">d- Large Print</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Large Print</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f23f" -->
-                        <option value="f" selected="selected">f- Braille</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Braille</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f23r" -->
-                        <option value="r" selected="selected">r- Regular print reproduction</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="r">r- Regular print reproduction</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f23s" -->
-                        <option value="s" selected="selected">s- Electronic</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="s">s- Electronic</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f23!" -->
-                        <option value="!" selected="selected">!- No attempt to code</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="!">!- No attempt to code</option>
-                        <!-- /TMPL_IF -->
-               </select>
-               </td>
-       </tr>
-       <tr>
-                <td><label for="f2427">24-27 Nature of contents</label> </td>
-                <td>
-                        <input type="text" name="f2427" id="f2427" size="4" maxlength="4" value="<!-- TMPL_VAR NAME="f2427" -->"/>                </td>
-        </tr>
-        <tr>
-                <td><label for="f28">28- Government Publication</label></td>
-                <td>
-                <select name="f28" id="f28" size="1">                                    
-                        <!-- TMPL_IF name="f280" -->
-                        <option value=" " selected="selected">#- Not a government publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- Not a government publication</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f28a" -->
-                        <option value="a" selected="selected">a- Autonomous or semi-autonomous component</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="a">a- Autonomous or semi-autonomous component</option>
-                        <!-- /TMPL_IF -->
 
-                        <!-- TMPL_IF name="f28c" -->
-                        <option value="c" selected="selected">c- Multilocal</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">c- Multilocal</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f28f" -->
-                        <option value="f" selected="selected">f- Federal/national</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Federal/national</option>
-                        <!-- /TMPL_IF -->
-
-
-                        <!-- TMPL_IF name="f28i" -->
-                        <option value="i" selected="selected">i- International intergovernmental</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="i">i- International intergovernmental</option>
-                        <!-- /TMPL_IF -->
-
-
-                        <!-- TMPL_IF name="f28l" -->
-                        <option value="l" selected="selected">l- Local</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="l">l- Local</option>
-                        <!-- /TMPL_IF -->
-
-                       
-                        <!-- TMPL_IF name="f28m" -->
-                        <option value="m" selected="selected">m- Multistate</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="m">m- Multistate</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f28o" -->
-                        <option value="o" selected="selected">o- Government publication - level undetermined</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="o">o- Government publication - level undetermined</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f28s" -->
-                        <option value="s" selected="selected">s- State, provincial,territorial,dependent,etc.</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="s">s- State,provincial,territorial,dependent,etc.</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f28u" -->
-                        <option value="u" selected="selected">u- Unknown if item is government publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="u">u- Unknown if item is government publication</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f28z" -->
-                        <option value="z" selected="selected">z- Other</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="z">z- Other</option>
-                        <!-- /TMPL_IF -->
-               </select>
-               </td>
-       </tr>
-        <tr>
-                <td><label for="f29">29- Conference publication</label></td>
-                <td>
-                <select name="f29" id="f29" size="1">
-                        <!-- TMPL_IF name="f290" -->
-                        <option value="0" selected="selected">0- Not a conference publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- Not a conference publication</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f291" -->
-                        <option value="1" selected="selected">1- Conference publication</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Conference publication</option>
-                        <!-- /TMPL_IF -->
-
-               </select>
-               </td>
-       </tr>
-       <tr>
-                <td><label for="f30">30- Festschrift</label></td>
-                <td>
-                <select name="f30" id="f30" size="1">
-                        <!-- TMPL_IF name="f300" -->
-                        <option value="0" selected="selected">0- Not a festschrift</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- Not a festschrift</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f301" -->
-                        <option value="1" selected="selected">1- Festschrift</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Festschrift</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-        </tr>
-
-        <tr>
-                <td><label for="f31">31- Index</label></td>
-                <td>
-                <select name="f31" id="f31" size="1">
-                        <!-- TMPL_IF name="f31|" -->
-                        <option value="|" selected="selected">|- Default</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="|">|- Default</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f310" -->
-                        <option value="0" selected="selected">0- No Index</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- No Index</option>
-                        <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="f311" -->
-                        <option value="1" selected="selected">1- Index present</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Index present</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-               </tr>
-               <tr><td>32 Undefined</td><td></td>
-               </tr>
-               <tr>
-                <td><label for="f33">33- Literary form</label></td>
-                <td>
-                <select name="f33" id="f33" size="1">
-                        <!-- TMPL_IF name="f330" -->
-                        <option value="0" selected="selected">0- Not fiction</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="0">0- Not fiction</option>
-                        <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="f331" -->
-                        <option value="1" selected="selected">1- Fiction</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="1">1- Fiction</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f33c" -->
-                        <option value="c" selected="selected">c- Comic strips</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">c- Comic strips</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f33d" -->
-                        <option value="d" selected="selected">d- Dramas</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Dramas</option>
-                        <!-- /TMPL_IF -->
-
-
-                        <!-- TMPL_IF name="f33e" -->
-                        <option value="e" selected="selected">e- Essays</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="e">e- Essays</option>
-                        <!-- /TMPL_IF -->
-
-                       
-                        <!-- TMPL_IF name="f33f" -->
-                        <option value="f" selected="selected">f- Novels</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="f">f- Novels</option>
-                        <!-- /TMPL_IF -->
-
-                       
-                        <!-- TMPL_IF name="f33h" -->
-                        <option value="h" selected="selected">h- Humor,satires,etc.</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="h">h- Humor,satires,etc.</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f33i" -->
-                        <option value="i" selected="selected">i- Letters</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="i">i- Letters</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f33j" -->
-                        <option value="j" selected="selected">j- Short stories</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="j">j- Short stories</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f33m" -->
-                        <option value="m" selected="selected">m- Mixed forms</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="m">m- Mixed forms</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f33p" -->
-                        <option value="p" selected="selected">p- Poetry</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="p">p- Poetry</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f33s" -->
-                        <option value="s" selected="selected">s- Speeches</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="s">s- Speeches</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f33u" -->
-                        <option value="u" selected="selected">u- Unknown</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="u">u- Unknown</option>
-                        <!-- /TMPL_IF -->
-
-
-
-                </select>
-                </td>
-        </tr>
-       <tr>
-                <td><label for="f34">34- Biography</label></td>
-                <td>
-                <select name="f34" id="f34" size="1">
-                        <!-- TMPL_IF name="f340" -->
-                        <option value=" " selected="selected">#- No biographical material</option>                              <!-- TMPL_ELSE -->
-                        <option value=" ">#- No biographical material</option>
-                        <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="f34a" -->
-                        <option value="a" selected="selected">a- Autobiography</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="a">a- Autobiography</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f34b" -->
-                        <option value="b" selected="selected">b- Individual biography</option>                              <!-- TMPL_ELSE -->
-                        <option value="b">b- Individual biography</option>
-                        <!-- /TMPL_IF -->
-
-                        <!-- TMPL_IF name="f34c" -->
-                        <option value="c" selected="selected">c- Collective biography</option>                              <!-- TMPL_ELSE -->
-                        <option value="c">c- Collective biography</option>
-                        <!-- /TMPL_IF -->
-                       
-                        <!-- TMPL_IF name="f34d" -->
-                        <option value="d" selected="selected">d- Contains biographical information</option>                              <!-- TMPL_ELSE -->
-                        <option value="d">d- Contains biographical information</option>
-                        <!-- /TMPL_IF -->
-                </select>
-                </td>
-        </tr>
-
-        <tr>
-
-                <td><label for="f3537">35-37 Language</label> See <a href="http://www.loc.gov/marc/languages/language_code.html">MARC Code List for Languages</a></td>
-                <td>
-                        <input type="text" name="f3537" id="f3537" size="4"  maxlength="4" value="<!-- TMPL_VAR NAME="f3537" -->"/>
-                </td>
-        </tr>
-       <tr>
-                <td><label for="f38">38- Modified Record</label></td>
-                <td>                
-               <select name="f38" id="f38" size="1">                                           
-                       <!-- TMPL_IF name="f380" -->
-                        <option value=" " selected="selected">#- Not modified</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- Not modified</option>
-                        <!-- /TMPL_IF -->
-                       
-                       <!-- TMPL_IF name="f38s" -->
-                        <option value="s" selected="selected">s- Shortened</option>
-                       <!-- TMPL_ELSE -->
-                        <option value="s">s- Shortened</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f38d" -->
-                        <option value="d" selected="selected">d- Dashed-on information omitted</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Dashed-on information omitted</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f38x" -->
-                        <option value="x" selected="selected">x- Missing characters</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="x">x- Missing characters</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f38r" -->
-                        <option value="r" selected="selected">r- Completely romanized/printed cards in script</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="r">r- Completely romanized/printed cards in script</option>
-                        <!-- /TMPL_IF -->
-
-                       <!-- TMPL_IF name="f38o" -->
-                        <option value="o" selected="selected">o- Completely romainzed/printed cards romanized</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="o">o- Completely romanized/printed cards romanized</option>
-                        <!-- /TMPL_IF -->
-               </select>
+<script type="text/javascript" src='<!-- TMPL_VAR name="themelang" -->/js/xmlControlfield.js'></script>
+<script type="text/javascript">
+    var objXmlControlField;
+    var tr_result;
+    var h4_result;
+
+    function loadXmlValues()
+    {
+        <!-- TMPL_IF NAME="errorXml" -->
+        alert("<!--TMPL_VAR Name="errorXml"-->");
+        <!-- TMPL_ELSE -->
+        var form = document.f_pop;
+        h4_result = document.getElementById("h4_result");
+        tr_result = document.getElementById("tr_result");
+        objXmlControlField = new xmlControlField('<!--TMPL_VAR Name="tagfield"-->', 'f_pop', document.getElementById('material_type'), document.getElementById('table_material_types'), 'h4_result', 'tr_result', '');
+        objXmlControlField.loadXmlValues();
+        renderResult(tr_result, (form.result.value != "")?form.result.value:returnValueParam("result"));
+        <!-- /TMPL_IF -->
+    }//loadXmlValues
+
+    function changeTypeofMaterial(form)
+    {
+        if (form.material_type.options[form.material_type.selectedIndex].value != "" && confirm('Show values for \'' + form.material_type.options[form.material_type.selectedIndex].text + '\' material type?')) {
+            objXmlControlField.setIdMaterial(form.material_type.options[form.material_type.selectedIndex].value);
+            objXmlControlField.renderTemplate();
+            renderResult(tr_result, form.result.value, true);
+        }
+    }//changeTypeofMaterial
+</script>
 
-                </td>
-        </tr>
-<tr>
-                <td><label for="f39">39- Cataloging source</label></td>
-                <td>
-                <select name="f39" id="f39" size="1">                                    
-                        <!-- TMPL_IF name="f390" -->
-                        <option value=" " selected="selected">#- National bibliographic agency</option>
-                        <!-- TMPL_ELSE -->
-                        <option value=" ">#- National bibliographic agency</option>
-                        <!-- /TMPL_IF -->
+</head>
+<body style="padding:1em;" onload="loadXmlValues()">
+<h3> 008 Fixed-length data elements--Additional material characteristics--General information</h3>
 
-                        <!-- TMPL_IF name="f39c" -->
-                        <option value="c" selected="selected">c- Cooperative cataloging program</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="c">c- Cooperative cataloging program</option>
-                        <!-- /TMPL_IF -->
-                       <!-- TMPL_IF name="f39d" -->
-                        <option value="d" selected="selected">d- Other</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="d">d- Other</option>
-                        <!-- /TMPL_IF -->
+<table border="1">
+    <tr id="tr_result">
+    </tr>
+</table>
+<h4 id="h4_result">&quot;<!--TMPL_VAR Name="result"-->&quot;</h4>
 
-                       <!-- TMPL_IF name="f39u" -->
-                        <option value="u" selected="selected">u- Unknown</option>
-                        <!-- TMPL_ELSE -->
-                        <option value="u">u- Unknown</option>
-                        <!-- /TMPL_IF -->
-               </select>
-                </td>
-        </tr>
+<form name="f_pop" id="f_pop" onsubmit="report()" action="">
+<input type="hidden" name="plugin_name" value="marc21_field_008.pl" />
+<input type="hidden" id="<!-- TMPL_VAR NAME='index'-->" name="index" value="<!-- TMPL_VAR NAME='index'-->" />
+<input type="hidden" name="result" id="result" value="<!--TMPL_VAR Name="result"-->" />
+<table id="table_material_types">
+    <tr id="tr_material_types">
+        <td><label for="material_type" title="Select a type of material to specify the variable values">Type of Material</label></td>
+        <td>
+            <select name="material_type" id="material_type" title="Select a type of material to specify the variable values" onchange="changeTypeofMaterial(this.form)">
+                <option value="">Select a type of material</option>
+            </select>
+        </td>
+    </tr>
 
 </table>
 <fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
 </form>
 <script type="text/javascript">//<![CDATA[
 
-// Pad the string with spaces so that it is 4 characters long.
-// Also, truncate strings that are longer than 4 characters.
-function pad4(s) {
-       var pad = "";
-       if (s.length < 4) {
-               var padLength = 4 - s.length;
-               for (var i = 0; i < 4 - s.length; i++) {
-                       pad += " ";
-               }
-               s += pad;
-       } else {
-               s = s.substring(0, 4);
-       }
-       return s;
-}
-
 function report() {
-            var doc   = opener.document; 
-            var field = doc.getElementById("<!-- TMPL_VAR NAME='index'-->");
-            field.value = 
-                       document.f_pop.f1.value+
-                       document.f_pop.f6.value+
-                       // bug 2563 {
-                       ( document.f_pop.f710.value.match(/^\s*$/)  ? "    " : pad4(document.f_pop.f710.value)  )+
-                       ( document.f_pop.f1114.value.match(/^\s*$/) ? "    " : pad4(document.f_pop.f1114.value) )+
-                       // }
-                       //MR
-                       (document.f_pop.f1517.value+"   ").substr(0,3)+
-                       (document.f_pop.f1821.value+"    ").substr(0,4)+
-                       document.f_pop.f22.value+
-                       document.f_pop.f23.value+
-                       (document.f_pop.f2427.value+"    ").substr(0,4)+
-                       document.f_pop.f28.value+
-                       document.f_pop.f29.value+
-                       document.f_pop.f30.value+
-                       document.f_pop.f31.value+ ' '+
-                       document.f_pop.f33.value+
-                       document.f_pop.f34.value+
-                       //MR
-                       (document.f_pop.f3537.value+"   ").substr(0,3)+
-                       document.f_pop.f38.value+
-                       document.f_pop.f39.value;
-               self.close();
-               return false;
-       }
-       //]]>
+        var doc   = opener.document;
+        var field = doc.getElementById("<!-- TMPL_VAR NAME='index'-->");
+        field.value = document.getElementById("result").value;
+        self.close();
+        return false;
+    }
+    //]]>
 </script>
 
 <!-- TMPL_INCLUDE NAME="popup-bottom.inc" -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_008.xml
new file mode 100755 (executable)
index 0000000..e4f4869
--- /dev/null
@@ -0,0 +1,1298 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Tagfield tag="008" xmlns="http://koha-community.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "./marc21_field_CF.xsd">
+  <Material id="BKS" name="Books" description="">
+    <Position pos="00-05" name="Date entered on file" description=""/>
+    <Position pos="06" name="Type of date/ Publication status" description="">
+      <Value description="No dates given; B.C. date involved">b</Value>
+      <Value description="Continuing resource currently published">c</Value>
+      <Value description="Continuing resource ceased publication">d</Value>
+      <Value description="Detailed date">e</Value>
+      <Value description="Inclusive dates of colletion">i</Value>
+      <Value description="Range of years of bulk of collection">k</Value>
+      <Value description="Multiple dates">m</Value>
+      <Value description="Dates unknown">n</Value>
+      <Value description="Date of distribution/ release/ issue and production/ recording session when different">p</Value>
+      <Value description="Questionable date">q</Value>
+      <Value description="Reprint / reissue date and original date">r</Value>
+      <Value description="Single know date / probable date">s</Value>
+      <Value description="Publication date and copyright date">t</Value>
+      <Value description="Continuings resource status unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Date 1" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="11-14" name="Date 2" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="15-17" url="http://www.loc.gov/marc/countries/countries_code.html" urltext="MARC Code List for Countries" name="Place of publication, production, or execution" description="">
+      <Value description="Various places">vp# </Value>
+      <Value description="No place, unknown, or undetermined">xx#</Value>
+      <Value description="Two-character alphabetic code">[aa#]</Value>
+      <Value description="Three-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="18-21" name="Illustrations" description="Up to four (4) one-character alphabetic codes (recorded in alphabetical order) that indicate the presence of types of illustrations in the item. If fewer than four alphabetic codes are assigned, the codes are left justified and unused positions contain blanks (#)">
+      <Value description="No illustrations">#</Value>
+      <Value description="Illustrations">a</Value>
+      <Value description="Maps">b</Value>
+      <Value description="Portraits">c</Value>
+      <Value description="Charts">d</Value>
+      <Value description="Plans">e</Value>
+      <Value description="Plates">f</Value>
+      <Value description="Music">g</Value>
+      <Value description="Facsimiles">h</Value>
+      <Value description="Coats of arms">i</Value>
+      <Value description="Genealogical tables">j</Value>
+      <Value description="Forms">k</Value>
+      <Value description="Samples">l</Value>
+      <Value description="Phonodisc, phonowire, etc">m</Value>
+      <Value description="Photographs">o</Value>
+      <Value description="Illuminations">p</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="22" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="23" name="Form of item" description="One character alphabetic code that specifies the form of material for the item">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille">f</Value>
+      <Value description="Online">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="24-27" name="Nature of contents" description="Up to four one-character codes that indicate whether a significant part of the item is or contains certain types of material. If fewer than four codes are assigned, the codes are left justified and unused positions contain blanks (#)">
+      <Value description="No specified nature of contents">#</Value>
+      <Value description="Offprints.Publication that originally was published as an article in a monograph or a serial and that is also issued separately and independently. Includes prepints and postprints">2</Value>
+      <Value description="Calendars">5</Value>
+      <Value description="Comics/graphic novels">6</Value>
+      <Value description="Abstracts/summaries. Abstracts or summaries of other publications. Not used when a publication includes an abstract or summary of its own content.">a</Value>
+      <Value description="Bibliographies">b</Value>
+      <Value description="Catalogs">c</Value>
+      <Value description="Dictionaries. Also used for a glossary or a gazetteer.">d</Value>
+      <Value description="Encyclopedias">e</Value>
+      <Value description="Handbooks">f</Value>
+      <Value description="Legal articles">g</Value>
+      <Value description="Indexes. Index to bibliographical material other than itself. Not used when a publication contains an index to its own content.">i</Value>
+      <Value description="Patent document">j</Value>
+      <Value description="Discographies">k</Value>
+      <Value description="Legislation. Full or partial text of enactments of legislative bodies, published either in statute or in code form, or text of rules and regulations issued by executive or adminitrative agencies.">l</Value>
+      <Value description="Theses. Thesis, dissertation, or work identified as having been created to satisfy the requirements for an academic certification or degree.">m</Value>
+      <Value description="Surveys of literature in a subject area. Composed entirely of authored surveys that summarize what has been published about a subject.">n</Value>
+      <Value description="Reviews. Devoted entirely to critical reviews of published or performed works (e.g., books, films, sound recordings, theater)">o</Value>
+      <Value description="Programmed texts">p</Value>
+      <Value description="Filmographies. Entire item, or a significant part of it, is a filmography or other  bibliografy of moving images.">q</Value>
+      <Value description="Directories">r</Value>
+      <Value description="Statistics">s</Value>
+      <Value description="Technical reports">t</Value>
+      <Value description="Standars/specifications">u</Value>
+      <Value description="Legal cases and case notes">v</Value>
+      <Value description="Law reports and digests">w</Value>
+      <Value description="Yearbooks">y</Value>
+      <Value description="Treaties. Treaty or accord negotiated between two or more parties to settle a disagreement, establish a relationship, gran rights,etc.">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="28" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="29" name="Conference publication" description="One-character code that indicates whether the item consists of the proceedings, reports, or summaries of a conference.">
+      <Value description="Not a conference publication">0</Value>
+      <Value description="Conference">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="30" name="Festschrift" description="One-character code that indicates whether the item is a festschrift">
+      <Value description="Not a festschrift">0</Value>
+      <Value description="Festschrift">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="31" name="Index" description="One-character numeric code that indicates whether the item includes an index to its own contents">
+      <Value description="No index">0</Value>
+      <Value description="Index present">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="32" name="Undefined" description="Contains a blank (#) or a fill character (|)."/>
+    <Position pos="33" name="Literary form" description="One-character code used to indicate the literary form of an item. Numeric codes 0 and 1 provide a generic identification of whether or not the item is a work of fiction. Alphabetic codes may be used to identify specific literary forms.">
+      <Value description="Not fiction (not further specified)">0</Value>
+      <Value description="Fiction (not further specified)">1</Value>
+      <Value description="Dramas">d</Value>
+      <Value description="Essays">e</Value>
+      <Value description="Novels">f</Value>
+      <Value description="Humor, satires, etc.">h</Value>
+      <Value description="Letters. Single letter or collection of correspondence">i</Value>
+      <Value description="Short stories. Short story or collection of short stories.">j</Value>
+      <Value description="Mixed forms. Represents a variety of literary forms (e.g., poetry and short stories)">m</Value>
+      <Value description="Poetry">p</Value>
+      <Value description="Speeches">s</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="34" name="Biography" description="One-character alphabetic code that indicates whether or not an item contains biographical material, and if so, what the biographical characteristics are.">
+      <Value description="No biographical material">#</Value>
+      <Value description="Autobiography">a</Value>
+      <Value description="Individual biography">b</Value>
+      <Value description="Collective biography">c</Value>
+      <Value description="Contains biographical information">d</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="35-37" url="http://www.loc.gov/marc/languages/language_code.html" urltext="MARC Code List for Languages" name="Language" description="">
+      <Value description="No information provided">###</Value>
+      <Value description="Multiple languages">mul</Value>
+      <Value description="Sign languages">sgn</Value>
+      <Value description="Undetermined">und</Value>
+      <Value description="No linguistic content">zxx</Value>
+      <Value description="Tree-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="38" name="Modified record" description="One-character code that indicates whether any data in a bibliographic record is a modification of information that appeared on the item being cataloged or that was intended to be included in the MARC record.">
+      <Value description="No modified">#</Value>
+      <Value description="Dashed-on information omitted">d</Value>
+      <Value description="Completely romanized/printed cards romanized">o</Value>
+      <Value description="Completely romanized/printed cards in script">r</Value>
+      <Value description="Shortened">s</Value>
+      <Value description="Missing characters">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="39" name="Cataloging source" description="">
+      <Value description="National bibliographic agency">#</Value>
+      <Value description="Cooperative cataloging program">c</Value>
+      <Value description="Other">d</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="CF" name="Computer Files" description="">
+    <Position pos="00-05" name="Date entered on file" description=""/>
+    <Position pos="06" name="Type of date/ Publication status" description="">
+      <Value description="No dates given; B.C. date involved">b</Value>
+      <Value description="Continuing resource currently published">c</Value>
+      <Value description="Continuing resource ceased publication">d</Value>
+      <Value description="Detailed date">e</Value>
+      <Value description="Inclusive dates of colletion">i</Value>
+      <Value description="Range of years of bulk of collection">k</Value>
+      <Value description="Multiple dates">m</Value>
+      <Value description="Dates unknown">n</Value>
+      <Value description="Date of distribution/ release/ issue and production/ recording session when different">p</Value>
+      <Value description="Questionable date">q</Value>
+      <Value description="Reprint / reissue date and original date">r</Value>
+      <Value description="Single know date / probable date">s</Value>
+      <Value description="Publication date and copyright date">t</Value>
+      <Value description="Continuings resource status unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Date 1" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="11-14" name="Date 2" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="15-17" url="http://www.loc.gov/marc/countries/countries_code.html" urltext="MARC Code List for Countries" name="Place of publication, production, or execution" description="">
+      <Value description="Various places">vp# </Value>
+      <Value description="No place, unknown, or undetermined">xx#</Value>
+      <Value description="Two-character alphabetic code">[aa#]</Value>
+      <Value description="Three-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="18-21" name="Undefined" description="Each one contains a blank (#) or a fill character (|)"/>
+    <Position pos="22" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="23" name="Form of item" description="One-character alphabetic code that specifies the form of material for the item">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Online">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="24-25" name="Undefined" description="Two undefined character positions; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="26" name="Type of computer file " description="One-character alphabetic code that indicates the type of computer file described in the bibliographic record">
+      <Value description="Numeric data">a</Value>
+      <Value description="Computer program">b</Value>
+      <Value description="Representational. Pictorial or graphic information that can be manipulated in conjunction with other types of files to produce graphic patterns that can be used to interpret and give meaning to the information. Does not include a document in image format.">c</Value>
+      <Value description="Document">d</Value>
+      <Value description="Bibliographic data">e</Value>
+      <Value description="Font">f</Value>
+      <Value description="Game">g</Value>
+      <Value description="Sound">h</Value>
+      <Value description="Interactive multimedia">i</Value>
+      <Value description="Online system or service">j</Value>
+      <Value description="Combination">m</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="27" name="Undefined" description="One-character code that contains a blank (#) or a fill character (|)"/>
+    <Position pos="28" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="29-34" name="Undefined" description="Six undefined character positions; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="35-37" url="http://www.loc.gov/marc/languages/language_code.html" urltext="MARC Code List for Languages" name="Language" description="">
+      <Value description="No information provided">###</Value>
+      <Value description="Multiple languages">mul</Value>
+      <Value description="Sign languages">sgn</Value>
+      <Value description="Undetermined">und</Value>
+      <Value description="No linguistic content">zxx</Value>
+      <Value description="Tree-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="38" name="Modified record" description="One-character code that indicates whether any data in a bibliographic record is a modification of information that appeared on the item being cataloged or that was intended to be included in the MARC record.">
+      <Value description="No modified">#</Value>
+      <Value description="Dashed-on information omitted">d</Value>
+      <Value description="Completely romanized/printed cards romanized">o</Value>
+      <Value description="Completely romanized/printed cards in script">r</Value>
+      <Value description="Shortened">s</Value>
+      <Value description="Missing characters">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="39" name="Cataloging source" description="">
+      <Value description="National bibliographic agency">#</Value>
+      <Value description="Cooperative cataloging program">c</Value>
+      <Value description="Other">d</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="MP" name="Maps" description="">
+    <Position pos="00-05" name="Date entered on file" description=""/>
+    <Position pos="06" name="Type of date/ Publication status" description="">
+      <Value description="No dates given; B.C. date involved">b</Value>
+      <Value description="Continuing resource currently published">c</Value>
+      <Value description="Continuing resource ceased publication">d</Value>
+      <Value description="Detailed date">e</Value>
+      <Value description="Inclusive dates of colletion">i</Value>
+      <Value description="Range of years of bulk of collection">k</Value>
+      <Value description="Multiple dates">m</Value>
+      <Value description="Dates unknown">n</Value>
+      <Value description="Date of distribution/ release/ issue and production/ recording session when different">p</Value>
+      <Value description="Questionable date">q</Value>
+      <Value description="Reprint / reissue date and original date">r</Value>
+      <Value description="Single know date / probable date">s</Value>
+      <Value description="Publication date and copyright date">t</Value>
+      <Value description="Continuings resource status unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Date 1" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="11-14" name="Date 2" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="15-17" url="http://www.loc.gov/marc/countries/countries_code.html" urltext="MARC Code List for Countries" name="Place of publication, production, or execution" description="">
+      <Value description="Various places">vp# </Value>
+      <Value description="No place, unknown, or undetermined">xx#</Value>
+      <Value description="Two-character alphabetic code">[aa#]</Value>
+      <Value description="Three-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="18-21" name="Relief" description="Up to four one-character alphabetic codes that indicate the relief type specified on the item. Codes are recorded in order of their importance to the described item. If fewer than four codes are assigned, the codes are left justified and each unused position contains a blank (#).">
+      <Value description="No relief shown"># </Value>
+      <Value description="Contours">a</Value>
+      <Value description="Shading">b</Value>
+      <Value description="Gradient and bathymetric tints">c</Value>
+      <Value description="Hachures">d</Value>
+      <Value description="Bathymetry/soundings">e</Value>
+      <Value description="Form lines">f</Value>
+      <Value description="Spot heights">g</Value>
+      <Value description="Pictorially">i</Value>
+      <Value description="Land forms">j</Value>
+      <Value description="Bathymetry/ isolines">k</Value>
+      <Value description="Rock drawings">m</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="22-23" name="Projection" description="Two-character alphabetic code that indicates the projection used in producing the item.">
+      <Value description="Projection not specified">##</Value>
+      <Value description="Aitoff ">aa</Value>
+      <Value description="Gnomic">ab</Value>
+      <Value description="Lambert's azimuthal equal area">ac</Value>
+      <Value description="Orthographic">ad</Value>
+      <Value description="Azimuthal equidistant">ae</Value>
+      <Value description="Stereographic">af</Value>
+      <Value description="General vertical near-sided">ag</Value>
+      <Value description="Modified stereographic for Alaska">am</Value>
+      <Value description="Chamberlin trimetric">an</Value>
+      <Value description="Polar stereographic">ap</Value>
+      <Value description="Azimuthal, specific type unknown">au</Value>
+      <Value description="Azimutal, other">az</Value>
+      <Value description="Gall ">ba</Value>
+      <Value description="Goode's homolographic">bb</Value>
+      <Value description="Lambert's cylindrical equal area">bc</Value>
+      <Value description="Mercator">bd</Value>
+      <Value description="Miller ">be</Value>
+      <Value description="Mollweide ">bf</Value>
+      <Value description="Sinusoidal ">bg</Value>
+      <Value description="Transverse Mercator">bh</Value>
+      <Value description="Gauss-Kruger ">bi</Value>
+      <Value description="Equirectangular ">bj</Value>
+      <Value description="Krovak">bk</Value>
+      <Value description="Cassini-Soldner">bl</Value>
+      <Value description="Oblique Mercator">bo</Value>
+      <Value description="Robinson ">br</Value>
+      <Value description="Space oblique Mercator">bs</Value>
+      <Value description="Cylindrical, specific type unknown">bu</Value>
+      <Value description="Cylindrical, other">bz</Value>
+      <Value description="Albers equal area">ca</Value>
+      <Value description="Bonne ">cb</Value>
+      <Value description="Lambert's conformal conic">cc</Value>
+      <Value description="Equidistant conic">ce</Value>
+      <Value description="Polyconic">cp</Value>
+      <Value description="Conic, specific type unknown">cu</Value>
+      <Value description="Conic, other">cz</Value>
+      <Value description="Armadillo ">da</Value>
+      <Value description="Butterfly ">db</Value>
+      <Value description="Eckert ">dc</Value>
+      <Value description="Goode's homolosine">dd</Value>
+      <Value description="Miller's bipolar oblique conformal conic">de</Value>
+      <Value description="Van Der Grinten ">df</Value>
+      <Value description="Dimaxión ">dg</Value>
+      <Value description="Cordiform">dh</Value>
+      <Value description="Lambert conformal ">dl</Value>
+      <Value description="Other">zz</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="24" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="25" name="Type of cartographic material" description="One-character alphabetic code that indicates the type of cartographic item described.">
+      <Value description="Single map">a</Value>
+      <Value description="Map Series. Number of related but physically separate and bibliographically distinct cartographic units intended by the producer(s) or issuing body(s) to form a single group.">b</Value>
+      <Value description="Map serial. Issued in successive parts bearing numerical or chronological designations and intended to be continued indefinitely">c</Value>
+      <Value description="Globe">d</Value>
+      <Value description="Atlas ">e</Value>
+      <Value description="Separate supplement to another work">f</Value>
+      <Value description="Bound as part of another work">g</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="26-27" name="Undefined" description="Each contains a blank (#) or a fill character (|)"/>
+    <Position pos="28" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="29" name="Form of item" description="One-character alphabetic code that indicates the form of material for the item.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic. Storage on a directly accessible tangible recording medium, e.g. disc, tape, playaway device, flashdrive, portable hard drive, etc. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not require the use of a computer (e.g., music compact discs, videodiscs). This code can be used as a generic code for any form of electronic resource. Codes o and q may be used if there is a need to separately identify online and direct electronic resources.">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="30" name="Undefined" description="Contains a blank (#) or a fill character (|)."/>
+    <Position pos="31" name="Index" description="One-character numeric code that indicates whether the item or accompanying material includes a location index or gazetteer.">
+      <Value description="No index">0</Value>
+      <Value description="Index present">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="32" name="Undefined" description="Contains a blank (#) or a fill character (|)."/>
+    <Position pos="33-34" name="Special format characteristics" description="Up to two one-character alphabetic codes that indicate the special format characteristics of the map. Codes are recorded in order of their importance to the described item. If only one code is assigned, it is left justified and the unused position contains a blank (#).">
+      <Value description="No specified special format characteristics">#</Value>
+      <Value description="Manuscript">e</Value>
+      <Value description="Picture card, post card">j</Value>
+      <Value description="Calendar">k</Value>
+      <Value description="Puzzle">l</Value>
+      <Value description="Game">n</Value>
+      <Value description="Wall map">o</Value>
+      <Value description="Playing cards">p</Value>
+      <Value description="Loose-leaf">r</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="35-37" url="http://www.loc.gov/marc/languages/language_code.html" urltext="MARC Code List for Languages" name="Language" description="">
+      <Value description="No information provided">###</Value>
+      <Value description="Multiple languages">mul</Value>
+      <Value description="Sign languages">sgn</Value>
+      <Value description="Undetermined">und</Value>
+      <Value description="No linguistic content">zxx</Value>
+      <Value description="Tree-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="38" name="Modified record" description="One-character code that indicates whether any data in a bibliographic record is a modification of information that appeared on the item being cataloged or that was intended to be included in the MARC record.">
+      <Value description="No modified">#</Value>
+      <Value description="Dashed-on information omitted">d</Value>
+      <Value description="Completely romanized/printed cards romanized">o</Value>
+      <Value description="Completely romanized/printed cards in script">r</Value>
+      <Value description="Shortened">s</Value>
+      <Value description="Missing characters">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="39" name="Cataloging source" description="">
+      <Value description="National bibliographic agency">#</Value>
+      <Value description="Cooperative cataloging program">c</Value>
+      <Value description="Other">d</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="MU" name="Music" description="">
+    <Position pos="00-05" name="Date entered on file" description=""/>
+    <Position pos="06" name="Type of date/ Publication status" description="">
+      <Value description="No dates given; B.C. date involved">b</Value>
+      <Value description="Continuing resource currently published">c</Value>
+      <Value description="Continuing resource ceased publication">d</Value>
+      <Value description="Detailed date">e</Value>
+      <Value description="Inclusive dates of colletion">i</Value>
+      <Value description="Range of years of bulk of collection">k</Value>
+      <Value description="Multiple dates">m</Value>
+      <Value description="Dates unknown">n</Value>
+      <Value description="Date of distribution/ release/ issue and production/ recording session when different">p</Value>
+      <Value description="Questionable date">q</Value>
+      <Value description="Reprint / reissue date and original date">r</Value>
+      <Value description="Single know date / probable date">s</Value>
+      <Value description="Publication date and copyright date">t</Value>
+      <Value description="Continuings resource status unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Date 1" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="11-14" name="Date 2" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="15-17" url="http://www.loc.gov/marc/countries/countries_code.html" urltext="MARC Code List for Countries" name="Place of publication, production, or execution" description="">
+      <Value description="Various places">vp# </Value>
+      <Value description="No place, unknown, or undetermined">xx#</Value>
+      <Value description="Two-character alphabetic code">[aa#]</Value>
+      <Value description="Three-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="18-19" name="Form of composition" description="">
+      <Value description="Anthems">an</Value>
+      <Value description="Ballads">bd</Value>
+      <Value description="Bluegrass music">bg</Value>
+      <Value description="Blues ">bl</Value>
+      <Value description="Ballets ">bt</Value>
+      <Value description="Chaconnes">ca</Value>
+      <Value description="Chants, Other religions">cb</Value>
+      <Value description="Chants, Christian">cc</Value>
+      <Value description="Concerti grossi ">cg</Value>
+      <Value description="Chorales">ch</Value>
+      <Value description="Chorale preludes">cl</Value>
+      <Value description="Canons and rounds">cn</Value>
+      <Value description="Concertos">co</Value>
+      <Value description="Chansons, polyphonic">cp</Value>
+      <Value description="Carols">cr</Value>
+      <Value description="Chance compositions">cs</Value>
+      <Value description="Cantatas">ct</Value>
+      <Value description="Country music">cy</Value>
+      <Value description="Canzonas">cz</Value>
+      <Value description="Dance forms">df</Value>
+      <Value description="Divertimentos, serenades, cassations, divertissements, and notturni">dv</Value>
+      <Value description="Fugues">fg</Value>
+      <Value description="Flamenco">fl</Value>
+      <Value description="Folk music">fm</Value>
+      <Value description="Fantasias ">ft</Value>
+      <Value description="Gospel music">gm</Value>
+      <Value description="Hymns">hy</Value>
+      <Value description="Jazz">jz</Value>
+      <Value description="Musical revues and comedies">mc</Value>
+      <Value description="Madrigals">md</Value>
+      <Value description="Minuets ">mi</Value>
+      <Value description="Motets">mo</Value>
+      <Value description="Motion picture music">mp</Value>
+      <Value description="Marches">mr</Value>
+      <Value description="Masses">ms</Value>
+      <Value description="Multiple forms">mu</Value>
+      <Value description="Mazurkas">mz</Value>
+      <Value description="Nocturnes">nc</Value>
+      <Value description="Not applicable">nn</Value>
+      <Value description="Operas">op</Value>
+      <Value description="Oratorios ">or</Value>
+      <Value description="Overtures">ov</Value>
+      <Value description="Program music">pg</Value>
+      <Value description="Passion music">pm</Value>
+      <Value description="Polonaises">po</Value>
+      <Value description="Popular music">pp</Value>
+      <Value description="Preludes">pr</Value>
+      <Value description="Passacaglias">ps</Value>
+      <Value description="Part-songs">pt</Value>
+      <Value description="Pavans">pv</Value>
+      <Value description=" Rock music">rc</Value>
+      <Value description="Rondos">rd</Value>
+      <Value description="Ragtime music">rg</Value>
+      <Value description="Ricercars ">ri</Value>
+      <Value description="Rhapsodies">rp</Value>
+      <Value description="Requiems ">rq</Value>
+      <Value description="Square dance music">sd</Value>
+      <Value description="Songs">sg</Value>
+      <Value description="Sonatas ">sn</Value>
+      <Value description="Symphonic poems">sp</Value>
+      <Value description="Studies and exercises">st</Value>
+      <Value description="Suites ">su</Value>
+      <Value description="Symphonies">sy</Value>
+      <Value description="Toccatas">tc</Value>
+      <Value description="Teatro lirico">tl</Value>
+      <Value description="Trio-sonatas">ts</Value>
+      <Value description="Unknown">uu</Value>
+      <Value description="Villacincos">vi</Value>
+      <Value description="Variations">vr</Value>
+      <Value description="Waltzers">wz</Value>
+      <Value description="Zarzuelas">za</Value>
+      <Value description="Other">zz</Value>
+      <Value description="No attempt to code">||</Value>
+    </Position>
+    <Position pos="20" name="Format of music" description="One-character code that indicates the format of a musical composition (e.g., piano-conductor score).">
+      <Value description="Full score">a</Value>
+      <Value description="Full score, miniature or study size">b</Value>
+      <Value description="Accompaniment reduced for keyboard">c</Value>
+      <Value description="Voice score">d</Value>
+      <Value description="Condensed score or piano-conductor score">e</Value>
+      <Value description="Close score">g</Value>
+      <Value description="Chorus score">h</Value>
+      <Value description="Condensed score">i</Value>
+      <Value description="Performer-conductor part">j</Value>
+      <Value description="Multiple score formats">m</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="21" name="Music Parts" description="">
+      <Value description="No parts in hand or not specified">#</Value>
+      <Value description="Instrumental and vocal parts">d</Value>
+      <Value description="Instrumental parts">e</Value>
+      <Value description="Vocal parts">f</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="22" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="23" name="Form of item" description="One-character alphabetic code that indicates the form of material for the item.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic. Storage on a directly accessible tangible recording medium, e.g. disc, tape, playaway device, flashdrive, portable hard drive, etc. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not require the use of a computer (e.g., music compact discs, videodiscs). This code can be used as a generic code for any form of electronic resource. Codes o and q may be used if there is a need to separately identify online and direct electronic resources.">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="24-29" name="Accompanying matter" description="Up to six one-character alphabetic codes (recorded in alphabetical order) that indicate the contents of program notes and other accompanying material for sound recording, music manuscripts, or notated music. If fewer than six codes are assigned, the codes are left justified and each unused position contains a blank (#).">
+      <Value description="No accompanying matter">#</Value>
+      <Value description="Discography">a</Value>
+      <Value description="Bibliography">b</Value>
+      <Value description="Thematic indez">c</Value>
+      <Value description="Libretto or text">d</Value>
+      <Value description="Bibliography of composer or autor">e</Value>
+      <Value description="Biography of performer or history of ensemble">f</Value>
+      <Value description="Technical and/or historical information on instruments">g</Value>
+      <Value description="Technical information on music">h</Value>
+      <Value description="Historical information">i</Value>
+      <Value description="Ethnological information">k</Value>
+      <Value description="Instrutional materials">r</Value>
+      <Value description="Music">s</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="30-31" name="Literary text for sound recordings " description="Up to two one-character codes (recorded in the order of the following list) that indicate the type of literary text contained in a nonmusical sound recording. If only one code is assigned, it is left justified and the unused position contains a blank (#).">
+      <Value description="Item is a music sound recording">#</Value>
+      <Value description="Autobiography">a</Value>
+      <Value description="Biography">b</Value>
+      <Value description="Conference proceedings">c</Value>
+      <Value description="Drama ">d</Value>
+      <Value description="Essays">e</Value>
+      <Value description="Fiction">f</Value>
+      <Value description="Reporting">g</Value>
+      <Value description="History">h</Value>
+      <Value description="Instruction">i</Value>
+      <Value description="Language instruction">j</Value>
+      <Value description="Comedy">k</Value>
+      <Value description="Lectures, speeches">l</Value>
+      <Value description="Memoirs">m</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Folktales">o</Value>
+      <Value description="Poetry">p</Value>
+      <Value description="Rehearsals">r</Value>
+      <Value description="Sounds">s</Value>
+      <Value description="Interviews">t</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="32" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="33" name="Transposition and arrangement" description="Whether all or part of the item being cataloged is a transposition and/or arrangement of another work.">
+      <Value description="Not arrangement or transposition or not specified">#</Value>
+      <Value description="Transposition">a</Value>
+      <Value description="Arragement">b</Value>
+      <Value description="Both transposed and arranged">c</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="34" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="35-37" url="http://www.loc.gov/marc/languages/language_code.html" urltext="MARC Code List for Languages" name="Language" description="">
+      <Value description="No information provided">###</Value>
+      <Value description="Multiple languages">mul</Value>
+      <Value description="Sign languages">sgn</Value>
+      <Value description="Undetermined">und</Value>
+      <Value description="No linguistic content">zxx</Value>
+      <Value description="Tree-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="38" name="Modified record" description="One-character code that indicates whether any data in a bibliographic record is a modification of information that appeared on the item being cataloged or that was intended to be included in the MARC record.">
+      <Value description="No modified">#</Value>
+      <Value description="Dashed-on information omitted">d</Value>
+      <Value description="Completely romanized/printed cards romanized">o</Value>
+      <Value description="Completely romanized/printed cards in script">r</Value>
+      <Value description="Shortened">s</Value>
+      <Value description="Missing characters">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="39" name="Cataloging source" description="">
+      <Value description="National bibliographic agency">#</Value>
+      <Value description="Cooperative cataloging program">c</Value>
+      <Value description="Other">d</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="CR" name="Continuing Resources" description="">
+    <Position pos="00-05" name="Date entered on file" description=""/>
+    <Position pos="06" name="Type of date/ Publication status" description="">
+      <Value description="No dates given; B.C. date involved">b</Value>
+      <Value description="Continuing resource currently published">c</Value>
+      <Value description="Continuing resource ceased publication">d</Value>
+      <Value description="Detailed date">e</Value>
+      <Value description="Inclusive dates of colletion">i</Value>
+      <Value description="Range of years of bulk of collection">k</Value>
+      <Value description="Multiple dates">m</Value>
+      <Value description="Dates unknown">n</Value>
+      <Value description="Date of distribution/ release/ issue and production/ recording session when different">p</Value>
+      <Value description="Questionable date">q</Value>
+      <Value description="Reprint / reissue date and original date">r</Value>
+      <Value description="Single know date / probable date">s</Value>
+      <Value description="Publication date and copyright date">t</Value>
+      <Value description="Continuings resource status unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Date 1" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="11-14" name="Date 2" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="15-17" url="http://www.loc.gov/marc/countries/countries_code.html" urltext="MARC Code List for Countries" name="Place of publication, production, or execution" description="">
+      <Value description="Various places">vp# </Value>
+      <Value description="No place, unknown, or undetermined">xx#</Value>
+      <Value description="Two-character alphabetic code">[aa#]</Value>
+      <Value description="Three-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="18" name="Frequency" description="One-character alphabetic code that indicates the frequency of an item; used in conjunction with 008/19 (Regularity).">
+      <Value description="No determinable frequency">#</Value>
+      <Value description="Annual">a</Value>
+      <Value description="Bimonthly">b</Value>
+      <Value description="Semiweekly">c</Value>
+      <Value description="Daily">d</Value>
+      <Value description="Biweekly">e</Value>
+      <Value description="Semiannual">f</Value>
+      <Value description="Biennial">g</Value>
+      <Value description="Triennial">h</Value>
+      <Value description="Three times a week">i</Value>
+      <Value description="Three times a month">j</Value>
+      <Value description="Continuously updated">k</Value>
+      <Value description="Monthly">m</Value>
+      <Value description="Quarterly">q</Value>
+      <Value description="Semimonthly">s</Value>
+      <Value description="Three times a year">t</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Weekly">w</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="19" name="Regularity" description="One-character alphabetic code that indicates the intended regularity of an item; used in conjunction with 008/18 (Frequency).">
+      <Value description="Normalized irregular">n</Value>
+      <Value description="Regular ">r</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Completely irregular">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="20" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="21" name="Type of continuing resource" description="One-character alphabetic code that indicates the type of continuing resource.">
+      <Value description="None of the following">#</Value>
+      <Value description="Updating database">d</Value>
+      <Value description="Updating loose-leaf">l</Value>
+      <Value description="Monographic series">m</Value>
+      <Value description="Newspaper">n</Value>
+      <Value description="Periodical">p</Value>
+      <Value description="Updating web site">w</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="22" name="Form of original item" description="One-character alphabetic code that indicates the form of material in which an item was originally published.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Newspaper format">e</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not requi">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="23" name="Form of item" description="One-character alphabetic code that specifies the form of material for the item being described">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not requi">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="24" name="Nature of entire work" description="">
+      <Value description="Not specified">#</Value>
+      <Value description="Calendars">5</Value>
+      <Value description="Comics/graphic novels">6</Value>
+      <Value description="Abstracts/ summaries">a</Value>
+      <Value description="Bibliographies">b</Value>
+      <Value description="Catalogs">c</Value>
+      <Value description="Dictionaries. Also used for a glossary or a gazetteer.">d</Value>
+      <Value description="Encyclopedias">e</Value>
+      <Value description="Handbooks">f</Value>
+      <Value description="Legal articles">g</Value>
+      <Value description="Biography">h</Value>
+      <Value description="Indexes. Index to bibliographical material other than itself. Not used when a publication contains an index to its own content.">i</Value>
+      <Value description="Discographies">k</Value>
+      <Value description="Legislation. Full or partial text of enactments of legislative bodies, published either in statute or in code form, or text of rules and regulations issued by executive or adminitrative agencies.">l</Value>
+      <Value description="Theses">m</Value>
+      <Value description="Survey of literature in a subject area">n</Value>
+      <Value description="Reviews">o</Value>
+      <Value description="Programmed texts">p</Value>
+      <Value description="Filmographies">q</Value>
+      <Value description="Directories">r</Value>
+      <Value description="Statistics">s</Value>
+      <Value description="Technical reports">t</Value>
+      <Value description="Standards/ specifications">u</Value>
+      <Value description="Legal cases and case notes">v</Value>
+      <Value description="Law reorts and digests">w</Value>
+      <Value description="Yearbooks">y</Value>
+      <Value description="Teatries">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="25-27" name="Nature of contents" description="">
+      <Value description="Not specified">#</Value>
+      <Value description="Calendars">5</Value>
+      <Value description="Comics/graphic novels">6</Value>
+      <Value description="Abstracts/ summaries">a</Value>
+      <Value description="Bibliographies">b</Value>
+      <Value description="Catalogs">c</Value>
+      <Value description="Dictionaries. Also used for a glossary or a gazetteer.">d</Value>
+      <Value description="Encyclopedias">e</Value>
+      <Value description="Handbooks">f</Value>
+      <Value description="Legal articles">g</Value>
+      <Value description="Biography">h</Value>
+      <Value description="Indexes. Index to bibliographical material other than itself. Not used when a publication contains an index to its own content.">i</Value>
+      <Value description="Discographies">k</Value>
+      <Value description="Legislation. Full or partial text of enactments of legislative bodies, published either in statute or in code form, or text of rules and regulations issued by executive or adminitrative agencies.">l</Value>
+      <Value description="Theses">m</Value>
+      <Value description="Survey of literature in a subject area">n</Value>
+      <Value description="Reviews">o</Value>
+      <Value description="Programmed texts">p</Value>
+      <Value description="Filmographies">q</Value>
+      <Value description="Directories">r</Value>
+      <Value description="Statistics">s</Value>
+      <Value description="Technical reports">t</Value>
+      <Value description="Standars/specifications">u</Value>
+      <Value description="Legal cases and case notes">v</Value>
+      <Value description="Law reports and digests">w</Value>
+      <Value description="Treaties">z</Value>
+      <Value description="No attempt to code">|||</Value>
+    </Position>
+    <Position pos="28" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="29" name="Conference publication" description="One-character numeric code that indicates whether an item consists of the proceedings, reports, or summaries of a conference.">
+      <Value description="Not a conference publication">0</Value>
+      <Value description="Conference publication">1</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="30-32" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="33" name="Original alphabet or script of title" description="One-character alphabetic code that indicates the original alphabet or script of the language of the title on the source item upon which the key title (field 222) is based.">
+      <Value description="No alphabet or script given / No key title">#</Value>
+      <Value description="Basic Roman">a</Value>
+      <Value description="Extended Roman">b</Value>
+      <Value description="Cyrillic">c</Value>
+      <Value description="Japanese">d</Value>
+      <Value description="Chinese">e</Value>
+      <Value description="Arabic">f</Value>
+      <Value description="Greek">g</Value>
+      <Value description="Hebrew">h</Value>
+      <Value description="Thai ">i</Value>
+      <Value description="Devanagari ">j</Value>
+      <Value description="Korean">k</Value>
+      <Value description="Tamil ">l</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="34" name="Entry convention" description="One-character numeric code that indicates whether the item was cataloged according to successive entry, latest entry, or integrated entry cataloging conventions.">
+      <Value description="Succesive entry.New bibliographic record is created each time 1) a title changes, or 2) a corporate body used as main entry or uniform title qualifier, changes. The earlier or later title or author/title is recorded in a linking field (field 780/785) on each record.">0</Value>
+      <Value description="Latest entry. Cataloged under its latest (most recent) title or issuing body (pre-AACR cataloging rules). All former titles and/or issuing bodies are given in notes (fields 247, 547, and 550).">1</Value>
+      <Value description="Integrated entry. Cataloged under its latest (most recent) title and/or responsible person or corporate body. Used for integrating resources and electronic serials that do not retain their earlier titles.">2</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="35-37" url="http://www.loc.gov/marc/languages/language_code.html" urltext="MARC Code List for Languages" name="Language" description="">
+      <Value description="No information provided">###</Value>
+      <Value description="Multiple languages">mul</Value>
+      <Value description="Sign languages">sgn</Value>
+      <Value description="Undetermined">und</Value>
+      <Value description="No linguistic content">zxx</Value>
+      <Value description="Tree-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="38" name="Modified record" description="One-character code that indicates whether any data in a bibliographic record is a modification of information that appeared on the item being cataloged or that was intended to be included in the MARC record.">
+      <Value description="No modified">#</Value>
+      <Value description="Dashed-on information omitted">d</Value>
+      <Value description="Completely romanized/printed cards romanized">o</Value>
+      <Value description="Completely romanized/printed cards in script">r</Value>
+      <Value description="Shortened">s</Value>
+      <Value description="Missing characters">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="39" name="Cataloging source" description="">
+      <Value description="National bibliographic agency">#</Value>
+      <Value description="Cooperative cataloging program">c</Value>
+      <Value description="Other">d</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="VM" name="Visual Materials" description="">
+    <Position pos="00-05" name="Date entered on file" description=""/>
+    <Position pos="06" name="Type of date/ Publication status" description="">
+      <Value description="No dates given; B.C. date involved">b</Value>
+      <Value description="Continuing resource currently published">c</Value>
+      <Value description="Continuing resource ceased publication">d</Value>
+      <Value description="Detailed date">e</Value>
+      <Value description="Inclusive dates of colletion">i</Value>
+      <Value description="Range of years of bulk of collection">k</Value>
+      <Value description="Multiple dates">m</Value>
+      <Value description="Dates unknown">n</Value>
+      <Value description="Date of distribution/ release/ issue and production/ recording session when different">p</Value>
+      <Value description="Questionable date">q</Value>
+      <Value description="Reprint / reissue date and original date">r</Value>
+      <Value description="Single know date / probable date">s</Value>
+      <Value description="Publication date and copyright date">t</Value>
+      <Value description="Continuings resource status unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Date 1" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="11-14" name="Date 2" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="15-17" url="http://www.loc.gov/marc/countries/countries_code.html" urltext="MARC Code List for Countries" name="Place of publication, production, or execution" description="">
+      <Value description="Various places">vp# </Value>
+      <Value description="No place, unknown, or undetermined">xx#</Value>
+      <Value description="Two-character alphabetic code">[aa#]</Value>
+      <Value description="Three-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="18-20" name="Running time for motion pictures and videorecordings " description="Three-digit number that indicates the total running time of the motion picture or videorecording. The number is right justified and each unused position contains a zero.">
+      <Value description="Running time exceeds three characters">000</Value>
+      <Value description="Running time">001-999</Value>
+      <Value description="Not applicable">nnn</Value>
+      <Value description="No attempt to code">|||</Value>
+      <Value description="Unknown">                         --- </Value>
+    </Position>
+    <Position pos="21" name="Undefined" description="Undefined; contains a blank (#) or a fill character (|)."/>
+    <Position pos="22" name="Target audience" description="One- character alphabetic code that describes the intellectual level of the target audience for which the material is intended">
+      <Value description="Unknown or not specified">#</Value>
+      <Value description="Preschool">a</Value>
+      <Value description="Primary">b</Value>
+      <Value description="Pre-adolescent">c</Value>
+      <Value description="Adolescent">d</Value>
+      <Value description="Adult">e</Value>
+      <Value description="Specialized">f</Value>
+      <Value description="General">g</Value>
+      <Value description="Juvenile">j</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="23-27" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="28" name="Government publication" description="One-character code that indicates whether or not the item is published or produced by or for an international, national, state, provincial, or local government agency, or by any subdivision of such a body">
+      <Value description="Not a government publication">#</Value>
+      <Value description="Autonomous or semi-autonomous component">a</Value>
+      <Value description="Multilocal">c</Value>
+      <Value description="Federal / National">f</Value>
+      <Value description="International intergovernmental">i</Value>
+      <Value description="Local">l</Value>
+      <Value description="Multistate">m</Value>
+      <Value description="Government publication-level undetermined">o</Value>
+      <Value description="State, provincial, territorial, dependent, etc.">s</Value>
+      <Value description="Unknown if item is government publication">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="29" name="Form of item" description="One-character alphabetic code that indicates the form of material for the item.">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic. Storage on a directly accessible tangible recording medium, e.g. disc, tape, playaway device, flashdrive, portable hard drive, etc. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not require the use of a computer (e.g., music compact discs, videodiscs). This code can be used as a generic code for any form of electronic resource. Codes o and q may be used if there is a need to separately identify online and direct electronic resources.">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="30-32" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="33" name="Type of visual material" description="One-character alphabetic code that indicates the type of visual material being described.">
+      <Value description="Art original ">a</Value>
+      <Value description="Kit.Mixture of components from two or more categories, that is, sound recording, maps, filmstrips, etc., no one of which is the predominant constituent of the item.">b</Value>
+      <Value description="Art reproduction">c</Value>
+      <Value description="Diorama ">d</Value>
+      <Value description="Filmstrip">f</Value>
+      <Value description="Game">g</Value>
+      <Value description="Picture">i</Value>
+      <Value description="Graphic">k</Value>
+      <Value description="Technical drawing">l</Value>
+      <Value description="Motion picture">m</Value>
+      <Value description="Chart">n</Value>
+      <Value description="Flash card">o</Value>
+      <Value description="Microscope slide">p</Value>
+      <Value description="Model">q</Value>
+      <Value description="Realia ">r</Value>
+      <Value description="Slide">s</Value>
+      <Value description="Transparency">t</Value>
+      <Value description="Videorecording">v</Value>
+      <Value description="Toy">w</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="34" name="Technique" description="One-character alphabetic code that indicates the technique used in creating motion in motion pictures or videorecordings.">
+      <Value description="Animation">a</Value>
+      <Value description="Animation and live action">c</Value>
+      <Value description="Live action">l</Value>
+      <Value description="Not applicable">n</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="Other">z</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="35-37" url="http://www.loc.gov/marc/languages/language_code.html" urltext="MARC Code List for Languages" name="Language" description="">
+      <Value description="No information provided">###</Value>
+      <Value description="Multiple languages">mul</Value>
+      <Value description="Sign languages">sgn</Value>
+      <Value description="Undetermined">und</Value>
+      <Value description="No linguistic content">zxx</Value>
+      <Value description="Tree-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="38" name="Modified record" description="One-character code that indicates whether any data in a bibliographic record is a modification of information that appeared on the item being cataloged or that was intended to be included in the MARC record.">
+      <Value description="No modified">#</Value>
+      <Value description="Dashed-on information omitted">d</Value>
+      <Value description="Completely romanized/printed cards romanized">o</Value>
+      <Value description="Completely romanized/printed cards in script">r</Value>
+      <Value description="Shortened">s</Value>
+      <Value description="Missing characters">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="39" name="Cataloging source" description="">
+      <Value description="National bibliographic agency">#</Value>
+      <Value description="Cooperative cataloging program">c</Value>
+      <Value description="Other">d</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+  <Material id="MX" name="Mixed Materials" description="">
+    <Position pos="00-05" name="Date entered on file" description=""/>
+    <Position pos="06" name="Type of date/ Publication status" description="">
+      <Value description="No dates given; B.C. date involved">b</Value>
+      <Value description="Continuing resource currently published">c</Value>
+      <Value description="Continuing resource ceased publication">d</Value>
+      <Value description="Detailed date">e</Value>
+      <Value description="Inclusive dates of colletion">i</Value>
+      <Value description="Range of years of bulk of collection">k</Value>
+      <Value description="Multiple dates">m</Value>
+      <Value description="Dates unknown">n</Value>
+      <Value description="Date of distribution/ release/ issue and production/ recording session when different">p</Value>
+      <Value description="Questionable date">q</Value>
+      <Value description="Reprint / reissue date and original date">r</Value>
+      <Value description="Single know date / probable date">s</Value>
+      <Value description="Publication date and copyright date">t</Value>
+      <Value description="Continuings resource status unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="07-10" name="Date 1" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="11-14" name="Date 2" description="A date specified by the code in 008/06 (Type of date/ Publication status)">
+      <Value description="Date element is not applicable">#</Value>
+      <Value description="Date digit">1</Value>
+      <Value description="Date digit">2</Value>
+      <Value description="Date digit">3</Value>
+      <Value description="Date digit">4</Value>
+      <Value description="Date digit">5</Value>
+      <Value description="Date digit">6</Value>
+      <Value description="Date digit">7</Value>
+      <Value description="Date digit">8</Value>
+      <Value description="Date digit">9</Value>
+      <Value description="Date element is totally or partially unknown">u</Value>
+      <Value description="No attempt to code">||||</Value>
+    </Position>
+    <Position pos="15-17" url="http://www.loc.gov/marc/countries/countries_code.html" urltext="MARC Code List for Countries" name="Place of publication, production, or execution" description="">
+      <Value description="Various places">vp# </Value>
+      <Value description="No place, unknown, or undetermined">xx#</Value>
+      <Value description="Two-character alphabetic code">[aa#]</Value>
+      <Value description="Three-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="18-22" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="23" name="Form of item" description="One-character alphabetic code that specifies the form of material for the item being described">
+      <Value description="None of the following">#</Value>
+      <Value description="Microfilm">a</Value>
+      <Value description="Microfiche">b</Value>
+      <Value description="Microopaque">c</Value>
+      <Value description="Large print">d</Value>
+      <Value description="Braille ">f</Value>
+      <Value description="Online.  The resource is accessed by means of hardware and software connections to a communications network. If a distinction between types of electronic resources is not necessary, code s can be used as a generic code for any form of electronic resource.">o</Value>
+      <Value description="Direct electronic">q</Value>
+      <Value description="Regular print reproduction">r</Value>
+      <Value description="Electronic. Intended for manipulation by a computer. May reside in a carrier accessed either directly or remotely, in some cases requiring the use of peripheral devices attached to the computer (e.g., a CD-ROM player). Not used for items that do not requi">s</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="24-34" name="Undefined" description="Undefined; each contains a blank (#) or a fill character (|)."/>
+    <Position pos="35-37" url="http://www.loc.gov/marc/languages/language_code.html" urltext="MARC Code List for Languages" name="Language" description="">
+      <Value description="No information provided">###</Value>
+      <Value description="Multiple languages">mul</Value>
+      <Value description="Sign languages">sgn</Value>
+      <Value description="Undetermined">und</Value>
+      <Value description="No linguistic content">zxx</Value>
+      <Value description="Tree-character alphabetic code">[aaa]</Value>
+    </Position>
+    <Position pos="38" name="Modified record" description="One-character code that indicates whether any data in a bibliographic record is a modification of information that appeared on the item being cataloged or that was intended to be included in the MARC record.">
+      <Value description="No modified">#</Value>
+      <Value description="Dashed-on information omitted">d</Value>
+      <Value description="Completely romanized/printed cards romanized">o</Value>
+      <Value description="Completely romanized/printed cards in script">r</Value>
+      <Value description="Shortened">s</Value>
+      <Value description="Missing characters">x</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+    <Position pos="39" name="Cataloging source" description="">
+      <Value description="National bibliographic agency">#</Value>
+      <Value description="Cooperative cataloging program">c</Value>
+      <Value description="Other">d</Value>
+      <Value description="Unknown">u</Value>
+      <Value description="No attempt to code">|</Value>
+    </Position>
+  </Material>
+</Tagfield>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_field_CF.xsd
new file mode 100755 (executable)
index 0000000..7b0b27b
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<xs:schema xmlns="http://koha-community.org" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://koha-community.org" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.1">
+  <xs:annotation>
+    <xs:documentation>Control Field Plugin Type of Materials schema</xs:documentation>
+  </xs:annotation>
+
+
+  <xs:element name="Tagfield" type="TagfieldType" nillable="false">
+    <xs:annotation>
+      <xs:documentation>Element indicating the control field</xs:documentation>
+    </xs:annotation>
+  </xs:element>
+
+
+  <xs:complexType name="TagfieldType">
+    <xs:sequence minOccurs="1" maxOccurs="unbounded">
+      <xs:element name="Material" type="MaterialType"/>
+    </xs:sequence>
+    <xs:attribute name="tag" type="controltagDataType" use="required"/>
+  </xs:complexType>
+
+
+  <xs:simpleType name="controltagDataType">
+    <xs:restriction base="xs:string">
+      <xs:whiteSpace value="collapse"/>
+      <xs:pattern value="00[1-9A-Za-z]{1}"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+
+  <xs:complexType name="MaterialType">
+    <xs:sequence minOccurs="1" maxOccurs="unbounded">
+      <xs:element name="Position" type="PositionType"/>
+    </xs:sequence>
+    <xs:attribute name="id" type="idDataType" use="required"/>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="description" type="xs:string" use="required"/>
+  </xs:complexType>
+
+
+  <xs:simpleType name="idDataType">
+    <xs:restriction base="xs:string">
+      <xs:whiteSpace value="collapse"/>
+      <xs:enumeration value="BKS"/>
+      <xs:enumeration value="CF"/>
+      <xs:enumeration value="MP"/>
+      <xs:enumeration value="MU"/>
+      <xs:enumeration value="CR"/>
+      <xs:enumeration value="VM"/>
+      <xs:enumeration value="MX"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+
+  <xs:complexType name="PositionType">
+    <xs:sequence minOccurs="0" maxOccurs="unbounded">
+      <xs:element name="Value" type="ValueType"/>
+    </xs:sequence>
+    <xs:attribute name="pos" type="posDataType" use="required"/>
+    <xs:attribute name="url" type="xs:anyURI" use="optional"/>
+    <xs:attribute name="urltext" type="xs:string" use="optional"/>
+    <xs:attribute name="name" type="xs:string" use="required"/>
+    <xs:attribute name="description" type="xs:string" use="required"/>
+  </xs:complexType>
+
+
+  <xs:simpleType name="posDataType">
+    <xs:restriction base="xs:string">
+      <xs:whiteSpace value="collapse"/>
+      <xs:pattern value="[0-9]+(-[0-9]+)?"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+
+  <xs:complexType name="ValueType">
+    <xs:simpleContent>
+      <xs:extension base="xs:string">
+        <xs:attribute name="description" type="xs:string" />
+      </xs:extension>
+    </xs:simpleContent>
+  </xs:complexType>
+
+</xs:schema>
index df78c54..dc7ed5f 100644 (file)
@@ -9,6 +9,7 @@
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript">
 //<![CDATA[
+if($.cookie("holdfor") != <!-- TMPL_VAR NAME="borrowernumber" -->){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }
 <!-- TMPL_IF NAME="UseTablesortForCirc" -->$.tablesorter.addParser({
     id: 'articles',
     is: function(s) {return false;  },
@@ -303,7 +304,7 @@ function refocus(calendar) {
             <li>The barcode was not found <!-- TMPL_VAR NAME="barcode" --></li>
            <!-- TMPL_IF NAME="fast_cataloging" -->
                <!-- TMPL_IF NAME="CAN_user_editcatalogue_fast_cataloging" -->
-                    <li><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a></li>
+                    <a href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA">Fast cataloging</a>
                <!-- /TMPL_IF -->
            <!-- /TMPL_IF -->
         <!-- /TMPL_IF -->
@@ -853,4 +854,4 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
 <!-- TMPL_INCLUDE NAME="circ-menu.inc" -->
 </div><!-- /TMPL_IF --><!-- /TMPL_UNLESS -->
 </div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index 8e6a013..945308c 100644 (file)
@@ -2,6 +2,8 @@
 
 <h1>Checkout History</h1>
 
-<p>This tab will provide you with information on the circulation history for this item.  Including the due date or return date and the patron information (if you are keeping track of this data).</p>
+<p>Each bibliographic record keeps a circulation history (with or without the patron information depending on your settings), but each item also has its own circulation history page. To see this, click on the 'Items' tab to the left of the record you are viewing.</p>
+
+<p>Below the 'History' heading is a link to 'View item's checkout history,' clicking that will open up the item's history which will look slightly different from the bibliographic record's history page.</p>
 
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 8c334fb..0bdf36e 100644 (file)
@@ -2,13 +2,13 @@
 
 <h1>Searching</h1>
 
-<p>To see more search options click [More Options] at the bottom of the page.&nbsp; This will allow for more advanced boolean searching.</p>
+<p>To see more search options click [More Options] at the bottom of the page. This will allow for more advanced boolean searching.</p>
 
 <h2>Searching Subtypes on the Staff Client</h2>
 
 <p>Below is a summary of  the various pieces of the advanced search limit: </p>
 
-<h3>AUDIENCE</h3>
+<h3>Audience</h3>
 
 <p>The index name is 'aud' and it's derived from 008/22</p>
 
@@ -17,7 +17,7 @@
 <li>aud:d Young adult</li>
 <li>aud:e Adult</li></ul>
 
-<h3>CONTENT</h3>
+<h3>Content</h3>
 
 <p>There are three indexes that comprise Content: 'fic' is derived from 003/33; 'bio' is derived from the 008/34 and 'mus' is derived from LEADER/06. Common values for each of these are:</p>
 
@@ -27,7 +27,7 @@
 <li>mus:j Musical recording</li>
 <li>mus:i Non-musical recording</li></ul>
 
-<h3>FORMAT</h3>
+<h3>Format</h3>
 
 <p>The index name is 'l-format' and it's an index of positions 007/01 and 007/02. Common values are:</p>
 
@@ -41,7 +41,7 @@
 <li>l-format:co CD Software</li>
 <li>l-format:cr Website</li></ul>
 
-<h3>ADDITIONAL CONTENT TYPES</h3>
+<h3>Additional Content Types</h3>
 
 <p>The index name is 'ctype' is taken from the 008 and it's where we get the 'additional content types'. It's position 008/24-28 field. Common values are: </p>
 
index 0ef48bc..4f4ac9e 100644 (file)
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
 <h1>Cataloging</h1>
-<p>
-Cataloging in Koha can be done one of two
-ways.&nbsp; This manual will explain how to use the labeled MARC view for
-cataloging.&nbsp; The other way to catalog is to use the &Dagger;bilbios cataloging
-plugin.&nbsp; 
-</p>
-<h2>Adding a Bib Record<br />
-</h2>
-<p>
-To
-catalog a new record, you need to be in Koha's 'Cataloguing' module.
-You can find this module in your global nav at the top of the screen,
-under the 'More' dropdown list.
-</p>
+
+<p>Before you start cataloging in Koha you're going to want to do some basic setup. Refer to the Implementation Checklist for a full list of these things. Most importantly you're going to want to make sure that your Frameworks are all defined the way you want. Once in the cataloging module you will not be able to add or remove fields and subfields so your frameworks must be ready before you start cataloging.</p>
+
+<h2>Adding Records</h2>
+
+<p>Records can be added to Koha via original or copy cataloging. If you would like to catalog a record using a blank template</p>
+
 <ul>
-       <li>
-       Start by searching the catalog to see if your item is already in the system</li>
-       <li>
-       If 'no results found', click on 'New Record' and choose a 'framework' from the dropdown box. </li>
-       <li style="background-color: #ffe599">TIP: Choose 'default' if you have not yet created a new framework
-       <ul>
-               <li>To create a framework you must go into the administration section
-               <ul>
-                       <li><em>Get there: </em>More &gt; Administration &gt; MARC Bibliographic Framework
-                       </li>
-               </ul>
-               </li>
-       </ul>
-       </li>
-</ul>
+       <li>Click 'New Record'
 <ul>
-       <li style="background-color: #ffe599">TIP: To quick start copy cataloging, instead of clicking the 'New Record' button, click the 'Z30.50 Search' button to search for a record from another target.</li>
-       <li>From the 'Add MARC Record' page, you have two options for cataloging new records</li>
+       <li>Choose the framework you would like to base your record off of</li>
 </ul>
-<ul>
-       <li>
-       <ul>
-               <li>Original cataloging OR
-               </li>
-       </ul>
-       <ul>
-               <li>Copy cataloging using the Koha's Z39.50 search
-               <ul>
-                       <li style="color: #990000">IMPORTANT: You must first set up Z39.50 Search Targets
-                       <ul>
-                               <li><em>Get there: </em>More &gt; Administration &gt; Additional parameters &gt; Z39.50 Client Targets</li>
-                       </ul>
-                       </li>
-               </ul>
-               </li>
-       </ul>
-       </li>
+</li>
 </ul>
-<h2>
-Original Cataloging</h2>
+
+<p>If you want to catalog a record based on an existing record at another library</p>
+
+<ul>
+       <li>Click 'z39.50 Search'</li>
+       <li>Search for the item you would like to catalog
 <ul>
-       <li>
-       Use the numerical tabbed interface to go through your MARC record
-       <ul>
-               <li>TIP: 1xx fields will be found under tab 1, 2xx fields will be found under tab 2, etc</li>
-       </ul>
-       </li>
-       <li>To help with your original cataloging, Koha has some built in plugins denoted by an ellipsis (...) at the end of the field. <br />
-       <ul>
-               <li>Some of these will automatically enter the data just by clicking in the text field, others require that you click on the '...'
-               </li>
-       </ul>
-       </li>
+       <li>If no results are found, try searching for fewer fields, not all Z39.50 targets can search all of the fields above.</li>
 </ul>
-<h3>Leader Plugin</h3>
-<strong>
-</strong>
+</li>
+       <li>Search targets can be altered by using the Z39.50 Admin area.</li>
+       <li>From the results you can view the MARC or Card view for the records or choose to Import them into Koha
 <ul>
-       <li>The Leader is a fixed field at the beginning of each MARC
-       record that contains coded information for the processing of the
-       record.
-       </li>
-       <li>Koha has no need for Leader information and does not use
-       it. However, Koha can store Leader data, and can help you build your
-       own Leader data.</li>
-       <li>
-       When you create (or edit) bibliographic records, clicking on the '...'
-       to the right of the Leader field will open a pop-up window to guide you
-       through the creation of your MARC Leader.</li>
-       <li>Make the appropriate choices from the pull-down menus, and Koha will
-       create the encoded Leader data and insert it into your 000@ subfield. </li>
-       <li>You now have Leader data stored with your records, should you ever need
-       it for some other application.</li>
+       <li>In addition to the Import link to the right of each title, you can click on the title you're interested in and a menu will pop up with links to preview the record and import it</li>
 </ul>
-<h3>Adding Additional Fields</h3>
+</li>
+</ul>
+
+<p>Once you've opened a blank framework or imported a record via Z39.50 you will be presented with the form to continue cataloging</p>
+
+<ul>
+       <li>To expand a collapsed tag click on the tag number</li>
+       <li>To get help from the Library of Congress on a MARC tag click the question mark (?) to the right of each field number
 <ul>
-       <li>When editing MARC fields you can duplicate fields (that are repeatable) by clicking the plus (+) next to the field or subfield<br />
-       <ul>
-               <li>When clicking plus (+) it will automatically duplicate the data in the field into a new field</li>
-               <li>When
-               clicking minus (-) it will delete the field or subfield if there is
-               another of the same field or subfield.&nbsp; If you click minus (-) when
-               there are no other repeats of the field or subfield it will delete the
-               field contents.</li>
-       </ul>
-       </li>
-       <li>By default subfields will appear
-       in alphabetical order. You can move these fields to the right order by
-       clicking the ^ to the left of the subfield&nbsp;
-       </li>
+       <li style="background-color: #ffe599">If you think this is an unwanted feature, you could add the following JavaScript to your intranetuserjs system preference:
+$(document).ready(function(){<br>
+$(".tagnum a").hide();<br>
+});</li>
 </ul>
-<h3><strong>Authority Plugin</strong></h3>
+</li>
+       <li>Sometimes fields may not be editable due to the value in your BiblioAddsAuthorities system preference. If you have this preference set to not allow catalogers to type in fields controlled by authorities you may see a lock symbol to the left of the field.
 <ul>
-       <li>Some fields (such as the 100) offer Authority Plugins</li>
-       <li>Click the '...' to the left of the field</li>
-       <li>
-       Search for the authority
-       </li>
-       <li>
-       Click 'choose' next to the matching record and it will auto fill the fields in your MARC record<br />
-       </li>
+       <li>If this icon appears you must click the ellipse to the right of the field to search for an existing authority.</li>
+       <li>From the results list click 'Choose authority' to bring that into your catalog record</li>
 </ul>
-<h2>
-<strong> Using Z39.50 for Copy Cataloging</strong></h2>
-<p>
-To perform a Z39.50 search
-</p>
+</li>
+       <li>To duplicate a field click on the + (plus sign) to the right of the tag
 <ul>
-       <li>Enter data into at least one of the following MARC fields
-       <ul>
-               <li>Title - 245</li>
-               <li>ISBN - 020</li>
-               <li>ISSN - 022</li>
-               <li>Author - 100</li>
-       </ul>
-       </li>
-       <li>
-       Click 'Z39.50 Search'</li>
-       <li>
-       Alter your search and choose Z39.50 targets from the pop-up window
-       </li>
-       <li>
-       TIP: First make sure you have set up your Z39.50 search targets
-
-       <ul>
-               <li>
-               <em>Get there: </em>More &gt; Administration &gt; Additional Parameters &gt; Z39.50 Client Targets
-
-               </li>
-       </ul>
-       </li>
+       <li>To move subfields in to the right order, click the up arrow to the left of the field</li>
+       <li>To duplicate a subfield click on the clone icon (to remove a copied field, click the delete clone icon) to the right of the field</li>
+       <li>To remove a subfield (if there is more than one of the same type), click the - (minus sign) to the right of the field</li>
 </ul>
+</li>
+       <li>To use a plugin click on the ... (ellipse) to the right of the filed
 <ul>
-       <li>Click on 'import' to import the record of your choice.</li>
-       <li>
-       Koha
-       will auto-fill the fields in your new MARC record with the values
-       supplied by the record you've just imported from the Z39.50 search.
-       
-       </li>
-       <li>
-       You can now add/edit fields to the record.
-       
-       </li>
-       <li>
-       Click 'Save' when you are done.
-       
-       </li>
+       <li>Some fixed fields have editors that will change based on the material type you're cataloging (for example the 006 and the 008 fields)</li>
 </ul>
-<h2>Editing a record</h2>
-<p>
-Editing a record is mostly the same as adding
-a record except that you will find that your fields will only display
-the subfields that you entered data in.&nbsp; When adding a new record you
-will see this for a 650 field.
-</p>
-<p>
-When editing you will only see
-</p>
-<p>
-To show all possible subfields in the framework, click on the text of the MARC field
-</p>
-<h2>Deleting Records</h2>
+</li>
+       <li>Once you've finished, click the 'Save' button at the top and choose whether you want to save and view the bib record you have created or continue on to add/edit items attached to the record
 <ul>
-       <li style="background-color: #ffe599">TIP: To delete a BIB Record, first delete all holdings
-       (items) attached to the bib. </li>
-       <li>Select Delete from the Edit dropdown
-       menu in the normal view of the record. <br />
-       <ul>
-               <li>Note: the delete option on the
-               Edit dropdown menu will be grayed out when holdings exist. It will only
-               allow you to delete the bib record after all the holdings (items) have
-               been deleted.</li>
-       </ul>
-       </li>
+       <li>If you are about to add a duplicate record to the system you will be warned before saving</li>
 </ul>
+</li>
+</ul>


 
-<h2>Questions<br />
-</h2>
-
-<h3>&quot;I searched on the MARC record I just added, and no results were found&quot;</h3>
-<p>
-If your catalog changes aren't visible in search results, it is because
-of the indexing process. Indexing can take anywhere from 1 minute to 4
-hours, depending on the load. If you do not see the new records by the
-following day, (24hrs) contact your system administrator. <br />
-</p>
-<h3>How to reorder my subject heading subfields so they appear in the proper order?</h3>
-<p>
-By default Koha alphabetizes your 6xx subfields, but you can easily
-move them around by clicking on the arrow on the left hand side of the
-subfield. This will allow you to put the headings in the order that
-best suits your item.
-</p>
-<h3>Can I duplicate a record in my system to do some copy cataloging?<br />
-</h3>
+<h2>Editing Records</h2>
 
-<ul>
-       <li>Search for the record you'd like to copy</li>
-       <li>Choose the record by clicking on the title</li>
-       <li>Click on 'Edit'</li>
-       <li>Choose to 'Edit as New (Duplicate)'</li>
-       <li>After editing your record, click 'Save'</li>
-       <li>You will be warned that this record was a duplicate</li>
-       <li>Choose 'No' to save this as a new record</li>
-</ul>
+<p>To edit a record you can click 'Edit Biblio' from the search results on the cataloging page or by clicking the Edit button on the Bibliographic Record.</p>
+
+<p>The record will open in the MARC editor</p>
+
+<p>Once you have made your edits you can click 'Save' at the top of the editor.</p>
+
+<h2>Duplicating Records</h2>
+
+<p>Sometimes a copy of the record you need to catalog can't be found via Z39.50. In these cases you can create a duplicate of similar record and edit the necessary pieces to create a new record. To duplicate an existing record click 'Edit as New (Duplicate)' from the Edit menu on the Bibliographic Record</p>
+
+<p>This will open a new MARC record with the fields filled in with the values from the original Bibliographic Record.</p>
+
+<h2>Merging Records</h2>
+
+<p>If you would like to merge together multiple records you can do that via the Lists tool.</p>
 
-<h3>How do I overlay a full
-bib record over the brief one that was added at acquisitions?</h3>
-<p>
-The librarian added orders using the form in Koha, then
-'received' them on that brief record.&nbsp; Is there a way to download the full record right in acquisitions so
-that the item gets attached to that full record? Or if not that, a way
-to replace the brief record with a complete one?</p>
-<p>Search for the partial record in your catalog and then go to Edit &gt;
-Edit Record and from there you can do a Z39.50 search to pull in a more
-full record or you can do your full cataloging there.
-</p>
-<p>
-&nbsp;
-</p>
-
-<!-- TMPL_INCLUDE name="help-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE name="help-bottom.inc" -->
index ccaf1bf..c987eff 100644 (file)
@@ -1,9 +1,60 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
-<h1>Adding item details</h1>
+<h2>Adding Items</h2>
 
-<p>After saving a MARC record, you are presented with a screen to add item details (or, local holdings). This is where you define the location of the item (home branch), the cost of the item, the barcode, etc. </p>
+<p>After saving a new bibliographic record, you will be redirected to a blank item record so that you can attach an item to the bibliographic record. You can also click 'Add Holdings' from the cataloging search results or you can add new item at any time by clicking 'New' on the bibliographic record and choosing 'New Item'</p>
 
-<ul><li>Click 'Add Item' after entering the data for your item</li><li>A confirmation will appear with the item information</li><li>From here you can edit the item or add another item</li></ul>
+<p>The item edit form will appear:</p>
+
+<p>At the very least, the following fields should be entered for new items:</p>
+
+<ul>
+       <li>8 - Collection code</li>
+       <li>a - Permanent location</li>
+       <li>b - Shelving location</li>
+       <li>o - Full call number</li>
+       <li>p - Barcode</li>
+       <li>v - Cost, replacement price
+<ul>
+       <li>This value will be charged to patrons when you mark and item they have checked out as 'Lost'</li>
+</ul>
+</li>
+       <li>y - Koha item type</li>
+</ul>
+
+<p>Below the add form there are 3 buttons for adding the item</p>
+
+<ul>
+       <li>Add Item will add just the one item</li>
+       <li>Add &amp; Duplicate will add the item and fill in a new form with the same values for your to alter</li>
+       <li>Add Multiple Copies will ask how many copies and will then add that number of copies adding +1 to the barcode so each barcode is unique</li>
+</ul>
+
+<p>Your added items will appear above the add form once submitted</p>
+
+<p>Your items will also appear below the bibliographic details on the bib record display.</p>
+
+<p>If you have SpineLabelShowPrintOnBibDetails set to 'Display' then there will also be a link to print a quick spine label next to each item.</p>
+
+<h2>Editing Items</h2>
+
+<p>Items can be edited in several ways.</p>
+
+<ul>
+       <li>Clicking 'Edit' and 'Edit Items' from the bibliographic record</li>
+       <li>Clicking 'Edit Items' beside the item on the 'Items' tab</li>
+</ul>
+
+<p>The edit menu is also where items can be deleted from</p>
+
+<h2>Moving Items</h2>
+
+<p>Items can be moved from one bibliographic record to another using the Attach Item option</p>
+
+<p>Visit the bibliographic record you want to attach the item to and choose 'Attach Item' from the 'Edit' menu.</p>
+
+<p>Simply enter the barcode for the item you want to move and click 'Select'</p>
+
+<p>If you want to move all items to a new record creating only one bibliographic record you can use the Merge Records tool instead.</p>
 
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
index ce41889..cdca2ac 100644 (file)
@@ -1,35 +1,22 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
 <h1>Patron Fines</h1>
-Patron fines are calculated based on your system preferences.<br/>
-               <ul>
-                       <li>
-<em>Get there: </em></span>More &gt; Administration &gt; Patrons and Circulation &gt; Circulation and fines rules</li>
-               </ul>     
-<h3>Viewing Patron Accounts</h3>
-
-               <ul>
-                       <li>Click on the 'Fines' tab under the patron information on the left</li>
-                       <li>You will see the patron's account information</li>
-                       <li>In addition to overdue fines, replacement costs for lost items, account management fees and other library specific fees will show on the account
-                       <ul>
-                               <li>
-                           <span style="background-color: #ffe599">
-TIP: Marking an item Lost via the edit item page will automatically put a fine on the patron's record for the replacement cost of the item</span></li>
-                       </ul></li>
-                       <li>To pay fines, click the 'Pay fines' tab</li>
-                       <li>Each charge gives you a menu which lets you decide whether to mark items paid or not</li>
-                       <li>By choosing 'Paid' the system assumes that a full payment is being made</li>
-                       <li>Payments will appear on the Account tab</li>
-                       <li>You can also create manual invoices/charges or apply manual credits to patron's accounts
-                       <ul>
-                               <li>
-                           <span style="background-color: #ffe599">
-TIP: If you create a manual credit, be aware that it won't be applied to any particular lost or late item</span></li>
-                       </ul></li>
-                       <li>To create a manual invoice, click the 'Create manual invoice' tab</li>
-                       <li>Enter in the information related to the charge you're adding</li>
-                       <li>The new charge will appear on the 'Account' tab</li>
-                       <li>Manual invoices can be paid the same way as automatic fines, by clicking on 'Pay fines'</li>
-               </ul>
-       </div>  <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
+
+<p>The patron's complete accounting history will appear on the Fines tab. Contrary to its name, the Fines tab does not just show fine data, it also shows membership fees, rental fees, reserve fees and any other charge you may have for patrons.</p>
+
+<h2>Charging Fines/Fees</h2>
+
+<p>Most fees and fines will be charged automatically if the fines cron job is running:</p>
+
+<ul>
+       <li>Fines will be charged based on your Circulation &amp; Fines Rules</li>
+       <li>Hold fees will be charged based on the rules you set in the Patron Types &amp; Categories administration area</li>
+       <li>Rental fees will be charged based on the settings in your Item Types administration area</li>
+       <li>Marking an item 'Lost' via the cataloging module will automatically charge the patron the replacement cost for that item</li>
+</ul>
+
+<h2>Printing Invoices</h2>
+
+<p>To the right of each account line there is a print link. Clicking that link will print an invoice for the line item that includes the date and description of the line item along with the total outstanding on the account.</p>
+
+<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 1d2ecd4..7d0a6f2 100644 (file)
@@ -1,11 +1,13 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
 <h1>Create Manual Credit</h1>
-               <ul>
-                       <li>To create a manual credit, click the 'Create manual credit' tab</li>
-                       <li>Enter in the information related to the credit you're adding</li>
-                       <li>The new credit will appear on the 'Account' tab</li>
-               </ul>   
-               
-               <p style="background-color: #ffe599">TIP: Use manual credits to pay partial fines.</p>
+
+<p>Manual credits can be used to pay off parts of fines, or to forgive a fine amount.</p>
+<ul>
+       <li>First choose the type of credit you'd like to apply</li>
+       <li>If this credit is associated with an item you can enter that item's barcode so that the line item links to the right item</li>
+       <li>The description field is where you will enter the description of the credit</li>
+       <li>In the amount field, do not enter currency symbols, only numbers and decimals</li>
+</ul>
+
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 97d6ebd..fea0521 100644 (file)
@@ -1,13 +1,17 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
 <h1>Create Manual Invoice</h1>
-               <ul>
-                       <li>Click the 'Create manual invoice' tab</li>
-                       <li>Enter in the information related to the charge you're adding</li>
-                       <li>The new charge will appear on the 'Account' tab</li>
-                       <li>If you would like to define additional categories for manual invoices you can do so by adding authorized values in the MANUAL_INV categories.</li>
-                       <ul><li style="color: #990000">IMPORTANT: Set the authorized value field as the description and the description field is the default fee, if any.</li></ul>
-                       <li>Manual invoices can be paid the same way as automatic fines, by clicking on 'Pay fines'</li>
-               </ul>
+
+<p>For fees that are not automatically charged, librarians can create a manual invoice</p>
+<ul>
+       <li>First choose the type of invoice you would like to create
+<ul>
+       <li>To add additional values to the manual invoice type pull down menu, add them to the MANUAL_INV Authorized Value</li>
+</ul>
+</li>
+       <li>If the fee is associated with an item you can enter its barcode so that the line item shows a link to that item</li>
+       <li>The description field is where you will enter the description of the charge</li>
+       <li>In the amount field, do not enter currency symbols, only numbers and decimals</li>
+</ul>
 
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index f0d744e..8210262 100644 (file)
@@ -1,6 +1,8 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->   
-   <h1>Setting Patron Permissions</h1>
-   <p>Patron permissions are used to define the rights of staff members when in the intranet/staff client.</p>
+
+<h1>Setting Patron Permissions</h1>
+
+<p>Patron permissions are used to define the rights of staff members when in the intranet/staff client.</p>
        <ul>
                <li>To alter patron permissions, click on Patrons on the main menu at the top of the screen.</li>
                <li>Search or browse for the patron you'd like to edit</li>
                <li>Choose the permissions you'd like this patron to have</li>
                <li>You can pick as many permissions as you'd like for each staff member
                <ul>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: If a staff member is set to 'superlibrarian' they have access to all functions and do not need any other permissions checked</span></li>
+                       <li><span style="background-color: #ffe599">TIP: If a staff member is set to 'superlibrarian' they have access to all functions and do not need any other permissions checked</span></li>
                </ul></li>
        </ul>
 
-<h3>What will each permission level do?</h3>
+<h3>Patron Permissions Defined</h3>
 
 <p>Depending on the permission certain menu items will be removed from the menus in Koha, preventing users from accessing them.</p>
-       <ul>
-               <li><strong>superlibrarian</strong>
-               <ul>
-                       <li>Access to all librarian functions</li>
-               </ul></li>
-               <li><strong>circulate</strong>
-               <ul>
-                       <li>Ability for logged in user to check books out and back in</li>
-               </ul></li>
-               <li><strong>catalog</strong>
-               <ul>
-                       <li>Must be given to all staff members to allow them to log into the staff interface</li>
-                       <li>This permission will allow staff members to search the catalog via the staff interface</li>
-               </ul></li>
-               <li><strong>parameters</strong>
-               <ul>
-                       <li>Provides access to all admin links and preferences</li>
-               </ul></li>
-               <li><strong>borrowers</strong>
-               <ul>
-                       <li>Add or modify patrons (with the exception of setting permissions)</li>
-               </ul></li>
-               <li><strong>permissions</strong>
-               <ul>
-                       <li>Ability to set patron permissions&nbsp;</li>
-               </ul></li>
-               <li><strong>reserveforothers</strong>
-               <ul>
-                       <li>Place holds on books for patrons via the staff interface</li>
-               </ul></li>
-               <li><strong>borrow</strong>
-               <ul>
-                       <li>Borrow books from the library with this staff account</li>
-               </ul></li>
-               <li><strong>editcatalogue</strong> Modify bibliogra
-               <ul>
-                       <li>Provides cataloging permissions such as altering and adding bibliographic and holdings data)</li>
-               </ul></li>
-               <li><strong>updatecharges</strong>
-               <ul>
-                       <li>Handle fines and charges for patrons (including paying, adding credits, and adding invoices)</li>
-               </ul></li>
-               <li><strong>acquisition</strong>
-               <ul>
-                       <li>Access to acquisition and patron purchase suggestions management</li>
-               </ul></li>
-               <li><strong>management</strong>
-               <ul>
-                       <li>Deprecated - no longer in use</li>
-               </ul></li>
-               <li><strong>tools</strong>
-               <ul>
-                       <li>Use tools (export, import, barcodes)</li>
-               </ul></li>
-               <li><strong>editauthorities</strong>
-               <ul>
-                       <li>Allow staff member to edit authorities</li>
-               </ul></li>
-               <li><strong>serials</strong>
-               <ul>
-                       <li>Allow staff member to manage serials subscriptions and claims</li>
-               </ul></li>
-               <li><strong>reports</strong>
-               <ul>
-                       <li>Allow staff member to access to the reports module</li>
-               </ul></li>
-               <li><strong>staffaccess</strong>
-               <ul>
-                       <li>Provides the ability to modify login / permissions for staff users</li>
-               </ul></li>
-       </ul><!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
+<ul>
+       <li>superlibrarian
+<ul>
+       <li>Access to all functions within the staff client</li>
+</ul>
+</li>
+       <li>circulate
+<ul>
+       <li>Ability to check (issue) books out and in and access the 'Circulation' page in the staff client</li>
+       <li>This section can be expanded (Learn more below)</li>
+</ul>
+</li>
+       <li>catalogue
+<ul>
+       <li>Allows staff members to search the catalog via the staff client</li>
+       <li>Must be given to all staff members to allow them to login to the staff client</li>
+</ul>
+</li>
+       <li>parameters
+<ul>
+       <li>Provides access to all areas of the Administration menu</li>
+</ul>
+</li>
+       <li>borrowers
+<ul>
+       <li>Allows staff members to add or modify patrons (with the exception of setting permissions)</li>
+</ul>
+</li>
+       <li>permissions
+<ul>
+       <li>Ability to set patron permissions</li>
+</ul>
+</li>
+       <li>reserveforothers
+<ul>
+       <li>Ability to place holds on books for patrons via the staff interface</li>
+       <li>This section can be expanded (Learn more below)</li>
+</ul>
+</li>
+       <li>borrow
+<ul>
+       <li>Grants staff members the rights to borrow books from the library</li>
+</ul>
+</li>
+       <li>editcatalogue
+<ul>
+       <li>Ability to catalog items (add and edit bibliographic and holdings data)</li>
+       <li>This section can be expanded (Learn more below)</li>
+</ul>
+</li>
+       <li>updatecharges
+<ul>
+       <li>Manage patron accounts (including paying fines, adding credits, and creating invoices)</li>
+</ul>
+</li>
+       <li>acquisition
+<ul>
+       <li>Provides access to the acquisitions and patron purchase suggestion modules</li>
+       <li>This section can be expanded (Learn more below)</li>
+</ul>
+</li>
+       <li>management
+<ul>
+       <li>No longer in use</li>
+</ul>
+</li>
+       <li>tools
+<ul>
+       <li>Access to all items in the Tools section of the staff client</li>
+       <li>This section can be expanded (Learn more below)</li>
+</ul>
+</li>
+       <li>editauthorities
+<ul>
+       <li>Provides access to edit the authority record</li>
+</ul>
+</li>
+       <li>serials
+<ul>
+       <li>Allows access to the serials module</li>
+       <li>This section can be expanded (Learn more below)</li>
+</ul>
+</li>
+       <li>reports
+<ul>
+       <li>Allow access to the Reports module (ability to create, edit and run all reports)</li>
+       <li>Reports found on the Circulation page are not controlled by this permission</li>
+       <li>This section can be expanded (Learn more below)</li>
+</ul>
+</li>
+       <li>staffaccess
+<ul>
+       <li>Provides the ability to modify login / permissions for staff users</li>
+</ul>
+</li>
+</ul>
+<h3>Granular Circulate Permissions</h3>
+<p>If the staff member has 'circulate' permissions they have the ability to perform all of these actions. If you would like to control circulation permissions on a more granular level choose from these options:</p>
+<ul>
+       <li>circulate_remaining_permissions
+<ul>
+       <li>All circulation rights except override permissions</li>
+</ul>
+</li>
+       <li>override_renewals
+<ul>
+       <li>Override blocked renewals</li>
+</ul>
+</li>
+</ul>
+<h3>Granular Holds Permissions</h3>
+<p>If the staff member has 'reserveforothers' permissions they have the ability to perform all of these actions. If you would like to control holds permissions on a more granular level choose from these options:</p>
+<ul>
+       <li>modify_holds_priority
+<ul>
+       <li>Allow staff members to alter the holds priority (moving patrons up and down the queue)</li>
+</ul>
+</li>
+       <li>place_holds
+<ul>
+       <li>All staff members to place holds for patrons via the staff interface</li>
+</ul>
+</li>
+</ul>
+<h3>Granular Cataloging Permissions</h3>
+<p>If the staff member has 'editcatalogue' permissions they have the ability to perform all of these actions. If you would like to control cataloging permissions on a more granular level choose from these options:</p>
+<ul>
+       <li>edit_catalogue
+<ul>
+       <li>Ability to access all cataloging functions via the Cataloging page</li>
+</ul>
+</li>
+       <li>edit_items
+<ul>
+       <li>Ability to make edits to item records, but not bib records</li>
+</ul>
+</li>
+       <li>fast_cataloging
+<ul>
+       <li>The ability to catalog using only the Fast Add Framework found on the Circulation page</li>
+</ul>
+</li>
+</ul>
+<h3>Granular Acquisitions Permissions</h3>
+<p>If the staff member has 'acquisition' permissions they have the ability to perform all of these actions. If you would like to control acquisitions permissions on a more granular level choose from these options:</p>
+<ul>
+       <li>budget_add_del
+<ul>
+       <li>Ability to add and delete budgets (not modify()</li>
+</ul>
+</li>
+       <li>budget_manage
+<ul>
+       <li>Manage budgets</li>
+</ul>
+</li>
+       <li>budget_modify
+<ul>
+       <li>Ability to edit existing budgets (not to add or delete)</li>
+</ul>
+</li>
+       <li>contracts_manage
+<ul>
+       <li>Manage contracts</li>
+</ul>
+</li>
+       <li>group_manage
+<ul>
+       <li>Manage orders and basket groups</li>
+</ul>
+</li>
+       <li>order_manage
+<ul>
+       <li>Manage orders and baskets</li>
+</ul>
+</li>
+       <li>order_receive
+<ul>
+       <li>Manage orders and baskets</li>
+</ul>
+</li>
+       <li>period_manage
+<ul>
+       <li>Manage periods</li>
+</ul>
+</li>
+       <li>planning_manage
+<ul>
+       <li>Manage budget planning</li>
+</ul>
+</li>
+       <li>vendors_manage
+<ul>
+       <li>Manage vendors</li>
+</ul>
+</li>
+</ul>
+<h3>Granular Serials Permissions</h3>
+<p>If the staff member has 'serials' permissions they have the ability to perform all of these actions. If you would like to control serials permissions on a more granular level choose from these options:</p>
+<ul>
+       <li>check_expiration
+<ul>
+       <li>Check the expiration of a serial</li>
+</ul>
+</li>
+       <li>claim_serials
+<ul>
+       <li>Claim missing serials</li>
+</ul>
+</li>
+       <li>create_subscription
+<ul>
+       <li>Create a new subscription</li>
+</ul>
+</li>
+       <li>delete_subscription
+<ul>
+       <li>Delete an existing subscription</li>
+</ul>
+</li>
+       <li>edit_subscription
+<ul>
+       <li>Edit (but not delete or create) an existing subscription</li>
+</ul>
+</li>
+       <li>receive_serials
+<ul>
+       <li>Receive serials on existing subscriptions</li>
+</ul>
+</li>
+       <li>renew_subscription
+<ul>
+       <li>Renew an existing subscription</li>
+</ul>
+</li>
+       <li>routing
+<ul>
+       <li>Manage routing lists</li>
+</ul>
+</li>
+</ul>
+<h3>Granular Tools Permissions</h3>
+<p>If the staff member has 'tools' permissions they have the ability to access and use all items under the Tools menu. If you would like to control which tools staff members have access to on a more granular level choose from these options:</p>
+<ul>
+       <li>batch_upload_patron_images
+<ul>
+       <li>Upload patron images in batch or one at a time (Access to the Image Upload Tool)</li>
+</ul>
+</li>
+       <li>delete_anonymize_patrons
+<ul>
+       <li>Delete old borrowers and anonymize circulation/reading history (Access to the Anonymize Patron Tool)</li>
+</ul>
+</li>
+       <li>edit_calendar
+<ul>
+       <li>Define days when the library is closed (Access to the Calendar/Holidays Tool)</li>
+</ul>
+</li>
+       <li>edit_news
+<ul>
+       <li>Write news for the OPAC and staff interfaces (Access to the News Tool)</li>
+</ul>
+</li>
+       <li>edit_notice_status_triggers
+<ul>
+       <li>Set notice/status triggers for overdue items (Access to the Overdue Notice Status/Triggers Tool)</li>
+</ul>
+</li>
+       <li>edit_notices
+<ul>
+       <li>Define notices (Access to the Notices Tool)</li>
+</ul>
+</li>
+       <li>export_catalog
+<ul>
+       <li>Export bibliographic and holdings data (Access to the Export Bibliographic &amp; Holdings Data Tool)</li>
+</ul>
+</li>
+       <li>import_patrons
+<ul>
+       <li>Import patron data (Access to the Import Patrons Tool)</li>
+</ul>
+</li>
+       <li>inventory
+<ul>
+       <li>Perform inventory (stocktaking) of your catalog (Access to the Inventory Tool)</li>
+</ul>
+</li>
+       <li>items_batchdel
+<ul>
+       <li>Perform batch deletion of items (Access to the Delete a queryset of items Tool)</li>
+</ul>
+</li>
+       <li>items_batchmod
+<ul>
+       <li>Perform batch modification of items (Access to the Modify a queryset of items Tool)</li>
+</ul>
+</li>
+       <li>label_creator
+<ul>
+       <li>Create printable labels and barcodes from catalog and patron data (Access to the Label Creator and Quick Label Creator Tools)</li>
+</ul>
+</li>
+       <li>manage_csv_profiles
+<ul>
+       <li>Create and edit CSV profiles (Access to the CSV Profiles Tool)</li>
+</ul>
+</li>
+       <li>manage_staged_marc
+<ul>
+       <li>Managed staged MARC records, including completing and reversing imports (Access to the Manage Staged MARC Records Tool)</li>
+</ul>
+</li>
+       <li>moderate_comments
+<ul>
+       <li>Moderate patron comments (Access to the Comments and Tags Tools)</li>
+</ul>
+</li>
+       <li>schedule_tasks
+<ul>
+       <li>Schedule tasks to run (Access to the Task Scheduler Tool)</li>
+</ul>
+</li>
+       <li>stage_marc_import
+<ul>
+       <li>Stage MARC records into the reservoir (Access to the Stage MARC Records Tool)</li>
+</ul>
+</li>
+       <li>view_system_logs
+<ul>
+       <li>Browse the system logs (Access to the Log Viewer Tool)</li>
+</ul>
+</li>
+</ul>
+<h3>Granular Reports Permissions</h3>
+<p>If the staff member has 'reports' permissions they have the ability to perform all of these actions. If you would like to control reports permissions on a more granular level choose from these options:</p>
+<ul>
+       <li>create_reports
+<ul>
+       <li>The ability to create and edit but not run SQL reports</li>
+</ul>
+</li>
+       <li>execute_reports
+<ul>
+       <li>The ability to run but not create or edit SQL reports</li>
+</ul>
+</li>
+</ul>
+<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
index dc00acf..ba39b43 100644 (file)
@@ -3,13 +3,12 @@
 <h1>Change Patron Password</h1>
 
 <p>Koha cannot display existing passwords, so this form can only be used to change a patron's username and/or password, but not to recover an existing password.</p>
-               <div class="hint">      The default minimum password length is 3 characters long.  To change this value, update your system preferences.
-               </div>
-               <div class="hint">
-                       <ul>
-                               <li><em>Get there:</em> More &gt; Administration &gt; Global System Preferences &gt; Patrons &gt; minPasswordLength</li>
-                       </ul>
-               </div>
+
+<p>The default minimum password length is 3 characters long.  To change this value, update your system preferences.</p>
+
+<ul>
+       <li><em>Get there:</em> More &gt; Administration &gt; Global System Preferences &gt; Patrons &gt; minPasswordLength</li>
+</ul>
 
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
 
index 41f03a3..fbc5ce9 100644 (file)
@@ -1,5 +1,6 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->   
-   <h1>Patron Search</h1>
+
+<h1>Patron Search</h1>
 
 <p>Clicking on the link to the Patron module will bring you to a search/browse screen for patrons. From here you can search for a patron by entering any part of their name or barcode in the search box at the top.</p>
 
index 3967674..431edc0 100644 (file)
 
 <h1>Add Patrons</h1>
 
-<h2>Adding a New Patron</h2>   
-   <p>IMPORTANT: System preferences should be defined before adding new patrons.<p>
-       <ul>
-               <li>
-<em>Get there:</em></span>More &gt; Administration </li>
-       </ul>   Add a new patron:<br/>
-       <ul>
-               <li>Click the 'New' button</li>
-               <li>Choose the type of patron you'd like to add:
-               <ul>
-                       <li>Staff = A user that can be configured to perform functions in the staff client.</li>
-                       <li>Adult = A regular patron (can have child patrons attached to it).</li>
-                       <li>Child = A patron who can have an adult guarantor. </li>
-                       <li>Organization = An organization that can have professional patrons attached to it.</li>
-                       <li>Professional = A patron that can have an organization as a guarantor. </li>
-                       <li>Statistical =                  
-                  A &quot;fake&quot; patron card. When items are scanned on to a Statistical patron card, the items are not checked out, but recorded. 
-                       <ul>
-                               <li>
-                           <span style="background-color: #ffe599">
-TIP: This can be used to record statistics of items that are used, but do not get checked out, such as reference items, magazines, etc. You can then run a report to gather the statistics from this card</span></li>
-                       </ul></li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>       
-                  
-          Each patron type will have slightly different options.</li>     
-               <li>       
-                  
-          Fill in the fields related to your patron
-               <ul>
-                       <li>               
-                                  
-                  Note that the Surname (or Last Name) is required for each patron as a default setting. You can define which fields, if any, should be required. 
-                       <ul>
-                               <li>                       
+<p>Patron categories belong to one of six overreaching categories in Koha.</p>
 
-<em>Get there</em>: Administration &gt; System Preferences &gt; Patrons &gt; BorrowerMandatoryField.</li>
-                       </ul></li>                 
-                       <li>               
-<span style="background-color: #ffe599">
-TIP: 'Initials' and 'Other name' are great for internal use when recognizing patrons</span></li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>If you're adding a 'Child' or 'Professional' you will see an additional field, asking you to define a Guarantor.
-               <ul>
-                       <li>               
-                                  
-                  From this menu you must choose the patron record to link to the child or professional.
-                       <ul>
-                               <li>                       
-                                                  
-                          Click 'Find guarantor' and pick a patron from the resulting list.
-                               <ul>
-                                       <li>
-                                   <span style="background-color: #ffe599">
-TIP: Only patrons of type &quot;A&quot; (adult) are searched for when you look for guarantors through the &quot;find guarantor&quot; interface.  This means that (for example) library staff (type &quot;S&quot;) and other children (type &quot;C&quot;) cannot be found as guarantors</span></li>
-                                       <li style="color: #ff0000">                                
-                                                                  
-                                  IMPORTANT: Entering a patron by hand will not work the way you'd expect - you must search</li>
-                               </ul></li>
-                       </ul></li>
-                       <li>               
-                                  
-                  
-                   <span style="background-color: #ffe599">
-TIP: You can define the terms used in the Guarantor field. 'Mother' and 'Father' are default settings, but you can add &quot;Grandparent&quot; or &quot;Legal Guardian&quot; for instance</span>
-                       <ul>
-                               <li>                       
-                                                  
-                          
-                           <span>
-<em>Get there: </em></span>Administration &gt; Global system preferences &gt; Patrons &gt;borrowerRelationship</li>
-                       </ul></li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>       
-                  
-          If you're adding an 'Organization' you will see fewer fields in this first section.</li>
-               <li>       
-                  
-          Enter your patron's main address.
-               <ul>
-                       <li>               
-                                  
-                  The 'Street type' dropdown menu comes from your Patrons and Circulation parameters.
-                       <ul>
-                               <li>                       
-                                                  
-                          
-                           <span>
-<em>Get there: </em></span>Administration &gt; Patrons and Circulation &gt; Road types</li>
-                       </ul></li>
-                       <li>               
-                                  
-                  The City, State dropdown menu comes from your Patrons and Circulation parameters.
-                       <ul>
-                               <li>
-                           <span>
-<em>Get there: </em></span>Administration &gt; Patrons and circulation &gt; Cities</li>
-                       </ul></li>
-               </ul></li>
-               <li>Enter additional contact information for your patron.<br/>
-               <ul>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: Encourage your patrons to provide an email address. Koha will use this email address to contact patrons when an item they reserved is available and to send overdue notices.</span></li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>Enter an alternate address (if you require one for your library).
-               <ul>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: This is handy if your patron has a PO Box and you want their home address as well.</span></li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>Enter in an additional contact (if you require one for your library)</li>
-               <li>Enter information necessary for patron management in the library
-               <ul>
-                       <li>The card number can be auto-calculated, scanned in from a barcode scanner or entered in by hand. The auto-calculated card number can be turned ON and OFF in your system preferences.
-                       <ul>
-                               <li>
-                           <span>
-<em>Get there</em></span>: Administration &gt; System Preferences &gt; Patrons &gt;  autoMemberNum.</li>
-                       </ul></li>
-                       <li>Library branches are defined in your Basic Parameters.<ul>
-                               <li>
-                           <span>
-<em>Get There:</em></span>Administration &gt; Basic Parameters &gt; Libraries, branches and groups</li>
-                       </ul></li>
-                       <li>Patron Categories are defined in Patrons and Circulation.<ul>
-                               <li>
-                           <span>
-<em>Get There:</em></span>Administration &gt; Patrons and circulation &gt; Patron categories</li>
-                       </ul></li>
-                       <li>The sort fields are used for internal use and reports.</li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>Enter information specific to you library policies.
+<ul>
+       <li>Staff = A user that can be configured to perform functions in the staff client</li>
+       <li>Adult = A regular patron (can have child patrons attached to it)</li>
+       <li>Child = A patron who can belong to an Adult patron</li>
+       <li>Organization = An organization that can have Professional patrons attached to it</li>
+       <li>Professional = A patron that can belong to an Organization</li>
+       <li>Statistical = A patron type used solely for tracking in house usage
+<ul>
+       <li><span style="background-color: #ffe599;">TIP: This can be used to record statistics of items that are used, but do not get checked out, such as reference items, magazines, etc. You can then run a report to gather the statistics from this card</span></li>
+</ul>
+</li>
+</ul>
+<h2>Add a new Patron</h2>
+<ul>
+       <li>Click 'New'</li>
+       <li>Enter the identifying information regarding your patron
+<ul>
+       <li>Required fields are defined in the BorrowerMandatoryField system preference</li>
+       <li>Salutation is populated by the BorrowersTitles system preference</li>
+</ul>
+</li>
+       <li>Next enter the contact information</li>
+       <li>If this patron is a child, you will be asked to attach the child patron to an adult patron
+<ul>
+       <li>Click 'Set to Patron' to search your system for an existing patron</li>
+       <li>If the Guarantor is not in the system, you can enter the first and last name in the fields available</li>
+       <li>The relationships are set using the borrowerRelationship system preference</li>
+</ul>
+</li>
+       <li>If this patron is a professional, you will be asked to attach the patron to an organizational patron
+<ul>
+       <li>Click 'Set to Patron to search your system for an existing patron</li>
+</ul>
+</li>
+       <li>Each patron can have an alternate contact
+<ul>
+       <li>An alternate contact could be a parent or guardian. It can also be used in academic settings to store the patron's home address.</li>
+</ul>
+</li>
+       <li>The library management section includes values that are used within the library
+<ul>
+       <li>The card number field is automatically calculated if you have the autoMemberNum system preference set that way</li>
+       <li>If you accidentally chose the wrong patron category at the beginning you can fix that here</li>
+       <li>Sort 1 and 2 are used for statistical purposes within your library</li>
+</ul>
+</li>
+       <li>Next, the Library Setup section includes additional library settings
+<ul>
+       <li>The registration date will automatically be filled in with today's date</li>
+       <li>If your patron cards expire (based on your patron category settings) the Expiry date will automatically be calculated</li>
+       <li>The OPAC Note is a note for the patron - it will appear in the OPAC on the patron's record</li>
+       <li>The Circulation Note is meant solely for your library staff and will appear when the circulation staff goes to check an item out to the patron</li>
+       <li>The OPAC Login and Password are used by the patron to log into their account in the OPAC. They are also used for staff accounts to provide them access to the staff client.</li>
+</ul>
+</li>
+       <li>If you have set additional patron attributes up, these will appear next</li>
+       <li>Finally, if you have EnhancedMessagingPreferences set to 'allow,' you can choose the messaging preferences for this patron.
+<ul>
+       <li>These preferences will override any you set via the patron categories</li>
+       <li>These preference can be altered by the patron via the OPAC</li>
+</ul>
+</li>
+       <li>Once finished, click 'Save'</li>
+       <li>At this point if the system suspects this patron is a duplicate of another it will warn you.</li>
+</ul>
 
-               <ul>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: Use 'Library note' for notes you'd like your circulation staff to see.</span></li>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: Use 'OPAC note' for notes you'd like the patron to see.<br/></span></li>
-                       <li>
-                   <span style="background-color: #ffe599">
-                                  
-                   <span style="background-color: #ffffff">
-IMPORTANT: Make sure your staff understands the difference between these fields. 'Library note' is a private note that ONLY staff can view. 'OPAC note' WILL be viewed by the patron.<br/></span></span></li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>Provide patrons with a login for the OPAC.
-               <ul>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: Patrons will be able to update/change their password via the OPAC</span></li>
-               </ul></li>
-       </ul>
-       <ul>
-               <li>Click 'Save' to finish the process.</li>
-       </ul><!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
+<h2>Add a Staff Patron</h2>
+
+<p>All staff members must be entered into Koha as patrons of the 'Staff' type. Follow the steps in Add a Patron to add a staff member. To give the staff member permissions to access the staff client, follow the steps in Patron Permissions</p>
+
+<p style="color: #990000">Remember to assign your staff secure usernames and passwords since these will be used to log into the staff client.</p>
+
+<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
index 530d641..a73b748 100644 (file)
@@ -2,7 +2,6 @@
 
 <h1>Patrons help</h1>
 
-<p>This is the Patrons module of Koha.</p>
 <p>The Patrons portion stores the information you add about your patrons.</p>
        <ul>
                <li>To add a patron, type their name into the search box and click the 'Search' button.</li>
@@ -12,4 +11,6 @@
                </ul></li>
                <li>Alternatively, you can browse a section of patron by selecting the first letter of the Patron's last name from the list on the right.</li>
                <li>If the patron does not already have an account, click the 'New' button and choose the patron type you'd like to add</li>
-       </ul><!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
+       </ul>
+       
+<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 8cba0e0..f48f7b5 100644 (file)
@@ -1,15 +1,9 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
-<h1>Patron Messaging Queue</h1>
-
-<p>This tab shows the status of patron notification messages.   Once a message is sent it will say so in the status column.</p>
-               <ul>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: To turn on messaging options you will need to turn the 'EnhancedMessagingPreferences' system preference to 'ON'</span>
-                       <ul>
-                               <li><em>Get there</em>: Administration &gt; System Preferences &gt; Patrons &gt;  EnhancedMessagingPreferences.</li>
-                       </ul></li>
-               </ul>
+<h1>Patron Messaging</h1>
+
+<p>The patron's messaging preferences are set when adding or editing the patron. This tab will show the messages that have been sent and those that are queued to be sent</p>
+
+<p>Once a message is sent it will say so in the status column.</p>
 
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 0dc1889..5a6221b 100644 (file)
@@ -1,12 +1,91 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
-<h1>Member Information Screen</h1>
-
-<p>This screen shows the information associated with a given patron.</p>
-<p>On the top left is their address and card number.</p>
-<p>A patron's annual membership fee payment status also shows on this screen.</p>
-<p>At the bottom of the patron information page you will find quick access to items the patron has checked out, overdue and on hold.</p>
-<p>You can get information on what a patron has read in the past by clicking on the Circulation History button.</p>
-<p>If you would like to edit a patron's information, click the 'Edit' button.  You can also click one of the 'Edit' links below each section on the patron record.</p>
-<p>If you would like to PERMANENTLY delete a user, click 'Delete' under 'More'. A confirmation box will appear, so don't worry about accidentally deleting a record. Just be absolutely sure before you delete!</p>
-<p>If no patron image exists for this patron, click the &quot;Add Patron Images&quot; link to add an image or images. The pixel dimensions should not exceed 200 X 300 and the file size should be under 520K. Only PNG, GIF, JPEG, XPM formats are supported.</p><!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
+<h1>Patron Details</h1>
+
+<p>When viewing a patron record you have the option to view information from one of many tabs found on the left hand side of the record.</p>
+
+<h2>Check Out</h2>
+
+<p>For instruction on checking items out click the Check Out tab and read the help file there.</p>
+
+<h2>Details</h2>
+
+<p>All patron information will appear on the Details tab. This includes all the contact information, notes, messaging preferences, etc entered when adding the patron.
+In the case of patrons who are marked as 'Child' or 'Professional' and their Guarantors additional information will appear on their record.</p>
+
+<ul>
+<li>A child patron will list their Guarantor</li>
+<li>On the Guarantor's record, all children and/or professionals will be listed</li>
+</ul>

+<h2>Fines</h2>
+
+<p>The patron's complete accounting history will appear on the Fines tab. Contrary to its name, the Fines tab does not just show fine data, it also shows membership fees, rental fees, reserve fees and any other charge you may have for patrons.</p>
+
+<h2>Circulation History</h2>
+
+<p>The circulation history tab will appear if you have set the intranetreadinghistory preference to allow it to appear. If you have the OPACPrivacy system preference set to 'Allow' and the patron has decided that the library cannot keep this information this tab will only show currently checked out items.</p>
+
+<h2>Modification Log</h2>
+
+<p>If you have set your BorrowersLog to track changes to patron records, then this tab will appear. The Modification Log will show all changes made to the patron record.</p>
+
+<ul>
+<li>The Librarian field shows the patron number for the librarian who made the changes</li>
+<li>The Object field lists the patron that is being modified</li>
+</ul>
+
+<h2>Messaging</h2>
+
+<p>The patron's messaging preferences are set when adding or editing the patron. This tab will show the messages that have been sent and those that are queued to be sent</p>
+
+<h2>Notices</h2>
+
+<p>The patron's messaging preferences are set when adding or editing the patron. This tab will show the messages that have been sent and those that are queued to be sent with their entire body content</p>
+
+<h2>Editing Patrons</h2>
+
+<p>Patrons in Koha can be edited using one of many edit buttons.</p>
+<ul>
+       <li>To edit the entire patron record simply click the 'Edit' button at the top of the patron record.</li>
+       <li>To only change the patron's password, click the 'Change Password' button
+<ul>
+       <li>Patron passwords are encrypted and cannot be recovered by the library staff</li>
+       <li>This form will automatically generate a random password, this password is not the patron's current password, just a new random password</li>
+</ul>
+</li>
+       <li>To edit a specific section of the patron record (for example the Library Use section) click the 'Edit' link below the section</li>
+       <li>A patron image can be added by browsing for the image on your machine from the 'Manage Patron Image' section
+<ul>
+       <li>This form will not appear if you have the patronimages system preference to allow patron images</li>
+       <li>To add patron images in bulk, use the Upload Patron Images Tool</li>
+</ul>
+</li>
+       <li>Patrons can also be blocked from checking items out by setting Patron Flags
+<ul>
+       <li>If you would like your circulation staff to confirm a patron's address before checking items out to the patron, you can see the 'Gone no Address' flag</li>
+       <li>If you would like to bar a patron from the library you can set the 'Debarred' flag
+<ul>
+       <li>This flag can automatically be set with the Overdue/Notice Status Triggers</li>
+</ul>
+</li>
+       <li>If the patron reports that they have lost their card you can set the 'Lost Card' flag to prevent someone else from using that card to check items out</li>
+</ul>
+</li>
+</ul>
+
+<h2>Duplicate a Patron</h2>
+
+<p>Sometimes when you're adding a new family to your system you don't want to type the contact information over and over. Koha allows for you to duplicate a patron and change only the parts you want to (or need to) change.</p>
+
+<ul>
+       <li>Open the patron you want to use as your base (the patron you want to duplicate information from)</li>
+       <li>Click the 'Duplicate' button at the top of their record</li>
+       <li>All of the fields with the exception of first name, card number, opac login and opac password have been duplicated. Fill in the missing pieces and click 'Save'
+<ul>
+       <li><span style="background-color: #ffe599;">TIP: Clicking in a field that is already populated with data will clear that field of all information (making it easier for you to type in something different)</span></li>
+</ul>
+</li>
+       <li>You will be brought to your new patron</li>
+</ul>
+
+<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/notices.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/notices.tmpl
new file mode 100644 (file)
index 0000000..68da5d4
--- /dev/null
@@ -0,0 +1,7 @@
+<!-- TMPL_INCLUDE NAME="help-top.inc" -->
+
+<h1>Patron Notices</h1>
+
+<p>The patron's messaging preferences are set when adding or editing the patron. This tab will show the messages that have been sent and those that are queued to be sent with their entire body content</p>
+
+<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 58a88d5..bf271c3 100644 (file)
@@ -1,17 +1,18 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
-<h1>Pay Fines</h1>
-               <ul>
-                       <li>To pay fines, click the 'Pay fines' tab</li>
-                       <li>Each charge gives you a menu which lets you decide whether to mark items paid or not</li>
-                       <li>By choosing 'Paid' the system assumes that a full payment is being made</li>
-                       <li>Payments will appear on the Account tab</li>
-                       <li>You can also create manual invoices/charges or apply manual credits to patron's accounts
-                       <ul>
-                               <li>
-                           <span style="background-color: #ffe599">
-TIP: If you create a manual credit, be aware that it won't be applied to any particular lost or late item</span></li>
-                       </ul></li>
-               </ul>
+<h1>Pay/Reverse Fines</h1>
+
+<p>Each line item can be paid in full (or written off) using the 'Pay Fines' tab.</p>
+
+<ul>
+       <li>Choose the payment type (Unpaid, Paid, Writeoff) from the pull down menu</li>
+       <li>Click 'Make Payment'</li>
+       <li>A line item will be added to the account information showing the fee paid in full (or written off)</li>
+       <li>If you accidentally mark and item as paid, you can reverse that line item by clicking 'Reverse' to the right of the line
+<ul>
+       <li>Once clicked a new line item will be added to the account, showing the payment as reversed</li>
+</ul>
+</li>
+</ul>
 
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 8c4cb9a..a9bf479 100644 (file)
@@ -1,17 +1,7 @@
 <!-- TMPL_INCLUDE NAME="help-top.inc" -->
 
 <h1>Patron Cirulation History Help</h1>
-               <ul>
-                       <li>To see the patron's reading history, click on the 'Circulation History' tab on the menu to the left.</li>
-                       <li>
-                   <span style="background-color: #ffe599">
-TIP: This will only show a reading history if you have the 'intranetreadinghistory' preference turned 'ON'</span>
-                       <ul>
-                               <li>
-                           <span>
-<em>Get there:</em></span>Administration &gt; Global system preferences &gt; Patrons &gt; intranetreadinghistory</li>
-                       </ul></li>
-                       <li>To see the history of changes to the patron record click on 'Modification Log' on the menu to the left.</li>
-               </ul>
+
+<p>The circulation history tab will appear if you have set the intranetreadinghistory preference to allow it to appear. If you have the OPACPrivacy system preference set to 'Allow' and the patron has decided that the library cannot keep this information this tab will only show currently checked out items.</p>
 
 <!-- TMPL_INCLUDE NAME="help-bottom.inc" -->
\ No newline at end of file
index 0187cf9..b4bc17d 100644 (file)
@@ -1,6 +1,6 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><title>Koha &rsaquo;  Labels</title>
-<!-- TMPL_INCLUDE NAME="calendar.inc" -->
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="calendar.inc" -->
 <style type="text/css">#custom-doc { width:47.23em;*width:46.04em;min-width:610px; margin:auto;margin-top: .4em; text-align:left; }</style>
 </head>
 <body>
index a746307..6cee5b2 100644 (file)
@@ -1,6 +1,6 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Patrons &rsaquo; 
-<!-- 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--></title>
+<!-- TMPL_IF NAME="opadd" -->Add<!-- TMPL_ELSIF NAME="opduplicate" -->Duplicate<!-- 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--></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
 <script type="text/JavaScript" language="JavaScript">
@@ -71,9 +71,8 @@
                Add<!--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_VAR NAME="surname" --> <!-- TMPL_VAR name="firstname" -->
 <!-- TMPL_ELSE --> 
-<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> &rsaquo; <strong>Modify<!--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 -->
+<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=<!-- TMPL_VAR NAME="borrowernumber" -->"><!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --></a> &rsaquo; <strong><!-- TMPL_IF NAME="opduplicate" -->Duplicate<!-- 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 -->
 </strong><!-- /TMPL_IF --></div>
-
 <!-- TMPL_IF NAME="opadd" --><div id="doc" class="yui-t7"><!-- TMPL_ELSE --><div id="doc3" class="yui-t2"><!-- /TMPL_IF -->
    
    <div id="bd">
@@ -91,7 +90,7 @@
        </h1>
        <!-- TMPL_ELSE -->
        <h1>
-               Modify<!--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_IF NAME="opduplicate" -->Duplicate<!-- 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_VAR name="firstname" --> <!-- TMPL_VAR NAME="surname" --> 
        </h1>
        <!-- /TMPL_IF -->
                        </ul>
                </div>
        <!-- /TMPL_IF -->
-       
-  
+
+
 <!-- TMPL_UNLESS NAME="check_member" --><form name="form" id="entryform"  action="/cgi-bin/koha/members/memberentry.pl" method="post">
 <input type="hidden" name="nodouble"  value="<!-- TMPL_VAR NAME="nodouble" -->" /> <!-- /TMPL_UNLESS -->
 <!--    field always hidden in different form (1,2,3) -->
 <input type="hidden" name="select_roadtype" value="<!-- TMPL_VAR NAME="select_roadtype" -->" />
 <input type="hidden" name="destination" value="<!-- TMPL_VAR NAME="destination" -->" />
 <input type="hidden" name="check_member" value="<!-- TMPL_VAR NAME="check_member" -->" />
-<input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
+<input type="hidden" name="borrowernumber" value="<!-- TMPL_IF NAME="opduplicate" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="borrowernumber" --><!-- /TMPL_IF -->" />
+<input type="hidden" name="nodouble"  value="<!-- TMPL_IF NAME="opduplicate" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="nodouble" --><!-- /TMPL_IF -->" />
 <!--TMPL_IF Name="step"--><input type="hidden" name="step"  value="<!-- TMPL_VAR NAME="step" -->" /><!--/TMPL_IF-->
-<!-- TMPL_IF NAME="opadd" --><input type="hidden" name="op" value="insert" /><!-- TMPL_ELSE --><input type="hidden" name="op" value="save" /><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="opadd" --><input type="hidden" name="op" value="insert" /><!-- TMPL_ELSIF NAME="opduplicate" --><input type="hidden" name="op" value="insert" /><!-- TMPL_ELSE --><input type="hidden" name="op" value="save" /><!-- /TMPL_IF -->
 
 <!--TMPL_IF Name="step_1"-->
        <fieldset class="rows" id="memberentry_identity">
                <!-- /TMPL_IF-->
                Surname: </label>
                <!-- TMPL_IF NAME="uppercasesurnames" -->
-               <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="<!-- TMPL_VAR NAME="surname" -->" />
+               <input style="text-transform:uppercase;" type="text" id="surname" name="surname" size="20"  value="<!-- TMPL_VAR NAME="surname" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                <!-- TMPL_ELSE -->
-               <input type="text" id="surname" name="surname" size="20"  value="<!-- TMPL_VAR NAME="surname" -->" />
+               <input type="text" id="surname" name="surname" size="20"  value="<!-- TMPL_VAR NAME="surname" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                <!-- /TMPL_IF -->
                <!-- TMPL_IF NAME="mandatorysurname" --><span class="required">Required</span><!-- /TMPL_IF -->
                </li>
                 <label for="firstname">
                 <!-- /TMPL_IF-->
                 First name: </label>
-                <input type="text" id="firstname" name="firstname" size="20"  value="<!-- TMPL_VAR NAME="firstname" -->" />
+                <input type="text" id="firstname" name="firstname" size="20"  value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="firstname" --><!-- /TMPL_IF -->" />
                 <!-- TMPL_IF NAME="mandatoryfirstname" --><span class="required">Required</span><!-- /TMPL_IF -->
             </li>
             <li>
                 Date of birth: </label>
                                
        <!-- TMPL_IF NAME="metric" -->                  
-                <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="<!-- TMPL_VAR NAME="dateofbirth" -->" />
+                <input type="text" id="dateofbirth" name="dateofbirth" size="20" onchange="CheckDate(document.form.dateofbirth);" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="dateofbirth" --><!-- /TMPL_IF -->" />
 <!-- TMPL_ELSE -->
-                <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="<!-- TMPL_VAR NAME="dateofbirth" -->" />
+                <input type="text" id="dateofbirth" name="dateofbirth" size="20" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="dateofbirth" --><!-- /TMPL_IF -->" />
 <!-- /TMPL_IF -->
 
                 <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" id="dateofbirth_button" alt="Show Calendar" />
                     <label for="initials">
                 <!-- /TMPL_IF-->
                 Initials: </label>
-                <input type="text" id="initials" name="initials" size="20"  value="<!-- TMPL_VAR NAME="initials" -->" />       
+                <input type="text" id="initials" name="initials" size="20"  value="<!-- TMPL_VAR NAME="initials" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />     
                 <!-- TMPL_IF NAME="mandatoryinitials" --><span class="required">Required</span><!-- /TMPL_IF -->
             </li>
         <!-- /TMPL_UNLESS -->
                        <label for="othernames">
                        <!-- /TMPL_IF-->
                        Other name: </label>
-                       <input type="text" id="othernames" name="othernames" size="20"  value="<!-- TMPL_VAR NAME="othernames" -->" />
+                       <input type="text" id="othernames" name="othernames" size="20"  value="<!-- TMPL_VAR NAME="othernames" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
 <!-- TMPL_IF NAME="mandatoryothernames" --><span class="required">Required</span><!-- /TMPL_IF -->
                <!-- TMPL_IF NAME="I" --><input type="hidden" name="sex" value="N" /><!-- /TMPL_IF -->
                </li>
                    <span><!-- TMPL_VAR NAME="contactname" --></span>
                    <input name="contactname" id="contactname" type="hidden" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
                    <!-- TMPL_ELSE -->
-                   <input name="contactname" id="contactname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
+                   <input name="contactname" id="contactname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactname" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                    <!-- /TMPL_IF -->
                </li>
 <!-- TMPL_ELSE -->
      <span><!-- TMPL_VAR NAME="contactname" --></span>
      <input name="contactname" id="contactname" type="hidden" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
      <!-- TMPL_ELSE -->
-     <input name="contactname" id="contactname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactname" -->" />
+     <input name="contactname" id="contactname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactname" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
      <!-- /TMPL_IF -->
  </li>
  <li>
      <span><!-- TMPL_VAR NAME="contactfirstname" --></span>
      <input name="contactfirstname" id="contactfirstname" type="hidden" size="20" value="<!-- TMPL_VAR NAME="contactfirstname" -->" />
      <!-- TMPL_ELSE -->
-     <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactfirstname" -->" />
+     <input name="contactfirstname" id="contactfirstname" type="text" size="20" value="<!-- TMPL_VAR NAME="contactfirstname" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
      <!-- /TMPL_IF -->
  </li>
  <!-- TMPL_IF name="relshiploop" -->
       <label for="streetnumber">
       <!-- /TMPL_IF-->
       Street number: </label>
-      <input type="text" id="streetnumber" name="streetnumber" size="5" value="<!-- TMPL_VAR NAME="streetnumber" -->" />
+      <input type="text" id="streetnumber" name="streetnumber" size="5" value="<!-- TMPL_VAR NAME="streetnumber" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
 <!-- TMPL_IF NAME="mandatorystreetnumber" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     <!-- TMPL_IF NAME="road_cgipopup" -->
       <label for="address">
       <!--/TMPL_IF-->
       Address: </label>
-      <input type="text" id="address" name="address" size="35" value="<!-- TMPL_VAR NAME="address" -->" />
+      <input type="text" id="address" name="address" size="35" value="<!-- TMPL_VAR NAME="address" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryaddress" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     <li>
       <label for="address2">
       <!-- /TMPL_IF-->
       Address 2: </label>
-      <input type="text" id="address2" name="address2" size="35" value="<!-- TMPL_VAR NAME="address2" -->" />
+      <input type="text" id="address2" name="address2" size="35" value="<!-- TMPL_VAR NAME="address2" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryaddress2" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>  
     <li>
       <!-- /TMPL_IF-->
       City, State: </label>
         
-        <input type="text" id="city" name="city" size="20" value="<!-- TMPL_VAR NAME="city" -->" />
+        <input type="text" id="city" name="city" size="20" value="<!-- TMPL_VAR NAME="city" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
         <!-- TMPL_IF NAME="city_cgipopup" -->or <strong>choose</strong>
         <select id="select_city" name="select_city">
         <!-- TMPL_LOOP NAME="city_loop" -->
         <label for="zipcode">
       <!-- /TMPL_IF-->
       Zip/Postal code: </label>
-      <input type="text" name="zipcode" id="zipcode" size="10" value="<!-- TMPL_VAR NAME="zipcode" -->" />
+      <input type="text" name="zipcode" id="zipcode" size="10" value="<!-- TMPL_VAR NAME="zipcode" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryzipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     
         <label for="country">
       <!-- /TMPL_IF-->
       Country: </label>
-      <input type="text" name="country" id="country" size="20" value="<!-- TMPL_VAR NAME="country" -->" />
+      <input type="text" name="country" id="country" size="20" value="<!-- TMPL_VAR NAME="country" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatorycountry" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>    
   
       <label for="phone">
       <!-- /TMPL_IF-->
       Phone (home): </label>
-      <input type="text" id="phone" name="phone" value="<!-- TMPL_VAR NAME="phone" -->" />
+      <input type="text" id="phone" name="phone" value="<!-- TMPL_VAR NAME="phone" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryphone" --><span class="required">Required</span><!-- /TMPL_IF --><div class="hint">Shows on transit slips</div>
 
     </li>
       <label for="phonepro">
       <!-- /TMPL_IF-->
       Phone (work): </label>
-      <input type="text" id="phonepro" name="phonepro" value="<!-- TMPL_VAR NAME="phonepro" -->" />
+      <input type="text" id="phonepro" name="phonepro" value="<!-- TMPL_VAR NAME="phonepro" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryphonepro" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     <li>
       <label for="mobile">
       <!-- /TMPL_IF-->
       Phone (cell): </label>
-      <input type="text" id="mobile" name="mobile" value="<!-- TMPL_VAR NAME="mobile" -->" />
+      <input type="text" id="mobile" name="mobile" value="<!-- TMPL_VAR NAME="mobile" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatorymobile" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     <li>
       <!--TMPL_ELSE-->
       <label for="email">
       <!-- /TMPL_IF-->
-      Email (home): </label>
-      <input type="text" id="email" name="email" size="45" value="<!-- TMPL_VAR NAME="email" -->" />  
+      Primary Email: </label>
+      <input type="text" id="email" name="email" size="45" value="<!-- TMPL_VAR NAME="email" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />  
          <!-- TMPL_IF NAME="mandatoryemail" --><span class="required">Required</span><!-- /TMPL_IF --><div class="hint">Shows on transit slips</div>
 
     </li>
       <!--TMPL_ELSE-->
       <label for="emailpro">
       <!-- /TMPL_IF-->
-      Email (work): </label>
-      <input type="text" id="emailpro" name="emailpro" size="45" value="<!-- TMPL_VAR NAME="emailpro" -->" />
+      Secondary Email: </label>
+      <input type="text" id="emailpro" name="emailpro" size="45" value="<!-- TMPL_VAR NAME="emailpro" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryemailpro" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
     <li>
       <label for="fax">
       <!-- /TMPL_IF-->
       Fax: </label>
-      <input type="text" id="fax" name="fax" value="<!-- TMPL_VAR NAME="fax" -->" />
+      <input type="text" id="fax" name="fax" value="<!-- TMPL_VAR NAME="fax" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryfax" --><span class="required">Required</span><!-- /TMPL_IF -->
     </li>
        </ol>
                                        <label for="B_address">
                                <!-- /TMPL_IF-->
                                Address: </label>
-                               <input type="text" id="B_address" name="B_address" size="40" value="<!-- TMPL_VAR NAME="B_address" -->" />
+                               <input type="text" id="B_address" name="B_address" size="40" value="<!-- TMPL_VAR NAME="B_address" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryB_address" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                        <label for="B_address2">
                                <!-- /TMPL_IF-->
                                Address 2: </label>
-                               <input type="text" id="B_address2" name="B_address2" size="40" value="<!-- TMPL_VAR NAME="B_address2" -->" />
+                               <input type="text" id="B_address2" name="B_address2" size="40" value="<!-- TMPL_VAR NAME="B_address2" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryB_address2" --><span class="required">Required</span><!-- /TMPL_IF -->
-                       </li>                   
+                       </li>
                        <li>
                                <!-- TMPL_IF NAME="mandatoryB_city" -->
                                        <label for="B_city" class="required" >
                                        <label for="B_city">
                                <!-- /TMPL_IF-->
                                City, State: </label>
-                               <input type="text" id="B_city" name="B_city" size="20" value="<!-- TMPL_VAR NAME="B_city" -->" />
+                               <input type="text" id="B_city" name="B_city" size="20" value="<!-- TMPL_VAR NAME="B_city" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryB_city" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                        <label for="B_zipcode">
                                <!-- /TMPL_IF-->
                                Zip/Postal code: </label>
-                               <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="<!-- TMPL_VAR NAME="B_zipcode" -->" />
+                               <input type="text" id="B_zipcode" name="B_zipcode" maxlength="10" size="10" value="<!-- TMPL_VAR NAME="B_zipcode" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryB_zipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                        <label for="B_country">
                                <!-- /TMPL_IF-->
                                Country: </label>
-                               <input type="text" id="B_country" name="B_country" size="20" value="<!-- TMPL_VAR NAME="B_country" -->" />
+                               <input type="text" id="B_country" name="B_country" size="20" value="<!-- TMPL_VAR NAME="B_country" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatoryB_country" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
             <li>
                 <label for="B_phone">
                 <!-- /TMPL_IF-->
                 Phone: </label>  
-                <input type="text" id="B_phone" name="B_phone" value="<!-- TMPL_VAR NAME="B_phone" -->" />
+                <input type="text" id="B_phone" name="B_phone" value="<!-- TMPL_VAR NAME="B_phone" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                 <!-- TMPL_IF NAME="mandatoryB_phone" --><span class="required">Required</span><!-- /TMPL_IF -->
             </li>
                        <li> 
           <label for="B_email">
         <!-- /TMPL_IF-->
         Email: </label>
-        <input type="text" id="B_email" name="B_email" size="45" value="<!-- TMPL_VAR NAME="B_email" -->" />
+        <input type="text" id="B_email" name="B_email" size="45" value="<!-- TMPL_VAR NAME="B_email" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                <!-- TMPL_IF NAME="mandatoryB_email" --><span class="required">Required</span><!-- /TMPL_IF --> </li>
             <li>
                 <!-- TMPL_IF NAME="mandatorycontactnote" -->
                                <label for="altcontactsurname">
                                <!-- /TMPL_IF -->
                                Surname:</label>
-                               <input type="text" name="altcontactsurname" id="altcontactsurname" value="<!-- TMPL_VAR NAME="altcontactsurname" -->" />
+                               <input type="text" name="altcontactsurname" id="altcontactsurname" value="<!-- TMPL_VAR NAME="altcontactsurname" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                                <!-- TMPL_IF NAME="mandatoryaltcontactsurname" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                <label for="altcontactfirstname">
                                <!-- /TMPL_IF -->
                                First name:</label>
-                               <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="<!-- TMPL_VAR NAME="altcontactfirstname" -->" />
+                               <input type="text" name="altcontactfirstname" id="altcontactfirstname" value="<!-- TMPL_VAR NAME="altcontactfirstname" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                                <!-- TMPL_IF NAME="mandatoryaltcontactfirstname" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                <label for="altcontactaddress1">
                                <!-- /TMPL_IF -->
                                Address:</label>
-                               <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="<!-- TMPL_VAR NAME="altcontactaddress1" -->" size="40" />
+                               <input type="text" name="altcontactaddress1" id="altcontactaddress1" value="<!-- TMPL_VAR NAME="altcontactaddress1" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> size="40" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactaddress1" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                <label for="altcontactaddress2">
                                <!-- /TMPL_IF -->
                                Address 2:</label>
-                               <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="<!-- TMPL_VAR NAME="altcontactaddress2" -->" size="40" />
+                               <input type="text" name="altcontactaddress2" id="altcontactaddress2" value="<!-- TMPL_VAR NAME="altcontactaddress2" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> size="40" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactaddress2" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                <label for="altcontactaddress3">
                                <!-- /TMPL_IF -->
                                City, State:</label>
-                               <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="<!-- TMPL_VAR NAME="altcontactaddress3" -->" size="40" />
+                               <input type="text" name="altcontactaddress3" id="altcontactaddress3" value="<!-- TMPL_VAR NAME="altcontactaddress3" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> size="40" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactaddress3" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                <label for="altcontactzipcode">
                                <!-- /TMPL_IF -->
                                Zip/Postal code:</label>
-                               <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="<!-- TMPL_VAR NAME="altcontactzipcode" -->" size="5" />
+                               <input type="text" name="altcontactzipcode" id="altcontactzipcode" value="<!-- TMPL_VAR NAME="altcontactzipcode" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> size="5" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactzipcode" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
                        <li>
                                <label for="altcontactcountry">
                                <!-- /TMPL_IF -->
                                Country:</label>
-                               <input type="text" name="altcontactcountry" id="altcontactcountry" value="<!-- TMPL_VAR NAME="altcontactcountry" -->" size="20" />
+                               <input type="text" name="altcontactcountry" id="altcontactcountry" value="<!-- TMPL_VAR NAME="altcontactcountry" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> size="20" />
                                <!-- TMPL_IF NAME="mandatoryaltcontactcountry" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>                   
                        <li>
                                <label for="altcontactphone">
                                <!-- /TMPL_IF -->
                                Phone:</label>
-                               <input type="text" name="altcontactphone" id="altcontactphone" value="<!-- TMPL_VAR NAME="altcontactphone" -->" />
+                               <input type="text" name="altcontactphone" id="altcontactphone" value="<!-- TMPL_VAR NAME="altcontactphone" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                                <!-- TMPL_IF NAME="mandatoryaltcontactphone" --><span class="required">Required</span><!-- /TMPL_IF -->
                        </li>
             </ol>
       <label for="cardnumber">
     <!-- /TMPL_IF--> 
     Card number: </label>
-    <input type="text" id="cardnumber" name="cardnumber" size="20" value="<!-- TMPL_VAR NAME="cardnumber" -->" />
+    <input type="text" id="cardnumber" name="cardnumber" size="20" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="cardnumber" --><!-- /TMPL_IF -->" />
          <!-- TMPL_IF NAME="mandatorycardnumber" --><span class="required">Required</span><!-- /TMPL_IF --></li>
     <li>
       <!-- TMPL_IF NAME="mandatorybranchcode" -->
     <!--TMPL_IF NAME="CGIsort2" --> 
       <!-- TMPL_VAR NAME="CGIsort2" -->
     <!--TMPL_ELSE-->
-      <input  type="text" id="sort2" name="sort2" size="20"  value="<!-- TMPL_VAR NAME="sort2" -->" />
+      <input  type="text" id="sort2" name="sort2" size="20"  value="<!-- TMPL_VAR NAME="sort2" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
          <!-- TMPL_IF NAME="mandatorysort2" --><span class="required">Required</span><!-- /TMPL_IF -->
     <!-- /TMPL_IF --> 
     </li>
                        OPAC Login: </label>
 
 <!-- TMPL_IF NAME="NoUpdateLogin" -->
-<input type="text" id="userid" name="userid" size="20" disabled="disabled" value="<!-- TMPL_VAR NAME="userid" -->" />
+<input type="text" id="userid" name="userid" size="20" disabled="disabled" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="userid" --><!-- /TMPL_IF -->" />
 <!-- TMPL_ELSE -->
-<input type="text" id="userid" name="userid" size="20" value="<!-- TMPL_VAR NAME="userid" -->" />
+<input type="text" id="userid" name="userid" size="20" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="userid" --><!-- /TMPL_IF -->" />
 <!-- /TMPL_IF -->
 
          <!-- TMPL_IF NAME="mandatoryuserid" --><span class="required">Required</span><!-- /TMPL_IF -->
                        Password: </label>
                        <!--TMPL_IF NAME="opadd"-->
                        <!-- TMPL_IF NAME="NoUpdateLogin" -->
-                               <input type="text" id="password" name="password" size="20"  disabled="disabled" value="<!-- TMPL_VAR NAME="password" -->" />
+                               <input type="text" id="password" name="password" size="20"  disabled="disabled" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="password" --><!-- /TMPL_IF -->" />
 <!-- TMPL_ELSE -->
-                               <input type="text" id="password" name="password" size="20" value="<!-- TMPL_VAR NAME="password" -->" />
+                               <input type="text" id="password" name="password" size="20" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE--><!-- TMPL_VAR NAME="password" --><!-- /TMPL_IF -->" />
 <!-- /TMPL_IF -->
                        <!--TMPL_ELSE-->
                        <!--TMPL_IF NAME="password"-->
                                <!-- TMPL_IF NAME="NoUpdateLogin" -->
                                        <input type="text" id="password" name="password" size="20"  disabled="disabled" value="****" />
                                <!-- TMPL_ELSE -->
-                                       <input type="text" id="password" name="password" size="20" value="****" />
+                                       <input type="text" id="password" name="password" size="20" value="<!-- TMPL_IF NAME="opduplicate" --><!--TMPL_ELSE-->****<!-- /TMPL_IF -->" />
                                <!-- /TMPL_IF -->
                        <!--TMPL_ELSE-->
                                <!-- TMPL_IF NAME="NoUpdateLogin" -->
                                <!-- TMPL_IF EXPR="key eq 'debarred'" -->Debarred:<!-- /TMPL_IF -->
                                <!-- TMPL_IF EXPR="key eq 'lost'" -->Lost Card:<!-- /TMPL_IF -->
                 </label>
-                               
                                <label for="yes<!-- TMPL_VAR NAME="name" -->">Yes </label>
                                <!-- TMPL_IF NAME="yes" -->
                                <input type="radio" id="yes<!-- TMPL_VAR NAME="name" -->" name="<!-- TMPL_VAR NAME="name" -->" value="1" checked="checked" />
                                <!-- TMPL_ELSE -->
                                <input type="radio" id="yes<!-- TMPL_VAR NAME="name" -->" name="<!-- TMPL_VAR NAME="name" -->" value="1" />
                                <!-- /TMPL_IF -->
-                               
                                <label for="no<!-- TMPL_VAR NAME="name" -->">No </label>
                                <!-- TMPL_IF NAME="no" -->
                                <input type="radio" id="no<!-- TMPL_VAR NAME="name" -->" name="<!-- TMPL_VAR NAME="name" -->" value="0" checked="checked"/>
                     </select>
                 <!-- TMPL_ELSE -->
                     <input type="text" maxlength="64" value="<!-- TMPL_VAR NAME="value" -->"
-                           id="<!-- TMPL_VAR NAME="form_id" -->" name="<!-- TMPL_VAR NAME="form_id" -->" />
+                           id="<!-- TMPL_VAR NAME="form_id" -->" name="<!-- TMPL_VAR NAME="form_id" -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
                 <!-- /TMPL_IF -->
                 <!-- TMPL_IF NAME="password_allowed" -->
                     (Password: <input type="password" maxlength="64" value="<!-- TMPL_VAR NAME="password" -->"
     <!-- TMPL_INCLUDE NAME="messaging-preference-form.inc" -->
     <!-- TMPL_IF NAME="SMSSendDriver" -->
         <p><label for="SMSnumber">SMS number:</label> 
-          <input type="text" id="SMSnumber" name="SMSnumber" value="<!-- TMPL_VAR NAME="SMSnumber"  -->" />
+          <input type="text" id="SMSnumber" name="SMSnumber" value="<!-- TMPL_VAR NAME="SMSnumber"  -->"<!--TMPL_IF NAME="opduplicate"--> onclick="this.value=''"<!-- /TMPL_IF --> />
         </p>
     <!-- /TMPL_IF -->
   </fieldset>
index a45b8ff..df517f4 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Summary for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> (<!-- TMPL_VAR NAME="cardnumber" -->)</title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/print.css" />
 </head>
 <body>
index 4a4d23a..c6535cf 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Print Receipt for <!-- TMPL_VAR NAME="cardnumber" --></title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/print.css" />
 
 <script language="javascript">
index 9f93dd9..b5155b9 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Print Receipt for <!-- TMPL_VAR NAME="cardnumber" --></title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/printreceiptinvoice.css" />
 <script language="javascript">
         window.print();
@@ -58,4 +58,4 @@
   </tfoot>
 </table>
 </div>
-<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
\ No newline at end of file
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index 6f2a3e6..62ebab1 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Print Receipt for <!-- TMPL_VAR NAME="cardnumber" --></title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="IntranetFavicon" --><!-- TMPL_VAR NAME="IntranetFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/printreceiptinvoice.css" />
 <script language="javascript">
         window.print();
index 6d65063..480f2e9 100644 (file)
@@ -1,5 +1,5 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
-<title>Reading Record for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></title>
+<title>Circulation History for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></title>
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
@@ -21,7 +21,7 @@
 <!-- TMPL_INCLUDE NAME="header.inc" -->
 <!-- TMPL_INCLUDE NAME="patron-search.inc" -->
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Reading Record for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Circulation History for <!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --></div>
 
 <div id="doc3" class="yui-t2">
    
@@ -29,7 +29,7 @@
        <div id="yui-main">
        <div class="yui-b">
 <!-- TMPL_INCLUDE NAME="circ-toolbar.inc" -->
-<h1>Reading Record</h1>
+<h1>Circulation History</h1>
 <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" /></form>
 
 <span id="pagertable_readingrec" class="pager">
index b20a2f7..9fd5fcd 100644 (file)
@@ -204,19 +204,6 @@ function Dopop(link) {
      <!--/TMPL_LOOP --> 
     </select>
                        </li>
-                       <li>
-                               <label for="day">Day: </label>
-                               <input type="text" name="Filter" id="day" value="" />
-                       </li>
-                       <li>
-                               <label for="month">Month: </label>
-                               <input type="text" name="Filter" id="month" value="" />
-                       </li>
-                       <li>
-                               <label for="year">Year: </label>
-                               <input type="text" name="Filter" id="year" value="" />
-                       </li>
-
                </ol>
        </fieldset>
        
@@ -227,6 +214,7 @@ function Dopop(link) {
                                                <option value ="10">10</option>
                                                <option value ="15">15</option>
                                                <option value ="20">20</option>
+                        <option value ="">No Limit</option>
        <!--                                    <option value ="25">25</option>
                                                <option value ="40">40</option>
                                                <option value ="50">50</option>
index c5868a0..6933393 100644 (file)
@@ -19,6 +19,9 @@
 <style type="text/css">
     #sql { width: 90%; height: 9em;}
 </style>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
+
 <script type="text/javascript">
 //<![CDATA[
 $(document).ready(function(){
@@ -38,6 +41,21 @@ $(document).ready(function(){
         }
     });
 <!-- /TMPL_IF -->
+  // call the tablesorter plugin
+  $("#table_reports").tablesorter({
+    sortList: [[1,0]],
+    headers: {
+       6: { sorter: false},
+       7: { sorter: false},
+       8: { sorter: false},
+       9: { sorter: false},
+      10: { sorter: false}
+    }
+  }).tablesorterPager({
+    container:     $("#pagertable_reports"),
+    positionFixed: false,
+    size:          50
+  });
 });
 //]]>
 </script>
@@ -106,9 +124,41 @@ canned reports and writing custom SQL reports.</p>
 <!-- TMPL_IF NAME="saved1" -->
 <!-- TMPL_IF NAME="savedreports" --><h1>Saved Reports</h1>
 <p>Choose the report to run from the list</p>
-<form action="/cgi-bin/koha/reports/guided_reports.pl">
-<table>
-<tr><th>ID</th><th>Report Name</th><th>Type</th><th>Notes</th><th>Author</th><th>Creation Date</th><th>Saved Results</th><th>Saved SQL</th><th colspan="3">&nbsp;</th></tr>
+
+<span id="pagertable_reports" class="pager">
+ <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
+  <img src="<!-- TMPL_VAR name="interface" -->/prog/img/first.png" class="first"/>
+  <img src="<!-- TMPL_VAR name="interface" -->/prog/img/prev.png" class="prev"/>
+  <input type="text" size="5" class="pagedisplay"/>
+  <img src="<!-- TMPL_VAR name="interface" -->/prog/img/next.png" class="next"/>
+  <img src="<!-- TMPL_VAR name="interface" -->/prog/img/last.png" class="last"/>
+  , entries/page:
+  <select class="pagesize">
+   <option value="10">10</option>
+   <option value="25" selected="selected">25</option>
+   <option value="50">50</option>
+   <option value="100">100</option>
+   <option value="200">200</option>
+  </select>
+ </form>
+</span>
+
+<table id="table_reports" class="tablesorter">
+<thead>
+ <tr>
+  <th>ID</th>
+  <th>Report Name</th>
+  <th>Type</th>
+  <th>Notes</th>
+  <th>Author</th>
+  <th>Creation Date</th>
+  <th>Saved Results</th>
+  <th>Saved SQL</th>
+  <th>&nbsp;</th>
+  <th>&nbsp;</th>
+ </tr>
+</thead>
+<tbody>
 <!-- TMPL_LOOP NAME="savedreports" -->
 <!-- TMPL_UNLESS NAME="__odd__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_UNLESS -->
 <td><!-- TMPL_VAR NAME="id" --></td>
@@ -120,20 +170,20 @@ canned reports and writing custom SQL reports.</p>
 <td><!-- TMPL_IF NAME="date_run" --><a href="/cgi-bin/koha/reports/guided_reports.pl?phase=retrieve%20results&id=<!-- TMPL_VAR NAME="id" -->"><!-- TMPL_VAR NAME="date_run" --></a><!-- /TMPL_IF -->
 </td>
     <td>
-        <a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Show%20SQL">Show SQL</a> 
+        <a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Show%20SQL">Show</a> 
         <!-- TMPL_IF name="CAN_user_reports_create_reports" -->
-            &nbsp; <a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Edit%20SQL">Edit SQL</a>
+            &nbsp; <a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Edit%20SQL">Edit</a>
         <!-- /TMPL_IF -->
     </td>
-<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Run%20this%20report">Run</a></td>
-<td><a href="/cgi-bin/koha/tools/scheduler.pl?id=<!-- TMPL_VAR NAME="id" -->">Schedule</a></td>
+<td><a href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Run%20this%20report">Run</a>
+<a href="/cgi-bin/koha/tools/scheduler.pl?id=<!-- TMPL_VAR NAME="id" -->">Schedule</a></td>
     <!-- TMPL_IF name="CAN_user_reports_create_reports" -->
         <td><a class="confirmdelete" title="Delete this saved report" href="/cgi-bin/koha/reports/guided_reports.pl?reports=<!-- TMPL_VAR NAME="id" -->&amp;phase=Delete%20Saved">Delete</a></td>
     <!-- /TMPL_IF -->
 </tr>
 <!-- /TMPL_LOOP -->
+</tbody>
 </table>
-</form>
 <!-- TMPL_ELSE --><h4>There are no saved reports. 
     <!-- TMPL_IF name="CAN_user_reports_create_reports" -->
         <a href="/cgi-bin/koha/reports/guided_reports.pl?phase=Build%20new">Build new?</a>
index b2d8487..b990f29 100644 (file)
@@ -34,6 +34,7 @@
                <li><a href="/cgi-bin/koha/reports/catalogue_stats.pl">Catalog</a></li>
                <li><a href="/cgi-bin/koha/reports/issues_stats.pl">Circulation</a></li>
                <li><a href="/cgi-bin/koha/reports/serials_stats.pl">Serials</a></li>
+               <li><a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds</a></li>
        </ul></div>
 
        <div class="yui-u"><h2>Top Lists</h2>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/reserves_stats.tmpl
new file mode 100644 (file)
index 0000000..246b248
--- /dev/null
@@ -0,0 +1,549 @@
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
+<title>Koha &rsaquo; Reports &rsaquo; Holds statistics <!-- TMPL_IF NAME="do_it" -->&rsaquo; Results<!-- /TMPL_IF --></title>
+<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
+<!-- TMPL_INCLUDE NAME="calendar.inc" -->
+<style type="text/css">
+       .sql {display:none;}
+</style>
+</head>
+<body>
+<!-- TMPL_INCLUDE NAME="header.inc" -->
+<!-- TMPL_INCLUDE NAME="cat-search.inc" -->
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> <!-- TMPL_IF NAME="do_it" -->&rsaquo; <a href="/cgi-bin/koha/reports/reserves_stats.pl">Holds statistics</a> &rsaquo; Results <!-- TMPL_ELSE -->&rsaquo; Holds statistics<!-- /TMPL_IF --></div>
+
+<div id="doc3" class="yui-t2">
+
+   <div id="bd">
+       <div id="yui-main">
+       <div class="yui-b">
+
+<!-- TMPL_IF NAME="do_it" -->
+    <!-- TMPL_IF NAME="mainloop" -->
+        <h1>Holds statistics</h1>
+        <!-- TMPL_IF NAME="loopfilter" -->
+            <p>Filtered on</p>
+            <ul>
+            <!-- TMPL_LOOP NAME="loopfilter" -->
+                <!-- TMPL_IF NAME="err" --><li class="error">Error:
+                               <!-- TMPL_ELSIF NAME="sql" --><li class="sql">
+                               <!-- TMPL_ELSE --><li>
+                               <!--/TMPL_IF -->
+                                       <!-- TMPL_VAR NAME="crit"--> <!-- TMPL_VAR NAME="filter"-->
+                               </li>
+            <!-- /TMPL_LOOP -->
+            </ul>
+        <!-- /TMPL_IF -->
+               
+    <!-- TMPL_LOOP NAME="mainloop" -->
+        
+        <table> 
+            <tr>
+                <th><!-- TMPL_VAR name="line" --> / <!-- TMPL_VAR name="column" --></th>
+                <!-- TMPL_LOOP NAME="loopcol" -->
+                    <th><!-- TMPL_VAR ESCAPE="HTML" NAME="coltitle_display" --></th>
+                <!-- /TMPL_LOOP -->
+                <th>TOTAL</th>
+                </tr>
+                <!-- TMPL_LOOP NAME="looprow" -->
+                    <tr<!-- TMPL_UNLESS NAME="__odd__" --> class="highlight"<!-- /TMPL_UNLESS -->>
+                        <td><!-- TMPL_VAR ESCAPE="HTML" NAME="rowtitle_display" DEFAULT="UNKNOWN VALUE" --></td>
+                    <!-- TMPL_LOOP NAME="loopcell" -->
+                                               <td align="center">
+                                               <!--TMPL_IF Name="url_complement"--><a href="reserves_stats.pl?output=<!--TMPL_VAR Name=output-->&amp;<!--TMPL_VAR Name="url_complement"-->"><!-- TMPL_VAR NAME="value" DEFAULT="&nbsp;" --></a><!--TMPL_ELSE--><!-- TMPL_VAR NAME="value" DEFAULT="&nbsp;" --><!--/TMPL_IF-->
+                                               </td>
+                    <!-- /TMPL_LOOP -->
+                                               <td align="center"><!-- TMPL_VAR NAME="totalrow" --></td>
+                    </tr>
+                <!-- /TMPL_LOOP -->
+            <tr>
+                <th>TOTAL</th>
+                <!-- TMPL_LOOP NAME="loopfooter" -->
+                <th><!-- TMPL_VAR NAME="totalcol" --></th>
+                <!-- /TMPL_LOOP -->
+                <th><!-- TMPL_VAR NAME="total" --></th>
+            </tr>
+        </table>
+    <!-- /TMPL_LOOP -->
+    <!-- /TMPL_IF -->
+<!-- TMPL_ELSE -->
+
+    <form method="post" action="/cgi-bin/koha/reports/reserves_stats.pl">
+    <fieldset class="rows">
+       <legend>Holds statistics</legend><table>
+        <thead>
+            <tr>
+                <th>Title</th>
+                <th>Row</th>
+                <th>Column</th>
+                <th>Filter</th>
+            </tr>
+        </thead>
+        <tbody>
+               <tr >
+                <td>Hold Status </td>
+                <td><input type="radio" name="Line" value="reservestatus" /></td>
+                <td><input type="radio" name="Column" value="reservestatus" checked="checked" /></td>
+                <td>
+                               <input type="checkbox" name="filter_reservestatus_or_1" value="1"> Asked</input>
+                               <input type="checkbox" name="filter_reservestatus_or_2" value="2"> Processing</input>
+                               <input type="checkbox" name="filter_reservestatus_or_3" value="3"> Waiting</input>
+                               <input type="checkbox" name="filter_reservestatus_or_4" value="4"> Satisfied</input>
+                               <input type="checkbox" name="filter_reservestatus_or_5" value="5"> Cancelled</input>
+                               </td>
+             </tr>
+             <tr class="highlight">
+                <td>Hold Date</td>
+                <td><input type="radio" name="Line" value="reservedate" /></td>
+                <td><input type="radio" name="Column" value="reservedate" /></td>
+                <td><label for="reservedate_begin">From</label> <input type="text"  size="10" id="filter_reservedate_begin" name="filter_reservedate_begin" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openreservedateFrom" style="cursor: pointer;" />
+                   <script type="text/javascript">
+                                  //<![CDATA[ 
+                                  function validate1(date) {
+                        var day = date.getDate();
+                        var month = date.getMonth() + 1;
+                        var year = date.getFullYear();
+                        var weekDay = date.getDay();
+                        var dayMonth = month + '-' + day;
+                        var dateString = year + '-' + month + '-' + day;
+                        var dateTo = document.getElementById('filter_reservedate_end').value.split("-");
+                        var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
+                        if (date > limitDate) {
+                             return true;
+                        } else {
+                             return false;
+                        }
+                    }
+                    Calendar.setup({
+                            inputField : "filter_reservedate_begin",
+                            ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                            button : "openreservedateFrom",
+                            disableFunc : validate1,
+                            dateStatusFunc : validate1
+                    });
+                                       //]]>
+                                       </script>
+                    <label for="filter_reservedate_end">To</label> <input size="10" id="filter_reservedate_end" name="filter_reservedate_end" value="" type="text" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" id="openreservedateTo" style="cursor: pointer;" border="0" />
+                    <script type="text/javascript">
+                                       //<![CDATA[  
+                                       function validate2(date) {
+                         var day = date.getDate();
+                         var month = date.getMonth() + 1;
+                         var year = date.getFullYear();
+                         var weekDay = date.getDay();
+                         var dayMonth = month + '-' + day;
+                         var dateString = year + '-' + month + '-' + day;
+                         var dateFrom = document.getElementById('filter_reservedate_begin').value.split("-");
+                         var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
+                         if (limitDate > date) {
+                              return true;
+                         } else {
+                              return false;
+                         }
+                     }
+                     Calendar.setup({
+                             inputField : "filter_reservedate_end",
+                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                             button : "openreservedateTo",
+                             disableFunc : validate2,
+                             dateStatusFunc : validate2
+                     });
+                                       //]]>
+                                       </script>
+                    </td>
+                </tr>
+            <tr>
+                <td>Notification Date</td>
+                <td><input type="radio" name="Line" value="notificationdate" /></td>
+                <td><input type="radio" name="Column" value="notificationdate" /></td>
+                <td><label for="filter_notificationdate_begin">From</label> <input type="text"  size="10" id="filter_notificationdate_begin" name="filter_notificationdate_begin" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="opennotificationdateFrom" style="cursor: pointer;" />
+                   <script type="text/javascript">
+                                  //<![CDATA[ 
+                                  function validate1(date) {
+                        var day = date.getDate();
+                        var month = date.getMonth() + 1;
+                        var year = date.getFullYear();
+                        var weekDay = date.getDay();
+                        var dayMonth = month + '-' + day;
+                        var dateString = year + '-' + month + '-' + day;
+                        var dateTo = document.getElementById('filter_notificationdate_end').value.split("-");
+                        var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
+                        if (date > limitDate) {
+                             return true;
+                        } else {
+                             return false;
+                        }
+                    }
+                    Calendar.setup({
+                            inputField : "filter_notificationdate_begin",
+                            ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                            button : "opennotificationdateFrom",
+                            disableFunc : validate1,
+                            dateStatusFunc : validate1
+                    });
+                                       //]]>
+                                       </script>
+                    <label for="filter_notificationdate_end">To</label> <input  size="10" id="filter_notificationdate_end" name="filter_notificationdate_end" value="" type="text" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" id="opennotificationdateTo" style="cursor: pointer;" border="0" />
+                    <script type="text/javascript">
+                                       //<![CDATA[  
+                                       function validate2(date) {
+                         var day = date.getDate();
+                         var month = date.getMonth() + 1;
+                         var year = date.getFullYear();
+                         var weekDay = date.getDay();
+                         var dayMonth = month + '-' + day;
+                         var dateString = year + '-' + month + '-' + day;
+                         var dateFrom = document.getElementById('filter_notificationdate_begin').value.split("-");
+                         var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
+                         if (limitDate > date) {
+                              return true;
+                         } else {
+                              return false;
+                         }
+                     }
+                     Calendar.setup({
+                             inputField : "filter_notificationdate_end",
+                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                             button : "opennotificationdateTo",
+                             disableFunc : validate2,
+                             dateStatusFunc : validate2
+                     });
+                                       //]]>
+                                       </script>
+                    </td>
+             </tr>
+            <tr>
+                <td>Reminder Date</td>
+                <td><input type="radio" name="Line" value="reminderdate" /></td>
+                <td><input type="radio" name="Column" value="reminderdate" /></td>
+                <td><label for="filter_reminderdate_begin">From</label> <input type="text"  size="10" id="filter_reminderdate_begin" name="Filter" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openreminderdateFrom" style="cursor: pointer;" />
+                   <script type="text/javascript">
+                                  //<![CDATA[ 
+                                  function validate1(date) {
+                        var day = date.getDate();
+                        var month = date.getMonth() + 1;
+                        var year = date.getFullYear();
+                        var weekDay = date.getDay();
+                        var dayMonth = month + '-' + day;
+                        var dateString = year + '-' + month + '-' + day;
+                        var dateTo = document.getElementById('filter_reminderdate_end').value.split("-");
+                        var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
+                        if (date > limitDate) {
+                             return true;
+                        } else {
+                             return false;
+                        }
+                    }
+                    Calendar.setup({
+                            inputField : "filter_reminderdate_begin",
+                            ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                            button : "openreminderdateFrom",
+                            disableFunc : validate1,
+                            dateStatusFunc : validate1
+                    });
+                                       //]]>
+                                       </script>
+                    <label for="filter_reminderdate_end">To</label> <input size="10" id="filter_reminderdate_end" name="filter_reminderdate_end" value="" type="text" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" id="openreminderdateTo" style="cursor: pointer;" border="0" />
+                    <script type="text/javascript">
+                                       //<![CDATA[  
+                                       function validate2(date) {
+                         var day = date.getDate();
+                         var month = date.getMonth() + 1;
+                         var year = date.getFullYear();
+                         var weekDay = date.getDay();
+                         var dayMonth = month + '-' + day;
+                         var dateString = year + '-' + month + '-' + day;
+                         var dateFrom = document.getElementById('filter_reminderdate_begin').value.split("-");
+                         var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
+                         if (limitDate > date) {
+                              return true;
+                         } else {
+                              return false;
+                         }
+                     }
+                     Calendar.setup({
+                             inputField : "filter_reminderdate_end",
+                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                             button : "openreminderdateTo",
+                             disableFunc : validate2,
+                             dateStatusFunc : validate2
+                     });
+                                       //]]>
+                                       </script>
+                    </td>
+             </tr>
+            <tr>
+                <td>Waiting Date</td>
+                <td><input type="radio" name="Line" value="waitingdate" /></td>
+                <td><input type="radio" name="Column" value="waitingdate" /></td>
+                <td><label for="filter_waitingdate_begin">From</label> <input type="text"  size="10" id="filter_waitingdate_begin" name="filter_waitingdate_begin" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openwaitingdateFrom" style="cursor: pointer;" />
+                   <script type="text/javascript">
+                                  //<![CDATA[ 
+                                  function validate1(date) {
+                        var day = date.getDate();
+                        var month = date.getMonth() + 1;
+                        var year = date.getFullYear();
+                        var weekDay = date.getDay();
+                        var dayMonth = month + '-' + day;
+                        var dateString = year + '-' + month + '-' + day;
+                        var dateTo = document.getElementById('filter_waitingdate_end').value.split("-");
+                        var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
+                        if (date > limitDate) {
+                             return true;
+                        } else {
+                             return false;
+                        }
+                    }
+                    Calendar.setup({
+                            inputField : "filter_waitingdate_begin",
+                            ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                            button : "openwaitingdateFrom",
+                            disableFunc : validate1,
+                            dateStatusFunc : validate1
+                    });
+                                       //]]>
+                                       </script>
+                    <label for="filter_waitingdate_end">To</label> <input  size="10" id="filter_waitingdate_end" name="filter_waitingdate_end" value="" type="text" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" id="openwaitingdateTo" style="cursor: pointer;" border="0" />
+                    <script type="text/javascript">
+                                       //<![CDATA[  
+                                       function validate2(date) {
+                         var day = date.getDate();
+                         var month = date.getMonth() + 1;
+                         var year = date.getFullYear();
+                         var weekDay = date.getDay();
+                         var dayMonth = month + '-' + day;
+                         var dateString = year + '-' + month + '-' + day;
+                         var dateFrom = document.getElementById('filter_waitingdate_begin').value.split("-");
+                         var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
+                         if (limitDate > date) {
+                              return true;
+                         } else {
+                              return false;
+                         }
+                     }
+                     Calendar.setup({
+                             inputField : "filter_waitingdate_end",
+                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                             button : "openwaitingdateTo",
+                             disableFunc : validate2,
+                             dateStatusFunc : validate2
+                     });
+                                       //]]>
+                                       </script>
+                    </td>
+             </tr>
+                        <tr>
+                <td>Cancellation Date</td>
+                <td><input type="radio" name="Line" value="cancellationdate" /></td>
+                <td><input type="radio" name="Column" value="cancellationdate" /></td>
+                <td><label for="filter_cancellationdate_begin">From</label> <input type="text"  size="10" id="filter_cancellationdate_begin" name="filter_cancellationdate_begin" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="opencancellationdateFrom" style="cursor: pointer;" />
+                   <script type="text/javascript">
+                                  //<![CDATA[ 
+                                  function validate1(date) {
+                        var day = date.getDate();
+                        var month = date.getMonth() + 1;
+                        var year = date.getFullYear();
+                        var weekDay = date.getDay();
+                        var dayMonth = month + '-' + day;
+                        var dateString = year + '-' + month + '-' + day;
+                        var dateTo = document.getElementById('filter_cancellationdate_end').value.split("-");
+                        var limitDate = new Date(dateTo[0], (dateTo[1] - 1), dateTo[2]);
+                        if (date > limitDate) {
+                             return true;
+                        } else {
+                             return false;
+                        }
+                    }
+                    Calendar.setup({
+                            inputField : "filter_cancellationdate_begin",
+                            ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                            button : "opencancellationdateFrom",
+                            disableFunc : validate1,
+                            dateStatusFunc : validate1
+                    });
+                                       //]]>
+                                       </script>
+                    <label for="filter_cancellationdate_end">To</label> <input  size="10" id="filter_cancellationdate_end" name="filter_cancellationdate_end" value="" type="text" />
+                    <img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" id="opencancellationdateTo" style="cursor: pointer;" border="0" />
+                    <script type="text/javascript">
+                                       //<![CDATA[  
+                                       function validate2(date) {
+                         var day = date.getDate();
+                         var month = date.getMonth() + 1;
+                         var year = date.getFullYear();
+                         var weekDay = date.getDay();
+                         var dayMonth = month + '-' + day;
+                         var dateString = year + '-' + month + '-' + day;
+                         var dateFrom = document.getElementById('filter_cancellationdate_begin').value.split("-");
+                         var limitDate = new Date(dateFrom[0], (dateFrom[1] - 1), dateFrom[2]);
+                         if (limitDate > date) {
+                              return true;
+                         } else {
+                              return false;
+                         }
+                     }
+                     Calendar.setup({
+                             inputField : "filter_cancellationdate_end",
+                             ifFormat : "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
+                             button : "opencancellationdateTo",
+                             disableFunc : validate2,
+                             dateStatusFunc : validate2
+                     });
+                                       //]]>
+                                       </script>
+                    </td>
+             </tr>
+        <tr>
+            <td>Patron Category</td>
+            <td><input type="radio" name="Line" value="borrowers.categorycode" /></td>
+            <td><input type="radio" name="Column" value="borrowers.categorycode" /></td>
+           <td><select name="filter_categorycode" id="borcat">
+               <option value=""> </option>
+               <!-- TMPL_LOOP NAME="categoryloop" -->
+                 <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="categorycode" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="categorycode" -->"><!-- TMPL_VAR NAME="description" --></option><!-- /TMPL_IF -->
+               <!-- /TMPL_LOOP -->
+               </select>
+             </td> 
+        </tr>
+        <tr class="highlight">
+            <td>Item Type</td>
+            <td><input type="radio" name="Line" value="items.itype" /></td>
+            <td><input type="radio" name="Column" value="items.itype" /></td>
+           <td><select name="filter_items.itype" id="itype">
+               <option value=""> </option>
+               <!-- TMPL_LOOP NAME="itypeloop" -->
+                 <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="code" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="code" -->"><!-- TMPL_VAR NAME="description" --></option><!-- /TMPL_IF -->
+               <!-- /TMPL_LOOP -->
+               </select>
+             </td> 
+        </tr>
+        <tr>
+            <td>Pickup Library</td>
+            <td><input type="radio" name="Line" value="reserves.branchcode" checked="checked" /></td>
+            <td><input type="radio" name="Column" value="reserves.branchcode" /></td>
+            <td><select name="filter_reserves.branchcode" id="resbranchcode">
+               <option value=""> </option>
+               <!-- TMPL_LOOP NAME="branchloop" -->
+<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_IF -->
+                               <!-- /TMPL_LOOP -->
+               </select>
+             </td> 
+        </tr>
+        <tr class="highlight">
+            <td>Holding Library</td>
+            <td><input type="radio" name="Line" value="holdingbranch" /></td>
+            <td><input type="radio" name="Column" value="holdingbranch" /></td>
+            <td><select name="filter_holdingbranch" id="holdingbranch">
+               <option value=""> </option>
+               <!-- TMPL_LOOP NAME="branchloop" -->
+<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_IF -->
+                               <!-- /TMPL_LOOP -->
+               </select>
+             </td> 
+        </tr>
+        <tr>
+            <td>Home Library</td>
+            <td><input type="radio" name="Line" value="homebranch" /></td>
+            <td><input type="radio" name="Column" value="homebranch" /></td>
+            <td><select name="filter_homebranch" id="homebranch">
+               <option value=""> </option>
+               <!-- TMPL_LOOP NAME="branchloop" -->
+<!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option><!-- /TMPL_IF -->
+                               <!-- /TMPL_LOOP -->
+               </select>
+             </td> 
+        </tr>
+        <tr class="highlight">
+            <td>Collection</td>
+            <td><input type="radio" name="Line"   value="items.ccode" /></td>
+            <td><input type="radio" name="Column" value="items.ccode" /></td>
+            <td><select name="filter_items.ccode" id="ccode">
+                <option value=""> </option>
+                <!-- TMPL_LOOP NAME="ccodeloop" -->
+                                       <!-- TMPL_IF NAME="selected" --> <option value="<!-- TMPL_VAR NAME="code" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="code" -->"><!-- TMPL_VAR NAME="description" --></option><!-- /TMPL_IF -->
+                <!-- /TMPL_LOOP -->
+                </select>
+            </td>
+        </tr>
+        <tr>
+            <td>Shelving Location</td>
+            <td><input type="radio" name="Line" value="items.location" /></td>
+            <td><input type="radio" name="Column" value="items.location" /></td>
+            <td><select name="filter_items.location" id="location">
+                <option value=""> </option>
+                <!-- TMPL_LOOP NAME="locationloop" -->
+                                       <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="code" -->" selected="selected"><!-- TMPL_VAR NAME="description" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="code" -->"><!-- TMPL_VAR NAME="description" --></option><!-- /TMPL_IF -->
+                               <!-- /TMPL_LOOP -->
+               </select>
+            </td> 
+        </tr>
+        <tr class="highlight">
+            <td>Item Call Number</td>
+            <td></td>
+            <td></td>
+            <td>From <input type="text" name="filter_itemcallnumber" size="10" /> (inclusive) to <input type="text" name="fiter_itemcallnumber" size="10" /> (exclusive) </td>
+        </tr>
+        <!-- TMPL_IF Name="hassort1" -->
+        <tr><td>Patron sort1</td>
+                       <td><input type="radio" name="Line" value="borrowers.sort1" /></td>
+                       <td><input type="radio" name="Column" value="borrowers.sort1" /></td>
+                       <td><select name="filter_borrowers.sort1" id="sort1">
+               <option value=""> </option>
+               <!-- TMPL_LOOP NAME="Bsort1" -->
+                          <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="authorised_value" -->" ><!-- TMPL_VAR NAME="lib" --></option><!-- /TMPL_IF -->
+               <!-- /TMPL_LOOP -->
+               </select>
+            </td> 
+        </tr>
+        <!-- /TMPL_IF -->
+        <!-- TMPL_IF Name="hassort2" -->
+        <tr class="highlight"><td>Patron sort2</td>
+            <td><input type="radio" name="Line" value="borrowers.sort2" /></td>
+            <td><input type="radio" name="Column" value="borrowers.sort2" /></td>
+               <td><select name="filter_borrowers.sort2" id="sort2">
+               <option value=""> </option>
+               <!-- TMPL_LOOP NAME="Bsort2" -->
+                          <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR NAME="authorised_value" -->" selected="selected"><!-- TMPL_VAR NAME="lib" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="authorised_value" -->" ><!-- TMPL_VAR NAME="lib" --></option><!-- /TMPL_IF -->
+               <!-- /TMPL_LOOP -->
+               </select>
+            </td> 
+        </tr>
+        <!-- /TMPL_IF -->
+        </tbody>
+    </table><br /></fieldset>
+
+<fieldset class="rows"><legend>Cell value </legend><ol><li><label for="cellvalue1">Count holds</label> <input type="radio" name="Cellvalue" value="1" id="cellvalue1" checked="checked" /> </li>
+            <li><label for="cellvalue2">Count unique borrowers</label> <input type="radio" name="Cellvalue" value="2" id="cellvalue2" /> </li><li><label for="cellvalue3">Count unique items</label> <input type="radio" name="Cellvalue" id="cellvalue3" value="3" /> </li><li><label for="cellvalue4">Count unique biblios</label> <input type="radio" name="Cellvalue" id="cellvalue4" value="4" /> </li></ol></fieldset>
+                       
+       <fieldset class="rows">
+       <legend>Output</legend>
+<ol><li><label for="outputscreen">To screen into the browser: </label><input type="radio" checked="checked" name="output" id="outputscreen" value="screen" /> </li>
+<li><label for="outputfile">To a file:</label> <input type="radio" name="output" value="file" id="outputfile" /> <label class="inline" for="basename">Named: </label><input type="text" name="basename" id="basename" value="Export" /> <label class="inline" for="MIME">Into an application  
+               </label><!-- TMPL_VAR NAME="CGIextChoice" -->
+               <!-- TMPL_VAR NAME="CGIsepChoice" --></li></ol>
+       </fieldset>
+
+       <fieldset class="action">
+       <input type="submit" value="Submit" />
+       <input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
+       <input type="hidden" name="do_it" value="1" />
+       </fieldset>
+       </form>
+<!-- /TMPL_IF -->
+
+</div>
+</div>
+<div class="yui-b">
+<!-- TMPL_INCLUDE NAME="reports-menu.inc" -->
+</div>
+</div>
+<!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->
index 58a5ad9..53ff7b7 100644 (file)
@@ -639,7 +639,7 @@ function checkMultiHold() {
                 <!-- TMPL_IF name="found" -->
                 Item waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
             <!-- TMPL_ELSE -->
-                Waiting to be pulled
+                Waiting to be pulled <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
             <!-- /TMPL_IF -->
           <!-- TMPL_ELSE -->
             Item being transferred to <b> <!-- TMPL_VAR NAME="wbrname" --></b> <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcode" -->" />
index 0b4e351..a941da7 100644 (file)
@@ -152,7 +152,7 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di
         </table></li></ol>
     </fieldset>
     <fieldset class="rows"> <legend>Acquisition information</legend><ol>
-        <li><label for="branchcode">Branchcode:</label>
+        <li><label for="branchcode">Library:</label>
             <select name="branchcode" id="branchcode">
                 <option value="">Any</option><!-- TMPL_LOOP name="branchloop" -->
                 <!-- TMPL_IF NAME="selected" --><option value="<!-- TMPL_VAR name="value" -->" selected="selected"><!-- TMPL_VAR name="branchname" --></option><!-- TMPL_ELSE --><option value="<!-- TMPL_VAR name="value" -->"><!-- TMPL_VAR name="branchname" --></option><!-- /TMPL_IF --><!-- /TMPL_LOOP -->
index 9f11c66..46b7d71 100644 (file)
@@ -69,8 +69,10 @@ $(document).ready(function(){
 
 <!-- TMPL_UNLESS name="batch_list" -->
    <!-- TMPL_UNLESS name="batch_info" -->
-     <span class="problem">No records have been staged.</span>
-     <a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.
+   <div class="dialog message">
+     <p>No records have been staged.</p>
+     <p><a href="/cgi-bin/koha/tools/stage-marc-import.pl">Stage MARC records for import</a>.</p>
+   </div>
    <!-- /TMPL_UNLESS -->
 <!-- /TMPL_UNLESS -->
 
@@ -148,7 +150,19 @@ $(document).ready(function(){
     <input type="hidden" name="runinbackground" value="" />
     <input type="hidden" name="completedJobID" value="" />
     <input type="hidden" name="import_batch_id" value="<!-- TMPL_VAR name="import_batch_id" -->" />
-    <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" /></fieldset>
+    <fieldset class="action">
+    <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" />
+    <br/>
+    Add new bibliographic records into this framework:
+    <select name="framework" id="frameworks">
+      <option value="">Default</option>
+      <!-- TMPL_LOOP NAME="frameworks" -->
+      <option value="<!-- TMPL_VAR NAME="value"-->" <!-- TMPL_VAR NAME="selected" -->>
+      <!-- TMPL_VAR NAME="label" -->
+      </option>
+      <!-- /TMPL_LOOP -->
+    </select>
+    </fieldset>
   </form>
   <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div>
      <div id="jobfailed"></div></div>
index fa99af2..9984144 100644 (file)
@@ -44,6 +44,7 @@
                                                                <select name="modules" id="modules" multiple="multiple">
                                                                        <option value="" selected="selected">All</option>
                                                                        <option value ="CATALOGUING">Catalog</option>
+                                                                       <option value ="AUTHORITIES">Authorities</option>
                                                                        <option value ="MEMBERS">Patrons</option>
                                                                        <option value ="ACQUISITION">Acquisitions</option>
                                                                        <option value ="SERIAL">Serials</option>
                                                                                                                <!-- TMPL_IF EXPR="module eq 'SERIAL'" -->
                                                                                                                        <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=<!-- TMPL_VAR NAME="object" -->"> <!-- TMPL_VAR NAME="object" --> </a>
                                                                                                                <!-- TMPL_ELSE -->
-                                                                                                                       <!-- TMPL_VAR NAME="object" -->
+                                                                                                                       <!-- TMPL_IF EXPR="module eq 'AUTHORITIES'" -->
+                                                                                                                               <a href="/cgi-bin/koha/authorities/detail.pl?authid=<!-- TMPL_VAR NAME="object" -->" title="Display detail for this authority">auth <!-- TMPL_VAR NAME="object" --></a>
+                                                                                                                       <!-- TMPL_ELSE -->
+                                                                                                                               <!-- TMPL_VAR NAME="object" -->
+                                                                                                                       <!-- /TMPL_IF -->
                                                                                                                <!-- /TMPL_IF -->
                                                                                                        <!-- /TMPL_IF -->
                                                                                                <!-- /TMPL_IF -->
index 952c41e..28da9c2 100644 (file)
@@ -19,6 +19,8 @@
         <xsl:variable name="UseControlNumber" select="1"/>
         <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
         <xsl:variable name="OPACBaseURL" select="marc:sysprefs/marc:syspref[@name='OPACBaseURL']"/>
+        <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
+        <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
 
         <xsl:variable name="leader" select="marc:leader"/>
         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
         </xsl:if>
 
         <!-- Author Statement -->
-        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/></xsl:call-template>
-        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/></xsl:call-template>
+        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=100 or @tag=110 or @tag=111]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
+        <xsl:call-template name="showAuthor"><xsl:with-param name="authorfield" select="marc:datafield[@tag=700 or @tag=710 or @tag=711]"/><xsl:with-param name="UseAuthoritiesForTracings" select="$UseAuthoritiesForTracings"/></xsl:call-template>
 
    <xsl:if test="$materialTypeCode!=''">
         <span class="results_summary"><span class="label">Type: </span>
                         </a>
                     </xsl:when>
                     <xsl:otherwise>
-                        <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='t']}">
+                        <a href="/cgi-bin/koha/catalogue/search.pl?q=se:{marc:subfield[@code='a']}">
                             <xsl:call-template name="chopPunctuation">
                                 <xsl:with-param name="chopString">
                                     <xsl:call-template name="subfieldSelect">
             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
             <a>
             <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
+            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
             </xsl:otherwise>
             </xsl:choose>
             <xsl:call-template name="chopPunctuation">
         </xsl:choose>  
         <xsl:choose>
         <xsl:when test="@ind2=0">
-            <xsl:for-each select="marc:subfield[@code='t']">
-                <xsl:value-of select="marc:subfield[@code=t]"/> <xsl:value-of select="marc:subfield[@code=r]"/>
-            </xsl:for-each> 
+            <xsl:call-template name="subfieldSelect">
+                <xsl:with-param name="codes">tru</xsl:with-param>
+            </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
             <xsl:call-template name="subfieldSelect">
         </xsl:choose>
         </span>
                 <xsl:variable name="f773">
-                    <xsl:call-template name="subfieldSelect">
+                    <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
                         <xsl:with-param name="codes">at</xsl:with-param>
-                    </xsl:call-template>
+                    </xsl:call-template></xsl:with-param></xsl:call-template>
                 </xsl:variable>
             <xsl:choose>
                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                    <a href="/cgi-bin/koha/catalogue/search.pl?q=Control-number:{marc:subfield[@code='w']}">
-                        <xsl:value-of select="translate($f773, '()', '')"/>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+                        <xsl:value-of select="translate($f773, '()', '')"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
                     </a>
                 </xsl:when>
                 <xsl:otherwise>
                     <a><xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
-                        <xsl:value-of select="$f773"/>
+                        <xsl:value-of select="$f773"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
                     </a>
                 </xsl:otherwise>
             </xsl:choose>
         <!-- 780 -->
         <xsl:if test="marc:datafield[@tag=780]">
         <xsl:for-each select="marc:datafield[@tag=780]">
+        <xsl:if test="@ind1=0">
         <span class="results_summary">
         <xsl:choose>
         <xsl:when test="@ind2=0">
             </xsl:choose>
         </span>
  
-        <xsl:choose>
-        <xsl:when test="@ind1=0">
+        <xsl:if test="marc:subfield[@code='n']">
             <span class="results_summary"><xsl:value-of select="marc:subfield[@code='n']"/></span>
-        </xsl:when>
-        </xsl:choose>
+        </xsl:if>
 
+        </xsl:if>
         </xsl:for-each>
         </xsl:if>
 
 
     <xsl:template name="showAuthor">
        <xsl:param name="authorfield"/>
+    <xsl:param name="UseAuthoritiesForTracings"/>
        <xsl:if test="count($authorfield)&gt;0">
         <h5 class="author">
         <xsl:for-each select="$authorfield">
         </xsl:choose>
         <a>
         <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
+            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
                 <xsl:attribute name="href">/cgi-bin/koha/catalogue/search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
index d101723..0cd4559 100644 (file)
 <xsl:text> </xsl:text>
        </xsl:template>
 
+       <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w.
+            Parameter: control number string.
+            Assumes LOC convention: (OrgCode)recordNumber.
+            If OrgCode is not present, return full string.
+            Additionally, handle various brackets/parentheses. Chop leading and trailing spaces.
+       -->
+       <xsl:template name="extractControlNumber">
+           <xsl:param name="subfieldW"/>
+           <xsl:variable name="tranW" select="translate($subfieldW,']})&gt;','))))')"/>
+           <xsl:choose>
+             <xsl:when test="contains($tranW,')')">
+               <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()&lt;&gt;',''))"/>
+             </xsl:when>
+             <xsl:otherwise>
+               <xsl:value-of select="normalize-space($subfieldW)"/>
+             </xsl:otherwise>
+           </xsl:choose>
+       </xsl:template>
 
     <!-- Function m880Select:  Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags
         - should be called immediately before the corresonding latin tags are processed 
                                 <xsl:value-of select="$str"/>
                             </a>
                         </xsl:when>
-                       <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
+                       <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9]) and $UseAuthoritiesForTracings='1'">
                             <a>
                                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of  select="marc:subfield[@code=9]"/></xsl:attribute>
                                   <xsl:value-of select="$str"/>
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 (file)
index 0000000..8400aa8
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/itemtypeimg/bridge/reference.gif differ
index 430dad8..83b54ea 100644 (file)
@@ -1991,4 +1991,15 @@ div.ft {
 #plainmarc th { background-color : #FFF; border: 0; white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; }
 #plainmarc td { border: 0; padding : 2px; vertical-align: top; }
 
+#catalogue_detail_biblio h1 { float:left; margin:0 1em 1em 0; }
+#catalogue_detail_biblio h1.title { float:none; margin-top:1em; }
+#catalogue_detail_biblio h3 {clear:both; }
+
+#opac-detail #Normalview { font-weight:bold; }
+#opac-marcdetail #Normalview { font-weight:normal; }
+#opac-marcdetail #MARCview { font-weight:bold; }
+#opac-isbddetail #Normalview { font-weight:normal; }
+#opac-isbddetail #ISBDview { font-weight:bold; }
+#opac-isbddetail #isbdcontents { margin-top: 2em; }
+
 div.bibmessage { background-color : #ffffb0; border-radius : 5px; padding : 3px; margin : 2px; }
index d8a4423..a0869b2 100644 (file)
@@ -1,7 +1,7 @@
 </title>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="generator" content="Koha <!-- TMPL_VAR NAME="Version" -->" /> <!-- leave this for stats -->
-<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
+<link rel="shortcut icon" href="<!-- TMPL_IF NAME="OpacFavicon" --><!-- TMPL_VAR NAME="OpacFavicon" --><!-- TMPL_ELSE --><!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico<!-- /TMPL_IF -->" type="image/x-icon" />
 <!-- TMPL_IF name="opacstylesheet" --><link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="opacstylesheet" -->" /><!-- TMPL_ELSE -->
 <!-- TMPL_IF name="opaclayoutstylesheet" --><link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/<!-- TMPL_VAR NAME="opaclayoutstylesheet" -->" /><!-- TMPL_ELSE --><link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/opac.css" /><!-- /TMPL_IF --><!-- /TMPL_IF -->
 <!-- TMPL_IF name="opaccolorstylesheet" -->
index 6db1552..3a3d4b9 100644 (file)
          <!-- /TMPL_LOOP -->
       </select>
    <!-- TMPL_ELSE -->
-      <!-- TMPL_UNLESS NAME="opac_limit_override" -->
+      <!-- TMPL_IF NAME="opac_limit_override" -->
+          <!-- TMPL_IF NAME="opac_search_limit" -->
+            <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" />
+          <!-- /TMPL_IF -->
+      <!-- TMPL_ELSE -->
           <!-- TMPL_IF name="mylibraryfirst" --> 
                <input name="limit" value="branch:<!-- TMPL_VAR name="mylibraryfirst" -->" type="hidden" />
           <!-- /TMPL_IF -->
-       <!-- /TMPL_UNLESS -->
-   <!-- /TMPL_IF -->
-   <!-- TMPL_IF NAME="opac_search_limit" -->
-      <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" />
+      <!-- /TMPL_IF -->
    <!-- /TMPL_IF -->
 
 
 <div id="moresearches">
 <a href="/cgi-bin/koha/opac-search.pl">Advanced Search</a>
 <!-- TMPL_IF NAME="OpacBrowser"     --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by Hierarchy</a><!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="OpacAuthorities" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Browse by Subject</a><!-- /TMPL_IF -->
+<!-- TMPL_IF NAME="OpacAuthorities" --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Browse by author or subject</a><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="TagsEnabled"     --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag Cloud</a><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="OpacCloud"       --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject Cloud</a><!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="OpacTopissue"    --><span class="pipe"> | </span><a href="/cgi-bin/koha/opac-topissues.pl">Most Popular</a><!-- /TMPL_IF -->
index 85719f3..2f66f25 100644 (file)
@@ -3,7 +3,7 @@
 <div id="search-facets">
 <h4>Refine your search</h4>
 <ul>
-       <li>Availability<ul><li><!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF --></li></ul>
+       <li>Availability<ul><li><!-- TMPL_IF NAME="available" -->Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi_not_availablity" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Show all items</a><!-- TMPL_ELSE -->Limit to <a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=available">currently available items.</a><!-- /TMPL_IF --></li></ul>
        <!-- TMPL_IF NAME="related" --> <li>(related searches: <!-- TMPL_LOOP NAME="related" --><!-- TMPL_VAR NAME="related_search" --><!-- /TMPL_LOOP -->)</li><!-- /TMPL_IF -->
        </li>
        
@@ -18,8 +18,8 @@
 <!-- TMPL_IF NAME="type_label_Libraries" -->Libraries<!-- /TMPL_IF -->
 <!-- /TMPL_UNLESS -->
 <ul>
-        <!-- TMPL_LOOP NAME="facets" --><li><a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=<!-- TMPL_VAR NAME="type_link_value" -->:<!-- TMPL_VAR NAME="facet_link_value" -->" title="<!-- TMPL_VAR NAME="facet_title_value" ESCAPE="HTML" -->"><!-- TMPL_VAR NAME="facet_label_value" --></a> <!-- (<!-- TMPL_VAR NAME="facet_count" -->) --></li><!-- /TMPL_LOOP --><!-- TMPL_IF NAME="expandable" -->
-        <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;offset=<!-- TMPL_VAR NAME="offset" -->&amp;expand=<!-- TMPL_VAR NAME="expand" -->#<!-- TMPL_VAR NAME="type_id" -->">Show More</a></li>
+        <!-- TMPL_LOOP NAME="facets" --><li><a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;limit=<!-- TMPL_VAR NAME="type_link_value" -->:<!-- TMPL_VAR NAME="facet_link_value" -->" title="<!-- TMPL_VAR NAME="facet_title_value" ESCAPE="HTML" -->"><!-- TMPL_VAR NAME="facet_label_value" --></a> <!-- TMPL_IF NAME="displayFacetCount" -->(<!-- TMPL_VAR NAME="facet_count" -->)<!-- /TMPL_IF --></li><!-- /TMPL_LOOP --><!-- TMPL_IF NAME="expandable" -->
+        <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->&amp;offset=<!-- TMPL_VAR NAME="offset" -->&amp;expand=<!-- TMPL_VAR NAME="expand" -->#<!-- TMPL_VAR NAME="type_id" -->">Show More</a></li>
 <!-- /TMPL_IF -->
 </ul></li>
 <!-- /TMPL_LOOP -->
index 570ba96..013a3c7 100644 (file)
@@ -1,7 +1,7 @@
 <!-- TMPL_IF NAME="PAGE_NUMBERS" --><div class="pages">
     <!-- Row of numbers corresponding to search result pages -->
-        <!-- TMPL_IF NAME="previous_page_offset" --><a class="nav" href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="previous_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">&lt;&lt; Previous</a><!-- /TMPL_IF -->
-    <!-- TMPL_LOOP NAME="PAGE_NUMBERS" --><!-- TMPL_IF NAME="highlight" --><span class="current"><!-- TMPL_VAR NAME="pg" --></span><!-- TMPL_ELSE -->        <a class="nav" href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->"><!-- TMPL_VAR NAME="pg" --></a><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="previous_page_offset" --><a class="nav" href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" -->&amp;offset=<!-- TMPL_VAR NAME="previous_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">&lt;&lt; Previous</a><!-- /TMPL_IF -->
+    <!-- TMPL_LOOP NAME="PAGE_NUMBERS" --><!-- TMPL_IF NAME="highlight" --><span class="current"><!-- TMPL_VAR NAME="pg" --></span><!-- TMPL_ELSE -->        <a class="nav" href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" -->&amp;offset=<!-- TMPL_VAR NAME="offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->"><!-- TMPL_VAR NAME="pg" --></a><!-- /TMPL_IF -->
     <!-- /TMPL_LOOP -->
-        <!-- TMPL_IF NAME="next_page_offset" --><a class="nav" href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" -->&amp;offset=<!-- TMPL_VAR NAME="next_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Next &gt;&gt;</a><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="next_page_offset" --><a class="nav" href="/cgi-bin/koha/opac-search.pl?<!-- TMPL_VAR NAME="query_cgi" --><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" -->&amp;offset=<!-- TMPL_VAR NAME="next_page_offset" --><!-- TMPL_IF NAME="sort_by" -->&amp;sort_by=<!-- TMPL_VAR NAME="sort_by" --><!-- /TMPL_IF -->">Next &gt;&gt;</a><!-- /TMPL_IF -->
 </div><!-- /TMPL_IF -->
index b66870d..5e9a640 100644 (file)
@@ -36,7 +36,7 @@
     <div id="userisbddetail" class="container">
     <div id="catalogue_detail_biblio">
        
-     <h1 style="float:left;margin:0 1em 1em 0;">ISBD View</h1> <div id="views">
+     <div id="views">
         <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span> <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">MARC View</a></span> <span class="view"><span id="ISBDview">ISBD View</span></span></div>
 
     <div id="isbdcontents"><!-- TMPL_VAR name="ISBD" --></div>
index fad1371..5c50d64 100644 (file)
@@ -66,16 +66,15 @@ $(document).ready(function(){
     <div id="usermarcdetail" class="container">
     <div id="catalogue_detail_biblio">
 
-    <h2 style="float:left;margin: 0 1em 1em 0;">MARC View</h2>
     <div id="views">
     <span class="view"><a id="Normalview" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">Normal View</a></span>
 
 <span class="view"><span id="MARCview">MARC View</span></span>
 <!-- TMPL_IF NAME="ISBD" --><span class="view"><a id="ISBDview"  href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR name="biblionumber" -->">ISBD View</a></span><!-- /TMPL_IF -->
 </div>
-    <h3 style="clear:both;"><!-- TMPL_VAR NAME="bibliotitle" --> (Record no. <!-- TMPL_VAR NAME="biblionumber" -->)</h3>
+    <h1 class="title"><!-- TMPL_VAR NAME="bibliotitle" --> (Record no. <!-- TMPL_VAR NAME="biblionumber" -->)</h1>
     <!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
-    <div>[ <a id="switchview" href="/cgi-bin/koha/opac-showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->&amp;viewas=html">view plain</a> ]</div>
+    <div id="switchview_div">[ <a id="switchview" href="/cgi-bin/koha/opac-showmarc.pl?id=<!-- TMPL_VAR NAME="biblionumber" -->&amp;viewas=html">view plain</a> ]</div>
     <div id="plainmarc"></div><!-- /TMPL_IF -->
     <div id="labeledmarc">
     <table id="marc">
index 3a478ff..f7c2adf 100644 (file)
         
         <select name="limit" id="branchloop">
         <option value="">All libraries</option>
-        <!-- TMPL_LOOP NAME="branchloop" -->
+        <!-- TMPL_LOOP NAME="BranchesLoop" -->
         <!--TMPL_IF Name="selected"-->
         <option value="branch:<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
         <!--TMPL_ELSE-->    
index 91a1412..8c11df2 100644 (file)
@@ -1,4 +1,4 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; Authority Search
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; Browse by author or subject
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 </head>
 <body id="opac-authorities">
@@ -13,7 +13,7 @@
         <input type="hidden" name="op" value="do_search" />
         <input type="hidden" name="type" value="opac" />
 <fieldset class="rows">
-<legend>Authority search</legend>
+            <legend>Browse by author or subject</legend>
 <ol>
  <li><label for="authtypecode">Search: : </label> <select name="authtypecode" id="authtypecode">
                 <!-- TMPL_LOOP NAME="authtypesloop" -->
                 <!-- TMPL_ELSE --><option value="<!-- TMPL_VAR NAME="value" -->"> <!-- TMPL_VAR NAME="authtypetext" --></option>
                 <!-- /TMPL_IF -->
                 <!-- /TMPL_LOOP -->
-                </select></li>           <li>
-                <label for="operatora">Main entry ($a only): </label>
-                <select name="operatora" id="operatora">
-                    <option value="contains">contains</option>
-                    <option value="start">starts with</option>
-                    <option value="is">is exactly</option>
                 </select>
-                <input type="text" name="valuea" id="mainentrya_value" value="<!-- TMPL_VAR NAME="value" -->" />
-                <input type="hidden" name="marclista" value="mainmainentry" />
-                <input type="hidden" name="and_ora" value="and" />
-                <input type="hidden" name="excludinga" value="" />
-            </li>
-            <li>
-                <label for="operatorb">Main entry: </label>
-                <select name="operatorb" id="operatorb">
-                    <option value="contains">contains</option>
-                    <option value="start">starts with</option>
-                    <option value="is">is exactly</option>
-                </select>
-                <input type="text" name="valueb" id="mainentry_value" value="<!-- TMPL_VAR NAME="value" -->" />
-                <input type="hidden" name="marclistb" value="mainentry" />
-                <input type="hidden" name="and_orb" value="and" />
-                <input type="hidden" name="excludingb" value="" />
-            </li>
-            <li>
-                <label for="anywhere">Anywhere: </label>
                 <select name="operatorc" id="anywhere">
                     <option value="contains">contains</option>
                     <option value="start">starts with</option>
@@ -54,7 +29,7 @@
                 </select>
                 <input type="text" name="valuec" id="anywhere_value" value="<!-- TMPL_VAR NAME="value" -->" />
                 <input type="hidden" name="marclistc" value="" />
-                <input type="hidden" name="and_orc" value="and" />
+                    <input type="hidden" name="and_ora" value="and" />
                 <input type="hidden" name="excludingc" value="" />
             </li>
             <li><label for="orderby">Order by: </label><select name="orderby" id="orderby">
@@ -71,8 +46,8 @@
 </div>
 </div>
 </div>
-
-</div><!-- TMPL_IF NAME="OpacNav" -->
+</div>
+<!-- TMPL_IF NAME="OpacNav" -->
 <div class="yui-b">
 <div id="leftmenus" class="container">
 <!--TMPL_INCLUDE NAME="navigation.inc" -->
index def5362..b6ef2ef 100644 (file)
@@ -1,4 +1,4 @@
-<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo;  Advanced Search
+<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo;  Entry
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <!-- TMPL_IF Name="displayhierarchy"-->
 <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/hierarchy.css">
@@ -60,18 +60,16 @@ function showChildren(mynumber) {
 <!--/TMPL_LOOP-->
 </div>
 <!-- /TMPL_IF -->
-<h1>Authority #<!-- TMPL_VAR NAME="authid" --> (<!-- TMPL_VAR name="authtypetext" -->)</h1>
+<h1>Entry <!-- TMPL_VAR name="authtypetext" --></h1>
        <p>Used in <a href="opac-search.pl?type=opac&amp;q=<!-- TMPL_VAR NAME="authid" -->&amp;idx=an"><!-- TMPL_VAR name="count" --> records</a></p>
-<table><!-- TMPL_LOOP name="0XX" -->
-        <tr><td colspan="3" class="marctag"><b><!-- TMPL_VAR name="tag" --></b></td></tr>
+        <!-- TMPL_LOOP name="0XX" -->
+        <p><b><!-- TMPL_VAR name="tag" --></b></p>
+        <ul>
         <!-- TMPL_LOOP name="subfield" -->
-                <tr><td class="marcsubfieldletter" ><!-- TMPL_VAR name="marc_subfield" --></td>
-                    <td class="marcsubfieldname" ><!-- TMPL_VAR name="marc_lib" --></td>
-                    <td class="subfieldvalue" ><!-- TMPL_VAR name="marc_value" --></td>
-                </tr>
+                <p><b><!-- TMPL_VAR name="marc_lib" -->:</b> <!-- TMPL_VAR name="marc_value" --></p>
             <!-- /TMPL_LOOP -->
+        </ul>
         <!-- /TMPL_LOOP -->
-</table>
 </div> 
 
 </div>
index e0c7564..05ca2e5 100644 (file)
@@ -48,7 +48,7 @@
                        </tr>
                        <!-- TMPL_LOOP NAME="result" -->
                                <tr>
-                                       <td><a href="opac-authoritiesdetail.pl?authid=<!-- TMPL_VAR NAME="authid" -->"><!-- TMPL_VAR NAME="summary" --></a></td>
+                                       <td><!-- TMPL_VAR NAME="summary" --></td>
 
                                                <td>
                                        <!-- TMPL_VAR NAME="authtypetext" -->
index 5241d19..468e90f 100644 (file)
             widgets : ['zebra'],
             sortList: [[0,0]]
         });<!-- TMPL_IF NAME="GoogleJackets" -->
-        KOHA.Google.GetCoverFromIsbn(<!-- TMPL_VAR name="covernewwindow" -->);<!-- /TMPL_IF --><!-- TMPL_IF NAME="TagsEnabled" -->
-        $(".tagbutton").click(KOHA.Tags.add_tag_button);<!-- /TMPL_IF -->
-               <!-- TMPL_IF NAME="opacbookbag" -->$("a.print").parent().after("<li><a class=\"addtocart\" href=\"#\" onclick=\"addRecord('"+$("input[name=bib]").val()+"'); return false;\">"+_("Add to Your Cart")+"<\/a><\/li>");
-<!-- /TMPL_IF -->});
+        KOHA.Google.GetCoverFromIsbn(<!-- TMPL_VAR name="covernewwindow" -->);<!-- /TMPL_IF --><!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" -->
+        $(".tagbutton").click(KOHA.Tags.add_tag_button);<!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
+
+});
 
 YAHOO.util.Event.onContentReady("furtherm", function () {
     $("#furtherm").css("display","block").css("visibility","hidden");
@@ -81,13 +81,13 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     <span class="Z3988" title="<!-- TMPL_VAR NAME="ocoins" -->"></span>
     <!-- /TMPL_IF -->
 
+    <div id="views"><span class="view"><span id="Normalview">Normal View</span></span> <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">MARC View</a></span> <!-- TMPL_IF NAME="ISBD" --><span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">ISBD View</a></span><!-- /TMPL_IF -->
+    </div>
     <!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
         <!-- TMPL_VAR NAME="XSLTBloc" -->
     <!-- TMPL_ELSE -->
-    <h1><!-- TMPL_VAR NAME="title" escape="html" --><!-- TMPL_IF NAME="subtitle" --> <span class="subtitle"><!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" --> <!-- /TMPL_LOOP --></span><!-- /TMPL_IF --></h1>
+    <h1 class="title"><!-- TMPL_VAR NAME="title" escape="html" --><!-- TMPL_IF NAME="subtitle" --> <span class="subtitle"><!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" --> <!-- /TMPL_LOOP --></span><!-- /TMPL_IF --></h1>
     <!-- TMPL_IF NAME="author" --><h5 class="author">by <a href="/cgi-bin/koha/opac-search.pl?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="author" ESCAPE="HTML" --></a></h5><!-- /TMPL_IF --> 
-    <div id="views"><span class="view"><span id="Normalview">Normal View</span></span> <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">MARC View</a></span> <!-- TMPL_IF NAME="ISBD" --><span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">ISBD View</a></span><!-- /TMPL_IF -->
-    </div>
 
     <span class="results_summary"><!-- TMPL_UNLESS NAME="item_level_itypes" -->
         [
@@ -805,6 +805,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         </a></li>
     <!-- /TMPL_IF --><!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="opacbookbag" --><li><a class="addtocart" href="#" onclick="addRecord('<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Add to Your Cart</a></li><!-- /TMPL_IF -->
                <li style="display:none;"><a href="#" id="furthersearches">More searches</a></li>
 </ul>
 
index 1793a86..c585936 100644 (file)
     <tr><th>&nbsp;</th><th>Days in advance</th><!-- TMPL_IF NAME="SMSSendDriver" --><th>SMS</th><!-- /TMPL_IF --><th>Email</th><th>Digests only?</th><!-- <th>RSS</th> --><th>Do not notify</th></tr>
     <!-- TMPL_LOOP name="messaging_preferences" -->
     <tr>
-      <td><!-- TMPL_VAR NAME="message_name" --></td>
+      <td><!-- TMPL_IF NAME="Item DUE" -->Item DUE
+          <!-- TMPL_ELSIF NAME="Advance Notice" -->Advance Notice
+          <!-- TMPL_ELSIF NAME="Upcoming Events" -->Upcoming Events
+          <!-- TMPL_ELSIF NAME="Hold Filled" -->Hold Filled
+          <!-- TMPL_ELSIF NAME="Item Check-in" -->Item Check-in
+          <!-- TMPL_ELSIF NAME="Item Checkout" -->Item Checkout
+          <!-- TMPL_ELSE -->Unknown <!-- /TMPL_IF --></td>
       <!-- TMPL_IF NAME="takes_days" -->
       <td><select name="<!-- TMPL_VAR NAME="message_attribute_id" -->-DAYS">
           <!-- TMPL_LOOP name="select_days" -->
       <!-- TMPL_ELSE -->
       <td>-</td>
       <!-- /TMPL_IF -->
-      <!-- TMPL_IF NAME="transport_sms" -->
+<!--      <!-- TMPL_IF NAME="transport_sms" -->
       <!-- TMPL_IF NAME="SMSSendDriver" --><td><input type="checkbox"
                  id="sms<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  name="<!-- TMPL_VAR NAME="message_attribute_id" -->"
                  value="sms" <!-- TMPL_VAR NAME="transport_sms"   --> onclick = "document.opacmessaging.none<!-- TMPL_VAR NAME="message_attribute_id" -->.checked=false;" /></td><!-- /TMPL_IF -->
       <!-- TMPL_ELSE -->
       <td>-</td>
-      <!-- /TMPL_IF -->
+      <!-- /TMPL_IF --> -->
 
       <!-- TMPL_IF NAME="transport_email" -->
       <td><input type="checkbox"
index b727361..56cc345 100644 (file)
                     <th id="place_on_hdr" style="display:none">Place On</th>
                   <!-- /TMPL_IF -->
                   <!-- TMPL_UNLESS NAME="singleBranchMode" -->
-                    <th>Pickup Location</th>
+                   <!-- TMPL_IF NAME="choose_branch"-->
+                        <th>Pickup Location</th>
+                   <!-- /TMPL_IF -->
                   <!-- /TMPL_UNLESS -->
                 </tr><!-- TMPL_ELSE --><tr><th colspan="5">Title</th></tr><!-- /TMPL_UNLESS -->
 
                                         <!-- /TMPL_IF --><!-- /TMPL_IF -->
 
                     <!-- TMPL_UNLESS NAME="singleBranchMode" -->
-                      <!-- TMPL_IF NAME="holdable" --><td>
+                        <!-- TMPL_IF NAME="holdable" -->
+                           <!-- TMPL_IF NAME="choose_branch" -->
+                                          <td>
                                               <select name="branch" id="branch_<!-- TMPL_VAR NAME="biblionumber" -->"
                                                 <!-- TMPL_UNLESS NAME="holdable" -->disabled="disabled"<!-- /TMPL_UNLESS --> >
                                                 <!-- TMPL_LOOP NAME="branchChoicesLoop" -->
                                                   <!-- /TMPL_IF -->
                                                 <!-- /TMPL_LOOP -->
                                               </select>
-                                            </td><!-- /TMPL_IF -->
+                                           </td>
+                           <!-- /TMPL_IF -->
+                       <!-- /TMPL_IF -->
                     <!-- /TMPL_UNLESS -->
                   </tr>
 
index 4920acb..8f87b1b 100644 (file)
@@ -7,7 +7,7 @@
 <!-- /TMPL_IF -->
 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
 <link rel="alternate" type="application/rss+xml" title="Koha - RSS"
-href="/cgi-bin/koha/opac-rss.pl?<!-- TMPL_VAR name="query_cgi"--><!-- TMPL_VAR NAME="limit_cgi" -->" />
+href="/cgi-bin/koha/opac-rss.pl?<!-- TMPL_VAR name="query_cgi"--><!-- TMPL_VAR NAME="limit_cgi" ESCAPE="HTML" -->" />
 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 <script type="text/javascript">
 //<![CDATA[
index 1e1d2d5..4646365 100644 (file)
@@ -249,6 +249,10 @@ $(function() {
                         </td>
                     <!-- /TMPL_UNLESS -->
                         <td>
+                        <!-- TMPL_IF NAME="XSLTBloc" -->
+                         <!-- TMPL_VAR NAME="XSLTBloc" -->
+                        <!-- TMPL_ELSE -->
+
                                 <!-- TMPL_IF name="BiblioDefaultViewmarc" --><a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title">
                                 <!-- TMPL_ELSE -->
                                 <!-- TMPL_IF name="BiblioDefaultViewisbd" --><a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->" title="View details for this title">
@@ -272,7 +276,7 @@ $(function() {
         (<!-- TMPL_VAR NAME="itemcallnumber" -->)<!-- TMPL_IF NAME="__LAST__" -->.<!-- TMPL_ELSE -->,<!-- /TMPL_IF -->
           <!-- /TMPL_IF -->
           <!-- /TMPL_LOOP --><!-- TMPL_ELSE -->This record has no items.<!-- /TMPL_IF --></span>
-
+            <!-- /TMPL_IF -->
         <!-- TMPL_IF NAME="TagsEnabled" -->
                 <!-- TMPL_IF NAME="TagsShowOnList" -->
                 <!-- TMPL_IF NAME="TagLoop" -->
index ab1e811..bc2b7f3 100644 (file)
@@ -91,6 +91,19 @@ $.tablesorter.addParser({
                        <!-- TMPL_IF name="selected" --><option value="<!-- TMPL_VAR name="itemtype"-->" selected="selected"> <!--TMPL_ELSE--><option value="<!-- TMPL_VAR name="itemtype" -->"> <!--/TMPL_IF--> <!-- TMPL_VAR name="description" --></option>
         <!-- /TMPL_LOOP -->
         </select> </li>
+    <!-- TMPL_IF NAME="branch_loop" -->
+    <li><label for="branch">Branch:</label>
+        <select name="branch" id="branch">
+        <!-- TMPL_LOOP NAME="branch_loop" -->
+            <!-- TMPL_IF name="selected" -->
+            <option value="<!-- TMPL_VAR NAME="value" -->" selected="selected"><!-- TMPL_VAR NAME="branchname" --></option>
+            <!-- TMPL_ELSE -->
+            <option value="<!-- TMPL_VAR NAME="value" -->"><!-- TMPL_VAR NAME="branchname" --></option>
+            <!-- /TMPL_IF -->
+        <!-- /TMPL_LOOP -->
+        </select>
+    </li>
+    <!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="patron_reason_loop" --><li><label for="patronreason">Reason for suggestion: </label><select name="patronreason" id="patronreason"><option value="">-- Choose --</option><!-- TMPL_LOOP NAME="patron_reason_loop" -->
            <option value="<!-- TMPL_VAR NAME="authorised_value" -->"><!--TMPL_VAR NAME="lib" --></option>
     <!-- /TMPL_LOOP --></select></li><!-- /TMPL_IF -->
index 08aac17..4f8ae07 100644 (file)
@@ -388,7 +388,7 @@ $.tablesorter.addParser({
                     <!-- TMPL_IF NAME="wait" -->
                         <!-- TMPL_IF NAME="atdestination" -->
                             <!-- TMPL_IF NAME="found" -->
-                            Item waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b>
+                            Item waiting at <b> <!-- TMPL_VAR NAME="wbrname" --></b><!-- TMPL_IF NAME="formattedwaitingdate" --> until <!-- TMPL_VAR NAME="formattedwaitingdate" --><!-- /TMPL_IF -->
                             <input type="hidden" name="pickup" value="<!-- TMPL_VAR NAME="wbrcd" -->" />
                             <!-- TMPL_ELSE -->
                             Item waiting to be pulled from <b> <!-- TMPL_VAR NAME="wbrname" --></b>
@@ -409,7 +409,8 @@ $.tablesorter.addParser({
                <!-- TMPL_IF NAME="cancelable" -->
                        <form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
                        <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
-                       <input type="submit" name="submit" class="icon delete cancel" value="Cancel" onclick="return confirmDelete(MSG_CONFIRM_DELETE_HOLD);" /></form>
+               <input type="hidden" name="reservenumber" value="<!-- TMPL_VAR NAME="reservenumber" -->" />
+                       <input type="submit" name="submit" class="icon delete cancel" value="Cancel" onclick="return confirmDelete('Are you sure you want to cancel this hold?');" /></form>
                <!-- TMPL_ELSE -->
                        &nbsp;
                <!-- /TMPL_IF -->
index 477e0d6..024442e 100644 (file)
@@ -37,8 +37,8 @@
 <li><label for="mobile">Mobile Phone:</label> <input id="mobile" type="text" value="<!-- TMPL_VAR name="mobile" -->"  name="mobile" /></li>
 <li><label for="phonepro">Work phone:</label> <input id="phonepro"  type="text" value="<!-- TMPL_VAR name="phonepro" -->"  name="phonepro" /></li>
 <li><label for="fax">Fax:</label> <input id="fax" type="text" value="<!-- TMPL_VAR name="fax" -->"  name="fax" /></li>
-<li><label for="emailaddress">Email:</label> <input id="emailaddress" type="text" value="<!-- TMPL_VAR name="email" -->"  name="email" /></li>
-<li><label for="emailpro">Work Email:</label> <input id="emailpro" type="text" value="<!-- TMPL_VAR name="emailpro" -->"  name="emailpro" /></li>
+<li><label for="emailaddress">Primary Email:</label> <input id="emailaddress" type="text" value="<!-- TMPL_VAR name="email" -->"  name="emailaddress" /></li>
+<li><label for="emailpro">Secondary Email:</label> <input id="emailpro" type="text" value="<!-- TMPL_VAR name="emailpro" -->"  name="emailpro" /></li>
 </ol>
 </fieldset>
 
 <li><span class="label">Mobile Phone:</span>  <!-- TMPL_VAR name="mobile" --></li>
 <li><span class="label">Work phone:</span>  <!-- TMPL_VAR name="phonepro" --></li>
 <li><span class="label">Fax:</span>  <!-- TMPL_VAR name="fax" --></li>
-<li><span class="label">Email:</span>  <!-- TMPL_VAR name="email" --></li>
-<li><span class="label">Work Email:</span>  <!-- TMPL_VAR name="emailpro" --></li>
+<li><span class="label">Primary Email:</span>  <!-- TMPL_VAR name="email" --></li>
+<li><span class="label">Secondary Email:</span>  <!-- TMPL_VAR name="emailpro" --></li>
 </ol>
 </fieldset>
 
index 5703059..71494cd 100755 (executable)
@@ -22,6 +22,9 @@
     <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
     <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
     <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/>
+    
+    <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
+    <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
         <xsl:variable name="leader" select="marc:leader"/>
         <xsl:variable name="leader6" select="substring($leader,7,1)"/>
         <xsl:variable name="leader7" select="substring($leader,8,1)"/>
@@ -85,7 +88,7 @@
         </xsl:if>
 
         <xsl:if test="marc:datafield[@tag=245]">
-        <h1>
+        <h1 class="title">
             <xsl:for-each select="marc:datafield[@tag=245]">
                     <xsl:call-template name="subfieldSelect">
                         <xsl:with-param name="codes">a</xsl:with-param>
         <xsl:for-each select="marc:datafield[@tag=100 or @tag=700]">
         <a>
         <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
+            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
         <xsl:for-each select="marc:datafield[@tag=110 or @tag=710]">
         <a>
         <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
+            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
             </xsl:choose>
         <a>
         <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
+            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
         </h5>
         </xsl:when>
         </xsl:choose>
-        <div id="views">
-        <span class="view"><span id="Normalview">Normal View</span> </span>
-        <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}" title="MARC">MARC View</a></span>
-<xsl:if test="$ShowISBD!='0'">
-        <span class="view"><a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=999]/marc:subfield[@code='c']}">ISBD View</a></span>
-</xsl:if>
-        </div>
 
    <xsl:if test="$DisplayOPACiconsXSLT!='0'">
         <xsl:if test="$materialTypeCode!=''">
         <span class="results_summary"><span class="label">Type: </span>
-        <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
+        <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element>
         <xsl:value-of select="$materialTypeLabel"/>
         </span>
         </xsl:if>
                         </a>
                     </xsl:when>
                     <xsl:otherwise>
-                        <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='t']}">
+                        <a href="/cgi-bin/koha/opac-search.pl?q=se:{marc:subfield[@code='a']}">
                             <xsl:call-template name="chopPunctuation">
                                 <xsl:with-param name="chopString">
                                     <xsl:call-template name="subfieldSelect">
             <xsl:for-each select="marc:datafield[substring(@tag, 1, 1) = '6']">
             <a>
             <xsl:choose>
-            <xsl:when test="marc:subfield[@code=9]">
+            <xsl:when test="marc:subfield[@code=9] and $UseAuthoritiesForTracings='1'">
                 <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
             </xsl:when>
             <xsl:otherwise>
-                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
+                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=su<xsl:value-of select="$SubjectModifier"/>:<xsl:value-of select="marc:subfield[@code='a']"/></xsl:attribute>
             </xsl:otherwise>
             </xsl:choose>
             <xsl:call-template name="chopPunctuation">
         <xsl:if test="marc:datafield[@tag=856]">
         <span class="results_summary"><span class="label">Online Resources: </span>
         <xsl:for-each select="marc:datafield[@tag=856]">
-                            <xsl:if test="$OPACURLOpenInNewWindow='0'">
-                                   <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
-                                    <xsl:choose>
-                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
-                                        <xsl:call-template name="subfieldSelect">
-                                        <xsl:with-param name="codes">y3z</xsl:with-param>
-                                        </xsl:call-template>
-                                    </xsl:when>
-                                    <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
-                                        <xsl:choose>
-                                        <xsl:when test="$URLLinkText!=''">
-                                                <xsl:value-of select="$URLLinkText"/>
-                                        </xsl:when>
-                                        <xsl:otherwise>
-                                                <xsl:text>Click here to access online</xsl:text>
-                                        </xsl:otherwise>
-                                        </xsl:choose>
-                                    </xsl:when>
-                                    </xsl:choose>
-                                    </a>
-                              </xsl:if>
-                            <xsl:if test="$OPACURLOpenInNewWindow='1'">
-                                   <a target='_blank'><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
-                                    <xsl:choose>
-                                    <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
-                                        <xsl:call-template name="subfieldSelect">
-                                        <xsl:with-param name="codes">y3z</xsl:with-param>
-                                        </xsl:call-template>
-                                    </xsl:when>
-                                    <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
-                                        <xsl:choose>
-                                        <xsl:when test="$URLLinkText!=''">
-                                                <xsl:value-of select="$URLLinkText"/>
-                                        </xsl:when>
-                                        <xsl:otherwise>
-                                                <xsl:text>Click here to access online</xsl:text>
-                                        </xsl:otherwise>
-                                        </xsl:choose>
-                                    </xsl:when>
-                                    </xsl:choose>
-                                    </a>
-                              </xsl:if>
-                                    <xsl:choose>
-                                    <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
-                                    <xsl:otherwise> | </xsl:otherwise>
-                                    </xsl:choose>
-
+            <a><xsl:attribute name="href"><xsl:value-of select="marc:subfield[@code='u']"/></xsl:attribute>
+            <xsl:if test="$OPACURLOpenInNewWindow='1'">
+                <xsl:attribute name="target">_blank</xsl:attribute>
+            </xsl:if>
+            <xsl:choose>
+            <xsl:when test="marc:subfield[@code='y' or @code='3' or @code='z']">
+                <xsl:call-template name="subfieldSelect">
+                    <xsl:with-param name="codes">y3z</xsl:with-param>
+                </xsl:call-template>
+            </xsl:when>
+            <xsl:when test="not(marc:subfield[@code='y']) and not(marc:subfield[@code='3']) and not(marc:subfield[@code='z'])">
+                <xsl:choose>
+                <xsl:when test="$URLLinkText!=''">
+                    <xsl:value-of select="$URLLinkText"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:text>Click here to access online</xsl:text>
+                </xsl:otherwise>
+                </xsl:choose>
+            </xsl:when>
+            </xsl:choose>
+            </a>
+            <xsl:choose>
+            <xsl:when test="position()=last()"><xsl:text>  </xsl:text></xsl:when>
+            <xsl:otherwise> | </xsl:otherwise>
+            </xsl:choose>
         </xsl:for-each>
         </span>
         </xsl:if>
+
+        <!-- 530 -->
+        <xsl:if test="marc:datafield[@tag=530]">
+        <xsl:for-each select="marc:datafield[@tag=530]">
+        <span class="results_summary additionalforms">
+            <xsl:call-template name="subfieldSelect">
+                <xsl:with-param name="codes">abcd</xsl:with-param>
+            </xsl:call-template>
+            <xsl:for-each select="marc:subfield[@code='u']">
+                <a><xsl:attribute name="href"><xsl:value-of select="text()"/></xsl:attribute>
+                <xsl:if test="$OPACURLOpenInNewWindow='1'">
+                    <xsl:attribute name="target">_blank</xsl:attribute>
+                </xsl:if>
+                <xsl:value-of select="text()"/>
+                </a>
+            </xsl:for-each>
+        </span>
+        </xsl:for-each>
+        </xsl:if>
+
+        <!-- 505 -->
         <xsl:if test="marc:datafield[@tag=505]">
         <xsl:for-each select="marc:datafield[@tag=505]">
-        <span class="results_summary">
+        <span class="results_summary contents">
         <xsl:choose>
         <xsl:when test="@ind1=1">
             <span class="label">Incomplete contents:</span>
         </xsl:choose>
         <xsl:choose>
         <xsl:when test="@ind2=0">
-            <xsl:for-each select="marc:subfield[@code='t']">
-                <xsl:value-of select="marc:subfield[@code=t]"/> <xsl:value-of select="marc:subfield[@code=r]"/>
-            </xsl:for-each>
+            <xsl:call-template name="subfieldSelect">
+                <xsl:with-param name="codes">tru</xsl:with-param>
+            </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
             <xsl:call-template name="subfieldSelect">
         </xsl:for-each>
         </xsl:if>
 
+        <!-- 583 -->
+        <xsl:if test="marc:datafield[@tag=583]">
+        <xsl:for-each select="marc:datafield[@tag=583]">
+            <xsl:if test="@ind1=1 or @ind1=' '">
+            <span class="results_summary actionnote">
+                <xsl:choose>
+                <xsl:when test="marc:subfield[@code='z']">
+                    <xsl:value-of select="marc:subfield[@code='z']"/>
+                </xsl:when>
+                <xsl:otherwise>
+                    <xsl:call-template name="subfieldSelect">
+                        <xsl:with-param name="codes">abcdefgijklnou</xsl:with-param>
+                    </xsl:call-template>
+                </xsl:otherwise>
+                </xsl:choose>
+            </span>
+            </xsl:if>
+        </xsl:for-each>
+        </xsl:if>
+
+        <!-- 586 -->
+        <xsl:if test="marc:datafield[@tag=586]">
+        <xsl:for-each select="marc:datafield[@tag=586]">
+            <span class="results_summary awardsnote">
+                <xsl:if test="@ind1=' '">
+                <span class="label">Awards: </span>
+                </xsl:if>
+                <xsl:value-of select="marc:subfield[@code='a']"/>
+            </span>
+        </xsl:for-each>
+        </xsl:if>
+
         <!-- 773 -->
         <xsl:if test="marc:datafield[@tag=773]">
         <xsl:for-each select="marc:datafield[@tag=773]">
         </xsl:choose>
         </span>
                 <xsl:variable name="f773">
-                    <xsl:call-template name="subfieldSelect">
+                    <xsl:call-template name="chopPunctuation"><xsl:with-param name="chopString"><xsl:call-template name="subfieldSelect">
                         <xsl:with-param name="codes">at</xsl:with-param>
-                    </xsl:call-template>
+                    </xsl:call-template></xsl:with-param></xsl:call-template>
                 </xsl:variable>
             <xsl:choose>
                 <xsl:when test="$UseControlNumber = '1' and marc:subfield[@code='w']">
-                    <a href="/cgi-bin/koha/opac-search.pl?q=Control-number:{marc:subfield[@code='w']}">
-                        <xsl:value-of select="translate($f773, '()', '')"/>
+                    <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Control-number:<xsl:call-template name="extractControlNumber"><xsl:with-param name="subfieldW" select="marc:subfield[@code='w']"/></xsl:call-template></xsl:attribute>
+                        <xsl:value-of select="translate($f773, '()', '')"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
                     </a>
                 </xsl:when>
                 <xsl:otherwise>
                     <a><xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=Title:<xsl:value-of select="translate($f773, '()', '')"/></xsl:attribute>
-                        <xsl:value-of select="$f773"/>
+                        <xsl:value-of select="$f773"/><xsl:if test="marc:subfield[@code='g']"><xsl:text> </xsl:text><xsl:value-of select="marc:subfield[@code='g']"/></xsl:if>
                     </a>
                 </xsl:otherwise>
             </xsl:choose>
index b3f61e5..0b53e22 100644 (file)
@@ -19,6 +19,7 @@
         <!-- Option: Display Alternate Graphic Representation (MARC 880)  -->
         <xsl:variable name="display880" select="boolean(marc:datafield[@tag=880])"/>
 
+    <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
     <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
     <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
     <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
                 chip cartridge
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='c']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="computer optical disc cartridge" title="computer optical disc cartridge"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="computer optical disc cartridge" title="computer optical disc cartridge" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='j']">
                 magnetic disc
                 magneto-optical disc
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='o']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="optical disc" title="optical disc"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="optical disc" title="optical disc" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='r']">
                available online
-                <img src="/opac-tmpl/prog/famfamfam/silk/drive_web.png" alt="remote" title="remote"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/drive_web.png" alt="remote" title="remote" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='a']">
                 tape cartridge
             </xsl:if>
 
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='a']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="celestial globe" title="celestial globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="celestial globe" title="celestial globe" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='e']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="earth moon globe" title="earth moon globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="earth moon globe" title="earth moon globe" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='b']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="planetary or lunar globe" title="planetary or lunar globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="planetary or lunar globe" title="planetary or lunar globe" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='c']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="terrestrial globe" title="terrestrial globe"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="terrestrial globe" title="terrestrial globe" class="format"/>
             </xsl:if>
 
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='o'][substring(text(),2,1)='o']">
                 film reel
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='n']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/chart_curve.png" alt="chart" title="chart"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/chart_curve.png" alt="chart" title="chart" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='c']">
                 collage
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='d']">
-                 <img src="/opac-tmpl/prog/famfamfam/silk/pencil.png" alt="drawing" title="drawing"/>
+                 <img src="/opac-tmpl/prog/famfamfam/silk/pencil.png" alt="drawing" title="drawing" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='o']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/note.png" alt="flash card" title="flash card"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/note.png" alt="flash card" title="flash card" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='e']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/paintbrush.png" alt="painting" title="painting"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/paintbrush.png" alt="painting" title="painting" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='f']">
                 photomechanical print
                 photoprint
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='i']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/picture.png" alt="picture" title="picture"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/picture.png" alt="picture" title="picture" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='j']">
                 print
                 technical drawing
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='q'][substring(text(),2,1)='q']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/script.png" alt="notated music" title="notated music"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/script.png" alt="notated music" title="notated music" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='d']">
                 filmslip
                 other filmstrip type
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='s']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/pictures.png" alt="slide" title="slide"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/pictures.png" alt="slide" title="slide" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='t']">
                 transparency
                 sound cassette
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='d']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="sound disc" title="sound disc"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="sound disc" title="sound disc" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='t']">
                 sound-tape reel
                 braille
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='b']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/magnifier.png" alt="large print" title="large print"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/magnifier.png" alt="large print" title="large print" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='a']">
                 regular print
                 videocassette
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='d']">
-                <img src="/opac-tmpl/prog/famfamfam/silk/dvd.png" alt="videodisc" title="videodisc"/>
+                <img src="/opac-tmpl/prog/famfamfam/silk/dvd.png" alt="videodisc" title="videodisc" class="format"/>
             </xsl:if>
             <xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='r']">
                 videoreel
     <xsl:if test="$typeOf008!=''">
         <span class="label">Type: </span>
             <xsl:choose>
-                <xsl:when test="$leader19='a'"><img src="/opac-tmpl/prog/famfamfam/silk/book_link.png" alt="book" title="book"/> Set</xsl:when>
+                <xsl:when test="$leader19='a'"><img src="/opac-tmpl/prog/famfamfam/silk/book_link.png" alt="book" title="book" class="materialtype"/> Set</xsl:when>
                 <xsl:when test="$leader6='a'">
                     <xsl:choose>
-                        <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="book" title="book"/> Book</xsl:when>
-                        <xsl:when test="$leader7='i' or $leader7='s'"><img src="/opac-tmpl/prog/famfamfam/silk/newspaper.png" alt="serial" title="serial"/> Continuing Resource</xsl:when>
-                        <xsl:when test="$leader7='a' or $leader7='b'"><img src="/opac-tmpl/prog/famfamfam/silk/book_open.png" alt="article" title="article"/> Article</xsl:when>
+                        <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
+                        <xsl:when test="$leader7='i' or $leader7='s'"><img src="/opac-tmpl/prog/famfamfam/silk/newspaper.png" alt="serial" title="serial" class="materialtype"/> Continuing Resource</xsl:when>
+                        <xsl:when test="$leader7='a' or $leader7='b'"><img src="/opac-tmpl/prog/famfamfam/silk/book_open.png" alt="article" title="article" class="materialtype"/> Article</xsl:when>
                     </xsl:choose>
                 </xsl:when>
-                <xsl:when test="$leader6='t'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="book" title="book"/> Book</xsl:when>
-                               <xsl:when test="$leader6='o'"><img src="/opac-tmpl/prog/famfamfam/silk/report_disk.png" alt="kit" title="kit"/> Kit</xsl:when>
-                               <xsl:when test="$leader6='p'"><img src="/opac-tmpl/prog/famfamfam/silk/report_disk.png" alt="mixed materials" title="mixed materials"/>Mixed Materials</xsl:when>
-                <xsl:when test="$leader6='m'"><img src="/opac-tmpl/prog/famfamfam/silk/computer_link.png" alt="computer file" title="computer file"/> Computer File</xsl:when>
-                <xsl:when test="$leader6='e' or $leader6='f'"><img src="/opac-tmpl/prog/famfamfam/silk/map.png" alt="map" title="map"/> Map</xsl:when>
-                <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'"><img src="/opac-tmpl/prog/famfamfam/silk/film.png" alt="visual material" title="visual material"/> Visual Material</xsl:when>
-                <xsl:when test="$leader6='c' or $leader6='d'"><img src="/opac-tmpl/prog/famfamfam/silk/music.png" alt="score" title="score"/> Score</xsl:when>
-                <xsl:when test="$leader6='i'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="sound" title="sound"/> Sound</xsl:when>
-                <xsl:when test="$leader6='j'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="music" title="music"/> Music</xsl:when>
+                <xsl:when test="$leader6='t'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
+                               <xsl:when test="$leader6='o'"><img src="/opac-tmpl/prog/famfamfam/silk/report_disk.png" alt="kit" title="kit" class="materialtype"/> Kit</xsl:when>
+                               <xsl:when test="$leader6='p'"><img src="/opac-tmpl/prog/famfamfam/silk/report_disk.png" alt="mixed materials" title="mixed materials" class="materialtype"/>Mixed Materials</xsl:when>
+                <xsl:when test="$leader6='m'"><img src="/opac-tmpl/prog/famfamfam/silk/computer_link.png" alt="computer file" title="computer file" class="materialtype"/> Computer File</xsl:when>
+                <xsl:when test="$leader6='e' or $leader6='f'"><img src="/opac-tmpl/prog/famfamfam/silk/map.png" alt="map" title="map" class="materialtype"/> Map</xsl:when>
+                <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'"><img src="/opac-tmpl/prog/famfamfam/silk/film.png" alt="visual material" title="visual material" class="materialtype"/> Visual Material</xsl:when>
+                <xsl:when test="$leader6='c' or $leader6='d'"><img src="/opac-tmpl/prog/famfamfam/silk/music.png" alt="score" title="score" class="materialtype"/> Score</xsl:when>
+                <xsl:when test="$leader6='i'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="sound" title="sound" class="materialtype"/> Sound</xsl:when>
+                <xsl:when test="$leader6='j'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="music" title="music" class="materialtype"/> Music</xsl:when>
             </xsl:choose>
     </xsl:if>
     <xsl:if test="string-length(normalize-space($physicalDescription))">
         </xsl:if>
             <xsl:choose>
                 <xsl:when test="$controlField008-21='d'">
-                     <img src="/opac-tmpl/prog/famfamfam/silk/database.png" alt="database" title="database"/>
+                     <img src="/opac-tmpl/prog/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
                 </xsl:when>
                 <xsl:when test="$controlField008-21='l'">
                     loose-leaf
                     periodical
                 </xsl:when>
                 <xsl:when test="$controlField008-21='w'">
-                     <img src="/opac-tmpl/prog/famfamfam/silk/world_link.png" alt="web site" title="web site"/>
+                     <img src="/opac-tmpl/prog/famfamfam/silk/world_link.png" alt="web site" title="web site" class="format"/>
                 </xsl:when>
             </xsl:choose>
         </xsl:if>
                 </xsl:when>
                 <xsl:when test="contains($controlField008-24,'b')">
                        bibliography
-                     <img src="/opac-tmpl/prog/famfamfam/silk/text_list_bullets.png" alt="bibliography" title="bibliography"/>
+                     <img src="/opac-tmpl/prog/famfamfam/silk/text_list_bullets.png" alt="bibliography" title="bibliography" class="natureofcontents"/>
                 </xsl:when>
                 <xsl:when test="contains($controlField008-24,'c')">
                     catalog
                     statistics
                 </xsl:when>
                 <xsl:when test="contains($controlField008-24,'t')">
-                     <img src="/opac-tmpl/prog/famfamfam/silk/report.png" alt="technical report" title="technical report"/>
+                     <img src="/opac-tmpl/prog/famfamfam/silk/report.png" alt="technical report" title="technical report" class="natureofcontents"/>
                 </xsl:when>
                 <xsl:when test="contains($controlField008-24,'v')">
                     legal case and case notes
                     numeric data
                 </xsl:when>
                 <xsl:when test="$controlField008-26='e'">
-                     <img src="/opac-tmpl/prog/famfamfam/silk/database.png" alt="database" title="database"/>
+                     <img src="/opac-tmpl/prog/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
                 </xsl:when>
                 <xsl:when test="$controlField008-26='f'">
-                     <img src="/opac-tmpl/prog/famfamfam/silk/font.png" alt="font" title="font"/> 
+                     <img src="/opac-tmpl/prog/famfamfam/silk/font.png" alt="font" title="font" class="format"/> 
                 </xsl:when>
                 <xsl:when test="$controlField008-26='g'">
-                     <img src="/opac-tmpl/prog/famfamfam/silk/controller.png" alt="game" title="game"/>
+                     <img src="/opac-tmpl/prog/famfamfam/silk/controller.png" alt="game" title="game" class="format"/>
                 </xsl:when>
             </xsl:choose>
         </xsl:if>
                 festschrift
             </xsl:if>
             <xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
-                 <img src="/opac-tmpl/prog/famfamfam/silk/user.png" alt="biography" title="biography"/>
+                 <img src="/opac-tmpl/prog/famfamfam/silk/user.png" alt="biography" title="biography" class="natureofcontents"/>
             </xsl:if>
 
             <xsl:if test="$controlField008-33 and $controlField008-33!='|' and $controlField008-33!='u' and $controlField008-33!=' '">
                        <xsl:value-of select="count(key('item-by-status', 'Withdrawn'))"/>
                        <xsl:text>). </xsl:text>                   </span>
                                   </xsl:if>
-                    <xsl:if test="count(key('item-by-status', 'Lost'))>0">
+                    <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
                    <span class="unavailable">
                        <xsl:text>Lost (</xsl:text>
                        <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
index d101723..559de13 100644 (file)
 <xsl:text> </xsl:text>
        </xsl:template>
 
+       <!-- Function extractControlNumber is used to extract the control number (record number) from MARC tags 773/80/85 [etc.] subfield $w.
+            Parameter: control number string.
+            Assumes LOC convention: (OrgCode)recordNumber.
+            If OrgCode is not present, return full string.
+            Additionally, handle various brackets/parentheses. Chop leading and trailing spaces.
+       -->
+       <xsl:template name="extractControlNumber">
+           <xsl:param name="subfieldW"/>
+           <xsl:variable name="tranW" select="translate($subfieldW,']})&gt;','))))')"/>
+           <xsl:choose>
+             <xsl:when test="contains($tranW,')')">
+               <xsl:value-of select="normalize-space(translate(substring-after($tranW,')'),'[]{}()&lt;&gt;',''))"/>
+             </xsl:when>
+             <xsl:otherwise>
+               <xsl:value-of select="normalize-space($subfieldW)"/>
+             </xsl:otherwise>
+           </xsl:choose>
+       </xsl:template>
 
     <!-- Function m880Select:  Display Alternate Graphic Representation (MARC 880) for selected latin "base"tags
         - should be called immediately before the corresonding latin tags are processed 
index 725c559..e4e5f67 100644 (file)
     </xsl:for-each>
   </xsl:if>
 
-  <div id="views">
-    <span class="view">
-      <span id="Normalview">Normal View</span>
-    </span>
-    <span class="view">
-      <a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC" rel="gb_page_center[600,500]">MARC View</a>
-    </span>
-    <span class="view">
-      <a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC">Expanded MARC View</a>
-    </span>
-    <span class="view">
-      <a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}">Card View (ISBD)</a>
-    </span>
-  </div>
-
   <xsl:call-template name="tag_4xx" />
 
   <xsl:call-template name="tag_7xx">
index 19b6745..cfb8823 100644 (file)
@@ -26,6 +26,8 @@
   <xsl:variable name="isbn"
    select="marc:datafield[@tag=010]/marc:subfield[@code='a']"/>
 
+  <xsl:variable name="hidelostitems" select="marc:sysprefs/marc:syspref[@name='hidelostitems']"/>
+
   <xsl:if test="marc:datafield[@tag=200]">
     <xsl:for-each select="marc:datafield[@tag=200]">
       <xsl:variable name="title" select="marc:subfield[@code='a']"/>
         <xsl:text>). </xsl:text>
       </span>
     </xsl:if>
-    <xsl:if test="count(key('item-by-status', 'Lost'))>0">
+    <xsl:if test="$hidelostitems='0' and count(key('item-by-status', 'Lost'))>0">
       <span class="unavailable">
         <xsl:text>Lost (</xsl:text>
         <xsl:value-of select="count(key('item-by-status', 'Lost'))"/>
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 (file)
index 0000000..8400aa8
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/itemtypeimg/bridge/reference.gif differ
index 8330459..cc1d0b5 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.03.00.XXX';
+    our $VERSION = '3.03.00.031';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index 1108726..608be04 100755 (executable)
@@ -33,13 +33,13 @@ my $layout = C4::Labels::Layout->retrieve(layout_id => $layout_id);
 
 sub _calc_next_label_pos {
     my ($row_count, $col_count, $llx, $lly) = @_;
-    if ($col_count lt $template->get_attr('cols')) {
+    if ($col_count < $template->get_attr('cols')) {
         $llx = ($llx + $template->get_attr('label_width') + $template->get_attr('col_gap'));
         $col_count++;
     }
     else {
         $llx = $template->get_attr('left_margin');
-        if ($row_count eq $template->get_attr('rows')) {
+        if ($row_count == $template->get_attr('rows')) {
             $pdf->Page();
             $lly = ($template->get_attr('page_height') - $template->get_attr('top_margin') - $template->get_attr('label_height'));
             $row_count = 1;
index 51b71d6..0e80861 100755 (executable)
@@ -5,6 +5,7 @@
 
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index df12a2a..50595ad 100755 (executable)
@@ -5,6 +5,7 @@
 
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index df688d1..f66b851 100755 (executable)
@@ -6,6 +6,7 @@
 
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -99,14 +100,20 @@ my ($count,$results);
 
 my @searchpatron;
 push @searchpatron, $member if ($member);
-push @searchpatron, $patron if (keys %$patron);
-my $from= ($startfrom-1)*$resultsperpage;
-my $to=$from+$resultsperpage;
- #($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  ) if (@searchpatron);
- my $search_scope=($quicksearch?"field_start_with":"contain");
- ($results)=Search(\@searchpatron,\@orderby,undef,undef,["firstname","surname","email","othernames","cardnumber","userid"],$search_scope  ) if (@searchpatron);
-if ($results){
-       $count =scalar(@$results);
+push @searchpatron, $patron if ( keys %$patron );
+my $from = ( $startfrom - 1 ) * $resultsperpage;
+my $to   = $from + $resultsperpage;
+
+#($results)=Search(\@searchpatron,{surname=>1,firstname=>1},[$from,$to],undef,["firstname","surname","email","othernames"]  ) if (@searchpatron);
+my $search_scope = ( $quicksearch ? "field_start_with" : "start_with" );
+($results) = Search( \@searchpatron, \@orderby, undef, undef, [ "firstname", "surname", "othernames", "cardnumber", "userid" ], $search_scope ) if (@searchpatron);
+
+if ($results) {
+       for my $field ('categorycode','branchcode'){
+               next unless ($patron->{$field});
+               @$results = grep { $_->{$field} eq $patron->{$field} } @$results; 
+       }
+    $count = scalar(@$results);
 }
 my @resultsdata;
 $to=($count>$to?$to:$count);
index 063e489..2195df4 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2006 SAN OUEST PROVENCE et Paul POULAIN
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -70,14 +71,15 @@ my $destination    = $input->param('destination');
 my $cardnumber     = $input->param('cardnumber');
 my $check_member   = $input->param('check_member');
 my $nodouble       = $input->param('nodouble');
-$nodouble = 1 if $op eq 'modify'; # FIXME hack to represent fact that if we're
-                                  # modifying an existing patron, it ipso facto
-                                  # isn't a duplicate.  Marking FIXME because this
-                                  # script needs to be refactored.
-my $select_city    = $input->param('select_city');
-my $nok            = $input->param('nok');
-my $guarantorinfo  = $input->param('guarantorinfo');
-my $step           = $input->param('step') || 0;
+my $duplicate      = $input->param('duplicate');
+$nodouble = 1 if ($op eq 'modify' or $op eq 'duplicate');    # FIXME hack to represent fact that if we're
+                                     # modifying an existing patron, it ipso facto
+                                     # isn't a duplicate.  Marking FIXME because this
+                                     # script needs to be refactored.
+my $select_city   = $input->param('select_city');
+my $nok           = $input->param('nok');
+my $guarantorinfo = $input->param('guarantorinfo');
+my $step          = $input->param('step') || 0;
 my @errors;
 my $default_city;
 # $check_categorytype contains the value of duplicate borrowers category type to redirect in good template in step =2
@@ -98,9 +100,10 @@ my @field_check=split(/\|/,$check_BorrowerMandatoryField);
 foreach (@field_check) {
        $template->param( "mandatory$_" => 1);    
 }
-$template->param("add"=>1) if ($op eq 'add');
-$template->param("checked" => 1) if (defined($nodouble) && $nodouble eq 1);
-($borrower_data = GetMember( 'borrowernumber'=>$borrowernumber )) if ($op eq 'modify' or $op eq 'save');
+$template->param( "add" => 1 ) if ( $op eq 'add' );
+$template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' );
+$template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 );
+( $borrower_data = GetMember( 'borrowernumber' => $borrowernumber ) ) if ( $op eq 'modify' or $op eq 'save' or $op eq 'duplicate' );
 my $categorycode  = $input->param('categorycode') || $borrower_data->{'categorycode'};
 my $category_type = $input->param('category_type');
 my $new_c_type = $category_type; #if we have input param, then we've already chosen the cat_type.
@@ -116,9 +119,9 @@ $category_type="A" unless $category_type; # FIXME we should display a error mess
 %data = %$borrower_data if ($borrower_data);
 
 # initialize %newdata
-my %newdata;   # comes from $input->param()
-if ($op eq 'insert' || $op eq 'modify' || $op eq 'save') {
-    my @names= ($borrower_data && $op ne 'save') ? keys %$borrower_data : $input->param();
+my %newdata;                                                                             # comes from $input->param()
+if ( $op eq 'insert' || $op eq 'modify' || $op eq 'save' || $op eq 'duplicate' ) {
+    my @names = ( $borrower_data && $op ne 'save' ) ? keys %$borrower_data : $input->param();
     foreach my $key (@names) {
         if (defined $input->param($key)) {
             $newdata{$key} = $input->param($key);
@@ -275,8 +278,8 @@ if ($op eq 'save' || $op eq 'insert'){
   }
 }
 
-if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save') and ($step == 0 or $step == 3 )){
-    if (exists ($newdata{'dateexpiry'}) && !($newdata{'dateexpiry'})){
+if ( ($op eq 'modify' || $op eq 'insert' || $op eq 'save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){
+    unless ($newdata{'dateexpiry'}){
         my $arg2 = $newdata{'dateenrolled'} || C4::Dates->today('iso');
         $newdata{'dateexpiry'} = GetExpiryDate($newdata{'categorycode'},$arg2);
     }
@@ -384,6 +387,11 @@ if ($op eq "modify")  {
     $template->param( updtype => 'M',modify => 1 );
     $template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1) unless $step;
 }
+if ( $op eq "duplicate" ) {
+    $template->param( updtype => 'I' );
+    $template->param( step_1 => 1, step_2 => 1, step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1 ) unless $step;
+}
+
 # my $cardnumber=$data{'cardnumber'};
 $data{'cardnumber'}=fixup_cardnumber($data{'cardnumber'}) if $op eq 'add';
 if(!defined($data{'sex'})){
index 6cb60fa..00c6034 100755 (executable)
@@ -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;
index cc2f153..bb593c4 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index 5a36bd7..cefdfba 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index 2a3947c..addeeb3 100755 (executable)
@@ -6,6 +6,7 @@
 
 
 # Copyright 2000-2002 Katipo Communications
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
diff --git a/misc/admin/koha-preferences b/misc/admin/koha-preferences
new file mode 100755 (executable)
index 0000000..a9e33f4
--- /dev/null
@@ -0,0 +1,324 @@
+#!/usr/bin/perl
+#
+# Copyright 2010 Jesse Weaver, Koha Dev Team
+#
+# 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.
+#
+
+use C4::Boolean;
+use C4::Context;
+use C4::Debug;
+use C4::Log;
+use Getopt::Long;
+use Pod::Usage;
+use YAML::Syck qw();
+$YAML::Syck::ImplicitTyping = 1;
+$YAML::Syck::SortKeys = 1;
+our %NOT_SET_PREFS = map { $_, 1 } qw( Version );
+
+=head1 NAME
+
+koha-preferences - Get, set, dump and load Koha system preferences
+
+=head1 SYNOPSIS
+
+misc/admin/koha-preferences COMMAND ...
+
+=cut
+
+sub print_usage {
+    my ( $annoyed ) = @_;
+
+    if ( $annoyed ) {
+        pod2usage( -verbose => 1, -exitval => 1, -output => \*STDERR );
+    } else {
+        pod2usage( -verbose => 1, -exitval => 0 );
+    }
+}
+
+sub _debug {
+    my ( $message ) = @_;
+
+    print STDERR $message . "\n" if ( $C4::Debug::debug );
+}
+
+sub _normalize_value {
+    my ($row) = @_;
+
+    # AFAIK, there are no sysprefs where NULL has a different meaning than ''.
+    return ( $row->{'value'} || '' ) unless ( $row->{'type'} eq 'YesNo' );
+
+    #
+    # In theory, YesNo sysprefs should always contain 1/0.
+    # In practice, however, they don't.
+    # - Yogi Berra
+    #
+    my $bool_value = eval {
+        return C4::Boolean::true_p( $row->{'value'} ) ? 1 : 0;
+    };
+    if ( $@ ) {
+        return 0;
+    } else {
+        return $bool_value;
+    }
+}
+
+sub _set_preference {
+    my ( $preference, $value ) = @_;
+
+    _debug( "Setting $preference to $value" );
+
+    C4::Context->set_preference( $preference, $value );
+    logaction( 'SYSTEMPREFERENCE', 'MODIFY', undef, $preference . " | " . $value );
+}
+
+sub GetPreferences {
+    my $dbh = C4::Context->dbh;
+
+    return {
+        map { $_->{'variable'},  _normalize_value($_) }
+        @{ $dbh->selectall_arrayref( "
+            SELECT
+              variable, value, type
+              FROM systempreferences
+        ", { Slice => {} } ) }
+    };
+}
+
+sub SetPreferences {
+    my ( %preferences ) = @_;
+
+    my $dbh = C4::Context->dbh;
+
+    # First, a quick check to make sure all of the system preferences exist
+    my $current_state = $dbh->selectall_arrayref( "
+        SELECT
+          variable, type, value
+          FROM systempreferences
+          WHERE variable IN (" . join( ', ', map( "?", keys %preferences ) ) . ")
+    ", { Slice => {} }, keys %preferences );
+
+    exit 2 if ( scalar( @$current_state ) != scalar( keys %preferences ) );
+
+    foreach my $row ( @$current_state ) {
+        # YAML::Syck encodes no as '', so deal with that
+        $preferences{$row->{'variable'}} = $preferences{$row->{'variable'}} eq '' ? 0 : C4::Boolean::true_p( $preferences{$row->{'variable'}} ) if ( $row->{'type'} eq 'YesNo' );
+    }
+
+    # Iterate through again, now that we've checked all of the YesNo sysprefs
+
+    foreach my $row ( @$current_state ) {
+        next if ( $preferences{$row->{'variable'}} eq $row->{'value'} );
+
+        _set_preference( $row->{'variable'}, $preferences{$row->{'variable'}} );
+    }
+}
+
+sub _fetch_preference {
+    my ( $preference ) = @_;
+
+    my $dbh = C4::Context->dbh;
+
+    my $row = $dbh->selectrow_hashref( "
+        SELECT
+          variable, value, type
+          FROM systempreferences
+          WHERE variable = ?
+          LIMIT 1
+    ", {}, $preference );
+
+    exit 2 unless ( $row );
+
+    return $row;
+}
+
+sub GetPreference {
+    my ( $preference ) = @_;
+
+    my $row = _fetch_preference( $preference );
+
+    return _normalize_value( $row );
+}
+
+sub SetPreference {
+    my ( $preference, $value ) = @_;
+
+    my $row = _fetch_preference( $preference );
+
+    $value = C4::Boolean::true_p($value) ? 1 : 0 if ( $row->{'type'} eq 'YesNo' );
+
+    exit 3 if ( $value eq $row->{'value'} );
+
+    _set_preference( $preference, $value );
+}
+
+sub ClearPreference {
+    my ( $preference ) = @_;
+
+    my $value = '';
+
+    my $row = _fetch_preference( $preference );
+
+    $value = 0 if ( $row->{'type'} eq 'YesNo' );
+
+    exit 3 if ( $value eq $row->{'value'} );
+
+    _set_preference( $preference, $value );
+}
+
+=head1 OPTIONS
+
+COMMAND can be any of the following:
+
+=over
+
+=item B<dump> [ -o I<OUTFILE> ]
+
+Dump all of Koha's system preferences as a simple YAML mapping into OUTFILE or
+STDOUT.
+
+=item B<load> [ -i I<INFILE> ] [ -f|--force ]
+
+Reads system preferences specified in YAML in INFILE or STDIN.  Will exit with a
+status of 2, without setting any sysprefs, if any of the sysprefs do not exist.
+Will also exit if any of the sysprefs are YesNo and have an invalid value.
+
+If there is a Version syspref in the input, it will not be set in the database,
+but it will be checked to make sure the running Koha version is equal or higher.
+The script will exit with a status of 4 if this is not true. Pass the -f option
+to skip this check.
+
+=item B<get> I<PREFERENCE>
+
+Print the value of the system preference PREFERENCE, followed by a newline.  If
+no such syspref exists, will exit with a status of 2.
+
+=item B<set> I<PREFERENCE> I<VALUE>
+
+Set the system preference PREFERENCE to the value VALUE. If no such syspref
+exists, will exit with a status of 2. If the syspref already has that value,
+will exit with a status of 3.
+
+If the syspref is YesNo, will accept only a boolean value, but the syntax for
+these is fairly lax (yes/no, on/off, 1/0, n/y, true/false are all accepted).
+
+=item B<clear> I<PREFERENCE>
+
+Clears the value of the system preference PREFERENCE. If no such syspref exists,
+will exit with a status of 2. Will set YesNo sysprefs to 'false'.
+
+=item B<manual>
+
+Print a longer, more detailed manual.
+
+=cut
+
+my %commands = (
+    dump => sub{
+        my ( $outfile );
+
+        GetOptions(
+            'o:s' => \$outfile
+        ) || _print_usage( 1 );
+
+        if ( $outfile ) {
+            YAML::Syck::DumpFile( $outfile, GetPreferences() );
+        } else {
+            print YAML::Syck::Dump( GetPreferences() );
+        }
+    },
+    load => sub {
+        my ( $infile, $force_version );
+
+        GetOptions(
+            'i:s' => \$infile,
+            'f' => \$force_version,
+        );
+
+        my $preferences = YAML::Syck::LoadFile($infile || \*STDIN);
+
+        die "Expected a YAML mapping" if ( ref($preferences) ne 'HASH' );
+
+        die "Tried to load preferences for version " . $preferences->{'Version'} . ", we are " . C4::Context->preference( 'Version' ) if ( $preferences->{'Version'} && C4::Context->preference( 'Version' ) < $preferences->{'Version'} );
+
+        my %prefs_to_set = (
+            map { $_, $preferences->{$_} }
+            grep { !$NOT_SET_PREFS{$_} }
+            keys %$preferences
+        );
+
+        SetPreferences( %prefs_to_set );
+    },
+    get => sub {
+        my ( $preference ) = @_;
+
+        print_usage() unless ( $preference );
+
+        print GetPreference( $preference ) . "\n";
+    },
+    set => sub {
+        my ( $preference, $value ) = @_;
+
+        print_usage() unless ( $preference && defined($value) );
+
+        SetPreference( $preference, $value );
+    },
+    clear => sub {
+        my ( $preference ) = @_;
+
+        print_usage() unless ( $preference );
+
+        ClearPreference( $preference );
+    },
+    manual => sub {
+        pod2usage( -verbose => 2 );
+    }
+);
+
+print_usage() if ( $ARGV[0] =~ /^(-h|--help|-help|help)$/ );
+
+print_usage( 1 ) if ( !$ARGV[0] || ref($commands{$ARGV[0]}) ne 'CODE' );
+
+$command = $commands{$ARGV[0]};
+shift @ARGV;
+$command->(@ARGV);
+
+=item B<help>
+
+Print a short usage message.
+
+=back
+
+=head1 EXAMPLES
+
+  $ export KOHA_DEBUG=1 # Used here to show what is being stored
+  $ misc/admin/koha-preferences get viewISBD
+  0
+  $ misc/admin/koha-preferences set viewISBD on
+  Setting viewISBD to 1
+  $ misc/admin/koha-preferences dump -o preferences.yaml
+  $ [ edit preferences.yaml ]
+  $ misc/admin/koha-preferences load -i preferences.yaml
+  $ misc/admin/koha-preferences load -i preferences-too-new.yaml
+  Tried to load preferences for version 3.0500012, we are 3.0300009 at misc/admin/koha-preferences line 255
+  $ misc/admin/koha-preferences load # Can also work from STDIN
+  XISBN: false
+  viewMARC: y
+  [ Control-D ]
+  Setting viewMARC to 1
+  Setting XISBN to 0
+
+=cut
index 5e3010e..b4be670 100755 (executable)
@@ -75,7 +75,7 @@ sub process_batch {
 
     print "... importing MARC records -- please wait\n";
     my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) = 
-        BatchCommitBibRecords($import_batch_id, 100, \&print_progress_and_commit);
+        BatchCommitBibRecords($import_batch_id, '', 100, \&print_progress_and_commit);
     print "... finished importing MARC records\n";
 
     print <<_SUMMARY_;
index 630b159..7c655c9 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 use strict;
 #use warnings; FIXME - Bug 2505
+use Carp;
 BEGIN {
     # find Koha's Perl modules
     # test carefully before changing this
@@ -201,12 +202,12 @@ foreach my $num (@getnofifys) {
                                                                'content-type' => 'text/html; charset="utf-8"',
                                        );
                                # if we don't have any content for the mail, we don't launch mail, but notify it in a file
-                                       if ($mailtext ne 'nonotifys') {
-                                       sendmail(%mail);
-                                       }
-                                       else {
-                                       print OUT $email ;
-                                       }
+                if ($mailtext ne 'nonotifys') {
+                    sendmail(%mail) or carp $Mail::Sendmail::error;
+                }
+                else {
+                    print OUT $email ;
+                }
                                        
 # now deal with the debarred mode
 #              if ($debarred eq 1) {
index 671368e..ba7cba8 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2008 Liblime
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
diff --git a/misc/cronjobs/purge_suggestions.pl b/misc/cronjobs/purge_suggestions.pl
new file mode 100755 (executable)
index 0000000..d38a7bf
--- /dev/null
@@ -0,0 +1,60 @@
+#!/usr/bin/perl -w
+
+# Copyright 2010 Biblibre SARL
+#
+# 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.
+
+use strict;
+use warnings;
+use utf8;
+
+BEGIN {
+
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { require "$FindBin::Bin/../kohalib.pl" };
+}
+
+use Getopt::Long;
+use Pod::Usage;
+use C4::Suggestions;
+
+my ($help, $days);
+
+GetOptions(
+    'help|?'         => \$help,
+    'days=s'         => \$days,
+);
+
+if($help or not $days){
+    print <<EOF
+    This script delete olds suggestions
+    Parameters :
+    -help|? This message
+    -days TTT to define the age of suggestions to delete
+
+     example :
+     export PERL5LIB=/path/to/koha;export KOHA_CONF=/etc/koha/koha-conf.xml;./purge_suggestions.pl -days 30
+EOF
+;
+    exit;
+}
+
+if($days){
+    DelSuggestionsOlderThan($days);
+}
+
index 3187e92..d4f5567 100755 (executable)
@@ -28,6 +28,7 @@ use Pod::Usage;
 use Mail::Sendmail;
 use Text::CSV_XS;
 use CGI;
+use Carp;
 
 use vars qw($VERSION);
 
@@ -159,7 +160,7 @@ unless (scalar(@ARGV)) {
 foreach my $report (@ARGV) {
     my ($sql, $type) = get_saved_report($report);
     unless ($sql) {
-        warn "ERROR: No saved report $report found";
+        carp "ERROR: No saved report $report found";
         next;
     }
     $verbose and print "SQL: $sql\n\n";
@@ -188,7 +189,7 @@ foreach my $report (@ARGV) {
             Subject => $subject,
             Message => $message 
         );
-        sendmail(%mail) or warn "mail not sent";
+        sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error;
     } else {
         print $message;
     }
index f4dda39..6415eb6 100755 (executable)
@@ -40,13 +40,13 @@ BEGIN {
 use C4::Context;
 use C4::Search;
 use C4::Circulation;
-use C4::Circulation::Fines;
 use C4::Members;
 use C4::Dates qw/format_date/;
 use HTML::Template::Pro;
 use Mail::Sendmail;
 use Mail::RFC822::Address;
 use C4::SMS;
+use Carp;
 use utf8;
 my ($res,$ua);##variables for SMS
 
@@ -312,8 +312,7 @@ sub sendEmail {
 
                 
        if (not(sendmail %mail)) {       
-warn  $Mail::Sendmail::error;
-               warn "sendEmail to $to failed.";
+carp  "sendEmail to $to failed: " . $Mail::Sendmail::error;
                return 0;       
        }
        
diff --git a/misc/maintenance/borrowers-force-messaging-defaults b/misc/maintenance/borrowers-force-messaging-defaults
new file mode 100755 (executable)
index 0000000..ff35e08
--- /dev/null
@@ -0,0 +1,121 @@
+#!/usr/bin/perl
+#
+# Copyright (C) 2011 Tamil s.a.r.l.
+#
+# 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.
+
+use strict;
+use warnings;
+BEGIN {
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { require "$FindBin::Bin/../kohalib.pl" };
+}
+
+use C4::Context;
+use C4::Members::Messaging;
+use Getopt::Long;
+use Pod::Usage;
+
+
+sub usage {
+    pod2usage( -verbose => 2 );
+    exit;
+}
+
+
+sub force_borrower_messaging_defaults {
+    my ($doit, $truncate, $since) = @_;
+
+    $since = '0000-00-00' if (!$since);
+    print $since;
+
+    my $dbh = C4::Context->dbh;
+    $dbh->{AutoCommit} = 0;
+
+    if ( $doit && $truncate ) {
+        my $sth = $dbh->prepare("TRUNCATE borrower_message_preferences");
+        $sth->execute();
+    }
+
+    my $sth = $dbh->prepare("SELECT borrowernumber, categorycode FROM borrowers WHERE dateenrolled >= ?");
+    $sth->execute($since);
+    while ( my ($borrowernumber, $categorycode) = $sth->fetchrow ) {
+        print "$borrowernumber: $categorycode\n";
+        next unless $doit;
+        C4::Members::Messaging::SetMessagingPreferencesFromDefaults( {
+            borrowernumber => $borrowernumber,
+            categorycode   => $categorycode,
+        } );
+    }
+    $dbh->commit();
+}
+
+
+my ($doit, $truncate, $since, $help);
+my $result = GetOptions(
+    'doit'     => \$doit,
+    'truncate' => \$truncate,
+    'since:s'  => \$since,
+    'help|h'   => \$help,
+);
+
+usage() if $help;
+
+force_borrower_messaging_defaults( $doit, $truncate, $since );
+
+=head1 NAME
+
+force-borrower-messaging-defaults
+
+=head1 SYNOPSIS
+
+  force-borrower-messaging-defaults 
+  force-borrower-messaging-defaults --help
+  force-borrower-messaging-defaults --doit
+  force-borrower-messaging-defaults --doit --truncate
+
+=head1 DESCRIPTION
+
+If the EnhancedMessagingPreferences syspref is enabled after borrowers have
+been created in the DB, those borrowers won't have messaging transport
+preferences default values as defined for their borrower category. So you would
+have to modify each borrower one by one if you would like to send them 'Hold
+Filled' notice for example.
+
+This script create transport preferences for all existing borrowers and set
+them to default values defined for the category they belong to.
+
+=over 8
+
+=item B<--help>
+
+Prints this help
+
+=item B<--doit>
+
+Process actually the borrowers.
+
+=item B<--truncate>
+
+Truncate all borrowers transport preferences before (re-)creating them. It
+affects borrower_message_preferences table.
+
+=back
+
+=cut
+
index bd11494..682c280 100755 (executable)
@@ -37,7 +37,7 @@ my $verbose_logging;
 my $zebraidx_log_opt = " -v none,fatal,warn ";
 my $result = GetOptions(
     'd:s'           => \$directory,
-    'reset'         => \$reset,
+    'r|reset'       => \$reset,
     's'             => \$skip_export,
     'k'             => \$keep_export,
     'nosanitize'    => \$nosanitize,
index 5f0d9ff..b22ae24 100755 (executable)
@@ -43,13 +43,13 @@ my $FILE_VERSION = '1.0';
 
 our $query = CGI->new;
 
-my ($template, $loggedinuser, $cookie)
-  = get_template_and_user( { template_name => "offline_circ/process_koc.tmpl",
-                               query => $query,
-                               type => "intranet",
-                               authnotrequired => 0,
-                                flagsrequired   => { circulate => "circulate_remaining_permissions" },
-                               });
+my ($template, $loggedinuser, $cookie) = get_template_and_user({
+    template_name => "offline_circ/process_koc.tmpl",
+    query => $query,
+    type => "intranet",
+    authnotrequired => 0,
+     flagsrequired   => { circulate => "circulate_remaining_permissions" },
+});
 
 
 my $fileID=$query->param('uploadedfileid');
@@ -71,8 +71,8 @@ if ($completedJobID) {
     my $uploaded_file = C4::UploadedFile->fetch($sessionID, $fileID);
     my $fh = $uploaded_file->fh();
     my @input_lines = <$fh>;
-  
-    my $filename = $uploaded_file->name(); 
+
+    my $filename = $uploaded_file->name();
     my $job = undef;
 
     if ($runinbackground) {
@@ -110,25 +110,24 @@ if ($completedJobID) {
         # if we get here, we're a child that has detached
         # itself from Apache
 
-    }     
+    }
 
     my $header_line = shift @input_lines;
     my $file_info   = parse_header_line($header_line);
     if ($file_info->{'Version'} ne $FILE_VERSION) {
-      push( @output, { message => 1,
-      ERROR_file_version => 1,
-      upload_version => $file_info->{'Version'},
-      current_version => $FILE_VERSION
-      } );
+        push @output, {
+            message => 1,
+            ERROR_file_version => 1,
+            upload_version => $file_info->{'Version'},
+            current_version => $FILE_VERSION
+        };
     }
-    
-    
+
     my $i = 0;
     foreach  my $line (@input_lines)  {
-    
         $i++;
         my $command_line = parse_command_line($line);
-        
+
         # map command names in the file to subroutine names
         my %dispatch_table = (
             issue     => \&kocIssueItem,
@@ -193,7 +192,7 @@ sub parse_command_line {
     my $command_line = shift;
     chomp($command_line);
     $command_line =~ s/\r//g;
-    
+
     my ( $timestamp, $command, @args ) = split( /\t/, $command_line );
     my ( $date,      $time,    $id )   = split( /\s/, $timestamp );
 
@@ -239,134 +238,130 @@ sub arguments_for_command {
 }
 
 sub kocIssueItem {
-  my $circ = shift;
-
-  $circ->{ 'barcode' } = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
-  my $branchcode = C4::Context->userenv->{branch};
-  my $borrower = GetMember( 'cardnumber'=>$circ->{ 'cardnumber' } );
-  my $item = GetBiblioFromItemNumber( undef, $circ->{ 'barcode' } );
-  my $issue = GetItemIssue( $item->{'itemnumber'} );
-
-  my $issuingrule = GetIssuingRule( $borrower->{ 'categorycode' }, $item->{ 'itemtype' }, $branchcode );
-  my $issuelength = $issuingrule->{ 'issuelength' };
-  my ( $year, $month, $day ) = split( /-/, $circ->{'date'} );
-  ( $year, $month, $day ) = Add_Delta_Days( $year, $month, $day, $issuelength );
-  my $date_due = sprintf("%04d-%02d-%02d", $year, $month, $day);
-
-  if ( $issue->{ 'date_due' } ) { ## Item is currently checked out to another person.
-#warn "Item Currently Issued.";
-    my $issue = GetOpenIssue( $item->{'itemnumber'} );
-    
-    if ( $issue->{'borrowernumber'} eq $borrower->{'borrowernumber'} ) { ## Issued to this person already, renew it.
-#warn "Item issued to this member already, renewing.";
-    
-    my $date_due_object = C4::Dates->new($date_due ,'iso');
-    C4::Circulation::AddRenewal(
-        $issue->{'borrowernumber'},    # borrowernumber
-        $item->{'itemnumber'},         # itemnumber
-        undef,                         # branch
-        $date_due_object,              # datedue
-        $circ->{'date'},               # issuedate
-    ) unless ($DEBUG);
-
-      push( @output, { renew => 1,
-    title => $item->{ 'title' },
-    biblionumber => $item->{'biblionumber'},
-    barcode => $item->{ 'barcode' },
-    firstname => $borrower->{ 'firstname' },
-    surname => $borrower->{ 'surname' },
-    borrowernumber => $borrower->{'borrowernumber'},
-    cardnumber => $borrower->{'cardnumber'},
-    datetime => $circ->{ 'datetime' }
-    } );
+    my $circ = shift;
+
+    $circ->{ 'barcode' } = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
+    my $branchcode = C4::Context->userenv->{branch};
+    my $borrower = GetMember( 'cardnumber'=>$circ->{ 'cardnumber' } );
+    my $item = GetBiblioFromItemNumber( undef, $circ->{ 'barcode' } );
+    my $issue = GetItemIssue( $item->{'itemnumber'} );
+
+    if ( $issue->{ 'date_due' } ) { ## Item is currently checked out to another person.
+        #warn "Item Currently Issued.";
+        my $issue = GetOpenIssue( $item->{'itemnumber'} );
+
+        if ( $issue->{'borrowernumber'} eq $borrower->{'borrowernumber'} ) { ## Issued to this person already, renew it.
+            #warn "Item issued to this member already, renewing.";
+
+            C4::Circulation::AddRenewal(
+                $issue->{'borrowernumber'},    # borrowernumber
+                $item->{'itemnumber'},         # itemnumber
+                undef,                         # branch
+                undef,                         # datedue - let AddRenewal calculate it automatically
+                $circ->{'date'},               # issuedate
+            ) unless ($DEBUG);
+
+            push @output, {
+                renew => 1,
+                title => $item->{ 'title' },
+                biblionumber => $item->{'biblionumber'},
+                barcode => $item->{ 'barcode' },
+                firstname => $borrower->{ 'firstname' },
+                surname => $borrower->{ 'surname' },
+                borrowernumber => $borrower->{'borrowernumber'},
+                cardnumber => $borrower->{'cardnumber'},
+                datetime => $circ->{ 'datetime' }
+            };
 
-    } else {
-#warn "Item issued to a different member.";
-#warn "Date of previous issue: $issue->{'issuedate'}";
-#warn "Date of this issue: $circ->{'date'}";
-      my ( $i_y, $i_m, $i_d ) = split( /-/, $issue->{'issuedate'} );
-      my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} );
-      
-      if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue.
-        my $date_due_object = C4::Dates->new($date_due ,'iso');
-        C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due_object ) unless ( DEBUG );
-        push( @output, { issue => 1,
-    title => $item->{ 'title' },
-    biblionumber => $item->{'biblionumber'},
-    barcode => $item->{ 'barcode' },
-    firstname => $borrower->{ 'firstname' },
-    surname => $borrower->{ 'surname' },
-    borrowernumber => $borrower->{'borrowernumber'},
-    cardnumber => $borrower->{'cardnumber'},
-    datetime => $circ->{ 'datetime' }
-    } );
-
-      } else { ## Current issue is *newer* than this issue, write a 'returned' issue, as the item is most likely in the hands of someone else now.
-#warn "Current issue to another member is newer. Doing nothing";
-        ## This situation should only happen of the Offline Circ data is *really* old.
-        ## FIXME: write line to old_issues and statistics
-      }
-    
+        } else {
+            #warn "Item issued to a different member.";
+            #warn "Date of previous issue: $issue->{'issuedate'}";
+            #warn "Date of this issue: $circ->{'date'}";
+            my ( $i_y, $i_m, $i_d ) = split( /-/, $issue->{'issuedate'} );
+            my ( $c_y, $c_m, $c_d ) = split( /-/, $circ->{'date'} );
+
+            if ( Date_to_Days( $i_y, $i_m, $i_d ) < Date_to_Days( $c_y, $c_m, $c_d ) ) { ## Current issue to a different persion is older than this issue, return and issue.
+                C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless ( DEBUG );
+                push @output, {
+                    issue => 1,
+                    title => $item->{ 'title' },
+                    biblionumber => $item->{'biblionumber'},
+                    barcode => $item->{ 'barcode' },
+                    firstname => $borrower->{ 'firstname' },
+                    surname => $borrower->{ 'surname' },
+                    borrowernumber => $borrower->{'borrowernumber'},
+                    cardnumber => $borrower->{'cardnumber'},
+                    datetime => $circ->{ 'datetime' }
+                };
+
+            } else { ## Current issue is *newer* than this issue, write a 'returned' issue, as the item is most likely in the hands of someone else now.
+                #warn "Current issue to another member is newer. Doing nothing";
+                ## This situation should only happen of the Offline Circ data is *really* old.
+                ## FIXME: write line to old_issues and statistics
+            }
+        }
+    } else { ## Item is not checked out to anyone at the moment, go ahead and issue it
+        C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, undef, undef, $circ->{'date'} ) unless ( DEBUG );
+        push @output, {
+            issue => 1,
+            title => $item->{ 'title' },
+            biblionumber => $item->{'biblionumber'},
+            barcode => $item->{ 'barcode' },
+            firstname => $borrower->{ 'firstname' },
+            surname => $borrower->{ 'surname' },
+            borrowernumber => $borrower->{'borrowernumber'},
+            cardnumber => $borrower->{'cardnumber'},
+            datetime =>$circ->{ 'datetime' }
+        };
     }
-  } else { ## Item is not checked out to anyone at the moment, go ahead and issue it
-      my $date_due_object = C4::Dates->new($date_due ,'iso');
-      C4::Circulation::AddIssue( $borrower, $circ->{'barcode'}, $date_due_object ) unless ( DEBUG );
-    push( @output, { issue => 1,
-    title => $item->{ 'title' },
-    biblionumber => $item->{'biblionumber'},
-    barcode => $item->{ 'barcode' },
-    firstname => $borrower->{ 'firstname' },
-    surname => $borrower->{ 'surname' },
-    borrowernumber => $borrower->{'borrowernumber'},
-    cardnumber => $borrower->{'cardnumber'},
-    datetime =>$circ->{ 'datetime' }
-    } );
-        }  
 }
 
 sub kocReturnItem {
-  my ( $circ ) = @_;
-  $circ->{'barcode'} = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
-  my $item = GetBiblioFromItemNumber( undef, $circ->{ 'barcode' } );
-  #warn( Data::Dumper->Dump( [ $circ, $item ], [ qw( circ item ) ] ) );
-  my $borrowernumber = _get_borrowernumber_from_barcode( $circ->{'barcode'} );
-  if ( $borrowernumber ) {
-  my $borrower = GetMember( 'borrowernumber' =>$borrowernumber );
-    C4::Circulation::MarkIssueReturned( $borrowernumber,
-                                      $item->{'itemnumber'},
-                                      undef,
-                                      $circ->{'date'} );
-  
-  push( @output, { return => 1,
-    title => $item->{ 'title' },
-    biblionumber => $item->{'biblionumber'},
-    barcode => $item->{ 'barcode' },
-    borrowernumber => $borrower->{'borrowernumber'},
-    firstname => $borrower->{'firstname'},
-    surname => $borrower->{'surname'},
-    cardnumber => $borrower->{'cardnumber'},
-    datetime => $circ->{ 'datetime' }
-    } ); 
-  } else {
-    push( @output, { ERROR_no_borrower_from_item => 1,
-    badbarcode => $circ->{'barcode'}
-    } );
-  
-  }
+    my ( $circ ) = @_;
+    $circ->{'barcode'} = barcodedecode($circ->{'barcode'}) if( $circ->{'barcode'} && C4::Context->preference('itemBarcodeInputFilter'));
+    my $item = GetBiblioFromItemNumber( undef, $circ->{ 'barcode' } );
+    #warn( Data::Dumper->Dump( [ $circ, $item ], [ qw( circ item ) ] ) );
+    my $borrowernumber = _get_borrowernumber_from_barcode( $circ->{'barcode'} );
+    if ( $borrowernumber ) {
+        my $borrower = GetMember( 'borrowernumber' =>$borrowernumber );
+        C4::Circulation::MarkIssueReturned(
+            $borrowernumber,
+            $item->{'itemnumber'},
+            undef,
+            $circ->{'date'}
+        );
 
+        push @output, {
+            return => 1,
+            title => $item->{ 'title' },
+            biblionumber => $item->{'biblionumber'},
+            barcode => $item->{ 'barcode' },
+            borrowernumber => $borrower->{'borrowernumber'},
+            firstname => $borrower->{'firstname'},
+            surname => $borrower->{'surname'},
+            cardnumber => $borrower->{'cardnumber'},
+            datetime => $circ->{ 'datetime' }
+        };
+    } else {
+        push @output, {
+            ERROR_no_borrower_from_item => 1,
+            badbarcode => $circ->{'barcode'}
+        };
+    }
 }
 
 sub kocMakePayment {
-  my ( $circ ) = @_;
-  my $borrower = GetMember( 'cardnumber'=>$circ->{ 'cardnumber' } );
-  recordpayment( $borrower->{'borrowernumber'}, $circ->{'amount'} );
-  push( @output, { payment => 1,
-    amount => $circ->{'amount'},
-    firstname => $borrower->{'firstname'},
-    surname => $borrower->{'surname'},
-    cardnumber => $circ->{'cardnumber'},
-    borrower => $borrower->{'borrowernumber'}
-    } );
+    my ( $circ ) = @_;
+    my $borrower = GetMember( 'cardnumber'=>$circ->{ 'cardnumber' } );
+    recordpayment( $borrower->{'borrowernumber'}, $circ->{'amount'} );
+    push @output, {
+        payment => 1,
+        amount => $circ->{'amount'},
+        firstname => $borrower->{'firstname'},
+        surname => $borrower->{'surname'},
+        cardnumber => $circ->{'cardnumber'},
+        borrower => $borrower->{'borrowernumber'}
+    };
 }
 
 =head2 _get_borrowernumber_from_barcode
@@ -384,9 +379,8 @@ sub _get_borrowernumber_from_barcode {
 
     my $item = GetBiblioFromItemNumber( undef, $barcode );
     return unless $item->{'itemnumber'};
-    
+
     my $issue = C4::Circulation::GetItemIssue( $item->{'itemnumber'} );
     return unless $issue->{'borrowernumber'};
     return $issue->{'borrowernumber'};
-    
 }
index e022497..b50947d 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -97,8 +98,8 @@ $template->param(
 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
 my $dbh = C4::Context->dbh;
 my $dat                 = TransformMarcToKoha( $dbh, $record );
-my @subscriptions       =
-  GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
+my @subscriptions       = GetSubscriptions( undef, undef, $biblionumber );
+
 my @subs;
 foreach my $subscription (@subscriptions) {
     my %cell;
index fd909f5..a5c9789 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index 7e06310..066a821 100755 (executable)
@@ -120,6 +120,9 @@ my @fields    = $record->fields();
 foreach my $field (@fields) {
     my @subfields_data;
 
+    # skip UNIMARC fields <200, they are useless for a patron
+    next if C4::Context->preference('MarcFlavour') eq 'UNIMARC' && $field->tag() <200;
+
     # if tag <10, there's no subfield, use the "@" trick
     if ( $field->tag() < 10 ) {
         next if ( $tagslib->{ $field->tag() }->{'@'}->{hidden} );
@@ -137,6 +140,8 @@ foreach my $field (@fields) {
         for my $i ( 0 .. $#subf ) {
             $subf[$i][0] = "@" unless $subf[$i][0];
             next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} );
+            # skip useless subfields (for patrons)
+            next if $subf[$i][0] =~ /7|8|9/;
             my %subfield_data;
             $subfield_data{marc_lib} =
               $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
index 0685e13..1015e54 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -101,7 +102,7 @@ my $collections =  GetKohaAuthorisedValues('items.ccode',$dat->{'frameworkcode'}
 
 #coping with subscriptions
 my $subscriptionsnumber = CountSubscriptionFromBiblionumber($biblionumber);
-my @subscriptions       = GetSubscriptions( $dat->{title}, $dat->{issn}, $biblionumber );
+my @subscriptions       = GetSubscriptions( undef, undef, $biblionumber );
 
 my @subs;
 $dat->{'serial'}=1 if $subscriptionsnumber;
@@ -198,6 +199,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);
index f4181d6..d50480a 100755 (executable)
@@ -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'};
         }
 
index 0f52650..d22049f 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # Copyright 2008 Garry Collum and the Koha Koha Development team
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
@@ -139,10 +140,9 @@ if (C4::Context->preference('TagsEnabled')) {
 #}
 
 # load the branches
-my $mybranch = ( C4::Context->preference('SearchMyLibraryFirst') && C4::Context->userenv && C4::Context->userenv->{branch} ) ? C4::Context->userenv->{branch} : '';
+
 my $branches = GetBranches();   # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established
 $template->param(
-    branchloop       => GetBranchesLoop($mybranch, 0),
     searchdomainloop => GetBranchCategories(undef,'searchdomain'),
 );
 
@@ -628,6 +628,7 @@ $template->param(
             total => $total,
             opacfacets => 1,
             facets_loop => $facets,
+           displayFacetCount=> C4::Context->preference('displayFacetCount')||0,
             scan => $scan,
             search_error => $error,
 );
index 6213965..0042c42 100755 (executable)
@@ -20,6 +20,7 @@ use warnings;
 
 use CGI;
 use Encode qw(encode);
+use Carp;
 
 use Mail::Sendmail;
 use MIME::QuotedPrint;
@@ -170,7 +171,7 @@ END_OF_BODY
     }
     else {
         # do something if it doesnt work....
-        warn "Error sending mail: $Mail::Sendmail::error \n";
+        carp "Error sending mail: $Mail::Sendmail::error \n";
         $template->param( error => 1 );
     }
     $template->param( email_add => $email_add );
index b535616..6a376c4 100755 (executable)
@@ -22,6 +22,7 @@ use warnings;
 
 use CGI;
 use Encode qw(encode);
+use Carp;
 
 use Mail::Sendmail;
 use MIME::QuotedPrint;
@@ -162,7 +163,7 @@ END_OF_BODY
     }
     else {
         # do something if it doesnt work....
-        warn "Error sending mail: $Mail::Sendmail::error \n";
+        carp "Error sending mail: $Mail::Sendmail::error \n";
         $template->param( error => 1 );
     }
 
index 2f0dc36..15eebf9 100755 (executable)
@@ -20,6 +20,7 @@ use warnings;
 
 use CGI;
 use C4::Auth;    # get_template_and_user
+use C4::Members;
 use C4::Branch;
 use C4::Koha;
 use C4::Output;
@@ -77,7 +78,7 @@ if ( $op eq "add_confirm" ) {
        }
        else {
                $$suggestion{'suggesteddate'}=C4::Dates->today;
-               $$suggestion{'branchcode'}=C4::Context->userenv->{"branch"};
+               $$suggestion{'branchcode'}= $input->param('branch') || C4::Context->userenv->{"branch"};
                &NewSuggestion($suggestion);
                # empty fields, to avoid filter in "SearchSuggestion"
                $$suggestion{$_}='' foreach qw<title author publishercode copyrightdate place collectiontitle isbn STATUS>;
@@ -122,6 +123,18 @@ foreach my $suggestion(@$suggestions_loop) {
 
 my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG");
 
+# Is the person allowed to choose their branch
+if ( C4::Context->preference("AllowPurchaseSuggestionBranchChoice") ) {
+    my ( $borr ) = GetMemberDetails( $borrowernumber );
+
+# pass the pickup branch along....
+    my $branch = $input->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ;
+
+# make branch selection options...
+    my $CGIbranchloop = GetBranchesLoop($branch);
+    $template->param( branch_loop => $CGIbranchloop );
+}
+
 $template->param(
        %$suggestion,
        itemtypeloop=> $supportlist,
index b98ce40..b5ce340 100755 (executable)
@@ -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);
 
index 634b77a..6549e2a 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
 # This file is part of Koha.
+# parts copyright 2010 BibLibre
 #
 # 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
index 2e93eef..95fc287 100755 (executable)
@@ -151,7 +151,8 @@ output_html_with_http_headers $input, $cookie, $template->output;
 
 
 sub calculate {
-    my ($line, $column, $filters) = @_;
+    my ($limit, $column, $filters) = @_;
+
     my @loopcol;
     my @loopline;
     my @looprow;
@@ -209,11 +210,6 @@ sub calculate {
                } elsif ($column =~ /sort2/   ) {
                        # $colfilter[0] = @$filters[11];
                }
-        # $colfilter[0] = @$filters[7] if ($column =~ /timestamp/ ) ; FIXME This can't be right.
-        # $colfilter[0] = @$filters[8] if ($column =~ /timestamp/ ) ; FIXME 
-        # $colfilter[0] = @$filters[9] if ($column =~ /timestamp/ ) ; FIXME Only this line would have effect.
-
-    #warn "filtre col ".$colfilter[0]." ".$colfilter[1];
                                                 
     # loop cols.
         if ($column eq "Day") {
@@ -281,15 +277,6 @@ sub calculate {
         $columns{''} = 1;
     }
 
-    #Initialization of cell values.....
-    my @table;
-    for (my $i=1;$i<=$line;$i++) {
-        foreach (keys %columns) {
-#                      warn " init table : $row->{rowtitle} / $_ ";
-            $table[$i]->{ $_ || "total" }->{'name'}=0;
-        }
-    }
-
     my $strcalc ;
 
 # Processing average loanperiods
@@ -302,17 +289,13 @@ sub calculate {
                   WHERE old_issues.borrowernumber IS NOT NULL
                   ";
        my @filterterms = (
-               'old_issues.timestamp  >',
-               'old_issues.timestamp  <',
+               'old_issues.issuedate >',
+               'old_issues.issuedate <',
                'old_issues.returndate >',
                'old_issues.returndate <',
                'old_issues.branchcode  like',
                'biblioitems.itemtype   like',
                'borrowers.categorycode like',
-               'dayname(old_issues.timestamp) like',
-               'monthname(old_issues.timestamp) like',
-               'monthname(old_issues.timestamp) like',
-               'year(old_issues.timestamp) like',
        );
     foreach ((@$filters)[0..9]) {
                my $term = shift @filterterms;  # go through both arrays in step
@@ -320,16 +303,11 @@ sub calculate {
                s/\*/%/g;
                $strcalc .= " AND $term '$_' ";
        }
-    
     $strcalc .= " GROUP BY borrowers.borrowernumber";
     $strcalc .= ", $colfield" if ($column);
     $strcalc .= " ORDER BY RANK DESC";
     $strcalc .= ",$colfield " if ($colfield);
-#      my $max;
-#      if (@loopcol) {
-#              $max = $line*@loopcol;
-#      } else { $max=$line;}
-#      $strcalc .= " LIMIT 0,$max";
+    $strcalc .= " LIMIT $limit" if ($limit);
 
     $debug and print DEBUG "(old_issues) SQL : $strcalc\n";
     my $dbcalc = $dbh->prepare($strcalc);
@@ -414,7 +392,6 @@ sub calculate {
        # the foot (totals by borrower type)
     $globalline{loopfooter} = [];
     $globalline{total}= $grantotal;            # FIXME: useless
-    $globalline{line} = $line;
     $globalline{column} = $column;
     return [\%globalline];     # reference to a 1 element array: that element is a hashref
 }
index 0502dc6..0a135e1 100755 (executable)
@@ -181,7 +181,7 @@ sub calculate {
         $colorder .= $column;
         
         my $strsth2;
-        $strsth2 .= "select distinctrow $colfield FROM borrowers LEFT JOIN `old_issues` USING(borrowernumber)";
+        $strsth2 .= "select distinct $colfield FROM borrowers WHERE 1";
         if ($colfilter[0]) {
             $colfilter[0] =~ s/\*/%/g;
             $strsth2 .= " and $column LIKE '$colfilter[0]' " ;
@@ -229,10 +229,18 @@ sub calculate {
     $strcalc .= "WHERE 1 ";
     @$filters[0]=~ s/\*/%/g if (@$filters[0]);
     $strcalc .= " AND borrowers.categorycode like '" . @$filters[0] ."'" if ( @$filters[0] );
-    my $strqueryfilter = "SELECT DISTINCT borrowernumber FROM old_issues WHERE borrowernumber IS NOT NULL ";
-    if (@$filters[1]){
-        my $strqueryfilter .= "AND old_issues.timestamp> @$filters[1] ";
+
+    my $strqueryfilter = "SELECT DISTINCT borrowernumber FROM  ";
+    $strqueryfilter .= "(SELECT borrowernumber from old_issues WHERE borrowernumber IS NOT NULL ";
+    if ($filters->[1]){
+        $strqueryfilter .= "AND old_issues.timestamp> '$filters->[1]' ";
+    }
+    $strqueryfilter .= "UNION SELECT borrowernumber FROM issues WHERE 1 ";
+    if ($filters->[1]){
+        $strqueryfilter .= "AND issues.timestamp> '$filters->[1]' ";
     }
+    $strqueryfilter .= ") active_borrowers";
+
     $strcalc .= " AND borrowers.borrowernumber not in ($strqueryfilter)";
     $strcalc .= " group by borrowers.borrowernumber";
     $strcalc .= ", $colfield" if ($column);
diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl
new file mode 100755 (executable)
index 0000000..4254d5a
--- /dev/null
@@ -0,0 +1,382 @@
+#!/usr/bin/perl
+
+# 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.
+
+
+use strict;
+
+use CGI;
+
+use C4::Auth;
+use C4::Debug;
+use C4::Context;
+use C4::Branch; # GetBranches
+use C4::Koha;
+use C4::Output;
+use C4::Reports;
+use C4::Members;
+use C4::Dates qw/format_date format_date_in_iso/;
+use C4::Category;
+use List::MoreUtils qw/any/;
+use YAML;
+
+=head1 NAME
+
+plugin that shows circulation stats
+
+=head1 DESCRIPTION
+
+=over 2
+
+=cut
+
+# my $debug = 1;       # override for now.
+my $input = new CGI;
+my $fullreportname = "reports/reserves_stats.tmpl";
+my $do_it    = $input->param('do_it');
+my $line     = $input->param("Line");
+my $column   = $input->param("Column");
+my $podsp    = $input->param("DisplayBy");
+my $type     = $input->param("PeriodTypeSel");
+my $daysel   = $input->param("PeriodDaySel");
+my $monthsel = $input->param("PeriodMonthSel");
+my $calc     = $input->param("Cellvalue");
+my $output   = $input->param("output");
+my $basename = $input->param("basename");
+my $mime     = $input->param("MIME");
+my $hash_params = $input->Vars;
+my $filter_hashref;
+foreach my $filter (grep {$_ =~/^filter/} keys %$hash_params){
+       my $filterstring=$filter;
+       $filterstring=~s/^filter_//g;
+       $$filter_hashref{$filterstring}=$$hash_params{$filter} if (defined $$hash_params{$filter} && $$hash_params{$filter} ne "");
+}
+my ($template, $borrowernumber, $cookie) = get_template_and_user({
+       template_name => $fullreportname,
+       query => $input,
+       type => "intranet",
+       authnotrequired => 0,
+       flagsrequired => {reports => '*'},
+       debug => 0,
+});
+our $sep     = $input->param("sep");
+$sep = "\t" if ($sep eq 'tabulation');
+$template->param(do_it => $do_it,
+       DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+);
+
+my $itemtypes = GetItemTypes();
+my $categoryloop = GetBorrowercategoryList;
+
+my $ccodes    = GetKohaAuthorisedValues("items.ccode");
+my $locations = GetKohaAuthorisedValues("items.location");
+my $authvalue = GetKohaAuthorisedValues("items.authvalue");
+
+my $Bsort1 = GetAuthorisedValues("Bsort1");
+my $Bsort2 = GetAuthorisedValues("Bsort2");
+my ($hassort1,$hassort2);
+$hassort1=1 if $Bsort1;
+$hassort2=1 if $Bsort2;
+
+
+if ($do_it) {
+# Displaying results
+       my $results = calculate($line, $column,  $calc, $filter_hashref);
+       if ($output eq "screen"){
+# Printing results to screen
+               $template->param(mainloop => $results);
+               output_html_with_http_headers $input, $cookie, $template->output;
+       } else {
+# Printing to a csv file
+        print $input->header(-type => 'application/vnd.sun.xml.calc',
+                            -encoding    => 'utf-8',
+                            -attachment=>"$basename.csv",
+                            -filename=>"$basename.csv" );
+               my $cols  = @$results[0]->{loopcol};
+               my $lines = @$results[0]->{looprow};
+# header top-right
+               print @$results[0]->{line} ."/". @$results[0]->{column} .$sep;
+# Other header
+               foreach my $col ( @$cols ) {
+                       print $col->{coltitle}.$sep;
+               }
+               print "Total\n";
+# Table
+               foreach my $line ( @$lines ) {
+                       my $x = $line->{loopcell};
+                       print $line->{rowtitle}.$sep;
+                       print map {$_->{value}.$sep} @$x;
+                       print $line->{totalrow}, "\n";
+               }
+# footer
+        print "TOTAL";
+        $cols = @$results[0]->{loopfooter};
+               print map {$sep.$_->{totalcol}} @$cols;
+        print $sep.@$results[0]->{total};
+       }
+       exit(1); # exit either way after $do_it
+}
+
+my $dbh = C4::Context->dbh;
+my @values;
+my %labels;
+my %select;
+
+# create itemtype arrayref for <select>.
+my @itemtypeloop;
+for my $itype ( sort {$itemtypes->{$a}->{description} cmp $itemtypes->{$b}->{description}} keys(%$itemtypes)) {
+       push @itemtypeloop, { code => $itype , description => $itemtypes->{$itype}->{description} } ;
+}
+
+    # location list
+my @locations;
+foreach (sort keys %$locations) {
+       push @locations, { code => $_, description => "$_ - " . $locations->{$_} };
+}
+    
+my @ccodes;
+foreach (sort {$ccodes->{$a} cmp $ccodes->{$b}} keys %$ccodes) {
+       push @ccodes, { code => $_, description => $ccodes->{$_} };
+}
+
+# various
+my @mime = (C4::Context->preference("MIME"));
+
+my $CGIextChoice=CGI::scrolling_list(
+       -name     => 'MIME',
+       -id       => 'MIME',
+       -values   => \@mime,
+       -size     => 1,
+       -multiple => 0 );
+    
+my $CGIsepChoice=GetDelimiterChoices;
+$template->param(
+       categoryloop => $categoryloop,
+       itemtypeloop => \@itemtypeloop,
+          ccodeloop => \@ccodes,
+         branchloop => GetBranchesLoop(C4::Context->userenv->{'branch'}),
+       hassort1=> $hassort1,
+       hassort2=> $hassort2,
+       Bsort1 => $Bsort1,
+       Bsort2 => $Bsort2,
+       CGIextChoice => $CGIextChoice,
+       CGIsepChoice => $CGIsepChoice,
+);
+output_html_with_http_headers $input, $cookie, $template->output;
+
+sub calculate {
+       my ($linefield, $colfield, $process, $filters_hashref) = @_;
+       my @loopfooter;
+       my @loopcol;
+       my @loopline;
+       my @looprow;
+       my %globalline;
+       my $grantotal =0;
+# extract parameters
+       my $dbh = C4::Context->dbh;
+
+# Filters
+# Checking filters
+#
+       my @loopfilter;
+       foreach my $filter (keys %$filters_hashref){
+               $$filters_hashref{$filter} =~s/\*/%/;
+               $$filters_hashref{$filter} = format_date_in_iso($$filters_hashref{$_}) if ($_=~/date/);
+       }
+       #display
+       @loopfilter= map{{ crit=>$_ ,filter=>($_=~/date/?
+                                                                                       format_date($$filters_hashref{$_})
+                                                                                       :$$filters_hashref{$_}
+                                                                                 )
+                                         }
+                                       } sort keys %$filters_hashref;
+
+
+
+
+       my $linesql=changeifreservestatus($linefield);
+       my $colsql=changeifreservestatus($colfield);
+       #Initialization of cell values.....
+
+       # preparing calculation
+    my $strcalc = "(SELECT $linesql line, $colsql col, ";
+        $strcalc .= ($process == 1) ? " COUNT(*)  calculation"                                 :
+                                       ($process == 2) ? "(COUNT(DISTINCT reserves.borrowernumber)) calculation"  :
+                               ($process == 3) ? "(COUNT(DISTINCT reserves.itemnumber)) calculation"      : 
+                               ($process == 4) ? "(COUNT(DISTINCT reserves.biblionumber)) calculation"    : '*';
+       $strcalc .= "
+        FROM reserves
+        LEFT JOIN borrowers USING (borrowernumber)
+       ";
+       $strcalc .= "LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber "
+        if ($linefield =~ /^biblio\./ or $colfield =~ /^biblio\./ or any {$_=~/biblio/}keys %$filters_hashref);
+       $strcalc .= "LEFT JOIN items ON reserves.itemnumber=items.itemnumber "
+        if ($linefield =~ /^items\./ or $colfield =~ /^items\./ or any {$_=~/items/}keys %$filters_hashref);
+        
+       my @sqlparams;
+       my @sqlorparams;
+       my @sqlor;
+       my @sqlwhere;
+       ($debug) and print STDERR Dump($filters_hashref);
+       foreach my $filter (keys %$filters_hashref){
+               my $string;
+               my $stringfield=$filter;
+               $stringfield=~s/\_[a-z_]+$//;
+               warn $stringfield;
+               if ($filter=~/ /){
+                       $string=$stringfield;
+               }
+               elsif ($filter=~/_or/){
+                        push @sqlor, qq{( }.changeifreservestatus($filter)." = ? ) ";
+                        push @sqlorparams, $$filters_hashref{$filter};
+               }
+               elsif ($filter=~/_end$/){
+                       $string = " $stringfield <= ? ";
+               }
+               elsif ($filter=~/_begin$/){
+                       $string = " $stringfield >= ? ";
+               }
+               else {
+                       $string = " $stringfield LIKE ? ";
+               }
+               if ($string){
+                       push @sqlwhere, $string;
+                       push @sqlparams, $$filters_hashref{$filter};
+               }
+       }
+
+       $strcalc .= " WHERE ".join(" AND ",@sqlwhere) if (@sqlwhere);
+       $strcalc .= " AND (".join(" OR ",@sqlor).")" if (@sqlor);
+       $strcalc .= " GROUP BY line, col )";
+       my $strcalc_old=$strcalc;
+       $strcalc_old=~s/reserves/old_reserves/g;
+       $strcalc.=qq{ UNION $strcalc_old ORDER BY line, col};
+       ($debug) and print STDERR $strcalc;
+       my $dbcalc = $dbh->prepare($strcalc);
+       push @loopfilter, {crit=>'SQL =', sql=>1, filter=>$strcalc};
+       @sqlparams=(@sqlparams,@sqlorparams);
+       $dbcalc->execute(@sqlparams,@sqlparams);
+       my ($emptycol,$emptyrow); 
+       my $data = $dbcalc->fetchall_hashref([qw(line col)]);
+       my @loopline;
+       my %cols_hash;
+       foreach my $row (keys %$data){
+               push @loopline, $row;
+               foreach my $col (keys %{$$data{$row}}){
+                       $$data{$row}{totalrow}+=$$data{$row}{$col}{calculation};
+                       $grantotal+=$$data{$row}{$col}{calculation};
+                       $cols_hash{$col}=1 ;
+               }
+       }
+       my $urlbase="do_it=1&amp;".join("&amp;",map{"filter_$_=$$filters_hashref{$_}"} keys %$filters_hashref);
+       foreach my $row (sort @loopline) {
+               my @loopcell;
+               #@loopcol ensures the order for columns is common with column titles
+               # and the number matches the number of columns
+               foreach my $col (sort keys %cols_hash) {
+                       push @loopcell, {value =>( $$data{$row}{$col}{calculation} or ""),
+       #                                               url_complement=>($urlbase=~/&amp;$/?$urlbase."&amp;":$urlbase)."filter_$linefield=$row&amp;filter_$colfield=$col"
+                                                       }
+               }
+               push @looprow, {
+                       'rowtitle_display' => display_value($linefield,$row),
+                       'rowtitle' => $row,
+                       'loopcell' => \@loopcell,
+                       'totalrow' => $$data{$row}{totalrow}
+               };
+       }
+       for my $col ( sort keys %cols_hash ) {
+               my $total = 0;
+               foreach my $row (@loopline) {
+                       $total += $$data{$row}{$col}{calculation};
+                       $debug and warn "value added ".$$data{$row}{$col}{calculation}. "for line ".$row;
+               }
+               push @loopfooter, {'totalcol' => $total};
+               push @loopcol, {'coltitle' => $col,
+                                               coltitle_display=>display_value($colfield,$col)};
+       }
+
+       # the header of the table
+       $globalline{loopfilter}=\@loopfilter;
+       # the core of the table
+       $globalline{looprow} = \@looprow;
+       $globalline{loopcol} = \@loopcol;
+       #       # the foot (totals by borrower type)
+       $globalline{loopfooter} = \@loopfooter;
+       $globalline{total}  = $grantotal;
+       $globalline{line}   = $linefield;
+       $globalline{column} = $colfield;
+       return [(\%globalline)];
+}
+
+sub null_to_zzempty ($) {
+       my $string = shift;
+       defined($string)    or  return 'zzEMPTY';
+       ($string eq "NULL") and return 'zzEMPTY';
+       return $string;         # else return the valid value
+}
+sub display_value{
+       my ($crit,$value)=@_;
+       my $display_value =
+               ($crit =~ /ccode/   ) ? $ccodes->{$value}    :
+               ($crit =~ /location/) ? $locations->{$value} :
+               ($crit =~ /itemtype/) ? $itemtypes->{$value}->{description} :
+               ($crit =~ /branch/) ? GetBranchName($value):
+               ($crit =~ /reservestatus/) ? reservestatushuman($value):
+               $value; # default fallback
+       if ($crit =~ /(sort1|sort2)/) {
+               $display_value=GetAuthorisedValues("B$_",$value);
+       } elsif ($crit =~ /category/) {
+               my $element=any{$value eq $_->{categorycode}} @$categoryloop;
+               $display_value=$$element{description};
+       }
+       return $display_value;
+}
+sub reservestatushuman{
+       my ($val)=@_;
+       my %hashhuman=(
+       1=>"1- placed",
+       2=>"2- processed",
+       3=>"3- pending",
+       4=>"4- satisfied",
+       5=>"5- cancelled",
+       6=>"6- not a status"
+       );
+       $hashhuman{$val};
+}
+sub changeifreservestatus{
+       my ($val)=@_;
+       ($val=~/reservestatus/
+               ?$val=qq{ case 
+                                       when priority>0 then 1 
+                                       when priority=0 then
+                                               (case 
+                                                  when found='f' then 4
+                                                  when found='w' then 
+                                                  (case 
+                                                   when cancellationdate is null then 3
+                                                       else 5
+                                                       end )
+                                                  else 2 
+                                                end )
+                                   else 6 
+                                       end }
+               :$val);
+}
+1;
index ad746c9..f4c7fb4 100755 (executable)
@@ -39,7 +39,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $input,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { circulate => 1 },
+        flagsrequired   => { circulate => 'circulate_remaining_permissions' },
         debug           => 0,
     }
 );
index e671e96..5839cd4 100755 (executable)
@@ -47,7 +47,7 @@ use C4::Output;
 use CGI;
 use C4::Acquisition;
 use C4::Dates qw/format_date/;
-use C4::Bookseller;
+use C4::Bookseller qw( GetBookSeller );
 
 my $query=new CGI;
 my ($template, $loggedinuser, $cookie)
index 735d945..e51148c 100755 (executable)
@@ -24,7 +24,7 @@ use C4::Auth;
 use C4::Serials;
 use C4::Acquisition;
 use C4::Output;
-use C4::Bookseller;
+use C4::Bookseller qw( GetBookSeller );
 use C4::Context;
 use C4::Letters;
 use C4::Branch;    # GetBranches GetBranchesLoop
index 26863f3..5aca561 100755 (executable)
@@ -1,6 +1,8 @@
 #!/usr/bin/perl
 
 # This file is part of Koha.
+# Copyright 2006-2010 BibLibre
+
 #
 # 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
diff --git a/t/00-testcritic.t b/t/00-testcritic.t
new file mode 100755 (executable)
index 0000000..65f2288
--- /dev/null
@@ -0,0 +1,37 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+# This script can be used to run perlcritic on perl files in koha
+# It calls its own custom perlcriticrc
+# The script is purely optional requiring Test::Perl::Critic to be installed 
+# and the environment variable TEST_QA to be set
+# At present only the directories in @dirs will pass the tests in 'Gentle' mode
+
+use File::Spec;
+use Test::More;
+use English qw(-no_match_vars);
+
+my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing circ debian errors
+labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
+serials sms suggestion t tags test tools virtualshelves);
+
+my @dirs = qw( basket circ debian errors offline_circ reserve reviews rotating_collections
+serials sms virtualshelves );
+
+if ( not $ENV{TEST_QA} ) {
+    my $msg = 'Author test. Set $ENV{TEST_QA} to a true value to run';
+    plan( skip_all => $msg );
+}
+
+eval { require Test::Perl::Critic; };
+
+if ( $EVAL_ERROR ) {
+    my $msg = 'Test::Perl::Critic required to criticise code,';
+    plan( skip_all => $msg );
+}
+
+my $rcfile = File::Spec->catfile( 't', 'perlcriticrc' );
+Test::Perl::Critic->import( -profile => $rcfile);
+all_critic_ok(@dirs);
+
index 241f442..1d4f36a 100755 (executable)
@@ -7,7 +7,7 @@ use strict;
 use warnings;
 use Data::Dumper;
 
-use C4::Bookseller;
+use C4::Bookseller qw( GetBookSellerFromId );
 
 use Test::More tests => 37;
 
diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t
new file mode 100644 (file)
index 0000000..016525a
--- /dev/null
@@ -0,0 +1,47 @@
+#!/usr/bin/perl
+#
+# This is to test C4/Koha
+# It requires a working Koha database with the sample data
+
+use strict;
+use warnings;
+use C4::Context;
+
+use Test::More tests => 4;
+
+BEGIN {
+    use_ok('C4::Koha');
+}
+
+my $data = {
+    category            => 'CATEGORY',
+    authorised_value    => 'AUTHORISED_VALUE',
+    lib                 => 'LIB',
+    lib_opac            => 'LIBOPAC',
+    imageurl            => 'IMAGEURL'
+};
+
+my $dbh = C4::Context->dbh;
+
+# Insert an entry into authorised_value table
+my $query = "INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) VALUES (?,?,?,?,?);";
+my $sth = $dbh->prepare($query);
+my $insert_success = $sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
+ok($insert_success, "Insert data in database");
+
+
+# Tests
+SKIP: {
+    skip "INSERT failed", 2 unless $insert_success;
+    
+    is ( GetAuthorisedValueByCode($data->{category}, $data->{authorised_value}), $data->{lib}, "GetAuthorisedValueByCode" );
+    is ( GetKohaImageurlFromAuthorisedValues($data->{category}, $data->{lib}), $data->{imageurl}, "GetKohaImageurlFromAuthorisedValues" );
+}
+
+# Clean up
+if($insert_success){
+    $query = "DELETE FROM authorised_values WHERE category=? AND authorised_value=? AND lib=? AND lib_opac=? AND imageurl=?;";
+    $sth = $dbh->prepare($query);
+    $sth->execute($data->{category}, $data->{authorised_value}, $data->{lib}, $data->{lib_opac}, $data->{imageurl});
+}
+
index 8e26643..e28fbae 100755 (executable)
@@ -39,13 +39,13 @@ is ($changedmember->{firstname}, "Marie", "Member Returned");
 
 $member->{email}="Marie\@email.com";
 ModMember(%$member);
-my $searchemail=Search($member);
-is ($member->{email}, "Marie\@email.com", "Email search works");
+$changedmember=GetMemberDetails("","TESTCARD01");
+is ($changedmember->{email}, "Marie\@email.com", "Email Set works");
 
 $member->{ethnicity}="German";
 ModMember(%$member);
-my $searcheth=Search($member);
-is ($member->{ethnicity}, "German", "Ethnicity Works");
+$changedmember=GetMemberDetails("","TESTCARD01");
+is ($changedmember->{ethnicity}, "German", "Ethnicity Works");
 
 my @searchstring=("Mcknight");
 my ($results) = Search(\@searchstring,undef,undef,undef,["surname"]);
index 323b55a..1282e38 100644 (file)
@@ -10,7 +10,7 @@ plan skip_all => "Test::Class required for performing database tests" if $@;
 
 use C4::Auth;
 use C4::Biblio;
-use C4::Bookseller;
+use C4::Bookseller qw( AddBookseller );
 use C4::Context;
 use C4::Items;
 use C4::Members;
index 94f8115..e03ee1f 100644 (file)
@@ -237,7 +237,7 @@ sub stage_commit_batches : Test( 75 ) {
         }
 
         my ($num_added, $num_updated, $num_items_added, 
-            $num_items_errored, $num_ignored) = BatchCommitBibRecords($batch_id);
+            $num_items_errored, $num_ignored) = BatchCommitBibRecords($batch_id,'');
         cmp_ok($num_added,         "==", $results->{'num_added'},         "$batch_key: added correct number of bibs");
         cmp_ok($num_updated,       "==", $results->{'num_updated'},       "$batch_key: updated correct number of bibs");
         cmp_ok($num_items_added,   "==", $results->{'num_items_added'},   "$batch_key: added correct number of items");
diff --git a/t/perlcriticrc b/t/perlcriticrc
new file mode 100644 (file)
index 0000000..53a34a6
--- /dev/null
@@ -0,0 +1 @@
+exclude = Miscellanea::RequireRcsKeywords
index d953667..ea93519 100755 (executable)
@@ -1,6 +1,7 @@
 #!/usr/bin/perl
 
-# Copyright 2007 Liblime Ltd
+# Copyright 2007 Liblime
+# Parts copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index e7ff78e..61c0965 100755 (executable)
@@ -27,6 +27,7 @@ use MARC::File::USMARC;
 
 # Koha modules used
 use C4::Context;
+use C4::Koha;
 use C4::Auth;
 use C4::Output;
 use C4::Biblio;
@@ -61,6 +62,16 @@ my %cookies = parse CGI::Cookie($cookie);
 my $sessionID = $cookies{'CGISESSID'}->value;
 my $dbh = C4::Context->dbh;
 
+# Frameworks selection loop
+{
+    my $frameworks = getframeworks;
+    my $arrayref = [];
+    while ( my ($key, $value) = each %$frameworks ) {
+        push @$arrayref, { value => $key, label => $value->{frameworktext} };
+    }
+    $template->param( frameworks => $arrayref );
+}
+
 if ($op eq "create_labels") {
        #create a batch of labels, then lose $op & $import_batch_id so we get back to import batch list.
        my $label_batch_id = create_labelbatch_from_importbatch($import_batch_id);
@@ -94,7 +105,8 @@ if ($op eq "") {
     if ($completedJobID) {
         add_saved_job_results_to_template($template, $completedJobID);
     } else {
-        commit_batch($template, $import_batch_id);
+        my $framework = $input->param('framework');
+        commit_batch($template, $import_batch_id, $framework);
     }
     import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
 } elsif ($op eq "revert-batch") {
@@ -222,7 +234,7 @@ sub import_batches_list {
 }
 
 sub commit_batch {
-    my ($template, $import_batch_id) = @_;
+    my ($template, $import_batch_id, $framework) = @_;
 
     my $job = undef;
     $dbh->{AutoCommit} = 0;
@@ -232,7 +244,7 @@ sub commit_batch {
         $callback = progress_callback($job, $dbh);
     }
     my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) = 
-        BatchCommitBibRecords($import_batch_id, 50, $callback);
+        BatchCommitBibRecords($import_batch_id, $framework, 50, $callback);
     $dbh->commit();
 
     my $results = {
index 84c2474..b125187 100755 (executable)
@@ -1,7 +1,6 @@
 #!/usr/bin/perl
 
-
-# Copyright 2000-2002 Katipo Communications
+# Copyright 2010 BibLibre
 #
 # This file is part of Koha.
 #
index cdaa641..d902398 100755 (executable)
@@ -22,6 +22,7 @@ use warnings;
 
 use CGI;
 use Encode qw(encode);
+use Carp;
 
 use Mail::Sendmail;
 use MIME::QuotedPrint;
@@ -157,7 +158,7 @@ END_OF_BODY
     }
     else {
         # do something if it doesnt work....
-        warn "Error sending mail: $Mail::Sendmail::error \n";
+        carp "Error sending mail: $Mail::Sendmail::error \n";
         $template->param( error => 1 );
     }
 
index 9f3841d..0c2e477 100644 (file)
@@ -17,6 +17,7 @@ use File::Temp qw/tempdir/;
 use IPC::Open3;
 use File::Spec;
 use Symbol qw(gensym);
+use utf8;
 
 my $po_dir = tempdir(CLEANUP => 1);
 
@@ -38,6 +39,7 @@ sub test_string_extraction {
     while (<PH>) {
         # ignore some noise on STDERR
         next if /^\.* done\.$/;
+       next if /^\.* terminé\.$/;
         next if /^Warning: Can't determine original templates' charset/;
         next if /^Warning: Charset Out defaulting to/;
         next if /^Removing empty file /;