Merge remote-tracking branch 'origin/new/bug_8440'
authorPaul Poulain <paul.poulain@biblibre.com>
Mon, 3 Sep 2012 15:52:33 +0000 (17:52 +0200)
committerPaul Poulain <paul.poulain@biblibre.com>
Mon, 3 Sep 2012 15:52:33 +0000 (17:52 +0200)
170 files changed:
C4/Acquisition.pm
C4/Auth.pm
C4/AuthoritiesMarc.pm
C4/Barcodes.pm
C4/Barcodes/EAN13.pm [new file with mode: 0644]
C4/Barcodes/ValueBuilder.pm [new file with mode: 0644]
C4/Biblio.pm
C4/Circulation.pm
C4/Creators/Lib.pm
C4/External/Amazon.pm
C4/External/BakerTaylor.pm
C4/Installer/PerlDependencies.pm
C4/Items.pm
C4/Koha.pm
C4/Labels/Label.pm
C4/Letters.pm
C4/Members.pm
C4/Members/Statistics.pm
C4/Output.pm
C4/Overdues.pm
C4/Search.pm
C4/Serials.pm
C4/Templates.pm
C4/VirtualShelves.pm
C4/XSLT.pm
Koha/Calendar.pm
Koha/DateUtils.pm
Koha/SearchEngine/Solr/Search.pm
acqui/basket.pl
acqui/basketgroup.pl
acqui/histsearch.pl
admin/smart-rules.pl
admin/systempreferences.pl
authorities/auth_finder.pl
authorities/authorities-home.pl
authorities/authorities.pl
authorities/blinddetail-biblio-search.pl
authorities/ysearch.pl
catalogue/detail.pl
cataloguing/addbooks.pl
cataloguing/additem.pl
cataloguing/value_builder/barcode.pl
cataloguing/value_builder/barcode_manual.pl [new file with mode: 0755]
cataloguing/z3950_search.pl
circ/circulation.pl
circ/pendingreserves.pl
circ/returns.pl
debian/scripts/koha-create
debian/scripts/koha-remove
docs/history.txt
installer/data/mysql/en/marcflavour/marc21/mandatory/authorities_normal_marc21.sql
installer/data/mysql/kohastructure.sql
installer/data/mysql/sysprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css
koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/auth-finder-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/authorities-search-results.inc
koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
koha-tmpl/intranet-tmpl/prog/en/includes/cities-admin-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/form-blocks.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/patrons-admin-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/roadtype-admin-search.inc
koha-tmpl/intranet-tmpl/prog/en/includes/z3950-admin-search.inc
koha-tmpl/intranet-tmpl/prog/en/js/additem.js
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/lib/jquery/plugins/jquery-ui-timepicker-addon.js [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/about.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basketgroup.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/histsearch.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/admin/admin-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.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/preferences/patrons.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref
koha-tmpl/intranet-tmpl/prog/en/modules/admin/searchengine/solr/indexes.tt
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/merge.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/intranet-main.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt
koha-tmpl/intranet-tmpl/prog/en/modules/services/itemrecorddisplay.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/csv-profiles.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt
koha-tmpl/intranet-tmpl/prog/en/modules/tools/picture-upload.tt
koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl
koha-tmpl/intranet-tmpl/prog/img/clear-field.png [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/img/clone-field.png [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/css/babeltheque.css [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/css/opac.css
koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc
koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc
koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-MARCdetail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt [new file with mode: 0644]
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-results-grouped.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-sendbasket.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews-rss.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-showreviews.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt
koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tt
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/MARC21slimUtils.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/NORMARCslimUtils.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslim2OPACDetail.xsl
koha-tmpl/opac-tmpl/prog/en/xslt/UNIMARCslimUtils.xsl
koha_perl_deps.pl
kohaversion.pl
members/memberentry.pl
members/moremember.pl
members/routing-lists.pl [new file with mode: 0755]
members/statistics.pl
misc/batchImportMARCWithBiblionumbers.pl
misc/cronjobs/advance_notices.pl
misc/cronjobs/fines.pl
misc/cronjobs/holds/build_holds_queue.pl
misc/cronjobs/overdue_notices.pl
misc/cronjobs/staticfines.pl
misc/export_borrowers.pl [new file with mode: 0755]
misc/load_testing/benchmark_staff.pl
opac/opac-ISBDdetail.pl
opac/opac-authoritiesdetail.pl
opac/opac-detail.pl
opac/opac-readingrecord.pl
opac/opac-reserve.pl
opac/opac-search.pl
opac/opac-sendbasket.pl
opac/opac-user.pl
opac/sco/sco-main.pl
reports/guided_reports.pl
reserve/renewscript.pl
rewrite-config.PL
t/00-load.t
t/Barcodes_EAN13.t [new file with mode: 0755]
t/Barcodes_ValueBuilder.t [new file with mode: 0644]
t/Calendar.t
t/Circulation_barcodedecode.t
t/Kalendar.t [deleted file]
t/db_dependent/Barcodes.t
tools/export.pl
xt/author/test_template.pl [deleted file]

index ccb488b..3b7d842 100644 (file)
@@ -29,6 +29,8 @@ use C4::Suggestions;
 use C4::Biblio;
 use C4::Debug;
 use C4::SQLHelper qw(InsertInTable);
+use C4::Bookseller qw(GetBookSellerFromId);
+use C4::Templates qw(gettemplate);
 
 use Time::localtime;
 use HTML::Entities;
@@ -42,7 +44,7 @@ BEGIN {
     @ISA    = qw(Exporter);
     @EXPORT = qw(
         &GetBasket &NewBasket &CloseBasket &DelBasket &ModBasket
-       &GetBasketAsCSV
+        &GetBasketAsCSV &GetBasketGroupAsCSV
         &GetBasketsByBookseller &GetBasketsByBasketgroup
         &GetBasketsInfosByBookseller
 
@@ -227,54 +229,127 @@ sub CloseBasket {
 
 Export a basket as CSV
 
+$cgi parameter is needed for column name translation
+
 =cut
 
 sub GetBasketAsCSV {
-    my ($basketno) = @_;
+    my ($basketno, $cgi) = @_;
     my $basket = GetBasket($basketno);
     my @orders = GetOrders($basketno);
     my $contract = GetContract($basket->{'contractnumber'});
-    my $csv = Text::CSV->new();
-    my $output; 
 
-    # TODO: Translate headers
-    my @headers = qw(contractname ordernumber entrydate isbn author title publishercode collectiontitle notes quantity rrp);
-
-    $csv->combine(@headers);                                                                                                        
-    $output = $csv->string() . "\n";   
+    my $template = C4::Templates::gettemplate("acqui/csv/basket.tmpl", "intranet", $cgi);
 
     my @rows;
     foreach my $order (@orders) {
-       my @cols;
-       # newlines are not valid characters for Text::CSV combine()
-        $order->{'notes'} =~ s/[\r\n]+//g;
-       push(@cols,
-               $contract->{'contractname'},
-               $order->{'ordernumber'},
-               $order->{'entrydate'}, 
-               $order->{'isbn'},
-               $order->{'author'},
-               $order->{'title'},
-               $order->{'publishercode'},
-               $order->{'collectiontitle'},
-               $order->{'notes'},
-               $order->{'quantity'},
-               $order->{'rrp'},
-           );
-       push (@rows, \@cols);
+        my $bd = GetBiblioData( $order->{'biblionumber'} );
+        my $row = {
+            contractname => $contract->{'contractname'},
+            ordernumber => $order->{'ordernumber'},
+            entrydate => $order->{'entrydate'},
+            isbn => $order->{'isbn'},
+            author => $bd->{'author'},
+            title => $bd->{'title'},
+            publicationyear => $bd->{'publicationyear'},
+            publishercode => $bd->{'publishercode'},
+            collectiontitle => $bd->{'collectiontitle'},
+            notes => $order->{'notes'},
+            quantity => $order->{'quantity'},
+            rrp => $order->{'rrp'},
+            deliveryplace => $basket->{'deliveryplace'},
+            billingplace => $basket->{'billingplace'}
+        };
+        foreach(qw(
+            contractname author title publishercode collectiontitle notes
+            deliveryplace billingplace
+        ) ) {
+            # Double the quotes to not be interpreted as a field end
+            $row->{$_} =~ s/"/""/g if $row->{$_};
+        }
+        push @rows, $row;
     }
 
-    foreach my $row (@rows) {
-       $csv->combine(@$row);                                                                                                                    
-       $output .= $csv->string() . "\n";    
+    @rows = sort {
+        if(defined $a->{publishercode} and defined $b->{publishercode}) {
+            $a->{publishercode} cmp $b->{publishercode};
+        }
+    } @rows;
 
-    }
-                                                                                                                                                      
-    return $output;             
+    $template->param(rows => \@rows);
 
+    return $template->output;
 }
 
 
+=head3 GetBasketGroupAsCSV
+
+=over 4
+
+&GetBasketGroupAsCSV($basketgroupid);
+
+Export a basket group as CSV
+
+$cgi parameter is needed for column name translation
+
+=back
+
+=cut
+
+sub GetBasketGroupAsCSV {
+    my ($basketgroupid, $cgi) = @_;
+    my $baskets = GetBasketsByBasketgroup($basketgroupid);
+
+    my $template = C4::Templates::gettemplate('acqui/csv/basketgroup.tmpl', 'intranet', $cgi);
+
+    my @rows;
+    for my $basket (@$baskets) {
+        my @orders     = GetOrders( $$basket{basketno} );
+        my $contract   = GetContract( $$basket{contractnumber} );
+        my $bookseller = GetBookSellerFromId( $$basket{booksellerid} );
+
+        foreach my $order (@orders) {
+            my $bd = GetBiblioData( $order->{'biblionumber'} );
+            my $row = {
+                clientnumber => $bookseller->{accountnumber},
+                basketname => $basket->{basketname},
+                ordernumber => $order->{ordernumber},
+                author => $bd->{author},
+                title => $bd->{title},
+                publishercode => $bd->{publishercode},
+                publicationyear => $bd->{publicationyear},
+                collectiontitle => $bd->{collectiontitle},
+                isbn => $order->{isbn},
+                quantity => $order->{quantity},
+                rrp => $order->{rrp},
+                discount => $bookseller->{discount},
+                ecost => $order->{ecost},
+                notes => $order->{notes},
+                entrydate => $order->{entrydate},
+                booksellername => $bookseller->{name},
+                bookselleraddress => $bookseller->{address1},
+                booksellerpostal => $bookseller->{postal},
+                contractnumber => $contract->{contractnumber},
+                contractname => $contract->{contractname},
+            };
+            foreach(qw(
+                basketname author title publishercode collectiontitle notes
+                booksellername bookselleraddress booksellerpostal contractname
+                basketgroupdeliveryplace basketgroupbillingplace
+                basketdeliveryplace basketbillingplace
+            ) ) {
+                # Double the quotes to not be interpreted as a field end
+                $row->{$_} =~ s/"/""/g if $row->{$_};
+            }
+            push @rows, $row;
+         }
+     }
+    $template->param(rows => \@rows);
+
+    return $template->output;
+
+}
+
 =head3 CloseBasketgroup
 
   &CloseBasketgroup($basketgroupno);
@@ -490,7 +565,12 @@ sub GetBasketsInfosByBookseller {
         SELECT aqbasket.*,
           SUM(aqorders.quantity) AS total_items,
           COUNT(DISTINCT aqorders.biblionumber) AS total_biblios,
-          SUM(IF(aqorders.datereceived IS NULL, aqorders.quantity, 0)) AS expected_items
+          SUM(
+            IF(aqorders.datereceived IS NULL
+              AND aqorders.datecancellationprinted IS NULL
+            , aqorders.quantity
+            , 0)
+          ) AS expected_items
         FROM aqbasket
           LEFT JOIN aqorders ON aqorders.basketno = aqbasket.basketno
         WHERE booksellerid = ?
@@ -514,8 +594,11 @@ Returns a reference to all baskets that belong to basketgroup $basketgroupid.
 
 sub GetBasketsByBasketgroup {
     my $basketgroupid = shift;
-    my $query = "SELECT * FROM aqbasket
-                LEFT JOIN aqcontract USING(contractnumber) WHERE basketgroupid=?";
+    my $query = qq{
+        SELECT *, aqbasket.booksellerid as booksellerid
+        FROM aqbasket
+        LEFT JOIN aqcontract USING(contractnumber) WHERE basketgroupid=?
+    };
     my $dbh = C4::Context->dbh;
     my $sth = $dbh->prepare($query);
     $sth->execute($basketgroupid);
@@ -1678,6 +1761,7 @@ sub GetHistory {
     my $to_placed_on = $params{to_placed_on};
     my $basket = $params{basket};
     my $booksellerinvoicenumber = $params{booksellerinvoicenumber};
+    my $basketgroupname = $params{basketgroupname};
     my @order_loop;
     my $total_qty         = 0;
     my $total_qtyreceived = 0;
@@ -1767,6 +1851,11 @@ sub GetHistory {
         push @query_params, "%$booksellerinvoicenumber%", "%$booksellerinvoicenumber%";
     }
 
+    if ($basketgroupname) {
+        $query .= " AND aqbasketgroups.name LIKE ? ";
+        push @query_params, "%$basketgroupname%";
+    }
+
     if ( C4::Context->preference("IndependantBranches") ) {
         my $userenv = C4::Context->userenv;
         if ( $userenv && ($userenv->{flags} || 0) != 1 ) {
index b6dc2f5..59c9955 100644 (file)
@@ -334,10 +334,7 @@ sub get_template_and_user {
 
     if ( $in->{'type'} eq "intranet" ) {
         $template->param(
-            AmazonContent               => C4::Context->preference("AmazonContent"),
             AmazonCoverImages           => C4::Context->preference("AmazonCoverImages"),
-            AmazonEnabled               => C4::Context->preference("AmazonEnabled"),
-            AmazonSimilarItems          => C4::Context->preference("AmazonSimilarItems"),
             AutoLocation                => C4::Context->preference("AutoLocation"),
             "BiblioDefaultView".C4::Context->preference("IntranetBiblioDefaultView") => 1,
             CalendarFirstDayOfWeek      => (C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday")?0:1,
@@ -388,17 +385,8 @@ sub get_template_and_user {
         } elsif (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv && C4::Context->userenv->{'branch'}) {
             $opac_name = C4::Context->userenv->{'branch'};
         }
-       my $checkstyle = C4::Context->preference("opaccolorstylesheet");
-       if ($checkstyle =~ /http/)
-       {
-               $template->param( opacexternalsheet => $checkstyle);
-       } else
-       {
-               my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
-            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
-       }
         $template->param(
-            AmazonContent             => "" . C4::Context->preference("AmazonContent"),
+            opaccolorstylesheet       => C4::Context->preference("opaccolorstylesheet"),
             AnonSuggestions           => "" . C4::Context->preference("AnonSuggestions"),
             AuthorisedValueImages     => C4::Context->preference("AuthorisedValueImages"),
             BranchesLoop              => GetBranchesLoop($opac_name),
@@ -406,10 +394,7 @@ sub get_template_and_user {
             LibraryName               => "" . C4::Context->preference("LibraryName"),
             LibraryNameTitle          => "" . $LibraryNameTitle,
             LoginBranchname           => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"",
-            OPACAmazonEnabled         => C4::Context->preference("OPACAmazonEnabled"),
-            OPACAmazonSimilarItems    => C4::Context->preference("OPACAmazonSimilarItems"),
             OPACAmazonCoverImages     => C4::Context->preference("OPACAmazonCoverImages"),
-            OPACAmazonReviews         => C4::Context->preference("OPACAmazonReviews"),
             OPACFRBRizeEditions       => C4::Context->preference("OPACFRBRizeEditions"),
             OpacHighlightedWords       => C4::Context->preference("OpacHighlightedWords"),
             OPACItemHolds             => C4::Context->preference("OPACItemHolds"),
@@ -441,7 +426,6 @@ sub get_template_and_user {
             hidelostitems             => C4::Context->preference("hidelostitems"),
             mylibraryfirst            => (C4::Context->preference("SearchMyLibraryFirst") && C4::Context->userenv) ? C4::Context->userenv->{'branch'} : '',
             opaclayoutstylesheet      => "" . C4::Context->preference("opaclayoutstylesheet"),
-            opacstylesheet            => "" . C4::Context->preference("opacstylesheet"),
             opacbookbag               => "" . C4::Context->preference("opacbookbag"),
             opaccredits               => "" . C4::Context->preference("opaccredits"),
             OpacFavicon               => C4::Context->preference("OpacFavicon"),
@@ -946,19 +930,12 @@ sub checkauth {
     }
 
     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,);
-    my $checkstyle = C4::Context->preference("opaccolorstylesheet");
-    if ($checkstyle =~ /\//)
-       {
-               $template->param( opacexternalsheet => $checkstyle);
-       } else
-       {
-               my $opaccolorstylesheet = C4::Context->preference("opaccolorstylesheet");  
-            $template->param( opaccolorstylesheet => $opaccolorstylesheet);
-       }
+    my $template = C4::Templates::gettemplate($template_name, $type, $query );
     $template->param(
-    login        => 1,
+        branchloop           => \@branch_loop,
+        opaccolorstylesheet  => C4::Context->preference("opaccolorstylesheet"),
+        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
+        login                => 1,
         INPUTS               => \@inputs,
         casAuthentication    => C4::Context->preference("casAuthentication"),
         suggestion           => C4::Context->preference("suggestion"),
@@ -972,7 +949,6 @@ sub checkauth {
         OpacFavicon          => C4::Context->preference("OpacFavicon"),
         opacreadinghistory   => C4::Context->preference("opacreadinghistory"),
         opacsmallimage       => C4::Context->preference("opacsmallimage"),
-        opaclayoutstylesheet => C4::Context->preference("opaclayoutstylesheet"),
         opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
         opacuserjs           => C4::Context->preference("opacuserjs"),
         opacbookbag          => "" . C4::Context->preference("opacbookbag"),
@@ -983,7 +959,6 @@ sub checkauth {
         opacheader           => C4::Context->preference("opacheader"),
         TagsEnabled                  => C4::Context->preference("TagsEnabled"),
         OPACUserCSS           => C4::Context->preference("OPACUserCSS"),
-        opacstylesheet       => C4::Context->preference("opacstylesheet"),
         intranetcolorstylesheet =>
                                                                C4::Context->preference("intranetcolorstylesheet"),
         intranetstylesheet => C4::Context->preference("intranetstylesheet"),
index ece46a3..1f440df 100644 (file)
@@ -354,7 +354,7 @@ sub SearchAuthorities {
                 my $thisauthtype = GetAuthType(GetAuthTypeCode($authid));
                 $newline{authtype}     = defined ($thisauthtype) ?
                                             $thisauthtype->{'authtypetext'} :
-                                            GetAuthType($authtypecode)->{'authtypetext'};
+                                            (GetAuthType($authtypecode) ? $_->{'authtypetext'} : '');
                 $newline{summary}      = $summary;
                 $newline{even}         = $counter % 2;
                 $newline{reported_tag} = $reported_tag;
@@ -959,6 +959,7 @@ sub BuildSummary {
         'f' => 'musical',
         'g' => 'broader',
         'h' => 'narrower',
+        'n' => 'notapplicable',
         'i' => 'subfi',
         't' => 'parent'
     );
@@ -970,7 +971,6 @@ sub BuildSummary {
     $thesaurus{'5'}="Lieux";
     $thesaurus{'6'}="Sujets";
     #thesaurus a remplir
-    my @fields = $record->fields();
     my $reported_tag;
 # if the library has a summary defined, use it. Otherwise, build a standard one
 # FIXME - it appears that the summary field in the authority frameworks
@@ -1007,108 +1007,138 @@ sub BuildSummary {
         $resultstring =~ s/\[(.*?)\]//g;
         $resultstring =~ s/\n/<br>/g;
         $summary{summary}      =  $resultstring;
-    } else {
-        my @authorized;
-        my @notes;
-        my @seefrom;
-        my @seealso;
-        my @otherscript;
-        my @fields = $record->fields();
-        if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
+    }
+    my @authorized;
+    my @notes;
+    my @seefrom;
+    my @seealso;
+    my @otherscript;
+    if (C4::Context->preference('marcflavour') eq 'UNIMARC') {
 # construct UNIMARC summary, that is quite different from MARC21 one
 # accepted form
-            foreach my $field ($record->field('2..')) {
-                push @authorized, $field->as_string('abcdefghijlmnopqrstuvwxyz');
-            }
+        foreach my $field ($record->field('2..')) {
+            push @authorized, { heading => $field->as_string('abcdefghijlmnopqrstuvwxyz'), field => $field->tag() };
+        }
 # rejected form(s)
-            foreach my $field ($record->field('3..')) {
-                push @notes, $field->subfield('a');
-            }
-            foreach my $field ($record->field('4..')) {
-                my $thesaurus = $field->subfield('2') ? "thes. : ".$thesaurus{"$field->subfield('2')"}." : " : '';
-                push @seefrom, { heading => $thesaurus . $field->as_string('abcdefghijlmnopqrstuvwxyz'), type => 'seefrom' };
-            }
+        foreach my $field ($record->field('3..')) {
+            push @notes, { note => $field->subfield('a'), field => $field->tag() };
+        }
+        foreach my $field ($record->field('4..')) {
+            my $thesaurus = $field->subfield('2') ? "thes. : ".$thesaurus{"$field->subfield('2')"}." : " : '';
+            push @seefrom, { heading => $thesaurus . $field->as_string('abcdefghijlmnopqrstuvwxyz'), type => 'seefrom', field => $field->tag() };
+        }
 # see :
-            foreach my $field ($record->field('5..')) {
-                if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
-                    push @seealso, { $field->as_string('abcdefgjxyz'), type => 'broader' };
-                } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
-                    push @seealso, { heading => $field->as_string('abcdefgjxyz'), type => 'narrower' };
-                } elsif ($field->subfield('a')) {
-                    push @seealso, { heading => $field->as_string('abcdefgxyz'), type => 'seealso' };
-                }
+        foreach my $field ($record->field('5..')) {
+            if (($field->subfield('5')) && ($field->subfield('a')) && ($field->subfield('5') eq 'g')) {
+                push @seealso, { $field->as_string('abcdefgjxyz'), type => 'broader', field => $field->tag() };
+            } elsif (($field->subfield('5')) && ($field->as_string) && ($field->subfield('5') eq 'h')){
+                push @seealso, { heading => $field->as_string('abcdefgjxyz'), type => 'narrower', field => $field->tag() };
+            } elsif ($field->subfield('a')) {
+                push @seealso, { heading => $field->as_string('abcdefgxyz'), type => 'seealso', field => $field->tag() };
             }
+        }
 # // form
-            foreach my $field ($record->field('7..')) {
-                my $lang = substr($field->subfield('8'),3,3);
-                push @otherscript, { lang => $lang, term => $field->subfield('a') };
-            }
-        } else {
+        foreach my $field ($record->field('7..')) {
+            my $lang = substr($field->subfield('8'),3,3);
+            push @otherscript, { lang => $lang, term => $field->subfield('a'), direction => 'ltr', field => $field->tag() };
+        }
+    } else {
 # construct MARC21 summary
 # FIXME - looping over 1XX is questionable
 # since MARC21 authority should have only one 1XX
-            foreach my $field ($record->field('1..')) {
-                my $tag = $field->tag();
-                next if "152" eq $tag;
+        my $subfields_to_report;
+        foreach my $field ($record->field('1..')) {
+            my $tag = $field->tag();
+            next if "152" eq $tag;
 # FIXME - 152 is not a good tag to use
 # in MARC21 -- purely local tags really ought to be
 # 9XX
-                if ($tag eq '100') {
-                    push @authorized, $field->as_string('abcdefghjklmnopqrstvxyz68');
-                } elsif ($tag eq '110') {
-                    push @authorized, $field->as_string('abcdefghklmnoprstvxyz68');
-                } elsif ($tag eq '111') {
-                    push @authorized, $field->as_string('acdefghklnpqstvxyz68');
-                } elsif ($tag eq '130') {
-                    push @authorized, $field->as_string('adfghklmnoprstvxyz68');
-                } elsif ($tag eq '148') {
-                    push @authorized, $field->as_string('abvxyz68');
-                } elsif ($tag eq '150') {
-                    push @authorized, $field->as_string('abvxyz68');
-                } elsif ($tag eq '151') {
-                    push @authorized, $field->as_string('avxyz68');
-                } elsif ($tag eq '155') {
-                    push @authorized, $field->as_string('abvxyz68');
-                } elsif ($tag eq '180') {
-                    push @authorized, $field->as_string('vxyz68');
-                } elsif ($tag eq '181') {
-                    push @authorized, $field->as_string('vxyz68');
-                } elsif ($tag eq '182') {
-                    push @authorized, $field->as_string('vxyz68');
-                } elsif ($tag eq '185') {
-                    push @authorized, $field->as_string('vxyz68');
-                } else {
-                    push @authorized, $field->as_string();
-                }
-            } #See From
-            foreach my $field ($record->field('4..')) {
-                my $type = 'seefrom';
-                $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
-                if ($type eq 'subfi') {
-                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
-                } else {
-                    push @seefrom, { heading => $field->as_string($marc21subfields), type => $type };
-                }
-            } #See Also
-            foreach my $field ($record->field('5..')) {
-                my $type = 'seealso';
-                $type = $marc21controlrefs{substr $field->subfield('w'), '0'} if ($field->subfield('w'));
-                if ($type eq 'subfi') {
-                    push @seealso, { heading => $field->as_string($marc21subfields), type => $field->subfield('i') };
-                } else {
-                    push @seealso, { heading => $field->as_string($marc21subfields), type => $type };
-                }
+            if ($tag eq '100') {
+                $subfields_to_report = 'abcdefghjklmnopqrstvxyz';
+            } elsif ($tag eq '110') {
+                $subfields_to_report = 'abcdefghklmnoprstvxyz';
+            } elsif ($tag eq '111') {
+                $subfields_to_report = 'acdefghklnpqstvxyz';
+            } elsif ($tag eq '130') {
+                $subfields_to_report = 'adfghklmnoprstvxyz';
+            } elsif ($tag eq '148') {
+                $subfields_to_report = 'abvxyz';
+            } elsif ($tag eq '150') {
+                $subfields_to_report = 'abvxyz';
+            } elsif ($tag eq '151') {
+                $subfields_to_report = 'avxyz';
+            } elsif ($tag eq '155') {
+                $subfields_to_report = 'abvxyz';
+            } elsif ($tag eq '180') {
+                $subfields_to_report = 'vxyz';
+            } elsif ($tag eq '181') {
+                $subfields_to_report = 'vxyz';
+            } elsif ($tag eq '182') {
+                $subfields_to_report = 'vxyz';
+            } elsif ($tag eq '185') {
+                $subfields_to_report = 'vxyz';
+            }
+            if ($subfields_to_report) {
+                push @authorized, { heading => $field->as_string($subfields_to_report), field => $tag };
+            } else {
+                push @authorized, { heading => $field->as_string(), field => $tag };
+            }
+        }
+        foreach my $field ($record->field('4..')) { #See From
+            my $type = 'seefrom';
+            $type = $marc21controlrefs{substr $field->subfield('w'), 0, 1} if ($field->subfield('w'));
+            if ($type eq 'notapplicable') {
+                $type = substr $field->subfield('w'), 2, 1;
+                $type = 'earlier' if $type && $type ne 'n';
+            }
+            if ($type eq 'subfi') {
+                push @seefrom, { heading => $field->as_string($marc21subfields), type => $field->subfield('i'), field => $field->tag() };
+            } else {
+                push @seefrom, { heading => $field->as_string($marc21subfields), type => $type, field => $field->tag() };
+            }
+        }
+        foreach my $field ($record->field('5..')) { #See Also
+            my $type = 'seealso';
+            $type = $marc21controlrefs{substr $field->subfield('w'), 0, 1} if ($field->subfield('w'));
+            if ($type eq 'notapplicable') {
+                $type = substr $field->subfield('w'), 2, 1;
+                $type = 'earlier' if $type && $type ne 'n';
+            }
+            if ($type eq 'subfi') {
+                push @seealso, { heading => $field->as_string($marc21subfields), type => $field->subfield('i'), field => $field->tag() };
+            } else {
+                push @seealso, { heading => $field->as_string($marc21subfields), type => $type, field => $field->tag() };
             }
-            foreach my $field ($record->field('6..')) {
-                push @notes, $field->as_string();
+        }
+        foreach my $field ($record->field('6..')) {
+            push @notes, { note => $field->as_string(), field => $field->tag() };
+        }
+        foreach my $field ($record->field('880')) {
+            my $linkage = $field->subfield('6');
+            my $category = substr $linkage, 0, 1;
+            if ($category eq '1') {
+                $category = 'preferred';
+            } elsif ($category eq '4') {
+                $category = 'seefrom';
+            } elsif ($category eq '5') {
+                $category = 'seealso';
+            }
+            my $type;
+            if ($field->subfield('w')) {
+                $type = $marc21controlrefs{substr $field->subfield('w'), '0'};
+            } else {
+                $type = $category;
             }
+            my $direction = $linkage =~ m#/r$# ? 'rtl' : 'ltr';
+            push @otherscript, { term => $field->as_string($subfields_to_report), category => $category, type => $type, direction => $direction, linkage => $linkage };
         }
-        $summary{authorized} = \@authorized;
-        $summary{notes} = \@notes;
-        $summary{seefrom} = \@seefrom;
-        $summary{seealso} = \@seealso;
-        $summary{otherscript} = \@otherscript;
     }
+    $summary{mainentry} = $authorized[0]->{heading};
+    $summary{authorized} = \@authorized;
+    $summary{notes} = \@notes;
+    $summary{seefrom} = \@seefrom;
+    $summary{seealso} = \@seealso;
+    $summary{otherscript} = \@otherscript;
     return \%summary;
 }
 
@@ -1326,7 +1356,7 @@ sub merge {
             my $marcdata = $rec->raw();
             my $marcrecordzebra= MARC::Record->new_from_xml($marcdata,"utf8",C4::Context->preference("marcflavour"));
             my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
-            my $i = $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield);
+            my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield);
             my $marcrecorddb=GetMarcBiblio($i);
             push @reccache, $marcrecorddb;
             $z++;
index 4a5fa19..2e81da6 100644 (file)
@@ -28,6 +28,7 @@ use C4::Dates;
 use C4::Barcodes::hbyymmincr;
 use C4::Barcodes::annual;
 use C4::Barcodes::incremental;
+use C4::Barcodes::EAN13;
 
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
 use vars qw($debug $cgi_debug);        # from C4::Debug, of course
@@ -138,7 +139,7 @@ sub next_value {
 
        $debug and warn "$incr";
        $head = $self->process_head($head,$max,$specific);
-       $tail = $self->process_tail($tail,$max,$specific);
+    $tail = $self->process_tail($tail,$incr,$specific); # XXX use $incr and not $max!
        my $next_value = $head . $incr . $tail;
        $debug and print STDERR "(  next ) max barcode found: $next_value\n";
        return $next_value;
@@ -177,6 +178,7 @@ our $types = {
        incremental => sub {C4::Barcodes::incremental->new_object(@_);},
        hbyymmincr  => sub {C4::Barcodes::hbyymmincr->new_object(@_); },
        OFF         => sub {C4::Barcodes::OFF->new_object(@_);        },
+    EAN13       => sub {C4::Barcodes::EAN13->new_object(@_);      },
 };
 
 sub new {
diff --git a/C4/Barcodes/EAN13.pm b/C4/Barcodes/EAN13.pm
new file mode 100644 (file)
index 0000000..da27c41
--- /dev/null
@@ -0,0 +1,57 @@
+package C4::Barcodes::EAN13;
+
+# Copyright 2012 Koha Development team
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+
+use C4::Context;
+use C4::Debug;
+
+use Algorithm::CheckDigits;
+
+use vars qw($VERSION @ISA);
+use vars qw($debug $cgi_debug);        # from C4::Debug, of course
+
+BEGIN {
+    $VERSION = 0.01;
+    @ISA = qw(C4::Barcodes);
+}
+
+sub parse {
+    my $self = shift;
+    my $barcode = (@_) ? shift : $self->value;
+    my $ean = CheckDigits('ean');
+    if ( $ean->is_valid($barcode) ) {
+        return ( '', $ean->basenumber($barcode), $ean->checkdigit($barcode) );
+    } else {
+        die "$barcode not valid EAN-13 barcode";
+    }
+}
+
+sub process_tail {
+    my ( $self,$tail,$whole,$specific ) = @_;
+    my $ean = CheckDigits('ean');
+    my $full = $ean->complete($whole);
+    my $chk  = $ean->checkdigit($full);
+    $debug && warn "# process_tail $tail -> $chk [$whole -> $full] $specific";
+    return $chk;
+}
+
+1;
+__END__
diff --git a/C4/Barcodes/ValueBuilder.pm b/C4/Barcodes/ValueBuilder.pm
new file mode 100644 (file)
index 0000000..13c5792
--- /dev/null
@@ -0,0 +1,109 @@
+#!/usr/bin/perl
+#
+# Copyright 2008-2010 Foundations Bible College
+# Parts copyright 2012 C & P Bibliography Services
+#
+# 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.
+
+package C4::Barcodes::ValueBuilder::incremental;
+use C4::Context;
+my $DEBUG = 0;
+
+sub get_barcode {
+    my ($args) = @_;
+    my $nextnum;
+    # not the best, two catalogers could add the same barcode easily this way :/
+    my $query = "select max(abs(barcode)) from items";
+    my $sth = C4::Context->dbh->prepare($query);
+    $sth->execute();
+    while (my ($count)= $sth->fetchrow_array) {
+        $nextnum = $count;
+    }
+    $nextnum++;
+    return $nextnum;
+}
+
+1;
+
+package C4::Barcodes::ValueBuilder::hbyymmincr;
+use C4::Context;
+my $DEBUG = 0;
+
+sub get_barcode {
+    my ($args) = @_;
+    my $nextnum;
+    my $year = substr($args->{year}, -2);
+    my $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?";
+    my $sth = C4::Context->dbh->prepare($query);
+    $sth->execute("^[-a-zA-Z]{1,}$year");
+    while (my ($count)= $sth->fetchrow_array) {
+        $nextnum = $count if $count;
+        $nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 10000 books per month
+            warn "Existing incremental number = $nextnum" if $DEBUG;
+    }
+    $nextnum++;
+    $nextnum = sprintf("%0*d", "4",$nextnum);
+    $nextnum = $year . $args->{mon} . $nextnum;
+    warn "New hbyymmincr Barcode = $nextnum" if $DEBUG;
+    my $scr = "
+        for (i=0 ; i<document.f.field_value.length ; i++) {
+            if (document.f.tag[i].value == '$args->{loctag}' && document.f.subfield[i].value == '$args->{locsubfield}') {
+                fnum = i;
+            }
+        }
+    if (\$('#' + id).val() == '') {
+        \$('#' + id).val(document.f.field_value[fnum].value + '$nextnum');
+    }
+    ";
+    return $nextnum, $scr;
+}
+
+
+package C4::Barcodes::ValueBuilder::annual;
+use C4::Context;
+my $DEBUG = 0;
+
+sub get_barcode {
+    my ($args) = @_;
+    my $nextnum;
+    my $query = "select max(cast( substring_index(barcode, '-',-1) as signed)) from items where barcode like ?";
+    my $sth=C4::Context->dbh->prepare($query);
+    $sth->execute("$args->{year}%");
+    while (my ($count)= $sth->fetchrow_array) {
+        warn "Examining Record: $count" if $DEBUG;
+        $nextnum = $count if $count;
+    }
+    $nextnum++;
+    $nextnum = sprintf("%0*d", "4",$nextnum);
+    $nextnum = "$args->{year}-$nextnum";
+    return $nextnum;
+}
+
+1;
+
+
+=head1 Barcodes::ValueBuilder
+
+This module is intended as a shim to ease the eventual transition from
+having all barcode-related code in the value builder plugin .pl file
+to using C4::Barcodes. Since the shift will require a rather significant
+amount of refactoring, this module will return value builder-formatted
+results, at first by merely running the code that was formerly in the
+barcodes.pl value builder, but later by using C4::Barcodes.
+
+=cut
+
+1;
index f8ba099..7512a49 100644 (file)
@@ -105,6 +105,7 @@ BEGIN {
       &ModBiblioframework
       &ModZebra
       &UpdateTotalIssues
+      &RemoveAllNsb
     );
 
     # To delete something
@@ -3103,7 +3104,7 @@ sub _koha_marc_update_bib_ids {
     my ( $biblio_tag,     $biblio_subfield )     = GetMarcFromKohaField( "biblio.biblionumber",          $frameworkcode );
     die qq{No biblionumber tag for framework "$frameworkcode"} unless $biblio_tag;
     my ( $biblioitem_tag, $biblioitem_subfield ) = GetMarcFromKohaField( "biblioitems.biblioitemnumber", $frameworkcode );
-    die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblio_tag;
+    die qq{No biblioitemnumber tag for framework "$frameworkcode"} unless $biblioitem_tag;
 
     if ( $biblio_tag == $biblioitem_tag ) {
 
@@ -3876,6 +3877,50 @@ sub UpdateTotalIssues {
      return;
 }
 
+=head2 RemoveAllNsb
+
+    &RemoveAllNsb($record);
+
+Removes all nsb/nse chars from a record
+
+=cut
+
+sub RemoveAllNsb {
+    my $record = shift;
+
+    SetUTF8Flag($record);
+
+    foreach my $field ($record->fields()) {
+        if ($field->is_control_field()) {
+            $field->update(nsb_clean($field->data()));
+        } else {
+            my @subfields = $field->subfields();
+            my @new_subfields;
+            foreach my $subfield (@subfields) {
+                push @new_subfields, $subfield->[0] => nsb_clean($subfield->[1]);
+            }
+            if (scalar(@new_subfields) > 0) {
+                my $new_field;
+                eval {
+                    $new_field = MARC::Field->new(
+                        $field->tag(),
+                        $field->indicator(1),
+                        $field->indicator(2),
+                        @new_subfields
+                    );
+                };
+                if ($@) {
+                    warn "error in RemoveAllNsb : $@";
+                } else {
+                    $field->replace_with($new_field);
+                }
+            }
+        }
+    }
+
+    return $record;
+}
+
 1;
 
 
index d17519d..8647943 100644 (file)
@@ -38,6 +38,8 @@ use C4::Branch; # GetBranches
 use C4::Log; # logaction
 use C4::Koha qw(GetAuthorisedValueByCode);
 use C4::Overdues qw(CalcFine UpdateFine);
+use Algorithm::CheckDigits;
+
 use Data::Dumper;
 use Koha::DateUtils;
 use Koha::Calendar;
@@ -169,6 +171,14 @@ sub barcodedecode {
                                $barcode =~ s/^(\D+)[0]*(\d+)$/$branch-$1-$2/i;
                        }
                }
+    } elsif ($filter eq 'EAN13') {
+        my $ean = CheckDigits('ean');
+        if ( $ean->is_valid($barcode) ) {
+            #$barcode = sprintf('%013d',$barcode); # this doesn't work on 32-bit systems
+            $barcode = '0' x ( 13 - length($barcode) ) . $barcode;
+        } else {
+            warn "# [$barcode] not valid EAN-13/UPC-A\n";
+        }
        }
     return $barcode;    # return barcode, modified or not
 }
@@ -1202,53 +1212,16 @@ Get the Hard Due Date and it's comparison for an itemtype, a borrower type and a
 
 sub GetHardDueDate {
     my ( $borrowertype, $itemtype, $branchcode ) = @_;
-    my $dbh = C4::Context->dbh;
-    my $sth =
-      $dbh->prepare(
-"select hardduedate, hardduedatecompare from issuingrules where categorycode=? and itemtype=? and branchcode=?"
-      );
-    $sth->execute( $borrowertype, $itemtype, $branchcode );
-    my $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
-
-    $sth->execute( $borrowertype, "*", $branchcode );
-    $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
-
-    $sth->execute( "*", $itemtype, $branchcode );
-    $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
 
-    $sth->execute( "*", "*", $branchcode );
-    $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
-
-    $sth->execute( $borrowertype, $itemtype, "*" );
-    $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
-
-    $sth->execute( $borrowertype, "*", "*" );
-    $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
-
-    $sth->execute( "*", $itemtype, "*" );
-    $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
-
-    $sth->execute( "*", "*", "*" );
-    $results = $sth->fetchrow_hashref;
-    return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
-      if defined($results) && $results->{hardduedate};
+    my $rule = GetIssuingRule( $borrowertype, $itemtype, $branchcode );
 
-    # if no rule is set => return undefined
-    return (undef, undef);
+    if ( defined( $rule ) ) {
+        if ( $rule->{hardduedate} ) {
+            return (dt_from_string($rule->{hardduedate}, 'iso'),$rule->{hardduedatecompare});
+        } else {
+            return (undef, undef);
+        }
+    }
 }
 
 =head2 GetIssuingRule
@@ -1623,7 +1596,7 @@ sub AddReturn {
 
         if ($borrowernumber) {
         if($issue->{'overdue'}){
-                my ( $amount, $type, $daycounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today );
+                my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today );
                 $type ||= q{};
         if ( $amount > 0 && ( C4::Context->preference('finesMode') eq 'production' )) {
           C4::Overdues::UpdateFine(
@@ -3091,10 +3064,12 @@ sub ReturnLostItem{
 
     MarkIssueReturned( $borrowernumber, $itemnum );
     my $borrower = C4::Members::GetMember( 'borrowernumber'=>$borrowernumber );
+    my $item = C4::Items::GetItem( $itemnum );
+    my $old_note = ($item->{'paidfor'} && ($item->{'paidfor'} ne q{})) ? $item->{'paidfor'}.' / ' : q{};
     my @datearr = localtime(time);
     my $date = ( 1900 + $datearr[5] ) . "-" . ( $datearr[4] + 1 ) . "-" . $datearr[3];
     my $bor = "$borrower->{'firstname'} $borrower->{'surname'} $borrower->{'cardnumber'}";
-    ModItem({ paidfor =>  "Paid for by $bor $date" }, undef, $itemnum);
+    ModItem({ paidfor =>  $old_note."Paid for by $bor $date" }, undef, $itemnum);
 }
 
 
index 67ee0e8..0a57b59 100644 (file)
@@ -90,7 +90,7 @@ my $barcode_types = [
     {type => 'CODE39MOD',       name => 'Code 39 + Modulo43',   desc => 'Translates the characters 0-9, A-Z, \'-\', \'*\', \'+\', \'$\', \'%\', \'/\', \'.\' and \' \' to a barcode pattern. Encodes Mod 43 checksum.',         selected => 0},
     {type => 'CODE39MOD10',     name => 'Code 39 + Modulo10',   desc => 'Translates the characters 0-9, A-Z, \'-\', \'*\', \'+\', \'$\', \'%\', \'/\', \'.\' and \' \' to a barcode pattern. Encodes Mod 10 checksum.',         selected => 0},
     {type => 'COOP2OF5',        name => 'COOP2of5',             desc => 'Creates COOP2of5 barcodes from a string consisting of the numeric characters 0-9',                                                                     selected => 0},
-#    {type => 'EAN13',           name => 'EAN13',                desc => 'Creates EAN13 barcodes from a string of 12 or 13 digits. The check number (the 13:th digit) is calculated if not supplied.',                           selected => 0},
+    {type => 'EAN13',           name => 'EAN13',                desc => 'Creates EAN13 barcodes from a string of 12 or 13 digits. The check number (the 13:th digit) is calculated if not supplied.',                           selected => 0},
 #    {type => 'EAN8',            name => 'EAN8',                 desc => 'Translates a string of 7 or 8 digits to EAN8 barcodes. The check number (the 8:th digit) is calculated if not supplied.',                              selected => 0},
 #    {type => 'IATA2of5',        name => 'IATA2of5',             desc => 'Creates IATA2of5 barcodes from a string consisting of the numeric characters 0-9',                                                                     selected => 0},
     {type => 'INDUSTRIAL2OF5',  name => 'Industrial2of5',       desc => 'Creates Industrial2of5 barcodes from a string consisting of the numeric characters 0-9',                                                               selected => 0},
index 53ebbd3..1e70f11 100644 (file)
@@ -17,14 +17,6 @@ package C4::External::Amazon;
 # with Koha; if not, write to the Free Software Foundation, Inc.,
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
-use XML::Simple;
-use LWP::Simple;
-use LWP::UserAgent;
-use HTTP::Request::Common;
-use C4::Koha;
-use URI::Escape;
-use POSIX;
-use Digest::SHA qw(hmac_sha256_base64);
 
 use strict;
 use warnings;
@@ -36,7 +28,6 @@ BEGIN {
     $VERSION = 3.07.00.049;
     @ISA = qw(Exporter);
     @EXPORT = qw(
-        get_amazon_details
         get_amazon_tld
     );
 }
@@ -68,35 +59,6 @@ This module provides facilities for retrieving Amazon.com content in Koha
 
 =over
 
-=item get_amazon_detail( $isbn, $record, $marcflavour, $services )
-
-Get editorial reviews, customer reviews, and similar products using Amazon Web Services.
-
-Parameters:
-
-=over
-
-=item $isbn
-
-Biblio record isbn
-
-=item $record
-
-Biblio MARC record
-
-=item $marcflavour
-
-MARC flavor, MARC21 or UNIMARC
-
-=item $services
-
-Requested Amazon services: A ref to an array. For example,
-[ 'Similarities', 'EditorialReviews', 'Reviews' ].
-No other service will be accepted. Services must be spelled exactly.
-If no sercice is requested, AWS isn't called.
-
-=back
-
 =item get_amazon_tld()
 
 Get Amazon Top Level Domain depending on Amazon local preference: AmazonLocal.
@@ -106,96 +68,6 @@ For example, if AmazonLocal is 'UK', returns '.co.uk'.
 
 =cut
 
-
-sub get_amazon_details {
-    my ( $isbn, $record, $marcflavour, $aws_ref ) = @_;
-
-    return unless defined $aws_ref;
-    my @aws = @$aws_ref;
-    return if $#aws == -1;
-
-    # Normalize the fields
-    $isbn = GetNormalizedISBN($isbn);
-    my $upc = GetNormalizedUPC($record,$marcflavour);
-    my $ean = GetNormalizedEAN($record,$marcflavour);
-    # warn "ISBN: $isbn | UPC: $upc | EAN: $ean";
-
-    # Choose the appropriate and available item identifier
-    my ( $id_type, $item_id ) =
-        defined($isbn) && length($isbn) == 13 ? ( 'EAN',  $isbn ) :
-        $isbn                                 ? ( 'ASIN', $isbn ) :
-        $upc                                  ? ( 'UPC',  $upc  ) :
-        $ean                                  ? ( 'EAN',  $upc  ) : ( undef, undef );
-    return unless defined($id_type);
-
-    # grab the item format to determine Amazon search index
-    my %hformat = ( a => 'Books', g => 'Video', j => 'Music' );
-    my $search_index = $hformat{ substr($record->leader(),6,1) } || 'Books';
-
-    my $parameters={Service=>"AWSECommerceService" ,
-        "AWSAccessKeyId"=> C4::Context->preference('AWSAccessKeyID') ,
-        "Operation"=>"ItemLookup", 
-        "AssociateTag"=>  C4::Context->preference('AmazonAssocTag') ,
-        "Version"=>"2009-06-01",
-        "ItemId"=>$item_id,
-        "IdType"=>$id_type,
-        "ResponseGroup"=>  join( ',',  @aws ),
-        "Timestamp"=>strftime("%Y-%m-%dT%H:%M:%SZ", gmtime)
-    };
-    $$parameters{"SearchIndex"} = $search_index if $id_type ne 'ASIN';
-    my @params;
-    while (my ($key,$value)=each %$parameters){
-        push @params, qq{$key=}.uri_escape($value, "^A-Za-z0-9\-_.~" );
-    }
-
-    my $url;
-    if (C4::Context->preference('AWSPrivateKey')) {
-        $url = qq{http://webservices.amazon} . get_amazon_tld() . 
-               "/onca/xml?" . join("&",sort @params) . qq{&Signature=} . uri_escape(SignRequest(@params),"^A-Za-z0-9\-_.~" );
-    } else {
-        $url = qq{http://webservices.amazon} . get_amazon_tld() .  "/onca/xml?" .join("&",sort @params);
-        warn "MUST set AWSPrivateKey syspref after 2009-08-15 in order to access Amazon web services";
-    }
-
-    my $content = get($url);
-    warn "could not retrieve $url" unless $content;
-    my $xmlsimple = XML::Simple->new();
-    my $response = $xmlsimple->XMLin(
-        $content,
-        forcearray => [ qw(SimilarProduct EditorialReview Review Item) ],
-    ) unless !$content;
-    return $response;
-}
-
-sub SignRequest{
-    my @params=@_;
-    my $tld=get_amazon_tld(); 
-    my $string = qq{GET\nwebservices.amazon$tld\n/onca/xml\n} . join("&",sort @params);
-    return hmac_sha256_base64($string,C4::Context->preference('AWSPrivateKey')) . '=';
-}
-
-sub check_search_inside {
-        my $isbn = shift;
-        my $ua = LWP::UserAgent->new(
-        agent => "Mozilla/4.76 [en] (Win98; U)",
-        keep_alive => 1,
-        env_proxy => 1,
-        );
-        my $available = 1;
-        my $uri = "http://www.amazon.com/gp/reader/$isbn/ref=sib_dp_pt/002-7879865-0184864#reader-link";
-        my $req = HTTP::Request->new(GET => $uri);
-        $req->header (
-                'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*',
-                'Accept-Charset' => 'iso-8859-1,*,utf-8',
-                'Accept-Language' => 'en-US' );
-        my $res = $ua->request($req);
-        my $content = $res->content();
-        if ($content =~ m/This book is temporarily unavailable/) {
-            undef $available;
-        }
-        return $available;
-}
-
 1;
 __END__
 
index 3503db0..d752677 100644 (file)
@@ -134,7 +134,6 @@ Such response will trigger a warning for each request (potentially many).  Point
 
 =head1 SEE ALSO
 
-C4::External::Amazon
 LWP::UserAgent
 
 =head1 AUTHOR
index d5e9326..6b1bb4b 100644 (file)
@@ -249,6 +249,11 @@ our $PERL_DEPS = {
         'required' => '0',
         'min_ver'  => '0.03'
     },
+    'Cache::Memcached::Fast' => {
+        'usage'    => 'Caching',
+        'required' => '0',
+        'min_ver'  => '0.17'
+    },
     'CHI' => {
         'usage'    => 'Caching',
         'required' => '0',
@@ -576,13 +581,25 @@ our $PERL_DEPS = {
     },
     'Test::Strict' => {
         'usage'    => 'Core',
-        'required' => '0.14',
+        'required' => '0',
+        'min_ver'  => '0.14',
+
+    },
+    'Test::YAML::Valid' => {
+        'usage'    => 'Core',
+        'required' => '0',
+        'min_ver'  => '0.04',
     },
     'Text::Unaccent' => {
         'usage'    => 'Core',
         'required' => '1',
         'min_ver'  => '1.08',
-    }
+    },
+    'HTML::FormatText' => {
+        'usage'    => 'Core',
+        'required' => '1',
+        'min_ver'  => '1.23',
+    },
 };
 
 1;
@@ -605,7 +622,7 @@ end of the outer hash and follow the key/value pattern used in the other depende
 =head2 Debian
 
 If you change the list of dependencies, and you use Debian, please also
-run the debian/update-control script and commit the modifed version of
+run the debian/update-control script and commit the modified version of
 debian/control into git as well. If you're not running Debian, don't
 worry about it.
 
index a9c0a16..e9af3dd 100644 (file)
@@ -936,7 +936,8 @@ sub GetLostItems {
     my $dbh     = C4::Context->dbh;
 
     my $query   = "
-        SELECT *
+        SELECT title, author, lib, itemlost, authorised_value, barcode, datelastseen, price, replacementprice, homebranch,
+               itype, itemtype, holdingbranch, location, itemnotes, items.biblionumber as biblionumber
         FROM   items
             LEFT JOIN biblio ON (items.biblionumber = biblio.biblionumber)
             LEFT JOIN biblioitems ON (items.biblionumber = biblioitems.biblionumber)
index 4f386e4..22afed6 100644 (file)
@@ -1232,7 +1232,7 @@ sub GetNormalizedUPC {
 }
 
 # Normalizes and returns the first valid ISBN found in the record
-# ISBN13 are converted into ISBN10. This is required to get Amazon cover book.
+# ISBN13 are converted into ISBN10. This is required to get some book cover images.
 sub GetNormalizedISBN {
     my ($isbn,$record,$marcflavour) = @_;
     my @fields;
index 7b1fafd..760bacf 100644 (file)
@@ -553,6 +553,28 @@ sub barcode {
             warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@);
         }
     }
+    elsif ($params{'barcode_type'} eq 'EAN13') {
+        $bar_length = 4; # FIXME
+    $num_of_bars = 13;
+        $tot_bar_length = ($bar_length * $num_of_bars) + ($guard_length * 2);
+        $x_scale_factor = ($params{'width'} / $tot_bar_length) * 0.9;
+        eval {
+            PDF::Reuse::Barcode::EAN13(
+                x                   => $params{'llx'},
+                y                   => $params{'lly'},
+                value               => sprintf('%013d',$params{barcode_data}),
+#                xSize               => $x_scale_factor,
+#                ySize               => $params{'y_scale_factor'},
+                mode                    => 'graphic',
+            );
+        };
+        if ($@) {
+            warn sprintf('Barcode generation failed for item %s with this error: %s', $self->{'item_number'}, $@);
+        }
+    }
+    else {
+    warn "unknown barcode_type: $params{barcode_type}";
+    }
 }
 
 sub csv_data {
@@ -608,6 +630,9 @@ This module provides methods for creating, and otherwise manipulating single lab
 =item .
             INDUSTRIAL2OF5  = The standard 2 of 5 barcode (a binary level bar code developed by Identicon Corp. and Computer Identics Corp. in 1970)
 
+=item .
+            EAN13           = The standard EAN-13 barcode
+
 =back
 
         C<printing_type>        Defines the general layout to be used on labels. NOTE: At present there are only five printing types supported in the label creator code:
index b366fbc..b17cb08 100644 (file)
@@ -120,7 +120,9 @@ my %letter;
 sub getletter {
     my ( $module, $code, $branchcode ) = @_;
 
-    if (C4::Context->preference('IndependantBranches') && $branchcode){
+    if ( C4::Context->preference('IndependantBranches')
+            and $branchcode
+            and C4::Context->userenv ) {
         $branchcode = C4::Context->userenv->{'branch'};
     }
 
index 2e59c91..2e315aa 100644 (file)
@@ -899,11 +899,8 @@ sub fixup_cardnumber {
         return "V$cardnumber$rem";
      } else {
 
-     # MODIFIED BY JF: mysql4.1 allows casting as an integer, which is probably
-     # better. I'll leave the original in in case it needs to be changed for you
-     # my $sth=$dbh->prepare("select max(borrowers.cardnumber) from borrowers");
         my $sth = $dbh->prepare(
-            "select max(cast(cardnumber as signed)) from borrowers"
+            'SELECT MAX( CAST( cardnumber AS SIGNED ) ) FROM borrowers WHERE cardnumber REGEXP "^-?[0-9]+$"'
         );
         $sth->execute;
         my ($result) = $sth->fetchrow;
index 302259c..9f26b86 100644 (file)
@@ -40,6 +40,18 @@ BEGIN {
     );
 }
 
+
+our $fields = get_fields();
+
+sub get_fields {
+    my $r = C4::Context->preference('StatisticsFields') || 'location|itype|ccode';
+    unless ( $r =~ m/^(\w|\d|\||-)+$/) {
+        warn "Members/Statistics : Bad value for syspref StatisticsFields" if $debug;
+        $r = 'location|itype|ccode';
+    }
+    return $r;
+}
+
 =head2 construct_query
   Build a sql query from a subquery
   Adds statistics fields to the select and the group by clause
@@ -47,10 +59,9 @@ BEGIN {
 sub construct_query {
     my $count    = shift;
     my $subquery = shift;
-    my $fields = C4::Context->preference('StatisticsFields') || 'location|itype|ccode';
     my @select_fields = split '\|', $fields;
-    my $query = "SELECT COUNT(*) as count_$count";
-    $query .= ", " . C4::Context->dbh->quote( $_ ) for @select_fields;
+    my $query = "SELECT COUNT(*) as count_$count,";
+    $query .= join ',', @select_fields;
 
     $query .= " " . $subquery;
 
index 21002c0..8cfa351 100644 (file)
@@ -42,13 +42,13 @@ BEGIN {
 
  @ISA    = qw(Exporter);
     @EXPORT_OK = qw(&is_ajax ajax_fail); # More stuff should go here instead
-    %EXPORT_TAGS = ( all =>[qw(&themelanguage &gettemplate setlanguagecookie pagination_bar
+    %EXPORT_TAGS = ( all =>[qw(&themelanguage &gettemplate setlanguagecookie pagination_bar &gettemplate
                                 &output_with_http_headers &output_ajax_with_http_headers &output_html_with_http_headers)],
                     ajax =>[qw(&output_with_http_headers &output_ajax_with_http_headers is_ajax)],
                     html =>[qw(&output_with_http_headers &output_html_with_http_headers)]
                 );
     push @EXPORT, qw(
-        &themelanguage &gettemplate setlanguagecookie getlanguagecookie pagination_bar
+        &themelanguage &gettemplate setlanguagecookie getlanguagecookie pagination_bar &gettemplate
     );
     push @EXPORT, qw(
         &output_html_with_http_headers &output_ajax_with_http_headers &output_with_http_headers FormatData FormatNumber
index ffdeaf5..d17f445 100644 (file)
@@ -241,8 +241,8 @@ C<$amount> is the fine owed by the patron (see above).
 C<$chargename> is the chargename field from the applicable record in
 the categoryitem table, whatever that is.
 
-C<$daycount> is the number of days between start and end dates, Calendar adjusted (where needed), 
-minus any applicable grace period.
+C<$unitcount> is the number of chargeable units (days between start and end dates, Calendar adjusted where needed,
+minus any applicable grace period, or hours)
 
 FIXME - What is chargename supposed to be ?
 
@@ -268,10 +268,9 @@ sub CalcFine {
     } else {
         # a zero (or null)  chargeperiod means no charge.
     }
-    if(C4::Context->preference('maxFine') && ( $amount > C4::Context->preference('maxFine'))) {
-        $amount = C4::Context->preference('maxFine');
-    }
-    return ($amount, $data->{chargename}, $units_minus_grace);
+    $amount = $data->{overduefinescap} if $data->{overduefinescap} && $amount > $data->{overduefinescap};
+    $debug and warn sprintf("CalcFine returning (%s, %s, %s, %s)", $amount, $data->{'chargename'}, $units_minus_grace, $chargeable_units);
+    return ($amount, $data->{'chargename'}, $units_minus_grace, $chargeable_units);
     # FIXME: chargename is NEVER populated anywhere.
 }
 
@@ -521,14 +520,39 @@ sub UpdateFine {
        #   "REF" is Cash Refund
     my $sth = $dbh->prepare(
         "SELECT * FROM accountlines
-               WHERE itemnumber=?
-               AND   borrowernumber=?
-               AND   accounttype IN ('FU','O','F','M')
-               AND   description like ? "
+        WHERE borrowernumber=?
+        AND   accounttype IN ('FU','O','F','M')"
     );
-    $sth->execute( $itemnum, $borrowernumber, "%$due%" );
+    $sth->execute( $borrowernumber );
+    my $data;
+    my $total_amount_other = 0.00;
+    my $due_qr = qr/$due/;
+    # Cycle through the fines and
+    # - find line that relates to the requested $itemnum
+    # - accumulate fines for other items
+    # so we can update $itemnum fine taking in account fine caps
+    while (my $rec = $sth->fetchrow_hashref) {
+        if ($rec->{itemnumber} == $itemnum && $rec->{description} =~ /$due_qr/) {
+            if ($data) {
+                warn "Not a unique accountlines record for item $itemnum borrower $borrowernumber";
+            } else {
+                $data = $rec;
+                next;
+            }
+        }
+        $total_amount_other += $rec->{'amount'};
+    }
+    if (my $maxfine = C4::Context->preference('MaxFine')) {
+        if ($total_amount_other + $amount > $maxfine) {
+            my $new_amount = $maxfine - $total_amount_other;
+            warn "Reducing fine for item $itemnum borrower $borrowernumber from $amount to $new_amount - MaxFine reached";
+            return if $new_amount <= 0.00;
+
+            $amount = $new_amount;
+        }
+    }
 
-    if ( my $data = $sth->fetchrow_hashref ) {
+    if ( $data ) {
 
                # we're updating an existing fine.  Only modify if amount changed
         # Note that in the current implementation, you cannot pay against an accruing fine
index fd81610..b0085c4 100644 (file)
@@ -1469,12 +1469,7 @@ sub searchResults {
     }
 
     #search item field code
-    my $sth =
-      $dbh->prepare(
-"SELECT tagfield FROM marc_subfield_structure WHERE kohafield LIKE 'items.itemnumber'"
-      );
-    $sth->execute;
-    my ($itemtag) = $sth->fetchrow;
+    my ($itemtag, undef) = &GetMarcFromKohaField( "items.itemnumber", "" );
 
     ## find column names of items related to MARC
     my $sth2 = $dbh->prepare("SHOW COLUMNS FROM items");
@@ -1792,7 +1787,7 @@ sub searchResults {
         # XSLT processing of some stuff
        use C4::Charset;
        SetUTF8Flag($marcrecord);
-       $debug && warn $marcrecord->as_formatted;
+        warn $marcrecord->as_formatted if $DEBUG;
        my $interface = $search_context eq 'opac' ? 'OPAC' : '';
        if (!$scan && C4::Context->preference($interface . "XSLTResultsDisplay")) {
             $oldbiblio->{XSLTResultsRecord} = XSLTParse4Display($oldbiblio->{biblionumber}, $marcrecord, $interface."XSLTResultsDisplay", 1, \@hiddenitems);
@@ -1823,8 +1818,6 @@ sub searchResults {
         $oldbiblio->{intransitcount}       = $item_in_transit_count;
         $oldbiblio->{onholdcount}          = $item_onhold_count;
         $oldbiblio->{orderedcount}         = $ordered_count;
-        # deleting - in isbn to enable amazon content
-        $oldbiblio->{isbn} =~ s/-//g;
 
         if (C4::Context->preference("AlternateHoldingsField") && $items_count == 0) {
             my $fieldspec = C4::Context->preference("AlternateHoldingsField");
index 58b6078..98660e9 100644 (file)
@@ -53,6 +53,7 @@ BEGIN {
       &check_routing &updateClaim &removeMissingIssue
       &CountIssues
       HasItems
+      &GetSubscriptionsFromBorrower
 
     );
 }
@@ -755,7 +756,7 @@ sub GetLatestSerials {
                         FROM     serial
                         WHERE    subscriptionid = ?
                         AND      (status =2 or status=4)
-                        ORDER BY planneddate DESC LIMIT 0,$limit
+                        ORDER BY publisheddate DESC LIMIT 0,$limit
                 ";
     my $sth = $dbh->prepare($strsth);
     $sth->execute($subscriptionid);
@@ -2175,6 +2176,40 @@ sub in_array {    # used in next sub down
     return 0;
 }
 
+=head2 GetSubscriptionsFromBorrower
+
+($count,@routinglist) = GetSubscriptionsFromBorrower($borrowernumber)
+
+this gets the info from subscriptionroutinglist for each $subscriptionid
+
+return :
+a count of the serial subscription routing lists to which a patron belongs,
+with the titles of those serial subscriptions as an array. Each element of the array
+contains a hash_ref with subscriptionID and title of subscription.
+
+=cut
+
+sub GetSubscriptionsFromBorrower {
+    my ($borrowernumber) = @_;
+    my $dbh              = C4::Context->dbh;
+    my $sth              = $dbh->prepare(
+        "SELECT subscription.subscriptionid, biblio.title
+            FROM subscription
+            JOIN biblio ON biblio.biblionumber = subscription.biblionumber
+            JOIN subscriptionroutinglist USING (subscriptionid)
+            WHERE subscriptionroutinglist.borrowernumber = ? ORDER BY title ASC
+                               "
+    );
+    $sth->execute($borrowernumber);
+    my @routinglist;
+    my $count = 0;
+    while ( my $line = $sth->fetchrow_hashref ) {
+        $count++;
+        push( @routinglist, $line );
+    }
+    return ( $count, @routinglist );
+}
+
 =head2 GetNextDate
 
 $resultdate = GetNextDate($planneddate,$subscription)
index 47bda04..e0baf2f 100644 (file)
@@ -104,9 +104,10 @@ sub output {
       ( $self->{interface} ne 'intranet' ? '/opac-tmpl' : '/intranet-tmpl' );
     $vars->{theme} = $self->theme;
     $vars->{opaccolorstylesheet} =
-      C4::Context->preference('opaccolorstylesheet');
+        C4::Context->preference('opaccolorstylesheet');
     $vars->{opacsmallimage} = C4::Context->preference('opacsmallimage');
-    $vars->{opacstylesheet} = C4::Context->preference('opacstylesheet');
+    $vars->{opaclayoutstylesheet} =
+        C4::Context->preference('opaclayoutstylesheet');
 
     # add variables set via param to $vars for processing
     # and clean any utf8 mess
@@ -211,7 +212,6 @@ sub _get_template_file {
     my $is_intranet = $interface eq 'intranet';
     my $htdocs = C4::Context->config($is_intranet ? 'intrahtdocs' : 'opachtdocs');
     my ($theme, $lang) = themelanguage($htdocs, $tmplbase, $interface, $query);
-    my $opacstylesheet = C4::Context->preference('opacstylesheet');
 
     # if the template doesn't exist, load the English one as a last resort
     my $filename = "$htdocs/$theme/$lang/modules/$tmplbase";
@@ -227,7 +227,6 @@ sub gettemplate {
     my ( $tmplbase, $interface, $query ) = @_;
     ($query) or warn "no query in gettemplate";
     my $path = C4::Context->preference('intranet_includes') || 'includes';
-    my $opacstylesheet = C4::Context->preference('opacstylesheet');
     $tmplbase =~ s/\.tmpl$/.tt/;
     my ($htdocs, $theme, $lang, $filename)
        =  _get_template_file($tmplbase, $interface, $query);
index 20f3620..25d092a 100644 (file)
@@ -221,7 +221,7 @@ Returns the above-mentioned fields for passed virtual shelf number.
 
 =cut
 
-sub GetShelf ($) {
+sub GetShelf {
     my ($shelfnumber) = @_;
     my $query = qq(
         SELECT shelfnumber, shelfname, owner, category, sortfield,
@@ -252,7 +252,7 @@ from C4::Circulation.
 
 =cut
 
-sub GetShelfContents ($;$$$) {
+sub GetShelfContents {
     my ($shelfnumber, $row_count, $offset, $sortfield) = @_;
     my $dbh=C4::Context->dbh();
     my $sth1 = $dbh->prepare("SELECT count(*) FROM virtualshelfcontents WHERE shelfnumber = ?");
@@ -351,7 +351,7 @@ sub AddToShelf {
     my $sth = $dbh->prepare($query);
 
     $sth->execute( $shelfnumber, $biblionumber );
-    ($sth->rows) and return undef; # already on shelf
+    ($sth->rows) and return; # already on shelf
     $query = qq(
         INSERT INTO virtualshelfcontents
             (shelfnumber, biblionumber, flags, borrowernumber)
@@ -658,15 +658,6 @@ sub _biblionumber_sth { #only used in obsolete sub below
     $sth;
 }
 
-sub each_biblionumbers (&$) { #OBSOLETE
-    my ($code,$shelf) = @_;
-    my $ref =  _biblionumber_sth($shelf)->fetchall_arrayref;
-    map {
-        $_=$$_[0];
-        $code->();
-        } @$ref;
-}
-
 sub _CheckShelfName {
     my ($name, $cat, $owner, $number)= @_;
 
index cbe1ff0..ac97e65 100644 (file)
@@ -187,7 +187,7 @@ sub XSLTParse4Display {
                               OPACBaseURL TraceCompleteSubfields UseICU
                               UseAuthoritiesForTracings TraceSubjectSubdivisions
                               Display856uAsImage OPACDisplay856uAsImage 
-                              UseControlNumber
+                              UseControlNumber IntranetBiblioDefaultView BiblioDefaultView
                               AlternateHoldingsField AlternateHoldingsSeparator / )
     {
         my $sp = C4::Context->preference( $syspref );
index 495f8ce..298cdb2 100644 (file)
@@ -79,6 +79,7 @@ sub _init {
     }
     $self->{single_holidays} = DateTime::Set->from_datetimes( dates => $dates );
     $self->{days_mode} = C4::Context->preference('useDaysMode');
+    $self->{test} = 0;
     return;
 }
 
@@ -100,7 +101,6 @@ sub addDate {
         my $dt = $base_date + $add_duration;
         while ( $self->is_holiday($dt) ) {
 
-            # TODOP if hours set to 10 am
             $dt->add_duration($day_dur);
             if ( $unit eq 'hours' ) {
                 $dt->set_hour($return_by_hour);    # Staffs specific
@@ -169,25 +169,25 @@ sub days_between {
     my $start_dt = shift;
     my $end_dt   = shift;
 
-    my $datestart_temp = $start_dt->clone();
-    my $dateend_temp = $end_dt->clone();
 
     # start and end should not be closed days
-    $datestart_temp->truncate( to => 'day' );
-    $dateend_temp->truncate( to => 'day' );
-    my $duration = $dateend_temp - $datestart_temp;
-    while ( DateTime->compare( $datestart_temp, $dateend_temp ) == -1 ) {
-        $datestart_temp->add( days => 1 );
-        if ( $self->is_holiday($datestart_temp) ) {
-            $duration->subtract( days => 1 );
+    my $days = $start_dt->delta_days($end_dt)->delta_days;
+    for (my $dt = $start_dt->clone();
+        $dt <= $end_dt;
+        $dt->add(days => 1)
+    ) {
+        if ($self->is_holiday($dt)) {
+            $days--;
         }
     }
-    return $duration;
+    return DateTime::Duration->new( days => $days );
 
 }
 
 sub hours_between {
-    my ($self, $start_dt, $end_dt) = @_;
+    my ($self, $start_date, $end_date) = @_;
+    my $start_dt = $start_date->clone();
+    my $end_dt = $end_date->clone();
     my $duration = $end_dt->delta_ms($start_dt);
     $start_dt->truncate( to => 'day' );
     $end_dt->truncate( to => 'day' );
@@ -195,12 +195,19 @@ sub hours_between {
     # However for hourly loans the logic should be expanded to
     # take into account open/close times then it would be a duration
     # of library open hours
-    while ( DateTime->compare( $start_dt, $end_dt ) == -1 ) {
-        $start_dt->add( days => 1 );
-        if ( $self->is_holiday($start_dt) ) {
-            $duration->subtract( hours => 24 );
+    my $skipped_days = 0;
+    for (my $dt = $start_dt->clone();
+        $dt <= $end_dt;
+        $dt->add(days => 1)
+    ) {
+        if ($self->is_holiday($dt)) {
+            ++$skipped_days;
         }
     }
+    if ($skipped_days) {
+        $duration->subtract_duration(DateTime::Duration->new( hours => 24 * $skipped_days));
+    }
+
     return $duration;
 
 }
@@ -221,6 +228,35 @@ sub _mockinit {
     push @{$dates}, $special;
     $self->{single_holidays} = DateTime::Set->from_datetimes( dates => $dates );
     $self->{days_mode} = 'Calendar';
+    $self->{test} = 1;
+    return;
+}
+
+sub set_daysmode {
+    my ( $self, $mode ) = @_;
+
+    # if not testing this is a no op
+    if ( $self->{test} ) {
+        $self->{days_mode} = $mode;
+    }
+
+    return;
+}
+
+sub clear_weekly_closed_days {
+    my $self = shift;
+    $self->{weekly_closed_days} = [ 0, 0, 0, 0, 0, 0, 0 ];    # Sunday only
+    return;
+}
+
+sub add_holiday {
+    my $self = shift;
+    my $new_dt = shift;
+    my @dt = $self->{exception_holidays}->as_list;
+    push @dt, $new_dt;
+    $self->{exception_holidays} =
+      DateTime::Set->from_datetimes( dates => \@dt );
+
     return;
 }
 
@@ -287,7 +323,24 @@ passed at DateTime object returns 1 if it is a closed day
 $duration = $calendar->days_between($start_dt, $end_dt);
 
 Passed two dates returns a DateTime::Duration object measuring the length between them
-ignoring closed days
+ignoring closed days. Always returns a positive number irrespective of the
+relative order of the parameters
+
+=head2 set_daysmode
+
+For testing only allows the calling script to change days mode
+
+=head2 clear_weekly_closed_days
+
+In test mode changes the testing set of closed days to a new set with
+no closed days. TODO passing an array of closed days to this would
+allow testing of more configurations
+
+=head2 add_holiday
+
+Passed a datetime object this will add it to the calendar's list of
+closed days. This is for testing so that we can alter the Calenfar object's
+list of specified dates
 
 =head1 DIAGNOSTICS
 
index a1fd088..b2c1df8 100644 (file)
@@ -80,6 +80,7 @@ sub dt_from_string {
             } elsif ( $date_format eq 'sql' ) {
                 $date_string =~
 s/(\d{4})(\d{2})(\d{2})\s+(\d{2})(\d{2})(\d{2})/$1-$2-$3T$4:$5:$6/;
+                return if ($date_string =~ /^0000-00-00/);
                 $date_string =~ s/00T/01T/;
             }
         }
@@ -94,7 +95,8 @@ s/(\d{4})(\d{2})(\d{2})\s+(\d{2})(\d{2})(\d{2})/$1-$2-$3T$4:$5:$6/;
 
 $date_string = output_pref($dt, [$format] );
 
-Returns a string containing the time & date formatted as per the C4::Context setting
+Returns a string containing the time & date formatted as per the C4::Context setting,
+or C<undef> if C<undef> was provided.
 
 A second parameter allows overriding of the syspref value. This is for testing only
 In usage use the DateTime objects own methods for non standard formatting
@@ -104,6 +106,9 @@ In usage use the DateTime objects own methods for non standard formatting
 sub output_pref {
     my $dt         = shift;
     my $force_pref = shift;    # if testing we want to override Context
+
+    return unless defined $dt;
+
     my $pref =
       defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
     given ($pref) {
@@ -158,6 +163,7 @@ sub format_sqldatetime {
     my $force_pref = shift;    # if testing we want to override Context
     if ( defined $str && $str =~ m/^\d{4}-\d{2}-\d{2}/ ) {
         my $dt = dt_from_string( $str, 'sql' );
+        return q{} unless $dt;
         $dt->truncate( to => 'minute' );
         return output_pref( $dt, $force_pref );
     }
index 5c626ba..b177ca4 100644 (file)
@@ -38,7 +38,8 @@ sub search {
               )
             : ( "recordid", "id" );
 
-    my $recordtype = ref($filters->{recordtype}) eq 'ARRAY'
+    my $recordtype;
+    $recordtype = ref($filters->{recordtype}) eq 'ARRAY'
                     ? $filters->{recordtype}[0]
                     : $filters->{recordtype}
                 if defined $filters && defined $filters->{recordtype};
index 67ace5c..9b36c14 100755 (executable)
@@ -146,7 +146,7 @@ if ( $op eq 'delete_confirm' ) {
         -type       => 'text/csv',
         -attachment => 'basket' . $basket->{'basketno'} . '.csv',
     );
-    print GetBasketAsCSV($query->param('basketno'));
+    print GetBasketAsCSV($query->param('basketno'), $query);
     exit;
 } elsif ($op eq 'close') {
     my $confirm = $query->param('confirm') || $confirm_pref eq '2';
@@ -156,8 +156,15 @@ if ( $op eq 'delete_confirm' ) {
         $basketno =~ /^\d+$/ and CloseBasket($basketno);
         # if requested, create basket group, close it and attach the basket
         if ($query->param('createbasketgroup')) {
+            my $branchcode;
+            if(C4::Context->userenv and C4::Context->userenv->{'branch'}
+              and C4::Context->userenv->{'branch'} ne "NO_LIBRARY_SET") {
+                $branchcode = C4::Context->userenv->{'branch'};
+            }
             my $basketgroupid = NewBasketgroup( { name => $basket->{basketname},
                             booksellerid => $booksellerid,
+                            deliveryplace => $branchcode,
+                            billingplace => $branchcode,
                             closed => 1,
                             });
             ModBasket( { basketno => $basketno,
index fd49c30..ac0672c 100755 (executable)
@@ -53,7 +53,7 @@ use C4::Output;
 use CGI;
 
 use C4::Bookseller qw/GetBookSellerFromId/;
-use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket/;
+use C4::Acquisition qw/CloseBasketgroup ReOpenBasketgroup GetOrders GetBasketsByBasketgroup GetBasketsByBookseller ModBasketgroup NewBasketgroup DelBasketgroup GetBasketgroups ModBasket GetBasketgroup GetBasket GetBasketGroupAsCSV/;
 use C4::Bookseller qw/GetBookSellerFromId/;
 use C4::Branch qw/GetBranches/;
 use C4::Members qw/GetMember/;
@@ -277,7 +277,7 @@ sub printbasketgrouppdf{
 
 }
 
-my $op = $input->param('op');
+my $op = $input->param('op') || 'display';
 my $booksellerid = $input->param('booksellerid');
 $template->param(booksellerid => $booksellerid);
 
@@ -417,6 +417,14 @@ if ( $op eq "add" ) {
     
     printbasketgrouppdf($basketgroupid);
     exit;
+}elsif ( $op eq "export" ) {
+    my $basketgroupid = $input->param('basketgroupid');
+    print $input->header(
+        -type       => 'text/csv',
+        -attachment => 'basketgroup' . $basketgroupid . '.csv',
+    );
+    print GetBasketGroupAsCSV( $basketgroupid, $input );
+    exit;
 }elsif( $op eq "delete"){
     my $basketgroupid = $input->param('basketgroupid');
     DelBasketgroup($basketgroupid);
index 7f799b5..e89bcae 100755 (executable)
@@ -65,6 +65,7 @@ my $isbn                    = $input->param('isbn');
 my $name                    = $input->param( 'name' );
 my $ean                     = $input->param('ean');
 my $basket                  = $input->param( 'basket' );
+my $basketgroupname             = $input->param('basketgroupname');
 my $booksellerinvoicenumber = $input->param( 'booksellerinvoicenumber' );
 my $do_search               = $input->param('do_search') || 0;
 my $from_placed_on          = C4::Dates->new($input->param('from'));
@@ -108,6 +109,7 @@ if ($do_search) {
         to_placed_on => $to_iso,
         basket => $basket,
         booksellerinvoicenumber => $booksellerinvoicenumber,
+        basketgroupname => $basketgroupname,
     );
 }
 
@@ -127,6 +129,7 @@ $template->param(
     name                    => $name,
     basket                  => $basket,
     booksellerinvoicenumber => $booksellerinvoicenumber,
+    basketgroupname         => $basketgroupname,
     from_placed_on          => $from_date,
     to_placed_on            => $to_date,
     DHTMLcalendar_dateformat=> C4::Dates->DHTMLcalendar(),
index cb35214..f45ea43 100755 (executable)
@@ -101,8 +101,8 @@ elsif ($op eq 'delete-branch-item') {
 # save the values entered
 elsif ($op eq 'add') {
     my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?');
-    my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
-    my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?  WHERE branchcode=? AND categorycode=? AND itemtype=?");
+    my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount, overduefinescap) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
+    my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=?, overduefinescap=?  WHERE branchcode=? AND categorycode=? AND itemtype=?");
     
     my $br = $branch; # branch
     my $bor  = $input->param('categorycode'); # borrower category
@@ -122,14 +122,15 @@ elsif ($op eq 'add') {
     $hardduedate = format_date_in_iso($hardduedate);
     my $hardduedatecompare = $input->param('hardduedatecompare');
     my $rentaldiscount = $input->param('rentaldiscount');
+    my $overduefinescap = $input->param('overduefinescap') || undef;
     $debug and warn "Adding $br, $bor, $cat, $fine, $maxissueqty";
 
     $sth_search->execute($br,$bor,$cat);
     my $res = $sth_search->fetchrow_hashref();
     if ($res->{total}) {
-        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat);
+        $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount,$overduefinescap, $br,$bor,$cat);
     } else {
-        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount);
+        $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount,$overduefinescap);
     }
 } 
 elsif ($op eq "set-branch-defaults") {
index e12bd5f..f7a7d05 100755 (executable)
@@ -266,18 +266,10 @@ $tabsysprefs{AdvancedSearchTypes}     = "Searching";
 $tabsysprefs{DisplayMultiPlaceHold}   = "Searching";
 
 # EnhancedContent
-$tabsysprefs{AmazonEnabled}          = "EnhancedContent";
-$tabsysprefs{OPACAmazonEnabled}      = "EnhancedContent";
 $tabsysprefs{AmazonCoverImages}      = "EnhancedContent";
 $tabsysprefs{OPACAmazonCoverImages}  = "EnhancedContent";
-$tabsysprefs{AWSAccessKeyID}         = "EnhancedContent";
-$tabsysprefs{AWSPrivateKey}          = "EnhancedContent";
 $tabsysprefs{AmazonLocale}           = "EnhancedContent";
 $tabsysprefs{AmazonAssocTag}         = "EnhancedContent";
-$tabsysprefs{AmazonSimilarItems}     = "EnhancedContent";
-$tabsysprefs{OPACAmazonSimilarItems} = "EnhancedContent";
-$tabsysprefs{AmazonReviews}          = "EnhancedContent";
-$tabsysprefs{OPACAmazonReviews}      = "EnhancedContent";
 
 # Babelthèque
 $tabsysprefs{Babeltheque}            = "EnhancedContent";
@@ -335,7 +327,6 @@ $tabsysprefs{opaccredits}                = "OPAC";
 $tabsysprefs{opaclayoutstylesheet}       = "OPAC";
 $tabsysprefs{OpacNav}                    = "OPAC";
 $tabsysprefs{opacsmallimage}             = "OPAC";
-$tabsysprefs{opacstylesheet}             = "OPAC";
 $tabsysprefs{opacthemes}                 = "OPAC";
 $tabsysprefs{opacuserjs}                 = "OPAC";
 $tabsysprefs{opacheader}                 = "OPAC";
index a3821ee..8182299 100755 (executable)
@@ -35,6 +35,7 @@ my $authtypecode = $query->param('authtypecode');
 my $index        = $query->param('index');
 my $tagid        = $query->param('tagid');
 my $resultstring = $query->param('result');
+my $relationship = $query->param('relationship');
 my $dbh          = C4::Context->dbh;
 
 my $startfrom = $query->param('startfrom');
@@ -192,6 +193,9 @@ $template->param(
     authtypecode  => $authtypecode,
 );
 
+$template->{VARS}->{source} = $query->param('source') || '';
+$template->{VARS}->{relationship} = $query->param('relationship') || '';
+
 # Print the page
 output_html_with_http_headers $query, $cookie, $template->output;
 
index d687c78..bc565d1 100755 (executable)
@@ -31,20 +31,24 @@ use C4::Acquisition;
 use C4::Koha;    # XXX subfield_is_koha_internal_p
 use C4::Biblio;
 
-my $query        = new CGI;
-my $op           = $query->param('op');
+my $query = new CGI;
+my $op    = $query->param('op');
 $op ||= q{};
 my $authtypecode = $query->param('authtypecode');
 $authtypecode ||= q{};
-my $dbh          = C4::Context->dbh;
+my $dbh = C4::Context->dbh;
 
 my $authid = $query->param('authid');
 my ( $template, $loggedinuser, $cookie );
 
 my $authtypes = getauthtypes;
 my @authtypesloop;
-foreach my $thisauthtype ( sort { $authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'} }
-    keys %$authtypes )
+foreach my $thisauthtype (
+    sort {
+        $authtypes->{$a}{'authtypetext'} cmp $authtypes->{$b}{'authtypetext'}
+    }
+    keys %$authtypes
+  )
 {
     my %row = (
         value        => $thisauthtype,
@@ -54,6 +58,21 @@ foreach my $thisauthtype ( sort { $authtypes->{$a}{'authtypetext'} cmp $authtype
     push @authtypesloop, \%row;
 }
 
+if ( $op eq "delete" ) {
+    ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+        {
+            template_name   => "authorities/authorities-home.tmpl",
+            query           => $query,
+            type            => 'intranet',
+            authnotrequired => 0,
+            flagsrequired   => { catalogue => 1 },
+            debug           => 1,
+        }
+    );
+    &DelAuthority( $authid, 1 );
+
+    $op = "do_search";
+}
 if ( $op eq "do_search" ) {
     my @marclist  = $query->param('marclist');
     my @and_or    = $query->param('and_or');
@@ -69,7 +88,7 @@ if ( $op eq "do_search" ) {
       SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value,
         ( $startfrom - 1 ) * $resultsperpage,
         $resultsperpage, $authtypecode, $orderby );
-#     use Data::Dumper; warn Data::Dumper::Dumper(@$results);
+
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
             template_name   => "authorities/searchresultlist.tmpl",
@@ -81,6 +100,18 @@ if ( $op eq "do_search" ) {
         }
     );
 
+    $template->param(
+        marclist       => $query->param('marclist'),
+        and_or         => $query->param('and_or'),
+        excluding      => $query->param('excluding'),
+        operator       => $query->param('operator'),
+        orderby        => $query->param('orderby'),
+        value          => $query->param('value'),
+        authtypecode   => $query->param('authtypecode'),
+        startfrom      => $startfrom,
+        resultsperpage => $resultsperpage,
+    );
+
     my @field_data = ();
 
     # we must get parameters once again. Because if there is a mainentry, it
@@ -88,19 +119,19 @@ if ( $op eq "do_search" ) {
     # next/previous would not work anymore
     my @marclist_ini = $query->param('marclist');
     for ( my $i = 0 ; $i <= $#marclist ; $i++ ) {
-        if ($value[$i]){   
-          push @field_data, { term => "marclist",  val => $marclist_ini[$i] };
-          if (!defined $and_or[$i]) {
-              $and_or[$i] = q{};
-          }
-          push @field_data, { term => "and_or",    val => $and_or[$i] };
-          if (!defined $excluding[$i]) {
-              $excluding[$i] = q{};
-          }
-          push @field_data, { term => "excluding", val => $excluding[$i] };
-          push @field_data, { term => "operator",  val => $operator[$i] };
-          push @field_data, { term => "value",     val => $value[$i] };
-        }    
+        if ( $value[$i] ) {
+            push @field_data, { term => "marclist", val => $marclist_ini[$i] };
+            if ( !defined $and_or[$i] ) {
+                $and_or[$i] = q{};
+            }
+            push @field_data, { term => "and_or", val => $and_or[$i] };
+            if ( !defined $excluding[$i] ) {
+                $excluding[$i] = q{};
+            }
+            push @field_data, { term => "excluding", val => $excluding[$i] };
+            push @field_data, { term => "operator",  val => $operator[$i] };
+            push @field_data, { term => "value",     val => $value[$i] };
+        }
     }
 
     # construction of the url of each page
@@ -121,7 +152,7 @@ if ( $op eq "do_search" ) {
 
     my $from = ( $startfrom - 1 ) * $resultsperpage + 1;
     my $to;
-    if (!defined $total) {
+    if ( !defined $total ) {
         $total = 0;
     }
 
@@ -146,20 +177,7 @@ if ( $op eq "do_search" ) {
     );
 
 }
-elsif ( $op eq "delete" ) {
-    ( $template, $loggedinuser, $cookie ) = get_template_and_user(
-        {
-            template_name   => "authorities/authorities-home.tmpl",
-            query           => $query,
-            type            => 'intranet',
-            authnotrequired => 0,
-            flagsrequired   => { catalogue => 1 },
-            debug           => 1,
-        }
-    );
-    &DelAuthority( $authid, 1 );
-}
-else {
+if ( $op eq '' ) {
     ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         {
             template_name   => "authorities/authorities-home.tmpl",
@@ -173,9 +191,7 @@ else {
 
 }
 
-$template->param(
-    authtypesloop => \@authtypesloop,
-);
+$template->param( authtypesloop => \@authtypesloop, );
 
 $template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour");
 
index 5774e6f..5b6afbd 100755 (executable)
@@ -604,7 +604,11 @@ if ($op eq "add") {
         } else {
             ($authid) = AddAuthority($record,$authid,$authtypecode);
         }
-        print $input->redirect("detail.pl?authid=$authid");
+        if ($myindex) {
+            print $input->redirect("blinddetail-biblio-search.pl?authid=$authid&index=$myindex");
+        } else {
+            print $input->redirect("detail.pl?authid=$authid");
+        }
         exit;
     } else {
     # it may be a duplicate, warn the user and do nothing
index 7de7db3..4aa2093 100755 (executable)
@@ -54,6 +54,7 @@ my $dbh = C4::Context->dbh;
 my $authid       = $query->param('authid');
 my $index        = $query->param('index');
 my $tagid        = $query->param('tagid');
+my $relationship = $query->param('relationship');
 my $authtypecode = &GetAuthTypeCode($authid);
 my $tagslib      = &GetTagsLabels( 1, $authtypecode );
 
@@ -95,6 +96,8 @@ if ($authid) {
         my $letter = $_ || '@';
         push( @subfield_loop, {marc_subfield => $letter, marc_values => $subfields{$_}} );
     }
+
+    push( @subfield_loop, { marc_subfield => 'w', marc_values => $relationship } ) if ( $relationship );
 }
 else {
     # authid is empty => the user want to empty the entry.
index c9e7c47..6584123 100755 (executable)
@@ -69,9 +69,9 @@ my $i = 0;
     foreach my $result (@$results) {
         if($i > 0){ print ","; }
         my $value = '';
-        my $authorized = $result->{'summary'}->{authorized};
+        my $authorized = $result->{'summary'}->{'authorized'};
         foreach my $heading (@$authorized) {
-            $value .= $heading . ' ';
+            $value .= $heading->{'heading'} . ' ';
         }
         $value = "{\"summary\":\"" . $value . "\"" . "}";
         print nsb_clean($value) . "\n";
index d110740..f2ad4eb 100755 (executable)
@@ -325,7 +325,7 @@ foreach ( keys %{$dat} ) {
 
 # does not work: my %views_enabled = map { $_ => 1 } $template->query(loop => 'EnableViews');
 # method query not found?!?!
-
+$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("AmazonCoverImages"));
 $template->param(
     itemloop        => \@itemloop,
     biblionumber        => $biblionumber,
@@ -352,45 +352,6 @@ if (C4::Context->preference("FRBRizeEditions")==1) {
     };
     if ($@) { warn "XISBN Failed $@"; }
 }
-if ( C4::Context->preference("AmazonEnabled") == 1 ) {
-    $template->param( AmazonTld => get_amazon_tld() );
-    my $amazon_reviews  = C4::Context->preference("AmazonReviews");
-    my $amazon_similars = C4::Context->preference("AmazonSimilarItems");
-    my @services;
-    if ( $amazon_reviews ) {
-        $template->param( AmazonReviews => 1 );
-        push( @services, 'EditorialReview' );
-    }
-    if ( $amazon_similars ) {
-        $template->param( AmazonSimilarItems => 1 );
-        push( @services, 'Similarities' );
-    }
-    my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour, \@services );
-    if ( $amazon_similars ) {
-        my $similar_products_exist;
-        my @similar_products;
-        for my $similar_product (@{$amazon_details->{Items}->{Item}->[0]->{SimilarProducts}->{SimilarProduct}}) {
-            # do we have any of these isbns in our collection?
-            my $similar_biblionumbers = get_biblionumber_from_isbn($similar_product->{ASIN});
-            # verify that there is at least one similar item
-                   if (scalar(@$similar_biblionumbers)){            
-                           $similar_products_exist++ if ($similar_biblionumbers && $similar_biblionumbers->[0]);
-                push @similar_products, +{ similar_biblionumbers => $similar_biblionumbers, title => $similar_product->{Title}, ASIN => $similar_product->{ASIN}  };
-            }
-        }
-        $template->param( AmazonSimilarItems       => $similar_products_exist );
-        $template->param( AMAZON_SIMILAR_PRODUCTS  => \@similar_products      );
-    }
-    if ( $amazon_reviews ) {
-        my $item = $amazon_details->{Items}->{Item}->[0];
-        my $editorial_reviews = \@{ $item->{EditorialReviews}->{EditorialReview} };
-        #my $customer_reviews  = \@{$amazon_details->{Items}->{Item}->[0]->{CustomerReviews}->{Review}};
-        #my $average_rating = $amazon_details->{Items}->{Item}->[0]->{CustomerReviews}->{AverageRating} || 0;
-        #$template->param( amazon_average_rating    => $average_rating * 20    );
-        #$template->param( AMAZON_CUSTOMER_REVIEWS  => $customer_reviews       );
-        $template->param( AMAZON_EDITORIAL_REVIEWS => $editorial_reviews      );
-    }
-}
 
 if ( C4::Context->preference("LocalCoverImages") == 1 ) {
     my @images = ListImagesForBiblio($biblionumber);
index 79534a4..7bca2f3 100755 (executable)
@@ -70,8 +70,7 @@ if ($query) {
 
     # build query
     my @operands = $query;
-    my (@operators, @indexes, @sort_by, @limits) = ();
-    my ( $builterror,$builtquery,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,@limits,\@sort_by,undef,undef);
+    my ( $builterror,$builtquery,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(undef,\@operands);
 
     # find results
     my ( $error, $marcresults, $total_hits ) = SimpleSearch($builtquery, $results_per_page * ($page - 1), $results_per_page);
index 8543297..7b7dbac 100755 (executable)
@@ -33,6 +33,9 @@ use C4::ClassSource;
 use C4::Dates;
 use List::MoreUtils qw/any/;
 use C4::Search;
+use Storable qw(thaw freeze);
+use URI::Escape;
+
 
 use MARC::File::XML;
 use URI::Escape;
@@ -277,6 +280,33 @@ sub generate_subfield_form {
         return \%subfield_data;
 }
 
+# Removes some subfields when prefilling items
+# This function will remove any subfield that is not in the SubfieldsToUseWhenPrefill syspref
+sub removeFieldsForPrefill {
+
+    my $item = shift;
+
+    # Getting item tag
+    my ($tag, $subtag) = GetMarcFromKohaField("items.barcode", '');
+
+    # Getting list of subfields to keep
+    my $subfieldsToUseWhenPrefill = C4::Context->preference('SubfieldsToUseWhenPrefill');
+
+    # Removing subfields that are not in the syspref
+    if ($tag && $subfieldsToUseWhenPrefill) {
+        my $field = $item->field($tag);
+        my @subfieldsToUse= split(/ /,$subfieldsToUseWhenPrefill);
+        foreach my $subfield ($field->subfields()) {
+            if (!grep { $subfield->[0] eq $_ } @subfieldsToUse) {
+                $field->delete_subfield(code => $subfield->[0]);
+            }
+
+        }
+    }
+
+    return $item;
+
+}
 
 my $input        = new CGI;
 my $error        = $input->param('error');
@@ -315,9 +345,26 @@ my $oldrecord = TransformMarcToKoha($dbh,$record);
 my $itemrecord;
 my $nextop="additem";
 my @errors; # store errors found while checking data BEFORE saving item.
+
+# Getting last created item cookie
+my $prefillitem = C4::Context->preference('PrefillItem');
+my $justaddeditem;
+my $cookieitemrecord;
+if ($prefillitem) {
+    my $lastitemcookie = $input->cookie('LastCreatedItem');
+    if ($lastitemcookie) {
+        $lastitemcookie = uri_unescape($lastitemcookie);
+        if ( thaw($lastitemcookie) ) {
+            $cookieitemrecord = thaw($lastitemcookie) ;
+            $cookieitemrecord = removeFieldsForPrefill($cookieitemrecord);
+        }
+    }
+}
+
 #-------------------------------------------------------------------------------
 if ($op eq "additem") {
-#-------------------------------------------------------------------------------
+
+    #-------------------------------------------------------------------------------
     # rebuild
     my @tags      = $input->param('tag');
     my @subfields = $input->param('subfield');
@@ -334,26 +381,55 @@ if ($op eq "additem") {
     my $add_multiple_copies_submit = $input->param('add_multiple_copies_submit');
     my $number_of_copies           = $input->param('number_of_copies');
 
+    # This is a bit tricky : if there is a cookie for the last created item and
+    # we just added an item, the cookie value is not correct yet (it will be updated
+    # next page). To prevent the form from being filled with outdated values, we
+    # force the use of "add and duplicate" feature, so the form will be filled with
+    # correct values.
+    $add_duplicate_submit = 1 if ($prefillitem);
+    $justaddeditem = 1;
+
+    # if autoBarcode is set to 'incremental', calculate barcode...
+    if ( C4::Context->preference('autoBarcode') eq 'incremental' ) {
+        $record = _increment_barcode($record, $frameworkcode);
+    }
+
+
     if (C4::Context->preference('autoBarcode') eq 'incremental') {
         $record = _increment_barcode($record, $frameworkcode);
     }
 
-    my $addedolditem = TransformMarcToKoha($dbh,$record);
+    my $addedolditem = TransformMarcToKoha( $dbh, $record );
 
     # If we have to add or add & duplicate, we add the item
-    if ($add_submit || $add_duplicate_submit) {
-       # check for item barcode # being unique
-       my $exist_itemnumber = get_item_from_barcode($addedolditem->{'barcode'});
-       push @errors,"barcode_not_unique" if($exist_itemnumber);
-       # if barcode exists, don't create, but report The problem.
-    unless ($exist_itemnumber) {
-           my ($oldbiblionumber,$oldbibnum,$oldbibitemnum) = AddItemFromMarc($record,$biblionumber);
-        set_item_default_location($oldbibitemnum);
-    }
-       $nextop = "additem";
-       if ($exist_itemnumber) {
-           $itemrecord = $record;
-       }
+    if ( $add_submit || $add_duplicate_submit ) {
+
+        # check for item barcode # being unique
+        my $exist_itemnumber = get_item_from_barcode( $addedolditem->{'barcode'} );
+        push @errors, "barcode_not_unique" if ($exist_itemnumber);
+
+        # if barcode exists, don't create, but report The problem.
+        unless ($exist_itemnumber) {
+            my ( $oldbiblionumber, $oldbibnum, $oldbibitemnum ) = AddItemFromMarc( $record, $biblionumber );
+            set_item_default_location($oldbibitemnum);
+
+            # Pushing the last created item cookie back
+            if ($prefillitem && defined $record) {
+                my $itemcookie = $input->cookie(
+                    -name => 'LastCreatedItem',
+                    # We uri_escape the whole freezed structure so we're sure we won't have any encoding problems
+                    -value   => uri_escape_utf8( freeze( $record ) ),
+                    -expires => ''
+                );
+
+                $cookie = [ $cookie, $itemcookie ];
+            }
+
+        }
+        $nextop = "additem";
+        if ($exist_itemnumber) {
+            $itemrecord = $record;
+        }
     }
 
     # If we have to add & duplicate
@@ -370,6 +446,7 @@ if ($op eq "additem") {
             $fieldItem->delete_subfields($tagsubfield);
             $itemrecord->insert_fields_ordered($fieldItem);
         }
+    $itemrecord = removeFieldsForPrefill($itemrecord) if ($prefillitem);
     }
 
     # If we have to add multiple copies
@@ -564,13 +641,16 @@ if ( C4::Context->preference('EasyAnalyticalRecords') ) {
         $analyticfield = '461';
     }
     foreach my $hostfield ($temp->field($analyticfield)){
-       if ($hostfield->subfield('0')){
-            my $hostrecord = GetMarcBiblio($hostfield->subfield('0'), 1);
-           my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostfield->subfield('0')) );
-           foreach my $hostitem ($hostrecord->field($itemfield)){
-               if ($hostitem->subfield('9') eq $hostfield->subfield('9')){
-                   push (@fields, $hostitem);
-                    push (@hostitemnumbers, $hostfield->subfield('9'));
+        my $hostbiblionumber = $hostfield->subfield('0');
+        if ($hostbiblionumber){
+            my $hostrecord = GetMarcBiblio($hostbiblionumber, 1);
+            if ($hostrecord) {
+                my ($itemfield, undef) = GetMarcFromKohaField( 'items.itemnumber', GetFrameworkCode($hostbiblionumber) );
+                foreach my $hostitem ($hostrecord->field($itemfield)){
+                    if ($hostitem->subfield('9') eq $hostfield->subfield('9')){
+                        push (@fields, $hostitem);
+                        push (@hostitemnumbers, $hostfield->subfield('9'));
+                    }
                 }
             }
         }
@@ -693,6 +773,11 @@ if($itemrecord){
             }
     # and now we add fields that are empty
 
+# Using last created item if it exists
+
+$itemrecord = $cookieitemrecord if ($prefillitem and not $justaddeditem and $op ne "edititem");
+
+# We generate form, and fill with values if defined
 foreach my $tag ( keys %{$tagslib}){
     foreach my $subtag (keys %{$tagslib->{$tag}}){
         next if subfield_is_koha_internal_p($subtag);
index c5e1fd3..5aeae9f 100755 (executable)
@@ -22,8 +22,11 @@ use warnings;
 no warnings 'redefine'; # otherwise loading up multiple plugins fills the log with subroutine redefine warnings
 
 use C4::Context;
+require C4::Barcodes::ValueBuilder;
 require C4::Dates;
 
+use Algorithm::CheckDigits;
+
 my $DEBUG = 0;
 
 =head1
@@ -55,14 +58,14 @@ the 3 scripts are inserted after the <input> in the html code
 sub plugin_javascript {
        my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
        my $function_name= "barcode".(int(rand(100000))+1);
+    my %args;
 
        # find today's date
-       my ($year, $mon, $day) = split('-', C4::Dates->today('iso'));
-       my ($tag,$subfield)       =  GetMarcFromKohaField("items.barcode", '');
-       my ($loctag,$locsubfield) =  GetMarcFromKohaField("items.homebranch", '');
+    ($args{year}, $args{mon}, $args{day}) = split('-', C4::Dates->today('iso'));
+    ($args{tag},$args{subfield})       =  GetMarcFromKohaField("items.barcode", '');
+    ($args{loctag},$args{locsubfield}) =  GetMarcFromKohaField("items.homebranch", '');
 
        my $nextnum;
-       my $query;
     my $scr;
        my $autoBarcodeType = C4::Context->preference("autoBarcode");
     warn "Barcode type = $autoBarcodeType" if $DEBUG;
@@ -77,51 +80,34 @@ sub plugin_javascript {
         </script>");
     }
        if ($autoBarcodeType eq 'annual') {
-               $query = "select max(cast( substring_index(barcode, '-',-1) as signed)) from items where barcode like ?";
-               my $sth=$dbh->prepare($query);
-               $sth->execute("$year%");
-               while (my ($count)= $sth->fetchrow_array) {
-            warn "Examining Record: $count" if $DEBUG;
-               $nextnum = $count if $count;
-               }
-               $nextnum++;
-               $nextnum = sprintf("%0*d", "4",$nextnum);
-               $nextnum = "$year-$nextnum";
+        ($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args);
        }
        elsif ($autoBarcodeType eq 'incremental') {
-               # not the best, two catalogers could add the same barcode easily this way :/
-               $query = "select max(abs(barcode)) from items";
-        my $sth = $dbh->prepare($query);
-               $sth->execute();
-               while (my ($count)= $sth->fetchrow_array) {
-                       $nextnum = $count;
-               }
-               $nextnum++;
+        ($nextnum, $scr) = C4::Barcodes::ValueBuilder::incremental::get_barcode(\%args);
     }
     elsif ($autoBarcodeType eq 'hbyymmincr') {      # Generates a barcode where hb = home branch Code, yymm = year/month catalogued, incr = incremental number, reset yearly -fbcit
-        $year = substr($year, -2);
-        $query = "SELECT MAX(CAST(SUBSTRING(barcode,-4) AS signed)) AS number FROM items WHERE barcode REGEXP ?";
+        ($nextnum, $scr) = C4::Barcodes::ValueBuilder::hbyymmincr::get_barcode(\%args);
+    }
+    elsif ($autoBarcodeType eq 'EAN13') {
+        # not the best, two catalogers could add the same barcode easily this way :/
+        my $query = "select max(abs(barcode)) from items";
         my $sth = $dbh->prepare($query);
-        $sth->execute("^[-a-zA-Z]{1,}$year");
-        while (my ($count)= $sth->fetchrow_array) {
-            $nextnum = $count if $count;
-            $nextnum = 0 if $nextnum == 9999; # this sequence only allows for cataloging 10000 books per month
-            warn "Existing incremental number = $nextnum" if $DEBUG;
+        $sth->execute();
+        while (my ($last)= $sth->fetchrow_array) {
+            $nextnum = $last;
         }
-        $nextnum++;
-        $nextnum = sprintf("%0*d", "4",$nextnum);
-        $nextnum = $year . $mon . $nextnum;
-        warn "New hbyymmincr Barcode = $nextnum" if $DEBUG;
-        $scr = " 
-        for (i=0 ; i<document.f.field_value.length ; i++) {
-            if (document.f.tag[i].value == '$loctag' && document.f.subfield[i].value == '$locsubfield') {
-                fnum = i;
-            }
+        my $ean = CheckDigits('ean');
+        if ( $ean->is_valid($nextnum) ) {
+            my $next = $ean->basenumber( $nextnum ) + 1;
+            $nextnum = $ean->complete( $next );
+            $nextnum = '0' x ( 13 - length($nextnum) ) . $nextnum; # pad zeros
+        } else {
+            warn "ERROR: invalid EAN-13 $nextnum, using increment";
+            $nextnum++;
         }
-        if (\$('#' + id).val() == '' || force) {
-            \$('#' + id).val(document.f.field_value[fnum].value + '$nextnum');
-        }
-        ";
+    }
+    else {
+        warn "ERROR: unknown autoBarcode: $autoBarcodeType";
     }
 
     # default js body (if not filled by hbyymmincr)
diff --git a/cataloguing/value_builder/barcode_manual.pl b/cataloguing/value_builder/barcode_manual.pl
new file mode 100755 (executable)
index 0000000..7b2e465
--- /dev/null
@@ -0,0 +1,132 @@
+#!/usr/bin/perl
+# Copyright 2000-2002 Katipo Communications
+# Parts copyright 2008-2010 Foundations Bible College
+#
+# 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;
+no warnings 'redefine'; # otherwise loading up multiple plugins fills the log with subroutine redefine warnings
+
+use C4::Context;
+require C4::Barcodes::ValueBuilder;
+require C4::Dates;
+
+my $DEBUG = 0;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+
+sub plugin_parameters {
+#   my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+    return "";
+}
+
+=head1
+
+plugin_javascript : the javascript function called when the user enters the subfield.
+contain 3 javascript functions :
+* one called when the field is entered (OnFocus). Named FocusXXX
+* one called when the field is leaved (onBlur). Named BlurXXX
+* one called when the ... link is clicked (<a href="javascript:function">) named ClicXXX
+
+returns :
+* XXX
+* a variable containing the 3 scripts.
+the 3 scripts are inserted after the <input> in the html code
+
+=cut
+
+sub plugin_javascript {
+    my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+    my $function_name= "barcode".(int(rand(100000))+1);
+    my %args;
+
+    $args{dbh} = $dbh;
+
+# find today's date
+    ($args{year}, $args{mon}, $args{day}) = split('-', C4::Dates->today('iso'));
+    ($args{tag},$args{subfield})       =  GetMarcFromKohaField("items.barcode", '');
+    ($args{loctag},$args{locsubfield}) =  GetMarcFromKohaField("items.homebranch", '');
+
+    my $nextnum;
+    my $scr;
+    my $autoBarcodeType = C4::Context->preference("autoBarcode");
+    warn "Barcode type = $autoBarcodeType" if $DEBUG;
+    if ((not $autoBarcodeType) or $autoBarcodeType eq 'OFF') {
+# don't return a value unless we have the appropriate syspref set
+        return ($function_name,
+                "<script type=\"text/javascript\">
+                // autoBarcodeType OFF (or not defined)
+                function Focus$function_name() { return 0;}
+                function  Clic$function_name() { return 0;}
+                function  Blur$function_name() { return 0;}
+                </script>");
+    }
+    if ($autoBarcodeType eq 'annual') {
+        ($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args);
+    }
+    elsif ($autoBarcodeType eq 'incremental') {
+        ($nextnum, $scr) = C4::Barcodes::ValueBuilder::incremental::get_barcode(\%args);
+    }
+    elsif ($autoBarcodeType eq 'hbyymmincr') {      # Generates a barcode where hb = home branch Code, yymm = year/month catalogued, incr = incremental number, reset yearly -fbcit
+        ($nextnum, $scr) = C4::Barcodes::ValueBuilder::hbyymmincr::get_barcode(\%args);
+    }
+
+# default js body (if not filled by hbyymmincr)
+    $scr or $scr = <<END_OF_JS;
+    if (\$('#' + id).val() == '') {
+        \$('#' + id).val('$nextnum');
+    }
+END_OF_JS
+
+        my $js  = <<END_OF_JS;
+    <script type="text/javascript">
+        //<![CDATA[
+
+        function Blur$function_name(index) {
+            //barcode validation might go here
+        }
+
+    function Focus$function_name(subfield_managed, id, force) {
+        return 0;
+    }
+
+    function Clic$function_name(id) {
+        $scr
+            return 0;
+    }
+    //]]>
+    </script>
+END_OF_JS
+        return ($function_name, $js);
+}
+
+=head1
+
+plugin: useless here
+
+=cut
+
+sub plugin {
+# my ($input) = @_;
+    return "";
+}
+
+1;
index a44b5ea..5e22636 100755 (executable)
@@ -117,10 +117,14 @@ else {
     my $s = 0;
     my $query = '';
     my $nterms;
-    if ($isbn || $issn) {
-        $term=$isbn if ($isbn);
-        $term=$issn if ($issn);
-        $query .= " \@or \@attr 1=8 \"$term\" \@attr 1=7 \"$term\" ";
+    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) {
index 551ceba..78ac1a4 100755 (executable)
@@ -148,8 +148,6 @@ if($duedatespec_allow){
     if ($duedatespec) {
         if ($duedatespec =~ C4::Dates->regexp('syspref')) {
                 $datedue = dt_from_string($duedatespec);
-                $datedue->set_hour(23);
-                $datedue->set_minute(59);
         } else {
             $invalidduedate = 1;
             $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
index 52a0450..61bace9 100755 (executable)
@@ -142,6 +142,7 @@ if ( $run_report ) {
     AND items.itemnumber NOT IN (SELECT itemnumber FROM branchtransfers where datearrived IS NULL)
     AND issues.itemnumber IS NULL
     AND reserves.priority <> 0 
+    AND reserves.suspend = 0
     AND notforloan = 0 AND damaged = 0 AND itemlost = 0 AND wthdrawn = 0
     ";
     # GROUP BY reserves.biblionumber allows only items that are not checked out, else multiples occur when 
index 1fbdcaf..743bf18 100755 (executable)
@@ -573,6 +573,7 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
 
         #        my %ri;
         my $biblio = GetBiblioFromItemNumber(GetItemnumberFromBarcode($bar_code));
+        my $item   = GetItem( GetItemnumberFromBarcode($bar_code) );
         # fix up item type for display
         $biblio->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $biblio->{'itype'} : $biblio->{'itemtype'};
         $ri{itembiblionumber} = $biblio->{'biblionumber'};
@@ -584,6 +585,8 @@ foreach ( sort { $a <=> $b } keys %returneditems ) {
         $ri{ccode}            = $biblio->{'ccode'};
         $ri{itemnumber}       = $biblio->{'itemnumber'};
         $ri{barcode}          = $bar_code;
+        $ri{homebranch}       = $item->{'homebranch'};
+        $ri{holdingbranch}    = $item->{'holdingbranch'};
 
         $ri{location}         = $biblio->{'location'};
         my $shelfcode = $ri{'location'};
index bb2b642..b0c418c 100755 (executable)
@@ -163,7 +163,7 @@ opacdomain="$OPACPREFIX$name$OPACSUFFIX$DOMAIN"
 intradomain="$INTRAPREFIX$name$INTRASUFFIX$DOMAIN"
 
 
-if [ `cat $PASSWDFILE | grep "^$name:"` ]
+if [ -f $PASSWDFILE ] && [ `cat $PASSWDFILE | grep "^$name:"` ]
 then
     passwdline=`cat $PASSWDFILE | grep "^$name:"`
     mysqluser=`echo $passwdline | cut -d ":" -f 2`
@@ -221,11 +221,15 @@ then
 
     # Generate Zebra database password.
     zebrapwd="$(pwgen -s 12 1)"
+    # Future enhancement: make this configurable for when your db is on
+    # another server.
+    mysql_hostname="localhost"
     # Set up MySQL database for this instance.
     if [ "$op" = create ]
     then
         mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
 CREATE DATABASE \`$mysqldb\`;
+CREATE USER \`$mysqluser\`@'$mysql_hostname' IDENTIFIED BY '$mysqlpwd';
 CREATE USER \`$mysqluser\`@'%' IDENTIFIED BY '$mysqlpwd';
 GRANT ALL PRIVILEGES ON \`$mysqldb\`.* TO \`$mysqluser\`;
 FLUSH PRIVILEGES;
@@ -235,6 +239,7 @@ eof
     if [ "$op" = use ]
     then
         mysql --defaults-extra-file=/etc/mysql/koha-common.cnf --force <<eof
+CREATE USER \`$mysqluser\`@'$mysql_hostname' IDENTIFIED BY '$mysqlpwd';
 CREATE USER \`$mysqluser\`@'%' IDENTIFIED BY '$mysqlpwd';
 GRANT ALL PRIVILEGES ON \`$mysqldb\`.* TO \`$mysqluser\`;
 FLUSH PRIVILEGES;
index 8d7fc50..d68aebc 100755 (executable)
@@ -52,20 +52,22 @@ do
     fi
 
     echo "Removing Koha instance $name"
-
+    mysql_hostname="localhost"
     if [ "$keepmysql" != "1" ]
     then
     # The grant creates the user in case it isn't, we don't want our loop to fail if it has already being deleted.
     mysql --defaults-extra-file=/etc/mysql/koha-common.cnf <<eof
 GRANT USAGE ON \`koha_$name\`.* TO \`koha_$name\`@\`%\`;
-DROP USER \`koha_$name\`;
+GRANT USAGE ON \`koha_$name\`.* TO \`koha_$name\`@\`$mysql_hostname\`;
+DROP USER \`koha_$name\`@\`%\`;
+DROP USER \`koha_$name\`@\`$mysql_hostname\`;
 DROP DATABASE IF EXISTS \`koha_$name\`;
 FLUSH PRIVILEGES;
 eof
     fi #`
     
     # If the daemon is not running already, we don't want to fail this loop. So bin the result code if this fails.
-    koha-stop-zebra $name | /bin/true
+    koha-stop-zebra $name || /bin/true
     [ -f "/etc/apache2/sites-available/$name" ]  && \
         rm "/etc/apache2/sites-available/$name"
     [ -f "/etc/koha/sites/$name/koha-conf.xml" ] && \
@@ -89,7 +91,7 @@ eof
         rm -r "/var/run/koha/$name"
     getent passwd "$name-koha" > /dev/null && deluser --quiet "$name-koha"
     # in case the site has already been disabled, we don't want to break the loop now.
-    a2dissite "$name" | /bin/true
+    a2dissite "$name" || /bin/true
 done
 
 service apache2 restart
index e50d30a..4a58f9d 100644 (file)
@@ -586,9 +586,9 @@ November 9 2011     Koha 3.4.6 released     releases
 November 21 2011       Plea for help from Horowhenua Library Trust (Koha TM in NZ)
 November 29 2011       Koha 3.6.1 released     releases
 December 4 2011        Koha 3.2.11 released    releases
-December 6 2011        Martin Renvoize becomes the 161th developer to have a patch pushed
-December 6 2011        Adrien Saurat becomes the 162th developer to have a patch pushed
-December 6 2011        Albert Oller becomes the 163th developer to have a patch pushed
+December 6 2011        Martin Renvoize becomes the 161st developer to have a patch pushed
+December 6 2011        Adrien Saurat becomes the 162nd developer to have a patch pushed
+December 6 2011        Albert Oller becomes the 163rd developer to have a patch pushed
 December 7 2011        Jon Aker becomes the 164th developer to have a patch pushed
 December 7 2011        Koha 3.4.7 released     releases
 December 13 2011       Fabio Tiana becomes the 165th developer to have a patch pushed
@@ -601,10 +601,10 @@ January 17 2012   Sam Sanders becomes the 170th developer to have a patch pushed (
 January 18 2012        Olivier Crouzet becomes the 171st developer to have a patch pushed
 January 27 2012        Koha 3.6.3 released     releases
 January 27 2012        Koha 3.4.8 released     releases
-January 31 2012        Bart Jorgensen becomes the 172st developer to have a patch pushed
-January 31 2012        Kate Henderson becomes the 173st developer to have a patch pushed
-January 31 2012        Jono Mingard becomes the 174st developer to have a patch pushed
-January 31 2012        Jorgia Kelsey becomes the 175st developer to have a patch pushed
+January 31 2012        Bart Jorgensen becomes the 172nd developer to have a patch pushed
+January 31 2012        Kate Henderson becomes the 173rd developer to have a patch pushed
+January 31 2012        Jono Mingard becomes the 174th developer to have a patch pushed
+January 31 2012        Jorgia Kelsey becomes the 175th developer to have a patch pushed
 February 1 2012        Aleksa Vujicic becomes the 176th developer to have a patch pushed
 February 1 2012        Peter Lorimer becomes the 177th developer to have a patch pushed
 March 4 2012   Koha 3.6.4 released     releases
@@ -612,15 +612,19 @@ March 16 2012     David Cook becomes the 178th developer to have a patch pushed
 March 20 2012  Gaetan Boisson becomes the 179th developer to have a patch pushed
 April 15 2012  Marc Veron becomes the 180th developer to have a patch pushed
 April 22 2012  Koha 3.8.0 released     releases
-May 11 2012    Lyon 3 team becomes the 181th developer to have a patch pushed
+May 11 2012    Lyon 3 team becomes the 181st developer to have a patch pushed
 May 22 2012    Koha 3.8.1 released     releases
 May 25 2012    Koha 3.6.5 released     releases
-May 28 2012    Simon Story becomes the 182th developer to have a patch pushed
+May 28 2012    Simon Story becomes the 182nd developer to have a patch pushed
 May 28 2012    Piotr Kowalski becomes the 183th developer to have a patch pushed
 June 5-7 2012  Kohacon12 in Edinburgh
 June 9-11 2012 Kohacon12 hackfest in Edinburgh
 June 10 2012   Shari Perkins becomes the 184th developer to have a patch pushed
 June 20 2012   Claire Hernandez becomes the 185th developer to have a patch pushed
 June 22 2012   Koha 3.8.2 released     releases
-July 3 2012     Mark Tompsett becomes the 186th developer to have a patch pushed
+June 23 2012   Koha 3.6.6 released     releases
+July 3 2012    Mark Tompsett becomes the 186th developer to have a patch pushed
 July 7 2012    Stacey Walker becomes the 187th developer to have a patch pushed
+July 7 2012    Mirko Tietgen becomes the 188th developer to have a patch pushed
+July 22 2012   Koha 3.8.3 released     releases
+July 22 2012   Koha 3.6.7 released     releases
\ No newline at end of file
index f7042db..9b02fa6 100644 (file)
@@ -748,7 +748,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -776,7 +776,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -802,7 +803,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -826,7 +828,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -849,7 +852,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -859,7 +863,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -870,7 +875,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -880,7 +886,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '453', 'a', 'Classification number--Single number or beginning number of span', 'Classification number--Single number or beginning number of span', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '453', 'a', 'Classification number--Single number or beginning number of span', 'Classification number--Single number or beginning number of span', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '453', 'c', 'Classification element--Ending number of span', 'Classification element--Ending number of span', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '453', 'h', 'Caption hierarchy', 'Caption hierarchy', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '453', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -892,7 +899,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '453', 'z', 'Table identification', 'Table identification', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '453', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '453', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('', '453', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -902,6 +910,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -938,7 +947,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -967,7 +976,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -994,7 +1004,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -1018,7 +1029,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -1042,7 +1054,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -1053,7 +1066,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -1065,7 +1079,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -1076,7 +1091,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '553', 'a', 'Classification number--Single number or beginning number of span', 'Classification number--Single number or beginning number of span', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '553', 'a', 'Classification number--Single number or beginning number of span', 'Classification number--Single number or beginning number of span', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '553', 'c', 'Classification number--Ending number of span', 'Classification number--Ending number of span', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '553', 'h', 'Caption hierarchy', 'Caption hierarchy', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '553', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -1088,7 +1104,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '553', 'z', 'Table identification', 'Table identification', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '553', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '553', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('', '553', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -1099,6 +1116,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2019,7 +2037,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('PERSO_NAME', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2047,7 +2065,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('PERSO_NAME', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2073,7 +2092,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('PERSO_NAME', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2097,7 +2117,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('PERSO_NAME', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2120,7 +2141,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('PERSO_NAME', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2130,7 +2152,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('PERSO_NAME', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2141,7 +2164,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('PERSO_NAME', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2151,7 +2175,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('PERSO_NAME', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2161,6 +2186,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('PERSO_NAME', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('PERSO_NAME', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2197,7 +2223,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('PERSO_NAME', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2226,7 +2252,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('PERSO_NAME', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2253,7 +2280,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('PERSO_NAME', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2277,7 +2305,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('PERSO_NAME', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2301,7 +2330,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('PERSO_NAME', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2312,7 +2342,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('PERSO_NAME', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2324,7 +2355,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('PERSO_NAME', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2335,7 +2367,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('PERSO_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('PERSO_NAME', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('PERSO_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('PERSO_NAME', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2346,6 +2379,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('PERSO_NAME', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('PERSO_NAME', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('PERSO_NAME', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('PERSO_NAME', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2941,7 +2975,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('CORPO_NAME', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2969,7 +3003,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('CORPO_NAME', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -2995,7 +3030,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('CORPO_NAME', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3019,7 +3055,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('CORPO_NAME', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3042,7 +3079,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('CORPO_NAME', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3052,7 +3090,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('CORPO_NAME', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3063,7 +3102,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('CORPO_NAME', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3073,7 +3113,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('CORPO_NAME', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3083,6 +3124,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('CORPO_NAME', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('CORPO_NAME', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3119,7 +3161,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('CORPO_NAME', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3148,7 +3190,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('CORPO_NAME', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3175,7 +3218,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('CORPO_NAME', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3199,7 +3243,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('CORPO_NAME', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3223,7 +3268,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('CORPO_NAME', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3234,7 +3280,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('CORPO_NAME', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3246,7 +3293,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('CORPO_NAME', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3257,7 +3305,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CORPO_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('CORPO_NAME', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CORPO_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('CORPO_NAME', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3268,6 +3317,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CORPO_NAME', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('CORPO_NAME', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('CORPO_NAME', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CORPO_NAME', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3858,7 +3908,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('MEETI_NAME', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3886,7 +3936,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('MEETI_NAME', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3912,7 +3963,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('MEETI_NAME', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3936,7 +3988,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('MEETI_NAME', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3959,7 +4012,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('MEETI_NAME', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3969,7 +4023,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('MEETI_NAME', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3980,7 +4035,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('MEETI_NAME', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -3990,7 +4046,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('MEETI_NAME', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4000,6 +4057,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('MEETI_NAME', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('MEETI_NAME', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4036,7 +4094,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('MEETI_NAME', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4065,7 +4123,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('MEETI_NAME', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4092,7 +4151,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('MEETI_NAME', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4116,7 +4176,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('MEETI_NAME', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4140,7 +4201,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('MEETI_NAME', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4151,7 +4213,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('MEETI_NAME', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4163,7 +4226,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('MEETI_NAME', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4174,7 +4238,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('MEETI_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('MEETI_NAME', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('MEETI_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('MEETI_NAME', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4185,6 +4250,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('MEETI_NAME', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('MEETI_NAME', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('MEETI_NAME', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('MEETI_NAME', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4778,7 +4844,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('UNIF_TITLE', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4806,7 +4872,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('UNIF_TITLE', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4832,7 +4899,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('UNIF_TITLE', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4856,7 +4924,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('UNIF_TITLE', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4879,7 +4948,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('UNIF_TITLE', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4889,7 +4959,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('UNIF_TITLE', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4900,7 +4971,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('UNIF_TITLE', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4910,7 +4982,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('UNIF_TITLE', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4920,6 +4993,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('UNIF_TITLE', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('UNIF_TITLE', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4956,7 +5030,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('UNIF_TITLE', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -4985,7 +5059,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('UNIF_TITLE', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5012,7 +5087,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('UNIF_TITLE', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5036,7 +5112,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('UNIF_TITLE', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5060,7 +5137,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('UNIF_TITLE', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5071,7 +5149,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('UNIF_TITLE', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5083,7 +5162,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('UNIF_TITLE', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5094,7 +5174,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('UNIF_TITLE', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('UNIF_TITLE', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('UNIF_TITLE', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('UNIF_TITLE', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5105,6 +5186,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('UNIF_TITLE', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('UNIF_TITLE', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('UNIF_TITLE', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('UNIF_TITLE', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5684,7 +5766,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('CHRON_TERM', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5712,7 +5794,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('CHRON_TERM', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5738,7 +5821,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('CHRON_TERM', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5762,7 +5846,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('CHRON_TERM', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5785,7 +5870,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('CHRON_TERM', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5795,7 +5881,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('CHRON_TERM', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5806,7 +5893,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('CHRON_TERM', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5816,7 +5904,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('CHRON_TERM', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5826,6 +5915,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('CHRON_TERM', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('CHRON_TERM', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5862,7 +5952,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('CHRON_TERM', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5891,7 +5981,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('CHRON_TERM', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5918,7 +6009,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('CHRON_TERM', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5942,7 +6034,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('CHRON_TERM', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5966,7 +6059,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('CHRON_TERM', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5977,7 +6071,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('CHRON_TERM', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -5989,7 +6084,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('CHRON_TERM', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6000,7 +6096,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('CHRON_TERM', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('CHRON_TERM', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('CHRON_TERM', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('CHRON_TERM', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6011,6 +6108,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('CHRON_TERM', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('CHRON_TERM', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('CHRON_TERM', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('CHRON_TERM', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6553,7 +6651,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('TOPIC_TERM', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6581,7 +6679,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('TOPIC_TERM', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6607,7 +6706,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('TOPIC_TERM', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6631,7 +6731,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('TOPIC_TERM', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6654,7 +6755,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('TOPIC_TERM', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6664,7 +6766,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('TOPIC_TERM', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6675,7 +6778,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('TOPIC_TERM', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6685,7 +6789,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('TOPIC_TERM', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6695,6 +6800,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('TOPIC_TERM', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('TOPIC_TERM', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6731,7 +6837,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('TOPIC_TERM', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6760,7 +6866,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('TOPIC_TERM', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6787,7 +6894,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('TOPIC_TERM', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6811,7 +6919,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('TOPIC_TERM', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6835,7 +6944,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('TOPIC_TERM', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6846,7 +6956,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('TOPIC_TERM', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6858,7 +6969,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('TOPIC_TERM', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6869,7 +6981,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('TOPIC_TERM', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('TOPIC_TERM', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('TOPIC_TERM', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('TOPIC_TERM', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -6880,6 +6993,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('TOPIC_TERM', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('TOPIC_TERM', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('TOPIC_TERM', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('TOPIC_TERM', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7425,7 +7539,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('GEOGR_NAME', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7453,7 +7567,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('GEOGR_NAME', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7479,7 +7594,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('GEOGR_NAME', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7503,7 +7619,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('GEOGR_NAME', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7526,7 +7643,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('GEOGR_NAME', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7536,7 +7654,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('GEOGR_NAME', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7547,7 +7666,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('GEOGR_NAME', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7557,7 +7677,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('GEOGR_NAME', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7567,6 +7688,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('GEOGR_NAME', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('GEOGR_NAME', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7603,7 +7725,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('GEOGR_NAME', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7632,7 +7754,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('GEOGR_NAME', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7659,7 +7782,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('GEOGR_NAME', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7683,7 +7807,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('GEOGR_NAME', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7707,7 +7832,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('GEOGR_NAME', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7718,7 +7844,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('GEOGR_NAME', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7730,7 +7857,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('GEOGR_NAME', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7741,7 +7869,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GEOGR_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('GEOGR_NAME', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GEOGR_NAME', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('GEOGR_NAME', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -7752,6 +7881,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GEOGR_NAME', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('GEOGR_NAME', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('GEOGR_NAME', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GEOGR_NAME', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8277,7 +8407,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '360', 'i', 'Explanatory text', 'Explanatory text', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '360', '6', 'Linkage', 'Linkage', 0, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '360', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 3, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '400', 'a', 'Personal name', 'Personal name', 0, 0, 4, NULL, NULL, '''400b'',''400c'',''400q'',''400d'',''400t'',''400o'',''400m'',''400r'',''400s'',''400k'',''400n'',''400p'',''400g'',''400l'',''400f'',''400h'',''400x'',''400z'',''400y'',''400v''', 0, 0, '', '', 'PERSO_NAME'),
                ('GENRE/FORM', '400', 'b', 'Numeration', 'Numeration', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '400', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '400', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8305,7 +8435,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '400', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '400', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '400', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '400', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '410', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''410b'',''410c'',''410d'',''410t'',''410o'',''410m'',''410r'',''410s'',''410k'',''410n'',''410p'',''410g'',''410l'',''410f'',''410h'',''410x'',''410z'',''410y'',''410v''', 0, 0, '', '', 'CORPO_NAME'),
                ('GENRE/FORM', '410', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '410', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '410', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8331,7 +8462,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '410', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '410', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '410', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '410', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '411', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 4, NULL, NULL, '''411e'',''411c'',''411d'',''411t'',''411s'',''411k'',''411n'',''411p'',''411g'',''411l'',''411f'',''411h'',''411x'',''411z'',''411y'',''411v''', 0, 0, '', '', 'MEETI_NAME'),
                ('GENRE/FORM', '411', 'b', 'Number {OBSOLETE]', 'Number {OBSOLETE]', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '411', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '411', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8355,7 +8487,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '411', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '411', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '411', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '411', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '430', 'a', 'Uniform title', 'Uniform title', 0, 0, 4, NULL, NULL, '''430o'',''430m'',''430r'',''430s'',''430d'',''430k'',''430n'',''430p'',''430g'',''430l'',''430f'',''430h'',''430t'',''430x'',''430z'',''430y'',''430v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('GENRE/FORM', '430', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '430', 'f', 'Date of a work', 'Date of a work', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '430', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8378,7 +8511,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '430', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '430', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '430', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '430', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '448', 'a', 'Chronological term', 'Chronological term', 0, 0, 4, NULL, NULL, '''448y'',''448x'',''448z'',''448v''', 0, 0, '', '', 'CHRON_TERM'),
                ('GENRE/FORM', '448', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '448', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '448', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8388,7 +8522,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '448', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '448', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '448', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '448', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '450', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 4, NULL, NULL, '''450x'',''450z'',''450y'',''450v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('GENRE/FORM', '450', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '450', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '450', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8399,7 +8534,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '450', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '450', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '450', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '450', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '451', 'a', 'Geographic name', 'Geographic name', 0, 0, 4, NULL, NULL, '''451z'',''451x'',''451y'',''451v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('GENRE/FORM', '451', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '451', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '451', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8409,7 +8545,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '451', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '451', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '451', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '451', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '455', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 4, NULL, NULL, '''455v'',''455x'',''455z'',''455y''', 0, 0, '', '', 'GENRE/FORM'),
                ('GENRE/FORM', '455', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '455', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '455', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8419,6 +8556,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '455', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '455', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '455', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('GENRE/FORM', '455', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 4, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('GENRE/FORM', '480', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '480', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '480', 'w', 'Control subfield', 'Control subfield', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8455,7 +8593,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '485', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '485', '6', 'Linkage', 'Linkage', 0, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '485', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 4, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '500', 'a', 'Personal name', 'Personal name', 0, 0, 5, NULL, NULL, '''500b'',''500c'',''500q'',''500d'',''500t'',''500o'',''500m'',''500r'',''500s'',''500k'',''500n'',''500p'',''500g'',''500l'',''500f'',''500h'',''500x'',''500z'',''500y'',''500v''', 0, 0, '', '', 'PERSO_NAME'),
                ('GENRE/FORM', '500', 'b', 'Numeration', 'Numeration', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '500', 'c', 'Titles and other words associated with a name', 'Titles and other words associated with a name', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '500', 'd', 'Dates associated with a name', 'Dates associated with a name', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8484,7 +8622,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '500', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '500', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '500', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '500', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '510', 'a', 'Corporate name or jurisdiction name as entry element', 'Corporate name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''510b'',''510c'',''510d'',''510t'',''510o'',''510m'',''510r'',''510s'',''510k'',''510n'',''510p'',''510g'',''510l'',''510f'',''510h'',''510x'',''510z'',''510y'',''510v''', 0, 0, '', '', 'CORPO_NAME'),
                ('GENRE/FORM', '510', 'b', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '510', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '510', 'd', 'Date of meeting or treaty signing', 'Date of meeting or treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8511,7 +8650,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '510', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '510', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '510', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '510', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '511', 'a', 'Meeting name or jurisdiction name as entry element', 'Meeting name or jurisdiction name as entry element', 0, 0, 5, NULL, NULL, '''511e'',''511c'',''511d'',''511t'',''511s'',''511k'',''511n'',''511p'',''511g'',''511l'',''511f'',''511h'',''511x'',''511z'',''511y'',''511v''', 0, 0, '', '', 'MEETI_NAME'),
                ('GENRE/FORM', '511', 'c', 'Location of meeting', 'Location of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '511', 'd', 'Date of meeting', 'Date of meeting', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '511', 'e', 'Subordinate unit', 'Subordinate unit', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8535,7 +8675,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '511', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '511', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '511', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '511', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '530', 'a', 'Uniform title', 'Uniform title', 0, 0, 5, NULL, NULL, '''530o'',''530m'',''530r'',''530s'',''530d'',''530k'',''530n'',''530p'',''530g'',''530l'',''530f'',''530h'',''530t'',''530x'',''530z'',''530y'',''530v''', 0, 0, '', '', 'UNIF_TITLE'),
                ('GENRE/FORM', '530', 'd', 'Date of treaty signing', 'Date of treaty signing', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '530', 'f', 'Date of a work', 'Date of a work', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '530', 'g', 'Miscellaneous information', 'Miscellaneous information', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8559,7 +8700,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '530', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '530', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '530', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '530', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '548', 'a', 'Chronological term', 'Chronological term', 0, 0, 5, NULL, NULL, '''548y'',''548x'',''548z'',''548v''', 0, 0, '', '', 'CHRON_TERM'),
                ('GENRE/FORM', '548', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '548', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '548', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8570,7 +8712,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '548', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '548', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '548', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '548', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '550', 'a', 'Topical term or geographic name entry element', 'Topical term or geographic name entry element', 0, 0, 5, NULL, NULL, '''550x'',''550z'',''550y'',''550v''', 0, 0, '', '', 'TOPIC_TERM'),
                ('GENRE/FORM', '550', 'b', 'Topical term following geographic name entry element', 'Topical term following geographic name entry element', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '550', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '550', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8582,7 +8725,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '550', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '550', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '550', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '550', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '551', 'a', 'Geographic name', 'Geographic name', 0, 0, 5, NULL, NULL, '''551z'',''551x'',''551y'',''551v''', 0, 0, '', '', 'GEOGR_NAME'),
                ('GENRE/FORM', '551', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '551', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '551', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8593,7 +8737,8 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '551', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '551', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '551', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
-               ('GENRE/FORM', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', ''),
+        ('GENRE/FORM', '551', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
+        ('GENRE/FORM', '555', 'a', 'Genre/form term', 'Genre/form term', 0, 0, 5, NULL, NULL, '''555v'',''555x'',''555z'',''555y''', 0, 0, '', '', 'GENRE/FORM'),
                ('GENRE/FORM', '555', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '555', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '555', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
@@ -8604,6 +8749,7 @@ INSERT INTO `auth_subfield_structure` (`authtypecode`, `tagfield`, `tagsubfield`
                ('GENRE/FORM', '555', '5', 'Institution to which field applies', 'Institution to which field applies', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '555', '6', 'Linkage', 'Linkage', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '555', '8', 'Field link and sequence number', 'Field link and sequence number', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
+        ('GENRE/FORM', '555', '9', '9 (RLIN)', '9 (RLIN)', 0, 0, 5, NULL, NULL, NULL, 0, 1, '', '', ''),
                ('GENRE/FORM', '580', 'i', 'Reference instruction phrase', 'Reference instruction phrase', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '580', 'v', 'Form subdivision', 'Form subdivision', 1, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
                ('GENRE/FORM', '580', 'w', 'Control subfield', 'Control subfield', 0, 0, 5, NULL, NULL, NULL, 0, 0, '', '', ''),
index fc9c5f0..69304e1 100644 (file)
@@ -998,6 +998,7 @@ CREATE TABLE `issuingrules` ( -- circulation and fine rules
   `renewalsallowed` smallint(6) NOT NULL default "0", -- how many renewals are allowed
   `reservesallowed` smallint(6) NOT NULL default "0", -- how many holds are allowed
   `branchcode` varchar(10) NOT NULL default '', -- the branch this rule is for (branches.branchcode)
+  overduefinescap decimal default NULL, -- the maximum amount of an overdue fine
   PRIMARY KEY  (`branchcode`,`categorycode`,`itemtype`),
   KEY `categorycode` (`categorycode`),
   KEY `itemtype` (`itemtype`)
index 7009155..430585a 100644 (file)
@@ -2,20 +2,14 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('advancedMARCeditor',0,"If ON, the MARC editor won't display field/subfield descriptions",'','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('AllowHoldDateInFuture','0','If set a date field is displayed on the Hold screen of the Staff Interface, allowing the hold date to be set in the future.','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACAllowHoldDateInFuture','0','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','','YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonEnabled',0,'Turn ON Amazon Content - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonReviews',0,'Display Amazon review on staff interface - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonSimilarItems',0,'Turn ON Amazon Similar Items feature  - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACAmazonEnabled',0,'Turn ON Amazon Content in the OPAC - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACAmazonSimilarItems',0,'Turn ON Amazon Similar Items feature  - You MUST set AWSAccessKeyID, AWSPrivateKey, and AmazonAssocTag if enabled','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web Services','US|CA|DE|FR|JP|UK','Choice');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to AnonymousPatron borrowernumber',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('Babeltheque',0,'Turn ON Babeltheque content  - See babeltheque.com to subscribe to this service','','YesNo');
 
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('authoritysep','--','Used to separate a list of authorities in a display. Usually --',10,'free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoBarcode','OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','incremental|annual|hbyymmincr|OFF','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoBarcode','OFF','Used to autogenerate a barcode: incremental will be of the form 1, 2, 3; annual of the form 2007-0001, 2007-0002; hbyymmincr of the form HB08010001 where HB=Home Branch','incremental|annual|hbyymmincr|EAN13|OFF','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutoLocation',0,'If ON, IP authentication is enabled, blocking access to the staff client from unauthorized IP addresses',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AutomaticItemReturn',1,'If ON, Koha will automatically set up a transfer of this item to its homebranch',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('autoMemberNum',1,'If ON, patron number is auto-calculated','','YesNo');
@@ -62,7 +56,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 -- this is selected by the web installer now
 -- INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('marcflavour','MARC21','Define global MARC flavor (MARC21 or UNIMARC) used for character encoding','MARC21|UNIMARC','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MARCOrgCode','OSt','Define MARC Organization Code - http://www.loc.gov/marc/organizations/orgshome.html','','free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',9999,'Maximum fine a patron can have for a single late return','','Integer');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('MaxFine',NULL,'Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.','','Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxoutstanding',5,'maximum amount withstanding to be able make holds','','Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxreserves',50,'Define maximum number of holds a patron can place','','Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to display for each result on a page of results',NULL,'free');
@@ -90,7 +84,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacTopissue',0,'If ON, enables the \'most popular items\' link on OPAC. Warning, this is an EXPERIMENTAL feature, turning ON may overload your server',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPublic',1,'Turn on/off public OPAC',NULL,'YesNo');
@@ -155,10 +148,10 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SelfCheckHelpMessage','','Enter HTML to include under the basic Web-based Self Checkout instructions on the Help page','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACnumSearchResults',20,'Specify the maximum number of results to display on a page of results',NULL,'Integer');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder',NULL,'Specify the default sort order','asc|dsc|az|za','Choice');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField',NULL,'Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder',NULL,'Specify the default sort order','asc|dsc|za|az','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortField','relevance','Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('defaultSortOrder','dsc','Specify the default sort order','asc|dsc|az|za','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortField','relevance','Specify the default field used for sorting','relevance|popularity|call_number|pubdate|acqdate|title|author','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACdefaultSortOrder','dsc','Specify the default sort order','asc|dsc|za|az','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FacetLabelTruncationLength',20,'Specify the facet max length in OPAC',NULL,'Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('staffClientBaseURL','','Specify the base URL of the staff client',NULL,'free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('minPasswordLength',3,'Specify the minimum length of a patron/staff password',NULL,'free');
@@ -166,7 +159,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('emailLibrarianWhenHoldIsPlaced',0,'If ON, emails the librarian whenever a hold is placed',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('numReturnedItemsToShow','20','Number of returned items to show on the check-in page',NULL,'Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesMode','test','Choose the fines mode, \'off\', \'test\' (emails admin report) or \'production\' (accrue overdue fines).  Requires accruefines cronjob.','off|test|production','Choice');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('itemBarcodeInputFilter','','If set, allows specification of a item barcode input filter','whitespace|T-prefix|cuecat|libsuite8|EAN13','Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('singleBranchMode',0,'Operate in Single-branch mode, hide branch selection in the OPAC',NULL,'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('URLLinkText','','Text to display as the link anchor in the OPAC',NULL,'free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
@@ -256,7 +249,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES (
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('NovelistSelectPassword',NULL,'Enable Novelist user Profile',NULL,'free');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('NovelistSelectView','tab','Where to display Novelist Select content','tab|above|below|right','Choice');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonCoverImages', '0', 'Display cover images on OPAC from Amazon Web Services','','YesNo');
-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACAmazonReviews', '0', 'Display Amazon readers reviews on OPAC','','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AmazonCoverImages', '0', 'Display Cover Images in Staff Client from Amazon Web Services','','YesNo');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'StaffSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the Staff client', 'Integer');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'OPACSerialIssueDisplayCount', '3', '', 'Number of serial issues to display per subscription in the OPAC', 'Integer');
@@ -272,7 +264,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('v
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('FilterBeforeOverdueReport','0','Do not run overdue report until filter selected','','YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelFormat', '<itemcallnumber><copynumber>', '30|10', 'This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.', 'Textarea');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('SpineLabelAutoPrint', '0', '', 'If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.', 'YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AWSPrivateKey','','See:  http://aws.amazon.com.  Note that this is required after 2009/08/15 in order to retrieve any enhanced content other than book covers from Amazon.','','free');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACFineNoRenewals','100','Fine limit above which user cannot renew books via OPAC','','Integer');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OverdueNoticeBcc','','Email address to bcc outgoing overdue notices sent by email','','free');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'NewItemsDefaultLocation', '', '', 'If set, all new items will have a location of the given Location Code ( Authorized Value type LOC )', '');
@@ -280,8 +271,8 @@ INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanatio
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'If set, when any item is ''checked in'', it''s location code will be changed to CART.', 'YesNo');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'DisplayClearScreenButton', '0', '', 'If set to ON, a clear screen button will appear on the circulation page.', 'YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patron''s cardnumber will be shown instead of their name on the holds and catalog screens', 'YesNo');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','<li><a  href="http://worldcat.org/search?q={TITLE}" target="_blank">Other Libraries (WorldCat)</a></li>\n<li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Other Databases (Google Scholar)</a></li>\n<li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Online Stores (Bookfinder.com)</a></li>','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC.  Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','70|10','Textarea');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryHTML','','Enter the HTML that will appear in a column on the \'my profile\' tab when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','70|10','Textarea');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','<li><a  href="http://worldcat.org/search?q={TITLE}" target="_blank">Other Libraries (WorldCat)</a></li>\n<li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Other Databases (Google Scholar)</a></li>\n<li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&amp;title={TITLE}&amp;st=xl&amp;ac=qr" target="_blank">Online Stores (Bookfinder.com)</a></li>\n<li><a href="http://openlibrary.org/search/?author=({AUTHOR})&title=({TITLE})" target="_blank">Open Library (openlibrary.org)</a></li>','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC.  Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','70|10','Textarea');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACMySummaryHTML','','Enter the HTML that will appear in a column on the \'my summary\' and \'my reading history\' tabs when a user is logged in to the OPAC. Enter {BIBLIONUMBER}, {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the HTML. Leave blank to disable.','70|10','Textarea');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACPatronDetails','1','If OFF the patron details tab in the OPAC is disabled.','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACFinesTab','1','If OFF the patron fines tab in the OPAC is disabled.','','YesNo');
 INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('DisplayOPACiconsXSLT', '1', '', 'If ON, displays the format, audience, type icons in XSLT MARC21 results and display pages.', 'YesNo');
@@ -375,3 +366,6 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES (
 INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo');
 INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('PrefillItem','0','When a new item is added, should it be prefilled with last created item values?','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToUseWhenPrefill','','Define a list of subfields to use when prefilling items (separated by space)','','Free');
index dbceb8d..c6b6063 100755 (executable)
@@ -5536,9 +5536,6 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
-
-
-
 $DBversion = "3.09.00.026";
 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES
@@ -5556,6 +5553,137 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
     SetVersion($DBversion);
 }
 
+$DBversion = '3.09.00.027';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("ALTER TABLE issuingrules ADD overduefinescap decimal DEFAULT NULL");
+    my $maxfine = C4::Context->preference('MaxFine');
+    if ($maxfine && $maxfine < 900) { # an arbitrary value that tells us it's not "some huge value"
+      $dbh->do("UPDATE issuingrules SET overduefinescap=?",undef,$maxfine);
+      $dbh->do("UPDATE systempreferences SET value = NULL WHERE variable = 'MaxFine'");
+    }
+    $dbh->do("UPDATE systempreferences SET explanation = 'Maximum fine a patron can have for all late returns at one moment. Single item caps are specified in the circulation rules matrix.' WHERE variable = 'MaxFine'");
+    print "Upgrade to $DBversion done (Bug 7420 add overduefinescap to circulation matrix)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.028";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    unless ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
+        my %referencetypes = (  '00' => 'PERSO_NAME',
+                                '10' => 'CORPO_NAME',
+                                '11' => 'MEETI_NAME',
+                                '30' => 'UNIF_TITLE',
+                                '48' => 'CHRON_TERM',
+                                '50' => 'TOPIC_TERM',
+                                '51' => 'GEOGR_NAME',
+                                '55' => 'GENRE/FORM'
+                );
+        my $query = q{SELECT DISTINCT authtypecode, tagfield
+                    FROM auth_subfield_structure
+                    WHERE (tagfield BETWEEN '400' AND '455' OR
+                    tagfield BETWEEN '500' and '555') AND tagsubfield='a' AND
+                    frameworkcode = '' AND ROW(authtypecode, tagfield) NOT IN
+                    (SELECT authtypecode, tagfield FROM auth_subfield_structure
+                    WHERE tagsubfield ='9' )};
+        $sth = $dbh->prepare($query);
+        $sth->execute;
+        my $sth2 = $dbh->prepare(q{INSERT INTO auth_subfield_structure
+                (authtypecode, tagfield, tagsubfield, liblibrarian, libopac,
+                 repeatable, mandatory, tab, authorised_value, value_builder,
+                 seealso, isurl, hidden, linkid, kohafield, frameworkcode)
+                VALUES (?, ?, '9', '9 (RLIN)', '9 (RLIN)', 0, 0, ?, NULL, NULL,
+                    NULL, 0, 1, '', '', '')});
+        my $sth3 = $dbh->prepare(q{UPDATE auth_subfield_structure SET
+                                    frameworkcode = ? WHERE authtypecode = ? AND
+                                    tagfield = ? AND tagsubfield = 'a'});
+        while (my $row = $sth->fetchrow_arrayref()) {
+            my ($authtypecode, $field) = @$row;
+            $sth2->execute($authtypecode, $field, substr($field, 0, 1));
+            my $authtypemarker = substr $field, 1, 2;
+            if ($authtypemarker && $referencetypes{$authtypemarker}) {
+                $sth3->execute($referencetypes{$authtypemarker}, $authtypecode, $field);
+            }
+        }
+    }
+
+    print "Upgrade to $DBversion done (Add thesaurus links for MARC21/NORMARC)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.029"; # FIXME
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("UPDATE systempreferences SET options=concat(options,'|EAN13') WHERE variable='itemBarcodeInputFilter' AND options NOT LIKE '%EAN13%'");
+    print "Upgrade to $DBversion done (Add itemBarcodeInputFilter choice EAN13)\n";
+
+    $dbh->do("UPDATE systempreferences SET options = concat(options,'|EAN13'), explanation = concat(explanation,'; EAN13 - incremental') WHERE variable = 'autoBarcode' AND options NOT LIKE '%EAN13%'");
+    print "Upgrade to $DBversion done ( Added EAN13 barcode autogeneration sequence )\n";
+
+    SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.030";
+if(C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    my $query = "SELECT value FROM systempreferences WHERE variable='opacstylesheet'";
+    my $remote= $dbh->selectrow_arrayref($query);
+    $dbh->do("DELETE from systempreferences WHERE variable='opacstylesheet'");
+    if($remote && $remote->[0]) {
+        $query="UPDATE systempreferences SET value=? WHERE variable='opaclayoutstylesheet'";
+        $dbh->do($query,undef,$remote->[0]);
+        print "NOTE: The URL of your remote opac css file has been moved to preference opaclayoutstylesheet.\n";
+    }
+    print "Upgrade to $DBversion done (BZ 8263: Make OPAC stylesheet preferences more consistent)\n";
+    SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.031";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("DELETE FROM systempreferences WHERE variable='AmazonReviews'");
+    $dbh->do("DELETE FROM systempreferences WHERE variable='AmazonSimilarItems'");
+    $dbh->do("DELETE FROM systempreferences WHERE variable='AWSAccessKeyID'");
+    $dbh->do("DELETE FROM systempreferences WHERE variable='AWSPrivateKey'");
+    $dbh->do("DELETE FROM systempreferences WHERE variable='OPACAmazonReviews'");
+    $dbh->do("DELETE FROM systempreferences WHERE variable='OPACAmazonSimilarItems'");
+    $dbh->do("DELETE FROM systempreferences WHERE variable='AmazonEnabled'");
+    $dbh->do("DELETE FROM systempreferences WHERE variable='OPACAmazonEnabled'");
+    print "Upgrade to $DBversion done ('Remove preferences controlling broken Amazon features (Bug 8679')\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.032";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+    $dbh->do("UPDATE systempreferences SET value = 'call_number' WHERE variable = 'defaultSortField' AND value = 'callnumber'");
+    $dbh->do("UPDATE systempreferences SET value = 'call_number' WHERE variable = 'OPACdefaultSortField' AND value = 'callnumber'");
+    print "Upgrade to $DBversion done (Bug 8657 - Default sort by call number does not work. Correcting system preference value.)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = '3.09.00.033';
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+   $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacSuppressionByIPRange','','Restrict the suppression to IP adresses outside of the IP range','','free');");
+   print "Upgrade to $DBversion done (Add OpacSuppressionByIPRange syspref)\n";
+   SetVersion ($DBversion);
+}
+
+$DBversion ="3.09.00.034";
+if(C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("UPDATE auth_subfield_structure SET frameworkcode = 'PERSO_NAME' WHERE frameworkcode = 'PERSO_CODE'");
+    $dbh->do("UPDATE auth_subfield_structure SET frameworkcode = 'CORPO_NAME' WHERE frameworkcode = 'ORGO_CODE'");
+    print "Upgrade to $DBversion done (Bug 8207: correct typo in authority types)\n";
+    SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.035";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+    $dbh->do("
+    INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('PrefillItem','0','When a new item is added, should it be prefilled with last created item values?','','YesNo');
+    ");
+    $dbh->do(
+    "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('SubfieldsToUseWhenPrefill','','Define a list of subfields to use when prefilling items (separated by space)','','Free');
+    ");
+    print "Upgrade to $DBversion done (Adding PrefillItem and SubfieldsToUseWhenPrefill sysprefs)\n";
+    SetVersion($DBversion);
+}
+
 =head1 FUNCTIONS
 
 =head2 TableExists($table)
@@ -5578,8 +5706,6 @@ sub TableExists {
 Drop all foreign keys of the table $table
 
 =cut
-
-
 sub DropAllForeignKeys {
     my ($table) = @_;
     # get the table description
index a8e9d0a..be057ab 100644 (file)
@@ -634,8 +634,9 @@ fieldset.rows label, fieldset.rows span.label {
 }
 
 fieldset.rows fieldset {
+    background-color: #FFF;
        border-width : 1px;
-       margin : 0 0 .5em 0;
+    margin : 1em;
        padding : .3em;
 }
 
@@ -734,6 +735,10 @@ fieldset.action, div.action {
   width: auto;
 }
 
+div.rows+div.rows {
+    margin-top : .6em;
+}
+
 div.rows {
 float : left;
 clear : left;
@@ -1184,6 +1189,16 @@ div.alert strong {
     list-style-position:inside;
 }
 
+a.clear-field {
+    background : transparent url("../../img/clear-field.png") center left no-repeat;
+    padding-left : 16px;
+}
+
+a.clone-field {
+    background : transparent url("../../img/clone-field.png") center left no-repeat;
+    padding-left : 20px;
+}
+
 a.document {
        background-position : left middle;
        background-repeat : no-repeat;
@@ -1260,6 +1275,10 @@ span.required {
        margin-left : .5em;
 }
 
+.missing{
+    background-color : #FFFFCC;
+}
+
 .term {
     background-color: #FFC;
         color : #990000;
@@ -2347,6 +2366,10 @@ ul.ui-tabs-nav li {
     font-style: italic;
 }
 
+#authfinderops {
+    float: right;
+}
+
 /* jQuery UI Datepicker */
 .ui-datepicker-trigger {
     vertical-align: middle;
@@ -2357,3 +2380,11 @@ ul.ui-tabs-nav li {
     -webkit-box-shadow: 1px 1px 3px 0 #666;
     box-shadow: 1px 1px 3px 0 #666;
 }
+
+/* css for timepicker */
+.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
+.ui-timepicker-div dl { text-align: left; }
+.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
+.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; }
index 5611a04..72162d3 100644 (file)
 <h5>Patrons and circulation</h5>
 <ul>
        <li><a href="/cgi-bin/koha/admin/categorie.pl">Patron types and categories</a></li>
-       <li><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></li>
-       <li><a href="/cgi-bin/koha/admin/roadtype.pl">Road types</a></li>
+    <li><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></li>
        <li><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></li>
-       <li><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></li>
        <li><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></li>
        <li><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></li>
+    <li><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></li>
+    <li><a href="/cgi-bin/koha/admin/roadtype.pl">Road types</a></li>
 </ul>
 
 <h5>Catalog</h5>
index a6d55df..7bffbc5 100644 (file)
@@ -1,7 +1,13 @@
+[% PROCESS 'form-blocks.inc' %]
 <script type="text/javascript">
 //<![CDATA[
 
 $(document).ready(function(){
+
+    var searchButton = new YAHOO.widget.Button("search");
+    var cancelButton = new YAHOO.widget.Button("cancel");
+    var clearButton = new YAHOO.widget.Button("clear");
+    var newButton = new YAHOO.widget.Button("createnew");
     // marclist
     $( "#value_any" ).autocomplete({
         source: function(request, response) {
@@ -85,15 +91,22 @@ $(document).ready(function(){
     });
 });
 
+function finderjumpfull(page)
+{
+    window.open(page,'','fullscreen,scrollbars');
+}
+
 //]]>
 </script>
 
 
 <form name="f" method="get" action="auth_finder.pl">
+            <input type="hidden" name="source" value="[% source %]" />
             <input type="hidden" name="op" value="do_search" />
             <input type="hidden" name="type" value="intranet" />
             <input type="hidden" name="index" value="[% index %]" />
-                <fieldset class="rows"><ol><li>
+                <fieldset class="rows"><legend>Search options</legend>
+                <ol><li>
                     <span class="label">Authority type</span>
                     [% authtypecode %]
                     <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
@@ -159,5 +172,33 @@ $(document).ready(function(){
             <option value="HeadingDsc">Heading descendant</option>
         </select>
         </li></ol></fieldset>
-            <fieldset class="action"> <input type="submit" value="Start search" class="submit" /> <a class="cancel close" href="#">Cancel</a></fieldset>
+        [% IF source == 'auth' %]
+        <fieldset class="rows"><legend>Relationship information</legend>
+            <ol>
+            <li>
+                <label for="relationship">Special relationship: </label>
+                <select name="relationship" id="relationship">
+                    [% selected=relationship %]
+                    [% PROCESS selectoptionopen value='' %]None specified</option>
+                    [% PROCESS selectoptionopen value='a' %]a - Earlier heading</option>
+                    [% PROCESS selectoptionopen value='b' %]b - Later heading</option>
+                    [% PROCESS selectoptionopen value='d' %]d - Acronym</option>
+                    [% PROCESS selectoptionopen value='f' %]f - Musical composition</option>
+                    [% PROCESS selectoptionopen value='g' %]g - Broader term</option>
+                    [% PROCESS selectoptionopen value='h' %]h - Narrower term</option>
+                    [% PROCESS selectoptionopen value='i' %]i - Reference instruction phrase in subfield $i</option>
+                    [% PROCESS selectoptionopen value='n' %]n - Not applicable</option>
+                    [% PROCESS selectoptionopen value='r' %]r - Relationship designation in $i or $4</option>
+                    [% PROCESS selectoptionopen value='t' %]t - Immediate parent body</option>
+                </select>
+            </li>
+            </ol>
+        </fieldset>
+        [% END %]
+        <fieldset class="action"> <input type="submit" value="Start search" class="submit" id="search" /> <a id="cancel" class="cancel close" href="#">Cancel</a>
+        <span id="authfinderops">
+        <a href="javascript:finderjumpfull('blinddetail-biblio-search.pl?authid=0&amp;index=[% index %]')" id="clear" class="button">Clear field</a>
+        <a href="javascript:finderjumpfull('authorities.pl?index=[% index %]&authtypecode=[% authtypecode %]')" id="createnew" class="button">Create new</a>
+        </span>
+        </fieldset>
 </form>
index 92314b1..3defe48 100644 (file)
@@ -30,7 +30,7 @@
     [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
     [% UNLESS ( summary.summaryonly ) %]
         [% FOREACH authorize IN summary.authorized %]
-            <span class="authorizedheading">[% authorize %]</span>
+            <span class="authorizedheading">[% authorize.heading %]</span>
         [% END %]
         [% IF ( marcflavour == 'UNIMARC' ) %]
             [% FOREACH note IN summary.notes %]
index 0b70028..b99c52a 100644 (file)
@@ -1,4 +1,4 @@
-<div id="header" class="gradient">
+<div class="gradient">
 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Fund Admin Resident Search Box -->
 
 <div id="header_search">
index 091f7fe..f2cd877 100644 (file)
@@ -7,7 +7,7 @@
 <ul>
 [% IF ( patronimages ) %]
 [% IF ( picture ) %]
-<li><img src="/cgi-bin/koha/members/patronimage.pl?crdnum=[% cardnumber %]" id="patronimage" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li>
+<li><img src="/cgi-bin/koha/members/patronimage.pl?crdnum=[% cardnumber | uri %]" id="patronimage" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="max-width : 140px; margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC; width:auto !important; width:130px;" /></li>
 [% ELSE %]
 <li><img src="/intranet-tmpl/prog/img/patron-blank.png" alt="[% firstname %] [% surname %] ([% cardnumber %])" border="0" style="margin: .3em 0 .3em .3em; padding: .2em; border: 1px solid #CCCCCC;" /></li>
 [% END %]
@@ -69,6 +69,7 @@
     [% IF ( CAN_user_updatecharges ) %]
         [% IF ( finesview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Fines</a></li>
     [% END %]
+    [% IF ( routinglistview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/routing-lists.pl?borrowernumber=[% borrowernumber %]">Routing Lists</a></li>
     [% IF ( intranetreadinghistory ) %]
         [% IF ( readingrecordview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/readingrec.pl?borrowernumber=[% borrowernumber %]">Circulation history</a></li>
     [% END %]
index cc46780..191f7f3 100644 (file)
@@ -1,4 +1,4 @@
-<div id="header" class="gradient">
+<div class="gradient">
 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Cities Resident Search Box -->
 <div id="header_search">
        <div id="city_search" class="residentsearch">
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/form-blocks.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/form-blocks.inc
new file mode 100644 (file)
index 0000000..8c307d5
--- /dev/null
@@ -0,0 +1,5 @@
+[% BLOCK selectoptionopen %]
+    [% IF value == selected %]<option value='[% value %]' selected='selected'>
+    [% ELSE %]<option value='[% value %]'>
+    [% END %]
+[% END %]
index 2749309..880c34c 100644 (file)
           <option value='email,emailpro,B_email,'>Email</option>
           <option value='borrowernumber'>Borrower number</option>
           <option value='phone,phonepro,B_phone,altcontactphone,mobile'>Phone number</option>
+          <option value='streettype,address,address2,city,state,zipcode,country'>Street Address</option>
       </select>
 
     <label for="orderby">Order by:</label>
     <select name="orderby" id="searchorderby">
-    <option value="surname,0">Surname</option>
+    <option value="">Surname, Firstname</option>
     <option value="cardnumber,0">Cardnumber</option>
     </select>
     <input value="Search" class="submit" type="submit" />
index 65d0aef..3fd9f5d 100644 (file)
@@ -1,4 +1,4 @@
-<div id="header" class="gradient">
+<div class="gradient">
 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Patrons Admin Resident Search Box -->
 <div id="header_search">
        <div id="patron_category_search" class="residentsearch">
index 21a83ab..f7bb425 100644 (file)
@@ -1,5 +1,4 @@
-
-<div id="header" class="gradient">
+<div class="gradient">
 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Roads Resident Search Box -->
 <div id="header_search">
      <div id="roadtype_search" class="residentsearch ui-tabs-panel">
index 94190ea..da47e19 100644 (file)
@@ -1,4 +1,4 @@
-<div id="header" class="gradient">
+<div class="gradient">
 <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin z3950 Admin Resident Search Box -->
 <div id="header_search">
     <div id="z3950_search" class="residentsearch">
index ba6e126..2c15b04 100644 (file)
@@ -189,7 +189,7 @@ function check_additem(unique_item_fields) {
             continue;
         }
         var values = new Array();
-        $("[name='kohafield'][value=items."+ fieldname +"]").each(function(){
+        $("[name='kohafield'][value='items."+ fieldname +"']").each(function(){
             var input = $(this).prevAll("input[name='field_value']")[0];
             if($(input).val()) {
                 values.push($(input).val());
index a036128..89d99b0 100644 (file)
@@ -1,5 +1,5 @@
 /*!
- * jQuery UI CSS Framework 1.8.20
+ * jQuery UI CSS Framework 1.8.22
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -39,7 +39,7 @@
 
 
 /*!
- * jQuery UI CSS Framework 1.8.20
+ * jQuery UI CSS Framework 1.8.22
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
 .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
 .ui-widget .ui-widget { font-size: 1em; }
 .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
-.ui-widget-content { border: 1px solid #B9D8D9; background: #ffffff; color: #222222; }
+.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
 .ui-widget-content a { color: #222222; }
-.ui-widget-header { border: 1px solid #B9D8D9; background: #E6F0F2 none; color: #222222; font-weight: bold; }
+.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
 .ui-widget-header a { color: #222222; }
 
 /* Interaction states
 ----------------------------------*/
-.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #B9D8D9; background: #F4F8F9 none; font-weight: normal; color: #555555; }
+.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; }
 .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; }
-.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #B9D8D9; background: #E6F0F2 none; font-weight: normal; color: #212121; }
+.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
 .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; }
-.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff none; font-weight: normal; color: #212121; }
+.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; }
 .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; }
 .ui-widget :active { outline: none; }
 
 /* Interaction Cues
 ----------------------------------*/
-.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #FED22F; background: #FFF4C6; color: #363636; }
+.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight  {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; }
 .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
-.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec; color: #cd0a0a; }
+.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; }
 .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; }
 .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
 .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; }
 /* 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 Autocomplete 1.8.20
+ * jQuery UI Autocomplete 1.8.22
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
  *
  * http://docs.jquery.com/UI/Autocomplete#theming
  */
-.ui-autocomplete { position: absolute; cursor: default; -webkit-box-shadow: 2px 2px 2px rgba(0,0,0,.3); -moz-box-shadow: 2px 2px 2px rgba(0,0,0,.3); box-shadow: 2px 2px 2px rgba(0,0,0,.3); }
-
-.ui-autocomplete.ui-widget-content .ui-state-hover { border: 1px solid #B9D8D9; background: #E6F0F2 none; font-weight: normal; color: #212121;
-}
-
-.ui-autocomplete-loading {
-    background: #FFF url("../../img/loading-small.gif") right center no-repeat;
-}
+.ui-autocomplete { position: absolute; cursor: default; }
 
 /* workarounds */
 * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
 
 /*
- * jQuery UI Menu 1.8.20
+ * jQuery UI Menu 1.8.22
  *
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
     display:block;
     float: left;
 }
-.ui-menu li {
-    list-style:none;
-}
 .ui-menu .ui-menu {
     margin-top: -3px;
 }
     margin: -1px;
 }
 /*!
- * jQuery UI Tabs 1.8.20
+ * jQuery UI Slider 1.8.22
+ *
+ * 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/Slider#theming
+ */
+.ui-slider { position: relative; text-align: left; }
+.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; }
+.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; }
+
+.ui-slider-horizontal { height: .8em; }
+.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; }
+.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; }
+.ui-slider-horizontal .ui-slider-range-min { left: 0; }
+.ui-slider-horizontal .ui-slider-range-max { right: 0; }
+
+.ui-slider-vertical { width: .8em; height: 100px; }
+.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
+.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
+.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
+.ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
+ * jQuery UI Tabs 1.8.22
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
 .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
 .ui-tabs .ui-tabs-hide { display: none !important; }
 /*!
- * jQuery UI Datepicker 1.8.20
+ * jQuery UI Datepicker 1.8.22
  *
  * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
  * Dual licensed under the MIT or GPL Version 2 licenses.
 .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
 .ui-datepicker select.ui-datepicker-month,
 .ui-datepicker select.ui-datepicker-year { width: 49%;}
-.ui-datepicker table {width: 100%; font-size: .9em; border : 0; border-collapse: collapse; margin:0 0 .4em; }
-.ui-datepicker th { background : transparent none; padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
+.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
+.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0;  }
 .ui-datepicker td { border: 0; padding: 1px; }
 .ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
 .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
 
 /* IE6 IFRAME FIX (taken from datepicker 1.5.3 */
 .ui-datepicker-cover {
-    display: none; /*sorry for IE5*/
-    display/**/: block; /*sorry for IE5*/
     position: absolute; /*must have*/
     z-index: -1; /*must have*/
     filter: mask(); /*must have*/
index 6996eae..e36a7f0 100644 (file)
-/*! jQuery UI - v1.8.21 - 2012-06-05
+/*! jQuery UI - v1.8.22 - 2012-07-24
 * https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.core.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.21",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
+(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.22",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a("<a>").outerWidth(1).jquery||a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.curCSS||(a.curCSS=a.css),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;return b[d]>0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}})})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
 * https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.widget.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
+(function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(b){for(var d=0,e;(e=b[d])!=null;d++)try{a(e).triggerHandler("remove")}catch(f){}c(b)}}else{var d=a.fn.remove;a.fn.remove=function(b,c){return this.each(function(){return c||(!b||a.filter(b,[this]).length)&&a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(b){}}),d.call(a(this),b,c)})}}a.widget=function(b,c,d){var e=b.split(".")[0],f;b=b.split(".")[1],f=e+"-"+b,d||(d=c,c=a.Widget),a.expr[":"][f]=function(c){return!!a.data(c,b)},a[e]=a[e]||{},a[e][b]=function(a,b){arguments.length&&this._createWidget(a,b)};var g=new c;g.options=a.extend(!0,{},g.options),a[e][b].prototype=a.extend(!0,g,{namespace:e,widgetName:b,widgetEventPrefix:a[e][b].prototype.widgetEventPrefix||b,widgetBaseClass:f},d),a.widget.bridge(b,a[e][b])},a.widget.bridge=function(c,d){a.fn[c]=function(e){var f=typeof e=="string",g=Array.prototype.slice.call(arguments,1),h=this;return e=!f&&g.length?a.extend.apply(null,[!0,e].concat(g)):e,f&&e.charAt(0)==="_"?h:(f?this.each(function(){var d=a.data(this,c),f=d&&a.isFunction(d[e])?d[e].apply(d,g):d;if(f!==d&&f!==b)return h=f,!1}):this.each(function(){var b=a.data(this,c);b?b.option(e||{})._init():a.data(this,c,new d(e,this))}),h)}},a.Widget=function(a,b){arguments.length&&this._createWidget(a,b)},a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:!1},_createWidget:function(b,c){a.data(c,this.widgetName,this),this.element=a(c),this.options=a.extend(!0,{},this.options,this._getCreateOptions(),b);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()}),this._create(),this._trigger("create"),this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName),this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+"-disabled "+"ui-state-disabled")},widget:function(){return this.element},option:function(c,d){var e=c;if(arguments.length===0)return a.extend({},this.options);if(typeof c=="string"){if(d===b)return this.options[c];e={},e[c]=d}return this._setOptions(e),this},_setOptions:function(b){var c=this;return a.each(b,function(a,b){c._setOption(a,b)}),this},_setOption:function(a,b){return this.options[a]=b,a==="disabled"&&this.widget()[b?"addClass":"removeClass"](this.widgetBaseClass+"-disabled"+" "+"ui-state-disabled").attr("aria-disabled",b),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_trigger:function(b,c,d){var e,f,g=this.options[b];d=d||{},c=a.Event(c),c.type=(b===this.widgetEventPrefix?b:this.widgetEventPrefix+b).toLowerCase(),c.target=this.element[0],f=c.originalEvent;if(f)for(e in f)e in c||(c[e]=f[e]);return this.element.trigger(c,d),!(a.isFunction(g)&&g.call(this.element[0],c,d)===!1||c.isDefaultPrevented())}}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
 * https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.mouse.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
+(function(a,b){var c=!1;a(document).mouseup(function(a){c=!1}),a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var b=this;this.element.bind("mousedown."+this.widgetName,function(a){return b._mouseDown(a)}).bind("click."+this.widgetName,function(c){if(!0===a.data(c.target,b.widgetName+".preventClickEvent"))return a.removeData(c.target,b.widgetName+".preventClickEvent"),c.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(b){if(c)return;this._mouseStarted&&this._mouseUp(b),this._mouseDownEvent=b;var d=this,e=b.which==1,f=typeof this.options.cancel=="string"&&b.target.nodeName?a(b.target).closest(this.options.cancel).length:!1;if(!e||f||!this._mouseCapture(b))return!0;this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)){this._mouseStarted=this._mouseStart(b)!==!1;if(!this._mouseStarted)return b.preventDefault(),!0}return!0===a.data(b.target,this.widgetName+".preventClickEvent")&&a.removeData(b.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(a){return d._mouseMove(a)},this._mouseUpDelegate=function(a){return d._mouseUp(a)},a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),b.preventDefault(),c=!0,!0},_mouseMove:function(b){return!a.browser.msie||document.documentMode>=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
 * https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.position.js
 * 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)}),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.21 - 2012-06-05
+(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)}),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.22 - 2012-07-24
+* 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.22"}),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.22 - 2012-07-24
+* 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.22"}),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.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.resizable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1e3},_create:function(){var b=this,c=this.options;this.element.addClass("ui-resizable"),a.extend(this,{_aspectRatio:!!c.aspectRatio,aspectRatio:c.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:c.helper||c.ghost||c.animate?c.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e<d.length;e++){var f=a.trim(d[e]),g="ui-resizable-"+f,h=a('<div class="ui-resizable-handle '+g+'"></div>');h.css({zIndex:c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);return l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),e<h.maxWidth&&(h.maxWidth=e),g<h.maxHeight&&(h.maxHeight=g);this._vBoundaries=h},_updateCache:function(a){var b=this.options;this.offset=this.helper.offset(),d(a.left)&&(this.position.left=a.left),d(a.top)&&(this.position.top=a.top),d(a.height)&&(this.size.height=a.height),d(a.width)&&(this.size.width=a.width)},_updateRatio:function(a,b){var c=this.options,e=this.position,f=this.size,g=this.axis;return d(a.height)?a.width=a.height*this.aspectRatio:d(a.width)&&(a.height=a.width/this.aspectRatio),g=="sw"&&(a.left=e.left+(f.width-a.width),a.top=null),g=="nw"&&(a.top=e.top+(f.height-a.height),a.left=e.left+(f.width-a.width)),a},_respectSize:function(a,b){var c=this.helper,e=this._vBoundaries,f=this._aspectRatio||b.shiftKey,g=this.axis,h=d(a.width)&&e.maxWidth&&e.maxWidth<a.width,i=d(a.height)&&e.maxHeight&&e.maxHeight<a.height,j=d(a.width)&&e.minWidth&&e.minWidth>a.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d<this._proportionallyResizeElements.length;d++){var e=this._proportionallyResizeElements[d];if(!this.borderDif){var f=[e.css("borderTopWidth"),e.css("borderRightWidth"),e.css("borderBottomWidth"),e.css("borderLeftWidth")],g=[e.css("paddingTop"),e.css("paddingRight"),e.css("paddingBottom"),e.css("paddingLeft")];this.borderDif=a.map(f,function(a,b){var c=parseInt(a,10)||0,d=parseInt(g[b],10)||0;return c+d})}if(!a.browser.msie||!a(c).is(":hidden")&&!a(c).parents(":hidden").length)e.css({height:c.height()-this.borderDif[0]-this.borderDif[2]||0,width:c.width()-this.borderDif[1]-this.borderDif[3]||0});else continue}},_renderProxy:function(){var b=this.element,c=this.options;this.elementOffset=b.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.22"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/d.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*d.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.selectable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("<div class='ui-selectable-helper'></div>")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.right<e||i.top>h||i.bottom<f):d.tolerance=="fit"&&(j=i.left>e&&i.right<g&&i.top>f&&i.bottom<h),j?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,c._trigger("selecting",b,{selecting:i.element}))):(i.selecting&&((b.metaKey||b.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),c._trigger("unselecting",b,{unselecting:i.element}))),i.selected&&!b.metaKey&&!b.ctrlKey&&!i.startselected&&(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,c._trigger("unselecting",b,{unselecting:i.element})))}),!1},_mouseStop:function(b){var c=this;this.dragged=!1;var d=this.options;return a(".ui-unselecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-unselecting"),d.unselecting=!1,d.startselected=!1,c._trigger("unselected",b,{unselected:d.element})}),a(".ui-selecting",this.element[0]).each(function(){var d=a.data(this,"selectable-item");d.$element.removeClass("ui-selecting").addClass("ui-selected"),d.selecting=!1,d.selected=!0,d.startselected=!0,c._trigger("selected",b,{selected:d.element})}),this._trigger("stop",b),this.helper.remove(),!1}}),a.extend(a.ui.selectable,{version:"1.8.22"})})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* 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.22"})})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* 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.22",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.22 - 2012-07-24
 * 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.21 - 2012-06-05
+(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.22 - 2012-07-24
+* 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.22 - 2012-07-24
+* 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},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!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"),g=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(g);a.each(d,function(a,b){if(a==="click")return;a in f?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.22",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.22 - 2012-07-24
+* 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.22"})})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
 * https://github.com/jquery/jquery-ui
 * Includes: jquery.ui.tabs.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},destroy:function(){var b=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.21"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){e()}:function(a){a.clientX&&c.rotate(null)});return a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate),this}})})(jQuery);;/*! jQuery UI - v1.8.21 - 2012-06-05
+(function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},destroy:function(){var b=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1<this.anchors.length?1:-1)),c.disabled=a.map(a.grep(c.disabled,function(a,c){return a!=b}),function(a,c){return a>=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.22"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a<c.anchors.length?a:0)},a),b&&b.stopPropagation()}),f=c._unrotate||(c._unrotate=b?function(a){e()}:function(a){a.clientX&&c.rotate(null)});return a?(this.element.bind("tabsshow",e),this.anchors.bind(d.event+".tabs",f),e()):(clearTimeout(c.rotation),this.element.unbind("tabsshow",e),this.anchors.unbind(d.event+".tabs",f),delete this._rotate,delete this._unrotate),this}})})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
 * 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.21"}});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; z-index: -10;"/>'),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));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+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(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},_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" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', -"+i+", 'M');\""+' 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" onclick="DP_jQuery_'+dpuuid+".datepicker._adjustDate('#"+a.id+"', +"+i+", 'M');\""+' 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" onclick="DP_jQuery_'+dpuuid+'.datepicker._hideDatepicker();">'+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" onclick="DP_jQuery_'+dpuuid+".datepicker._gotoToday('#"+a.id+"');\""+">"+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?"":' onclick="DP_jQuery_'+dpuuid+".datepicker._selectDay('#"+a.id+"',"+Y.getMonth()+","+Y.getFullYear()+', this);return false;"')+">"+(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" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'M');\" "+">";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" onchange="DP_jQuery_'+dpuuid+".datepicker._selectMonthYear('#"+a.id+"', this, 'Y');\" "+">";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.21",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.22"}});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;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.22",window["DP_jQuery_"+dpuuid]=$})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* 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.22"})})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* 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.22",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}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return-(h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g))+c},easeOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return h*Math.pow(2,-10*b)*Math.sin((b*e-f)*2*Math.PI/g)+d+c},easeInOutElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e/2)==2)return c+d;g||(g=e*.3*1.5);if(h<Math.abs(d)){h=d;var f=g/4}else var f=g/(2*Math.PI)*Math.asin(d/h);return b<1?-0.5*h*Math.pow(2,10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)+c:h*Math.pow(2,-10*(b-=1))*Math.sin((b*e-f)*2*Math.PI/g)*.5+d+c},easeInBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),e*(c/=f)*c*((g+1)*c-g)+d},easeOutBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),e*((c=c/f-1)*c*((g+1)*c+g)+1)+d},easeInOutBack:function(a,c,d,e,f,g){return g==b&&(g=1.70158),(c/=f/2)<1?e/2*c*c*(((g*=1.525)+1)*c-g)+d:e/2*((c-=2)*c*(((g*=1.525)+1)*c+g)+2)+d},easeInBounce:function(b,c,d,e,f){return e-a.easing.easeOutBounce(b,f-c,0,e,f)+d},easeOutBounce:function(a,b,c,d,e){return(b/=e)<1/2.75?d*7.5625*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+.984375)+c},easeInOutBounce:function(b,c,d,e,f){return c<f/2?a.easing.easeInBounce(b,c*2,0,e,f)*.5+d:a.easing.easeOutBounce(b,c*2-f,0,e,f)*.5+e*.5+d}})}(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.blind.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.blind=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=f=="vertical"?"height":"width",i=f=="vertical"?g.height():g.width();e=="show"&&g.css(h,0);var j={};j[h]=e=="show"?i:0,g.animate(j,b.duration,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.bounce.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.bounce=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"up",g=b.options.distance||20,h=b.options.times||5,i=b.duration||250;/show|hide/.test(e)&&d.push("opacity"),a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",g=b.options.distance||(j=="top"?c.outerHeight(!0)/3:c.outerWidth(!0)/3);e=="show"&&c.css("opacity",0).css(j,k=="pos"?-g:g),e=="hide"&&(g=g/(h*2)),e!="hide"&&h--;if(e=="show"){var l={opacity:1};l[j]=(k=="pos"?"+=":"-=")+g,c.animate(l,i/2,b.options.easing),g=g/2,h--}for(var m=0;m<h;m++){var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing),g=e=="hide"?g*2:g/2}if(e=="hide"){var l={opacity:0};l[j]=(k=="pos"?"-=":"+=")+g,c.animate(l,i/2,b.options.easing,function(){c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}else{var n={},p={};n[j]=(k=="pos"?"-=":"+=")+g,p[j]=(k=="pos"?"+=":"-=")+g,c.animate(n,i/2,b.options.easing).animate(p,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)})}c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.clip.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.clip=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","height","width"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"vertical";a.effects.save(c,d),c.show();var g=a.effects.createWrapper(c).css({overflow:"hidden"}),h=c[0].tagName=="IMG"?g:c,i={size:f=="vertical"?"height":"width",position:f=="vertical"?"top":"left"},j=f=="vertical"?h.height():h.width();e=="show"&&(h.css(i.size,0),h.css(i.position,j/2));var k={};k[i.size]=e=="show"?j:0,k[i.position]=e=="show"?0:j/2,h.animate(k,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.drop.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.drop=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","opacity"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight(!0)/2:c.outerWidth(!0)/2);e=="show"&&c.css("opacity",0).css(g,h=="pos"?-i:i);var j={opacity:e=="show"?1:0};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.explode.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.explode=function(b){return this.queue(function(){var c=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3,d=b.options.pieces?Math.round(Math.sqrt(b.options.pieces)):3;b.options.mode=b.options.mode=="toggle"?a(this).is(":visible")?"hide":"show":b.options.mode;var e=a(this).show().css("visibility","hidden"),f=e.offset();f.top-=parseInt(e.css("marginTop"),10)||0,f.left-=parseInt(e.css("marginLeft"),10)||0;var g=e.outerWidth(!0),h=e.outerHeight(!0);for(var i=0;i<c;i++)for(var j=0;j<d;j++)e.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.fade.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.fold.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* 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);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.pulsate.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show"),e=(b.options.times||5)*2-1,f=b.duration?b.duration/2:a.fx.speeds._default/2,g=c.is(":visible"),h=0;g||(c.css("opacity",0).show(),h=1),(d=="hide"&&g||d=="show"&&!g)&&e--;for(var i=0;i<e;i++)c.animate({opacity:h},f,b.options.easing),h=(h+1)%2;c.animate({opacity:h},f,b.options.easing,function(){h==0&&c.hide(),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}).dequeue()})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.scale.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.puff=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide"),e=parseInt(b.options.percent,10)||150,f=e/100,g={height:c.height(),width:c.width()};a.extend(b.options,{fade:!0,mode:d,percent:d=="hide"?e:100,from:d=="hide"?g:{height:g.height*f,width:g.width*f}}),c.effect("scale",b.options,b.duration,b.callback),c.dequeue()})},a.effects.scale=function(b){return this.queue(function(){var c=a(this),d=a.extend(!0,{},b.options),e=a.effects.setMode(c,b.options.mode||"effect"),f=parseInt(b.options.percent,10)||(parseInt(b.options.percent,10)==0?0:e=="hide"?0:100),g=b.options.direction||"both",h=b.options.origin;e!="effect"&&(d.origin=h||["middle","center"],d.restore=!0);var i={height:c.height(),width:c.width()};c.from=b.options.from||(e=="show"?{height:0,width:0}:i);var j={y:g!="horizontal"?f/100:1,x:g!="vertical"?f/100:1};c.to={height:i.height*j.y,width:i.width*j.x},b.options.fade&&(e=="show"&&(c.from.opacity=0,c.to.opacity=1),e=="hide"&&(c.from.opacity=1,c.to.opacity=0)),d.from=c.from,d.to=c.to,d.mode=e,c.effect("size",d,b.duration,b.callback),c.dequeue()})},a.effects.size=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right","width","height","overflow","opacity"],e=["position","top","bottom","left","right","overflow","opacity"],f=["width","height","overflow"],g=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],i=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],j=a.effects.setMode(c,b.options.mode||"effect"),k=b.options.restore||!1,l=b.options.scale||"both",m=b.options.origin,n={height:c.height(),width:c.width()};c.from=b.options.from||n,c.to=b.options.to||n;if(m){var p=a.effects.getBaseline(m,n);c.from.top=(n.height-c.from.height)*p.y,c.from.left=(n.width-c.from.width)*p.x,c.to.top=(n.height-c.to.height)*p.y,c.to.left=(n.width-c.to.width)*p.x}var q={from:{y:c.from.height/n.height,x:c.from.width/n.width},to:{y:c.to.height/n.height,x:c.to.width/n.width}};if(l=="box"||l=="both")q.from.y!=q.to.y&&(d=d.concat(h),c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(d=d.concat(i),c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to));(l=="content"||l=="both")&&q.from.y!=q.to.y&&(d=d.concat(g),c.from=a.effects.setTransition(c,g,q.from.y,c.from),c.to=a.effects.setTransition(c,g,q.to.y,c.to)),a.effects.save(c,k?d:e),c.show(),a.effects.createWrapper(c),c.css("overflow","hidden").css(c.from);if(l=="content"||l=="both")h=h.concat(["marginTop","marginBottom"]).concat(g),i=i.concat(["marginLeft","marginRight"]),f=d.concat(h).concat(i),c.find("*[width]").each(function(){var c=a(this);k&&a.effects.save(c,f);var d={height:c.height(),width:c.width()};c.from={height:d.height*q.from.y,width:d.width*q.from.x},c.to={height:d.height*q.to.y,width:d.width*q.to.x},q.from.y!=q.to.y&&(c.from=a.effects.setTransition(c,h,q.from.y,c.from),c.to=a.effects.setTransition(c,h,q.to.y,c.to)),q.from.x!=q.to.x&&(c.from=a.effects.setTransition(c,i,q.from.x,c.from),c.to=a.effects.setTransition(c,i,q.to.x,c.to)),c.css(c.from),c.animate(c.to,b.duration,b.options.easing,function(){k&&a.effects.restore(c,f)})});c.animate(c.to,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){c.to.opacity===0&&c.css("opacity",c.from.opacity),j=="hide"&&c.hide(),a.effects.restore(c,k?d:e),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.shake.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.shake=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"effect"),f=b.options.direction||"left",g=b.options.distance||20,h=b.options.times||3,i=b.duration||b.options.duration||140;a.effects.save(c,d),c.show(),a.effects.createWrapper(c);var j=f=="up"||f=="down"?"top":"left",k=f=="up"||f=="left"?"pos":"neg",l={},m={},n={};l[j]=(k=="pos"?"-=":"+=")+g,m[j]=(k=="pos"?"+=":"-=")+g*2,n[j]=(k=="pos"?"-=":"+=")+g*2,c.animate(l,i,b.options.easing);for(var p=1;p<h;p++)c.animate(m,i,b.options.easing).animate(n,i,b.options.easing);c.animate(m,i,b.options.easing).animate(l,i/2,b.options.easing,function(){a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments)}),c.queue("fx",function(){c.dequeue()}),c.dequeue()})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.slide.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.slide=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"show"),f=b.options.direction||"left";a.effects.save(c,d),c.show(),a.effects.createWrapper(c).css({overflow:"hidden"});var g=f=="up"||f=="down"?"top":"left",h=f=="up"||f=="left"?"pos":"neg",i=b.options.distance||(g=="top"?c.outerHeight(!0):c.outerWidth(!0));e=="show"&&c.css(g,h=="pos"?isNaN(i)?"-"+i:-i:i);var j={};j[g]=(e=="show"?h=="pos"?"+=":"-=":h=="pos"?"-=":"+=")+i,c.animate(j,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}})(jQuery);;/*! jQuery UI - v1.8.22 - 2012-07-24
+* https://github.com/jquery/jquery-ui
+* Includes: jquery.effects.transfer.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery-ui-timepicker-addon.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/jquery-ui-timepicker-addon.js
new file mode 100644 (file)
index 0000000..d1344ec
--- /dev/null
@@ -0,0 +1,1530 @@
+/*
+* jQuery timepicker addon
+* By: Trent Richardson [http://trentrichardson.com]
+* Version 1.0.1
+* Last Modified: 07/01/2012
+*
+* Copyright 2012 Trent Richardson
+* You may use this project under MIT or GPL licenses.
+* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt
+* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
+*
+* HERES THE CSS:
+* .ui-timepicker-div .ui-widget-header { margin-bottom: 8px; }
+* .ui-timepicker-div dl { text-align: left; }
+* .ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; }
+* .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; }
+*/
+
+/*jslint evil: true, maxlen: 300, white: false, undef: false, nomen: false, onevar: false */
+
+(function($) {
+
+// Prevent "Uncaught RangeError: Maximum call stack size exceeded"
+$.ui.timepicker = $.ui.timepicker || {};
+if ($.ui.timepicker.version) {
+    return;
+}
+
+$.extend($.ui, { timepicker: { version: "1.0.1" } });
+
+/* Time picker manager.
+   Use the singleton instance of this class, $.timepicker, to interact with the time picker.
+   Settings for (groups of) time pickers are maintained in an instance object,
+   allowing multiple different settings on the same page. */
+
+function Timepicker() {
+    this.regional = []; // Available regional settings, indexed by language code
+    this.regional[''] = { // Default regional settings
+        currentText: 'Now',
+        closeText: 'Done',
+        ampm: false,
+        amNames: ['AM', 'A'],
+        pmNames: ['PM', 'P'],
+        timeFormat: 'hh:mm tt',
+        timeSuffix: '',
+        timeOnlyTitle: 'Choose Time',
+        timeText: 'Time',
+        hourText: 'Hour',
+        minuteText: 'Minute',
+        secondText: 'Second',
+        millisecText: 'Millisecond',
+        timezoneText: 'Time Zone'
+    };
+    this._defaults = { // Global defaults for all the datetime picker instances
+        showButtonPanel: true,
+        timeOnly: false,
+        showHour: true,
+        showMinute: true,
+        showSecond: false,
+        showMillisec: false,
+        showTimezone: false,
+        showTime: true,
+        stepHour: 1,
+        stepMinute: 1,
+        stepSecond: 1,
+        stepMillisec: 1,
+        hour: 0,
+        minute: 0,
+        second: 0,
+        millisec: 0,
+        timezone: null,
+        useLocalTimezone: false,
+        defaultTimezone: "+0000",
+        hourMin: 0,
+        minuteMin: 0,
+        secondMin: 0,
+        millisecMin: 0,
+        hourMax: 23,
+        minuteMax: 59,
+        secondMax: 59,
+        millisecMax: 999,
+        minDateTime: null,
+        maxDateTime: null,
+        onSelect: null,
+        hourGrid: 0,
+        minuteGrid: 0,
+        secondGrid: 0,
+        millisecGrid: 0,
+        alwaysSetTime: true,
+        separator: ' ',
+        altFieldTimeOnly: true,
+        showTimepicker: true,
+        timezoneIso8601: false,
+        timezoneList: null,
+        addSliderAccess: false,
+        sliderAccessArgs: null
+    };
+    $.extend(this._defaults, this.regional['']);
+}
+
+$.extend(Timepicker.prototype, {
+    $input: null,
+    $altInput: null,
+    $timeObj: null,
+    inst: null,
+    hour_slider: null,
+    minute_slider: null,
+    second_slider: null,
+    millisec_slider: null,
+    timezone_select: null,
+    hour: 0,
+    minute: 0,
+    second: 0,
+    millisec: 0,
+    timezone: null,
+    defaultTimezone: "+0000",
+    hourMinOriginal: null,
+    minuteMinOriginal: null,
+    secondMinOriginal: null,
+    millisecMinOriginal: null,
+    hourMaxOriginal: null,
+    minuteMaxOriginal: null,
+    secondMaxOriginal: null,
+    millisecMaxOriginal: null,
+    ampm: '',
+    formattedDate: '',
+    formattedTime: '',
+    formattedDateTime: '',
+    timezoneList: null,
+
+    /* Override the default settings for all instances of the time picker.
+       @param  settings  object - the new settings to use as defaults (anonymous object)
+       @return the manager object */
+    setDefaults: function(settings) {
+        extendRemove(this._defaults, settings || {});
+        return this;
+    },
+
+    //########################################################################
+    // Create a new Timepicker instance
+    //########################################################################
+    _newInst: function($input, o) {
+        var tp_inst = new Timepicker(),
+            inlineSettings = {};
+
+        for (var attrName in this._defaults) {
+            var attrValue = $input.attr('time:' + attrName);
+            if (attrValue) {
+                try {
+                    inlineSettings[attrName] = eval(attrValue);
+                } catch (err) {
+                    inlineSettings[attrName] = attrValue;
+                }
+            }
+        }
+        tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, {
+            beforeShow: function(input, dp_inst) {
+                if ($.isFunction(o.beforeShow)) {
+                    return o.beforeShow(input, dp_inst, tp_inst);
+                }
+            },
+            onChangeMonthYear: function(year, month, dp_inst) {
+                // Update the time as well : this prevents the time from disappearing from the $input field.
+                tp_inst._updateDateTime(dp_inst);
+                if ($.isFunction(o.onChangeMonthYear)) {
+                    o.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst);
+                }
+            },
+            onClose: function(dateText, dp_inst) {
+                if (tp_inst.timeDefined === true && $input.val() !== '') {
+                    tp_inst._updateDateTime(dp_inst);
+                }
+                if ($.isFunction(o.onClose)) {
+                    o.onClose.call($input[0], dateText, dp_inst, tp_inst);
+                }
+            },
+            timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
+        });
+        tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) { return val.toUpperCase(); });
+        tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) { return val.toUpperCase(); });
+
+        if (tp_inst._defaults.timezoneList === null) {
+            var timezoneList = [];
+            for (var i = -11; i <= 12; i++) {
+                timezoneList.push((i >= 0 ? '+' : '-') + ('0' + Math.abs(i).toString()).slice(-2) + '00');
+            }
+            if (tp_inst._defaults.timezoneIso8601) {
+                timezoneList = $.map(timezoneList, function(val) {
+                    return val == '+0000' ? 'Z' : (val.substring(0, 3) + ':' + val.substring(3));
+                });
+            }
+            tp_inst._defaults.timezoneList = timezoneList;
+        }
+
+        tp_inst.timezone = tp_inst._defaults.timezone;
+        tp_inst.hour = tp_inst._defaults.hour;
+        tp_inst.minute = tp_inst._defaults.minute;
+        tp_inst.second = tp_inst._defaults.second;
+        tp_inst.millisec = tp_inst._defaults.millisec;
+        tp_inst.ampm = '';
+        tp_inst.$input = $input;
+
+        if (o.altField) {
+            tp_inst.$altInput = $(o.altField)
+                .css({ cursor: 'pointer' })
+                .focus(function(){ $input.trigger("focus"); });
+        }
+
+        if(tp_inst._defaults.minDate===0 || tp_inst._defaults.minDateTime===0)
+        {
+            tp_inst._defaults.minDate=new Date();
+        }
+        if(tp_inst._defaults.maxDate===0 || tp_inst._defaults.maxDateTime===0)
+        {
+            tp_inst._defaults.maxDate=new Date();
+        }
+
+        // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime..
+        if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) {
+            tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime());
+        }
+        if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) {
+            tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime());
+        }
+        if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) {
+            tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime());
+        }
+        if(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) {
+            tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime());
+        }
+        return tp_inst;
+    },
+
+    //########################################################################
+    // add our sliders to the calendar
+    //########################################################################
+    _addTimePicker: function(dp_inst) {
+        var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ?
+                this.$input.val() + ' ' + this.$altInput.val() :
+                this.$input.val();
+
+        this.timeDefined = this._parseTime(currDT);
+        this._limitMinMaxDateTime(dp_inst, false);
+        this._injectTimePicker();
+    },
+
+    //########################################################################
+    // parse the time string from input value or _setTime
+    //########################################################################
+    _parseTime: function(timeString, withDate) {
+        if (!this.inst) {
+            this.inst = $.datepicker._getInst(this.$input[0]);
+        }
+
+        if (withDate || !this._defaults.timeOnly)
+        {
+            var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat');
+            try {
+                var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults);
+                if (!parseRes.timeObj) { return false; }
+                $.extend(this, parseRes.timeObj);
+            } catch (err)
+            {
+                return false;
+            }
+            return true;
+        }
+        else
+        {
+            var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults);
+            if(!timeObj) { return false; }
+            $.extend(this, timeObj);
+            return true;
+        }
+    },
+
+    //########################################################################
+    // generate and inject html for timepicker into ui datepicker
+    //########################################################################
+    _injectTimePicker: function() {
+        var $dp = this.inst.dpDiv,
+            o = this._defaults,
+            tp_inst = this,
+            // Added by Peter Medeiros:
+            // - Figure out what the hour/minute/second max should be based on the step values.
+            // - Example: if stepMinute is 15, then minMax is 45.
+            hourMax = parseInt((o.hourMax - ((o.hourMax - o.hourMin) % o.stepHour)) ,10),
+            minMax  = parseInt((o.minuteMax - ((o.minuteMax - o.minuteMin) % o.stepMinute)) ,10),
+            secMax  = parseInt((o.secondMax - ((o.secondMax - o.secondMin) % o.stepSecond)) ,10),
+            millisecMax  = parseInt((o.millisecMax - ((o.millisecMax - o.millisecMin) % o.stepMillisec)) ,10),
+            dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, '');
+
+        // Prevent displaying twice
+        //if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0) {
+        if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0 && o.showTimepicker) {
+            var noDisplay = ' style="display:none;"',
+                html = '<div class="ui-timepicker-div" id="ui-timepicker-div-' + dp_id + '"><dl>' +
+                        '<dt class="ui_tpicker_time_label" id="ui_tpicker_time_label_' + dp_id + '"' +
+                        ((o.showTime) ? '' : noDisplay) + '>' + o.timeText + '</dt>' +
+                        '<dd class="ui_tpicker_time" id="ui_tpicker_time_' + dp_id + '"' +
+                        ((o.showTime) ? '' : noDisplay) + '></dd>' +
+                        '<dt class="ui_tpicker_hour_label" id="ui_tpicker_hour_label_' + dp_id + '"' +
+                        ((o.showHour) ? '' : noDisplay) + '>' + o.hourText + '</dt>',
+                hourGridSize = 0,
+                minuteGridSize = 0,
+                secondGridSize = 0,
+                millisecGridSize = 0,
+                size = null;
+
+            // Hours
+            html += '<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_' + dp_id + '"' +
+                        ((o.showHour) ? '' : noDisplay) + '></div>';
+            if (o.showHour && o.hourGrid > 0) {
+                html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
+
+                for (var h = o.hourMin; h <= hourMax; h += parseInt(o.hourGrid,10)) {
+                    hourGridSize++;
+                    var tmph = (o.ampm && h > 12) ? h-12 : h;
+                    if (tmph < 10) { tmph = '0' + tmph; }
+                    if (o.ampm) {
+                        if (h === 0) {
+                            tmph = 12 +'a';
+                        } else {
+                            if (h < 12) { tmph += 'a'; }
+                            else { tmph += 'p'; }
+                        }
+                    }
+                    html += '<td>' + tmph + '</td>';
+                }
+
+                html += '</tr></table></div>';
+            }
+            html += '</dd>';
+
+            // Minutes
+            html += '<dt class="ui_tpicker_minute_label" id="ui_tpicker_minute_label_' + dp_id + '"' +
+                    ((o.showMinute) ? '' : noDisplay) + '>' + o.minuteText + '</dt>'+
+                    '<dd class="ui_tpicker_minute"><div id="ui_tpicker_minute_' + dp_id + '"' +
+                            ((o.showMinute) ? '' : noDisplay) + '></div>';
+
+            if (o.showMinute && o.minuteGrid > 0) {
+                html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>';
+
+                for (var m = o.minuteMin; m <= minMax; m += parseInt(o.minuteGrid,10)) {
+                    minuteGridSize++;
+                    html += '<td>' + ((m < 10) ? '0' : '') + m + '</td>';
+                }
+
+                html += '</tr></table></div>';
+            }
+            html += '</dd>';
+
+            // Seconds
+            html += '<dt class="ui_tpicker_second_label" id="ui_tpicker_second_label_' + dp_id + '"' +
+                    ((o.showSecond) ? '' : noDisplay) + '>' + o.secondText + '</dt>'+
+                    '<dd class="ui_tpicker_second"><div id="ui_tpicker_second_' + dp_id + '"'+
+                            ((o.showSecond) ? '' : noDisplay) + '></div>';
+
+            if (o.showSecond && o.secondGrid > 0) {
+                html += '<div style="padding-left: 1px"><table><tr>';
+
+                for (var s = o.secondMin; s <= secMax; s += parseInt(o.secondGrid,10)) {
+                    secondGridSize++;
+                    html += '<td>' + ((s < 10) ? '0' : '') + s + '</td>';
+                }
+
+                html += '</tr></table></div>';
+            }
+            html += '</dd>';
+
+            // Milliseconds
+            html += '<dt class="ui_tpicker_millisec_label" id="ui_tpicker_millisec_label_' + dp_id + '"' +
+                    ((o.showMillisec) ? '' : noDisplay) + '>' + o.millisecText + '</dt>'+
+                    '<dd class="ui_tpicker_millisec"><div id="ui_tpicker_millisec_' + dp_id + '"'+
+                            ((o.showMillisec) ? '' : noDisplay) + '></div>';
+
+            if (o.showMillisec && o.millisecGrid > 0) {
+                html += '<div style="padding-left: 1px"><table><tr>';
+
+                for (var l = o.millisecMin; l <= millisecMax; l += parseInt(o.millisecGrid,10)) {
+                    millisecGridSize++;
+                    html += '<td>' + ((l < 10) ? '0' : '') + l + '</td>';
+                }
+
+                html += '</tr></table></div>';
+            }
+            html += '</dd>';
+
+            // Timezone
+            html += '<dt class="ui_tpicker_timezone_label" id="ui_tpicker_timezone_label_' + dp_id + '"' +
+                    ((o.showTimezone) ? '' : noDisplay) + '>' + o.timezoneText + '</dt>';
+            html += '<dd class="ui_tpicker_timezone" id="ui_tpicker_timezone_' + dp_id + '"'   +
+                            ((o.showTimezone) ? '' : noDisplay) + '></dd>';
+
+            html += '</dl></div>';
+            var $tp = $(html);
+
+                // if we only want time picker...
+            if (o.timeOnly === true) {
+                $tp.prepend(
+                    '<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' +
+                        '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' +
+                    '</div>');
+                $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide();
+            }
+
+            this.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({
+                orientation: "horizontal",
+                value: this.hour,
+                min: o.hourMin,
+                max: hourMax,
+                step: o.stepHour,
+                slide: function(event, ui) {
+                    tp_inst.hour_slider.slider( "option", "value", ui.value);
+                    tp_inst._onTimeChange();
+                }
+            });
+
+
+            // Updated by Peter Medeiros:
+            // - Pass in Event and UI instance into slide function
+            this.minute_slider = $tp.find('#ui_tpicker_minute_'+ dp_id).slider({
+                orientation: "horizontal",
+                value: this.minute,
+                min: o.minuteMin,
+                max: minMax,
+                step: o.stepMinute,
+                slide: function(event, ui) {
+                    tp_inst.minute_slider.slider( "option", "value", ui.value);
+                    tp_inst._onTimeChange();
+                }
+            });
+
+            this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({
+                orientation: "horizontal",
+                value: this.second,
+                min: o.secondMin,
+                max: secMax,
+                step: o.stepSecond,
+                slide: function(event, ui) {
+                    tp_inst.second_slider.slider( "option", "value", ui.value);
+                    tp_inst._onTimeChange();
+                }
+            });
+
+            this.millisec_slider = $tp.find('#ui_tpicker_millisec_'+ dp_id).slider({
+                orientation: "horizontal",
+                value: this.millisec,
+                min: o.millisecMin,
+                max: millisecMax,
+                step: o.stepMillisec,
+                slide: function(event, ui) {
+                    tp_inst.millisec_slider.slider( "option", "value", ui.value);
+                    tp_inst._onTimeChange();
+                }
+            });
+
+            this.timezone_select = $tp.find('#ui_tpicker_timezone_'+ dp_id).append('<select></select>').find("select");
+            $.fn.append.apply(this.timezone_select,
+                $.map(o.timezoneList, function(val, idx) {
+                    return $("<option />")
+                        .val(typeof val == "object" ? val.value : val)
+                        .text(typeof val == "object" ? val.label : val);
+                })
+            );
+            if (typeof(this.timezone) != "undefined" && this.timezone !== null && this.timezone !== "") {
+                var local_date = new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12);
+                var local_timezone = timeZoneString(local_date);
+                if (local_timezone == this.timezone) {
+                    selectLocalTimeZone(tp_inst);
+                } else {
+                    this.timezone_select.val(this.timezone);
+                }
+            } else {
+                if (typeof(this.hour) != "undefined" && this.hour !== null && this.hour !== "") {
+                    this.timezone_select.val(o.defaultTimezone);
+                } else {
+                    selectLocalTimeZone(tp_inst);
+                }
+            }
+            this.timezone_select.change(function() {
+                tp_inst._defaults.useLocalTimezone = false;
+                tp_inst._onTimeChange();
+            });
+
+            // Add grid functionality
+            if (o.showHour && o.hourGrid > 0) {
+                size = 100 * hourGridSize * o.hourGrid / (hourMax - o.hourMin);
+
+                $tp.find(".ui_tpicker_hour table").css({
+                    width: size + "%",
+                    marginLeft: (size / (-2 * hourGridSize)) + "%",
+                    borderCollapse: 'collapse'
+                }).find("td").each( function(index) {
+                    $(this).click(function() {
+                        var h = $(this).html();
+                        if(o.ampm)     {
+                            var ap = h.substring(2).toLowerCase(),
+                                aph = parseInt(h.substring(0,2), 10);
+                            if (ap == 'a') {
+                                if (aph == 12) { h = 0; }
+                                else { h = aph; }
+                            } else if (aph == 12) { h = 12; }
+                            else { h = aph + 12; }
+                        }
+                        tp_inst.hour_slider.slider("option", "value", h);
+                        tp_inst._onTimeChange();
+                        tp_inst._onSelectHandler();
+                    }).css({
+                        cursor: 'pointer',
+                        width: (100 / hourGridSize) + '%',
+                        textAlign: 'center',
+                        overflow: 'hidden'
+                    });
+                });
+            }
+
+            if (o.showMinute && o.minuteGrid > 0) {
+                size = 100 * minuteGridSize * o.minuteGrid / (minMax - o.minuteMin);
+                $tp.find(".ui_tpicker_minute table").css({
+                    width: size + "%",
+                    marginLeft: (size / (-2 * minuteGridSize)) + "%",
+                    borderCollapse: 'collapse'
+                }).find("td").each(function(index) {
+                    $(this).click(function() {
+                        tp_inst.minute_slider.slider("option", "value", $(this).html());
+                        tp_inst._onTimeChange();
+                        tp_inst._onSelectHandler();
+                    }).css({
+                        cursor: 'pointer',
+                        width: (100 / minuteGridSize) + '%',
+                        textAlign: 'center',
+                        overflow: 'hidden'
+                    });
+                });
+            }
+
+            if (o.showSecond && o.secondGrid > 0) {
+                $tp.find(".ui_tpicker_second table").css({
+                    width: size + "%",
+                    marginLeft: (size / (-2 * secondGridSize)) + "%",
+                    borderCollapse: 'collapse'
+                }).find("td").each(function(index) {
+                    $(this).click(function() {
+                        tp_inst.second_slider.slider("option", "value", $(this).html());
+                        tp_inst._onTimeChange();
+                        tp_inst._onSelectHandler();
+                    }).css({
+                        cursor: 'pointer',
+                        width: (100 / secondGridSize) + '%',
+                        textAlign: 'center',
+                        overflow: 'hidden'
+                    });
+                });
+            }
+
+            if (o.showMillisec && o.millisecGrid > 0) {
+                $tp.find(".ui_tpicker_millisec table").css({
+                    width: size + "%",
+                    marginLeft: (size / (-2 * millisecGridSize)) + "%",
+                    borderCollapse: 'collapse'
+                }).find("td").each(function(index) {
+                    $(this).click(function() {
+                        tp_inst.millisec_slider.slider("option", "value", $(this).html());
+                        tp_inst._onTimeChange();
+                        tp_inst._onSelectHandler();
+                    }).css({
+                        cursor: 'pointer',
+                        width: (100 / millisecGridSize) + '%',
+                        textAlign: 'center',
+                        overflow: 'hidden'
+                    });
+                });
+            }
+
+            var $buttonPanel = $dp.find('.ui-datepicker-buttonpane');
+            if ($buttonPanel.length) { $buttonPanel.before($tp); }
+            else { $dp.append($tp); }
+
+            this.$timeObj = $tp.find('#ui_tpicker_time_'+ dp_id);
+
+            if (this.inst !== null) {
+                var timeDefined = this.timeDefined;
+                this._onTimeChange();
+                this.timeDefined = timeDefined;
+            }
+
+            //Emulate datepicker onSelect behavior. Call on slidestop.
+            var onSelectDelegate = function() {
+                tp_inst._onSelectHandler();
+            };
+            this.hour_slider.bind('slidestop',onSelectDelegate);
+            this.minute_slider.bind('slidestop',onSelectDelegate);
+            this.second_slider.bind('slidestop',onSelectDelegate);
+            this.millisec_slider.bind('slidestop',onSelectDelegate);
+
+            // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/
+            if (this._defaults.addSliderAccess){
+                var sliderAccessArgs = this._defaults.sliderAccessArgs;
+                setTimeout(function(){ // fix for inline mode
+                    if($tp.find('.ui-slider-access').length === 0){
+                        $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs);
+
+                        // fix any grids since sliders are shorter
+                        var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true);
+                        if(sliderAccessWidth){
+                            $tp.find('table:visible').each(function(){
+                                var $g = $(this),
+                                    oldWidth = $g.outerWidth(),
+                                    oldMarginLeft = $g.css('marginLeft').toString().replace('%',''),
+                                    newWidth = oldWidth - sliderAccessWidth,
+                                    newMarginLeft = ((oldMarginLeft * newWidth)/oldWidth) + '%';
+
+                                $g.css({ width: newWidth, marginLeft: newMarginLeft });
+                            });
+                        }
+                    }
+                },0);
+            }
+            // end slideAccess integration
+
+        }
+    },
+
+    //########################################################################
+    // This function tries to limit the ability to go outside the
+    // min/max date range
+    //########################################################################
+    _limitMinMaxDateTime: function(dp_inst, adjustSliders){
+        var o = this._defaults,
+            dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay);
+
+        if(!this._defaults.showTimepicker) { return; } // No time so nothing to check here
+
+        if($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date){
+            var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'),
+                minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0);
+
+            if(this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null){
+                this.hourMinOriginal = o.hourMin;
+                this.minuteMinOriginal = o.minuteMin;
+                this.secondMinOriginal = o.secondMin;
+                this.millisecMinOriginal = o.millisecMin;
+            }
+
+            if(dp_inst.settings.timeOnly || minDateTimeDate.getTime() == dp_date.getTime()) {
+                this._defaults.hourMin = minDateTime.getHours();
+                if (this.hour <= this._defaults.hourMin) {
+                    this.hour = this._defaults.hourMin;
+                    this._defaults.minuteMin = minDateTime.getMinutes();
+                    if (this.minute <= this._defaults.minuteMin) {
+                        this.minute = this._defaults.minuteMin;
+                        this._defaults.secondMin = minDateTime.getSeconds();
+                    } else if (this.second <= this._defaults.secondMin){
+                        this.second = this._defaults.secondMin;
+                        this._defaults.millisecMin = minDateTime.getMilliseconds();
+                    } else {
+                        if(this.millisec < this._defaults.millisecMin) {
+                            this.millisec = this._defaults.millisecMin;
+                        }
+                        this._defaults.millisecMin = this.millisecMinOriginal;
+                    }
+                } else {
+                    this._defaults.minuteMin = this.minuteMinOriginal;
+                    this._defaults.secondMin = this.secondMinOriginal;
+                    this._defaults.millisecMin = this.millisecMinOriginal;
+                }
+            }else{
+                this._defaults.hourMin = this.hourMinOriginal;
+                this._defaults.minuteMin = this.minuteMinOriginal;
+                this._defaults.secondMin = this.secondMinOriginal;
+                this._defaults.millisecMin = this.millisecMinOriginal;
+            }
+        }
+
+        if($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date){
+            var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'),
+                maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0);
+
+            if(this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null){
+                this.hourMaxOriginal = o.hourMax;
+                this.minuteMaxOriginal = o.minuteMax;
+                this.secondMaxOriginal = o.secondMax;
+                this.millisecMaxOriginal = o.millisecMax;
+            }
+
+            if(dp_inst.settings.timeOnly || maxDateTimeDate.getTime() == dp_date.getTime()){
+                this._defaults.hourMax = maxDateTime.getHours();
+                if (this.hour >= this._defaults.hourMax) {
+                    this.hour = this._defaults.hourMax;
+                    this._defaults.minuteMax = maxDateTime.getMinutes();
+                    if (this.minute >= this._defaults.minuteMax) {
+                        this.minute = this._defaults.minuteMax;
+                        this._defaults.secondMax = maxDateTime.getSeconds();
+                    } else if (this.second >= this._defaults.secondMax) {
+                        this.second = this._defaults.secondMax;
+                        this._defaults.millisecMax = maxDateTime.getMilliseconds();
+                    } else {
+                        if(this.millisec > this._defaults.millisecMax) { this.millisec = this._defaults.millisecMax; }
+                        this._defaults.millisecMax = this.millisecMaxOriginal;
+                    }
+                } else {
+                    this._defaults.minuteMax = this.minuteMaxOriginal;
+                    this._defaults.secondMax = this.secondMaxOriginal;
+                    this._defaults.millisecMax = this.millisecMaxOriginal;
+                }
+            }else{
+                this._defaults.hourMax = this.hourMaxOriginal;
+                this._defaults.minuteMax = this.minuteMaxOriginal;
+                this._defaults.secondMax = this.secondMaxOriginal;
+                this._defaults.millisecMax = this.millisecMaxOriginal;
+            }
+        }
+
+        if(adjustSliders !== undefined && adjustSliders === true){
+            var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)) ,10),
+                minMax  = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)) ,10),
+                secMax  = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)) ,10),
+                millisecMax  = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)) ,10);
+
+            if(this.hour_slider) {
+                this.hour_slider.slider("option", { min: this._defaults.hourMin, max: hourMax }).slider('value', this.hour);
+            }
+            if(this.minute_slider) {
+                this.minute_slider.slider("option", { min: this._defaults.minuteMin, max: minMax }).slider('value', this.minute);
+            }
+            if(this.second_slider){
+                this.second_slider.slider("option", { min: this._defaults.secondMin, max: secMax }).slider('value', this.second);
+            }
+            if(this.millisec_slider) {
+                this.millisec_slider.slider("option", { min: this._defaults.millisecMin, max: millisecMax }).slider('value', this.millisec);
+            }
+        }
+
+    },
+
+
+    //########################################################################
+    // when a slider moves, set the internal time...
+    // on time change is also called when the time is updated in the text field
+    //########################################################################
+    _onTimeChange: function() {
+        var hour   = (this.hour_slider) ? this.hour_slider.slider('value') : false,
+            minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
+            second = (this.second_slider) ? this.second_slider.slider('value') : false,
+            millisec = (this.millisec_slider) ? this.millisec_slider.slider('value') : false,
+            timezone = (this.timezone_select) ? this.timezone_select.val() : false,
+            o = this._defaults;
+
+        if (typeof(hour) == 'object') { hour = false; }
+        if (typeof(minute) == 'object') { minute = false; }
+        if (typeof(second) == 'object') { second = false; }
+        if (typeof(millisec) == 'object') { millisec = false; }
+        if (typeof(timezone) == 'object') { timezone = false; }
+
+        if (hour !== false) { hour = parseInt(hour,10); }
+        if (minute !== false) { minute = parseInt(minute,10); }
+        if (second !== false) { second = parseInt(second,10); }
+        if (millisec !== false) { millisec = parseInt(millisec,10); }
+
+        var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0];
+
+        // If the update was done in the input field, the input field should not be updated.
+        // If the update was done using the sliders, update the input field.
+        var hasChanged = (hour != this.hour || minute != this.minute ||
+                second != this.second || millisec != this.millisec ||
+                (this.ampm.length > 0 &&
+                    (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
+                timezone != this.timezone);
+
+        if (hasChanged) {
+
+            if (hour !== false) { this.hour = hour; }
+            if (minute !== false) { this.minute = minute; }
+            if (second !== false) { this.second = second; }
+            if (millisec !== false) { this.millisec = millisec; }
+            if (timezone !== false) { this.timezone = timezone; }
+
+            if (!this.inst) { this.inst = $.datepicker._getInst(this.$input[0]); }
+
+            this._limitMinMaxDateTime(this.inst, true);
+        }
+        if (o.ampm) { this.ampm = ampm; }
+
+        //this._formatTime();
+        this.formattedTime = $.datepicker.formatTime(this._defaults.timeFormat, this, this._defaults);
+        if (this.$timeObj) { this.$timeObj.text(this.formattedTime + o.timeSuffix); }
+        this.timeDefined = true;
+        if (hasChanged) { this._updateDateTime(); }
+    },
+
+    //########################################################################
+    // call custom onSelect.
+    // bind to sliders slidestop, and grid click.
+    //########################################################################
+    _onSelectHandler: function() {
+        var onSelect = this._defaults.onSelect;
+        var inputEl = this.$input ? this.$input[0] : null;
+        if (onSelect && inputEl) {
+            onSelect.apply(inputEl, [this.formattedDateTime, this]);
+        }
+    },
+
+    //########################################################################
+    // left for any backwards compatibility
+    //########################################################################
+    _formatTime: function(time, format) {
+        time = time || { hour: this.hour, minute: this.minute, second: this.second, millisec: this.millisec, ampm: this.ampm, timezone: this.timezone };
+        var tmptime = (format || this._defaults.timeFormat).toString();
+
+        tmptime = $.datepicker.formatTime(tmptime, time, this._defaults);
+
+        if (arguments.length) { return tmptime; }
+        else { this.formattedTime = tmptime; }
+    },
+
+    //########################################################################
+    // update our input with the new date time..
+    //########################################################################
+    _updateDateTime: function(dp_inst) {
+        dp_inst = this.inst || dp_inst;
+        var dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),
+            dateFmt = $.datepicker._get(dp_inst, 'dateFormat'),
+            formatCfg = $.datepicker._getFormatConfig(dp_inst),
+            timeAvailable = dt !== null && this.timeDefined;
+        this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
+        var formattedDateTime = this.formattedDate;
+        // remove following lines to force every changes in date picker to change the input value
+        // Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
+        // If the user manually empty the value in the input field, the date picker will never change selected value.
+        //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
+        //     return;
+        //}
+
+        if (this._defaults.timeOnly === true) {
+            formattedDateTime = this.formattedTime;
+        } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
+            formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix;
+        }
+
+        this.formattedDateTime = formattedDateTime;
+
+        if(!this._defaults.showTimepicker) {
+            this.$input.val(this.formattedDate);
+        } else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
+            this.$altInput.val(this.formattedTime);
+            this.$input.val(this.formattedDate);
+        } else if(this.$altInput) {
+            this.$altInput.val(formattedDateTime);
+            this.$input.val(formattedDateTime);
+        } else {
+            this.$input.val(formattedDateTime);
+        }
+
+        this.$input.trigger("change");
+    }
+
+});
+
+$.fn.extend({
+    //########################################################################
+    // shorthand just to use timepicker..
+    //########################################################################
+    timepicker: function(o) {
+        o = o || {};
+        var tmp_args = arguments;
+
+        if (typeof o == 'object') { tmp_args[0] = $.extend(o, { timeOnly: true }); }
+
+        return $(this).each(function() {
+            $.fn.datetimepicker.apply($(this), tmp_args);
+        });
+    },
+
+    //########################################################################
+    // extend timepicker to datepicker
+    //########################################################################
+    datetimepicker: function(o) {
+        o = o || {};
+        var tmp_args = arguments;
+
+        if (typeof(o) == 'string'){
+            if(o == 'getDate') {
+                return $.fn.datepicker.apply($(this[0]), tmp_args);
+            }
+            else {
+                return this.each(function() {
+                    var $t = $(this);
+                    $t.datepicker.apply($t, tmp_args);
+                });
+            }
+        }
+        else {
+            return this.each(function() {
+                var $t = $(this);
+                $t.datepicker($.timepicker._newInst($t, o)._defaults);
+            });
+        }
+    }
+});
+
+$.datepicker.parseDateTime = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) {
+    var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings);
+    if (parseRes.timeObj)
+    {
+        var t = parseRes.timeObj;
+        parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec);
+    }
+
+    return parseRes.date;
+};
+
+$.datepicker.parseTime = function(timeFormat, timeString, options) {
+
+    //########################################################################
+    // pattern for standard and localized AM/PM markers
+    //########################################################################
+    var getPatternAmpm = function(amNames, pmNames) {
+        var markers = [];
+        if (amNames) {
+            $.merge(markers, amNames);
+        }
+        if (pmNames) {
+            $.merge(markers, pmNames);
+        }
+        markers = $.map(markers, function(val) { return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&'); });
+        return '(' + markers.join('|') + ')?';
+    };
+
+    //########################################################################
+    // figure out position of time elements.. cause js cant do named captures
+    //########################################################################
+    var getFormatPositions = function( timeFormat ) {
+        var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|t{1,2}|z)/g),
+            orders = { h: -1, m: -1, s: -1, l: -1, t: -1, z: -1 };
+
+        if (finds) {
+            for (var i = 0; i < finds.length; i++) {
+                if (orders[finds[i].toString().charAt(0)] == -1) {
+                    orders[finds[i].toString().charAt(0)] = i + 1;
+                }
+            }
+        }
+        return orders;
+    };
+
+    var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {});
+
+    var regstr = '^' + timeFormat.toString()
+            .replace(/h{1,2}/ig, '(\\d?\\d)')
+            .replace(/m{1,2}/ig, '(\\d?\\d)')
+            .replace(/s{1,2}/ig, '(\\d?\\d)')
+            .replace(/l{1}/ig, '(\\d?\\d?\\d)')
+            .replace(/t{1,2}/ig, getPatternAmpm(o.amNames, o.pmNames))
+            .replace(/z{1}/ig, '(z|[-+]\\d\\d:?\\d\\d)?')
+            .replace(/\s/g, '\\s?') + o.timeSuffix + '$',
+        order = getFormatPositions(timeFormat),
+        ampm = '',
+        treg;
+
+    treg = timeString.match(new RegExp(regstr, 'i'));
+
+    var resTime = {hour: 0, minute: 0, second: 0, millisec: 0};
+
+    if (treg) {
+        if (order.t !== -1) {
+            if (treg[order.t] === undefined || treg[order.t].length === 0) {
+                ampm = '';
+                resTime.ampm = '';
+            } else {
+                ampm = $.inArray(treg[order.t], o.amNames) !== -1 ? 'AM' : 'PM';
+                resTime.ampm = o[ampm == 'AM' ? 'amNames' : 'pmNames'][0];
+            }
+        }
+
+        if (order.h !== -1) {
+            if (ampm == 'AM' && treg[order.h] == '12') {
+                resTime.hour = 0; // 12am = 0 hour
+            } else {
+                if (ampm == 'PM' && treg[order.h] != '12') {
+                    resTime.hour = parseInt(treg[order.h],10) + 12; // 12pm = 12 hour, any other pm = hour + 12
+                }
+                else { resTime.hour = Number(treg[order.h]); }
+            }
+        }
+
+        if (order.m !== -1) { resTime.minute = Number(treg[order.m]); }
+        if (order.s !== -1) { resTime.second = Number(treg[order.s]); }
+        if (order.l !== -1) { resTime.millisec = Number(treg[order.l]); }
+        if (order.z !== -1 && treg[order.z] !== undefined) {
+            var tz = treg[order.z].toUpperCase();
+            switch (tz.length) {
+                case 1:        // Z
+                    tz = o.timezoneIso8601 ? 'Z' : '+0000';
+                    break;
+                case 5:        // +hhmm
+                    if (o.timezoneIso8601) {
+                        tz = tz.substring(1) == '0000' ?
+                            'Z' :
+                            tz.substring(0, 3) + ':' + tz.substring(3);
+                    }
+                    break;
+                case 6:        // +hh:mm
+                    if (!o.timezoneIso8601) {
+                        tz = tz == 'Z' || tz.substring(1) == '00:00' ?
+                            '+0000' :
+                            tz.replace(/:/, '');
+                    } else {
+                        if (tz.substring(1) == '00:00') {
+                            tz = 'Z';
+                        }
+                    }
+                    break;
+            }
+            resTime.timezone = tz;
+        }
+
+
+        return resTime;
+    }
+
+    return false;
+};
+
+//########################################################################
+// format the time all pretty...
+// format = string format of the time
+// time = a {}, not a Date() for timezones
+// options = essentially the regional[].. amNames, pmNames, ampm
+//########################################################################
+$.datepicker.formatTime = function(format, time, options) {
+    options = options || {};
+    options = $.extend($.timepicker._defaults, options);
+    time = $.extend({hour:0, minute:0, second:0, millisec:0, timezone:'+0000'}, time);
+
+    var tmptime = format;
+    var ampmName = options.amNames[0];
+
+    var hour = parseInt(time.hour, 10);
+    if (options.ampm) {
+        if (hour > 11){
+            ampmName = options.pmNames[0];
+            if(hour > 12) {
+                hour = hour % 12;
+            }
+        }
+        if (hour === 0) {
+            hour = 12;
+        }
+    }
+    tmptime = tmptime.replace(/(?:hh?|mm?|ss?|[tT]{1,2}|[lz])/g, function(match) {
+        switch (match.toLowerCase()) {
+            case 'hh': return ('0' + hour).slice(-2);
+            case 'h':  return hour;
+            case 'mm': return ('0' + time.minute).slice(-2);
+            case 'm':  return time.minute;
+            case 'ss': return ('0' + time.second).slice(-2);
+            case 's':  return time.second;
+            case 'l':  return ('00' + time.millisec).slice(-3);
+            case 'z':  return time.timezone;
+            case 't': case 'tt':
+                if (options.ampm) {
+                    if (match.length == 1) {
+                        ampmName = ampmName.charAt(0);
+                    }
+                    return match.charAt(0) == 'T' ? ampmName.toUpperCase() : ampmName.toLowerCase();
+                }
+                return '';
+        }
+    });
+
+    tmptime = $.trim(tmptime);
+    return tmptime;
+};
+
+//########################################################################
+// the bad hack :/ override datepicker so it doesnt close on select
+// inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378
+//########################################################################
+$.datepicker._base_selectDate = $.datepicker._selectDate;
+$.datepicker._selectDate = function (id, dateStr) {
+    var inst = this._getInst($(id)[0]),
+        tp_inst = this._get(inst, 'timepicker');
+
+    if (tp_inst) {
+        tp_inst._limitMinMaxDateTime(inst, true);
+        inst.inline = inst.stay_open = true;
+        //This way the onSelect handler called from calendarpicker get the full dateTime
+        this._base_selectDate(id, dateStr);
+        inst.inline = inst.stay_open = false;
+        this._notifyChange(inst);
+        this._updateDatepicker(inst);
+    }
+    else { this._base_selectDate(id, dateStr); }
+};
+
+//#############################################################################################
+// second bad hack :/ override datepicker so it triggers an event when changing the input field
+// and does not redraw the datepicker on every selectDate event
+//#############################################################################################
+$.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker;
+$.datepicker._updateDatepicker = function(inst) {
+
+    // don't popup the datepicker if there is another instance already opened
+    var input = inst.input[0];
+    if($.datepicker._curInst &&
+       $.datepicker._curInst != inst &&
+       $.datepicker._datepickerShowing &&
+       $.datepicker._lastInput != input) {
+        return;
+    }
+
+    if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) {
+
+        this._base_updateDatepicker(inst);
+
+        // Reload the time control when changing something in the input text field.
+        var tp_inst = this._get(inst, 'timepicker');
+        if(tp_inst) {
+            tp_inst._addTimePicker(inst);
+
+            if (tp_inst._defaults.useLocalTimezone) { //checks daylight saving with the new date.
+                var date = new Date(inst.selectedYear, inst.selectedMonth, inst.selectedDay, 12);
+                selectLocalTimeZone(tp_inst, date);
+                tp_inst._onTimeChange();
+            }
+        }
+    }
+};
+
+//#######################################################################################
+// third bad hack :/ override datepicker so it allows spaces and colon in the input field
+//#######################################################################################
+$.datepicker._base_doKeyPress = $.datepicker._doKeyPress;
+$.datepicker._doKeyPress = function(event) {
+    var inst = $.datepicker._getInst(event.target),
+        tp_inst = $.datepicker._get(inst, 'timepicker');
+
+    if (tp_inst) {
+        if ($.datepicker._get(inst, 'constrainInput')) {
+            var ampm = tp_inst._defaults.ampm,
+                dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')),
+                datetimeChars = tp_inst._defaults.timeFormat.toString()
+                                .replace(/[hms]/g, '')
+                                .replace(/TT/g, ampm ? 'APM' : '')
+                                .replace(/Tt/g, ampm ? 'AaPpMm' : '')
+                                .replace(/tT/g, ampm ? 'AaPpMm' : '')
+                                .replace(/T/g, ampm ? 'AP' : '')
+                                .replace(/tt/g, ampm ? 'apm' : '')
+                                .replace(/t/g, ampm ? 'ap' : '') +
+                                " " +
+                                tp_inst._defaults.separator +
+                                tp_inst._defaults.timeSuffix +
+                                (tp_inst._defaults.showTimezone ? tp_inst._defaults.timezoneList.join('') : '') +
+                                (tp_inst._defaults.amNames.join('')) +
+                                (tp_inst._defaults.pmNames.join('')) +
+                                dateChars,
+                chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode);
+            return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1);
+        }
+    }
+
+    return $.datepicker._base_doKeyPress(event);
+};
+
+//#######################################################################################
+// Override key up event to sync manual input changes.
+//#######################################################################################
+$.datepicker._base_doKeyUp = $.datepicker._doKeyUp;
+$.datepicker._doKeyUp = function (event) {
+    var inst = $.datepicker._getInst(event.target),
+        tp_inst = $.datepicker._get(inst, 'timepicker');
+
+    if (tp_inst) {
+        if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
+            try {
+                $.datepicker._updateDatepicker(inst);
+            }
+            catch (err) {
+                $.datepicker.log(err);
+            }
+        }
+    }
+
+    return $.datepicker._base_doKeyUp(event);
+};
+
+//#######################################################################################
+// override "Today" button to also grab the time.
+//#######################################################################################
+$.datepicker._base_gotoToday = $.datepicker._gotoToday;
+$.datepicker._gotoToday = function(id) {
+    var inst = this._getInst($(id)[0]),
+        $dp = inst.dpDiv;
+    this._base_gotoToday(id);
+    var tp_inst = this._get(inst, 'timepicker');
+    selectLocalTimeZone(tp_inst);
+    var now = new Date();
+    this._setTime(inst, now);
+    $( '.ui-datepicker-today', $dp).click();
+};
+
+//#######################################################################################
+// Disable & enable the Time in the datetimepicker
+//#######################################################################################
+$.datepicker._disableTimepickerDatepicker = function(target) {
+    var inst = this._getInst(target);
+    if (!inst) { return; }
+
+    var tp_inst = this._get(inst, 'timepicker');
+    $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
+    if (tp_inst) {
+        tp_inst._defaults.showTimepicker = false;
+        tp_inst._updateDateTime(inst);
+    }
+};
+
+$.datepicker._enableTimepickerDatepicker = function(target) {
+    var inst = this._getInst(target);
+    if (!inst) { return; }
+
+    var tp_inst = this._get(inst, 'timepicker');
+    $(target).datepicker('getDate'); // Init selected[Year|Month|Day]
+    if (tp_inst) {
+        tp_inst._defaults.showTimepicker = true;
+        tp_inst._addTimePicker(inst); // Could be disabled on page load
+        tp_inst._updateDateTime(inst);
+    }
+};
+
+//#######################################################################################
+// Create our own set time function
+//#######################################################################################
+$.datepicker._setTime = function(inst, date) {
+    var tp_inst = this._get(inst, 'timepicker');
+    if (tp_inst) {
+        var defaults = tp_inst._defaults,
+            // calling _setTime with no date sets time to defaults
+            hour = date ? date.getHours() : defaults.hour,
+            minute = date ? date.getMinutes() : defaults.minute,
+            second = date ? date.getSeconds() : defaults.second,
+            millisec = date ? date.getMilliseconds() : defaults.millisec;
+        //check if within min/max times..
+        // correct check if within min/max times.
+        // Rewritten by Scott A. Woodward
+        var hourEq = hour === defaults.hourMin,
+            minuteEq = minute === defaults.minuteMin,
+            secondEq = second === defaults.secondMin;
+        var reset = false;
+        if(hour < defaults.hourMin || hour > defaults.hourMax)
+            reset = true;
+        else if( (minute < defaults.minuteMin || minute > defaults.minuteMax) && hourEq)
+            reset = true;
+        else if( (second < defaults.secondMin || second > defaults.secondMax ) && hourEq && minuteEq)
+            reset = true;
+        else if( (millisec < defaults.millisecMin || millisec > defaults.millisecMax) && hourEq && minuteEq && secondEq)
+            reset = true;
+        if(reset) {
+            hour = defaults.hourMin;
+            minute = defaults.minuteMin;
+            second = defaults.secondMin;
+            millisec = defaults.millisecMin;
+        }
+        tp_inst.hour = hour;
+        tp_inst.minute = minute;
+        tp_inst.second = second;
+        tp_inst.millisec = millisec;
+        if (tp_inst.hour_slider) tp_inst.hour_slider.slider('value', hour);
+        if (tp_inst.minute_slider) tp_inst.minute_slider.slider('value', minute);
+        if (tp_inst.second_slider) tp_inst.second_slider.slider('value', second);
+        if (tp_inst.millisec_slider) tp_inst.millisec_slider.slider('value', millisec);
+
+        tp_inst._onTimeChange();
+        tp_inst._updateDateTime(inst);
+    }
+};
+
+//#######################################################################################
+// Create new public method to set only time, callable as $().datepicker('setTime', date)
+//#######################################################################################
+$.datepicker._setTimeDatepicker = function(target, date, withDate) {
+    var inst = this._getInst(target);
+    if (!inst) { return; }
+
+    var tp_inst = this._get(inst, 'timepicker');
+
+    if (tp_inst) {
+        this._setDateFromField(inst);
+        var tp_date;
+        if (date) {
+            if (typeof date == "string") {
+                tp_inst._parseTime(date, withDate);
+                tp_date = new Date();
+                tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);
+            }
+            else { tp_date = new Date(date.getTime()); }
+            if (tp_date.toString() == 'Invalid Date') { tp_date = undefined; }
+            this._setTime(inst, tp_date);
+        }
+    }
+
+};
+
+//#######################################################################################
+// override setDate() to allow setting time too within Date object
+//#######################################################################################
+$.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker;
+$.datepicker._setDateDatepicker = function(target, date) {
+    var inst = this._getInst(target);
+    if (!inst) { return; }
+
+    var tp_date = (date instanceof Date) ? new Date(date.getTime()) : date;
+
+    this._updateDatepicker(inst);
+    this._base_setDateDatepicker.apply(this, arguments);
+    this._setTimeDatepicker(target, tp_date, true);
+};
+
+//#######################################################################################
+// override getDate() to allow getting time too within Date object
+//#######################################################################################
+$.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
+$.datepicker._getDateDatepicker = function(target, noDefault) {
+    var inst = this._getInst(target);
+    if (!inst) { return; }
+
+    var tp_inst = this._get(inst, 'timepicker');
+
+    if (tp_inst) {
+        this._setDateFromField(inst, noDefault);
+        var date = this._getDate(inst);
+        if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) { date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec); }
+        return date;
+    }
+    return this._base_getDateDatepicker(target, noDefault);
+};
+
+//#######################################################################################
+// override parseDate() because UI 1.8.14 throws an error about "Extra characters"
+// An option in datapicker to ignore extra format characters would be nicer.
+//#######################################################################################
+$.datepicker._base_parseDate = $.datepicker.parseDate;
+$.datepicker.parseDate = function(format, value, settings) {
+    var splitRes = splitDateTime(format, value, settings);
+    return $.datepicker._base_parseDate(format, splitRes[0], settings);
+};
+
+//#######################################################################################
+// override formatDate to set date with time to the input
+//#######################################################################################
+$.datepicker._base_formatDate = $.datepicker._formatDate;
+$.datepicker._formatDate = function(inst, day, month, year){
+    var tp_inst = this._get(inst, 'timepicker');
+    if(tp_inst) {
+        tp_inst._updateDateTime(inst);
+        return tp_inst.$input.val();
+    }
+    return this._base_formatDate(inst);
+};
+
+//#######################################################################################
+// override options setter to add time to maxDate(Time) and minDate(Time). MaxDate
+//#######################################################################################
+$.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker;
+$.datepicker._optionDatepicker = function(target, name, value) {
+    var inst = this._getInst(target);
+    if (!inst) { return null; }
+
+    var tp_inst = this._get(inst, 'timepicker');
+    if (tp_inst) {
+        var min = null, max = null, onselect = null;
+        if (typeof name == 'string') { // if min/max was set with the string
+            if (name === 'minDate' || name === 'minDateTime' ) {
+                min = value;
+            }
+            else {
+                if (name === 'maxDate' || name === 'maxDateTime') {
+                    max = value;
+                }
+                else {
+                    if (name === 'onSelect') {
+                        onselect = value;
+                    }
+                }
+            }
+        } else {
+            if (typeof name == 'object') { //if min/max was set with the JSON
+                if (name.minDate) {
+                    min = name.minDate;
+                } else {
+                    if (name.minDateTime) {
+                        min = name.minDateTime;
+                    } else {
+                        if (name.maxDate) {
+                            max = name.maxDate;
+                        } else {
+                            if (name.maxDateTime) {
+                                max = name.maxDateTime;
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        if(min) { //if min was set
+            if (min === 0) {
+                min = new Date();
+            } else {
+                min = new Date(min);
+            }
+
+            tp_inst._defaults.minDate = min;
+            tp_inst._defaults.minDateTime = min;
+        } else if (max) { //if max was set
+            if(max===0) {
+                max=new Date();
+            } else {
+                max= new Date(max);
+            }
+            tp_inst._defaults.maxDate = max;
+            tp_inst._defaults.maxDateTime = max;
+        } else if (onselect) {
+            tp_inst._defaults.onSelect = onselect;
+        }
+    }
+    if (value === undefined) {
+        return this._base_optionDatepicker(target, name);
+    }
+    return this._base_optionDatepicker(target, name, value);
+};
+
+//#######################################################################################
+// jQuery extend now ignores nulls!
+//#######################################################################################
+function extendRemove(target, props) {
+    $.extend(target, props);
+    for (var name in props) {
+        if (props[name] === null || props[name] === undefined) {
+            target[name] = props[name];
+        }
+    }
+    return target;
+}
+
+//#######################################################################################
+// Splits datetime string into date ans time substrings.
+// Throws exception when date can't be parsed
+// If only date is present, time substring eill be ''
+//#######################################################################################
+var splitDateTime = function(dateFormat, dateTimeString, dateSettings)
+{
+    try {
+        var date = $.datepicker._base_parseDate(dateFormat, dateTimeString, dateSettings);
+    } catch (err) {
+        if (err.indexOf(":") >= 0) {
+            // Hack!  The error message ends with a colon, a space, and
+            // the "extra" characters.  We rely on that instead of
+            // attempting to perfectly reproduce the parsing algorithm.
+            var dateStringLength = dateTimeString.length-(err.length-err.indexOf(':')-2);
+            var timeString = dateTimeString.substring(dateStringLength);
+
+            return [dateTimeString.substring(0, dateStringLength), dateTimeString.substring(dateStringLength)];
+
+        } else {
+            throw err;
+        }
+    }
+    return [dateTimeString, ''];
+};
+
+//#######################################################################################
+// Internal function to parse datetime interval
+// Returns: {date: Date, timeObj: Object}, where
+//   date - parsed date without time (type Date)
+//   timeObj = {hour: , minute: , second: , millisec: } - parsed time. Optional
+//#######################################################################################
+var parseDateTimeInternal = function(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings)
+{
+    var date;
+    var splitRes = splitDateTime(dateFormat, dateTimeString, dateSettings);
+    date = $.datepicker._base_parseDate(dateFormat, splitRes[0], dateSettings);
+    if (splitRes[1] !== '')
+    {
+        var timeString = splitRes[1];
+        var separator = timeSettings && timeSettings.separator ? timeSettings.separator : $.timepicker._defaults.separator;
+        if ( timeString.indexOf(separator) !== 0) {
+            throw 'Missing time separator';
+        }
+        timeString = timeString.substring(separator.length);
+        var parsedTime = $.datepicker.parseTime(timeFormat, timeString, timeSettings);
+        if (parsedTime === null) {
+            throw 'Wrong time format';
+        }
+        return {date: date, timeObj: parsedTime};
+    } else {
+        return {date: date};
+    }
+};
+
+//#######################################################################################
+// Internal function to set timezone_select to the local timezone
+//#######################################################################################
+var selectLocalTimeZone = function(tp_inst, date)
+{
+    if (tp_inst && tp_inst.timezone_select) {
+        tp_inst._defaults.useLocalTimezone = true;
+        var now = typeof date !== 'undefined' ? date : new Date();
+        var tzoffset = timeZoneString(now);
+        if (tp_inst._defaults.timezoneIso8601) {
+            tzoffset = tzoffset.substring(0, 3) + ':' + tzoffset.substring(3);
+        }
+        tp_inst.timezone_select.val(tzoffset);
+    }
+};
+
+// Input: Date Object
+// Output: String with timezone offset, e.g. '+0100'
+var timeZoneString = function(date)
+{
+    var off = date.getTimezoneOffset() * -10100 / 60;
+    var timezone = (off >= 0 ? '+' : '-') + Math.abs(off).toString().substr(1);
+    return timezone;
+};
+
+$.timepicker = new Timepicker(); // singleton instance
+$.timepicker.version = "1.0.1";
+
+})(jQuery);
index 34f6578..11d6834 100644 (file)
                <li><a href="https://www.ohloh.net/p/koha/contributors/6618544614275">Henri-Damien Laurent</a> (Koha 3.0 Release Maintainer)</li>
                <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609147">Owen Leonard</a> (Koha 3.x Interface Design)</li>
                <li><a href="https://www.ohloh.net/p/koha/contributors/6618544615991">Chris Nighswonger</a> (Koha 3.2, 3.4 Release Maintainer, Koha 3.6 Release Maintainer)</li>
-               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544612249">Paul Poulain</a> (Koha 2.0 Release Manager, Koha 2.2 Release Manager/Maintainer, Koha 3.8 Release Manager)</li>
+               <li><a href="https://www.ohloh.net/p/koha/contributors/6618544612249">Paul Poulain</a> (Koha 2.0 Release Manager, Koha 2.2 Release Manager/Maintainer, Koha 3.8 Release Manager, Koha 3.10 Release Manager)</li>
                <li><a href="http://www.ohloh.net/p/koha/contributors/6620692116417">MJ Ray</a> (Koha 2.0 Release Maintainer)</li>
-                <li>Ian Walls Koha 3.6 QA Manager, Koha 3.8 QA Manager</li>
+                <li>Ian Walls Koha 3.6 QA Manager, Koha 3.8 QA Manager, Koha 3.10 QA Manager</li>
                 </ul>
             <h2>Koha development team</h2>
             <ul>
                 <li>Adam Thick</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6618544609107">Finlay Thompson</a></li>
                 <li>Fabio Tiana</li>
+        <li>Mirko Tietgen</li>
                 <li><a href="https://www.ohloh.net/p/koha/contributors/6620692101577">Steve Tonnesen (early MARC work, Virtual Bookshelves concept, KohaCD)</a></li>
                 <li>Bruno Toumi</li>
                 <li>Andrei V. Toutoukine</li>
                 <li>Marc Veron</li>
                 <li>Aleksa Vujicic</li>
                 <li>Reed Wade</li>
-        <li>Stacey Walker</li>
+                <li>Stacey Walker</li>
                 <li>Ian Walls</li>
                 <li><a href="http://www.ohloh.net/accounts/janewagner">Jane Wagner</a></li>
                 <li>Ward van Wanrooij</li>
index 6327e22..d02202c 100644 (file)
@@ -314,7 +314,8 @@ function yuiToolbar() {
                                        <td>
                                                        <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="reopen" /><input type="hidden" name="booksellerid" value="[% basketgroup.booksellerid %]" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Reopen" /></form>
                                                        <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="print" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Print" /></form>
-                                               </td>
+                                                        <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="get"><input type="hidden" name="op" value="export" /><input type="hidden" name="basketgroupid" value="[% basketgroup.id %]" /><input type="submit" value="Export as CSV" /></form>
+                    </td>
                                </tr>
                                [% END %]
                                [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basket.tt
new file mode 100644 (file)
index 0000000..2d5c2df
--- /dev/null
@@ -0,0 +1,3 @@
+Contract name,Order number,Entry date,ISBN,Author,Title,Publication year,Publisher code,Collection title,Notes,Quantity,RRP,Delivery place,Billing place
+[% FOREACH r IN rows %]"[% r.contractname %]",[% r.ordernumber %],[% r.entrydate %],[% r.isbn %],"[% r.author %]","[% r.title %]",[% r.publicationyear %],"[% r.publishercode %]","[% r.collectiontitle %]","[% r.notes %]",[% r.quantity %],[% r.rrp %],"[% r.deliveryplace %]","[% r.billingplace %]"
+[% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/csv/basketgroup.tt
new file mode 100644 (file)
index 0000000..2db2c5f
--- /dev/null
@@ -0,0 +1,3 @@
+Account number,Basket name,Order number,Author,Title,Publisher code,Publication year,Collection title,ISBN,Quantity,RRP,Discount,Estimated cost,Notes,Entry date,Bookseller name,Bookseller physical address,Bookseller postal address,Contract number,Contract name,Basket group delivery place,Basket group billing place,Basket delivery place,Basket billing place
+[% FOREACH r IN rows %][% r.clientnumber %],"[% r.basketname %]",[% r.ordernumber %],"[% r.author %]","[% r.title %]","[% r.publishercode %]",[% r.publicationyear %],"[% r.collectiontitle %]",[% r.isbn %],[% r.quantity %],[% r.rrp %],[% r.discount %],[% r.ecost %],"[% r.notes %]",[% r.entrydate %],"[% r.booksellername %]","[% r.bookselleraddress %]","[% r.booksellerpostal %]",[% r.contractnumber %],"[% r.contractname %]","[% r.basketgroupdeliveryplace %]","[% r.basketgroupbillingplace %]","[% r.basketdeliveryplace %]","[% r.basketbillingplace %]"
+[% END %]
index b6875be..ef720e0 100644 (file)
                <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% name %]" /></li>
                <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% basket %]" /></li>
         <li><label for="booksellerinvoicenumber ">Bookseller invoice no: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% booksellerinvoicenumber %]" /></li>
+        <li>
+            <label for="basketgroupname">Basket group:</label>
+            <input type="text" name="basketgroupname" id="basketgroupname" value="[% basketgroupname %]" />
+        </li>
                <li><label for="from">From: </label> 
         <input type="text" size="10" id="from" name="from" value="[% from_placed_on %]" class="datepickerfrom" />
                                <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
index 821dcd3..1e19f8b 100644 (file)
@@ -7,6 +7,28 @@
 //<![CDATA[
     function Check(form) {
         [% IF (AcqCreateItemReceiving) %]
+            var total_errors=0;
+            $("input[name='mandatory'],select[name='mandatory']").each(function(i){
+                if($(this).val() == 1){
+                    var mandatory_field = $("input[name='field_value'],select[name='field_value']").eq(i);
+                    if(mandatory_field.val() == ''){
+                        mandatory_field.addClass("missing");
+                        total_errors++;
+                    }
+                }
+            });
+
+            var alertString;
+            if (total_errors==0) {
+                return true;
+            } else {
+                alertString  = _("Form not submitted because of the following problem(s)");
+                alertString += "\n------------------------------------------------------------------------------------\n";
+                alertString += "\n- "+ total_errors+_(" mandatory fields empty (highlighted)");
+                alert(alertString);
+                return false;
+            }
+
             // Remove last itemblock if it is not in items_list
             var lastitemblock = $("#outeritemblock > div:last");
             var tobedeleted = true;
index 7b0f7ca..2e6d9a2 100644 (file)
@@ -11,8 +11,9 @@
 <script type="text/javascript">
 //<![CDATA[
 
-    var rowsToCollapse = 5;
+    dt_overwrite_html_sorting_localeCompare();
 
+    var rowsToCollapse = 5;
     $(document).ready(function(){
         var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
             "aoColumnDefs": [
@@ -21,7 +22,7 @@
             "aoColumns": [
                 { "sType": "num-html" },
                 { "sType": "num-html" },
-                null,
+                { "sType": "html" },
                 null,
                 null,
                 null,
@@ -38,7 +39,7 @@
             "aoColumns": [
                 { "sType": "num-html" },
                 { "sType": "num-html" },
-                null,
+                { "sType": "html" },
                 null,
                 null,
                 null,
index a85d490..3906c46 100644 (file)
 <dl>
        <dt><a href="/cgi-bin/koha/admin/categorie.pl">Patron categories</a></dt>
        <dd>Define patron categories.</dd>
-       <dt><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></dt>
-       <dd>Define cities and towns that your patrons live in.</dd>
-       <dt><a href="/cgi-bin/koha/admin/roadtype.pl" >Road types</a>
-       </dt>
-       <dd>Define road types (street, avenue, way, etc.). Road types display as authorized values when adding/editing patrons and can be used in geographic statistics.</dd>
-       <dt><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></dt>
-       <dd>Define extended attributes (identifiers and statistical categories) for patron records</dd>
 [% IF CAN_user_parameters_manage_circ_rules %]
-       <dt><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></dt>
-       <dd>Define circulation and fines rules for combinations of libraries, patron categories, and item types</dd>
+    <dt><a href="/cgi-bin/koha/admin/smart-rules.pl">Circulation and fines rules</a></dt>
+    <dd>Define circulation and fines rules for combinations of libraries, patron categories, and item types</dd>
 [% END %]
+    <dt><a href="/cgi-bin/koha/admin/patron-attr-types.pl">Patron attribute types</a></dt>
+    <dd>Define extended attributes (identifiers and statistical categories) for patron records</dd>
     <dt><a href="/cgi-bin/koha/admin/branch_transfer_limits.pl">Library transfer limits</a></dt>
        <dd>Limit the ability to transfer items between libraries based on the library sending, the library receiving, and the item type involved. These rules only go into effect if the preference UseBranchTransferLimits is set to ON.</dd>
     <dt><a href="/cgi-bin/koha/admin/item_circulation_alerts.pl">Item circulation alerts</a></dt>
        <dd>Define rules for check-in and checkout notifications for combinations of libraries, patron categories, and item types</dd>
+    <dt><a href="/cgi-bin/koha/admin/cities.pl">Cities and towns</a></dt>
+    <dd>Define cities and towns that your patrons live in.</dd>
+    <dt><a href="/cgi-bin/koha/admin/roadtype.pl" >Road types</a>
+    </dt>
+    <dd>Define road types (street, avenue, way, etc.). Road types display as authorized values when adding/editing patrons and can be used in geographic statistics.</dd>
 </dl>
 </div>
 <div class="yui-u">
index e0be34b..f1b8254 100644 (file)
            var ok=0;
                var _alertString=_("Form not submitted because of the following problem(s)");
                _alertString +="\n-------------------------------------------------------------------\n\n";
-               if (ff.categorycode.value.length==0) {
-                   ok=1;
-                       _alertString += _("- categorycode missing") + "\n";
-               }
+                ff.categorycode.value = ff.categorycode.value.trim();
+                if (ff.categorycode.value.length==0) {
+                   ok=1;
+                   _alertString += _("- categorycode missing") + "\n";
+                }
+                else{
+                   var patt=/^[a-zA-Z0-9\-_]+$/g;
+                   if ( !patt.test(ff.categorycode.value) ) {
+                      ok=1;
+                      _alertString += _("- category code can only contain the following characters: letters, numbers, - and _") + "\n";
+                   }
+                }
                if (!(ff.category_type.value)){
                    ok=1;
                    _alertString += _("- category type missing") + "\n";
@@ -290,7 +298,7 @@ Confirm deletion of category [% categorycode |html %][% END %]</legend>
                        <tr>
                         <td>[% loo.categorycode |html %]</td>
                         <td>
-                            <a href="[% loo.script_name %]?op=add_form&amp;categorycode=[% loo.categorycode |url %]">[% loo.description |html %]</a>
+                            <a href="[% loo.script_name %]?op=add_form&amp;categorycode=[% loo.categorycode |uri %]">[% loo.description |html %]</a>
                         </td>
                         <td>
                             [% IF ( loo.type_A ) %]Adult[% END %]
@@ -337,8 +345,8 @@ Confirm deletion of category [% categorycode |html %][% END %]</legend>
                             [% END %]
                         </td>
                         [% END %]
-                        <td><a href="[% loo.script_name %]?op=add_form&amp;categorycode=[% loo.categorycode |url %]">Edit</a></td>
-                                               <td><a href="[% loo.script_name %]?op=delete_confirm&amp;categorycode=[% loo.categorycode |url %]">Delete</a></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>
                [% END %]
        </table>
index fe5fd05..404a04e 100644 (file)
@@ -93,7 +93,18 @@ Cataloging:
                   incremental: generated in the form 1, 2, 3.
                   annual: generated in the form &lt;year&gt;-0001, &lt;year&gt;-0002.
                   hbyymmincr: generated in the form &lt;branchcode&gt;yymm0001.
+                  EAN13: incremental EAN-13 barcodes
                   "OFF": not generated automatically.
+        -
+            - When a new item is added, should it be prefilled with last created item values?
+            - pref: PrefillItem
+              choices:
+                  yes: the new item is prefilled with last created item values
+                  no: the new item is not prefilled with last created item values
+        -
+            - Define a list of subfields to use when prefilling items (separated by space)
+            - pref: SubfieldsToUseWhenPrefill
+
     Display:
         -
             - 'Separate multiple displayed authors, series or subjects with '
@@ -141,4 +152,8 @@ Cataloging:
                   yes: Hide
                   no: "Don't hide"
             - items marked as suppressed from OPAC search results. Note that you must have the <code>Suppress</code> index set up in Zebra and at least one suppressed item, or your searches will be broken.
+            - Restrict the suppression to IP adresses outside of the IP range
+            - pref: OpacSuppressionByIPRange
+              class: short
+            - (Leave blank if not used. Define a range like <code>192.168.</code>.)
 
index e07fc0d..a758b19 100644 (file)
@@ -16,6 +16,7 @@ Circulation:
                   cuecat: Convert from CueCat form
                   T-prefix: Remove the first number from T-prefix style
                   libsuite8: Convert from Libsuite8 form
+                  EAN13: EAN-13 or zero-padded UPC-A from
             - scanned item barcodes.
         -
             - Sort previous checkouts on the circulation page from
index bb3bc2d..d1f2814 100644 (file)
@@ -18,20 +18,6 @@ Enhanced Content:
             - other editions of an item on the OPAC.
     Amazon:
         -
-            - pref: AmazonEnabled
-              default: 0
-              choices:
-                  yes: Use
-                  no: "Don't use"
-            - data from Amazon on the staff interface (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
-        -
-            - pref: OPACAmazonEnabled
-              default: 0
-              choices:
-                  yes: Use
-                  no: "Don't use"
-            - data from Amazon on the OPAC (including reviews and "Search Inside" links on item detail pages). This requires that you have signed up for and entered an access key.
-        -
             - Use Amazon data from its
             - pref: AmazonLocale
               choices:
@@ -43,14 +29,6 @@ Enhanced Content:
                   UK: British
             - website.
         -
-            - Access Amazon content using the access key
-            - pref: AWSAccessKeyID
-            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
-        -
-            - Access Amazon content (other than book jackets) using the private key
-            - pref: AWSPrivateKey
-            - (free, at <a href="http://aws.amazon.com/">http://aws.amazon.com/</a>).
-        -
             - Put the associate tag
             - pref: AmazonAssocTag
             - on links to Amazon. This can net your library referral fees if a patron decides to buy an item.
@@ -62,40 +40,12 @@ Enhanced Content:
                   no: "Don't show"
             - cover images from Amazon on search results and item detail pages on the staff interface.
         -
-            - pref: AmazonReviews
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - reviews from Amazon on item detail pages on the staff interface.
-        -
-            - pref: AmazonSimilarItems
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - similar items, as determined by Amazon, on item detail pages on the staff interface.
-        -
             - pref: OPACAmazonCoverImages
               default: 1
               choices:
                   yes: Show
                   no: "Don't show"
             - cover images from Amazon on search results and item detail pages on the OPAC.
-        -
-            - pref: OPACAmazonSimilarItems
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - similar items, as determined by Amazon, on item detail pages on the OPAC.
-        -
-            - pref: OPACAmazonReviews
-              default: 1
-              choices:
-                  yes: Show
-                  no: "Don't show"
-            - reviews from Amazon on item detail pages on the OPAC.
     Babelthèque:
         -
             - pref: Babeltheque
index 4a4d4de..50abfeb 100644 (file)
@@ -151,17 +151,12 @@ OPAC:
             - Include the additional CSS stylesheet
             - pref: opaccolorstylesheet
               class: file
-            - to override specified settings from the default stylesheet (leave blank to disable). Enter a filename or a complete URL beginning with <code>http://</code> (if the file lives on a remote server). Please note that if you enter a filename, the file should be in the css subdirectory for each active theme and language within the Koha templates directory.
+            - to override specified settings from the default stylesheet (leave blank to disable). Enter just a filename, a full local path or a complete URL starting with <code>http://</code> (if the file lives on a remote server). Please note that if you just enter a filename, the file should be in the css subdirectory for each active theme and language within the Koha templates directory. A full local path is expected to start from your HTTP document root.
         -
             - Use the CSS stylesheet
             - pref: opaclayoutstylesheet
               class: file
-            - on all pages in the OPAC, instead of the default (leave blank to disable). Please enter filename only. The file should be in the css subdirectory for each active theme and language within the Koha templates directory.
-        -
-            - Use the remote CSS stylesheet
-            - pref: opacstylesheet
-              class: file
-            - on all pages in the OPAC, instead of the default. (This should be a complete URL, starting with <code>http://</code>.)
+            - on all pages in the OPAC, instead of the default css (used when leaving this field blank). Enter just a filename, a full local path or a complete URL starting with <code>http://</code> (if the file lives on a remote server). Please note that if you just enter a filename, the file should be in the css subdirectory for each active theme and language within the Koha templates directory. A full local path is expected to start from your HTTP document root.
         -
             - "Include the following CSS on all pages in the OPAC:"
             - pref: OPACUserCSS
@@ -204,7 +199,7 @@ OPAC:
               type: textarea
               class: code
         -
-            - 'Include a "Links" column on the "my summary" tab when a user is logged in to the OPAC, with the following HTML (leave blank to disable):'
+            - 'Include a "Links" column on the "my summary" and "my reading history" tabs when a user is logged in to the OPAC, with the following HTML (leave blank to disable):'
             - '<br />Note: The placeholders {BIBLIONUMBER}, {TITLE}, {ISBN} and {AUTHOR} will be replaced with information from the displayed record.'
             - pref: OPACMySummaryHTML
               type: textarea
index ce62779..74d14af 100644 (file)
@@ -74,10 +74,11 @@ Patrons:
                no: "Don't allow"
          - "staff to access a patron's checkout history (it is stored regardless)."
      -
-         - The late fine for a specific checkout will only go up to
+         - The late fine for all checkouts will only go up to
          - pref: MaxFine
            class: currency
          - '[% local_currency %].'
+         - Empty value means no limit. Single item caps are specified in the circulation rules matrix.
      -
          - pref: memberofinstitution
            choices:
index e324680..5176d52 100644 (file)
@@ -99,7 +99,7 @@ Searching:
               choices:
                   relevance: relevance
                   popularity: total number of checkouts
-                  callnumber: call number
+                  call_number: call number
                   pubdate: date of publication
                   acqdate: date added
                   title: title
@@ -131,7 +131,7 @@ Searching:
               choices:
                   relevance: relevance
                   popularity: total number of checkouts
-                  callnumber: call number
+                  call_number: call number
                   pubdate: date of publication
                   acqdate: date added
                   title: title
index 2ccbe5a..7f5be96 100644 (file)
                   [% IF ( index.mandatory ) %]
                     <input type="hidden" name="type" value="[% index.type %]" />
                   [% END %]
-                  <select name="type"[% IF ( index.mandatory ) %] disabled="disabled"[% END %]>
-                    <option [% IF ( index.type == 'str' ) %] selected="selected"[% END %] value="str">String</option>
-                    <option [% IF ( index.type == 'ste' ) %] selected="selected"[% END %] value="ste">Simple Text</option>
-                    <option [% IF ( index.type == 'txt' ) %] selected="selected"[% END %] value="txt">Text</option>
-                    <option [% IF ( index.type == 'int' ) %] selected="selected"[% END %] value="int">Integer</option>
-                    <option [% IF ( index.type == 'date') %] selected="selected"[% END %] value="date">Date</option>
+                  [% IF ( index.mandatory ) %]
+                    <select name="type" disabled="disabled">
+                  [% ELSE %]
+                    <select name="type">
+                  [% END %]
+                    [% IF ( index.type == 'str' ) %]
+                        <option value="str" selected="selected">String</option>
+                    [% ELSE %]
+                        <option value="str">String</option>
+                    [% END %]
+                    [% IF ( index.type == 'ste' ) %]
+                        <option value="ste" selected="selected">Simple Text</option>
+                    [% ELSE %]
+                        <option value="ste">Simple Text</option>
+                    [% END %]
+                    [% IF ( index.type == 'txt' ) %]
+                        <option value="txt" selected="selected">Text</option>
+                    [% ELSE %]
+                        <option value="txt">Text</option>
+                    [% END %]
+                    [% IF ( index.type == 'int' ) %]
+                        <option value="int" selected="selected">Integer</option>
+                    [% ELSE %]
+                        <option value="int">Integer</option>
+                    [% END %]
+                    [% IF ( index.type == 'date' ) %]
+                        <option value="date" selected="selected">Date</option>
+                    [% ELSE %]
+                        <option value="date">Date</option>
+                    [% END %]
                   </select>
                 </td>
                 <td>
-                  <input name="sortable" type="checkbox" [% IF ( index.sortable ) %]checked="checked"[% END %] value="[% index.code %]" />
+                  [% IF ( index.sortable ) %]
+                    <input name="sortable" type="checkbox" checked="checked" value="[% index.code %]" />
+                  [% ELSE %]
+                    <input name="sortable" type="checkbox" value="[% index.code %]" />
+                  [% END %]
                 </td>
                 <td>
-                  <input name="facetable" type="checkbox" [% IF ( index.facetable ) %]checked="checked"[% END %] value="[% index.code %]" />
+                  [% IF ( index.facetable ) %]
+                    <input name="facetable" type="checkbox" checked="checked" value="[% index.code %]" />
+                  [% ELSE %]
+                    <input name="facetable" type="checkbox" value="[% index.code %]" />
+                  [% END %]
                 </td>
                 <td>
                     <textarea name="mappings" class="contentEditable">[% FOREACH m IN index.mappings %][% m %]
index 49e4ef2..b2f62f7 100644 (file)
@@ -72,6 +72,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                 <th>Fine amount</th>
                 <th>Fine charging interval</th>
                 <th>Fine grace period (day)</th>
+                <th>Overdue Fines Cap ($)</th>
                 <th>Suspension in days (day)</th>
                 <th>Renewals allowed (count)</th>
                 <th>Holds allowed (count)</th>
@@ -116,6 +117,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                                                        <td>[% rule.fine %]</td>
                                                        <td>[% rule.chargeperiod %]</td>
                                                        <td>[% rule.firstremind %]</td>
+                            <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
                                                        <td>[% rule.finedays %]</td>
                                                        <td>[% rule.renewalsallowed %]</td>
                                                        <td>[% rule.reservesallowed %]</td>
@@ -161,6 +163,7 @@ for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidde
                     <td><input name="fine" size="4" /></td>
                     <td><input name="chargeperiod" size="2" /></td>
                     <td><input name="firstremind" size="2" /> </td>
+                    <td><input name="overduefinescap" size="6" /> </td>
                     <td><input name="finedays" size="3" /> </td>
                     <td><input name="renewalsallowed" size="2" /></td>
                     <td><input name="reservesallowed" size="2" /></td>
index e684179..d0c4329 100644 (file)
@@ -153,7 +153,7 @@ function openAuth(tagsubfieldid,authtype) {
             }      
         }
     }           
-       newin=window.open("../authorities/auth_finder.pl?authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
+    newin=window.open("../authorities/auth_finder.pl?source=auth&authtypecode="+  authtype+ "&index="+tagsubfieldid+"&value_mainstr="+encodeURI(mainmainstring)+"&value_main="+encodeURI(mainstring), "_blank",'width=700,height=550,toolbar=false,scrollbars=yes');
 }
 
 function AddField(field,cntrepeatfield) {
@@ -584,6 +584,7 @@ function searchauthority() {
     <input type="hidden" name="repeat_field" value="" />
     <input type="hidden" name="authtypecode" value="[% authtypecode %]" />
     <input type="hidden" name="authid" value="[% authid %]" />
+    <input type="hidden" name="index" value="[% index %]" />
     <input type="hidden" value="0" id="confirm_not_duplicate" name="confirm_not_duplicate" />
 
        <div id="toolbar">
index 2881710..415185a 100644 (file)
@@ -11,6 +11,18 @@ function jumpfull(page)
 {      
     window.open(page,'','fullscreen,scrollbars');
 }
+
+function doauth(authid, index, repet)
+{
+[% IF source == 'auth' %]
+    var e = document.getElementById("relationship");
+    var relationship = e.options[e.selectedIndex].value;
+
+    jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet + '&relationship=' + relationship);
+[% ELSE %]
+    jumpfull('blinddetail-biblio-search.pl?authid=' + authid + '&index=' + index + '&repet=' + repet);
+[% END %]
+}
 </script>
 </head>
 <body id="auth_searchresultlist_auth" class="auth">
@@ -56,16 +68,6 @@ function jumpfull(page)
                     <th>Get it!</th>
                     <th>Other action</th>
                 </tr>
-                <tr>
-                    <td>&nbsp;</td>
-                    <td>&nbsp;</td>
-                    <td>
-                        <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=0&amp;index=[% index %]')" class="button">
-                            Clear
-                        </a>
-                    </td>
-                    <td>&nbsp;</td>
-                </tr>
                 [% FOREACH resul IN result %]
                     <tr>
                         <td>[% PROCESS authresult summary=resul.summary %]</td>
@@ -73,10 +75,10 @@ function jumpfull(page)
                         <td>
                           [% IF resul.repets %]
                             [% FOREACH repet IN resul.repets %]
-                            <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=[% resul.authid %]&amp;index=[% repet.index %]&amps;repet=[% repet.repet %]')" title="[% repet.value %]">[% repet.repet %]</a>
+                            <a href="javascript:doauth('[% resul.authid %]', '[% repet.index %]', '[% repet.repet %]')" title="[% repet.value %]">[% repet.repet %]</a>
                             [% END %]
                           [% ELSE %]
-                            <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=[% resul.authid %]&amp;index=[% index %]')">choose</a>
+                            <a href="javascript:doauth('[% resul.authid %]', '[% index %]', '')">choose</a>
                           [% END %]
                         </td>
                         <td><a href="authorities.pl?authid=[% resul.authid %]">Edit authority</a></td>
index 038959f..6ac139a 100644 (file)
@@ -8,7 +8,9 @@ function confirm_deletion(id) {
     
     var is_confirmed = confirm('Are you sure you want to delete this authority?');
     if (is_confirmed) {
-        window.location="authorities-home.pl?op=delete&amp;authid="+id;
+      window.location="authorities-home.pl?op=delete&amp;authid="
+          + id
+          + "&amp;marclist=[% marclist %]&amp;and_or=[% and_or %]&amp;excluding=[% excluding %]&amp;operator=[%operator%]&amp;orderby=[% orderby %]&amp;value=[% value %]&amp;startfrom=[% startfrom %]&amp;resultsperpage=[% resultsperpage %]";
     }
 }
 function Help() {
index 4f00524..22f7908 100644 (file)
@@ -39,7 +39,7 @@ function verify_images() {
         $('#bibliodetails').tabs();
         $('#search-form').focus();
      });
-     [% IF ( AmazonEnabled ) %]$(window).load(function() {
+     [% IF ( AmazonCoverImages ) %]$(window).load(function() {
         verify_images();
      });[% END %]
 //]]>
@@ -74,7 +74,7 @@ function verify_images() {
         <span class="Z3988" title="[% ocoins %]"></span>
     [% END %]
 
-    [% IF ( AmazonEnabled ) %]
+    [% IF ( AmazonCoverImages ) %]
         [% IF ( XSLTDetailsDisplay ) %]
             <div class="yui-gc">
             <div id="catalogue_detail_biblio" class="yui-u first">
@@ -117,8 +117,8 @@ function verify_images() {
         [% END %]
         [% 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 ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
-        <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a>[% END %][% END %]
+        [% IF ( AmazonCoverImages ) %]</div><div class="yui-u" id="bookcoverimg">
+        <a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a>[% END %]
     [% ELSE %]
 
     <h3>[% title |html %]</h3>
@@ -177,8 +177,8 @@ function verify_images() {
         </ul>
         </div>
        
-[% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<div class="yui-u" id="bookcoverimg">
-<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a></div>[% END %][% END %]
+[% IF ( AmazonCoverImages ) %]<div class="yui-u" id="bookcoverimg">
+<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="" /></a></div>[% END %]
         
         <div class="yui-u" style="margin-top: 1em;">
         <ul>
@@ -260,7 +260,6 @@ function verify_images() {
 <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 ( AmazonSimilarItems ) %]<li><a href="#related">Related titles</a></li>[% END %]
 [% IF ( LocalCoverImages ) %][% IF ( localimages || CAN_user_tools_upload_local_cover_images ) %]<li><a href="#images">Images</a></li>[% END %][% END %]
  </ul>
 
@@ -449,14 +448,6 @@ function verify_images() {
     
 <div id="description">
 <div class="content_set">
-[% IF ( AmazonEnabled ) %]
-[% FOREACH AMAZON_EDITORIAL_REVIEW IN AMAZON_EDITORIAL_REVIEWS %]
-    [% IF ( AMAZON_EDITORIAL_REVIEW.Content ) %]
-    <h4>From [% AMAZON_EDITORIAL_REVIEW.Source %]:</h4>
-    <p>[% AMAZON_EDITORIAL_REVIEW.Content %]</p>
-    [% END %]
-[% END %]
-[% END %]
 
 [% IF ( MARCNOTES ) %]
     [% FOREACH MARCNOTE IN MARCNOTES %]
@@ -522,7 +513,7 @@ function verify_images() {
 [% IF ( FRBRizeEditions ) %][% IF ( XISBNS ) %]
 <div id="editions"><h4>Editions</h4>
 <table>
-[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( XISBN.AmazonEnabled ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
+[% FOREACH XISBN IN XISBNS %]<tr>[% IF ( AmazonCoverImages ) %]<td><a href="http://www.amazon.com/gp/reader/[% XISBN.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" /></a></td>[% END %]
 [% UNLESS ( item_level_itypes ) %]<td>[% IF ( noItemTypeImages ) %][% XISBN.description %][% ELSE %]<img src="[% XISBN.imageurl %]" alt="[% XISBN.description %]" title="[% XISBN.description %]">[% END %]</td>[% END %]
 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% XISBN.biblionumber %]">[% XISBN.title |html %]</a> by [% XISBN.author %] &copy;[% XISBN.copyrightdate %]
   [% IF ( XISBN.publishercode ) %]
@@ -536,19 +527,6 @@ function verify_images() {
 </table></div>[% END %]
 [% END %]
 
-[% IF ( AmazonEnabled ) %][% IF ( AmazonSimilarItems ) %]
-<div id="related">
-<h4>Similar Items</h4>
-<ul>
-[% FOREACH AMAZON_SIMILAR_PRODUCT IN AMAZON_SIMILAR_PRODUCTS %]
-[% FOREACH similar_biblionumber IN AMAZON_SIMILAR_PRODUCT.similar_biblionumbers %]
-<li><img alt="" src="http://images.amazon.com/images/P/[% similar_biblionumber.ASIN %].01._SS50_.jpg" /> <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]">[% similar_biblionumber.title |html %]</a> </li>
-[% END %]
-[% END %]
-</ul>
-</div>
-[% END %][% END %]
-
 [% IF ( LocalCoverImages ) %]
 <div id="images">
 [% IF ( localimages.0 ) %]
index 1ebc862..2e71ba7 100644 (file)
@@ -6,7 +6,7 @@
 var MSG_NO_ITEM_SELECTED = _("Nothing is selected.");
 var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be placed on hold.");
 var q_array = new Array();  // will hold search terms, if present
-[% IF ( AmazonEnabled ) %]
+[% IF ( AmazonCoverImages ) %]
 // http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
 function verify_images() {
     $("img").each(function(i){
@@ -96,6 +96,11 @@ $(".addtocart").show();
     toHighlight = $("p,span.results_summary,a.title");
         var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
         q_array = query_desc.split(" ");
+        // ensure that we don't have "" at the end of the array, which can
+        // break the highlighter
+        while (q_array.length > 0 && q_array[q_array.length-1] == "") {
+            q_array = q_array.splice(0,-1);
+        }
         highlightOn();
         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
         $("#highlight_toggle_off").show().click(function() {highlightOff();});
@@ -440,20 +445,20 @@ YAHOO.util.Event.onContentReady("searchheader", function () {
                     <!-- TABLE RESULTS START -->
                 <table>
                     <tr>
-                        [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]<th>&nbsp;</th>[% END %][% END %]
+                        [% IF ( AmazonCoverImages ) %]<th>&nbsp;</th>[% END %]
                         <th colspan="2">Results</th>
                         <th>Location</th>
                     </tr>
                         <!-- Actual Search Results -->
                         [% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
                          [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
-                            [% IF ( AmazonEnabled ) %][% IF ( AmazonCoverImages ) %]
+                            [% IF ( AmazonCoverImages ) %]
                                 <td>
                                     <a class="p1" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber |url %]">
                                                                        
                                         <img src="[% IF ( SEARCH_RESULT.normalized_isbn ) %]http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg[% ELSE %]http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif[% END %]" alt="" class="thumbnail" />
                                     </a></td>
-                            [% END %][% END %]
+                            [% END %]
                             <td>
                                 <input type="checkbox" class="selection" id="bib[% SEARCH_RESULT.biblionumber %]" name="biblionumber" value="[% SEARCH_RESULT.biblionumber %]" style="display:none" />
                             </td>
index 6692274..05750b2 100644 (file)
@@ -44,7 +44,7 @@ function Check(f) {
         if($(this).val() == 1){
             var mandatory_field = $("input[name='field_value'],select[name='field_value']").eq(i);
             if(mandatory_field.val() == ''){
-                mandatory_field.css("background-color","#FFFFCC");
+                mandatory_field.addClass("missing");
                 total_errors++;
             }
         }
index 9c910ec..911c2f0 100644 (file)
@@ -227,9 +227,11 @@ function changeFramework(fw) {
 </form>
 [% ELSE %]
 [% IF ( errors ) %]
+    <div class="dialog alert">
     [% FOREACH error IN errors %]
-       <div class="error">[% error.error %]</div>
+        <p>[% error.error %]</p>
     [% END %]
+    </div>
 [% ELSE %]
 <form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
 
index 6f72392..729defc 100644 (file)
@@ -5,6 +5,7 @@
 [% INCLUDE 'calendar.inc' %]
 [% IF ( UseTablesortForCirc ) %]<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>[% END %]
 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery-ui-timepicker-addon.js"></script>
 <script type="text/javascript">
 //<![CDATA[
 [% IF ( borrowernumber ) %]if($.cookie("holdfor") != [% borrowernumber %]){ $.cookie("holdfor",null, { path: "/", expires: 0 }); }[% ELSE %]$.cookie("holdfor",null, { path: "/", expires: 0 });[% END %]
@@ -16,6 +17,7 @@
 });[% END %]
 [% UNLESS ( borrowernumber ) %][% UNLESS ( CGIselectborrower ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %][% END %]
         $(document).ready(function() {
+
         $('#patronlists').tabs();
                [% IF ( UseTablesortForCirc ) %]$.tablesorter.defaults.widgets = ['zebra'];
                $("#issuest").tablesorter({[% IF ( dateformat_metric ) %]
@@ -142,8 +144,10 @@ var allcheckboxes = $(".checkboxed");
         radioCheckBox($(this));
      });
     $("#newduedate").datepicker({ minDate: 1 }); // require that renewal date is after today
-    $("#duedatespec").datepicker({
-        onSelect: function(dateText, inst) { $("#barcode").focus(); }
+    $("#duedatespec").datetimepicker({
+        onSelect: function(dateText, inst) { $("#barcode").focus(); },
+        hour: 23,
+        minute: 59,
     });
 
  });
@@ -313,7 +317,7 @@ function validate1(date) {
     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
     [% IF ( INVALID_DATE ) %]
     <p>
-    <input type="text" size="10" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
+    <input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />
     <label for="duedatespec">Due date</label>
     </p>
     [% ELSE %]
@@ -487,7 +491,7 @@ No patron matched <span class="ex">[% message %]</span>
 
     [% IF ( SpecifyDueDate ) %]<div class="date-select">
         <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
-               [% IF ( duedatespec ) %]<input type="text" size="10" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />[% ELSE %]<input type="text" size="10" id="duedatespec" name="duedatespec" value="" />
+        [% IF ( duedatespec ) %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="[% duedatespec %]" />[% ELSE %]<input type="text" size="13" id="duedatespec" name="duedatespec" value="" />
 [% END %]
           <label for="stickyduedate"> Remember for session:</label>
 [% IF ( stickyduedate ) %]
index 1ed01f0..674cf86 100644 (file)
@@ -47,10 +47,9 @@ $(document).ready(function () {
 </script>
 </head>
 <body id="circ_returns" class="circ">
-<div id="header" class="gradient">
+
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'checkin-search.inc' %]
-</div>
 
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Check in</div>
 
@@ -429,7 +428,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>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 branch</th><th>Holding branch</th><th>Shelving location</th><th>Call number</th><th>Type</th>  <th>Patron</th><th>Note</th></tr>
 
         [% FOREACH riloo IN riloop %]
             <tr>
@@ -445,6 +444,8 @@ $(document).ready(function () {
                     [% riloo.itemtitle |html %]</a></td>
                        <td>[% riloo.itemauthor %]</td>
             <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% riloo.itembiblionumber %]&amp;itemnumber=[% riloo.itemnumber %]#item[% riloo.itemnumber %]">[% riloo.barcode %]</a></td>
+            <td>[% riloo.homebranch %]</td>
+            <td>[% riloo.holdingbranch %]</td>
             <td>[% riloo.location %]</td>
             <td>[% riloo.itemcallnumber %]</td>
             <td>[% riloo.itemtype %] [% riloo.ccode %]</td>
index 492dca4..38658dd 100644 (file)
                     || ( CAN_user_acquisition && pendingsuggestions ) ) %]
                 <div id="area-pending">
                     [% IF ( CAN_user_acquisition && pendingsuggestions ) %]
-                    <div class="pending-info">
+                    <div class="pending-info" id="suggestions_pending">
+
                         <a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions pending approval</a>:
                         <span class="pending-number-link">[% pendingsuggestions %]</span>
                     </div>
                     [% END %]
 
                     [% IF ( CAN_user_tools_moderate_comments  && pendingcomments ) %]
-                    <div class="pending-info">
+                    <div class="pending-info" id="comments_pending">
                         <a href="/cgi-bin/koha/reviews/reviewswaiting.pl">Comments pending approval</a>:
                         <span class="pending-number-link">[% pendingcomments %]</span>
                     </div>
                     [% END %]
 
                     [% IF ( CAN_user_tools_moderate_tags && pendingtags ) %]
-                    <div class="pending-info">
+                    <div class="pending-info" id="tags_pending">
                         <a href="/cgi-bin/koha/tags/review.pl">Tags pending approval</a>:
                         <span class="pending-number-link">[% pendingtags %]</span>
                     </div>
index 1f28b04..f4734c0 100644 (file)
     });
 
     function clear_entry(node) {
-        var original = node.parentNode.parentNode;
+        var original = node.parentNode;
         $("input[type=text]", original).attr('value', '');
         $("select", original).attr('value', '');
     }
 
     function clone_entry(node) {
-        var original = node.parentNode.parentNode;
-        var clone = original.cloneNode(true);
+        var original = $(node).parent();
+        var clone = original.clone();
+
         var newId = 50 + parseInt(Math.random() * 100000);
-        $("input", clone).attr('id', function() {
+        $("input,select,textarea", clone).attr('id', function() {
             return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
         });
-        $("input", clone).attr('name', function() {
+        $("input,select,textarea", clone).attr('name', function() {
             return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
         });
-        $("select", clone).attr('id', function() {
-            return this.id.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
-        });
-        $("select", clone).attr('name', function() {
-            return this.name.replace(/patron_attr_\d+/, 'patron_attr_' + newId);
+        $("label", clone).attr('for', function() {
+            return $(this).attr("for").replace(/patron_attr_\d+/, 'patron_attr_' + newId);
         });
         $("input#patron_attr_" + newId, clone).attr('value','');
         $("select#patron_attr_" + newId, clone).attr('value','');
-        original.parentNode.insertBefore(clone, original.nextSibling);
+        $(original).after(clone);
+        return false;
     }
 
     function update_category_code(category_code) {
         if ( $(category_code).is("select") ) {
             category_code = $("#categorycode").find("option:selected").val();
         }
-        var mytables = $(".attributes_table>tbody");
-
-        mytables.find("tr").each(function(){
-            $(this).hide()
-        });
-
-        mytables.find("tr[data-category_code="+category_code+"]").each(function(){
-            $(this).show();
-        });
-        mytables.find("tr[data-category_code='']").each(function(){
-            $(this).show();
-        });
-
+        var mytables = $(".attributes_table");
+        $(mytables).find("li").hide();
+        $(mytables).find(" li[data-category_code="+category_code+"]").show();
+        $(mytables).find(" li[data-category_code='']").show();
     }
 
                var MSG_SEPARATOR = _("Separator must be / in field ");
                        [% END %]
                        [% IF ( ERROR_age_limitations ) %]
                                <li id="ERROR_age_limitations">Patron's age is incorrect for their category.  
-                                       Ages allowed are [% ERROR_age_limitations %].</li>
+                    Ages allowed are [% age_low %]-[% age_high %].</li>
                        [% END %]
                        [% IF ( ERROR_branch ) %]
                                <li id="ERROR_branch">Library is invalid.</li>
     <legend>Additional attributes and identifiers</legend>
     [% FOREACH pa_loo IN patron_attributes %]
         [% IF pa_loo.class %]
-            <table id="aai_[% pa_loo.class %]" class="attributes_table">
-            <caption>[% pa_loo.lib %]</caption>
-        [% ELSE %]
-            <table id="aai" class="attributes_table">
+            <fieldset id="aai_[% pa_loo.class %]">
+            <legend>[% pa_loo.lib %]</legend>
         [% END %]
-        <thead>
-            <tr>
-                <th>Type</th>
-                <th colspan="2">Value</th>
-            </tr>
-        </thead>
-        <tbody>
+        <ol class="attributes_table">
             [% FOREACH patron_attribute IN pa_loo.items %]
-                <tr data-category_code="[% patron_attribute.category_code %]">
-                    <td>
-                        [% patron_attribute.code %] ([% patron_attribute.description %])
-                    </td>
-                    <td>
+                <li data-category_code="[% patron_attribute.category_code %]">
+                    <label for="[% patron_attribute.form_id %]">[% patron_attribute.description %]: </label>
                         <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
                         [% IF ( patron_attribute.use_dropdown ) %]
                             <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
                             [% END %]
                         [% END %]
                         [% IF ( patron_attribute.password_allowed ) %]
-                            (Password: <input type="password" maxlength="64" value="[% patron_attribute.password %]"
+                            (<label class="yesno" for="[% patron_attribute.form_id %]_password">Password:</label> <input type="password" maxlength="64" value="[% patron_attribute.password %]"
                                    id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
                         [% END %]
-                    </td>
-                    <td>
-                        <a href="#" onclick="clear_entry(this); return false;">Clear</a>
+                        <a href="#" class="clear-field" onclick="clear_entry(this); return false;">Clear</a>
                         [% IF ( patron_attribute.repeatable ) %]
-                        <a href="#" onclick="clone_entry(this); return false;">New</a>
+                        <a href="#" class="clone-field" onclick="clone_entry(this); return false;">New</a>
                         [% END %]
-                    </td>
-                </tr>
+                </li>
             [% END %]
-        </tbody>
-        </table>
+        </ol>
+        [% IF pa_loo.class %]</fieldset>[% END %]
     [% END %]
   </fieldset>
 [% END %][% END %][% END %]
index b6df1b3..11bb33f 100644 (file)
@@ -290,32 +290,24 @@ function validate1(date) {
 <h3>Additional attributes and identifiers</h3>
 [% FOREACH attribute IN attributes_loop %]
     [% IF attribute.class %]
-        <h4>[% attribute.lib %]</h4>
-        <table id="aai_[% attribute.class %]">
+        <div id="aai_[% attribute.class %]" class="rows">
     [% ELSE %]
-        <table id="aai">
+        <div id="aai" class="rows">
     [% END %]
-        <thead>
-            <tr>
-                <th>Type</th>
-                <th>Description</th>
-                <th>Value</th>
-            </tr>
-        </thead>
-        <tbody>
+        <h4>[% attribute.lib %]</h4>
+        <ol>
         [% FOREACH item IN attribute.items %]
-            <tr>
-                <td>[% item.code %]</td>
-                <td>[% item.description %]</td>
-                <td>[% item.value %]
-                    [% IF ( item.value_description ) %]
-                        ([% item.value_description %])
-                    [% END %]
-                </td>
-            </tr>
+            <li>
+                <span class="label">[% item.description %]: </span>
+                [% IF ( item.value_description ) %]
+                    [% item.value_description %]
+                [% ELSE %]
+                    [% item.value %]
+                [% END %]
+            </li>
         [% END %]
-        </tbody>
-    </table>
+        </ol>
+    </div>
 [% END %]
 </div>
 <div class="action"><a href="memberentry.pl?op=modify&amp;borrowernumber=[% borrowernumber %]&amp;step=4">Edit</a></div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/routing-lists.tt
new file mode 100644 (file)
index 0000000..04876dc
--- /dev/null
@@ -0,0 +1,80 @@
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Subscription Routing Lists for [% INCLUDE 'patron-title.inc' %]</title>
+[% INCLUDE 'doc-head-close.inc' %]
+</head>
+<body>
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'patron-search.inc' %]
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Subscription Routing Lists for [% INCLUDE 'patron-title.inc' %]</div>
+
+<div id="doc3" class="yui-t2">
+    <div id="bd">
+    <div id="yui-main">
+    <div class="yui-b">
+[% INCLUDE 'circ-toolbar.inc' %]
+
+<!-- Search Bar -->
+<p class="tip">Search subscriptions:</p>
+<form action="/cgi-bin/koha/serials/serials-home.pl" method="get">[% IF ( routing ) %]<input type="hidden" name="routing" value="[% routing %]" />[% END %]<input type="hidden" name="searched" value="1" /> <label for="ISSN_filter">ISSN:</label> <input type="text" size="10" maxlength="11" name="ISSN_filter" id="ISSN_filter" value="[% ISSN_filter %]" /> <label for="title_filter">Title:</label> <input type="text" size="20" maxlength="40" name="title_filter" id="title_filter" value="[% title_filter %]" /><input type="submit" value="Search" class="submit" />
+</form>
+<!-- Search Bar End -->
+
+<h1>
+[% IF ( countSubscrip ) %]
+[% countSubscrip %] Subscription routing list(s)
+[% ELSE %]
+0 Subscription routing lists
+[% END %]
+</h1>
+
+<div id="subscriptions">
+[% IF ( subscripLoop ) %]
+<table id="subscriptiont">
+              <thead>
+                <tr>
+                  <th>Subscription title</th>
+                  <th>Routing list</th>
+                </tr>
+              </thead>
+              <tbody>
+[% FOREACH subscripLoop IN subscripLoop %]
+<tr>
+    <td>
+    <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscripLoop.subscriptionid %]"><strong>
+    [% subscripLoop.title %]
+    </strong>
+                    </a>
+                  </td>
+                  <td>
+                    <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscripLoop.subscriptionid %]"><strong>
+                    Edit routing list
+                      </strong>
+                    </a>
+                    <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                  </td>
+                </tr>
+                [% END %]
+                </tbody>
+            </table>
+            </form>
+          [% ELSE %]
+          <p>Patron does not belong to any subscription routing lists.</p>
+          <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+                    <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
+                    [% END %]
+
+</div>
+
+
+
+
+</div>
+</div>
+
+<div class="yui-b">
+[% INCLUDE 'circ-menu.inc' %]
+</div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
index 3d9a7ab..21d8235 100644 (file)
@@ -56,6 +56,9 @@ $(document).ready(function(){
     positionFixed: false,
     size:          20
   });
+  // redefine the datepicker's default because reports require ISO
+  // http://jqueryui.com/demos/datepicker/#option-dateFormat
+  $( ".datepicker" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
 });
 //]]>
 </script>
@@ -501,16 +504,22 @@ canned reports and writing custom SQL reports.</p>
         <input type='hidden' name='reports' value="[% reports %]" />
         <h1>Enter parameters for report [% name %]:</h1>
         [% IF ( notes ) %]<p>[% notes %]</p>[% END %]
+        <fieldset class="rows">
+            <ol>
         [% FOREACH sql_param IN sql_params %]
             [% IF sql_param.input == 'date' %]
-                <p>
-                [% sql_param.entry %]: <input id="date_[% sql_param_entry %]" type="text" value="" size="10" name="sql_params" class="datepicker" />
-                </p>
+                <li>
+                <label for="date_[% sql_param_entry %][% loop.count %]">[% sql_param.entry %]:</label> <input id="date_[% sql_param_entry %][% loop.count %]" type="text" value="" size="10" name="sql_params" class="datepicker" />
+                </li>
+            [% ELSIF ( sql_param.input == 'text' ) %]
+                <li><label for="sql_params[% loop.count %]">[% sql_param.entry %]: </label><input id="sql_params[% loop.count %]" type="text" name="sql_params" /></li>
             [% ELSE %]
-                <p>[% sql_param.entry %]: [% sql_param.input %]</p>
+                <li><label for="sql_params_[% sql_param.labelid %]">[% sql_param.entry %]:</label> [% sql_param.input %]</li>
             [% END %]
         [% END %]
-        <input type='submit' value='Run the report'/>
+            </ol>
+        </fieldset>
+        <fieldset class="action"><input type="submit" value="Run the report" /></fieldset>
     </form>
 [% END %]
 
index 1fdf693..a0cd35e 100644 (file)
@@ -1,4 +1,5 @@
 [% INCLUDE 'doc-head-open.inc' %]
+[% USE KohaDates %]
 <title>Koha &rsaquo; Serials [% biblionumber %]</title>
 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
 [% INCLUDE 'doc-head-close.inc' %]
@@ -83,9 +84,9 @@ Serials updated :
             <th>ISSN</th>
             <th>Title</th>
             <th> Notes </th>
-            <th>
-                Library (callnumber)
-            </th>
+            <th>Library</th>
+            <th>Call number</th>
+            <th>Expiration date</th>
             [% IF ( routing && CAN_user_serials_routing ) %]
               <th>Routing list</th>
             [% END %]        
@@ -99,6 +100,8 @@ Serials updated :
             <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>
@@ -117,8 +120,13 @@ Serials updated :
                 [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
                 </td>
                 <td>
-                [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
-                [% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %]
+                  [% 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>
@@ -127,6 +135,7 @@ Serials updated :
                     [% 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 %]
index 6790b3d..005a0a8 100644 (file)
@@ -2,22 +2,18 @@
   [% FOREACH iteminfo IN iteminformation %]
     <li>
       <div class="subfield_line" style="[% iteminfo.hidden %];" id="subfield[% iteminfo.serialid %][% iteminfo.countitems %][% iteminfo.subfield %][% iteminfo.random %]">
-        <label>
-            [% iteminfo.subfield %] -
-            [% IF ( iteminfo.mandatory ) %]
-                <b>
-            [% END %]
-            [% iteminfo.marc_lib %]
-            [% IF ( iteminfo.mandatory ) %]
-                *</b>
-            [% END %]
-        </label>
+        [% IF (iteminfo.mandatory) %]
+            <label class="required">[% iteminfo.subfield %] - [% iteminfo.marc_lib %]</label>
+        [% ELSE %]
+            <label>[% iteminfo.subfield %] - [% iteminfo.marc_lib %]</label>
+        [% END %]
         [% iteminfo.marc_value %]
         <input type="hidden" name="itemid" value="1" />
         <input type="hidden" name="kohafield" value="[% iteminfo.kohafield %]" />
         <input type="hidden" name="tag" value="[% iteminfo.tag %]" />
         <input type="hidden" name="subfield" value="[% iteminfo.subfield %]" />
         <input type="hidden" name="mandatory" value="[% iteminfo.mandatory %]" />
+        [% IF (iteminfo.mandatory) %] <span class="required">Required</span>[% END %]
       </div>
     </li>
   [% END %]
index 74624ea..2d98836 100644 (file)
@@ -28,13 +28,13 @@ function reloadPage(p) {
                                <div class="yui-b">
                                    [% IF ( success || error ) %]
                                            [% IF ( success ) %]
-               [% IF ( action == 'create' ) %]<p>The new CSV profile "[% profile_name %]" has been successfully created.</p>[% END %]
-               [% IF ( action == 'edit' ) %]<p>The CSV profile has been successfully modified.</p>[% END %]
-               [% IF ( action == 'delete' ) %]<p>The CSV profile has been successfully deleted.</p>[% END %]
-                                           [% ELSE %]
-               [% IF ( action == 'create' ) %]<p class="error">The new CSV profile "[% profile_name %]" has not been created.</p>[% END %]
-               [% IF ( action == 'edit' ) %]<p class="error">The CSV profile has not been modified.</p>[% END %]
-               [% IF ( action == 'delete' ) %]<p class="error">The CSV profile has not been deleted.</p>[% END %]
+        [% IF ( action == 'create' ) %]<div class="dialog message">The new CSV profile "[% profile_name %]" has been successfully created.</div>[% END %]
+        [% IF ( action == 'edit' ) %]<div class="dialog message">The CSV profile has been successfully modified.</div>[% END %]
+        [% IF ( action == 'delete' ) %]<div class="dialog message">The CSV profile has been successfully deleted.</div>[% END %]
+                        [% ELSE %]
+        [% IF ( action == 'create' ) %]<div class="dialog alert">The new CSV profile "[% profile_name %]" has not been created.</div>[% END %]
+        [% IF ( action == 'edit' ) %]<div class="dialog alert">The CSV profile has not been modified.</div>[% END %]
+        [% IF ( action == 'delete' ) %]<div class="dialog alert">The CSV profile has not been deleted.</div>[% END %]
                                            [% END %]
                                    [% END %]
 <div id="csvexporttabs" class="toptabs">
index 1f668b9..a88ed84 100644 (file)
@@ -14,8 +14,8 @@ $(document).ready(function(){
                $(".checkboxed").unCheckCheckboxes();
                return false;
            });
-[% IF ( offset ) %]$("#markseen").before("<input type=\"submit\" value=\"&lt;&lt; Mark seen and continue\" id=\"markback\" />");[% END %]
-[% IF ( nextoffset ) %]$("#markseen").after("<input type=\"submit\" id=\"marknext\" value=\"Mark seen and continue &gt;&gt;\" />");[% END %]
+[% IF ( offset ) %]$("#markseen").before("<input type=\"submit\" value=\"&lt;&lt; " + _("Mark seen and continue") + "\" id=\"markback\" /> ");[% END %]
+[% IF ( nextoffset ) %]$("#markseen").after(" <input type=\"submit\" id=\"marknext\" value=\"" + _("Mark seen and continue") + " &gt;&gt;\" />");[% END %]
        $("#markback").click(function(){
                $(".checkboxed").find("input").filter("[name=offset]").attr("value","[% prevoffset %]");
                return true;
index 374b2f1..c156e01 100644 (file)
@@ -319,6 +319,7 @@ $(document).ready(function() {
 
                </li>
                </ol>
+                [% IF code.search('DGST') %] <span class="overdue">Warning, this is a template for a Digest, as such, any references to branch data ( e.g. branches.branchname ) will refer to the borrower's home branch.</span> [% END %]
                </fieldset>
                <fieldset class="action"><input type="button" value="Submit" onclick="Check(this.form)" class="button" /> <a class="cancel" href="/cgi-bin/koha/tools/letter.pl">Cancel</a></fieldset>
       <input type="hidden" name="searchfield" value="[% searchfield %]" />
index 3520048..51a78c5 100644 (file)
                   <li>[% TOTAL %] directories scanned.</li>
                     <li>[% HANDLED %] directories processed.</li>
                 </ul>
+
                 [% FOREACH COUNT IN COUNTS %]
-                   <ul class="data">
+                    <ul class="data">
                         [% IF ( COUNT.TCOUNTS ) %]<li>[% COUNT.TCOUNTS %] image(s) moved into the database:</li>[% END %]
-                        [% FOREACH filename IN COUNT.filenames %]
-                            <li>[% filename.source %] - Cardnumber: [% filename.cardnumber %]
-                                    [% IF ( filename.filerrors ) %]<br /> <b>WARNING:</b> This image <i>not</i> imported because 
+                            [% FOREACH filename IN COUNT.filenames %]
+                                <li>[% filename.source %] - Cardnumber: [% filename.cardnumber %]
+                                [% IF ( filename.filerrors ) %]
                                     [% FOREACH filerror IN filename.filerrors %]
-                                        [% IF ( filerror.DBERR ) %]the database returned an error. Please refer to the error log for more details.</li>
-                                        [% ELSIF ( filerror.IMGEXISTS ) %]this patron does not exist in the database.</li>
-                                        [% ELSIF ( filerror.MIMERR ) %]the image format is unrecognized.</li>
-                                        [% ELSIF ( filerror.CORERR ) %]the image file is corrupted.</li>
-                                        [% ELSIF ( filerror.OPNERR ) %]Koha was unable to open the image for reading.</li>
-                                        [% ELSIF ( filerror.OVRSIZ ) %]the image file is too big.</li>
-                                        [% ELSIF ( filerror.CRDFIL ) %]the [% filerror.CRDFIL %] is missing.</li>
-                                        [% ELSE %]of an unknown error. Please refer to the error log for more details.</li>[% END %]
-                                    [% END %]
-                                        [% ELSE %] imported successfully.</li>
+                                        [% IF ( filerror.DBERR ) %]<br /><b>ERROR:</b> Image not imported because the database returned an error. Please refer to the error log for more details.
+                                        [% ELSIF ( filerror.IMGEXISTS ) %]<br /><b>ERROR:</b> Image not imported because this patron does not exist in the database.
+                                        [% ELSIF ( filerror.MIMERR ) %]<br /><b>ERROR:</b> Image not imported because the image format is unrecognized.
+                                        [% ELSIF ( filerror.CORERR ) %]<br /><b>ERROR:</b> Image not imported because the image file is corrupted.
+                                        [% ELSIF ( filerror.OPNERR ) %]<br /><b>ERROR:</b> Image not imported because Koha was unable to open the image for reading.
+                                        [% ELSIF ( filerror.OVRSIZ ) %]<br /><b>ERROR:</b> Image not imported because the image file is too big (see online help for maximum size).
+                                        [% ELSIF ( filerror.CRDFIL ) %]<br /><b>ERROR:</b> Image not imported ([% filerror.CRDFIL %] missing).
+                                        [% ELSE %]<br /><b>ERROR:</b> Image not imported because of an unknown error. Please refer to the error log for more details.
+                                        [% END %]
                                     [% END %]
+                                [% ELSE %] imported successfully.
+                                [% END %]
+                                </li>
                         [% END %]
-                        </ul>
+                    </ul>
                 [% END %]
 
                                </div>
index ad1650d..faad011 100644 (file)
@@ -2,7 +2,10 @@
 
 <!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
 
-<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:stylesheet version="1.0"
+  xmlns:marc="http://www.loc.gov/MARC21/slim"
+  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  exclude-result-prefixes="marc items">
 
   <xsl:template name="datafield">
     <xsl:param name="tag"/>
diff --git a/koha-tmpl/intranet-tmpl/prog/img/clear-field.png b/koha-tmpl/intranet-tmpl/prog/img/clear-field.png
new file mode 100644 (file)
index 0000000..80287bf
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/clear-field.png differ
diff --git a/koha-tmpl/intranet-tmpl/prog/img/clone-field.png b/koha-tmpl/intranet-tmpl/prog/img/clone-field.png
new file mode 100644 (file)
index 0000000..702efb3
Binary files /dev/null and b/koha-tmpl/intranet-tmpl/prog/img/clone-field.png differ
diff --git a/koha-tmpl/opac-tmpl/prog/en/css/babeltheque.css b/koha-tmpl/opac-tmpl/prog/en/css/babeltheque.css
new file mode 100644 (file)
index 0000000..95406ec
--- /dev/null
@@ -0,0 +1,152 @@
+/* ## BABELTHEQUE ## */
+/* Babeltheque is a french supplier for advanced features
+this babeltheque.css is not used anywhere by Koha, it's not a mistake
+If you're babeltheque customer, you have access to a specific configuration URL
+on babeltheque website, where you can activate this css
+So: it should not be removed from Koha !
+*/
+
+#BW_etiquettes {
+  clear :left;
+  border: 1px solid #E8E8E8;
+  margin-top: 10px;
+  width: 49%;
+  float: left;
+  visibility: hidden;
+  visibility: visible\9;
+}
+#BW_etiquettes:not(:empty) {
+  visibility: visible;
+}
+
+#BW_etiquettes h2 {
+  clear:left;
+  background-color: #E8E8E8;
+  margin: 5px 10px;
+  padding: 0 5px;
+}
+
+#BW_ulEti {max-width:100%;}
+
+#BW_ulEti ul  {
+  margin:0;
+  padding:0 15px;
+  list-style-type: none;
+}
+
+#BW_ulEti a {
+  text-decoration: none;
+}
+
+#BW_ulEti a.tag_s0  {font-weight: 120;font-size:0.8em;}
+#BW_ulEti a.tag_s1  {font-weight: 150;font-size:0.9em;}
+#BW_ulEti a.tag_s2  {font-weight: 180;font-size:1.0em;}
+#BW_ulEti a.tag_s3  {font-weight: 200;font-size:1.2em;}
+#BW_ulEti a.tag_s4  {font-weight: 220;font-size:1.4em;}
+#BW_ulEti a.tag_s5  {font-weight: 230;font-size:1.5em;}
+#BW_ulEti a.tag_s6  {font-weight: 320;font-size:1.6em;}
+#BW_ulEti a.tag_s7  {font-weight: 350;font-size:1.7em;}
+#BW_ulEti a.tag_s8  {font-weight: 400;font-size:1.8em;}
+#BW_ulEti { padding: 0px; line-height: 2em; text-align: center;}
+#BW_ulEti a { padding: 2px; }
+#BW_ulEti { margin: 0px; }
+
+#BW_ulEti ol {
+  float:left;
+  display: inline;
+  margin: 0 10px;
+}
+
+#BW_suggestions {
+  border: 1px solid #E8E8E8;
+  margin-top: 10px;
+  float: right;
+  width: 49%;
+  visibility: hidden;
+  visibility: visible\9;
+}
+#BW_suggestions:not(:empty) {
+  visibility: visible;
+}
+#BW_suggestions h2 {
+  background-color: #E8E8E8;
+  margin: 5px 10px;
+  padding: 0 5px;
+}
+#BW_suggestions .BW_livres_tag_page {
+  padding: 0 15px;
+}
+#BW_suggestions .BW_livres_tag_page:before {
+  content : '> ';
+}
+#BW_droite .BW_livres_tag:before {
+  content : '> ';
+}
+
+#BW_videos {
+  clear : both;
+  border: 1px solid #E8E8E8;
+  padding-bottom: 140px;
+  margin-top: 10px;
+  max-width: 100%;
+  visibility: hidden;
+  visibility: visible\9;
+}
+
+#BW_videos:not(:empty) {
+  visibility: visible;
+}
+
+#BW_videos h2 {
+  background-color: #E8E8E8;
+  margin: 5px 10px;
+  padding: 0 5px;
+}
+#BW_videos .BW_bloc_vid {
+  clear: both;
+  padding: 0 15px;
+}
+.BW_vignette_vid {
+  border: 1px solid #DFD9CE;
+  float: left;
+  height: 141px;
+  margin: 5px;
+  min-height: 141px;
+  padding: 5px;
+  white-space: nowrap;
+}
+
+#BW_notes {clear :left;}
+#BW_notes h2 {font-size:85%;}
+
+#BW_citations {}
+#BW_citations h2 {font-size:85%;}
+
+#BW_critiques {}
+#BW_critiques h2 {font-size:85%;}
+
+#BW_critiques_pro {}
+#BW_critiques_pro h2 {font-size:85%;}
+
+#BW_citations,#BW_critiques,#BW_critiques_pro {
+  background: -moz-linear-gradient(center top , #3399FF, #3333FF) repeat scroll 0 0 transparent;
+  background: -webkit-gradient(linear, center top, center bottom, from(#3399FF), to(#3333FF));
+  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#3399FF', endColorstr='#3333FF');
+  border: 1px solid #B7B7B7;
+  border-radius: 5px 5px 5px 5px;
+  color: #FFFFCC;
+  display: inline-block;
+  float: left;
+  font-weight: bold;
+  margin: 15px 20px 15px 0;
+  min-width: 150px;
+  padding: 0 15px 8px;
+  position: relative;
+  text-align: center;
+  text-shadow: 1px 1px 1px #777777;
+  white-space: nowrap;
+}
+
+#BW_citations a,#BW_critiques a,#BW_critiques_pro a {
+  color: #FFFFCC;
+}
index 1e5b0c6..021238d 100644 (file)
@@ -434,6 +434,13 @@ a .term {
   background-repeat: no-repeat;
 }
 
+#action a.highlight_toggle {
+    background-image: url("../../images/sprite.png"); /* place hold icon */
+    background-position: -5px -841px;
+    background-repeat: no-repeat;
+    display: none;
+}
+
 #action a#furthersearches {
     background-image: url("../../images/sprite.png");
     background-position: 106px -295px;
@@ -1797,16 +1804,6 @@ div#menu li.active a:hover {
        padding : 2px;
 }
 
-#amazonreviews h4 {
-       font-size : 90%;
-       margin : 0;
-       padding : 0;
-}
-#amazonreviews h3 {
-       font-size : 100%;
-       margin : 0;
-       padding : 0;
-}
 span.starFull {
        background: url(../../images/star-ratings.gif) top left no-repeat;
        display : block;
@@ -2594,9 +2591,20 @@ ul.ui-tabs-nav li {
 }
 
 .authref .label {
- font-style: italic;
+    font-style: italic;
+}
+
+.authstanza {
+    margin-top: 1em;
 }
 
+.authstanzaheading {
+    font-weight: bold;
+}
+
+.authstanza li {
+    margin-left: 0.5em;
+}
 
 /* jQuery UI Datepicker */
 .ui-datepicker-trigger {
@@ -2609,152 +2617,3 @@ ul.ui-tabs-nav li {
     box-shadow: 1px 1px 3px 0 #666;
 }
 
-/* ## BABELTHEQUE ## */
-/* Uncomment if babeltheque configuration no contains these lines */
-/*
-#BW_etiquettes {
-  clear :left;
-  border: 1px solid #E8E8E8;
-  margin-top: 10px;
-  width: 49%;
-  float: left;
-  visibility: hidden;
-  visibility: visible\9;
-}
-#BW_etiquettes:not(:empty) {
-  visibility: visible;
-}
-
-#BW_etiquettes h2 {
-  clear:left;
-  background-color: #E8E8E8;
-  margin: 5px 10px;
-  padding: 0 5px;
-}
-
-#BW_ulEti {max-width:100%;}
-
-#BW_ulEti ul  {
-  margin:0;
-  padding:0 15px;
-  list-style-type: none;
-}
-
-#BW_ulEti a {
-  text-decoration: none;
-}
-
-#BW_ulEti a.tag_s0  {font-weight: 120;font-size:0.8em;}
-#BW_ulEti a.tag_s1  {font-weight: 150;font-size:0.9em;}
-#BW_ulEti a.tag_s2  {font-weight: 180;font-size:1.0em;}
-#BW_ulEti a.tag_s3  {font-weight: 200;font-size:1.2em;}
-#BW_ulEti a.tag_s4  {font-weight: 220;font-size:1.4em;}
-#BW_ulEti a.tag_s5  {font-weight: 230;font-size:1.5em;}
-#BW_ulEti a.tag_s6  {font-weight: 320;font-size:1.6em;}
-#BW_ulEti a.tag_s7  {font-weight: 350;font-size:1.7em;}
-#BW_ulEti a.tag_s8  {font-weight: 400;font-size:1.8em;}
-#BW_ulEti { padding: 0px; line-height: 2em; text-align: center;}
-#BW_ulEti a { padding: 2px; }
-#BW_ulEti { margin: 0px; }
-
-#BW_ulEti ol {
-  float:left;
-  display: inline;
-  margin: 0 10px;
-}
-
-#BW_suggestions {
-  border: 1px solid #E8E8E8;
-  margin-top: 10px;
-  float: right;
-  width: 49%;
-  visibility: hidden;
-  visibility: visible\9;
-}
-#BW_suggestions:not(:empty) {
-  visibility: visible;
-}
-#BW_suggestions h2 {
-  background-color: #E8E8E8;
-  margin: 5px 10px;
-  padding: 0 5px;
-}
-#BW_suggestions .BW_livres_tag_page {
-  padding: 0 15px;
-}
-#BW_suggestions .BW_livres_tag_page:before {
-  content : '> ';
-}
-#BW_droite .BW_livres_tag:before {
-  content : '> ';
-}
-
-#BW_videos {
-  clear : both;
-  border: 1px solid #E8E8E8;
-  padding-bottom: 140px;
-  margin-top: 10px;
-  max-width: 100%;
-  visibility: hidden;
-  visibility: visible\9;
-}
-
-#BW_videos:not(:empty) {
-  visibility: visible;
-}
-
-#BW_videos h2 {
-  background-color: #E8E8E8;
-  margin: 5px 10px;
-  padding: 0 5px;
-}
-#BW_videos .BW_bloc_vid {
-  clear: both;
-  padding: 0 15px;
-}
-.BW_vignette_vid {
-  border: 1px solid #DFD9CE;
-  float: left;
-  height: 141px;
-  margin: 5px;
-  min-height: 141px;
-  padding: 5px;
-  white-space: nowrap;
-}
-
-#BW_notes {clear :left;}
-#BW_notes h2 {font-size:85%;}
-
-#BW_citations {}
-#BW_citations h2 {font-size:85%;}
-
-#BW_critiques {}
-#BW_critiques h2 {font-size:85%;}
-
-#BW_critiques_pro {}
-#BW_critiques_pro h2 {font-size:85%;}
-
-#BW_citations,#BW_critiques,#BW_critiques_pro {
-  background: -moz-linear-gradient(center top , #3399FF, #3333FF) repeat scroll 0 0 transparent;
-  background: -webkit-gradient(linear, center top, center bottom, from(#3399FF), to(#3333FF));
-  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#3399FF', endColorstr='#3333FF');
-  border: 1px solid #B7B7B7;
-  border-radius: 5px 5px 5px 5px;
-  color: #FFFFCC;
-  display: inline-block;
-  float: left;
-  font-weight: bold;
-  margin: 15px 20px 15px 0;
-  min-width: 150px;
-  padding: 0 15px 8px;
-  position: relative;
-  text-align: center;
-  text-shadow: 1px 1px 1px #777777;
-  white-space: nowrap;
-}
-
-#BW_citations a,#BW_critiques a,#BW_critiques_pro a {
-  color: #FFFFCC;
-}
-
-*/
index 92314b1..3defe48 100644 (file)
@@ -30,7 +30,7 @@
     [% IF ( summary.summary ) %][% summary.summary %]:[% END %]
     [% UNLESS ( summary.summaryonly ) %]
         [% FOREACH authorize IN summary.authorized %]
-            <span class="authorizedheading">[% authorize %]</span>
+            <span class="authorizedheading">[% authorize.heading %]</span>
         [% END %]
         [% IF ( marcflavour == 'UNIMARC' ) %]
             [% FOREACH note IN summary.notes %]
index 8634cfd..3ce49ce 100644 (file)
@@ -3,13 +3,18 @@
 <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" />
-[% IF ( opacstylesheet ) %]<link rel="stylesheet" type="text/css" href="[% opacstylesheet %]" />[% ELSE %]
-[% IF ( opaclayoutstylesheet ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaclayoutstylesheet %]" />[% ELSE %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/opac.css" />[% END %][% END %]
-[% IF ( opaccolorstylesheet ) %]
-    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaccolorstylesheet %]" />
+[% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %]
+[% IF (opaclayoutstylesheet.match('^https?:|^\/')) %]
+    <link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet %]" />
+[% ELSE %]
+    <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaclayoutstylesheet %]" />
 [% END %]
-[% IF ( opacexternalsheet ) %]
-    <link rel="stylesheet" type="text/css" href="[% opacexternalsheet %]" />
+[% IF ( opaccolorstylesheet ) %]
+    [% IF (opaccolorstylesheet.match('^https?:|^\/')) %]
+        <link rel="stylesheet" type="text/css" href="[% opaccolorstylesheet %]" />
+    [% ELSE %]
+        <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaccolorstylesheet %]" />
+    [% END %]
 [% END %]
 [% IF ( opac_css_override ) %]
     <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opac_css_override %]" />
index 822cb6e..3f661ad 100644 (file)
 </div>
 <div id="breadcrumbs" class="yui-g">
 [% IF ( searchdesc ) %]<p>[% IF ( total ) %]<strong>Your search returned [% total |html %] results.</strong> [% IF ( related ) %] (related searches: [% FOREACH relate IN related %][% relate.related_search %][% END %]). [% END %]
-<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2"><img src="/opac-tmpl/prog/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" /></a>
+<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;count=[% countrss |html %]&amp;sort_by=acqdate_dsc&amp;format=rss2" class="rsssearchlink"><img src="/opac-tmpl/prog/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
 [% ELSE %]
 <strong>No results found!</strong>
 <p>
     [% IF ( searchdesc ) %]
-    No results found for that in [% LibraryName %] catalog. <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss2"><img src="/opac-tmpl/prog/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" /></a>
+    No results found for that in [% LibraryName %] catalog. <a href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;format=rss2" class="rsssearchlink"><img src="/opac-tmpl/prog/images/feed-icon-16x16.png" alt="Subscribe to this search" title="Subscribe to this search" border="0" class="rsssearchicon"/></a>
     [% ELSE %]
     You did not specify any search criteria.
     [% END %]
index 85d44d7..0f16f3a 100644 (file)
             <li><a class="addtocart cart[% biblionumber %]" href="#" onclick="addRecord('[% biblionumber %]'); return false;">Add to your cart</a>  <a style="display:none;" class="cartRemove cartR[% biblionumber %]" href="#" onclick="delSingleRecord('[% biblionumber %]'); return false;">(remove)</a></li>
         [% END %]
     [% END %]
+    [% IF ( OpacHighlightedWords && query_desc ) %]
+    <li>
+        <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
+        <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
+    </li>
+    [% END %]
     <li style="display:none;"><a href="#" id="furthersearches">More searches</a></li>
 </ul>
 
index 8e87d71..3863fad 100644 (file)
@@ -35,6 +35,8 @@ function showChildren(mynumber) {
        <div class="yui-b"><div class="yui-g">
 <div id="userauthdetails" class="container">
 
+    <div id="views"><span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid %]">Normal view</a></span> <span class="view"><span id="MARCview">MARC view</span></span></div>
+
 [% IF ( displayhierarchy ) %]
 
 <div class="hierarchies">
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt
new file mode 100644 (file)
index 0000000..2f438be
--- /dev/null
@@ -0,0 +1,173 @@
+[% BLOCK authtypelabel %]
+    [% UNLESS ( type=='seefrom' || type=='seealso' || type=='' ) %]
+        <span class="type">[% FILTER trim %][% SWITCH type %]
+        [% CASE 'earlier' %]Earlier heading
+        [% CASE 'later' %]Later heading
+        [% CASE 'acronym' %]Acronym
+        [% CASE 'musical' %]Musical composition
+        [% CASE 'broader' %]Broader heading
+        [% CASE 'narrower' %]Narrower heading
+        [% CASE %][% type %]
+        [% END %][% END %]</span>
+    [% END %]
+[% END %]
+[% BLOCK otherscript %]
+    [% FOREACH heading IN headings %]
+        [% IF heading.category == wantcategory %]
+            [% IF heading.direction == 'ltr' %]
+                <div class="heading otherscript [% heading.category %]">
+                <span class="[% heading.category %]">[% heading.term %]</span>
+                </div>
+            [% ELSIF heading.direction == 'rtl' %]
+                <div class="heading otherscript [% heading.category %] rtl">
+                <span class="[% heading.category %]">[% heading.term %]</span>
+                </div>
+            [% END %]
+        [% END %]
+    [% END %]
+[% 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>
+    [% ELSE %][% heading %]
+    [% END %]
+[% END %]
+[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo;  Entry
+[% INCLUDE 'doc-head-close.inc' %]
+[% IF ( displayhierarchy ) %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css">
+[% END %]
+<script language="JavaScript" type="text/javascript">
+$(document).ready(function() {
+    $('#authdescriptions').tabs();
+});
+
+[% IF ( displayhierarchy ) %]
+function showParents(mynumber) {
+  var parents=document.getElementsByName(mynumber+'p')
+  for(i=0;i<parents.length;i++){
+    if (parents[i].style.display == "none") {
+      parents[i].style.display ="block";
+    } else {
+      parents[i].style.display ="none";
+    }
+  }
+}
+function showChildren(mynumber) {
+  var children=document.getElementsByName(mynumber+'c')
+  for(i=0;i<children.length;i++){
+    if (children[i].style.display == "none") {
+      children[i].style.display = "block";
+    } else {
+      children[i].style.display = "none";
+    }
+  }
+}
+[% END %]
+</script>
+</head>
+<body id="opac-authoritiesdetail">
+
+<div id="doc3" class="yui-t1">
+   <div id="bd">
+[% INCLUDE 'masthead.inc' %]
+    <div id="yui-main">
+    <div class="yui-b"><div class="yui-g">
+
+    <div id="views"><span class="view"><span id="Normalview">Normal view</span></span> <span class="view"><a id="MARCview" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% authid %]&marc=1">MARC view</a></span></div>
+
+<div id="userauthdetails" class="container">
+
+[% IF ( displayhierarchy ) %]
+
+<div class="hierarchies">
+[% FOREACH loophierarchie IN loophierarchies %]
+  <div class="hierarchy">
+  [% FOREACH loopelemen IN loophierarchie.loopelement %]
+    <div id="[% loopelemen.loopauthid %]" class="[% loopelemen.class %]">
+    [% IF ( loopelemen.current_value ) %]
+        [% loopelemen.value %]
+    [% ELSE %]
+        <a href="opac-authoritiesdetail.pl?authid=[% loopelemen.loopauthid %]" title="Term">[% loopelemen.value %]</a>
+    [% END %]
+    [% IF ( loopelemen.ifchildren ) %]
+      <sub><a class="parents" title="Narrower terms" href="JavaScript:showChildren('[% loopelemen.loopauthid %]');">+</a></sub><br/>
+      [% FOREACH loopchildre IN loopelemen.loopchildren %]
+        <div name="[% loopchildre.loopauthid %]c" class="child"> <a href="opac-authoritiesdetail.pl?authid=[% loopchildre.childauthid %]">[% loopchildre.childvalue %]</a></div>
+      [% END %]
+    [% END %]
+    </div>
+  [% END %]
+
+  </div>
+[% END %]
+</div>
+[% END %]
+<h1>[% summary.mainentry %][% IF authtypetext %]([% authtypetext %])[% END %]</h1>
+<div class="usedin">Used in <a href="opac-search.pl?type=opac&amp;q=[% authid %]&amp;idx=an,phr">[% count %] records</a></div>
+<div class="authstanza">
+[% FOREACH authorize IN summary.authorized %]
+<div class="heading authorized auth[% seefro.field %]"><span class="label">Preferred form: </span><span class="authorized">[% authorize.heading %]</span></div>
+[% END %]
+[% PROCESS otherscript headings=summary.otherscript wantcategory='preferred' %]
+</div>
+[% IF summary.seefrom.size %]
+    <div class="authstanza seefrom">
+    <div class="authstanzaheading">Used for/see from:</div>
+    <ul class="seefrom">
+    [% FOREACH seefro IN summary.seefrom %]
+        <li class="heading seefrom auth[% seefro.field %]">
+        [% IF seefro.type && seefro.type != 'seefrom' %]<span class="label">[% PROCESS authtypelabel type=seefro.type | trim %]:</span>[% END %]
+        <span class="seefrom">[% PROCESS authheadingdisplay heading=seefro.heading search=seefrosearch authid=seefro.authid %]</span>
+        </li>
+    [% END %]
+    [% PROCESS otherscript headings=summary.otherscript wantcategory='seefrom' %]
+    </div>
+[% END %]
+[% IF summary.seealso.size %]
+    <div class="authstanza seealso">
+    <div class="authstanzaheading">See also:</div>
+    <ul class="seelso">
+    [% FOREACH seeals IN summary.seealso %]
+        <li class="heading seealso auth[% seeals.field %]">[% IF seeals.type && seeals.type != 'seealso' %]<span class="label">[% PROCESS authtypelabel type=seeals.type | trim %]:</span>[% END %]
+        <span class="seealso">[% PROCESS authheadingdisplay heading=seeals.heading search=seeals.search authid=seeals.authid %]</span>
+        </li>
+    [% END %]
+    [% PROCESS otherscript headings=summary.otherscript wantcategory='seealso' %]
+    </div>
+[% END %]
+[% IF marcflavour == 'UNIMARC' && summary.otherscript %]
+    <div class="authstanza">
+    [% FOREACH otherscrip IN summary.otherscript %]
+        <div class="heading otherscript auth[% otherscrip.field %]"><span class="label">See also[% PROCESS language lang=otherscript.lang | trim %] term:</span>
+        <span class="otherscript">[% otherscrip.term %]</span>
+        </div>
+    [% END %]
+    </div>
+[% END %]
+<div id="authdescriptions" class="toptabs">
+<ul>
+    <li id="tab_descriptions" class="ui-tabs-selected"><a href="#descriptions">Notes</a></li>
+</ul>
+<div id="descriptions">
+<div class="content_set">
+[% FOREACH note IN summary.notes %]
+<p class="note auth[% note.field %]">[% note.note %]</p>
+[% END %]
+</div>
+</div>
+</div>
+</div>
+</div>
+
+</div>
+</div>
+</div>
+[% IF ( OpacNav ) %]
+<div class="yui-b">
+<div id="leftmenus" class="container">
+[% INCLUDE 'navigation.inc' %]
+</div>
+</div>[% END %]
+</div>
+[% INCLUDE 'opac-bottom.inc' %]
index 5e2b55e..99a21b3 100644 (file)
@@ -12,6 +12,7 @@
 [% IF ( OpacStarRatings != 'disable' ) %]<script type="text/javascript" src="/opac-tmpl/prog/en/lib/jquery/plugins/jquery.rating.js"></script>
 <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[
 
         [% END %]
     [% END %]
 
+    [% IF ( OpacHighlightedWords ) %]
+        var q_array = new Array();  // holds search terms if available
+
+        function highlightOff() {
+            $("#catalogue_detail_biblio").removeHighlight();
+            $(".highlight_toggle").toggle();
+        }
+        function highlightOn() {
+            var x;
+            for (x in q_array) {
+                $(".title").highlight(q_array[x]);
+                $(".author").highlight(q_array[x]);
+                $(".results_summary").highlight(q_array[x]);
+            }
+            $(".highlight_toggle").toggle();
+        }
+    [% END %]
 
      $(document).ready(function() { 
         $('#bibliodescriptions').tabs();
             widgets : ['zebra'],
             sortList: [[0,0]]
         });
+        [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
+            q_array = query_desc.split(" ");
+            highlightOn();
+            $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ; return false;});
+            $("#highlight_toggle_off").show().click(function() {highlightOff(); return false;});[% END %][% END %]
        [% IF ( GoogleJackets ) %]
         KOHA.Google.GetCoverFromIsbn([% covernewwindow %]);
        [% END %]
@@ -112,7 +135,7 @@ $(function () {
             borrowernumber: "[% borrowernumber %]",
             biblionumber: "[% biblionumber %]",
             rating_value: value,
-            auth_error: value,
+            auth_error: value
           }, function (data) {
 
             if (data.auth_status != 'ok') {
@@ -296,7 +319,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
     <div id="bookcover">
     [% IF ( OPACLocalCoverImages ) %]<div style="block" title="[% biblionumber |url %]" class="[% biblionumber %]" id="local-thumbnail-preview"></div>[% END %]
-    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% END %][% END %][% END %]
+    [% IF ( OPACAmazonCoverImages ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link" target="_blank"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/reader/[% normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% normalized_isbn %].01.MZZZZZZZ.jpg" alt="Cover image" /></a>[% END %][% END %]
 
     [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( content_identifier_exists ) %][% IF ( using_https ) %]
     <img src="https://secure.syndetics.com/index.aspx?isbn=[% normalized_isbn %]/[% SyndeticsCoverImageSize %].GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% normalized_upc %]&amp;oclc=[% normalized_oclc %]" alt="" class="thumbnail" />
@@ -654,17 +677,10 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
     [% END %]
 [% END %]
 
-[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonSimilarItems ) %][% IF ( AMAZON_SIMILAR_PRODUCTS ) %]
-    <li id="tab_related"><a href="#similars">Related</a></li>
-[% END %][% END %][% END %]
-
 [% IF ( OPACFRBRizeEditions ) %][% IF ( XISBNS ) %]
     <li id="tab_editions"><a href="#editions">Editions</a></li>
 [% END %][% END %]
 
-[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonReviews ) %]
-    <li id="tab_amazonreviews"><a href="#amazonreviews">Amazon reviews</a></li>
-[% END %][% END %]
 [% IF ( Babeltheque ) %]
     <li id="tab_babeltheque"><a href="#babeltheque">Babelthèque</a></li>
 [% END %]
@@ -798,7 +814,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         <td rowspan="2" style="width:20px;"><a style="height: 10em;" 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"><img src="/opac-tmpl/prog/images/browse-prev.gif" alt="Previous" border="0" /></a></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 ( OPACAmazonEnabled ) %][% 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 %][% END %]
+    [% 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="" />
@@ -814,8 +830,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 [% 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 ( OPACAmazonEnabled ) %][% 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 %][% END %]
+    [% 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 ) %]
@@ -851,16 +867,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 
 <div id="descriptions">
 <div class="content_set">
-[% IF ( OPACAmazonEnabled ) %]
-[% IF ( OPACAmazonReviews ) %]
-[% FOREACH AMAZON_EDITORIAL_REVIEW IN AMAZON_EDITORIAL_REVIEWS %]
-    [% IF ( AMAZON_EDITORIAL_REVIEW.Content ) %]
-    <h4>From [% AMAZON_EDITORIAL_REVIEW.Source %]:</h4>
-    <div>[% AMAZON_EDITORIAL_REVIEW.Content %]</div>
-    [% END %]
-[% END %]
-[% END %]
-[% END %]
+
 [% IF ( SyndeticsEnabled ) %]
 [% IF ( SyndeticsSummary ) %]
 [% IF ( SYNDETICS_SUMMARY ) %]
@@ -1100,7 +1107,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 [% FOREACH XISBN IN XISBNS %]
 <tr>
 <td>
-[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %]<img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% END %][% END %]
+[% IF ( OPACAmazonCoverImages ) %]<img src="http://images.amazon.com/images/P/[% XISBN.normalized_isbn %].01._AA75_PU_PU-5_.jpg" alt="" />[% END %]
 
 [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( XISBN.content_identifier_exists ) %]
 [% IF ( using_https ) %]
@@ -1119,52 +1126,6 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
 </table>
 </div>[% END %][% END %]
 
-[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonSimilarItems ) %][% IF ( AMAZON_SIMILAR_PRODUCTS ) %]
-<!-- Amazon Similar items -->
-<div id="similars">
-<h4>Related Titles</h4>
-<table><tr>
-[% FOREACH AMAZON_SIMILAR_PRODUCT IN AMAZON_SIMILAR_PRODUCTS %]
-[% FOREACH similar_biblionumber IN AMAZON_SIMILAR_PRODUCT.similar_biblionumbers %]
-<td>[% IF ( OPACAmazonCoverImages ) %]<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]"><img alt="" src="http://images.amazon.com/images/P/[% similar_biblionumber.ASIN %].01._SS50_.jpg" />[% END %]
-    [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( similar_biblionumber.content_identifier_exists ) %]
-    [% IF ( using_https ) %]
-    <img border="0" src="https://secure.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&amp;upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&amp;oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />
-    [% ELSE %]<img border="0" src="http://www.syndetics.com/index.aspx?isbn=[% similar_biblionumber.browser_normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %][% IF ( similar_biblionumber.browser_normalized_upc ) %]&amp;upc=[% similar_biblionumber.browser_normalized_upc %][% END %][% IF ( similar_biblionumber.browser_normalized_oclc ) %]&amp;oclc=[% similar_biblionumber.browser_normalized_oclc %][% END %]&amp;type=xw10" alt="" />[% END %]
-    [% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
-<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% similar_biblionumber.biblionumber %]">[% similar_biblionumber.title |html %]</a> </td>
-[% END %]
-[% END %]
-</tr></table>
-</div>[% END %]
-[% END %][% END %]
-
-[% IF ( OPACAmazonEnabled ) %]
-[% IF ( OPACAmazonReviews ) %]
-<!-- Amazon Reviews -->
-<div id="amazonreviews">
-        [% IF ( amazon_average_rating ) %]
-            <div class="clearfix"><h3 style="float: left;">Average rating (from Amazon[% AmazonTld %]): </h3><span class="starMT" style="float: left;"><span class="starFull" style="float: left; width:[% amazon_average_rating / 2 %]px"></span></span> [% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books" target="_blank">Add your own review</a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books">Add your own review</a>[% END %][% END %]</div>
-
-        [% FOREACH AMAZON_CUSTOMER_REVIEW IN AMAZON_CUSTOMER_REVIEWS %]
-            <div class="content_set">
-            <div class="clearfix" style="margin: .5em 0;"><h4 style="float: left;">[% AMAZON_CUSTOMER_REVIEW.Summary |html %]</h4>  <span class="starMT" style="float: left;"><span class="starFull" style="float: left; width:[% Rating * 10 %]px"></span></span> </div>  [% AMAZON_CUSTOMER_REVIEW.Date | $KohaDates %]
-            [% IF ( AMAZON_CUSTOMER_REVIEW.Content ) %]
-                <p style="margin-left: .2em;">[% AMAZON_CUSTOMER_REVIEW.Content |html %]</p>
-            [% END %]
-            </div>
-        [% END %]
-        [% ELSE %]
-
-    <p> Sorry, there are no reviews from this library available for this title. [% IF ( normalized_isbn ) %][% IF ( OPACurlOpenInNewWindow ) %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books" target="_blank">Add your own review</a>[% ELSE %]<a href="http://www.amazon[% AmazonTld %]/gp/customer-reviews/write-a-review.html/002-2970817-7876066?%5Fencoding=UTF8&amp;asin=[% normalized_isbn %]&amp;store=books">Add your own review</a>[% END %][% END %]</p>
-
-        [% END %]
-</div>
-<!-- /Amazon Reviews -->
-[% END %]
-[% END %]
-
-
 [% IF ( OPACLocalCoverImages ) %]
 <div id="images">
 <p>Click on an image to view it in the image viewer</p>
@@ -1246,7 +1207,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
         <a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on LinkedIn"><img alt="Share on LinkedIn" src="/opac-tmpl/prog/images/socnet/linkedin16.png" /></a>
         <a href="http://www.delicious.com/save?url=[% current_url |url %]&amp;title=[% title |url %]" title="Share on Delicious"><img alt="Share on Delicious" src="/opac-tmpl/prog/images/socnet/delicious16.gif" /></a>
         <g:plusone size="small"></g:plusone>
-        <a href="mailto:ADRESSE?subject=TO READ : [% title %]>&amp;body=[% title %]> [% current_url |url %]" title="Share by email"><img alt="Share by email" src="/opac-tmpl/prog/images/socnet/mailto16.png" /></a>
+        <a href="mailto:?subject=[% title %]&amp;body=[% title %] ([% current_url |url %])" title="Share by email"><img alt="Share by email" src="/opac-tmpl/prog/images/socnet/mailto16.png" /></a>
     </div>
 [% END %]
 
index 14a5f3e..e761402 100644 (file)
@@ -36,7 +36,7 @@
        <dc:identifier>ISBN [% SEARCH_RESULT.isbn |html %]</dc:identifier>
        <link>[% IF ( SEARCH_RESULT.BiblioDefaultViewmarc ) %][% OPACBaseURL %]/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% IF ( SEARCH_RESULT.BiblioDefaultViewisbd ) %][% OPACBaseURL %]/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% ELSE %][% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %][% END %][% END %]</link>
        <description><![CDATA[
-[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %]
+[% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %]
 [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( SEARCH_RESULT.content_identifier_exists ) %]<img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SEARCH_RESULT.SyndeticsClientCode %]&amp;type=xw10[% IF ( SEARCH_RESULT.normalized_upc ) %]&amp;upc=[% SEARCH_RESULT.normalized_upc %][% END %][% IF ( SEARCH_RESULT.normalized_oclc ) %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %][% END %]" alt="" />
 [% ELSE %]
 <img src="http://www.syndetics.com/index.aspx?isbn=[% SEARCH_RESULT.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% SEARCH_RESULT.normalized_upc %]&amp;oclc=[% SEARCH_RESULT.normalized_oclc %]" alt="" />
index 8786925..57d1a9e 100644 (file)
@@ -59,13 +59,16 @@ You have never borrowed anything from this library.
 <th>Item type</th>
 <th>Call no.</th>
 <th>Date</th>
+[% IF ( OPACMySummaryHTML ) %]
+<th>Links</th>
+[% END %]
 </tr>
 
 [% FOREACH READING_RECOR IN READING_RECORD %]
 
 [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
 <td>
-[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="http://www.amazon.com/gp/reader/[% READING_RECOR.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% READING_RECOR.normalized_isbn %].01.THUMBZZZ.jpg" alt="Cover Image" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
+[% IF ( OPACAmazonCoverImages ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="http://www.amazon.com/gp/reader/[% READING_RECOR.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% READING_RECOR.normalized_isbn %].01.THUMBZZZ.jpg" alt="Cover Image" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
 
     [% IF ( GoogleJackets ) %][% IF ( READING_RECOR.normalized_isbn ) %]<div style="block" title="[% READING_RECOR.biblionumber |url %]" class="[% READING_RECOR.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
 
@@ -85,6 +88,9 @@ You have never borrowed anything from this library.
 <td>[% UNLESS ( noItemTypeImages ) %][% IF ( READING_RECOR.imageurl ) %]<img src="[% READING_RECOR.imageurl %]" alt="" />[% END %][% END %] [% READING_RECOR.description %]</td>
 <td>[% READING_RECOR.itemcallnumber %]</td>
 <td>[% IF ( READING_RECOR.returndate ) %][% READING_RECOR.returndate | $KohaDates %][% ELSE %]<em>(Checked out)</em>[% END %]</td>
+[% IF ( OPACMySummaryHTML ) %]
+<td>[% READING_RECOR.MySummaryHTML %]</td>
+[% END %]
 </tr>
 
 [% END %]
index 99c31bd..86e1a08 100644 (file)
@@ -15,6 +15,12 @@ href="/cgi-bin/koha/opac-rss.pl?[% query_cgi %][% limit_cgi |html %]" />
 var q_array = new Array();  // will hold the search terms, if possible
 
 $(document).ready(function(){
+    [% IF ( OpacHighlightedWords ) %]
+        $('a.title').each(function() {
+            $(this).attr('href', $(this).attr('href') + '&query_desc=[% query_desc | url %]');
+        });
+    [% END %]
+
        $('#sortsubmit').hide();
     $('#sort_by').change(function() {
         $('#bookbag_form').submit();
@@ -58,6 +64,11 @@ $(document).ready(function(){
     [% IF ( query_desc ) %]
     var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
     q_array = query_desc.split(" ");
+    // ensure that we don't have "" at the end of the array, which can
+    // break the highlighter
+    while (q_array.length > 0 && q_array[q_array.length-1] == "") {
+        q_array = q_array.splice(0,-1);
+    }
     highlightOn();
     $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
     $("#highlight_toggle_off").show().click(function() {highlightOff();});
@@ -198,7 +209,7 @@ function highlightOn() {
             [% ELSE %]
                 <tr>
             [% END %]
-                    <td>[% IF ( OPACAmazonEnabled ) %]
+                    <td>[% IF ( OPACAmazonCoverImages ) %]
                         <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% GROUP_RESULT.biblionumber |url %]">[% IF ( GROUP_RESULT.isbn ) %]<img src="http://images.amazon.com/images/P/[% GROUP_RESULT.isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<img src="http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif" alt="" class="thumbnail" />[% END %]
                         </a>
                         [% ELSE %]
index 67b1686..6191342 100644 (file)
@@ -97,6 +97,12 @@ function highlightOn() {
 }
 [% END %]
 $(document).ready(function(){
+    [% IF ( OpacHighlightedWords ) %]
+        $('a.title').each(function() {
+            $(this).attr('href', $(this).attr('href') + '&query_desc=[% query_desc | url %]');
+        });
+    [% END %]
+
     [% IF ( opacbookbag ) %]$(".addtocart").show();[% END %]
 
 [% IF ( opacbookbag ) %]
@@ -203,6 +209,11 @@ $(document).ready(function(){
 
 [% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
         q_array = query_desc.split(" ");
+        // ensure that we don't have "" at the end of the array, which can
+        // break the highlighter
+        while (q_array.length > 0 && q_array[q_array.length-1] == "") {
+            q_array = q_array.splice(0,-1);
+        }
         highlightOn();
         $("#highlight_toggle_on" ).hide().click(function() {highlightOn() ;});
         $("#highlight_toggle_off").show().click(function() {highlightOff();});[% END %][% END %]
@@ -603,7 +614,7 @@ $(document).ready(function(){
                 </td><td>
                     <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
             [% IF ( OPACLocalCoverImages ) %]<span title="[% SEARCH_RESULT.biblionumber |url %]" class="[% SEARCH_RESULT.biblionumber %]" id="local-thumbnail[% loop.count %]"></span>[% END %]
-                    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
+                    [% IF ( OPACAmazonCoverImages ) %][% IF ( SEARCH_RESULT.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% SEARCH_RESULT.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
 
                 [% IF ( SyndeticsEnabled ) %]
                     [% IF ( SyndeticsCoverImages ) %]
index 92bdc87..6e2b974 100644 (file)
@@ -51,7 +51,7 @@
 <div id="userreview" class="container">
 [% IF ( cgi_debug ) %]<div class="debug">CGI debug is on.</div>[% END %]
 [% IF ( ERRORS ) %]
-       <div class="error">
+    <div class="dialog alert">
        [% FOREACH ERROR IN ERRORS %]
                <p>
                [% IF ( ERROR.scrubbed ) %]Note: your comment contained illegal markup code.
index 1e7fbca..dc6929d 100644 (file)
@@ -3,90 +3,156 @@ Your cart
 <END_SUBJECT>
 
 [% USE HtmlToText %]
-[% myhtml FILTER html2text(leftmargin => 0, rightmargin => 50) %]
+[% myhtml FILTER html2text(leftmargin => 0, rightmargin => 0) %]
 [% myhtmltext | html2text %]
 
 <HEADER>
+
 [% FILTER html2text %]
-<p>Hi,
-</p>
-<p>[% firstname %] [% surname %] sent you a cart from our online catalog.</p>
+    <p>Hi,</p>
+
+    <p>[% firstname %] [% surname %] sent you a cart from our online catalog.</p>
 
-<p>Please note that the attached file is a MARC bibliographic records file
-which can be imported into personal bibliographic software like EndNote,
-Reference Manager or ProCite.</p>
+    <p>Please note that the attached file is a MARC bibliographic records file
+    which can be imported into personal bibliographic software like EndNote,
+    Reference Manager or ProCite.</p>
+    <hr/>
 [% END %]
 <END_HEADER>
 
 <MESSAGE>
 [% FILTER html2text %]
-<hr/>
 
-[% IF comment %]
-<p>[% comment %]</p>
-<hr/>
-[% END %]
+    [% IF comment %]
+        <p>[% comment %]</p>
+        <hr/>
+    [% END %]
+    <ol>
+    [% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
+        <li>
+            <span>
+                [% BIBLIO_RESULT.title %]
+                [% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
+            </span>
+
+            <p>
+            [% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
+            <span>Author(s): [% IF ( BIBLIO_RESULT.author ) %][% BIBLIO_RESULT.author %][% END %]
+
+            [% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
+                [% IF ( BIBLIO_RESULT.author ) %]; [% END %]
+                [% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
+                    [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
+                        [% MARCAUTHOR_SUBFIELDS_LOO.separator %][% MARCAUTHOR_SUBFIELDS_LOO.value %]
+                    [% END %]
+                    [% UNLESS ( loop.last ) %];[% END %]
+                [% END %]
+            [% END %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.ISBN ) %]
+            <span>
+                ISBN: [% BIBLIO_RESULT.ISBN %]
+            </span><br/>
+            [% END %]
+
+            [% IF BIBLIO_RESULT.publishercode %]
+            <span>
+                Published by: [% BIBLIO_RESULT.publishercode %]
+                [% IF ( BIBLIO_RESULT.publicationyear ) %]
+                    in [% BIBLIO_RESULT.publicationyear %]
+                [% END %]
+                [% IF ( BIBLIO_RESULT.pages ) %]
+                    , [% BIBLIO_RESULT.pages %]
+                [% END %]
+                [% IF BIBLIO_RESULT.size %]
+                , [% BIBLIO_RESULT.size %]
+                [% END %]
+            </span><br/>
+            [% END %]
+
+            [% IF BIBLIO_RESULT.collection %]
+            <span>
+                Collection: [% BIBLIO_RESULT.seriestitle %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.subject ) %]
+            <span>
+                Subject: [% BIBLIO_RESULT.subject %]
+            <span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.copyrightdate ) %]
+            <span>
+                Copyright year: [% BIBLIO_RESULT.copyrightdate %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.notes ) %]
+            <span>
+                Notes : [% BIBLIO_RESULT.notes %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.unititle ) %]
+            <span>
+                Unified title: [% BIBLIO_RESULT.unititle %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.serial ) %]
+            <span>
+                Serial: [% BIBLIO_RESULT.serial %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.dewey ) %]
+            <span>
+                Dewey: [% BIBLIO_RESULT.dewey %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.classification ) %]
+            <span>
+                Classification: [% BIBLIO_RESULT.classification %]
+            </span><br/>
+            [% END %]
+
+            [% IF ( BIBLIO_RESULT.lccn ) %]
+            <span>
+                LCCN: [% BIBLIO_RESULT.lccn %]
+            </span><br/>
+            [% END %]
+            [% IF ( BIBLIO_RESULT.url ) %]
+            <span>
+                URL: [% BIBLIO_RESULT.url |url %]
+            </span>
+            [% END %]
+            </p>
+
+            [% IF ( OPACBaseURL ) %]
+            <p>
+                In online catalog: [% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber %]
+            </p>
+            [% END %]
+            [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %]
+            <p>Items:
+            <ul>
+                [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]<li>
+                    [% ITEM_RESULT.branchname %]
+                    [% ITEM_RESULT.location %]
+                    [% IF ITEM_RESULT.itemcallnumber %]([% ITEM_RESULT.itemcallnumber %])[% END %]
+                    [% ITEM_RESULT.barcode %]
+                </li>[% END %]
+            </ul>
+            </p>
+            [% END %]
+            <hr/>
+        </li>
+    [% END %]
+    </ol>
 
-<ol>
-[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
-<li>
-<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber= [% BIBLIO_RESULT.biblionumber %]">[% BIBLIO_RESULT.title %]</a>
-[% IF ( BIBLIO_RESULT.subtitle ) %] [% BIBLIO_RESULT.subtitle %][% END %]
-<ul>
-[% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
-<li>Author(s): [% IF ( BIBLIO_RESULT.author ) %][% BIBLIO_RESULT.author %][% END %][% IF ( BIBLIO_RESULT.MARCAUTHORS ) %][% IF ( BIBLIO_RESULT.author ) %]; [% END %][% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %][% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %][% MARCAUTHOR_SUBFIELDS_LOO.value %][% END %][% UNLESS ( loop.last ) %]; [% ELSE %][% END %][% END %][% END %][% END %]</li>
-[% IF ( BIBLIO_RESULT.ISBN ) %]
-<li>ISBN: [% BIBLIO_RESULT.ISBN %]</li>
-[% END %]
-[% IF BIBLIO_RESULT.publishercode %]
-<li>
-Published by: [% BIBLIO_RESULT.publishercode %][% IF ( BIBLIO_RESULT.publicationyear ) %] in [% BIBLIO_RESULT.publicationyear %][% END %][% IF ( BIBLIO_RESULT.pages ) %], [% BIBLIO_RESULT.pages %][% END %][% IF BIBLIO_RESULT.size %], [% BIBLIO_RESULT.size %][% END %]
-</li>
-[% END %]
-[% IF BIBLIO_RESULT.collection %]
-<li>Collection: [% BIBLIO_RESULT.seriestitle %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.subject ) %]
-<li>Subject: [% BIBLIO_RESULT.subject %]<li>
-[% END %]
-[% IF ( BIBLIO_RESULT.copyrightdate ) %]
-<li>Copyright year: [% BIBLIO_RESULT.copyrightdate %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.notes ) %]
-<li>Notes : [% BIBLIO_RESULT.notes %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.unititle ) %]
-<li>Unified title: [% BIBLIO_RESULT.unititle %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.serial ) %]
-<li>Serial: [% BIBLIO_RESULT.serial %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.dewey ) %]
-<li>Dewey: [% BIBLIO_RESULT.dewey %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.classification ) %]
-<li>Classification: [% BIBLIO_RESULT.classification %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.lccn ) %]
-<li>LCCN: [% BIBLIO_RESULT.lccn %]</li>
-[% END %]
-[% IF ( BIBLIO_RESULT.url ) %]
-<li>URL : [% BIBLIO_RESULT.url %]</li>
-[% END %]
-<li>Items:
-<ul>
-[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
-<li>
-[% ITEM_RESULT.branchname %]
-[% ITEM_RESULT.location %]
-[% IF ITEM_RESULT.itemcallnumber %]([% ITEM_RESULT.itemcallnumber %])[% END %]
-[% ITEM_RESULT.barcode %]
-</li>
-[% END %]
-</ul>
-</ul>
-</li>
-[% END %]
-</ol>
 [% END %]
 <END_MESSAGE>
index 716f2e1..18f3da5 100644 (file)
@@ -408,7 +408,7 @@ $(function() {
                         </td>
           <td>
           <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% itemsloo.biblionumber %]">
-                    [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
+                    [% IF ( OPACAmazonCoverImages ) %][% IF ( itemsloo.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% itemsloo.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
 
           [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
                 <img src="https://secure.syndetics.com/index.aspx?isbn=[% itemsloo.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% itemsloo.normalized_upc %]&amp;oclc=[% itemsloo.normalized_oclc %]" alt="" class="thumbnail" />
index 54cc959..2159022 100644 (file)
@@ -13,7 +13,7 @@
        <title>New comment on [% review.title |html %] [% FOREACH subtitl IN review.subtitle %], [% subtitl.subfield |html %][% END %]</title>
        <link>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% review.biblionumber %]#comments</link>
        <description><![CDATA[
-[% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %][% END %]
+[% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" />[% END %][% END %]
 
 [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( review.content_identifier_exists ) %][% IF ( using_https ) %]<img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" />
 [% ELSE %]
index 9fcc532..5b22722 100644 (file)
@@ -80,7 +80,7 @@ $(document).ready(function(){
     [% END %]
 
 
-            [% IF ( OPACAmazonEnabled ) %][% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %][% END %]
+            [% IF ( OPACAmazonCoverImages ) %][% IF ( review.normalized_isbn ) %]<img src="http://images.amazon.com/images/P/[% review.normalized_isbn %].01.TZZZZZZZ.jpg" alt="" class="thumbnail" />[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
 
             [% IF ( SyndeticsEnabled ) %][% IF ( SyndeticsCoverImages ) %][% IF ( using_https ) %]
         <img src="https://secure.syndetics.com/index.aspx?isbn=[% review.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% review.normalized_upc %]&amp;oclc=[% review.normalized_oclc %]" alt="" class="thumbnail" />
index ff30035..b9ef41d 100644 (file)
@@ -120,7 +120,7 @@ function Dopop(link) {
                         [% END %]
                     </select></li>
                        <li>
-            <label for="timeLimit">of the the last:</label> <select name="timeLimit" id="timeLimit">
+            <label for="timeLimit">of the last:</label> <select name="timeLimit" id="timeLimit">
                 [% IF ( timeLimit == 3 ) %]<option value="3" selected="selected">3 months</option>[% ELSE %]<option value="3">3 months</option>[% END %]
                  [% IF ( timeLimit == 6 ) %]<option value="6" selected="selected">6 months</option>[% ELSE %]<option value="6">6 months</option>[% END %]
                  [% IF ( timeLimit == 12 ) %]<option value="12" selected="selected">12 months</option>[% ELSE %]<option value="12">12 months</option>[% END %]
index 33e3b48..26b5efc 100644 (file)
@@ -103,7 +103,7 @@ $.tablesorter.addParser({
             [% IF ( renewal_blocked_fines ) && ( OpacRenewalAllowed ) %]
                 <span id="renewal_blocked_fines"><li><strong>Please note: </strong> Since you have <a href="/cgi-bin/koha/opac-account.pl">more than <span id="renewal_blocked_fines_amount">[% renewal_blocked_fines %]</span></a> in fines, you cannot renew your books online. Please pay your fines if you wish to renew your books.</li></span>
             [% ELSIF ( renewal_blocked_fines ) %]
-        <span id="renewal_blocked_fines"><li><strong>Please note: </strong> You have <a href="/cgi-bin/koha/opac-account.pl">more than <span id="renewal_blocked_fines_amount">[% renewal_blocked_fines %]</span></a> in fines. </li></span>
+                <span id="renewal_blocked_fines"><li><strong>Please note: </strong> You currently owe <a href="/cgi-bin/koha/opac-account.pl"><span id="renewal_blocked_fines_amount">[% renewal_blocked_fines %] in fines.</span></a></li></span>
             [% END %]
         </ul></div>
         [% END %]
index b6db8b4..5daff77 100644 (file)
@@ -21,7 +21,6 @@
     <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
     <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
     <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
-    <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/>
     
     <xsl:variable name="SubjectModifier"><xsl:if test="marc:sysprefs/marc:syspref[@name='TraceCompleteSubfields']='1'">,complete-subfield</xsl:if></xsl:variable>
     <xsl:variable name="UseAuthoritiesForTracings" select="marc:sysprefs/marc:syspref[@name='UseAuthoritiesForTracings']"/>
index c39ca39..8a7d511 100644 (file)
                             </xsl:if>
                         </xsl:for-each>
                     </xsl:variable>
-                    <xsl:choose>
-                        <xsl:when test="boolean($bibno)">
-                            <a>
-                                <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of  select="$bibno"/></xsl:attribute>
-                                <xsl:value-of select="$str"/>
-                            </a>
-                        </xsl:when>
-                       <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
-                            <a>
-                                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of  select="marc:subfield[@code=9]"/></xsl:attribute>
-                                  <xsl:value-of select="$str"/>
-                            </a>
-                        </xsl:when>
-                        <xsl:when test="boolean($index)">
-                            <a>
-                                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of  select="$index"/>:<xsl:value-of  select="marc:subfield[@code='a']"/></xsl:attribute>
+                    <xsl:if test="string-length($str) &gt; 0">
+                        <xsl:choose>
+                            <xsl:when test="boolean($bibno)">
+                                <a>
+                                    <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of  select="$bibno"/></xsl:attribute>
+                                    <xsl:value-of select="$str"/>
+                                </a>
+                            </xsl:when>
+                           <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
+                                <a>
+                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of  select="marc:subfield[@code=9]"/></xsl:attribute>
+                                    <xsl:value-of select="$str"/>
+                                </a>
+                            </xsl:when>
+                            <xsl:when test="boolean($index)">
+                                <a>
+                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of  select="$index"/>:<xsl:value-of  select="marc:subfield[@code='a']"/></xsl:attribute>
+                                    <xsl:value-of select="$str"/>
+                                </a>
+                            </xsl:when>
+                            <xsl:otherwise>
                                 <xsl:value-of select="$str"/>
-                            </a>
-                        </xsl:when>
-                        <xsl:otherwise>
-                            <xsl:value-of select="$str"/>
-                        </xsl:otherwise>
-                    </xsl:choose>
+                            </xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:if>
                 </span>
             </xsl:if>
         </xsl:for-each>
index 91a0437..13cff4f 100644 (file)
                             </xsl:if>
                         </xsl:for-each>
                     </xsl:variable>
-                    <xsl:choose>
-                        <xsl:when test="boolean($bibno)">
-                            <a>
-                                <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of  select="$bibno"/></xsl:attribute>
+                    <xsl:if test="string-length($str) &gt; 0">
+                        <xsl:choose>
+                            <xsl:when test="boolean($bibno)">
+                                <a>
+                                    <xsl:attribute name="href">/cgi-bin/koha/opac-detail.pl?biblionumber=<xsl:value-of  select="$bibno"/></xsl:attribute>
+                                    <xsl:value-of select="$str"/>
+                                </a>
+                            </xsl:when>
+                           <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
+                                <a>
+                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of  select="marc:subfield[@code=9]"/></xsl:attribute>
+                                    <xsl:value-of select="$str"/>
+                                </a>
+                            </xsl:when>
+                            <xsl:when test="boolean($index)">
+                                <a>
+                                    <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of  select="$index"/>:<xsl:value-of  select="marc:subfield[@code='a']"/></xsl:attribute>
+                                    <xsl:value-of select="$str"/>
+                                </a>
+                            </xsl:when>
+                            <xsl:otherwise>
                                 <xsl:value-of select="$str"/>
-                            </a>
-                        </xsl:when>
-                       <xsl:when test="boolean($index) and boolean(marc:subfield[@code=9])">
-                            <a>
-                                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=an:<xsl:value-of  select="marc:subfield[@code=9]"/></xsl:attribute>
-                                  <xsl:value-of select="$str"/>
-                            </a>
-                        </xsl:when>
-                        <xsl:when test="boolean($index)">
-                            <a>
-                                <xsl:attribute name="href">/cgi-bin/koha/opac-search.pl?q=<xsl:value-of  select="$index"/>:<xsl:value-of  select="marc:subfield[@code='a']"/></xsl:attribute>
-                                <xsl:value-of select="$str"/>
-                            </a>
-                        </xsl:when>
-                        <xsl:otherwise>
-                            <xsl:value-of select="$str"/>
-                        </xsl:otherwise>
-                    </xsl:choose>
+                            </xsl:otherwise>
+                        </xsl:choose>
+                    </xsl:if>
                 </span>
             </xsl:if>
         </xsl:for-each>
index c7dd167..1dc43cd 100644 (file)
   <xsl:variable name="DisplayOPACiconsXSLT" select="marc:sysprefs/marc:syspref[@name='DisplayOPACiconsXSLT']"/>
   <xsl:variable name="OPACURLOpenInNewWindow" select="marc:sysprefs/marc:syspref[@name='OPACURLOpenInNewWindow']"/>
   <xsl:variable name="URLLinkText" select="marc:sysprefs/marc:syspref[@name='URLLinkText']"/>
-  <xsl:variable name="ShowISBD" select="marc:sysprefs/marc:syspref[@name='viewISBD']"/>
 
   <xsl:if test="marc:datafield[@tag=200]">
     <xsl:for-each select="marc:datafield[@tag=200]">
-      <h1>
+      <h1 class="title">
         <xsl:call-template name="addClassRtl" />
         <xsl:for-each select="marc:subfield">
           <xsl:choose>
     </xsl:for-each>
   </xsl:if>
 
-  <div id="views">
-    <span class="view">
-      <span id="Normalview">Normal View</span>
-    </span>
-    <span class="view">
-      <a id="MARCviewPop" href="/cgi-bin/koha/opac-showmarc.pl?id={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC" rel="gb_page_center[600,500]">MARC View</a>
-    </span>
-    <span class="view">
-      <a id="MARCview" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}" title="MARC">Expanded MARC View</a>
-    </span>
-    <xsl:if test="$ShowISBD!='0'">
-        <span class="view">
-          <a id="ISBDview" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber={marc:datafield[@tag=090]/marc:subfield[@code='a']}">Card View (ISBD)</a>
-        </span>
-    </xsl:if>
-  </div>
-
   <xsl:call-template name="tag_title">
     <xsl:with-param name="tag">454</xsl:with-param>
     <xsl:with-param name="label">Translation of</xsl:with-param>
index 146b88c..32f8cde 100644 (file)
                 <xsl:text>/cgi-bin/koha/opac-search.pl?q=an:</xsl:text>
                 <xsl:value-of select="."/>
               </xsl:attribute>
-              <xsl:value-of select="$display"/>
+              <xsl:choose>
+                <xsl:when test="string-length($display) &gt; 0">
+                  <xsl:call-template name="chopPunctuation">
+                    <xsl:with-param name="chopString">
+                      <xsl:value-of select="$display"/>
+                    </xsl:with-param>
+                  </xsl:call-template>
+                </xsl:when>
+                <xsl:otherwise>
+                  <xsl:value-of select="."/>
+                </xsl:otherwise>
+              </xsl:choose>
             </a>
             <xsl:variable name="ncommas"
                  select="string-length($ends) - string-length(translate($ends, ',', ''))" />
           </xsl:if>
         </xsl:for-each>
       </xsl:when>
-      <xsl:otherwise>
+      <xsl:when test="marc:subfield[@code=a]">
         <a>
           <xsl:attribute name="href">
             <xsl:text>/cgi-bin/koha/opac-search.pl?q=su:</xsl:text>
             </xsl:with-param>
           </xsl:call-template>
         </a>
-      </xsl:otherwise>
+      </xsl:when>
+      <xsl:otherwise/>
     </xsl:choose>
     <xsl:if test="not(position()=last())">
       <xsl:text> | </xsl:text>
index 01e17d5..123bcd2 100755 (executable)
@@ -18,6 +18,8 @@ my $installed = 0;
 my $upgrade = 0;
 my $all = 0;
 my $color = 0;
+my $brief = 0;
+my $req = 0;
 
 GetOptions(
             'h|help|?'    => \$help,
@@ -25,6 +27,8 @@ GetOptions(
             'i|installed' => \$installed,
             'u|upgrade'   => \$upgrade,
             'a|all'       => \$all,
+            'b|brief'     => \$brief,
+            'r|required'  => \$req,
             'c|color'     => \$color,
           );
 
@@ -39,12 +43,14 @@ push @pm, 'missing_pm' if $missing || $all;
 push @pm, 'upgrade_pm' if $upgrade || $all;
 push @pm, 'current_pm' if $installed || $all;
 
-print color 'bold blue' if $color;
-print"
+if (!$brief) {
+    print color 'bold blue' if $color;
+    print"
                                               Installed         Required          Module is
 Module Name                                   Version           Version            Required
 --------------------------------------------------------------------------------------------
 ";
+}
 
 my $count = 0;
 foreach my $type (@pm) {
@@ -60,28 +66,40 @@ foreach my $type (@pm) {
             my $required = ($_->{$pm}->{'required'}?'Yes':'No');
             my $current_version = ($color ? $_->{$pm}->{'cur_ver'} :
                                    $type eq 'missing_pm' || $type eq 'upgrade_pm' ? $_->{$pm}->{'cur_ver'}." *" : $_->{$pm}->{'cur_ver'});
+            if (!$brief) {
+                if (($req && $required eq 'Yes') || !$req) {
 format =
 @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<       @<<<<<
 $pm,                                          $current_version, $_->{$pm}->{'min_ver'},  $required
 .
 write;
+                }
+            }
+            else {
+                if (($req && $required eq 'Yes') || !$req) {
+                    print "$pm\n";
+                }
+            }
         }
     }
 }
-print color 'bold blue' if $color;
-my $footer = "
+
+if (!$brief) {
+    print color 'bold blue' if $color;
+    my $footer = "
 --------------------------------------------------------------------------------------------
 Total modules reported: $count                      ";
 
-if ($color) {
-    $footer .= "\n\n";
-}
-else {
-    $footer .= "* Module is missing or requires an upgrade.\n\n";
-}
+    if ($color) {
+        $footer .= "\n\n";
+    }
+    else {
+        $footer .= "* Module is missing or requires an upgrade.\n\n";
+    }
 
-print $footer;
-print color 'reset' if $color;
+    print $footer;
+    print color 'reset' if $color;
+}
 
 1;
 
@@ -93,7 +111,12 @@ koha_perl_deps.pl
 
 =head1 SYNOPSIS
 
-./koha_perl_deps.pl -m
+ At least one of -a, -m, -i, or -u flags must specified to not trigger help.
+ ./koha_perl_deps.pl -m [-b] [-r] [-c]
+ ./koha_perl_deps.pl -u [-b] [-r] [-c]
+ ./koha_perl_deps.pl -i [-b] [-r] [-c]
+ ./koha_perl_deps.pl -a [-b] [-r] [-c]
+ ./koha_perl_deps.pl [-[h?]]
 
 =head1 OPTIONS
 
@@ -113,7 +136,16 @@ lists all perl modules needing to be upgraded relative to Koha
 
 =item B<-a|--all>
 
-lists all koha perl dependencies
+ lists all koha perl dependencies
+ This is equivalent to '-m -i -u'.
+
+=item B<-b|--brief>
+
+lists only the perl dependency name.
+
+=item B<-r|--required>
+
+filters list to only required perl dependencies.
 
 =item B<-c|--color>
 
index ce3a3cd..9b09a7e 100644 (file)
@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.09.00.026';
+    our $VERSION = '3.09.00.035';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install
index 58f5cf1..2a39110 100755 (executable)
@@ -101,6 +101,8 @@ my @field_check=split(/\|/,$check_BorrowerMandatoryField);
 foreach (@field_check) {
        $template->param( "mandatory$_" => 1);    
 }
+# we'll need this, later.
+my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0;
 # function to designate unwanted fields
 my $check_BorrowerUnwantedField=C4::Context->preference("BorrowerUnwantedField");
 @field_check=split(/\|/,$check_BorrowerUnwantedField);
@@ -264,14 +266,14 @@ if ($op eq 'save' || $op eq 'insert'){
     if (checkcardnumber($newdata{cardnumber},$newdata{borrowernumber})){ 
         push @errors, 'ERROR_cardnumber';
     } 
-    my $dateofbirthmandatory = (scalar grep {$_ eq "dateofbirth"} @field_check) ? 1 : 0;
     if ($newdata{dateofbirth} && $dateofbirthmandatory) {
         my $age = GetAge($newdata{dateofbirth});
         my $borrowercategory=GetBorrowercategory($newdata{'categorycode'});   
         my ($low,$high) = ($borrowercategory->{'dateofbirthrequired'}, $borrowercategory->{'upperagelimit'});
         if (($high && ($age > $high)) or ($age < $low)) {
             push @errors, 'ERROR_age_limitations';
-            $template->param('ERROR_age_limitations' => "$low to $high");
+            $template->param( age_low => $low);
+            $template->param( age_high => $high);
         }
     }
   
index 25ae7e9..0524ecb 100755 (executable)
@@ -457,6 +457,7 @@ sub build_issue_data {
         $issue->{date_due}  = output_pref( $issue->{date_due} );
         $issue->{issuedate} = output_pref( $issue->{issuedate} ) if defined $issue->{issuedate};
         my $biblionumber = $issue->{biblionumber};
+        $issue->{issuingbranchname} = GetBranchName($issue->{branchcode});
         my %row          = %{$issue};
         $totalprice += $issue->{replacementprice};
 
diff --git a/members/routing-lists.pl b/members/routing-lists.pl
new file mode 100755 (executable)
index 0000000..25b0f85
--- /dev/null
@@ -0,0 +1,133 @@
+#!/usr/bin/perl
+
+# Copyright 2012 Prosentient Systems
+#
+# 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 CGI;
+use C4::Output;
+use C4::Auth qw/:DEFAULT get_session/;
+use C4::Branch; # GetBranches
+use C4::Members;
+use C4::Context;
+use C4::Serials;
+use CGI::Session;
+
+my $query = new CGI;
+
+my $sessionID = $query->cookie("CGISESSID") ;
+my $session = get_session($sessionID);
+
+# branch are now defined by the userenv
+# but first we have to check if someone has tried to change them
+
+my $branch = $query->param('branch');
+if ($branch){
+    # update our session so the userenv is updated
+    $session->param('branch', $branch);
+    $session->param('branchname', GetBranchName($branch));
+}
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
+    {
+        template_name   => 'members/routing-lists.tt',
+        query           => $query,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { circulate => 'circulate_remaining_permissions' },
+    }
+);
+
+my $branches = GetBranches();
+
+my $findborrower = $query->param('findborrower');
+$findborrower =~ s|,| |g;
+
+my $borrowernumber = $query->param('borrowernumber');
+
+$branch  = C4::Context->userenv->{'branch'};
+
+# get the borrower information.....
+my $borrower;
+if ($borrowernumber) {
+    $borrower = GetMemberDetails( $borrowernumber, 0 );
+}
+
+
+##################################################################################
+# BUILD HTML
+# I'm trying to show the title of subscriptions where the borrowernumber is attached via a routing list
+
+if ($borrowernumber) {
+# new op dev
+  my $count;
+  my @borrowerSubscriptions;
+  ($count, @borrowerSubscriptions) = GetSubscriptionsFromBorrower($borrowernumber );
+  my @subscripLoop;
+
+    foreach my $num_res (@borrowerSubscriptions) {
+        my %getSubscrip;
+        $getSubscrip{subscriptionid}   = $num_res->{'subscriptionid'};
+        $getSubscrip{title}                    = $num_res->{'title'};
+        $getSubscrip{borrowernumber}           = $num_res->{'borrowernumber'};
+        push( @subscripLoop, \%getSubscrip );
+    }
+
+    $template->param(
+        countSubscrip => scalar @subscripLoop,
+        subscripLoop  => \@subscripLoop,
+        routinglistview => 1
+    );
+
+    $template->param( adultborrower => 1 ) if ( $borrower->{'category_type'} eq 'A' );
+}
+
+##################################################################################
+
+
+# Computes full borrower address
+my (undef, $roadttype_hashref) = &GetRoadTypes();
+my $address = $borrower->{'streetnumber'}.' '.$roadttype_hashref->{$borrower->{'streettype'}}.' '.$borrower->{'address'};
+
+$template->param(
+
+    findborrower      => $findborrower,
+    borrower          => $borrower,
+    borrowernumber    => $borrowernumber,
+    branch            => $branch,
+    branchname        => GetBranchName($borrower->{'branchcode'}),
+    firstname         => $borrower->{'firstname'},
+    surname           => $borrower->{'surname'},
+    categorycode      => $borrower->{'categorycode'},
+    categoryname      => $borrower->{description},
+    address           => $address,
+    address2          => $borrower->{'address2'},
+    email             => $borrower->{'email'},
+    emailpro          => $borrower->{'emailpro'},
+    borrowernotes     => $borrower->{'borrowernotes'},
+    city              => $borrower->{'city'},
+    zipcode           => $borrower->{'zipcode'},
+    country           => $borrower->{'country'},
+    phone             => $borrower->{'phone'} || $borrower->{'mobile'},
+    cardnumber        => $borrower->{'cardnumber'},
+);
+
+my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
+$template->param( picture => 1 ) if $picture;
+
+output_html_with_http_headers $query, $cookie, $template->output;
index 8551ec8..7125560 100755 (executable)
@@ -58,7 +58,7 @@ foreach my $key ( keys %$borrower ) {
 }
 
 # Construct column names
-my $fields = C4::Context->preference('StatisticsFields') || 'location|itype|ccode';
+my $fields = C4::Members::Statistics::get_fields();
 our @statistic_column_names = split '\|', $fields;
 our @value_column_names = ( 'count_precedent_state', 'count_total_issues_today', 'count_total_issues_returned_today' );
 our @column_names = ( @statistic_column_names, @value_column_names );
@@ -70,6 +70,7 @@ my $total_issues_returned_today = GetTotalIssuesReturnedTodayByBorrower( $borrow
 my $r = merge (
     @$precedent_state, @$total_issues_today, @$total_issues_returned_today
 );
+
 add_actual_state( $r );
 my ( $total, $datas ) = build_array( $r );
 
@@ -194,7 +195,7 @@ sub merge {
         for my $ch ( @r ) {
             $exists = 1;
             for my $cn ( @statistic_column_names ) {
-                if ( not $ch->{$cn} eq $h->{$cn} ) {
+                if ( $ch->{$cn} and not $ch->{$cn} eq $h->{$cn} ) {
                     $exists = 0;
                     last;
                 }
index 4acc02b..24692fd 100755 (executable)
@@ -56,7 +56,7 @@ my ($tagfield,$biblionumtagsubfield) = &GetMarcFromKohaField("biblio.biblionumbe
 
 my $i=0;
 while ( my $record = $batch->next() ) {
-       my $biblionumber=$record->field($tagfield)->subfield($biblionumtagsubfield);
+    my $biblionumber = ($tagfield < 10) ? $record->field($tagfield)->data : $record->subfield($tagfield, $biblionumtagsubfield);
        $i++;
        $sth2->execute($record->as_usmarc,$biblionumber) if $biblionumber;
        print "$biblionumber \n";
index e89b8ae..a090ecc 100755 (executable)
@@ -160,7 +160,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) {
               my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
               $titles .= join("\t",@item_info) . "\n";
             }
-        
+
+            ## Get branch info for borrowers home library.
             $letter = parse_letter( { letter_code    => $letter_type,
                                       borrowernumber => $upcoming->{'borrowernumber'},
                                       branchcode     => $upcoming->{'branchcode'},
@@ -191,7 +192,8 @@ UPCOMINGITEM: foreach my $upcoming ( @$upcoming_dues ) {
               my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
               $titles .= join("\t",@item_info) . "\n";
             }
-        
+
+            ## Get branch info for borrowers home library.
             $letter = parse_letter( { letter_code    => $letter_type,
                                       borrowernumber => $upcoming->{'borrowernumber'},
                                       branchcode     => $upcoming->{'branchcode'},
@@ -252,10 +254,15 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$upcoming_digest ) {
       my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
       $titles .= join("\t",@item_info) . "\n";
     }
+
+    ## Get branch info for borrowers home library.
+    my %branch_info = get_branch_info( $borrowernumber );
+
     my $letter = parse_letter( { letter_code    => $letter_type,
                               borrowernumber => $borrowernumber,
                               substitute     => { count => $count,
-                                                  'items.content' => $titles
+                                                  'items.content' => $titles,
+                                                  %branch_info,
                                                 }
                          } )
       or die "no letter of type '$letter_type' found. Please see sample_notices.sql";
@@ -290,10 +297,15 @@ PATRON: while ( my ( $borrowernumber, $digest ) = each %$due_digest ) {
       my @item_info = map { $_ =~ /^date|date$/ ? format_date($item_info->{$_}) : $item_info->{$_} || '' } @item_content_fields;
       $titles .= join("\t",@item_info) . "\n";
     }
+
+    ## Get branch info for borrowers home library.
+    my %branch_info = get_branch_info( $borrowernumber );
+
     my $letter = parse_letter( { letter_code    => $letter_type,
                               borrowernumber => $borrowernumber,
                               substitute     => { count => $count,
-                                                  'items.content' => $titles
+                                                  'items.content' => $titles,
+                                                  %branch_info,
                                                 }
                          } )
       or die "no letter of type '$letter_type' found. Please see sample_notices.sql";
@@ -353,6 +365,25 @@ sub format_date {
     return output_pref($dt);
 }
 
+=head2 get_branch_info
+
+=cut
+
+sub get_branch_info {
+    my ( $borrowernumber ) = @_;
+
+    ## Get branch info for borrowers home library.
+    my $borrower_details = C4::Members::GetMember( borrowernumber => $borrowernumber );
+    my $borrower_branchcode = $borrower_details->{'branchcode'};
+    my $branch = C4::Branch::GetBranchDetail( $borrower_branchcode );
+    my %branch_info;
+    foreach my $key( keys %$branch ) {
+        $branch_info{"branches.$key"} = $branch->{$key};
+    }
+
+    return %branch_info;
+}
+
 1;
 
 __END__
index 5124f3c..27bd061 100755 (executable)
@@ -110,10 +110,9 @@ for my $overdue ( @{$overdues} ) {
     }
     ++$counted;
 
-    my ( $amount, $type, $daycounttotal ) =
+    my ( $amount, $type, $unitcounttotal ) =
       CalcFine( $overdue, $borrower->{categorycode},
         $branchcode, $datedue, $today );
-
     $type ||= q{};
 
     # Don't update the fine if today is a holiday.
@@ -131,15 +130,15 @@ for my $overdue ( @{$overdues} ) {
     push @cells,
       map { defined $borrower->{$_} ? $borrower->{$_} : q{} } @borrower_fields;
     push @cells, map { $overdue->{$_} } @item_fields;
-    push @cells, $type, $daycounttotal, $amount;
+    push @cells, $type, $unitcounttotal, $amount;
     say {$fh} join $delim, @cells;
 }
 close $fh;
 
 if ($verbose) {
     my $overdue_items = @{$overdues};
-    print <<'EOM';
-Fines assessment -- $today->ymd() -- Saved to $filename
+    print <<"EOM";
+Fines assessment -- $today -- Saved to $filename
 Number of Overdue Items:
      counted $overdue_items
     reported $counted
index f01153e..d920c04 100755 (executable)
@@ -82,7 +82,9 @@ sub GetBibsWithPendingHoldRequests {
                      FROM reserves
                      WHERE found IS NULL
                      AND priority > 0
-                     AND reservedate <= CURRENT_DATE()";
+                     AND reservedate <= CURRENT_DATE()
+                     AND suspend = 0
+                     ";
     my $sth = $dbh->prepare($bib_query);
 
     $sth->execute();
@@ -125,6 +127,7 @@ sub GetPendingHoldRequestsForBib {
                          AND found IS NULL
                          AND priority > 0
                          AND reservedate <= CURRENT_DATE()
+                         AND suspend = 0
                          ORDER BY priority";
     my $sth = $dbh->prepare($request_query);
     $sth->execute($biblionumber);
index 8c0bc12..1243add 100755 (executable)
@@ -388,7 +388,7 @@ foreach my $branchcode (@branches) {
 
     $verbose and warn sprintf "branchcode : '%s' using %s\n", $branchcode, $admin_email_address;
 
-    my $sth2 = $dbh->prepare( <<'END_SQL' );
+    my $sth2 = $dbh->prepare( <<"END_SQL" );
 SELECT biblio.*, items.*, issues.*, biblioitems.itemtype, TO_DAYS($date)-TO_DAYS(date_due) AS days_overdue
   FROM issues,items,biblio, biblioitems
   WHERE items.itemnumber=issues.itemnumber
@@ -455,10 +455,10 @@ END_SQL
             }
             $borrower_sql .= '  AND categories.overduenoticerequired=1 ';
             if($triggered) {
-                $borrower_sql .= ' AND TO_DAYS($date)-TO_DAYS(date_due) = ?';
+                $borrower_sql .= " AND TO_DAYS($date)-TO_DAYS(date_due) = ?";
                 push @borrower_parameters, $mindays;
             } else {
-                $borrower_sql .= ' AND TO_DAYS($date)-TO_DAYS(date_due) BETWEEN ? and ? ' ;
+                $borrower_sql .= " AND TO_DAYS($date)-TO_DAYS(date_due) BETWEEN ? and ? " ;
                 push @borrower_parameters, $mindays, $maxdays;
             }
 
index 35264dc..098fae6 100755 (executable)
@@ -176,7 +176,7 @@ for ( my $i = 0 ; $i < scalar(@$data) ; $i++ ) {
     ( $datedue_days <= $today_days ) or next;    # or it's not overdue, right?
 
     $overdueItemsCounted++;
-    my ( $amount, $type, $daycounttotal, $daycount ) = CalcFine( $data->[$i], $borrower->{'categorycode'}, $branchcode, undef, undef, $datedue, $today );
+    my ( $amount, $type, $unitcounttotal, $unitcount ) = CalcFine( $data->[$i], $borrower->{'categorycode'}, $branchcode, undef, undef, $datedue, $today );
 
     # Reassign fine's amount if specified in command-line
     $amount = $catamounts{$borrower->{'categorycode'}} if (defined $catamounts{$borrower->{'categorycode'}});
diff --git a/misc/export_borrowers.pl b/misc/export_borrowers.pl
new file mode 100755 (executable)
index 0000000..c4b3e40
--- /dev/null
@@ -0,0 +1,113 @@
+#!/usr/bin/perl
+
+# Copyright 2011 BibLibre
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Script to export borrowers
+
+use Modern::Perl;
+use Text::CSV;
+use Getopt::Long qw(:config no_ignore_case);
+
+use C4::Context;
+use C4::Members;
+
+use encoding 'utf8';
+
+sub print_usage {
+    ( my $basename = $0 ) =~ s|.*/||;
+    print <<USAGE;
+
+$basename
+    Export patron informations in CSV format.
+    It prints to standard output. Use redirection to save CSV in a file.
+
+Usage:
+$0 [--field=FIELD [--field=FIELD [...]]] [--show-header]
+$0 -h
+
+    -f, --field=FIELD       Field to export. It is repeatable and has to match
+                            keys returned by the GetMemberDetails function.
+                            If no field is specified, then all fields will be
+                            exported.
+    -H, --show-header       Print field names on first row
+    -h, --help              Show this help
+
+USAGE
+}
+
+# Getting parameters
+my @fields;
+my $show_header;
+my $help;
+
+GetOptions(
+    'field|f=s'     => \@fields,
+    'show-header|H' => \$show_header,
+    'help|h'        => \$help
+) or print_usage, exit 1;
+
+if ($help) {
+    print_usage;
+    exit;
+}
+
+# Getting borrowers
+my $dbh   = C4::Context->dbh;
+my $query = "SELECT borrowernumber FROM borrowers ORDER BY borrowernumber";
+my $sth   = $dbh->prepare($query);
+$sth->execute;
+
+my $csv = Text::CSV->new( { binary => 1 } );
+
+# If the user did not specify any field to export, we assume he wants them all
+# We retrieve the first borrower informations to get field names
+my ($borrowernumber) = $sth->fetchrow_array;
+my $member = GetMemberDetails($borrowernumber);
+@fields = keys %$member unless (@fields);
+
+if ($show_header) {
+    $csv->combine(@fields);
+    print $csv->string . "\n";
+}
+
+$csv->combine(
+    map {
+        ( defined $member->{$_} and !ref $member->{$_} )
+          ? $member->{$_}
+          : ''
+      } @fields
+);
+die "Invalid character at borrower $borrowernumber: ["
+  . $csv->error_input . "]\n"
+  if ( !defined( $csv->string ) );
+print $csv->string . "\n";
+
+while ( my $borrowernumber = $sth->fetchrow_array ) {
+    $member = GetMemberDetails($borrowernumber);
+    $csv->combine(
+        map {
+            ( defined $member->{$_} and !ref $member->{$_} )
+              ? $member->{$_}
+              : ''
+          } @fields
+    );
+    die "Invalid character at borrower $borrowernumber: ["
+      . $csv->error_input . "]\n"
+      if ( !defined( $csv->string ) );
+    print $csv->string . "\n";
+}
index ba659c9..1d225d9 100644 (file)
@@ -18,6 +18,7 @@ use Data::Dumper;
 use HTTP::Cookies;
 use C4::Context;
 use C4::Debug;
+use URI::Escape;
 
 my ($help, $steps, $baseurl, $max_tries, $user, $password,$short_print);
 GetOptions(
@@ -241,7 +242,7 @@ if ($steps=~ /4/) {
     my $b2 = HTTPD::Bench::ApacheBench->new;
     $b2->concurrency( $concurrency );
     unless ($short_print) {
-        print "Step 5: patron detail page         ";
+        print "Step 4: patron detail page         ";
     }
     my $run2 = HTTPD::Bench::ApacheBench::Run->new
         ({ urls => \@borrowers,
@@ -324,7 +325,7 @@ if ($steps=~ /6/) {
         until ($rand_barcode) {
             my $rand_itemnumber = int(rand($itemnumber_max)+1);
             $sth->execute($rand_itemnumber);
-            ($rand_barcode) = $sth->fetchrow();
+            ($rand_barcode) = uri_escape_utf8($sth->fetchrow());
         }
         push @issues,"$baseurl/circ/circulation.pl?borrowernumber=$rand_borrowernumber&barcode=$rand_barcode&issueconfirmed=1";
         push @returns,"$baseurl/circ/returns.pl?barcode=$rand_barcode";
index 435859d..773ed51 100755 (executable)
@@ -54,7 +54,6 @@ use C4::Review;
 use C4::Serials;    # uses getsubscriptionfrom biblionumber
 use C4::Koha;
 use C4::Members;    # GetMember
-use C4::External::Amazon;
 
 my $query = CGI->new();
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -192,40 +191,4 @@ if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
  $template->param('OPACSearchForTitleIn' => $search_for_title);
 }
 
-## Amazon.com stuff
-#not used unless preference set
-if ( C4::Context->preference("OPACAmazonEnabled") == 1 ) {
-
-    my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour );
-
-    foreach my $result ( @{ $amazon_details->{Details} } ) {
-        $template->param( item_description => $result->{ProductDescription} );
-        $template->param( image            => $result->{ImageUrlMedium} );
-        $template->param( list_price       => $result->{ListPrice} );
-        $template->param( amazon_url       => $result->{url} );
-    }
-
-    my @products;
-    my @reviews;
-    for my $details ( @{ $amazon_details->{Details} } ) {
-        next unless $details->{SimilarProducts};
-        for my $product ( @{ $details->{SimilarProducts}->{Product} } ) {
-            push @products, +{ Product => $product };
-        }
-        next unless $details->{Reviews};
-        for my $product ( @{ $details->{Reviews}->{AvgCustomerRating} } ) {
-            $template->param( rating => $product * 20 );
-        }
-        for my $reviews ( @{ $details->{Reviews}->{CustomerReview} } ) {
-            push @reviews,
-              +{
-                Summary => $reviews->{Summary},
-                Comment => $reviews->{Comment},
-              };
-        }
-    }
-    $template->param( SIMILAR_PRODUCTS => \@products );
-    $template->param( AMAZONREVIEWS    => \@reviews );
-}
-
 output_html_with_http_headers $query, $cookie, $template->output;
index 2884373..8d5367f 100755 (executable)
@@ -53,7 +53,7 @@ my $query = new CGI;
 my $dbh = C4::Context->dbh;
 
 my $display_hierarchy = C4::Context->preference("AuthDisplayHierarchy");
-my $show_marc = $query->param('marc') || 1; # Currently only MARC view is available
+my $show_marc = $query->param('marc');
 
 # open template
 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
@@ -67,11 +67,14 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 );
 
 my $authid       = $query->param('authid');
-my $authtypecode = &GetAuthTypeCode( $authid );
-my $tagslib      = &GetTagsLabels( 0, $authtypecode );
+my $record = GetAuthority( $authid );
+if ( ! $record ) {
+    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
+    exit;
+}
 
+my $authtypecode = &GetAuthTypeCode( $authid );
 
-my $record;
 if ($display_hierarchy){
   my $trees=BuildUnimarcHierarchies($authid);
   my @trees = split /;/,$trees ;
@@ -85,7 +88,6 @@ if ($display_hierarchy){
     foreach my $element (@tree){
       my $cell;
       my $elementdata = GetAuthority($element);
-      $record= $elementdata if ($authid==$element);
       push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
       $cnt++;
     }
@@ -96,95 +98,94 @@ if ($display_hierarchy){
     'loophierarchies' =>\@loophierarchies,
   );
 }
-else {
-    $record = GetAuthority( $authid );
-}
 my $count = CountUsage($authid);
 
-# find the marc field/subfield used in biblio by this authority
-my $sth =
-  $dbh->prepare(
-    "select distinct tagfield from marc_subfield_structure where authtypecode=?"
-  );
-$sth->execute($authtypecode);
-my $biblio_fields;
-while ( my ($tagfield) = $sth->fetchrow ) {
-    $biblio_fields .= $tagfield . "9,";
+
+my $authtypes     = getauthtypes();
+my @authtypesloop = ();
+foreach my $thisauthtype ( keys %{$authtypes} ) {
+    push @authtypesloop,
+         { value        => $thisauthtype,
+           selected     => $thisauthtype eq $authtypecode,
+           authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
+         };
 }
-chop $biblio_fields;
+$template->{VARS}->{'authtypesloop'} = \@authtypesloop;
+$template->{VARS}->{'authtypetext'}  = $authtypes->{$authtypecode}{'authtypetext'};
+$template->{VARS}->{'authid'}        = $authid;
+$template->{VARS}->{'count'}         = $count;
+
+# find the marc field/subfield used in biblio by this authority
+if ($show_marc) {
+    my $tagslib = &GetTagsLabels( 0, $authtypecode );
+    my $sth =
+        $dbh->prepare(
+                "select distinct tagfield from marc_subfield_structure where authtypecode=?"
+                );
+    $sth->execute($authtypecode);
+    my $biblio_fields;
+    while ( my ($tagfield) = $sth->fetchrow ) {
+        $biblio_fields .= $tagfield . "9,";
+    }
+    chop $biblio_fields;
 
 # fill arrays
-my @loop_data = ();
-my $tag;
+    my @loop_data = ();
+    my $tag;
 
-# loop through each tab 0 through 9
-# for (my $tabloop = 0; $tabloop<=10;$tabloop++) {
 # loop through each tag
-my @fields    = $record->fields();
-foreach my $field (@fields) {
-    my @subfields_data;
-
-    # skip UNIMARC fields <200, they are useless for a patron
-    next if C4::Context->preference('MarcFlavour') eq 'UNIMARC' && $field->tag() <200;
-
-    # if tag <10, there's no subfield, use the "@" trick
-    if ( $field->tag() < 10 ) {
-        next if ( $tagslib->{ $field->tag() }->{'@'}->{hidden} );
-        my %subfield_data;
-        $subfield_data{marc_lib}   = $tagslib->{ $field->tag() }->{'@'}->{lib};
-        $subfield_data{marc_value} = $field->data();
-        $subfield_data{marc_subfield} = '@';
-        $subfield_data{marc_tag}      = $field->tag();
-        push( @subfields_data, \%subfield_data );
-    }
-    else {
-        my @subf = $field->subfields;
-
-        # loop through each subfield
-        for my $i ( 0 .. $#subf ) {
-            $subf[$i][0] = "@" unless $subf[$i][0];
-            next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} );
-            # skip useless subfields (for patrons)
-            next if $subf[$i][0] =~ /7|8|9/;
+    my @fields    = $record->fields();
+    foreach my $field (@fields) {
+        my @subfields_data;
+
+# skip UNIMARC fields <200, they are useless for a patron
+        next if C4::Context->preference('MarcFlavour') eq 'UNIMARC' && $field->tag() <200;
+
+# if tag <10, there's no subfield, use the "@" trick
+        if ( $field->tag() < 10 ) {
+            next if ( $tagslib->{ $field->tag() }->{'@'}->{hidden} );
             my %subfield_data;
-            $subfield_data{marc_lib} =
-              $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
-            $subfield_data{marc_subfield} = $subf[$i][0];
+            $subfield_data{marc_lib}   = $tagslib->{ $field->tag() }->{'@'}->{lib};
+            $subfield_data{marc_value} = $field->data();
+            $subfield_data{marc_subfield} = '@';
             $subfield_data{marc_tag}      = $field->tag();
-            $subfield_data{isurl} =  $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{isurl};
-            $subfield_data{marc_value} = $subf[$i][1];
             push( @subfields_data, \%subfield_data );
         }
+        else {
+            my @subf = $field->subfields;
+
+# loop through each subfield
+            for my $i ( 0 .. $#subf ) {
+                $subf[$i][0] = "@" unless $subf[$i][0];
+                next if ( $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{hidden} );
+# skip useless subfields (for patrons)
+                next if $subf[$i][0] =~ /7|8|9/;
+                my %subfield_data;
+                $subfield_data{marc_lib} =
+                    $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{lib};
+                $subfield_data{marc_subfield} = $subf[$i][0];
+                $subfield_data{marc_tag}      = $field->tag();
+                $subfield_data{isurl} =  $tagslib->{ $field->tag() }->{ $subf[$i][0] }->{isurl};
+                $subfield_data{marc_value} = $subf[$i][1];
+                push( @subfields_data, \%subfield_data );
+            }
+        }
+        if ( $#subfields_data >= 0 ) {
+            my %tag_data;
+            $tag_data{tag} =
+                $field->tag()
+                . ' '
+                . C4::Koha::display_marc_indicators($field)
+                . ' - ' . $tagslib->{ $field->tag() }->{lib};
+            $tag_data{subfield} = \@subfields_data;
+            push( @loop_data, \%tag_data );
+        }
     }
-    if ( $#subfields_data >= 0 ) {
-        my %tag_data;
-        $tag_data{tag} =
-          $field->tag() 
-          . ' '
-          . C4::Koha::display_marc_indicators($field)
-          . ' - ' . $tagslib->{ $field->tag() }->{lib};
-        $tag_data{subfield} = \@subfields_data;
-        push( @loop_data, \%tag_data );
-    }
+    $template->param( "Tab0XX" => \@loop_data );
+} else {
+    my $summary = BuildSummary($record, $authid, $authtypecode);
+    $template->{VARS}->{'summary'} = $summary;
 }
-$template->param( "Tab0XX" => \@loop_data );
 
-my $authtypes     = getauthtypes();
-my @authtypesloop = ();
-foreach my $thisauthtype ( keys %{$authtypes} ) {
-    push @authtypesloop,
-      { value        => $thisauthtype,
-        selected     => $thisauthtype eq $authtypecode,
-        authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
-      };
-}
-
-$template->param(
-    authid               => $authid,
-    count                => $count,
-    biblio_fields        => $biblio_fields,
-    authtypetext         => $authtypes->{$authtypecode}{'authtypetext'},
-    authtypesloop        => \@authtypesloop,
-);
 output_html_with_http_headers $query, $cookie, $template->output;
 
index 0bafabd..feaa89b 100755 (executable)
@@ -157,8 +157,7 @@ if ($session->param('busc')) {
         for (my $i=0;$i<@servers;$i++) {
             my $server = $servers[$i];
             $hits = $results_hashref->{$server}->{"hits"};
-            my @records = $results_hashref->{$server}->{"RECORDS"};
-            @newresults = searchResults('opac', '', $hits, $results_per_page, $offset, $arrParamsBusc->{'scan'}, \@records,, C4::Context->preference('hidelostitems'));
+            @newresults = searchResults('opac', '', $hits, $results_per_page, $offset, $arrParamsBusc->{'scan'}, $results_hashref->{$server}->{"RECORDS"});
         }
         return \@newresults;
     }#searchAgain
@@ -747,46 +746,6 @@ if (C4::Context->preference("OPACLocalCoverImages")){
                $template->param(OPACLocalCoverImages => 1);
 }
 
-# Amazon.com Stuff
-if ( C4::Context->preference("OPACAmazonEnabled") ) {
-    $template->param( AmazonTld => get_amazon_tld() );
-    my $amazon_reviews  = C4::Context->preference("OPACAmazonReviews");
-    my $amazon_similars = C4::Context->preference("OPACAmazonSimilarItems");
-    my @services;
-    if ( $amazon_reviews ) {
-        push( @services, 'EditorialReview', 'Reviews' );
-    }
-    if ( $amazon_similars ) {
-        push( @services, 'Similarities' );
-    }
-    my $amazon_details = &get_amazon_details( $isbn, $record, $marcflavour, \@services );
-    my $similar_products_exist;
-    if ( $amazon_reviews ) {
-        my $item = $amazon_details->{Items}->{Item}->[0];
-        my $customer_reviews = \@{ $item->{CustomerReviews}->{Review} };
-        my $editorial_reviews = \@{ $item->{EditorialReviews}->{EditorialReview} };
-        my $average_rating = $item->{CustomerReviews}->{AverageRating} || 0;
-        $template->param( amazon_average_rating    => $average_rating * 20);
-        $template->param( AMAZON_CUSTOMER_REVIEWS  => $customer_reviews );
-        $template->param( AMAZON_EDITORIAL_REVIEWS => $editorial_reviews );
-    }
-    if ( $amazon_similars ) {
-        my $item = $amazon_details->{Items}->{Item}->[0];
-        my @similar_products;
-        for my $similar_product (@{ $item->{SimilarProducts}->{SimilarProduct} }) {
-            # do we have any of these isbns in our collection?
-            my $similar_biblionumbers = get_biblionumber_from_isbn($similar_product->{ASIN});
-            # verify that there is at least one similar item
-            if (scalar(@$similar_biblionumbers)){
-                $similar_products_exist++ if ($similar_biblionumbers && $similar_biblionumbers->[0]);
-                push @similar_products, +{ similar_biblionumbers => $similar_biblionumbers, title => $similar_product->{Title}, ASIN => $similar_product->{ASIN}  };
-            }
-        }
-        $template->param( OPACAmazonSimilarItems => $similar_products_exist );
-        $template->param( AMAZON_SIMILAR_PRODUCTS => \@similar_products );
-    }
-}
-
 my $syndetics_elements;
 
 if ( C4::Context->preference("SyndeticsEnabled") ) {
@@ -907,6 +866,8 @@ if (C4::Context->preference("OPACShelfBrowser")) {
     }
 }
 
+$template->param( AmazonTld => get_amazon_tld() ) if ( C4::Context->preference("OPACAmazonCoverImages"));
+
 if (C4::Context->preference("BakerTaylorEnabled")) {
        $template->param(
                BakerTaylorEnabled  => 1,
@@ -1000,4 +961,8 @@ if (C4::Context->preference('OPACLocalCoverImages') == 1) {
     $template->{VARS}->{localimages} = \@images;
 }
 
+if (C4::Context->preference('OpacHighlightedWords')) {
+    $template->{VARS}->{query_desc} = $query->param('query_desc');
+}
+
 output_html_with_http_headers $query, $cookie, $template->output;
index 3e78c9a..0c92de6 100755 (executable)
@@ -97,6 +97,16 @@ foreach my $issue (@{$issues} ) {
         $line{'description'}   = $itemtypes->{ $issue->{'itemtype'} }->{'description'};
         $line{imageurl}        = getitemtypeimagelocation( 'opac', $itemtypes->{ $issue->{'itemtype'}  }->{'imageurl'} );
     }
+    # My Summary HTML
+    if (my $my_summary_html = C4::Context->preference('OPACMySummaryHTML')){
+        $line{author} ? $my_summary_html =~ s/{AUTHOR}/$line{author}/g : $my_summary_html =~ s/{AUTHOR}//g;
+        $line{title} =~ s/\/+$//; # remove trailing slash
+        $line{title} =~ s/\s+$//; # remove trailing space
+        $line{title} ? $my_summary_html =~ s/{TITLE}/$line{title}/g : $my_summary_html =~ s/{TITLE}//g;
+        $line{normalized_isbn} ? $my_summary_html =~ s/{ISBN}/$line{normalized_isbn}/g : $my_summary_html =~ s/{ISBN}//g;
+        $line{biblionumber} ? $my_summary_html =~ s/{BIBLIONUMBER}/$line{biblionumber}/g : $my_summary_html =~ s/{BIBLIONUMBER}//g;
+        $line{MySummaryHTML} = $my_summary_html;
+    }
     push( @loop_reading, \%line );
     $line{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($issue->{'biblionumber'}));
 }
@@ -130,6 +140,7 @@ $template->param(
     showfulllink   => 1,
        readingrecview => 1,
        count          => scalar @loop_reading,
+    OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0,
 );
 
 output_html_with_http_headers $query, $cookie, $template->output;
index 1fb4df0..2bbb4be 100755 (executable)
@@ -147,22 +147,20 @@ foreach my $biblioNumber (@biblionumbers) {
         $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo;
     }
 
-    if ($show_holds_count) {
-        # Compute the priority rank.
-        my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1);
-        $biblioData->{reservecount} = 1; # new reserve
-        foreach my $res (@$reserves) {
-            my $found = $res->{'found'};
-            if ( $found && ($found eq 'W') ) {
-                $rank--;
-            }
-            else {
-                $biblioData->{reservecount}++;
-            }
+    # Compute the priority rank.
+    my ( $rank, $reserves ) =
+      GetReservesFromBiblionumber( $biblioNumber, 1 );
+    $biblioData->{reservecount} = 1;    # new reserve
+    foreach my $res (@{$reserves}) {
+        my $found = $res->{found};
+        if ( $found && $found eq 'W' ) {
+            $rank--;
+        }
+        else {
+            $biblioData->{reservecount}++;
         }
-        $rank++;
-        $biblioData->{rank} = $rank;
     }
+    $biblioData->{rank} = $rank + 1;
 }
 
 #
index 1e5a0d7..46cf105 100755 (executable)
@@ -449,7 +449,17 @@ my @limit_inputs = $limit_cgi ? _input_cgi_parse($limit_cgi) : ();
 #
 # add OPAC suppression - requires at least one item indexed with Suppress
 if (C4::Context->preference('OpacSuppression')) {
-    $query = "($query) not Suppress=1";
+    # OPAC suppression by IP address
+    if (C4::Context->preference('OpacSuppressionByIPRange')) {
+        my $IPAddress = $ENV{'REMOTE_ADDR'};
+        my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
+        if ($IPAddress !~ /^$IPRange/)  {
+            $query = "($query) not Suppress=1";
+        }
+    }
+    else {
+        $query = "($query) not Suppress=1";
+    }
 }
 
 $template->param ( LIMIT_INPUTS => \@limit_inputs );
@@ -609,7 +619,7 @@ for (my $i=0;$i<@servers;$i++) {
 
             if (!$borrowernumber || $borrowernumber eq '') {
                 # To a cookie (the user is not logged in)
-                if (($params->{'offset'}||'') eq '') {
+                if (!$offset) {
                     push @recentSearches, {
                                 "query_desc" => $query_desc_history || "unknown",
                                 "query_cgi"  => $query_cgi_history  || "unknown",
@@ -631,7 +641,7 @@ for (my $i=0;$i<@servers;$i++) {
             }
             else {
                 # To the session (the user is logged in)
-                if (($params->{'offset'}||'') eq '') {
+                if (!$offset) {
                     AddSearchHistory($borrowernumber, $cgi->cookie("CGISESSID"), $query_desc_history, $query_cgi_history, $total);
                     $template->param(ShowOpacRecentSearchLink => 1);
                 }
index a3a4eb8..da74745 100755 (executable)
@@ -27,7 +27,6 @@ use Carp;
 use Mail::Sendmail;
 use MIME::QuotedPrint;
 use MIME::Base64;
-use HTML::FormatText;
 use C4::Biblio;
 use C4::Items;
 use C4::Auth;
@@ -135,7 +134,7 @@ if ( $email_add ) {
 
     my $email_header = "";
     if ( $template_res =~ /<HEADER>\n(.*)\n?<END_HEADER>/s ) {
-        $email_header = $1;
+        $email_header = encode_qp($1);
     }
 
     my $email_file = "basket.txt";
@@ -144,7 +143,7 @@ if ( $email_add ) {
     }
 
     if ( $template_res =~ /<MESSAGE>\n(.*)\n?<END_MESSAGE>/s ) {
-        $body = $1;
+        $body = encode_qp($1);
     }
 
     my $boundary = "====" . time() . "====";
index 4dbc432..50a167e 100755 (executable)
@@ -109,7 +109,7 @@ if ( $borr->{amountoutstanding} > $no_renewal_amt ) {
     $borr->{'flagged'} = 1;
     $canrenew = 0;
     $template->param(
-        renewal_blocked_fines => sprintf( '%.02f', $no_renewal_amt ),
+        renewal_blocked_fines => sprintf( '%.02f', $borr->{amountoutstanding} ),
     );
 }
 
index 243dddd..26a8774 100755 (executable)
@@ -155,7 +155,7 @@ elsif ( $op eq "checkout" ) {
             hide_main                 => 1,
         );
         if ($issue_error eq 'DEBT') {
-            $template->param(amount => $impossible->{DEBT});
+            $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$impossible->{DEBT});
         }
         #warn "issue_error: " . $issue_error ;
         if ( $issue_error eq "NO_MORE_RENEWALS" ) {
@@ -187,6 +187,9 @@ elsif ( $op eq "checkout" ) {
             "circ_error_$issue_error" => 1,
             hide_main                 => 1,
         );
+        if ($issue_error eq 'DEBT') {
+            $template->param(amount => C4::Budgets->GetCurrency()->{symbol}.$needconfirm->{DEBT});
+        }
     } else {
         if ( $confirmed || $issuenoconfirm ) {    # we'll want to call getpatroninfo again to get updated issues.
             # warn "issuing book?";
index 1112274..8a2aada 100755 (executable)
@@ -508,6 +508,7 @@ elsif ($phase eq 'Run this report'){
         for(my $i=0;$i<($#split/2);$i++) {
             my ($text,$authorised_value) = split /\|/,$split[$i*2+1];
             my $input;
+            my $labelid;
             if ($authorised_value eq "date") {
                $input = 'date';
             }
@@ -563,8 +564,11 @@ elsif ($phase eq 'Run this report'){
                         $authorised_lib{$value} = $lib;
                     }
                 }
+                $labelid = $text;
+                $labelid =~ s/\W//g;
                 $input =CGI::scrolling_list(      # FIXME: factor out scrolling_list
                     -name     => "sql_params",
+                    -id       => "sql_params_".$labelid,
                     -values   => \@authorised_values,
 #                     -default  => $value,
                     -labels   => \%authorised_lib,
@@ -575,9 +579,9 @@ elsif ($phase eq 'Run this report'){
                 );
 
             } else {
-                $input = "<input type='text' name='sql_params'/>";
+                $input = "text";
             }
-            push @tmpl_parameters, {'entry' => $text, 'input' => $input };
+            push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid };
         }
         $template->param('sql'         => $sql,
                         'name'         => $name,
index ad03d88..d13ced3 100755 (executable)
@@ -1,10 +1,8 @@
 #!/usr/bin/perl
 
-
 #written 18/1/2000 by chris@katipo.co.nz
 #script to renew items from the web
 
-
 # Copyright 2000-2002 Katipo Communications
 #
 # This file is part of Koha.
@@ -25,6 +23,8 @@ use strict;
 use warnings;
 use CGI;
 use C4::Circulation;
+use C4::Context;
+use C4::Items;
 use C4::Auth;
 use URI::Escape;
 use Koha::DateUtils;
@@ -49,7 +49,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 #
 
 my @data;
-if ($input->param('renew_all')) {
+if ( $input->param('renew_all') ) {
     @data = $input->param('all_items[]');
 }
 else {
@@ -57,56 +57,84 @@ else {
 }
 
 my @barcodes;
-if ($input->param('return_all')) {
+if ( $input->param('return_all') ) {
     @barcodes = $input->param('all_barcodes[]');
-} else {
+}
+else {
     @barcodes = $input->param('barcodes[]');
 }
 
-my $branch=$input->param('branch');
+my $branch = $input->param('branch');
 my $datedue;
-if ($input->param('newduedate')){
-    $datedue = dt_from_string($input->param('newduedate'));
+if ( $input->param('newduedate') ) {
+    $datedue = dt_from_string( $input->param('newduedate') );
 }
 
 # warn "barcodes : @barcodes";
 #
 # renew items
 #
-my $cardnumber = $input->param("cardnumber");
+my $cardnumber     = $input->param("cardnumber");
 my $borrowernumber = $input->param("borrowernumber");
-my $exemptfine = $input->param("exemptfine") || 0;
+my $exemptfine     = $input->param("exemptfine") || 0;
 my $override_limit = $input->param("override_limit") || 0;
-my $failedrenews = q{};
+my $failedrenews   = q{};
 foreach my $itemno (@data) {
+
     # check status before renewing issue
-       my ($renewokay,$error) = CanBookBeRenewed($borrowernumber,$itemno,$override_limit);
-    if ($renewokay){
-        AddRenewal($borrowernumber,$itemno,$branch,$datedue);
+    my ( $renewokay, $error ) =
+      CanBookBeRenewed( $borrowernumber, $itemno, $override_limit );
+    if ($renewokay) {
+        AddRenewal( $borrowernumber, $itemno, $branch, $datedue );
+    }
+    else {
+        $failedrenews .= "&failedrenew=$itemno";
     }
-       else {
-               $failedrenews.="&failedrenew=$itemno";        
-       }
 }
 my $failedreturn = q{};
 foreach my $barcode (@barcodes) {
+
     # check status before renewing issue
-   my ( $returned, $messages, $issueinformation, $borrower ) = 
-    AddReturn($barcode, $branch, $exemptfine);
-   $failedreturn.="&failedreturn=$barcode" unless ($returned);
+
+    #System Preference Handling During Check-in In Patron Module
+    my $itemnumber;
+    $itemnumber = GetItemnumberFromBarcode($barcode);
+    if ($itemnumber) {
+        if ( C4::Context->preference("InProcessingToShelvingCart") ) {
+            my $item = GetItem($itemnumber);
+            if ( $item->{'location'} eq 'PROC' ) {
+                $item->{'location'} = 'CART';
+                ModItem( $item, $item->{'biblionumber'},
+                    $item->{'itemnumber'} );
+            }
+        }
+
+        if ( C4::Context->preference("ReturnToShelvingCart") ) {
+            my $item = GetItem($itemnumber);
+            $item->{'location'} = 'CART';
+            ModItem( $item, $item->{'biblionumber'}, $item->{'itemnumber'} );
+        }
+    }
+
+    my ( $returned, $messages, $issueinformation, $borrower ) =
+      AddReturn( $barcode, $branch, $exemptfine );
+    $failedreturn .= "&failedreturn=$barcode" unless ($returned);
 }
 
 #
 # redirection to the referrer page
 #
-if ($input->param('destination') eq "circ"){
+if ( $input->param('destination') eq "circ" ) {
     $cardnumber = uri_escape($cardnumber);
-    print $input->redirect(
-        '/cgi-bin/koha/circ/circulation.pl?findborrower='.$cardnumber.$failedrenews.$failedreturn
-    );
+    print $input->redirect( '/cgi-bin/koha/circ/circulation.pl?findborrower='
+          . $cardnumber
+          . $failedrenews
+          . $failedreturn );
 }
 else {
     print $input->redirect(
-        '/cgi-bin/koha/members/moremember.pl?borrowernumber='.$borrowernumber.$failedrenews.$failedreturn
-    );
+            '/cgi-bin/koha/members/moremember.pl?borrowernumber='
+          . $borrowernumber
+          . $failedrenews
+          . $failedreturn );
 }
index 083b3a8..02715ab 100644 (file)
@@ -101,6 +101,7 @@ $prefix = $ENV{'INSTALL_BASE'} || "/usr";
   "__KOHA_GROUP__" => "koha",
   "__ZEBRA_PASS__" => "zebrastripes",
   "__ZEBRA_USER__" => "kohauser",
+  '__BACKUP_DIR__' => "$prefix/var/spool",
   '__INTRANET_CGI_DIR__' => "$prefix/intranet/cgi-bin",
   '__INTRANET_TMPL_DIR__' => "$prefix/intranet/templates",
   '__INTRANET_WWW_DIR__' => "$prefix/intranet/www",
index 8f96e22..da9008d 100644 (file)
@@ -43,6 +43,7 @@ find(
             return unless $m =~ s/[.]pm$//;
             $m =~ s{^.*/Koha/}{Koha/};
             $m =~ s{/}{::}g;
+            return if $m =~ /Koha::SearchEngine::/; # Koha::SearchEngine::* are experimental
             use_ok($m) || BAIL_OUT("***** PROBLEMS LOADING FILE '$m'");
         },
     },
diff --git a/t/Barcodes_EAN13.t b/t/Barcodes_EAN13.t
new file mode 100755 (executable)
index 0000000..c3c9046
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/perl
+#
+# implementation tests are in t/db_dependent/Barcodes.t
+
+use strict;
+use warnings;
+
+use Test::More tests => 1;
+
+BEGIN {
+        use_ok('C4::Barcodes::EAN13');
+}
diff --git a/t/Barcodes_ValueBuilder.t b/t/Barcodes_ValueBuilder.t
new file mode 100644 (file)
index 0000000..64d7fae
--- /dev/null
@@ -0,0 +1,77 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+use DBI;
+use Test::More tests => 10;
+use Test::MockModule;
+
+BEGIN {
+    use_ok('C4::Barcodes::ValueBuilder');
+}
+
+
+my $module = new Test::MockModule('C4::Context');
+$module->mock('_new_dbh', sub {
+                             my $dbh = DBI->connect( 'DBI:Mock:', '', '' )
+                             || die "Cannot create handle: $DBI::errstr\n";
+                             return $dbh });
+
+# Mock data
+my $incrementaldata = [
+    ['max(abs(barcode))'],
+    ['33333074344563'],
+];
+
+
+my $dbh = C4::Context->dbh();
+
+my %args = (
+    year        => '2012',
+    mon         => '07',
+    day         => '30',
+    tag         => '952',
+    subfield    => 'p',
+    loctag      => '952',
+    locsubfield => 'a'
+);
+
+$dbh->{mock_add_resultset} = $incrementaldata;
+my ($nextnum, $scr, $history);
+
+($nextnum, $scr) = C4::Barcodes::ValueBuilder::incremental::get_barcode(\%args);
+is($nextnum, 33333074344564, 'incremental barcode');
+is($scr, undef, 'incremental javascript');
+
+# This should run exactly one query so we can test
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 1, 'Correct number of statements executed for incremental barcode') ;
+
+my $hbyymmincrdata = [
+    ['number'],
+    ['890'],
+];
+
+$dbh->{mock_add_resultset} = $hbyymmincrdata;
+$dbh->{mock_clear_history} = 1;
+($nextnum, $scr) = C4::Barcodes::ValueBuilder::hbyymmincr::get_barcode(\%args);
+is($nextnum, '12070891', 'hbyymmincr barcode');
+ok(length($scr) > 0, 'hbyymmincr javascript');
+
+# This should run exactly one query so we can test
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 1, 'Correct number of statements executed for hbyymmincr barcode') ;
+
+my $annualdata = [
+    ['max(cast( substring_index(barcode, \'-\',-1) as signed))'],
+    ['34'],
+];
+
+$dbh->{mock_add_resultset} = $annualdata;
+$dbh->{mock_clear_history} = 1;
+($nextnum, $scr) = C4::Barcodes::ValueBuilder::annual::get_barcode(\%args);
+is($nextnum, '2012-0035', 'annual barcode');
+is($scr, undef, 'annual javascript');
+
+# This should run exactly one query so we can test
+$history = $dbh->{mock_all_history};
+is(scalar(@{$history}), 1, 'Correct number of statements executed for hbyymmincr barcode') ;
index d2690f7..283300e 100755 (executable)
-#!/usr/bin/perl
-#
-# This Koha test module is a stub!  
-# Add more tests here!!!
+#!/usr/bin/env perl
 
 use strict;
 use warnings;
-
-use Test::More tests => 1;
+use DateTime;
+use Test::More tests => 21;
+use Koha::DateUtils;
 
 BEGIN {
-        use_ok('C4::Calendar');
+    use_ok('Koha::Calendar');
+
+    # This was the only test C4 had
+    # Remove when no longer used
+    use_ok('C4::Calendar');
 }
 
+my $cal = Koha::Calendar->new( TEST_MODE => 1 );
+
+isa_ok( $cal, 'Koha::Calendar', 'Calendar class returned' );
+
+my $saturday = DateTime->new(
+    year      => 2011,
+    month     => 6,
+    day       => 25,
+    time_zone => 'Europe/London',
+);
+my $sunday = DateTime->new(
+    year      => 2011,
+    month     => 6,
+    day       => 26,
+    time_zone => 'Europe/London',
+);
+my $monday = DateTime->new(
+    year      => 2011,
+    month     => 6,
+    day       => 27,
+    time_zone => 'Europe/London',
+);
+my $bloomsday = DateTime->new(
+    year      => 2011,
+    month     => 6,
+    day       => 16,
+    time_zone => 'Europe/London',
+);    # should be a holiday
+my $special = DateTime->new(
+    year      => 2011,
+    month     => 6,
+    day       => 1,
+    time_zone => 'Europe/London',
+);    # should be a holiday
+my $notspecial = DateTime->new(
+    year      => 2011,
+    month     => 6,
+    day       => 2,
+    time_zone => 'Europe/London',
+);    # should NOT be a holiday
+
+is( $cal->is_holiday($sunday), 1, 'Sunday is a closed day' );   # wee free test;
+is( $cal->is_holiday($monday),     0, 'Monday is not a closed day' );    # alas
+is( $cal->is_holiday($bloomsday),  1, 'month/day closed day test' );
+is( $cal->is_holiday($special),    1, 'special closed day test' );
+is( $cal->is_holiday($notspecial), 0, 'open day test' );
+
+my $dt = $cal->addDate( $saturday, 1, 'days' );
+is( $dt->day_of_week, 1, 'addDate skips closed Sunday' );
+
+$dt = $cal->addDate( $bloomsday, -1 );
+is( $dt->ymd(), '2011-06-15', 'Negative call to addDate' );
+
+my $test_dt = DateTime->new(    # Monday
+    year      => 2012,
+    month     => 7,
+    day       => 23,
+    hour      => 11,
+    minute    => 53,
+    time_zone => 'Europe/London',
+);
+
+my $later_dt = DateTime->new(    # Monday
+    year      => 2012,
+    month     => 9,
+    day       => 17,
+    hour      => 17,
+    minute    => 30,
+    time_zone => 'Europe/London',
+);
+
+my $daycount = $cal->days_between( $test_dt, $later_dt );
+cmp_ok( $daycount->in_units('days'),
+    '==', 48, 'days_between calculates correctly' );
+
+my $ret = $cal->addDate( $test_dt, 1, 'days' );
+
+cmp_ok( $ret->ymd(), 'eq', '2012-07-24', 'Simple Single Day Add (Calendar)' );
+
+$ret = $cal->addDate( $test_dt, 7, 'days' );
+cmp_ok( $ret->ymd(), 'eq', '2012-07-31', 'Add 7 days Calendar mode' );
+$cal->set_daysmode('Datedue');
+$ret = $cal->addDate( $test_dt, 7, 'days' );
+cmp_ok( $ret->ymd(), 'eq', '2012-07-30', 'Add 7 days Datedue mode' );
+$cal->set_daysmode('Days');
+$ret = $cal->addDate( $test_dt, 7, 'days' );
+cmp_ok( $ret->ymd(), 'eq', '2012-07-30', 'Add 7 days Days mode' );
+$cal->set_daysmode('Calendar');
+
+# example tests for bug report
+$cal->clear_weekly_closed_days();
+
+$daycount = $cal->days_between( dt_from_string('2012-01-10','iso'),
+    dt_from_string("2012-05-05",'iso') )->in_units('days');
+cmp_ok( $daycount, '==', 116, 'test larger intervals' );
+$daycount = $cal->days_between( dt_from_string("2012-01-01",'iso'),
+    dt_from_string("2012-05-05",'iso') )->in_units('days');
+cmp_ok( $daycount, '==', 125, 'test positive intervals' );
+my $daycount2 = $cal->days_between( dt_from_string("2012-05-05",'iso'),
+    dt_from_string("2012-01-01",'iso') )->in_units('days');
+cmp_ok( $daycount2, '==', $daycount, 'test parameter order not relevant' );
+$daycount = $cal->days_between( dt_from_string("2012-07-01",'iso'),
+    dt_from_string("2012-07-15",'iso') )->in_units('days');
+cmp_ok( $daycount, '==', 14, 'days_between calculates correctly' );
+$cal->add_holiday( dt_from_string('2012-07-06','iso') );
+$daycount = $cal->days_between( dt_from_string("2012-07-01",'iso'),
+    dt_from_string("2012-07-15",'iso') )->in_units('days');
+cmp_ok( $daycount, '==', 13, 'holiday correctly recognized' );
+
+$cal->add_holiday( dt_from_string('2012-07-07','iso') );
+$daycount = $cal->days_between( dt_from_string("2012-07-01",'iso'),
+    dt_from_string("2012-07-15",'iso') )->in_units('days');
+cmp_ok( $daycount, '==', 12, 'multiple holidays correctly recognized' );
index 9c4a6e6..f76f7fc 100644 (file)
@@ -4,7 +4,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 24;
+use Test::More tests => 26;
 C4::Context->_new_userenv(123456);
 C4::Context->set_userenv(1,'kmkale' , 1, 'kk1' , 'IMS', 0, 'kmkale@anantcorp.com');
 
@@ -18,6 +18,7 @@ our %inputs = (
     whitespace => [" 26002315", "26002315 ", "\n\t26002315\n"],
     'T-prefix' => [qw(T0031472 T32)],
     'libsuite8' => ['b000126', 'b12', 'B0126', 'IMS-B-126', 'ims-b-126','CD0000024','00123','11998'],
+    EAN13      => [qw(892685001928 695152)],
     other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
 );
 our %outputs = (
@@ -25,6 +26,7 @@ our %outputs = (
     whitespace => [qw(26002315 26002315 26002315)],
     'T-prefix' => [qw(T0031472 T0000002         )],
     'libsuite8' => ['IMS-b-126', 'IMS-b-12', 'IMS-B-126', 'IMS-B-126', 'ims-b-126','IMS-CD-24','IMS-b-123','IMS-b-11998'],
+    EAN13      => [qw(0892685001928 0000000695152)],
     other      => [qw(26002315 T0031472 T32 Alphanum123), "Alpha Num 345"],
 );
     
diff --git a/t/Kalendar.t b/t/Kalendar.t
deleted file mode 100755 (executable)
index 5d219b2..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-use strict;
-use warnings;
-use 5.010;
-use DateTime;
-use DateTime::TimeZone;
-
-use C4::Context;
-use Test::More tests => 9;
-
-BEGIN { use_ok('Koha::Calendar'); }
-
-my $cal = Koha::Calendar->new( TEST_MODE => 1 );
-
-isa_ok( $cal, 'Koha::Calendar', 'Calendar class returned' );
-
-my $saturday = DateTime->new(
-    year      => 2011,
-    month     => 6,
-    day       => 25,
-    time_zone => 'Europe/London',
-);
-my $sunday = DateTime->new(
-    year      => 2011,
-    month     => 6,
-    day       => 26,
-    time_zone => 'Europe/London',
-);
-my $monday = DateTime->new(
-    year      => 2011,
-    month     => 6,
-    day       => 27,
-    time_zone => 'Europe/London',
-);
-my $bloomsday = DateTime->new(
-    year      => 2011,
-    month     => 6,
-    day       => 16,
-    time_zone => 'Europe/London',
-);    # should be a holiday
-my $special = DateTime->new(
-    year      => 2011,
-    month     => 6,
-    day       => 1,
-    time_zone => 'Europe/London',
-);    # should be a holiday
-my $notspecial = DateTime->new(
-    year      => 2011,
-    month     => 6,
-    day       => 2,
-    time_zone => 'Europe/London',
-);    # should NOT be a holiday
-is( $cal->is_holiday($sunday), 1, 'Sunday is a closed day' );   # wee free test;
-is( $cal->is_holiday($monday),     0, 'Monday is not a closed day' );    # alas
-is( $cal->is_holiday($bloomsday),  1, 'month/day closed day test' );
-is( $cal->is_holiday($special),    1, 'special closed day test' );
-is( $cal->is_holiday($notspecial), 0, 'open day test' );
-
-my $dt = $cal->addDate( $saturday, 1, 'days' );
-is( $dt->day_of_week, 1, 'addDate skips closed Sunday' );
-
-$dt = $cal->addDate( $bloomsday, -1 );
-is( $dt->ymd(), '2011-06-15', 'Negative call to addDate' );
index cd50178..3fb9ce8 100755 (executable)
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 49;
+use Test::More tests => 66;
 BEGIN {
        use FindBin;
        use lib $FindBin::Bin;
@@ -14,6 +14,7 @@ my %thash = (
        incremental => [],
        annual => [],
        hbyymmincr => ['MAIN'],
+    EAN13 => ['0000000695152','892685001928'],
 );
 
 print "\n";
index d3ad16f..3ef8427 100755 (executable)
@@ -26,38 +26,107 @@ use C4::AuthoritiesMarc; # GetAuthority
 use CGI;
 use C4::Koha;    # GetItemTypes
 use C4::Branch;  # GetBranches
-use Data::Dumper;
+use C4::Record;
+use Getopt::Long;
 
 my $query = new CGI;
-my $op=$query->param("op") || '';
-my $filename=$query->param("filename");
-$filename =~ s/(\r|\n)//;
-my $dbh=C4::Context->dbh;
-my $marcflavour = C4::Context->preference("marcflavour");
 
-my ($template, $loggedinuser, $cookie, $flags)
-    = get_template_and_user
-    (
-        {
-            template_name => "tools/export.tmpl",
-            query => $query,
-            type => "intranet",
-            authnotrequired => 0,
-            flagsrequired => {tools => 'export_catalog'},
-            debug => 1,
-            }
+my $op;
+my $filename;
+my $dbh         = C4::Context->dbh;
+my $marcflavour = C4::Context->preference("marcflavour");
+my $clean;
+my $output_format;
+my $dont_export_items;
+my $deleted_barcodes;
+my $timestamp;
+my $record_type;
+my $help;
+
+# Checks if the script is called from commandline
+my $commandline = not defined $ENV{GATEWAY_INTERFACE};
+
+if ( $commandline ) {
+
+    # Getting parameters
+    $op = 'export';
+    GetOptions(
+        'format=s' => \$output_format,
+        'date=s' => \$timestamp,
+        'dont_export_items' => \$dont_export_items,
+        'deleted_barcodes' => \$deleted_barcodes,
+        'clean' => \$clean,
+        'filename=s' => \$filename,
+        'record-type=s' => \$record_type,
+        'help|?' => \$help
     );
 
-       my $limit_ind_branch=(C4::Context->preference('IndependantBranches') &&
-              C4::Context->userenv &&
-              !(C4::Context->userenv->{flags} & 1) &&
-              C4::Context->userenv->{branch}?1:0);
-       my $branches = GetBranches($limit_ind_branch);    
-    my $branch                = $query->param("branch") || '';
-       if ( C4::Context->preference("IndependantBranches") &&
-         !(C4::Context->userenv->{flags} & 1) ) {
-       $branch = C4::Context->userenv->{'branch'};
-       }
+    if ($help) {
+        print <<_USAGE_;
+export.pl [--format=format] [--date=date] [--record-type=TYPE] [--dont_export_items] [--deleted_barcodes] [--clean] --filename=outputfile
+
+
+ --format=FORMAT        FORMAT is either 'xml' or 'marc' (default)
+
+ --date=DATE            DATE should be entered as the 'dateformat' syspref is
+                        set (dd/mm/yyyy for metric, yyyy-mm-dd for iso,
+                        mm/dd/yyyy for us) records exported are the ones that
+                        have been modified since DATE
+
+ --record-type=TYPE     TYPE is 'bibs' or 'auths'
+
+ --deleted_barcodes     If used, a list of barcodes of items deleted since DATE
+                        is produced (or from all deleted items if no date is
+                        specified). Used only if TYPE is 'bibs'
+
+ --clean                removes NSE/NSB
+_USAGE_
+        exit;
+    }
+
+    # Default parameters values :
+    $output_format     ||= 'marc';
+    $timestamp         ||= '';
+    $dont_export_items ||= 0;
+    $deleted_barcodes  ||= 0;
+    $clean             ||= 0;
+    $record_type       ||= "bibs";
+
+    # Redirect stdout
+    open STDOUT, '>', $filename if $filename;
+
+} else {
+
+    $op          = $query->param("op") || '';
+    $filename    = $query->param("filename") || 'koha.mrc';
+    $filename =~ s/(\r|\n)//;
+
+}
+
+my ($template, $loggedinuser, $cookie, $flags) = get_template_and_user(
+    {
+        template_name => "tools/export.tmpl",
+        query => $query,
+        type => "intranet",
+        authnotrequired => $commandline,
+        flagsrequired => {tools => 'export_catalog'},
+        debug => 1,
+    }
+);
+
+my $limit_ind_branch = (
+    C4::Context->preference('IndependantBranches') &&
+    C4::Context->userenv &&
+    !(C4::Context->userenv->{flags} & 1) &&
+    C4::Context->userenv->{branch}
+) ? 1 : 0;
+
+my $branch = $query->param("branch") || '';
+if ( C4::Context->preference("IndependantBranches") &&
+     C4::Context->userenv &&
+     !(C4::Context->userenv->{flags} & 1) ) {
+    $branch = C4::Context->userenv->{'branch'};
+}
 
 my $backupdir = C4::Context->config('backupdir');
 
@@ -74,12 +143,14 @@ if ($op eq "export") {
         binmode STDOUT;
         $charset = '';
     }
-    print $query->header(   -type => $mimetype,
-                            -charset => $charset,
-                            -attachment=>$filename);
-     
-    my $record_type        = $query->param("record_type");
-    my $output_format      = $query->param("output_format");
+    print $query->header(
+        -type => $mimetype,
+        -charset => $charset,
+        -attachment => $filename
+    ) unless ($commandline);
+
+    $record_type           = $query->param("record_type") unless ($commandline);
+    $output_format         = $query->param("output_format") || 'marc' unless ($commandline);
     my $dont_export_fields = $query->param("dont_export_fields");
     my @sql_params;
     my $sql_query;
@@ -89,6 +160,7 @@ if ($op eq "export") {
     my $itemtype             = $query->param("itemtype");
     my $start_callnumber     = $query->param("start_callnumber");
     my $end_callnumber       = $query->param("end_callnumber");
+    $timestamp = ($timestamp) ? C4::Dates->new($timestamp) : '' if ($commandline);
     my $start_accession =
       ( $query->param("start_accession") )
       ? C4::Dates->new( $query->param("start_accession") )
@@ -97,62 +169,92 @@ if ($op eq "export") {
       ( $query->param("end_accession") )
       ? C4::Dates->new( $query->param("end_accession") )
       : '';
-    my $dont_export_items    = $query->param("dont_export_item");
+    $dont_export_items    = $query->param("dont_export_item") unless ($commandline);
     my $strip_nonlocal_items = $query->param("strip_nonlocal_items");
 
+    my $biblioitemstable = ($commandline and $deleted_barcodes)
+                                ? 'deletedbiblioitems'
+                                : 'biblioitems';
+    my $itemstable = ($commandline and $deleted_barcodes)
+                                ? 'deleteditems'
+                                : 'items';
+
     my $starting_authid = $query->param('starting_authid');
     my $ending_authid   = $query->param('ending_authid');
     my $authtype        = $query->param('authtype');
 
     if ( $record_type eq 'bibs' ) {
-        my $items_filter =
-            $branch || $start_callnumber || $end_callnumber ||
-            $start_accession || $end_accession ||
-            ($itemtype && C4::Context->preference('item-level_itypes'));
-        $sql_query = $items_filter ?
-            "SELECT DISTINCT biblioitems.biblionumber
-            FROM biblioitems JOIN items
-            USING (biblionumber) WHERE 1"
-            :
-            "SELECT biblioitems.biblionumber FROM biblioitems WHERE biblionumber >0 ";
-
-        if ( $StartingBiblionumber ) {
-            $sql_query .= " AND biblioitems.biblionumber >= ? ";
-            push @sql_params, $StartingBiblionumber;
-        }
+        if ($timestamp) {
+            # Specific query when timestamp is used
+            # Actually it's used only with CLI and so all previous filters
+            # are not used.
+            # If one day timestamp is used via the web interface, this part will
+            # certainly have to be rewrited
+            $sql_query = " (
+                SELECT biblionumber
+                FROM $biblioitemstable
+                  LEFT JOIN items USING(biblionumber)
+                WHERE $biblioitemstable.timestamp >= ?
+                  OR items.timestamp >= ?
+            ) UNION (
+                SELECT biblionumber
+                FROM $biblioitemstable
+                  LEFT JOIN deleteditems USING(biblionumber)
+                WHERE $biblioitemstable.timestamp >= ?
+                  OR deleteditems.timestamp >= ?
+            ) ";
+            my $ts = $timestamp->output('iso');
+            @sql_params = ($ts, $ts, $ts, $ts);
+        } else {
+            my $items_filter =
+                $branch || $start_callnumber || $end_callnumber ||
+                $start_accession || $timestamp || $end_accession ||
+                ($itemtype && C4::Context->preference('item-level_itypes'));
+            $sql_query = $items_filter ?
+                "SELECT DISTINCT $biblioitemstable.biblionumber
+                FROM $biblioitemstable JOIN $itemstable
+                USING (biblionumber) WHERE 1"
+                :
+                "SELECT $biblioitemstable.biblionumber FROM $biblioitemstable WHERE biblionumber >0 ";
+
+            if ( $StartingBiblionumber ) {
+                $sql_query .= " AND $biblioitemstable.biblionumber >= ? ";
+                push @sql_params, $StartingBiblionumber;
+            }
 
-        if ( $EndingBiblionumber ) {
-            $sql_query .= " AND biblioitems.biblionumber <= ? ";
-            push @sql_params, $EndingBiblionumber;
-        }
+            if ( $EndingBiblionumber ) {
+                $sql_query .= " AND $biblioitemstable.biblionumber <= ? ";
+                push @sql_params, $EndingBiblionumber;
+            }
 
-        if ($branch) {
-            $sql_query .= " AND homebranch = ? ";
-            push @sql_params, $branch;
-        }
+            if ($branch) {
+                $sql_query .= " AND homebranch = ? ";
+                push @sql_params, $branch;
+            }
 
-        if ($start_callnumber) {
-            $sql_query .= " AND itemcallnumber <= ? ";
-            push @sql_params, $start_callnumber;
-        }
+            if ($start_callnumber) {
+                $sql_query .= " AND itemcallnumber <= ? ";
+                push @sql_params, $start_callnumber;
+            }
 
-        if ($end_callnumber) {
-            $sql_query .= " AND itemcallnumber >= ? ";
-            push @sql_params, $end_callnumber;
-        }
-        if ($start_accession) {
-            $sql_query .= " AND dateaccessioned >= ? ";
-            push @sql_params, $start_accession->output('iso');
-        }
+            if ($end_callnumber) {
+                $sql_query .= " AND itemcallnumber >= ? ";
+                push @sql_params, $end_callnumber;
+            }
+            if ($start_accession) {
+                $sql_query .= " AND dateaccessioned >= ? ";
+                push @sql_params, $start_accession->output('iso');
+            }
 
-        if ($end_accession) {
-            $sql_query .= " AND dateaccessioned <= ? ";
-            push @sql_params, $end_accession->output('iso');
-        }
+            if ($end_accession) {
+                $sql_query .= " AND dateaccessioned <= ? ";
+                push @sql_params, $end_accession->output('iso');
+            }
 
-        if ( $itemtype ) {
-            $sql_query .= (C4::Context->preference('item-level_itypes')) ? " AND items.itype = ? " : " AND biblioitems.itemtype = ?";
-            push @sql_params, $itemtype;
+            if ( $itemtype ) {
+                $sql_query .= (C4::Context->preference('item-level_itypes')) ? " AND items.itype = ? " : " AND biblioitems.itemtype = ?";
+                push @sql_params, $itemtype;
+            }
         }
     }
     elsif ( $record_type eq 'auths' ) {
@@ -207,61 +309,74 @@ if ($op eq "export") {
     $sth->execute(@sql_params);
 
     while ( my ($recordid) = $sth->fetchrow ) {
-        my $record;
-        if ( $record_type eq 'bibs' ) {
-            $record = eval { GetMarcBiblio($recordid); };
-
-     # FIXME: decide how to handle records GetMarcBiblio can't parse or retrieve
-            if ($@) {
-                next;
+        if ( $deleted_barcodes ) {
+            my $q = "
+                SELECT DISTINCT barcode
+                FROM deleteditems
+                WHERE deleteditems.biblionumber = ?
+            ";
+            my $sth = $dbh->prepare($q);
+            $sth->execute($recordid);
+            while (my $row = $sth->fetchrow_array) {
+                print "$row\n";
             }
-            next if not defined $record;
-            C4::Biblio::EmbedItemsInMarcBiblio( $record, $recordid )
-              unless $dont_export_items;
-            if ( $strip_nonlocal_items || $limit_ind_branch ) {
-                my ( $homebranchfield, $homebranchsubfield ) =
-                  GetMarcFromKohaField( 'items.homebranch', '' );
-                for my $itemfield ( $record->field($homebranchfield) ) {
-
-# if stripping nonlocal items, use loggedinuser's branch if they didn't select one
-                    $branch = C4::Context->userenv->{'branch'} unless $branch;
-                    $record->delete_field($itemfield)
-                      if (
-                        $itemfield->subfield($homebranchsubfield) ne $branch );
+        } else {
+            my $record;
+            if ( $record_type eq 'bibs' ) {
+                $record = eval { GetMarcBiblio($recordid); };
+
+                if ($@) {
+                    next;
+                }
+                next if not defined $record;
+                C4::Biblio::EmbedItemsInMarcBiblio( $record, $recordid )
+                  unless $dont_export_items;
+                if ( $strip_nonlocal_items || $limit_ind_branch ) {
+                    my ( $homebranchfield, $homebranchsubfield ) =
+                      GetMarcFromKohaField( 'items.homebranch', '' );
+                    for my $itemfield ( $record->field($homebranchfield) ) {
+
+    # if stripping nonlocal items, use loggedinuser's branch if they didn't select one
+                        $branch = C4::Context->userenv->{'branch'} unless $branch;
+                        $record->delete_field($itemfield)
+                          if (
+                            $itemfield->subfield($homebranchsubfield) ne $branch );
+                    }
                 }
             }
-        }
-        elsif ( $record_type eq 'auths' ) {
-            $record = C4::AuthoritiesMarc::GetAuthority($recordid);
-            next if not defined $record;
-        }
+            elsif ( $record_type eq 'auths' ) {
+                $record = C4::AuthoritiesMarc::GetAuthority($recordid);
+                next if not defined $record;
+            }
 
-        if ( $dont_export_fields ) {
-            my @fields = split " ", $dont_export_fields;
-            foreach ( @fields ) {
-                /^(\d*)(\w)?$/;
-                my $field = $1;
-                my $subfield = $2;
-                # skip if this record doesn't have this field
-                next if not defined $record->field($field);
-                if( $subfield ) {
-                    $record->field($field)->delete_subfields($subfield);
+            if ( $dont_export_fields ) {
+                my @fields = split " ", $dont_export_fields;
+                foreach ( @fields ) {
+                    /^(\d*)(\w)?$/;
+                    my $field = $1;
+                    my $subfield = $2;
+                    # skip if this record doesn't have this field
+                    next if not defined $record->field($field);
+                    if( $subfield ) {
+                        $record->field($field)->delete_subfields($subfield);
+                    }
+                    else {
+                        $record->delete_field($record->field($field));
+                    }
                 }
-                else {
-                    $record->delete_field($record->field($field));
+            }
+            RemoveAllNsb($record) if ($clean);
+            if ( $output_format eq "xml" ) {
+                if ($marcflavour eq 'UNIMARC' && $record_type eq 'auths') {
+                    print $record->as_xml_record('UNIMARCAUTH');
+                } else {
+                    print $record->as_xml_record($marcflavour);
                 }
             }
-        }
-        if ( $output_format eq "xml" ) {
-            if ($marcflavour eq 'UNIMARC' && $record_type eq 'auths') {
-                print $record->as_xml_record('UNIMARCAUTH');
-            } else {
-                print $record->as_xml_record($marcflavour);
+            else {
+                print $record->as_usmarc();
             }
         }
-        else {
-            print $record->as_usmarc();
-        }
     }
     exit;
 
@@ -279,6 +394,7 @@ else {
             );
        push @itemtypesloop, \%row;
     }
+    my $branches = GetBranches($limit_ind_branch);
     my @branchloop;
     for my $thisbranch (
         sort { $branches->{$a}->{branchname} cmp $branches->{$b}->{branchname} }
@@ -317,6 +433,7 @@ else {
         itemtypeloop             => \@itemtypesloop,
         DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
         authtypeloop             => \@authtypesloop,
+        dont_export_fields       => C4::Context->preference("DontExportFields"),
     );
 
     output_html_with_http_headers $query, $cookie, $template->output;
@@ -331,7 +448,7 @@ sub getbackupfilelist {
     if ( opendir(my $dir, $directory) ) {
         while (my $file = readdir($dir)) {
             next unless ( $file =~ m/\.$extension(\.(gz|bz2|xz))?/ );
-            push @files, $file if ( -f "$backupdir/$file" && -r "$backupdir/$file" );
+            push @files, $file if ( -f "$directory/$file" && -r "$directory/$file" );
         }
         closedir($dir);
     }
@@ -345,7 +462,8 @@ sub download_backup {
     my $filename  = $args->{filename};
 
     return unless ( $directory && -d $directory );
-    return unless ( $filename =~ m/$extension(\.(gz|bz2|xz))?$/ && not $filename =~ m#|# );
+    return unless ( $filename =~ m/\.$extension(\.(gz|bz2|xz))?$/ );
+    return if ( $filename =~ m#/# );
     $filename = "$directory/$filename";
     return unless ( -f $filename && -r $filename );
     return unless ( open(my $dump, '<', $filename) );
diff --git a/xt/author/test_template.pl b/xt/author/test_template.pl
deleted file mode 100755 (executable)
index 1414d4b..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2009 LibLime
-# 
-# This file is part of Koha.
-#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-use strict;
-use warnings;
-
-=head1 NAME
-
-test_template.pl
-
-=head2 DESCRIPTION
-
-This helper script is invoked by xt/author/valid-templates.t
-and tests a template for basic syntax errors by having
-HTML::Template::Pro parse it.
-
-=cut
-
-use FindBin qw($Bin);
-use HTML::Template::Pro;
-
-my $filename    = $ARGV[0];
-my $include_dir = $ARGV[1];
-
-my $template = HTML::Template::Pro->new(
-    filename          => $filename,
-    die_on_bad_params => 1,
-    global_vars       => 1,
-    case_sensitive    => 1,
-    loop_context_vars => 1,     # enable: __first__, __last__, __inner__, __odd__, __counter__ 
-    path              => [$include_dir],
-);
-
-$template->output; # tossing output
-
-=head1 AUTHOR
-
-Koha Development Team <http://koha-community.org/>
-
-Galen Charlton <galen.charlton@liblime.com>
-
-=cut