Merge branch 'bug_7143' into 3.12-master
authorJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 27 Dec 2012 15:12:16 +0000 (10:12 -0500)
committerJared Camins-Esakov <jcamins@cpbibliography.com>
Thu, 27 Dec 2012 15:12:16 +0000 (10:12 -0500)
218 files changed:
C4/Acquisition.pm
C4/Auth.pm
C4/AuthoritiesMarc.pm
C4/Biblio.pm
C4/Bookseller.pm
C4/Branch.pm
C4/Breeding.pm
C4/Budgets.pm
C4/Category.pm
C4/Circulation.pm
C4/Context.pm
C4/HTML5Media.pm [new file with mode: 0644]
C4/ILSDI/Services.pm
C4/Images.pm
C4/Input.pm
C4/Installer/PerlDependencies.pm
C4/Items.pm
C4/Koha.pm
C4/Letters.pm
C4/Log.pm
C4/Members.pm
C4/Members/AttributeTypes.pm
C4/Members/Attributes.pm
C4/Reserves.pm
C4/SIP/ILS/Item.pm
C4/SIP/ILS/Patron.pm
C4/SIP/ILS/Transaction/Checkin.pm
C4/SIP/ILS/Transaction/Checkout.pm
C4/SIP/ILS/Transaction/FeePayment.pm
C4/SIP/ILS/Transaction/Hold.pm
C4/SIP/ILS/Transaction/Renew.pm
C4/SIP/ILS/Transaction/RenewAll.pm
C4/Search.pm
C4/Serials.pm
C4/Tags.pm
C4/VirtualShelves.pm
C4/VirtualShelves/Page.pm
Koha/Borrower/Modifications.pm [new file with mode: 0644]
Makefile.PL
acqui/orderreceive.pl
acqui/parcel.pl
acqui/z3950_search.pl
admin/authorised_values.pl
admin/categorie.pl
admin/patron-attr-types.pl
catalogue/detail.pl
catalogue/detailprint.pl [deleted file]
cataloguing/addbiblio.pl
cataloguing/additem.pl
cataloguing/z3950_search.pl
circ/bookcount.pl
circ/circulation-home.pl
circ/returns.pl
debian/docs/koha-shell.xml [new file with mode: 0644]
debian/koha-common.install
debian/rules
debian/scripts/koha-run-backups
debian/scripts/koha-shell [new file with mode: 0755]
docs/history.txt
etc/zebradb/marc_defs/marc21/authorities/authority-koha-indexdefs.xml
etc/zebradb/marc_defs/marc21/authorities/authority-zebra-indexdefs.xsl
etc/zebradb/marc_defs/marc21/authorities/record.abs
etc/zebradb/marc_defs/unimarc/authorities/record.abs
install_misc/install_koha_on_fresh_debian
installer/data/mysql/de-DE/mandatory/sample_notices.sql
installer/data/mysql/de-DE/optional/auth_val.sql
installer/data/mysql/en/mandatory/sample_notices.sql
installer/data/mysql/en/mandatory/subtag_registry.sql [changed mode: 0644->0755]
installer/data/mysql/en/optional/auth_val.sql
installer/data/mysql/es-ES/mandatory/sample_notices.sql
installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
installer/data/mysql/it-IT/necessari/auth_val.sql
installer/data/mysql/it-IT/necessari/userpermissions.sql
installer/data/mysql/kohastructure.sql
installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql
installer/data/mysql/pl-PL/mandatory/sample_notices.sql
installer/data/mysql/ru-RU/mandatory/sample_notices.sql
installer/data/mysql/sysprefs.sql
installer/data/mysql/uk-UA/mandatory/sample_notices.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/css/addbiblio.css
koha-tmpl/intranet-tmpl/prog/en/css/print.css
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc
koha-tmpl/intranet-tmpl/prog/en/includes/serials-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc
koha-tmpl/intranet-tmpl/prog/en/includes/subtypes_unimarc.inc
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/jquery-ui.css
koha-tmpl/intranet-tmpl/prog/en/lib/jquery/jquery-ui.js
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/neworderempty.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/uncertainprice.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbudgetperiods.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt [deleted file]
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/bookcount.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/didyoumean.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/authorities/authorities.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/branchoverdues.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/pendingreserves.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/returns.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/circ/view_holdsqueue.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/members/members-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/reports/guided_reports.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/holidays.tt
koha-tmpl/intranet-tmpl/prog/en/modules/help/tools/letter.tt
koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/reports/acquisitions_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reports/serials_stats.tt
koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/claims.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serial-issues-full.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-collection.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-edit.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-recieve.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl
koha-tmpl/opac-tmpl/ccsr/en/css/sanop.css [deleted file]
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/css/sanop.css [deleted file]
koha-tmpl/opac-tmpl/prog/en/css/sco.css
koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc
koha-tmpl/opac-tmpl/prog/en/includes/opac-bottom.inc
koha-tmpl/opac-tmpl/prog/en/includes/page-numbers.inc
koha-tmpl/opac-tmpl/prog/en/includes/subtypes_unimarc.inc
koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc
koha-tmpl/opac-tmpl/prog/en/js/script.js
koha-tmpl/opac-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-auth.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-authorities-home.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadcart.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-downloadshelf.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-full-serial-issues.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-main.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry-update-submitted.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-confirmation.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-email-sent.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-invalid.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/prog/en/modules/sco/help.tt
koha-tmpl/opac-tmpl/prog/en/modules/sco/printslip.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/sco/receipt.tt
koha-tmpl/opac-tmpl/prog/en/modules/sco/sco-main.tt
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
kohaversion.pl
mainpage.pl
members/member.pl
members/members-home.pl
members/members-update-do.pl [new file with mode: 0755]
members/members-update.pl [new file with mode: 0755]
misc/bin/koha-index-daemon-ctl.sh [new file with mode: 0755]
misc/cronjobs/backup.sh
misc/cronjobs/delete_expired_opac_registrations.pl [new file with mode: 0755]
misc/cronjobs/delete_unverified_opac_registrations.pl [new file with mode: 0755]
misc/cronjobs/overdue_notices.pl
misc/cronjobs/runreport.pl
misc/cronjobs/serialsUpdate.pl
misc/migration_tools/bulkmarcimport.pl
misc/migration_tools/rebuild_zebra.pl
misc/translator/tmpl_process3.pl
misc/translator/xgettext.pl
opac/opac-authorities-home.pl
opac/opac-authoritiesdetail.pl
opac/opac-detail.pl
opac/opac-memberentry.pl [new file with mode: 0755]
opac/opac-registration-verify.pl [new file with mode: 0755]
opac/opac-reserve.pl
opac/opac-search.pl
opac/opac-user.pl
opac/sco/help.pl
opac/sco/printslip.pl [new file with mode: 0755]
opac/sco/sco-main.pl
reports/acquisitions_stats.pl
reports/dictionary.pl
reports/serials_stats.pl
reserve/request.pl
serials/checkexpiration.pl
serials/serials-collection.pl
serials/serials-edit.pl
serials/serials-search.pl
serials/subscription-detail.pl
t/00-checkdatabase-version.t
t/Makefile
t/Members_AttributeTypes.t
t/db_dependent/Context.t
t/db_dependent/Koha_borrower_modifications.t [new file with mode: 0755]
t/db_dependent/lib/KohaTest.pm
tools/batchMod.pl
tools/import_borrowers.pl

index 83031be..17330e5 100644 (file)
@@ -1795,8 +1795,8 @@ sub GetLateOrders {
     my $having = "";
     if ($dbdriver eq "mysql") {
         $select .= "
-        aqorders.quantity - IFNULL(aqorders.quantityreceived,0)                 AS quantity,
-        (aqorders.quantity - IFNULL(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
+        aqorders.quantity - COALESCE(aqorders.quantityreceived,0)                 AS quantity,
+        (aqorders.quantity - COALESCE(aqorders.quantityreceived,0)) * aqorders.rrp AS subtotal,
         DATEDIFF(CAST(now() AS date),closedate) AS latesince
         ";
         if ( defined $delay ) {
index 705eda0..b32136a 100644 (file)
@@ -462,6 +462,8 @@ sub get_template_and_user {
             SyndeticsSeries              => C4::Context->preference("SyndeticsSeries"),
             SyndeticsCoverImageSize      => C4::Context->preference("SyndeticsCoverImageSize"),
             OPACLocalCoverImages         => C4::Context->preference("OPACLocalCoverImages"),
+            PatronSelfRegistration       => C4::Context->preference("PatronSelfRegistration"),
+            PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
         );
 
         $template->param(OpacPublic => '1') if ($user || C4::Context->preference("OpacPublic"));
@@ -932,17 +934,11 @@ sub checkauth {
         my $value = $query->param($name);
         push @inputs, { name => $name, value => $value };
     }
-    # get the branchloop, which we need for authentication
-    my $branches = GetBranches();
-    my @branch_loop;
-    for my $branch_hash (sort keys %$branches) {
-               push @branch_loop, {branchcode => "$branch_hash", branchname => $branches->{$branch_hash}->{'branchname'}, };
-    }
 
     my $template_name = ( $type eq 'opac' ) ? 'opac-auth.tmpl' : 'auth.tmpl';
     my $template = C4::Templates::gettemplate($template_name, $type, $query );
     $template->param(
-        branchloop           => \@branch_loop,
+        branchloop           => GetBranchesLoop(),
         opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
         opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
         login                => 1,
@@ -967,10 +963,9 @@ sub checkauth {
         OpacAuthorities      => C4::Context->preference("OpacAuthorities"),
         OpacBrowser          => C4::Context->preference("OpacBrowser"),
         opacheader           => C4::Context->preference("opacheader"),
-        TagsEnabled                  => C4::Context->preference("TagsEnabled"),
+        TagsEnabled          => C4::Context->preference("TagsEnabled"),
         OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
-        intranetcolorstylesheet =>
-                                                               C4::Context->preference("intranetcolorstylesheet"),
+        intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
         intranetstylesheet => C4::Context->preference("intranetstylesheet"),
         intranetbookbag    => C4::Context->preference("intranetbookbag"),
         IntranetNav        => C4::Context->preference("IntranetNav"),
@@ -978,7 +973,9 @@ sub checkauth {
         intranetuserjs     => C4::Context->preference("intranetuserjs"),
         IndependantBranches=> C4::Context->preference("IndependantBranches"),
         AutoLocation       => C4::Context->preference("AutoLocation"),
-               wrongip            => $info{'wrongip'},
+        wrongip            => $info{'wrongip'},
+        PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),
+        PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
     );
 
     $template->param( OpacPublic => C4::Context->preference("OpacPublic"));
index c8183c1..4a3392f 100644 (file)
@@ -292,9 +292,9 @@ sub SearchAuthorities {
         } elsif ($sortby eq 'HeadingDsc') {
             $orderstring = '@attr 7=2 @attr 1=Heading 0';
         } elsif ($sortby eq 'AuthidAsc') {
-            $orderstring = '@attr 7=1 @attr 1=Local-Number 0';
+            $orderstring = '@attr 7=1 @attr 4=109 @attr 1=Local-Number 0';
         } elsif ($sortby eq 'AuthidDsc') {
-            $orderstring = '@attr 7=2 @attr 1=Local-Number 0';
+            $orderstring = '@attr 7=2 @attr 4=109 @attr 1=Local-Number 0';
         }
         $query=($query?$query:"\@attr 1=_ALLRECORDS \@attr 2=103 ''");
         $query="\@or $orderstring $query" if $orderstring;
index 832da69..7a9b7bb 100644 (file)
@@ -90,6 +90,7 @@ BEGIN {
       &GetAuthorisedValueDesc
       &GetMarcStructure
       &GetMarcFromKohaField
+      &GetMarcSubfieldStructureFromKohaField
       &GetFrameworkCode
       &TransformKohaToMarc
       &PrepHostMarcField
@@ -1214,6 +1215,38 @@ sub GetMarcFromKohaField {
     return (0, undef);
 }
 
+=head2 GetMarcSubfieldStructureFromKohaField
+
+    my $subfield_structure = &GetMarcSubfieldStructureFromKohaField($kohafield, $frameworkcode);
+
+Returns a hashref where keys are marc_subfield_structure column names for the
+row where kohafield=$kohafield for the given framework code.
+
+$frameworkcode is optional. If not given, then the default framework is used.
+
+=cut
+
+sub GetMarcSubfieldStructureFromKohaField {
+    my ($kohafield, $frameworkcode) = @_;
+
+    return undef unless $kohafield;
+    $frameworkcode //= '';
+
+    my $dbh = C4::Context->dbh;
+    my $query = qq{
+        SELECT *
+        FROM marc_subfield_structure
+        WHERE kohafield = ?
+          AND frameworkcode = ?
+    };
+    my $sth = $dbh->prepare($query);
+    $sth->execute($kohafield, $frameworkcode);
+    my $result = $sth->fetchrow_hashref;
+    $sth->finish;
+
+    return $result;
+}
+
 =head2 GetMarcBiblio
 
   my $record = GetMarcBiblio($biblionumber, [$embeditems]);
@@ -1686,15 +1719,19 @@ sub GetMarcNotes {
     my $note = "";
     my $tag  = "";
     my $marcnote;
+    my %blacklist = map { $_ => 1 } split(/,/,C4::Context->preference('NotesBlacklist'));
     foreach my $field ( $record->field($scope) ) {
-        my $value = $field->as_string();
-        if ( $note ne "" ) {
-            $marcnote = { marcnote => $note, };
-            push @marcnotes, $marcnote;
-            $note = $value;
-        }
-        if ( $note ne $value ) {
-            $note = $note . " " . $value;
+        my $tag = $field->tag();
+        if (!$blacklist{$tag}) {
+            my $value = $field->as_string();
+            if ( $note ne "" ) {
+                $marcnote = { marcnote => $note, };
+                push @marcnotes, $marcnote;
+                $note = $value;
+            }
+            if ( $note ne $value ) {
+                $note = $note . " " . $value;
+            }
         }
     }
 
index 5874a93..c8389a3 100644 (file)
@@ -125,7 +125,7 @@ sub GetBooksellersWithLateOrders {
             )
             AND aqorders.rrp <> 0
             AND aqorders.ecost <> 0
-            AND aqorders.quantity - IFNULL(aqorders.quantityreceived,0) <> 0
+            AND aqorders.quantity - COALESCE(aqorders.quantityreceived,0) <> 0
             AND aqbasket.closedate IS NOT NULL
     ";
     if ( defined $delay ) {
index d765c99..fe67e0c 100644 (file)
@@ -160,11 +160,12 @@ sub GetBranchesLoop {  # since this is what most pages want anyway
     my $onlymine = @_ ? shift : onlymine();
     my $branches = GetBranches($onlymine);
     my @loop;
-    foreach ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) {
+    foreach my $branchcode ( sort { uc($branches->{$a}->{branchname}) cmp uc($branches->{$b}->{branchname}) } keys %$branches ) {
         push @loop, {
-            value => $_,
-            selected => ($_ eq $branch) ? 1 : 0, 
-            branchname => $branches->{$_}->{branchname},
+            value      => $branchcode,
+            branchcode => $branchcode,
+            selected   => ($branchcode eq $branch) ? 1 : 0,
+            branchname => $branches->{$branchcode}->{branchname},
         };
     }
     return \@loop;
index 9dedc4d..f82ecf8 100644 (file)
@@ -33,7 +33,7 @@ BEGIN {
     $VERSION = 3.07.00.049;
        require Exporter;
        @ISA = qw(Exporter);
-       @EXPORT = qw(&ImportBreeding &BreedingSearch);
+    @EXPORT = qw(&ImportBreeding &BreedingSearch &Z3950Search);
 }
 
 =head1 NAME
@@ -213,6 +213,216 @@ sub BreedingSearch {
     return($count, @results);
 } # sub breedingsearch
 
+
+=head2 Z3950Search
+
+Z3950Search($pars, $template);
+
+Parameters for Z3950 search are all passed via the $pars hash. It may contain isbn, title, author, dewey, subject, lccall, controlnumber, stdid, srchany.
+Also it should contain an arrayref id that points to a list of id's of the z3950 targets to be queried (see z3950servers table).
+This code is used in acqui/z3950_search and cataloging/z3950_search.
+The second parameter $template is a Template object. The routine uses this parameter to store the found values into the template.
+
+=cut
+
+sub Z3950Search {
+    my ($pars, $template)= @_;
+
+    my $dbh   = C4::Context->dbh;
+    my @id= @{$pars->{id}};
+    my $random= $pars->{random};
+    my $page= $pars->{page};
+    my $biblionumber= $pars->{biblionumber};
+
+    my $isbn= $pars->{isbn};
+    my $issn= $pars->{issn};
+    my $title= $pars->{title};
+    my $author= $pars->{author};
+    my $dewey= $pars->{dewey};
+    my $subject= $pars->{subject};
+    my $lccn= $pars->{lccn};
+    my $lccall= $pars->{lccall};
+    my $controlnumber= $pars->{controlnumber};
+
+    my $show_next       = 0;
+    my $total_pages     = 0;
+
+    my $attr = '';
+    my $term;
+    my $host;
+    my $server;
+    my $database;
+    my $port;
+    my $marcdata;
+    my @encoding;
+    my @results;
+    my $count;
+    my $record;
+    my $oldbiblio;
+    my @serverhost;
+    my @servername;
+    my @breeding_loop = ();
+
+    my @oConnection;
+    my @oResult;
+    my @errconn;
+    my $s = 0;
+    my $query;
+    my $nterms=0;
+    if ($isbn) {
+        $term=$isbn;
+        $query .= " \@attr 1=7 \@attr 5=1 \"$term\" ";
+        $nterms++;
+    }
+    if ($issn) {
+        $term=$issn;
+        $query .= " \@attr 1=8 \@attr 5=1 \"$term\" ";
+        $nterms++;
+    }
+    if ($title) {
+        utf8::decode($title);
+        $query .= " \@attr 1=4 \"$title\" ";
+        $nterms++;
+    }
+    if ($author) {
+        utf8::decode($author);
+        $query .= " \@attr 1=1003 \"$author\" ";
+        $nterms++;
+    }
+    if ($dewey) {
+        $query .= " \@attr 1=16 \"$dewey\" ";
+        $nterms++;
+    }
+    if ($subject) {
+        utf8::decode($subject);
+        $query .= " \@attr 1=21 \"$subject\" ";
+        $nterms++;
+    }
+    if ($lccn) {
+        $query .= " \@attr 1=9 $lccn ";
+        $nterms++;
+    }
+    if ($lccall) {
+        $query .= " \@attr 1=16 \@attr 2=3 \@attr 3=1 \@attr 4=1 \@attr 5=1 \@attr 6=1 \"$lccall\" ";
+        $nterms++;
+    }
+    if ($controlnumber) {
+        $query .= " \@attr 1=12 \"$controlnumber\" ";
+        $nterms++;
+    }
+    for my $i (1..$nterms-1) {
+        $query = "\@and " . $query;
+    }
+
+    foreach my $servid (@id) {
+        my $sth = $dbh->prepare("select * from z3950servers where id=?");
+        $sth->execute($servid);
+        while ( $server = $sth->fetchrow_hashref ) {
+            my $option1      = new ZOOM::Options();
+            $option1->option( 'async' => 1 );
+            $option1->option( 'elementSetName', 'F' );
+            $option1->option( 'databaseName',   $server->{db} );
+            $option1->option( 'user', $server->{userid} ) if $server->{userid};
+            $option1->option( 'password', $server->{password} )
+              if $server->{password};
+            $option1->option( 'preferredRecordSyntax', $server->{syntax} );
+            $option1->option( 'timeout', $server->{timeout} ) if $server->{timeout};
+            $oConnection[$s] = create ZOOM::Connection($option1);
+            $oConnection[$s]->connect( $server->{host}, $server->{port} );
+            $serverhost[$s] = $server->{host};
+            $servername[$s] = $server->{name};
+            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
+            $s++;
+        }    ## while fetch
+    }    # foreach
+    my $nremaining  = $s;
+
+    for ( my $z = 0 ; $z < $s ; $z++ ) {
+        $oResult[$z] = $oConnection[$z]->search_pqf($query);
+    }
+
+    while ( $nremaining-- ) {
+        my $k;
+        my $event;
+        while ( ( $k = ZOOM::event( \@oConnection ) ) != 0 ) {
+            $event = $oConnection[ $k - 1 ]->last_event();
+            last if $event == ZOOM::Event::ZEND;
+        }
+
+        if ( $k != 0 ) {
+            $k--;
+            my ($error, $errmsg, $addinfo, $diagset)= $oConnection[$k]->error_x();
+            if ($error) {
+                if ($error =~ m/^(10000|10007)$/ ) {
+                    push(@errconn, {'server' => $serverhost[$k]});
+                }
+            }
+            else {
+                my $numresults = $oResult[$k]->size();
+                my $i;
+                my $result = '';
+                if ( $numresults > 0  and $numresults >= (($page-1)*20)) {
+                    $show_next = 1 if $numresults >= ($page*20);
+                    $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
+                    for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
+                        my $rec = $oResult[$k]->record($i);
+                        if ($rec) {
+                            my $marcrecord;
+                            $marcdata   = $rec->raw();
+                            my ($charset_result, $charset_errors);
+                            ($marcrecord, $charset_result, $charset_errors)= MarcToUTF8Record($marcdata, C4::Context->preference('marcflavour'), $encoding[$k]);
+                            # Normalize the record so it doesn't have separated diacritics
+                            SetUTF8Flag($marcrecord);
+                            my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
+                            $oldbiblio->{isbn}   =~ s/ |-|\.//g if $oldbiblio->{isbn};
+                            # pad | and ( with spaces to allow line breaks in the HTML
+                            $oldbiblio->{isbn} =~ s/\|/ \| /g if $oldbiblio->{isbn};
+                            $oldbiblio->{isbn} =~ s/\(/ \(/g if $oldbiblio->{isbn};
+                            $oldbiblio->{issn} =~ s/ |-|\.//g if $oldbiblio->{issn};
+                            # pad | and ( with spaces to allow line breaks in the HTML
+                            $oldbiblio->{issn} =~ s/\|/ \| /g if $oldbiblio->{issn};
+                            $oldbiblio->{issn} =~ s/\(/ \(/g if $oldbiblio->{issn};
+                            my ($notmarcrecord, $alreadyindb, $alreadyinfarm, $imported, $breedingid)= ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' );
+                            my %row_data;
+                            $row_data{server}       = $servername[$k];
+                            $row_data{isbn}         = $oldbiblio->{isbn};
+                            $row_data{lccn}         = $oldbiblio->{lccn};
+                            $row_data{title}        = $oldbiblio->{title};
+                            $row_data{author}       = $oldbiblio->{author};
+                            $row_data{date}         = $oldbiblio->{copyrightdate};
+                            $row_data{edition}      = $oldbiblio->{editionstatement};
+                            $row_data{breedingid}   = $breedingid;
+                            $row_data{biblionumber} = $biblionumber;
+                            push( @breeding_loop, \%row_data );
+                        }
+                        else {
+                            push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1});
+                        }
+                    }
+                }    #if $numresults
+            }
+        }    # if $k !=0
+
+        $template->param(
+            numberpending => $nremaining,
+            current_page => $page,
+            total_pages => $total_pages,
+            show_nextbutton => $show_next?1:0,
+            show_prevbutton => $page!=1,
+        );
+    } # while nremaining
+
+    my @servers = ();
+    foreach my $id (@id) {
+        push @servers, {id => $id};
+    }
+    $template->param(
+        breeding_loop => \@breeding_loop,
+        servers => \@servers,
+        errconn       => \@errconn
+    );
+}
+
 1;
 __END__
 
index d07dc75..7b553e6 100644 (file)
@@ -379,19 +379,32 @@ sub GetBudgetAuthCats  {
 # -------------------------------------------------------------------
 sub GetAuthvalueDropbox {
     my ( $authcat, $default ) = @_;
+    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
     my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare(
-        'SELECT authorised_value,lib FROM authorised_values
-        WHERE category = ? ORDER BY lib'
-    );
-    $sth->execute( $authcat );
+
+    my $query = qq{
+        SELECT *
+        FROM authorised_values
+    };
+    $query .= qq{
+          LEFT JOIN authorised_values_branches ON ( id = av_id )
+    } if $branch_limit;
+    $query .= qq{
+        WHERE category = ?
+    };
+    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
+    $query .= " GROUP BY lib ORDER BY category, lib, lib_opac";
+    my $sth = $dbh->prepare($query);
+    $sth->execute( $authcat, $branch_limit ? $branch_limit : () );
+
+
     my $option_list = [];
     my @authorised_values = ( q{} );
-    while (my ($value, $lib) = $sth->fetchrow_array) {
+    while (my $av = $sth->fetchrow_hashref) {
         push @{$option_list}, {
-            value => $value,
-            label => $lib,
-            default => ($default eq $value),
+            value => $av->{authorised_value},
+            label => $av->{lib},
+            default => ($default eq $av->{authorised_value}),
         };
     }
 
index 8cadc8b..fcb3ed8 100644 (file)
@@ -74,13 +74,24 @@ C<description>.
 =cut
 
 sub all {
-    my $class = shift;
-    map {
-        utf8::encode($_->{description});
-        $class->new($_);
-    } @{C4::Context->dbh->selectall_arrayref(
-        "SELECT * FROM categories ORDER BY description", { Slice => {} }
-    )};
+    my ( $class ) = @_;
+    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+    my $dbh = C4::Context->dbh;
+    # The categories table is small enough for
+    # `SELECT *` to be harmless.
+    my $query = "SELECT * FROM categories";
+    $query .= qq{
+        LEFT JOIN categories_branches ON categories_branches.categorycode = categories.categorycode
+        WHERE categories_branches.branchcode = ? OR categories_branches.branchcode IS NULL
+    } if $branch_limit;
+    $query .= " ORDER BY description";
+    return map { $class->new($_) } @{
+        $dbh->selectall_arrayref(
+            $query,
+            { Slice => {} },
+            $branch_limit ? $branch_limit : ()
+        )
+    };
 }
 
 
index ad86d41..71fe20f 100644 (file)
@@ -83,6 +83,7 @@ BEGIN {
                &GetBiblioIssues
                &GetOpenIssue
                &AnonymiseIssueHistory
+        &CheckIfIssuedToPatron
        );
 
        # subs to deal with returns
@@ -1252,7 +1253,9 @@ sub AddIssue {
 
         ## If item was lost, it has now been found, reverse any list item charges if neccessary.
         if ( $item->{'itemlost'} ) {
-            _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
+            if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) {
+                _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
+            }
         }
 
         ModItem({ issues           => $item->{'issues'},
@@ -1813,9 +1816,13 @@ sub AddReturn {
     }
 
     # fix up the accounts.....
-    if ($item->{'itemlost'}) {
-        _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode);    # can tolerate undef $borrowernumber
+    if ( $item->{'itemlost'} ) {
         $messages->{'WasLost'} = 1;
+
+        if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) {
+            _FixAccountForLostAndReturned($item->{'itemnumber'}, $borrowernumber, $barcode);    # can tolerate undef $borrowernumber
+            $messages->{'LostItemFeeRefunded'} = 1;
+        }
     }
 
     # fix up the overdues in accounts...
@@ -2575,6 +2582,27 @@ sub AddRenewal {
             "Renewal of Rental Item $item->{'title'} $item->{'barcode'}",
             'Rent', $charge, $itemnumber );
     }
+
+    # Send a renewal slip according to checkout alert preferencei
+    if ( C4::Context->preference('RenewalSendNotice') eq '1') {
+       my $borrower = C4::Members::GetMemberDetails( $borrowernumber, 0 );
+       my $circulation_alert = 'C4::ItemCirculationAlertPreference';
+       my %conditions = (
+               branchcode   => $branch,
+               categorycode => $borrower->{categorycode},
+               item_type    => $item->{itype},
+               notification => 'CHECKOUT',
+       );
+       if ($circulation_alert->is_enabled_for(\%conditions)) {
+               SendCirculationAlert({
+                       type     => 'RENEWAL',
+                       item     => $item,
+               borrower => $borrower,
+               branch   => $branch,
+               });
+       }
+    }
+
     # Log the renewal
     UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'});
        return $datedue;
@@ -2896,12 +2924,13 @@ sub SendCirculationAlert {
     my %message_name = (
         CHECKIN  => 'Item_Check_in',
         CHECKOUT => 'Item_Checkout',
+       RENEWAL  => 'Item_Checkout',
     );
     my $borrower_preferences = C4::Members::Messaging::GetMessagingPreferences({
         borrowernumber => $borrower->{borrowernumber},
         message_name   => $message_name{$type},
     });
-    my $issues_table = ( $type eq 'CHECKOUT' ) ? 'issues' : 'old_issues';
+    my $issues_table = ( $type eq 'CHECKOUT' || $type eq 'RENEWAL' ) ? 'issues' : 'old_issues';
     my $letter =  C4::Letters::GetPreparedLetter (
         module => 'circulation',
         letter_code => $type,
@@ -3417,6 +3446,26 @@ sub TransferSlip {
     );
 }
 
+=head2 CheckIfIssuedToPatron
+
+  CheckIfIssuedToPatron($borrowernumber, $biblionumber)
+
+  Return 1 if any record item is issued to patron, otherwise return 0
+
+=cut
+
+sub CheckIfIssuedToPatron {
+    my ($borrowernumber, $biblionumber) = @_;
+
+    my $items = GetItemsByBiblioitemnumber($biblionumber);
+
+    foreach my $item (@{$items}) {
+        return 1 if ($item->{borrowernumber} && $item->{borrowernumber} eq $borrowernumber);
+    }
+
+    return;
+}
+
 
 1;
 
index bd1f235..4e6c5fb 100644 (file)
@@ -220,6 +220,18 @@ sub KOHAVERSION {
     do $cgidir."/kohaversion.pl" || die "NO $cgidir/kohaversion.pl";
     return kohaversion();
 }
+
+=head2 final_linear_version
+
+Returns the version number of the final update to run in updatedatabase.pl.
+This number is equal to the version in kohaversion.pl
+
+=cut
+
+sub final_linear_version {
+    return KOHAVERSION;
+}
+
 =head2 read_config_file
 
 Reads the specified Koha config file. 
diff --git a/C4/HTML5Media.pm b/C4/HTML5Media.pm
new file mode 100644 (file)
index 0000000..89620d3
--- /dev/null
@@ -0,0 +1,223 @@
+package C4::HTML5Media;
+
+# Copyright 2012 Mirko Tietgen
+#
+# 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 C4::Context;
+use MARC::Field;
+
+
+=head1 HTML5Media
+
+C4::HTML5Media
+
+=head1 Description
+
+This module gets the relevant data from field 856 (MARC21/UNIMARC) to create a HTML5 audio or video element containing the file(s) catalogued in 856.
+
+=cut
+
+=head2 gethtml5media
+
+Get all relevant data from field 856. Takes a $record in the subroutine call, sets appropriate params.
+
+=cut
+
+sub gethtml5media {
+    my $self = shift;
+    my $record = shift;
+    my @HTML5Media_sets = ();
+    my @HTML5Media_fields = $record->field(856);
+    my $HTML5MediaParent;
+    my $HTML5MediaWidth;
+    my @HTML5MediaExtensions = split( /\|/, C4::Context->preference("HTML5MediaExtensions") );
+    my $marcflavour          = C4::Context->preference("marcflavour");
+    foreach my $HTML5Media_field (@HTML5Media_fields) {
+        my %HTML5Media;
+        # protocol
+        if ( $HTML5Media_field->indicator(1) eq '1' ) {
+            $HTML5Media{protocol} = 'ftp';
+        }
+        elsif ( $HTML5Media_field->indicator(1) eq '4' ) {
+            $HTML5Media{protocol} = 'http';
+        }
+        elsif ( $HTML5Media_field->indicator(1) eq '7' ) {
+            if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') {
+                $HTML5Media{protocol} = $HTML5Media_field->subfield('2');
+            }
+            elsif ($marcflavour eq 'UNIMARC') {
+                $HTML5Media{protocol} = $HTML5Media_field->subfield('y');
+            }
+        }
+        else {
+            $HTML5Media{protocol} = 'http';
+        }
+        # user
+        if ( $HTML5Media_field->subfield('l') ) {
+            $HTML5Media{username} = $HTML5Media_field->subfield('l'); # yes, that is arbitrary if h and l are not the same. originally i flipped a coin in that case.
+        }
+        elsif ( $HTML5Media_field->subfield('h') ) {
+            $HTML5Media{username} = $HTML5Media_field->subfield('h');
+        }
+        # user/pass
+        if ( $HTML5Media{username} && $HTML5Media_field->subfield('k') ) {
+            $HTML5Media{loginblock} = $HTML5Media{username} . ':' . $HTML5Media_field->subfield('k') . '@';
+        }
+        elsif ( $HTML5Media{username} ) {
+            $HTML5Media{loginblock} = $HTML5Media{username} . '@';
+        }
+        else {
+            $HTML5Media{loginblock} = '';
+        }
+        # port
+        if ( $HTML5Media_field->subfield('p') ) {
+            $HTML5Media{portblock} = ':' . $HTML5Media_field->subfield('k');
+        }
+        else {
+            $HTML5Media{portblock} = '';
+        }
+        # src
+        if ( $HTML5Media_field->subfield('u') ) {
+            $HTML5Media{srcblock} = $HTML5Media_field->subfield('u');
+        }
+        elsif ( $HTML5Media_field->subfield('a') && $HTML5Media_field->subfield('d') && $HTML5Media_field->subfield('f') ) {
+            $HTML5Media{host}        = $HTML5Media_field->subfield('a');
+            $HTML5Media{host}        =~ s/(^\/|\/$)//g;
+            $HTML5Media{path}        = $HTML5Media_field->subfield('d');
+            $HTML5Media{path}        =~ s/(^\/|\/$)//g;
+            $HTML5Media{file}        = $HTML5Media_field->subfield('f');
+            $HTML5Media{srcblock}    = $HTML5Media{protocol} . '://' . $HTML5Media{loginblock} . $HTML5Media{host} . $HTML5Media{portblock} . '/' . $HTML5Media{path} . '/' . $HTML5Media{file};
+        }
+        else {
+            next; # no file to play
+        }
+        # extension
+        $HTML5Media{extension} = ($HTML5Media{srcblock} =~ m/([^.]+)$/)[0];
+        if ( !grep /$HTML5Media{extension}/, @HTML5MediaExtensions ) {
+            next; # not a specified media file
+        }
+        # mime
+        if ( $HTML5Media_field->subfield('c') ) {
+            $HTML5Media{codecs} = $HTML5Media_field->subfield('c');
+        }
+        ### from subfield q…
+        if ( $HTML5Media_field->subfield('q') ) {
+            $HTML5Media{mime} = $HTML5Media_field->subfield('q');
+        }
+        ### â€¦or from file extension and codecs…
+        elsif ( $HTML5Media{codecs} ) {
+            if ( $HTML5Media{codecs} =~ /theora.*vorbis/ ) {
+                $HTML5Media{mime} = 'video/ogg';
+            }
+            elsif ( $HTML5Media{codecs} =~ /vp8.*vorbis/ ) {
+                $HTML5Media{mime} = 'video/webm';
+            }
+            elsif ( ($HTML5Media{codecs} =~ /^vorbis$/) && ($HTML5Media{extension} eq 'ogg') ) {
+                $HTML5Media{mime} = 'audio/ogg';
+            }
+            elsif ( ($HTML5Media{codecs} =~ /^vorbis$/) && ($HTML5Media{extension} eq 'webm') ) {
+                $HTML5Media{mime} = 'audio/webm';
+            }
+        }
+        ### â€¦or just from file extension
+        else {
+            if ( $HTML5Media{extension} eq 'ogv' ) {
+                $HTML5Media{mime} = 'video/ogg';
+                $HTML5Media{codecs} = 'theora,vorbis';
+            }
+            if ( $HTML5Media{extension} eq 'oga' ) {
+                $HTML5Media{mime} = 'audio/ogg';
+              $HTML5Media{codecs} = 'vorbis';
+            }
+            elsif ( $HTML5Media{extension} eq 'spx' ) {
+                $HTML5Media{mime} = 'audio/ogg';
+                $HTML5Media{codecs} = 'speex';
+            }
+            elsif ( $HTML5Media{extension} eq 'opus' ) {
+                $HTML5Media{mime} = 'audio/ogg';
+                $HTML5Media{codecs} = 'opus';
+            }
+            elsif ( $HTML5Media{extension} eq 'vtt' ) {
+                $HTML5Media{mime} = 'text/vtt';
+            }
+        }
+        # codecs
+        if ( $HTML5Media{codecs} ) {
+            $HTML5Media{codecblock} = '; codecs="' . $HTML5Media{codecs} . '"';
+        }
+        else {
+            $HTML5Media{codecblock} = '';
+        }
+        # type
+        if ( $HTML5Media{mime} ) {
+            $HTML5Media{typeblock} = ' type=\'' . $HTML5Media{mime} . $HTML5Media{codecblock} . '\'';
+        }
+        else {
+          $HTML5Media{typeblock} = '';
+        }
+        # element
+        if ( $HTML5Media{mime} =~ /audio/ ) {
+            $HTML5Media{type} = 'audio';
+        }
+        elsif ( $HTML5Media{mime} =~ /video/ ) {
+            $HTML5Media{type} = 'video';
+        }
+        elsif ( $HTML5Media{mime} =~ /text/ ) {
+            $HTML5Media{type} = 'track';
+        }
+        # push
+        if ( $HTML5Media{srcblock} && $HTML5Media{type} ) {
+            push (@HTML5Media_sets, \%HTML5Media);
+        }
+    }
+    # parent element
+    for my $media ( @HTML5Media_sets ) {
+        if ( ($media->{mime}) && ($media->{mime} =~ /audio/) ) {
+            if ( $HTML5MediaParent ne 'video' ) {
+                $HTML5MediaParent = 'audio';
+                $HTML5MediaWidth = '';
+            }
+        }
+        elsif ( ($media->{mime}) && ($media->{mime} =~ /video/) ) {
+            $HTML5MediaParent = 'video';
+            $HTML5MediaWidth = ' width="480"';
+        }
+    }
+    # child element
+    for my $media ( @HTML5Media_sets ) {
+        if ( ($media->{type}) && ( ($media->{type} eq 'video') || ($media->{type} eq 'audio') ) ) {
+            if ( $media->{type} eq $HTML5MediaParent ) {
+                $media->{child} = 'source';
+            }
+        }
+        else {
+            $media->{child} = $media->{type};
+        }
+    }
+
+    return (
+        HTML5MediaEnabled  => ( (scalar(@HTML5Media_sets) > 0) && ($HTML5MediaParent) ),
+        HTML5MediaSets     => \@HTML5Media_sets,
+        HTML5MediaParent   => $HTML5MediaParent,
+        HTML5MediaWidth    => $HTML5MediaWidth,
+    );
+}
+
+1;
index 5a62954..68cbdb3 100644 (file)
@@ -197,6 +197,12 @@ sub GetRecords {
             $biblioitem->{code} = "RecordNotFound";
         }
 
+        my $embed_items = 1;
+        my $record = GetMarcBiblio($biblionumber, $embed_items);
+        if ($record) {
+            $biblioitem->{marcxml} = $record->as_xml_record();
+        }
+
         # We don't want MARC to be displayed
         delete $biblioitem->{'marc'};
 
index 8b17f1c..4bae00c 100644 (file)
@@ -131,16 +131,10 @@ sub ListImagesForBiblio {
     my $query = 'SELECT imagenumber FROM biblioimages WHERE biblionumber = ?';
     my $sth   = $dbh->prepare($query);
     $sth->execute($biblionumber);
-    warn "Database error!" if $sth->errstr;
-    if ( !$sth->errstr && $sth->rows > 0 ) {
-        while ( my $row = $sth->fetchrow_hashref ) {
-            push @imagenumbers, $row->{'imagenumber'};
-        }
-        return @imagenumbers;
-    }
-    else {
-        return undef;
+    while ( my $row = $sth->fetchrow_hashref ) {
+        push @imagenumbers, $row->{'imagenumber'};
     }
+    return @imagenumbers;
 }
 
 =head2 DelImage
index 2e84dc2..ba30460 100644 (file)
@@ -119,33 +119,48 @@ Returns NULL if no authorised values found
 =cut
 
 sub buildCGIsort {
-       my ($name,$input_name,$data) = @_;
-       my $dbh=C4::Context->dbh;
-       my $query=qq{SELECT * FROM authorised_values WHERE category=? order by lib};
-       my $sth=$dbh->prepare($query);
-       $sth->execute($name);
-       my $CGISort;
-       if ($sth->rows>0){
-               my @values;
-               my %labels;
-
-               for (my $i =0;$i<$sth->rows;$i++){
-                       my $results = $sth->fetchrow_hashref;
-                       push @values, $results->{authorised_value};
-                       $labels{$results->{authorised_value}}=$results->{lib};
-               }
-               $CGISort= CGI::scrolling_list(
-                                       -name => $input_name,
-                                       -id =>   $input_name,
-                                       -values => \@values,
-                                       -labels => \%labels,
-                                       -default=> $data,
-                                       -size => 1,
-                                       -multiple => 0);
-       }
-       $sth->finish;
-       return $CGISort;
+    my ( $name, $input_name, $data ) = @_;
+    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+
+    my $dbh=C4::Context->dbh;
+    my $query = qq{
+        SELECT *
+        FROM authorised_values
+    };
+    $query .= qq{
+          LEFT JOIN authorised_values_branches ON ( id = av_id )
+    } if $branch_limit;
+    $query .= qq{
+        WHERE category = ?
+    };
+    $query .= qq{ AND ( branchcode = ? OR branchcode IS NULL )} if $branch_limit;
+    $query .= qq{ GROUP BY lib ORDER BY lib};
+
+    my $sth=$dbh->prepare($query);
+    $sth->execute( $name, $branch_limit ? $branch_limit : () );
+    my $CGISort;
+    if ($sth->rows>0){
+        my @values;
+        my %labels;
+
+        for (my $i =0;$i<$sth->rows;$i++){
+            my $results = $sth->fetchrow_hashref;
+            push @values, $results->{authorised_value};
+            $labels{$results->{authorised_value}}=$results->{lib};
+        }
+        $CGISort= CGI::scrolling_list(
+                    -name => $input_name,
+                    -id =>   $input_name,
+                    -values => \@values,
+                    -labels => \%labels,
+                    -default=> $data,
+                    -size => 1,
+                    -multiple => 0);
+    }
+    $sth->finish;
+    return $CGISort;
 }
+
 END { }       # module clean-up code here (global destructor)
 
 1;
index 71f35d4..16144f9 100644 (file)
@@ -629,6 +629,11 @@ our $PERL_DEPS = {
         'required' => '0',
         'min_ver'  => '1.09',
       },
+    'String::Random' => {
+        'usage'    => 'OpacSelfRegistration',
+        'required' => '0',
+        'min_ver'  => '1.4',
+    },
 };
 
 1;
index 253078d..012ec8a 100644 (file)
@@ -2602,7 +2602,20 @@ sub PrepareItemrecordDisplay {
         $itemrecord = C4::Items::GetMarcItem( $bibnum, $itemnum );
     }
     my @loop_data;
-    my $authorised_values_sth = $dbh->prepare( "SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib" );
+
+    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+    my $query = qq{
+        SELECT authorised_value,lib FROM authorised_values
+    };
+    $query .= qq{
+        LEFT JOIN authorised_values_branches ON ( id = av_id )
+    } if $branch_limit;
+    $query .= qq{
+        WHERE category = ?
+    };
+    $query .= qq{ AND ( branchcode = ? OR branchcode IS NULL )} if $branch_limit;
+    $query .= qq{ ORDER BY lib};
+    my $authorised_values_sth = $dbh->prepare( $query );
     foreach my $tag ( sort keys %{$tagslib} ) {
         my $previous_tag = '';
         if ( $tag ne '' ) {
@@ -2707,6 +2720,7 @@ sub PrepareItemrecordDisplay {
                                 $authorised_lib{$branchcode} = $branchname;
                             }
                         }
+                        $defaultvalue = C4::Context->userenv->{branch};
 
                         #----- itemtypes
                     } elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {
@@ -2734,7 +2748,10 @@ sub PrepareItemrecordDisplay {
 
                         #---- "true" authorised value
                     } else {
-                        $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value} );
+                        $authorised_values_sth->execute(
+                            $tagslib->{$tag}->{$subfield}->{authorised_value},
+                            $branch_limit ? $branch_limit : ()
+                        );
                         push @authorised_values, ""
                           unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
                         while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
index d38729a..3892468 100644 (file)
@@ -1036,28 +1036,50 @@ C<$opac> If set to a true value, displays OPAC descriptions rather than normal o
 =cut
 
 sub GetAuthorisedValues {
-    my ($category,$selected,$opac) = @_;
+    my ( $category, $selected, $opac ) = @_;
+    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
     my @results;
     my $dbh      = C4::Context->dbh;
-    my $query    = "SELECT * FROM authorised_values";
-    $query .= " WHERE category = '" . $category . "'" if $category;
-    $query .= " ORDER BY category, lib, lib_opac";
+    my $query = qq{
+        SELECT *
+        FROM authorised_values
+    };
+    $query .= qq{
+          LEFT JOIN authorised_values_branches ON ( id = av_id )
+    } if $branch_limit;
+    my @where_strings;
+    my @where_args;
+    if($category) {
+        push @where_strings, "category = ?";
+        push @where_args, $category;
+    }
+    if($branch_limit) {
+        push @where_strings, "( branchcode = ? OR branchcode IS NULL )";
+        push @where_args, $branch_limit;
+    }
+    if(@where_strings > 0) {
+        $query .= " WHERE " . join(" AND ", @where_strings);
+    }
+    $query .= " GROUP BY lib ORDER BY category, lib, lib_opac";
+
     my $sth = $dbh->prepare($query);
-    $sth->execute;
+
+    $sth->execute( @where_args );
     while (my $data=$sth->fetchrow_hashref) {
-        if ( (defined($selected)) && ($selected eq $data->{'authorised_value'}) ) {
-            $data->{'selected'} = 1;
+        if ( defined $selected and $selected eq $data->{authorised_value} ) {
+            $data->{selected} = 1;
         }
         else {
-            $data->{'selected'} = 0;
+            $data->{selected} = 0;
         }
-        if ($opac && $data->{'lib_opac'}) {
-            $data->{'lib'} = $data->{'lib_opac'};
+
+        if ($opac && $data->{lib_opac}) {
+            $data->{lib} = $data->{lib_opac};
         }
         push @results, $data;
     }
-    #my $data = $sth->fetchall_arrayref({});
-    return \@results; #$data;
+    $sth->finish;
+    return \@results;
 }
 
 =head2 GetAuthorisedValueCategories
index f646241..a585ff8 100644 (file)
@@ -540,6 +540,9 @@ sub GetProcessedLetter {
        }
     }
 
+    my $OPACBaseURL = C4::Context->preference('OPACBaseURL');
+    $letter->{content} =~ s/<<OPACBaseURL>>/$OPACBaseURL/go;
+
     if ($want_librarian) {
         # parsing librarian name
         my $userenv = C4::Context->userenv;
@@ -638,18 +641,19 @@ sub _parseletter_sth {
     # check cache first
     (defined $handles{$table}) and return $handles{$table};
     my $query = 
-    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
-    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                 :
-    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
-    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                 :
-    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1" :
-    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"            :
-    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                 :
-    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                 :
-    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                 :
-    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                 :
-    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                 :
-    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                 :
+    ($table eq 'biblio'       ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
+    ($table eq 'biblioitems'  ) ? "SELECT * FROM $table WHERE   biblionumber = ?"                                  :
+    ($table eq 'items'        ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
+    ($table eq 'issues'       ) ? "SELECT * FROM $table WHERE     itemnumber = ?"                                  :
+    ($table eq 'old_issues'   ) ? "SELECT * FROM $table WHERE     itemnumber = ? ORDER BY timestamp DESC LIMIT 1"  :
+    ($table eq 'reserves'     ) ? "SELECT * FROM $table WHERE borrowernumber = ? and biblionumber = ?"             :
+    ($table eq 'borrowers'    ) ? "SELECT * FROM $table WHERE borrowernumber = ?"                                  :
+    ($table eq 'branches'     ) ? "SELECT * FROM $table WHERE     branchcode = ?"                                  :
+    ($table eq 'suggestions'  ) ? "SELECT * FROM $table WHERE   suggestionid = ?"                                  :
+    ($table eq 'aqbooksellers') ? "SELECT * FROM $table WHERE             id = ?"                                  :
+    ($table eq 'aqorders'     ) ? "SELECT * FROM $table WHERE    ordernumber = ?"                                  :
+    ($table eq 'opac_news'    ) ? "SELECT * FROM $table WHERE          idnew = ?"                                  :
+    ($table eq 'borrower_modifications') ? "SELECT * FROM $table WHERE borrowernumber = ? OR verification_token =?":
     undef ;
     unless ($query) {
         warn "ERROR: No _parseletter_sth query for table '$table'";
@@ -756,7 +760,7 @@ sub EnqueueLetter {
     my $params = shift or return;
 
     return unless exists $params->{'letter'};
-    return unless exists $params->{'borrowernumber'};
+#   return unless exists $params->{'borrowernumber'};
     return unless exists $params->{'message_transport_type'};
 
     my $content = $params->{letter}->{content};
index 14448e3..671fcdb 100644 (file)
--- a/C4/Log.pm
+++ b/C4/Log.pm
@@ -73,6 +73,7 @@ sub logaction {
     # the scalar '0'.
     my $userenv = C4::Context->userenv();
     my $usernumber = (ref($userenv) eq 'HASH') ? $userenv->{'number'} : 0;
+    $usernumber ||= 0;
 
     my $dbh = C4::Context->dbh;
     my $sth=$dbh->prepare("Insert into action_logs (timestamp,user,module,action,object,info) values (now(),?,?,?,?,?)");
index b2f45b9..81b014b 100644 (file)
@@ -25,6 +25,7 @@ use strict;
 use C4::Context;
 use C4::Dates qw(format_date_in_iso format_date);
 use Digest::MD5 qw(md5_base64);
+use String::Random qw( random_string );
 use Date::Calc qw/Today Add_Delta_YM check_date Date_to_Days/;
 use C4::Log; # logaction
 use C4::Overdues;
@@ -118,6 +119,7 @@ BEGIN {
     #Insert data
     push @EXPORT, qw(
         &AddMember
+        &AddMember_Opac
         &add_member_orgs
         &MoveMemberToDeleted
         &ExtendMemberSubscriptionTo
@@ -751,11 +753,25 @@ Returns as undef upon any db error without further processing
 sub AddMember {
     my (%data) = @_;
     my $dbh = C4::Context->dbh;
-       # generate a proper login if none provided
-       $data{'userid'} = Generate_Userid($data{'borrowernumber'}, $data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
-       # create a disabled account if no password provided
-       $data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
-       $data{'borrowernumber'}=InsertInTable("borrowers",\%data);      
+
+    # generate a proper login if none provided
+    $data{'userid'} = Generate_Userid($data{'borrowernumber'}, $data{'firstname'}, $data{'surname'}) if $data{'userid'} eq '';
+
+    # add expiration date if it isn't already there
+    unless ( $data{'dateexpiry'} ) {
+        $data{'dateexpiry'} = GetExpiryDate( $data{'categorycode'}, C4::Dates->new()->output("iso") );
+    }
+
+    # add enrollment date if it isn't already there
+    unless ( $data{'dateenrolled'} ) {
+        $data{'dateenrolled'} = C4::Dates->new()->output("iso");
+    }
+
+    # create a disabled account if no password provided
+    $data{'password'} = ($data{'password'})? md5_base64($data{'password'}) : '!';
+    $data{'borrowernumber'}=InsertInTable("borrowers",\%data);
+
+
     # mysql_insertid is probably bad.  not necessarily accurate and mysql-specific at best.
     logaction("MEMBERS", "CREATE", $data{'borrowernumber'}, "") if C4::Context->preference("BorrowersLog");
     
@@ -1374,20 +1390,35 @@ to category descriptions.
 
 #'
 sub GetborCatFromCatType {
-    my ( $category_type, $action ) = @_;
-       # FIXME - This API  seems both limited and dangerous. 
+    my ( $category_type, $action, $no_branch_limit ) = @_;
+
+    my $branch_limit = $no_branch_limit
+        ? 0
+        : C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+
+    # FIXME - This API  seems both limited and dangerous.
     my $dbh     = C4::Context->dbh;
-    my $request = qq|   SELECT categorycode,description 
-            FROM categories 
-            $action
-            ORDER BY categorycode|;
-    my $sth = $dbh->prepare($request);
-       if ($action) {
-        $sth->execute($category_type);
-    }
-    else {
-        $sth->execute();
+
+    my $request = qq{
+        SELECT categories.categorycode, categories.description
+        FROM categories
+    };
+    $request .= qq{
+        LEFT JOIN categories_branches ON categories.categorycode = categories_branches.categorycode
+    } if $branch_limit;
+    if($action) {
+        $request .= " $action ";
+        $request .= " AND (branchcode = ? OR branchcode IS NULL) GROUP BY description" if $branch_limit;
+    } else {
+        $request .= " WHERE branchcode = ? OR branchcode IS NULL GROUP BY description" if $branch_limit;
     }
+    $request .= " ORDER BY categorycode";
+
+    my $sth = $dbh->prepare($request);
+    $sth->execute(
+        $action ? $category_type : (),
+        $branch_limit ? $branch_limit : ()
+    );
 
     my %labels;
     my @codes;
@@ -1396,6 +1427,7 @@ sub GetborCatFromCatType {
         push @codes, $data->{'categorycode'};
         $labels{ $data->{'categorycode'} } = $data->{'description'};
     }
+    $sth->finish;
     return ( \@codes, \%labels );
 }
 
@@ -1454,16 +1486,21 @@ If no category code provided, the function returns all the categories.
 =cut
 
 sub GetBorrowercategoryList {
+    my $no_branch_limit = @_ ? shift : 0;
+    my $branch_limit = $no_branch_limit
+        ? 0
+        : C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
     my $dbh       = C4::Context->dbh;
-    my $sth       =
-    $dbh->prepare(
-    "SELECT * 
-    FROM categories 
-    ORDER BY description"
-        );
-    $sth->execute;
-    my $data =
-    $sth->fetchall_arrayref({});
+    my $query = "SELECT * FROM categories";
+    $query .= qq{
+        LEFT JOIN categories_branches ON categories.categorycode = categories_branches.categorycode
+        WHERE branchcode = ? OR branchcode IS NULL GROUP BY description
+    } if $branch_limit;
+    $query .= " ORDER BY description";
+    my $sth = $dbh->prepare( $query );
+    $sth->execute( $branch_limit ? $branch_limit : () );
+    my $data = $sth->fetchall_arrayref( {} );
+    $sth->finish;
     return $data;
 }    # sub getborrowercategory
 
@@ -2358,6 +2395,22 @@ sub GetBorrowersWithEmail {
     return @result;
 }
 
+sub AddMember_Opac {
+    my ( %borrower ) = @_;
+
+    $borrower{'categorycode'} = C4::Context->preference('PatronSelfRegistrationDefaultCategory');
+
+    my $sr = new String::Random;
+    $sr->{'A'} = [ 'A'..'Z', 'a'..'z' ];
+    my $password = $sr->randpattern("AAAAAAAAAA");
+    $borrower{'password'} = $password;
+
+    $borrower{'cardnumber'} = fixup_cardnumber();
+
+    my $borrowernumber = AddMember(%borrower);
+
+    return ( $borrowernumber, $password );
+}
 
 END { }    # module clean-up code here (global destructor)
 
index 3e33694..1754099 100644 (file)
@@ -69,12 +69,24 @@ If $all_fields is true, then each hashref also contains the other fields from bo
 =cut
 
 sub GetAttributeTypes {
-    my ($all) = @_;
-    my $select = $all ? '*' : 'code, description, class';
+    my $all    = @_   ? shift : 0;
+    my $no_branch_limit = @_ ? shift : 0;
+    my $branch_limit = $no_branch_limit
+        ? 0
+        : C4::Context->userenv ? C4::Context->userenv->{"branch"} : 0;
+    my $select = $all ? '*'   : 'DISTINCT(code), description, class';
+
     my $dbh = C4::Context->dbh;
-    my $sth = $dbh->prepare("SELECT $select FROM borrower_attribute_types ORDER by code");
-    $sth->execute();
+    my $query = "SELECT $select FROM borrower_attribute_types";
+    $query .= qq{
+        LEFT JOIN borrower_attribute_types_branches ON bat_code = code
+        WHERE b_branchcode = ? OR b_branchcode IS NULL
+    } if $branch_limit;
+    $query .= " ORDER BY code";
+    my $sth    = $dbh->prepare($query);
+    $sth->execute( $branch_limit ? $branch_limit : () );
     my $results = $sth->fetchall_arrayref({});
+    $sth->finish;
     return @$results;
 }
 
@@ -166,6 +178,13 @@ sub fetch {
     $self->{'category_description'}      = $row->{'category_description'};
     $self->{'class'}                     = $row->{'class'};
 
+    $sth = $dbh->prepare("SELECT branchcode, branchname FROM borrower_attribute_types_branches, branches WHERE b_branchcode = branchcode AND bat_code = ?;");
+    $sth->execute( $code );
+    while ( my $data = $sth->fetchrow_hashref ) {
+        push @{ $self->{branches} }, $data;
+    }
+    $sth->finish();
+
     bless $self, $class;
     return $self;
 }
@@ -219,6 +238,22 @@ sub store {
     $sth->bind_param(11, $self->{'code'});
     $sth->execute;
 
+    if ( defined $$self{branches} ) {
+        $sth = $dbh->prepare("DELETE FROM borrower_attribute_types_branches WHERE bat_code = ?");
+        $sth->execute( $$self{code} );
+        $sth = $dbh->prepare(
+            "INSERT INTO borrower_attribute_types_branches
+                        ( bat_code, b_branchcode )
+                        VALUES ( ?, ? )"
+        );
+        for my $branchcode ( @{$$self{branches}} ) {
+            next if not $branchcode;
+            $sth->bind_param( 1, $$self{code} );
+            $sth->bind_param( 2, $branchcode );
+            $sth->execute;
+        }
+    }
+    $sth->finish;
 }
 
 =head2 code
@@ -250,6 +285,20 @@ sub description {
     @_ ? $self->{'description'} = shift : $self->{'description'};
 }
 
+=head2 branches
+
+my $branches = $attr_type->branches();
+$attr_type->branches($branches);
+
+Accessor.
+
+=cut
+
+sub branches {
+    my $self = shift;
+    @_ ? $self->{branches} = shift : $self->{branches};
+}
+
 =head2 repeatable
 
   my $repeatable = $attr_type->repeatable();
@@ -324,13 +373,9 @@ sub staff_searchable {
 
 =head2 display_checkout
 
-=over 4
-
 my $display_checkout = $attr_type->display_checkout();
 $attr_type->display_checkout($display_checkout);
 
-=back
-
 Accessor.  The C<$display_checkout> argument
 is interpreted as a Perl boolean.
 
@@ -357,13 +402,9 @@ sub authorised_value_category {
 
 =head2 category_code
 
-=over 4
-
 my $category_code = $attr_type->category_code();
 $attr_type->category_code($category_code);
 
-=back
-
 Accessor.
 
 =cut
@@ -375,13 +416,9 @@ sub category_code {
 
 =head2 category_description
 
-=over 4
-
 my $category_description = $attr_type->category_description();
 $attr_type->category_description($category_description);
 
-=back
-
 Accessor.
 
 =cut
@@ -393,13 +430,9 @@ sub category_description {
 
 =head2 class
 
-=over 4
-
 my $class = $attr_type->class();
 $attr_type->class($class);
 
-=back
-
 Accessor.
 
 =cut
@@ -432,6 +465,7 @@ sub delete {
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare_cached("DELETE FROM borrower_attribute_types WHERE code = ?");
     $sth->execute($code);
+    $sth->finish;
 }
 
 =head2 num_patrons
index e175915..f0ec07f 100644 (file)
@@ -71,6 +71,7 @@ marked for OPAC display are returned.
 sub GetBorrowerAttributes {
     my $borrowernumber = shift;
     my $opac_only = @_ ? shift : 0;
+    my $branch_limit = @_ ? shift : 0;
 
     my $dbh = C4::Context->dbh();
     my $query = "SELECT code, description, attribute, lib, password, display_checkout, category_code, class
@@ -95,6 +96,7 @@ sub GetBorrowerAttributes {
             class             => $row->{'class'},
         }
     }
+    $sth->finish;
     return \@results;
 }
 
index 1dc6f72..a380bf0 100644 (file)
@@ -2007,7 +2007,10 @@ sub MoveReserve {
             ModReserveFill($borr_res);
         }
 
-        if ($cancelreserve) { # cancel reserves on this item
+        if ( $cancelreserve eq 'revert' ) { ## Revert waiting reserve to priority 1
+            RevertWaitingStatus({ itemnumber => $itemnumber });
+        }
+        elsif ( $cancelreserve eq 'cancel' || $cancelreserve ) { # cancel reserves on this item
             CancelReserve(0, $res->{'itemnumber'}, $res->{'borrowernumber'});
             CancelReserve($res->{'biblionumber'}, 0, $res->{'borrowernumber'});
         }
@@ -2058,6 +2061,66 @@ sub MergeHolds {
     }
 }
 
+=head2 RevertWaitingStatus
+
+  $success = RevertWaitingStatus({ itemnumber => $itemnumber });
+
+  Reverts a 'waiting' hold back to a regular hold with a priority of 1.
+
+  Caveat: Any waiting hold fixed with RevertWaitingStatus will be an
+          item level hold, even if it was only a bibliolevel hold to
+          begin with. This is because we can no longer know if a hold
+          was item-level or bib-level after a hold has been set to
+          waiting status.
+
+=cut
+
+sub RevertWaitingStatus {
+    my ( $params ) = @_;
+    my $itemnumber = $params->{'itemnumber'};
+
+    return unless ( $itemnumber );
+
+    my $dbh = C4::Context->dbh;
+
+    ## Get the waiting reserve we want to revert
+    my $query = "
+        SELECT * FROM reserves
+        WHERE itemnumber = ?
+        AND found IS NOT NULL
+    ";
+    my $sth = $dbh->prepare( $query );
+    $sth->execute( $itemnumber );
+    my $reserve = $sth->fetchrow_hashref();
+
+    ## Increment the priority of all other non-waiting
+    ## reserves for this bib record
+    $query = "
+        UPDATE reserves
+        SET
+          priority = priority + 1
+        WHERE
+          biblionumber =  ?
+        AND
+          priority > 0
+    ";
+    $sth = $dbh->prepare( $query );
+    $sth->execute( $reserve->{'biblionumber'} );
+
+    ## Fix up the currently waiting reserve
+    $query = "
+    UPDATE reserves
+    SET
+      priority = 1,
+      found = NULL,
+      waitingdate = NULL
+    WHERE
+      reserve_id = ?
+    ";
+    $sth = $dbh->prepare( $query );
+    return $sth->execute( $reserve->{'reserve_id'} );
+}
+
 =head2 ReserveSlip
 
   ReserveSlip($branchcode, $borrowernumber, $biblionumber)
index 6bf7192..ba85cd7 100644 (file)
@@ -22,14 +22,7 @@ use C4::Circulation;
 use C4::Members;
 use C4::Reserves;
 
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
-
-BEGIN {
-    $VERSION = 3.07.00.049;
-       require Exporter;
-       @ISA = qw(Exporter);
-       @EXPORT_OK = qw();
-}
+our $VERSION = 3.07.00.049;
 
 =head1 EXAMPLE
 
@@ -140,7 +133,7 @@ my %fields = (
 );
 
 sub next_hold {
-    my $self = shift or return;
+    my $self = shift;
     # use Data::Dumper; warn "next_hold() hold_shelf: " . Dumper($self->{hold_shelf}); warn "next_hold() pending_queue: " . $self->{pending_queue};
     foreach (@{$self->hold_shelf}) {    # If this item was taken from the hold shelf, then that reserve still governs
         next unless ($_->{itemnumber} and $_->{itemnumber} == $self->{itemnumber});
@@ -168,7 +161,7 @@ sub hold_patron_id {
 
 }
 sub hold_patron_name {
-    my $self = shift or return;
+    my $self = shift;
     my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return;
     my $holder = GetMember(borrowernumber=>$borrowernumber);
     unless ($holder) {
@@ -186,7 +179,7 @@ sub hold_patron_name {
 }
 
 sub hold_patron_bcode {
-    my $self = shift or return;
+    my $self = shift;
     my $borrowernumber = (@_ ? shift: $self->hold_patron_id()) or return;
     my $holder = GetMember(borrowernumber => $borrowernumber);
     if ($holder) {
@@ -257,9 +250,11 @@ sub sip_circulation_status {
 }
 
 sub sip_security_marker {
+    my $self = shift;
     return '02';       # FIXME? 00-other; 01-None; 02-Tattle-Tape Security Strip (3M); 03-Whisper Tape (3M)
 }
 sub sip_fee_type {
+    my $self = shift;
     return '01';    # FIXME? 01-09 enumerated in spec.  We just use O1-other/unknown.
 }
 
@@ -354,7 +349,7 @@ sub _barcode_to_borrowernumber {
     return $member->{borrowernumber};
 }
 sub barcode_is_borrowernumber {    # because hold_queue only has borrowernumber...
-    my $self = shift;   # not really used
+    my $self = shift;
     my $barcode = shift;
     my $number  = shift or return;    # can't be zero
     return unless defined $barcode; # might be 0 or 000 or 000000
index d3a9762..8c00a11 100644 (file)
@@ -23,32 +23,26 @@ use C4::Reserves;
 use C4::Branch qw(GetBranchName);
 use Digest::MD5 qw(md5_base64);
 
-use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
+our $VERSION = 3.07.00.049;
 
-BEGIN {
-    $VERSION = 3.07.00.049;
-       @ISA = qw(Exporter);
-       @EXPORT_OK = qw(invalid_patron);
-}
-
-our $kp;       # koha patron
+our $kp;    # koha patron
 
 sub new {
-       my ($class, $patron_id) = @_;
+    my ($class, $patron_id) = @_;
     my $type = ref($class) || $class;
     my $self;
-       $kp = GetMember(cardnumber=>$patron_id);
-       $debug and warn "new Patron (GetMember): " . Dumper($kp);
+    $kp = GetMember(cardnumber=>$patron_id) || GetMember(userid=>$patron_id);
+    $debug and warn "new Patron (GetMember): " . Dumper($kp);
     unless (defined $kp) {
-               syslog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id);
+        syslog("LOG_DEBUG", "new ILS::Patron(%s): no such patron", $patron_id);
         return;
-       }
-       $kp = GetMemberDetails(undef,$patron_id);
-       $debug and warn "new Patron (GetMemberDetails): " . Dumper($kp);
-       my $pw        = $kp->{password};  ### FIXME - md5hash -- deal with . 
-       my $flags     = $kp->{flags};     # or warn "Warning: No flags from patron object for '$patron_id'"; 
-       my $debarred  = $kp->{debarred};  # 1 if ($kp->{flags}->{DBARRED}->{noissues});
-       $debug and warn sprintf("Debarred = %s : ", ($debarred||'undef')) . Dumper(%{$kp->{flags}});
+    }
+    $kp = GetMemberDetails($kp->{borrowernumber});
+    $debug and warn "new Patron (GetMemberDetails): " . Dumper($kp);
+    my $pw        = $kp->{password};  ### FIXME - md5hash -- deal with .
+    my $flags     = $kp->{flags};     # or warn "Warning: No flags from patron object for '$patron_id'";
+    my $debarred  = $kp->{debarred};  # 1 if ($kp->{flags}->{DBARRED}->{noissues});
+    $debug and warn sprintf("Debarred = %s : ", ($debarred||'undef')) . Dumper(%{$kp->{flags}});
     my ($day, $month, $year) = (localtime)[3,4,5];
     my $today    = sprintf '%04d-%02d-%02d', $year+1900, $month+1, $day;
     my $expired  = ($today gt $kp->{dateexpiry}) ? 1 : 0;
@@ -58,18 +52,16 @@ sub new {
         }
         $kp->{opacnote} .= 'PATRON EXPIRED';
     }
-       my %ilspatron;
-       my $adr     = $kp->{streetnumber} || '';
-       my $address = $kp->{address}      || ''; 
+    my %ilspatron;
+    my $adr     = _get_address($kp);
     my $dob     = $kp->{dateofbirth};
     $dob and $dob =~ s/-//g;    # YYYYMMDD
     my $dexpiry     = $kp->{dateexpiry};
     $dexpiry and $dexpiry =~ s/-//g;    # YYYYMMDD
-       $adr .= ($adr && $address) ? " $address" : $address;
     my $fines_amount = $flags->{CHARGES}->{amount};
     $fines_amount = ($fines_amount and $fines_amount > 0) ? $fines_amount : 0;
     {
-       no warnings;    # any of these $kp->{fields} being concat'd could be undef
+    no warnings;    # any of these $kp->{fields} being concat'd could be undef
     %ilspatron = (
         getmemberdetails_object => $kp,
         name => $kp->{firstname} . " " . $kp->{surname},
@@ -109,24 +101,24 @@ sub new {
     );
     }
     $debug and warn "patron fines: $ilspatron{fines} ... amountoutstanding: $kp->{amountoutstanding} ... CHARGES->amount: $flags->{CHARGES}->{amount}";
-       for (qw(EXPIRED CHARGES CREDITS GNA LOST DBARRED NOTES)) {
-               ($flags->{$_}) or next;
+    for (qw(EXPIRED CHARGES CREDITS GNA LOST DBARRED NOTES)) {
+        ($flags->{$_}) or next;
         if ($_ ne 'NOTES' and $flags->{$_}->{message}) {
             $ilspatron{screen_msg} .= " -- " . $flags->{$_}->{message};  # show all but internal NOTES
         }
-               if ($flags->{$_}->{noissues}) {
-                       foreach my $toggle (qw(charge_ok renew_ok recall_ok hold_ok inet)) {
-                               $ilspatron{$toggle} = 0;    # if we get noissues, disable everything
-                       }
-               }
-       }
+        if ($flags->{$_}->{noissues}) {
+            foreach my $toggle (qw(charge_ok renew_ok recall_ok hold_ok inet)) {
+                $ilspatron{$toggle} = 0;    # if we get noissues, disable everything
+            }
+        }
+    }
 
     # FIXME: populate fine_items recall_items
 #   $ilspatron{hold_items}    = (GetReservesFromBorrowernumber($kp->{borrowernumber},'F'));
-       $ilspatron{unavail_holds} = [(GetReservesFromBorrowernumber($kp->{borrowernumber}))];
-       $ilspatron{items} = GetPendingIssues($kp->{borrowernumber});
-       $self = \%ilspatron;
-       $debug and warn Dumper($self);
+    $ilspatron{unavail_holds} = [(GetReservesFromBorrowernumber($kp->{borrowernumber}))];
+    $ilspatron{items} = GetPendingIssues($kp->{borrowernumber});
+    $self = \%ilspatron;
+    $debug and warn Dumper($self);
     syslog("LOG_DEBUG", "new ILS::Patron(%s): found patron '%s'", $patron_id,$self->{id});
     bless $self, $type;
     return $self;
@@ -184,24 +176,24 @@ sub AUTOLOAD {
     $name =~ s/.*://;
 
     unless (exists $fields{$name}) {
-               croak "Cannot access '$name' field of class '$class'";
+        croak "Cannot access '$name' field of class '$class'";
     }
 
-       if (@_) {
+    if (@_) {
         $fields{$name} or croak "Field '$name' of class '$class' is READ ONLY.";
-               return $self->{$name} = shift;
-       } else {
-               return $self->{$name};
-       }
+        return $self->{$name} = shift;
+    } else {
+        return $self->{$name};
+    }
 }
 
 sub check_password {
     my ($self, $pwd) = @_;
-       my $md5pwd = $self->{password};
-       # warn sprintf "check_password for %s: '%s' vs. '%s'",($self->{name}||''),($self->{password}||''),($pwd||'');
-       (defined $pwd   ) or return 0;          # you gotta give me something (at least ''), or no deal
-       (defined $md5pwd) or return($pwd eq '');        # if the record has a NULL password, accept '' as match
-       return (md5_base64($pwd) eq $md5pwd);
+    my $md5pwd = $self->{password};
+    # warn sprintf "check_password for %s: '%s' vs. '%s'",($self->{name}||''),($self->{password}||''),($pwd||'');
+    (defined $pwd   ) or return 0;        # you gotta give me something (at least ''), or no deal
+    (defined $md5pwd) or return($pwd eq '');    # if the record has a NULL password, accept '' as match
+    return (md5_base64($pwd) eq $md5pwd);
 }
 
 # A few special cases, not in AUTOLOADed %fields
@@ -235,17 +227,17 @@ sub expired {
 sub drop_hold {
     my ($self, $item_id) = @_;
     return if !$item_id;
-       my $result = 0;
-       foreach (qw(hold_items unavail_holds)) {
-               $self->{$_} or next;
-               for (my $i = 0; $i < scalar @{$self->{$_}}; $i++) {
-                       my $held_item = $self->{$_}[$i]->{item_id} or next;
-                       if ($held_item eq $item_id) {
-                               splice @{$self->{$_}}, $i, 1;
-                               $result++;
-                       }
-               }
-       }
+    my $result = 0;
+    foreach (qw(hold_items unavail_holds)) {
+        $self->{$_} or next;
+        for (my $i = 0; $i < scalar @{$self->{$_}}; $i++) {
+            my $held_item = $self->{$_}[$i]->{item_id} or next;
+            if ($held_item eq $item_id) {
+                splice @{$self->{$_}}, $i, 1;
+                $result++;
+            }
+        }
+    }
     return $result;
 }
 
@@ -253,10 +245,10 @@ sub drop_hold {
 # from the SIP request.  Note those incoming values are 1-indexed, not 0-indexed.
 #
 sub x_items {
-    my $self      = shift or return;
+    my $self      = shift;
     my $array_var = shift or return;
     my ($start, $end) = @_;
-       $self->{$array_var} or return [];
+    $self->{$array_var} or return [];
     $start = 1 unless defined($start);
     $end   = scalar @{$self->{$array_var}} unless defined($end);
     # syslog("LOG_DEBUG", "$array_var: start = %d, end = %d; items(%s)", $start, $end, join(', ', @{$self->{items}}));
@@ -268,35 +260,35 @@ sub x_items {
 # List of outstanding holds placed
 #
 sub hold_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('hold_items', @_);
 }
 
 sub overdue_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('overdue_items', @_);
 }
 sub charged_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('items', @_);
 }
 sub fine_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('fine_items', @_);
 }
 sub recall_items {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('recall_items', @_);
 }
 sub unavail_holds {
-    my $self = shift or return;
+    my $self = shift;
     return $self->x_items('unavail_holds', @_);
 }
 
 sub block {
     my ($self, $card_retained, $blocked_card_msg) = @_;
     foreach my $field ('charge_ok', 'renew_ok', 'recall_ok', 'hold_ok', 'inet') {
-               $self->{$field} = 0;
+        $self->{$field} = 0;
     }
     $self->{screen_msg} = "Block feature not implemented";  # $blocked_card_msg || "Card Blocked.  Please contact library staff";
     # TODO: not really affecting patron record
@@ -306,11 +298,11 @@ sub block {
 sub enable {
     my $self = shift;
     foreach my $field ('charge_ok', 'renew_ok', 'recall_ok', 'hold_ok', 'inet') {
-               $self->{$field} = 1;
+        $self->{$field} = 1;
     }
     syslog("LOG_DEBUG", "Patron(%s)->enable: charge: %s, renew:%s, recall:%s, hold:%s",
-          $self->{id}, $self->{charge_ok}, $self->{renew_ok},
-          $self->{recall_ok}, $self->{hold_ok});
+       $self->{id}, $self->{charge_ok}, $self->{renew_ok},
+       $self->{recall_ok}, $self->{hold_ok});
     $self->{screen_msg} = "Enable feature not implemented."; # "All privileges restored.";   # TODO: not really affecting patron record
     return $self;
 }
@@ -321,16 +313,16 @@ sub inet_privileges {
 }
 
 sub fee_limit {
-    my $self = shift;
+    my $self = shift;
     return C4::Context->preference("noissuescharge") || 5;
 }
 
 sub excessive_fees {
-    my $self = shift or return;
+    my $self = shift;
     return ($self->fee_amount and $self->fee_amount > $self->fee_limit);
 }
 sub excessive_fines {
-    my $self = shift or return;
+    my $self = shift;
     return $self->excessive_fees;   # excessive_fines is the same thing as excessive_fees for Koha
 }
     
@@ -346,48 +338,68 @@ sub library_name {
 #
 
 sub invalid_patron {
+    my $self = shift;
     return "Please contact library staff";
 }
 
 sub charge_denied {
+    my $self = shift;
     return "Please contact library staff";
 }
 
+sub _get_address {
+    my $patron = shift;
+
+    my $address = $patron->{streetnumber} || q{};
+    for my $field (qw( roaddetails address address2 city state zipcode country))
+    {
+        next unless $patron->{$field};
+        if ($address) {
+            $address .= q{ };
+            $address .= $patron->{$field};
+        }
+        else {
+            $address .= $patron->{$field};
+        }
+    }
+    return $address;
+}
+
 1;
 __END__
 
 =head1 EXAMPLES
 
   our %patron_example = (
-                 djfiander => {
-                     name => "David J. Fiander",
-                     id => 'djfiander',
-                     password => '6789',
-                     ptype => 'A', # 'A'dult.  Whatever.
-                     birthdate => '19640925',
-                     address => '2 Meadowvale Dr. St Thomas, ON',
-                     home_phone => '(519) 555 1234',
-                     email_addr => 'djfiander@hotmail.com',
-                     charge_ok => 1,
-                     renew_ok => 1,
-                     recall_ok => 0,
-                     hold_ok => 1,
-                     card_lost => 0,
-                     claims_returned => 0,
-                     fines => 100,
-                     fees => 0,
-                     recall_overdue => 0,
-                     items_billed => 0,
-                     screen_msg => '',
-                     print_line => '',
-                     items => [],
-                     hold_items => [],
-                     overdue_items => [],
-                     fine_items => ['Computer Time'],
-                     recall_items => [],
-                     unavail_holds => [],
-                     inet => 1,
-                 },
+          djfiander => {
+              name => "David J. Fiander",
+              id => 'djfiander',
+              password => '6789',
+              ptype => 'A', # 'A'dult.  Whatever.
+              birthdate => '19640925',
+              address => '2 Meadowvale Dr. St Thomas, ON',
+              home_phone => '(519) 555 1234',
+              email_addr => 'djfiander@hotmail.com',
+              charge_ok => 1,
+              renew_ok => 1,
+              recall_ok => 0,
+              hold_ok => 1,
+              card_lost => 0,
+              claims_returned => 0,
+              fines => 100,
+              fees => 0,
+              recall_overdue => 0,
+              items_billed => 0,
+              screen_msg => '',
+              print_line => '',
+              items => [],
+              hold_items => [],
+              overdue_items => [],
+              fine_items => ['Computer Time'],
+              recall_items => [],
+              unavail_holds => [],
+              inet => 1,
+          },
   );
 
  From borrowers table:
@@ -467,26 +479,26 @@ __END__
 
  $flags->{KEY}
  {CHARGES}
-       {message}     Message showing patron's credit or debt
-       {noissues}    Set if patron owes >$5.00
- {GNA}                 Set if patron gone w/o address
-       {message}     "Borrower has no valid address"
-       {noissues}    Set.
- {LOST}                Set if patron's card reported lost
-       {message}     Message to this effect
-       {noissues}    Set.
- {DBARRED}             Set if patron is debarred
-       {message}     Message to this effect
-       {noissues}    Set.
- {NOTES}               Set if patron has notes
-       {message}     Notes about patron
- {ODUES}               Set if patron has overdue books
-       {message}     "Yes"
-       {itemlist}    ref-to-array: list of overdue books
-       {itemlisttext}    Text list of overdue items
- {WAITING}             Set if there are items available that the patron reserved
-       {message}     Message to this effect
-       {itemlist}    ref-to-array: list of available items
+    {message}     Message showing patron's credit or debt
+    {noissues}    Set if patron owes >$5.00
+ {GNA}             Set if patron gone w/o address
+    {message}     "Borrower has no valid address"
+    {noissues}    Set.
+ {LOST}            Set if patron's card reported lost
+    {message}     Message to this effect
+    {noissues}    Set.
+ {DBARRED}         Set if patron is debarred
+    {message}     Message to this effect
+    {noissues}    Set.
+ {NOTES}           Set if patron has notes
+    {message}     Notes about patron
+ {ODUES}           Set if patron has overdue books
+    {message}     "Yes"
+    {itemlist}    ref-to-array: list of overdue books
+    {itemlisttext}    Text list of overdue items
+ {WAITING}         Set if there are items available that the patron reserved
+    {message}     Message to this effect
+    {itemlist}    ref-to-array: list of available items
 
 =cut
 
index 47bd85d..49ce926 100644 (file)
@@ -17,7 +17,7 @@ use C4::Reserves qw( ModReserveAffect );
 use C4::Items qw( ModItemTransfer );
 use C4::Debug;
 
-our @ISA = qw(ILS::Transaction);
+use parent qw(ILS::Transaction);
 
 my %fields = (
     magnetic => 0,
index da7a1b0..c61eca6 100644 (file)
@@ -20,13 +20,11 @@ use C4::Circulation;
 use C4::Members;
 use C4::Reserves qw(ModReserveFill);
 use C4::Debug;
+use parent qw(ILS::Transaction);
 
-use vars qw($VERSION @ISA $debug);
+our $debug;
 
-BEGIN {
-    $VERSION = 3.07.00.049;
-       @ISA = qw(ILS::Transaction);
-}
+our $VERSION = 3.07.00.049;
 
 # Most fields are handled by the Transaction superclass
 my %fields = (
index 19bdd04..52619f4 100644 (file)
@@ -22,9 +22,8 @@ use strict;
 
 use C4::Accounts qw(recordpayment);
 use ILS;
-use base qw(ILS::Transaction);
+use parent qw(ILS::Transaction);
 
-use vars qw($VERSION @ISA $debug);
 
 our $debug   = 0;
 our $VERSION = 3.07.00.049;
index 3352c1c..a2ca13e 100644 (file)
@@ -12,13 +12,10 @@ use ILS::Transaction;
 use C4::Reserves;      # AddReserve
 use C4::Members;       # GetMember
 use C4::Biblio;                # GetBiblioFromItemNumber GetBiblioItemByBiblioNumber
+use parent qw(ILS::Transaction);
 
-use vars qw($VERSION @ISA);
 
-BEGIN {
-    $VERSION = 3.07.00.049;
-           @ISA = qw(ILS::Transaction);
-}
+our $VERSION = 3.07.00.049;
 
 my %fields = (
        expiration_date => 0,
index 1f0f567..aa300d4 100644 (file)
@@ -12,7 +12,7 @@ use ILS;
 use C4::Circulation;
 use C4::Members;
 
-use base qw(ILS::Transaction);
+use parent qw(ILS::Transaction);
 
 my %fields = (
     renewal_ok => 0,
index c7be96b..7cdb4bb 100644 (file)
@@ -12,7 +12,7 @@ use ILS::Item;
 
 use C4::Members qw( GetMember );
 
-use base qw(ILS::Transaction::Renew);
+use parent qw(ILS::Transaction::Renew);
 
 my %fields = (
     renewed   => [],
index 1e850d9..50f7d2b 100644 (file)
@@ -254,28 +254,29 @@ sub SimpleSearch {
                 return ( $error, undef, undef );
             }
         }
-        while ( ( my $i = ZOOM::event( \@zconns ) ) != 0 ) {
-            my $event = $zconns[ $i - 1 ]->last_event();
-            if ( $event == ZOOM::Event::ZEND ) {
 
-                my $first_record = defined( $offset ) ? $offset+1 : 1;
+        _ZOOM_event_loop(
+            \@zconns,
+            \@tmpresults,
+            sub {
+                my ($i, $size) = @_;
+                my $first_record = defined($offset) ? $offset + 1 : 1;
                 my $hits = $tmpresults[ $i - 1 ]->size();
                 $total_hits += $hits;
                 my $last_record = $hits;
                 if ( defined $max_results && $offset + $max_results < $hits ) {
-                    $last_record  = $offset + $max_results;
+                    $last_record = $offset + $max_results;
                 }
 
-                for my $j ( $first_record..$last_record ) {
-                    my $record = $tmpresults[ $i - 1 ]->record( $j-1 )->raw(); # 0 indexed
+                for my $j ( $first_record .. $last_record ) {
+                    my $record =
+                      $tmpresults[ $i - 1 ]->record( $j - 1 )->raw()
+                      ;    # 0 indexed
                     push @{$results}, $record;
                 }
             }
-        }
+        );
 
-        foreach my $result (@tmpresults) {
-            $result->destroy();
-        }
         foreach my $zoom_query (@zoom_queries) {
             $zoom_query->destroy();
         }
@@ -410,12 +411,11 @@ sub getRecords {
     }    # finished looping through servers
 
     # The big moment: asynchronously retrieve results from all servers
-    while ( ( my $i = ZOOM::event( \@zconns ) ) != 0 ) {
-        my $ev = $zconns[ $i - 1 ]->last_event();
-        if ( $ev == ZOOM::Event::ZEND ) {
-            next unless $results[ $i - 1 ];
-            my $size = $results[ $i - 1 ]->size();
-            if ( $size > 0 ) {
+        _ZOOM_event_loop(
+            \@zconns,
+            \@results,
+            sub {
+                my ( $i, $size ) = @_;
                 my $results_hash;
 
                 # loop through the results
@@ -444,16 +444,26 @@ sub getRecords {
                         my $tmpauthor;
 
                 # the minimal record in author/title (depending on MARC flavour)
-                        if (C4::Context->preference("marcflavour") eq "UNIMARC") {
-                            $tmptitle = MARC::Field->new('200',' ',' ', a => $term, f => $occ);
+                        if ( C4::Context->preference("marcflavour") eq
+                            "UNIMARC" )
+                        {
+                            $tmptitle = MARC::Field->new(
+                                '200', ' ', ' ',
+                                a => $term,
+                                f => $occ
+                            );
                             $tmprecord->append_fields($tmptitle);
-                        } else {
-                            $tmptitle  = MARC::Field->new('245',' ',' ', a => $term,);
-                            $tmpauthor = MARC::Field->new('100',' ',' ', a => $occ,);
+                        }
+                        else {
+                            $tmptitle =
+                              MARC::Field->new( '245', ' ', ' ', a => $term, );
+                            $tmpauthor =
+                              MARC::Field->new( '100', ' ', ' ', a => $occ, );
                             $tmprecord->append_fields($tmptitle);
                             $tmprecord->append_fields($tmpauthor);
                         }
-                        $results_hash->{'RECORDS'}[$j] = $tmprecord->as_usmarc();
+                        $results_hash->{'RECORDS'}[$j] =
+                          $tmprecord->as_usmarc();
                     }
 
                     # not an index scan
@@ -467,143 +477,179 @@ sub getRecords {
                 }
                 $results_hashref->{ $servers[ $i - 1 ] } = $results_hash;
 
-                # Fill the facets while we're looping, but only for the biblioserver and not for a scan
+# 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 $facet ( @$facets ) {
-                               for ( my $j = 0 ; $j < $jmax ; $j++ ) {
-                                   my $render_record = $results[ $i - 1 ]->record($j)->render();
+                    my $jmax =
+                      $size > $facets_maxrecs ? $facets_maxrecs : $size;
+                    for my $facet (@$facets) {
+                        for ( my $j = 0 ; $j < $jmax ; $j++ ) {
+                            my $render_record =
+                              $results[ $i - 1 ]->record($j)->render();
                             my @used_datas = ();
-                            foreach my $tag ( @{$facet->{tags}} ) {
+                            foreach my $tag ( @{ $facet->{tags} } ) {
+
                                 # avoid first line
-                                my $tag_num = substr($tag, 0, 3);
-                                my $letters = substr($tag, 3);
-                                my $field_pattern = '\n' . $tag_num . ' ([^z][^\n]+)';
-                                $field_pattern = '\n' . $tag_num . ' ([^\n]+)' if (int($tag_num) < 10);
-                                my @field_tokens = ( $render_record =~ /$field_pattern/g ) ;
+                                my $tag_num = substr( $tag, 0, 3 );
+                                my $letters = substr( $tag, 3 );
+                                my $field_pattern =
+                                  '\n' . $tag_num . ' ([^z][^\n]+)';
+                                $field_pattern = '\n' . $tag_num . ' ([^\n]+)'
+                                  if ( int($tag_num) < 10 );
+                                my @field_tokens =
+                                  ( $render_record =~ /$field_pattern/g );
                                 foreach my $field_token (@field_tokens) {
-                                    my @subf = ( $field_token =~ /\$([a-zA-Z0-9]) ([^\$]+)/g );
+                                    my @subf = ( $field_token =~
+                                          /\$([a-zA-Z0-9]) ([^\$]+)/g );
                                     my @values;
-                                    for (my $i = 0; $i < @subf; $i += 2) {
+                                    for ( my $i = 0 ; $i < @subf ; $i += 2 ) {
                                         if ( $letters =~ $subf[$i] ) {
-                                             my $value = $subf[$i+1];
-                                             $value =~ s/^ *//;
-                                             $value =~ s/ *$//;
-                                             push @values, $value;
+                                            my $value = $subf[ $i + 1 ];
+                                            $value =~ s/^ *//;
+                                            $value =~ s/ *$//;
+                                            push @values, $value;
                                         }
                                     }
-                                    my $data = join($facet->{sep}, @values);
+                                    my $data = join( $facet->{sep}, @values );
                                     unless ( $data ~~ @used_datas ) {
-                                        $facets_counter->{ $facet->{idx} }->{$data}++;
+                                        $facets_counter->{ $facet->{idx} }
+                                          ->{$data}++;
                                         push @used_datas, $data;
                                     }
-                                } # fields
-                            } # field codes
-                        } # records
-                        $facets_info->{ $facet->{idx} }->{label_value} = $facet->{label};
-                        $facets_info->{ $facet->{idx} }->{expanded} = $facet->{expanded};
-                    } # facets
+                                }    # fields
+                            }    # field codes
+                        }    # records
+                        $facets_info->{ $facet->{idx} }->{label_value} =
+                          $facet->{label};
+                        $facets_info->{ $facet->{idx} }->{expanded} =
+                          $facet->{expanded};
+                    }    # facets
                 }
-            }
 
-            # warn "connection ", $i-1, ": $size hits";
-            # warn $results[$i-1]->record(0)->render() if $size > 0;
+                # warn "connection ", $i-1, ": $size hits";
+                # warn $results[$i-1]->record(0)->render() if $size > 0;
 
-            # BUILD FACETS
-            if ( $servers[ $i - 1 ] =~ /biblioserver/ ) {
-                for my $link_value (
-                    sort { $facets_counter->{$b} <=> $facets_counter->{$a} }
-                        keys %$facets_counter )
-                {
-                    my $expandable;
-                    my $number_of_facets;
-                    my @this_facets_array;
-                    for my $one_facet (
-                        sort {
-                             $facets_counter->{$link_value}->{$b}
-                         <=> $facets_counter->{$link_value}->{$a}
-                        } keys %{ $facets_counter->{$link_value} }
+                # BUILD FACETS
+                if ( $servers[ $i - 1 ] =~ /biblioserver/ ) {
+                    for my $link_value (
+                        sort { $facets_counter->{$b} <=> $facets_counter->{$a} }
+                        keys %$facets_counter
                       )
                     {
-                        $number_of_facets++;
-                        if (   ( $number_of_facets < 6 )
-                            || ( $expanded_facet eq $link_value )
-                            || ( $facets_info->{$link_value}->{'expanded'} ) )
+                        my $expandable;
+                        my $number_of_facets;
+                        my @this_facets_array;
+                        for my $one_facet (
+                            sort {
+                                $facets_counter->{$link_value}
+                                  ->{$b} <=> $facets_counter->{$link_value}
+                                  ->{$a}
+                            } keys %{ $facets_counter->{$link_value} }
+                          )
                         {
+                            $number_of_facets++;
+                            if (   ( $number_of_facets < 6 )
+                                || ( $expanded_facet eq $link_value )
+                                || ( $facets_info->{$link_value}->{'expanded'} )
+                              )
+                            {
+
+# Sanitize the link value : parenthesis, question and exclamation mark will cause errors with CCL
+                                my $facet_link_value = $one_facet;
+                                $facet_link_value =~ s/[()!?¡¿؟]/ /g;
+
+                                # 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, $facet_max_length )
+                                  . "..."
+                                  if length($facet_label_value) >
+                                      $facet_max_length;
 
-                      # Sanitize the link value : parenthesis, question and exclamation mark will cause errors with CCL
-                            my $facet_link_value = $one_facet;
-                            $facet_link_value =~ s/[()!?¡¿؟]/ /g;
+                            # if it's a branch, label by the name, not the code,
+                                if ( $link_value =~ /branch/ ) {
+                                    if (   defined $branches
+                                        && ref($branches) eq "HASH"
+                                        && defined $branches->{$one_facet}
+                                        && ref( $branches->{$one_facet} ) eq
+                                        "HASH" )
+                                    {
+                                        $facet_label_value =
+                                          $branches->{$one_facet}
+                                          ->{'branchname'};
+                                    }
+                                    else {
+                                        $facet_label_value = "*";
+                                    }
+                                }
 
-                            # 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, $facet_max_length ) . "..."
-                                if length($facet_label_value) > $facet_max_length;
+                          # if it's a itemtype, label by the name, not the code,
+                                if ( $link_value =~ /itype/ ) {
+                                    if (   defined $itemtypes
+                                        && ref($itemtypes) eq "HASH"
+                                        && defined $itemtypes->{$one_facet}
+                                        && ref( $itemtypes->{$one_facet} ) eq
+                                        "HASH" )
+                                    {
+                                        $facet_label_value =
+                                          $itemtypes->{$one_facet}
+                                          ->{'description'};
+                                    }
+                                }
 
-                            # if it's a branch, label by the name, not the code,
-                            if ( $link_value =~ /branch/ ) {
-                                                               if (defined $branches
-                                                                       && ref($branches) eq "HASH"
-                                                                       && defined $branches->{$one_facet}
-                                                                       && ref ($branches->{$one_facet}) eq "HASH")
-                                                               {
-                                       $facet_label_value =
-                                               $branches->{$one_facet}->{'branchname'};
-                                                               }
-                                                               else {
-                                                                       $facet_label_value = "*";
-                                                               }
-                            }
-                            # if it's a itemtype, label by the name, not the code,
-                            if ( $link_value =~ /itype/ ) {
-                                if (defined $itemtypes
-                                    && ref($itemtypes) eq "HASH"
-                                    && defined $itemtypes->{$one_facet}
-                                    && ref ($itemtypes->{$one_facet}) eq "HASH")
-                                {
+               # also, if it's a location code, use the name instead of the code
+                                if ( $link_value =~ /location/ ) {
                                     $facet_label_value =
-                                        $itemtypes->{$one_facet}->{'description'};
+                                      GetKohaAuthorisedValueLib( 'LOC',
+                                        $one_facet, $opac );
                                 }
-                            }
 
-                            # also, if it's a location code, use the name instead of the code
-                            if ( $link_value =~ /location/ ) {
-                                $facet_label_value = GetKohaAuthorisedValueLib('LOC', $one_facet, $opac);
+                # but we're down with the whole label being in the link's title.
+                                push @this_facets_array,
+                                  {
+                                    facet_count =>
+                                      $facets_counter->{$link_value}
+                                      ->{$one_facet},
+                                    facet_label_value => $facet_label_value,
+                                    facet_title_value => $one_facet,
+                                    facet_link_value  => $facet_link_value,
+                                    type_link_value   => $link_value,
+                                  }
+                                  if ($facet_label_value);
                             }
-
-                            # but we're down with the whole label being in the link's title.
-                            push @this_facets_array, {
-                                facet_count       => $facets_counter->{$link_value}->{$one_facet},
-                                facet_label_value => $facet_label_value,
-                                facet_title_value => $one_facet,
-                                facet_link_value  => $facet_link_value,
-                                type_link_value   => $link_value,
-                            } if ( $facet_label_value );
                         }
-                    }
 
-                    # handle expanded option
-                    unless ( $facets_info->{$link_value}->{'expanded'} ) {
-                        $expandable = 1
-                          if ( ( $number_of_facets > 6 )
-                            && ( $expanded_facet ne $link_value ) );
+                        # handle expanded option
+                        unless ( $facets_info->{$link_value}->{'expanded'} ) {
+                            $expandable = 1
+                              if ( ( $number_of_facets > 6 )
+                                && ( $expanded_facet ne $link_value ) );
+                        }
+                        push @facets_loop,
+                          {
+                            type_link_value => $link_value,
+                            type_id         => $link_value . "_id",
+                            "type_label_"
+                              . $facets_info->{$link_value}->{'label_value'} =>
+                              1,
+                            facets     => \@this_facets_array,
+                            expandable => $expandable,
+                            expand     => $link_value,
+                          }
+                          unless (
+                            (
+                                $facets_info->{$link_value}->{'label_value'} =~
+                                /Libraries/
+                            )
+                            and ( C4::Context->preference('singleBranchMode') )
+                          );
                     }
-                    push @facets_loop, {
-                        type_link_value => $link_value,
-                        type_id         => $link_value . "_id",
-                        "type_label_" . $facets_info->{$link_value}->{'label_value'} => 1,
-                        facets     => \@this_facets_array,
-                        expandable => $expandable,
-                        expand     => $link_value,
-                    } unless ( ($facets_info->{$link_value}->{'label_value'} =~ /Libraries/) and (C4::Context->preference('singleBranchMode')) );
                 }
             }
-        }
-    }
+        );
     return ( undef, $results_hashref, \@facets_loop );
 }
 
@@ -2816,24 +2862,53 @@ sub GetDistinctValues {
                }
                # The big moment: asynchronously retrieve results from all servers
                my @elements;
-               while ( ( my $i = ZOOM::event( \@zconns ) ) != 0 ) {
-                       my $ev = $zconns[ $i - 1 ]->last_event();
-                       if ( $ev == ZOOM::Event::ZEND ) {
-                               next unless $results[ $i - 1 ];
-                               my $size = $results[ $i - 1 ]->size();
-                               if ( $size > 0 ) {
-                      for (my $j=0;$j<$size;$j++){
-                                               my %hashscan;
-                                               @hashscan{qw(value cnt)}=$results[ $i - 1 ]->display_term($j);
-                                               push @elements, \%hashscan;
-                                         }
-                               }
-                       }
-               }
+        _ZOOM_event_loop(
+            \@zconns,
+            \@results,
+            sub {
+                my ( $i, $size ) = @_;
+                for ( my $j = 0 ; $j < $size ; $j++ ) {
+                    my %hashscan;
+                    @hashscan{qw(value cnt)} =
+                      $results[ $i - 1 ]->display_term($j);
+                    push @elements, \%hashscan;
+                }
+            }
+        );
                return \@elements;
    }
 }
 
+=head2 _ZOOM_event_loop
+
+    _ZOOM_event_loop(\@zconns, \@results, sub {
+        my ( $i, $size ) = @_;
+        ....
+    } );
+
+Processes a ZOOM event loop and passes control to a closure for
+processing the results, and destroying the resultsets.
+
+=cut
+
+sub _ZOOM_event_loop {
+    my ($zconns, $results, $callback) = @_;
+    while ( ( my $i = ZOOM::event( $zconns ) ) != 0 ) {
+        my $ev = $zconns->[ $i - 1 ]->last_event();
+        if ( $ev == ZOOM::Event::ZEND ) {
+            next unless $results->[ $i - 1 ];
+            my $size = $results->[ $i - 1 ]->size();
+            if ( $size > 0 ) {
+                $callback->($i, $size);
+            }
+        }
+    }
+
+    foreach my $result (@$results) {
+        $result->destroy();
+    }
+}
+
 
 END { }    # module clean-up code here (global destructor)
 
index cedbcff..0c4b60e 100644 (file)
@@ -93,7 +93,13 @@ sub GetSuppliersWithLateIssues {
     FROM            subscription
     LEFT JOIN       serial ON serial.subscriptionid=subscription.subscriptionid
     LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
-    WHERE id > 0 AND ((planneddate < now() AND serial.status=1) OR serial.STATUS = 3 OR serial.STATUS = 4) ORDER BY name|;
+    WHERE id > 0
+        AND (
+            (planneddate < now() AND serial.status=1)
+            OR serial.STATUS = 3 OR serial.STATUS = 4
+        )
+        AND subscription.closed = 0
+    ORDER BY name|;
     return $dbh->selectall_arrayref($query, { Slice => {} });
 }
 
@@ -122,6 +128,7 @@ sub GetLateIssues {
             LEFT JOIN  aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
             WHERE      ((planneddate < now() AND serial.STATUS =1) OR serial.STATUS = 3)
             AND        subscription.aqbooksellerid=?
+            AND        subscription.closed = 0
             ORDER BY   title
         |;
         $sth = $dbh->prepare($query);
@@ -134,6 +141,7 @@ 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.closed = 0
             ORDER BY   title
         |;
         $sth = $dbh->prepare($query);
@@ -662,8 +670,16 @@ sub SearchSubscriptions {
         push @where_args, $args->{biblionumber};
     }
     if( $args->{title} ){
-        push @where_strs, "biblio.title LIKE ?";
-        push @where_args, "%$args->{title}%";
+        my @words = split / /, $args->{title};
+        my (@strs, @args);
+        foreach my $word (@words) {
+            push @strs, "biblio.title LIKE ?";
+            push @args, "%$word%";
+        }
+        if (@strs) {
+            push @where_strs, '(' . join (' AND ', @strs) . ')';
+            push @where_args, @args;
+        }
     }
     if( $args->{issn} ){
         push @where_strs, "biblioitems.issn LIKE ?";
@@ -685,7 +701,10 @@ sub SearchSubscriptions {
         push @where_strs, "subscription.branchcode = ?";
         push @where_args, "$args->{branch}";
     }
-
+    if( defined $args->{closed} ){
+        push @where_strs, "subscription.closed = ?";
+        push @where_args, "$args->{closed}";
+    }
     if(@where_strs){
         $query .= " WHERE " . join(" AND ", @where_strs);
     }
@@ -2465,6 +2484,54 @@ sub is_barcode_in_use {
     return @{$occurences};
 }
 
+=head2 CloseSubscription
+Close a subscription given a subscriptionid
+=cut
+sub CloseSubscription {
+    my ( $subscriptionid ) = @_;
+    return unless $subscriptionid;
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare( qq{
+        UPDATE subscription
+        SET closed = 1
+        WHERE subscriptionid = ?
+    } );
+    $sth->execute( $subscriptionid );
+
+    # Set status = missing when status = stopped
+    $sth = $dbh->prepare( qq{
+        UPDATE serial
+        SET status = 8
+        WHERE subscriptionid = ?
+        AND status = 1
+    } );
+    $sth->execute( $subscriptionid );
+}
+
+=head2 ReopenSubscription
+Reopen a subscription given a subscriptionid
+=cut
+sub ReopenSubscription {
+    my ( $subscriptionid ) = @_;
+    return unless $subscriptionid;
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare( qq{
+        UPDATE subscription
+        SET closed = 0
+        WHERE subscriptionid = ?
+    } );
+    $sth->execute( $subscriptionid );
+
+    # Set status = expected when status = stopped
+    $sth = $dbh->prepare( qq{
+        UPDATE serial
+        SET status = 1
+        WHERE subscriptionid = ?
+        AND status = 8
+    } );
+    $sth->execute( $subscriptionid );
+}
+
 1;
 __END__
 
index d74dbf8..b6b319b 100644 (file)
@@ -26,9 +26,11 @@ use Exporter;
 use C4::Context;
 use C4::Debug;
 #use Data::Dumper;
+use constant TAG_FIELDS => qw(tag_id borrowernumber biblionumber term language date_created);
+use constant TAG_SELECT => "SELECT " . join(',', TAG_FIELDS) . "\n FROM   tags_all\n";
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
-use vars qw($ext_dict $select_all @fields);
+our $ext_dict;
 
 BEGIN {
     $VERSION = 3.07.00.049;
@@ -70,8 +72,6 @@ More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG"
 INIT {
     $ext_dict and $Lingua::Ispell::path = $ext_dict;
     $debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n";
-       @fields = qw(tag_id borrowernumber biblionumber term language date_created);
-       $select_all = "SELECT " . join(',',@fields) . "\n FROM   tags_all\n";
 }
 
 sub get_filters {
@@ -181,7 +181,7 @@ sub delete_tag_rows_by_ids {
 
 sub get_tag_rows {
        my $hash = shift || {};
-       my @ok_fields = @fields;
+    my @ok_fields = TAG_FIELDS;
        push @ok_fields, 'limit';       # push the limit! :)
        my $wheres;
        my $limit  = "";
@@ -208,7 +208,7 @@ sub get_tag_rows {
                        push @exe_args, $hash->{$key};
                }
        }
-       my $query = $select_all . ($wheres||'') . $limit;
+    my $query = TAG_SELECT . ($wheres||'') . $limit;
        $debug and print STDERR "get_tag_rows query:\n $query\n",
                                                        "get_tag_rows query args: ", join(',', @exe_args), "\n";
        my $sth = C4::Context->dbh->prepare($query);
@@ -491,7 +491,7 @@ sub add_tag_index {
 
 sub get_tag {          # by tag_id
        (@_) or return;
-       my $sth = C4::Context->dbh->prepare("$select_all WHERE tag_id = ?");
+    my $sth = C4::Context->dbh->prepare(TAG_SELECT . "WHERE tag_id = ?");
        $sth->execute(shift);
        return $sth->fetchrow_hashref;
 }
index 5682a15..0bb4b56 100644 (file)
@@ -266,11 +266,12 @@ sub GetShelfContents {
         ($sortfield) = $sth2->fetchrow_array;
     }
     my $query =
-       " SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
+       " SELECT DISTINCT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
             biblio.*, biblioitems.itemtype, biblioitems.publicationyear as year, biblioitems.publishercode, biblioitems.place, biblioitems.size, biblioitems.pages
          FROM   virtualshelfcontents vc
          JOIN biblio      ON      vc.biblionumber =      biblio.biblionumber
          LEFT JOIN biblioitems ON  biblio.biblionumber = biblioitems.biblionumber
+         LEFT JOIN items ON items.biblionumber=vc.biblionumber
          LEFT JOIN itemtypes   ON biblioitems.itemtype = itemtypes.itemtype
          WHERE  vc.shelfnumber=? ";
     my @params = ($shelfnumber);
@@ -460,7 +461,7 @@ sub ShelfPossibleAction {
 
     my $dbh = C4::Context->dbh;
     my $query = qq/
-        SELECT IFNULL(owner,0) AS owner, category, allow_add, allow_delete_own, allow_delete_other, IFNULL(sh.borrowernumber,0) AS borrowernumber
+        SELECT COALESCE(owner,0) AS owner, category, allow_add, allow_delete_own, allow_delete_other, COALESCE(sh.borrowernumber,0) AS borrowernumber
         FROM virtualshelves vs
         LEFT JOIN virtualshelfshares sh ON sh.shelfnumber=vs.shelfnumber
         AND sh.borrowernumber=?
index 988244c..6a4d431 100644 (file)
@@ -214,7 +214,6 @@ sub shelfpage {
                 my $member = GetMember( 'borrowernumber' => $owner );
                 my $ownername = defined($member) ? $member->{firstname} . " " . $member->{surname} : '';
                 $edit = 1;
-                $sortfield='' unless $sortfield;
                 $template->param(
                     edit                => 1,
                     display             => $displaymode,
@@ -224,7 +223,7 @@ sub shelfpage {
                     ownername           => $ownername,
                     "category$category" => 1,
                     category            => $category,
-                    "sort_$sortfield"   => 1,
+                    sortfield           => $sortfield,
                     allow_add           => $allow_add,
                     allow_delete_own    => $allow_delete_own,
                     allow_delete_other  => $allow_delete_other,
@@ -248,17 +247,9 @@ sub shelfpage {
             #check that the user can view the shelf
             if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) {
                 my $items;
-                my $authorsort;
-                my $yearsort;
                 my $tag_quantity;
                 my $sortfield = ( $sorton ? $sorton : 'title' );
-                if ( $sortfield eq 'author' ) {
-                    $authorsort = 'author';
-                }
-                if ( $sortfield eq 'year' ) {
-                    $yearsort = 'year';
-                }
-                ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield eq 'year' ? 'copyrightdate' : $sortfield );
+                ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield );
                 for my $this_item (@$items) {
                     my $biblionumber = $this_item->{'biblionumber'};
                     my $record = GetMarcBiblio($biblionumber);
@@ -302,8 +293,7 @@ sub shelfpage {
                     shelfname           => $shelfname,
                     shelfnumber         => $shelfnumber,
                     viewshelf           => $shelfnumber,
-                    authorsort          => $authorsort,
-                    yearsort            => $yearsort,
+                    sortfield           => $sortfield,
                     manageshelf         => $manageshelf,
                     allowremovingitems  => ShelfPossibleAction( $loggedinuser, $shelfnumber, 'delete'),
                     allowaddingitem     => ShelfPossibleAction( $loggedinuser, $shelfnumber, 'add'),
@@ -412,14 +402,6 @@ sub shelfpage {
         my $category  = $shelflist->{$element}->{'category'};
         my $owner     = $shelflist->{$element}->{'owner'}||0;
         my $canmanage = ShelfPossibleAction( $loggedinuser, $element, 'manage' );
-        my $sortfield = $shelflist->{$element}->{'sortfield'};
-        if ( $sortfield ){
-            if ( $sortfield eq 'author' ) {
-                $shelflist->{$element}->{"authorsort"} = 'author';
-            } elsif ( $sortfield eq 'year' ) {
-                $shelflist->{$element}->{"yearsort"} = 'year';
-            }
-        }
         $shelflist->{$element}->{"viewcategory$category"} = 1;
         $shelflist->{$element}->{manageshelf} = $canmanage;
         if($canmanage || ($loggedinuser && $owner==$loggedinuser)) {
diff --git a/Koha/Borrower/Modifications.pm b/Koha/Borrower/Modifications.pm
new file mode 100644 (file)
index 0000000..1d32d16
--- /dev/null
@@ -0,0 +1,322 @@
+package Koha::Borrower::Modifications;
+
+# Copyright 2012 ByWater Solutions
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 NAME
+
+C4::Borrowers::Modifications
+
+=cut
+
+use Modern::Perl;
+
+use C4::Context;
+use C4::Debug;
+use C4::SQLHelper qw(InsertInTable UpdateInTable);
+
+sub new {
+    my ( $class, %args ) = @_;
+
+    return bless( \%args, $class );
+}
+
+=head2 AddModifications
+
+Koha::Borrower::Modifications->AddModifications( $data );
+
+Adds or updates modifications for a borrower.
+
+Requires either the key borrowernumber, or verification_token
+to be part of the passed in hash.
+
+=cut
+
+sub AddModifications {
+    my ( $self, $data ) = @_;
+
+    if ( $self->{'borrowernumber'} ) {
+        delete $data->{'borrowernumber'};
+
+        if ( keys %$data ) {
+            $data->{'borrowernumber'} = $self->{'borrowernumber'};
+            my $dbh = C4::Context->dbh;
+
+            my $query = "
+                SELECT COUNT(*) AS count
+                FROM borrower_modifications
+                WHERE borrowernumber = ?
+            ";
+
+            my $sth = $dbh->prepare($query);
+            $sth->execute( $self->{'borrowernumber'} );
+            my $result = $sth->fetchrow_hashref();
+
+            if ( $result->{'count'} ) {
+                $data->{'verification_token'} = q{};
+                return UpdateInTable( "borrower_modifications", $data );
+            }
+            else {
+                return InsertInTable( "borrower_modifications", $data );
+            }
+        }
+
+    }
+    elsif ( $self->{'verification_token'} ) {
+        delete $data->{'borrowernumber'};
+        $data->{'verification_token'} = $self->{'verification_token'};
+
+        return InsertInTable( "borrower_modifications", $data );
+    }
+    else {
+        return;
+    }
+}
+
+=head2 Verify
+
+$verified = Koha::Borrower::Modifications->Verify( $verification_token );
+
+Returns true if the passed in token is valid.
+
+=cut
+
+sub Verify {
+    my ( $self, $verification_token ) = @_;
+
+    $verification_token =
+      ($verification_token)
+      ? $verification_token
+      : $self->{'verification_token'};
+
+    my $dbh   = C4::Context->dbh;
+    my $query = "
+        SELECT COUNT(*) AS count
+        FROM borrower_modifications
+        WHERE verification_token = ?
+    ";
+    my $sth = $dbh->prepare($query);
+    $sth->execute($verification_token);
+    my $result = $sth->fetchrow_hashref();
+
+    return $result->{'count'};
+}
+
+=head2 GetPendingModificationsCount
+
+$count = Koha::Borrower::Modifications->GetPendingModificationsCount();
+
+Returns the number of pending modifications for existing borrowers.
+=cut
+
+sub GetPendingModificationsCount {
+    my ( $self, $branchcode ) = @_;
+
+    my $dbh   = C4::Context->dbh;
+    my $query = "
+        SELECT COUNT(*) AS count
+        FROM borrower_modifications, borrowers
+        WHERE borrower_modifications.borrowernumber > 0
+        AND borrower_modifications.borrowernumber = borrowers.borrowernumber
+    ";
+
+    my @params;
+    if ($branchcode) {
+        $query .= " AND borrowers.branchcode = ? ";
+        push( @params, $branchcode );
+    }
+
+    my $sth = $dbh->prepare($query);
+    $sth->execute(@params);
+    my $result = $sth->fetchrow_hashref();
+
+    return $result->{'count'};
+}
+
+=head2 GetPendingModifications
+
+$arrayref = Koha::Borrower::Modifications->GetPendingModifications();
+
+Returns an arrayref of hashrefs for all pending modifications for existing borrowers.
+
+=cut
+
+sub GetPendingModifications {
+    my ( $self, $branchcode ) = @_;
+
+    my $dbh   = C4::Context->dbh;
+    my $query = "
+        SELECT borrower_modifications.*
+        FROM borrower_modifications, borrowers
+        WHERE borrower_modifications.borrowernumber > 0
+        AND borrower_modifications.borrowernumber = borrowers.borrowernumber
+    ";
+
+    my @params;
+    if ($branchcode) {
+        $query .= " AND borrowers.branchcode = ? ";
+        push( @params, $branchcode );
+    }
+    $query .= " ORDER BY borrowers.surname, borrowers.firstname";
+    my $sth = $dbh->prepare($query);
+    $sth->execute(@params);
+
+    my @m;
+    while ( my $row = $sth->fetchrow_hashref() ) {
+        foreach my $key ( keys %$row ) {
+            delete $row->{$key} unless defined $row->{$key};
+        }
+
+        push( @m, $row );
+    }
+
+    return \@m;
+}
+
+=head2 ApproveModifications
+
+Koha::Borrower::Modifications->ApproveModifications( $borrowernumber );
+
+Commits the pending modifications to the borrower record and removes
+them from the modifications table.
+
+=cut
+
+sub ApproveModifications {
+    my ( $self, $borrowernumber ) = @_;
+
+    $borrowernumber =
+      ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
+
+    return unless $borrowernumber;
+
+    my $data = $self->GetModifications({ borrowernumber => $borrowernumber });
+
+    if ( UpdateInTable( "borrowers", $data ) ) {
+        $self->DelModifications({ borrowernumber => $borrowernumber });
+    }
+}
+
+=head2 DenyModifications
+
+Koha::Borrower::Modifications->DenyModifications( $borrowernumber );
+
+Removes the modifications from the table for the given borrower,
+without commiting the changes to the borrower record.
+
+=cut
+
+sub DenyModifications {
+    my ( $self, $borrowernumber ) = @_;
+
+    $borrowernumber =
+      ($borrowernumber) ? $borrowernumber : $self->{'borrowernumber'};
+
+    return unless $borrowernumber;
+
+    return $self->DelModifications({ borrowernumber => $borrowernumber });
+}
+
+=head2 DelModifications
+
+Koha::Borrower::Modifications->DelModifications({
+  [ borrowernumber => $borrowernumber ],
+  [ verification_token => $verification_token ]
+});
+
+Deletes the modifications for the given borrowernumber or verification token.
+
+=cut
+
+sub DelModifications {
+    my ( $self, $params ) = @_;
+
+    my ( $field, $value );
+
+    if ( $params->{'borrowernumber'} ) {
+        $field = 'borrowernumber';
+        $value = $params->{'borrowernumber'};
+    }
+    elsif ( $params->{'verification_token'} ) {
+        $field = 'verification_token';
+        $value = $params->{'verification_token'};
+    }
+
+    return unless $value;
+
+    my $dbh = C4::Context->dbh;
+
+    $field = $dbh->quote_identifier($field);
+
+    my $query = "
+        DELETE
+        FROM borrower_modifications
+        WHERE $field = ?
+    ";
+
+    my $sth = $dbh->prepare($query);
+    return $sth->execute($value);
+}
+
+=head2 GetModifications
+
+$hashref = Koha::Borrower::Modifications->GetModifications({
+  [ borrowernumber => $borrowernumber ],
+  [ verification_token => $verification_token ]
+});
+
+Gets the modifications for the given borrowernumber or verification token.
+
+=cut
+
+sub GetModifications {
+    my ( $self, $params ) = @_;
+
+    my ( $field, $value );
+
+    if ( defined( $params->{'borrowernumber'} ) ) {
+        $field = 'borrowernumber';
+        $value = $params->{'borrowernumber'};
+    }
+    elsif ( defined( $params->{'verification_token'} ) ) {
+        $field = 'verification_token';
+        $value = $params->{'verification_token'};
+    }
+
+    return unless $value;
+
+    my $dbh = C4::Context->dbh;
+
+    $field = $dbh->quote_identifier($field);
+
+    my $query = "
+        SELECT *
+        FROM borrower_modifications
+        WHERE $field = ?
+    ";
+
+    my $sth = $dbh->prepare($query);
+    $sth->execute($value);
+    my $data = $sth->fetchrow_hashref();
+
+    foreach my $key ( keys %$data ) {
+        delete $data->{$key} unless ( defined( $data->{$key} ) );
+    }
+
+    return $data;
+}
+
+1;
index ca9e4f0..6c6e186 100644 (file)
@@ -523,6 +523,7 @@ if ($config{'INSTALL_ZEBRA'} eq "yes") {
     push @{ $pl_files->{'rewrite-config.PL'} }, (
         'blib/SCRIPT_DIR/koha-zebra-ctl.sh',
         'blib/SCRIPT_DIR/koha-pazpar2-ctl.sh',
+        'blib/SCRIPT_DIR/koha-index-daemon-ctl.sh',
     );
     if ($config{'INSTALL_PAZPAR2'} eq 'yes') {
         push @{ $pl_files->{'rewrite-config.PL'} }, (
index 17c2d5e..f25b5a9 100755 (executable)
@@ -38,8 +38,6 @@ It permit to write a new order as 'received'.
 
 to know on what supplier this script has to display receive order.
 
-=item receive
-
 =item invoiceid
 
 the id of this invoice.
@@ -88,12 +86,12 @@ my $booksellerid   = $invoice->{booksellerid};
 my $freight      = $invoice->{shipmentcost};
 my $datereceived = $invoice->{shipmentdate};
 my $ordernumber  = $input->param('ordernumber');
-my $search       = $input->param('receive');
 
 $datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
 
 my $bookseller = GetBookSellerFromId($booksellerid);
-my $results = SearchOrder($ordernumber,$search);
+my $results;
+$results = SearchOrder($ordernumber) if $ordernumber;
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
@@ -106,148 +104,129 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
-my $count = scalar @$results;
+unless ( $results and @$results) {
+    output_html_with_http_headers $input, $cookie, $template->output;
+    exit;
+}
+
 # prepare the form for receiving
-if ( $count == 1 ) {
-    my $order = $results->[0];
+my $order = $results->[0];
 
-    # Check if ACQ framework exists
-    my $acq_fw = GetMarcStructure(1, 'ACQ');
-    unless($acq_fw) {
-        $template->param('NoACQframework' => 1);
-    }
+# Check if ACQ framework exists
+my $acq_fw = GetMarcStructure(1, 'ACQ');
+unless($acq_fw) {
+    $template->param('NoACQframework' => 1);
+}
 
-    my $AcqCreateItem = C4::Context->preference('AcqCreateItem');
-    if ($AcqCreateItem eq 'receiving') {
-        $template->param(
-            AcqCreateItemReceiving => 1,
-            UniqueItemFields => C4::Context->preference('UniqueItemFields'),
-        );
-    } elsif ($AcqCreateItem eq 'ordering') {
-        my $fw = ($acq_fw) ? 'ACQ' : '';
-        my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
-        my @items;
-        foreach (@itemnumbers) {
-            my $item = GetItem($_);
-            if($item->{homebranch}) {
-                $item->{homebranchname} = GetBranchName($item->{homebranch});
-            }
-            if($item->{holdingbranch}) {
-                $item->{holdingbranchname} = GetBranchName($item->{holdingbranch});
-            }
-            if(my $code = GetAuthValCode("items.notforloan", $fw)) {
-                $item->{notforloan} = GetKohaAuthorisedValueLib($code, $item->{notforloan});
-            }
-            if(my $code = GetAuthValCode("items.restricted", $fw)) {
-                $item->{restricted} = GetKohaAuthorisedValueLib($code, $item->{restricted});
-            }
-            if(my $code = GetAuthValCode("items.location", $fw)) {
-                $item->{location} = GetKohaAuthorisedValueLib($code, $item->{location});
-            }
-            if(my $code = GetAuthValCode("items.ccode", $fw)) {
-                $item->{collection} = GetKohaAuthorisedValueLib($code, $item->{ccode});
-            }
-            if(my $code = GetAuthValCode("items.materials", $fw)) {
-                $item->{materials} = GetKohaAuthorisedValueLib($code, $item->{materials});
-            }
-            my $itemtype = getitemtypeinfo($item->{itype});
-            $item->{itemtype} = $itemtype->{description};
-            push @items, $item;
+my $AcqCreateItem = C4::Context->preference('AcqCreateItem');
+if ($AcqCreateItem eq 'receiving') {
+    $template->param(
+        AcqCreateItemReceiving => 1,
+        UniqueItemFields => C4::Context->preference('UniqueItemFields'),
+    );
+} elsif ($AcqCreateItem eq 'ordering') {
+    my $fw = ($acq_fw) ? 'ACQ' : '';
+    my @itemnumbers = GetItemnumbersFromOrder($order->{ordernumber});
+    my @items;
+    foreach (@itemnumbers) {
+        my $item = GetItem($_);
+        if($item->{homebranch}) {
+            $item->{homebranchname} = GetBranchName($item->{homebranch});
         }
-        $template->param(items => \@items);
-    }
-
-    $order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
-    $order->{unitprice} = '' if $order->{unitprice} == 0;
-
-    my $rrp;
-    my $ecost;
-    my $unitprice;
-    if ( $bookseller->{listincgst} ) {
-        if ( $bookseller->{invoiceincgst} ) {
-            $rrp = $order->{rrp};
-            $ecost = $order->{ecost};
-            $unitprice = $order->{unitprice};
-        } else {
-            $rrp = $order->{rrp} / ( 1 + $order->{gstrate} );
-            $ecost = $order->{ecost} / ( 1 + $order->{gstrate} );
-            $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} );
+        if($item->{holdingbranch}) {
+            $item->{holdingbranchname} = GetBranchName($item->{holdingbranch});
         }
-    } else {
-        if ( $bookseller->{invoiceincgst} ) {
-            $rrp = $order->{rrp} * ( 1 + $order->{gstrate} );
-            $ecost = $order->{ecost} * ( 1 + $order->{gstrate} );
-            $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} );
-        } else {
-            $rrp = $order->{rrp};
-            $ecost = $order->{ecost};
-            $unitprice = $order->{unitprice};
+        if(my $code = GetAuthValCode("items.notforloan", $fw)) {
+            $item->{notforloan} = GetKohaAuthorisedValueLib($code, $item->{notforloan});
         }
-     }
-
-    my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
-
-    my $authorisedby = $order->{authorisedby};
-    my $member = GetMember( borrowernumber => $authorisedby );
-
-    my $budget = GetBudget( $order->{budget_id} );
-
-    $template->param(
-        AcqCreateItem         => $AcqCreateItem,
-        count                 => 1,
-        biblionumber          => $order->{'biblionumber'},
-        ordernumber           => $order->{'ordernumber'},
-        biblioitemnumber      => $order->{'biblioitemnumber'},
-        booksellerid          => $order->{'booksellerid'},
-        freight               => $freight,
-        gstrate               => $order->{gstrate} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0,
-        name                  => $bookseller->{'name'},
-        date                  => format_date($order->{entrydate}),
-        title                 => $order->{'title'},
-        author                => $order->{'author'},
-        copyrightdate         => $order->{'copyrightdate'},
-        isbn                  => $order->{'isbn'},
-        seriestitle           => $order->{'seriestitle'},
-        bookfund              => $budget->{budget_name},
-        quantity              => $order->{'quantity'},
-        quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
-        quantityreceived      => $order->{'quantityreceived'},
-        rrp                   => sprintf( "%.2f", $rrp ),
-        ecost                 => sprintf( "%.2f", $ecost ),
-        unitprice             => sprintf( "%.2f", $unitprice),
-        memberfirstname       => $member->{firstname} || "",
-        membersurname         => $member->{surname} || "",
-        invoiceid             => $invoice->{invoiceid},
-        invoice               => $invoice->{invoicenumber},
-        datereceived          => $datereceived->output(),
-        datereceived_iso      => $datereceived->output('iso'),
-        notes                 => $order->{notes},
-        suggestionid          => $suggestion->{suggestionid},
-        surnamesuggestedby    => $suggestion->{surnamesuggestedby},
-        firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
-    );
+        if(my $code = GetAuthValCode("items.restricted", $fw)) {
+            $item->{restricted} = GetKohaAuthorisedValueLib($code, $item->{restricted});
+        }
+        if(my $code = GetAuthValCode("items.location", $fw)) {
+            $item->{location} = GetKohaAuthorisedValueLib($code, $item->{location});
+        }
+        if(my $code = GetAuthValCode("items.ccode", $fw)) {
+            $item->{collection} = GetKohaAuthorisedValueLib($code, $item->{ccode});
+        }
+        if(my $code = GetAuthValCode("items.materials", $fw)) {
+            $item->{materials} = GetKohaAuthorisedValueLib($code, $item->{materials});
+        }
+        my $itemtype = getitemtypeinfo($item->{itype});
+        $item->{itemtype} = $itemtype->{description};
+        push @items, $item;
+    }
+    $template->param(items => \@items);
 }
-else {
-    my @loop;
-    for ( my $i = 0 ; $i < $count ; $i++ ) {
-        my %line = %{ @$results[$i] };
-
-        $line{invoice}      = $invoice->{invoicenumber};
-        $line{datereceived} = $datereceived->output();
-        $line{freight}      = $freight;
-        $line{gstrate}      = @$results[$i]->{'gstrate'} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
-        $line{title}        = @$results[$i]->{'title'};
-        $line{author}       = @$results[$i]->{'author'};
-        $line{booksellerid} = $booksellerid;
-        push @loop, \%line;
+
+$order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
+$order->{unitprice} = '' if $order->{unitprice} == 0;
+
+my $rrp;
+my $ecost;
+my $unitprice;
+if ( $bookseller->{listincgst} ) {
+    if ( $bookseller->{invoiceincgst} ) {
+        $rrp = $order->{rrp};
+        $ecost = $order->{ecost};
+        $unitprice = $order->{unitprice};
+    } else {
+        $rrp = $order->{rrp} / ( 1 + $order->{gstrate} );
+        $ecost = $order->{ecost} / ( 1 + $order->{gstrate} );
+        $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} );
+    }
+} else {
+    if ( $bookseller->{invoiceincgst} ) {
+        $rrp = $order->{rrp} * ( 1 + $order->{gstrate} );
+        $ecost = $order->{ecost} * ( 1 + $order->{gstrate} );
+        $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} );
+    } else {
+        $rrp = $order->{rrp};
+        $ecost = $order->{ecost};
+        $unitprice = $order->{unitprice};
     }
+ }
+
+my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
+
+my $authorisedby = $order->{authorisedby};
+my $member = GetMember( borrowernumber => $authorisedby );
+
+my $budget = GetBudget( $order->{budget_id} );
+
+$template->param(
+    AcqCreateItem         => $AcqCreateItem,
+    count                 => 1,
+    biblionumber          => $order->{'biblionumber'},
+    ordernumber           => $order->{'ordernumber'},
+    biblioitemnumber      => $order->{'biblioitemnumber'},
+    booksellerid          => $order->{'booksellerid'},
+    freight               => $freight,
+    name                  => $bookseller->{'name'},
+    date                  => format_date($order->{entrydate}),
+    title                 => $order->{'title'},
+    author                => $order->{'author'},
+    copyrightdate         => $order->{'copyrightdate'},
+    isbn                  => $order->{'isbn'},
+    seriestitle           => $order->{'seriestitle'},
+    bookfund              => $budget->{budget_name},
+    quantity              => $order->{'quantity'},
+    quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
+    quantityreceived      => $order->{'quantityreceived'},
+    rrp                   => sprintf( "%.2f", $rrp ),
+    ecost                 => sprintf( "%.2f", $ecost ),
+    unitprice             => sprintf( "%.2f", $unitprice),
+    memberfirstname       => $member->{firstname} || "",
+    membersurname         => $member->{surname} || "",
+    invoiceid             => $invoice->{invoiceid},
+    invoice               => $invoice->{invoicenumber},
+    datereceived          => $datereceived->output(),
+    datereceived_iso      => $datereceived->output('iso'),
+    notes                 => $order->{notes},
+    suggestionid          => $suggestion->{suggestionid},
+    surnamesuggestedby    => $suggestion->{surnamesuggestedby},
+    firstnamesuggestedby  => $suggestion->{firstnamesuggestedby},
+);
 
-    $template->param(
-        loop         => \@loop,
-        booksellerid => $booksellerid,
-        invoiceid    => $invoice->{invoiceid},
-    );
-}
 my $op = $input->param('op');
 if ($op and $op eq 'edit'){
     $template->param(edit   =>   1);
index 0e0f41b..15578a9 100755 (executable)
@@ -333,7 +333,6 @@ $template->param(
     booksellerid          => $bookseller->{id},
     countreceived         => $countlines,
     loop_received         => \@loop_received,
-    booksellerid          => $booksellerid,
     loop_orders           => \@loop_orders,
     book_foot_loop        => \@book_foot_loop,
     totalprice            => sprintf($cfstr, $totalprice),
index 68cd0d6..37ebe2c 100755 (executable)
@@ -25,32 +25,15 @@ use CGI;
 
 use C4::Auth;
 use C4::Output;
-use C4::Biblio;
 use C4::Context;
 use C4::Breeding;
 use C4::Koha;
-use C4::Charset;
 use C4::Bookseller qw/ GetBookSellerFromId /;
-use ZOOM;
-
-my $input        = new CGI;
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-    {
-        template_name   => "acqui/z3950_search.tmpl",
-        query           => $input,
-        type            => "intranet",
-        authnotrequired => 1,
-        flagsrequired   => { acquisition => 'order_manage' },
-        debug           => 1,
-    }
-);
-
 
+my $input           = new CGI;
 my $dbh             = C4::Context->dbh;
-my $error           = $input->param('error');
-my $biblionumber    = $input->param('biblionumber');
-$biblionumber       = 0 unless $biblionumber;
-my $frameworkcode   = $input->param('frameworkcode');
+my $biblionumber    = $input->param('biblionumber')||0;
+my $frameworkcode   = $input->param('frameworkcode')||'';
 my $title           = $input->param('title');
 my $author          = $input->param('author');
 my $isbn            = $input->param('isbn');
@@ -60,40 +43,11 @@ my $lccall          = $input->param('lccall');
 my $subject         = $input->param('subject');
 my $dewey           = $input->param('dewey');
 my $controlnumber   = $input->param('controlnumber');
-my $op              = $input->param('op');
+my $op              = $input->param('op')||'';
 my $booksellerid    = $input->param('booksellerid');
 my $basketno        = $input->param('basketno');
-
 my $page            = $input->param('current_page') || 1;
 $page               = $input->param('goto_page') if $input->param('changepage_goto');
-my $show_next       = 0;
-my $total_pages     = 0;
-
-my $noconnection;
-my $attr = '';
-my $term;
-my $host;
-my $server;
-my $database;
-my $port;
-my $marcdata;
-my @encoding;
-my @results;
-my $count;
-my $toggle;
-my $record;
-my $oldbiblio;
-my $errmsg;
-my @serverhost;
-my @servername;
-my @breeding_loop = ();
-my $random        = $input->param('random');
-unless ($random)
-{    # this var is not useful anymore just kept to keep rel2_2 compatibility
-    $random = rand(1000000000);
-}
-
-my $DEBUG = $ENV{DEBUG} || 0;    # if set to 1, many debug message are send on syslog.
 
 # get framework list
 my $frameworks = getframeworks;
@@ -110,25 +64,32 @@ foreach my $thisframeworkcode ( keys %$frameworks ) {
 }
 
 my $vendor = GetBookSellerFromId($booksellerid);
-$template->param( frameworkcode => $frameworkcode, 
-                                    frameworkcodeloop => \@frameworkcodeloop,
-                                    booksellerid => $booksellerid,
-                                    basketno => $basketno,
-                                    name => $vendor->{'name'}
-                                    );
-                                    
 
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "acqui/z3950_search.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 1,
+        flagsrequired   => { acquisition => 'order_manage' },
+    }
+);
 $template->param(
-    isbn         => $isbn,
-    issn         => $issn,
-    lccn         => $lccn,
-    lccall       => $lccall,
-    title        => $title,
-    author       => $author,
-    controlnumber=> $controlnumber,
-    biblionumber => $biblionumber,
-    dewey        => $dewey,
-    subject      => $subject,
+        frameworkcode => $frameworkcode,
+        frameworkcodeloop => \@frameworkcodeloop,
+        booksellerid => $booksellerid,
+        basketno     => $basketno,
+        name         => $vendor->{'name'},
+        isbn         => $isbn,
+        issn         => $issn,
+        lccn         => $lccn,
+        lccall       => $lccall,
+        title        => $title,
+        author       => $author,
+        controlnumber=> $controlnumber,
+        biblionumber => $biblionumber,
+        dewey        => $dewey,
+        subject      => $subject,
 );
 
 if ( $op ne "do_search" ) {
@@ -143,214 +104,27 @@ if ( $op ne "do_search" ) {
     exit;
 }
 
-    my @id = $input->param('id');
-
-    if ( not @id ) {
-        # empty server list -> report and exit
-        $template->param( emptyserverlist => 1 );
-        output_html_with_http_headers $input, $cookie, $template->output;
-        exit;
-    }
-
-    my @oConnection;
-    my @oResult;
-    my @errconn;
-    my $s = 0;
-    my $query;
-    my $nterms;
-    if ($isbn) {
-        $term=$isbn;
-        $query .= " \@attr 1=7 \@attr 5=1 \"$term\" ";
-        $nterms++;
-    }
-    if ($issn) {
-        $term=$issn;
-        $query .= " \@attr 1=8 \@attr 5=1 \"$term\" ";
-        $nterms++;
-    }
-    if ($title) {
-        utf8::decode($title);
-        $query .= " \@attr 1=4 \"$title\" ";
-        $nterms++;
-    }
-    if ($author) {
-        utf8::decode($author);
-        $query .= " \@attr 1=1003 \"$author\" ";
-        $nterms++;
-    }
-    if ($dewey) {
-        $query .= " \@attr 1=16 \"$dewey\" ";
-        $nterms++;
-    }
-    if ($subject) {
-        utf8::decode($subject);
-        $query .= " \@attr 1=21 \"$subject\" ";
-        $nterms++;
-    }
-    if ($lccn) {
-        $query .= " \@attr 1=9 $lccn ";
-        $nterms++;
-    }
-    if ($lccall) {
-        $query .= " \@attr 1=16 \@attr 2=3 \@attr 3=1 \@attr 4=1 \@attr 5=1 \@attr 6=1 \"$lccall\" ";
-        $nterms++;
-    }
-    if ($controlnumber) {
-        $query .= " \@attr 1=12 \"$controlnumber\" ";
-        $nterms++;
-    }
-for my $i (1..$nterms-1) {
-    $query = "\@and " . $query;
+my @id = $input->param('id');
+if (@id==0) {
+    $template->param( emptyserverlist => 1 );
+    output_html_with_http_headers $input, $cookie, $template->output;
+    exit;
 }
-warn "query ".$query  if $DEBUG;
-
-    foreach my $servid (@id) {
-        my $sth = $dbh->prepare("select * from z3950servers where id=?");
-        $sth->execute($servid);
-        while ( $server = $sth->fetchrow_hashref ) {
-            warn "serverinfo ".join(':',%$server) if $DEBUG;
-            my $option1      = new ZOOM::Options();
-            $option1->option( 'async' => 1 );
-            $option1->option( 'elementSetName', 'F' );
-            $option1->option( 'databaseName',   $server->{db} );
-            $option1->option( 'user', $server->{userid} ) if $server->{userid};
-            $option1->option( 'password', $server->{password} )
-              if $server->{password};
-            $option1->option( 'preferredRecordSyntax', $server->{syntax} );
-            $oConnection[$s] = create ZOOM::Connection($option1)
-              || $DEBUG
-              && warn( "" . $oConnection[$s]->errmsg() );
-            warn( "server data", $server->{name}, $server->{port} ) if $DEBUG;
-            $oConnection[$s]->connect( $server->{host}, $server->{port} )
-              || $DEBUG
-              && warn( "" . $oConnection[$s]->errmsg() );
-            $serverhost[$s] = $server->{host};
-            $servername[$s] = $server->{name};
-            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
-            $s++;
-        }    ## while fetch
-    }    # foreach
-    my $nremaining  = $s;
-    my $firstresult = 1;
-
-    for ( my $z = 0 ; $z < $s ; $z++ ) {
-        warn "doing the search" if $DEBUG;
-        $oResult[$z] = $oConnection[$z]->search_pqf($query)
-          || $DEBUG
-          && warn( "somthing went wrong: " . $oConnection[$s]->errmsg() );
-
-        # $oResult[$z] = $oConnection[$z]->search_pqf($query);
-    }
-
-  warn "# nremaining = $nremaining\n" if $DEBUG;
-
-  while ( $nremaining-- ) {
-
-    my $k;
-    my $event;
-    while ( ( $k = ZOOM::event( \@oConnection ) ) != 0 ) {
-        $event = $oConnection[ $k - 1 ]->last_event();
-        warn( "connection ", $k - 1, ": event $event (",
-            ZOOM::event_str($event), ")\n" )
-          if $DEBUG;
-        last if $event == ZOOM::Event::ZEND;
-    }
 
-    if ( $k != 0 ) {
-        $k--;
-        warn "event from $k server = ",$serverhost[$k] if $DEBUG;
-        my ( $error, $errmsg, $addinfo, $diagset ) =
-          $oConnection[$k]->error_x();
-        if ($error) {
-            if ($error =~ m/^(10000|10007)$/ ) {
-                push(@errconn, {'server' => $serverhost[$k]});
-            }
-            $DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n";
-        }
-        else {
-            my $numresults = $oResult[$k]->size();
-            warn "numresults = $numresults" if $DEBUG;
-            my $i;
-            my $result = '';
-            if ( $numresults > 0  and $numresults >= (($page-1)*20)) {
-                $show_next = 1 if $numresults >= ($page*20);
-                $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
-                for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
-                    my $rec = $oResult[$k]->record($i);
-                    if ($rec) {
-                        my $marcrecord;
-                        $marcdata   = $rec->raw();
-
-                        my ($charset_result, $charset_errors);
-                        ($marcrecord, $charset_result, $charset_errors) = 
-                          MarcToUTF8Record($marcdata, C4::Context->preference('marcflavour'), $encoding[$k]);
-####WARNING records coming from Z3950 clients are in various character sets MARC8,UTF8,UNIMARC etc
-## In HEAD i change everything to UTF-8
-# In rel2_2 i am not sure what encoding is so no character conversion is done here
-##Add necessary encoding changes to here -TG
-
-                        # Normalize the record so it doesn't have separated diacritics
-                        SetUTF8Flag($marcrecord);
-
-                        my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
-                        $oldbiblio->{isbn}   =~ s/ |-|\.//g if $oldbiblio->{isbn};
-                        # pad | and ( with spaces to allow line breaks in the HTML
-                        $oldbiblio->{isbn} =~ s/\|/ \| /g if $oldbiblio->{isbn};
-                        $oldbiblio->{isbn} =~ s/\(/ \(/g if $oldbiblio->{isbn};
-
-                        $oldbiblio->{issn} =~ s/ |-|\.//g if $oldbiblio->{issn};
-                        # pad | and ( with spaces to allow line breaks in the HTML
-                        $oldbiblio->{issn} =~ s/\|/ \| /g if $oldbiblio->{issn};
-                        $oldbiblio->{issn} =~ s/\(/ \(/g if $oldbiblio->{issn};
-                          my (
-                            $notmarcrecord, $alreadyindb, $alreadyinfarm,
-                            $imported,      $breedingid
-                          )
-                          = ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' );
-                        my %row_data;
-                        $row_data{server}       = $servername[$k];
-                        $row_data{isbn}         = $oldbiblio->{isbn};
-                        $row_data{lccn}         = $oldbiblio->{lccn};
-                        $row_data{title}        = $oldbiblio->{title};
-                        $row_data{author}       = $oldbiblio->{author};
-                        $row_data{breedingid}   = $breedingid;
-                        $row_data{biblionumber} = $biblionumber;
-                        push( @breeding_loop, \%row_data );
-
-                    } else {
-                        push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1});
-                    } # $rec
-                }    # upto 5 results
-            }    #$numresults
-        }
-    }    # if $k !=0
-    my $numberpending = $nremaining - 1;
-
-    my @servers = ();
-    foreach my $id (@id) {
-        push(@servers,{id => $id});
-    }
-
-    $template->param(
-        breeding_loop => \@breeding_loop,
-        server        => $servername[$k],
-        numberpending => $numberpending,
-        current_page => $page,
-        servers => \@servers,
-        total_pages => $total_pages,
-    );
-    $template->param(show_nextbutton=>1) if $show_next;
-    $template->param(show_prevbutton=>1) if $page != 1;
-
-    #  print  $template->output  if $firstresult !=1;
-    $firstresult++;
-
-  } # while nremaining
-
-$template->param(
-breeding_loop => \@breeding_loop,
-#server        => $servername[$k],
-numberpending => $nremaining > 0 ? $nremaining : 0,
-errconn       => \@errconn
-);
+my $pars= {
+        random => $input->param('random') || rand(1000000000),
+        biblionumber => $biblionumber,
+        page => $page,
+        id => \@id,
+        isbn => $isbn,
+        title => $title,
+        author => $author,
+        dewey => $dewey,
+        subject => $subject,
+        lccall => $lccall,
+        controlnumber => $controlnumber,
+        stdid => 0,
+        srchany => 0,
+};
+Z3950Search($pars, $template);
 output_html_with_http_headers $input, $cookie, $template->output;
index 17917ce..9e90182 100755 (executable)
@@ -22,6 +22,7 @@ use warnings;
 
 use CGI;
 use C4::Auth;
+use C4::Branch;
 use C4::Context;
 use C4::Koha;
 use C4::Output;
@@ -67,13 +68,32 @@ $template->param(  script_name => $script_name,
 # called by default. Used to create form to add or  modify a record
 if ($op eq 'add_form') {
        my $data;
+    my @selected_branches;
        if ($id) {
                my $sth=$dbh->prepare("select id, category, authorised_value, lib, lib_opac, imageurl from authorised_values where id=?");
                $sth->execute($id);
                $data=$sth->fetchrow_hashref;
+        $sth = $dbh->prepare("SELECT b.branchcode, b.branchname FROM authorised_values_branches AS avb, branches AS b WHERE avb.branchcode = b.branchcode AND avb.av_id = ?;");
+        $sth->execute( $id );
+        while ( my $branch = $sth->fetchrow_hashref ) {
+            push @selected_branches, $branch;
+        }
        } else {
                $data->{'category'} = $input->param('category');
        }
+
+    my $branches = GetBranches;
+    my @branches_loop;
+
+    foreach my $branch (sort keys %$branches) {
+        my $selected = ( grep {$_->{branchcode} eq $branch} @selected_branches ) ? 1 : 0;
+        push @branches_loop, {
+            branchcode => $branches->{$branch}{branchcode},
+            branchname => $branches->{$branch}{branchname},
+            selected => $selected,
+        };
+    }
+
        if ($id) {
                $template->param(action_modify => 1);
                $template->param('heading_modify_authorized_value_p' => 1);
@@ -92,6 +112,7 @@ if ($op eq 'add_form') {
                          id               => $data->{'id'},
                          imagesets        => C4::Koha::getImageSets( checked => $data->{'imageurl'} ),
                          offset           => $offset,
+                         branches_loop    => \@branches_loop,
                      );
                           
 ################## ADD_VALIDATE ##################################
@@ -102,6 +123,7 @@ if ($op eq 'add_form') {
     my $imageurl     = $input->param( 'imageurl' ) || '';
        $imageurl = '' if $imageurl =~ /removeImage/;
     my $duplicate_entry = 0;
+    my @branches = $input->param('branches');
 
     if ( $id ) { # Update
         my $sth = $dbh->prepare( "SELECT category, authorised_value FROM authorised_values WHERE id = ? ");
@@ -125,7 +147,21 @@ if ($op eq 'add_form') {
             my $lib_opac = $input->param('lib_opac');
             undef $lib if ($lib eq ""); # to insert NULL instead of a blank string
             undef $lib_opac if ($lib_opac eq ""); # to insert NULL instead of a blank string
-            $sth->execute($new_category, $new_authorised_value, $lib, $lib_opac, $imageurl, $id);          
+            $sth->execute($new_category, $new_authorised_value, $lib, $lib_opac, $imageurl, $id);
+            if ( @branches ) {
+                $sth = $dbh->prepare("DELETE FROM authorised_values_branches WHERE av_id = ?");
+                $sth->execute( $id );
+                $sth = $dbh->prepare(
+                    "INSERT INTO authorised_values_branches
+                                ( av_id, branchcode )
+                                VALUES ( ?, ? )"
+                );
+                for my $branchcode ( @branches ) {
+                    next if not $branchcode;
+                    $sth->execute($id, $branchcode);
+                }
+            }
+            $sth->finish;
             print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authorised_values.pl?searchfield=".$new_category."&offset=$offset\"></html>";
             exit;
         }
@@ -137,13 +173,25 @@ if ($op eq 'add_form') {
         ($duplicate_entry) = $sth->fetchrow_array();
         unless ( $duplicate_entry ) {
             my $sth=$dbh->prepare( 'INSERT INTO authorised_values
-                                    ( id, category, authorised_value, lib, lib_opac, imageurl )
-                                    values (?, ?, ?, ?, ?, ?)' );
+                                    ( category, authorised_value, lib, lib_opac, imageurl )
+                                    values (?, ?, ?, ?, ?)' );
            my $lib = $input->param('lib');
            my $lib_opac = $input->param('lib_opac');
            undef $lib if ($lib eq ""); # to insert NULL instead of a blank string
            undef $lib_opac if ($lib_opac eq ""); # to insert NULL instead of a blank string
-           $sth->execute($id, $new_category, $new_authorised_value, $lib, $lib_opac, $imageurl );
+            $sth->execute( $new_category, $new_authorised_value, $lib, $lib_opac, $imageurl );
+            $id = $dbh->{'mysql_insertid'};
+            if ( @branches ) {
+                $sth = $dbh->prepare(
+                    "INSERT INTO authorised_values_branches
+                                ( av_id, branchcode )
+                                VALUES ( ?, ? )"
+                );
+                for my $branchcode ( @branches ) {
+                    next if not $branchcode;
+                    $sth->execute($id, $branchcode);
+                }
+            }
            print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authorised_values.pl?searchfield=".$input->param('category')."&offset=$offset\"></html>";
            exit;
         }
@@ -176,6 +224,8 @@ if ($op eq 'add_form') {
        my $id = $input->param('id');
        my $sth=$dbh->prepare("delete from authorised_values where id=?");
        $sth->execute($id);
+    $sth = $dbh->prepare("DELETE FROM authorised_values_branches WHERE id = ?");
+    $sth->execute($id);
        print "Content-Type: text/html\n\n<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=authorised_values.pl?searchfield=$searchfield&offset=$offset\"></html>";
        exit;
                                                                                                        # END $OP eq DELETE_CONFIRMED
@@ -219,7 +269,14 @@ sub default_form {
     my $count = scalar(@$results);
        my @loop_data = ();
        # builds value list
+    my $dbh = C4::Context->dbh;
+    $sth = $dbh->prepare("SELECT b.branchcode, b.branchname FROM authorised_values_branches AS avb, branches AS b WHERE avb.branchcode = b.branchcode AND avb.av_id = ?");
        for (my $i=0; $i < $count; $i++){
+        $sth->execute( $results->[$i]{id} );
+        my @selected_branches;
+        while ( my $branch = $sth->fetchrow_hashref ) {
+            push @selected_branches, $branch;
+        }
                my %row_data;  # get a fresh hash for the row data
                $row_data{category}              = $results->[$i]{'category'};
                $row_data{authorised_value}      = $results->[$i]{'authorised_value'};
@@ -228,6 +285,7 @@ sub default_form {
                $row_data{imageurl}              = getitemtypeimagelocation( 'intranet', $results->[$i]{'imageurl'} );
                $row_data{edit}                  = "$script_name?op=add_form&amp;id=".$results->[$i]{'id'}."&amp;offset=$offset";
                $row_data{delete}                = "$script_name?op=delete_confirm&amp;searchfield=$searchfield&amp;id=".$results->[$i]{'id'}."&amp;offset=$offset";
+        $row_data{branches}              = \@selected_branches;
                push(@loop_data, \%row_data);
        }
 
index 63d629c..4964158 100755 (executable)
 # 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; FIXME - Bug 2505
+use Modern::Perl;
+
 use CGI;
 use C4::Context;
 use C4::Auth;
+use C4::Branch;
 use C4::Output;
 use C4::Dates;
 use C4::Form::MessagingPreferences;
@@ -90,16 +91,34 @@ if ($op eq 'add_form') {
        
        #---- if primkey exists, it's a modify action, so read values to modify...
        my $data;
+    my @selected_branches;
        if ($categorycode) {
                my $dbh = C4::Context->dbh;
                my $sth=$dbh->prepare("select categorycode,description,enrolmentperiod,enrolmentperioddate,upperagelimit,dateofbirthrequired,enrolmentfee,issuelimit,reservefee,hidelostitems,overduenoticerequired,category_type from categories where categorycode=?");
                $sth->execute($categorycode);
                $data=$sth->fetchrow_hashref;
-               $sth->finish;
-       }
+
+        $sth = $dbh->prepare("SELECT b.branchcode, b.branchname FROM categories_branches AS cb, branches AS b WHERE cb.branchcode = b.branchcode AND cb.categorycode = ?");
+        $sth->execute( $categorycode );
+        while ( my $branch = $sth->fetchrow_hashref ) {
+            push @selected_branches, $branch;
+        }
+        $sth->finish;
+    }
 
     $data->{'enrolmentperioddate'} = undef if ($data->{'enrolmentperioddate'} eq '0000-00-00');
 
+    my $branches = GetBranches;
+    my @branches_loop;
+    foreach my $branch (sort keys %$branches) {
+        my $selected = ( grep {$$_{branchcode} eq $branch} @selected_branches ) ? 1 : 0;
+        push @branches_loop, {
+            branchcode => $$branches{$branch}{branchcode},
+            branchname => $$branches{$branch}{branchname},
+            selected => $selected,
+        };
+    }
+
        $template->param(description        => $data->{'description'},
                                enrolmentperiod         => $data->{'enrolmentperiod'},
                                enrolmentperioddate     => C4::Dates::format_date($data->{'enrolmentperioddate'}),
@@ -115,6 +134,7 @@ if ($op eq 'add_form') {
                 SMSSendDriver => C4::Context->preference("SMSSendDriver"),
                 TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"),
                                "type_".$data->{'category_type'} => 1,
+                branches_loop           => \@branches_loop,
                                );
     if (C4::Context->preference('EnhancedMessagingPreferences')) {
         C4::Form::MessagingPreferences::set_form_values({ categorycode => $categorycode } , $template);
@@ -133,6 +153,22 @@ if ($op eq 'add_form') {
        if ($is_a_modif) {
             my $sth=$dbh->prepare("UPDATE categories SET description=?,enrolmentperiod=?, enrolmentperioddate=?,upperagelimit=?,dateofbirthrequired=?,enrolmentfee=?,reservefee=?,hidelostitems=?,overduenoticerequired=?,category_type=? WHERE categorycode=?");
             $sth->execute(map { $input->param($_) } ('description','enrolmentperiod','enrolmentperioddate','upperagelimit','dateofbirthrequired','enrolmentfee','reservefee','hidelostitems','overduenoticerequired','category_type','categorycode'));
+            my @branches = $input->param("branches");
+            if ( @branches ) {
+                $sth = $dbh->prepare("DELETE FROM categories_branches WHERE categorycode = ?");
+                $sth->execute( $input->param( "categorycode" ) );
+                $sth = $dbh->prepare(
+                    "INSERT INTO categories_branches
+                                ( categorycode, branchcode )
+                                VALUES ( ?, ? )"
+                );
+                for my $branchcode ( @branches ) {
+                    next if not $branchcode;
+                    $sth->bind_param( 1, $input->param( "categorycode" ) );
+                    $sth->bind_param( 2, $branchcode );
+                    $sth->execute;
+                }
+            }
             $sth->finish;
         } else {
             my $sth=$dbh->prepare("INSERT INTO categories  (categorycode,description,enrolmentperiod,enrolmentperioddate,upperagelimit,dateofbirthrequired,enrolmentfee,reservefee,hidelostitems,overduenoticerequired,category_type) values (?,?,?,?,?,?,?,?,?,?,?)");
@@ -197,7 +233,14 @@ if ($op eq 'add_form') {
        $template->param(else => 1);
        my @loop;
        my ($count,$results)=StringSearch($searchfield,'web');
+    my $dbh = C4::Context->dbh;
+    my $sth = $dbh->prepare("SELECT b.branchcode, b.branchname FROM categories_branches AS cb, branches AS b WHERE cb.branchcode = b.branchcode AND cb.categorycode = ?");
        for (my $i=0; $i < $count; $i++){
+        $sth->execute( $results->[$i]{'categorycode'} );
+        my @selected_branches;
+        while ( my $branch = $sth->fetchrow_hashref ) {
+            push @selected_branches, $branch;
+        }
                my %row = (
                        categorycode            => $results->[$i]{'categorycode'},
                                description             => $results->[$i]{'description'},
@@ -211,7 +254,9 @@ if ($op eq 'add_form') {
                                reservefee              => sprintf("%.2f",$results->[$i]{'reservefee'}),
                                 hidelostitems           => $results->[$i]{'hidelostitems'},
                                category_type           => $results->[$i]{'category_type'},
-                               "type_".$results->[$i]{'category_type'} => 1);
+                "type_".$results->[$i]{'category_type'} => 1,
+                branches                => \@selected_branches,
+        );
         if (C4::Context->preference('EnhancedMessagingPreferences')) {
             my $brief_prefs = _get_brief_messaging_prefs($results->[$i]{'categorycode'});
             $row{messaging_prefs} = $brief_prefs if @$brief_prefs;
@@ -220,8 +265,7 @@ if ($op eq 'add_form') {
        }
        $template->param(loop => \@loop);
        # check that I (institution) and C (child) exists. otherwise => warning to the user
-       my $dbh = C4::Context->dbh;
-       my $sth=$dbh->prepare("select category_type from categories where category_type='C'");
+    $sth=$dbh->prepare("select category_type from categories where category_type='C'");
        $sth->execute;
        my ($categoryChild) = $sth->fetchrow;
        $template->param(categoryChild => $categoryChild);
index c0ad1f7..3935f40 100755 (executable)
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 #
 
-use strict;
-use warnings;
+use Modern::Perl;
+
 use CGI;
 use List::MoreUtils qw/uniq/;
 
 use C4::Auth;
+use C4::Branch;
 use C4::Context;
 use C4::Output;
 use C4::Koha;
@@ -82,10 +83,20 @@ exit 0;
 sub add_attribute_type_form {
     my $template = shift;
 
+    my $branches = GetBranches;
+    my @branches_loop;
+    foreach my $branch (sort keys %$branches) {
+        push @branches_loop, {
+            branchcode => $$branches{$branch}{branchcode},
+            branchname => $$branches{$branch}{branchname},
+        };
+    }
+
     $template->param(
         attribute_type_form => 1,
         confirm_op => 'add_attribute_type_confirmed',
         categories => GetBorrowercategoryList,
+        branches_loop => \@branches_loop,
     );
     authorised_value_category_list($template);
     pa_classes($template);
@@ -162,6 +173,8 @@ sub add_update_attribute_type {
     $attr_type->display_checkout($display_checkout);
     $attr_type->category_code($input->param('category_code'));
     $attr_type->class($input->param('class'));
+    my @branches = $input->param('branches');
+    $attr_type->branches( \@branches );
 
     if ($op eq 'edit') {
         $template->param(edited_attribute_type => $attr_type->code());
@@ -244,6 +257,20 @@ sub edit_attribute_type_form {
     authorised_value_category_list($template, $attr_type->authorised_value_category());
     pa_classes( $template, $attr_type->class );
 
+
+    my $branches = GetBranches;
+    my @branches_loop;
+    my $selected_branches = $attr_type->branches;
+    foreach my $branch (sort keys %$branches) {
+        my $selected = ( grep {$$_{branchcode} eq $branch} @$selected_branches ) ? 1 : 0;
+        push @branches_loop, {
+            branchcode => $branches->{$branch}{branchcode},
+            branchname => $branches->{$branch}{branchname},
+            selected => $selected,
+        };
+    }
+    $template->param( branches_loop => \@branches_loop );
+
     $template->param ( category_code => $attr_type->category_code );
     $template->param ( category_description => $attr_type->category_description );
 
@@ -259,21 +286,26 @@ sub edit_attribute_type_form {
 sub patron_attribute_type_list {
     my $template = shift;
 
-    my @attr_types = C4::Members::AttributeTypes::GetAttributeTypes();
-    my @classes = uniq( map {$_->{class}} @attr_types );
+    my @attr_types = C4::Members::AttributeTypes::GetAttributeTypes( 1, 1 );
+
+    my @classes = uniq( map { $_->{class} } @attr_types );
     @classes = sort @classes;
 
     my @attributes_loop;
     for my $class (@classes) {
-        my @items;
+        my ( @items, $branches );
         for my $attr (@attr_types) {
-            push @items, $attr if $attr->{class} eq $class
+            next if $attr->{class} ne $class;
+            my $attr_type = C4::Members::AttributeTypes->fetch($attr->{code});
+            $attr->{branches} = $attr_type->branches;
+            push @items, $attr;
         }
         my $lib = GetAuthorisedValueByCode( 'PA_CLASS', $class ) || $class;
         push @attributes_loop, {
             class => $class,
             items => \@items,
             lib   => $lib,
+            branches => $branches,
         };
     }
     $template->param(available_attribute_types => \@attributes_loop);
index 67e9c99..9379704 100755 (executable)
@@ -40,6 +40,7 @@ use C4::VirtualShelves;
 use C4::XSLT;
 use C4::Images;
 use Koha::DateUtils;
+use C4::HTML5Media;
 
 # use Smart::Comments;
 
@@ -155,6 +156,8 @@ foreach my $subscription (@subscriptions) {
     $cell{branchcode}        = $subscription->{branchcode};
     $cell{branchname}        = GetBranchName($subscription->{branchcode});
     $cell{hasalert}          = $subscription->{hasalert};
+    $cell{callnumber}        = $subscription->{callnumber};
+    $cell{closed}            = $subscription->{closed};
     #get the three latest serials.
        $serials_to_display = $subscription->{staffdisplaycount};
        $serials_to_display = C4::Context->preference('StaffSerialIssueDisplayCount') unless $serials_to_display;
@@ -175,15 +178,20 @@ $dat->{'hiddencount'} = scalar @all_items + @hostitems - scalar @items;
 my $shelflocations = GetKohaAuthorisedValues('items.location', $fw);
 my $collections    = GetKohaAuthorisedValues('items.ccode'   , $fw);
 my $copynumbers    = GetKohaAuthorisedValues('items.copynumber', $fw);
-my (@itemloop, %itemfields);
+my (@itemloop, @otheritemloop, %itemfields);
 my $norequests = 1;
 my $authvalcode_items_itemlost = GetAuthValCode('items.itemlost',$fw);
 my $authvalcode_items_damaged  = GetAuthValCode('items.damaged', $fw);
 
 my $analytics_flag;
 my $materials_flag; # set this if the items have anything in the materials field
+my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
+if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
+    $template->param(SeparateHoldings => 1);
+}
+my $separatebranch = C4::Context->preference('SeparateHoldingsBranch') || 'homebranch';
 foreach my $item (@items) {
-
+    my $itembranchcode = $item->{$separatebranch};
     $item->{homebranch}        = GetBranchName($item->{homebranch});
 
     # can place holds defaults to yes
@@ -257,16 +265,27 @@ foreach my $item (@items) {
        $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
     }
        
-       #count if item is used in analytical bibliorecords
-       my $countanalytics= GetAnalyticsCount($item->{itemnumber});
-       if ($countanalytics > 0){
-               $analytics_flag=1;
-               $item->{countanalytics} = $countanalytics;
-       }
+    #count if item is used in analytical bibliorecords
+    my $countanalytics= GetAnalyticsCount($item->{itemnumber});
+    if ($countanalytics > 0){
+        $analytics_flag=1;
+        $item->{countanalytics} = $countanalytics;
+    }
+
     if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
        $materials_flag = 1;
     }
-    push @itemloop, $item;
+
+    if ($currentbranch and $currentbranch ne "NO_LIBRARY_SET"
+    and C4::Context->preference('SeparateHoldings')) {
+        if ($itembranchcode and $itembranchcode eq $currentbranch) {
+            push @itemloop, $item;
+        } else {
+            push @otheritemloop, $item;
+        }
+    } else {
+        push @itemloop, $item;
+    }
 }
 
 $template->param( norequests => $norequests );
@@ -330,6 +349,7 @@ foreach ( keys %{$dat} ) {
 $template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
 $template->param(
     itemloop        => \@itemloop,
+    otheritemloop   => \@otheritemloop,
     biblionumber        => $biblionumber,
     ($analyze? 'analyze':'detailview') =>1,
     subscriptions       => \@subs,
@@ -360,6 +380,12 @@ if ( C4::Context->preference("LocalCoverImages") == 1 ) {
     $template->{VARS}->{localimages} = \@images;
 }
 
+# HTML5 Media
+if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'staff') ) {
+    $template->param( C4::HTML5Media->gethtml5media($record));
+}
+
+
 # Get OPAC URL
 if (C4::Context->preference('OPACBaseURL')){
      $template->param( OpacUrl => C4::Context->preference('OPACBaseURL') );
diff --git a/catalogue/detailprint.pl b/catalogue/detailprint.pl
deleted file mode 100755 (executable)
index fe92fe5..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright 2000-2002 Katipo Communications
-#
-# 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; FIXME - Bug 2505
-
-use C4::Context;
-use CGI;
-use C4::Auth;
-use C4::Biblio;
-use C4::Items;
-use C4::Output;
-use C4::Dates;
-
-my $query = new CGI;
-my $type  = $query->param('type');
-($type) || ( $type = 'intra' );
-
-my $biblionumber = $query->param('biblionumber');
-
-# change back when ive fixed request.pl
-my @items = GetItemsInfo( $biblionumber );
-my $norequests = 1;
-foreach my $itm (@items) {
-    $norequests = 0 unless $itm->{'notforloan'};
-}
-
-my $dat         = GetBiblioData($biblionumber);
-my $record      = GetMarcBiblio($biblionumber);
-my $addauthor   = GetMarcAuthors($record,C4::Context->preference("marcflavour"));
-my $authorcount = scalar @$addauthor;
-
-$dat->{'additional'} = "";
-foreach (@$addauthor) {
-    $dat->{'additional'} .= "|" . $_->{'a'};
-}    # for
-
-$dat->{'count'}      = @items;
-$dat->{'norequests'} = $norequests;
-
-my @results;
-
-$results[0] = $dat;
-
-my $resultsarray = \@results;
-my $itemsarray   = \@items;
-
-my $startfrom = $query->param('startfrom');
-($startfrom) || ( $startfrom = 0 );
-
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-    {
-        template_name   => ('catalogue/detailprint.tmpl'),
-        query           => $query,
-        type            => "intranet",
-        authnotrequired => ( $type eq 'opac' ),
-        flagsrequired   => { catalogue => 1 },
-    }
-);
-
-my $count = 1;
-
-# now to get the items into a hash we can use and whack that thru
-
-my $nextstartfrom = ( $startfrom + 20 < $count - 20 ) ? ( $startfrom + 20 ) : ( $count - 20 );
-my $prevstartfrom = ( $startfrom - 20 > 0 ) ? ( $startfrom - 20 ) : (0);
-
-$template->param(
-    startfrom      => $startfrom + 1,
-    endat          => $startfrom + 20,
-    numrecords     => $count,
-    nextstartfrom  => $nextstartfrom,
-    prevstartfrom  => $prevstartfrom,
-    BIBLIO_RESULTS => $resultsarray,
-    ITEM_RESULTS   => $itemsarray,
-    loggedinuser   => $loggedinuser,
-    biblionumber   => $biblionumber,
-);
-
-output_html_with_http_headers $query, $cookie, $template->output;
index 2d591c6..caacd91 100755 (executable)
@@ -219,8 +219,11 @@ sub build_authorized_values_list {
         $value = $default_source unless $value;
     }
     else {
+        my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
         $authorised_values_sth->execute(
-            $tagslib->{$tag}->{$subfield}->{authorised_value} );
+            $tagslib->{$tag}->{$subfield}->{authorised_value},
+            $branch_limit ? $branch_limit : (),
+        );
 
         push @authorised_values, ""
           unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
@@ -230,6 +233,7 @@ sub build_authorized_values_list {
             $authorised_lib{$value} = $lib;
         }
     }
+    $authorised_values_sth->finish;
     return CGI::scrolling_list(
         -name     => "tag_".$tag."_subfield_".$subfield."_".$index_tag."_".$index_subfield,
         -values   => \@authorised_values,
@@ -508,12 +512,15 @@ sub build_tabs {
     my @loop_data = ();
     my $tag;
 
-    my $authorised_values_sth = $dbh->prepare(
-        "select authorised_value,lib
-        from authorised_values
-        where category=? order by lib"
-    );
-    
+    my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+    my $query = "SELECT authorised_value, lib
+                FROM authorised_values";
+    $query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id )} if $branch_limit;
+    $query .= " WHERE category = ?";
+    $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit;
+    $query .= " GROUP BY lib ORDER BY lib, lib_opac";
+    my $authorised_values_sth = $dbh->prepare( $query );
+
     # in this array, we will push all the 10 tabs
     # to avoid having 10 tabs in the template : they will all be in the same BIG_LOOP
     my @BIG_LOOP;
@@ -698,6 +705,7 @@ sub build_tabs {
             };
         }
     }
+    $authorised_values_sth->finish;
     $template->param( BIG_LOOP => \@BIG_LOOP );
 }
 
index 79a717c..c9875ca 100755 (executable)
@@ -107,8 +107,7 @@ sub generate_subfield_form {
   
   my $frameworkcode = &GetFrameworkCode($biblionumber);
         my %subfield_data;
-        my $dbh = C4::Context->dbh;        
-        my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
+        my $dbh = C4::Context->dbh;
         
         my $index_subfield = int(rand(1000000)); 
         if ($subfieldtag eq '@'){
@@ -203,11 +202,11 @@ sub generate_subfield_form {
                   #---- "true" authorised value
             }
             else {
-                  push @authorised_values, "" unless ( $subfieldlib->{mandatory} );
-                  $authorised_values_sth->execute( $subfieldlib->{authorised_value} );
-                  while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
-                      push @authorised_values, $value;
-                      $authorised_lib{$value} = $lib;
+                  push @authorised_values, qq{} unless ( $subfieldlib->{mandatory} );
+                  my $av = GetAuthorisedValues( $subfieldlib->{authorised_value} );
+                  for my $r ( @$av ) {
+                      push @authorised_values, $r->{authorised_value};
+                      $authorised_lib{$r->{authorised_value}} = $r->{lib};
                   }
             }
 
index fd4eff9..9fc9d68 100755 (executable)
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
 use CGI;
 
 use C4::Auth;
 use C4::Output;
-use C4::Biblio;
 use C4::Context;
 use C4::Breeding;
 use C4::Koha;
-use C4::Charset;
-use ZOOM;
 
 my $input        = new CGI;
 my $dbh          = C4::Context->dbh;
@@ -44,37 +41,13 @@ my $lccn          = $input->param('lccn');
 my $lccall        = $input->param('lccall');
 my $subject       = $input->param('subject');
 my $dewey         = $input->param('dewey');
-my $controlnumber      = $input->param('controlnumber');
-my $stdid                      = $input->param('stdid');
-my $srchany                    = $input->param('srchany');
-my $random        = $input->param('random') || rand(1000000000); # this var is not useful anymore just kept for rel2_2 compatibility
-my $op            = $input->param('op');
+my $controlnumber = $input->param('controlnumber');
+my $stdid         = $input->param('stdid');
+my $srchany       = $input->param('srchany');
+my $op            = $input->param('op')||'';
 
 my $page            = $input->param('current_page') || 1;
 $page = $input->param('goto_page') if $input->param('changepage_goto');
-my $show_next = 0;
-my $total_pages = 0;
-
-my $numberpending;
-my $attr = '';
-my $term;
-my $host;
-my $server;
-my $database;
-my $port;
-my $marcdata;
-my @encoding;
-my @results;
-my $count;
-my $record;
-my $oldbiblio;
-my $errmsg;
-my @serverloop = ();
-my @serverhost;
-my @servername;
-my @breeding_loop = ();
-
-my $DEBUG = 0;    # if set to 1, many debug message are send on syslog.
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
         template_name   => "cataloguing/z3950_search.tmpl",
@@ -82,11 +55,10 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user({
         type            => "intranet",
         authnotrequired => 1,
         flagsrequired   => { catalogue => 1 },
-        debug           => 1,
 });
 
-$template->param( frameworkcode => $frameworkcode, );
 $template->param(
+    frameworkcode => $frameworkcode,
     isbn         => $isbn,
     issn         => $issn,
     lccn         => $lccn,
@@ -110,222 +82,31 @@ if ( $op ne "do_search" ) {
         opsearch     => "search",
     );
     output_html_with_http_headers $input, $cookie, $template->output;
+    exit;
 }
-else {
-    my @id = $input->param('id');
 
-    if ( not defined @id ) {
+my @id = $input->param('id');
+if ( @id==0 ) {
         # empty server list -> report and exit
         $template->param( emptyserverlist => 1 );
         output_html_with_http_headers $input, $cookie, $template->output;
         exit;
-    }
-
-    my @oConnection;
-    my @oResult;
-    my @errconn;
-    my $s = 0;
-    my $query = '';
-    my $nterms;
-    if ($isbn) {
-        $term=$isbn;
-        $query .= " \@attr 1=7 \@attr 5=1 \"$term\" ";
-        $nterms++;
-    }
-    if ($issn) {
-        $term=$issn;
-        $query .= " \@attr 1=8 \@attr 5=1 \"$term\" ";
-        $nterms++;
-    }
-    if ($title) {
-        utf8::decode($title);
-        $query .= " \@attr 1=4 \"$title\" ";
-        $nterms++;
-    }
-    if ($author) {
-        utf8::decode($author);
-        $query .= " \@attr 1=1003 \"$author\" ";
-        $nterms++;
-    }
-    if ($dewey) {
-        $query .= " \@attr 1=16 \"$dewey\" ";
-        $nterms++;
-    }
-    if ($subject) {
-        utf8::decode($subject);
-        $query .= " \@attr 1=21 \"$subject\" ";
-        $nterms++;
-    }
-       if ($lccn) {    
-        $query .= " \@attr 1=9 $lccn ";
-        $nterms++;
-    }
-    if ($lccall) {
-        $query .= " \@attr 1=16 \@attr 2=3 \@attr 3=1 \@attr 4=1 \@attr 5=1 \@attr 6=1 \"$lccall\" ";
-        $nterms++;
-    }
-    if ($controlnumber) {
-        $query .= " \@attr 1=12 \"$controlnumber\" ";
-        $nterms++;
-    }
-    if ($stdid) {
-        $query .= " \@attr 1=1007 \"$stdid\" ";
-        $nterms++;
-    }
-    if ($srchany) {
-        $query .= " \@attr 1=1016 \"$srchany\" ";
-        $nterms++;
-    }
-for my $i (1..$nterms-1) {
-    $query = "\@and " . $query;
 }
-warn "query ".$query  if $DEBUG;
-
-    foreach my $servid (@id) {
-        my $sth = $dbh->prepare("SELECT * FROM z3950servers WHERE id=? ORDER BY rank, name");
-        $sth->execute($servid);
-        while ( $server = $sth->fetchrow_hashref ) {
-            warn "serverinfo ".join(':',%$server) if $DEBUG;
-            my $option1      = new ZOOM::Options();
-            $option1->option('async' => 1);
-            $option1->option('elementSetName', 'F');
-            $option1->option('databaseName', $server->{db});
-            $option1->option('user',         $server->{userid}  ) if $server->{userid};
-            $option1->option('password',     $server->{password}) if $server->{password};
-            $option1->option('preferredRecordSyntax', $server->{syntax});
-            $option1->option( 'timeout', $server->{timeout} ) if ($server->{timeout});
-            $oConnection[$s] = create ZOOM::Connection($option1)
-              || $DEBUG
-              && warn( "" . $oConnection[$s]->errmsg() );
-            warn( "server data", $server->{name}, $server->{port} ) if $DEBUG;
-            $oConnection[$s]->connect( $server->{host}, $server->{port} )
-              || $DEBUG
-              && warn( "" . $oConnection[$s]->errmsg() );
-            $serverhost[$s] = $server->{host};
-            $servername[$s] = $server->{name};
-            $encoding[$s]   = ($server->{encoding}?$server->{encoding}:"iso-5426");
-            $s++;
-        }    ## while fetch
-    }    # foreach
-    my $nremaining  = $s;
-    my $firstresult = 1;
-
-    for ( my $z = 0 ; $z < $s ; $z++ ) {
-        warn "doing the search" if $DEBUG;
-        $oResult[$z] = $oConnection[$z]->search_pqf($query)
-          || $DEBUG
-          && warn( "somthing went wrong: " . $oConnection[$s]->errmsg() );
-
-        # $oResult[$z] = $oConnection[$z]->search_pqf($query);
-    }
-
-  AGAIN:
-    my $k;
-    my $event;
-    while ( ( $k = ZOOM::event( \@oConnection ) ) != 0 ) {
-        $event = $oConnection[ $k - 1 ]->last_event();
-        warn( "connection ", $k - 1, ": event $event (",
-            ZOOM::event_str($event), ")\n" )
-          if $DEBUG;
-        last if $event == ZOOM::Event::ZEND;
-    }
-
-    if ( $k != 0 ) {
-        $k--;
-        warn $serverhost[$k] if $DEBUG;
-        my ( $error, $errmsg, $addinfo, $diagset ) =
-          $oConnection[$k]->error_x();
-        if ($error) {
-            if ($error =~ m/^(10000|10007)$/ ) {
-                push(@errconn, {'server' => $serverhost[$k], 'error' => $error});
-            }
-            $DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n";
-        }
-        else {
-            my $numresults = $oResult[$k]->size();
-            my $i;
-            my $result = '';
-            if ( $numresults > 0  and $numresults >= (($page-1)*20)) {
-                $show_next = 1 if $numresults >= ($page*20);
-                $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
-                for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
-                    my $rec = $oResult[$k]->record($i);
-                    if ($rec) {
-                        my $marcrecord;
-                        $marcdata   = $rec->raw();
-
-                        my ($charset_result, $charset_errors);
-                        ($marcrecord, $charset_result, $charset_errors) = 
-                          MarcToUTF8Record($marcdata, C4::Context->preference('marcflavour'), $encoding[$k]);
-####WARNING records coming from Z3950 clients are in various character sets MARC8,UTF8,UNIMARC etc
-## In HEAD i change everything to UTF-8
-# In rel2_2 i am not sure what encoding is so no character conversion is done here
-##Add necessary encoding changes to here -TG
-
-                        # Normalize the record so it doesn't have separated diacritics
-                        SetUTF8Flag($marcrecord);
-
-                        my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
-                        $oldbiblio->{isbn}   =~ s/ |-|\.//g if $oldbiblio->{isbn};
-                        # pad | and ( with spaces to allow line breaks in the HTML
-                        $oldbiblio->{isbn} =~ s/\|/ \| /g if $oldbiblio->{isbn};
-                        $oldbiblio->{isbn} =~ s/\(/ \(/g if $oldbiblio->{isbn};
-
-                        $oldbiblio->{issn} =~ s/ |-|\.//g if $oldbiblio->{issn};
-                        # pad | and ( with spaces to allow line breaks in the HTML
-                        $oldbiblio->{issn} =~ s/\|/ \| /g if $oldbiblio->{issn};
-                        $oldbiblio->{issn} =~ s/\(/ \(/g if $oldbiblio->{issn};
-                          my (
-                            $notmarcrecord, $alreadyindb, $alreadyinfarm,
-                            $imported,      $breedingid
-                          )
-                          = ImportBreeding( $marcdata, 2, $serverhost[$k], $encoding[$k], $random, 'z3950' );
-                        my %row_data;
-                        $row_data{server}       = $servername[$k];
-                        $row_data{isbn}         = $oldbiblio->{isbn};
-                        $row_data{lccn}         = $oldbiblio->{lccn};
-                        $row_data{title}        = $oldbiblio->{title};
-                        $row_data{author}       = $oldbiblio->{author};
-                        $row_data{date}         = $oldbiblio->{copyrightdate};
-                        $row_data{edition}      = $oldbiblio->{editionstatement};
-                        $row_data{breedingid}   = $breedingid;
-                        $row_data{biblionumber} = $biblionumber;
-                        push( @breeding_loop, \%row_data );
-                           
-                    } else {
-                        push(@breeding_loop,{'server'=>$servername[$k],'title'=>join(': ',$oConnection[$k]->error_x()),'breedingid'=>-1,'biblionumber'=>-1});
-                    } # $rec
-                }
-            }    #$numresults
-        }
-    }    # if $k !=0
-    $numberpending = $nremaining - 1;
-
-    my @servers = ();
-    foreach my $id (@id) {
-        push(@servers,{id => $id});
-    }
-
-    $template->param(
-        breeding_loop => \@breeding_loop,
-        server        => $servername[$k],
-        numberpending => $numberpending,
-        biblionumber  => $biblionumber,
-        errconn       => \@errconn,
-        current_page => $page,
-        servers => \@servers,
-        total_pages => $total_pages,
-    );
-    $template->param(show_nextbutton=>1) if $show_next;
-    $template->param(show_prevbutton=>1) if $page != 1;
-    
-    output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0;
-
-    #          print  $template->output  if $firstresult !=1;
-    $firstresult++;
 
-  MAYBE_AGAIN:
-    if ( --$nremaining > 0 ) {
-        goto AGAIN;
-    }
-}    ## if op=search
+my $pars= {
+        random => $input->param('random') || rand(1000000000),
+        biblionumber => $biblionumber,
+        page => $page,
+        id => \@id,
+        isbn => $isbn,
+        title => $title,
+        author => $author,
+        dewey => $dewey,
+        subject => $subject,
+        lccall => $lccall,
+        controlnumber => $controlnumber,
+        stdid => 0,
+        srchany => 0,
+};
+Z3950Search($pars, $template);
+output_html_with_http_headers $input, $cookie, $template->output;
index 228772e..75bf319 100755 (executable)
@@ -45,12 +45,11 @@ my $data  = GetBiblioItemData($bi);
 my $homebranch    = $branches->{ $idata->{'homebranch'}    }->{'branchname'};
 my $holdingbranch = $branches->{ $idata->{'holdingbranch'} }->{'branchname'};
 
-my ( $lastmove, $message ) = lastmove($itm);
+my $lastmove = lastmove($itm);
 
 my $lastdate;
 my $count;
 if ( not $lastmove ) {
-#    $lastdate = $message;
     $count = issuessince( $itm, 0 );
 } else {
     $lastdate = $lastmove->{'datearrived'};
@@ -79,8 +78,6 @@ foreach (@$branchloop) {
     $_->{seentime}   = $timechunk;
 }
 
-### $lastdate
-
 $template->param(
     biblionumber            => $biblionumber,
     title                   => $data->{'title'},
@@ -89,7 +86,7 @@ $template->param(
     biblioitemnumber        => $bi,
     homebranch              => $homebranch,
     holdingbranch           => $holdingbranch,
-    lastdate                => $lastdate ?  format_date($lastdate) : $message,
+    lastdate                => $lastdate ?  format_date($lastdate) : 0,
     count                   => $count,
     branchloop              => $branchloop,
 );
@@ -112,14 +109,14 @@ sub lastmove {
     );
     $sth->execute($itemnumber);
     my ($date) = $sth->fetchrow_array;
-    return ( 0, "Item has no branch transfers record" ) if not $date;
+    return 0 unless $date;
     $sth = $dbh->prepare(
 "SELECT * FROM branchtransfers WHERE branchtransfers.itemnumber=? and branchtransfers.datearrived=?"
     );
     $sth->execute( $itemnumber, $date );
     my ($data) = $sth->fetchrow_hashref;
-    return ( 0, "Item has no branch transfers record" ) if not $data;
-    return ( $data, "" );
+    return 0 unless $data;
+    return $data;
 }
 
 sub issuessince {
@@ -165,7 +162,7 @@ sub lastseenat {
     "SELECT MAX(transfer) FROM (SELECT max(datearrived) AS transfer FROM branchtransfers WHERE itemnumber=? AND tobranch = ?
      UNION ALL
      SELECT max(datesent) AS transfer FROM branchtransfers WHERE itemnumber=? AND frombranch = ?
-       ) tmp"
+    ) tmp"
     );
     $sth->execute( $itm, $brc, $itm, $brc );
     my ($date2) = $sth->fetchrow_array;
@@ -179,7 +176,6 @@ sub lastseenat {
 sub slashdate {
     my ($date) = @_;
     $date or return;
-    # warn "slashdate($date)...";
     return (
         format_date($date),
         substr($date,11,5)
index 842f8d9..5eee81b 100755 (executable)
@@ -25,7 +25,7 @@ use C4::Context;
 use C4::Koha;
 
 my $query = new CGI;
-my ($template, $loggedinuser, $cookie)
+my ($template, $loggedinuser, $cookie, $flags)
 = get_template_and_user({template_name => "circ/circulation-home.tmpl",
                                query => $query,
                                type => "intranet",
@@ -37,5 +37,8 @@ my ($template, $loggedinuser, $cookie)
 my $fa = getframeworkinfo('FA');
 $template->param( fast_cataloging => 1 ) if (defined $fa);
 
+# Checking if the transfer page needs to be displayed
+$template->param( display_transfer => 1 ) if ( ($flags->{'superlibrarian'} == 1) || (C4::Context->preference("IndependantBranches") == 0) );
+
 
 output_html_with_http_headers $query, $cookie, $template->output;
index 902456d..9472797 100755 (executable)
@@ -418,6 +418,9 @@ foreach my $code ( keys %$messages ) {
     elsif ( $code eq 'WasLost' ) {
         $err{waslost} = 1;
     }
+    elsif ( $code eq 'LostItemFeeRefunded' ) {
+        $template->param( LostItemFeeRefunded => 1 );
+    }
     elsif ( $code eq 'ResFound' ) {
         ;    # FIXME... anything to do here?
     }
diff --git a/debian/docs/koha-shell.xml b/debian/docs/koha-shell.xml
new file mode 100644 (file)
index 0000000..a9029f7
--- /dev/null
@@ -0,0 +1,112 @@
+<article xmlns='http://docbook.org/ns/docbook'>
+    <title>koha-shell</title>
+    <info>
+        <productname>Koha</productname> is the first free software library automation package.
+        <author>
+            <personname>
+                <firstname>Robin</firstname>
+                <surname>Sheat</surname>
+            </personname>
+            <affiliation>
+                <orgname>Catalyst IT</orgname>
+                <uri>http://www.catalyst.net.nz</uri>
+            </affiliation>
+            <contrib>Author</contrib>
+        </author>
+    </info>
+
+    <refentry xml:id="koha-shell">
+
+        <refmeta>
+            <refentrytitle>koha-shell</refentrytitle>
+            <manvolnum>8</manvolnum>
+        </refmeta>
+
+        <refnamediv>
+            <refname>koha-shell</refname>
+            <refpurpose>Gives you a shell with the user and environment set to make it easy to do koha operations.</refpurpose>
+            <refclass>UNIX/Linux</refclass>
+        </refnamediv>
+
+        <refsynopsisdiv>
+            <cmdsynopsis>
+                <command>koha-shell</command>
+                <arg><option>--command|-c</option> COMMAND</arg>
+                <arg><option>--help|-h</option></arg>
+                <arg><option>--login|-l</option></arg>
+                <arg><option>--preserve-environment|-p|-m</option></arg>
+                <arg><option>--shell|-s</option> SHELL</arg>
+                <arg><option>--verbose|-v</option></arg>
+                <arg choice="req" rep="norepeat"><replaceable>instancename</replaceable></arg>
+            </cmdsynopsis>
+        </refsynopsisdiv>
+
+        <refsect1><title>Options</title>
+            <variablelist>
+                <varlistentry>
+                    <term><option>--command</option></term>
+                    <listitem>
+                        <para>Run the specified command rather than launching a shell.</para>
+                    </listitem>
+                </varlistentry>
+                <varlistentry>
+                    <term><option>--help</option></term>
+                    <listitem>
+                        <para>Show a usage synopsis.</para>
+                    </listitem>
+                </varlistentry>
+                <varlistentry>
+                    <term><option>--login</option></term>
+                    <listitem>
+                        <para>Make the shell a login shell.</para>
+                    </listitem>
+                </varlistentry>
+                <varlistentry>
+                    <term><option>--preserve-environment</option></term>
+                    <listitem>
+                        <para>Preserve the current environment (note that if you run it through 'sudo', this may not work as you'd expect.)</para>
+                    </listitem>
+                </varlistentry>
+                <varlistentry>
+                    <term><option>--shell</option></term>
+                    <listitem>
+                        <para>Run the specified shell. The default is the shell of the current environment, followed by /bin/sh.</para>
+                    </listitem>
+                </varlistentry>
+                <varlistentry>
+                    <term><option>--verbose</option></term>
+                    <listitem>
+                        <para>Show the command that is going to be run.</para>
+                    </listitem>
+                </varlistentry>
+            </variablelist>
+        </refsect1>
+
+        <refsect1><title>Description</title>
+            <para>This launches a shell with the user and required environment variables set in such a way that running any Koha commands will
+                work correctly. With the use of '-c', it can be used to easily run commands in the correct environment.</para>
+            <para>It behaves mostly as a wrapper for <command>su(1)</command>, so a deeper discussion of the options can be found in there.</para>
+        </refsect1>
+
+        <refsect1>
+            <title>Examples</title>
+            <para>
+                To get a shell:
+            </para>
+            <para><command>$ sudo koha-shell library</command></para>
+            <para>
+                To run a command:
+            </para>
+            <para><command>$ sudo koha-shell -c "/usr/share/koha/bin/migration_tools/bulkmarcimport.pl -b -file data.marc" library</command></para>
+        </refsect1>
+
+        <refsect1><title>See also</title>
+            <simplelist type="inline">
+                <member><command>koha-foreach(8)</command></member>
+                <member><command>su(1)</command></member>
+            </simplelist>
+        </refsect1>
+
+    </refentry>
+
+</article>
index 50affbd..2a5573e 100644 (file)
@@ -24,6 +24,7 @@ debian/scripts/koha-reset-passwd            usr/sbin
 debian/scripts/koha-restart-zebra           usr/sbin
 debian/scripts/koha-restore                 usr/sbin
 debian/scripts/koha-run-backups             usr/sbin
+debian/scripts/koha-shell                   usr/sbin
 debian/scripts/koha-start-zebra             usr/sbin
 debian/scripts/koha-stop-zebra              usr/sbin
 debian/scripts/koha-upgrade-schema          usr/sbin
index cb2eee3..0b75d09 100755 (executable)
@@ -92,10 +92,12 @@ override_dh_auto_install:
                $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css
        install -m 0644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/sprite.png  \
                $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css
+       sed -i -e 's:url(.*/reset-fonts-grids.css.*):url("/opac-tmpl/lib/yui/reset-fonts-grids/reset-fonts-grids.css"):' \
+                  -e 's:url(.*/skin.css.*):url("/opac-tmpl/lib/yui/assets/skins/sam/skin.css"):' \
+               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/opac.css \
+               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/sco.css
        sed -i -e 's:url(.*/reset-fonts-grids.css.*):url(reset-fonts-grids.css):' \
                   -e 's:url(.*/skin.css.*):url(skin.css):' \
-               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/opac.css \
-               $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css/sco.css \
                $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css/staff-global*.css
        mkdir -p $(TMP)/debian/tmp_docbook
        xsltproc --output $(TMP)/debian/tmp_docbook/ \
index 0aafc52..74f879b 100755 (executable)
@@ -58,7 +58,7 @@ done
 for name in $(koha-list --enabled | grep -Fxv demo)
 do
     koha-dump "$name" > /dev/null
-    if [ -z "$dirname"]; then
+    if [ -z "$dirname" ]; then
         backupdir="$( xmlstarlet sel -t -v 'yazgfs/config/backupdir' /etc/koha/sites/$name/koha-conf.xml )";
     else
         backupdir="$dirname/$name";
diff --git a/debian/scripts/koha-shell b/debian/scripts/koha-shell
new file mode 100755 (executable)
index 0000000..8d05b51
--- /dev/null
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+# koha-shell -- put you in a shell with a koha environment set up
+# Copyright 2012  Catalyst IT, Ltd
+#
+# This program 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 3 of the License, or
+# (at your option) any later version.
+#
+# This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use Getopt::Long;
+use Modern::Perl;
+
+Getopt::Long::Configure("bundling");
+
+my %opts;
+my $res = GetOptions( \%opts, "command|c=s", "help|h", "login|l", "shell|s=s",
+    "preserve-environment|p|m", "verbose|v" );
+
+if ( !$res || $opts{help} ) {
+    show_help( !$res );
+    exit( !$res );
+}
+
+if ( !@ARGV ) {
+    show_help( 1, "An instance name must be supplied." );
+    exit(1);
+}
+my $instance = shift @ARGV;
+if ( !-e "/etc/koha/sites/$instance" ) {
+    show_help( 1, "The instance doesn't exist: $instance" );
+    exit(1);
+}
+my $shell = $opts{shell} || $ENV{SHELL} || '/bin/sh';
+
+# Now we're set up, build the 'su' command
+my @su_args;
+push @su_args, '/bin/su';
+push @su_args, '--preserve-environment' if $opts{'preserve-environment'};
+push @su_args, '--login' if $opts{login};
+push @su_args, '--command',
+    "env "
+  . "KOHA_CONF=/etc/koha/sites/$instance/koha-conf.xml "
+  . "PERL5LIB=/usr/share/koha/lib $shell"
+  . ( $opts{command} ? " -c '$opts{command}'" : '' );
+push @su_args, "$instance-koha";
+
+print "Command: '".join("' '",@su_args)."'\n" if $opts{verbose};
+system(@su_args);
+if ( $? == -1 ) {
+    print STDERR "failed to execute: $!\n";
+}
+elsif ( $? & 127 ) {
+    printf STDERR "child died with signal %d, %s coredump\n",
+      ( $? & 127 ), ( $? & 128 ) ? 'with' : 'without';
+}
+
+sub show_help {
+    my ( $err, $msg ) = @_;
+
+    my $fh = $err ? *STDERR : *STDOUT;
+    say $fh "Error: " . $msg if $msg;
+    print $fh $_ while <DATA>;
+}
+
+__DATA__
+koha-shell -- gives you a shell with your Koha environment set up
+
+Usage: koha-shell [options] [instance name]
+
+Options:
+    -c, --command COMMAND   pass COMMAND to the invoked shell
+    -h, --help              show this help and quit
+    -l, --login             make the shell a login shell
+    -m, -p,
+    --preserve-environment  do not reset environment variables
+    -s, --shell SHELL       use SHELL instead of the one from your environment
+    -v, --verbose           output the full command that will be executed
+
+The default shell is the one currently in use. Refer to su(1) for more detail
+on these options.
index 204e402..af41839 100644 (file)
@@ -642,4 +642,7 @@ October 23 2012     Koha 3.6.10 released    releases
 October 26 2012        Robert Williams becomes the 194th developer to have a patch pushed
 November 22 2012       Koha 3.8.7 released     releases
 November 23 2012       Koha 3.10.0 released    releases
+December 12 2012       Romina Racca becomes the 195th developer to have a patch pushed
+December 17 2012       Vitor Fernandes becomes the 196th developer to have a patch pushed
+December 21 2012       Nadia Nicolaides becomes the 197th developer to have a patch pushed
 
index 5a34eb2..752cd57 100644 (file)
@@ -24,6 +24,7 @@ authority-zebra-indexdefs.xsl`
   <!-- Original record ID -->
   <kohaidx:index_control_field tag="001">
     <kohaidx:target_index>Local-Number:w</kohaidx:target_index>
+    <kohaidx:target_index>Local-Number:n</kohaidx:target_index>
     <kohaidx:target_index>Local-Number:s</kohaidx:target_index>
   </kohaidx:index_control_field>
   
index 02509b3..1a9257b 100644 (file)
@@ -50,7 +50,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml)
     </z:index>
   </xslo:template>
   <xslo:template match="marc:controlfield[@tag='001']">
-    <z:index name="Local-Number:w Local-Number:s">
+    <z:index name="Local-Number:w Local-Number:n Local-Number:s">
       <xslo:value-of select="."/>
     </z:index>
   </xslo:template>
index e76107c..f185887 100644 (file)
@@ -19,7 +19,7 @@ systag sysno rank
 xpath enable
 
 all any
-melm 001 Local-Number,Local-Number:s
+melm 001 Local-Number,Local-Number:n,Local-Number:s
 melm 942$a authtype:w,authtype:p
 
 # Personal Name
index 18245c0..c6ed01f 100644 (file)
@@ -11,7 +11,7 @@ systag sysno rank
 xpath enable
 
 all any
-melm 001 Local-Number,Local-Number:s
+melm 001 Local-Number,Local-Number:n,Local-Number:s
 melm 942$a authtype
 melm 152$b authtype:w,authtype:p
 
index 50e2728..fdfbaef 100644 (file)
@@ -523,6 +523,8 @@ a2ensite koha
 invoke-rc.d apache2 reload
 
 koha_script=`makefile_value KOHA_DEST_SCRIPT_DIR`
+ln -s "$koha_script"/koha-index-daemon-ctl.sh  /etc/init.d/koha-index-daemon
+update-rc.d koha-index-daemon defaults
 
 # TODO:
 # - add translator
index 5bd39a2..7a1a9a3 100644 (file)
@@ -106,3 +106,4 @@ Fällig am: <<issues.date_due>><br />
    <li><<items.barcode>></li>
    <li><<items.itemcallnumber>></li>
 </ul>', 1);
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
index ed45274..3c45e08 100644 (file)
@@ -50,3 +50,10 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_N
 -- OPAC Suggestions reasons
 INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','damaged','Vorhandenes Exemplar ist beschädigt','Vorhandenes Exemplar ist beschädigt');
 INSERT INTO authorised_values (category,authorised_value,lib,lib_opac) VALUES ('OPAC_SUG','bestseller','Neuerscheinung von bekanntem Verfasser','Neuerscheinung von bekanntem Verfasser');
+
+-- Report groups
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CIRC', 'Ausleihe');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CAT', 'Katalog');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Benutzer');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Erwerbung');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Gebühren');
index 6fa0a54..77fb501 100644 (file)
@@ -7,6 +7,7 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f
 ('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'), 
 ('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'), 
 ('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
+('circulation','RENEWAL','Item Renewals','Item Renewals','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
 ('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>\r\n<<branches.branchcity>> <<branches.branchzip>>'),
 ('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup (print notice)', '<<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n\r\n\r\nChange Service Requested\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>>\r\n<<borrowers.address>>\r\n<<borrowers.city>> <<borrowers.zipcode>>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
 ('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
@@ -105,3 +106,16 @@ Date due: <<issues.date_due>><br />
    <li><<items.barcode>></li>
    <li><<items.itemcallnumber>></li>
 </ul>', 1);
+
+INSERT INTO `letter` (`module`,`code`,`branchcode`,`name`,`is_html`,`title`,`content`)
+VALUES (
+'members',  'OPAC_REG_VERIFY',  '',  'Opac Self-Registration Verification Email',  '1',  'Verify Your Account',  'Hello!
+
+Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
+
+http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
+
+If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
+);
+
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
old mode 100644 (file)
new mode 100755 (executable)
index 90a3bed..dac8b29
@@ -63,6 +63,9 @@ VALUES( 'ar', 'language', 'en', 'Arabic');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'ar', 'language', 'fr', 'Arabe');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'ar', 'language', 'de', 'Arabisch');
+
 -- Armenian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'hy', 'language', 'Armenian','2005-10-16');
@@ -79,6 +82,9 @@ VALUES( 'hy', 'language', 'en', 'Armenian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'hy', 'language', 'fr', 'Armenian');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'hy', 'language', 'de', 'Armenisch');
+
 -- Bulgarian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'bg', 'language', 'Bulgarian','2005-10-16');
@@ -95,6 +101,9 @@ VALUES( 'bg', 'language', 'en', 'Bulgarian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'bg', 'language', 'fr', 'Bulgare');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'bg', 'language', 'de', 'Bulgarisch');
+
 -- Chinese
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'zh', 'language', 'Chinese','2005-10-16');
@@ -111,6 +120,9 @@ VALUES( 'zh', 'language', 'en', 'Chinese');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'zh', 'language', 'fr', 'Chinois');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'zh', 'language', 'de', 'Chinesisch');
+
 -- Czech
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'cs', 'language', 'Czech','2005-10-16' );
@@ -127,6 +139,9 @@ VALUES( 'cs', 'language', 'en', 'Czech');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'cs', 'language', 'fr', 'Tchèque');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'cs', 'language', 'de', 'Tschechisch');
+
 -- Danish
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'da', 'language', 'Danish','2005-10-16' );
@@ -143,6 +158,9 @@ VALUES( 'da', 'language', 'en', 'Danish');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'da', 'language', 'fr', 'Danois');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'da', 'language', 'de', 'Dänisch');
+
 -- Dutch, Flemish
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'nl', 'language', 'Dutch','2005-10-16' );
@@ -159,6 +177,9 @@ VALUES( 'nl', 'language', 'en', 'Dutch');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nl', 'language', 'fr', 'Néerlandais');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nl', 'language', 'de', 'Niederländisch');
+
 -- English
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'en', 'language', 'English','2005-10-16' );
@@ -172,6 +193,9 @@ VALUES( 'en', 'language', 'en', 'English');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'en', 'language', 'fr', 'Anglais');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'en', 'language', 'de', 'Englisch');
+
 -- Finnish
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'fi', 'language', 'Finnish','2005-10-16' );
@@ -185,6 +209,9 @@ VALUES( 'fi', 'language', 'fi', 'suomi');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'fi', 'language', 'en', 'Finnish');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'fi', 'language', 'de', 'Finnisch');
+
 -- French
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'fr', 'language', 'French','2005-10-16' );
@@ -198,6 +225,9 @@ VALUES( 'fr', 'language', 'en', 'French');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'fr', 'language', 'fr', 'Fran&ccedil;ais');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'fr', 'language', 'de', 'Französisch');
+
 -- INSERT INTO language_descriptions(subtag, type, lang, description)
 -- VALUES( 'fr-CA', 'language', 'fr-CA', 'fran&ccedil;ais');
 
@@ -214,6 +244,12 @@ VALUES( 'lo', 'language', 'lo', '&#3742;&#3762;&#3754;&#3762;&#3749;&#3762;&#375
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'lo', 'language', 'en', 'Lao');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'lo', 'language', 'fr', 'Laotien');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'lo', 'language', 'de', 'Laotisch');
+
 -- German
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'de', 'language', 'German','2005-10-16' );
@@ -246,6 +282,9 @@ VALUES( 'el', 'language', 'en', 'Greek, Modern [1453- ]');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'el', 'language', 'fr', 'Grec Moderne (Après 1453)');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'el', 'language', 'de', 'Griechisch (Nach 1453)');
+
 -- Hebrew
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'he', 'language', 'Hebrew','2005-10-16');
@@ -262,6 +301,9 @@ VALUES( 'he', 'language', 'en', 'Hebrew');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'he', 'language', 'fr', 'Hébreu');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'he', 'language', 'de', 'Hebräisch');
+
 -- Hindi
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'hi', 'language', 'Hindi','2005-10-16');
@@ -278,6 +320,9 @@ VALUES( 'hi', 'language', 'en', 'Hindi');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'hi', 'language', 'fr', 'Hindi');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'hi', 'language', 'de', 'Hindi');
+
 -- Hungarian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'hu', 'language', 'Hungarian','2005-10-16' );
@@ -294,6 +339,9 @@ VALUES( 'hu', 'language', 'en', 'Hungarian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'hu', 'language', 'fr', 'Hongrois');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'hu', 'language', 'de', 'Ungarisch');
+
 -- Indonesian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'id', 'language', 'Indonesian','2005-10-16' );
@@ -310,6 +358,9 @@ VALUES( 'id', 'language', 'en', 'Indonesian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'id', 'language', 'fr', 'Indonésien');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'id', 'language', 'de', 'Indonesisch');
+
 -- Italian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'it', 'language', 'Italian','2005-10-16' );
@@ -326,6 +377,9 @@ VALUES( 'it', 'language', 'en', 'Italian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'it', 'language', 'fr', 'Italien');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'it', 'language', 'de', 'Italienisch');
+
 -- Japanese
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'ja', 'language', 'Japanese','2005-10-16');
@@ -342,6 +396,9 @@ VALUES( 'ja', 'language', 'en', 'Japanese');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'ja', 'language', 'fr', 'Japonais');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'ja', 'language', 'de', 'Japanisch');
+
 -- Korean
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'ko', 'language', 'Korean','2005-10-16');
@@ -358,6 +415,9 @@ VALUES( 'ko', 'language', 'en', 'Korean');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'ko', 'language', 'fr', 'Coréen');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'ko', 'language', 'de', 'Koreanisch');
+
 -- Latin
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'la', 'language', 'Latin','2005-10-16' );
@@ -374,6 +434,9 @@ VALUES( 'la', 'language', 'en', 'Latin');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'la', 'language', 'fr', 'Latin');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'la', 'language', 'de', 'Latein');
+
 -- Galician
 
 INSERT INTO language_subtag_registry( subtag, type, description, added)
@@ -388,6 +451,9 @@ VALUES( 'gl', 'language', 'gl', 'Galego');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'gl', 'language', 'en', 'Galician');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'gl', 'language', 'fr', 'Galicien');
+
 -- Norwegian (bokmÃ¥l)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'nb', 'language', 'Norwegian bokm&#229;l','2005-10-16' );
@@ -407,6 +473,9 @@ VALUES( 'nb', 'language', 'en', 'Norwegian bokm&#229;l');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nb', 'language', 'fr', 'Norvégien bokm&#229;l');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nb', 'language', 'de', 'Norwegisch bokm&#229;l');
+
 -- Norwegian (nynorsk)
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'nn', 'language', 'Norwegian nynorsk','2011-02-14' );
@@ -426,6 +495,9 @@ VALUES( 'nn', 'language', 'en', 'Norwegian nynorsk');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'nn', 'language', 'fr', 'Norvégien nynorsk');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'nn', 'language', 'de', 'Norwegisch nynorsk');
+
 -- Persian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'fa', 'language', 'Persian','2005-10-16');
@@ -442,6 +514,9 @@ VALUES( 'fa', 'language', 'en', 'Persian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'fa', 'language', 'fr', 'Persan');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'fa', 'language', 'de', 'Persisch');
+
 -- Polish
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'pl', 'language', 'Polish','2005-10-16' );
@@ -458,6 +533,9 @@ VALUES( 'pl', 'language', 'en', 'Polish');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'pl', 'language', 'fr', 'Polonais');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'pl', 'language', 'de', 'Polnisch');
+
 -- Portuguese
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'pt', 'language', 'Portuguese','2005-10-16' );
@@ -474,6 +552,9 @@ VALUES( 'pt', 'language', 'en', 'Portuguese');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'pt', 'language', 'fr', 'Portugais');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'pt', 'language', 'de', 'Portugiesisch');
+
 -- Romanian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'ro', 'language', 'Romanian','2005-10-16' );
@@ -490,6 +571,9 @@ VALUES( 'ro', 'language', 'en', 'Romanian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'ro', 'language', 'fr', 'Roumain');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'ro', 'language', 'de', 'Rumänisch');
+
 -- Russian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'ru', 'language', 'Russian','2005-10-16');
@@ -506,6 +590,9 @@ VALUES( 'ru', 'language', 'en', 'Russian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'ru', 'language', 'fr', 'Russe');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'ru', 'language', 'de', 'Russisch');
+
 -- Serbian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'sr', 'language', 'Serbian','2005-10-16' );
@@ -519,6 +606,12 @@ VALUES( 'sr', 'language', 'sr', '&#1089;&#1088;&#1087;&#1089;&#1082;&#1080;');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'sr', 'language', 'en', 'Serbian');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'sr', 'language', 'fr', 'Serbe');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'sr', 'language', 'de', 'Serbisch');
+
 -- Spanish, Castilian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'es', 'language', 'Spanish','2005-10-16' );
@@ -535,6 +628,9 @@ VALUES( 'es', 'language', 'en', 'Spanish');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'es', 'language', 'fr', 'Espagnol');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'es', 'language', 'de', 'Spanisch');
+
 -- Swedish
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'sv', 'language', 'Swedish','2005-10-16' );
@@ -551,6 +647,9 @@ VALUES( 'sv', 'language', 'en', 'Swedish');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'sv', 'language', 'fr', 'Suédois');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'sv', 'language', 'de', 'Schwedisch');
+
 -- Tetum
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'tet', 'language', 'Tetum','2005-10-16' );
@@ -564,6 +663,12 @@ VALUES( 'tet', 'language', 'tet', 'tetun');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'tet', 'language', 'en', 'Tetum');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'tet', 'language', 'fr', 'Tétoum');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'tet', 'language', 'de', 'Tetum');
+
 -- Thai
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'th', 'language', 'Thai','2005-10-16');
@@ -580,6 +685,9 @@ VALUES( 'th', 'language', 'en', 'Thai');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'th', 'language', 'fr', 'Thaï');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'th', 'language', 'de', 'Thailändisch');
+
 -- Turkish
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'tr', 'language', 'Turkish','2005-10-16' );
@@ -596,6 +704,8 @@ VALUES( 'tr', 'language', 'en', 'Turkish');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'tr', 'language', 'fr', 'Turc');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'tr', 'language', 'de', 'Türkisch');
 
 -- Ukranian
 INSERT INTO language_subtag_registry( subtag, type, description, added)
@@ -613,6 +723,9 @@ VALUES( 'uk', 'language', 'en', 'Ukranian');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'uk', 'language', 'fr', 'Ukrainien');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'uk', 'language', 'de', 'Ukrainisch');
+
 -- Urdu
 INSERT INTO language_subtag_registry( subtag, type, description, added)
 VALUES ( 'ur', 'language', 'Urdu','2005-10-16' );
@@ -626,6 +739,12 @@ VALUES( 'ur', 'language', 'en', 'Urdu');
 INSERT INTO language_descriptions(subtag, type, lang, description)
 VALUES( 'ur', 'language', 'ur', '&#1575;&#1585;&#1583;&#1608;');
 
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'ur', 'language', 'fr', 'Ourdou');
+
+INSERT INTO language_descriptions(subtag, type, lang, description)
+VALUES( 'ur', 'language', 'de', 'Urdu');
+
 -- SCRIPTS
 -- Arabic
 INSERT INTO language_subtag_registry( subtag, type, description, added)
index e1c7917..db6df3d 100644 (file)
@@ -50,3 +50,10 @@ INSERT INTO `authorised_values` (category, authorised_value, lib) VALUES ('BOR_N
 -- 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');
+
+-- Report groups
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CIRC', 'Circulation');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CAT', 'Catalog');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Patrons');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Acquisitions');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Accounts');
index 0450bd0..26a7c81 100644 (file)
@@ -16,3 +16,4 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f
 ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
index 1056d14..ad91561 100644 (file)
@@ -18,3 +18,4 @@ VALUES
 ('suggestions','AVAILABLE','Suggestion disponible', 'Suggestion d\'achat disponible','cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une suggestion d\'achat pour le docuement  <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous aviez demandé est maintenant disponible dans nos collections.\n\nSi vous avez des questions, merci de nous contacter par courriel Ã  l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
 ('suggestions','ORDERED','Suggestion commandée', 'Suggestion commandée','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une demande de suggestion d\'achat sur le docuement <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous avez demandé est maintenant en commande. Le document devrait arriver rapidement dans nos collections.\n\nVous serez averti quand le docuement sera disponible.\n\nSi vous avez des questions, merci de nous contacter Ã  l\'adresse <<branches.branchemail>>\n\nMerci,\n\n<<branches.branchname>>'),
 ('suggestions','REJECTED','Suggestion rejetée', 'Suggestion d\'achat rejeté','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez fait la demande du document <<suggestions.title>> de <<suggestions.author>>.\n\nla Bibliothèque a examiné votre demande ce jour, et a décidé de ne pas retenir la suggestion pour l\'instant.\n\nLa raison est la suivante: <<suggestions.reason>>\n\nSi vous avez des questions, merci de nous contacter Ã  l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>');
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','Les documents suivants ont Ã©té renouvelés\r\n----\r\n<<biblio.title>>\r\n----\r\nMerci, <<branches.branchname>>.');
index cd78c83..f45d637 100644 (file)
@@ -79,4 +79,11 @@ INSERT INTO authorised_values (category, authorised_value, lib) VALUES
 ('LANG', 'fre', 'francese'),
 ('LANG', 'lat', 'latino');
 
+-- Raggruppamenti di esempio per i reports
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CIRC', 'Circulation');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'CAT', 'Catalog');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'PAT', 'Patrons');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACQ', 'Acquisitions');
+INSERT INTO authorised_values (category, authorised_value, lib) VALUES ('REPORT_GROUP', 'ACC', 'Accounts');
+
 SET FOREIGN_KEY_CHECKS=1;
index d0b5348..cf5424e 100644 (file)
@@ -3,8 +3,8 @@ SET FOREIGN_KEY_CHECKS=0;
 INSERT INTO permissions (module_bit, code, description) VALUES
    ( 1, 'circulate_remaining_permissions', 'Permessi rimanenti per la circolazione'),
    ( 1, 'override_renewals', 'Sblocca i rinnovi bloccati'),
-   ( 3, 'parameters_remaining_permissions', 'Remaining system parameters permissions'),
-   ( 3, 'manage_circ_rules', 'manage circulation rules'),
+   ( 3, 'parameters_remaining_permissions', 'Permessi rimanenti'),
+   ( 3, 'manage_circ_rules', 'Gestisci regole circolazione'),
    ( 6, 'place_holds', 'Fai prenotazioni per gli utenti'),
    ( 6, 'modify_holds_priority', 'Modifica priorità prenotazioni'),
    ( 9, 'edit_catalogue', 'Cataloga (crea/modifica dati bibliografici e di copia)'),
@@ -20,26 +20,26 @@ INSERT INTO permissions (module_bit, code, description) VALUES
    (11, 'group_manage', 'Gestisci ordini e raccoglitori raggruppati'),
    (11, 'order_receive', 'Gestisci arrivi'),
    (11, 'budget_add_del', 'Aggiungi e cancella budgets (senza modificarli)'),
-   (11, 'budget_manage_all', 'Manage all budgets'),
+   (11, 'budget_manage_all', 'Gestisci tutti i budgets'),
    (13, 'edit_news', 'Scrivi le news per l\'OPAC e per l\'interfaccia staff'),
    (13, 'label_creator', 'Crea etichette da stampare e barcodes dal catalogo e dai dati degli utenti'),
    (13, 'edit_calendar', 'Definisci i giorni di chiusura della biblioteca'),
    (13, 'moderate_comments', 'Modera i commenti degli utenti'),
    (13, 'edit_notices', 'Definisci le notifiche'),
    (13, 'edit_notice_status_triggers', 'Imposta il messaggio o lo stato delle notifiche per le copie in ritardo'),
-   (13, 'edit_quotes', 'Edit quotes for quote-of-the-day feature'),
+   (13, 'edit_quotes', 'Modifica suggerimenti/citazioni per la feature corrispondente'),
    (13, 'view_system_logs', 'Scorri i log di sistema'),
    (13, 'inventory', 'Lavora sugli inventari (stocktaking) del tuo catalogo'),
    (13, 'stage_marc_import', 'Opera sui Record MARC presenti nella zona di lavoro'),
    (13, 'manage_staged_marc', 'Gestisci i record MARC in lavorazione, inclusi il completare e il cancellare gli import'),
    (13, 'export_catalog', 'Esporta i dati bibliografici e di copia'),
    (13, 'import_patrons', 'Importa i dati utente'),
-   (13, 'edit_patrons', 'Perform batch modification of patrons'),
+   (13, 'edit_patrons', 'Modifica utenti via batch'),
    (13, 'delete_anonymize_patrons', 'Cancella i vecchi prestiti e rendi anonimo lo storico della circolazione (canella in lettura lo storico utenti prestito)'),
    (13, 'batch_upload_patron_images', 'Aggiorna le foto utente in modalità batch o al momento'),
    (13, 'schedule_tasks', 'Schedula i task da far andare'),
-   (13, 'items_batchmod', 'Perform batch modification of items'),
-   (13, 'items_batchdel', 'Perform batch deletion of items'),
+   (13, 'items_batchmod', 'Abilita alla modifica batch delle copie'),
+   (13, 'items_batchdel', 'Abilita alla cancellazione via batch delle copie'),
    (13, 'manage_csv_profiles', 'Gestisci i profili CSV di export'),
    (13, 'moderate_tags', 'Modera i tag inseriti dagli utenti'),
    (13, 'rotating_collections', 'Gestisci le collezioni circolanti (rotating collections)'),
index cc9fb21..ed673da 100644 (file)
@@ -1920,6 +1920,7 @@ CREATE TABLE `subscription` (
   `opacdisplaycount` VARCHAR(10) NULL,
   `graceperiod` int(11) NOT NULL default '0',
   `enddate` date default NULL,
+  `closed` INT(1) NOT NULL DEFAULT 0,
   PRIMARY KEY  (`subscriptionid`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
@@ -2824,7 +2825,8 @@ CREATE TABLE `aqorders_items` ( -- information on items entered in the acquisiti
   `itemnumber` int(11) NOT NULL, -- the item number for this item (items.itemnumber)
   `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order item was last touched
   PRIMARY KEY  (`itemnumber`),
-  KEY `ordernumber` (`ordernumber`)
+  KEY `ordernumber` (`ordernumber`),
+  CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 
@@ -2938,6 +2940,122 @@ CREATE TABLE `quotes` (
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
+--
+-- Table structure for table categories_branches
+--
+
+DROP TABLE IF EXISTS categories_branches;
+CREATE TABLE categories_branches( -- association table between categories and branches
+    categorycode VARCHAR(10),
+    branchcode VARCHAR(10),
+    FOREIGN KEY (categorycode) REFERENCES categories(categorycode) ON DELETE CASCADE,
+    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table authorised_values_branches
+--
+
+DROP TABLE IF EXISTS authorised_values_branches;
+CREATE TABLE authorised_values_branches( -- association table between authorised_values and branches
+    av_id INTEGER,
+    branchcode VARCHAR(10),
+    FOREIGN KEY (av_id) REFERENCES authorised_values(id) ON DELETE CASCADE,
+    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+
+--
+-- Table structure for table borrower_attribute_types_branches
+--
+
+DROP TABLE IF EXISTS borrower_attribute_types_branches;
+CREATE TABLE borrower_attribute_types_branches( -- association table between borrower_attribute_types and branches
+    bat_code VARCHAR(10),
+    b_branchcode VARCHAR(10),
+    FOREIGN KEY (bat_code) REFERENCES borrower_attribute_types(code) ON DELETE CASCADE,
+    FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
+) ENGINE=INNODB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table `borrower_modifications`
+--
+
+CREATE TABLE IF NOT EXISTS `borrower_modifications` (
+  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  `verification_token` varchar(255) NOT NULL DEFAULT '',
+  `borrowernumber` int(11) NOT NULL DEFAULT '0',
+  `cardnumber` varchar(16) DEFAULT NULL,
+  `surname` mediumtext,
+  `firstname` text,
+  `title` mediumtext,
+  `othernames` mediumtext,
+  `initials` text,
+  `streetnumber` varchar(10) DEFAULT NULL,
+  `streettype` varchar(50) DEFAULT NULL,
+  `address` mediumtext,
+  `address2` text,
+  `city` mediumtext,
+  `state` text,
+  `zipcode` varchar(25) DEFAULT NULL,
+  `country` text,
+  `email` mediumtext,
+  `phone` text,
+  `mobile` varchar(50) DEFAULT NULL,
+  `fax` mediumtext,
+  `emailpro` text,
+  `phonepro` text,
+  `B_streetnumber` varchar(10) DEFAULT NULL,
+  `B_streettype` varchar(50) DEFAULT NULL,
+  `B_address` varchar(100) DEFAULT NULL,
+  `B_address2` text,
+  `B_city` mediumtext,
+  `B_state` text,
+  `B_zipcode` varchar(25) DEFAULT NULL,
+  `B_country` text,
+  `B_email` text,
+  `B_phone` mediumtext,
+  `dateofbirth` date DEFAULT NULL,
+  `branchcode` varchar(10) DEFAULT NULL,
+  `categorycode` varchar(10) DEFAULT NULL,
+  `dateenrolled` date DEFAULT NULL,
+  `dateexpiry` date DEFAULT NULL,
+  `gonenoaddress` tinyint(1) DEFAULT NULL,
+  `lost` tinyint(1) DEFAULT NULL,
+  `debarred` date DEFAULT NULL,
+  `debarredcomment` varchar(255) DEFAULT NULL,
+  `contactname` mediumtext,
+  `contactfirstname` text,
+  `contacttitle` text,
+  `guarantorid` int(11) DEFAULT NULL,
+  `borrowernotes` mediumtext,
+  `relationship` varchar(100) DEFAULT NULL,
+  `ethnicity` varchar(50) DEFAULT NULL,
+  `ethnotes` varchar(255) DEFAULT NULL,
+  `sex` varchar(1) DEFAULT NULL,
+  `password` varchar(30) DEFAULT NULL,
+  `flags` int(11) DEFAULT NULL,
+  `userid` varchar(75) DEFAULT NULL,
+  `opacnote` mediumtext,
+  `contactnote` varchar(255) DEFAULT NULL,
+  `sort1` varchar(80) DEFAULT NULL,
+  `sort2` varchar(80) DEFAULT NULL,
+  `altcontactfirstname` varchar(255) DEFAULT NULL,
+  `altcontactsurname` varchar(255) DEFAULT NULL,
+  `altcontactaddress1` varchar(255) DEFAULT NULL,
+  `altcontactaddress2` varchar(255) DEFAULT NULL,
+  `altcontactaddress3` varchar(255) DEFAULT NULL,
+  `altcontactstate` text,
+  `altcontactzipcode` varchar(50) DEFAULT NULL,
+  `altcontactcountry` text,
+  `altcontactphone` varchar(50) DEFAULT NULL,
+  `smsalertnumber` varchar(50) DEFAULT NULL,
+  `privacy` int(11) DEFAULT NULL,
+  PRIMARY KEY (`verification_token`,`borrowernumber`),
+  KEY `verification_token` (`verification_token`),
+  KEY `borrowernumber` (`borrowernumber`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
 /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
index f40da36..9c3e5e2 100644 (file)
@@ -37,3 +37,4 @@ VALUES ('circulation','ODUE','Purring','Purring pÃ¥ dokument','<<borrowers.first
 ('suggestions','AVAILABLE','ForeslÃ¥tt dokument tilgjengelig', 'ForeslÃ¥tt dokument tilgjengelig','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslÃ¥tt at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av Ã¥ informere deg om at dokumentet nÃ¥ er innlemmet i samlingen.\n\nEr det noe du lurer pÃ¥, vennligst kontakt oss pÃ¥ <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
 ('suggestions','ORDERED','Innkjøpsforslag i bestilling', 'Innkjøpsforslag i bestilling','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslÃ¥tt at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nVi har gleden av Ã¥ informere deg om at dokumentet du foreslo nÃ¥ er i bestilling.\n\nDu vil fÃ¥ en ny melding nÃ¥r dokumentet er tilgjengelig.\n\nEr det noe du lurer pÃ¥, vennligst kontakt oss pÃ¥ <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>'),
 ('suggestions','REJECTED','Innkjøpsforslag avslÃ¥tt', 'Innkjøpsforslag avslÃ¥tt','<<borrowers.firstname>> <<borrowers.surname>>,\n\nDu har foreslÃ¥tt at biblioteket kjøper inn <<suggestions.title>> av <<suggestions.author>>.\n\nBiblioteket har vurdert innkjøpsforslaget ditt i dag, og bestemt seg for Ã¥ ikke ta det til følge.\n\nBegrunnelse: <<suggestions.reason>>\n\nEr det noe du lurer pÃ¥, vennligst kontakt oss pÃ¥ <<branches.branchemail>>.\n\nVennlig hilsen,\n\n<<branches.branchname>>');
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
index 73102af..69812fd 100644 (file)
@@ -18,3 +18,4 @@ VALUES
 ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
index e13782a..358783e 100644 (file)
@@ -16,3 +16,4 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f
 ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
index 44f9eb3..d5d15d7 100644 (file)
@@ -352,7 +352,7 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAllowSharingPrivateLists',0,'If set, allows opac users to share private lists with other patrons',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('Babeltheque_url_js','','Url for Babeltheque javascript (e.g. http://www.babeltheque.com/bw_XX.js)','','Free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('Babeltheque_url_update', '', 'Url for Babeltheque update (E.G. http://www.babeltheque.com/.../file.csv.bz2)', '', 'Free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SocialNetworks','1','Enable/Disable social networks links in opac detail pages','','YesNo');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('SocialNetworks','0','Enable/Disable social networks links in opac detail pages','','YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('SubscriptionDuplicateDroppedInput','','','List of fields which must not be rewritten when a subscription is duplicated (Separated by pipe |)','Free');
 INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('AutoResumeSuspendedHolds',  '1', NULL ,  'Allow suspended holds to be automatically resumed by a set date.',  'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice');
@@ -387,3 +387,22 @@ INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdid
 INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet than can be expanded into browse links, e.g. on Home > Patrons',NULL,'free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo');
+INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
+('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
+('PatronSelfRegistrationVerifyByEmail', '0', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.', 'YesNo'),
+('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
+('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'),
+('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
+('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalSendNotice','0', NULL, '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaEnabled','not','Show a tab with a HTML5 media player for files catalogued in field 856','not|opac|staff|both','Choice');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','Media file extensions','','free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldsOnPatronsPossessions', '1', 'Allow holds on records that patron have items of it',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free');
+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserCSS', '', NULL, 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free');
+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('SCOUserJS', '', NULL, 'Define custom javascript for inclusion in the SCO module', 'free');
index a908f6c..b7e67c5 100644 (file)
@@ -15,3 +15,4 @@ VALUES ('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.f
 ('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
 ('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
+INSERT INTO `letter` (module, code, name, title, content) VALUES ('circulation','RENEWAL','Item Renewal','Renewals','The following items have been renew:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
index 966ec9b..77265f4 100755 (executable)
@@ -64,6 +64,7 @@ GetOptions(
 my $dbh = C4::Context->dbh;
 $|=1; # flushes output
 
+local $dbh->{RaiseError} = 0;
 
 # Record the version we are coming from
 
@@ -5713,7 +5714,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
           ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
 
     print "Upgrade to $DBversion done (creating `transport_cost` table; adding UseTransportCostMatrix systempref, in circulation)\n";
-    SetVersion ($DBversion);
+    SetVersion($DBversion);
 }
 
 $DBversion ="3.09.00.038";
@@ -5926,7 +5927,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
-
 $DBversion = "3.09.00.053";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     $dbh->do(
@@ -6012,7 +6012,6 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
     SetVersion ($DBversion);
 }
 
-
 $DBversion = "3.09.00.062";
 if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
    $dbh->do("UPDATE systempreferences SET value=0 WHERE variable='NoZebra'");
@@ -6080,9 +6079,266 @@ $DBversion = "3.11.00.001";
 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('alphabet','A B C D E F G H I J K L M N O P Q R S T U V W X Y Z','Alphabet that can be expanded into browse links, e.g. on Home > Patrons',NULL,'free')");
     print "Upgrade to $DBversion done (Bug 2832 - Add alphabet syspref)\n";
+}
+
+$DBversion = "3.11.00.002";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do(q{
+        DELETE from aqorders_items where ordernumber NOT IN (SELECT ordernumber FROM aqorders);
+    });
+    $dbh->do(q{
+        ALTER TABLE aqorders_items
+        ADD CONSTRAINT aqorders_items_ibfk_1 FOREIGN KEY (ordernumber) REFERENCES aqorders (ordernumber)
+        ON DELETE CASCADE ON UPDATE CASCADE;
+    });
+    print "Upgrade to $DBversion done (Bug 9030: Add constraint on aqorders_items.ordernumber)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.003";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lost item is returned.', NULL, 'YesNo')");
+    print "Upgrade to $DBversion done (Bug 7189: Add system preference RefundLostItemFeeOnReturn)\n";
     SetVersion($DBversion);
 }
 
+$DBversion = "3.11.00.004";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do(qq{
+        ALTER TABLE subscription ADD COLUMN closed INT(1) NOT NULL DEFAULT 0 AFTER enddate;
+    });
+
+    print "Upgrade to $DBversion done (Bug 8782: Add field subscription.closed)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.005";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do(qq{CREATE TABLE borrower_attribute_types_branches(bat_code VARCHAR(10), b_branchcode VARCHAR(10),FOREIGN KEY (bat_code) REFERENCES borrower_attribute_types(code) ON DELETE CASCADE,FOREIGN KEY (b_branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=utf8;});
+
+    $dbh->do(qq{CREATE TABLE categories_branches(categorycode VARCHAR(10), branchcode VARCHAR(10), FOREIGN KEY (categorycode) REFERENCES categories(categorycode) ON DELETE CASCADE, FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=utf8;});
+
+    $dbh->do(qq{CREATE TABLE authorised_values_branches(av_id INTEGER, branchcode VARCHAR(10), FOREIGN KEY (av_id) REFERENCES authorised_values(id) ON DELETE CASCADE, FOREIGN KEY  (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE ) ENGINE=INNODB DEFAULT CHARSET=utf8;});
+
+    print "Upgrade to $DBversion done (Bug 7919: Display of values depending on the connexion library)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.006";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do(q{
+        UPDATE virtualshelves SET sortfield="copyrightdate" where sortfield="year";
+    });
+    print "Upgrade to $DBversion done (Bug 9167: Update the virtualshelves.sortfield column with 'copyrightdate' if needed)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.007";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ar', 'language', 'de', 'Arabisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'hy', 'language', 'de', 'Armenisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'bg', 'language', 'de', 'Bulgarisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'zh', 'language', 'de', 'Chinesisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'cs', 'language', 'de', 'Tschechisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'da', 'language', 'de', 'Dänisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'nl', 'language', 'de', 'Niederländisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'en', 'language', 'de', 'Englisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'fi', 'language', 'de', 'Finnisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'fr', 'language', 'de', 'Französisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'lo', 'language', 'fr', 'Laotien')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'lo', 'language', 'de', 'Laotisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'el', 'language', 'de', 'Griechisch (Nach 1453)')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'he', 'language', 'de', 'Hebräisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'hi', 'language', 'de', 'Hindi')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'hu', 'language', 'de', 'Ungarisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'id', 'language', 'de', 'Indonesisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'it', 'language', 'de', 'Italienisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ja', 'language', 'de', 'Japanisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ko', 'language', 'de', 'Koreanisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'la', 'language', 'de', 'Latein')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'gl', 'language', 'fr', 'Galicien')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'gl', 'language', 'de', 'Galizisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'nb', 'language', 'de', 'Norwegisch bokm&#229;l')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'nn', 'language', 'de', 'Norwegisch nynorsk')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'fa', 'language', 'de', 'Persisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'pl', 'language', 'de', 'Polnisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'pt', 'language', 'de', 'Portugiesisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ro', 'language', 'de', 'Rumänisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ru', 'language', 'de', 'Russisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'sr', 'language', 'fr', 'Serbe')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'sr', 'language', 'de', 'Serbisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'es', 'language', 'de', 'Spanisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'sv', 'language', 'de', 'Schwedisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'tet', 'language', 'fr', 'Tétoum')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'tet', 'language', 'de', 'Tetum')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'th', 'language', 'de', 'Thailändisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'tr', 'language', 'de', 'Türkisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'uk', 'language', 'de', 'Ukrainisch')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ur', 'language', 'fr', 'Ourdou')");
+    $dbh->do("INSERT INTO language_descriptions (subtag, type, lang, description) VALUES( 'ur', 'language', 'de', 'Urdu')");
+    print "Upgrade to $DBversion done (Bug 9056: add German and a couple of French translations to language_descriptions)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.008";
+if (CheckVersion($DBversion)) {
+    $dbh->do("
+        CREATE TABLE IF NOT EXISTS `borrower_modifications` (
+          `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+          `verification_token` varchar(255) NOT NULL DEFAULT '',
+          `borrowernumber` int(11) NOT NULL DEFAULT '0',
+          `cardnumber` varchar(16) DEFAULT NULL,
+          `surname` mediumtext,
+          `firstname` text,
+          `title` mediumtext,
+          `othernames` mediumtext,
+          `initials` text,
+          `streetnumber` varchar(10) DEFAULT NULL,
+          `streettype` varchar(50) DEFAULT NULL,
+          `address` mediumtext,
+          `address2` text,
+          `city` mediumtext,
+          `state` text,
+          `zipcode` varchar(25) DEFAULT NULL,
+          `country` text,
+          `email` mediumtext,
+          `phone` text,
+          `mobile` varchar(50) DEFAULT NULL,
+          `fax` mediumtext,
+          `emailpro` text,
+          `phonepro` text,
+          `B_streetnumber` varchar(10) DEFAULT NULL,
+          `B_streettype` varchar(50) DEFAULT NULL,
+          `B_address` varchar(100) DEFAULT NULL,
+          `B_address2` text,
+          `B_city` mediumtext,
+          `B_state` text,
+          `B_zipcode` varchar(25) DEFAULT NULL,
+          `B_country` text,
+          `B_email` text,
+          `B_phone` mediumtext,
+          `dateofbirth` date DEFAULT NULL,
+          `branchcode` varchar(10) DEFAULT NULL,
+          `categorycode` varchar(10) DEFAULT NULL,
+          `dateenrolled` date DEFAULT NULL,
+          `dateexpiry` date DEFAULT NULL,
+          `gonenoaddress` tinyint(1) DEFAULT NULL,
+          `lost` tinyint(1) DEFAULT NULL,
+          `debarred` date DEFAULT NULL,
+          `debarredcomment` varchar(255) DEFAULT NULL,
+          `contactname` mediumtext,
+          `contactfirstname` text,
+          `contacttitle` text,
+          `guarantorid` int(11) DEFAULT NULL,
+          `borrowernotes` mediumtext,
+          `relationship` varchar(100) DEFAULT NULL,
+          `ethnicity` varchar(50) DEFAULT NULL,
+          `ethnotes` varchar(255) DEFAULT NULL,
+          `sex` varchar(1) DEFAULT NULL,
+          `password` varchar(30) DEFAULT NULL,
+          `flags` int(11) DEFAULT NULL,
+          `userid` varchar(75) DEFAULT NULL,
+          `opacnote` mediumtext,
+          `contactnote` varchar(255) DEFAULT NULL,
+          `sort1` varchar(80) DEFAULT NULL,
+          `sort2` varchar(80) DEFAULT NULL,
+          `altcontactfirstname` varchar(255) DEFAULT NULL,
+          `altcontactsurname` varchar(255) DEFAULT NULL,
+          `altcontactaddress1` varchar(255) DEFAULT NULL,
+          `altcontactaddress2` varchar(255) DEFAULT NULL,
+          `altcontactaddress3` varchar(255) DEFAULT NULL,
+          `altcontactstate` text,
+          `altcontactzipcode` varchar(50) DEFAULT NULL,
+          `altcontactcountry` text,
+          `altcontactphone` varchar(50) DEFAULT NULL,
+          `smsalertnumber` varchar(50) DEFAULT NULL,
+          `privacy` int(11) DEFAULT NULL,
+          PRIMARY KEY (`verification_token`,`borrowernumber`),
+          KEY `verification_token` (`verification_token`),
+          KEY `borrowernumber` (`borrowernumber`)
+        ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+");
+
+    $dbh->do("
+        INSERT INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES
+        ('PatronSelfRegistration', '0', NULL, 'If enabled, patrons will be able to register themselves via the OPAC.', 'YesNo'),
+        ('PatronSelfRegistrationVerifyByEmail', '0', NULL, 'If enabled, any patron attempting to register themselves via the OPAC will be required to verify themselves via email to activate his or her account.', 'YesNo'),
+        ('PatronSelfRegistrationDefaultCategory', '', '', 'A patron registered via the OPAC will receive a borrower category code set in this system preference.', 'free'),
+        ('PatronSelfRegistrationExpireTemporaryAccountsDelay', '0', NULL, 'If PatronSelfRegistrationDefaultCategory is enabled, this system preference controls how long a patron can have a temporary status before the account is deleted automatically. It is an integer value representing a number of days to wait before deleting a temporary patron account. Setting it to 0 disables the deleting of temporary accounts.', 'Integer'),
+        ('PatronSelfRegistrationBorrowerMandatoryField',  'surname|firstname', NULL ,  'Choose the mandatory fields for a patron''s account, when registering via the OPAC.',  'free'),
+        ('PatronSelfRegistrationBorrowerUnwantedField',  '', NULL ,  'Name the fields you don''t want to display when registering a new patron via the OPAC.',  'free');
+    ");
+
+    $dbh->do("
+    INSERT INTO  letter ( `module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content` )
+    VALUES ( 'members', 'OPAC_REG_VERIFY', '', 'Opac Self-Registration Verification Email', '1', 'Verify Your Account', 'Hello!
+
+    Your library account has been created. Please verify your email address by clicking this link to complete the signup process:
+
+    http://<<OPACBaseURL>>/cgi-bin/koha/opac-registration-verify.pl?token=<<borrower_modifications.verification_token>>
+
+    If you did not initiate this request, you may safely ignore this one-time message. The request will expire shortly.'
+    )");
+
+    print "Upgrade to $DBversion done (Bug 7067: Add Patron Self Registration)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.009";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("
+        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
+        ('SeparateHoldings', '0', 'Separate current branch holdings from other holdings', NULL, 'YesNo'),
+        ('SeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings', 'homebranch|holdingbranch', 'Choice'),
+        ('OpacSeparateHoldings', '0', 'Separate current branch holdings from other holdings (OPAC)', NULL, 'YesNo'),
+        ('OpacSeparateHoldingsBranch', 'homebranch', 'Branch used to separate holdings (OPAC)', 'homebranch|holdingbranch', 'Choice')
+    ");
+
+    print "Upgrade to $DBversion done (Bug 7674: Add systempreferences SeparateHoldings, SeparateHoldingsBranch, OpacSeparateHoldings and OpacSeparateHoldingsBranch) \n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.010";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('RenewalSendNotice', '0', '', NULL, 'YesNo')");
+    $dbh->do(q{
+        INSERT INTO `letter` (`module`, `code`, `name`, `title`, `content`) VALUES
+        ('circulation','RENEWAL','Item Renewals','Item Renewals','The following items have been renewed:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.');
+    });
+    print "Upgrade to $DBversion done (Bug 9151 - Renewal notice according to patron alert preferences)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.011";
+if ( CheckVersion($DBversion) ) {
+   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaEnabled','not','Show a HTML5 media player in a tab on opac-detail.pl for media files catalogued in field 856.','not|opac|staff|both','Choice');");
+   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','Media file extensions','','free');");
+   print "Upgrade to $DBversion done (Bug 8377: Add HTML5MediaEnabled and HTML5MediaExtensions sysprefs)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion = "3.11.00.012";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowHoldsOnPatronsPossessions', '1', 'Allow holds on records that patron have items of it',NULL,'YesNo')");
+    print "Upgrade to $DBversion done (Bug 9206: Only allow place holds in records that the patron don't have in his possession)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.013";
+if ( CheckVersion($DBversion) ) {
+    $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('NotesBlacklist','','List of notes fields that should not appear in the title notes/description separator of details',NULL,'free')");
+    print "Upgrade to $DBversion done (Bug 9162 - Add a system preference to set which notes fields appears on title notes/description separator)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.11.00.014";
+if ( CheckVersion($DBversion) ) {
+   $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SCOUserCSS', '', 'Add CSS to be included in the SCO module in an embedded <style> tag.', 'free' )");
+   $dbh->do("INSERT INTO systempreferences ( variable, value, explanation, type ) VALUES ( 'SCOUserJS', '', 'Define custom javascript for inclusion in the SCO module', 'free' )");
+   print "Upgrade to $DBversion done (Bug 9009: Add SCOUserCSS and SCOUserJS sysprefs)\n";
+   SetVersion ($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
@@ -6164,4 +6420,33 @@ sub SetVersion {
     }
     C4::Context::clear_syspref_cache(); # invalidate cached preferences
 }
+
+=head2 CheckVersion
+
+Check whether a given update should be run when passed the proposed version
+number. The update will always be run if the proposed version is greater
+than the current database version and less than or equal to the version in
+kohaversion.pl. The update is also run if the version contains XXX, though
+this behavior will be changed following the adoption of non-linear updates
+as implemented in bug 7167.
+
+=cut
+
+sub CheckVersion {
+    my ($proposed_version) = @_;
+    my $version_number = TransformToNum($proposed_version);
+
+    # The following line should be deleted when bug 7167 is pushed
+    return 1 if ( $proposed_version =~ m/XXX/ );
+
+    if ( C4::Context->preference("Version") < $version_number
+        && $version_number <= TransformToNum( C4::Context->final_linear_version ) )
+    {
+        return 1;
+    }
+    else {
+        return 0;
+    }
+}
+
 exit;
index d35a471..79ceb48 100644 (file)
@@ -155,4 +155,12 @@ a.tagnum {
 .floating {
        -webkit-box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
        box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, .5);
+}
+
+tr.active td {
+    background-color: #FFFFCC;
+}
+
+tr.active.highlight td {
+    background-color: #FEF4B4;
 }
\ No newline at end of file
index 955b68b..239059c 100644 (file)
@@ -286,25 +286,30 @@ td.debit {
        text-align : left;
        }
 
-div#breadcrumbs,
-div#toplevelnav,
-div#login,
-div#header_search,
-div#toolbar,
-div#changelanguage,
-div#menu,
+#breadcrumbs,
+#toplevelnav,
+#login,
+#header,
+#header_search,
+#toolbar,
+#changelanguage,
+#menu,
+.gradient,
 div.yui-b,
 .noprint,
 form#sortbyform,
 #cartDetails,
 fieldset.action,
 .list-actions,
-.print {
+.print,
+.ui-tabs-nav {
     display: none;
 }
 
-div#yui-main div.yui-b {
-       display : block;
+div#yui-main div.yui-b,
+.ui-tabs .ui-tabs-panel,
+.ui-tabs .ui-tabs-hide {
+    display : block !important;
 }
 
 .yui-t1 #yui-main div.yui-b,
index 63bd81c..349a65d 100644 (file)
@@ -1157,7 +1157,7 @@ div.message {
        background: -webkit-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Opera11.10+ */
        background: -ms-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* W3C */
        border : 1px solid #bcbcbc;
        text-align: center;
@@ -1252,7 +1252,6 @@ div#menu li a {
     background: -webkit-linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* Chrome10+,Safari5.1+ */
      background: -o-linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* IE10+ */
-        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e8f0f6', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
        background: linear-gradient(left, #e8f0f6 0%,#e8f0f6 96%,#c1c1c1 100%); /* W3C */
        -moz-border-top-left-radius: 5px;
        border-top-left-radius: 5px;
@@ -1266,15 +1265,12 @@ div#menu li a {
 }
 
 div#menu li a:hover {
-
-
      background: #fff; /* Old browsers */
    background: -moz-linear-gradient(left, #FAFAFA 0%, #FAFAFA 96%, #e6e6e6 97%, #cccccc 99%, #c1c1c1 100%); /* FF3.6+ */
   background: -webkit-gradient(linear, left top, right top, color-stop(0%,#FAFAFA), color-stop(96%,#FAFAFA), color-stop(97%,#e6e6e6), color-stop(99%,#cccccc), color-stop(100%,#c1c1c1)); /* Chrome,Safari4+ */
   background: -webkit-linear-gradient(left, #FAFAFA 0%,#FAFAFA 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Chrome10+,Safari5.1+ */
      background: -o-linear-gradient(left, #FAFAFA 0%,#FAFAFA 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Opera11.10+ */
    background: -ms-linear-gradient(left, #FAFAFA 0%,#FAFAFA 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* IE10+ */
-        filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
        background: linear-gradient(left, #FAFAFA 0%,#fff 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* W3C */
     border-left: 1px solid #85CA11;
     border-top: 1px solid #85CA11;
@@ -2401,3 +2397,10 @@ div.authorizedheading {
 .ui-timepicker-div dl dd { margin: 0 10px 10px 65px; }
 .ui-timepicker-div td { font-size: 90%; }
 .ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; }
+
+/* jQuery UI Accordion */
+.ui-accordion-header { font-weight: bold; font-size : 110%; }
+
+video {
+    width: 480px;
+}
index 740a3b5..f8e6b4a 100644 (file)
@@ -23,8 +23,7 @@
        function addToCart() { addRecord('[% biblionumber %]'); }
        function addToShelf() { window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes');
        }
-       function printBiblio() {window.open('/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=[% biblionumber %]','Print_Biblio','width=700,height=500,toolbar=false,scrollbars=yes');
-       }
+    function printBiblio() {window.print(); }
 [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
 function confirm_deletion() {
                var count = [% count %];
@@ -235,7 +234,7 @@ function confirm_items_deletion() {
        [% END %]       
 
        <li><a id="addtoshelf" href="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=[% biblionumber %]">Add to shelf</a></li>
-       <li><a id="printbiblio" href="/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=[% biblionumber %]">Print</a></li>
+    <li><span id="printbiblio"></span></li>
        [% IF ( CAN_user_reserveforothers ) %]
     [% UNLESS ( norequests ) %]<li><a id="placehold" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">Place hold</a></li>[% END %]
        [% END %]
index 6909e1c..a0f6abb 100644 (file)
@@ -1,6 +1,6 @@
 [% IF ( PAGE_NUMBERS ) %]<div class="pages">
     <!-- Row of numbers corresponding to search result pages -->
-        [% IF ( previous_page_offset ) %]<a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">&lt;&lt; Previous</a>[% END %]
+        [% IF ( previous_page_offset.defined ) %]<a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">&lt;&lt; Previous</a>[% END %]
     [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<span class="current">[% PAGE_NUMBER.pg %]</span>[% ELSE %]        <a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">[% PAGE_NUMBER.pg %]</a>[% END %]
     [% END %]
         [% IF ( next_page_offset ) %]<a class="nav" href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by %][% END %]">Next &gt;&gt;</a>[% END %]
index 0feafda..8083192 100644 (file)
@@ -1,6 +1,7 @@
 [% IF ( subscriptionid ) %]
 <ul>
 <li><a href="serials-collection.pl?subscriptionid=[% subscriptionid %]">Serial collection</a></li>
+  [% UNLESS closed %]
     [% IF ( routing && CAN_user_serials_routing ) %]
         [% IF ( hasRouting ) %]
              <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]">Edit routing list</a></li>
@@ -8,6 +9,7 @@
             <li><a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscriptionid %]&amp;op=new">Create routing list</a></li>
         [% END %]
     [% END %]
+  [% END %]
 </ul>
 [% END %]
 
index 00f76bc..0e7497d 100644 (file)
@@ -1,6 +1,18 @@
 <div id="toolbar"><script type="text/javascript">
        //<![CDATA[
 
+    function confirm_close() {
+        var is_confirmed = confirm(_("Are you sure you want to close this subscription?"));
+        if (is_confirmed) {
+            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=close";
+        }
+    }
+    function confirm_reopen() {
+        var is_confirmed = confirm(_("Are you sure you want to reopen this subscription?"));
+        if (is_confirmed) {
+            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen";
+        }
+    }
        // prepare DOM for YUI Toolbar
 
         $(document).ready(function() {
@@ -50,6 +62,8 @@ onclick: {fn:function(){popup([% subscriptionid %])}}
                [% END %]
            new YAHOO.widget.Button("renew");
            new YAHOO.widget.Button("receive");
+        new YAHOO.widget.Button("close");
+        new YAHOO.widget.Button("reopen");
                [% END %]
        }
 
@@ -57,38 +71,49 @@ onclick: {fn:function(){popup([% subscriptionid %])}}
        </script>
 <ul class="toolbar">
     [% IF ( CAN_user_serials_create_subscription ) %]
-       [% IF ( biblionumber_for_new_subscription ) %]
-        <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription %]">New subscription</a></li>
-       [% ELSE %]
-        <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl">New subscription</a></li>
-       [% END %]
+        [% IF ( biblionumber_for_new_subscription ) %]
+            <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription %]">New subscription</a></li>
+        [% ELSE %]
+            <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl">New subscription</a></li>
+        [% END %]
     [% END %]
 
     [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
-       [% IF ( subscriptionid ) %]
+        [% IF ( subscriptionid ) %]
 
-           [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
-               [% UNLESS ( cannotedit ) %]
-                   <li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptionid %]">Edit</a></li>
-               [% END %]
-           [% END %]
+            [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
+                [% UNLESS ( cannotedit ) %]
+                    <li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptionid %]">Edit</a></li>
+                [% END %]
+            [% END %]
 
-           [% IF ( CAN_user_serials_create_subscription ) %]
-               <li><a id="duplicate" href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&amp;subscriptionid=[% subscriptionid %]">Duplicate </a></li>
-           [% END %]
+            [% IF ( CAN_user_serials_create_subscription ) %]
+                <li><a id="duplicate" href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&amp;subscriptionid=[% subscriptionid %]">Duplicate </a></li>
+            [% END %]
 
-           [% UNLESS ( cannotedit ) %]
-               [% IF ( CAN_user_serials_renew_subscription ) %]
-                   <li id="renewc"><a id="renew" href="#" onclick="popup([% subscriptionid %])">Renew </a></li>
-               [% END %]
-               [% IF ( CAN_user_serials_receive_serials ) %]
-                   <li><a id="receive" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscriptionid %]&amp;serstatus=1,3">Receive</a></li>
-               [% END %]
-               [% IF ( CAN_user_serials_delete_subscription ) %]
-                   <li><a id="delete" href="javascript:confirm_deletion()">Delete</a></li>
-               [% END %]
-           [% END %]
-       [% END %]
+            [% UNLESS ( cannotedit ) %]
+                [% UNLESS closed %]
+                    [% IF ( CAN_user_serials_renew_subscription ) %]
+                        <li id="renewc"><a id="renew" href="#" onclick="popup([% subscriptionid %])">Renew </a></li>
+                    [% END %]
+                [% END %]
+                [% IF ( CAN_user_serials_receive_serials ) %]
+                    [% UNLESS closed %]
+                        <li><a id="receive" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscriptionid %]&amp;serstatus=1,3">Receive</a></li>
+                    [% END %]
+                [% END %]
+                [% IF CAN_user_serials_edit_subscription %]
+                    [% IF closed %]
+                        <li><a id="reopen" href="javascript:confirm_reopen();">Reopen</a></li>
+                    [% ELSE %]
+                        <li><a id="close" href="javascript:confirm_close();">Close</a></li>
+                    [% END %]
+                [% END %]
+                [% IF ( CAN_user_serials_delete_subscription ) %]
+                    <li><a id="delete" href="javascript:confirm_deletion()">Delete</a></li>
+                [% END %]
+            [% END %]
+        [% END %]
     [% END %]
 </ul>
 </div>
index 896e59e..5e6bf63 100644 (file)
@@ -6,21 +6,21 @@
                <p>
                <label>Audience</label>
                <select name="limit" class="subtype">
-            <option value="" SELECTED="selected" >Any</option>
+            <option value="" selected="selected" >Any</option>
                        <option value="aud:a">juvenile, general</option>
                        <option value="aud:b">pre-primary (0-5)</option>
-                       <option value="aud:c">Primary (5-8)</option>
+            <option value="aud:c">primary (5-8)</option>
                        <option value="aud:d">children (9-14)</option>
-                       <option value="aud:e">Young Adult</option>
-                       <option value="aud:k">Adult, serious</option>
-                       <option value="aud:m">Adult, General</option>
-                       <option value="aud:u">Unknown</option>
+            <option value="aud:e">young Adult</option>
+            <option value="aud:k">adult, serious</option>
+            <option value="aud:m">adult, general</option>
+            <option value="aud:u">unknown</option>
                </select>
                </p>
                <p>
                <label>Print</label>
         <select name="limit" class="subtype">
-                       <option value="" selected="selected" >any</option>
+            <option value="" selected="selected" >Any</option>
                                <option value="Material-type:r">regular print</option>
                                <option value="Material-type:d">large print</option>
                                <option value="Material-type:e">newspaper format</option>
                                <option value="Material-type:h">hand-written</option>
                                <option value="Material-type:i">multimedia</option>
                                <option value="Material-type:j">mini-print</option>
+                <option value="Material-type:s">electronic ressource</option>
+                <option value="Material-type:t">microform</option>
                                <option value="Material-type:z">other form of textual material</option>
                </select>
                </p>
                <p>
-               <label>Feschrift Ind.</label>
+        <label>Literary genre</label>
                <select name="limit" class="subtype">
                        <option value="" selected="selected" >Any</option>
             <option value="Literature-Code:a">fiction</option>
             <option value="Literature-Code:f">short stories</option>
             <option value="Literature-Code:g">poetry</option>
             <option value="Literature-Code:h">speeches, oratory</option>
+            <option value="Literature-Code:i">libretto</option>
             <option value="Literature-Code:y">not a literary text</option>
-            <option value="Literature-Code:z">multiple/other lit. forms</option>
-               </select>
-               </p>
+            <option value="Literature-Code:z">multiple/other literary forms</option>
+    </select>
+    </p>
         <p>
                <label>Biography</label>
         <select name="limit" class="subtype" size="1">
             <option value="">Any</option>
-            <option value="Biography-code:y">Not a biography</option>
+            <option value="Biography-code:y">not a biography</option>
             <option value="Biography-code:a">autobiography</option>
             <option value="Biography-code:b">individual biography</option>
             <option value="Biography-code:c">collective biography</option>
-            <option value="Biography-code:d">contains biogr. data</option>
+            <option value="Biography-code:d">contains biographical data</option>
                </select>
         </p>
         <p>
             <option value="ctype:r" >literature surveys/reviews</option>
             <option value="ctype:s" >treaties</option>
             <option value="ctype:t" >cartoons or comic strips</option>
+            <option value="ctype:v" >dissertation or thesis (revised)</option>v
+            <option value="ctype:w" >religious text</option>
             <option value="ctype:z" >other</option>
                </select>
         </p>
                <select name="limit" class="subtype">
            <option value="">Any type</option>
            <option value="Type-Of-Serial:a">Periodical</option>
-                       <option value="Type-Of-Serial:b">Monographical series</option>
+                    <option value="Type-Of-Serial:b">Monographic series</option>
                        <option value="Type-Of-Serial:c">Newspaper</option>
+                    <option value="Type-Of-Serial:e">Updating loose-leaf</option>
+                    <option value="Type-Of-Serial:f">Database</option>
+                    <option value="Type-Of-Serial:g">Updating website</option>
                        <option value="Type-Of-Serial:z">Other</option>
                </select>
                </p>
                                <option value="Frequency-code:i">Three times a year</option>
                                <option value="Frequency-code:j">Semiannual</option>
                                <option value="Frequency-code:k">Annual</option>
-                               <option value="Frequency-code:l">Biannual</option>
+                <option value="Frequency-code:l">Biennial</option>
                                <option value="Frequency-code:m">Triennial</option>
                                <option value="Frequency-code:n">Three times a week</option>
                                <option value="Frequency-code:o">Three times a month</option>
-                               <option value="Frequency-code:u">Unknown</option>
                                <option value="Frequency-code:y">Without periodicity</option>
-                               <option value="Frequency-code:i">Other</option>
+                <option value="Frequency-code:u">Unknown</option>
+                <option value="Frequency-code:z">Other</option>
                </select>
                </p>
                <p>
                <label>Regularity</label>
                <select name="limit" class="subtype">
             <option value="">Any regularity</option>
-                               <option value="Regularity-code:u">Unknown</option>
-                               <option value="Regularity-code:a">Regular</option>
-                               <option value="Regularity-code:b">Normalised irregular</option>
+                <option value="Regularity-code:a">regular</option>
+                <option value="Regularity-code:b">normalised irregular</option>
                                <option value="Regularity-code:y">irregular</option>
+                <option value="Regularity-code:u">unknown</option>
                </select>
         </p>
 
                                <option value="Graphics-type:z">other non-projected graphic type</option>
                </select>
                <select name="limit" class="subtype">
-            <option value="">any</option>
+            <option value="">Any</option>
             <option value="Graphics-support:a">canvas</option>
             <option value="Graphics-support:b">bristol board</option>
             <option value="Graphics-support:c">cardboard/illustration board</option>
             <option value="Graphics-support:l">porcelaine</option>
             <option value="Graphics-support:m">stone</option>
             <option value="Graphics-support:n">wood</option>
-            <option value="Graphics-support:u">unknown</option>
             <option value="Graphics-support:v">mixed collection</option>
             <option value="Graphics-support:e">synthetics</option>
             <option value="Graphics-support:f">skin</option>
             <option value="Graphics-support:h">metal</option>
             <option value="Graphics-support:i">paper</option>
             <option value="Graphics-support:z">others</option>
-               </select>
+            <option value="Graphics-support:u">unknown</option>
+    </select>
         </p>
-
 </fieldset>
 </div>
index fe76cd3..880bd01 100644 (file)
 /* Overlays */
 .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
 .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
+ * jQuery UI Accordion 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Accordion#theming
+ */
+/* IE/Win - Fix animation bug - #4615 */
+.ui-accordion { width: 100%; }
+.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; }
+.ui-accordion .ui-accordion-li-fix { display: inline; }
+.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; }
+.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; }
+.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
+.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
+.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
+.ui-accordion .ui-accordion-content-active { display: block; }
+/*!
  * jQuery UI Autocomplete 1.8.23
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
    margin: -1px;
 }
 /*!
+ * jQuery UI Button 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Button#theming
+ */
+.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */
+.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */
+button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */
+.ui-button-icons-only { width: 3.4em; }
+button.ui-button-icons-only { width: 3.7em; }
+
+/*button text element */
+.ui-button .ui-button-text { display: block; line-height: 1.4;  }
+.ui-button-text-only .ui-button-text { padding: .4em 1em; }
+.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; }
+.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; }
+.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; }
+.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; }
+/* no icon support for input elements, provide padding by default */
+input.ui-button { padding: .4em 1em; }
+
+/*button icon element(s) */
+.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; }
+.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; }
+.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; }
+.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; }
+
+/*button sets*/
+.ui-buttonset { margin-right: 7px; }
+.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; }
+
+/* workarounds */
+button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
+/*!
+ * jQuery UI Dialog 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Dialog#theming
+ */
+.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
+.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative;  }
+.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
+.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
+.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
+.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
+.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
+.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; }
+.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
+.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
+.ui-draggable .ui-dialog-titlebar { cursor: move; }
+/*!
  * jQuery UI Slider 1.8.23
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
     left: -4px; /*must have*/
     width: 200px; /*must have*/
     height: 200px; /*must have*/
-}
\ No newline at end of file
+}/*!
+ * jQuery UI Progressbar 1.8.23
+ *
+ * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
+ * Dual licensed under the MIT or GPL Version 2 licenses.
+ * http://jquery.org/license
+ *
+ * http://docs.jquery.com/UI/Progressbar#theming
+ */
+.ui-progressbar { height:2em; text-align: left; overflow: hidden; }
+.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; }
index 635f4c6..eb53cd4 100644 (file)
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
 * https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.draggable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.left<h[0]&&(f=h[0]+this.offset.click.left),b.pageY-this.offset.click.top<h[1]&&(g=h[1]+this.offset.click.top),b.pageX-this.offset.click.left>h[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.top<h[1]||j-this.offset.click.top>h[3]?j-this.offset.click.top<h[1]?j+c.grid[1]:j-c.grid[1]:j:j;var k=c.grid[0]?this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0]:this.originalPageX;f=h?k-this.offset.click.left<h[0]||k-this.offset.click.left>h[2]?k-this.offset.click.left<h[0]?k+c.grid[0]:k-c.grid[0]:k:k}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(b,c,d){return d=d||this._uiHash(),a.ui.plugin.call(this,b,[c,d]),b=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),a.Widget.prototype._trigger.call(this,b,c,d)},plugins:{},_uiHash:function(a){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),a.extend(a.ui.draggable,{version:"1.8.23"}),a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),e=d.options,f=a.extend({},c,{item:d.element});d.sortables=[],a(e.connectToSortable).each(function(){var c=a.data(this,"sortable");c&&!c.options.disabled&&(d.sortables.push({instance:c,shouldRevert:c.options.revert}),c.refreshPositions(),c._trigger("activate",b,f))})},stop:function(b,c){var d=a(this).data("draggable"),e=a.extend({},c,{item:d.element});a.each(d.sortables,function(){this.instance.isOver?(this.instance.isOver=0,d.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(b),this.instance.options.helper=this.instance.options._helper,d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",b,e))})},drag:function(b,c){var d=a(this).data("draggable"),e=this,f=function(b){var c=this.offset.click.top,d=this.offset.click.left,e=this.positionAbs.top,f=this.positionAbs.left,g=b.height,h=b.width,i=b.top,j=b.left;return a.ui.isOver(e+c,f+d,i,j,g,h)};a.each(d.sortables,function(f){this.instance.positionAbs=d.positionAbs,this.instance.helperProportions=d.helperProportions,this.instance.offset.click=d.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=a(e).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return c.helper[0]},b.target=this.instance.currentItem[0],this.instance._mouseCapture(b,!0),this.instance._mouseStart(b,!0,!0),this.instance.offset.click.top=d.offset.click.top,this.instance.offset.click.left=d.offset.click.left,this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top,d._trigger("toSortable",b),d.dropped=this.instance.element,d.currentItem=d.element,this.instance.fromOutside=d),this.instance.currentItem&&this.instance._mouseDrag(b)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",b,this.instance._uiHash(this.instance)),this.instance._mouseStop(b,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),d._trigger("fromSortable",b),d.dropped=!1)})}}),a.ui.plugin.add("draggable","cursor",{start:function(b,c){var d=a("body"),e=a(this).data("draggable").options;d.css("cursor")&&(e._cursor=d.css("cursor")),d.css("cursor",e.cursor)},stop:function(b,c){var d=a(this).data("draggable").options;d._cursor&&a("body").css("cursor",d._cursor)}}),a.ui.plugin.add("draggable","opacity",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("opacity")&&(e._opacity=d.css("opacity")),d.css("opacity",e.opacity)},stop:function(b,c){var d=a(this).data("draggable").options;d._opacity&&a(c.helper).css("opacity",d._opacity)}}),a.ui.plugin.add("draggable","scroll",{start:function(b,c){var d=a(this).data("draggable");d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"&&(d.overflowOffset=d.scrollParent.offset())},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=!1;if(d.scrollParent[0]!=document&&d.scrollParent[0].tagName!="HTML"){if(!e.axis||e.axis!="x")d.overflowOffset.top+d.scrollParent[0].offsetHeight-b.pageY<e.scrollSensitivity?d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop+e.scrollSpeed:b.pageY-d.overflowOffset.top<e.scrollSensitivity&&(d.scrollParent[0].scrollTop=f=d.scrollParent[0].scrollTop-e.scrollSpeed);if(!e.axis||e.axis!="y")d.overflowOffset.left+d.scrollParent[0].offsetWidth-b.pageX<e.scrollSensitivity?d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft+e.scrollSpeed:b.pageX-d.overflowOffset.left<e.scrollSensitivity&&(d.scrollParent[0].scrollLeft=f=d.scrollParent[0].scrollLeft-e.scrollSpeed)}else{if(!e.axis||e.axis!="x")b.pageY-a(document).scrollTop()<e.scrollSensitivity?f=a(document).scrollTop(a(document).scrollTop()-e.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<e.scrollSensitivity&&(f=a(document).scrollTop(a(document).scrollTop()+e.scrollSpeed));if(!e.axis||e.axis!="y")b.pageX-a(document).scrollLeft()<e.scrollSensitivity?f=a(document).scrollLeft(a(document).scrollLeft()-e.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<e.scrollSensitivity&&(f=a(document).scrollLeft(a(document).scrollLeft()+e.scrollSpeed))}f!==!1&&a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(d,b)}}),a.ui.plugin.add("draggable","snap",{start:function(b,c){var d=a(this).data("draggable"),e=d.options;d.snapElements=[],a(e.snap.constructor!=String?e.snap.items||":data(draggable)":e.snap).each(function(){var b=a(this),c=b.offset();this!=d.element[0]&&d.snapElements.push({item:this,width:b.outerWidth(),height:b.outerHeight(),top:c.top,left:c.left})})},drag:function(b,c){var d=a(this).data("draggable"),e=d.options,f=e.snapTolerance,g=c.offset.left,h=g+d.helperProportions.width,i=c.offset.top,j=i+d.helperProportions.height;for(var k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f<g&&g<m+f&&n-f<i&&i<o+f||l-f<g&&g<m+f&&n-f<j&&j<o+f||l-f<h&&h<m+f&&n-f<i&&i<o+f||l-f<h&&h<m+f&&n-f<j&&j<o+f)){d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=!1;continue}if(e.snapMode!="inner"){var p=Math.abs(n-j)<=f,q=Math.abs(o-i)<=f,r=Math.abs(l-h)<=f,s=Math.abs(m-g)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n-d.helperProportions.height,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m}).left-d.margins.left)}var t=p||q||r||s;if(e.snapMode!="outer"){var p=Math.abs(n-i)<=f,q=Math.abs(o-j)<=f,r=Math.abs(l-g)<=f,s=Math.abs(m-h)<=f;p&&(c.position.top=d._convertPositionTo("relative",{top:n,left:0}).top-d.margins.top),q&&(c.position.top=d._convertPositionTo("relative",{top:o-d.helperProportions.height,left:0}).top-d.margins.top),r&&(c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left),s&&(c.position.left=d._convertPositionTo("relative",{top:0,left:m-d.helperProportions.width}).left-d.margins.left)}!d.snapElements[k].snapping&&(p||q||r||s||t)&&d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item})),d.snapElements[k].snapping=p||q||r||s||t}}}),a.ui.plugin.add("draggable","stack",{start:function(b,c){var d=a(this).data("draggable").options,e=a.makeArray(a(d.stack)).sort(function(b,c){return(parseInt(a(b).css("zIndex"),10)||0)-(parseInt(a(c).css("zIndex"),10)||0)});if(!e.length)return;var f=parseInt(e[0].style.zIndex)||0;a(e).each(function(a){this.style.zIndex=f+a}),this[0].style.zIndex=f+e.length}}),a.ui.plugin.add("draggable","zIndex",{start:function(b,c){var d=a(c.helper),e=a(this).data("draggable").options;d.css("zIndex")&&(e._zIndex=d.css("zIndex")),d.css("zIndex",e.zIndex)},stop:function(b,c){var d=a(this).data("draggable").options;d._zIndex&&a(c.helper).css("zIndex",d._zIndex)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.droppable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0,this.isout=1,this.accept=a.isFunction(c)?c:function(a){return a.is(c)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[],a.ui.ddmanager.droppables[b.scope].push(this),b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){var b=a.ui.ddmanager.droppables[this.options.scope];for(var c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);return this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable"),this},_setOption:function(b,c){b=="accept"&&(this.accept=a.isFunction(c)?c:function(a){return a.is(c)}),a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",b,this.ui(c)))},_out:function(b){var c=a.ui.ddmanager.current;if(!c||(c.currentItem||c.element)[0]==this.element[0])return;this.accept.call(this.element[0],c.currentItem||c.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",b,this.ui(c)))},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return!1;var e=!1;return this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var b=a.data(this,"droppable");if(b.options.greedy&&!b.options.disabled&&b.options.scope==d.options.scope&&b.accept.call(b.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(b,{offset:b.element.offset()}),b.options.tolerance))return e=!0,!1}),e?!1:this.accept.call(this.element[0],d.currentItem||d.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",b,this.ui(d)),this.element):!1},ui:function(a){return{draggable:a.currentItem||a.element,helper:a.helper,position:a.position,offset:a.positionAbs}}}),a.extend(a.ui.droppable,{version:"1.8.23"}),a.ui.intersect=function(b,c,d){if(!c.offset)return!1;var e=(b.positionAbs||b.position.absolute).left,f=e+b.helperProportions.width,g=(b.positionAbs||b.position.absolute).top,h=g+b.helperProportions.height,i=c.offset.left,j=i+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case"fit":return i<=e&&f<=j&&k<=g&&h<=l;case"intersect":return i<e+b.helperProportions.width/2&&f-b.helperProportions.width/2<j&&k<g+b.helperProportions.height/2&&h-b.helperProportions.height/2<l;case"pointer":var m=(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,n=(b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,o=a.ui.isOver(n,m,k,i,c.proportions.height,c.proportions.width);return o;case"touch":return(g>=k&&g<=l||h>=k&&h<=l||g<k&&h>l)&&(e>=i&&e<=j||f>=i&&f<=j||e<i&&f>j);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h<d.length;h++){if(d[h].options.disabled||b&&!d[h].accept.call(d[h].element[0],b.currentItem||b.element))continue;for(var i=0;i<f.length;i++)if(f[i]==d[h].element[0]){d[h].proportions.height=0;continue g}d[h].visible=d[h].element.css("display")!="none";if(!d[h].visible)continue;e=="mousedown"&&d[h]._activate.call(d[h],c),d[h].offset=d[h].element.offset(),d[h].proportions={width:d[h].element[0].offsetWidth,height:d[h].element[0].offsetHeight}}},drop:function(b,c){var d=!1;return a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!this.options)return;!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance)&&(d=this._drop.call(this,c)||d),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)&&(this.isout=1,this.isover=0,this._deactivate.call(this,c))}),d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c),a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var d=a.ui.intersect(b,this,this.options.tolerance),e=!d&&this.isover==1?"isout":d&&this.isover==0?"isover":null;if(!e)return;var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");g.length&&(f=a.data(g[0],"droppable"),f.greedyChild=e=="isover"?1:0)}f&&e=="isover"&&(f.isover=0,f.isout=1,f._out.call(f,c)),this[e]=1,this[e=="isout"?"isover":"isout"]=0,this[e=="isover"?"_over":"_out"].call(this,c),f&&e=="isout"&&(f.isout=0,f.isover=1,f._over.call(f,c))})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable"),b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.sortable.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=this.options.axis==="x"||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=this.options.axis==="y"||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i],this.direction=j-h>0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.23"})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
 * https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.accordion.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}return f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];return this._clickHandler({target:b},b),this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(d.disabled)return;if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!g)return;return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),a.extend(a.ui.accordion,{version:"1.8.23",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size()){b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.autocomplete.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
 * https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.button.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){var c,d,e,f,g="ui-button ui-widget ui-state-default ui-corner-all",h="ui-state-hover ui-state-active ",i="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",j=function(){var b=a(this).find(":ui-button");setTimeout(function(){b.button("refresh")},1)},k=function(b){var c=b.name,d=b.form,e=a([]);return c&&(d?e=a(d).find("[name='"+c+"']"):e=a("[name='"+c+"']",b.ownerDocument).filter(function(){return!this.form})),e};a.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",j),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var b=this,h=this.options,i=this.type==="checkbox"||this.type==="radio",l="ui-state-hover"+(i?"":" ui-state-active"),m="ui-state-focus";h.label===null&&(h.label=this.buttonElement.html()),this.buttonElement.addClass(g).attr("role","button").bind("mouseenter.button",function(){if(h.disabled)return;a(this).addClass("ui-state-hover"),this===c&&a(this).addClass("ui-state-active")}).bind("mouseleave.button",function(){if(h.disabled)return;a(this).removeClass(l)}).bind("click.button",function(a){h.disabled&&(a.preventDefault(),a.stopImmediatePropagation())}),this.element.bind("focus.button",function(){b.buttonElement.addClass(m)}).bind("blur.button",function(){b.buttonElement.removeClass(m)}),i&&(this.element.bind("change.button",function(){if(f)return;b.refresh()}),this.buttonElement.bind("mousedown.button",function(a){if(h.disabled)return;f=!1,d=a.pageX,e=a.pageY}).bind("mouseup.button",function(a){if(h.disabled)return;if(d!==a.pageX||e!==a.pageY)f=!0})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).toggleClass("ui-state-active"),b.buttonElement.attr("aria-pressed",b.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(h.disabled||f)return!1;a(this).addClass("ui-state-active"),b.buttonElement.attr("aria-pressed","true");var c=b.element[0];k(c).not(c).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")}):(this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return!1;a(this).addClass("ui-state-active"),c=this,a(document).one("mouseup",function(){c=null})}).bind("mouseup.button",function(){if(h.disabled)return!1;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(b){if(h.disabled)return!1;(b.keyCode==a.ui.keyCode.SPACE||b.keyCode==a.ui.keyCode.ENTER)&&a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")}),this.buttonElement.is("a")&&this.buttonElement.keyup(function(b){b.keyCode===a.ui.keyCode.SPACE&&a(this).click()})),this._setOption("disabled",h.disabled),this._resetButton()},_determineButtonType:function(){this.element.is(":checkbox")?this.type="checkbox":this.element.is(":radio")?this.type="radio":this.element.is("input")?this.type="input":this.type="button";if(this.type==="checkbox"||this.type==="radio"){var a=this.element.parents().filter(":last"),b="label[for='"+this.element.attr("id")+"']";this.buttonElement=a.find(b),this.buttonElement.length||(a=a.length?a.siblings():this.element.siblings(),this.buttonElement=a.filter(b),this.buttonElement.length||(this.buttonElement=a.find(b))),this.element.addClass("ui-helper-hidden-accessible");var c=this.element.is(":checked");c&&this.buttonElement.addClass("ui-state-active"),this.buttonElement.attr("aria-pressed",c)}else this.buttonElement=this.element},widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible"),this.buttonElement.removeClass(g+" "+h+" "+i).removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html()),this.hasTitle||this.buttonElement.removeAttr("title"),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);if(b==="disabled"){c?this.element.propAttr("disabled",!0):this.element.propAttr("disabled",!1);return}this._resetButton()},refresh:function(){var b=this.element.is(":disabled");b!==this.options.disabled&&this._setOption("disabled",b),this.type==="radio"?k(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed","true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")}):this.type==="checkbox"&&(this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false"))},_resetButton:function(){if(this.type==="input"){this.options.label&&this.element.val(this.options.label);return}var b=this.buttonElement.removeClass(i),c=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend("<span class='ui-button-icon-primary ui-icon "+d.primary+"'></span>"),d.secondary&&b.append("<span class='ui-button-icon-secondary ui-icon "+d.secondary+"'></span>"),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.dialog.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||"&#160;",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){return b.close(a),!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("<span></span>").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;return a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle),a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1===c._trigger("beforeClose",b))return;return c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d),c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;return e.modal&&!b||!e.stack&&!e.modal?d._trigger("focus",c):(e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c),d)},open:function(){if(this._isOpen)return;var b=this,c=b.options,d=b.uiDialog;return b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode!==a.ui.keyCode.TAB)return;var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey)return d.focus(1),!1;if(b.target===d[0]&&b.shiftKey)return e.focus(1),!1}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open"),b},_createButtons:function(b){var c=this,d=!1,e=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),f=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('<button type="button"></button>').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(f);a.each(d,function(a,b){if(a==="click")return;a in e?e[a](b):e.attr(a,b)}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||"&#160;"))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.23",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");return b||(this.uuid+=1,b=this.uuid),"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()<a.ui.dialog.overlay.maxZ)return!1})},1),a(document).bind("keydown.dialog-overlay",function(c){b.options.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}),a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize));var c=(this.oldInstances.pop()||a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return a.fn.bgiframe&&c.bgiframe(),this.instances.push(c),c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;return a.browser.msie&&a.browser.version<7?(b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),b<c?a(window).height()+"px":b+"px"):a(document).height()+"px"},width:function(){var b,c;return a.browser.msie?(b=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth),b<c?a(window).width()+"px":b+"px"):a(document).width()+"px"},resize:function(){var b=a([]);a.each(a.ui.dialog.overlay.instances,function(){b=b.add(this)}),b.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}}),a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.slider.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
 (function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;i<g;i+=1)h.push(f);this.handles=e.add(a(h.join("")).appendTo(b.element)),this.handle=this.handles.eq(0),this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){d.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){d.disabled?a(this).blur():(a(".ui-slider .ui-state-focus").removeClass("ui-state-focus"),a(this).addClass("ui-state-focus"))}).blur(function(){a(this).removeClass("ui-state-focus")}),this.handles.each(function(b){a(this).data("index.ui-slider-handle",b)}),this.handles.keydown(function(d){var e=a(this).data("index.ui-slider-handle"),f,g,h,i;if(b.options.disabled)return;switch(d.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:d.preventDefault();if(!b._keySliding){b._keySliding=!0,a(this).addClass("ui-state-active"),f=b._start(d,e);if(f===!1)return}}i=b.options.step,b.options.values&&b.options.values.length?g=h=b.values(e):g=h=b.value();switch(d.keyCode){case a.ui.keyCode.HOME:h=b._valueMin();break;case a.ui.keyCode.END:h=b._valueMax();break;case a.ui.keyCode.PAGE_UP:h=b._trimAlignValue(g+(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.PAGE_DOWN:h=b._trimAlignValue(g-(b._valueMax()-b._valueMin())/c);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(g===b._valueMax())return;h=b._trimAlignValue(g+i);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(g===b._valueMin())return;h=b._trimAlignValue(g-i)}b._slide(d,e,h)}).keyup(function(c){var d=a(this).data("index.ui-slider-handle");b._keySliding&&(b._keySliding=!1,b._stop(c,d),b._change(c,d),a(this).removeClass("ui-state-active"))}),this._refreshValue(),this._animateOff=!1},destroy:function(){return this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options,d,e,f,g,h,i,j,k,l;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),d={x:b.pageX,y:b.pageY},e=this._normValueFromMouse(d),f=this._valueMax()-this._valueMin()+1,h=this,this.handles.each(function(b){var c=Math.abs(e-h.values(b));f>c&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c<d)&&(c=d),c!==this.values(b)&&(e=this.values(),e[b]=c,f=this._trigger("slide",a,{handle:this.handles[b],value:c,values:e}),d=this.values(b?0:1),f!==!1&&this.values(b,c,!0))):c!==this.value()&&(f=this._trigger("slide",a,{handle:this.handles[b],value:c}),f!==!1&&this.value(c))},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(b,c){var d,e,f;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);return}if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f<d.length;f+=1)d[f]=this._trimAlignValue(e[f]),this._change(null,f);this._refreshValue()},_setOption:function(b,c){var d,e=0;a.isArray(this.options.values)&&(e=this.options.values.length),a.Widget.prototype._setOption.apply(this,arguments);switch(b){case"disabled":c?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.propAttr("disabled",!0),this.element.addClass("ui-disabled")):(this.handles.propAttr("disabled",!1),this.element.removeClass("ui-disabled"));break;case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":this._animateOff=!0,this._refreshValue();for(d=0;d<e;d+=1)this._change(null,d);this._animateOff=!1}},_value:function(){var a=this.options.value;return a=this._trimAlignValue(a),a},_values:function(a){var b,c,d;if(arguments.length)return b=this.options.values[a],b=this._trimAlignValue(b),b;c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c},_trimAlignValue:function(a){if(a<=this._valueMin())return this._valueMin();if(a>=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.23"})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
 * https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.datepicker.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.23"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a)),this._attachHandlers(a);var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+(c?0:$(document).scrollLeft()),i=document.documentElement.clientHeight+(c?0:$(document).scrollTop());return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;return c&&s++,c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;return r+=f[0].length,parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase())return f=c[0],r+=d.length,!1});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;return c&&m++,c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;return c&&e++,c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()==a.lastVal)return;var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;return b.setDate(b.getDate()+a),b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());return f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0)),this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_attachHandlers:function(a){var b=this._get(a,"stepMonths"),c="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){var a={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(c,-b,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(c,+b,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(c)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(c,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(c,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(c,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),a[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' data-handler="selectDay" data-event="click" data-month="'+Y.getMonth()+'" data-year="'+Y.getFullYear()+'"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return e=d&&e>d?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.23",window["DP_jQuery_"+dpuuid]=$})(jQuery);;
\ No newline at end of file
+(function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.23"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$('<span class="'+this._appendClass+'">'+c+"</span>"),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("<img/>").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('<button type="button"></button>').addClass(this._triggerClass).html(g==""?f:$("<img/>").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;d<a.length;d++)a[d].length>b&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$('<input type="text" id="'+g+'" style="position: absolute; top: -100px; width: 0px;"/>'),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b<this._disabledInputs.length;b++)if(this._disabledInputs[b]==a)return!0;return!1},_getInst:function(a){try{return $.data(a,PROP_NAME)}catch(b){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(a,b,c){var d=this._getInst(a);if(arguments.length==2&&typeof b=="string")return b=="defaults"?$.extend({},$.datepicker._defaults):d?b=="all"?$.extend({},d.settings):this._get(d,b):null;var e=b||{};typeof b=="string"&&(e={},e[b]=c);if(d){this._curInst==d&&this._hideDatepicker();var f=this._getDateDatepicker(a,!0),g=this._getMinMaxDate(d,"min"),h=this._getMinMaxDate(d,"max");extendRemove(d.settings,e),g!==null&&e.dateFormat!==undefined&&e.minDate===undefined&&(d.settings.minDate=this._formatDate(d,g)),h!==null&&e.dateFormat!==undefined&&e.maxDate===undefined&&(d.settings.maxDate=this._formatDate(d,h)),this._attachments($(a),d),this._autoSize(d),this._setDate(d,f),this._updateAlternate(d),this._updateDatepicker(d)}},_changeDatepicker:function(a,b,c){this._optionDatepicker(a,b,c)},_refreshDatepicker:function(a){var b=this._getInst(a);b&&this._updateDatepicker(b)},_setDateDatepicker:function(a,b){var c=this._getInst(a);c&&(this._setDate(c,b),this._updateDatepicker(c),this._updateAlternate(c))},_getDateDatepicker:function(a,b){var c=this._getInst(a);return c&&!c.inline&&this._setDateFromField(c,b),c?this._getDate(c):null},_doKeyDown:function(a){var b=$.datepicker._getInst(a.target),c=!0,d=b.dpDiv.is(".ui-datepicker-rtl");b._keyEvent=!0;if($.datepicker._datepickerShowing)switch(a.keyCode){case 9:$.datepicker._hideDatepicker(),c=!1;break;case 13:var e=$("td."+$.datepicker._dayOverClass+":not(."+$.datepicker._currentClass+")",b.dpDiv);e[0]&&$.datepicker._selectDay(a.target,b.selectedMonth,b.selectedYear,e[0]);var f=$.datepicker._get(b,"onSelect");if(f){var g=$.datepicker._formatDate(b);f.apply(b.input?b.input[0]:null,[g,b])}else $.datepicker._hideDatepicker();return!1;case 27:$.datepicker._hideDatepicker();break;case 33:$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 34:$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 35:(a.ctrlKey||a.metaKey)&&$.datepicker._clearDate(a.target),c=a.ctrlKey||a.metaKey;break;case 36:(a.ctrlKey||a.metaKey)&&$.datepicker._gotoToday(a.target),c=a.ctrlKey||a.metaKey;break;case 37:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?1:-1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?-$.datepicker._get(b,"stepBigMonths"):-$.datepicker._get(b,"stepMonths"),"M");break;case 38:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,-7,"D"),c=a.ctrlKey||a.metaKey;break;case 39:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,d?-1:1,"D"),c=a.ctrlKey||a.metaKey,a.originalEvent.altKey&&$.datepicker._adjustDate(a.target,a.ctrlKey?+$.datepicker._get(b,"stepBigMonths"):+$.datepicker._get(b,"stepMonths"),"M");break;case 40:(a.ctrlKey||a.metaKey)&&$.datepicker._adjustDate(a.target,7,"D"),c=a.ctrlKey||a.metaKey;break;default:c=!1}else a.keyCode==36&&a.ctrlKey?$.datepicker._showDatepicker(this):c=!1;c&&(a.preventDefault(),a.stopPropagation())},_doKeyPress:function(a){var b=$.datepicker._getInst(a.target);if($.datepicker._get(b,"constrainInput")){var c=$.datepicker._possibleChars($.datepicker._get(b,"dateFormat")),d=String.fromCharCode(a.charCode==undefined?a.keyCode:a.charCode);return a.ctrlKey||a.metaKey||d<" "||!c||c.indexOf(d)>-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a)),this._attachHandlers(a);var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+(c?0:$(document).scrollLeft()),i=document.documentElement.clientHeight+(c?0:$(document).scrollTop());return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1<a.length&&a.charAt(s+1)==b;return c&&s++,c},o=function(a){var c=n(a),d=a=="@"?14:a=="!"?20:a=="y"&&c?4:a=="o"?3:2,e=new RegExp("^\\d{1,"+d+"}"),f=b.substring(r).match(e);if(!f)throw"Missing number at position "+r;return r+=f[0].length,parseInt(f[0],10)},p=function(a,c,d){var e=$.map(n(a)?d:c,function(a,b){return[[b,a]]}).sort(function(a,b){return-(a[1].length-b[1].length)}),f=-1;$.each(e,function(a,c){var d=c[1];if(b.substr(r,d.length).toLowerCase()==d.toLowerCase())return f=c[0],r+=d.length,!1});if(f!=-1)return f+1;throw"Unknown name at position "+r},q=function(){if(b.charAt(r)!=a.charAt(s))throw"Unexpected literal at position "+r;r++},r=0;for(var s=0;s<a.length;s++)if(m)a.charAt(s)=="'"&&!n("'")?m=!1:q();else switch(a.charAt(s)){case"d":k=o("d");break;case"D":p("D",e,f);break;case"o":l=o("o");break;case"m":j=o("m");break;case"M":j=p("M",g,h);break;case"y":i=o("y");break;case"@":var t=new Date(o("@"));i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"!":var t=new Date((o("!")-this._ticksTo1970)/1e4);i=t.getFullYear(),j=t.getMonth()+1,k=t.getDate();break;case"'":n("'")?q():m=!0;break;default:q()}if(r<b.length)throw"Extra/unparsed characters found in date: "+b.substring(r);i==-1?i=(new Date).getFullYear():i<100&&(i+=(new Date).getFullYear()-(new Date).getFullYear()%100+(i<=d?0:-100));if(l>-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+1<a.length&&a.charAt(m+1)==b;return c&&m++,c},i=function(a,b,c){var d=""+b;if(h(a))while(d.length<c)d="0"+d;return d},j=function(a,b,c,d){return h(a)?d[b]:c[b]},k="",l=!1;if(b)for(var m=0;m<a.length;m++)if(l)a.charAt(m)=="'"&&!h("'")?l=!1:k+=a.charAt(m);else switch(a.charAt(m)){case"d":k+=i("d",b.getDate(),2);break;case"D":k+=j("D",b.getDay(),d,e);break;case"o":k+=i("o",Math.round(((new Date(b.getFullYear(),b.getMonth(),b.getDate())).getTime()-(new Date(b.getFullYear(),0,0)).getTime())/864e5),3);break;case"m":k+=i("m",b.getMonth()+1,2);break;case"M":k+=j("M",b.getMonth(),f,g);break;case"y":k+=h("y")?b.getFullYear():(b.getYear()%100<10?"0":"")+b.getYear()%100;break;case"@":k+=b.getTime();break;case"!":k+=b.getTime()*1e4+this._ticksTo1970;break;case"'":h("'")?k+="'":l=!0;break;default:k+=a.charAt(m)}return k},_possibleChars:function(a){var b="",c=!1,d=function(b){var c=e+1<a.length&&a.charAt(e+1)==b;return c&&e++,c};for(var e=0;e<a.length;e++)if(c)a.charAt(e)=="'"&&!d("'")?c=!1:b+=a.charAt(e);else switch(a.charAt(e)){case"d":case"m":case"y":case"@":b+="0123456789";break;case"D":case"M":return null;case"'":d("'")?b+="'":c=!0;break;default:b+=a.charAt(e)}return b},_get:function(a,b){return a.settings[b]!==undefined?a.settings[b]:this._defaults[b]},_setDateFromField:function(a,b){if(a.input.val()==a.lastVal)return;var c=this._get(a,"dateFormat"),d=a.lastVal=a.input?a.input.val():null,e,f;e=f=this._getDefaultDate(a);var g=this._getFormatConfig(a);try{e=this.parseDate(c,d,g)||f}catch(h){this.log(h),d=b?"":d}a.selectedDay=e.getDate(),a.drawMonth=a.selectedMonth=e.getMonth(),a.drawYear=a.selectedYear=e.getFullYear(),a.currentDay=d?e.getDate():0,a.currentMonth=d?e.getMonth():0,a.currentYear=d?e.getFullYear():0,this._adjustInstDate(a)},_getDefaultDate:function(a){return this._restrictMinMax(a,this._determineDate(a,this._get(a,"defaultDate"),new Date))},_determineDate:function(a,b,c){var d=function(a){var b=new Date;return b.setDate(b.getDate()+a),b},e=function(b){try{return $.datepicker.parseDate($.datepicker._get(a,"dateFormat"),b,$.datepicker._getFormatConfig(a))}catch(c){}var d=(b.toLowerCase().match(/^c/)?$.datepicker._getDate(a):null)||new Date,e=d.getFullYear(),f=d.getMonth(),g=d.getDate(),h=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,i=h.exec(b);while(i){switch(i[2]||"d"){case"d":case"D":g+=parseInt(i[1],10);break;case"w":case"W":g+=parseInt(i[1],10)*7;break;case"m":case"M":f+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f));break;case"y":case"Y":e+=parseInt(i[1],10),g=Math.min(g,$.datepicker._getDaysInMonth(e,f))}i=h.exec(b)}return new Date(e,f,g)},f=b==null||b===""?c:typeof b=="string"?e(b):typeof b=="number"?isNaN(b)?c:d(b):new Date(b.getTime());return f=f&&f.toString()=="Invalid Date"?c:f,f&&(f.setHours(0),f.setMinutes(0),f.setSeconds(0),f.setMilliseconds(0)),this._daylightSavingAdjust(f)},_daylightSavingAdjust:function(a){return a?(a.setHours(a.getHours()>12?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_attachHandlers:function(a){var b=this._get(a,"stepMonths"),c="#"+a.id.replace(/\\\\/g,"\\");a.dpDiv.find("[data-handler]").map(function(){var a={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(c,-b,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(c,+b,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(c)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(c,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(c,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(c,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),a[this.getAttribute("data-handler")])})},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&p<l?l:p;while(this._daylightSavingAdjust(new Date(o,n,1))>p)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?'<a class="ui-datepicker-prev ui-corner-all" data-handler="prev" data-event="click" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>":e?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+q+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"e":"w")+'">'+q+"</span></a>",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?'<a class="ui-datepicker-next ui-corner-all" data-handler="next" data-event="click" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>":e?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+s+'"><span class="ui-icon ui-icon-circle-triangle-'+(c?"w":"e")+'">'+s+"</span></a>",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" data-handler="hide" data-event="click">'+this._get(a,"closeText")+"</button>",x=d?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(c?w:"")+(this._isInRange(a,v)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" data-handler="today" data-event="click">'+u+"</button>":"")+(c?"":w)+"</div>":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L<g[0];L++){var M="";this.maxRows=4;for(var N=0;N<g[1];N++){var O=this._daylightSavingAdjust(new Date(o,n,a.selectedDay)),P=" ui-corner-all",Q="";if(j){Q+='<div class="ui-datepicker-group';if(g[1]>1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+P+'">'+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'</div><table class="ui-datepicker-calendar"><thead>'+"<tr>";var R=z?'<th class="ui-datepicker-week-col">'+this._get(a,"weekHeader")+"</th>":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="<th"+((S+y+6)%7>=5?' class="ui-datepicker-week-end"':"")+">"+'<span title="'+A[T]+'">'+C[T]+"</span></th>"}Q+=R+"</tr></thead><tbody>";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z<X;Z++){Q+="<tr>";var _=z?'<td class="ui-datepicker-week-col">'+this._get(a,"calculateWeek")(Y)+"</td>":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Y<l||m&&Y>m;_+='<td class="'+((S+y+6)%7>=5?" ui-datepicker-week-end":"")+(bb?" ui-datepicker-other-month":"")+(Y.getTime()==O.getTime()&&n==a.selectedMonth&&a._keyEvent||J.getTime()==Y.getTime()&&J.getTime()==O.getTime()?" "+this._dayOverClass:"")+(bc?" "+this._unselectableClass+" ui-state-disabled":"")+(bb&&!G?"":" "+ba[1]+(Y.getTime()==k.getTime()?" "+this._currentClass:"")+(Y.getTime()==b.getTime()?" ui-datepicker-today":""))+'"'+((!bb||G)&&ba[2]?' title="'+ba[2]+'"':"")+(bc?"":' data-handler="selectDay" data-event="click" data-month="'+Y.getMonth()+'" data-year="'+Y.getFullYear()+'"')+">"+(bb&&!G?"&#xa0;":bc?'<span class="ui-state-default">'+Y.getDate()+"</span>":'<a class="ui-state-default'+(Y.getTime()==b.getTime()?" ui-state-highlight":"")+(Y.getTime()==k.getTime()?" ui-state-active":"")+(bb?" ui-priority-secondary":"")+'" href="#">'+Y.getDate()+"</a>")+"</td>",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+"</tr>"}n++,n>11&&(n=0,o++),Q+="</tbody></table>"+(j?"</div>"+(g[0]>0&&N==g[1]-1?'<div class="ui-datepicker-row-break"></div>':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='<div class="ui-datepicker-title">',m="";if(f||!i)m+='<span class="ui-datepicker-month">'+g[b]+"</span>";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='<select class="ui-datepicker-month" data-handler="selectMonth" data-event="change">';for(var p=0;p<12;p++)(!n||p>=d.getMonth())&&(!o||p<=e.getMonth())&&(m+='<option value="'+p+'"'+(p==b?' selected="selected"':"")+">"+h[p]+"</option>");m+="</select>"}k||(l+=m+(f||!i||!j?"&#xa0;":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+='<span class="ui-datepicker-year">'+c+"</span>";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='<select class="ui-datepicker-year" data-handler="selectYear" data-event="change">';for(;t<=u;t++)a.yearshtml+='<option value="'+t+'"'+(t==c?' selected="selected"':"")+">"+t+"</option>";a.yearshtml+="</select>",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?"&#xa0;":"")+m),l+="</div>",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&b<c?c:b;return e=d&&e>d?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.23",window["DP_jQuery_"+dpuuid]=$})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.progressbar.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("<div class='ui-progressbar-value ui-widget-header ui-corner-left'></div>").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){return a===b?this._value():(this._setOption("value",a),this)},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.23"})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.core.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array&&b.length==3?b:(c=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(b))?[parseInt(c[1],10),parseInt(c[2],10),parseInt(c[3],10)]:(c=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(b))?[parseFloat(c[1])*2.55,parseFloat(c[2])*2.55,parseFloat(c[3])*2.55]:(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(b))?[parseInt(c[1],16),parseInt(c[2],16),parseInt(c[3],16)]:(c=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(b))?[parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16),parseInt(c[3]+c[3],16)]:(c=/rgba\(0, 0, 0, 0\)/.exec(b))?e.transparent:e[a.trim(b).toLowerCase()]}function d(b,d){var e;do{e=(a.curCSS||a.css)(b,d);if(e!=""&&e!="transparent"||a.nodeName(b,"body"))break;d="backgroundColor"}while(b=b.parentNode);return c(e)}function h(){var a=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle,b={},c,d;if(a&&a.length&&a[0]&&a[a[0]]){var e=a.length;while(e--)c=a[e],typeof a[c]=="string"&&(d=c.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),b[d]=a[c])}else for(c in a)typeof a[c]=="string"&&(b[c]=a[c]);return b}function i(b){var c,d;for(c in b)d=b[c],(d==null||a.isFunction(d)||c in g||/scrollbar/.test(c)||!/color/i.test(c)&&isNaN(parseFloat(d)))&&delete b[c];return b}function j(a,b){var c={_:0},d;for(d in b)a[d]!=b[d]&&(c[d]=b[d]);return c}function k(b,c,d,e){typeof b=="object"&&(e=c,d=null,c=b,b=c.effect),a.isFunction(c)&&(e=c,d=null,c={});if(typeof c=="number"||a.fx.speeds[c])e=d,d=c,c={};return a.isFunction(d)&&(e=d,d=null),c=c||{},d=d||c.duration,d=a.fx.off?0:typeof d=="number"?d:d in a.fx.speeds?a.fx.speeds[d]:a.fx.speeds._default,e=e||c.complete,[b,c,d,e]}function l(b){return!b||typeof b=="number"||a.fx.speeds[b]?!0:typeof b=="string"&&!a.effects[b]?!0:!1}a.effects={},a.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor","borderTopColor","borderColor","color","outlineColor"],function(b,e){a.fx.step[e]=function(a){a.colorInit||(a.start=d(a.elem,e),a.end=c(a.end),a.colorInit=!0),a.elem.style[e]="rgb("+Math.max(Math.min(parseInt(a.pos*(a.end[0]-a.start[0])+a.start[0],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[1]-a.start[1])+a.start[1],10),255),0)+","+Math.max(Math.min(parseInt(a.pos*(a.end[2]-a.start[2])+a.start[2],10),255),0)+")"}});var e={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},f=["add","remove","toggle"],g={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};a.effects.animateClass=function(b,c,d,e){return a.isFunction(d)&&(e=d,d=null),this.queue(function(){var g=a(this),k=g.attr("style")||" ",l=i(h.call(this)),m,n=g.attr("class")||"";a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),m=i(h.call(this)),g.attr("class",n),g.animate(j(l,m),{queue:!1,duration:c,easing:d,complete:function(){a.each(f,function(a,c){b[c]&&g[c+"Class"](b[c])}),typeof g.attr("style")=="object"?(g.attr("style").cssText="",g.attr("style").cssText=k):g.attr("style",k),e&&e.apply(this,arguments),a.dequeue(this)}})})},a.fn.extend({_addClass:a.fn.addClass,addClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{add:b},c,d,e]):this._addClass(b)},_removeClass:a.fn.removeClass,removeClass:function(b,c,d,e){return c?a.effects.animateClass.apply(this,[{remove:b},c,d,e]):this._removeClass(b)},_toggleClass:a.fn.toggleClass,toggleClass:function(c,d,e,f,g){return typeof d=="boolean"||d===b?e?a.effects.animateClass.apply(this,[d?{add:c}:{remove:c},e,f,g]):this._toggleClass(c,d):a.effects.animateClass.apply(this,[{toggle:c},d,e,f])},switchClass:function(b,c,d,e,f){return a.effects.animateClass.apply(this,[{add:c,remove:b},d,e,f])}}),a.extend(a.effects,{version:"1.8.23",save:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.data("ec.storage."+b[c],a[0].style[b[c]])},restore:function(a,b){for(var c=0;c<b.length;c++)b[c]!==null&&a.css(b[c],a.data("ec.storage."+b[c]))},setMode:function(a,b){return b=="toggle"&&(b=a.is(":hidden")?"show":"hide"),b},getBaseline:function(a,b){var c,d;switch(a[0]){case"top":c=0;break;case"middle":c=.5;break;case"bottom":c=1;break;default:c=a[0]/b.height}switch(a[1]){case"left":d=0;break;case"center":d=.5;break;case"right":d=1;break;default:d=a[1]/b.width}return{x:d,y:c}},createWrapper:function(b){if(b.parent().is(".ui-effects-wrapper"))return b.parent();var c={width:b.outerWidth(!0),height:b.outerHeight(!0),"float":b.css("float")},d=a("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;try{e.id}catch(f){e=document.body}return b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;return b.parent().is(".ui-effects-wrapper")?(c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus(),c):b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}});var m={};a.each(["Quad","Cubic","Quart","Quint","Expo"],function(a,b){m[b]=function(b){return Math.pow(b,a+2)}}),a.extend(m,{Sine:function(a){return 1-Math.cos(a*Math.PI/2)},Circ:function(a){return 1-Math.sqrt(1-a*a)},Elastic:function(a){return a===0||a===1?a:-Math.pow(2,8*(a-1))*Math.sin(((a-1)*80-7.5)*Math.PI/15)},Back:function(a){return a*a*(3*a-2)},Bounce:function(a){var b,c=4;while(a<((b=Math.pow(2,--c))-1)/11);return 1/Math.pow(4,3-c)-7.5625*Math.pow((b*3-2)/22-a,2)}}),a.each(m,function(b,c){a.easing["easeIn"+b]=c,a.easing["easeOut"+b]=function(a){return 1-c(1-a)},a.easing["easeInOut"+b]=function(a){return a<.5?c(a*2)/2:c(a*-2+2)/-2+1}})}(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.highlight.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;
index 25fbc25..6c8ea00 100644 (file)
         <div id="sysinfo">
         [% IF (warnIsRootUser) %]
             <h2>Warning regarding current user</h2>
-            <p>It seems that you are logged in as database administrative user. A lot of things will not work with this account.</p>
-            <p>Usually you need to log in with a regular staff account. To create a staff account, create a branch, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.</p>
+            <p>You are logged in as the database administrative user. This is not recommended because some parts of Koha will not function as expected when using this account.</p>
+            <p>Please log in instead with a regular staff account. To create a staff account, create a library, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.</p>
         [% END %]
             <h2>Warnings regarding the system configuration</h2>
         [% IF ( (prefNoZebra) || (warnPrefBiblioAddsAuthorities) || warnPrefEasyAnalyticalRecords ) %]
                 <li>Shaun Evans</li>
                 <li>Pat Eyler (Kaitiaki from 2002 to 2004)</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609865">Antoine Farnault</a></li>
+                <li>Vitor Fernandes</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6618544670742">Katrin Fischer</a></li>
                 <li>Clay Fouts</li>
                 <li>Claudia Forsman</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6618544607803">Andrew Moore</a></li>
                 <li>Sharon Moreland</li>
                 <li>Nicolas Morin</li>
-                 <li>Mike Mylonas</li>
-                 <li>Joy Nelson</li>
+                <li>Mike Mylonas</li>
+                <li>Nadia Nicolaides</li>
+                <li>Joy Nelson</li>
                 <li><a href="https://www.ohloh.net/accounts/cnighswonger">Chris Nighswonger</a></li>
                 <li>Albert Oller</li>
                 <li>Eric Olsen</li>
                 <li>Maxime Pelletier</li>
                 <li>Polytechnic University</li>
                 <li>Shari Perkins</li>
-                <li>Meenakshi.R</li>
+                <li>Romina Racca</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6620692116417">MJ Ray</a></li>
                 <li>Liz Rea</li>
                 <li>Thatcher Rea</li>
index a04204e..8e9b1a3 100644 (file)
@@ -207,7 +207,7 @@ $(document).ready(function() {
             <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
           </li>
           <li>
-            <label for="branch">Branch:</label>
+            <label for="branch">Library:</label>
             <select id="branch" name="branch">
               <option value="">All</option>
               [% FOREACH branch IN branches_loop %]
index 5533ebc..2631e3c 100644 (file)
@@ -350,8 +350,8 @@ $(document).ready(function()
                         <th>&nbsp;</th>
                         <th>&nbsp;</th>
                         <th>Barcode</th>
-                        <th>Home branch</th>
-                        <th>Holding branch</th>
+                        <th>Home library</th>
+                        <th>Holding library</th>
                         <th>Not for loan</th>
                         <th>Restricted</th>
                         <th>Location</th>
index c6559c3..da9aefe 100644 (file)
                             <th>&nbsp;</th>
                             <th>&nbsp;</th>
                             <th>Barcode</th>
-                            <th>Home branch</th>
-                            <th>Holding branch</th>
+                            <th>Home library</th>
+                            <th>Holding library</th>
                             <th>Not for loan</th>
                             <th>Restricted</th>
                             <th>Location</th>
 
 </div>
 </div><div class="yui-g"><fieldset class="action">
-        <input type="submit"  value="Save" />
+        <input type="submit" onclick="return false;" style="display: none;" id="phony_submit" value="phony_submit" name="phony_submit" />
+        <input type="submit"  value="Save" class="button" accesskey="w" />
         <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Cancel</a>
 </fieldset></div>    </form>
 [% ELSE %]
-<div id="acqui_acquire_orderlist">
-    <table>
-    <tr>
-        <th>Basket</th>
-        <th>ISBN</th>
-        <th>Title</th>
-        <th>Author</th>
-        <th>Qty</th>
-        <th>Received</th>
-    </tr>
-    [% FOREACH loo IN loop %]
-        <tr>
-            <td>[% loo.basketno %]</td>
-            <td>[% loo.isbn %]</td>
-         <td><a href="orderreceive.pl?ordernumber=[% loo.ordernumber %]&amp;invoiceid=[% invoiceid %]">[% loo.title |html %]</a></td>
-            <td>[% loo.author %]</td>
-            <td>[% loo.quantity %]</td>
-            <td>[% loo.quantityreceived %]</td>
-        </tr>
-    [% END %]
-    </table>
-</div>
+    This ordernumber does not exist.
 [% END %]
 
 </div>
index 833e606..877d263 100644 (file)
 
     dt_overwrite_html_sorting_localeCompare();
 
-    var rowsToCollapse = 5;
     $(document).ready(function(){
         var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "bStateSave": true,
+            "iCookieDuration": 60*60*24*1000, // 1000 days
+            "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
             "aoColumnDefs": [
                 { "aTargets": [ 3, 8, 9 ], "bSortable": false, "bSearchable": false },
             ],
@@ -34,6 +36,9 @@
             "sPaginationType": "four_button"
         } ) );
         var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
+            "bStateSave": true,
+            "iCookieDuration": 60*60*24*1000, // 1000 days
+            "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
             "aoColumnDefs": [
                 { "aTargets": [ 3, -1 ], "bSortable": false, "bSearchable": false },
             ],
     });
 */
 
-       rowCountPending  = $("#pendingt tbody.filterclass tr").length;
-       rowCountReceived = $("#receivedt tbody.filterclass tr").length;
-       if (rowCountPending > rowsToCollapse ) { if ( $.cookie("pendingKeepExpanded") != 1 ) { pendingCollapse(); } else { pendingExpand(); } }
-       if (rowCountReceived > rowsToCollapse ) { if ( $.cookie("receivedKeepExpanded") != 1 ) { receivedCollapse(); } else { receivedExpand(); } }
     });
 
      // Case-insensitive version of jquery's contains function
           containsExactly: "$(a).text() == m[3]"
      });
 
-
-    // Collapse pending items table
-    function pendingCollapse() {
-        $.cookie("pendingKeepExpanded", 0, { path: "/", expires: 9999 });
-       $("#pendingcollapserow").remove();
-    $("#pendingt tr").show();
-       $("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
-       $("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ")  + rowsToCollapse +  _(" items are displayed.") + " <a href=\"javascript:pendingExpand();\">" + _("Click here to show all ")  + rowCountPending + _(" items") + "<\/a>.<\/p>");
-
-    }
-
-    // Expend pending items table
-    function pendingExpand() {
-        $.cookie("pendingKeepExpanded", 1, { path: "/", expires: 9999 });
-       $("#pendingcollapserow").remove();
-       $("#pendingt tr").show();
-    $("#pendingt tbody.filterclass tr.orderfound").remove();
-       $("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + " <a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
-    }
-
-    // Collapse already received items table
-    function receivedCollapse() {
-        $.cookie("receivedKeepExpanded", 0, { path: "/", expires: 9999 });
-       $("#receivedcollapserow").remove();
-       $("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
-       $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " <a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
-    }
-
-    // Expand already received items table
-    function receivedExpand() {
-        $.cookie("receivedKeepExpanded", 1, { path: "/", expires: 9999 });
-       $("#receivedcollapserow").remove();
-       $("#receivedt tr").show();
-       $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + " <a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
-    }
-
 //]]>
 </script>
 <script type="text/javascript">
            </ol>
                <fieldset class="action">
         <input type="hidden" value="search" name="op" />
-        <input type="hidden" value="[% booksellerid %]" name="booksellerid" />
-        <input type="hidden" value="[% invoice %]" name="invoice" />
-        <input type="hidden" value="[% invoicedatereceived %]" name="datereceived" />
+        <input type="hidden" value="[% invoiceid %]" name="invoiceid" />
         <input type="submit" value="Filter" />
-        <a href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% booksellerid %]&amp;invoice=[% invoice %]&amp;op=new&amp;datereceived=[% formatteddatereceived %]">Clear</a>
+        <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Clear</a>
                </fieldset>
 
 
index 0902d07..1b1f070 100644 (file)
@@ -68,7 +68,6 @@ function check(form) {
         <h2>Orders with uncertain prices</h2>
         <form action="[% scriptname %]" method="post" name="uncertainprices">
         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
-        <input type="hidden" name="op" value="validate" />
         Orders from:
         <select name="owner">
             [% IF ( owner ) %]
index f8a0506..244f92f 100644 (file)
 
   <div id="budgetsTabs" class="toptabs">
     <ul>
-        <li><a href="#active">Active Budgets</a></li>
-        <li><a href="#inactive">Inactive Budgets</a></li>
+        <li><a href="#active">Active budgets</a></li>
+        <li><a href="#inactive">Inactive budgets</a></li>
     </ul>
 
     <div id="active">
                 <td>
                   <a href="[% script_name %]?op=add_form&amp;budget_period_id=[% period_active.budget_period_id |html %]">Edit</a>
                   <a href="[% script_name %]?op=delete_confirm&amp;budget_period_id=[% period_active.budget_period_id %]">Delete</a>
-                  <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% period_active.budget_period_id %]">Add Fund</a>
+                  <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% period_active.budget_period_id %]">Add fund</a>
                 </td>
                 </tr>
               [% END %]
index 4acaac3..e464617 100644 (file)
                sortList: [[1,0]],
                headers: { 4: { sorter: false}, 5: { sorter: false}}
                                }).tablesorterPager({container: $("#pagertable_authorized_values"),positionFixed: false,size: 50});
-       
+
+    if ( $("#branches option:selected").length < 1 ) {
+        $("#branches option:first").attr("selected", "selected");
+    }
 }); </script>
 
 <script type="text/JavaScript" language="JavaScript">
@@ -60,7 +63,7 @@
         <fieldset class="rows"><ol>
         <li>
                         [% IF ( action_add_category ) %]<label for="category">Category</label>
-               <input type="text" name="category"  id="category" size="10" maxlength="10" />
+            <input type="text" name="category"  id="category" size="10" maxlength="10" class="focus" />
                         [% ELSE %]<span class="label">Category</span>
                <input type="hidden" name="category" value="[% category %]" />   [% category %]
                         [% END %]
         <li>
             <label for="authorised_value">Authorized value</label>
      [% IF ( action_modify ) %]<input type="hidden" id="id" name="id" value="[% id %]" />[% END %]
+            [% IF ( action_add_category ) %]
             <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" />
+            [% ELSE %]
+            <input type="text" id="authorised_value" name="authorised_value" value="[% authorised_value %]" maxlength="80" class="focus" />
+            [% END %]
         </li>
         <li>
             <label for="lib">Description</label>
             <label for="lib_opac">Description (OPAC)</label>
             <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
         </li>
+        <li><label for="branches">Branches limitation: </label>
+            <select id="branches" name="branches" multiple size="10">
+                <option value="">All branches</option>
+                [% FOREACH branch IN branches_loop %]
+                  [% IF ( branch.selected ) %]
+                    <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                  [% ELSE %]
+                    <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                  [% END %]
+                [% END %]
+            </select>
+            <span>Select All if this authorised value must to be displayed all the time. Otherwise select librairies you want to associate with this value.
+            </span>
+        </li>
+
                </ol>
         <div id="icons" class="toptabs" style="clear:both">
         <h5 style="margin-left:10px;">Choose an icon:</h5>
        <th>Description</th>
        <th>Description (OPAC)</th>
        <th>Icon</th>
+    <th>Branches limitations</th>
        <th>Edit</th>
        <th>Delete</th>
        </tr>
        <td>[% loo.lib %]</td>
        <td>[% loo.lib_opac %]</td>
        <td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
+    <td>
+        [% IF loo.branches.size > 0 %]
+            [% branches_str = "" %]
+            [% FOREACH branch IN loo.branches %]
+                [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
+            [% END %]
+            <span href="#" title="[% branches_str %]">
+                [% IF loo.branches.size > 1 %]
+                    [% loo.branches.size %] branches limitations
+                [% ELSE %]
+                    [% loo.branches.size %] branch limitation
+                [% END %]
+        [% ELSE %]
+            No limitation
+        [% END %]
+    </td>
        <td><a href="[% loo.edit %]">Edit</a></td>
        <td><a href="[% loo.delete %]">Delete</a></td>
 </tr>
index f1b8254..6c3114f 100644 (file)
                headers: { 11: { sorter: false}}
        }).tablesorterPager({container: $("#pagertable_categorie"),positionFixed: false,size: 20});
     $( "#enrolmentperioddate" ).datepicker({ minDate: 1 }); // Require that "until date" be in the future
+
+    if ( $("#branches option:selected").length < 1 ) {
+        $("#branches option:first").attr("selected", "selected");
+    }
 }); </script>
 <script type="text/javascript">
 //<![CDATA[
                                        [% IF ( type_P ) %]<option value="P" selected="selected">Professional</option>[% ELSE %]<option value="P">Professional</option>[% END %]
                                        [% IF ( type_X ) %]<option value="X" selected="selected">Statistical</option>[% ELSE %]<option value="X">Statistical</option>[% END %]
                                        </select>
-       </li></ol>
+    </li>
+    <li><label for="branches">Branches limitation: </label>
+        <select id="branches" name="branches" multiple size="10">
+            <option value="">All branches</option>
+            [% FOREACH branch IN branches_loop %]
+              [% IF ( branch.selected ) %]
+                <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+              [% ELSE %]
+                <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+              [% END %]
+            [% END %]
+        </select>
+        <span>Select All if this category type must to be displayed all the time. Otherwise select librairies you want to associate with this value.
+        </span>
+    </li>
+    </ol>
 </fieldset>
 
     [% IF ( EnhancedMessagingPreferences ) %]
@@ -292,6 +311,7 @@ Confirm deletion of category [% categorycode |html %][% END %]</legend>
             [% IF ( EnhancedMessagingPreferences ) %]
             <th scope="col">Messaging</th>
             [% END %]
+            <th scope="col">Branches limitations</th>
                        <th scope="col" colspan="2">&nbsp; </th>
                </thead>
                [% FOREACH loo IN loop %]
@@ -345,6 +365,23 @@ Confirm deletion of category [% categorycode |html %][% END %]</legend>
                             [% END %]
                         </td>
                         [% END %]
+                        <td>
+                            [% IF loo.branches.size > 0 %]
+                                [% branches_str = "" %]
+                                [% FOREACH branch IN loo.branches %]
+                                    [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
+                                [% END %]
+                                <span title="[% branches_str %]">
+                                    [% IF loo.branches.size > 1 %]
+                                        [% loo.branches.size %] branches limitations
+                                    [% ELSE %]
+                                        [% loo.branches.size %] branch limitation
+                                    [% END %]
+                                </span>
+                            [% ELSE %]
+                                No limitation
+                            [% END %]
+                        </td>
                         <td><a href="[% loo.script_name %]?op=add_form&amp;categorycode=[% loo.categorycode |uri %]">Edit</a></td>
                         <td><a href="[% loo.script_name %]?op=delete_confirm&amp;categorycode=[% loo.categorycode |uri %]">Delete</a></td>
                </tr>
index cb3f9ba..30a3a85 100644 (file)
@@ -168,11 +168,15 @@ Item types administration
      </li>
   [% ELSE %]
       <li>
-          <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" />
+          <label for="itemtype">Item type</label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" class="focus" />
       </li>
   [% END %]
       <li>
-          <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" />      </li>
+      [% IF ( itemtype ) %]
+          <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" class="focus" /></li>
+      [% ELSE %]
+          <label for="description">Description</label><input type="text" id="description" name="description" size="48" value="[% description |html %]" /></li>
+      [% END %]
      [% IF ( noItemTypeImages ) %]
         <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
         [% ELSE %]</ol>
index 4ce4785..d70bdbd 100644 (file)
 
 <script type="text/javascript">
 //<![CDATA[
+$(document).ready(function() {
+    if ( $("#branches option:selected").length < 1 ) {
+        $("#branches option:first").attr("selected", "selected");
+    }
+} );
 
 function DoCancel(f) {
   f.op.value='';
@@ -186,6 +191,20 @@ function CheckAttributeTypeForm(f) {
                   to be chosen from the authorized value list.  However, an authorized value list is not 
                   enforced during batch patron import.</span>
         </li>
+        <li><label for="branches">Branches limitation: </label>
+            <select id="branches" name="branches" multiple size="10">
+                <option value="">All branches</option>
+                [% FOREACH branch IN branches_loop %]
+                  [% IF ( branch.selected ) %]
+                    <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                  [% ELSE %]
+                    <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                  [% END %]
+                [% END %]
+            </select>
+            <span>Select All if this attribute type must to be displayed all the time. Otherwise select librairies you want to associate with this value.
+            </span>
+        </li>
         <li>
             <label for="category">Category: </label>
             <select name="category_code" id="category">
@@ -286,6 +305,7 @@ function CheckAttributeTypeForm(f) {
         <tr>
           <th>Code</th>
           <th>Description</th>
+          <th>Branches limitation</th>
           <th>Actions</th>
         </tr>
       </thead>
@@ -295,6 +315,23 @@ function CheckAttributeTypeForm(f) {
             <td>[% item.code |html %]</td>
             <td>[% item.description %]</td>
             <td>
+                [% IF item.branches.size > 0 %]
+                    [% branches_str = "" %]
+                    [% FOREACH branch IN item.branches %]
+                        [% branches_str = branches_str _ " " _ branch.branchname _ "(" _ branch.branchcode _ ")" %]
+                    [% END %]
+                    <span title="[% branches_str %]">
+                        [% IF item.branches.size > 1 %]
+                            [% item.branches.size %] branches limitations
+                        [% ELSE %]
+                            [% item.branches.size %] branch limitation
+                        [% END %]
+                    </span>
+                [% ELSE %]
+                    No limitation
+                [% END %]
+            </td>
+            <td>
               <a href="[% item.script_name %]?op=edit_attribute_type&amp;code=[% item.code |html %]">Edit</a>
               <a href="[% item.script_name %]?op=delete_attribute_type&amp;code=[% item.code |html %]">Delete</a>
             </td>
index 91f15c3..09ec796 100644 (file)
@@ -156,4 +156,19 @@ Cataloging:
             - pref: OpacSuppressionByIPRange
               class: short
             - (Leave blank if not used. Define a range like <code>192.168.</code>.)
-
+        -
+            - pref: SeparateHoldings
+              choices:
+                  yes: Separate
+                  no: Don't separate
+            - 'items display into two tabs. First tab contains items whose'
+            - pref: SeparateHoldingsBranch
+              choices:
+                homebranch: 'home branch'
+                holdingbranch: 'holding branch'
+            - 'is the branch of user logged in. The other tab contains other items.'
+        -
+            - Don't show these
+            - pref: NotesBlacklist
+              class: multi
+            - note fields in title notes separator (OPAC record details) and in the description separator (Staff client record details). The fields should appear separated with commas and according with the Koha MARC format (eg 3.. for UNIMARC, 5.. for MARC21)
index c583bbe..645b19b 100644 (file)
@@ -228,6 +228,12 @@ Circulation:
                   date_due: the old due date of the checkout.
                   now: the current date.
         -
+            - pref: RenewalSendNotice
+              choices:
+                  yes: Send
+                  no: "Don't send"
+            - a renewal notice according to patron checkout alert preferences.
+        -
             - Prevent patrons from making holds on the OPAC if they owe more than
             - pref: maxoutstanding
               class: currency
@@ -435,6 +441,12 @@ Circulation:
             - pref: decreaseLoanHighHoldsValue
               class: integer
             - holds.
+        -
+            - pref: AllowHoldsOnPatronsPossessions
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - a patron to place a hold on a record where the patron already has one or more items attached to that record checked out.
     Fines Policy:
         -
             - Calculate fines based on days overdue
@@ -452,8 +464,24 @@ Circulation:
                   test: Calculate (but only for mailing to the admin)
                   production: Calculate and charge
             - fines (when <code>misc/cronjobs/fines.pl</code> is being run).
+        -
+            - pref: RefundLostItemFeeOnReturn
+              choices:
+                  yes: Refund
+                  no: "Don't refund"
+            - lost item fees charged to a borrower when the lost item is returned.
     Self Checkout:
         -
+            - "Include the following JavaScript on all pages in the web-based self checkout:"
+            - pref: SCOUserJS
+              type: textarea
+              class: code
+        -
+            - "Include the following CSS on all pages in the web-based self checkout:"
+            - pref: SCOUserCSS
+              type: textarea
+              class: code
+        -
             - pref: ShowPatronImageInWebBasedSelfCheck
               choices:
                   yes: Show
index d1f2814..655ae34 100644 (file)
@@ -286,3 +286,17 @@ Enhanced Content:
                   yes: Allow
                   no: "Don't allow"
             - multiple images to be attached to each bibliographic record.
+    HTML5 Media:
+        -
+            - Show a tab with a HTML5 media player for files catalogued in field 856
+            - pref: HTML5MediaEnabled
+              choices:
+                  not: "not at all."
+                  opac: "in the OPAC."
+                  staff: "in the staff client."
+                  both: "in OPAC and staff client."
+        -
+            - Media file extensions
+            - pref: HTML5MediaExtensions
+              class: multi
+            - (separated with |).
index 2866f8d..c1870ad 100644 (file)
@@ -239,6 +239,7 @@ OPAC:
             - a library select pulldown menu on the OPAC masthead.
         -
             - 'Display this HTML when no results are found for a search in the OPAC:'
+            - '<br />Note: You can insert placeholders {QUERY_KW} that will be replaced with the keywords of the query.'
             - pref: OPACNoResultsFound
               type: textarea
               class: code
@@ -258,6 +259,17 @@ OPAC:
             - '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),'
             - 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),'
             - 'Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields (<code>marcstd</code>), MODS (<code>mods</code>), RIS (<code>ris</code>)'
+        -
+            - pref: OpacSeparateHoldings
+              choices:
+                  yes: Separate
+                  no: Don't separate
+            - 'items display into two tabs. First tab contains items whose'
+            - pref: OpacSeparateHoldingsBranch
+              choices:
+                homebranch: 'home branch'
+                holdingbranch: 'holding branch'
+            - 'is the branch of user logged in. The other tab contains other items.'
     Features:
         -
             - pref: opacuserlogin
@@ -527,3 +539,37 @@ OPAC:
                   yes: Use
                   no: "Don't use"
             - "the item collection code when finding items for the shelf browser."      
+
+    Self Registration:
+        -
+            - pref: PatronSelfRegistration
+              choices:
+                  yes: Allow
+                  no: "Don't allow"
+            - "library patrons to register an account via the OPAC."
+        -
+            - pref: PatronSelfRegistrationVerifyByEmail
+              choices:
+                  yes: Require
+                  no: "Don't require"
+            - "that a self-registering patron verify his or herself via email."
+        -
+            - "Use the patron category code"
+            - pref: PatronSelfRegistrationDefaultCategory
+              class: short
+            - "as the default patron category for patrons registered via the OPAC."
+        -
+            - "Delete patrons registered via the OPAC, but not yet verified after"
+            - pref: PatronSelfRegistrationExpireTemporaryAccountsDelay
+              class: integer
+            - "days."
+        -
+            - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> must be filled in on the patron entry screen:"
+            - pref: PatronSelfRegistrationBorrowerMandatoryField
+              class: multi
+            - (separate columns with |)
+        -
+            - "The following <a href='http://schema.koha-community.org/tables/borrowers.html' target='blank'>database columns</a> will not appear on the patron entry screen:"
+            - pref: PatronSelfRegistrationBorrowerUnwantedField
+              class: multi
+            - (separate columns with |)
index a025fe1..586d72f 100644 (file)
@@ -230,7 +230,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                             [% ELSE %]
                             <option value="holdingbranch">
                             [% END %]
-                                Item returns to issuing branch
+                                Item returns to issuing library
                             </option>
                             [% IF ( default_returnbranch == 'noreturn' ) %]
                             <option value="noreturn" selected="selected">
@@ -390,7 +390,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                     <td>
                         <select name="returnbranch">
                             <option value="homebranch">Item returns home</option>
-                            <option value="holdingbranch">Item returns to issuing branch</option>
+                            <option value="holdingbranch">Item returns to issuing library</option>
                             <option value="noreturn">Item floats</option>
                         </select>
                     </td>
index ef2b5b9..cc68bfe 100644 (file)
@@ -1,4 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
+[% INCLUDE 'greybox.inc' %]
 <title>Koha &rsaquo; Catalog &rsaquo;
   [% IF ( unknownbiblionumber ) %]
     Unknown record
@@ -115,6 +116,7 @@ function verify_images() {
                     [% END %]
                     </span>
         [% END %]
+        <span id="catalogue_detail_marc_preview" class="results_summary"><span class="label">MARC Preview:</span> <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a></span>
         [% IF ( holdcount ) %]<span class="results_summary"><span class="label">Holds:</span> <span class="holdcount"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">[% holdcount %]</a></span></span>[% ELSE %][% END %]
 
         [% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
@@ -174,6 +176,10 @@ function verify_images() {
        <a href="http://[% OpacUrl %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a>
                </li>
        [% END %]
+        <li id="catalogue_detail_marc_preview">
+            <strong>MARC Preview:</strong>
+            <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% biblionumber %]" title="MARC" rel="gb_page_center[600,500]">Show</a>
+        </li>
         </ul>
         </div>
        
@@ -255,18 +261,23 @@ function verify_images() {
 </div>
 <div id="bibliodetails" class="toptabs">
 
-<ul>   
-<li><a href="#holdings">Holdings</a></li>
+<ul>
+    [% IF (SeparateHoldings) %]
+        <li><a href="#holdings">[% LoginBranchname %] holdings</a></li>
+        <li><a href="#otherholdings">Other holdings</a></li>
+    [% ELSE %]
+        <li><a href="#holdings">Holdings</a></li>
+    [% END %]
 <li><a href="#description">Descriptions</a></li>
 [% IF ( subscriptionsnumber ) %]<li><a href="#subscriptions">Subscriptions</a></li>[% END %]
 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]<li><a href="#editions">Editions</a></li>[% END %][% END %]
 [% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
- </ul>
+[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]<li><a href="#html5media">Play media</a></li>[% END %][% END %]
+</ul>
 
-<div id="holdings">
-[% IF ( count ) %]
-    [% IF ( showncount ) %]
-        <table>
+[% BLOCK items_table %]
+    <table>
+        <thead>
             <tr>
                 [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
                 <th>Current location</th>
@@ -281,148 +292,171 @@ function verify_images() {
                 [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
                 [% IF materials %]<th>Materials specified</th>[% END %]
                 [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
-        [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
-        [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
-               [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
+                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
+                [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
+                [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
             </tr>
-            [% FOREACH itemloo IN itemloop %]
+        </thead>
+        <tbody>
+            [% FOREACH item IN items %]
                 <tr>
                     [% IF ( item_level_itypes ) %]
-                    <td class="itype">
-                        [% IF !noItemTypeImages && itemloo.imageurl %]
-                            <img src="[% itemloo.imageurl %]" alt="[% itemloo.description %]" title="[% itemloo.description %]" />
-                        [% END %]
-                        [% itemloo.description %]
-                    </td>
+                        <td class="itype">
+                            [% IF !noItemTypeImages && item.imageurl %]
+                                <img src="[% item.imageurl %]" alt="[% item.description %]" title="[% item.description %]" />
+                            [% END %]
+                            [% item.description %]
+                        </td>
                     [% END %]
-                    <td class="location">[% UNLESS ( singlebranchmode ) %][% itemloo.branchname %] [% END %]</td>
-                    <td class="homebranch">[% itemloo.homebranch %]<span class="shelvingloc">[% itemloo.location %]</span> </td>
-                   [% IF ( itemdata_ccode ) %]<td>[% itemloo.ccode %]</td>[% END %]
-                    <td class="itemcallnumber">[% IF ( itemloo.itemcallnumber ) %] [% itemloo.itemcallnumber %][% END %]</td>
+                    <td class="location">[% UNLESS ( singlebranchmode ) %][% item.branchname %] [% END %]</td>
+                    <td class="homebranch">[% item.homebranch %]<span class="shelvingloc">[% item.location %]</span> </td>
+                    [% IF ( itemdata_ccode ) %]<td>[% item.ccode %]</td>[% END %]
+                    <td class="itemcallnumber">[% IF ( item.itemcallnumber ) %] [% item.itemcallnumber %][% END %]</td>
                     <td class="status">
 
-                [% IF ( itemloo.datedue ) %]
-                                               <span class="datedue">Checked out
-                    [% UNLESS ( itemloo.NOTSAMEBRANCH ) %]
-                          to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.borrowernumber %]">
-                         [% IF ( itemloo.hidepatronname ) %]
-                             [% itemloo.cardnumber %]
-                         [% ELSE %]
-                             [% itemloo.firstname %] [% itemloo.surname %]
-                         [% END %]
-                         </a>
-                    [% END %]
-                                               : due [% itemloo.datedue %]
-                                               </span>
-                [% ELSIF ( itemloo.transfertwhen ) %]
-                           In transit from [% itemloo.transfertfrom %],
-                           to [% itemloo.transfertto %], since [% itemloo.transfertwhen %]
-                                                       <!-- FIXME: the "since" clause is redundant w/ lastseen field -->
-                [% END %]
+                        [% IF ( item.datedue ) %]
+                            <span class="datedue">Checked out
+                                [% UNLESS ( item.NOTSAMEBRANCH ) %]
+                                    to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.borrowernumber %]">
+                                        [% IF ( item.hidepatronname ) %]
+                                            [% item.cardnumber %]
+                                        [% ELSE %]
+                                            [% item.firstname %] [% item.surname %]
+                                        [% END %]
+                                    </a>
+                                [% END %]
+                                : due [% item.datedue %]
+                            </span>
+                        [% ELSIF ( item.transfertwhen ) %]
+                            In transit from [% item.transfertfrom %],
+                            to [% item.transfertto %], since [% item.transfertwhen %]
+                            <!-- FIXME: the "since" clause is redundant w/ lastseen field -->
+                        [% END %]
 
-                [% IF ( itemloo.itemlost ) %]
-                    [% IF ( itemloo.itemlostloop ) %]
-                    [% FOREACH itemlostloo IN itemloo.itemlostloop %]
-                        [% IF ( itemlostloo.selected ) %]
+                        [% IF ( item.itemlost ) %]
+                            [% IF ( item.itemlostloop ) %]
+                                [% FOREACH itemlostloo IN item.itemlostloop %]
+                                    [% IF ( itemlostloo.selected ) %]
                                         <span class="lost">[% itemlostloo.lib %]</span>
+                                    [% END %]
+                                [% END %]
+                            [% ELSE %]
+                                <span class="lost">Unavailable (lost or missing)</span>
+                            [% END %]
                         [% END %]
-                    [% END %]
-                    [% ELSE %]
-                                        <span class="lost">Unavailable (lost or missing)</span>
-                    [% END %]
-                [% END %]
 
-                [% IF ( itemloo.wthdrawn ) %]
-                                        <span class="wdn">Withdrawn</span>
-                [% END %]
+                        [% IF ( item.wthdrawn ) %]
+                            <span class="wdn">Withdrawn</span>
+                        [% END %]
 
-                [% IF ( itemloo.damaged ) %]
-                    [% IF ( itemloo.itemdamagedloop ) %]
-                        [% FOREACH itemdamagedloo IN itemloo.itemdamagedloop %]
-                        [% IF ( itemdamagedloo.selected ) %]
+                        [% IF ( item.damaged ) %]
+                            [% IF ( item.itemdamagedloop ) %]
+                                [% FOREACH itemdamagedloo IN item.itemdamagedloop %]
+                                    [% IF ( itemdamagedloo.selected ) %]
                                         <span class="dmg">[% itemdamagedloo.lib %]</span>
+                                    [% END %]
+                                [% END %]
+                            [% ELSE %]
+                                <span class="dmg">Damaged</span>
+                            [% END %]
                         [% END %]
+
+                        [% IF ( item.itemnotforloan ) %]
+                            Not for loan
+                            [% IF ( item.notforloanvalue ) %]
+                                ([% item.notforloanvalue %])
+                            [% END %]
                         [% END %]
-                    [% ELSE %]
-                                        <span class="dmg">Damaged</span>
-                    [% END %]
-                [% END %]
 
-                [% IF ( itemloo.itemnotforloan ) %]
-                    Not for loan 
-                    [% IF ( itemloo.notforloanvalue ) %]
-                        ([% itemloo.notforloanvalue %])
-                    [% END %]
-                [% END %]
+                        [% IF ( item.reservedate ) %]
+                            [% IF ( item.waitingdate ) %]
+                                Waiting
+                            [% ELSE %]
+                                Item-level hold
+                            [% END %]
+                            [% IF ( canreservefromotherbranches ) %]
+                                for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% item.ReservedForBorrowernumber %]">
+                                    [% IF ( item.hidepatronname ) %]
+                                        [% item.Reservedcardnumber %]
+                                    [% ELSE %]
+                                        [% item.ReservedForFirstname %] [% item.ReservedForSurname %]
+                                    [% END %]
+                                </a>
+                            [% END %]
+                            [% IF ( item.waitingdate ) %]
+                                at[% ELSE %]for delivery at
+                            [% END %]
+                            [% item.ExpectedAtLibrary %]
+                            [% IF ( item.waitingdate ) %]
+                                since [% item.waitingdate %]
+                            [% ELSE %]
+                                [% IF ( item.reservedate ) %]
+                                    (placed [% item.reservedate %])
+                                [% END %]
+                            [% END %]
+                        [% END %]
+                        [% UNLESS ( item.itemnotforloan or item.onloan or item.itemlost or item.wthdrawn or item.damaged or item.transfertwhen or item.reservedate ) %]
+                            Available
+                        [% END %]
 
-                            
-                [% IF ( itemloo.reservedate ) %]
-                    [% IF ( itemloo.waitingdate ) %]
-                        Waiting
-                    [% ELSE %]
-                        Item-level hold
-                    [% END %]
-                    [% IF ( canreservefromotherbranches ) %]for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% itemloo.ReservedForBorrowernumber %]">
-                       [% IF ( itemloo.hidepatronname ) %]
-                           [% itemloo.Reservedcardnumber %]
-                       [% ELSE %]
-                           [% itemloo.ReservedForFirstname %] [% itemloo.ReservedForSurname %]
-                       [% END %]
-                   </a>[% END %]
-                    [% IF ( itemloo.waitingdate ) %]
-                        at[% ELSE %]for delivery at
-                    [% END %]   [% itemloo.ExpectedAtLibrary %]
-                    [% IF ( itemloo.waitingdate ) %]
-                        since [% itemloo.waitingdate %]
-                    [% ELSE %]
-                        [% IF ( itemloo.reservedate ) %](placed [% itemloo.reservedate %])[% END %]
-                    [% END %]
-                [% END %]
-                [% UNLESS ( itemloo.itemnotforloan ) %][% UNLESS ( itemloo.onloan ) %][% UNLESS ( itemloo.itemlost ) %][% UNLESS ( itemloo.wthdrawn ) %][% UNLESS ( itemloo.damaged ) %][% UNLESS ( itemloo.transfertwhen ) %][% UNLESS ( itemloo.reservedate ) %]
-                                        Available
-                [% END %][% END %][% END %][% END %][% END %][% END %][% END %]
+                        [% IF ( item.restricted ) %]
+                            <span class="restricted">([% item.restricted %])</span>
+                        [% END %]
 
-                [% IF ( itemloo.restricted ) %]<span class="restricted">([% itemloo.restricted %])</span>[% END %]
-                        
                     </td>
-                    <td class="datelastseen">[% itemloo.datelastseen %]</td>
-                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% itemloo.type %]&amp;itemnumber=[% itemloo.itemnumber %]&amp;biblionumber=[% itemloo.biblionumber %]&amp;bi=[% itemloo.biblioitemnumber %]#item[% itemloo.itemnumber %]">[% itemloo.barcode %]</a></td>
-                               [% IF ( volinfo ) %]    <td class="enumchron">
-                                       [% IF ( itemdata_enumchron ) %]
-                                               [% IF ( itemloo.enumchron ) %]
-                                               [% itemloo.enumchron %][% IF ( itemloo.serialseq ) %] -- [% END %]
-                                               [% END %]
-                                       [% itemloo.serialseq %][% IF ( itemloo.publisheddate ) %] ([% itemloo.publisheddate %])[% END %]
-                                       [% END %]
-                               </td>[% END %]
-                               [% IF ( itemdata_uri ) %]
-                                       <td class="uri"><a href="[% itemloo.uri %]">[% itemloo.uri %]</a></td>
-                               [% END %]
-                               [% IF ( itemdata_copynumber ) %]
-                                       <td class="copynumber">[% itemloo.copynumber %]</td>
-                               [% END %]
-               [% IF materials %]
-                   <td class="materials"> [% itemloo.materials %] </td>
-               [% END %]
-                [% IF ( itemdata_itemnotes ) %]<td><div class="itemnotes">[% itemloo.itemnotes %]</div></td>[% END %]
-               [% IF ( SpineLabelShowPrintOnBibDetails ) %]
-            <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% itemloo.barcode %]" >Print label</a></td>
-               [% END %]
-                [% IF ( hostrecords ) %]
-                      <td>[% IF ( itemloo.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemloo.hostbiblionumber %]" >[% itemloo.hosttitle %]</a>[% END %]</td>
-                [% END %]
-                [% IF ( analyze ) %]<td>
-                       [% IF ( itemloo.countanalytics ) %]
-                               <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% itemloo.itemnumber %]">[% itemloo.countanalytics %] analytics</a>
-                       [% END %]</td>
-               [% END %]
-                [% IF ( analyze ) %]
-                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% itemloo.biblionumber %]&amp;hostitemnumber=[% itemloo.itemnumber %]">Create analytics</a></td>
-                [% END %]
+                    <td class="datelastseen">[% item.datelastseen %]</td>
+                    <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?type=[% item.type %]&amp;itemnumber=[% item.itemnumber %]&amp;biblionumber=[% item.biblionumber %]&amp;bi=[% item.biblioitemnumber %]#item[% item.itemnumber %]">[% item.barcode %]</a></td>
+                    [% IF ( volinfo ) %]
+                        <td class="enumchron">
+                            [% IF ( itemdata_enumchron ) %]
+                                [% IF ( item.enumchron ) %]
+                                    [% item.enumchron %]
+                                    [% IF ( item.serialseq ) %] -- [% END %]
+                                [% END %]
+                                [% item.serialseq %]
+                                [% IF ( item.publisheddate ) %] ([% item.publisheddate %])[% END %]
+                            [% END %]
+                        </td>
+                    [% END %]
+                    [% IF ( itemdata_uri ) %]
+                        <td class="uri"><a href="[% item.uri %]">[% item.uri %]</a></td>
+                    [% END %]
+                    [% IF ( itemdata_copynumber ) %]
+                        <td class="copynumber">[% item.copynumber %]</td>
+                    [% END %]
+                    [% IF materials %]
+                        <td class="materials"> [% item.materials %] </td>
+                    [% END %]
+                    [% IF ( itemdata_itemnotes ) %]
+                        <td><div class="itemnotes">[% item.itemnotes %]</div></td>
+                    [% END %]
+                    [% IF ( SpineLabelShowPrintOnBibDetails ) %]
+                        <td><a href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode %]" >Print label</a></td>
+                    [% END %]
+                    [% IF ( hostrecords ) %]
+                        <td>[% IF ( item.hostbiblionumber) %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.hostbiblionumber %]" >[% item.hosttitle %]</a>[% END %]</td>
+                    [% END %]
+                    [% IF ( analyze ) %]
+                        <td>
+                            [% IF ( item.countanalytics ) %]
+                                <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&amp;q=[% item.itemnumber %]">[% item.countanalytics %] analytics</a>
+                            [% END %]
+                        </td>
+                    [% END %]
+                    [% IF ( analyze ) %]
+                        <td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&amp;hostitemnumber=[% item.itemnumber %]">Create analytics</a></td>
+                    [% END %]
 
                 </tr>
             [% END %]
-        </table>
+        </tbody>
+    </table>
+[% END %][%# end of block items_table %]
+
+<div id="holdings">
+[% IF ( count ) %]
+    [% IF ( showncount ) %]
+        [% PROCESS items_table items=itemloop %]
         [% END %]
                 [% IF ( hiddencount ) %]
                    <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]&amp;showallitems=1">Show all items ([% hiddencount %] hidden)</a>
@@ -445,6 +479,16 @@ function verify_images() {
     [% END %]
 [% END %]
     </div>
+
+[% IF (SeparateHoldings) %]
+    <div id="otherholdings">
+        [% IF (otheritemloop.size) %]
+            [% PROCESS items_table items=otheritemloop %]
+        [% ELSE %]
+            No other items.
+        [% END %]
+    </div>
+[% END %]
     
 <div id="description">
 <div class="content_set">
@@ -470,6 +514,8 @@ function verify_images() {
     [% FOREACH subscription IN subscriptions %]
            [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
            [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
+            [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
+            [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %] </p>[% END %]
             [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
             [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist %] </p>[% END %]
             [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote %])</p>[% END %]
@@ -486,20 +532,16 @@ function verify_images() {
                 <tr>
                     <td>[% latestserial.serialseq %]</td>
                     <td>[% latestserial.planneddate %]</td>
-                    <td>[% IF ( latestserial.status1 ) %]Expected
-                        [% ELSE %]
-                            [% IF ( latestserial.status2 ) %]Arrived
-                            [% ELSE %]
-                                [% IF ( latestserial.status3 ) %]Late
-                                [% ELSE %]
-                                    [% IF ( latestserial.status4 ) %]Missing
-                                    [% ELSE %]
-                                        [% IF ( latestserial.status5 ) %]Not issued
-                                        [% END %]
-                                    [% END %]
-                                [% END %]
-                            [% END %]
-                        [% END %]</td>
+                    <td>
+                      [% IF ( latestserial.status1 ) %]Expected[% END %]
+                      [% IF ( latestserial.status2 ) %]Arrived[% END %]
+                      [% IF ( latestserial.status3 ) %]Late[% END %]
+                      [% IF ( latestserial.status4 ) %]Missing[% END %]
+                      [% IF ( latestserial.status5 ) %]Not issued[% END %]
+                      [% IF ( latestserial.status6 ) %]Delete[% END %]
+                      [% IF ( latestserial.status7 ) %]Claimed[% END %]
+                      [% IF ( latestserial.status8 ) %]Stopped[% END %]
+                    </td>
                     <td>[% latestserial.notes %]</td>
                 </tr>
             [% END %]
@@ -546,6 +588,20 @@ function verify_images() {
 </div>
 [% END %]
 
+[% IF ( HTML5MediaEnabled ) %]
+<div id="html5media">
+        <p>
+        <[% HTML5MediaParent %] controls preload=none>
+          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
+            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
+          [% END %]
+            [[% HTML5MediaParent %] tag not supported by your browser.]
+        </[% HTML5MediaParent %]>
+        </p>
+</div>
+[% END %]
+
+
 </div><!-- /bibliodetails -->
 
 <div class="yui-g" id="export" style="margin-top: 1em;">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detailprint.tt
deleted file mode 100644 (file)
index 3f4312a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-[% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Catalog &rsaquo; Details for [% title |html %]</title>
-[% INCLUDE 'doc-head-close.inc' %]
-<link rel="stylesheet" href="[% themelang %]/css/print.css" type="text/css" />
-</head>
-
-<body id="catalog_detailprint" class="catalog">
-
-<!-- main site -->
-<div id="main">
-[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
-       <table class="list">
-       <caption>[% BIBLIO_RESULT.title |html %] [% BIBLIO_RESULT.subtitle %]</caption>
-    <tr><th>Biblio record number: </th><td> [% BIBLIO_RESULT.biblionumber %]   </td></tr>
-[% IF ( BIBLIO_RESULT.author ) %]<tr><th>Author: </th><td>[% BIBLIO_RESULT.author %]</td></tr>[% END %]
-[% IF ( BIBLIO_RESULT.additional ) %]<tr><th>Additional author: </th><td>[% BIBLIO_RESULT.additional %]</td></tr>[% END %]
-[% IF ( BIBLIO_RESULT.publishercode ) %]<tr><th>Publisher: </th><td>[% BIBLIO_RESULT.publishercode %]</td></tr>[% END %]
-<tr><th>Publication details: </th><td>                 [% IF ( BIBLIO_RESULT.publicationyear ) %][% BIBLIO_RESULT.publicationyear %][% END %]
-                       [% IF ( BIBLIO_RESULT.pages ) %], [% END %][% BIBLIO_RESULT.pages %]
-                       [% IF ( BIBLIO_RESULT.size ) %], [% END %][% BIBLIO_RESULT.size %]</td></tr>
-                       [% IF ( BIBLIO_RESULT.collection ) %]<tr><th>Collection:</th><td> [% BIBLIO_RESULT.seriestitle %]</td></tr>[% END %]
-                       [% IF ( BIBLIO_RESULT.subject ) %]<tr><th>Subject: </th><td>[% BIBLIO_RESULT.subject %]</td></tr>[% END %]
-            [% IF ( BIBLIO_RESULT.copyrightdate ) %]<tr><th>Copyright date: </th><td> [% BIBLIO_RESULT.copyrightdate %]</td></tr>[% END %]
-                       [% IF ( BIBLIO_RESULT.notes ) %]<tr><th>Notes: </th><td>[% BIBLIO_RESULT.notes %]</td></tr>[% END %]
-                       [% IF ( BIBLIO_RESULT.unititle ) %]<tr><th>Unititle: </th><td>[% BIBLIO_RESULT.unititle %]</td></tr>[% END %]
-                       [% IF ( BIBLIO_RESULT.dewey ) %]<tr><th>Dewey: </th><td>[% BIBLIO_RESULT.dewey %]</td></tr>[% END %]
-                       [% IF ( BIBLIO_RESULT.classification ) %]<tr><th>Classification: </th><td> [% BIBLIO_RESULT.classification %]</td></tr>[% END %]
-                       [% IF ( BIBLIO_RESULT.lccn ) %]<tr><th>LCCN: </th><td>[% BIBLIO_RESULT.lccn %]</td></tr>[% END %]
-            [% IF ( BIBLIO_RESULT.url ) %]<tr><th>URL: </th><td><a href="[% BIBLIO_RESULT.url %]">[% BIBLIO_RESULT.url %]</a></td></tr>[% END %]
-                       [% IF ( BIBLIO_RESULT.ISBN ) %]<tr><th>ISBN: </th><td>[% BIBLIO_RESULT.ISBN %]</td></tr>[% END %]
-       </table>
-[% END %]
-
-<table>
-    <tr><th>Item type</th><th>Call number</th><th>Location</th><th>Date due</th><th>Last seen</th><th>Barcode</th></tr>
-       [% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
-               <tr>
-                       <td>[% ITEM_RESULT.description %]</td>
-                       <td>[% ITEM_RESULT.itemcallnumber %]</td>
-                       <td>[% ITEM_RESULT.branchname %][% IF ( ITEM_RESULT.bulk ) %], [% ITEM_RESULT.bulk %][% ELSE %]&nbsp;[% END %]</td>
-                       <td>[% ITEM_RESULT.datedue %]</td>
-                       <td>[% ITEM_RESULT.datelastseen %]</td>
-                       <td>[% ITEM_RESULT.barcode %]</td>
-               </tr>
-       [% END %]
-</table>
-<script type="text/javascript">
-//<![CDATA[
-    $(document).ready(function() {
-       window.print();
-    });
-//]]>
-</script>
-[% INCLUDE 'intranet-bottom.inc' %]
index 2c33df8..0222046 100644 (file)
@@ -87,8 +87,8 @@ function confirm_deletion(biblionumber,itemnumber) {
 
 $(document).ready(function() {
     $("#cataloguing_additem_itemlist  tr").hover(
-        function () {$(this).attr("class","highlight");},
-        function () {$(this).attr("class",""         );}
+        function () {$(this).addClass("highlight");},
+        function () {$(this).removeClass("highlight");}
     );
 });
 //]]>
@@ -131,7 +131,11 @@ $(document).ready(function() {
                 [% END %]
             </tr>
                 [% FOREACH item_loo IN item_loop %]
+                [% IF ( item_loo.itemnumber == itemnumber) %]
+                <tr id="row[% item_loo.itemnumber %]" class="active">
+                [% ELSE %]
                 <tr id="row[% item_loo.itemnumber %]">
+                [% END %]
                     [% IF ( item_loo.nomod ) %] <td colspan="2">&nbsp;</td>[% ELSE %][% IF ( item_loo.hostitemflag ) %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% item_loo.hostbiblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a></td>
 <td><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&amp;biblionumber=[% biblionumber %]&amp;hostitemnumber=[% item_loo.itemnumber %]">Delink</a></td>
 [% ELSE %]<td><a href="additem.pl?op=edititem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a></td>
@@ -197,8 +201,8 @@ $(document).ready(function() {
     -->
 
     <input type="submit" name="add_submit" value="Add item" onclick="return Check(this.form)" />
-    <input type="submit" name="add_duplicate_submit" value="Add &amp; Duplicate" onclick="return Check(this.form)" />
-    <input type="submit" name="add_multiple_copies" value="Add Multiple Copies" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
+    <input type="submit" name="add_duplicate_submit" value="Add &amp; duplicate" onclick="return Check(this.form)" />
+    <input type="submit" name="add_multiple_copies" value="Add multiple copies" onclick="javascript:this.nextSibling.style.visibility='visible';document.f.number_of_copies.focus(); return false;" /><span id="add_multiple_copies_span" style="visibility:hidden">
        <label for="number_of_copies">Number of copies to add : </label>
        <input type="text" id="number_of_copies" name="number_of_copies" value="" size="2" />
        <input type="submit" id="add_multiple_copies_submit" name="add_multiple_copies_submit" value="Add" onclick="javascript:return Check(this.form) &amp;&amp; CheckMultipleAdd(this.form.number_of_copies.value);" />
@@ -208,7 +212,7 @@ $(document).ready(function() {
     <input type="hidden" name="tag" value="[% itemtagfield %]" />
     <input type="hidden" name="subfield" value="[% itemtagsubfield %]" />
     <input type="hidden" name="field_value" value="[% itemnumber %]" />
-    <input type="submit" value="Save Changes" onclick="return Check(this.form)" />
+    <input type="submit" value="Save changes" onclick="return Check(this.form)" />
     [% END %]</fieldset>
     
     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
index b53cffb..cabb45c 100644 (file)
@@ -28,7 +28,7 @@ $(document).ready(function(){
                
                <tr><td>[% homebranch %]</td>
             <td>[% holdingbranch %]</td>
-            <td>[% lastdate %]</td>
+            <td>[% IF ( lastdate ) %][% lastdate %][% ELSE %]Item has no transfer record[% END %]</td>
             <td>[% count %]</td>
         </tr>
 </table>
@@ -50,7 +50,8 @@ $(document).ready(function(){
                     <span style="display:none;">[% branchloo.seen %][% branchloo.seentime %]</span>
                     <!-- invisible span for eventual use by tablesorter -->
                     [% branchloo.seen %] [% branchloo.seentime %]
-                [% ELSE %]Never
+                [% ELSE %]
+                    <span>Never</span>
                 [% END %]
             </td>
         </tr>
index 8b4ad57..631158f 100644 (file)
@@ -19,7 +19,9 @@
        <ul>
         <li><a href="/cgi-bin/koha/circ/circulation.pl">Check out</a></li>
         <li><a href="/cgi-bin/koha/circ/returns.pl">Check in</a></li>
+    [% IF ( display_transfer ) %]
                <li><a href="/cgi-bin/koha/circ/branchtransfers.pl">Transfer</a></li>
+    [% END %]
        [% IF ( AutoLocation ) %][% ELSE %][% IF ( IndependantBranches ) %][% ELSE %]<li><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a></li>[% END %][% END %]
        [% IF ( fast_cataloging ) %]
            [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
index ee3a666..c860ed6 100644 (file)
@@ -385,16 +385,18 @@ function validate1(date) {
 
 [% IF ( RESERVED ) %]
     <p>
-    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="1" />
+    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
     <label for="cancelreserve">Cancel hold</label>
     </p>
 [% END %]
 
 [% IF ( RESERVE_WAITING ) %]
-    <p>
-    <input type="checkbox" id="cancelreserve" name="cancelreserve" value="1" />
+<p>
     <label for="cancelreserve">Cancel hold</label>
-    </p>
+    <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
+    <label for="revertreserve">Revert waiting status</label>
+    <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
+</p>
 [% END %]
 
     <input type="hidden" name="barcode" value="[% barcode %]" />
index 672105a..7fd8d1d 100644 (file)
@@ -332,6 +332,11 @@ $(document).ready(function () {
                     [% END %]
                     [% IF ( errmsgloo.waslost ) %]
                         <p class="problem">Item was lost, now found.</p>
+                        [% IF ( LostItemFeeRefunded ) %]
+                            <p class="problem">A refund has been applied to the borrowing patron's account.</p>
+                        [% ELSE %]
+                            <p class="problem">Any lost item fees for this item will remain on the patron's account</p>
+                        [% END %]
                     [% END %]
                     [% IF ( errmsgloo.withdrawn ) %]
                         [% IF BlockReturnOfWithdrawnItems %]
@@ -415,7 +420,7 @@ $(document).ready(function () {
 [% IF ( riloop ) %]
     <h2>Checked-in items</h2>
     <table>
-    <tr><th>Due date</th><th>Title</th>        <th>Author</th> <th>Barcode</th><th>Home branch</th><th>Holding branch</th><th>Shelving location</th><th>Call number</th><th>Type</th>  <th>Patron</th><th>Note</th></tr>
+    <tr><th>Due date</th><th>Title</th>        <th>Author</th> <th>Barcode</th><th>Home library</th><th>Holding library</th><th>Shelving location</th><th>Call number</th><th>Type</th>        <th>Patron</th><th>Note</th></tr>
 
         [% FOREACH riloo IN riloop %]
             <tr>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/didyoumean.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/didyoumean.tt
new file mode 100644 (file)
index 0000000..eea10bc
--- /dev/null
@@ -0,0 +1,22 @@
+[% INCLUDE 'help-top.inc' %]
+
+<h1>Did you mean?</h1>
+
+<p>Koha can offer 'Did you mean?' options on searches based on values in your authorities.</p>
+
+<p style="color: #990000;">Important Did you mean? only works in the OPAC at this time. The Intranet options are here for future development.</p>
+
+<p>Using this page you can control which options Koha gives patrons on their search results.</p>
+
+<p>To turn on the 'Did you mean?' bar on your search results you need to check the box next to each plugin you would like to use. The two plugins you have to choose from are:</p>
+
+<ul>
+    <li>The ExplodedTerms plugin suggests that the user try searching for broader/narrower/related terms for a given search (e.g. a user searching for "New York (State)" would click the link for narrower terms if they're also interested in "New York (City)"). This is only relevant for libraries with highly hierarchical authority data.</li>
+    <li>The AuthorityFile plugin searches the authority file and suggests the user might be interested in bibs linked to the top 5 authorities</li>
+</ul>
+
+<p>If you want one plugin to take priority over another you simply drag it above the other.</p>
+
+<p><strong>See the full documentation for the Did you mean? feature in the <a href="http://manual.koha-community.org/3.10/en/additionaladmin.html#didyoumean">manual</a> (online).</strong></p>
+
+[% INCLUDE 'help-bottom.inc' %]
index 4791ab2..e9552c5 100644 (file)
        <li>all libraries, all patron types, all item types</li>
 </ul>
 
-<p>Tip: If you are a single library system choose your branch name before creating rules (sometimes having only rules for the 'all libraries' option can cause issues with holds)</p>
+<p>Tip: If you are a single library system choose your library name before creating rules (sometimes having only rules for the 'all libraries' option can cause issues with holds)</p>
 
 <p style="color: #990000;">Important: At the very least you will need to set a default circulation rule. This rule should be set for all item types, all libraries and all patron categories. That will catch all instances that do not match a specific rule. When checking out if you do not have a rule for all libraries, all item types and all patron types then you may see patrons getting blocked from placing holds. You will also want a rule for your specific library set for all item types and all patron types to avoid this holds issue. Koha needs to know what rule to fall back on.</p>
 
 <h4>Default Circulation Rules</h4>
 
-<p>Using the issuing rules matrix you can define rules that depend on patron/item typecombos. To set your rules, choose a library from the pull down (or 'all libraries' if you want to apply these rules to all branches)</p>
+<p>Using the issuing rules matrix you can define rules that depend on patron/item typecombos. To set your rules, choose a library from the pull down (or 'all libraries' if you want to apply these rules to all libraries)</p>
 
 <p>From the matrix you can choose any combination of patron categories and item types to apply the rules to</p>
 
@@ -84,7 +84,7 @@
     <li>Control where the item returns to once it is checked in
 <ul>
     <li>Item returns home</li>
-    <li>Item returns to issuing branch</li>
+    <li>Item returns to issuing library</li>
     <li>Item floats
 <ul>
     <li>When an item floats it stays where it was checked in and does not ever return 'home'</li>
 
 <p style="color: #990000;">Important: Note that if the system preference AllowHoldPolicyOverrideset to 'allow', these policies can be overridden by your circulation staff.</p>
 
-<p style="color: #990000;">Important: These policies are based on the patron's home branch, not the branch that the reserving staff member is from.</p>
+<p style="color: #990000;">Important: These policies are based on the patron's home library, not the library that the reserving staff member is from.</p>
 
 <p>The various Return Policies have the following effects:</p>
 
     <li style="color: #990000;">Important: If the AutomaticItemReturnpreference is set to automatically transfer the items home, then a prompt will not appear</li>
 </ul>
 </li>
-    <li>Item returns to issuing branch: The item will prompt the librarian to transfer the item back to the library where it was checked out
+    <li>Item returns to issuing library: The item will prompt the librarian to transfer the item back to the library where it was checked out
 <ul>
     <li style="color: #990000;">Important: If the AutomaticItemReturnpreference is set to automatically transfer the items home, then a prompt will not appear</li>
 </ul>
 </li>
-    <li>Item floats: The item will not be transferred from the branch it was checked in at, instead it will remain there until transferred manually or checked in at another branch</li>
+    <li>Item floats: The item will not be transferred from the library it was checked in at, instead it will remain there until transferred manually or checked in at another library</li>
 </ul>
 
 <p><strong>See the full documentation for Circulation and Fine Rules in the <a href="http://manual.koha-community.org/3.10/en/patscirc.html#circfinerules">manual</a> (online).</strong></p>
index 91f72b4..7441e98 100644 (file)
@@ -2,7 +2,7 @@
 
 <h2>Adding Authorities</h2>
 
-<p>To add a new authority record, choose the authority type from the 'New Authority' button.,/p>
+<p>To add a new authority record, choose the authority type from the 'New Authority' button.</p>
 
 <p>The form that appears will allow you to enter all of the necessary details regarding your authority record.</p>
 
@@ -22,4 +22,4 @@
 
 <p><strong>See the full documentation for Authorities in the <a href="http://manual.koha-community.org/3.10/en/catauthorities.html">manual</a> (online).</strong></p>
 
-[% INCLUDE 'help-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'help-bottom.inc' %]
index 153b012..699643a 100644 (file)
@@ -4,7 +4,7 @@
 
 <p>This report will show you any overdues at your library that have accrued fines on them.</p>
 
-<p>If you would like to limit the report you can use the pull down menu at the top to limit to a specific shelving location at your branch. To see overdues with fines at other branches you will have to change your branch or log in at that branch.</p>
+<p>If you would like to limit the report you can use the pull down menu at the top to limit to a specific shelving location at your library. To see overdues with fines at other libraries you will have to change your library or log in at that library.</p>
 
 <p style="color: #990000">Important: If you do not charge fines and/or don't have the fines cron job running you will see no data on this report.</p>
 
index 397e599..b6a5e29 100644 (file)
@@ -2,7 +2,7 @@
 
 <h1>Holds to Pull</h1>
 
-<p>This report will show you all of the items that have holds on them that are available at the library for pulling. If the items are available at multiple branches then all branches with that item available will see the hold to pull until one library triggers the hold.</p>
+<p>This report will show you all of the items that have holds on them that are available at the library for pulling. If the items are available at multiple libraries then all libraries with that item available will see the hold to pull until one library triggers the hold.</p>
 
 <p>You can limit the results you see by using the Refine box on the left side of the page</p>
 
index 852648d..1e0a0c4 100644 (file)
 <p>There are several messages that can appear when checking items in:</p>
 
 <ul>
-    <li>If you are checking an item in at a library other than the home branch, a message will appear asking you to transfer the book to the home library
+    <li>If you are checking an item in at a library other than the home library, a message will appear asking you to transfer the book to the home library
 <ul>
        <li>After this item is checked in the status of the item will be changed in the catalog to 'in transit'</li>
-    <li>To mark an item as back at the home branch, check the item in at the home branch
+    <li>To mark an item as back at the home library, check the item in at the home library
 <ul>
-    <li>A message will appear tell you that the item is not checked out, but the status will now say available in the catalog. This step is necessary to mark items as received by the home branch.</li>
+    <li>A message will appear tell you that the item is not checked out, but the status will now say available in the catalog. This step is necessary to mark items as received by the home library.</li>
 </ul>
 </li>
 </ul>
@@ -46,7 +46,7 @@
     <li>Ignoring the hold will leave the item on hold, but leave its status as Available (it will not cancel the hold)</li>
 </ul>
 </li>
-    <li>If you're checking in an item that has a hold on it at another branch you will be prompted to confirm and transfer the item
+    <li>If you're checking in an item that has a hold on it at another library you will be prompted to confirm and transfer the item
 <ul>
     <li>Clicking the Confirm hold and Transfer button will mark the item as in transit to the library where the hold was placed</li>
     <li>Clicking the Print Slip, Transfer and Confirm button will mark the item as in transit to the library where the hold was placed and present the library with a receipt to print and place on the book with the patron's information</li>
@@ -61,7 +61,7 @@
 
 <p>When you check in an item that has a hold on it the system will ask you to either confirm and transfer the item or just confirm the hold</p>
 
-<p>Clicking the Confirm button will mark the item as on hold for the patron. If the item needs to be transferred the item will also be marked as in transit to the proper branch. Clicking 'Ignore' will retain the hold, but allow you to check the item out to another patron. Choosing to confirm and print will present you with a printable page that you can slip inside the book with the necessary hold and/or transfer information.</p>
+<p>Clicking the Confirm button will mark the item as on hold for the patron. If the item needs to be transferred the item will also be marked as in transit to the proper library. Clicking 'Ignore' will retain the hold, but allow you to check the item out to another patron. Choosing to confirm and print will present you with a printable page that you can slip inside the book with the necessary hold and/or transfer information.</p>
 
 <p>Once confirmed the hold will show on the patron record and on the checkout screen under the 'Hold' tab.</p>
 
index c45d16d..29be871 100644 (file)
@@ -10,7 +10,7 @@
 
 <p>If you do not want all of your libraries to participate in the on-shelf holds fulfillment process, you should list the the libraries that *do* participate in the process here by inputting all the participating library's branchcodes, separated by commas ( e.g. "MPL,CPL,SPL,BML" etc. ).</p>
 
-<p>By default, the holds queue will be generated such that the system will first attempt to hold fulfillment using items already at the pickup library if possible. If there are no items available at the pickup library to fill a hold, build_holds_queue.pl will then use the list of libraries defined in StaticHoldsQueueWeight. If RandomizeHoldsQueueWeight is disabled ( which it is by default ), the script will assign fulfillment requests in the order the branches are placed in the StaticHoldsQueueWeight system preference.</p>
+<p>By default, the holds queue will be generated such that the system will first attempt to hold fulfillment using items already at the pickup library if possible. If there are no items available at the pickup library to fill a hold, build_holds_queue.pl will then use the list of libraries defined in StaticHoldsQueueWeight. If RandomizeHoldsQueueWeight is disabled ( which it is by default ), the script will assign fulfillment requests in the order the libraries are placed in the StaticHoldsQueueWeight system preference.</p>
 
 <p>For example, if your system has three libraries, of varying sizes ( small, medium and large ) and you want the burden of holds fulfillment to be on larger libraries before smaller libraries, you would want StaticHoldsQueueWeight to look something like "LRG,MED,SML".</p>
 
index 258e167..37dc0db 100644 (file)
@@ -32,7 +32,7 @@
 </li>
 </ul>
 
-<p>If you want to filter your results to a specific branch or category, you can click the plus sign [+] to the right of the search box.</p>
+<p>If you want to filter your results to a specific library or category, you can click the plus sign [+] to the right of the search box.</p>
 
 <p>You can also browse through the patron records by clicking on the linked letters across the top.</p>
 
index 428fe7f..2023cbb 100644 (file)
@@ -34,7 +34,7 @@
 </li>
 </ul>
 
-<p>If you want to filter your results to a specific branch or category, you can click the plus sign [+] to the right of the search box.</p>
+<p>If you want to filter your results to a specific library or category, you can click the plus sign [+] to the right of the search box.</p>
 
 <p>You can also browse through the patron records by clicking on the linked letters across the top.</p>
 
index 7be3885..33f46c6 100644 (file)
@@ -72,7 +72,7 @@
 <ul>
     <li>The &lt;&lt; and &gt;&gt; are just delimiters. You must put &lt;&lt; at the beginning and &gt;&gt; at the end of your parameter</li>
     <li>The 'Question to ask' will be displayed on the left of the string to enter.</li>
-    <li>The authorized_value can be omitted if not applicable. If it contains an authorized value category, or branches or itemtype or categorycode, a list with the Koha authorized values will be displayed instead of a free field Note that you can have more than one parameter in a given SQL Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". For example entering nothing for : "title=&lt;&lt;Enter title&gt;&gt;" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like &lt;&lt;Enter title&gt;&gt;" and enter a % at run time instead of nothing</li>
+    <li>The authorized_value can be omitted if not applicable. If it contains an authorized value category, or libraries or itemtype or categorycode, a list with the Koha authorized values will be displayed instead of a free field Note that you can have more than one parameter in a given SQL Note that entering nothing at run time won't probably work as you expect. It will be considered as "value empty" not as "ignore this parameter". For example entering nothing for : "title=&lt;&lt;Enter title&gt;&gt;" will display results with title='' (no title). If you want to have to have something not mandatory, use "title like &lt;&lt;Enter title&gt;&gt;" and enter a % at run time instead of nothing</li>
 </ul>
 <p>Examples:</p>
 <ul>
@@ -81,12 +81,12 @@ FROM borrowers <br />
 WHERE branchcode=&lt;&lt;Enter patrons library|branches&gt;&gt; AND surname like &lt;&lt;Enter filter for patron surname (% if none)&gt;&gt;</li>
     <li>SELECT * <br />
 FROM items <br />
-WHERE homebranch = &lt;&lt;Pick your branch|branches&gt;&gt; AND barcode like &lt;&lt;Partial barcode value here&gt;&gt;</li>
+WHERE homebranch = &lt;&lt;Pick your library|branches&gt;&gt; AND barcode like &lt;&lt;Partial barcode value here&gt;&gt;</li>
 </ul>
 </li>
     <li>Tip: To generate a date picker calendar to the right of the field when running a report you can use the 'date' keyword like this: &lt;&lt;Enter Date|date&gt;&gt;</li>
     <li>Tip: You have to put "%" in a text box to 'leave it blank'. Otherwise, it literally looks for "" (empty string) as the value for the field.</li>
-    <li style="color: #990000">Important: In addition to using any authorized value code to generate a dropdown, you can use the following values as well: Branches (branches), Item Types (itemtypes) and Patron Categories (categorycode). For example a branch pull down would be generated like this &lt;&lt;Branch|branches&gt;&gt;</li>
+    <li style="color: #990000">Important: In addition to using any authorized value code to generate a dropdown, you can use the following values as well: Libraries (branches), Item Types (itemtypes) and Patron Categories (categorycode). For example a library pull down would be generated like this &lt;&lt;Library|branches&gt;&gt;</li>
 </ul>
 
 <p>Note: There is a limit of 10,000 records put on SQL statements entered in Koha. To get around this you want to add 'LIMIT 100000' to the end of your SQL statement (or any other number above 10,000.</p>
index 1784350..923e1d5 100644 (file)
@@ -19,7 +19,7 @@
 
 <h3>Adding Events</h3>
 
-<p>Before adding events, choose the library you would like to apply the closings to. When adding events you will be asked if you would like to apply the event to one branch or all branches. To add events, simply</p>
+<p>Before adding events, choose the library you would like to apply the closings to. When adding events you will be asked if you would like to apply the event to one library or all libraries. To add events, simply</p>
 
 <ul>
        <li>Click on the date on the calendar that you would like to apply the closing to</li>
@@ -39,7 +39,7 @@
 </li>
     <li>Finally decide if this event should be applied to all libraries or just the one you have originally selected
 <ul>
-    <li>If you'd rather enter all the holidays and then copy them all to another branch all at once you can use the copy menu below the calendar</li>
+    <li>If you'd rather enter all the holidays and then copy them all to another library all at once you can use the copy menu below the calendar</li>
 </ul>
 </li>
 </ul>
index cf81c5e..bae182f 100644 (file)
 </li>
 </ol>
 </li>
-    <li>When this notice references the branches table it is referring to the pickup branch information.</li>
+    <li>When this notice references the branches table it is referring to the pickup library information.</li>
 </ul>
 </li>
        <li>HOLDPLACED (a notice to the library staff that a hold has been placed)
 <ul>
        <li>This notice requires the emailLibrarianWhenHoldIsPlaced system preference to be set to 'Enable'</li>
-    <li>When this notice references the branches table it is referring to the pickup branch information.</li>
+    <li>When this notice references the branches table it is referring to the pickup library information.</li>
 </ul>
 </li>
        <li>HOLD_PRINT (Printed notice when hold available for pickup)
 <ul>
        <li>This notice is used for hold confirmation notices that are sent out in print format. This will not effect what the email notice looks like.</li>
-    <li>When this notice references the branches table it is referring to the pickup branch information.</li>
+    <li>When this notice references the branches table it is referring to the pickup library information.</li>
 </ul>
 </li>
        <li>ODUE (Overdue Notice)
     <li>TRANSFERSLIP
 <ul>
     <li>Used to print a transfer slip</li>
-    <li>The transfer sliip is printed when you confirm a transfer from one branch to another in your system</li>
+    <li>The transfer sliip is printed when you confirm a transfer from one library to another in your system</li>
 </ul>
 </li>
 </ul>
index 4e91e06..542a350 100644 (file)
 <div class="yui-g">
             [% IF ( ( CAN_user_tools_moderate_comments  && pendingcomments ) 
                     || ( CAN_user_tools_moderate_tags && pendingtags )
+                    || ( CAN_user_borrowers && pending_borrower_modifications )
                     || ( CAN_user_acquisition && pendingsuggestions ) ) %]
                 <div id="area-pending">
                     [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
                         <span class="pending-number-link">[% pendingtags %]</span>
                     </div>
                     [% END %]
+
+
+                    [% IF ( CAN_user_borrowers && pending_borrower_modifications ) %]
+                    <div class="pending-info" id="patron_updates_pending">
+                        <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
+                        <span class="pending-number-link">[% pending_borrower_modifications %]</span>
+                    </div>
+                    [% END %]
+
                 </div>
-            [% END %]
 
+            [% END %]
 
 </div>
             [% IF ( IntranetmainUserblock ) %]
index 613ad36..f44754a 100644 (file)
                                                        [% END %]
                                                </div>
 
+                    [% IF ( CAN_user_borrowers && pending_borrower_modifications ) %]
+                        <div class="pending-info" id="patron_updates_pending">
+                            <a href="/cgi-bin/koha/members/members-update.pl">Patrons requesting modifications</a>:
+                            <span class="holdcount"><a href="/cgi-bin/koha/members/members-update.pl">[% pending_borrower_modifications %]</a></span>
+                        </div>
+                    [% END %]
 
                                                [% IF ( resultsloop ) %]
                                                <div id="searchheader"> <h3>Results [% from %] to [% to %] of [% numresults %] found for [% IF ( member ) %]'<span class="ex">[% member %]</span>'[% END %][% IF ( surname ) %]'<span class="ex">[% surname %]</span>'[% END %]</h3></div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt
new file mode 100644 (file)
index 0000000..7b85274
--- /dev/null
@@ -0,0 +1,123 @@
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha &rsaquo; Patrons &rsaquo; Update patron records</title>
+[% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript">
+    $(function() {
+        $( "#pending_updates" ).accordion();
+    });
+</script>
+</head>
+<body id="pat_update" class="pat">
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'patron-search.inc' %]
+
+[%
+    SET field_display_names = {
+        surname         => "Surname"
+        firstname       => "First name"
+        title           => "Title"
+        othernames      => "Other names"
+        initials        => "Initials"
+        streetnumber    => "Street number"
+        streettype      => "Street type"
+        address         => "Address"
+        address2        => "Address 2"
+        city            => "City"
+        state           => "State"
+        zipcode         => "Zip code"
+        country         => "Country"
+        email           => "Email"
+        phone           => "Primary Phone"
+        mobile          => "Primary Mobile Phone"
+        fax             => "Fax"
+        emailpro        => "Secondary email"
+        phonepro        => "Secondary phone"
+        B_streetnumber  => "Alternate address - street number"
+        B_streettype    => "Alternate address - street type"
+        B_address       => "Alternate address"
+        B_address2      => "Alternate address 2"
+        B_city          => "Alternate address - city"
+        B_state         => "Alternate address - state"
+        B_zipcode       => "Alternate address - zip code"
+        B_email         => "Alternate address - email"
+        B_phone         => "Alertnate address - phone"
+        dateofbirth     => "Date of birth"
+        contactname     => "Contact - last name"
+        contactfirstname=> "Contact - first name"
+        contacttitle    => "Contact - title"
+        relationship    => "Contact - relationship"
+        ethnicity       => "Ethnicity"
+        ethnotes        => "Ethnicity notes"
+        sex             => "Sex"
+        altcontactfirstname => "Alternate contact - first name"
+        altcontactsurname   => "Alternate contact - surname"
+        altcontactaddress1  => "Alternate contact - address"
+        altcontactaddress2  => "Alternate contact - address 2"
+        altcontactaddress3  => "Alternate contact - city"
+        altcontactstate     => "Alternate contact - state"
+        altcontactzipcode   => "Alternate contact - zip code"
+        altcontactcounty    => "Alternate contact - county"
+        altcontactphone     => "Alternate contact - phone"
+        smsalertnumber      => "SMS alert number"
+    }
+%]
+<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; Update patron records</div>
+
+<div id="doc2" class="yui-t7">
+
+   <div id="bd">
+        <div id="yui-main">
+
+            [% IF PendingModifications %]
+            <h2>Update patron records</h2>
+                <form method="post" action="members-update-do.pl">
+                    <div id="pending_updates">
+                            [% FOREACH pm IN PendingModifications %]
+                                [% SET borrowernumber = pm.borrowernumber %]
+                                <h3><a href="#panel_modify_[% pm.borrowernumber %]">[% borrowers.$borrowernumber.surname %], [% borrowers.$borrowernumber.firstname %]</a></h3>
+                                <div id="panel_modify_[% pm.borrowernumber %]">
+                                    <div style="background-color:#E6F0F2;padding:.5em;margin:.3em 0;">
+                                        <input type="radio" id="approve_modify_[% pm.borrowernumber %]" name="modify_[% pm.borrowernumber %]" value="approve" />
+                                        <label for="approve_modify_[% pm.borrowernumber %]">Approve</label>
+
+                                        <input type="radio" id="deny_modify_[% pm.borrowernumber %]" name="modify_[% pm.borrowernumber %]" value="deny" />
+                                        <label for="deny_modify_[% pm.borrowernumber %]">Deny</label>
+
+                                        <input type="radio" id="ignore_modify_[% pm.borrowernumber %]" name="modify_[% pm.borrowernumber %]" value="ignore" checked="checked"/>
+                                        <label for="ignore_modify_[% pm.borrowernumber %]">Ignore</label>
+                                    </div>
+                                        <table>
+                                            <tr>
+                                                <th>Field</th>
+                                                <th>From</th>
+                                                <th>To</th>
+                                            </tr>
+
+
+                                            [% FOREACH key IN pm.keys %]
+                                                [% IF field_display_names.$key %]
+                                                    [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %]
+                                                        <tr>
+                                                            <td>[% field_display_names.$key %]</td>
+                                                            <td>[% borrowers.$borrowernumber.$key %]</td>
+                                                            <td>[% pm.$key %]</td>
+                                                        </tr>
+                                                    [% END %]
+                                                [% END %]
+                                            [% END %]
+                                        </table>
+                                </div>
+                            [% END %]
+                        </div>
+                    <fieldset class="action"><input type="submit" value="Submit" /></fieldset>
+
+                </form>
+            [% ELSE %]
+            <div class="dialog message">
+                <p>There are no pending patron modifications.</p>
+            </div>
+            [% END %]
+
+        </div>
+    </div>
+[% INCLUDE 'intranet-bottom.inc' %]
index 802a82e..159e89a 100644 (file)
 [% IF ( do_it ) %]
        [% FOREACH mainloo IN mainloop %]
                <h1>Acquisitions statistics </h1>
-               [% IF ( mainloo.loopfilter ) %]
-                       <p><b>Filtered on:</b></p>
-                       [% FOREACH loopfilte IN mainloo.loopfilter %]
-                                       <p>[% loopfilte.crit %]: [% loopfilte.filter %]</p>
+        [% IF ( mainloo.loopfilter.size ) %]
+            <p><b>Filtered on:</b></p>
+            [% FOREACH loopfilte IN mainloo.loopfilter %]
+                <p>
+                    [% SWITCH loopfilte.crit %]
+                        [% CASE '0' %] Placed on (from)
+                        [% CASE '1' %] Placed on (to)
+                        [% CASE '2' %] Received on (from)
+                        [% CASE '3' %] Received on (to)
+                        [% CASE '4' %] Supplier
+                        [% CASE '5' %] Home branch
+                        [% CASE '6' %] Collection
+                        [% CASE '7' %] Item type
+                        [% CASE '8' %] Budget
+                        [% CASE '9' %] Sort1
+                        [% CASE '10' %] Sort2
+                        [% CASE %] Unknown filter
+                    [% END %]
+                    : [% loopfilte.filter %]
+                </p>
                        [% END %]
                [% END %]
 
                                <td>Vendor</td>
                                <td><input type="radio" checked="checked" name="Line" value="aqbooksellers.name" /></td>
                                <td><input type="radio" name="Column" value="aqbooksellers.name" /></td>
-                               <td>[% CGIBookSeller %]</td>
-                       </tr>
+                <td>
+                    <select name="Filter">
+                        <option value="">All suppliers</option>
+                        [% FOREACH bookseller IN booksellers %]
+                            <option value="[% bookseller.name %]">[% bookseller.name %]</option>
+                        [% END %]
+                    </select>
+                </td>
+            </tr>
+            <tr>
+                <td>Home branch</td>
+                <td><input type="radio" name="Line" value="items.homebranch" /></td>
+                <td><input type="radio" name="Column" value="items.homebranch" /></td>
+                <td>
+                    <select name="Filter">
+                        <option value="" selected="selected">All branches</option>
+                        [% FOREACH branch IN branches %]
+                            <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+                        [% END %]
+                    </select>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    [% IF ccode_label %]
+                        [% ccode_label %]
+                    [% ELSE %]
+                        Collection
+                    [% END %]
+                </td>
+                <td><input type="radio" name="Line" value="items.ccode" /></td>
+                <td><input type="radio" name="Column" value="items.ccode" /></td>
+                <td>
+                    [% IF ccode_avlist.size %]
+                        <select name="Filter">
+                            <option value="" selected="selected">All</option>
+                            [% FOREACH ccode_av IN ccode_avlist %]
+                                <option value="[% ccode_av.value %]">[% ccode_av.lib %]</option>
+                            [% END %]
+                        </select>
+                    [% ELSE %]
+                        <input type="text" name="Filter" />
+                    [% END %]
+                </td>
+            </tr>
                        <tr>
                                <td>Item Type</td>
                                <td><input type="radio" name="Line" value="biblioitems.itemtype" /></td>
        </table><br />
        </fieldset>
 
-<fieldset class="rows">                <legend> Cell value </legend>
-                       <ol><li><label for="cellvalue1">Count items</label><input type="radio" name="Cellvalue" id="cellvalue1" value="1" checked="checked" /> </li>
-                       <li><label for="cellvalue2">Amount</label><input type="radio" name="Cellvalue" id="cellvalue2" value="2" /> </li></ol></fieldset>
+<fieldset class="rows">
+    <legend> Cell value </legend>
+    <ol>
+        <li>
+            <label for="cellvalue1">Count items</label><input type="radio" name="Cellvalue" id="cellvalue1" value="1" checked="checked" />
+        </li>
+        <li>
+            <label for="cellvalue2">Count unique biblios</label><input type="radio" name="Cellvalue" id="cellvalue2" value="2" />
+        </li>
+        <li>
+            <label for="cellvalue3">Amount</label><input type="radio" name="Cellvalue" id="cellvalue3" value="3" />
+        </li>
+        <li>
+            <label for="cellvalue4">Ordered amount</label><input type="radio" name="Cellvalue" id="cellvalue4" value="4" />
+        </li>
+        <li>
+            <label for="cellvalue5">Spent amount</label><input type="radio" name="Cellvalue" id="cellvalue5" value="5" />
+        </li>
+    </ol>
+</fieldset>
 
        <fieldset class="rows">
        <legend>Output</legend>
index af51a4c..65f662f 100644 (file)
@@ -38,6 +38,7 @@
                 <th>Call number</th>
                 <th>Subscription begin</th>
                 <th>Subscription end</th>
+                <th>Expired? / Closed?</th>
                        </tr>
                </thead>
                <tbody>
                                        <td>[% data.callnumber %]</td>
                                        <td>[% data.startdate %]</td>
                                        <td>[% data.enddate %]</td>
+                    <td>
+                        [% IF data.closed %]
+                            Closed
+                        [% ELSIF data.expired %]
+                            Expired
+                        [% END %]
+                    </td>
                                </tr>
                                [% END %]
                        </tr>
index 0ad5d23..05470eb 100644 (file)
@@ -213,6 +213,9 @@ function checkMultiHold() {
         [% IF ( none_available ) %]
           <li> <strong>No copies are available</strong> to be placed on hold</li>
         [% END %]
+        [% IF ( alreadypossession ) %]
+          <li> <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borrowerfirstname %] [% borrowersurname %]</a> <strong>is already in possesion</strong> of one item</li>
+        [% END %]
          </ul>
     [% ELSE %]
       <h3>Cannot place hold on some items</h3>
index 5d9f7a9..c1f3aa1 100644 (file)
                <option>Late</option>
                <option>Missing</option>
                <option>Claimed</option>
+        <option>Stopped</option>
            </select>
        </li>
        
                             [% IF ( missingissue.status3 ) %]Late[% END %]
                             [% IF ( missingissue.status4 ) %]Missing[% END %]
                             [% IF ( missingissue.status7 ) %]Claimed[% END %]
+                            [% IF ( missingissue.status8 ) %]Stopped[% END %]
                         </td>
                         <td class="planneddate">
                         [% missingissue.planneddate %]
index ae998cc..dbdfda9 100644 (file)
@@ -68,12 +68,14 @@ function active(numlayer)
                                        [% serial.serialseq %]
                                </td>
                                <td>
-                                       [% IF ( serial.status1 ) %]Arrived[% END %]
-                                       [% IF ( serial.status2 ) %]Expected[% END %]
-                                       [% IF ( serial.status3 ) %]Late[% END %]
-                                       [% IF ( serial.status4 ) %]Missing[% END %]
-                    [% IF ( serial.status5 ) %]Not available[% END %]
-                                       [% IF ( serial.status7 ) %]Claimed[% END %]
+                    [% IF ( serial.status1 ) %]Expected[% END %]
+                    [% IF ( serial.status2 ) %]Arrived[% END %]
+                    [% IF ( serial.status3 ) %]Late[% END %]
+                    [% IF ( serial.status4 ) %]Missing[% END %]
+                    [% IF ( serial.status5 ) %]Not issued[% END %]
+                    [% IF ( serial.status6 ) %]Delete[% END %]
+                    [% IF ( serial.status7 ) %]Claimed[% END %]
+                    [% IF ( serial.status8 ) %]Stopped[% END %]
                                </td>
                        </tr>
                        [% END %]
index 3d2e690..6281258 100644 (file)
@@ -1,6 +1,10 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Serials &rsaquo; Serial collection information for [% bibliotitle %]</title>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
 
 <script type="text/javascript">
 //<![CDATA[
@@ -45,10 +49,31 @@ function generateNext(subscriptionid) {
        }
 }
 
+function CheckAll( node ) {
+    $("#"+node).checkCheckboxes();
+    return false;
+}
+function CheckNone( node ) {
+    $("#"+node).unCheckCheckboxes();
+    return false;
+}
 $(document).ready(function() {
     $('#subscription_years').tabs();
+    [% IF dateformatmetric %]
+      dt_add_type_uk_date();
+    [% END %]
+
+    $(".subscription-year-table").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
+        ],
+        "aaSorting": [[0, 'desc']],
+        "bAutoWidth": false,
+        "bPaginate": false,
+        "bInfo": false,
+        "bFilter": false,
+    } ));
 });
 
 //]]>
 </script>
@@ -151,22 +176,33 @@ $(document).ready(function() {
                 [% END %]</td>
             <td> [% subscription.branchcode %]</td>
             <td> [% subscription.callnumber %]</td>
-        <td> [% subscription.notes %]        [% IF ( subscription.subscriptionexpired ) %]<br /><span class="problem"> Subscription expired</span>
-        [% END %]
+        <td> [% subscription.notes %]
+            [% UNLESS subscription.closed %]
+                [% IF ( subscription.subscriptionexpired ) %]
+                    <br /><span class="problem"> Subscription expired</span>
+                [% END %]
+            [% ELSE %]
+                <br /> Subscription closed
+            [% END %]
         </td>
         [% IF ( routing && CAN_user_serials_routing ) %]
         <td>
-            <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit routing list</a>
+            [% UNLESS subscription.closed %]
+                <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit routing list</a>
+            [% END %]
         </td>
         [% END %]
-        [% IF ( subscription.abouttoexpire ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
-        [% ELSE %]
-        [% IF ( subscription.subscriptionexpired ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
+        [% UNLESS subscription.closed %]
+            [% IF ( subscription.abouttoexpire ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
+            [% ELSE %]
+                [% IF ( subscription.subscriptionexpired ) %]<td class="problem"> <a href="/cgi-bin/koha/serials/subscription-renew.pl?subscriptionid=[% subscription.subscriptionid %]" onclick="popup([% subscription.subscriptionid %]); return false;">Renew</a></td>
+                [% ELSE %]
+                    <td> &nbsp;</td>
+                [% END %]
+            [% END %]
         [% ELSE %]
-        <td> &nbsp;</td>
-        [% END %]
+            <td> &nbsp;</td>
         [% END %]
-
       </tr>
 [% END %]
 [% IF ( subscr ) %]
@@ -194,13 +230,22 @@ $(document).ready(function() {
     [% IF ( CAN_user_serials_receive_serials ) %]
         <p>
             <input type="submit" value="Edit serials" />&nbsp;
-            <input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
-            [% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;<input type="button" value="Multi receiving" onclick="javascript:generateReceive([% subscriptionidlist %])" />[% END %]
+            [% UNLESS subscription.closed %]
+                <input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
+                [% IF ( subscriptions.size == 1 and !serialsadditems ) %]&nbsp;<input type="button" value="Multi receiving" onclick="javascript:generateReceive([% subscriptionidlist %])" />[% END %]
+            [% END %]
         </p>
     [% END %]
-
-        <table>
-         <tr>
+      <span class="checkall">
+        <a class="CheckAll" href="#" onclick="CheckAll('subscription-year-[% year.year %]'); return false;">Select all</a>
+      </span> |
+      <span class="clearall">
+        <a class="CheckNone" href="#" onclick="CheckNone('subscription-year-[% year.year %]'); return false;">Clear all</a>
+      </span>
+        <table class="subscription-year-table">
+          <thead>
+            <tr>
+                [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
 [% IF ( subscriptions.size > 1 ) %]
                 <th># Subs</th>
 [% END %]
@@ -217,10 +262,28 @@ $(document).ready(function() {
                 <th>Library
                 </th>
                 [% IF ( routing ) %]<th>Routing</th>[% END %]
-                [% IF ( CAN_user_serials_receive_serials ) %]<th>Edit</th>[% END %]
             </tr>
+          </thead>
+          <tbody>
       [% FOREACH serial IN year.serials %]
     [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+            [% IF ( CAN_user_serials_receive_serials ) %]
+                <td>
+                  [% IF ( serial.cannotedit ) %]
+                    disabled
+                  [% ELSE %]
+                    [% IF ( serial.subscriptionexpired ) %]
+                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" disabled="disabled" />
+                    [% ELSE %]
+                      [% IF ( serial.checked ) %]
+                    <input type="checkbox" class="checkboxed" name="serialid" checked="checked" value="[% serial.serialid %]" />
+                      [% ELSE %]
+                    <input type="checkbox" class="checkboxed" name="serialid" value="[% serial.serialid %]" />
+                      [% END %]
+                    [% END %]
+                  [% END %]
+                </td>
+            [% END %]
 [% IF ( subscriptions.size > 1 ) %]
                  <td><a href="serials-collection.pl?subscriptionid=[% serial.subscriptionid %]">[% serial.subscriptionid %]</a></td>
 [% END %]
@@ -234,7 +297,14 @@ $(document).ready(function() {
                     [% serial.serialseq %]
                 </td>
                 <td>
-                    [% IF ( serial.status1 ) %]Expected[% END %][% IF ( serial.status2 ) %]Arrived[% END %][% IF ( serial.status3 ) %]Late[% END %][% IF ( serial.status4 ) %]Missing[% END %][% IF ( serial.status5 ) %]Not Available[% END %][% IF ( serial.status7 ) %]Claimed[% END %]
+                    [% IF ( latestserial.status1 ) %]Expected[% END %]
+                    [% IF ( latestserial.status2 ) %]Arrived[% END %]
+                    [% IF ( latestserial.status3 ) %]Late[% END %]
+                    [% IF ( latestserial.status4 ) %]Missing[% END %]
+                    [% IF ( latestserial.status5 ) %]Not issued[% END %]
+                    [% IF ( latestserial.status6 ) %]Delete[% END %]
+                    [% IF ( latestserial.status7 ) %]Claimed[% END %]
+                    [% IF ( latestserial.status8 ) %]Stopped[% END %]
                 </td>
                 <td>
                     [% serial.notes %]
@@ -247,26 +317,10 @@ $(document).ready(function() {
                     <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %] ([% serial.planneddate %])'); return false" >Print list</a>
                 </td>
                 [% END %]
-            [% IF ( CAN_user_serials_receive_serials ) %]
-                <td>
-                  [% IF ( serial.cannotedit ) %]
-                    disabled
-                  [% ELSE %]
-                    [% IF ( serial.subscriptionexpired ) %]
-                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" disabled="disabled" />
-                    [% ELSE %]
-                      [% IF ( serial.checked ) %]
-                    <input type="checkbox" name="serialid" checked="checked" value="[% serial.serialid %]" />
-                      [% ELSE %]
-                    <input type="checkbox" name="serialid" value="[% serial.serialid %]" />
-                      [% END %]           
-                    [% END %]
-                  [% END %]
-                </td>
-            [% END %]
             </tr>
-      [% END %]
-        </table>
+          [% END %]
+        </tbody>
+      </table>
     </div>
     [% END %]
   <input type="hidden" name="subscriptionid" value="[% subscriptionidlist %]" />
index 61b76a9..935d9e1 100644 (file)
@@ -168,7 +168,7 @@ $(document).ready(function() {
         </td>
         <td>
             [% IF ( serialslis.editdisable ) %]
-              <input type="hidden" name="status" id="status[% serialslis.serialid %]" value="1">
+              <input type="hidden" name="status" id="status[% serialslis.serialid %]" value="[% serialslis.serstatus %]">
               <select name="status" size="1"  disabled="disabled">
             [% ELSE %]
               [% IF ( serialslis.serialsadditems ) %]
@@ -177,39 +177,42 @@ $(document).ready(function() {
               <select name="status" size="1" id="status[% serialslis.serialid %]" onchange="if (this.value==2 || this.value==7){changeDate(this, '[% serialslis.arriveddate %]')} else {changeDate(this, '[% serialslis.planneddate %]')}" >
                [% END %] 
             [% END %]
-  [% IF ( serialslis.status1 ) %]
-                    <option value="1" selected="selected">Expected</option>
-  [% END %]
-  [% IF ( serialslis.status2 ) %]
-                    <option value="2" selected="selected">Arrived</option>
-  [% ELSE %]
-                    <option value="2">Arrived</option>
-  [% END %]
-  [% IF ( serialslis.status3 ) %]
-                    <option value="3" selected="selected">Late</option>
-  [% ELSE %]
-                    <option value="3">Late</option>
-  [% END %]
-  [% IF ( serialslis.status4 ) %]
-                    <option value="4" selected="selected">Missing</option>
-  [% ELSE %]
-                    <option value="4">Missing</option>
-  [% END %]
-  [% IF ( serialslis.status7 ) %]
-                    <option value="7" selected="selected">Claimed</option>
-  [% ELSE %]
-                    <option value="7">Claimed</option>
-  [% END %]
-  [% IF ( serialslis.status5 ) %]
-                    <option value="5" selected="selected">Not available</option>
-  [% ELSE %]
-                    <option value="5">Not available</option>
-  [% END %]
-  [% IF ( serialslis.status6 ) %]
-                    <option value="6" selected="selected">Delete</option>
-  [% ELSE %]
-                    <option value="6">Delete</option>
-  [% END %]
+            [% IF ( serialslis.status1 ) %]
+              <option value="1" selected="selected">Expected</option>
+            [% END %]
+            [% IF ( serialslis.status2 ) %]
+              <option value="2" selected="selected">Arrived</option>
+            [% ELSE %]
+              <option value="2">Arrived</option>
+            [% END %]
+            [% IF ( serialslis.status3 ) %]
+              <option value="3" selected="selected">Late</option>
+            [% ELSE %]
+              <option value="3">Late</option>
+            [% END %]
+            [% IF ( serialslis.status4 ) %]
+              <option value="4" selected="selected">Missing</option>
+            [% ELSE %]
+              <option value="4">Missing</option>
+            [% END %]
+            [% IF ( serialslis.status7 ) %]
+              <option value="7" selected="selected">Claimed</option>
+            [% ELSE %]
+              <option value="7">Claimed</option>
+            [% END %]
+            [% IF ( serialslis.status5 ) %]
+              <option value="5" selected="selected">Not available</option>
+            [% ELSE %]
+              <option value="5">Not available</option>
+            [% END %]
+            [% IF ( serialslis.status6 ) %]
+              <option value="6" selected="selected">Delete</option>
+            [% ELSE %]
+              <option value="6">Delete</option>
+            [% END %]
+            [% IF serialslis.status8 %]
+              <option value="8" selected="selected">Stopped</option>
+            [% END %]
             </select>
 
         </td>
@@ -284,39 +287,42 @@ $(document).ready(function() {
             <select name="status" size="1" id="addstatus[% newserialloo.serialid %]" onchange="if (this.value==2){unHideItems('items'+'[% newserialloo.subscriptionid %][% newserialloo.serialid %]','label[% newserialloo.subscriptionid %][% newserialloo.serialid %]','[% newserialloo.serialid %]'); changeDate2('[% newserialloo.arriveddate %]')} else if (this.value==7){changeDate('[% newserialloo.arriveddate %]')} else { HideItems('items'+'[% newserialloo.subscriptionid %]'+[% newserialloo.serialid %],'label[% serialslis.subscriptionid %][% serialslis.serialid %]'); changeDate2('[% serialslis.planneddate %]')}" >
 
                     <option value="">----</option>
-  [% IF ( newserialloo.status1 ) %]
+                  [% IF ( newserialloo.status1 ) %]
                     <option value="1" selected="selected">Expected</option>
-  [% END %]
-  [% IF ( newserialloo.status2 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status2 ) %]
                     <option value="2" selected="selected">Arrived</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="2">Arrived</option>
-  [% END %]
-  [% IF ( newserialloo.status3 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status3 ) %]
                     <option value="3" selected="selected">Late</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="3">Late</option>
-  [% END %]
-  [% IF ( newserialloo.status4 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status4 ) %]
                     <option value="4" selected="selected">Missing</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="4">Missing</option>
-  [% END %]
-  [% IF ( newserialloo.status7 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status7 ) %]
                     <option value="7" selected="selected">Claimed</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="7">Claimed</option>
-  [% END %]
-  [% IF ( newserialloo.status5 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status5 ) %]
                     <option value="5" selected="selected">Not available</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="5">Not available</option>
-  [% END %]
-  [% IF ( newserialloo.status6 ) %]
+                  [% END %]
+                  [% IF ( newserialloo.status6 ) %]
                     <option value="6" selected="selected">Delete</option>
-  [% ELSE %]
+                  [% ELSE %]
                     <option value="6">Delete</option>
-  [% END %]
+                  [% END %]
+                  [% IF newserialloo.status8 %]
+                    <option value="8" selected="selected">Stopped</option>
+                  [% END %]
             </select>
 
         </td>
@@ -370,8 +376,11 @@ $(document).ready(function() {
 [% END %]
 
 </table>
-    <fieldset class="action"><input type="submit" value="Save"  class="button" accesskey="w" />
-    [% UNLESS ( serialsadditems ) %]&nbsp;&nbsp;<input type="button" onclick="javascript:generateReceive()" value="Multi receiving">[% END %]
+    <fieldset class="action">
+       <input type="submit" onclick="return false;" style="display: none;" id="phony_submit" value="phony_submit" name="phony_submit" />
+       <input type="submit" value="Save"  class="button" accesskey="w" />
+       [% UNLESS ( serialsadditems ) %]&nbsp;&nbsp;<input type="button" onclick="javascript:generateReceive()" value="Multi receiving">[% END %]
+    </fieldset>
 </form>
 
 </div>
@@ -384,7 +393,9 @@ $(document).ready(function() {
         <li><a href="serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]" title="serial collection for [% subscription.bibliotitle %]">Serial collection #[% subscription.subscriptionid %]</a></li>
         <li><a href="subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" title="detail of the subscription">Subscription #[% subscription.subscriptionid %]</a></li>
         [% IF ( subscription.abouttoexpire ) %]
+          [% UNLESS subscription.closed %]
             <li><a href="#" onclick="javascript:popup([% subscription.subscriptionid %])">Renew #[% subscription.subscriptionid %]</a></li>
+          [% END %]
         [% END %]
     [% END %]
     <li><a href="/cgi-bin/koha/catalogue/[% default_bib_view %].pl?biblionumber=[% biblionumber %]" title="go to [% bibliotitle %]">Show biblio</a></li></ul>
index 868d34e..04db346 100644 (file)
@@ -137,6 +137,9 @@ function barcode_check(){
                                        [% ELSE %]
                                                <option value="6">Delete</option>
                                        [% END %]
+                    [% IF serialslis.status8 %]
+                        <option value="8" selected="selected">Stopped</option>
+                    [% END %]
                                </select>
                        [% IF ( serialslis.serialadditems ) %]
                                <br /><br />
index 98ef4d5..558f988 100644 (file)
@@ -9,14 +9,25 @@
 <script type="text/javascript">
 //<![CDATA[
  $(document).ready(function() {
-    var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
+    var osrlt = $("#osrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
         "aoColumnDefs": [
             { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
         ],
         "sPaginationType": "four_button"
     } ) );
 
-    srlt.fnAddFilters("filter", 750);
+    var csrlt = $("#csrlt").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "aoColumnDefs": [
+            { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
+        ],
+        "sPaginationType": "four_button"
+    } ) );
+
+    osrlt.fnAddFilters("filter", 750);
+    csrlt.fnAddFilters("filter", 750);
+
+    $('#serialstabs').tabs();
+
  });
  //]]>
 </script>
@@ -33,9 +44,9 @@
       <div class="yui-b">
       [% INCLUDE 'serials-toolbar.inc' %]
 
-      <h2>Serials subscriptions</h2>
+      <h2>Serials subscriptions ([% total %] found)</h2>
       [% UNLESS ( done_searched ) %]
-      <div id="advsearch">
+      <div id="advsearch" style="padding-bottom:3em;">
         <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
           <fieldset class="rows">
           <legend>Search subscriptions</legend>
                   <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
                 </li>
                 <li>
-                  <label for="bookseller">Bookseller:</label>
+                  <label for="bookseller">Vendor:</label>
                   <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
                 </li>
                 <li>
-                  <label for="branch">Branch:</label>
+                  <label for="branch">Library:</label>
                   <select id="branch" name="branch_filter">
                     <option value="">All</option>
                     [% FOREACH branch IN branches_loop %]
       </div>
       [% END %]
       [% IF ( done_searched ) %]
-        [% IF ( subscriptions ) %]
-          <table id="srlt">
-            <thead>
-              <tr>
-                  <th>ISSN</th>
-                  <th>Title</th>
-                  <th> Notes </th>
-                  <th>Library</th>
-                  <th>Call number</th>
-                  <th>Expiration date</th>
-                  [% IF ( routing && CAN_user_serials_routing ) %]
-                    <th>Routing list</th>
-                  [% END %]
-                  <th>&nbsp;</th>
-                  <th>&nbsp;</th>
-              </tr>
-            </thead>
-            <tfoot>
-              <tr>
-                <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
-                <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
-                <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
-                <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
-                <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
-                <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
-                [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
-                <td></td>
-                <td></td>
-              </tr>
-            </tfoot>
-            <tbody>
-              [% FOREACH subscription IN subscriptions %]
-                <tr>
-                  <td>
-                  [% IF ( subscription.issn ) %][% subscription.issn %]
-                  [% END %]
-                  </td>
-                  <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
-                  </td>
-                  <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
-                  [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
-                  </td>
-                  <td>
-                    [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
-                  </td>
-                  <td>
-                    [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
-                  </td>
-                  <td>
-                    [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
-                  </td>
-                  [% IF ( routing && CAN_user_serials_routing ) %]
-                  <td>
-                    [% IF ( subscription.cannotedit ) %]
-                      &nbsp;
-                    [% ELSE %]
-                      [% IF ( subscription.routingedit ) %]
-                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
-                        ([% subscription.routingedit %])
-                      [% ELSE %]
-                        <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
-                      [% END %]
+        [% IF ( total ) %]
+          <div id="serialstabs" class="toptabs" style="clear:both;">
+            <ul class="ui-tabs-nav">
+              <li><a href="#opened">Opened ([% openedsubscriptions.size || 0 %])</a></li>
+              <li><a href="#closed">Closed ([% closedsubscriptions.size || 0 %])</a></li>
+            </ul>
+            <div id="opened">
+              [% IF openedsubscriptions %]
+                <table id="osrlt">
+                  <thead>
+                    <tr>
+                        <th>ISSN</th>
+                        <th>Title</th>
+                        <th> Notes </th>
+                        <th>Library</th>
+                        <th>Call number</th>
+                        <th>Expiration date</th>
+                        [% IF ( routing && CAN_user_serials_routing ) %]
+                          <th>Routing list</th>
+                        [% END %]
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
+                    </tr>
+                  </thead>
+                  <tfoot>
+                    <tr>
+                      <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
+                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
+                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
+                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
+                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
+                      <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
+                      [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
+                      <td></td>
+                      <td></td>
+                    </tr>
+                  </tfoot>
+                  <tbody>
+                    [% FOREACH subscription IN openedsubscriptions %]
+                      <tr>
+                        <td>
+                        [% IF ( subscription.issn ) %][% subscription.issn %]
+                        [% END %]
+                        </td>
+                        <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
+                        </td>
+                        <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
+                        [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
+                        </td>
+                        [% IF ( routing && CAN_user_serials_routing ) %]
+                        <td>
+                          [% IF ( subscription.cannotedit ) %]
+                            &nbsp;
+                          [% ELSE %]
+                            [% IF ( subscription.routingedit ) %]
+                              <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]">Edit</a>
+                              ([% subscription.routingedit %])
+                            [% ELSE %]
+                              <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=new">New</a>
+                            [% END %]
+                          [% END %]
+                        </td>
+                        [% END %]
+                        <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
+                        </td>
+                        <td>
+                        [% IF ( subscription.cannotedit ) %]
+                          &nbsp;
+                        [% ELSE %]
+                          [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
+                        [% END %]
+                        </td>
+                      </tr>
+                    [% END %]
+                  </tbody>
+                </table>
+              [% ELSE %]
+                There is no opened subscription for your search.
+              [% END %]
+            </div>
+            <div id="closed">
+              [% IF closedsubscriptions %]
+                <table id="csrlt">
+                  <thead>
+                    <tr>
+                        <th>ISSN</th>
+                        <th>Title</th>
+                        <th> Notes </th>
+                        <th>Library</th>
+                        <th>Call number</th>
+                        <th>&nbsp;</th>
+                        <th>&nbsp;</th>
+                    </tr>
+                  </thead>
+                  <tfoot>
+                    <tr>
+                      <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
+                      <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
+                      <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
+                      <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
+                      <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
+                      <td></td>
+                      <td></td>
+                    </tr>
+                  </tfoot>
+                  <tbody>
+                    [% FOREACH subscription IN closedsubscriptions %]
+                      <tr>
+                        <td>
+                          [% IF ( subscription.issn ) %]
+                            [% subscription.issn %]
+                          [% END %]
+                        </td>
+                        <td>
+                          <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
+                        </td>
+                        <td>
+                          [% IF ( subscription.notes ) %][% subscription.notes %][% END %]
+                          [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
+                        </td>
+                        <td>
+                          [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
+                        </td>
+                        <td>
+                          [% UNLESS subscription.cannotedit %]
+                            <a href="/cgi-bin/koha/serials/serials-search.pl?subscriptionid=[% subscription.subscriptionid %]&amp;op=reopen&routing=[% subscription.routing %]&amp;searched=1&amp;title_filter=[% title_filter %]&amp;ISSN_filter=[% ISSN_filter %]&amp;EAN_filter=[% EAN_filter %]&amp;published_filter=[% publisher_filter %]&amp;bookseller_filter=[% bookseller_filter %]&amp;branch_filter=[% branch_filter %]" onclick="return confirm(_('Are you sure you want to reopen this subscription?'));">Reopen</a>
+                          [% ELSE %]
+                            Cannot edit
+                          [% END %]
+                        </td>
+                        <td>
+                          <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
+                        </td>
+                      </tr>
                     [% END %]
-                  </td>
-                  [% END %]
-                  <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
-                  </td>
-                  <td>
-                  [% IF ( subscription.cannotedit ) %]
-                    &nbsp;
-                  [% ELSE %]
-                    [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&amp;serstatus=1,3,7">Serial receive</a>[% END %]
-                  [% END %]
-                  </td>
-                </tr>
+                  </tbody>
+                </table>
+              [% ELSE %]
+                There is no closed subscription for your search.
               [% END %]
-            </tbody>
-          </table>
-        [% ELSE %]
-          There is no subscription for your search.
+            </div>
+          </div>
         [% END %]
       [% END %]
     </div>
                   <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
                 </li>
                 <li>
-                  <label for="bookseller">Bookseller:</label>
+                  <label for="bookseller">Vendor:</label>
                   <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
                 </li>
                 <li>
-                  <label for="branch">Branch:</label>
+                  <label for="branch">Library:</label>
                   <select id="branch" name="branch_filter">
                     <option value="">All</option>
                     [% FOREACH branch IN branches_loop %]
index 44a2d8f..949b946 100644 (file)
@@ -55,8 +55,12 @@ $(document).ready(function() {
        <div class="yui-b">
        [% INCLUDE 'serials-toolbar.inc' %]
 
-    <h1>Subscription for [% bibliotitle %] </h1>
-    [% IF ( abouttoexpire ) %]<div class="dialog message">Subscription will expire [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>[% END %]
+    <h1>Subscription for [% bibliotitle%] [% IF closed %](closed)[% END %]</h1>
+    [% IF ( abouttoexpire ) %]
+      [% UNLESS closed %]
+        <div class="dialog message">Subscription will expire [% enddate %]. <a href="#" id="renewsub">Renew this subscription</a>.</div>
+      [% END %]
+    [% END %]
     [% IF ( NEEDSCONFIRMATION ) %]
     <div id="circ_needsconfirmation" class="dialog alert">
                        <h3>Please Confirm Subscription deletion</h3>
@@ -374,27 +378,19 @@ $(document).ready(function() {
                     [% serialslis.publisheddate %]
                 </td>
                 <td>
-                        [% IF ( serialslis.status1 ) %]
-                            Expected
-                        [% END %]
-                        [% IF ( serialslis.status2 ) %]
-                            Arrived
-                        [% END %]
-                        [% IF ( serialslis.status3 ) %]
-                            Late
-                        [% END %]
-                        [% IF ( serialslis.status4 ) %]
-                            Missing
-                        [% END %]
-                        [% IF ( serialslis.status5 ) %]
-                            Not available
-                        [% END %]
-                        [% IF ( serialslis.status7 ) %]
-                            Claimed
-                             [% IF ( serialslis.claimdate ) %]
-                             [% serialslis.claimdate %]
-                             [% END %]
-                        [% END %]
+                    [% IF ( serialslis.status1 ) %]Expected[% END %]
+                    [% IF ( serialslis.status2 ) %]Arrived[% END %]
+                    [% IF ( serialslis.status3 ) %]Late[% END %]
+                    [% IF ( serialslis.status4 ) %]Missing[% END %]
+                    [% IF ( serialslis.status5 ) %]Not issued[% END %]
+                    [% IF ( serialslis.status6 ) %]Delete[% END %]
+                    [% IF ( serialslis.status7 ) %]
+                      Claimed
+                      [% IF ( serialslis.claimdate ) %]
+                        [% serialslis.claimdate %]
+                      [% END %]
+                    [% END %]
+                    [% IF ( serialslis.status8 ) %]Stopped[% END %]
                 </td>
             </tr>
         [% END %]
index 0c71a41..81fe513 100644 (file)
@@ -210,6 +210,7 @@ function placeHold () {
                 <th>Title</th>
                 <th>Author</th>
                 <th>Date added</th>
+                <th>Call number</th>
                 <th>&nbsp;</th>
             </tr>
                [% FOREACH itemsloo IN itemsloop %]
@@ -238,6 +239,9 @@ function placeHold () {
                        <td>[% itemsloo.author %]</td>
                        <td>[% itemsloo.dateadded %]</td>
                        <td>
+                [% FOREACH result IN itemsloo.ITEM_RESULTS %][% result.itemcallnumber %][% UNLESS loop.last %], [% END %][% END %]
+            </td>
+            <td>
                        [% UNLESS ( itemsloo.notforloan ) %]
                        <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]">Holds</a>
                        [% END %]
@@ -294,14 +298,15 @@ function placeHold () {
         <ol>
         <li><label class="required" for="addshelf">List name:</label><input id="addshelf" type="text" name="addshelf" size="25" /></li>
         <li><span class="label">Owner: </span><input type="hidden" name="owner" id="owner" value="[% loggedinuser %]" />[% loggedinusername %]</li>
-               <li><label for="sortfield" >Sort this list by: </label>
-               <select name="sortfield" id="sortfield">
-               [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
-               [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
-               [% IF ( sort_copyrightdate ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
-               </select></li>
+        <li><label for="sortfield" >Sort this list by: </label>
+        <select name="sortfield" id="sortfield">
+            <option value="title">Title</option>
+            <option value="author">Author</option>
+            <option value="copyrightdate">Copyrightdate</option>
+            <option value="itemcallnumber">Call number</option>
+        </select></li>
         <li><label for="category">Category: </label>
-                       <select name="category" id="category">
+            <select name="category" id="category">
                   <option value="1">Private</option>
                   <option value="2">Public</option>
                      </select></li>
@@ -319,9 +324,10 @@ function placeHold () {
                <li><label for="owner">Owner: </label><input type="hidden" id="owner" name="owner" value="[% IF ( owner ) %][% ownername %][% ELSE %][% loggedinusername %][% END %]" />[% IF ( owner ) %][% ownername %][% ELSE %][% loggedinusername %][% END %]</li>
                <li><label for="sortfield" >Sort this list by: </label>
                <select name="sortfield">
-               [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
-               [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
-               [% IF ( sort_copyrightdate ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
+        [% IF ( sortfield == "title" ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
+        [% IF ( sortfield == "author" ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
+        [% IF ( sortfield == "copyrightdate" ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
+        [% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
                </select></li>
                <li><label for="category">Category: </label>
                        <select id="category" name="category">
@@ -386,7 +392,7 @@ function placeHold () {
                     [% IF ( shelveslooppri.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
         <td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&amp;[% END %]viewshelf=[% shelveslooppri.shelf %]&amp;shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
         <td>[% shelveslooppri.count %] item(s)</td>
-        <td>[% IF ( shelveslooppri.authorsort ) %]Author[% ELSIF ( shelveslooppri.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
+        <td>[% IF ( shelveslooppri.sortfield == "author" ) %]Author[% ELSIF ( shelveslooppri.sortfield == "copyrightdate" ) %]Year[% ELSIF (shelveslooppri.sortfield == "itemcallnumber") %]Call number[% ELSE %]Title[% END %]</td>
         <td>[% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
                        [% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
                </td>
@@ -439,7 +445,7 @@ function placeHold () {
                <td><a href="shelves.pl?viewshelf=[% shelvesloo.shelf %]">[% shelvesloo.shelfname |html %]</a></td>
         <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% shelvesloo.owner %]">[% shelvesloo.ownername %]</td>
                <td>[% shelvesloo.count %] item(s)</td>
-        <td>[% IF ( shelvesloo.authorsort ) %]Author[% ELSIF ( shelvesloo.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
+        <td>[% IF ( shelvesloo.sortfield == "author" ) %]Author[% ELSIF ( shelvesloo.sortfield == "copyrightdate" ) %]Year[% ELSIF (shelvesloo.sortfield == "itemcallnumber") %]Call number[% ELSE %]Title[% END %]</td>
         <td>[% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
                        [% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
                </td>
index ea36118..24349e1 100644 (file)
                                 </xsl:call-template>
                             </xsl:with-param>
                         </xsl:call-template>
-                       </a>
-                    <xsl:text> </xsl:text><xsl:call-template name="part"/>
-            <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
+            </a>
+            <xsl:call-template name="part"/>
+            <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
         </xsl:for-each>
 
         <!-- 490 Series not traced, Ind1 = 0 -->
        </xsl:choose>
        <!-- add relator code too between brackets-->
        <xsl:if test="marc:subfield[@code='4' or @code='e']">
-         <xsl:text>[</xsl:text>
+      <span class="relatorcode">
+      <xsl:text> [</xsl:text>
          <xsl:choose>
            <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
            <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
          </xsl:choose>
          <xsl:text>]</xsl:text>
+      </span>
        </xsl:if>
        </a>
         <xsl:choose>
diff --git a/koha-tmpl/opac-tmpl/ccsr/en/css/sanop.css b/koha-tmpl/opac-tmpl/ccsr/en/css/sanop.css
deleted file mode 100644 (file)
index 7ed0a67..0000000
+++ /dev/null
@@ -1,2013 +0,0 @@
-
-body #main {
-  margin-left : 2%;
-      background-color: #eeeeee;
-
-}
-
-/* TWO COLUMNS, RIGHT SIDEBAR */
-
-
-body#withsidebar #main {
-     float: left;
-   margin-left: 1%;
-       width: 58%;
-    }
-
-html body#withsidebar #main    {
-       margin-left: .5%;
-      }
-
-body#withsidebar #sidebar
-   {
-      float: left;
-   margin-top : 2.4em;
-    width: 39%;
-}
-
-/* THREE COLUMNS */
-
-body#tricolumn #main_wrapper {
-             float: left;
-   width: 100%;
-}
-
-body#tricolumn #main
-   {
-              margin: 0 150px 0 175px;
-       }
-
-body#tricolumn #nav
- {
-      float: left;
-   margin-left: -100%;
-    width: 175px;
-  }
-body#tricolumn #sidebar
-      {
-      float: left;
-   margin-left: -150px;
-   width: 150px;
-  }
-
-/* TWO COLUMNS LEFT NAVIGATION */
-
-body#withnav #main_wrapper
-       {
-      float: left;
-   width: 100%;
-   }
-
-body#withnav #main
-  {
-      margin: 0 0 0 175px;
-   }
-
-body#withnav #nav
-   {
-      float: left;
-   margin-left: -100%;
-    width: 175px;
-  }
-
-body#withnav #main .content-block {
- padding-left : 10px;
-}
-
-/* END TWO COLUMNS RIGHT NAVIGATION */
-
-a {
-    font-weight: bold;
-}
-
-a:link, a:visited, a:active {
-        text-decoration : underline;
-        color :navy;
-}
-
-a:link.current {
-      font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-}
-
-a:link.nav {
- font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-
-}
-
-a:visited.current {
- font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-}
-
-a:visited.nav {
-      font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-}
-
-a:hover.current {
-    font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-}
-
-a:hover.nav {
-        font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-
-}
-
-a:active.current {
-  font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-}
-
-a:active.nav {
-       font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-}
-
-a.help {
-     padding: 3px;
-  text-decoration: none;
-}
-
-a.title {
-    font-size: 1.2em;
-      font-style: normal;
-    font-weight: bold;
-}
-
-body {
-   font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-    font-size: 73%;
-        margin: 0;
-     padding: 0;
-    background-color : #eeeeee;
-}
-
-input, select, th, td {
- font-size:1em
-}
-
-caption {
-     font-family: Arial, Geneva, Helvetica, sans-serif;
-     font-size : 1.3em;
-     font-weight: bold;
-     margin: 0;
-     padding: 5px 0 3px 0;
-  text-align: left;
-}
-
-div.bookcover {
-   float: right;
-}
-
-div.details td.details {
-      text-align: left;
-}
-
-div.details ul {
-  list-style-type: circle;
-       margin-left: 0;
-        text-align: left;
-}
-
-div.error {
-       padding: 3px 10px 3px 10px;
-    width: 75%;
-}
-
-div.error li {
-  margin-bottom: .5em;
-}
-
-div.form, div.details {
-        margin: 0 auto;
-        padding: 0 0 0 6px;
-}
-
-div.notes {
-     text-align: left;
-}
-
-div.sidebar-box+div.sidebar-box {
- margin-top: 5px;
-}
-
-div.tab {
-  display: block;
-        margin-right: 0px;
-     width: 100%;
-}
-
-div.tab p {
-    margin: 0;
-     padding: 3px 0;
-}
-
-div.tab p.MARCtag {
- clear: both;
-   font-weight: bold; /* style for tag definition (700 - Statement of responsability) */
-  margin: 0;
-     padding: 2px;
-}
-
-div.tab table {
-}
-
-div.tabbloc {
-      font-family: Arial, Helvetica, sans-serif;
-}
-
-div.table {
-      width: 95%;
-}
-
-dl.details dt {
- font-weight: bold;
-     margin: .5em 0;
-}
-
-dl.details dd {
-     margin-left: 1em;
-}
-
-dl.details ul {
-   padding: 0;
-    margin-left: 1em;
-}
-
-dl.details ul p {
- margin-left : 0;
-}
-
-em.new {
-   font-style: normal;
-    font-weight: bold;
-}
-
-form {
-   display: inline;
-       margin: 0;
-     padding: 0;
-}
-
-h1 {
-    font-size: 1.8em;
-      padding: 5px 0 3px 0;
-}
-
-h1,h2,h3,h4,h5,h6 {
-   font-family: arial, geneva, helvetica, sans-serif;
-     margin: 0;
-}
-
-h1.logo {
-        display: inline;
-       margin: 10px 0 0 10px;
-
-}
-
-h1.title {
-  font-style: italic;
-    padding: 5px 0 3px 0;
-  color: navy;
-}
-
-h2 {
-   font-size: 1.6em;
-      padding: 5px 0 3px 0;
-
-}
-
-h2#libraryname {
-     padding-left : 5px;
-}
-
-h3 {
-    font-size: 1.4em;
-      padding: 5px 0 3px 0;
-}
-
-h3.author {
-   padding: 0 0 3px 15px;
-}
-
-h3+p {
-       margin: .4em 0 .4em 0;
-}
-
-h4 {
- font-size: 1.3em;
-      padding: 5px 0 3px 0;
-}
-
-h5 {
-  font-size: 1.2em;
-      margin: 0;
-     padding: 10px 0 2px 0;
-}
-
-h5+p {
-       margin-top: 0;
- padding-top: 0;
-}
-
-h6 {
-        font-size: 1.1em;
-}
-
-input.add, a.add {
-        background-image: url(../images/add.gif);
-}
-
-input.addchecked, a.addchecked {
-  background-image: url(../images/addtobasket.gif);
-}
-
-input.back, a.back {
-      background-image: url(../images/back.gif);
-}
-
-input.brief, a.brief {
-   background-image: url(../images/brief.gif);
-}
-
-input.cancel {
-  font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-    font-size : .9em;
-      font-weight: bold;
-     padding: 2px;
-}
-
-input.cart, a.cart {
-  background-image: url(../images/cart.gif);
-}
-
-input.clearall, a.clearall {
-     background-image: url(../images/clearbasket.gif);
-}
-
-input.close, a.close {
-    background-image: url(../images/close.gif);
-}
-
-input.delete, a.delete {
-        background-image: url(../images/delete.gif);
-}
-
-input.detail, a.detail {
-       background-image: url(../images/detail.gif);
-}
-
-input.edit, a.edit {
-   background-image: url(../images/edit.gif);
-}
-
-input.icon {
-     background-position: left;
-     background-repeat: no-repeat;
-  font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-    font-size : .9em;
-      font-weight: bold;
-     padding: 2px 2px 2px 22px;
-}
-
-input.isbd, a.isbd {
-     background-image: url(../images/isbd.gif);
-}
-
-input.print, a.print {
-   background-image: url(../images/print2.gif);
-}
-
-input.remove, a.remove {
-       background-image: url(../images/remove.gif);
-}
-
-input.reserve, a.reserve {
-     background-image: url(../images/placereserve.gif);
-}
-
-input.send, a.send {
-     background-image: url(../images/send.gif);
-}
-
-input.shelf, a.shelf {
-   background-image: url(../images/addtoshelf.gif);
-}
-
-input.trash, a.trash {
-     background-image: url(../images/trash.gif);
-}
-
-p {
-     padding: 0 10px 0 10px;
-}
-
-p.error, div.error {
-        font-weight: normal;
-   margin: auto;
-  padding: 5px 20px 5px 20px;
-}
-
-p.error+p.error, div.error+div.error {
-  margin-top: 5px;
-}
-
-p+h3 {
-     margin-top: .6em;
-}
-
-p+h5 {
-    margin: 0;
-     padding: 3px 0 2px 0;
-}
-
-span.itemicon {
-       float : left;
-  font-size: .9em;
-       margin: 2px;
-   white-space: nowrap;
-}
-
-span.print {
-   font-size: .7em;
-       font-weight: normal;
-   padding-left: .7em;
-}
-
-table {
- border-collapse: collapse;
-     margin: 5px 0 5px 0;
-   padding: 0;
-}
-
-*html td, *html th {
-    font-size : .8em;
-}
-
-td {
-      padding: 3px;
-}
-
-td.input, div.form td, div.details td {
-       border-left: 0;
-        border-right: 0;
-       padding: 2px 2px 2px 4px;
-      text-align: right;
-}
-
-td.credit {
-      text-align: right;
-}
-
-td.debit {
-       text-align: right;
-}
-
-td.sum, th.sum {
- text-align: right;
-}
-
-td.sum {
- font-weight: bold;
-}
-
-td.label {
-       font-weight: bold;
-     line-height: 1.5em;
-    padding: 4px;
-}
-
-td.label, div.form th, div.details th {
-       border-right: 0;
-       border-top: 0;
- font-weight: bold;
-     padding: 2px 2px 2px 4px;
-      text-align: left;
-      vertical-align: top;
-}
-
-td.search-options select {
-}
-
-td:last-child {
-  padding: 3px;
-}
-
-th {
-  font-weight: bold;
-     padding: 2px;
-}
-
-th a {
-        font-weight: bold;
-     text-decoration: none;
-}
-
-th:last-child {
-      font-weight: bold;
-     padding: 2px;
-}
-
-th[scope="row"] {
-     font-weight: normal;
-   text-align: right;
-}
-
-ul#facets {
-      margin: 3px;
-}
-
-#nav ul#facets {
-       margin : 0;
-    padding : 0;
-}
-
-#nav ul#facets li {
-    font-weight: bold;
-     text-align: left;
-}
-
-#nav ul#facets li#branch_facet, #nav ul#facets li#subject_facet, #nav ul#facets li#series_facet, #nav ul#facets li#author_facet {
-}
-
-#nav ul#facets ul li {
-       border: 0;
-     font-size: .95em;
-      font-weight: normal;
-   padding: 2px;
-  text-align: left;
-}
-
-#nav ul#facets ul li a {
-  font-weight: normal;
-   text-decoration: underline;
-}
-
-#nav ul#facets ul li.showmore {
- text-align: center;
-}
-
-#nav ul#facets ul li.showmore a {
-       font-weight: bold;
-     text-decoration: none;
-}
-
-/* Tabs */
-ul.link-tabs {
-    list-style-type: none;
- margin: 9px 0 -2px 5px;
-        padding: 0;
-}
-
-ul.link-tabs li {
-       display: inline;
-       padding: 0px;
-}
-
-ul.link-tabs li a {
-   font-weight: bold;
-     padding: 2px 4px 2px 4px;
-      text-decoration: none;
-}
-
-ul.link-tabs li#power_formButton a, ul.link-tabs li#proximity_formButton a {
- padding: 2px 4px 3px 4px;
-}
-
-ul.link-tabs li.off a {
-}
-
-ul.link-tabs li.off a:hover {
-  padding: 2px 3px 2px 4px;
-}
-
-ul.link-tabs li.on a {
-}
-
-.clear {
-        clear: both;
-   line-height: .1em;
-}
-
-.content-block {
- padding: 5px;
-}
-
-#home {
-       text-align : center;
-}
-
-#home #searchform input.submit {
-       font-size : 1.3em;
-}
-
-div#advanced-search p {
-  margin: .4em;
-
-}
-
-div#advanced-search fieldset {
-       /*margin-left : -1em;*/
-       margin-bottom: .3em;
-  background-color : #eeeeee;
-
-}
-
-div#advanced-search fieldset p {
-       margin-left : 1em;
-       white-space: nowrap;
-
-
-}
-
-table.itemtypes {
-        border-collapse: separate;
-     border-spacing: 3px;
-   display: block;
-        padding: 0;
-    margin: 0;
-}
-
-div#advanced-search legend, div#sidebar legend {
- font-weight: bold;
-}
-
-div#advanced-search label {
-
-}
-
-.count {
- font-weight: normal;
-}
-
-.current {
-     font-weight: bold;
-     padding: 1px 5px 1px 5px;
-      text-decoration: none;
-}
-
-.detail-sidebar {
-    float: right;
-  padding: 5px;
-  margin-left : 15px;
-    margin-right : 5px;
-    text-align: center;
-    width : 25%;
-}
-
-.detail-sidebar .further {
-     float: none;
-   text-align: left;
-      width : 90%;
-}
-
-.further {
-     margin: 5px;
-   text-align: left;
-      width : 90%;
-}
-
-.ex {
-  font-family: "Courier New", Courier, monospace;
-}
-
-.further h4 {
-       padding: 2px;
-}
-
-.further li {
- padding: 2px 0;
-}
-
-.further ul, .further li {
-  list-style: none;
-      margin: .5em 0 .7em .4em;
-      padding: 0;
-}
-
-.inline {
-       display: inline;
-}
-
-.item-datedue {
-    font-style: italic;
-}
-
-.item-details {
- display: block;
-        margin: 0 0 0 25px;
-}
-
-.item-reserved, .item-notforloan, .item-lost, .item-cancelled, .item-damaged, .item-reserved {
-  display: block;
-}
-
-.labelsubfield {
-    clear: both; /* style for each subfield (like : a Publication year), just before the biblio subfield */
-        float: left;
-   font-weight: bold;
-     margin-left: 30px;
-     width: 12em;
-}
-
-.left {
-        float: left;
-}
-
-.loggedin {
-    font-weight: bold;
-}
-
-.login-note {
-    width: 35%;
-}
-
-.menu {
- line-height: 3em;
-      font-size: 1.2em;
-      margin: 0;
-     padding: 5px;
-}
-
-.menu a.logout {
-      font-weight: bold;
-     padding: 3px 15px 3px 15px;
-    text-decoration: none;
-}
-
-.menu a:link, #members a:link {
-      padding: 2px;
-}
-
-.menu a:visited, #members a:visited {
- padding: 2px;
-}
-
-.menu a:hover, #members a:hover {
-     padding: 2px;
-}
-
-.menu a:active, #members a:active {
-   padding: 2px;
-}
-
-.menu input {
-}
-
-.menu label {
-        font-weight: bold;
-}
-
-.menu p {
-        margin: 0;
-     padding: 0;
-}
-
-.menu p+p {
-     margin-top: 5px;
-}
-
-.note {
-    margin: 10px auto;
-     padding: 4px 4px 4px 4px;
-      width: 35%;
-}
-
-.opac-detail {
-  padding: 4px;
-}
-
-.opac-detail dd {
-     display: block;
-        line-height: 1.5em;
-    padding: 4px;
-  text-align: right;
-}
-
-.operations {
-    margin-top: 7px;
-       padding: 0 10px;
-       text-align: center;
-    width: 100%;
-}
-
-.operations img {
-      padding: 5px;
-}
-
-.operations li {
-      list-style-type: none;
- margin: 0;
-     padding-bottom: 2px;
-}
-
-.operations li a, .operations li a:visited {
-   background-position: top left;
- background-repeat: no-repeat;
-  border-style: outset;
-  display: block;
-        padding: 3px 3px 3px 26px;
-     text-decoration: none;
-}
-
-.searchresults a.reserve, .searchresults a.reserve:visited {
- background-position: top left;
- background-repeat: no-repeat;/*
-        border-style: outset;*/
-        float: right;
-  padding: 2px 3px 2px 26px;
-     /*text-decoration: none;*/
-}
-
-.operations li a:active {
-        border-style: inset;
-}
-
-.operations ul {
-       margin: 0;
-     padding: 0;
-    width: 90%;
-}
-
-.overdue {
-      font-weight: bold;
-}
-
-.pages {
- line-height : 1.8em;
-   text-align: center;
-}
-
-.rejected {
-     text-decoration: line-through;
-}
-
-.right {
-     float: right;
-}
-
-.search-main {
-        float: left;
-   width: 65%;
-}
-
-.searchresults input, .searchresults label, .searchresults select {
-     font-size: .8em;
-}
-
-.searchresults p {
- margin: 0;
-     padding: 0;
-    padding-top : .6em;
-}
-
-.searchresults p img {
-  vertical-align: middle;
-}
-
-.searchresults table td {
-   vertical-align: top;
-}
-
-p.searchresults {
-      margin-top : -5px;
-     text-align : right;
-    vertical-align : middle;
-       padding-bottom : 3px;
-}
-
-.selected {
-   text-decoration: none;
-}
-
-.sidebar-box {
-       margin-bottom: 0;
-}
-
-.sidebar-box h3, .sidebar-box h4 {
-        margin-left: 10px;
-}
-
-.sidebar-box p {
- margin: 3px 10px;
-      padding: 0;
-}
-
-.submit {
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-    font-size : .9em;
-      font-weight: bold;
-     padding: 2px;
-}
-
-.term {
-       font-weight: bold;
-}
-
-.thumbnail {
-     border: 0;
-     float: left;
-   margin: 0 5px 5px 0;
-}
-
-.title {
-       font-style: italic;
-    font-weight: bold;
-}
-
-#sidebar .content-block {
-        margin : 0 10px 0 0;
-}
-
-form#auth h3 {
- font-size : 1.1em;
-}
-
-#footer {
-        clear: both;
-   padding: 10px;
- text-align: center;
-}
-
-#corner {
-       position: absolute;
-    top: 10px;
-     right: 5px;
-}
-
-#corner a.cart {
-        background-image : url(../images/cart-small.gif);
-      background-position: left;
-     background-repeat : no-repeat;
- padding: 0 15px;
-       text-decoration: none;
-}
-
-#languages {
- display: inline;
-}
-
-#languages ul {
-    display : inline;
-      list-style: none;
-      margin: 0;
-     padding : 0;
-}
-
-#languages ul li {
-     display: inline;
-       font-family: Arial, Helvetica, sans-serif;
-     font-size: .9em;
-}
-
-#languages ul li a {
-       font-weight: normal;
-   padding: 0 3px;
-        text-decoration: none;
-}
-
-#loose_form label, #keyword_form label, #precise_form label, #cql_form label, #advanced label, #cql label, #power label, #proximity label {
-  font-weight: bold;
-     text-align: right;
-}
-
-#loose_form, #keyword_form, #precise_form, #cql_form, #advanced, #cql, #power, #proximity {
-      margin: 5px;
-   width: 96%;
-}
-
-/*#main {
-       margin-left: 20%;
-      margin-right: 0;
-       padding: 0;
-    position: relative;
-}*/
-
-#masthead {
-   margin: 0;
-     margin-bottom : 1em;
-   padding: 0;
-    text-align:center;
-
-}
-
-#members {
-      font-size: .8em;
-       font-weight: bold;
-     padding: 4px 0 4px 0;
-}
-
-#members a.card {
-     background-image: url(../images/card.gif);
-     background-position: left;
-     background-repeat: no-repeat;
-  display: block;
-        padding-left: 39px;
-}
-
-#members a.logout {
-     font-weight: bold;
-     padding: 0 .3em 0 .3em;
-        text-decoration: none;
-}
-
-#members li {
-        display: inline;
-       list-style: none;
-      margin: 0;
-}
-
-#members ul li a:link, #members ul li a:visited, #members ul li a:hover, #members ul li a:active, #members span.members {
-        padding : 4px;
-}
-
-#members ul li:last-child {
-}
-
-#members ul li a:hover {
-}
-
-#members ul {
-     margin: 0;
-     padding: 0;
-    text-align: right;
-}
-
-/*#nav {
- float: left;
-   margin: 0;
-     padding: 0;
-    width: 20%;
-}*/
-
-#nav a {
-      font-family: Arial, Geneva, Helvetica, sans-serif;
-     font-weight: bold;
-     text-decoration: none;
-}
-
-#nav h6 {
-    padding: 3px;
-  text-align: center;
-}
-
-#nav li ul li {
- font-family: Arial, Geneva, Helvetica, sans-serif;
-     list-style: none;
-      margin: 0;
-     padding: 5px 3px 5px 3px;
-      text-align: right;
-}
-
-#nav li ul li a {
-        font-family: Arial, Geneva, Helvetica, sans-serif;
-     font-weight: bold;
-     text-decoration: none;
-}
-
-#nav ul {
-    margin: 0;
-     padding: 0;
-}
-
-#nav ul li {
-    font-family: Arial, Geneva, Helvetica, sans-serif;
-     list-style: none;
-      margin: 0;
-     padding: 3px 8px 3px 3px;
-      text-align: right;
-}
-
-#nav ul li+li {
-  margin: 0;
-}
-
-#power_formButton, #proximity_formButton {
-}
-
-#results, .results {
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-    margin: 0;
-     padding: 7px 0 10px 0;
-}
-
-#search-footer {
-     margin: auto;
-  text-align: center;
-}
-
-#search-footer a {
-      margin: 3px 5px 3px 5px;
-       padding: 2px 5px;
-      text-decoration: none;
-}
-
-#searchform input.submit {
-   font-size: .8em;
-}
-
-#search-sidebar {
-  float: right;
-  margin: 10px;
-  padding: 3px;
-  width: 30%;
-}
-
-#search-sidebar .sidebar-box label {
-    display: block;
-        text-align: left;
-}
-
-/*#sidebar {
-      float: right;
-  margin: 20px;
-  padding: 5px;
-  width: 20%;
-}*/
-
-#sidebar .submit {
-    font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-    font-weight: bold;
-     padding: 2px;
-  font-size: 1em;
-}
-
-#sidebar h3 {
-       font-family: Arial, Geneva, Helvetica, sans-serif;
-     margin: 0;
-     padding: 5px 0 1px 0;
-}
-
-#sort {
-       margin: .3em;
-}
-
-#sort, #sort select, #sort input {
-}
-
-#starFull {
-     background: url(../images/bluestars.png) top left no-repeat;
-   height: 25px;
-  margin: 0;
-     padding: 0;
-}
-
-#starMT {
-       background: url(../images/emptystars.png) top left no-repeat;
-  height: 25px;
-  margin: 0 3px 0 30px;
-  padding: 0;
-    position: relative;
-    width: 100px;
-}
-
-#window {
-     margin-left: 2%;
-       margin-right: 2%;
-      margin-top: 2%;
-        padding: 10px;
-}
-
-#window .class {
-     display: block;
-        font-weight: bold;
-     padding: 0 0 5px 3px;
-}
-
-#window div.menu {
-    margin: 0;
-
-}
-
-div#item-details {
-      margin-bottom : 1.5em;
-}
-
-div#item-details img {
-       float : left;
-  padding : 1em;
-}
-
-div#item-details p {
- margin : .1em 0;
-       line-height : 1.6em;
-}
-
-div#holdings table {
-   width : 100%;
-}
-
-div#holdings td, div#holdings th {
-    padding : 5px;
-}
-
-div#holdings, div#descriptions, div#reviews, div#serials, div#publicshelves, div#privateshelves, div#fines, div#waiting, div#overdues, div#issues, div#reserves {
-    margin-top : 4px;
-      padding : .7em;
-        width : 90%;
-}
-
-#usermenu {
-    font-size: .9em;
-       font-weight: bold;
-     margin-top : -1.1em;
-   margin-bottom : 1em;
-   padding: 4px 0 4px 0;
-
-
-}
-
-#usermenu li {
-      display: inline;
-       list-style: none;
-      margin: 0;
-}
-
-#usermenu ul li a:link, #usermenu ul li a:visited, #usermenu ul li a:hover, #usermenu ul li a:active, #usermenu span.members {
-   padding : 4px;
-}
-
-#usermenu ul li:last-child {
-}
-
-#usermenu ul li a:hover {
-}
-
-#usermenu ul {
-  margin: 0;
-     padding: 0;
-    text-align: right;
-}
-
-table.featured-item {
-    border-collapse : separate;
-    border-spacing: 9px;
-   margin : 5px;
-  text-align : center;
-}
-
-table.featured-item td {
-       vertical-align : top;
-}
-
-table.featured-item a img {
-   margin : auto;
-}
-
-table.featured-item a.title {
-        display : block;
-       font-size : 1em;
-       margin-bottom : .4em;
-}
-
-table.featured-item .author {
- display : block;
-       font-size : .95em;
-     margin-bottom : .2em;
-}
-
-table.featured-item .publisher {
-      display : block;
-       font-size : .8em;
-}
-
-/* COLORS, BACKGROUNDS, AND BORDERS */
-
-a {
-       color: #006699;
-}
-
-a:link.current {
-    background-color: transparent;
- color: #3366CC;
-}
-
-a:link.nav {
-        background-color: #EFF1DC;
-     border: 1px solid #CCCC99;
-     color: #3366CC;
-}
-
-a:visited {
- color: #006699;
-}
-
-a:visited.current {
- background-color: transparent;
- color: #3366CC;
-}
-
-a:visited.nav {
-     background-color: #EFF1DC;
-     border: 1px solid #CCCC99;
-     color: #3366CC;
-}
-
-a:hover {
-   color: orange;
-}
-
-a:hover.current {
-    background-color: #CCFF00;
-     color: #CC3333;
-}
-
-a:hover.nav {
-       background-color: #FFFFCC;
-     border: 1px solid #CCCC99;
-     color: #CC3333;
-}
-
-a:active {
-  color: #990033;
-}
-
-a:active.current {
-  background-color: #99CC00;
-     color: #FFFF99;
-}
-
-a:active.nav {
-      background-color: #FFFFCC;
-     border: 1px solid #CCCC99;
-     color: #D25500;
-}
-
-a.reserve {
- background-color: #006699;
-     color: White;
-}
-
-body {
-        background-color: #eeeeee;
-}
-
-body#withsidebar #main {
- border: 0;
-
-}
-ul {
-background-color:#eeeeee;
-text-align: left;
-}
-
-caption {
-    color: #000066;
-}
-
-div.error h3 {
-      color: #990000;
-}
-
-div.form, div.details {
-     background-color: #ffffff;
-}
-
-div.tab {
-        background-color: transparent;
-}
-
-div.tab p {
-  border-bottom: 1px solid #FFFFFF;
-      border-top: 1px solid #D8DEB8;
-}
-
-div.tabbloc {
-        background-color: transparent;
-}
-
-div#advanced-search fieldset {
-       border-right : 1px none #999999;
-       border-top : 1px none #999999;
-       border-bottom : 1px none #999999;
-       border-left : 1px none #999999;
-}
-
-div#advanced-search legend {
- color : #003366;
-}
-
-dl.details dt {
-    color: #000066;
-}
-
-em.new {
-    color: #CC3333;
-}
-
-h1,h2,h3,h4,h5,h6 {
- color: navy;
-   background-color:navy;
- color:white;
-}
-
-h1.logo {
-      color: #D3DFAD;
-
-}
-
-h1#libraryname a {
- color: #000066;
-        margin-left: .3em;
-     text-decoration: none;
-}
-
-input.icon {
- background-color: #6699CC;
-     border: 1px outset #666666;
-    color: #FFFFCC;
-}
-
-p.availability {
-    color: #666666;
-        font-size: .9em;
-}
-
-p.error, div.error {
-       background-color: #FFFFCC;
-     border: 1px dashed #CC6600;
-}
-
-span.itemicon {
- background-color : #F8F8EB;
-    border: 1px solid #D8DEB8;
-}
-
-table {
-  background-color: #FFFFFF;
-}
-
-table.itemtypes td {
-     background-color: #F8F8EB;
-     border: 1px solid #D8DEB8;
-}
-
-td {
-     background-color: #FFFFFF;
-     border-bottom: 1px solid #DDDDDD;
-      border-right: 1px solid #DDDDDD;
-}
-
-td.input, div.form td, div.details td {
-    border-bottom: 1px solid #CCCCCC;
-      border-left: 0;
-        border-right: 0;
-       color: #000000;
-}
-
-td.credit {
- color: #000066;
-}
-
-td.debit {
-  color: #990000;
-}
-
-td.sum, th.sum {
-}
-
-td.sum {
-        background-color : #FFFFCC;
-}
-
-td.label {
-      border-bottom: 1px solid #CCCCCC;
-      border-left: 1px solid #CCCCCC;
-        color: #000088;
-}
-
-td.label, div.form th, div.details th {
-     background-color: #FFFFFF;
-     border-bottom: 1px solid #CCCCCC;
-      border-left: 1px solid #CCCCCC;
-        border-right: 0;
-       border-top: 0;
- color: #000088;
-}
-
-div.details {
-       padding: 5px;
-
-}
-
-div.details table, div.details td, div.details th {
-  border: 0;
-     border-bottom: 1px solid #DDDDDD;
-}
-
-td.overdue {
-      color: #CC0000;
-}
-
-td:last-child {
-     border-bottom: 1px solid #CCCCCC;
-      border-right: 0 solid #CCCCCC;
-}
-
-th {
- background-color: #EFF1DC;
-     border-bottom: 1px solid #CCCCCC;
-      border-right: 1px solid #CCCCCC;
-}
-
-th:last-child {
-    background-color: #EFF1DC;
-     border-bottom: 1px solid #CCCCCC;
-      border-right: 0 solid #CCCCCC;
-}
-
-th[scope="row"] {
-    background-color: #E7E7CA;
-}
-
-tr.highlight {
-   background-color: #F8F8EB;
-}
-
-tr.highlight th[scope="row"] {
-   background-color: #EEEEEE;
-}
-
-tr.overdue td {
-  background-color: #FFDDDD;
-}
-
-input.cancel {
-   background-color: #990033;
-     border: 1px outset #666666;
-    color: #FFFFCC;
-}
-
-.available {
-        color : #006600;
-}
-
-.content-block {
-   background-color: #FFFFFF;
-}
-
-.current {
-       background-color: #FFFFFF;
-     color: #3366CC;
-}
-
-.detail-sidebar {
-   background-color: #EEEEEB;
-}
-
-.further {
-       background-color: #EEEEEB;
-     border: 2px solid #DDDED3;
-     color: #CCCC99;
-}
-
-.further h4 {
-       background-color: #D8DEB8;
-}
-
-.further li {
-}
-
-.issued {
-       color: #999999;
-}
-
-.labelsubfield {
-}
-
-.loggedin {
-     color: #D8DEB8;
-}
-
-.loggedinusername {
- color: #666666;
-}
-
-.marcsubfieldletter {
-       background-color: #EFF1DC;
-}
-
-.marcsubfieldname {
-      background-color: #EFF1DC;
-}
-
-.MARCtag {
-       background-color: #EEEEEE;
-     color: #000066; /* style for tag definition (700 - Statement of responsability) */
-}
-
-.menu {
-  background-image : url(../images/menu-background.gif);
- background-repeat: repeat-x;
-   background-color: #6699CC;
-     border-top: 1px solid #335599;
- border-bottom: 1px solid #335599;
-      color: #FFFFFF;
-
-}
-
-.menu a:link {
-     color : #FFFFCC;
-}
-
-.menu a:visited {
-  color : #FFFFCC;
-}
-
-.menu a:hover {
-    color : #FFFFFF;
-}
-
-.menu a:active {
-   color : #FFFF99;
-}
-
-#members a:link {
-  color: #0099CC;
-}
-
-#members a:visited {
-        color: #0099CC;
-}
-
-#members a:hover {
-  color: #990000;
-}
-
-#members a:active {
- color: #990000;
-}
-
-.menu input.submit {
-        background-color : #6BA037;
-    color: #FFFFFF;
-}
-
-.note {
-     background-color: #EEEEEB;
-     border-bottom: 1px solid #DDDED3;
-      border-left: 1px solid #DDDED3;
-        border-right: 1px solid #DDDED3;
-       border-top: 1px solid #DDDED3;
-}
-
-.opac-detail {
-       background-color: #FFFFCC;
-}
-
-.opac-detail dd {
-        border-bottom: 1px solid #E7E7CA;
-      color: #000000;
-}
-
-.operations li a, .operations li a:visited {
-        background-color: #6699CC;
-     border: 2px solid #D8DEB8;
-     color: #FFFFCC;
-}
-
-.operations li a:hover {
-    background-color: #0099FF;
-     color: #FFFF99;
-}
-
-.operations li a:active {
-   background-color: #0099FF;
-     color: #FFFF99;
-}
-
-
-.item-reserved {
-   color : #009933;
-}
-
-.item-datedue {
-    color: #999999;
-}
-
-.item-notforloan, .item-lost, .item-cancelled, .item-damaged, .item-reserved {
-}
-
-.searchresults td, .searchresults th, .searchresults table {
-      border: 0;
-}
-
-.searchresults tr {
-      border-bottom : 1px solid #CCCCCC;
-}
-
-.searchresults table {
-   border-top : 0px solid #CCCCCC;
-}
-
-p.searchresults {
-   background-color : #EFF1DC;
-}
-
-.searchresults a.reserve {
-      background-color : transparent;
-        color : #006699;/*
-     background-color : #6699CC;
-    border: 1px outset #666666;
-    color : White;*/
-}
-
-.sidebar-box {
-     border: 1px dashed #CCCCCC;
-}
-
-.subfield {
-     background-color: #EFF1DC;
-}
-
-.subfieldvalue {
- background-color: #FFFFFF;
-}
-
-.submit {
-        background-color: #EEC95A;
-     border: 3px outset #666666;
-    color: #FFFFFF;
-}
-
-.term {
-     background-color: #FFFFCC;
-     color: #990000;
-}
-
-.unavailable {
-      color: #990033;
-}
-
-#footer {
-   border-top: 1px solid #EEEEEE;
-}
-
-#languages ul li a {
- border: 1px solid #D8DEB8;
-}
-
-#languages ul li a:hover {
-       background-color: #FFFFCC;
-}
-
-#main {
-  background-color: transparent;/*
-       border-top: 1px solid #EEEEEE;*/
-}
-
-#masthead {
-        background-color: #FFFFFF;/*
-   border-bottom: 1px solid #EEEEEE;*/
-}
-
-#members {
-      background-image : url(../images/member-menu-background.gif);
-  background-repeat: repeat-x;
-   border-top: 1px solid #9999CC;
- border-bottom : 1px solid #9999CC;
-     background-color: #AFBCCF;
-     color: #000066;
-}
-
-#members ul li a:link, #members ul li a:visited, #members span.members {
-    background-image : url(../images/member-menu-background-link.gif);
-     background-repeat: repeat-x;
-   border-left: 1px solid #9999CC;
-        color: #006699;
-}
-
-#members ul li:last-child a {
-       border-right : 1px solid #9999CC;
-}
-
-#members ul li a:hover, #members ul li a:active {
- background-image : url(../images/member-menu-background-hover.gif);
-    background-repeat: repeat-x;
-}
-
-#members a {
-   text-decoration: none;
-}
-
-#members a.logout:link, #members a.logout:visited, #members a.logout:hover, #members a.logout:active {
-       background-image : url(../images/member-menu-background-logout.gif);
-   background-repeat: repeat-x;
-   color: #000000;
-}
-
-#members a:hover.logout {
-   background-image : url(../images/member-menu-background-logout-hover.gif);
-     background-repeat: repeat-x;
-   color: #000000;
-}
-
-#nav {
-      /*background-color: #EFF1DC;*/
- border : 1px solid #EFF1DC;
-
-}
-
-#nav h6 {
-      background-color: #E7E7CA;
-     line-height : 1.8em;
-   margin-left: -1px;
-     margin-top : -1px;
-     margin-right : -1px;
-}
-
-#nav li ul li {/*
-      background-color: #E7E7CA;*/
-   border-bottom: 0 solid #D8DEB8;
-        border-left: 0 solid #FFFFCC;
-  border-right: 0 solid #006699;
- border-top: 0 solid #FFFFCC;
-}
-
-#nav li ul li a {
-      color: #0000FF;
-}
-
-#nav li ul li a:link {
-      color: #335599;
-}
-
-#nav li ul li a:visited {
-   color: #335599;
-}
-
-#nav li ul li a:hover {
-     color: #CC3333;
-}
-
-#nav ul li {
-        /* background-color: #EFF1DC; */
-       border-bottom: 0px solid #CCCC99;
-      border-left: 0 solid #FFFFCC;
-  border-right: 0 solid #006699;
- border-top: 0 solid #FFFFCC;
-}
-
-#nav ul li+li {
-        border-bottom: 0px solid #CCCC99;
-      border-left: 0 solid #FFFFCC;
-  border-right: 0 solid #006699;
-}
-
-#results, .results {
- color: #000066;
-}
-
-#search-sidebar {
-   background-color: #F8F8EB;
-}
-
-#sidebar {
-       /*background-color: #F8F8EB;
-   border: 1px dashed #666666;*/
-}
-
-#sidebar .content-block {
-     background-color : #EEEEEE;
-}
-
-#sidebar fieldset {
-     background-color: #F9F9FF;
-}
-
-#sidebar legend {
-        color : #003366;
-}
-
-#sidebar .submit {
-/*     background-color: #EEC95A; */
-       color: #FFFFFF;
-}
-
-#sidebar h3 {
-       color: #000066;
-}
-
-#window {
-   background-color: #E7E7CA;
-     border-left: 1px solid #CCCC99;
-}
-ul.link-tabs {
-}
-
-ul.link-tabs li {
-}
-
-ul.link-tabs li a {
-   border-top: 1px solid #DDDDDD;
- border-left : 1px solid #DDDDDD;
-       border-right : 1px solid #666666;
-}
-
-ul.link-tabs li.on a {
-    background-color: #FFFFFF;
-     border-bottom: 1px solid #FFFFFF;
-}
-
-ul.link-tabs li.off a {
-   background-color: #EEEEEB;
-     border-bottom: 1px solid #DDDDDD;
-}
-
-ul.link-tabs li.off a:hover {
-     background-color: #FFFFEC;
-     border-top: 1px solid #BEBF84;
- border-left : 1px solid #BEBF84;
-       border-right : 2px solid #333333;
-}
-
-ul.link-tabs li a.debit {
- background-color : #FFFF99;
-    color : #990033;
-}
-
-div#holdings, div#descriptions, div#reviews, div#serials, div#publicshelves, div#privateshelves, div#fines, div#waiting, div#overdues, div#issues, div#reserves {
-  border : 1px solid #DDDDDD;
-}
-
-div#holdings table {
-    border-top : 1px solid #DDDDDD;
-        border-right : 1px solid #DDDDDD;
-}
-
-div#holdings td, div#holdings th {
-        border-left : 1px solid #DDDDDD;
-       border-bottom : 1px solid #DDDDDD;
-}
-
-#usermenu {
-      background-image : url(../images/usermenu-background.gif);
-     background-repeat: repeat-x;
-   background-color: #EEEEEB;
-     border-top: 1px solid #EEEEEE;
- border-bottom: 1px solid #335599;
-      color: #000000;
-}
-
-#usermenu ul li a:link, #usermenu ul li a:visited {
- background-image : url(../images/usermenu-background.gif);
-     background-repeat: repeat-x;
-   border-left: 1px solid #9999CC;
-        color: #006699;
-}
-
-#usermenu ul li:last-child a {
-      border-right : 1px solid #9999CC;
-}
-
-#usermenu ul li a:hover, #usermenu ul li a:active {
-       background-image : url(../images/usermenu-background-hover.gif);
-       background-repeat: repeat-x;
-}
-
-#usermenu a {
-  text-decoration: none;
-}
-
-table.featured-item {
-        border : 0;
-}
-
-table.featured-item td {
-        border : 1px solid #CCCCCC;
-}
-
-table.featured-item a img {
-}
-
-table.featured-item a.title {
-}
-
-table.featured-item .author {
-}
-
-table.featured-item .publisher {
-}
-h1{
-background-color: #eeeeee;
-color: navy;
-background-image: url(./acceuil.jpg);
-background-repeat:no-repeat;
-}
-h1.authority
-{
-background-image:none;
-
-}
\ No newline at end of file
index aad1b2c..3149784 100644 (file)
@@ -1,3 +1,6 @@
+@import url("/opac-tmpl/lib/yui/reset-fonts-grids.css");
+@import url("/opac-tmpl/lib/yui/skin.css");
+
 a {
        font-weight : bold;
 }
@@ -649,12 +652,11 @@ a.send {
 
 #toolbar input.editshelf,
 input.editshelf {
-    background-image : url("../../images/sprite.png");
-    background-position : 2px -732px;
-    background-repeat: no-repeat;
+    background : transparent url("../../images/sprite.png") 2px -732px no-repeat;
        border : 0;
        color : #006699;
        cursor : pointer;
+    filter: none;
        font-size : 100%;
        padding-left : 29px;
        text-decoration : none;
@@ -664,11 +666,12 @@ input.editshelf {
 #toolbar a.newshelf,
 a.newshelf {
     background-image: url("../../images/sprite.png"); /* add to list icon */
-    background-position: -4px -864px;
+    background-position: -4px -764px;
     background-repeat: no-repeat;
        border : 0;
        color : #006699;
        cursor : pointer;
+    filter: none;
        font-size : 100%;
        margin: 0 0.5em;
     padding-left : 23px;
@@ -683,12 +686,11 @@ a.newshelf.disabled {
 
 #toolbar input.deleteshelf,
 input.deleteshelf {
-    background-image : url("../../images/sprite.png");
-    background-position : 2px -685px;
-    background-repeat: no-repeat;
+    background : transparent url("../../images/sprite.png") 2px -685px no-repeat;
        border : 0;
        color : #006699;
        cursor : pointer;
+    filter: none;
        font-size : 100%;
     padding-left : 25px;
        text-decoration : none;
@@ -1538,7 +1540,7 @@ div.message {
        background: -webkit-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Opera11.10+ */
        background: -ms-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
+    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
        background: linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* W3C */
        border : 1px solid #bcbcbc;
        width : 55%;
@@ -1584,7 +1586,6 @@ div.message {
        background: -webkit-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Chrome10+,Safari5.1+ */
        background: -o-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Opera11.10+ */
        background: -ms-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* IE10+ */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eef4fe', endColorstr='#cbdefe',GradientType=1 ); /* IE6-9 */
        background: linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* W3C */
        border : 1px solid #739acf;
        padding : .3em 1em 0 0;
@@ -1739,7 +1740,6 @@ div#menu li a {
        background: -o-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* IE10+ */
        background: linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* W3C */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
        text-decoration : none;
        display : block;
        border : 1px solid #979797;
@@ -1757,7 +1757,6 @@ div#menu li a:hover {
        background: -o-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* Opera 11.10+ */
        background: -ms-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* IE10+ */
        background: linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* W3C */
-       filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#a2bee8',GradientType=1 ); /* IE6-9 */
 }
 
 div#menu li.active a:hover {
@@ -2833,3 +2832,21 @@ body#opac-main #opacmainuserblockmobile {
 .tagweight9 {
     font-size: 30px;
 }
+
+#patronregistration {
+    background-color: #F7F7F7;
+    border : 1px solid #EAEAEA;
+    -moz-border-radius: 3px;
+    border-radius : 3px;
+    font-size : 90%;
+    margin : .7em 0;
+    padding : .5em;
+    text-align: center;
+}
+#patronregistration a {
+    display: block;
+}
+
+video {
+    width: 480px;
+}
diff --git a/koha-tmpl/opac-tmpl/prog/en/css/sanop.css b/koha-tmpl/opac-tmpl/prog/en/css/sanop.css
deleted file mode 100644 (file)
index 610b00e..0000000
+++ /dev/null
@@ -1,2013 +0,0 @@
-
-body #main {
-       margin-left : 2%;
-       background-color: #eeeeee;
-
-}
-
-/* TWO COLUMNS, RIGHT SIDEBAR */
-
-
-body#withsidebar #main {
-       float: left;
-       margin-left: 1%;
-       width: 58%;
-       }
-
-html body#withsidebar #main    {
-       margin-left: .5%;
-       }
-       
-body#withsidebar #sidebar
-       {
-       float: left;
-       margin-top : 2.4em;
-       width: 39%;
-}
-
-/* THREE COLUMNS */
-
-body#tricolumn #main_wrapper {
-               float: left;
-       width: 100%;
-}
-
-body#tricolumn #main
-       {
-               margin: 0 150px 0 175px;
-       }
-
-body#tricolumn #nav
-       {
-       float: left;
-       margin-left: -100%;
-       width: 175px;
-       }
-body#tricolumn #sidebar
-       {
-       float: left;
-       margin-left: -150px;
-       width: 150px;
-       }
-       
-/* TWO COLUMNS LEFT NAVIGATION */
-       
-body#withnav #main_wrapper
-       {
-       float: left;
-       width: 100%;
-       }
-       
-body#withnav #main
-       {
-       margin: 0 0 0 175px;
-       }
-
-body#withnav #nav
-       {
-       float: left;
-       margin-left: -100%;
-       width: 175px;
-       }
-
-body#withnav #main .content-block {
-       padding-left : 10px;
-}
-
-/* END TWO COLUMNS RIGHT NAVIGATION */
-       
-a {
-       font-weight: bold;
-}
-
-a:link, a:visited, a:active {
-        text-decoration : underline;
-        color :navy;
-}
-        
-a:link.current {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-}
-
-a:link.nav {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-  
-}
-
-a:visited.current {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-}
-
-a:visited.nav {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-}
-
-a:hover.current {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-}
-
-a:hover.nav {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-       
-}
-
-a:active.current {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-}
-
-a:active.nav {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-}
-
-a.help {
-       padding: 3px;
-       text-decoration: none;
-}
-
-a.title {
-       font-size: 1.2em;
-       font-style: normal;
-       font-weight: bold;
-}
-
-body {
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-       font-size: 73%;
-       margin: 0;
-       padding: 0;
-       background-color : #eeeeee;
-}
-
-input, select, th, td {
-       font-size:1em
-}
-
-caption {
-       font-family: Arial, Geneva, Helvetica, sans-serif;
-       font-size : 1.3em;
-       font-weight: bold;
-       margin: 0;
-       padding: 5px 0 3px 0;
-       text-align: left;
-}
-
-div.bookcover {
-       float: right;
-}
-
-div.details td.details {
-       text-align: left;
-}
-
-div.details ul {
-       list-style-type: circle;
-       margin-left: 0;
-       text-align: left;
-}
-
-div.error {
-       padding: 3px 10px 3px 10px;
-       width: 75%;
-}
-
-div.error li {
-       margin-bottom: .5em;
-}
-
-div.form, div.details {
-       margin: 0 auto;
-       padding: 0 0 0 6px;
-}
-
-div.notes {
-       text-align: left;
-}
-
-div.sidebar-box+div.sidebar-box {
-       margin-top: 5px;
-}
-
-div.tab {
-       display: block;
-       margin-right: 0px;
-       width: 100%;
-}
-
-div.tab p {
-       margin: 0;
-       padding: 3px 0;
-}
-
-div.tab p.MARCtag {
-       clear: both;
-       font-weight: bold; /* style for tag definition (700 - Statement of responsability) */
-       margin: 0;
-       padding: 2px;
-}
-
-div.tab table {
-}
-
-div.tabbloc {
-       font-family: Arial, Helvetica, sans-serif;
-}
-
-div.table {
-       width: 95%;
-}
-
-dl.details dt {
-       font-weight: bold;
-       margin: .5em 0;
-}
-
-dl.details dd {
-       margin-left: 1em;
-}
-
-dl.details ul {
-       padding: 0;
-       margin-left: 1em;
-}
-
-dl.details ul p {
-       margin-left : 0;
-}
-
-em.new {
-       font-style: normal;
-       font-weight: bold;
-}
-
-form {
-       display: inline;
-       margin: 0;
-       padding: 0;
-}
-
-h1 {
-       font-size: 1.8em;
-       padding: 5px 0 3px 0;
-}
-
-h1,h2,h3,h4,h5,h6 {
-       font-family: arial, geneva, helvetica, sans-serif;
-       margin: 0;
-}
-
-h1.logo {
-       display: inline;
-       margin: 10px 0 0 10px;
-       
-}
-
-h1.title {
-       font-style: italic;
-       padding: 5px 0 3px 0;
-       color: navy;
-}
-
-h2 {
-       font-size: 1.6em;
-       padding: 5px 0 3px 0;
-       
-}
-
-h2#libraryname {
-       padding-left : 5px;
-}
-
-h3 {
-       font-size: 1.4em;
-       padding: 5px 0 3px 0;
-}
-
-h3.author {
-       padding: 0 0 3px 15px;
-}
-
-h3+p {
-       margin: .4em 0 .4em 0;
-}
-
-h4 {
-       font-size: 1.3em;
-       padding: 5px 0 3px 0;
-}
-
-h5 {
-       font-size: 1.2em;
-       margin: 0;
-       padding: 10px 0 2px 0;
-}
-
-h5+p {
-       margin-top: 0;
-       padding-top: 0;
-}
-
-h6 {
-       font-size: 1.1em;
-}
-
-input.add, a.add {
-       background-image: url(../images/add.gif);
-}
-
-input.addchecked, a.addchecked {
-       background-image: url(../images/addtobasket.gif);
-}
-
-input.back, a.back {
-       background-image: url(../images/back.gif);
-}
-
-input.brief, a.brief {
-       background-image: url(../images/brief.gif);
-}
-
-input.cancel {
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-       font-size : .9em;
-       font-weight: bold;
-       padding: 2px;
-}
-
-input.cart, a.cart {
-       background-image: url(../images/cart.gif);
-}
-
-input.clearall, a.clearall {
-       background-image: url(../images/clearbasket.gif);
-}
-
-input.close, a.close {
-       background-image: url(../images/close.gif);
-}
-
-input.delete, a.delete {
-       background-image: url(../images/delete.gif);
-}
-
-input.detail, a.detail {
-       background-image: url(../images/detail.gif);
-}
-
-input.edit, a.edit {
-       background-image: url(../images/edit.gif);
-}
-
-input.icon {
-       background-position: left;
-       background-repeat: no-repeat;
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-       font-size : .9em;
-       font-weight: bold;
-       padding: 2px 2px 2px 22px;
-}
-
-input.isbd, a.isbd {
-       background-image: url(../images/isbd.gif);
-}
-
-input.print, a.print {
-       background-image: url(../images/print2.gif);
-}
-
-input.remove, a.remove {
-       background-image: url(../images/remove.gif);
-}
-
-input.reserve, a.reserve {
-       background-image: url(../images/placereserve.gif);
-}
-
-input.send, a.send {
-       background-image: url(../images/send.gif);
-}
-
-input.shelf, a.shelf {
-       background-image: url(../images/addtoshelf.gif);
-}
-
-input.trash, a.trash {
-       background-image: url(../images/trash.gif);
-}
-
-p {
-       padding: 0 10px 0 10px;
-}
-
-p.error, div.error {
-       font-weight: normal;
-       margin: auto;
-       padding: 5px 20px 5px 20px;
-}
-
-p.error+p.error, div.error+div.error {
-       margin-top: 5px;
-}
-
-p+h3 {
-       margin-top: .6em;
-}
-
-p+h5 {
-       margin: 0;
-       padding: 3px 0 2px 0;
-}
-
-span.itemicon {
-       float : left;
-       font-size: .9em;
-       margin: 2px;
-       white-space: nowrap;
-}
-
-span.print {
-       font-size: .7em;
-       font-weight: normal;
-       padding-left: .7em;
-}
-
-table {
-       border-collapse: collapse;
-       margin: 5px 0 5px 0;
-       padding: 0;
-}
-
-*html td, *html th {
-       font-size : .8em;
-}
-
-td {
-       padding: 3px;
-}
-
-td.input, div.form td, div.details td {
-       border-left: 0;
-       border-right: 0;
-       padding: 2px 2px 2px 4px;
-       text-align: right;
-}
-
-td.credit {
-       text-align: right;
-}
-
-td.debit {
-       text-align: right;
-}
-
-td.sum, th.sum {
-       text-align: right;
-}
-
-td.sum {
-       font-weight: bold;
-}
-
-td.label {
-       font-weight: bold;
-       line-height: 1.5em;
-       padding: 4px;
-}
-
-td.label, div.form th, div.details th {
-       border-right: 0;
-       border-top: 0;
-       font-weight: bold;
-       padding: 2px 2px 2px 4px;
-       text-align: left;
-       vertical-align: top;
-}
-
-td.search-options select {
-}
-
-td:last-child {
-       padding: 3px;
-}
-
-th {
-       font-weight: bold;
-       padding: 2px;
-}
-
-th a {
-       font-weight: bold;
-       text-decoration: none;
-}
-
-th:last-child {
-       font-weight: bold;
-       padding: 2px;
-}
-
-th[scope="row"] {
-       font-weight: normal;
-       text-align: right;
-}
-
-ul#facets {
-       margin: 3px;
-}
-
-#nav ul#facets {
-       margin : 0;
-       padding : 0;
-}
-
-#nav ul#facets li {
-       font-weight: bold;
-       text-align: left;
-}
-
-#nav ul#facets li#branch_facet, #nav ul#facets li#subject_facet, #nav ul#facets li#series_facet, #nav ul#facets li#author_facet {
-}
-
-#nav ul#facets ul li {
-       border: 0;
-       font-size: .95em;
-       font-weight: normal;
-       padding: 2px;
-       text-align: left;
-}
-
-#nav ul#facets ul li a {
-       font-weight: normal;
-       text-decoration: underline;
-}
-
-#nav ul#facets ul li.showmore {
-       text-align: center;
-}
-
-#nav ul#facets ul li.showmore a {
-       font-weight: bold;
-       text-decoration: none;
-}
-
-/* Tabs */
-ul.link-tabs {
-       list-style-type: none;
-       margin: 9px 0 -2px 5px;
-       padding: 0;
-}
-
-ul.link-tabs li {
-       display: inline;
-       padding: 0px;
-}
-
-ul.link-tabs li a {
-       font-weight: bold;
-       padding: 2px 4px 2px 4px;
-       text-decoration: none;
-}
-
-ul.link-tabs li#power_formButton a, ul.link-tabs li#proximity_formButton a {
-       padding: 2px 4px 3px 4px;
-}
-
-ul.link-tabs li.off a {
-}
-
-ul.link-tabs li.off a:hover {
-       padding: 2px 3px 2px 4px;
-}
-
-ul.link-tabs li.on a {
-}
-
-.clear {
-       clear: both;
-       line-height: .1em;
-}
-
-.content-block {
-       padding: 5px;
-}
-
-#home {
-       text-align : center;
-}
-
-#home #searchform input.submit {
-       font-size : 1.3em;
-}
-
-div#advanced-search p {
-       margin: .4em;
-
-}
-
-div#advanced-search fieldset {
-       /*margin-left : -1em;*/
-       margin-bottom: .3em; 
-       background-color : #eeeeee;
-       
-}
-
-div#advanced-search fieldset p {
-       margin-left : 1em;
-       white-space: nowrap; 
-       
-       
-}
-
-table.itemtypes {
-       border-collapse: separate;
-       border-spacing: 3px;
-       display: block;
-       padding: 0;
-       margin: 0;
-}
-
-div#advanced-search legend, div#sidebar legend {
-       font-weight: bold;
-}
-
-div#advanced-search label {
-
-}
-
-.count {
-       font-weight: normal;
-}
-
-.current {
-       font-weight: bold;
-       padding: 1px 5px 1px 5px;
-       text-decoration: none;
-}
-
-.detail-sidebar {
-       float: right;
-       padding: 5px;
-       margin-left : 15px;
-       margin-right : 5px;
-       text-align: center;
-       width : 25%;
-}
-
-.detail-sidebar .further {
-       float: none;
-       text-align: left;
-       width : 90%;
-}
-
-.further {
-       margin: 5px;
-       text-align: left;
-       width : 90%;
-}
-
-.ex {
-       font-family: "Courier New", Courier, monospace;
-}
-
-.further h4 {
-       padding: 2px;
-}
-
-.further li {
-       padding: 2px 0;
-}
-
-.further ul, .further li {
-       list-style: none;
-       margin: .5em 0 .7em .4em;
-       padding: 0;
-}
-
-.inline {
-       display: inline;
-}
-
-.item-datedue {
-       font-style: italic;
-}
-
-.item-details {
-       display: block;
-       margin: 0 0 0 25px;
-}
-
-.item-reserved, .item-notforloan, .item-lost, .item-cancelled, .item-damaged, .item-reserved {
-       display: block;
-}
-
-.labelsubfield {
-       clear: both; /* style for each subfield (like : a Publication year), just before the biblio subfield */
-       float: left;
-       font-weight: bold;
-       margin-left: 30px;
-       width: 12em;
-}
-
-.left {
-       float: left;
-}
-
-.loggedin {
-       font-weight: bold;
-}
-
-.login-note {
-       width: 35%;
-}
-
-.menu {
-       line-height: 3em;
-       font-size: 1.2em;
-       margin: 0;
-       padding: 5px;
-}
-
-.menu a.logout {
-       font-weight: bold;
-       padding: 3px 15px 3px 15px;
-       text-decoration: none;
-}
-
-.menu a:link, #members a:link {
-       padding: 2px;
-}
-
-.menu a:visited, #members a:visited {
-       padding: 2px;
-}
-
-.menu a:hover, #members a:hover {
-       padding: 2px;
-}
-
-.menu a:active, #members a:active {
-       padding: 2px;
-}
-
-.menu input {
-}
-
-.menu label {
-       font-weight: bold;
-}
-
-.menu p {
-       margin: 0;
-       padding: 0;
-}
-
-.menu p+p {
-       margin-top: 5px;
-}
-
-.note {
-       margin: 10px auto;
-       padding: 4px 4px 4px 4px;
-       width: 35%;
-}
-
-.opac-detail {
-       padding: 4px;
-}
-
-.opac-detail dd {
-       display: block;
-       line-height: 1.5em;
-       padding: 4px;
-       text-align: right;
-}
-
-.operations {
-       margin-top: 7px;
-       padding: 0 10px;
-       text-align: center;
-       width: 100%;
-}
-
-.operations img {
-       padding: 5px;
-}
-
-.operations li {
-       list-style-type: none;
-       margin: 0;
-       padding-bottom: 2px;
-}
-
-.operations li a, .operations li a:visited {
-       background-position: top left;
-       background-repeat: no-repeat;
-       border-style: outset;
-       display: block;
-       padding: 3px 3px 3px 26px;
-       text-decoration: none;
-}
-
-.searchresults a.reserve, .searchresults a.reserve:visited {
-       background-position: top left;
-       background-repeat: no-repeat;/*
-       border-style: outset;*/
-       float: right;
-       padding: 2px 3px 2px 26px;
-       /*text-decoration: none;*/
-}
-
-.operations li a:active {
-       border-style: inset;
-}
-
-.operations ul {
-       margin: 0;
-       padding: 0;
-       width: 90%;
-}
-
-.overdue {
-       font-weight: bold;
-}
-
-.pages {
-       line-height : 1.8em;
-       text-align: center;
-}
-
-.rejected {
-       text-decoration: line-through;
-}
-
-.right {
-       float: right;
-}
-
-.search-main {
-       float: left;
-       width: 65%;
-}
-
-.searchresults input, .searchresults label, .searchresults select {
-       font-size: .8em;
-}
-
-.searchresults p {
-       margin: 0;
-       padding: 0;
-       padding-top : .6em;
-}
-
-.searchresults p img {
-       vertical-align: middle;
-}
-
-.searchresults table td {
-       vertical-align: top;
-}
-
-p.searchresults {
-       margin-top : -5px;
-       text-align : right;
-       vertical-align : middle;
-       padding-bottom : 3px;
-}
-
-.selected {
-       text-decoration: none;
-}
-
-.sidebar-box {
-       margin-bottom: 0;
-}
-
-.sidebar-box h3, .sidebar-box h4 {
-       margin-left: 10px;
-}
-
-.sidebar-box p {
-       margin: 3px 10px;
-       padding: 0;
-}
-
-.submit {
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-       font-size : .9em;
-       font-weight: bold;
-       padding: 2px;
-}
-
-.term {
-       font-weight: bold;
-}
-
-.thumbnail {
-       border: 0;
-       float: left;
-       margin: 0 5px 5px 0;
-}
-
-.title {
-       font-style: italic;
-       font-weight: bold;
-}
-
-#sidebar .content-block {
-       margin : 0 10px 0 0;
-}
-
-form#auth h3 {
-       font-size : 1.1em;
-}
-
-#footer {
-       clear: both;
-       padding: 10px;
-       text-align: center;
-}
-
-#corner {
-       position: absolute;
-       top: 10px;
-       right: 5px;
-}
-
-#corner a.cart {
-       background-image : url(../images/cart-small.gif);
-       background-position: left;
-       background-repeat : no-repeat;
-       padding: 0 15px;
-       text-decoration: none;
-}
-
-#languages {
-       display: inline;
-}
-
-#languages ul {
-       display : inline;
-       list-style: none;
-       margin: 0;
-       padding : 0;
-}
-
-#languages ul li {
-       display: inline;
-       font-family: Arial, Helvetica, sans-serif;
-       font-size: .9em;
-}
-
-#languages ul li a {
-       font-weight: normal;
-       padding: 0 3px;
-       text-decoration: none;
-}
-
-#loose_form label, #keyword_form label, #precise_form label, #cql_form label, #advanced label, #cql label, #power label, #proximity label {
-       font-weight: bold;
-       text-align: right;
-}
-
-#loose_form, #keyword_form, #precise_form, #cql_form, #advanced, #cql, #power, #proximity {
-       margin: 5px;
-       width: 96%;
-}
-
-/*#main {
-       margin-left: 20%;
-       margin-right: 0;
-       padding: 0;
-       position: relative;
-}*/
-
-#masthead {
-       margin: 0;
-       margin-bottom : 1em;
-       padding: 0;
-       text-align:center;
-       
-}
-
-#members {
-       font-size: .8em;
-       font-weight: bold;
-       padding: 4px 0 4px 0;
-}
-
-#members a.card {
-       background-image: url(../images/card.gif);
-       background-position: left;
-       background-repeat: no-repeat;
-       display: block;
-       padding-left: 39px;
-}
-
-#members a.logout {
-       font-weight: bold;
-       padding: 0 .3em 0 .3em;
-       text-decoration: none;
-}
-
-#members li {
-       display: inline;
-       list-style: none;
-       margin: 0;
-}
-
-#members ul li a:link, #members ul li a:visited, #members ul li a:hover, #members ul li a:active, #members span.members {
-       padding : 4px;
-}
-
-#members ul li:last-child {
-}
-
-#members ul li a:hover {
-}
-
-#members ul {
-       margin: 0;
-       padding: 0;
-       text-align: right;
-}
-
-/*#nav {
-       float: left;
-       margin: 0;
-       padding: 0;
-       width: 20%;
-}*/
-
-#nav a {
-       font-family: Arial, Geneva, Helvetica, sans-serif;
-       font-weight: bold;
-       text-decoration: none;
-}
-
-#nav h6 {
-       padding: 3px;
-       text-align: center;
-}
-
-#nav li ul li {
-       font-family: Arial, Geneva, Helvetica, sans-serif;
-       list-style: none;
-       margin: 0;
-       padding: 5px 3px 5px 3px;
-       text-align: right;
-}
-
-#nav li ul li a {
-       font-family: Arial, Geneva, Helvetica, sans-serif;
-       font-weight: bold;
-       text-decoration: none;
-}
-
-#nav ul {
-       margin: 0;
-       padding: 0;
-}
-
-#nav ul li {
-       font-family: Arial, Geneva, Helvetica, sans-serif;
-       list-style: none;
-       margin: 0;
-       padding: 3px 8px 3px 3px;
-       text-align: right;
-}
-
-#nav ul li+li {
-       margin: 0;
-}
-
-#power_formButton, #proximity_formButton {
-}
-
-#results, .results {
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-       margin: 0;
-       padding: 7px 0 10px 0;
-}
-
-#search-footer {
-       margin: auto;
-       text-align: center;
-}
-
-#search-footer a {
-       margin: 3px 5px 3px 5px;
-       padding: 2px 5px;
-       text-decoration: none;
-}
-
-#searchform input.submit {
-       font-size: .8em;
-}
-
-#search-sidebar {
-       float: right;
-       margin: 10px;
-       padding: 3px;
-       width: 30%;
-}
-
-#search-sidebar .sidebar-box label {
-       display: block;
-       text-align: left;
-}
-
-/*#sidebar {
-       float: right;
-       margin: 20px;
-       padding: 5px;
-       width: 20%;
-}*/
-
-#sidebar .submit {
-       font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
-       font-weight: bold;
-       padding: 2px;
-       font-size: 1em;
-}
-
-#sidebar h3 {
-       font-family: Arial, Geneva, Helvetica, sans-serif;
-       margin: 0;
-       padding: 5px 0 1px 0;
-}
-
-#sort {
-       margin: .3em;
-}
-
-#sort, #sort select, #sort input {
-}
-
-#starFull {
-       background: url(../images/bluestars.png) top left no-repeat;
-       height: 25px;
-       margin: 0;
-       padding: 0;
-}
-
-#starMT {
-       background: url(../images/emptystars.png) top left no-repeat;
-       height: 25px;
-       margin: 0 3px 0 30px;
-       padding: 0;
-       position: relative;
-       width: 100px;
-}
-
-#window {
-       margin-left: 2%;
-       margin-right: 2%;
-       margin-top: 2%;
-       padding: 10px;
-}
-
-#window .class {
-       display: block;
-       font-weight: bold;
-       padding: 0 0 5px 3px;
-}
-
-#window div.menu {
-       margin: 0;
-       
-}
-
-div#item-details {
-       margin-bottom : 1.5em;
-}
-
-div#item-details img {
-       float : left;
-       padding : 1em;
-}
-
-div#item-details p {
-       margin : .1em 0;
-       line-height : 1.6em;
-}
-
-div#holdings table {
-       width : 100%;
-}
-
-div#holdings td, div#holdings th {
-       padding : 5px;
-}
-
-div#holdings, div#descriptions, div#reviews, div#serials, div#publicshelves, div#privateshelves, div#fines, div#waiting, div#overdues, div#issues, div#reserves {
-       margin-top : 4px;
-       padding : .7em;
-       width : 90%;
-}
-
-#usermenu {
-       font-size: .9em;
-       font-weight: bold;
-       margin-top : -1.1em;
-       margin-bottom : 1em;
-       padding: 4px 0 4px 0;
-       
-       
-}
-
-#usermenu li {
-       display: inline;
-       list-style: none;
-       margin: 0;
-}
-
-#usermenu ul li a:link, #usermenu ul li a:visited, #usermenu ul li a:hover, #usermenu ul li a:active, #usermenu span.members {
-       padding : 4px;
-}
-
-#usermenu ul li:last-child {
-}
-
-#usermenu ul li a:hover {
-}
-
-#usermenu ul {
-       margin: 0;
-       padding: 0;
-       text-align: right;
-}
-
-table.featured-item {
-       border-collapse : separate;
-       border-spacing: 9px;
-       margin : 5px;
-       text-align : center;
-}
-
-table.featured-item td {
-       vertical-align : top;
-}
-
-table.featured-item a img {
-       margin : auto;
-}
-
-table.featured-item a.title {
-       display : block;
-       font-size : 1em;
-       margin-bottom : .4em;
-}
-
-table.featured-item .author {
-       display : block;
-       font-size : .95em;
-       margin-bottom : .2em;
-}
-
-table.featured-item .publisher {
-       display : block;
-       font-size : .8em;
-}
-
-/* COLORS, BACKGROUNDS, AND BORDERS */
-
-a {
-       color: #006699;
-}
-
-a:link.current {
-       background-color: transparent;
-       color: #3366CC;
-}
-
-a:link.nav {
-       background-color: #EFF1DC;
-       border: 1px solid #CCCC99;
-       color: #3366CC;
-}
-
-a:visited {
-       color: #006699;
-}
-
-a:visited.current {
-       background-color: transparent;
-       color: #3366CC;
-}
-
-a:visited.nav {
-       background-color: #EFF1DC;
-       border: 1px solid #CCCC99;
-       color: #3366CC;
-}
-
-a:hover {
-       color: orange;
-}
-
-a:hover.current {
-       background-color: #CCFF00;
-       color: #CC3333;
-}
-
-a:hover.nav {
-       background-color: #FFFFCC;
-       border: 1px solid #CCCC99;
-       color: #CC3333;
-}
-
-a:active {
-       color: #990033;
-}
-
-a:active.current {
-       background-color: #99CC00;
-       color: #FFFF99;
-}
-
-a:active.nav {
-       background-color: #FFFFCC;
-       border: 1px solid #CCCC99;
-       color: #D25500;
-}
-
-a.reserve {
-       background-color: #006699;
-       color: White;
-}
-
-body {
-       background-color: #eeeeee;
-}
-
-body#withsidebar #main {
-       border: 0;
-       
-}
-ul {
-background-color:#eeeeee;
-text-align: left;
-}
-
-caption {
-       color: #000066;
-}
-
-div.error h3 {
-       color: #990000;
-}
-
-div.form, div.details {
-       background-color: #ffffff;
-}
-
-div.tab {
-       background-color: transparent;
-}
-
-div.tab p {
-       border-bottom: 1px solid #FFFFFF;
-       border-top: 1px solid #D8DEB8;
-}
-
-div.tabbloc {
-       background-color: transparent;
-}
-
-div#advanced-search fieldset {
-       border-right : 1px none #999999; 
-       border-top : 1px none #999999; 
-       border-bottom : 1px none #999999;
-       border-left : 1px none #999999; 
-}
-
-div#advanced-search legend {
-       color : #003366;
-}
-
-dl.details dt {
-       color: #000066;
-}
-
-em.new {
-       color: #CC3333;
-}
-
-h1,h2,h3,h4,h5,h6 {
-       color: navy;
-       background-color:navy;
-       color:white;
-}
-
-h1.logo {
-       color: #D3DFAD;
-       
-}
-
-h1#libraryname a {
-       color: #000066;
-       margin-left: .3em;
-       text-decoration: none;
-}
-
-input.icon {
-       background-color: #6699CC;
-       border: 1px outset #666666;
-       color: #FFFFCC;
-}
-
-p.availability {
-       color: #666666;
-       font-size: .9em;
-}
-
-p.error, div.error {
-       background-color: #FFFFCC;
-       border: 1px dashed #CC6600;
-}
-
-span.itemicon {
-       background-color : #F8F8EB;
-       border: 1px solid #D8DEB8;
-}
-
-table {
-       background-color: #FFFFFF;
-}
-
-table.itemtypes td {
-       background-color: #F8F8EB;
-       border: 1px solid #D8DEB8;
-}
-
-td {
-       background-color: #FFFFFF;
-       border-bottom: 1px solid #DDDDDD;
-       border-right: 1px solid #DDDDDD;
-}
-
-td.input, div.form td, div.details td {
-       border-bottom: 1px solid #CCCCCC;
-       border-left: 0;
-       border-right: 0;
-       color: #000000;
-}
-
-td.credit {
-       color: #000066;
-}
-
-td.debit {
-       color: #990000;
-}
-
-td.sum, th.sum {
-}
-
-td.sum {
-       background-color : #FFFFCC;
-}
-
-td.label {
-       border-bottom: 1px solid #CCCCCC;
-       border-left: 1px solid #CCCCCC;
-       color: #000088;
-}
-
-td.label, div.form th, div.details th {
-       background-color: #FFFFFF;
-       border-bottom: 1px solid #CCCCCC;
-       border-left: 1px solid #CCCCCC;
-       border-right: 0;
-       border-top: 0;
-       color: #000088;
-}
-
-div.details {
-       padding: 5px;
-       
-}
-
-div.details table, div.details td, div.details th {
-       border: 0;
-       border-bottom: 1px solid #DDDDDD;
-}
-
-td.overdue {
-       color: #CC0000;
-}
-
-td:last-child {
-       border-bottom: 1px solid #CCCCCC;
-       border-right: 0 solid #CCCCCC;
-}
-
-th {
-       background-color: #EFF1DC;
-       border-bottom: 1px solid #CCCCCC;
-       border-right: 1px solid #CCCCCC;
-}
-
-th:last-child {
-       background-color: #EFF1DC;
-       border-bottom: 1px solid #CCCCCC;
-       border-right: 0 solid #CCCCCC;
-}
-
-th[scope="row"] {
-       background-color: #E7E7CA;
-}
-
-tr.highlight {
-       background-color: #F8F8EB;
-}
-
-tr.highlight th[scope="row"] {
-       background-color: #EEEEEE;
-}
-
-tr.overdue td {
-       background-color: #FFDDDD;
-}
-
-input.cancel {
-       background-color: #990033;
-       border: 1px outset #666666;
-       color: #FFFFCC;
-}
-
-.available {
-       color : #006600;
-}
-
-.content-block {
-       background-color: #FFFFFF;
-}
-
-.current {
-       background-color: #FFFFFF;
-       color: #3366CC;
-}
-
-.detail-sidebar {
-       background-color: #EEEEEB;
-}
-
-.further {
-       background-color: #EEEEEB;
-       border: 2px solid #DDDED3;
-       color: #CCCC99;
-}
-
-.further h4 {
-       background-color: #D8DEB8;
-}
-
-.further li {
-}
-
-.issued {
-       color: #999999;
-}
-
-.labelsubfield {
-}
-
-.loggedin {
-       color: #D8DEB8;
-}
-
-.loggedinusername {
-       color: #666666;
-}
-
-.marcsubfieldletter {
-       background-color: #EFF1DC;
-}
-
-.marcsubfieldname {
-       background-color: #EFF1DC;
-}
-
-.MARCtag {
-       background-color: #EEEEEE;
-       color: #000066; /* style for tag definition (700 - Statement of responsability) */
-}
-
-.menu {
-       background-image : url(../images/menu-background.gif);
-       background-repeat: repeat-x;
-       background-color: #6699CC;
-       border-top: 1px solid #335599;
-       border-bottom: 1px solid #335599;
-       color: #FFFFFF;
-       
-}
-
-.menu a:link {
-       color : #FFFFCC;
-}
-
-.menu a:visited {
-       color : #FFFFCC;
-}
-
-.menu a:hover {
-       color : #FFFFFF;
-}
-
-.menu a:active {
-       color : #FFFF99;
-}
-
-#members a:link {
-       color: #0099CC;
-}
-
-#members a:visited {
-       color: #0099CC;
-}
-
-#members a:hover {
-       color: #990000;
-}
-
-#members a:active {
-       color: #990000;
-}
-
-.menu input.submit {
-       background-color : #6BA037;
-       color: #FFFFFF;
-}
-
-.note {
-       background-color: #EEEEEB;
-       border-bottom: 1px solid #DDDED3;
-       border-left: 1px solid #DDDED3;
-       border-right: 1px solid #DDDED3;
-       border-top: 1px solid #DDDED3;
-}
-
-.opac-detail {
-       background-color: #FFFFCC;
-}
-
-.opac-detail dd {
-       border-bottom: 1px solid #E7E7CA;
-       color: #000000;
-}
-
-.operations li a, .operations li a:visited {
-       background-color: #6699CC;
-       border: 2px solid #D8DEB8;
-       color: #FFFFCC;
-}
-
-.operations li a:hover {
-       background-color: #0099FF;
-       color: #FFFF99;
-}
-
-.operations li a:active {
-       background-color: #0099FF;
-       color: #FFFF99;
-}
-
-
-.item-reserved {
-       color : #009933;
-}
-
-.item-datedue {
-       color: #999999;
-}
-
-.item-notforloan, .item-lost, .item-cancelled, .item-damaged, .item-reserved {
-}
-
-.searchresults td, .searchresults th, .searchresults table {
-       border: 0;
-}
-
-.searchresults tr {
-       border-bottom : 1px solid #CCCCCC;
-}
-
-.searchresults table {
-       border-top : 0px solid #CCCCCC;
-}
-
-p.searchresults {
-       background-color : #EFF1DC;
-}
-
-.searchresults a.reserve {
-       background-color : transparent;
-       color : #006699;/*
-       background-color : #6699CC;
-       border: 1px outset #666666;
-       color : White;*/
-}
-
-.sidebar-box {
-       border: 1px dashed #CCCCCC;
-}
-
-.subfield {
-       background-color: #EFF1DC;
-}
-
-.subfieldvalue {
-       background-color: #FFFFFF;
-}
-
-.submit {
-       background-color: #EEC95A;
-       border: 3px outset #666666;
-       color: #FFFFFF;
-}
-
-.term {
-       background-color: #FFFFCC;
-       color: #990000;
-}
-
-.unavailable {
-       color: #990033;
-}
-
-#footer {
-       border-top: 1px solid #EEEEEE;
-}
-
-#languages ul li a {
-       border: 1px solid #D8DEB8;
-}
-
-#languages ul li a:hover {
-       background-color: #FFFFCC;
-}
-
-#main {
-       background-color: transparent;/*
-       border-top: 1px solid #EEEEEE;*/
-}
-
-#masthead {
-       background-color: #FFFFFF;/*
-       border-bottom: 1px solid #EEEEEE;*/
-}
-
-#members {
-       background-image : url(../images/member-menu-background.gif);
-       background-repeat: repeat-x;
-       border-top: 1px solid #9999CC;
-       border-bottom : 1px solid #9999CC;
-       background-color: #AFBCCF;
-       color: #000066;
-}
-
-#members ul li a:link, #members ul li a:visited, #members span.members {
-       background-image : url(../images/member-menu-background-link.gif);
-       background-repeat: repeat-x;
-       border-left: 1px solid #9999CC;
-       color: #006699;
-}
-
-#members ul li:last-child a {
-       border-right : 1px solid #9999CC;
-}
-
-#members ul li a:hover, #members ul li a:active {
-       background-image : url(../images/member-menu-background-hover.gif);
-       background-repeat: repeat-x;
-}
-
-#members a {
-       text-decoration: none;
-}
-
-#members a.logout:link, #members a.logout:visited, #members a.logout:hover, #members a.logout:active {
-       background-image : url(../images/member-menu-background-logout.gif);
-       background-repeat: repeat-x;
-       color: #000000;
-}
-
-#members a:hover.logout {
-       background-image : url(../images/member-menu-background-logout-hover.gif);
-       background-repeat: repeat-x;
-       color: #000000;
-}
-
-#nav {
-       /*background-color: #EFF1DC;*/
-       border : 1px solid #EFF1DC;
-
-}
-
-#nav h6 {
-       background-color: #E7E7CA;
-       line-height : 1.8em;
-       margin-left: -1px;
-       margin-top : -1px;
-       margin-right : -1px;
-}
-
-#nav li ul li {/*
-       background-color: #E7E7CA;*/
-       border-bottom: 0 solid #D8DEB8;
-       border-left: 0 solid #FFFFCC;
-       border-right: 0 solid #006699;
-       border-top: 0 solid #FFFFCC;
-}
-
-#nav li ul li a {
-       color: #0000FF;
-}
-
-#nav li ul li a:link {
-       color: #335599;
-}
-
-#nav li ul li a:visited {
-       color: #335599;
-}
-
-#nav li ul li a:hover {
-       color: #CC3333;
-}
-
-#nav ul li {
-       /* background-color: #EFF1DC; */
-       border-bottom: 0px solid #CCCC99;
-       border-left: 0 solid #FFFFCC;
-       border-right: 0 solid #006699;
-       border-top: 0 solid #FFFFCC;
-}
-
-#nav ul li+li {
-       border-bottom: 0px solid #CCCC99;
-       border-left: 0 solid #FFFFCC;
-       border-right: 0 solid #006699;
-}
-
-#results, .results {
-       color: #000066;
-}
-
-#search-sidebar {
-       background-color: #F8F8EB;
-}
-
-#sidebar {
-       /*background-color: #F8F8EB;
-       border: 1px dashed #666666;*/
-}
-
-#sidebar .content-block {
-       background-color : #EEEEEE;
-}
-
-#sidebar fieldset {
-       background-color: #F9F9FF;
-}
-
-#sidebar legend {
-       color : #003366;
-}
-
-#sidebar .submit {
-/*     background-color: #EEC95A; */
-       color: #FFFFFF;
-}
-
-#sidebar h3 {
-       color: #000066;
-}
-
-#window {
-       background-color: #E7E7CA;
-       border-left: 1px solid #CCCC99;
-}
-ul.link-tabs {
-}
-
-ul.link-tabs li {
-}
-
-ul.link-tabs li a {
-       border-top: 1px solid #DDDDDD;
-       border-left : 1px solid #DDDDDD;
-       border-right : 1px solid #666666;
-}
-
-ul.link-tabs li.on a {
-       background-color: #FFFFFF;
-       border-bottom: 1px solid #FFFFFF;
-}
-
-ul.link-tabs li.off a {
-       background-color: #EEEEEB;
-       border-bottom: 1px solid #DDDDDD;
-}
-
-ul.link-tabs li.off a:hover {
-       background-color: #FFFFEC;
-       border-top: 1px solid #BEBF84;
-       border-left : 1px solid #BEBF84;
-       border-right : 2px solid #333333;
-}
-
-ul.link-tabs li a.debit {
-       background-color : #FFFF99;
-       color : #990033;
-}
-
-div#holdings, div#descriptions, div#reviews, div#serials, div#publicshelves, div#privateshelves, div#fines, div#waiting, div#overdues, div#issues, div#reserves {
-       border : 1px solid #DDDDDD;
-}
-
-div#holdings table {
-       border-top : 1px solid #DDDDDD;
-       border-right : 1px solid #DDDDDD;
-}
-
-div#holdings td, div#holdings th {
-       border-left : 1px solid #DDDDDD;
-       border-bottom : 1px solid #DDDDDD;
-}
-
-#usermenu {
-       background-image : url(../images/usermenu-background.gif);
-       background-repeat: repeat-x;
-       background-color: #EEEEEB;
-       border-top: 1px solid #EEEEEE;
-       border-bottom: 1px solid #335599;
-       color: #000000;
-}
-
-#usermenu ul li a:link, #usermenu ul li a:visited {
-       background-image : url(../images/usermenu-background.gif);
-       background-repeat: repeat-x;
-       border-left: 1px solid #9999CC;
-       color: #006699;
-}
-
-#usermenu ul li:last-child a {
-       border-right : 1px solid #9999CC;
-}
-
-#usermenu ul li a:hover, #usermenu ul li a:active {
-       background-image : url(../images/usermenu-background-hover.gif);
-       background-repeat: repeat-x;
-}
-
-#usermenu a {
-       text-decoration: none;
-}
-
-table.featured-item {
-       border : 0;
-}
-
-table.featured-item td {
-       border : 1px solid #CCCCCC;
-}
-
-table.featured-item a img {
-}
-
-table.featured-item a.title {
-}
-
-table.featured-item .author {
-}
-
-table.featured-item .publisher {
-}
-h1{
-background-color: #eeeeee;
-color: navy;
-background-image: url(./acceuil.jpg);
-background-repeat:no-repeat;
-}
-h1.authority
-{
-background-image:none;
-
-}
\ No newline at end of file
index 4d8e25a..0a81ddd 100644 (file)
@@ -138,6 +138,7 @@ div.message {
  
 .dialog input.back {
     background : #FFF url(/opac-tmpl/lib/famfamfam/silk/arrow_left.png) no-repeat 4px center;
+    border: 1px solid #BCBCBC;
        padding : .4em .4em .4em 25px;  
  }
  
@@ -336,3 +337,6 @@ span.lang{
 div.ft {
        clear : both;
 }
+.inline {
+    display: inline;
+}
\ No newline at end of file
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc b/koha-tmpl/opac-tmpl/prog/en/includes/calendar.inc
new file mode 100644 (file)
index 0000000..2f30c9c
--- /dev/null
@@ -0,0 +1,77 @@
+<script type="text/javascript">
+//<![CDATA[
+
+var debug    = "[% debug %]";
+var dformat  = "[% dateformat %]";
+var sentmsg = 0;
+if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
+
+function Date_from_syspref(dstring) {
+        var dateX = dstring.split(/[-/]/);
+        if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
+        if (dformat === "iso") {
+                return new Date(dateX[0], (dateX[1] - 1), dateX[2]);  // YYYY-MM-DD to (YYYY,m(0-11),d)
+        } else if (dformat === "us") {
+                return new Date(dateX[2], (dateX[0] - 1), dateX[1]);  // MM/DD/YYYY to (YYYY,m(0-11),d)
+        } else if (dformat === "metric") {
+                return new Date(dateX[2], (dateX[1] - 1), dateX[0]);  // DD/MM/YYYY to (YYYY,m(0-11),d)
+        } else {
+                if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
+                return 0;
+        }
+}
+
+/* Instead of including multiple localization files as you would normally see with
+   jQueryUI we expose the localization strings in the default configuration */
+jQuery(function($){
+    $.datepicker.regional[''] = {
+        closeText: _('Done'),
+        prevText: _('Prev'),
+        nextText: _('Next'),
+        currentText: _('Today'),
+        monthNames: [_('January'),_('February'),_('March'),_('April'),_('May'),_('June'),
+        _('July'),_('August'),_('September'),_('October'),_('November'),_('December')],
+        monthNamesShort: [_('Jan'), _('Feb'), _('Mar'), _('Apr'), _('May'), _('Jun'),
+        _('Jul'), _('Aug'), _('Sep'), _('Oct'), _('Nov'), _('Dec')],
+        dayNames: [_('Sunday'), _('Monday'), _('Tuesday'), _('Wednesday'), _('Thursday'), _('Friday'), _('Saturday')],
+        dayNamesShort: [_('Sun'), _('Mon'), _('Tue'), _('Wed'), _('Thu'), _('Fri'), _('Sat')],
+        dayNamesMin: [_('Su'),_('Mo'),_('Tu'),_('We'),_('Th'),_('Fr'),_('Sa')],
+        weekHeader: _('Wk'),
+        dateFormat: '[% IF ( dateformat_us ) %]mm/dd/yy[% ELSIF ( dateformat_metric ) %]dd/mm/yy[% ELSE %]yy-mm-dd[% END %]',
+        firstDay: [% CalendarFirstDayOfWeek %],
+        isRTL: [% IF ( bidi ) %]true[% ELSE %]false[% END %],
+        showMonthAfterYear: false,
+        yearSuffix: ''};
+    $.datepicker.setDefaults($.datepicker.regional['']);
+});
+
+$(document).ready(function(){
+
+$.datepicker.setDefaults({
+        showOn: "both",
+        changeMonth: true,
+        changeYear: true,
+        buttonImage: '[% interface %]/lib/famfamfam/silk/calendar.png',
+        buttonImageOnly: true,
+        showButtonPanel: true,
+        showOtherMonths: true
+    });
+
+    $( ".datepicker" ).datepicker();
+    // http://jqueryui.com/demos/datepicker/#date-range
+    var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
+        changeMonth: true,
+        numberOfMonths: 1,
+        onSelect: function( selectedDate ) {
+            var option = this.id == "from" ? "minDate" : "maxDate",
+                instance = $( this ).data( "datepicker" );
+                date = $.datepicker.parseDate(
+                    instance.settings.dateFormat ||
+                    $.datepicker._defaults.dateFormat,
+                    selectedDate, instance.settings );
+            dates.not( this ).datepicker( "option", option, date );
+        }
+    });
+});
+//]]>
+</script>
\ No newline at end of file
index 4f0e540..1bc9eb3 100644 (file)
@@ -3,8 +3,6 @@
 <meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
 <link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
 <link rel="stylesheet" type="text/css" href="[% themelang %]/lib/jquery/jquery-ui.css" />
-<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/reset-fonts-grids.css" />
-<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/skin.css" />
 [% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %]
 [% IF (opaclayoutstylesheet.match('^https?:|^\/')) %]
     <link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet %]" />
index 1a96788..0cb0efe 100644 (file)
@@ -50,7 +50,7 @@
 [% END %]
 [% BLOCK authheadingdisplay %]
     [% IF authid %]<a href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid %]">[% heading %]</a>
-    [% ELSIF search %]<a href="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_ora=and&orderby=HeadingAsc&value=[% search %]">[% heading %]</a>
+    [% ELSIF search %]<a href="/cgi-bin/koha/opac-authorities-home.pl?op=do_search&type=opac&operator=contains&marclist=mainentry&and_or=and&orderby=HeadingAsc&value=[% search %]">[% heading %]</a>
     [% ELSE %][% heading %]
     [% END %]
 [% END %]
index 295eb5b..3df0221 100644 (file)
@@ -1,7 +1,7 @@
 [% IF ( opaccredits ) %]
        <div class="ft">
-        [% opaccredits %]
-    </div>
+            [% opaccredits %]
+        </div>
 [% END %]
 </div>
 
index 935d943..33d5a3e 100644 (file)
@@ -1,6 +1,6 @@
 [% IF ( PAGE_NUMBERS ) %]<div class="pages">
     <!-- Row of numbers corresponding to search result pages -->
-        [% IF ( previous_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">&lt;&lt; Previous</a>[% END %]
+        [% IF ( previous_page_offset.defined ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">&lt;&lt; Previous</a>[% END %]
     [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<span class="current">[% PAGE_NUMBER.pg %]</span>[% ELSE %]        <a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html%][% END %]">[% PAGE_NUMBER.pg %]</a>[% END %]
     [% END %]
         [% IF ( next_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">Next &gt;&gt;</a>[% END %] </div>[% END %]
index 2a68959..1845ddb 100644 (file)
@@ -3,21 +3,21 @@
     <p>
     <label>Audience</label>
     <select name="limit" class="subtype">
-            <option value="" SELECTED="selected" >Any</option>
+            <option value="" selected="selected" >Any</option>
       <option value="aud:a">juvenile, general</option>
       <option value="aud:b">pre-primary (0-5)</option>
-      <option value="aud:c">Primary (5-8)</option>
+      <option value="aud:c">primary (5-8)</option>
       <option value="aud:d">children (9-14)</option>
-      <option value="aud:e">Young Adult</option>
-      <option value="aud:k">Adult, serious</option>
-      <option value="aud:m">Adult, General</option>
-      <option value="aud:u">Unknown</option>
+      <option value="aud:e">young Adult</option>
+      <option value="aud:k">adult, serious</option>
+      <option value="aud:m">adult, General</option>
+      <option value="aud:u">unknown</option>
     </select>
     </p>
     <p>
     <label>Print</label>
         <select name="limit" class="subtype">
-      <option value="" selected="selected" >any</option>
+      <option value="" selected="selected" >Any</option>
         <option value="Material-type:r">regular print</option>
         <option value="Material-type:d">large print</option>
         <option value="Material-type:e">newspaper format</option>
         <option value="Material-type:h">hand-written</option>
         <option value="Material-type:i">multimedia</option>
         <option value="Material-type:j">mini-print</option>
+    <option value="Material-type:s">electronic ressource</option>
+    <option value="Material-type:t">microform</option>
         <option value="Material-type:z">other form of textual material</option>
     </select>
     </p>
     <p>
-    <label>Feschrift Ind.</label>
+    <label>Literary genre</label>
     <select name="limit" class="subtype">
       <option value="" selected="selected" >Any</option>
             <option value="Literature-Code:a">fiction</option>
             <option value="Literature-Code:f">short stories</option>
             <option value="Literature-Code:g">poetry</option>
             <option value="Literature-Code:h">speeches, oratory</option>
+            <option value="Literature-Code:i">libretto</option>
             <option value="Literature-Code:y">not a literary text</option>
-            <option value="Literature-Code:z">multiple/other lit. forms</option>
+            <option value="Literature-Code:z">multiple/other literary forms</option>
     </select>
     </p>
         <p>
     <label>Biography</label>
         <select name="limit" class="subtype" size="1">
             <option value="">Any</option>
-            <option value="Biography-code:y">Not a biography</option>
+            <option value="Biography-code:y">not a biography</option>
             <option value="Biography-code:a">autobiography</option>
             <option value="Biography-code:b">individual biography</option>
             <option value="Biography-code:c">collective biography</option>
-            <option value="Biography-code:d">contains biogr. data</option>
+            <option value="Biography-code:d">contains biographical data</option>
     </select>
         </p>
         <p>
             <option value="ctype:r" >literature surveys/reviews</option>
             <option value="ctype:s" >treaties</option>
             <option value="ctype:t" >cartoons or comic strips</option>
+            <option value="ctype:v" >dissertation or thesis (revised)</option>v
+            <option value="ctype:w" >religious text</option>
             <option value="ctype:z" >other</option>
     </select>
         </p>
     <select name="limit" class="subtype">
            <option value="">Any type</option>
            <option value="Type-Of-Serial:a">Periodical</option>
-      <option value="Type-Of-Serial:b">Monographical series</option>
-      <option value="Type-Of-Serial:c">Newspaper</option>
-      <option value="Type-Of-Serial:z">Other</option>
+           <option value="Type-Of-Serial:b">Monographic series</option>
+           <option value="Type-Of-Serial:c">Newspaper</option>
+       <option value="Type-Of-Serial:e">Updating loose-leaf</option>
+       <option value="Type-Of-Serial:f">Database</option>
+       <option value="Type-Of-Serial:g">Updating website</option>
+       <option value="Type-Of-Serial:z">Other</option>
     </select>
     </p>
     <p>
         <option value="Frequency-code:i">Three times a year</option>
         <option value="Frequency-code:j">Semiannual</option>
         <option value="Frequency-code:k">Annual</option>
-        <option value="Frequency-code:l">Biannual</option>
+        <option value="Frequency-code:l">Biennial</option>
         <option value="Frequency-code:m">Triennial</option>
         <option value="Frequency-code:n">Three times a week</option>
         <option value="Frequency-code:o">Three times a month</option>
-        <option value="Frequency-code:u">Unknown</option>
         <option value="Frequency-code:y">Without periodicity</option>
-        <option value="Frequency-code:i">Other</option>
+        <option value="Frequency-code:u">Unknown</option>
+        <option value="Frequency-code:z">Other</option>
     </select>
     </p>
     <p>
     <label>Regularity</label>
     <select name="limit" class="subtype">
             <option value="">Any regularity</option>
-        <option value="Regularity-code:u">Unknown</option>
-        <option value="Regularity-code:a">Regular</option>
-        <option value="Regularity-code:b">Normalised irregular</option>
+        <option value="Regularity-code:a">regular</option>
+        <option value="Regularity-code:b">normalised irregular</option>
         <option value="Regularity-code:y">irregular</option>
+        <option value="Regularity-code:u">unknown</option>
     </select>
         </p>
 
         <option value="Graphics-type:z">other non-projected graphic type</option>
     </select>
     <select name="limit" class="subtype">
-            <option value="">any</option>
+            <option value="">Any</option>
             <option value="Graphics-support:a">canvas</option>
             <option value="Graphics-support:b">bristol board</option>
             <option value="Graphics-support:c">cardboard/illustration board</option>
             <option value="Graphics-support:l">porcelaine</option>
             <option value="Graphics-support:m">stone</option>
             <option value="Graphics-support:n">wood</option>
-            <option value="Graphics-support:u">unknown</option>
             <option value="Graphics-support:v">mixed collection</option>
             <option value="Graphics-support:e">synthetics</option>
             <option value="Graphics-support:f">skin</option>
             <option value="Graphics-support:h">metal</option>
             <option value="Graphics-support:i">paper</option>
             <option value="Graphics-support:z">others</option>
+            <option value="Graphics-support:u">unknown</option>
     </select>
         </p>
index 352d6b3..5a07d95 100644 (file)
@@ -5,7 +5,7 @@
   [% IF ( OPACFinesTab ) %]
   [% IF ( accountview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-account.pl">my fines</a></li>
   [% END %]
-  [% IF ( userupdateview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-userupdate.pl">my personal details</a></li>
+  [% IF ( userupdateview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-memberentry.pl">my personal details</a></li>
   [% IF ( TagsEnabled ) %]
     [% IF ( tagsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-tags.pl?mine=1">my tags</a></li>
   [% END %]
index 5e30183..398a89c 100644 (file)
@@ -7,35 +7,12 @@ function Dopop(link) {
        newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes,resizeable=yes');
 }
 
-$.datepicker.setDefaults({
-        showOn: "both",
-        changeMonth: true,
-        changeYear: true,
-        buttonImage: '/opac-tmpl/lib/famfamfam/silk/calendar.png',
-        buttonImageOnly: true,
-        showButtonPanel: true
-    });
-
 $(document).ready(function(){
        $(".close").click(function(){
                window.close();
        });
        $(".focus").focus();
-    $( ".datepicker" ).datepicker();
-    // http://jqueryui.com/demos/datepicker/#date-range
-    var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
-        changeMonth: true,
-        numberOfMonths: 1,
-        onSelect: function( selectedDate ) {
-            var option = this.id == "from" ? "minDate" : "maxDate",
-                instance = $( this ).data( "datepicker" );
-                date = $.datepicker.parseDate(
-                    instance.settings.dateFormat ||
-                    $.datepicker._defaults.dateFormat,
-                    selectedDate, instance.settings );
-            dates.not( this ).datepicker( "option", option, date );
-        }
-    });
+
        // clear the basket when user logs out
        $("#logout").click(function(){
                var nameCookie = "bib_list";
diff --git a/koha-tmpl/opac-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png b/koha-tmpl/opac-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png
new file mode 100644 (file)
index 0000000..6d02426
Binary files /dev/null and b/koha-tmpl/opac-tmpl/prog/en/lib/jquery/images/ui-icons_888888_256x240.png differ
index a73c8bb..b5fca46 100644 (file)
@@ -84,8 +84,10 @@ please choose against which one you would like to authenticate: </p>
 </ol></fieldset>
 
 <input type="submit" value="Log In" class="submit" />
-<div id="nologininstructions">  <h5>Don't have a password yet?</h5><p> If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
-<h5>Don't have a library card?</h5><p> If you don't have a library card, stop by your local library to sign up.  </p></div>
+<div id="nologininstructions">
+    <h5>Don't have a password yet?</h5><p> If you don't have a password yet, stop by the circulation desk the next time you're in the library. We'll happily set one up for you.</p>
+    <h5>Don't have a library card?</h5><p> If you don't have a library card, stop by your local library to sign up[% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<span id="registrationinstructions"> or  <a href="/cgi-bin/koha/opac-memberentry.pl">register here</a></span>[% END %].  </p>
+</div>
 </form>
 
 
index 93f27b9..e0bf5a9 100644 (file)
@@ -33,7 +33,7 @@
                     <option value="match">in any heading</option>
                     <option value="mainentry">in main entry</option>
                 </select>
-                <input type="hidden" name="and_ora" value="and" />
+                <input type="hidden" name="and_or" value="and" />
                 <input type="hidden" name="excluding" value="" />
             </li>
             <li><label for="orderby">Order by: </label><select name="orderby" id="orderby">
index 3ed3144..fa5ec3d 100644 (file)
@@ -16,6 +16,7 @@
 <link rel="stylesheet" type="text/css" href="/opac-tmpl/prog/en/css/jquery.rating.css" />[% END %]
 
 [% IF ( OpacHighlightedWords ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.highlight-3.js"></script>[% END %]
+
 <script type="text/JavaScript" language="JavaScript">
 //<![CDATA[
 
@@ -81,7 +82,7 @@
         });
 [% END %]
 
-        $("#holdingst").tablesorter({[% IF ( dateformat == 'metric' ) %]
+        $(".holdingst").tablesorter({[% IF ( dateformat == 'metric' ) %]
     dateFormat: 'uk',[% END %]
             widgets : ['zebra'],
             sortList: [[0,0]]
@@ -654,9 +655,12 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 <div id="bibliodescriptions" class="toptabs">
 
 <ul>   
-[% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
-    <a href="#holdings">Holdings ( [% count %] )</a>
-</li>
+    [% IF ( defaulttab == 'holdings' ) %]<li id="tab_holdings" class="ui-tabs-selected">[% ELSE %]<li id="tab_holdings">[% END %]
+        <a href="#holdings">[% IF SeparateHoldings %][% LoginBranchname %] holdings[% ELSE %]Holdings[% END %] ( [% itemloop.size || 0 %] )</a>
+    </li>
+    [% IF (SeparateHoldings) %]
+        <li><a href="#otherholdings">Other holdings ( [% otheritemloop.size || 0 %] )</a></li>
+    [% END %]
 <li id="tab_descriptions"> <a href="#descriptions">Title notes</a></li>
 [% IF ( SYNDETICS_TOC ) %]
     <li id="tab_toc"> <a href="#toc">TOC</a></li>
@@ -712,9 +716,14 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     </li>
 [% END %]
 
-[% IF ( OPACLocalCoverImages ) %][% IF ( localimages ) %]
+[% IF ( OPACLocalCoverImages && localimages.size ) %]
     <li id="tab_images"><a href="#images">Images</a></li>
+[% END %]
+
+[% IF ( HTML5MediaEnabled ) %][% IF ( HTML5MediaSets ) %]
+    <li id="tab_html5media"><a href="#html5media">Play media</a></li>
 [% END %][% END %]
+
 </ul>
 
 [% IF ( serialcollection ) %]
@@ -740,69 +749,13 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 </div>
 [% END %]
 
+
 <div id="holdings">
-[% IF ( count ) %]
+[% IF ( itemloop.size ) %]
     [% IF ( lotsofitems ) %]
        <p>This record has many physical items. <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]&amp;viewallitems=1#holdings">Click here to view them all.</a></p>
     [% ELSE %]
-    <table id="holdingst">
-        <thead><tr>
-            [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %]
-            <th id="item_location">Location</th>
-            [% IF ( itemdata_ccode ) %]<th id="item_ccode">Collection</th>[% END %]
-            <th id="item_callnumber">Call number</th>
-            [% IF ( itemdata_enumchron ) %]<th id="item_enumchron">Vol info</th>[% END %]
-            [% IF ( itemdata_uri ) %]<th id="item_url">url</th>[% END %]
-            [% IF ( itemdata_copynumber ) %]<th id="item_copy">Copy</th>[% END %]
-            <th id="item_status">Status</th>
-            [% IF ( itemdata_itemnotes ) %]<th id="item_notes">Notes</th>[% END %]
-            <th id="item_datedue">Date due</th>
-            [% IF ( OPACShowBarcode ) %]<th>Barcode</th>[% END %]
-        [% IF holds_count.defined %]
-            <th>Item holds</th>
-        [% ELSIF show_priority %]
-            <th>Item hold queue priority</th>
-        [% END %]
-        </tr></thead>
-           <tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
-      <tr>[% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
-             <td class="location">
-    [% UNLESS ( singleBranchMode ) %]
-        <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
-        [% IF ( ITEM_RESULT.branchurl ) %]
-        <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a>
-        [% ELSE %]
-        [% ITEM_RESULT.branchname %]
-        [% END %]
-        </span>
-        <div class="branch-info-tooltip">[% ITEM_RESULT.branch_opac_info %]</div>
-    [% END %]
-    <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
-    </td>
-            [% IF ( itemdata_ccode ) %]<td class="collection">[% ITEM_RESULT.ccode %]</td>[% END %]
-        <td class="call_no">[% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#shelfbrowser">Browse shelf</a>)[% END %][% END %]</td>
-            [% IF ( itemdata_enumchron ) %]<td class="vol_info">[% ITEM_RESULT.enumchron %]</td>[% END %]
-          [% IF ( itemdata_uri ) %]<td class="url"><a href="[% ITEM_RESULT.uri %]">[% ITEM_RESULT.uri %]</a></td>[% END %]
-               [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
-              <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
-             [% IF ( itemdata_itemnotes ) %]<td class="notes">[% ITEM_RESULT.itemnotes %]</td>[% END %]
-        <td class="date_due">[% ITEM_RESULT.datedue | $KohaDates %]</td>
-        [% IF ( OPACShowBarcode ) %]<td class="barcode">[% ITEM_RESULT.barcode %]</td>[% END %]
-        [% IF holds_count.defined || show_priority %]
-        <td class="holds_count">
-            [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %]
-            [% IF ITEM_RESULT.priority %]
-                [% IF holds_count.defined %]
-                (priority [% ITEM_RESULT.priority %])
-                [% ELSE %]
-                [% ITEM_RESULT.priority %]
-                [% END %]
-            [% END %]
-                </td>
-        [% END %]
-           </tr>
-           [% END %]</tbody>
-       </table>
+        [% INCLUDE items_table items=itemloop tab="holdings" %]
     [% END %]
     [% IF holds_count.defined || priority %]
     <div id="bib_holds">
@@ -828,65 +781,20 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     [% END %]
 [% END %]
 
-[% IF ( OpenOPACShelfBrowser ) %]
-<div id="shelfbrowser">
-<h5 style="text-align: center;">[% IF ( starting_homebranch ) %]Browsing [% starting_homebranch %] Shelves[% END %][% IF ( starting_location ) %], Shelving location: [% starting_location %][% END %][% IF ( starting_ccode ) %], Collection code: [% starting_ccode %][% END %] <a style="font-size: 75%;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]">Close shelf browser</a></h5>
-
-        
-        <table><tr>
-        <td rowspan="2" style="width:20px;"><div id="browser_previous"><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% IF ( shelfbrowser_prev_biblionumber ) %][% shelfbrowser_prev_biblionumber %][% ELSE %][% biblionumber %][% END %]&amp;shelfbrowse_itemnumber=[% shelfbrowser_prev_itemnumber %]#shelfbrowser">Previous</a></div></td>
-[% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %]
-        <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% PREVIOUS_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% PREVIOUS_SHELF_BROWS.itemnumber %]#shelfbrowser">
-    [% IF ( OPACAmazonCoverImages ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<img border="0" src="http://images.amazon.com/images/P/[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
-    [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %]
-    [% IF ( using_https ) %]
-    <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
-    [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />[% END %]
-    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
-    [% IF ( GoogleJackets ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]<div style="block" title="[% PREVIOUS_SHELF_BROWS.biblionumber |url %]" class="[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
-    [% IF ( BakerTaylorEnabled ) %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]
-    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
-
-</a></td>
-[% END %]
-
-[% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %]
-       <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% NEXT_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% NEXT_SHELF_BROWS.itemnumber %]#shelfbrowser">
-
-    [% IF ( OPACAmazonCoverImages ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
-    <img border="0" src="http://images.amazon.com/images/P/[% NEXT_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
-
-       [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %]
-    [% IF ( using_https ) %]
-    <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
-    [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />[% END %]
-    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
-
-    [% IF ( GoogleJackets ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]<div style="block" title="[% NEXT_SHELF_BROWS.biblionumber |url %]" class="[% NEXT_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
-    [% IF ( BakerTaylorEnabled ) %][% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
-    <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% NEXT_SHELF_BROWS.browser_normalized_isbn %]" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
-
-</a></td>
-[% END %]
-<td rowspan="2"><div id="browser_next"><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% IF ( shelfbrowser_next_biblionumber ) %][% shelfbrowser_next_biblionumber %][% ELSE %][% biblionumber %][% END %]&amp;shelfbrowse_itemnumber=[% shelfbrowser_next_itemnumber %]#shelfbrowser">Next</a></div></td>
-</tr>
-
-<tr>
-[% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %]
-<td class="top">[% PREVIOUS_SHELF_BROWS.itemcallnumber %]<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% PREVIOUS_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% PREVIOUS_SHELF_BROWS.itemnumber %]#shelfbrowser">[% PREVIOUS_SHELF_BROWS.title |html %]</a></td>
-[% END %]
-
-[% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %]
-       <td class="top" style="width:20px;">[% NEXT_SHELF_BROWS.itemcallnumber %]<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% NEXT_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% NEXT_SHELF_BROWS.itemnumber %]#shelfbrowser">[% NEXT_SHELF_BROWS.title |html %]</a></td>
-[% END %]
-</tr>
-</table>
-        
-</div>
-[% END %]
+[% INCLUDE shelfbrowser tab='holdings' %]
 <br clear="all" />
 </div>
 
+[% IF (SeparateHoldings) %]
+    <div id="otherholdings">
+        [% IF (otheritemloop.size) %]
+            [% INCLUDE items_table items=otheritemloop tab="otherholdings" %]
+        [% ELSE %]
+            No other items.
+        [% END %]
+        [% INCLUDE shelfbrowser tab='otherholdings' %]
+    </div>
+[% END %]
 
 <div id="descriptions">
 <div class="content_set">
@@ -988,6 +896,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     [% FOREACH subscription IN subscriptions %]
     [% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
     [% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
+    [% IF ( subscription.closed ) %]<p>This subscription is closed.</p>[% END %]
+    <span style="display:none;"> [% IF ( subscription.callnumber ) %]<p>Callnumber: [% subscription.callnumber %]</p>[% END %]</span>
     [% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
     <p>Subscription from: [% subscription.histstartdate | $KohaDates %] to:[% IF ( subscription.histenddate ) %] [% subscription.histenddate | $KohaDates %] [% ELSE %] now (current)[% END %]</p>
     [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist %] </p>[% END %]
@@ -1149,7 +1059,20 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 </table>
 </div>[% END %][% END %]
 
-[% IF ( OPACLocalCoverImages ) %]
+[% IF ( HTML5MediaEnabled ) %]
+<div id="html5media">
+        <p>
+        <[% HTML5MediaParent %] controls preload=none>
+          [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
+            <[% HTML5MediaSet.child  %] src="[% HTML5MediaSet.srcblock %]"[% HTML5MediaSet.typeblock %] />
+          [% END %]
+            [[% HTML5MediaParent %] tag not supported by your browser.]
+        </[% HTML5MediaParent %]>
+        </p>
+</div>
+[% END %]
+
+[% IF ( OPACLocalCoverImages && localimages.size ) %]
 <div id="images">
 <p>Click on an image to view it in the image viewer</p>
 [% FOREACH image IN localimages %]
@@ -1263,3 +1186,194 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 [% END %]
 
 [% INCLUDE 'opac-bottom.inc' %]
+
+[%# End of template %]
+
+[% BLOCK items_table %]
+    <table class="holdingst">
+        <thead><tr>
+            [% IF ( item_level_itypes ) %]<th id="item_itemtype">Item type</th>[% END %]
+            <th id="item_location">Location</th>
+            [% IF ( itemdata_ccode ) %]<th id="item_ccode">Collection</th>[% END %]
+            <th id="item_callnumber">Call number</th>
+            [% IF ( itemdata_enumchron ) %]<th id="item_enumchron">Vol info</th>[% END %]
+            [% IF ( itemdata_uri ) %]<th id="item_url">url</th>[% END %]
+            [% IF ( itemdata_copynumber ) %]<th id="item_copy">Copy</th>[% END %]
+            <th id="item_status">Status</th>
+            [% IF ( itemdata_itemnotes ) %]<th id="item_notes">Notes</th>[% END %]
+            <th id="item_datedue">Date due</th>
+            [% IF ( OPACShowBarcode ) %]<th>Barcode</th>[% END %]
+        [% IF holds_count.defined %]
+            <th>Item holds</th>
+        [% ELSIF show_priority %]
+            <th>Item hold queue priority</th>
+        [% END %]
+        </tr></thead>
+           <tbody>[% FOREACH ITEM_RESULT IN items %]
+      <tr>[% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
+             <td class="location">
+    [% UNLESS ( singleBranchMode ) %]
+        <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
+        [% IF ( ITEM_RESULT.branchurl ) %]
+        <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a>
+        [% ELSE %]
+        [% ITEM_RESULT.branchname %]
+        [% END %]
+        </span>
+        <div class="branch-info-tooltip">[% ITEM_RESULT.branch_opac_info %]</div>
+    [% END %]
+    <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
+    </td>
+            [% IF ( itemdata_ccode ) %]<td class="collection">[% ITEM_RESULT.ccode %]</td>[% END %]
+        <td class="call_no">[% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&amp;shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#[% tab %]">Browse shelf</a>)[% END %][% END %]</td>
+            [% IF ( itemdata_enumchron ) %]<td class="vol_info">[% ITEM_RESULT.enumchron %]</td>[% END %]
+          [% IF ( itemdata_uri ) %]<td class="url"><a href="[% ITEM_RESULT.uri %]">[% ITEM_RESULT.uri %]</a></td>[% END %]
+               [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
+              <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
+             [% IF ( itemdata_itemnotes ) %]<td class="notes">[% ITEM_RESULT.itemnotes %]</td>[% END %]
+        <td class="date_due">[% ITEM_RESULT.datedue | $KohaDates %]</td>
+        [% IF ( OPACShowBarcode ) %]<td class="barcode">[% ITEM_RESULT.barcode %]</td>[% END %]
+        [% IF holds_count.defined || show_priority %]
+        <td class="holds_count">
+            [% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %]
+            [% IF ITEM_RESULT.priority %]
+                [% IF holds_count.defined %]
+                (priority [% ITEM_RESULT.priority %])
+                [% ELSE %]
+                [% ITEM_RESULT.priority %]
+                [% END %]
+            [% END %]
+                </td>
+        [% END %]
+           </tr>
+           [% END %]</tbody>
+       </table>
+[% END %][%# end of items_table block %]
+
+[% BLOCK shelfbrowser %]
+    [% IF ( OpenOPACShelfBrowser and shelfbrowser_tab == tab) %]
+        <div id="shelfbrowser">
+            <h5 style="text-align: center;">
+                [% IF ( starting_homebranch ) %]Browsing [% starting_homebranch %] Shelves[% END %]
+                [% IF ( starting_location ) %], Shelving location: [% starting_location %][% END %]
+                [% IF ( starting_ccode ) %], Collection code: [% starting_ccode %][% END %]
+                <a style="font-size: 75%;" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]">Close shelf browser</a>
+            </h5>
+
+            <table>
+                <tr>
+                    <td rowspan="2" style="width:20px;">
+                        <div id="browser_previous">
+                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% IF ( shelfbrowser_prev_biblionumber ) %][% shelfbrowser_prev_biblionumber %][% ELSE %][% biblionumber %][% END %]&amp;shelfbrowse_itemnumber=[% shelfbrowser_prev_itemnumber %]#shelfbrowser">Previous</a>
+                        </div>
+                    </td>
+                    [% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %]
+                        <td>
+                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% PREVIOUS_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% PREVIOUS_SHELF_BROWS.itemnumber %]#shelfbrowser">
+                                [% IF ( OPACAmazonCoverImages ) %]
+                                    [% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]
+                                        <img border="0" src="http://images.amazon.com/images/P/[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />
+                                    [% ELSE %]
+                                        <span class="no-image">No cover image available</span>
+                                    [% END %]
+                                [% END %]
+                                [% IF ( SyndeticsEnabled ) %]
+                                    [% IF ( SyndeticsCoverImages ) %]
+                                        [% IF ( content_identifier_exists ) %]
+                                            [% IF ( using_https ) %]
+                                                <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
+                                            [% ELSE %]
+                                                <img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% PREVIOUS_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% PREVIOUS_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
+                                            [% END %]
+                                        [% ELSE %]
+                                            <span class="no-image">No cover image available</span>
+                                        [% END %]
+                                    [% END %]
+                                [% END %]
+                                [% IF ( GoogleJackets ) %]
+                                    [% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]
+                                        <div style="block" title="[% PREVIOUS_SHELF_BROWS.biblionumber |url %]" class="[% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>
+                                    [% ELSE %]
+                                        <span class="no-image">No cover image available</span>
+                                    [% END %]
+                                [% END %]
+                                [% IF ( BakerTaylorEnabled ) %]
+                                    [% IF ( PREVIOUS_SHELF_BROWS.browser_normalized_isbn ) %]
+                                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% PREVIOUS_SHELF_BROWS.browser_normalized_isbn %]" />
+                                    [% ELSE %]
+                                        <span class="no-image">No cover image available</span>
+                                    [% END %]
+                                [% END %]
+                            </a>
+                        </td>
+                    [% END %]
+
+                    [% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %]
+                        <td>
+                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% NEXT_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% NEXT_SHELF_BROWS.itemnumber %]#shelfbrowser">
+                                [% IF ( OPACAmazonCoverImages ) %]
+                                    [% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
+                                        <img border="0" src="http://images.amazon.com/images/P/[% NEXT_SHELF_BROWS.browser_normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />
+                                    [% ELSE %]
+                                        <span class="no-image">No cover image available</span>
+                                    [% END %]
+                                [% END %]
+
+                                [% IF ( SyndeticsEnabled ) %]
+                                    [% IF ( SyndeticsCoverImages ) %]
+                                        [% IF ( content_identifier_exists ) %]
+                                            [% IF ( using_https ) %]
+                                                <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
+                                            [% ELSE %]
+                                                <img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% NEXT_SHELF_BROWS.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( NEXT_SHELF_BROWS.browser_normalized_upc ) %]&amp;upc=[% NEXT_SHELF_BROWS.browser_normalized_upc %][% END %][% IF ( NEXT_SHELF_BROWS.browser_normalized_oclc ) %]&amp;oclc=[% NEXT_SHELF_BROWS.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
+                                            [% END %]
+                                        [% ELSE %]
+                                            <span class="no-image">No cover image available</span>
+                                        [% END %]
+                                    [% END %]
+                                [% END %]
+
+                                [% IF ( GoogleJackets ) %]
+                                    [% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
+                                        <div style="block" title="[% NEXT_SHELF_BROWS.biblionumber |url %]" class="[% NEXT_SHELF_BROWS.browser_normalized_isbn %]" id="gbs-thumbnail-preview[% loop.count %]"></div>
+                                    [% ELSE %]
+                                        <span class="no-image">No cover image available</span>
+                                    [% END %]
+                                [% END %]
+                                [% IF ( BakerTaylorEnabled ) %]
+                                    [% IF ( NEXT_SHELF_BROWS.browser_normalized_isbn ) %]
+                                        <img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL |html %][% NEXT_SHELF_BROWS.browser_normalized_isbn %]" />
+                                    [% ELSE %]
+                                        <span class="no-image">No cover image available</span>
+                                    [% END %]
+                                [% END %]
+                            </a>
+                        </td>
+                    [% END %]
+
+                    <td rowspan="2">
+                        <div id="browser_next">
+                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% IF ( shelfbrowser_next_biblionumber ) %][% shelfbrowser_next_biblionumber %][% ELSE %][% biblionumber %][% END %]&amp;shelfbrowse_itemnumber=[% shelfbrowser_next_itemnumber %]#shelfbrowser">Next</a>
+                        </div>
+                    </td>
+                </tr>
+
+                <tr>
+                    [% FOREACH PREVIOUS_SHELF_BROWS IN PREVIOUS_SHELF_BROWSE %]
+                        <td class="top">
+                            [% PREVIOUS_SHELF_BROWS.itemcallnumber %]
+                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% PREVIOUS_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% PREVIOUS_SHELF_BROWS.itemnumber %]#shelfbrowser">[% PREVIOUS_SHELF_BROWS.title |html %]</a>
+                        </td>
+                    [% END %]
+
+                    [% FOREACH NEXT_SHELF_BROWS IN NEXT_SHELF_BROWSE %]
+                        <td class="top" style="width:20px;">
+                            [% NEXT_SHELF_BROWS.itemcallnumber %]
+                            <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% NEXT_SHELF_BROWS.biblionumber %]&amp;shelfbrowse_itemnumber=[% NEXT_SHELF_BROWS.itemnumber %]#shelfbrowser">[% NEXT_SHELF_BROWS.title |html %]</a>
+                        </td>
+                    [% END %]
+                </tr>
+            </table>
+        </div>
+    [% END %]
+[% END %][%# end of shelfbrowser block %]
index 6b1e365..f594ffc 100644 (file)
@@ -9,9 +9,9 @@
        <ol><li><label for="format">Download cart:</label>
         <select name="format" id="format">
         <option value="">-- Choose format --</option>
-           <option value="iso2709">iso2709</option>
-           <option value="ris">RIS</option>
-           <option value="bibtex">BibTex</option>
+        <option value="ris">RIS (Zotero, EndNote, others)</option>
+        <option value="bibtex">BibTeX</option>
+        <option value="iso2709">MARC</option>
            [% FOREACH csv_profile IN csv_profiles %]
            <option value="[% csv_profile.export_format_id %]">CSV - [% csv_profile.profile %]</option>
            [% END %]
index e3c9a21..5712c6a 100644 (file)
@@ -17,9 +17,9 @@
                <ol><li><label for="format">Download list:</label>
                <select name="format" id="format">
             <option value="">-- Choose format --</option>
-                   <option value="iso2709">iso2709</option>
-                   <option value="ris">RIS</option>
-                   <option value="bibtex">BibTex</option>
+            <option value="ris">RIS (Zotero, EndNote, others)</option>
+            <option value="bibtex">BibTeX</option>
+            <option value="iso2709">MARC</option>
                    [% FOREACH csv_profile IN csv_profiles %]
                    <option value="[% csv_profile.export_format_id %]">CSV - [% csv_profile.profile %]</option>
                    [% END %]
index 6b47afa..c37a6ef 100644 (file)
@@ -200,12 +200,15 @@ function showlayer(numlayer){
                    </td>
                    <td>    [% serial.serialseq %]
                    </td>
-                   <td>    [% IF ( serial.status1 ) %]Waiting[% END %]
-                       [% IF ( serial.status2 ) %]Arrived[% END %]
-                       [% IF ( serial.status3 ) %]Late[% END %]
-                       [% IF ( serial.status4 ) %]Missing[% END %]
-            [% IF ( serial.status5 ) %]Not available[% END %]
-                       [% IF ( serial.status7 ) %]Claimed[% END %]
+            <td>
+              [% IF ( serial.status1 ) %]Expected[% END %]
+              [% IF ( serial.status2 ) %]Arrived[% END %]
+              [% IF ( serial.status3 ) %]Late[% END %]
+              [% IF ( serial.status4 ) %]Missing[% END %]
+              [% IF ( serial.status5 ) %]Not available[% END %]
+              [% IF ( serial.status6 ) %]Delete[% END %]
+              [% IF ( serial.status7 ) %]Claimed[% END %]
+              [% IF ( serial.status8 ) %]Stopped[% END %]
                    </td>
                    <td class="subscriptionidfilterclass">    [% serial.subscriptionid %]
                    </td>
index cc67ff2..61235e6 100644 (file)
@@ -56,6 +56,9 @@
                <li><label for="password">Password:</label><input type="password" id="password" size="10" name="password" /></li>
                </ol>    <fieldset class="action">
         <input type="submit" value="Log In" class="submit" />
+
+        [% IF PatronSelfRegistration && PatronSelfRegistrationDefaultCategory %]<div id="patronregistration">Don't have an account? <a href="/cgi-bin/koha/opac-memberentry.pl">Register here.</a></div>[% END %]
+
         </fieldset></fieldset>
        </form>
        </div>
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry-update-submitted.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry-update-submitted.tt
new file mode 100644 (file)
index 0000000..21fe7de
--- /dev/null
@@ -0,0 +1,28 @@
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Updates submitted
+[% INCLUDE 'doc-head-close.inc' %]
+</head>
+<body id="opac-patron-update-submitted">
+<div id="doc3" class="yui-t1">
+   <div id="bd">
+[% INCLUDE 'masthead.inc' %]
+
+<div id="yui-main">
+    <div class="yui-b">
+        <div id="update-submitted" class="container">
+
+            <h3><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]'s account</a> &#8674; Updates to your record</h3>
+            <div class="dialog message">
+                <h3>Thank you</h3>
+                <p>Your updates have been submitted. A librarian will review your updates before applying them.</p>
+            </div>
+        </div>
+    </div>
+</div>
+<div class="yui-b">
+<div id="leftmenus" class="container">
+[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
+</div>
+</div>
+</div>
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-memberentry.tt
new file mode 100644 (file)
index 0000000..d41917c
--- /dev/null
@@ -0,0 +1,757 @@
+[% USE KohaDates %]
+[% SET userupdateview = 1 %]
+
+    [% INCLUDE 'doc-head-open.inc' %]
+        [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; [% IF action == 'edit' %]Update your personal details[% ELSE %]Register a new account[% END %]
+    [% INCLUDE 'doc-head-close.inc' %]
+
+    <script type="text/javascript">
+        //<![CDATA[
+        $(document).ready(function() {
+            [% IF action == 'edit' && !OPACPatronDetails %]
+                $("#memberentry-form :input").attr('readonly', true);
+                $("#borrower_branchcode").attr('disabled',true);
+                $("#borrower_title").attr('disabled',true);
+                $('#memberentry-form :radio').attr('disabled',true);
+                $('span.required').remove();
+                $('label.required').removeClass('required');
+            [% ELSE %]
+                $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
+            [% END %]
+        });
+    //]]>
+    </script>
+</head>
+[% IF action == 'edit' %]
+<body id="opac-patron-update">
+[% ELSE %]
+<body id="opac-patron-registration">
+[% END %]
+    <div id="doc3" class="yui-t1">
+        <div id="bd">
+            [% INCLUDE 'masthead.inc' %]
+
+            <div id="yui-main">
+                <div class="yui-b">
+                    <div class="yui-g">
+                        [% IF action == 'edit' %]
+                        <div id="update-account" class="container">
+                        [% ELSE %]
+                        <div id="add-account" class="container">
+                        [% END %]
+                        [% IF action == 'edit' %]
+                            <h3><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]'s account</a> &#8674; Personal details</h3>
+                        [% ELSE %]
+                            <h3>Register a new account</h3>
+                        [% END %]
+
+                            [% IF action == 'edit' %]
+                            [% UNLESS OPACPatronDetails %]
+                                <div class="dialog message">To make changes to your record please contact the library.</div>
+                            [% END %]
+                            [% END %]
+
+                            [% IF empty_mandatory_fields %]
+                                <div class="dialog alert">You have not filled out all required fields. Please fill in all missing fields and resubmit.</div>
+                            [% END %]
+
+                            [% IF failed_captcha %]
+                                <div class="dialog alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
+                            [% END %]
+
+                            <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form">
+
+                                [% UNLESS
+                                    hidden.defined('branchcode')
+                                %]
+
+                                <fieldset class="rows" id="memberentry_library">
+
+                                    <legend id="library_legend">Library</legend>
+                                        <ol>
+                                            [% UNLESS hidden.defined('branchcode') %]
+                                                <li>
+                                                    [% IF mandatory.defined('branchcode') %]
+                                                        <label for="borrower_branchcode" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_branchcode">
+                                                    [% END %]
+                                                    Home Library:</label>
+
+                                                    <select id="borrower_branchcode" name="borrower_branchcode">
+                                                        [% FOREACH b IN branches %]
+                                                            [% IF b.value == borrower.branchcode %]
+                                                                <option value="[% b.value %]" selected="selected">[% b.branchname %]</option>
+                                                            [% ELSE %]
+                                                                <option value="[% b.value %]">[% b.branchname %]</option>
+                                                            [% END %]
+                                                        [% END %]
+                                                    </select>
+                                                </li>
+                                            [% END %]
+                                        </ol>
+                                    </fieldset>
+                                [% END %]
+
+                                [% UNLESS
+                                    hidden.defined('title') && hidden.defined('surname') && hidden.defined('firstname') &&
+                                    hidden.defined('dateofbirth') && hidden.defined('initials') && hidden.defined('othernames') &&
+                                    hidden.defined('sex')
+                                %]
+                                    <fieldset class="rows" id="memberentry_identity">
+                                        <legend id="identity_legend">Identity</legend>
+
+                                        <ol>
+                                            [% UNLESS hidden.defined('title') %]
+                                                <li>
+                                                    [% IF mandatory.defined('title') %]
+                                                        <label for="borrower_title" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_title">
+                                                    [% END %]
+                                                    Salutation:</label>
+
+                                                    <select id="borrower_title" name="borrower_title">
+                                                        <option value="">&nbsp;</option>
+                                                        [% FOREACH mt IN member_titles %]
+                                                            [% IF mt == borrower.title %]
+                                                                <option value="[% mt %]" selected="selected">[% mt %]</option>
+                                                            [% ELSE %]
+                                                                <option value="[% mt %]">[% mt %]</option>
+                                                            [% END %]
+                                                        [% END %]
+                                                    </select>
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('surname') %]
+                                                <li>
+                                                    [% IF mandatory.defined('surname') %]
+                                                        <label for="borrower_surname" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_surname">
+                                                    [% END %]
+                                                    Surname:</label>
+
+                                                    <input type="text" id="borrower_surname" name="borrower_surname" value="[% borrower.surname %]" />
+                                                    [% IF mandatory.defined('surname') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('firstname') %]
+                                                <li>
+                                                    [% IF mandatory.defined('firstname') %]
+                                                        <label for="borrower_firstname" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_firstname">
+                                                    [% END %]
+                                                    First name:</label>
+
+                                                    <input type="text" id="borrower_firstname" name="borrower_firstname" value="[% borrower.firstname %]" />
+                                                    [% IF mandatory.defined('firstname') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('dateofbirth') %]
+                                                <li>
+                                                    [% IF mandatory.defined('dateofbirth') %]
+                                                        <label for="borrower_dateofbirth" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_dateofbirth">
+                                                    [% END %]
+                                                    Date of birth:</label>
+
+                                                    <input type="text" id="borrower_dateofbirth" name="borrower_dateofbirth" value="[% borrower.dateofbirth | $KohaDates %]" size="10" />
+
+                                                    [% UNLESS action == 'edit' && !OPACPatronDetails %]
+                                                        <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('borrower_dateofbirth').value='';return false;">Clear date</a><p></p>
+                                                    [% END %]
+
+                                                    [% IF mandatory.defined('dateofbirth') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('initials') %]
+                                                <li>
+                                                    [% IF mandatory.defined('initials') %]
+                                                        <label for="borrower_initials" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_initials">
+                                                    [% END %]
+                                                    Initials:</label>
+
+                                                    <input type="text" id="borrower_initials" name="borrower_initials" value="[% borrower.initials %]" />
+                                                    [% IF mandatory.defined('initials') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('othernames') %]
+                                                <li>
+                                                    [% IF mandatory.defined('othernames') %]
+                                                        <label for="borrower_othernames" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_othernames">
+                                                    [% END %]
+                                                    Other names:</label>
+
+                                                    <input type="text" id="borrower_othernames" name="borrower_othernames" value="[% borrower.othernames %]" />
+                                                    [% IF mandatory.defined('othernames') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('sex') %]
+                                                <li class="radio">
+                                                    <label for="sex-female">Female:</label>
+                                                    [% IF borrower.sex == 'F' %]
+                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" checked="checked" />
+                                                    [% ELSE %]
+                                                        <input type="radio" name="borrower_sex" id="sex-female" value="F" />
+                                                    [% END %]
+
+                                                    <label for="sex-male">Male:</label>
+                                                    [% IF borrower.sex == 'M' %]
+                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" checked="checked" />
+                                                    [% ELSE %]
+                                                        <input type="radio" name="borrower_sex" id="sex-male" value="M" />
+                                                    [% END %]
+
+                                                    <label for="sex-none">N/A:</label>
+                                                    [% IF borrower.sex == '' %]
+                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" checked="checked" />
+                                                    [% ELSE %]
+                                                        <input type="radio" name="borrower_sex" id="sex-none" value="" />
+                                                    [% END %]
+
+                                                    [% IF mandatory.defined('sex') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+                                        </ol>
+                                    </fieldset>
+                                [% END %]
+
+                                [% UNLESS
+                                    hidden.defined('streetnumber') && hidden.defined('address') && hidden.defined('address2') &&
+                                    hidden.defined('city') && hidden.defined('state') && hidden.defined('zipcode') &&
+                                    hidden.defined('country')
+                                %]
+                                    <fieldset class="rows" id="memberentry_mainaddress">
+                                        <legend id="mainaddress_legend">Main address</legend>
+
+                                        <ol>
+                                            [% UNLESS hidden.defined('streetnumber') %]
+                                                <li>
+                                                    [% IF mandatory.defined('streetnumber') %]
+                                                        <label for="borrower_streetnumber" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_streetnumber">
+                                                    [% END %]
+                                                    Street number:</label>
+
+                                                    <input type="text" id="borrower_streetnumber" name="borrower_streetnumber" value="[% borrower.streetnumber %]" />
+                                                    [% IF mandatory.defined('streetnumber') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('address') %]
+                                                <li>
+                                                    [% IF mandatory.defined('address') %]
+                                                        <label for="borrower_address" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_address">
+                                                    [% END %]
+                                                    Address:</label>
+
+                                                    <input type="text" id="borrower_address" name="borrower_address" value="[% borrower.address %]" />
+                                                    [% IF mandatory.defined('address') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('address2') %]
+                                                <li>
+                                                    [% IF mandatory.defined('address2') %]
+                                                        <label for="borrower_address2" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_address2">
+                                                    [% END %]
+                                                    Address 2:</label>
+
+                                                    <input type="text" id="borrower_address2" name="borrower_address2" value="[% borrower.address2 %]" />
+                                                    [% IF mandatory.defined('address2') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('city') %]
+                                                <li>
+                                                    [% IF mandatory.defined('city') %]
+                                                        <label for="borrower_city" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_city">
+                                                    [% END %]
+                                                    City:</label>
+
+                                                    <input type="text" id="borrower_city" name="borrower_city" value="[% borrower.city %]" />
+                                                    [% IF mandatory.defined('city') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('state') %]
+                                                <li>
+                                                    [% IF mandatory.defined('state') %]
+                                                        <label for="borrower_state" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_state">
+                                                    [% END %]
+                                                    State:</label>
+
+                                                    <input type="text" id="borrower_state" name="borrower_state" value="[% borrower.state %]" />
+                                                    [% IF mandatory.defined('state') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('zipcode') %]
+                                                <li>
+                                                    [% IF mandatory.defined('zipcode') %]
+                                                        <label for="borrower_zipcode" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_zipcode">
+                                                    [% END %]
+                                                    Zip/Postal code:</label>
+
+                                                    <input type="text" id="borrower_zipcode" name="borrower_zipcode" value="[% borrower.zipcode %]" />
+                                                    [% IF mandatory.defined('zipcode') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('country') %]
+                                                <li>
+                                                    [% IF mandatory.defined('country') %]
+                                                        <label for="borrower_country" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_country">
+                                                    [% END %]
+                                                    Country:</label>
+
+                                                    <input type="text" id="borrower_country" name="borrower_country" value="[% borrower.country %]" />
+                                                    [% IF mandatory.defined('country') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                        </ol>
+                                    </fieldset>
+                                [% END %]
+
+                                [% UNLESS
+                                    hidden.defined('phone') && hidden.defined('phonepro') && hidden.defined('mobile') &&
+                                    hidden.defined('email') && hidden.defined('emailpro') && hidden.defined('fax')
+                                %]
+                                    <fieldset class="rows" id="memberentry_contact">
+                                        <legend id="contact_legend">Contact information</legend>
+
+                                        <ol>
+                                            [% UNLESS hidden.defined('phone') %]
+                                                <li>
+                                                    [% IF mandatory.defined('phone') %]
+                                                        <label for="borrower_phone" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_phone">
+                                                    [% END %]
+                                                    Primary phone:</label>
+
+                                                    <input type="text" id="borrower_phone" name="borrower_phone" value="[% borrower.phone %]" />
+                                                    [% IF mandatory.defined('phone') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('phonepro') %]
+                                                <li>
+                                                    [% IF mandatory.defined('phonepro') %]
+                                                        <label for="borrower_phonepro" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_phonepro">
+                                                    [% END %]
+                                                    Secondary phone:</label>
+
+                                                    <input type="text" id="borrower_phonepro" name="borrower_phonepro" value="[% borrower.phonepro %]" />
+                                                    [% IF mandatory.defined('phonepro') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('mobile') %]
+                                                <li>
+                                                    [% IF mandatory.defined('mobile') %]
+                                                        <label for="borrower_mobile" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_mobile">
+                                                    [% END %]
+                                                    Mobile phone:</label>
+
+                                                    <input type="text" id="borrower_mobile" name="borrower_mobile" value="[% borrower.mobile %]" />
+                                                    [% IF mandatory.defined('mobile') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('email') %]
+                                                <li>
+                                                    [% IF mandatory.defined('email') %]
+                                                        <label for="borrower_email" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_email">
+                                                    [% END %]
+                                                    Primary email:</label>
+
+                                                    <input type="text" id="borrower_email" name="borrower_email" value="[% borrower.email %]" />
+                                                    [% IF mandatory.defined('email') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('emailpro') %]
+                                                <li>
+                                                    [% IF mandatory.defined('emailpro') %]
+                                                        <label for="borrower_emailpro" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_emailpro">
+                                                    [% END %]
+                                                    Secondary email:</label>
+
+                                                    <input type="text" id="borrower_emailpro" name="borrower_emailpro" value="[% borrower.emailpro %]" />
+                                                    [% IF mandatory.defined('emailpro') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('fax') %]
+                                                <li>
+                                                    [% IF mandatory.defined('fax') %]
+                                                        <label for="borrower_fax" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_fax">
+                                                    [% END %]
+                                                    Fax:</label>
+
+                                                    <input type="text" id="borrower_fax" name="borrower_fax" value="[% borrower.fax %]" />
+                                                    [% IF mandatory.defined('fax') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+                                        </ol>
+                                    </fieldset>
+                                [% END %]
+
+                                [% UNLESS
+                                    hidden.defined('B_address') && hidden.defined('B_address2') && hidden.defined('B_city') &&
+                                    hidden.defined('B_state') && hidden.defined('B_zipcode') && hidden.defined('B_county') &&
+                                    hidden.defined('B_phone') && hidden.defined('B_email') && hidden.defined('contactnote')
+                                %]
+                                    <fieldset class="rows" id="memberentry_alternateaddress">
+                                        <legend id="alternateaddress_legend">Alternate address</legend>
+
+                                        <ol>
+                                            [% UNLESS hidden.defined('B_address') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_address') %]
+                                                        <label for="borrower_B_address" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_address">
+                                                    [% END %]
+                                                    Address:</label>
+
+                                                    <input type="text" id="borrower_B_address" name="borrower_B_address" value="[% borrower.B_address %]" />
+                                                    [% IF mandatory.defined('B_address') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('B_address2') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_address2') %]
+                                                        <label for="borrower_B_address2" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_address2">
+                                                    [% END %]
+                                                    Address 2:</label>
+
+                                                    <input type="text" id="borrower_B_address2" name="borrower_B_address2" value="[% borrower.B_address2 %]" />
+                                                    [% IF mandatory.defined('B_address2') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('B_city') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_city') %]
+                                                        <label for="borrower_B_city" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_city">
+                                                    [% END %]
+                                                    City:</label>
+
+                                                    <input type="text" id="borrower_B_city" name="borrower_B_city" value="[% borrower.B_city %]" />
+                                                    [% IF mandatory.defined('B_city') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('B_state') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_state') %]
+                                                        <label for="borrower_B_state" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_state">
+                                                    [% END %]
+                                                    State:</label>
+
+                                                    <input type="text" id="borrower_B_state" name="borrower_B_state" value="[% borrower.B_state %]" />
+                                                    [% IF mandatory.defined('B_state') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('B_zipcode') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_zipcode') %]
+                                                        <label for="borrower_B_zipcode" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_zipcode">
+                                                    [% END %]
+                                                    Zip/Postal code:</label>
+
+                                                    <input type="text" id="borrower_B_zipcode" name="borrower_B_zipcode" value="[% borrower.B_zipcode %]" />
+                                                    [% IF mandatory.defined('B_zipcode') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('B_country') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_country') %]
+                                                        <label for="borrower_B_country" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_country">
+                                                    [% END %]
+                                                    Country:</label>
+
+                                                    <input type="text" id="borrower_B_country" name="borrower_B_country" value="[% borrower.B_country %]" />
+                                                    [% IF mandatory.defined('B_country') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('B_phone') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_phone') %]
+                                                        <label for="borrower_B_phone" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_phone">
+                                                    [% END %]
+                                                    Phone:</label>
+
+                                                    <input type="text" id="borrower_B_phone" name="borrower_B_phone" value="[% borrower.B_phone %]" />
+                                                    [% IF mandatory.defined('B_phone') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('B_email') %]
+                                                <li>
+                                                    [% IF mandatory.defined('B_email') %]
+                                                        <label for="borrower_B_email" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_B_email">
+                                                    [% END %]
+                                                    Email:</label>
+
+                                                    <input type="text" id="borrower_B_email" name="borrower_B_email" value="[% borrower.B_email %]" />
+                                                    [% IF mandatory.defined('B_email') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('contactnote') %]
+                                                <li>
+                                                    [% IF mandatory.defined('contactnote') %]
+                                                        <label for="borrower_contactnote" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_contactnote">
+                                                    [% END %]
+                                                    Contact Note:</label>
+
+                                                    <textarea id="borrower_contactnote" name="borrower_contactnote" cols="40" rows="2">[% borrower.contactnote %]</textarea>
+                                                    [% IF mandatory.defined('contactnote') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                        </ol>
+                                    </fieldset>
+                                [% END %]
+
+                                [% UNLESS
+                                    hidden.defined('altcontactsurname') && hidden.defined('altcontactfirstname') && hidden.defined('altcontactaddress1') &&
+                                    hidden.defined('altcontactaddress2') && hidden.defined('altcontactaddress3') && hidden.defined('altcontactstate') &&
+                                    hidden.defined('altcontactzipcode') && hidden.defined('altcontactcountry') && hidden.defined('altcontactphone')
+                                %]
+                                    <fieldset class="rows" id="memberentry_alternatecontact">
+                                        <legend id="alternatecontact_legend">Alternate contact</legend>
+
+                                        <ol>
+                                            [% UNLESS hidden.defined('altcontactsurname') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactsurname') %]
+                                                        <label for="borrower_altcontactsurname" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactsurname">
+                                                    [% END %]
+                                                    Surname:</label>
+
+                                                    <input type="text" id="borrower_altcontactsurname" name="borrower_altcontactsurname" value="[% borrower.altcontactsurname %]" />
+                                                    [% IF mandatory.defined('altcontactsurname') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactfirstname') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactfirstname') %]
+                                                        <label for="borrower_altcontactfirstname" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactfirstname">
+                                                    [% END %]
+                                                    First name:</label>
+
+                                                    <input type="text" id="borrower_altcontactfirstname" name="borrower_altcontactfirstname" value="[% borrower.altcontactfirstname %]" />
+                                                    [% IF mandatory.defined('altcontactfirstname') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactaddress1') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactaddress1') %]
+                                                        <label for="borrower_altcontactaddress1" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactaddress1">
+                                                    [% END %]
+                                                    Address:</label>
+
+                                                    <input type="text" id="borrower_altcontactaddress1" name="borrower_altcontactaddress1" value="[% borrower.altcontactaddress1 %]" />
+                                                    [% IF mandatory.defined('altcontactaddress1') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactaddress2') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactaddress2') %]
+                                                        <label for="borrower_altcontactaddress2" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactaddress2">
+                                                    [% END %]
+                                                    Address 2:</label>
+
+                                                    <input type="text" id="borrower_altcontactaddress2" name="borrower_altcontactaddress2" value="[% borrower.altcontactaddress2 %]" />
+                                                    [% IF mandatory.defined('altcontactaddress2') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactaddress3') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactaddress3') %]
+                                                        <label for="borrower_altcontactaddress3" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactaddress3">
+                                                    [% END %]
+                                                    City:</label>
+
+                                                    <input type="text" id="borrower_altcontactaddress3" name="borrower_altcontactaddress3" value="[% borrower.altcontactaddress3 %]" />
+                                                    [% IF mandatory.defined('altcontactaddress3') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactstate') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactstate') %]
+                                                        <label for="borrower_altcontactstate" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactstate">
+                                                    [% END %]
+                                                    State:</label>
+
+                                                    <input type="text" id="borrower_altcontactstate" name="borrower_altcontactstate" value="[% borrower.altcontactstate %]" />
+                                                    [% IF mandatory.defined('altcontactstate') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactzipcode') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactzipcode') %]
+                                                        <label for="borrower_altcontactzipcode" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactzipcode">
+                                                    [% END %]
+                                                    Zip/Postal code:</label>
+
+                                                    <input type="text" id="borrower_altcontactzipcode" name="borrower_altcontactzipcode" value="[% borrower.altcontactzipcode %]" />
+                                                    [% IF mandatory.defined('altcontactzipcode') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactcountry') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactcountry') %]
+                                                        <label for="borrower_altcontactcountry" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactcountry">
+                                                    [% END %]
+                                                    Country:</label>
+
+                                                    <input type="text" id="borrower_altcontactcountry" name="borrower_altcontactcountry" value="[% borrower.altcontactcountry %]" />
+                                                    [% IF mandatory.defined('altcontactcountry') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+
+                                            [% UNLESS hidden.defined('altcontactphone') %]
+                                                <li>
+                                                    [% IF mandatory.defined('altcontactphone') %]
+                                                        <label for="borrower_altcontactphone" class="required">
+                                                    [% ELSE %]
+                                                        <label for="borrower_altcontactphone">
+                                                    [% END %]
+                                                    Phone:</label>
+
+                                                    <input type="text" id="borrower_altcontactphone" name="borrower_altcontactphone" value="[% borrower.altcontactphone %]" />
+                                                    [% IF mandatory.defined('altcontactphone') %]<span class="required">Required</span>[% END %]
+                                                </li>
+                                            [% END %]
+                                        </ol>
+                                    </fieldset>
+                                [% END %]
+
+                                [% UNLESS action == 'edit' %]
+                                    <fieldset class="rows" id="memberentry_captcha">
+                                        <ol>
+                                            <li>
+                                                <label for="captcha" class="required">Verification:</label>
+
+                                                <input type="text" name="captcha" id="captcha" />
+                                                <input type="hidden" name="captcha_digest" value="[% captcha_digest %]" />
+
+                                                <span class="hint">Please type this following characters into the preceding box: <strong>[% captcha %]</strong></span>
+                                            </li>
+                                        </ol>
+                                    </fieldset>
+                                [% END %]
+
+                                [% IF action == 'edit' %]
+                                    [% IF OPACPatronDetails %]
+                                        <fieldset class="action">
+                                            <input type="hidden" name="action" value="update" />
+                                            <input type="submit" value="Submit update request" />
+                                        </fieldset>
+                                    [% END %]
+                                [% ELSE %]
+                                    <fieldset class="action">
+                                        <input type="hidden" name="action" value="create" />
+                                        <input type="submit" value="Submit" />
+                                    </fieldset>
+                                [% END %]
+
+                            </form>
+
+                        </div><!--/div id="update-account" -->
+                    </div>
+                </div>
+            </div>
+
+            <div class="yui-b">
+                <div id="leftmenus" class="container">
+                    [% INCLUDE 'navigation.inc' IsPatronPage=1 %]
+                </div>
+            </div>
+        </div>
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-confirmation.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-confirmation.tt
new file mode 100644 (file)
index 0000000..968faa0
--- /dev/null
@@ -0,0 +1,70 @@
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
+[% INCLUDE 'doc-head-close.inc' %]
+</head>
+<body id="opac-main">
+[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
+   <div id="bd">
+[% INCLUDE 'masthead.inc' %]
+
+<div id="yui-main">
+    <div class="yui-b">
+        <div id="loggedin" class="yui-ge">
+            <div class="yui-u first">
+                <h1>Registration Complete!</h1>
+
+                <p>You have successfully registered your new account. To log in, use the following credentials:</p>
+
+                <p>
+                    Username: [% borrower.userid %]
+                    <br/>
+                    Password: [% password_cleartext %]
+                </p>
+
+                <p>For your convenience, the login box on this page has been pre-filled with this data. Please log in[% IF OpacPasswordChange %] and change your password[% END %].</p>
+
+                <div id="PatronSelfRegistrationAdditionalInstructions">[% PatronSelfRegistrationAdditionalInstructions %]</div>
+            </div>
+
+            [% IF ( opacuserlogin || OpacNavRight ) %]
+                <div class="yui-u">
+                    [% IF ( opacuserlogin ) %]
+                        [% UNLESS ( loggedinusername ) %]
+                            [% UNLESS ( casAuthentication ) %]
+                                <div id="login" class="container clearfix">
+                                    <form action="/cgi-bin/koha/opac-user.pl" method="post" name="auth" id="auth">
+                                        <input type="hidden" name="koha_login_context" value="opac" />
+
+                                        <fieldset class="brief">
+                                            <legend>Log in to your account:</legend>
+
+                                            <ol>
+                                                <li><label for="userid">Login:</label><input type="text" id="userid" size="10" name="userid" value="[% borrower.userid %]" /></li>
+                                                <li><label for="password">Password:</label><input type="password" id="password" size="10" name="password" value="[% password_cleartext %]" /></li>
+                                            </ol>
+
+                                            <fieldset class="action">
+                                                <input type="submit" value="Log In" class="submit" />
+                                            </fieldset>
+                                        </fieldset>
+                                    </form>
+                                </div>
+                            [% END %]
+                        [% END %]
+                    [% END %]
+
+                    [% IF ( OpacNavRight ) %]<div id="opacrightsidebar" class="container">[% OpacNavRight %]</div>[% END %]
+                </div>
+            [% END %]
+        </div>
+    </div>
+</div>
+
+[% IF ( OpacNav ) %]<div class="yui-b">
+    <div id="opacnav" class="container">
+        [% INCLUDE 'navigation.inc' %]
+    </div>
+[% END %]
+
+</div>
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-email-sent.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-email-sent.tt
new file mode 100644 (file)
index 0000000..649e999
--- /dev/null
@@ -0,0 +1,28 @@
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Please confirm your registration
+[% INCLUDE 'doc-head-close.inc' %]
+</head>
+<body id="opac-confirmation-pending">
+[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
+   <div id="bd">
+[% INCLUDE 'masthead.inc' %]
+
+<div id="yui-main">
+    <div class="yui-b">
+        <div id="confirmation-pending" class="dialog message">
+            <h1>Please confirm your registration</h1>
+
+                        <p>A confirmation email has been sent to the email address <strong>[% email %]</strong>.</p>
+
+                        <p>Your account will not be activated until you follow the link provided in the confirmation email.</p></div>
+        </div>
+</div>
+
+[% IF ( OpacNav ) %]<div class="yui-b">
+    <div id="opacnav" class="container">
+        [% INCLUDE 'navigation.inc' %]
+    </div>
+[% END %]
+
+</div>
+[% INCLUDE 'opac-bottom.inc' %]
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-invalid.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-registration-invalid.tt
new file mode 100644 (file)
index 0000000..12dac1d
--- /dev/null
@@ -0,0 +1,30 @@
+[% INCLUDE 'doc-head-open.inc' %]
+[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog
+[% INCLUDE 'doc-head-close.inc' %]
+</head>
+<body id="opac-main">
+[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
+   <div id="bd">
+[% INCLUDE 'masthead.inc' %]
+
+<div id="yui-main">
+    <div class="yui-b">
+        <div id="loggedin" class="yui-ge">
+            <div class="yui-u first">
+                <h1>Registration invalid!</h1>
+
+                <p>There were problems processing your registration. Please contact your library for help.</p>
+
+            </div>
+        </div>
+    </div>
+</div>
+
+[% IF ( OpacNav ) %]<div class="yui-b">
+    <div id="opacnav" class="container">
+        [% INCLUDE 'navigation.inc' %]
+    </div>
+[% END %]
+
+</div>
+[% INCLUDE 'opac-bottom.inc' %]
index 8096baf..53ccbbf 100644 (file)
@@ -1,5 +1,6 @@
 [% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo;  Placing a hold
 [% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'calendar.inc' %]
 <script type="text/javascript">
 // <![CDATA[
  var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
                           [% UNLESS ( bibitemloo.bib_available ) %]
                             <div class="bibmessage">No available items.</div>
                           [% ELSE %]
-                            <div class="bibmessage">This title cannot be requested.</div>
+                            [% IF ( bibitemloo.already_patron_possession ) %]
+                                <div class="bibmessage">This title cannot be requested because it's already in your possession.</div>
+                            [% ELSE %]
+                                <div class="bibmessage">This title cannot be requested.</div>
+                            [% END %]
                           [% END %]
                         [% END %]
 
index 197ac5d..8f31917 100644 (file)
@@ -485,9 +485,10 @@ $(function() {
                       <li>
                         <label for="sortfield" >Sort this list by: </label>
                         <select name="sortfield" id="sortfield">
-                          [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
-                          [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
-                          [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
+                          [% IF ( sortfield == "title" ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
+                          [% IF ( sortfield == "author" ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
+                          [% IF ( sortfield == "copyrightdate" ) %]<option value="copyrightdate" selected="selected">Year</option>[% ELSE %]<option value="copyrightdate">Year</option>[% END %]
+                          [% IF ( sortfield == "itemcallnumber" ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
                         </select>
                       </li>
                       <li>
@@ -674,9 +675,10 @@ $(function() {
                       <li>
                         <label for="sortfield" >Sort this list by: </label>
                         <select name="sortfield" id="sortfield">
-                          [% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
-                          [% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
-                          [% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
+                          <option value="title">Title</option>
+                          <option value="author">Author</option>
+                          <option value="copyrightdate">Year</option>
+                          <option value="itemcallnumber">Call number</option>
                         </select>
                       </li>
                       <li>
index 43b8329..c28d84f 100644 (file)
@@ -3,6 +3,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 [% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home
 [% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'calendar.inc' %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.metadata.min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/JavaScript">
index 32b4f56..f2fa3a9 100644 (file)
@@ -6,6 +6,9 @@
 <link rel="stylesheet" type="text/css" href="[% yuipath %]/reset-fonts-grids.css" />
 <link rel="stylesheet" type="text/css" href="[% yuipath %]/skin.css" />
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/sco.css" />
+[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %]
+
+[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
 </head>
 <body>
 <div id="doc" class="yui-t7">
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/sco/printslip.tt b/koha-tmpl/opac-tmpl/prog/en/modules/sco/printslip.tt
new file mode 100644 (file)
index 0000000..eaa0d30
--- /dev/null
@@ -0,0 +1,26 @@
+[% INCLUDE 'doc-head-open.inc' %]
+<title>[% title %]</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/print.css" />
+[% IF stylesheet %]
+<link rel="stylesheet" type="text/css" href="[% stylesheet %]" />
+[% END %]
+
+<script language="javascript">
+    function printThenClose() {
+        window.print();
+        window.close();
+    }
+</script>
+</head>
+<body id="circ_printslip" class="circ" onload="printThenClose();">
+<div id="receipt">
+
+[% IF plain %]
+<pre>
+[% slip %]
+</pre>
+[% ELSE %]
+[% slip %]
+[% END %]
index 8178412..7e363d2 100644 (file)
@@ -26,6 +26,8 @@ function closeNow()
 }
 </script> 
 
+[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %]
+[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
 
 </head>
 
index 66cace5..5441ccf 100644 (file)
@@ -8,18 +8,22 @@
 <script type="text/javascript" src="[% yuipath %]/container/container-min.js"></script>
 <script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery-ui.js"></script>
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
 <script type="text/javascript">//<![CDATA[
-function sco_init(valid_session) {
-    if (valid_session == 1) {
-        setTimeout("location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';",[% SelfCheckTimeout %]); 
-    }
+function sco_init() {
+    setTimeout("location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';",[% SelfCheckTimeout %]);
 }
 function dofocus() {    // named function req'd for body onload event by some FF and IE7 security models
     // alert("dofocus called");
     $(".focus:last").select();
 }
+var slip_re = /slip/;
+function printx_window(print_type) {
+  var handler = print_type.match(slip_re) ? "printslip" : "moremember";
 
+  return false;
+}
 function checkout_confirm(patronid) {
     var   barcode = $("#barcode").val();
     // alert("checkout_confirm('" + patronid + "') called for barcode '" + barcode + "'");
@@ -28,13 +32,6 @@ function checkout_confirm(patronid) {
         window.location.href='/cgi-bin/koha/sco/sco-main.pl?op=logout';
         return false;
     }
-    if (this.valid_session == 0) {
-        // probably should force logout like above ? --atz 6/09
-        if (confirm('Session has expired.  Click \'OK\' to continue processing this item.  Click Cancel if you are not ' + patronid)){
-            this.op.value='logout';
-            this.patronid.value='';
-        }
-    }
     return true;
 }
 
@@ -75,9 +72,8 @@ $.tablesorter.addParser({
 });
 
 $(document).ready(function() {
-    [% IF ( patronid ) %] sco_init(1);
-    [% ELSIF ( timedout ) %] sco_init(1);
-    [% END %]
+    dofocus();
+    [% IF ( patronid ) %]sco_init();[% END %]
     $("#loanTable").tablesorter({
         [% IF ( dateformat_metric ) %]
             dateFormat: 'uk',
@@ -92,15 +88,23 @@ $(document).ready(function() {
     });
 });
 //]]>
-
+$(document).ready(function(){
+    $("#logout_form").submit(function(){
+        if(confirm("Would you like to print a receipt?")){
+            window.open("/cgi-bin/koha/sco/printslip.pl?borrowernumber=[% borrowernumber %]&amp;print=qslip");
+        }
+        return true;
+    });
+});
 </script>
 [% IF ( opacuserjs ) %]<script type="text/javascript">[% opacuserjs %]</script>[% END %]
-
+[% IF ( SCOUserJS ) %]<script type="text/javascript">[% SCOUserJS %]</script>[% END %]
 
 <link rel="stylesheet" type="text/css" href="[% yuipath %]/reset-fonts-grids.css" />
 <link rel="stylesheet" type="text/css" href="[% yuipath %]/skin.css" />
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/sco.css" />
 [% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
+[% IF ( SCOUserCSS ) %]<style type="text/css">[% SCOUserCSS %]</style>[% END %]
 
 </head>
 <body onload="dofocus();">
@@ -111,13 +115,13 @@ $(document).ready(function() {
 <div id="bd">
 
 [% IF ( impossible ) %]<!-- We tried to issue, but failed. -->
-<div class="dialog alert"><h3>Item cannot be checked out.</h3><p>Sorry, This item cannot be checked out at this station.  </p>
+<div class="dialog alert"><h3>Item cannot be checked out.</h3><p>Sorry, this item cannot be checked out at this station.  </p>
 [% IF ( title ) %]<p>Title: <em>[% title |html %]</em> </p>[% END %]
 <p>
    [% IF ( circ_error_UNKNOWN_BARCODE ) %]
     <em>MESSAGE 1:</em> The system does not recognize this barcode.
-   [% ELSIF ( circ_error_TOO_MANY ) %]
-    <em>MESSAGE 2:</em> You have borrowed too many items and can't check out any more.
+   [% ELSIF ( circ_error_max_loans_allowed ) %]
+    <em>MESSAGE 2:</em> You have checked out too many items and can't check out any more.
    [% ELSIF ( circ_error_ISSUED_TO_ANOTHER ) %]
     <em>MESSAGE 3:</em> This item is checked out to someone else.
    [% ELSIF ( circ_error_NO_MORE_RENEWALS ) %]
@@ -125,13 +129,13 @@ $(document).ready(function() {
    [% ELSIF ( circ_error_NOT_FOR_LOAN ) %]
     <em>MESSAGE 5:</em> This item is not for loan.
    [% ELSIF ( circ_error_DEBT ) %]
-    <em>MESSAGE 6:</em> You owe the library [% amount %] and cannot borrow.
+    <em>MESSAGE 6:</em> You owe the library [% amount %] and cannot check out.
    [% ELSIF ( circ_error_WTHDRAWN ) %]
     <em>MESSAGE 7:</em> This item has been withdrawn from the collection.
    [% ELSIF ( circ_error_RESTRICTED ) %]
     <em>MESSAGE 8:</em>
    [% ELSIF ( circ_error_RESERVED ) %]
-    <em>MESSAGE 9:</em> This item is reserved for another patron.
+    <em>MESSAGE 9:</em> This item is on hold for another patron.
    [% ELSIF ( circ_error_ITEMNOTSAMEBRANCH ) %]
     <em>MESSAGE 10:</em>
    [% ELSIF ( circ_error_EXPIRED ) %]
@@ -147,44 +151,67 @@ $(document).ready(function() {
    [% END %]
    Please see a member of the library staff.
 </p>
-<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" method="post">
-<input type="hidden" name="op" value="login" />
-<input type="hidden" name="patronid" value="[% patronid %]" />
 [% IF ( returnitem ) %]
 [% IF ( AllowSelfCheckReturns ) %]
-<input type="hidden" name="barcode" value="[% barcode %]" />
-<input type="button" name="returnbook" value="Return this item" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
+<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
+    <input type="hidden" name="op" value="returnbook" />
+    <input type="hidden" name="patronid" value="[% patronid %]" />
+    <input type="hidden" name="barcode" value="[% barcode %]" />
+    <input type="submit" name="returnbook" value="Return this item" class="return" />
+</form>
 [% END %]
 [% END %]
-<input type="submit" name= "confirm" value="Return to Account Summary" class="back focus" />
+<form action="/cgi-bin/koha/sco/sco-main.pl" name="errorForm" class="inline" method="post">
+    <input type="hidden" name="op" value="" />
+    <input type="hidden" name="patronid" value="[% patronid %]" />
+    <input type="hidden" name="barcode" value="[% barcode %]" />
+    <input type="submit" name= "confirm" value="Return to account summary" class="back focus" />
 </form>
 [% END %]
 [% IF ( confirm ) %]<!-- We need to confirm the issue.. -->
 <div class="dialog alert"><h3>Please confirm the checkout:</h3>
 <p>[% IF ( confirm_renew_issue ) %]This item is already checked out to you.[% END %]</p>
 
-<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" method="post">
-<input type="hidden" name="op" value="checkout" />
-<input type="hidden" name="patronid" value="[% patronid %]" />
-<input type="hidden" name="barcode" value="[% barcode %]" />
-<input type="hidden" name="confirmed" value="" />
 [% IF ( renew ) %]
 [% IF ( AllowSelfCheckReturns ) %]
-<input type="button" value="Return item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
+    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
+        <input type="hidden" name="op" value="returnbook" />
+        <input type="hidden" name="patronid" value="[% patronid %]" />
+        <input type="hidden" name="barcode" value="[% barcode %]" />
+        <input type="hidden" name="confirmed" value="" />
+        <input type="submit" value="Return item" name="confirm" class="return" />
+    </form>
 [% END %]
 [% END %]
-[% UNLESS ( renew ) %]<input type="button" value="Renew item" name="confirm" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
-[% ELSE %]<input type="button" value="Renew item" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />[% END %]
-<input type="button" value="Cancel" class="cancel" onclick="this.form.op.value='';this.form.submit();return true;"  />
-</form>
+
+[% UNLESS ( renew ) %]
+    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
+        <input type="hidden" name="op" value="checkout" />
+        <input type="hidden" name="patronid" value="[% patronid %]" />
+        <input type="hidden" name="barcode" value="[% barcode %]" />
+        <input type="hidden" name="confirmed" value="1" />
+        <input type="submit" value="Renew item" name="confirm" class="renew" />
+      </form>
+[% ELSE %]
+    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
+        <input type="hidden" name="op" value="checkout" />
+        <input type="hidden" name="patronid" value="[% patronid %]" />
+        <input type="hidden" name="barcode" value="[% barcode %]" />
+        <input type="hidden" name="confirmed" value="1" />
+        <input type="submit" value="Renew item" class="renew" />
+    </form>
+[% END %]
+    <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
+      <input type="hidden" name="op" value="" />
+      <input type="hidden" name="patronid" value="[% patronid %]" />
+      <input type="submit" value="Cancel" class="cancel" />
+    </form>
 </div>
 [% END %]
 
 [% IF ( nopermission ) %]<!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Access denied</h3>
 Sorry, this self-checkout station has lost authentication.  Please contact the administrator to resolve this problem. </div>
 [% END %]
-[% IF ( timed_out ) %]<!-- This is what is displayed if login has timed out -->
-<div class="dialog alert"><h3>Session timed out</h3>Sorry, your session has timed out, please log in again.</div>[% END %]
 [% IF ( different_ip ) %]<!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Session lost</h3>You are accessing self-checkout from a different IP address! please log in again.</div>[% END %]
 [% IF ( invalid_username_or_password ) %]
 <!-- This is what is displayed if user doesnt have permission --><div class="dialog alert"><h3>Record not found</h3><p>Your userid was not found in the database.  Please try again.</p></div>[% END %]
@@ -211,23 +238,18 @@ Sorry, this self-checkout station has lost authentication.  Please contact the a
        [% END %]
        [% END %]
 
-       [% IF ( timedout ) %]
-       <div class="dialog message"><h4>Sorry</h4><p>Your session has timed out due to inactivity.  Please sign in.</p></div>
-       <br />
-       [% END %]
        [% IF ( validuser ) %]
   [% IF ( display_patron_image ) %]<div class="yui-ge"><div class="yui-u first">[% END %]
        <div id="newcheckout" class="sco_entry">
        <form id="scan_form" name="scan_form" method="post" action="/cgi-bin/koha/sco/sco-main.pl" onsubmit="return checkout_confirm('[% patronid %]');">
        <fieldset><legend> Check out[% IF ( AllowSelfCheckReturns ) %], return[% END %] or renew an item: </legend>
        <label for="barcode">Scan a new item or enter its barcode:</label>
-       <input id="barcode" name="barcode" size="20" class="focus" />
+    <input id="barcode" name="barcode" size="20" class="focus" autocomplete="off" />
        <input type="hidden" name="op" value="checkout" />
        <input type="hidden" name="patronid" value="[% patronid %]" />
-       <input type="hidden" name="valid_session" value="1" />
        <input type="submit" value="Submit" class="submit" /></fieldset>
        </form>
-       <div><form method="post" action="/cgi-bin/koha/sco/sco-main.pl?op=logout" ><input type="submit" value="Finish" class="finish" /></form></div>
+    <div><form method="post" action="#" id="logout_form"><input type="submit" value="Finish" class="finish" /></form></div>
        </div> <!-- sco_entry --> <!-- newcheckout -->
   [% IF ( display_patron_image ) %]</div> <!-- /yui-u first -->[% END %]
   [% IF ( display_patron_image ) %]
@@ -255,19 +277,21 @@ Sorry, this self-checkout station has lost authentication.  Please contact the a
        [% IF ( ISSUE.overdue ) %]<td class="overdue">[% ISSUE.date_due | $KohaDates %]</td>[% ELSE %]<td>[% ISSUE.date_due | $KohaDates %]</td>[% END %]
        <td>
     <form action="/cgi-bin/koha/sco/sco-main.pl" method="post">
-    <input type="hidden" name="op" value="checkout" />
     <input type="hidden" name="patronid" value="[% patronid %]" />
     <input type="hidden" name="barcode" value="[% ISSUE.barcode %]" />
-    <input type="hidden" name="confirmed" value=""  />
         [% IF ( ISSUE.norenew ) %]
-          [% IF ( ISSUE.AllowSelfCheckReturns ) %]
-          <input type="button" value="Return Item" name="confirm" class="return" onclick="this.form.op.value='returnbook';this.form.submit();"  />
+          [% IF ( AllowSelfCheckReturns ) %]
+            <input type="submit" value="Check in item" name="confirm" class="return" />
+            <input type="hidden" name="op" value="returnbook" />
+            <input type="hidden" name="confirmed" value=""  />
           [% ELSE %]
-          <span>No renewals allowed</span>
+            <span>No renewals allowed</span>
           [% END %]
         [% ELSE %]
-            [% UNLESS ( ISSUE.renew ) %]<input type="button" value="Renew Item"  name="confirm" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />
-            [% ELSE %]<input type="button" value="Renew Item" class="renew" onclick="this.form.confirmed.value='1';this.form.submit();" />[% END %]
+            <input type="hidden" name="op" value="checkout" />
+            <input type="hidden" name="confirmed" value="1" />
+            [% UNLESS ( ISSUE.renew ) %]<input type="submit" value="Renew item"  name="confirm" class="renew" />
+            [% ELSE %]<input type="submit" value="Renew item" class="renew" />[% END %]
         [% END %]
     </form>
        </td>
@@ -292,7 +316,7 @@ Sorry, this self-checkout station has lost authentication.  Please contact the a
        <input type="password" id="patronpw" size="20" name="patronpw" />
        [% ELSE %]
        <fieldset class="checkout"><label for="patronid">Please enter your card number:</label> 
-       <input type="text" id="patronid" class="focus" size="20" name="patronid" />
+    <input type="text" id="patronid" class="focus" size="20" name="patronid" autocomplete="off" />
        [% END %]
 
        [% FOREACH INPUT IN INPUTS %]<input type="hidden" name="[% INPUT.name |html %]" value="[% INPUT.value |html %]">[% END %]
index 64afc0b..300b7bd 100644 (file)
                                 </xsl:call-template>
                             </xsl:with-param>
                         </xsl:call-template>
-                       </a>
-                    <xsl:text> </xsl:text><xsl:call-template name="part"/>
-            <xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
+            </a>
+            <xsl:call-template name="part"/>
+            <xsl:choose><xsl:when test="position()=last()"><xsl:text>. </xsl:text></xsl:when><xsl:otherwise><xsl:text> ; </xsl:text></xsl:otherwise></xsl:choose>
         </xsl:for-each>
 
         <!-- 490 Series not traced, Ind1 = 0 -->
                 </xsl:choose>
                 <!-- add relator code too between brackets-->
                 <xsl:if test="marc:subfield[@code='4' or @code='e']">
-                    <xsl:text>[</xsl:text>
+                    <span class="relatorcode">
+                    <xsl:text> [</xsl:text>
                     <xsl:choose>
                         <xsl:when test="marc:subfield[@code=4]"><xsl:value-of select="marc:subfield[@code=4]"/></xsl:when>
                         <xsl:otherwise><xsl:value-of select="marc:subfield[@code='e']"/></xsl:otherwise>
                     </xsl:choose>
                     <xsl:text>]</xsl:text>
+                    </span>
                 </xsl:if>
             </a>
             <xsl:if test="marc:subfield[@code=9]">
index bb473e9..72fc95c 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.11.00.001';
+    our $VERSION = '3.11.00.014';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index 78daf38..9085630 100755 (executable)
@@ -28,17 +28,17 @@ use C4::NewsChannels;
 use C4::Review qw/numberofreviews/;
 use C4::Suggestions qw/CountSuggestion/;
 use C4::Tags qw/get_count_by_tag_status/;
-my $query     = new CGI;
+use Koha::Borrower::Modifications;
 
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+my $query = new CGI;
+
+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
     {
         template_name   => "intranet-main.tmpl",
         query           => $query,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => {
-            catalogue => 1,
-        },
+        flagsrequired   => { catalogue => 1, },
     }
 );
 
@@ -50,14 +50,23 @@ $template->param(
     koha_news_count => $koha_news_count
 );
 
-my $pendingcomments = numberofreviews(0);
-my $pendingtags = get_count_by_tag_status(0);
-my $pendingsuggestions       = CountSuggestion("ASKED");
+my $branch =
+  C4::Context->preference("IndependantBranches")
+  && !$flags->{'superlibrarian'}
+  ? C4::Context->userenv()->{'branch'}
+  : undef;
+
+my $pendingcomments    = numberofreviews(0);
+my $pendingtags        = get_count_by_tag_status(0);
+my $pendingsuggestions = CountSuggestion("ASKED");
+my $pending_borrower_modifications =
+  Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
 
 $template->param(
-    pendingcomments    => $pendingcomments,
-    pendingtags        => $pendingtags,
-    pendingsuggestions => $pendingsuggestions
+    pendingcomments                => $pendingcomments,
+    pendingtags                    => $pendingtags,
+    pendingsuggestions             => $pendingsuggestions,
+    pending_borrower_modifications => $pending_borrower_modifications,
 );
 
 #
index f8aa4f1..d25dba9 100755 (executable)
@@ -135,8 +135,8 @@ foreach my $borrower(@$results[$from..$to-1]){
 
   my %row = (
     count => $index++,
-       %$borrower,
-       %{$categories_dislay{$$borrower{categorycode}}},
+    %$borrower,
+    (defined $categories_dislay{ $borrower->{categorycode} }?   %{ $categories_dislay{ $borrower->{categorycode} } }:()),
     overdues => $od,
     issues => $issue,
     odissue => "$od/$issue",
index 61eb83a..1d8f1e5 100755 (executable)
@@ -26,6 +26,7 @@ use C4::Context;
 use C4::Members;
 use C4::Branch;
 use C4::Category;
+use Koha::Borrower::Modifications;
 
 my $query = new CGI;
 my $branch = $query->param('branchcode');
@@ -76,10 +77,15 @@ else {
     $template->param(categories=>\@categories);
 }
 
+
+my $pending_borrower_modifications =
+  Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
+
 $template->param( 
         "AddPatronLists_".C4::Context->preference("AddPatronLists")=> "1",
         no_add => $no_add,
+        pending_borrower_modifications => $pending_borrower_modifications,
             );
-$template->param( 'alphabet' => C4::Context->preference('alphabet') );
+$template->param( 'alphabet' => C4::Context->preference('alphabet') || join ' ', 'A' .. 'Z' );
 
 output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/members/members-update-do.pl b/members/members-update-do.pl
new file mode 100755 (executable)
index 0000000..e7b7b28
--- /dev/null
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+
+# Parts Copyright Biblibre 2010
+# 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 CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Context;
+use C4::Members;
+use C4::Branch;
+use C4::Category;
+use Koha::Borrower::Modifications;
+
+my $query = new CGI;
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "about.tmpl",
+        query           => $query,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { borrowers => 1 },
+        debug           => 1,
+    }
+);
+
+my @params = $query->param;
+
+foreach my $param (@params) {
+    if ( $param =~ "^modify_" ) {
+        my (undef, $borrowernumber) = split( /_/, $param );
+
+        my $action = $query->param($param);
+
+        if ( $action eq 'approve' ) {
+            Koha::Borrower::Modifications->ApproveModifications( $borrowernumber );
+        }
+        elsif ( $action eq 'deny' ) {
+            Koha::Borrower::Modifications->DenyModifications( $borrowernumber );
+        }
+        elsif ( $action eq 'ignore' ) {
+
+        }
+    }
+}
+
+print $query->redirect("/cgi-bin/koha/members/members-update.pl");
diff --git a/members/members-update.pl b/members/members-update.pl
new file mode 100755 (executable)
index 0000000..334d83b
--- /dev/null
@@ -0,0 +1,65 @@
+#!/usr/bin/perl
+
+# Parts Copyright Biblibre 2010
+# 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 CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Context;
+use C4::Members;
+use C4::Branch;
+use C4::Category;
+use Koha::Borrower::Modifications;
+
+my $query = new CGI;
+
+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
+    {
+        template_name   => "members/members-update.tmpl",
+        query           => $query,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { borrowers => 1 },
+        debug           => 1,
+    }
+);
+
+my $branch =
+  C4::Context->preference("IndependantBranches")
+  && !$flags->{'superlibrarian'}
+  ? C4::Context->userenv()->{'branch'}
+  : undef;
+
+my $pending_modifications =
+  Koha::Borrower::Modifications->GetPendingModifications($branch);
+
+my $borrowers;
+foreach my $pm (@$pending_modifications) {
+    $borrowers->{ $pm->{'borrowernumber'} } =
+      GetMember( borrowernumber => $pm->{'borrowernumber'} );
+
+}
+
+$template->param(
+    PendingModifications => $pending_modifications,
+    borrowers            => $borrowers,
+);
+
+output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/misc/bin/koha-index-daemon-ctl.sh b/misc/bin/koha-index-daemon-ctl.sh
new file mode 100755 (executable)
index 0000000..03cdca8
--- /dev/null
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+### BEGIN INIT INFO
+# Provides:          koha-index-daemon-$DBNAME
+# Required-Start:    $local_fs $syslog
+# Required-Stop:     $local_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# X-Interactive:     false
+# Short-Description: Start/stop koha-index-daemon for $DBNAME
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+USER=__KOHA_USER__
+GROUP=__KOHA_GROUP__
+DBNAME=__DB_NAME__
+NAME=koha-index-daemon-$DBNAME
+LOGDIR=__LOG_DIR__
+PERL5LIB=__PERL_MODULE_DIR__
+KOHA_CONF=__KOHA_CONF_DIR__/koha-conf.xml
+ERRLOG=$LOGDIR/koha-index-daemon.err
+STDOUT=$LOGDIR/koha-index-daemon.log
+OUTPUT=$LOGDIR/koha-index-daemon-output.log
+
+export KOHA_CONF
+export PERL5LIB
+
+INDEXDAEMON="koha-index-daemon"
+INDEXDAEMON_OPTS="--timeout 30 --conf $KOHA_CONF \
+                  --directory /var/tmp/koha-index-daemon-$DBNAME"
+
+DAEMONOPTS="--name=$NAME \
+            --errlog=$ERRLOG \
+            --stdout=$STDOUT \
+            --output=$OUTPUT \
+            --verbose=1 --respawn --delay=30"
+
+USER="--user=$USER.$GROUP"
+
+
+case "$1" in
+    start)
+      log_daemon_msg "Starting Koha indexing daemon ($DBNAME)"
+      if daemon $DAEMONOPTS $USER -- $INDEXDAEMON $INDEXDAEMON_OPTS; then
+        log_end_msg 0
+      else
+        log_end_msg 1
+      fi
+      ;;
+    stop)
+      log_daemon_msg "Stopping Koha indexing daemon ($DBNAME)"
+      if daemon $DAEMONOPTS $USER --stop -- $INDEXDAEMON $INDEXDAEMON_OPTS; then
+        log_end_msg 0
+      else
+        log_end_msg 1
+      fi
+      ;;
+    restart)
+      log_daemon_msg "Restarting the Koha indexing daemon ($DBNAME)"
+      if daemon $DAEMONOPTS $USER --restart -- $INDEXDAEMON $INDEXDAEMON_OPTS; then
+        log_end_msg 0
+      else
+        log_end_msg 1
+      fi
+      ;;
+    *)
+      log_success_msg "Usage: /etc/init.d/$NAME {start|stop|restart}"
+      exit 1
+      ;;
+esac
index fdd6a21..17150a9 100755 (executable)
@@ -1,22 +1,22 @@
 #!/bin/sh
 # Script to create daily backups of the Koha database.
 # Based on a script by John Pennington
+
+DATABASE=`xmlstarlet sel -t -v 'yazgfs/config/database' $KOHA_CONF`
+HOSTNAME=`xmlstarlet sel -t -v 'yazgfs/config/hostname' $KOHA_CONF`
+PORT=`xmlstarlet sel -t -v 'yazgfs/config/port' $KOHA_CONF`
+USER=`xmlstarlet sel -t -v 'yazgfs/config/user' $KOHA_CONF`
+PASS=`xmlstarlet sel -t -v 'yazgfs/config/pass' $KOHA_CONF`
 BACKUPDIR=`xmlstarlet sel -t -v 'yazgfs/config/backupdir' $KOHA_CONF`
-KOHA_DATE=`date '+%y%m%d'`
+KOHA_DATE=`date '+%Y%m%d'`
 KOHA_BACKUP=$BACKUPDIR/koha-$KOHA_DATE.sql.gz
 
-mysqldump --single-transaction -u koha -ppassword koha | gzip -9 > $KOHA_BACKUP
-
-#mv $KOHA_BACKUP /home/kohaadmin &&
-#chown kohaadmin.users /home/kohaadmin/koha-$KOHA_DATE.dump.gz &&
-#chmod 600 /home/kohaadmin/koha-$KOHA_DATE.dump.gz &&
-# Makes the compressed dump file property of the kohaadmin user.
-# Make sure that you replace kohaadmin with a real user.
+mysqldump --single-transaction --user=$USER --password="$PASS" --port=$PORT --host=$HOST $DATABASE| gzip -9 > $KOHA_BACKUP
 
 if [ -f $KOHA_BACKUP ] ; then
-echo "$KOHA_BACKUP was successfully created." | mail kohaadmin -s $KOHA_BACKUP
+echo "$KOHA_BACKUP was successfully created." | mail $USER -s $KOHA_BACKUP
 else
-echo "$KOHA_BACKUP was NOT successfully created." | mail kohaadmin -s $KOHA_BACKUP
+echo "$KOHA_BACKUP was NOT successfully created." | mail $USER -s $KOHA_BACKUP
 fi
 
 # Notifies kohaadmin of (un)successful backup creation
diff --git a/misc/cronjobs/delete_expired_opac_registrations.pl b/misc/cronjobs/delete_expired_opac_registrations.pl
new file mode 100755 (executable)
index 0000000..c7c3375
--- /dev/null
@@ -0,0 +1,80 @@
+#!/usr/bin/perl
+
+# Copyright 2009-2010 Kyle Hall
+#
+# 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 Modern::Perl;
+use Getopt::Long;
+
+BEGIN {
+
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib };
+}
+
+use C4::Context;
+use C4::Members qw/ DelMember /;
+
+my $help;
+my $confirm;
+
+GetOptions(
+    'h|help'    => \$help,
+    'c|confirm' => \$confirm,
+);
+my $usage = << 'ENDUSAGE';
+
+This script remove confirmed OPAC based patron registrations
+that have not been changed from the patron category specified
+in the system preference PatronSelfRegistrationDefaultCategory
+within the required time period.
+
+This script has the following parameters :
+    -h --help:    This message
+
+    -c --confirm: Without this flag set, this script will do nothing.
+ENDUSAGE
+
+if ( $help || !$confirm ) {
+    print $usage;
+    exit;
+}
+
+## Delete accounts that haven't been upgraded from the 'temporary' category code'
+my $delay =
+  C4::Context->preference('PatronSelfRegistrationExpireTemporaryAccountsDelay');
+my $category_code =
+  C4::Context->preference('PatronSelfRegistrationDefaultCategory');
+
+my $query = "
+    SELECT borrowernumber
+    FROM borrowers
+    WHERE
+        categorycode = ?
+      AND
+        DATEDIFF( DATE( NOW() ), DATE(dateenrolled) ) = ? )
+";
+
+my $dbh = C4::Context->dbh;
+my $sth = $dbh->prepare($query);
+$sth->execute( $category_code, $delay );
+
+while ( my ($borrowernumber) = $sth->fetchrow_array() ) {
+    DelMember($borrowernumber);
+}
diff --git a/misc/cronjobs/delete_unverified_opac_registrations.pl b/misc/cronjobs/delete_unverified_opac_registrations.pl
new file mode 100755 (executable)
index 0000000..6909c70
--- /dev/null
@@ -0,0 +1,70 @@
+#!/usr/bin/perl
+
+# Copyright 2009-2010 Kyle Hall
+#
+# 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 Modern::Perl;
+use Getopt::Long;
+
+BEGIN {
+
+    # find Koha's Perl modules
+    # test carefully before changing this
+    use FindBin;
+    eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib };
+}
+
+use C4::Context;
+use C4::Members qw/ DelMember /;
+
+my $help;
+my $confirm;
+my $hours = 24;
+
+GetOptions(
+    'h|help'    => \$help,
+    'c|confirm' => \$confirm,
+    't|time=i'  => \$hours,
+);
+my $usage = << 'ENDUSAGE';
+
+This script removes unconfirmed OPAC based patron registrations
+that have not been confirmed within the required time period.
+
+This script has the following parameters :
+    -h --help:    This message
+
+    -t --time:    The length in hours to wait before removing an unconfirmed registration.
+                  Defaults to 24 hours if not set.
+
+    -c --confirm: Without this flag set, this script will do nothing.
+ENDUSAGE
+
+if ( $help || !$confirm ) {
+    print $usage;
+    exit;
+}
+
+my $dbh = C4::Context->dbh;
+
+$dbh->do( "
+         DELETE FROM borrower_modifications
+         WHERE
+             borrowernumber = 0
+           AND
+             TIME_TO_SEC( TIMEDIFF( NOW(), timestamp )) / 3600 > ?
+", undef, $hours );
index e83bd39..737fa34 100755 (executable)
@@ -442,7 +442,7 @@ END_SQL
             # this text contains fields that are replaced by their value. Those fields must be written between brackets
             # The following fields are available :
            # itemcount is interpreted here as the number of items in the overdue range defined by the current notice or all overdues < max if(-list-all).
-            # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode>
+            # <date> <itemcount> <firstname> <lastname> <address1> <address2> <address3> <city> <postcode> <country>
 
             my $borrower_sql = <<'END_SQL';
 SELECT distinct(issues.borrowernumber), firstname, surname, address, address2, city, zipcode, country, email
@@ -551,6 +551,7 @@ END_SQL
                             address2       => $address2,
                             city           => $city,
                             postcode       => $postcode,
+                            country        => $country,
                             email          => $email,
                             itemcount      => $itemcount,
                             titles         => $titles,
@@ -579,6 +580,7 @@ END_SQL
                                 address2       => $address2,
                                 city           => $city,
                                 postcode       => $postcode,
+                                country        => $country,
                                 email          => $email,
                                 itemcount      => $itemcount,
                                 titles         => $titles,
@@ -604,7 +606,7 @@ END_SQL
                 print @output_chunks;
         }
         # Generate the content of the csv with headers
-        my $content = join(";", qw(title name surname address1 address2 zipcode city email itemcount itemsinfo due_date issue_date)) . "\n";
+        my $content = join(";", qw(title name surname address1 address2 zipcode city country email itemcount itemsinfo due_date issue_date)) . "\n";
         $content .= join( "\n", @output_chunks );
             
         my $attachment = {
@@ -744,7 +746,7 @@ sub prepare_letter_for_printing {
     if ( exists $params->{'outputformat'} && $params->{'outputformat'} eq 'csv' ) {
         if ($csv->combine(
                 $params->{'firstname'}, $params->{'lastname'}, $params->{'address1'},  $params->{'address2'}, $params->{'postcode'},
-                $params->{'city'},      $params->{'email'},    $params->{'itemcount'}, $params->{'titles'}
+                $params->{'city'}, $params->{'country'}, $params->{'email'}, $params->{'itemcount'}, $params->{'titles'}
             )
           ) {
             return $csv->string, "\n";
index 690f216..2357ed8 100755 (executable)
@@ -29,6 +29,7 @@ use Mail::Sendmail;
 use Text::CSV_XS;
 use CGI;
 use Carp;
+use Encode;
 
 use vars qw($VERSION);
 
@@ -192,9 +193,9 @@ foreach my $report_id (@ARGV) {
         warn "ERROR: No saved report $report_id found";
         next;
     }
-    my $sql         => $report->{savedsql};
-    my $report_name => $report->{report_name};
-    my $type        => $report->{type};
+    my $sql         = $report->{savedsql};
+    my $report_name = $report->{report_name};
+    my $type        = $report->{type};
 
     $verbose and print "SQL: $sql\n\n";
     if (defined($report_name) and $report_name ne "")
@@ -245,8 +246,8 @@ foreach my $report_id (@ARGV) {
         my %mail = (
             To      => $to,
             From    => $from,
-            Subject => $subject,
-            Message => $message 
+            Subject => encode('utf8', $subject ),
+            Message => encode('utf8', $message )
         );
         sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error;
     } else {
index 1de5a48..a5a376f 100755 (executable)
@@ -60,6 +60,7 @@ my $sth = $dbh->prepare("
      WHERE serial.status = 1 
        AND periodicity <> 32
        AND DATE_ADD(planneddate, INTERVAL CAST(graceperiod AS SIGNED) DAY) < NOW()
+       AND subscription.closed = 0
      ");
 $sth->execute();
 
index a9fee95..e0f905c 100755 (executable)
@@ -35,6 +35,7 @@ my ( $input_marc_file, $number, $offset) = ('',0,0);
 my ($version, $delete, $test_parameter, $skip_marc8_conversion, $char_encoding, $verbose, $commit, $fk_off,$format,$biblios,$authorities,$keepids,$match, $isbn_check, $logfile);
 my $cleanisbn = 1;
 my ($sourcetag,$sourcesubfield,$idmapfl, $dedup_barcode);
+my $framework = '';
 
 $|=1;
 
@@ -62,6 +63,7 @@ GetOptions(
     'idmap:s' => \$idmapfl,
     'cleanisbn!'     => \$cleanisbn,
     'dedupbarcode' => \$dedup_barcode,
+    'framework=s' => \$framework,
 );
 $biblios=!$authorities||$biblios;
 
@@ -154,7 +156,7 @@ if ($authorities){
 }
 else {
    ( $tagid, $subfieldid ) =
-            GetMarcFromKohaField( "biblio.biblionumber", '' );
+            GetMarcFromKohaField( "biblio.biblionumber", $framework );
        $tagid||="001";
 }
 
@@ -185,7 +187,7 @@ RECORD: while (  ) {
     last unless ( $record );
     $i++;
     print ".";
-    print "\r$i" unless $i % 100;
+    print "\n$i" unless $i % 100;
     
     # transcode the record to UTF8 if needed & applicable.
     if ($record->encoding() eq 'MARC-8' and not $skip_marc8_conversion) {
@@ -308,7 +310,7 @@ RECORD: while (  ) {
                        }
                        else 
                        {
-                eval { ( $biblionumber, $biblioitemnumber ) = AddBiblio($record, '', { defer_marc_save => 1 }) };
+                eval { ( $biblionumber, $biblioitemnumber ) = AddBiblio($record, $framework, { defer_marc_save => 1 }) };
             }
             if ( $@ ) {
                 warn "ERROR: Adding biblio $biblionumber failed: $@\n";
@@ -326,7 +328,7 @@ RECORD: while (  ) {
             C4::Biblio::_strip_item_fields($clone_record, '');
             # This sets the marc fields if there was an error, and also calls
             # defer_marc_save.
-            ModBiblioMarc( $clone_record, $biblionumber, '' );
+            ModBiblioMarc( $clone_record, $biblionumber, $framework );
             if ( $error_adding ) {
                 warn "ERROR: Adding items to bib $biblionumber failed: $error_adding";
                                printlog({id=>$id||$originalid||$biblionumber, op=>"insertitem",status=>"ERROR"}) if ($logfile);
@@ -339,7 +341,7 @@ RECORD: while (  ) {
                        }
             if ($dedup_barcode && grep { exists $_->{error_code} && $_->{error_code} eq 'duplicate_barcode' } @$errors_ref) {
                 # Find the record called 'barcode'
-                my ($tag, $sub) = C4::Biblio::GetMarcFromKohaField('items.barcode', '');
+                my ($tag, $sub) = C4::Biblio::GetMarcFromKohaField('items.barcode', $framework);
                 # Now remove any items that didn't have a duplicate_barcode error,
                 # erase the barcodes on items that did, and re-add those items.
                 my %dupes;
@@ -372,7 +374,7 @@ RECORD: while (  ) {
                     printlog({id=>$id||$originalid||$biblionumber, op=>"insertitem",status=>"ERROR"}) if ($logfile);
                     # if we failed because of an exception, assume that
                     # the MARC columns in biblioitems were not set.
-                    ModBiblioMarc( $record, $biblionumber, '' );
+                    ModBiblioMarc( $record, $biblionumber, $framework );
                     next RECORD;
                 } else {
                     printlog({id=>$id||$originalid||$biblionumber, op=>"insert",status=>"ok"}) if ($logfile);
@@ -594,6 +596,12 @@ to add the record is retried, thereby giving the record a blank barcode. This
 is useful when something has set barcodes to be a biblio ID, or similar
 (usually other software.)
 
+=item B<-framework>
+
+This is the code for the framework that the requested records will have attached
+to them when they are created. If not specified, then the default framework
+will be used.
+
 =back
 
 =cut
index 0e24df5..b72ab2c 100755 (executable)
@@ -93,6 +93,10 @@ if ($process_zebraqueue and $do_not_clear_zebraqueue) {
     die $msg;
 }
 
+if ($reset) {
+    $noshadow = 1;
+}
+
 if ($noshadow) {
     $noshadow = ' -n ';
 }
@@ -667,7 +671,7 @@ Parameters:
                             or -s.
 
     -r                      clear Zebra index before
-                            adding records to index
+                            adding records to index. Implies -w.
 
     -d                      Temporary directory for indexing.
                             If not specified, one is automatically
index 89c993f..cd46997 100755 (executable)
@@ -59,7 +59,7 @@ sub text_replace_tag ($$) {
     # value [tag=input], meta
     my $tag = lc($1) if $t =~ /^<(\S+)/s;
     my $translated_p = 0;
-    for my $a ('alt', 'content', 'title', 'value','label') {
+    for my $a ('alt', 'content', 'title', 'value', 'label', 'placeholder') {
     if ($attr->{$a}) {
         next if $a eq 'label' && $tag ne 'optgroup';
         next if $a eq 'content' && $tag ne 'meta';
index 99a75bf..032117d 100755 (executable)
@@ -102,7 +102,7 @@ sub text_extract (*) {
         } elsif ($kind eq C4::TmplTokenType::TAG && %$attr) {
             # value [tag=input], meta
             my $tag = lc($1) if $t =~ /^<(\S+)/s;
-            for my $a ('alt', 'content', 'title', 'value','label') {
+            for my $a ('alt', 'content', 'title', 'value', 'label', 'placeholder') {
                 if ($attr->{$a}) {
                     next if $a eq 'label' && $tag ne 'optgroup';
                     next if $a eq 'content' && $tag ne 'meta';
index 5656228..115012e 100755 (executable)
@@ -90,7 +90,13 @@ if ( $op eq "do_search" ) {
         $displaynext = 1;
     }
 
-    my @field_data = ( { term => "marclist" , val => $query->param("marclist") || ''} );
+    my @field_data = (
+        { term => "marclist",  val => $marclist[0] },
+        { term => "and_or",    val => $and_or[0] },
+        { term => "excluding", val => $excluding[0] },
+        { term => "operator",  val => $operator[0] },
+        { term => "value",     val => $value[0] },
+    );
 
     my @numbers = ();
 
index 195e244..3e17cf1 100755 (executable)
@@ -122,7 +122,7 @@ if ($show_marc) {
         my @subfields_data;
 
 # skip UNIMARC fields <200, they are useless for a patron
-        next if C4::Context->preference('MarcFlavour') eq 'UNIMARC' && $field->tag() <200;
+        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 ) {
@@ -134,6 +134,9 @@ if ($show_marc) {
             $subfield_data{marc_tag}      = $field->tag();
             push( @subfields_data, \%subfield_data );
         }
+        elsif ( C4::Context->preference('marcflavour') eq 'MARC21' && $field->tag() eq 667 ) {
+            # tagfield 667 is a nonpublic general note in MARC21, which shouldn't be shown in the OPAC
+        }
         else {
             my @subf = $field->subfields;
 
index d9ecdfa..22c922b 100755 (executable)
@@ -49,6 +49,7 @@ use MARC::Field;
 use List::MoreUtils qw/any none/;
 use C4::Images;
 use Koha::DateUtils;
+use C4::HTML5Media;
 
 BEGIN {
        if (C4::Context->preference('BakerTaylorEnabled')) {
@@ -471,6 +472,8 @@ foreach my $subscription (@subscriptions) {
     $cell{branchcode}        = $subscription->{branchcode};
     $cell{branchname}        = GetBranchName($subscription->{branchcode});
     $cell{hasalert}          = $subscription->{hasalert};
+    $cell{callnumber}        = $subscription->{callnumber};
+    $cell{closed}            = $subscription->{closed};
     #get the three latest serials.
     $serials_to_display = $subscription->{opacdisplaycount};
     $serials_to_display = C4::Context->preference('OPACSerialIssueDisplayCount') unless $serials_to_display;
@@ -482,13 +485,6 @@ foreach my $subscription (@subscriptions) {
 
 $dat->{'count'} = scalar(@items);
 
-# If there is a lot of items, and the user has not decided
-# to view them all yet, we first warn him
-# TODO: The limit of 50 could be a syspref
-my $viewallitems = $query->param('viewallitems');
-if ($dat->{'count'} >= 50 && !$viewallitems) {
-    $template->param('lotsofitems' => 1);
-}
 
 my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) );
 
@@ -517,6 +513,12 @@ $template->param( show_priority => $has_hold ) ;
 my $norequests = 1;
 my $branches = GetBranches();
 my %itemfields;
+my (@itemloop, @otheritemloop);
+my $currentbranch = C4::Context->userenv ? C4::Context->userenv->{branch} : undef;
+if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
+    $template->param(SeparateHoldings => 1);
+}
+my $separatebranch = C4::Context->preference('OpacSeparateHoldingsBranch');
 for my $itm (@items) {
     $itm->{holds_count} = $item_reserves{ $itm->{itemnumber} };
     $itm->{priority} = $priority{ $itm->{itemnumber} };
@@ -567,6 +569,24 @@ for my $itm (@items) {
         $itm->{transfertfrom} = $branches->{$transfertfrom}{branchname};
         $itm->{transfertto}   = $branches->{$transfertto}{branchname};
      }
+    my $itembranch = $itm->{$separatebranch};
+    if ($currentbranch and C4::Context->preference('OpacSeparateHoldings')) {
+        if ($itembranch and $itembranch eq $currentbranch) {
+            push @itemloop, $itm;
+        } else {
+            push @otheritemloop, $itm;
+        }
+    } else {
+        push @itemloop, $itm;
+    }
+}
+
+# If there is a lot of items, and the user has not decided
+# to view them all yet, we first warn him
+# TODO: The limit of 50 could be a syspref
+my $viewallitems = $query->param('viewallitems');
+if (scalar(@itemloop) >= 50 && !$viewallitems) {
+    $template->param('lotsofitems' => 1);
 }
 
 ## get notes and subjects from MARC record
@@ -695,7 +715,8 @@ if(C4::Context->preference("ISBD")) {
 }
 
 $template->param(
-    ITEM_RESULTS        => \@items,
+    itemloop            => \@itemloop,
+    otheritemloop       => \@otheritemloop,
     subscriptionsnumber => $subscriptionsnumber,
     biblionumber        => $biblionumber,
     subscriptions       => \@subs,
@@ -756,6 +777,11 @@ if (C4::Context->preference("OPACLocalCoverImages")){
                $template->param(OPACLocalCoverImages => 1);
 }
 
+# HTML5 Media
+if ( (C4::Context->preference("HTML5MediaEnabled") eq 'both') or (C4::Context->preference("HTML5MediaEnabled") eq 'opac') ) {
+    $template->param( C4::HTML5Media->gethtml5media($record));
+}
+
 my $syndetics_elements;
 
 if ( C4::Context->preference("SyndeticsEnabled") ) {
@@ -855,8 +881,7 @@ if ( C4::Context->preference( "SocialNetworks" ) ) {
 
 # Shelf Browser Stuff
 if (C4::Context->preference("OPACShelfBrowser")) {
-    # pick the first itemnumber unless one was selected by the user
-    my $starting_itemnumber = $query->param('shelfbrowse_itemnumber'); # || $items[0]->{itemnumber};
+    my $starting_itemnumber = $query->param('shelfbrowse_itemnumber');
     if (defined($starting_itemnumber)) {
         $template->param( OpenOPACShelfBrowser => 1) if $starting_itemnumber;
         my $nearby = GetNearbyItems($starting_itemnumber,3);
@@ -873,6 +898,13 @@ if (C4::Context->preference("OPACShelfBrowser")) {
             PREVIOUS_SHELF_BROWSE => $nearby->{prev},
             NEXT_SHELF_BROWSE => $nearby->{next},
         );
+
+        # in which tab shelf browser should open ?
+        if (grep { $starting_itemnumber == $_->{itemnumber} } @itemloop) {
+            $template->param(shelfbrowser_tab => 'holdings');
+        } else {
+            $template->param(shelfbrowser_tab => 'otherholdings');
+        }
     }
 }
 
@@ -958,7 +990,7 @@ my $defaulttab =
         ? 'subscriptions' :
     $opac_serial_default eq 'serialcollection' && @serialcollections > 0
         ? 'serialcollection' :
-    $opac_serial_default eq 'holdings' && $dat->{'count'} > 0
+    $opac_serial_default eq 'holdings' && scalar (@itemloop) > 0
         ? 'holdings' :
     $subscriptionsnumber
         ? 'subscriptions' :
diff --git a/opac/opac-memberentry.pl b/opac/opac-memberentry.pl
new file mode 100755 (executable)
index 0000000..7f8230d
--- /dev/null
@@ -0,0 +1,306 @@
+#!/usr/bin/perl
+
+# 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 Modern::Perl;
+
+use CGI;
+use Digest::MD5 qw( md5_base64 md5_hex );
+use String::Random qw( random_string );
+
+use C4::Auth;
+use C4::Output;
+use C4::Members;
+use Koha::Borrower::Modifications;
+use C4::Branch qw(GetBranchesLoop);
+
+my $cgi = new CGI;
+my $dbh = C4::Context->dbh;
+
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => "opac-memberentry.tmpl",
+        type            => "opac",
+        query           => $cgi,
+        authnotrequired => 1,
+    }
+);
+
+unless ( C4::Context->preference('PatronSelfRegistration') || $borrowernumber )
+{
+    print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
+    exit;
+}
+
+my $action = $cgi->param('action') || q{};
+if ( $action eq q{} ) {
+    if ($borrowernumber) {
+        $action = 'edit';
+    }
+    else {
+        $action = 'new';
+    }
+}
+
+$template->param(
+    action            => $action,
+    hidden            => GetHiddenFields(),
+    mandatory         => GetMandatoryFields($action),
+    member_titles     => GetTitles(),
+    branches          => GetBranchesLoop(),
+    OPACPatronDetails => C4::Context->preference('OPACPatronDetails'),
+);
+
+if ( $action eq 'create' ) {
+
+    my %borrower = ParseCgiForBorrower($cgi);
+
+    %borrower = DelEmptyFields(%borrower);
+
+    my @empty_mandatory_fields = CheckMandatoryFields( \%borrower, $action );
+
+    if (@empty_mandatory_fields) {
+        $template->param(
+            empty_mandatory_fields => \@empty_mandatory_fields,
+            borrower               => \%borrower
+        );
+    }
+    elsif (
+        md5_base64( $cgi->param('captcha') ) ne $cgi->param('captcha_digest') )
+    {
+        $template->param(
+            failed_captcha => 1,
+            borrower       => \%borrower
+        );
+    }
+    else {
+        if (
+            C4::Context->boolean_preference(
+                'PatronSelfRegistrationVerifyByEmail')
+          )
+        {
+            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+                {
+                    template_name   => "opac-registration-email-sent.tmpl",
+                    type            => "opac",
+                    query           => $cgi,
+                    authnotrequired => 1,
+                }
+            );
+            $template->param( 'email' => $borrower{'email'} );
+
+            my $verification_token = md5_hex( \%borrower );
+            $borrower{'password'} = random_string("..........");
+
+            Koha::Borrower::Modifications->new(
+                verification_token => $verification_token )
+              ->AddModifications(\%borrower);
+
+            #Send verification email
+            my $letter = C4::Letters::GetPreparedLetter(
+                module      => 'members',
+                letter_code => 'OPAC_REG_VERIFY',
+                tables      => {
+                    borrower_modifications =>
+                      [ $verification_token, $verification_token ],
+                },
+            );
+
+            C4::Letters::EnqueueLetter(
+                {
+                    letter                 => $letter,
+                    message_transport_type => 'email',
+                    to_address             => $borrower{'email'},
+                    from_address =>
+                      C4::Context->preference('KohaAdminEmailAddress'),
+                }
+            );
+        }
+        else {
+            ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+                {
+                    template_name   => "opac-registration-confirmation.tmpl",
+                    type            => "opac",
+                    query           => $cgi,
+                    authnotrequired => 1,
+                }
+            );
+
+            $template->param( OpacPasswordChange =>
+                  C4::Context->preference('OpacPasswordChange') );
+
+            my ( $borrowernumber, $password ) = AddMember_Opac(%borrower);
+
+            $template->param( password_cleartext => $password );
+            $template->param(
+                borrower => GetMember( borrowernumber => $borrowernumber ) );
+            $template->param(
+                PatronSelfRegistrationAdditionalInstructions =>
+                  C4::Context->preference(
+                    'PatronSelfRegistrationAdditionalInstructions')
+            );
+        }
+    }
+}
+elsif ( $action eq 'update' ) {
+
+    my %borrower = ParseCgiForBorrower($cgi);
+
+    my %borrower_changes = DelEmptyFields(%borrower);
+    my @empty_mandatory_fields =
+      CheckMandatoryFields( \%borrower_changes, $action );
+
+    if (@empty_mandatory_fields) {
+        $template->param(
+            empty_mandatory_fields => \@empty_mandatory_fields,
+            borrower               => \%borrower
+        );
+
+        $template->param( action => 'edit' );
+    }
+    else {
+        ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+            {
+                template_name   => "opac-memberentry-update-submitted.tmpl",
+                type            => "opac",
+                query           => $cgi,
+                authnotrequired => 1,
+            }
+        );
+
+        my %borrower_changes = DelUnchangedFields( $borrowernumber, %borrower );
+
+        my $m =
+          Koha::Borrower::Modifications->new(
+            borrowernumber => $borrowernumber );
+
+        $m->DelModifications;
+        $m->AddModifications(\%borrower_changes);
+        $template->param(
+            borrower => GetMember( borrowernumber => $borrowernumber ),
+        );
+    }
+}
+elsif ( $action eq 'edit' ) {    #Display logged in borrower's data
+    $template->param(
+        borrower => GetMember( borrowernumber => $borrowernumber ), );
+}
+
+my $captcha = random_string("CCCCC");
+
+$template->param(
+    captcha        => $captcha,
+    captcha_digest => md5_base64($captcha)
+);
+
+output_html_with_http_headers $cgi, $cookie, $template->output;
+
+sub GetHiddenFields {
+    my %hidden_fields;
+
+    my $BorrowerUnwantedField =
+      C4::Context->preference("PatronSelfRegistrationBorrowerUnwantedField");
+
+    my @fields = split( /\|/, $BorrowerUnwantedField );
+    foreach (@fields) {
+        next unless m/\w/o;
+        $hidden_fields{$_} = 1;
+    }
+
+    return \%hidden_fields;
+}
+
+sub GetMandatoryFields {
+    my ($action) = @_;
+
+    my %mandatory_fields;
+
+    my $BorrowerMandatoryField =
+      C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
+
+    my @fields = split( /\|/, $BorrowerMandatoryField );
+
+    foreach (@fields) {
+        $mandatory_fields{$_} = 1;
+    }
+
+    if ( $action eq 'create' || $action eq 'new' ) {
+        $mandatory_fields{'email'} = 1
+          if C4::Context->boolean_preference(
+            'PatronSelfRegistrationVerifyByEmail');
+    }
+
+    return \%mandatory_fields;
+}
+
+sub CheckMandatoryFields {
+    my ( $borrower, $action ) = @_;
+
+    my @empty_mandatory_fields;
+
+    my $mandatory_fields = GetMandatoryFields($action);
+    delete $mandatory_fields->{'cardnumber'};
+
+    foreach my $key ( keys %$mandatory_fields ) {
+        push( @empty_mandatory_fields, $key )
+          unless ( defined( $borrower->{$key} ) && $borrower->{$key} );
+    }
+
+    return @empty_mandatory_fields;
+}
+
+sub ParseCgiForBorrower {
+    my ($cgi) = @_;
+
+    my %borrower;
+
+    foreach ( $cgi->param ) {
+        if ( $_ =~ '^borrower_' ) {
+            my ($key) = substr( $_, 9 );
+            $borrower{$key} = $cgi->param($_);
+        }
+    }
+
+    $borrower{'dateofbirth'} =
+      C4::Dates->new( $borrower{'dateofbirth'} )->output("iso")
+      if ( defined( $borrower{'dateofbirth'} ) );
+
+    return %borrower;
+}
+
+sub DelUnchangedFields {
+    my ( $borrowernumber, %new_data ) = @_;
+
+    my $current_data = GetMember( borrowernumber => $borrowernumber );
+
+    foreach my $key ( keys %new_data ) {
+        if ( $current_data->{$key} eq $new_data{$key} ) {
+            delete $new_data{$key};
+        }
+    }
+
+    return %new_data;
+}
+
+sub DelEmptyFields {
+    my (%borrower) = @_;
+
+    foreach my $key ( keys %borrower ) {
+        delete $borrower{$key} unless $borrower{$key};
+    }
+
+    return %borrower;
+}
diff --git a/opac/opac-registration-verify.pl b/opac/opac-registration-verify.pl
new file mode 100755 (executable)
index 0000000..a45b534
--- /dev/null
@@ -0,0 +1,82 @@
+#!/usr/bin/perl
+
+# 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 Modern::Perl;
+
+use CGI;
+
+use C4::Auth;
+use C4::Output;
+use C4::Members;
+use Koha::Borrower::Modifications;
+
+my $cgi = new CGI;
+my $dbh = C4::Context->dbh;
+
+unless ( C4::Context->preference('PatronSelfRegistration') ) {
+    print $cgi->redirect("/cgi-bin/koha/opac-main.pl");
+    exit;
+}
+
+my $token = $cgi->param('token');
+my $m = Koha::Borrower::Modifications->new( verification_token => $token );
+
+my ( $template, $borrowernumber, $cookie );
+if ( $m->Verify() ) {
+    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+        {
+            template_name   => "opac-registration-confirmation.tmpl",
+            type            => "opac",
+            query           => $cgi,
+            authnotrequired => 1,
+        }
+    );
+
+    $template->param(
+        OpacPasswordChange => C4::Context->preference('OpacPasswordChange') );
+
+    my $borrower = Koha::Borrower::Modifications->GetModifications({ verification_token => $token });
+
+    my $password;
+    ( $borrowernumber, $password ) = AddMember_Opac(%$borrower);
+
+    if ($borrowernumber) {
+        Koha::Borrower::Modifications->DelModifications({ verification_token => $token });
+
+        $template->param( password_cleartext => $password );
+        $template->param(
+            borrower => GetMember( borrowernumber => $borrowernumber ) );
+        $template->param(
+            PatronSelfRegistrationAdditionalInstructions =>
+              C4::Context->preference(
+                'PatronSelfRegistrationAdditionalInstructions')
+        );
+    }
+
+}
+else {
+    ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+        {
+            template_name   => "opac-registration-invalid.tmpl",
+            type            => "opac",
+            query           => $cgi,
+            authnotrequired => 1,
+        }
+    );
+}
+
+output_html_with_http_headers $cgi, $cookie, $template->output;
index bb23752..4ff9478 100755 (executable)
@@ -490,7 +490,7 @@ foreach my $biblioNum (@biblionumbers) {
         # If there is no loan, return and transfer, we show a checkbox.
         $itemLoopIter->{notforloan} = $itemLoopIter->{notforloan} || 0;
 
-        my $branch = C4::Circulation::_GetCircControlBranch($itemLoopIter, $borr);
+        my $branch = ( C4::Context->preference('ReservesControlBranch') eq 'ItemHomeLibrary' ) ? $itemInfo->{'homebranch'} : $borr->{'branchcode'};
 
         my $branchitemrule = GetBranchItemRule( $branch, $itemInfo->{'itype'} );
         my $policy_holdallowed = 1;
@@ -537,6 +537,11 @@ foreach my $biblioNum (@biblionumbers) {
         $biblioLoopIter{holdable} = undef;
         $anyholdable = undef;
     }
+    if(not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowernumber,$biblioNum)) {
+        $biblioLoopIter{holdable} = undef;
+        $biblioLoopIter{already_patron_possession} = 1;
+        $anyholdable = undef;
+    }
 
     push @$biblioLoop, \%biblioLoopIter;
 }
index 73d2c53..9708176 100755 (executable)
@@ -761,6 +761,16 @@ for (my $i=0;$i<@servers;$i++) {
         }
         # no hits
         else {
+            my $nohits = C4::Context->preference('OPACNoResultsFound');
+            if ($nohits and $nohits=~/{QUERY_KW}/){
+                # extracting keywords in case of relaunching search
+                (my $query_kw=$query_desc)=~s/ and|or / /g;
+                $query_kw = Encode::decode_utf8($query_kw);
+                my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g);
+                $query_kw=join('+',@query_kw);
+                $nohits=~s/{QUERY_KW}/$query_kw/g;
+                $template->param('OPACNoResultsFound' =>$nohits);
+            }
             $template->param(
                 searchdesc => 1,
                 query_desc => $query_desc,
index eee3d38..1c942d5 100755 (executable)
@@ -127,7 +127,7 @@ $bordat[0] = $borr;
 # Warningdate is the date that the warning starts appearing
 if ( $borr->{dateexpiry} && C4::Context->preference('NotifyBorrowerDeparture') &&
     Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
-    Date_to_Days( $today_year, $today_month, $today_day ) ) 
+    Date_to_Days( $today_year, $today_month, $today_day ) )
 {
     # borrower card soon to expire, warn the borrower
     $borr->{'warndeparture'} = $borr->{dateexpiry};
@@ -154,58 +154,58 @@ my @issuedat;
 my $itemtypes = GetItemTypes();
 my $issues = GetPendingIssues($borrowernumber);
 if ($issues){
-       foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
-               # check for reserves
-               my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
-               if ( $restype ) {
-                       $issue->{'reserved'} = 1;
-               }
-               
-               my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
-               my $charges = 0;
-               foreach my $ac (@$accts) {
-                       if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
-                               $charges += $ac->{'amountoutstanding'}
-                                 if $ac->{'accounttype'} eq 'F';
-                               $charges += $ac->{'amountoutstanding'}
-                                 if $ac->{'accounttype'} eq 'L';
-                       }
-               }
-               $issue->{'charges'} = $charges;
-
-               # get publictype for icon
-
-               my $publictype = $issue->{'publictype'};
-               $issue->{$publictype} = 1;
-
-               # check if item is renewable
-               my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
-               ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
+    foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
+        # check for reserves
+        my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
+        if ( $restype ) {
+            $issue->{'reserved'} = 1;
+        }
+
+        my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber );
+        my $charges = 0;
+        foreach my $ac (@$accts) {
+            if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) {
+                $charges += $ac->{'amountoutstanding'}
+                  if $ac->{'accounttype'} eq 'F';
+                $charges += $ac->{'amountoutstanding'}
+                  if $ac->{'accounttype'} eq 'L';
+            }
+        }
+        $issue->{'charges'} = $charges;
+
+        # get publictype for icon
+
+        my $publictype = $issue->{'publictype'};
+        $issue->{$publictype} = 1;
+
+        # check if item is renewable
+        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
+        ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
         if($status && C4::Context->preference("OpacRenewalAllowed")){
             $issue->{'status'} = $status;
         }
-               $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many';
-               $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve';
-
-               if ( $issue->{'overdue'} ) {
-                       push @overdues, $issue;
-                       $overdues_count++;
-                       $issue->{'overdue'} = 1;
-               }
-               else {
-                       $issue->{'issued'} = 1;
-               }
-               # imageurl:
-               my $itemtype = $issue->{'itemtype'};
-               if ( $itemtype ) {
-                       $issue->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
-                       $issue->{'description'} = $itemtypes->{$itemtype}->{'description'};
-               }
-               push @issuedat, $issue;
-               $count++;
-               
-               my $isbn = GetNormalizedISBN($issue->{'isbn'});
-               $issue->{normalized_isbn} = $isbn;
+        $issue->{'too_many'} = 1 if $renewerror and $renewerror eq 'too_many';
+        $issue->{'on_reserve'} = 1 if $renewerror and $renewerror eq 'on_reserve';
+
+        if ( $issue->{'overdue'} ) {
+            push @overdues, $issue;
+            $overdues_count++;
+            $issue->{'overdue'} = 1;
+        }
+        else {
+            $issue->{'issued'} = 1;
+        }
+        # imageurl:
+        my $itemtype = $issue->{'itemtype'};
+        if ( $itemtype ) {
+            $issue->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
+            $issue->{'description'} = $itemtypes->{$itemtype}->{'description'};
+        }
+        push @issuedat, $issue;
+        $count++;
+
+        my $isbn = GetNormalizedISBN($issue->{'isbn'});
+        $issue->{normalized_isbn} = $isbn;
 
                 # My Summary HTML
                 if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){
@@ -217,7 +217,7 @@ if ($issues){
                     $issue->{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g;
                     $issue->{MySummaryHTML} = $my_summary_html;
                 }
-       }
+    }
 }
 $template->param( ISSUES       => \@issuedat );
 $template->param( issues_count => $count );
@@ -257,7 +257,7 @@ foreach my $res (@reserves) {
     if ( $res->{'expirationdate'} eq '0000-00-00' ) {
       $res->{'expirationdate'} = '';
     }
-    
+
     my $publictype = $res->{'publictype'};
     $res->{$publictype} = 1;
     $res->{'waiting'} = 1 if $res->{'found'} eq 'W';
@@ -291,7 +291,7 @@ foreach my $res (@reserves) {
         if ( ( $res->{'found'} eq 'W' ) ) {
             my $item = $res->{'itemnumber'};
             $item = GetBiblioFromItemNumber($item,undef);
-            $res->{'wait'}= 1; 
+            $res->{'wait'}= 1;
             $res->{'holdingbranch'}=$item->{'holdingbranch'};
             $res->{'biblionumber'}=$item->{'biblionumber'};
             $res->{'barcode'} = $item->{'barcode'};
@@ -317,7 +317,7 @@ foreach my $res (@reserves) {
     # can be cancelled
     #$res->{'cancelable'} = 1 if ($res->{'wait'} && $res->{'atdestination'} && $res->{'found'} ne "1");
     $res->{'cancelable'} = 1 if    ($res->{wait} and not $res->{found}) or (not $res->{wait} and not $res->{intransit});
-    
+
 }
 
 $template->param( WAITING => \@waiting );
@@ -341,12 +341,12 @@ if (C4::Context->preference('BakerTaylorEnabled')) {
 if (C4::Context->preference("OPACAmazonCoverImages") or 
     C4::Context->preference("GoogleJackets") or
     C4::Context->preference("BakerTaylorEnabled") or
-       C4::Context->preference("SyndeticsCoverImages")) {
+    C4::Context->preference("SyndeticsCoverImages")) {
         $template->param(JacketImages=>1);
 }
 
 if ( GetMessagesCount( $borrowernumber, 'B' ) ) {
-       $template->param( bor_messages => 1 );
+    $template->param( bor_messages => 1 );
 }
 
 if ( $borr->{'opacnote'} ) {
@@ -357,7 +357,7 @@ if ( $borr->{'opacnote'} ) {
 }
 
 $template->param(
-    bor_messages_loop  => GetMessages( $borrowernumber, 'B', 'NONE' ),
+    bor_messages_loop    => GetMessages( $borrowernumber, 'B', 'NONE' ),
     waiting_count      => $wcount,
     patronupdate => $patronupdate,
     OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"),
@@ -368,7 +368,7 @@ $template->param(
 $template->param( DHTMLcalendar_dateformat  => C4::Dates->DHTMLcalendar() );
 $template->param(
     SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
-    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds') ,
+    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
index b3f4398..abcb396 100755 (executable)
@@ -52,5 +52,10 @@ if (C4::Context->preference('SelfCheckHelpMessage')) {
     $template->param(SelfCheckHelpMessage => C4::Context->preference('SelfCheckHelpMessage'));
 }
 
+$template->param(
+    SCOUserJS  => C4::Context->preference('SCOUserJS'),
+    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
+);
+
 output_html_with_http_headers $query, $cookie, $template->output;
 
diff --git a/opac/sco/printslip.pl b/opac/sco/printslip.pl
new file mode 100755 (executable)
index 0000000..e8a5685
--- /dev/null
@@ -0,0 +1,68 @@
+#!/usr/bin/perl
+
+# Copyright 2012 ByWater Solutions
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 printslip.pl
+
+Script to allow SCO patrons to print a receipt for their checkout.
+
+It is called from sco-main.pl
+
+=cut
+
+
+use strict;
+use warnings;
+use CGI;
+use C4::Context;
+use C4::Auth qw/:DEFAULT get_session/;
+use C4::Output;
+use C4::Members;
+use C4::Koha;
+
+my $input = new CGI;
+my $sessionID = $input->cookie("CGISESSID");
+my $session = get_session($sessionID);
+
+my $print = $input->param('print');
+my $error = $input->param('error');
+
+# patrons still need to be able to print receipts
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "/sco/printslip.tmpl",
+        query           => $input,
+        type            => "opac",
+    }
+);
+
+my $borrowernumber = $input->param('borrowernumber');
+my $branch=C4::Context->userenv->{'branch'};
+my ($slip, $is_html);
+if (my $letter = IssueSlip ($session->param('branch') || $branch, $borrowernumber, $print eq "qslip")) {
+    $slip = $letter->{content};
+    $is_html = $letter->{is_html};
+}
+
+$template->{VARS}->{slip} = $slip;
+$template->{VARS}->{plain} = !$is_html;
+$template->{VARS}->{title} = "Print Receipt for $borrowernumber";
+$template->{VARS}->{stylesheet} = C4::Context->preference("SlipCSS");
+$template->{VARS}->{error} = $error;
+
+output_html_with_http_headers $input, $cookie, $template->output;
index 26a8774..25a3594 100755 (executable)
@@ -56,16 +56,16 @@ unless (C4::Context->preference('WebBasedSelfCheck')) {
 
 if (C4::Context->preference('AutoSelfCheckAllowed')) 
 {
-       my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID');
-       my $AutoSelfCheckPass = C4::Context->preference('AutoSelfCheckPass');
-       $query->param(-name=>'userid',-values=>[$AutoSelfCheckID]);
-       $query->param(-name=>'password',-values=>[$AutoSelfCheckPass]);
+    my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID');
+    my $AutoSelfCheckPass = C4::Context->preference('AutoSelfCheckPass');
+    $query->param(-name=>'userid',-values=>[$AutoSelfCheckID]);
+    $query->param(-name=>'password',-values=>[$AutoSelfCheckPass]);
     $query->param(-name=>'koha_login_context',-values=>['sco']);
 }
 my ($template, $loggedinuser, $cookie) = get_template_and_user({
     template_name   => "sco/sco-main.tmpl",
     authnotrequired => 0,
-      flagsrequired => { circulate => "circulate_remaining_permissions" },
+    flagsrequired => { circulate => "circulate_remaining_permissions" },
     query => $query,
     type  => "opac",
     debug => 1,
@@ -91,14 +91,13 @@ $template->param(AllowSelfCheckReturns => $allowselfcheckreturns);
 
 
 my $issuerid = $loggedinuser;
-my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed, $timedout) = (
+my ($op, $patronid, $patronlogin, $patronpw, $barcode, $confirmed) = (
     $query->param("op")         || '',
     $query->param("patronid")   || '',
     $query->param("patronlogin")|| '',
     $query->param("patronpw")   || '',
     $query->param("barcode")    || '',
     $query->param("confirmed")  || '',
-    $query->param("timedout")   || '', #not actually using this...
 );
 
 my $issuenoconfirm = 1; #don't need to confirm on issue.
@@ -239,12 +238,13 @@ if ($borrower->{cardnumber}) {
         patronlogin => $patronlogin,
         patronpw => $patronpw,
         noitemlinks => 1 ,
+        borrowernumber => $borrower->{'borrowernumber'},
     );
     my $inputfocus = ($return_only      == 1) ? 'returnbook' :
                      ($confirm_required == 1) ? 'confirm'    : 'barcode' ;
     $template->param(
         inputfocus => $inputfocus,
-               nofines => 1,
+        nofines => 1,
         "dateformat_" . C4::Context->preference('dateformat') => 1,
     );
     if (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) {
@@ -263,4 +263,9 @@ if ($borrower->{cardnumber}) {
     );
 }
 
+$template->param(
+    SCOUserJS  => C4::Context->preference('SCOUserJS'),
+    SCOUserCSS => C4::Context->preference('SCOUserCSS'),
+);
+
 output_html_with_http_headers $query, $cookie, $template->output;
index 7207e64..de4b0f3 100755 (executable)
@@ -20,8 +20,8 @@
 
 # test comment
 
-use strict;
-#use warnings; FIXME - Bug 2505
+use Modern::Perl;
+
 use C4::Auth;
 use CGI;
 use C4::Context;
@@ -30,6 +30,8 @@ use C4::Output;
 use C4::Koha;
 use C4::Circulation;
 use C4::Dates qw/format_date format_date_in_iso/;
+use C4::Branch;
+use C4::Biblio;
 
 =head1 NAME
 
@@ -53,27 +55,30 @@ $filters[2] = format_date_in_iso( $filters[2] );
 $filters[3] = format_date_in_iso( $filters[3] );
 my $podsp          = $input->param("PlacedOnDisplay");
 my $rodsp          = $input->param("ReceivedOnDisplay");
-my $aodsp          = $input->param("AcquiredOnDisplay");    ##added by mason.
 my $calc           = $input->param("Cellvalue");
 my $output         = $input->param("output");
 my $basename       = $input->param("basename");
 
-my ($template, $borrowernumber, $cookie)
-       = get_template_and_user({template_name => $fullreportname,
-                               query => $input,
-                               type => "intranet",
-                               authnotrequired => 0,
-                               flagsrequired => {reports => '*'},
-                               debug => 1,
-                               });
-our $sep     = $input->param("sep");
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+    {
+        template_name   => $fullreportname,
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { reports => '*' },
+        debug           => 1,
+    }
+);
+
+our $sep     = $input->param("sep") // '';
 $sep = "\t" if ($sep eq 'tabulation');
-$template->param(do_it => $do_it,
-        DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
-               );
+$template->param(
+    do_it                    => $do_it,
+    DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+);
 if ($do_it) {
     my $results =
-      calculate( $line, $column, $podsp, $rodsp, $aodsp, $calc, \@filters );
+      calculate( $line, $column, $podsp, $rodsp, $calc, \@filters );
     if ( $output eq "screen" ) {
         $template->param( mainloop => $results );
         output_html_with_http_headers $input, $cookie, $template->output;
@@ -112,31 +117,15 @@ if ($do_it) {
 }
 else {
     my $dbh = C4::Context->dbh;
-    my @select;
-    my %select;
     my $req;
     $req = $dbh->prepare("SELECT distinctrow id,name FROM aqbooksellers ORDER BY name");
     $req->execute;
-    my @select;
-    push @select, "";
-       $select{''} = "All Suppliers";
-    while ( my ( $value, $desc ) = $req->fetchrow ) {
-        push @select, $desc;
-        $select{$value}=$desc;
-    }
-    my $CGIBookSellers = CGI::scrolling_list(
-        -name   => 'Filter',
-        -id     => 'supplier',
-        -values => \@select,
-        -labels   => \%select,
-        -size     => 1,
-        -multiple => 0
-    );
+    my $booksellers = $req->fetchall_arrayref({});
 
     $req = $dbh->prepare("SELECT DISTINCTROW itemtype,description FROM itemtypes ORDER BY description");
     $req->execute;
-    undef @select;
-    undef %select;
+    my @select;
+    my %select;
     push @select, "";
     $select{''} = "All Item Types";
     while ( my ( $value, $desc ) = $req->fetchrow ) {
@@ -183,11 +172,11 @@ else {
     $select{''} = "All";
     my $hassort1;
     while ( my ($value) = $req->fetchrow ) {
-               if ($value) {
-                       $hassort1 = 1;
-                       push @select, $value;
-                       $select{$value} = $value;
-               }
+        if ($value) {
+            $hassort1 = 1;
+            push @select, $value;
+            $select{$value} = $value;
+        }
     }
     my $CGISort1 = CGI::scrolling_list(
         -name     => 'Filter',
@@ -211,12 +200,12 @@ else {
     my $hglghtsort2;
 
     while ( my ($value) = $req->fetchrow ) {
-               if ($value) {
-                       $hassort2 = 1;
-                       $hglghtsort2 = !($hassort1);
-                       push @select, $value;
-                       $select{$value} = $value;
-               }
+        if ($value) {
+            $hassort2    = 1;
+            $hglghtsort2 = !($hassort1);
+            push @select, $value;
+            $select{$value} = $value;
+        }
     }
     my $CGISort2 = CGI::scrolling_list(
         -name     => 'Filter',
@@ -237,25 +226,40 @@ else {
 
     my $CGIsepChoice = GetDelimiterChoices;
 
+    my $branches = GetBranches;
+    my @branches;
+    foreach ( sort keys %$branches ) {
+        push @branches, $branches->{$_};
+    }
+
+    my $ccode_subfield_structure = GetMarcSubfieldStructureFromKohaField('items.ccode', '');
+    my $ccode_label;
+    my $ccode_avlist;
+    if($ccode_subfield_structure) {
+        $ccode_label = $ccode_subfield_structure->{liblibrarian};
+        $ccode_avlist = GetAuthorisedValues($ccode_subfield_structure->{authorised_value});
+    }
+
     $template->param(
-        CGIBookSeller => $CGIBookSellers,
+        booksellers   => $booksellers,
         CGIItemType   => $CGIItemTypes,
         CGIBudget     => $CGIBudget,
         hassort1      => $hassort1,
         hassort2      => $hassort2,
-        HlghtSort2    => $hglghtsort2,
         CGISort1      => $CGISort1,
         CGISort2      => $CGISort2,
         CGIextChoice  => $CGIextChoice,
         CGIsepChoice  => $CGIsepChoice,
-               date_today => C4::Dates->new()->output()
+        branches      => \@branches,
+        ccode_label   => $ccode_label,
+        ccode_avlist  => $ccode_avlist,
     );
 
 }
 output_html_with_http_headers $input, $cookie, $template->output;
 
 sub calculate {
-    my ( $line, $column, $podsp, $rodsp, $aodsp, $process, $filters ) = @_;
+    my ( $line, $column, $podsp, $rodsp, $process, $filters ) = @_;
     my @mainloop;
     my @loopfooter;
     my @loopcol;
@@ -264,6 +268,9 @@ sub calculate {
     my %globalline;
     my $grantotal = 0;
 
+    $podsp ||= 0;
+    $rodsp ||= 0;
+
     # extract parameters
     my $dbh = C4::Context->dbh;
 
@@ -271,109 +278,93 @@ sub calculate {
     # Checking filters
     #
     my @loopfilter;
-    for ( my $i = 0 ; $i <= 8 ; $i++ ) {
-        my %cell;
-        if ( @$filters[$i] ) {
+    for ( my $i = 0 ; $i <= @$filters ; $i++ ) {
+        if( defined @$filters[$i] and @$filters[$i] ne '' ) {
+            my %cell;
             if ( ( ( $i == 1 ) or ( $i == 3 ) ) and ( @$filters[ $i - 1 ] ) ) {
-                $cell{err} = 1 if ( @$filters[$i] < @$filters[ $i - 1 ] );
+                $cell{err} = 1 if ( @$filters[$i] lt @$filters[ $i - 1 ] );
             }
             # format the dates filters, otherwise just fill as is
-            if ($i>=4) {
-                $cell{filter} .= @$filters[$i];
+            if ($i >= 4) {
+                $cell{filter} = @$filters[$i];
             } else {
-                $cell{filter} .= format_date(@$filters[$i]);
+                $cell{filter} = format_date(@$filters[$i]);
             }
-            $cell{crit}   .= "Placed On From" if ( $i == 0 );
-            $cell{crit}   .= "Placed On To" if ( $i == 1 );
-            $cell{crit}   .= "Received On From" if ( $i == 2 );
-            $cell{crit}   .= "Received On To" if ( $i == 3 );
-
-#            $cell{crit} .= "Acquired On From" if ( $i == 4 );
-#            $cell{crit} .= "Acquired On To"   if ( $i == 5 );
-
-            $cell{crit} .= "BookSeller" if ( $i == 4 );
-            $cell{crit} .= "Doc Type"   if ( $i == 5 );
-            $cell{crit} .= "Budget"     if ( $i == 6 );
-            $cell{crit} .= "Sort1"      if ( $i == 7 );
-            $cell{crit} .= "Sort2"      if ( $i == 8 );
+            $cell{crit} = $i;
             push @loopfilter, \%cell;
         }
     }
 
-    my @linefilter;
-
-    $linefilter[0] = @$filters[0] if ( $line =~ /closedate/ );
-    $linefilter[1] = @$filters[1] if ( $line =~ /closedate/ );
-    $linefilter[0] = @$filters[2] if ( $line =~ /received/ );
-    $linefilter[1] = @$filters[3] if ( $line =~ /received/ );
-
-    $linefilter[0] = @$filters[4]  if ( $line =~ /bookseller/ );
-    $linefilter[0] = @$filters[5]  if ( $line =~ /itemtype/ );
-    $linefilter[0] = @$filters[6]  if ( $line =~ /budget/ );
-    $linefilter[0] = @$filters[7]  if ( $line =~ /sort1/ );
-    $linefilter[0] = @$filters[8] if ( $line =~ /sort2/ );
-
-    my @colfilter;
-    $colfilter[0] = @$filters[0] if ( $column =~ /closedate/ );
-    $colfilter[1] = @$filters[1] if ( $column =~ /closedate/ );
-    $colfilter[0] = @$filters[2] if ( $column =~ /received/ );
-    $colfilter[1] = @$filters[3] if ( $column =~ /received/ );
-
-    $colfilter[0] = @$filters[4]  if ( $column =~ /bookseller/ );
-    $colfilter[0] = @$filters[5]  if ( $column =~ /itemtype/ );
-    $colfilter[0] = @$filters[6]  if ( $column =~ /budget/ );
-    $colfilter[0] = @$filters[7]  if ( $column =~ /sort1/ );
-    $colfilter[0] = @$filters[8]  if ( $column =~ /sort2/ );
-
-    # 1st, loop rows.
-    my $linefield;
-    if ( ( $line =~ /closedate/ ) and ( $podsp == 1 ) ) {
-
-        #Display by day
-        $linefield .= "concat(hex(weekday($line)+1),'-',dayname($line))";
-    }
-    elsif ( ( $line =~ /closedate/ ) and ( $podsp == 2 ) ) {
-
-        #Display by Month
-        $linefield .= "concat(hex(month($line)),'-',monthname($line))";
-    }
-    elsif ( ( $line =~ /closedate/ ) and ( $podsp == 3 ) ) {
-
-        #Display by Year
-        $linefield .= "Year($line)";
-
-    }
-    elsif ( ( $line =~ /received/ ) and ( $rodsp == 1 ) ) {
-
-        #Display by day
-        $linefield .= "concat(hex(weekday($line)+1),'-',dayname($line))";
-    }
-    elsif ( ( $line =~ /received/ ) and ( $rodsp == 2 ) ) {
-
-        #Display by Month
-        $linefield .= "concat(hex(month($line)),'-',monthname($line))";
+    my %filter;
+    my %field;
+    foreach ($line, $column) {
+        $filter{$_} = [];
+        $field{$_} = $_;
+        given ($_) {
+            when (/closedate/) {
+                $filter{$_}->[0] = @$filters[0];
+                $filter{$_}->[1] = @$filters[1];
+                my $a = $_;
+                given ($podsp) {
+                    when (1) { $field{$a} = "concat(hex(weekday($a)+1),'-',dayname($a))" }
+                    when (2) { $field{$a} = "concat(hex(month($a)),'-',monthname($a))" }
+                    when (3) { $field{$a} = "Year($a)" }
+                    default  { $field{$a} = $a }
+                }
+            }
+            when (/received/) {
+                $filter{$_}->[0] = @$filters[2];
+                $filter{$_}->[1] = @$filters[3];
+                my $a = $_;
+                given ($rodsp) {
+                    when (1) { $field{$a} = "concat(hex(weekday($a)+1),'-',dayname($a))" }
+                    when (2) { $field{$a} = "concat(hex(month($a)),'-',monthname($a))" }
+                    when (3) { $field{$a} = "Year($a)" }
+                    default  { $field{$a} = $a }
+                }
+            }
+            when (/bookseller/) {
+                $filter{$_}->[0] = @$filters[4];
+            }
+            when (/homebranch/) {
+                $filter{$_}->[0] = @$filters[5];
+            }
+            when (/ccode/) {
+                $filter{$_}->[0] = @$filters[6];
+            }
+            when (/itemtype/) {
+                $filter{$_}->[0] = @$filters[7];
+            }
+            when (/budget/) {
+                $filter{$_}->[0] = @$filters[8];
+            }
+            when (/sort1/) {
+                $filter{$_}->[0] = @$filters[9];
+            }
+            when (/sort2/) {
+                $filter{$_}->[0] = @$filters[10];
+            }
+        }
     }
-    elsif ( ( $line =~ /received/ ) and ( $rodsp == 3 ) ) {
 
-        #Display by Year
-        $linefield .= "Year($line)";
+    my @linefilter = @{ $filter{$line} };
+    my $linefield = $field{$line};
+    my @colfilter = @{ $filter{$column} };
+    my $colfield = $field{$column};
 
-    }
-    else {
-        $linefield .= $line;
-    }
-
-    my $strsth;
-    $strsth .=
-      "SELECT DISTINCTROW $linefield FROM (aqorders, aqbasket )
-                LEFT JOIN items ON (aqorders.biblionumber= items.biblionumber)
-                LEFT JOIN biblioitems ON (aqorders.biblionumber= biblioitems.biblionumber)
-                LEFT JOIN aqbudgets  ON (aqorders.budget_id = aqbudgets.budget_id )
-
-                LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id) WHERE (aqorders.basketno=aqbasket.basketno)
-                AND $line IS NOT NULL AND $line <> '' ";
-    
-       if (@linefilter) {
+    # 1st, loop rows.
+    my $strsth = "
+        SELECT DISTINCTROW $linefield
+        FROM aqorders
+          LEFT JOIN aqbasket ON (aqorders.basketno = aqbasket.basketno)
+          LEFT JOIN aqorders_items ON (aqorders.ordernumber = aqorders_items.ordernumber)
+          LEFT JOIN items ON (aqorders_items.itemnumber = items.itemnumber)
+          LEFT JOIN biblioitems ON (aqorders.biblionumber = biblioitems.biblionumber)
+          LEFT JOIN aqbudgets  ON (aqorders.budget_id = aqbudgets.budget_id )
+          LEFT JOIN aqbooksellers ON (aqbasket.booksellerid = aqbooksellers.id)
+        WHERE $line IS NOT NULL AND $line <> '' ";
+
+    if (@linefilter) {
         if ( $linefilter[1] ) {
             if ( $linefilter[0] ) {
                 $strsth .= " AND $line BETWEEN ? AND ? ";
@@ -408,62 +399,27 @@ sub calculate {
     else {
         $sth->execute;
     }
-       while ( my ($celvalue) = $sth->fetchrow ) {
-               my %cell;
-               if ($celvalue) {
-                       $cell{rowtitle} = $celvalue;
-                       push @loopline, \%cell;
-               }
-               $cell{totalrow} = 0;
-       }
-    # 2nd, loop cols.
-    my $colfield;
-    if ( ( $column =~ /closedate/ ) and ( $podsp == 1 ) ) {
-
-        #Display by day
-        $colfield .= "concat(hex(weekday($column)+1),'-',dayname($column))";
-    }
-    elsif ( ( $column =~ /closedate/ ) and ( $podsp == 2 ) ) {
-
-        #Display by Month
-        $colfield .= "concat(hex(month($column)),'-',monthname($column))";
-    }
-    elsif ( ( $column =~ /closedate/ ) and ( $podsp == 3 ) ) {
-
-        #Display by Year
-        $colfield .= "Year($column)";
-
-    }
-    elsif ( ( $column =~ /received/ ) and ( $rodsp == 1 ) ) {
-
-        #Display by day
-        $colfield .= "concat(hex(weekday($column)+1),'-',dayname($column))";
-    }
-    elsif ( ( $column =~ /received/ ) and ( $rodsp == 2 ) ) {
-
-        #Display by Month
-        $colfield .= "concat(hex(month($column)),'-',monthname($column))";
-    }
-    elsif ( ( $column =~ /received/ ) and ( $rodsp == 3 ) ) {
-
-        #Display by Year
-        $colfield .= "Year($column)";
-
-    }
-    else {
-        $colfield .= $column;
+    while ( my ($celvalue) = $sth->fetchrow ) {
+        my %cell;
+        if ($celvalue) {
+            $cell{rowtitle} = $celvalue;
+            push @loopline, \%cell;
+        }
+        $cell{totalrow} = 0;
     }
 
-    my $strsth2;
-    $strsth2 .=
-      "SELECT distinctrow $colfield FROM (aqorders, aqbasket )
-                 LEFT JOIN items ON (aqorders.biblionumber= items.biblionumber)
-                 LEFT JOIN biblioitems ON (aqorders.biblionumber= biblioitems.biblionumber)
-                 LEFT JOIN aqbudgets  ON (aqorders.budget_id = aqbudgets.budget_id )
-
-                 LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id)
-                 WHERE (aqorders.basketno=aqbasket.basketno) AND 
-                 $column IS NOT NULL AND $column <> '' ";
+    # 2nd, loop cols.
+    my $strsth2 = "
+        SELECT DISTINCTROW $colfield
+        FROM aqorders
+          LEFT JOIN aqbasket ON (aqorders.basketno = aqbasket.basketno)
+          LEFT JOIN aqorders_items ON (aqorders.ordernumber = aqorders_items.ordernumber)
+          LEFT JOIN items ON (aqorders_items.itemnumber = items.itemnumber)
+          LEFT JOIN biblioitems ON (aqorders.biblionumber = biblioitems.biblionumber)
+          LEFT JOIN aqbudgets  ON (aqorders.budget_id = aqbudgets.budget_id )
+          LEFT JOIN aqbooksellers ON (aqbasket.booksellerid = aqbooksellers.id)
+        WHERE $column IS NOT NULL AND $column <> ''
+    ";
 
     if (@colfilter) {
         if ( $colfilter[1] ) {
@@ -488,7 +444,6 @@ sub calculate {
         }
     }
 
-
     $strsth2 .= " GROUP BY $colfield";
     $strsth2 .= " ORDER BY $colfield";
 
@@ -503,13 +458,13 @@ sub calculate {
     else {
         $sth2->execute;
     }
-       while ( my $celvalue = $sth2->fetchrow ) {
-               my %cell;
-               if ($celvalue) {
-                       $cell{coltitle} = $celvalue;
-                       push @loopcol, \%cell;
-               }
-       }
+    while ( my $celvalue = $sth2->fetchrow ) {
+        my %cell;
+        if ($celvalue) {
+            $cell{coltitle} = $celvalue;
+            push @loopcol, \%cell;
+        }
+    }
 
     my $i = 0;
     my @totalcol;
@@ -528,18 +483,26 @@ sub calculate {
     # preparing calculation
     my $strcalc;
     $strcalc .= "SELECT $linefield, $colfield, ";
-    $strcalc .= "SUM( aqorders.quantity ) " if ( $process == 1 );
-    $strcalc .= "SUM( aqorders.quantity * aqorders.listprice ) "
-      if ( $process == 2 );
-    $strcalc .= "FROM (aqorders, aqbasket )
-                 LEFT JOIN items ON (aqorders.biblionumber= items.biblionumber)
-                 LEFT JOIN biblioitems ON (aqorders.biblionumber= biblioitems.biblionumber)
-                 LEFT JOIN aqbudgets  ON (aqorders.budget_id = aqbudgets.budget_id )
-
-                 LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id) 
-                 WHERE (aqorders.basketno=aqbasket.basketno) ";
-    
-       @$filters[0] =~ s/\*/%/g if ( @$filters[0] );
+    given ($process) {
+        when (1) { $strcalc .= "COUNT(*) " }
+        when (2) { $strcalc .= "COUNT(DISTINCT(aqorders.biblionumber)) " }
+        when ([3,4,5]) { $strcalc .= "SUM(aqorders.listprice) " }
+        default { $strcalc .= "NULL " }
+    }
+    $strcalc .= "
+        FROM aqorders
+          LEFT JOIN aqbasket ON (aqorders.basketno = aqbasket.basketno)
+          LEFT JOIN aqorders_items ON (aqorders.ordernumber = aqorders_items.ordernumber)
+          LEFT JOIN items ON (aqorders_items.itemnumber = items.itemnumber)
+          LEFT JOIN biblioitems ON (aqorders.biblionumber = biblioitems.biblionumber)
+          LEFT JOIN aqbudgets ON (aqorders.budget_id = aqbudgets.budget_id )
+          LEFT JOIN aqbooksellers ON (aqbasket.booksellerid = aqbooksellers.id)
+        WHERE aqorders.datecancellationprinted IS NULL ";
+    $strcalc .= " AND (aqorders.datereceived IS NULL OR aqorders.datereceived = '') "
+        if ( $process == 4 );
+    $strcalc .= " AND aqorders.datereceived IS NOT NULL AND aqorders.datereceived <> '' "
+        if ( $process == 5 );
+    @$filters[0] =~ s/\*/%/g if ( @$filters[0] );
     $strcalc .= " AND aqbasket.closedate >= '" . @$filters[0] . "'"
       if ( @$filters[0] );
     @$filters[1] =~ s/\*/%/g if ( @$filters[1] );
@@ -554,20 +517,23 @@ sub calculate {
     @$filters[4] =~ s/\*/%/g if ( @$filters[4] );
     $strcalc .= " AND aqbooksellers.name LIKE '" . @$filters[4] . "'"
       if ( @$filters[4] );
-    @$filters[5] =~ s/\*/%/g if ( @$filters[5] );
-    $strcalc .= " AND biblioitems.itemtype LIKE '" . @$filters[5] . "'"
+    $strcalc .= " AND items.homebranch = '" . @$filters[5] . "'"
       if ( @$filters[5] );
     @$filters[6] =~ s/\*/%/g if ( @$filters[6] );
-    $strcalc .= " AND aqbudgets.budget_code LIKE '" . @$filters[6] . "'"
+    $strcalc .= " AND items.ccode = '" . @$filters[6] . "'"
       if ( @$filters[6] );
     @$filters[7] =~ s/\*/%/g if ( @$filters[7] );
-    $strcalc .= " AND aqorders.sort1 LIKE '" . @$filters[7] . "'"
+    $strcalc .= " AND biblioitems.itemtype LIKE '" . @$filters[7] . "'"
       if ( @$filters[7] );
     @$filters[8] =~ s/\*/%/g if ( @$filters[8] );
-    $strcalc .= " AND aqorders.sort2 LIKE '" . @$filters[8] . "'"
+    $strcalc .= " AND aqbudgets.budget_code LIKE '" . @$filters[8] . "'"
       if ( @$filters[8] );
-
-    $strcalc .= " AND aqorders.datecancellationprinted is NULL ";
+    @$filters[9] =~ s/\*/%/g if ( @$filters[9] );
+    $strcalc .= " AND aqorders.sort1 LIKE '" . @$filters[9] . "'"
+      if ( @$filters[9] );
+    @$filters[10] =~ s/\*/%/g if ( @$filters[10] );
+    $strcalc .= " AND aqorders.sort2 LIKE '" . @$filters[10] . "'"
+      if ( @$filters[10] );
 
     $strcalc .= " GROUP BY $linefield, $colfield ORDER BY $linefield,$colfield";
     my $dbcalc = $dbh->prepare($strcalc);
@@ -575,8 +541,6 @@ sub calculate {
 
     my $emptycol;
     while ( my ( $row, $col, $value ) = $dbcalc->fetchrow ) {
-               next if ($row eq undef || $col eq undef);
-
         $emptycol = 1         if ( !defined($col) );
         $col      = "zzEMPTY" if ( !defined($col) );
         $row      = "zzEMPTY" if ( !defined($row) );
@@ -594,15 +558,17 @@ sub calculate {
         # and the number matches the number of columns
         foreach my $col (@loopcol) {
             my $value = $table{$row}->{ ( $col->{coltitle} eq "NULL" ) ? "zzEMPTY" : $col->{coltitle} };
+            $value = sprintf("%.2f", $value) if($value and grep /$process/, (3,4,5));
             push @loopcell, { value => $value };
         }
-        push @looprow,
-          {
-            'rowtitle' => ( $row eq "zzEMPTY" ) ? "NULL" : $row,
-            'loopcell'  => \@loopcell,
-            'hilighted' => ( $hilighted > 0 ),
-            'totalrow'  => $table{$row}->{totalrow}
-          };
+        my $r = {
+            rowtitle => ( $row eq "zzEMPTY" ) ? "NULL" : $row,
+            loopcell  => \@loopcell,
+            hilighted => ( $hilighted > 0 ),
+            totalrow  => $table{$row}->{totalrow}
+        };
+        $r->{totalrow} = sprintf("%.2f", $r->{totalrow}) if($r->{totalrow} and grep /$process/, (3,4,5));
+        push @looprow, $r;
         $hilighted = -$hilighted;
     }
 
@@ -617,17 +583,19 @@ sub calculate {
                 : $col->{coltitle}
               };
         }
+        $total = sprintf("%.2f", $total) if($total and grep /$process/, (3,4,5));
 
         push @loopfooter, { 'totalcol' => $total };
     }
 
     # the header of the table
-       $globalline{loopfilter}=\@loopfilter;
+    $globalline{loopfilter} = \@loopfilter;
     # the core of the table
     $globalline{looprow} = \@looprow;
     $globalline{loopcol} = \@loopcol;
 
     #       # the foot (totals by borrower type)
+    $grantotal = sprintf("%.2f", $grantotal) if ($grantotal and grep /$process/, (3,4,5));
     $globalline{loopfooter} = \@loopfooter;
     $globalline{total}      = $grantotal;
     $globalline{line}       = $line;
index aae96c9..f27ce10 100755 (executable)
@@ -108,7 +108,7 @@ elsif ( $phase eq 'New Term step 4' ) {
         if ( $type eq 'DATE' || $type eq 'DATETIME' ) {
             $tmp_hash{'date'} = 1;
         }
-        if ( $type eq 'TEXT' ) {
+        if ($type eq 'TEXT' || $type eq 'MEDIUMTEXT'){
             $tmp_hash{'text'} = 1;
         }
 
index 9aff54b..36f7cc5 100755 (executable)
@@ -96,9 +96,19 @@ if($do_it){
     while(my $row = $sth->fetchrow_hashref){
         $row->{'enddate'} = format_date(GetExpirationDate($row->{'subscriptionid'}));
         $row->{'startdate'} = format_date($row->{'startdate'});
-        push @datas, $row if ($expired || (not $expired && not HasSubscriptionExpired($row->{subscriptionid})) );
+        $row->{expired} = HasSubscriptionExpired($row->{subscriptionid});
+        push @datas, $row if (
+            $expired
+            or (
+                not $expired
+                and (
+                    not $row->{expired}
+                    and not $row->{closed}
+                )
+            )
+        );
     }
-    
+
     if($output eq 'screen'){
         $template->param(datas => \@datas,
                          do_it => 1);
index c34a614..705f4f6 100755 (executable)
@@ -244,9 +244,16 @@ foreach my $biblionumber (@biblionumbers) {
     my $dat          = GetBiblioData($biblionumber);
 
     unless ( CanBookBeReserved($borrowerinfo->{borrowernumber}, $biblionumber) ) {
-               $warnings = 1;
+               $warnings = 1;
         $maxreserves = 1;
     }
+
+    my $alreadypossession;
+    if (not C4::Context->preference('AllowHoldsOnPatronsPossessions') and CheckIfIssuedToPatron($borrowerinfo->{borrowernumber},$biblionumber)) {
+        $warnings = 1;
+        $alreadypossession = 1;
+    }
+
     # get existing reserves .....
     my ( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1);
     my $totalcount = $count;
@@ -268,7 +275,8 @@ foreach my $biblionumber (@biblionumbers) {
     $template->param( alreadyreserved => $alreadyreserved,
                       messages => $messages,
                       warnings => $warnings,
-                                         maxreserves=>$maxreserves
+                 maxreserves=>$maxreserves,
+                     alreadypossession => $alreadypossession,
                                          );
 
 
index bf4b6e9..e831854 100755 (executable)
@@ -79,6 +79,7 @@ if ($date) {
 
         $subscription->{expirationdate} = $expirationdate;
         next if $expirationdate !~ /\d{4}-\d{2}-\d{2}/; # next if not in ISO format.
+        next if $subscription->{closed};
         if ( Date_to_Days(split "-",$expirationdate) < Date_to_Days(split "-",$date) &&
                         Date_to_Days(split "-",$expirationdate) > Date_to_Days(&Today) ) {
             $subscription->{expirationdate}=format_date($subscription->{expirationdate});
index 4393546..ad57e07 100755 (executable)
@@ -101,8 +101,10 @@ my $subscriptioncount;
 my ($location, $callnumber);
 if (@subscriptionid){
    my @subscriptioninformation=();
+   my $closed = 0;
    foreach my $subscriptionid (@subscriptionid){
     my $subs= GetSubscription($subscriptionid);
+    $closed = 1 if $subs->{closed};
     $subs->{opacnote}     =~ s/\n/\<br\/\>/g;
     $subs->{missinglist}  =~ s/\n/\<br\/\>/g;
     $subs->{recievedlist} =~ s/\n/\<br\/\>/g;
@@ -127,6 +129,7 @@ if (@subscriptionid){
     my $tmpsubscription= GetFullSubscription($subscriptionid);
     @subscriptioninformation=(@$tmpsubscription,@subscriptioninformation);
   }
+  $template->param(closed => $closed);
   $subscriptions=PrepareSerialsData(\@subscriptioninformation);
   $subscriptioncount = CountSubscriptionFromBiblionumber($subscriptiondescs->[0]{'biblionumber'});
 } else {
@@ -169,6 +172,7 @@ $template->param(
           callnumber          => $callnumber,
           uc(C4::Context->preference("marcflavour")) => 1,
           serialsadditems   => $subscriptiondescs->[0]{'serialsadditems'},
+          dateformatmetric   => C4::Context->preference("dateformat") eq "metric" ? 1 : 0,
           );
 
 output_html_with_http_headers $query, $cookie, $template->output;
index bb87c5f..66d3a4e 100755 (executable)
@@ -151,6 +151,7 @@ foreach my $serialid (@serialids) {
             )
             || $serinfo->{'cannotedit'}
         );
+        $serinfo->{editdisable} ||= ($serinfo->{status8} and $serinfo->{closed});
         push @serialdatalist, $serinfo;
         $processedserialid{$serialid} = 1;
     }
index ac5d0d3..aaf64e6 100755 (executable)
@@ -46,6 +46,8 @@ my $biblionumber  = $query->param('biblionumber') || '';
 my $branch        = $query->param('branch_filter') || '';
 my $routing       = $query->param('routing') || C4::Context->preference("RoutingSerials");
 my $searched      = $query->param('searched') || 0;
+my @subscriptionids = $query ->param('subscriptionid');
+my $op            = $query->param('op');
 
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     {
@@ -58,6 +60,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
     }
 );
 
+if ( $op and $op eq "close" ) {
+    for my $subscriptionid ( @subscriptionids ) {
+        C4::Serials::CloseSubscription( $subscriptionid );
+    }
+} elsif ( $op and $op eq "reopen" ) {
+    for my $subscriptionid ( @subscriptionids ) {
+        C4::Serials::ReopenSubscription( $subscriptionid );
+    }
+}
+
 my @subscriptions;
 if ($searched){
     @subscriptions = SearchSubscriptions(
@@ -81,6 +93,15 @@ if ($routing) {
     }
 }
 
+my (@openedsubscriptions, @closedsubscriptions);
+for my $sub ( @subscriptions ) {
+    unless ( $sub->{closed} ) {
+        push @openedsubscriptions, $sub;
+    } else {
+        push @closedsubscriptions, $sub;
+    }
+}
+
 my $branches = GetBranches();
 my @branches_loop;
 foreach (sort keys %$branches){
@@ -94,7 +115,9 @@ foreach (sort keys %$branches){
 }
 
 $template->param(
-    subscriptions => \@subscriptions,
+    openedsubscriptions => \@openedsubscriptions,
+    closedsubscriptions => \@closedsubscriptions,
+    total         => @openedsubscriptions + @closedsubscriptions,
     title_filter  => $title,
     ISSN_filter   => $ISSN,
     EAN_filter    => $EAN,
index f3a50ac..009360b 100755 (executable)
@@ -34,6 +34,13 @@ my $issueconfirmed = $query->param('issueconfirmed');
 my $dbh = C4::Context->dbh;
 my ($template, $loggedinuser, $cookie, $hemisphere);
 my $subscriptionid = $query->param('subscriptionid');
+
+if ( $op and $op eq "close" ) {
+    C4::Serials::CloseSubscription( $subscriptionid );
+} elsif ( $op and $op eq "reopen" ) {
+    C4::Serials::ReopenSubscription( $subscriptionid );
+}
+
 my $subs = GetSubscription($subscriptionid);
 
 $subs->{enddate} = GetExpirationDate($subscriptionid);
index 3a3df52..8bb3661 100644 (file)
@@ -38,7 +38,12 @@ foreach my $file (@files){
        $line++;
        if (/XXX/i) {
            #two lines are an exception for updatedatabase (routine SetVersion and TransferToNum)
-           next if $file=~ /updatedatabase/ && ( /s\/XXX\$\/999\/;/ || /\$_\[0\]=~ \/XXX\$\/;/ );
+           next
+               if $file =~ /updatedatabase/
+                  && (   /s\/XXX\$\/999\/;/
+                      || /\$_\[0\]=~ \/XXX\$\/;/
+                      || /version contains XXX/
+                      || /\$proposed_version =~ m\/XXX\// );
            $xxx_found = 1;
           last;
        }
index 80058bb..5a4a5b1 100644 (file)
@@ -29,7 +29,7 @@ REAL_REWRITE_SCRIPT = ../rewrite-config.PL
 ZEBRA_CONF_DIR = run/etc/zebradb
 ZEBRA_CONF_FILES = $(ZEBRA_CONF_DIR)/etc/passwd $(ZEBRA_CONF_DIR)/zebra-biblios.cfg $(ZEBRA_CONF_DIR)/zebra-authorities.cfg $(ZEBRA_CONF_DIR)/zebra-authorities-dom.cfg $(ZEBRA_CONF_DIR)/explain-authorities.xml $(ZEBRA_CONF_DIR)/explain-biblios.xml $(ZEBRA_CONF_DIR)/retrieval-info-auth-grs1.xml $(ZEBRA_CONF_DIR)/retrieval-info-auth-dom.xml $(ZEBRA_CONF_DIR)/ccl.properties $(ZEBRA_CONF_DIR)/cql.properties $(ZEBRA_CONF_DIR)/pqf.properties
 
-SCRIPTS = koha-zebra-ctl.sh koha-pazpar2-ctl.sh
+SCRIPTS = koha-zebra-ctl.sh koha-pazpar2-ctl.sh koha-index-daemon-ctl.sh
 SRC_SCRIPT_DIR = ../misc/bin
 TEST_SCRIPT_DIR = run/bin
 
index 5aba165..152fc53 100755 (executable)
@@ -37,7 +37,7 @@ my $dbh = C4::Context->dbh();
 
 $dbh->{mock_add_resultset} = $members_attributetypes;
 
-my @members_attributetypes = C4::Members::AttributeTypes::GetAttributeTypes();
+my @members_attributetypes = C4::Members::AttributeTypes::GetAttributeTypes(undef, 1);
 
 is( $members_attributetypes[0]->{'code'}, 'one', 'First code value is one' );
 
index 5105e84..32ea441 100755 (executable)
@@ -23,6 +23,11 @@ ok($koha = C4::Context->new,  'C4::Context->new');
 ok($dbh = C4::Context->dbh(), 'Getting dbh from C4::Context');
 ok($ret = C4::Context->KOHAVERSION, '  (function)  KOHAVERSION = ' . ($ret||''));
 ok($ret =       $koha->KOHAVERSION, '       $koha->KOHAVERSION = ' . ($ret||''));
+ok(
+    TransformVersionToNum( C4::Context->final_linear_version ) <=
+      TransformVersionToNum( C4::Context->KOHAVERSION ),
+    'Final linear version is less than or equal to kohaversion.pl'
+);
 my @keys = keys %$koha;
 diag("Number of keys in \%\$koha: " . scalar @keys); 
 our $width = 0;
@@ -104,4 +109,16 @@ is(scalar(@{$history}), 0, 'Did not retrieve syspref from database');
 
 done_testing();
 
+sub TransformVersionToNum {
+    my $version = shift;
+
+    # remove the 3 last . to have a Perl number
+    $version =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
+
+    # three X's at the end indicate that you are testing patch with dbrev
+    # change it into 999
+    # prevents error on a < comparison between strings (should be: lt)
+    $version =~ s/XXX$/999/;
+    return $version;
+}
 1;
diff --git a/t/db_dependent/Koha_borrower_modifications.t b/t/db_dependent/Koha_borrower_modifications.t
new file mode 100755 (executable)
index 0000000..9849502
--- /dev/null
@@ -0,0 +1,125 @@
+#!/usr/bin/perl
+
+use Modern::Perl;
+use Test::More tests => 14;
+
+use C4::Context;
+use C4::Members;
+
+use Koha::Borrower::Modifications;
+
+C4::Context->dbh->do("TRUNCATE TABLE borrower_modifications");
+
+## Create new pending modification
+Koha::Borrower::Modifications->new( verification_token => '1234567890' )
+  ->AddModifications( { surname => 'Hall', firstname => 'Kyle' } );
+
+## Get the new pending modification
+my $borrower = Koha::Borrower::Modifications->GetModifications(
+    { verification_token => '1234567890' } );
+
+## Verify we get the same data
+ok( $borrower->{'surname'} = 'Hall',
+    'Test AddModifications() and GetModifications()' );
+
+## Check the Verify method
+ok(
+    Koha::Borrower::Modifications->Verify('1234567890'),
+    'Test that Verify() succeeds with a valid token'
+);
+
+## Delete the pending modification
+$borrower = Koha::Borrower::Modifications->DelModifications(
+    { verification_token => '1234567890' } );
+
+## Verify it's no longer in the database
+$borrower = Koha::Borrower::Modifications->GetModifications(
+    { verification_token => '1234567890' } );
+ok( !defined( $borrower->{'surname'} ), 'Test DelModifications()' );
+
+## Check the Verify method
+ok(
+    !Koha::Borrower::Modifications->Verify('1234567890'),
+    'Test that Verify() method fails for a bad token'
+);
+
+## Create new pending modification, but for an existing borrower
+Koha::Borrower::Modifications->new( borrowernumber => '2' )
+  ->AddModifications( { surname => 'Hall', firstname => 'Kyle' } );
+
+## Test the counter
+ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1,
+    'Test GetPendingModificationsCount()' );
+
+## Create new pending modification for another existing borrower
+Koha::Borrower::Modifications->new( borrowernumber => '3' )
+  ->AddModifications( { surname => 'Smith', firstname => 'Sandy' } );
+
+## Test the counter
+ok(
+    Koha::Borrower::Modifications->GetPendingModificationsCount() == 2,
+'Add a new pending modification and test GetPendingModificationsCount() again'
+);
+
+## Check GetPendingModifications
+my $pending = Koha::Borrower::Modifications->GetPendingModifications();
+ok(
+    $pending->[0]->{'firstname'} eq 'Sandy',
+    'Test GetPendingModifications() again'
+);
+ok( $pending->[1]->{'firstname'} eq 'Kyle', 'Test GetPendingModifications()' );
+
+## This should delete the row from the table
+Koha::Borrower::Modifications->DenyModifications('3');
+
+## Test the counter
+ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1,
+    'Test DenyModifications()' );
+
+## Save a copy of the borrowers original data
+my $old_borrower = GetMember( borrowernumber => '2' );
+
+## Apply the modifications
+Koha::Borrower::Modifications->ApproveModifications('2');
+
+## Test the counter
+ok(
+    Koha::Borrower::Modifications->GetPendingModificationsCount() == 0,
+    'Test ApproveModifications() removes pending modification from db'
+);
+
+## Get a copy of the borrowers current data
+my $new_borrower = GetMember( borrowernumber => '2' );
+
+## Check to see that the approved modifications were saved
+ok( $new_borrower->{'surname'} eq 'Hall',
+    'Test ApproveModifications() applys modification to borrower' );
+
+## Now let's put it back the way it was
+Koha::Borrower::Modifications->new( borrowernumber => '2' )->AddModifications(
+    {
+        surname   => $old_borrower->{'surname'},
+        firstname => $old_borrower->{'firstname'}
+    }
+);
+
+## Test the counter
+ok( Koha::Borrower::Modifications->GetPendingModificationsCount() == 1,
+    'Test GetPendingModificationsCount()' );
+
+## Apply the modifications
+Koha::Borrower::Modifications->ApproveModifications('2');
+
+## Test the counter
+ok(
+    Koha::Borrower::Modifications->GetPendingModificationsCount() == 0,
+    'Test ApproveModifications() removes pending modification from db, again'
+);
+
+$new_borrower = GetMember( borrowernumber => '2' );
+
+## Test to verify the borrower has been updated with the original values
+ok(
+    $new_borrower->{'surname'} eq $old_borrower->{'surname'},
+    'Test ApproveModifications() applys modification to borrower, again'
+);
index 601c48f..f69e1cb 100644 (file)
@@ -818,7 +818,7 @@ sub stop_zebrasrv {
 
 sub start_zebraqueue_daemon {
 
-    my $command = q(echo "zebraqueue_daemon is deprecated");
+    my $command = q(run/bin/koha-index-daemon-ctl.sh start);
     diag $command;
     my $started = system( $command );
     diag "started: $started";
@@ -832,7 +832,7 @@ sub start_zebraqueue_daemon {
 
 sub stop_zebraqueue_daemon {
 
-    my $command = q(echo "zebraqueue_daemon is deprecated");
+    my $command = q(run/bin/koha-index-daemon-ctl.sh stop);
     diag $command;
     my $started = system( $command );
     diag "started: $started";
index 2c68bd3..2a87b88 100755 (executable)
@@ -266,7 +266,13 @@ if ($op eq "show"){
 # now, build the item form for entering a new item
 my @loop_data =();
 my $i=0;
-my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
+my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : "";
+my $query = qq{SELECT authorised_value, lib FROM authorised_values};
+$query  .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id ) } if $branch_limit;
+$query  .= qq{ WHERE category = ?};
+$query  .= qq{ AND ( branchcode = ? OR branchcode IS NULL ) } if $branch_limit;
+$query  .= qq{ GROUP BY lib ORDER BY lib, lib_opac};
+my $authorised_values_sth = $dbh->prepare( $query );
 
 my $branches = GetBranchesLoop();  # build once ahead of time, instead of multiple times later.
 
@@ -359,7 +365,7 @@ foreach my $tag (sort keys %{$tagslib}) {
       }
       else {
           push @authorised_values, ""; # unless ( $tagslib->{$tag}->{$subfield}->{mandatory} );
-          $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value} );
+          $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value}, $branch_limit ? $branch_limit : () );
           while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
               push @authorised_values, $value;
               $authorised_lib{$value} = $lib;
@@ -427,6 +433,8 @@ foreach my $tag (sort keys %{$tagslib}) {
     $i++
   }
 } # -- End foreach tag
+$authorised_values_sth->finish;
+
 
 
     # what's the next op ? it's what we are not in : an add if we're editing, otherwise, and edit.
index 83db522..78353c9 100755 (executable)
@@ -304,7 +304,7 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) {
 } else {
     if ($extended) {
         my @matchpoints = ();
-        my @attr_types = C4::Members::AttributeTypes::GetAttributeTypes();
+        my @attr_types = C4::Members::AttributeTypes::GetAttributeTypes(undef, 1);
         foreach my $type (@attr_types) {
             my $attr_type = C4::Members::AttributeTypes->fetch($type->{code});
             if ($attr_type->unique_id()) {