Record payment by a patron. C<$borrowernumber> is the patron's
borrower number. C<$payment> is a floating-point number, giving the
-amount that was paid.
+amount that was paid.
Amounts owed are paid off oldest first. That is, if the patron has a
$1 fine from Feb. 1, another $1 fine from Mar. 1, and makes a payment
$newamtos = $accdata->{'amountoutstanding'} - $amountleft;
$amountleft = 0;
}
- my $thisacct = $accdata->{accountno};
+ my $thisacct = $accdata->{accountlines_id};
my $usth = $dbh->prepare(
"UPDATE accountlines SET amountoutstanding= ?
- WHERE (borrowernumber = ?) AND (accountno=?)"
+ WHERE (accountlines_id = ?)"
);
- $usth->execute( $newamtos, $borrowernumber, $thisacct );
+ $usth->execute( $newamtos, $thisacct );
$usth->finish;
# $usth = $dbh->prepare(
# "INSERT INTO accountoffsets
=head2 makepayment
- &makepayment($borrowernumber, $acctnumber, $amount, $branchcode);
+ &makepayment($accountlines_id, $borrowernumber, $acctnumber, $amount, $branchcode);
Records the fact that a patron has paid off the entire amount he or
she owes.
#here we update both the accountoffsets and the account lines
#updated to check, if they are paying off a lost item, we return the item
# from their card, and put a note on the item record
- my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_;
+ my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch ) = @_;
my $dbh = C4::Context->dbh;
my $manager_id = 0;
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
# begin transaction
my $nextaccntno = getnextacctno($borrowernumber);
my $newamtos = 0;
- my $sth =
- $dbh->prepare(
- "SELECT * FROM accountlines WHERE borrowernumber=? AND accountno=?");
- $sth->execute( $borrowernumber, $accountno );
+ my $sth = $dbh->prepare("SELECT * FROM accountlines WHERE accountlines_id=?");
+ $sth->execute( $accountlines_id );
my $data = $sth->fetchrow_hashref;
$sth->finish;
$dbh->prepare(
"UPDATE accountlines
SET amountoutstanding = 0, description = 'Payment,thanks'
- WHERE borrowernumber = ?
- AND accountno = ?
+ WHERE accountlines_id = ?
"
);
- $udp->execute($borrowernumber, $accountno );
+ $udp->execute($accountlines_id);
$udp->finish;
}else{
my $udp =
$dbh->prepare(
"UPDATE accountlines
SET amountoutstanding = 0
- WHERE borrowernumber = ?
- AND accountno = ?
+ WHERE accountlines_id = ?
"
);
- $udp->execute($borrowernumber, $accountno );
+ $udp->execute($accountlines_id);
$udp->finish;
# create new line
if ( $data->{'accounttype'} eq 'Rep' || $data->{'accounttype'} eq 'L' ) {
C4::Circulation::ReturnLostItem( $borrowernumber, $data->{'itemnumber'} );
}
+ my $sthr = $dbh->prepare("SELECT max(accountlines_id) AS lastinsertid FROM accountlines");
+ $sthr->execute();
+ my $datalastinsertid = $sthr->fetchrow_hashref;
+ $sthr->finish;
+ return $datalastinsertid->{'lastinsertid'};
}
=head2 getnextacctno
#'
# FIXME - Okay, so what does the above actually _mean_?
-sub getnextacctno ($) {
- my ($borrowernumber) = shift or return undef;
+sub getnextacctno {
+ my ($borrowernumber) = shift or return;
my $sth = C4::Context->dbh->prepare(
"SELECT accountno+1 FROM accountlines
- WHERE (borrowernumber = ?)
- ORDER BY accountno DESC
- LIMIT 1"
+ WHERE (borrowernumber = ?)
+ ORDER BY accountno DESC
+ LIMIT 1"
);
$sth->execute($borrowernumber);
return ($sth->fetchrow || 1);
=head2 fixaccounts (removed)
- &fixaccounts($borrowernumber, $accountnumber, $amount);
+ &fixaccounts($accountlines_id, $borrowernumber, $accountnumber, $amount);
#'
# FIXME - I don't understand what this function does.
sub fixaccounts {
- my ( $borrowernumber, $accountno, $amount ) = @_;
+ my ( $accountlines_id, $borrowernumber, $accountno, $amount ) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare(
- "SELECT * FROM accountlines WHERE borrowernumber=?
- AND accountno=?"
+ "SELECT * FROM accountlines WHERE accountlines_id=?"
);
- $sth->execute( $borrowernumber, $accountno );
+ $sth->execute( $accountlines_id );
my $data = $sth->fetchrow_hashref;
# FIXME - Error-checking
UPDATE accountlines
SET amount = '$amount',
amountoutstanding = '$outstanding'
- WHERE borrowernumber = $borrowernumber
- AND accountno = $accountno
+ WHERE accountlines_id = $accountlines_id
EOT
# FIXME: exceedingly bad form. Use prepare with placholders ("?") in query and execute args.
}
$newamtos = $accdata->{'amountoutstanding'} - $amountleft;
$amountleft = 0;
}
- my $thisacct = $accdata->{accountno};
+ my $thisacct = $accdata->{accountlines_id};
my $usth = $dbh->prepare(
"UPDATE accountlines SET amountoutstanding= ?
- WHERE (borrowernumber = ?) AND (accountno=?)"
+ WHERE (accountlines_id = ?)"
);
- $usth->execute( $newamtos, $borrowernumber, $thisacct );
+ $usth->execute( $newamtos, $thisacct );
$usth->finish;
$usth = $dbh->prepare(
"INSERT INTO accountoffsets
$newamtos = $accdata->{'amountoutstanding'} - $amountleft;
$amountleft = 0;
}
- my $thisacct = $accdata->{accountno};
+ my $thisacct = $accdata->{accountlines_id};
my $usth = $dbh->prepare(
"UPDATE accountlines SET amountoutstanding= ?
- WHERE (borrowernumber = ?) AND (accountno=?)"
+ WHERE (accountlines_id = ?)"
);
- $usth->execute( $newamtos, $borrowernumber, $thisacct );
+ $usth->execute( $newamtos, $thisacct );
$usth->finish;
$usth = $dbh->prepare(
"INSERT INTO accountoffsets
}
# print $amountleft;
- my $thisacct = $accdata->{accountno};
+ my $thisacct = $accdata->{accountlines_id};
my $usth = $dbh->prepare(
"UPDATE accountlines SET amountoutstanding= ?
- WHERE (borrowernumber = ?) AND (accountno=?)"
+ WHERE (accountlines_id = ?)"
);
- $usth->execute( $newamtos, $borrowernumber, $thisacct );
+ $usth->execute( $newamtos, $thisacct );
$usth->finish;
$usth = $dbh->prepare(
"INSERT INTO accountoffsets
}
sub ModNote {
- my ( $borrowernumber, $accountno, $note ) = @_;
+ my ( $accountlines_id, $note ) = @_;
my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare('UPDATE accountlines SET note = ? WHERE borrowernumber = ? AND accountno = ?');
- $sth->execute( $note, $borrowernumber, $accountno );
+ my $sth = $dbh->prepare('UPDATE accountlines SET note = ? WHERE accountlines_id = ?');
+ $sth->execute( $note, $accountlines_id );
}
sub getcredits {
}
sub ReversePayment {
- my ( $borrowernumber, $accountno ) = @_;
- my $dbh = C4::Context->dbh;
-
- my $sth = $dbh->prepare('SELECT amountoutstanding FROM accountlines WHERE borrowernumber = ? AND accountno = ?');
- $sth->execute( $borrowernumber, $accountno );
- my $row = $sth->fetchrow_hashref();
- my $amount_outstanding = $row->{'amountoutstanding'};
-
- if ( $amount_outstanding <= 0 ) {
- $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = amount * -1, description = CONCAT( description, " Reversed -" ) WHERE borrowernumber = ? AND accountno = ?');
- $sth->execute( $borrowernumber, $accountno );
- } else {
- $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = 0, description = CONCAT( description, " Reversed -" ) WHERE borrowernumber = ? AND accountno = ?');
- $sth->execute( $borrowernumber, $accountno );
- }
+ my ( $accountlines_id ) = @_;
+ my $dbh = C4::Context->dbh;
+
+ my $sth = $dbh->prepare('SELECT amountoutstanding FROM accountlines WHERE accountlines_id = ?');
+ $sth->execute( $accountlines_id );
+ my $row = $sth->fetchrow_hashref();
+ my $amount_outstanding = $row->{'amountoutstanding'};
+
+ if ( $amount_outstanding <= 0 ) {
+ $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = amount * -1, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?');
+ $sth->execute( $accountlines_id );
+ } else {
+ $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding = 0, description = CONCAT( description, " Reversed -" ) WHERE accountlines_id = ?');
+ $sth->execute( $accountlines_id );
+ }
}
=head2 recordpayment_selectaccts
# offset transactions
my $sth = $dbh->prepare('UPDATE accountlines SET amountoutstanding= ? ' .
- 'WHERE (borrowernumber = ?) AND (accountno=?)');
+ 'WHERE accountlines_id=?');
for my $accdata ( @{$rows} ) {
if ($amountleft == 0) {
last;
$newamtos = $accdata->{amountoutstanding} - $amountleft;
$amountleft = 0;
}
- my $thisacct = $accdata->{accountno};
- $sth->execute( $newamtos, $borrowernumber, $thisacct );
+ my $thisacct = $accdata->{accountlines_id};
+ $sth->execute( $newamtos, $thisacct );
}
# create new line
# makepayment needs to be fixed to handle partials till then this separate subroutine
# fills in
sub makepartialpayment {
- my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_;
+ my ( $accountlines_id, $borrowernumber, $accountno, $amount, $user, $branch ) = @_;
my $manager_id = 0;
$manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
if (!$amount || $amount < 0) {
my $newamtos = 0;
my $data = $dbh->selectrow_hashref(
- 'SELECT * FROM accountlines WHERE borrowernumber=? AND accountno=?',undef,$borrowernumber,$accountno);
+ 'SELECT * FROM accountlines WHERE accountlines_id=?',undef,$accountlines_id);
my $new_outstanding = $data->{amountoutstanding} - $amount;
- my $update = 'UPDATE accountlines SET amountoutstanding = ? WHERE borrowernumber = ? '
- . ' AND accountno = ?';
- $dbh->do( $update, undef, $new_outstanding, $borrowernumber, $accountno);
+ my $update = 'UPDATE accountlines SET amountoutstanding = ? WHERE accountlines_id = ? ';
+ $dbh->do( $update, undef, $new_outstanding, $accountlines_id);
# create new line
my $insert = 'INSERT INTO accountlines (borrowernumber, accountno, date, amount, '
. 'description, accounttype, amountoutstanding, itemnumber, manager_id) '
. ' VALUES (?, ?, now(), ?, ?, ?, 0, ?, ?)';
- $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, $amount,
+ $dbh->do( $insert, undef, $borrowernumber, $nextaccntno, 0 - $amount,
"Payment, thanks - $user", 'Pay', $data->{'itemnumber'}, $manager_id);
UpdateStats( $user, 'payment', $amount, '', '', '', $borrowernumber, $accountno );
&NewOrder &DelOrder &ModOrder &GetPendingOrders &GetOrder &GetOrders
&GetOrderNumber &GetLateOrders &GetOrderFromItemnumber
&SearchOrder &GetHistory &GetRecentAcqui
- &ModReceiveOrder &ModOrderBiblioitemNumber
+ &ModReceiveOrder &CancelReceipt &ModOrderBiblioitemNumber
&GetCancelledOrders
&NewOrderItem &ModOrderItem &ModItemOrder
&GetParcels &GetParcel
&GetContracts &GetContract
+ &GetInvoices
+ &GetInvoice
+ &GetInvoiceDetails
+ &AddInvoice
+ &ModInvoice
+ &CloseInvoice
+ &ReopenInvoice
+
&GetItemnumbersFromOrder
&AddClaim
=head3 NewBasket
$basket = &NewBasket( $booksellerid, $authorizedby, $basketname,
- $basketnote, $basketbooksellernote, $basketcontractnumber );
+ $basketnote, $basketbooksellernote, $basketcontractnumber, $deliveryplace, $billingplace );
Create a new basket in aqbasket table
=cut
-# FIXME : this function seems to be unused.
-
sub NewBasket {
- my ( $booksellerid, $authorisedby, $basketname, $basketnote, $basketbooksellernote, $basketcontractnumber ) = @_;
+ my ( $booksellerid, $authorisedby, $basketname, $basketnote, $basketbooksellernote, $basketcontractnumber, $deliveryplace, $billingplace ) = @_;
my $dbh = C4::Context->dbh;
my $query = "
INSERT INTO aqbasket
$dbh->do($query);
#find & return basketno MYSQL dependant, but $dbh->last_insert_id always returns null :-(
my $basket = $dbh->{'mysql_insertid'};
- ModBasketHeader($basket, $basketname || '', $basketnote || '', $basketbooksellernote || '', $basketcontractnumber || undef, $booksellerid);
+ ModBasketHeader($basket, $basketname || '', $basketnote || '', $basketbooksellernote || '', $basketcontractnumber || undef, $booksellerid, $deliveryplace || undef, $billingplace || undef );
return $basket;
}
notes => $order->{'notes'},
quantity => $order->{'quantity'},
rrp => $order->{'rrp'},
- deliveryplace => $basket->{'deliveryplace'},
- billingplace => $basket->{'billingplace'}
+ deliveryplace => C4::Branch::GetBranchName( $basket->{'deliveryplace'} ),
+ billingplace => C4::Branch::GetBranchName( $basket->{'billingplace'} ),
};
foreach(qw(
contractname author title publishercode collectiontitle notes
my @orders = GetOrders( $$basket{basketno} );
my $contract = GetContract( $$basket{contractnumber} );
my $bookseller = GetBookSellerFromId( $$basket{booksellerid} );
+ my $basketgroup = GetBasketgroup( $$basket{basketgroupid} );
foreach my $order (@orders) {
my $bd = GetBiblioData( $order->{'biblionumber'} );
booksellerpostal => $bookseller->{postal},
contractnumber => $contract->{contractnumber},
contractname => $contract->{contractname},
+ basketgroupdeliveryplace => C4::Branch::GetBranchName( $basketgroup->{deliveryplace} ),
+ basketgroupbillingplace => C4::Branch::GetBranchName( $basketgroup->{billingplace} ),
+ basketdeliveryplace => C4::Branch::GetBranchName( $basket->{deliveryplace} ),
+ basketbillingplace => C4::Branch::GetBranchName( $basket->{billingplace} ),
};
foreach(qw(
basketname author title publishercode collectiontitle notes
=item C<$booksellerid> is the id (foreign) key in the "aqbooksellers" table for the vendor.
+=item C<$deliveryplace> is the "deliveryplace" field in the aqbasket table.
+
+=item C<$billingplace> is the "billingplace" field in the aqbasket table.
+
=back
=cut
sub ModBasketHeader {
- my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid) = @_;
+ my ($basketno, $basketname, $note, $booksellernote, $contractnumber, $booksellerid, $deliveryplace, $billingplace) = @_;
+ my $query = qq{
+ UPDATE aqbasket
+ SET basketname=?, note=?, booksellernote=?, booksellerid=?, deliveryplace=?, billingplace=?
+ WHERE basketno=?
+ };
- my $query = "UPDATE aqbasket SET basketname=?, note=?, booksellernote=?, booksellerid=? WHERE basketno=?";
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare($query);
- $sth->execute($basketname,$note,$booksellernote,$booksellerid,$basketno);
+ $sth->execute($basketname, $note, $booksellernote, $booksellerid, $deliveryplace, $billingplace, $basketno);
if ( $contractnumber ) {
my $query2 ="UPDATE aqbasket SET contractnumber=? WHERE basketno=?";
=item defaults entrydate to Now
-The following keys are used: "biblionumber", "title", "basketno", "quantity", "notes", "biblioitemnumber", "rrp", "ecost", "gst", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "bookfundid".
+The following keys are used: "biblionumber", "title", "basketno", "quantity", "notes", "biblioitemnumber", "rrp", "ecost", "gstrate", "unitprice", "subscription", "sort1", "sort2", "booksellerinvoicenumber", "listprice", "budgetdate", "purchaseordernumber", "branchcode", "booksellerinvoicenumber", "bookfundid".
=back
}
my $ordernumber=InsertInTable("aqorders",$orderinfo);
+ if (not $orderinfo->{parent_ordernumber}) {
+ my $sth = $dbh->prepare("
+ UPDATE aqorders
+ SET parent_ordernumber = ordernumber
+ WHERE ordernumber = ?
+ ");
+ $sth->execute($ordernumber);
+ }
return ( $orderinfo->{'basketno'}, $ordernumber );
}
=head3 ModReceiveOrder
&ModReceiveOrder($biblionumber, $ordernumber, $quantityreceived, $user,
- $unitprice, $booksellerinvoicenumber, $biblioitemnumber,
- $freight, $bookfund, $rrp);
+ $unitprice, $invoiceid, $biblioitemnumber,
+ $bookfund, $rrp, \@received_itemnumbers);
Updates an order, to reflect the fact that it was received, at least
in part. All arguments not mentioned below update the fields with the
same name in the aqorders table of the Koha database.
-If a partial order is received, splits the order into two. The received
-portion must have a booksellerinvoicenumber.
+If a partial order is received, splits the order into two.
Updates the order with bibilionumber C<$biblionumber> and ordernumber
C<$ordernumber>.
sub ModReceiveOrder {
my (
- $biblionumber, $ordernumber, $quantrec, $user, $cost,
- $invoiceno, $freight, $rrp, $budget_id, $datereceived, $received_items
+ $biblionumber, $ordernumber, $quantrec, $user, $cost, $ecost,
+ $invoiceid, $rrp, $budget_id, $datereceived, $received_items
)
= @_;
+
my $dbh = C4::Context->dbh;
$datereceived = C4::Dates->output('iso') unless $datereceived;
my $suggestionid = GetSuggestionFromBiblionumber( $biblionumber );
my $order = $sth->fetchrow_hashref();
$sth->finish();
+ my $new_ordernumber = $ordernumber;
if ( $order->{quantity} > $quantrec ) {
+ # Split order line in two parts: the first is the original order line
+ # without received items (the quantity is decreased),
+ # the second part is a new order line with quantity=quantityrec
+ # (entirely received)
$sth=$dbh->prepare("
UPDATE aqorders
- SET quantityreceived=?
- , datereceived=?
- , booksellerinvoicenumber=?
- , unitprice=?
- , freight=?
- , rrp=?
- , quantity=?
- WHERE biblionumber=? AND ordernumber=?");
-
- $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$quantrec,$biblionumber,$ordernumber);
+ SET quantity = ?
+ WHERE ordernumber = ?
+ ");
+
+ $sth->execute($order->{quantity} - $quantrec, $ordernumber);
+
$sth->finish;
- # create a new order for the remaining items, and set its bookfund.
- foreach my $orderkey ( "linenumber", "allocation" ) {
- delete($order->{'$orderkey'});
- }
- $order->{'quantity'} -= $quantrec;
- $order->{'quantityreceived'} = 0;
- my $newOrder = NewOrder($order);
- # Change ordernumber in aqorders_items for items not received
- my @orderitems = GetItemnumbersFromOrder( $order->{'ordernumber'} );
- my $count = scalar @orderitems;
-
- for (my $i=0; $i<$count; $i++){
- foreach (@$received_items){
- splice (@orderitems, $i, 1) if ($orderitems[$i] == $_);
+ delete $order->{'ordernumber'};
+ $order->{'quantity'} = $quantrec;
+ $order->{'quantityreceived'} = $quantrec;
+ $order->{'datereceived'} = $datereceived;
+ $order->{'invoiceid'} = $invoiceid;
+ $order->{'unitprice'} = $cost;
+ $order->{'rrp'} = $rrp;
+ $order->{ecost} = $ecost;
+ $order->{'orderstatus'} = 3; # totally received
+ $new_ordernumber = NewOrder($order);
+
+ if ($received_items) {
+ foreach my $itemnumber (@$received_items) {
+ ModItemOrder($itemnumber, $new_ordernumber);
}
}
- foreach (@orderitems) {
- ModItemOrder($_, $newOrder);
- }
} else {
$sth=$dbh->prepare("update aqorders
- set quantityreceived=?,datereceived=?,booksellerinvoicenumber=?,
- unitprice=?,freight=?,rrp=?
+ set quantityreceived=?,datereceived=?,invoiceid=?,
+ unitprice=?,rrp=?,ecost=?
where biblionumber=? and ordernumber=?");
- $sth->execute($quantrec,$datereceived,$invoiceno,$cost,$freight,$rrp,$biblionumber,$ordernumber);
+ $sth->execute($quantrec,$datereceived,$invoiceid,$cost,$rrp,$ecost,$biblionumber,$ordernumber);
$sth->finish;
}
- return $datereceived;
+ return ($datereceived, $new_ordernumber);
}
+
+=head3 CancelReceipt
+
+ my $parent_ordernumber = CancelReceipt($ordernumber);
+
+ Cancel an order line receipt and update the parent order line, as if no
+ receipt was made.
+ If items are created at receipt (AcqCreateItem = receiving) then delete
+ these items.
+
+=cut
+
+sub CancelReceipt {
+ my $ordernumber = shift;
+
+ return unless $ordernumber;
+
+ my $dbh = C4::Context->dbh;
+ my $query = qq{
+ SELECT datereceived, parent_ordernumber, quantity
+ FROM aqorders
+ WHERE ordernumber = ?
+ };
+ my $sth = $dbh->prepare($query);
+ $sth->execute($ordernumber);
+ my $order = $sth->fetchrow_hashref;
+ unless($order) {
+ warn "CancelReceipt: order $ordernumber does not exist";
+ return;
+ }
+ unless($order->{'datereceived'}) {
+ warn "CancelReceipt: order $ordernumber is not received";
+ return;
+ }
+
+ my $parent_ordernumber = $order->{'parent_ordernumber'};
+
+ if($parent_ordernumber == $ordernumber || not $parent_ordernumber) {
+ # The order line has no parent, just mark it as not received
+ $query = qq{
+ UPDATE aqorders
+ SET quantityreceived = ?,
+ datereceived = ?,
+ invoiceid = ?
+ WHERE ordernumber = ?
+ };
+ $sth = $dbh->prepare($query);
+ $sth->execute(0, undef, undef, $ordernumber);
+ } else {
+ # The order line has a parent, increase parent quantity and delete
+ # the order line.
+ $query = qq{
+ SELECT quantity, datereceived
+ FROM aqorders
+ WHERE ordernumber = ?
+ };
+ $sth = $dbh->prepare($query);
+ $sth->execute($parent_ordernumber);
+ my $parent_order = $sth->fetchrow_hashref;
+ unless($parent_order) {
+ warn "Parent order $parent_ordernumber does not exist.";
+ return;
+ }
+ if($parent_order->{'datereceived'}) {
+ warn "CancelReceipt: parent order is received.".
+ " Can't cancel receipt.";
+ return;
+ }
+ $query = qq{
+ UPDATE aqorders
+ SET quantity = ?
+ WHERE ordernumber = ?
+ };
+ $sth = $dbh->prepare($query);
+ my $rv = $sth->execute(
+ $order->{'quantity'} + $parent_order->{'quantity'},
+ $parent_ordernumber
+ );
+ unless($rv) {
+ warn "Cannot update parent order line, so do not cancel".
+ " receipt";
+ return;
+ }
+ if(C4::Context->preference('AcqCreateItem') eq 'receiving') {
+ # Remove items that were created at receipt
+ $query = qq{
+ DELETE FROM items, aqorders_items
+ USING items, aqorders_items
+ WHERE items.itemnumber = ? AND aqorders_items.itemnumber = ?
+ };
+ $sth = $dbh->prepare($query);
+ my @itemnumbers = GetItemnumbersFromOrder($ordernumber);
+ foreach my $itemnumber (@itemnumbers) {
+ $sth->execute($itemnumber, $itemnumber);
+ }
+ } else {
+ # Update items
+ my @itemnumbers = GetItemnumbersFromOrder($ordernumber);
+ foreach my $itemnumber (@itemnumbers) {
+ ModItemOrder($itemnumber, $parent_ordernumber);
+ }
+ }
+ # Delete order line
+ $query = qq{
+ DELETE FROM aqorders
+ WHERE ordernumber = ?
+ };
+ $sth = $dbh->prepare($query);
+ $sth->execute($ordernumber);
+
+ }
+
+ return $parent_ordernumber;
+}
+
#------------------------------------------------------------#
=head3 SearchOrder
firstname,
aqorders.biblionumber,
aqorders.ordernumber,
+ aqorders.parent_ordernumber,
aqorders.quantity,
aqorders.quantityreceived,
aqorders.unitprice,
aqorders.listprice,
aqorders.rrp,
aqorders.ecost,
+ aqorders.gstrate,
biblio.title
FROM aqorders
LEFT JOIN aqbasket ON aqbasket.basketno=aqorders.basketno
LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber
LEFT JOIN biblio ON aqorders.biblionumber=biblio.biblionumber
+ LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid
WHERE
aqbasket.booksellerid = ?
- AND aqorders.booksellerinvoicenumber LIKE ?
+ AND aqinvoices.invoicenumber LIKE ?
AND aqorders.datereceived = ? ";
my @query_params = ( $supplierid, $code, $datereceived );
my $dbh = C4::Context->dbh;
my @query_params = ();
my $strsth ="
- SELECT aqorders.booksellerinvoicenumber,
+ SELECT aqinvoices.invoicenumber,
datereceived,purchaseordernumber,
count(DISTINCT biblionumber) AS biblio,
sum(quantity) AS itemsexpected,
sum(quantityreceived) AS itemsreceived
FROM aqorders LEFT JOIN aqbasket ON aqbasket.basketno = aqorders.basketno
+ LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid
WHERE aqbasket.booksellerid = ? and datereceived IS NOT NULL
";
push @query_params, $bookseller;
if ( defined $code ) {
- $strsth .= ' and aqorders.booksellerinvoicenumber like ? ';
+ $strsth .= ' and aqinvoices.invoicenumber like ? ';
# add a % to the end of the code to allow stemming.
push @query_params, "$code%";
}
push @query_params, $dateto;
}
- $strsth .= "group by aqorders.booksellerinvoicenumber,datereceived ";
+ $strsth .= "group by aqinvoices.invoicenumber,datereceived ";
# can't use a placeholder to place this column name.
# but, we could probably be checking to make sure it is a column that will be fetched.
$from .= ' AND borrowers.branchcode LIKE ? ';
push @query_params, $branch;
}
+
+ if ( defined $estimateddeliverydatefrom or defined $estimateddeliverydateto ) {
+ $from .= ' AND aqbooksellers.deliverytime IS NOT NULL ';
+ }
if ( defined $estimateddeliverydatefrom ) {
- $from .= '
- AND aqbooksellers.deliverytime IS NOT NULL
- AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
+ $from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) >= ?';
push @query_params, $estimateddeliverydatefrom;
}
- if ( defined $estimateddeliverydatefrom and defined $estimateddeliverydateto ) {
+ if ( defined $estimateddeliverydateto ) {
$from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= ?';
push @query_params, $estimateddeliverydateto;
- } elsif ( defined $estimateddeliverydatefrom ) {
+ }
+ if ( defined $estimateddeliverydatefrom and not defined $estimateddeliverydateto ) {
$from .= ' AND ADDDATE(aqbasket.closedate, INTERVAL aqbooksellers.deliverytime DAY) <= CAST(now() AS date)';
}
if (C4::Context->preference("IndependantBranches")
aqorders.quantityreceived,
aqorders.ecost,
aqorders.ordernumber,
- aqorders.booksellerinvoicenumber as invoicenumber,
+ aqinvoices.invoicenumber,
aqbooksellers.id as id,
aqorders.biblionumber
FROM aqorders
LEFT JOIN aqbasketgroups ON aqbasket.basketgroupid=aqbasketgroups.id
LEFT JOIN aqbooksellers ON aqbasket.booksellerid=aqbooksellers.id
LEFT JOIN biblioitems ON biblioitems.biblionumber=aqorders.biblionumber
- LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber";
+ LEFT JOIN biblio ON biblio.biblionumber=aqorders.biblionumber
+ LEFT JOIN aqinvoices ON aqorders.invoiceid = aqinvoices.invoiceid";
$query .= " LEFT JOIN borrowers ON aqbasket.authorisedby=borrowers.borrowernumber"
if ( C4::Context->preference("IndependantBranches") );
}
if ($booksellerinvoicenumber) {
- $query .= " AND (aqorders.booksellerinvoicenumber LIKE ? OR aqbasket.booksellerinvoicenumber LIKE ?)";
- push @query_params, "%$booksellerinvoicenumber%", "%$booksellerinvoicenumber%";
+ $query .= " AND aqinvoices.invoicenumber LIKE ? ";
+ push @query_params, "%$booksellerinvoicenumber%";
}
if ($basketgroupname) {
";
my $sth = $dbh->prepare($query);
$sth->execute($ordernumber);
+}
+
+=head3 GetInvoices
+
+ my @invoices = GetInvoices(
+ invoicenumber => $invoicenumber,
+ suppliername => $suppliername,
+ shipmentdatefrom => $shipmentdatefrom, # ISO format
+ shipmentdateto => $shipmentdateto, # ISO format
+ billingdatefrom => $billingdatefrom, # ISO format
+ billingdateto => $billingdateto, # ISO format
+ isbneanissn => $isbn_or_ean_or_issn,
+ title => $title,
+ author => $author,
+ publisher => $publisher,
+ publicationyear => $publicationyear,
+ branchcode => $branchcode,
+ order_by => $order_by
+ );
+
+Return a list of invoices that match all given criteria.
+
+$order_by is "column_name (asc|desc)", where column_name is any of
+'invoicenumber', 'booksellerid', 'shipmentdate', 'billingdate', 'closedate',
+'shipmentcost', 'shipmentcost_budgetid'.
+
+asc is the default if omitted
+
+=cut
+
+sub GetInvoices {
+ my %args = @_;
+
+ my @columns = qw(invoicenumber booksellerid shipmentdate billingdate
+ closedate shipmentcost shipmentcost_budgetid);
+
+ my $dbh = C4::Context->dbh;
+ my $query = qq{
+ SELECT aqinvoices.*, aqbooksellers.name AS suppliername,
+ COUNT(
+ DISTINCT IF(
+ aqorders.datereceived IS NOT NULL,
+ aqorders.biblionumber,
+ NULL
+ )
+ ) AS receivedbiblios,
+ SUM(aqorders.quantityreceived) AS receiveditems
+ FROM aqinvoices
+ LEFT JOIN aqbooksellers ON aqbooksellers.id = aqinvoices.booksellerid
+ LEFT JOIN aqorders ON aqorders.invoiceid = aqinvoices.invoiceid
+ LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
+ LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
+ LEFT JOIN subscription ON biblio.biblionumber = subscription.biblionumber
+ };
+
+ my @bind_args;
+ my @bind_strs;
+ if($args{supplierid}) {
+ push @bind_strs, " aqinvoices.booksellerid = ? ";
+ push @bind_args, $args{supplierid};
+ }
+ if($args{invoicenumber}) {
+ push @bind_strs, " aqinvoices.invoicenumber LIKE ? ";
+ push @bind_args, "%$args{invoicenumber}%";
+ }
+ if($args{suppliername}) {
+ push @bind_strs, " aqbooksellers.name LIKE ? ";
+ push @bind_args, "%$args{suppliername}%";
+ }
+ if($args{shipmentdatefrom}) {
+ push @bind_strs, " aqinvoices.shipementdate >= ? ";
+ push @bind_args, $args{shipmentdatefrom};
+ }
+ if($args{shipmentdateto}) {
+ push @bind_strs, " aqinvoices.shipementdate <= ? ";
+ push @bind_args, $args{shipmentdateto};
+ }
+ if($args{billingdatefrom}) {
+ push @bind_strs, " aqinvoices.billingdate >= ? ";
+ push @bind_args, $args{billingdatefrom};
+ }
+ if($args{billingdateto}) {
+ push @bind_strs, " aqinvoices.billingdate <= ? ";
+ push @bind_args, $args{billingdateto};
+ }
+ if($args{isbneanissn}) {
+ push @bind_strs, " (biblioitems.isbn LIKE ? OR biblioitems.ean LIKE ? OR biblioitems.issn LIKE ? ) ";
+ push @bind_args, $args{isbneanissn}, $args{isbneanissn}, $args{isbneanissn};
+ }
+ if($args{title}) {
+ push @bind_strs, " biblio.title LIKE ? ";
+ push @bind_args, $args{title};
+ }
+ if($args{author}) {
+ push @bind_strs, " biblio.author LIKE ? ";
+ push @bind_args, $args{author};
+ }
+ if($args{publisher}) {
+ push @bind_strs, " biblioitems.publishercode LIKE ? ";
+ push @bind_args, $args{publisher};
+ }
+ if($args{publicationyear}) {
+ push @bind_strs, " biblioitems.publicationyear = ? ";
+ push @bind_args, $args{publicationyear};
+ }
+ if($args{branchcode}) {
+ push @bind_strs, " aqorders.branchcode = ? ";
+ push @bind_args, $args{branchcode};
+ }
+
+ $query .= " WHERE " . join(" AND ", @bind_strs) if @bind_strs;
+ $query .= " GROUP BY aqinvoices.invoiceid ";
+
+ if($args{order_by}) {
+ my ($column, $direction) = split / /, $args{order_by};
+ if(grep /^$column$/, @columns) {
+ $direction ||= 'ASC';
+ $query .= " ORDER BY $column $direction";
+ }
+ }
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute(@bind_args);
+ my $results = $sth->fetchall_arrayref({});
+ return @$results;
+}
+
+=head3 GetInvoice
+
+ my $invoice = GetInvoice($invoiceid);
+
+Get informations about invoice with given $invoiceid
+
+Return a hash filled with aqinvoices.* fields
+
+=cut
+
+sub GetInvoice {
+ my ($invoiceid) = @_;
+ my $invoice;
+
+ return unless $invoiceid;
+
+ my $dbh = C4::Context->dbh;
+ my $query = qq{
+ SELECT *
+ FROM aqinvoices
+ WHERE invoiceid = ?
+ };
+ my $sth = $dbh->prepare($query);
+ $sth->execute($invoiceid);
+
+ $invoice = $sth->fetchrow_hashref;
+ return $invoice;
+}
+
+=head3 GetInvoiceDetails
+
+ my $invoice = GetInvoiceDetails($invoiceid)
+
+Return informations about an invoice + the list of related order lines
+
+Orders informations are in $invoice->{orders} (array ref)
+
+=cut
+
+sub GetInvoiceDetails {
+ my ($invoiceid) = @_;
+ my $invoice;
+
+ return unless $invoiceid;
+
+ my $dbh = C4::Context->dbh;
+ my $query = qq{
+ SELECT aqinvoices.*, aqbooksellers.name AS suppliername
+ FROM aqinvoices
+ LEFT JOIN aqbooksellers ON aqinvoices.booksellerid = aqbooksellers.id
+ WHERE invoiceid = ?
+ };
+ my $sth = $dbh->prepare($query);
+ $sth->execute($invoiceid);
+
+ $invoice = $sth->fetchrow_hashref;
+
+ $query = qq{
+ SELECT aqorders.*, biblio.*
+ FROM aqorders
+ LEFT JOIN biblio ON aqorders.biblionumber = biblio.biblionumber
+ WHERE invoiceid = ?
+ };
+ $sth = $dbh->prepare($query);
+ $sth->execute($invoiceid);
+ $invoice->{orders} = $sth->fetchall_arrayref({});
+ $invoice->{orders} ||= []; # force an empty arrayref if fetchall_arrayref fails
+
+ return $invoice;
+}
+
+=head3 AddInvoice
+
+ my $invoiceid = AddInvoice(
+ invoicenumber => $invoicenumber,
+ booksellerid => $booksellerid,
+ shipmentdate => $shipmentdate,
+ billingdate => $billingdate,
+ closedate => $closedate,
+ shipmentcost => $shipmentcost,
+ shipmentcost_budgetid => $shipmentcost_budgetid
+ );
+
+Create a new invoice and return its id or undef if it fails.
+
+=cut
+
+sub AddInvoice {
+ my %invoice = @_;
+
+ return unless(%invoice and $invoice{invoicenumber});
+
+ my @columns = qw(invoicenumber booksellerid shipmentdate billingdate
+ closedate shipmentcost shipmentcost_budgetid);
+
+ my @set_strs;
+ my @set_args;
+ foreach my $key (keys %invoice) {
+ if(0 < grep(/^$key$/, @columns)) {
+ push @set_strs, "$key = ?";
+ push @set_args, ($invoice{$key} || undef);
+ }
+ }
+
+ my $rv;
+ if(@set_args > 0) {
+ my $dbh = C4::Context->dbh;
+ my $query = "INSERT INTO aqinvoices SET ";
+ $query .= join (",", @set_strs);
+ my $sth = $dbh->prepare($query);
+ $rv = $sth->execute(@set_args);
+ if($rv) {
+ $rv = $dbh->last_insert_id(undef, undef, 'aqinvoices', undef);
+ }
+ }
+ return $rv;
+}
+
+=head3 ModInvoice
+
+ ModInvoice(
+ invoiceid => $invoiceid, # Mandatory
+ invoicenumber => $invoicenumber,
+ booksellerid => $booksellerid,
+ shipmentdate => $shipmentdate,
+ billingdate => $billingdate,
+ closedate => $closedate,
+ shipmentcost => $shipmentcost,
+ shipmentcost_budgetid => $shipmentcost_budgetid
+ );
+
+Modify an invoice, invoiceid is mandatory.
+
+Return undef if it fails.
+
+=cut
+
+sub ModInvoice {
+ my %invoice = @_;
+
+ return unless(%invoice and $invoice{invoiceid});
+
+ my @columns = qw(invoicenumber booksellerid shipmentdate billingdate
+ closedate shipmentcost shipmentcost_budgetid);
+
+ my @set_strs;
+ my @set_args;
+ foreach my $key (keys %invoice) {
+ if(0 < grep(/^$key$/, @columns)) {
+ push @set_strs, "$key = ?";
+ push @set_args, ($invoice{$key} || undef);
+ }
+ }
+
+ my $dbh = C4::Context->dbh;
+ my $query = "UPDATE aqinvoices SET ";
+ $query .= join(",", @set_strs);
+ $query .= " WHERE invoiceid = ?";
+
+ my $sth = $dbh->prepare($query);
+ $sth->execute(@set_args, $invoice{invoiceid});
+}
+
+=head3 CloseInvoice
+
+ CloseInvoice($invoiceid);
+
+Close an invoice.
+
+Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => undef);
+
+=cut
+
+sub CloseInvoice {
+ my ($invoiceid) = @_;
+
+ return unless $invoiceid;
+
+ my $dbh = C4::Context->dbh;
+ my $query = qq{
+ UPDATE aqinvoices
+ SET closedate = CAST(NOW() AS DATE)
+ WHERE invoiceid = ?
+ };
+ my $sth = $dbh->prepare($query);
+ $sth->execute($invoiceid);
+}
+
+=head3 ReopenInvoice
+
+ ReopenInvoice($invoiceid);
+
+Reopen an invoice
+
+Equivalent to ModInvoice(invoiceid => $invoiceid, closedate => C4::Dates->new()->output('iso'))
+
+=cut
+
+sub ReopenInvoice {
+ my ($invoiceid) = @_;
+
+ return unless $invoiceid;
+
+ my $dbh = C4::Context->dbh;
+ my $query = qq{
+ UPDATE aqinvoices
+ SET closedate = NULL
+ WHERE invoiceid = ?
+ };
+ my $sth = $dbh->prepare($query);
+ $sth->execute($invoiceid);
}
1;
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
use Digest::MD5 qw(md5_base64);
use Storable qw(thaw freeze);
use URI::Escape;
INSERT INTO search_history(userid, sessionid, query_desc, query_cgi, total, time )
VALUES ( ?, ?, ?, ?, ?, FROM_UNIXTIME(?))
EOQ
+
sub get_template_and_user {
my $in = shift;
my $template =
OpacShowRecentComments => C4::Context->preference("OpacShowRecentComments"),
OPACURLOpenInNewWindow => "" . C4::Context->preference("OPACURLOpenInNewWindow"),
OPACUserCSS => "". C4::Context->preference("OPACUserCSS"),
+ OPACMobileUserCSS => "". C4::Context->preference("OPACMobileUserCSS"),
OPACViewOthersSuggestions => "" . C4::Context->preference("OPACViewOthersSuggestions"),
OpacAuthorities => C4::Context->preference("OpacAuthorities"),
OPACBaseURL => ($in->{'query'}->https() ? "https://" : "http://") . $ENV{'SERVER_NAME'} .
OpacCloud => C4::Context->preference("OpacCloud"),
OpacKohaUrl => C4::Context->preference("OpacKohaUrl"),
OpacMainUserBlock => "" . C4::Context->preference("OpacMainUserBlock"),
+ OpacMainUserBlockMobile => "" . C4::Context->preference("OpacMainUserBlockMobile"),
+ OpacShowFiltersPulldownMobile => C4::Context->preference("OpacShowFiltersPulldownMobile"),
+ OpacShowLibrariesPulldownMobile => C4::Context->preference("OpacShowLibrariesPulldownMobile"),
OpacNav => "" . C4::Context->preference("OpacNav"),
OpacNavRight => "" . C4::Context->preference("OpacNavRight"),
OpacNavBottom => "" . C4::Context->preference("OpacNavBottom"),
=cut
-sub _version_check ($$) {
+sub _version_check {
my $type = shift;
my $query = shift;
my $version;
sub _session_log {
(@_) or return 0;
- open L, ">>/tmp/sessionlog" or warn "ERROR: Cannot append to /tmp/sessionlog";
- printf L join("\n",@_);
- close L;
+ open my $fh, '>>', "/tmp/sessionlog" or warn "ERROR: Cannot append to /tmp/sessionlog";
+ printf $fh join("\n",@_);
+ close $fh;
+}
+
+sub _timeout_syspref {
+ my $timeout = C4::Context->preference('timeout') || 600;
+ # value in days, convert in seconds
+ if ($timeout =~ /(\d+)[dD]/) {
+ $timeout = $1 * 86400;
+ };
+ return $timeout;
}
sub checkauth {
$type = 'opac' unless $type;
my $dbh = C4::Context->dbh;
- my $timeout = C4::Context->preference('timeout');
- # days
- if ($timeout =~ /(\d+)[dD]/) {
- $timeout = $1 * 86400;
- };
- $timeout = 600 unless $timeout;
+ my $timeout = _timeout_syspref();
_version_check($type,$query);
# state variables
$ip = $session->param('ip');
$lasttime = $session->param('lasttime');
$userid = $session->param('id');
- $sessiontype = $session->param('sessiontype');
+ $sessiontype = $session->param('sessiontype') || '';
}
if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne $session->param('id')) )
|| ( $cas && $query->param('ticket') ) ) {
intranetstylesheet => C4::Context->preference("intranetstylesheet"),
intranetbookbag => C4::Context->preference("intranetbookbag"),
IntranetNav => C4::Context->preference("IntranetNav"),
+ IntranetFavicon => C4::Context->preference("IntranetFavicon"),
intranetuserjs => C4::Context->preference("intranetuserjs"),
IndependantBranches=> C4::Context->preference("IndependantBranches"),
AutoLocation => C4::Context->preference("AutoLocation"),
my $flagsrequired = shift;
my $dbh = C4::Context->dbh;
- my $timeout = C4::Context->preference('timeout');
- $timeout = 600 unless $timeout;
+ my $timeout = _timeout_syspref();
unless (C4::Context->preference('Version')) {
# database has not been installed yet
my $flagsrequired = shift;
my $dbh = C4::Context->dbh;
- my $timeout = C4::Context->preference('timeout');
- $timeout = 600 unless $timeout;
+ my $timeout = _timeout_syspref();
unless (C4::Context->preference('Version')) {
# database has not been installed yet
my $userid = shift;
my $dbh = @_ ? shift : C4::Context->dbh;
my $userflags;
- $flags = 0 unless $flags;
+ {
+ # I don't want to do this, but if someone logs in as the database
+ # user, it would be preferable not to spam them to death with
+ # numeric warnings. So, we make $flags numeric.
+ no warnings 'numeric';
+ $flags += 0;
+ }
my $sth = $dbh->prepare("SELECT bit, flag, defaulton FROM userflags");
$sth->execute;
# ~ then gets the LDAP entry
# ~ and calls the memberadd if necessary
-sub ldapserver_error ($) {
+sub ldapserver_error {
return sprintf('No ldapserver "%s" defined in KOHA_CONF: ' . $ENV{KOHA_CONF}, shift);
}
update => defined($ldap->{update} ) ? $ldap->{update} : 1, # update from LDAP to Koha database for existing user
);
-sub description ($) {
- my $result = shift or return undef;
+sub description {
+ my $result = shift or return;
return "LDAP error #" . $result->code
. ": " . $result->error_name . "\n"
. "# " . $result->error_text . "\n";
# Edit KOHA_CONF so $memberhash{'xxx'} fits your ldap structure.
# Ensure that mandatory fields are correctly filled!
#
-sub ldap_entry_2_hash ($$) {
+sub ldap_entry_2_hash {
my $userldapentry = shift;
my %borrower = ( cardnumber => shift );
my %memberhash;
hashdump("LDAP key: ",$userldapentry->{$_});
}
}
- my $x = $userldapentry->{attrs} or return undef;
+ my $x = $userldapentry->{attrs} or return;
foreach (keys %$x) {
$memberhash{$_} = join ' ', @{$x->{$_}};
$debug and print STDERR sprintf("building \$memberhash{%s} = ", $_, join(' ', @{$x->{$_}})), "\n";
return %borrower;
}
-sub exists_local($) {
+sub exists_local {
my $arg = shift;
my $dbh = C4::Context->dbh;
my $select = "SELECT borrowernumber,cardnumber,userid,password FROM borrowers ";
my ($md5password, $cardnum) = $sth->fetchrow;
($digest eq $md5password) and return $cardnum;
warn "Password mismatch after update to cardnumber=$cardnum (borrowernumber=$borrowerid)";
- return undef;
+ return;
}
die "Unexpected error after password update to userid/borrowernumber: $userid / $borrowerid.";
}
-sub update_local($$$$) {
- my $userid = shift or return undef;
- my $digest = md5_base64(shift) or return undef;
- my $borrowerid = shift or return undef;
- my $borrower = shift or return undef;
+sub update_local {
+ my $userid = shift or return;
+ my $digest = md5_base64(shift) or return;
+ my $borrowerid = shift or return;
+ my $borrower = shift or return;
my @keys = keys %$borrower;
my $dbh = C4::Context->dbh;
my $query = "UPDATE borrowers\nSET " .
&SearchAuthorities
&BuildSummary
- &BuildUnimarcHierarchies
- &BuildUnimarcHierarchy
+ &BuildAuthHierarchies
+ &BuildAuthHierarchy
+ &GenerateHierarchy
&merge
&FindDuplicateAuthority
# also store main entry MARC tag, to extract it at end of search
my $mainentrytag;
##first set the authtype search and may be multiple authorities
- my $n=0;
- my @authtypecode;
- my @auths=split / /,$authtypecode ;
- foreach my $auth (@auths){
- $query .=" \@attr 1=authtype \@attr 5=100 ".$auth; ##No truncation on authtype
- push @authtypecode ,$auth;
- $n++;
- }
- if ($n>1){
- while ($n>1){$query= "\@or ".$query;$n--;}
+ if ($authtypecode) {
+ my $n=0;
+ my @authtypecode;
+ my @auths=split / /,$authtypecode ;
+ foreach my $auth (@auths){
+ $query .=" \@attr 1=authtype \@attr 5=100 ".$auth; ##No truncation on authtype
+ push @authtypecode ,$auth;
+ $n++;
+ }
+ if ($n>1){
+ while ($n>1){$query= "\@or ".$query;$n--;}
+ }
}
my $dosearch;
return \%summary;
}
-=head2 BuildUnimarcHierarchies
+=head2 GetAuthorizedHeading
+
+ $heading = &GetAuthorizedHeading({ record => $record, authid => $authid })
+
+Takes a MARC::Record object describing an authority record or an authid, and
+returns a string representation of the first authorized heading. This routine
+should be considered a temporary shim to ease the future migration of authority
+data from C4::AuthoritiesMarc to the object-oriented Koha::*::Authority.
+
+=cut
+
+sub GetAuthorizedHeading {
+ my $args = shift;
+ my $record;
+ unless ($record = $args->{record}) {
+ return unless $args->{authid};
+ $record = GetAuthority($args->{authid});
+ }
+ 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..')) {
+ return $field->as_string('abcdefghijlmnopqrstuvwxyz');
+ }
+ } else {
+ 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') {
+ return $field->as_string('abcdefghjklmnopqrstvxyz68');
+ } elsif ($tag eq '110') {
+ return $field->as_string('abcdefghklmnoprstvxyz68');
+ } elsif ($tag eq '111') {
+ return $field->as_string('acdefghklnpqstvxyz68');
+ } elsif ($tag eq '130') {
+ return $field->as_string('adfghklmnoprstvxyz68');
+ } elsif ($tag eq '148') {
+ return $field->as_string('abvxyz68');
+ } elsif ($tag eq '150') {
+ return $field->as_string('abvxyz68');
+ } elsif ($tag eq '151') {
+ return $field->as_string('avxyz68');
+ } elsif ($tag eq '155') {
+ return $field->as_string('abvxyz68');
+ } elsif ($tag eq '180') {
+ return $field->as_string('vxyz68');
+ } elsif ($tag eq '181') {
+ return $field->as_string('vxyz68');
+ } elsif ($tag eq '182') {
+ return $field->as_string('vxyz68');
+ } elsif ($tag eq '185') {
+ return $field->as_string('vxyz68');
+ } else {
+ return $field->as_string();
+ }
+ }
+ }
+ return;
+}
+
+=head2 BuildAuthHierarchies
- $text= &BuildUnimarcHierarchies( $authid, $force)
+ $text= &BuildAuthHierarchies( $authid, $force)
return text containing trees for hierarchies
for them to be stored in auth_header
=cut
-sub BuildUnimarcHierarchies{
- my $authid = shift @_;
+sub BuildAuthHierarchies{
+ my $authid = shift @_;
# warn "authid : $authid";
- my $force = shift @_;
- my @globalresult;
- my $dbh=C4::Context->dbh;
- my $hierarchies;
- my $data = GetHeaderAuthority($authid);
- if ($data->{'authtrees'} and not $force){
- return $data->{'authtrees'};
+ my $force = shift @_ || (C4::Context->preference('marcflavour') eq 'UNIMARC' ? 0 : 1);
+ my @globalresult;
+ my $dbh=C4::Context->dbh;
+ my $hierarchies;
+ my $data = GetHeaderAuthority($authid);
+ if ($data->{'authtrees'} and not $force){
+ return $data->{'authtrees'};
# } elsif ($data->{'authtrees'}){
# $hierarchies=$data->{'authtrees'};
- } else {
- my $record = GetAuthority($authid);
- my $found;
- return unless $record;
- foreach my $field ($record->field('5..')){
- if ($field->subfield('5') && $field->subfield('5') eq 'g'){
- my $subfauthid=_get_authid_subfield($field);
- next if ($subfauthid eq $authid);
- my $parentrecord = GetAuthority($subfauthid);
- my $localresult=$hierarchies;
- my $trees;
- $trees = BuildUnimarcHierarchies($subfauthid);
- my @trees;
- if ($trees=~/;/){
- @trees = split(/;/,$trees);
- } else {
- push @trees, $trees;
- }
- foreach (@trees){
- $_.= ",$authid";
+ } else {
+ my $record = GetAuthority($authid);
+ my $found;
+ return unless $record;
+ foreach my $field ($record->field('5..')){
+ my $broader = 0;
+ $broader = 1 if (
+ (C4::Context->preference('marcflavour') eq 'UNIMARC' && $field->subfield('5') && $field->subfield('5') eq 'g') ||
+ (C4::Context->preference('marcflavour') ne 'UNIMARC' && $field->subfield('w') && substr($field->subfield('w'), 0, 1) eq 'g'));
+ if ($broader) {
+ my $subfauthid=_get_authid_subfield($field) || '';
+ next if ($subfauthid eq $authid);
+ my $parentrecord = GetAuthority($subfauthid);
+ next unless $parentrecord;
+ my $localresult=$hierarchies;
+ my $trees;
+ $trees = BuildAuthHierarchies($subfauthid);
+ my @trees;
+ if ($trees=~/;/){
+ @trees = split(/;/,$trees);
+ } else {
+ push @trees, $trees;
+ }
+ foreach (@trees){
+ $_.= ",$authid";
+ }
+ @globalresult = (@globalresult,@trees);
+ $found=1;
+ }
+ $hierarchies=join(";",@globalresult);
}
- @globalresult = (@globalresult,@trees);
- $found=1;
- }
- $hierarchies=join(";",@globalresult);
+#Unless there is no ancestor, I am alone.
+ $hierarchies="$authid" unless ($hierarchies);
}
- #Unless there is no ancestor, I am alone.
- $hierarchies="$authid" unless ($hierarchies);
- }
- AddAuthorityTrees($authid,$hierarchies);
- return $hierarchies;
+ AddAuthorityTrees($authid,$hierarchies);
+ return $hierarchies;
}
-=head2 BuildUnimarcHierarchy
+=head2 BuildAuthHierarchy
- $ref= &BuildUnimarcHierarchy( $record, $class,$authid)
+ $ref= &BuildAuthHierarchy( $record, $class,$authid)
return a hashref in order to display hierarchy for record and final Authid $authid
"current_value"
"value"
-"ifparents"
-"ifchildren"
-Those two latest ones should disappear soon.
+=cut
+
+sub BuildAuthHierarchy{
+ my $record = shift @_;
+ my $class = shift @_;
+ my $authid_constructed = shift @_;
+ return unless ($record && $record->field('001'));
+ my $authid=$record->field('001')->data();
+ my %cell;
+ my $parents=""; my $children="";
+ my (@loopparents,@loopchildren);
+ my $marcflavour = C4::Context->preference('marcflavour');
+ my $relationshipsf = $marcflavour eq 'UNIMARC' ? '5' : 'w';
+ foreach my $field ($record->field('5..')){
+ my $subfauthid=_get_authid_subfield($field);
+ if ($subfauthid && $field->subfield($relationshipsf) && $field->subfield('a')){
+ my $relationship = substr($field->subfield($relationshipsf), 0, 1);
+ if ($relationship eq 'h'){
+ push @loopchildren, { "authid"=>$subfauthid,"value"=>$field->subfield('a')};
+ }
+ elsif ($relationship eq 'g'){
+ push @loopparents, { "authid"=>$subfauthid,"value"=>$field->subfield('a')};
+ }
+# brothers could get in there with an else
+ }
+ }
+ $cell{"parents"}=\@loopparents;
+ $cell{"children"}=\@loopchildren;
+ $cell{"class"}=$class;
+ $cell{"authid"}=$authid;
+ $cell{"current_value"} =1 if ($authid eq $authid_constructed);
+ $cell{"value"}=C4::Context->preference('marcflavour') eq 'UNIMARC' ? $record->subfield('2..',"a") : $record->subfield('1..', 'a');
+ return \%cell;
+}
+
+=head2 BuildAuthHierarchyBranch
+
+ $branch = &BuildAuthHierarchyBranch( $tree, $authid[, $cnt])
+
+Return a data structure representing an authority hierarchy
+given a list of authorities representing a single branch in
+an authority hierarchy tree. $authid is the current node in
+the tree (which may or may not be somewhere in the middle).
+$cnt represents the level of the upper-most item, and is only
+used when BuildAuthHierarchyBranch is called recursively (i.e.,
+don't ever pass in anything but zero to it).
=cut
-sub BuildUnimarcHierarchy{
- my $record = shift @_;
- my $class = shift @_;
- my $authid_constructed = shift @_;
- return undef unless ($record);
- my $authid=$record->field('001')->data();
- my %cell;
- my $parents=""; my $children="";
- my (@loopparents,@loopchildren);
- foreach my $field ($record->field('5..')){
- my $subfauthid=_get_authid_subfield($field);
- if ($subfauthid && $field->subfield('5') && $field->subfield('a')){
- if ($field->subfield('5') eq 'h'){
- push @loopchildren, { "childauthid"=>$field->subfield('3'),"childvalue"=>$field->subfield('a')};
- }
- elsif ($field->subfield('5') eq 'g'){
- push @loopparents, { "parentauthid"=>$field->subfield('3'),"parentvalue"=>$field->subfield('a')};
- }
- # brothers could get in there with an else
- }
- }
- $cell{"ifparents"}=1 if (scalar(@loopparents)>0);
- $cell{"ifchildren"}=1 if (scalar(@loopchildren)>0);
- $cell{"loopparents"}=\@loopparents if (scalar(@loopparents)>0);
- $cell{"loopchildren"}=\@loopchildren if (scalar(@loopchildren)>0);
- $cell{"class"}=$class;
- $cell{"loopauthid"}=$authid;
- $cell{"current_value"} =1 if $authid eq $authid_constructed;
- $cell{"value"}=$record->subfield('2..',"a");
- return \%cell;
+sub BuildAuthHierarchyBranch {
+ my ($tree, $authid, $cnt) = @_;
+ $cnt |= 0;
+ my $elementdata = GetAuthority(shift @$tree);
+ my $branch = BuildAuthHierarchy($elementdata,"child".$cnt, $authid);
+ if (scalar @$tree > 0) {
+ my $nextBranch = BuildAuthHierarchyBranch($tree, $authid, ++$cnt);
+ my $nextAuthid = $nextBranch->{authid};
+ my $found;
+ # If we already have the next branch listed as a child, let's
+ # replace the old listing with the new one. If not, we will add
+ # the branch at the end.
+ foreach my $cell (@{$branch->{children}}) {
+ if ($cell->{authid} eq $nextAuthid) {
+ $cell = $nextBranch;
+ $found = 1;
+ last;
+ }
+ }
+ push @{$branch->{children}}, $nextBranch unless $found;
+ }
+ return $branch;
+}
+
+=head2 GenerateHierarchy
+
+ $hierarchy = &GenerateHierarchy($authid);
+
+Return an arrayref holding one or more "trees" representing
+authority hierarchies.
+
+=cut
+
+sub GenerateHierarchy {
+ my ($authid) = @_;
+ my $trees = BuildAuthHierarchies($authid);
+ my @trees = split /;/,$trees ;
+ push @trees,$trees unless (@trees);
+ my @loophierarchies;
+ foreach my $tree (@trees){
+ my @tree=split /,/,$tree;
+ push @tree, $tree unless (@tree);
+ my $branch = BuildAuthHierarchyBranch(\@tree, $authid);
+ push @loophierarchies, [ $branch ];
+ }
+ return \@loophierarchies;
}
sub _get_authid_subfield{
} else {
#zebra connection
my $oConnection=C4::Context->Zconn("biblioserver",0);
- my $oldSyntax = $oConnection->option("preferredRecordSyntax");
- $oConnection->option("preferredRecordSyntax"=>"XML");
+ # We used to use XML syntax here, but that no longer works.
+ # Thankfully, we don't need it.
my $query;
$query= "an=".$mergefrom;
my $oResult = $oConnection->search(new ZOOM::Query::CCL2RPN( $query, $oConnection ));
my $rec;
$rec=$oResult->record($z);
my $marcdata = $rec->raw();
- my $marcrecordzebra= MARC::Record->new_from_xml($marcdata,"utf8",C4::Context->preference("marcflavour"));
+ my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata);
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' );
my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield);
my $marcrecorddb=GetMarcBiblio($i);
$z++;
}
$oResult->destroy();
- $oConnection->option("preferredRecordSyntax"=>$oldSyntax);
}
#warn scalar(@reccache)." biblios to update";
# Get All candidate Tags for the change
foreach my $tagfield (@tags_using_authtype){
# warn "tagfield : $tagfield ";
foreach my $field ($marcrecord->field($tagfield)){
+ # biblio is linked to authority with $9 subfield containing authid
my $auth_number=$field->subfield("9");
my $tag=$field->tag();
if ($auth_number==$mergefrom) {
my $field_to=MARC::Field->new(($tag_to?$tag_to:$tag),$field->indicator(1),$field->indicator(2),"9"=>$mergeto);
my $exclude='9';
- foreach my $subfield (@record_to) {
+ foreach my $subfield (grep {$_->[0] ne '9'} @record_to) {
$field_to->add_subfields($subfield->[0] =>$subfield->[1]);
$exclude.= $subfield->[0];
}
sub results {
my $self = shift;
- return undef unless $self->{'status'} eq 'completed';
+ return unless $self->{'status'} eq 'completed';
return $self->{'results'};
}
my $session = get_session($sessionID);
my $prefix = "job_$jobID";
unless (defined $session->param($prefix)) {
- return undef;
+ return;
}
my $self = $session->param($prefix);
bless $self, $class;
return '0000001';
}
sub width {
- return undef;
+ return;
}
sub process_head { # (self,head,whole,specific)
my $self = shift;
my ($head,$incr,$tail) = $self->parse($max); # for incremental, you'd get ('',the_whole_barcode,'')
unless (defined $incr) {
warn "No incrementing part of barcode ($max) returned by parse.";
- return undef;
+ return;
}
my $x = length($incr); # number of digits
$incr =~ /^9+$/ and $x++; # if they're all 9's, we need an extra.
return $next_value;
}
sub next {
- my $self = shift or return undef;
+ my $self = shift or return;
(@_) and $self->{next} = shift;
return $self->{next};
}
sub previous {
- my $self = shift or return undef;
+ my $self = shift or return;
(@_) and $self->{previous} = shift;
return $self->{previous};
}
sub serial {
- my $self = shift or return undef;
+ my $self = shift or return;
(@_) and $self->{serial} = shift;
return $self->{serial};
}
$autoBarcodeType =~ s/^.*:://; # in case we get C4::Barcodes::incremental, we just want 'incremental'
unless ($autoBarcodeType) {
carp "No autoBarcode format found.";
- return undef;
+ return;
}
unless (defined $types->{$autoBarcodeType}) {
carp "The autoBarcode format '$autoBarcodeType' is unrecognized.";
- return undef;
+ return;
}
carp "autoBarcode format = $autoBarcodeType" if $debug;
my $self;
return $self;
}
carp "Failed new C4::Barcodes::$autoBarcodeType";
- return undef;
+ return;
}
sub new_object {
use C4::Debug;
use Algorithm::CheckDigits;
+use Carp;
use vars qw($VERSION @ISA);
use vars qw($debug $cgi_debug); # from C4::Debug, of course
if ( $ean->is_valid($barcode) ) {
return ( '', $ean->basenumber($barcode), $ean->checkdigit($barcode) );
} else {
- die "$barcode not valid EAN-13 barcode";
+ carp "$barcode not valid EAN-13 barcode";
+ return ( '', $barcode, '' );
}
}
# Generates barcode where hb = home branch Code, yymm = year/month catalogued, incr = incremental number,
# increment resets yearly -fbcit
-sub db_max ($;$) {
+sub db_max {
my $self = shift;
my $query = "SELECT MAX(SUBSTRING(barcode,-$width)), barcode FROM items WHERE barcode REGEXP ? GROUP BY barcode";
$debug and print STDERR "(hbyymmincr) db_max query: $query\n";
return ($max || 0);
}
-sub initial () {
+sub initial {
my $self = shift;
# FIXME: populated branch?
my $iso = C4::Dates->new->output('iso'); # like "2008-07-02"
return $self->branch . substr($iso,2,2) . substr($iso,5,2) . sprintf('%' . "$width.$width" . 'd',1);
}
-sub parse ($;$) { # return 3 parts of barcode: non-incrementing, incrementing, non-incrementing
+sub parse { # return 3 parts of barcode: non-incrementing, incrementing, non-incrementing
my $self = shift;
my $barcode = (@_) ? shift : $self->value;
my $branch = $self->branch;
return ($1,$2,''); # the third part is in anticipation of barcodes that include checkdigits
}
-sub branch ($;$) {
+sub branch {
my $self = shift;
(@_) and $self->{branch} = shift;
return $self->{branch};
}
-sub width ($;$) {
+sub width {
my $self = shift;
(@_) and $width = shift; # hitting the class variable.
return $width;
}
-sub process_head($$;$$) { # (self,head,whole,specific)
+sub process_head { # (self,head,whole,specific)
my ($self,$head,$whole,$specific) = @_;
$specific and return $head; # if this is built off an existing barcode, just return the head unchanged.
$head =~ s/\d{4}$//; # else strip the old yymm
use MARC::File::USMARC;
use MARC::File::XML;
use POSIX qw(strftime);
+use Module::Load::Conditional qw(can_load);
use C4::Koha;
use C4::Dates qw/format_date/;
my $linker_module =
"C4::Linker::" . ( C4::Context->preference("LinkerModule") || 'Default' );
- eval { eval "require $linker_module"; };
- if ($@) {
+ unless ( can_load( modules => { $linker_module => undef } ) ) {
$linker_module = 'C4::Linker::Default';
- eval "require $linker_module";
- }
- if ($@) {
- return 0, 0;
+ unless ( can_load( modules => { $linker_module => undef } ) ) {
+ return 0, 0;
+ }
}
my $linker = $linker_module->new(
sub GetISBDView {
my ( $biblionumber, $template ) = @_;
my $record = GetMarcBiblio($biblionumber, 1);
- return undef unless defined $record;
+ return unless defined $record;
my $itemtype = &GetFrameworkCode($biblionumber);
my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype );
my $tagslib = &GetMarcStructure( 1, $itemtype );
=head2 GetBiblio
- ( $count, @results ) = &GetBiblio($biblionumber);
+ my $biblio = &GetBiblio($biblionumber);
=cut
my $count = 0;
my @results;
$sth->execute($biblionumber);
- while ( my $data = $sth->fetchrow_hashref ) {
- $results[$count] = $data;
- $count++;
- } # while
- $sth->finish;
- return ( $count, @results );
+ if ( my $data = $sth->fetchrow_hashref ) {
+ return $data;
+ }
+ return;
} # sub GetBiblio
=head2 GetBiblioItemInfosOf
=cut
-sub GetUsedMarcStructure($) {
+sub GetUsedMarcStructure {
my $frameworkcode = shift || '';
my $query = qq/
SELECT *
return $record;
} else {
- return undef;
+ return;
}
}
sub GetMarcSubjects {
my ( $record, $marcflavour ) = @_;
- my ( $mintag, $maxtag );
+ my ( $mintag, $maxtag, $fields_filter );
if ( $marcflavour eq "UNIMARC" ) {
$mintag = "600";
$maxtag = "611";
- } else { # assume marc21 if not unimarc
+ $fields_filter = '6..';
+ } else { # marc21/normarc
$mintag = "600";
$maxtag = "699";
+ $fields_filter = '6..';
}
my @marcsubjects;
- my $subject = "";
- my $subfield = "";
- my $marcsubject;
my $subject_limit = C4::Context->preference("TraceCompleteSubfields") ? 'su,complete-subfield' : 'su';
+ my $authoritysep = C4::Context->preference('authoritysep');
- foreach my $field ( $record->field('6..') ) {
- next unless $field->tag() >= $mintag && $field->tag() <= $maxtag;
+ foreach my $field ( $record->field($fields_filter) ) {
+ next unless ($field->tag() >= $mintag && $field->tag() <= $maxtag);
my @subfields_loop;
my @subfields = $field->subfields();
- my $counter = 0;
my @link_loop;
- # if there is an authority link, build the link with an= subfield9
- my $found9 = 0;
+ # if there is an authority link, build the links with an= subfield9
+ my $subfield9 = $field->subfield('9');
+ my $authoritylink;
+ if ($subfield9) {
+ my $linkvalue = $subfield9;
+ $linkvalue =~ s/(\(|\))//g;
+ @link_loop = ( { limit => 'an', 'link' => $linkvalue } );
+ $authoritylink = $linkvalue
+ }
+
+ # other subfields
for my $subject_subfield (@subfields) {
+ next if ( $subject_subfield->[0] eq '9' );
# don't load unimarc subfields 3,4,5
next if ( ( $marcflavour eq "UNIMARC" ) and ( $subject_subfield->[0] =~ /2|3|4|5/ ) );
-
# don't load MARC21 subfields 2 (FIXME: any more subfields??)
next if ( ( $marcflavour eq "MARC21" ) and ( $subject_subfield->[0] =~ /2/ ) );
+
my $code = $subject_subfield->[0];
my $value = $subject_subfield->[1];
my $linkvalue = $value;
$linkvalue =~ s/(\(|\))//g;
- my $operator;
- if ( $counter != 0 ) {
- $operator = ' and ';
- }
- if ( $code eq 9 ) {
- $found9 = 1;
- @link_loop = ( { 'limit' => 'an', link => "$linkvalue" } );
- }
- if ( not $found9 ) {
- push @link_loop, { 'limit' => $subject_limit, link => $linkvalue, operator => $operator };
- }
- my $separator;
- if ( $counter != 0 ) {
- $separator = C4::Context->preference('authoritysep');
+ # if no authority link, build a search query
+ unless ($subfield9) {
+ push @link_loop, {
+ limit => $subject_limit,
+ 'link' => $linkvalue,
+ operator => (scalar @link_loop) ? ' and ' : undef
+ };
}
-
- # ignore $9
my @this_link_loop = @link_loop;
- push @subfields_loop, { code => $code, value => $value, link_loop => \@this_link_loop, separator => $separator } unless ( $subject_subfield->[0] eq 9 || $subject_subfield->[0] eq '0' );
- $counter++;
+ # do not display $0
+ unless ( $code eq '0' ) {
+ push @subfields_loop, {
+ code => $code,
+ value => $value,
+ link_loop => \@this_link_loop,
+ separator => (scalar @subfields_loop) ? $authoritysep : ''
+ };
+ }
}
- push @marcsubjects, { MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop };
+ push @marcsubjects, {
+ MARCSUBJECT_SUBFIELDS_LOOP => \@subfields_loop,
+ authoritylink => $authoritylink,
+ };
}
return \@marcsubjects;
sub GetMarcAuthors {
my ( $record, $marcflavour ) = @_;
- my ( $mintag, $maxtag );
+ my ( $mintag, $maxtag, $fields_filter );
# tagslib useful for UNIMARC author reponsabilities
my $tagslib =
if ( $marcflavour eq "UNIMARC" ) {
$mintag = "700";
$maxtag = "712";
- } elsif ( $marcflavour eq "MARC21" || $marcflavour eq "NORMARC" ) { # assume marc21 or normarc if not unimarc
+ $fields_filter = '7..';
+ } else { # marc21/normarc
$mintag = "700";
$maxtag = "720";
- } else {
- return;
+ $fields_filter = '7..';
}
+
my @marcauthors;
+ my $authoritysep = C4::Context->preference('authoritysep');
- foreach my $field ( $record->fields ) {
+ foreach my $field ( $record->field($fields_filter) ) {
next unless $field->tag() >= $mintag && $field->tag() <= $maxtag;
my @subfields_loop;
my @link_loop;
# if there is an authority link, build the link with Koha-Auth-Number: subfield9
my $subfield9 = $field->subfield('9');
+ if ($subfield9) {
+ my $linkvalue = $subfield9;
+ $linkvalue =~ s/(\(|\))//g;
+ @link_loop = ( { 'limit' => 'an', 'link' => $linkvalue } );
+ }
+
+ # other subfields
for my $authors_subfield (@subfields) {
+ next if ( $authors_subfield->[0] eq '9' );
# don't load unimarc subfields 3, 5
next if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] =~ /3|5/ ) );
- my $subfieldcode = $authors_subfield->[0];
+
+ my $code = $authors_subfield->[0];
my $value = $authors_subfield->[1];
my $linkvalue = $value;
$linkvalue =~ s/(\(|\))//g;
- my $operator;
- if ( $count_auth != 0 ) {
- $operator = ' and ';
- }
-
- # if we have an authority link, use that as the link, otherwise use standard searching
- if ($subfield9) {
- @link_loop = ( { 'limit' => 'an', link => "$subfield9" } );
- } else {
-
- # reset $linkvalue if UNIMARC author responsibility
- if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] eq "4" ) ) {
- $linkvalue = "(" . GetAuthorisedValueDesc( $field->tag(), $authors_subfield->[0], $authors_subfield->[1], '', $tagslib ) . ")";
- }
- push @link_loop, { 'limit' => 'au', link => $linkvalue, operator => $operator };
+ # UNIMARC author responsibility
+ if ( $marcflavour eq 'UNIMARC' and $code eq '4' ) {
+ $value = GetAuthorisedValueDesc( $field->tag(), $code, $value, '', $tagslib );
+ $linkvalue = "($value)";
+ }
+ # if no authority link, build a search query
+ unless ($subfield9) {
+ push @link_loop, {
+ limit => 'au',
+ 'link' => $linkvalue,
+ operator => (scalar @link_loop) ? ' and ' : undef
+ };
}
- $value = GetAuthorisedValueDesc( $field->tag(), $authors_subfield->[0], $authors_subfield->[1], '', $tagslib )
- if ( $marcflavour eq 'UNIMARC' and ( $authors_subfield->[0] =~ /4/ ) );
my @this_link_loop = @link_loop;
- my $separator;
- if ( $count_auth != 0 ) {
- $separator = C4::Context->preference('authoritysep');
+ # do not display $0
+ unless ( $code eq '0') {
+ push @subfields_loop, {
+ tag => $field->tag(),
+ code => $code,
+ value => $value,
+ link_loop => \@this_link_loop,
+ separator => (scalar @subfields_loop) ? $authoritysep : ''
+ };
}
- push @subfields_loop,
- { tag => $field->tag(),
- code => $subfieldcode,
- value => $value,
- link_loop => \@this_link_loop,
- separator => $separator
- }
- unless ( $authors_subfield->[0] eq '9' || $authors_subfield->[0] eq '0');
- $count_auth++;
- }
- push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop };
+ }
+ push @marcauthors, {
+ MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop,
+ authoritylink => $subfield9,
+ };
}
return \@marcauthors;
}
sub GetMarcSeries {
my ( $record, $marcflavour ) = @_;
- my ( $mintag, $maxtag );
+ my ( $mintag, $maxtag, $fields_filter );
if ( $marcflavour eq "UNIMARC" ) {
$mintag = "600";
$maxtag = "619";
- } else { # assume marc21 if not unimarc
+ $fields_filter = '6..';
+ } else { # marc21/normarc
$mintag = "440";
$maxtag = "490";
+ $fields_filter = '4..';
}
my @marcseries;
- my $subjct = "";
- my $subfield = "";
- my $marcsubjct;
+ my $authoritysep = C4::Context->preference('authoritysep');
- foreach my $field ( $record->field('440'), $record->field('490') ) {
+ foreach my $field ( $record->field($fields_filter) ) {
+ next unless $field->tag() >= $mintag && $field->tag() <= $maxtag;
my @subfields_loop;
-
- #my $value = $field->subfield('a');
- #$marcsubjct = {MARCSUBJCT => $value,};
my @subfields = $field->subfields();
-
- #warn "subfields:".join " ", @$subfields;
- my $counter = 0;
my @link_loop;
+
for my $series_subfield (@subfields) {
- my $volume_number;
- undef $volume_number;
- # see if this is an instance of a volume
- if ( $series_subfield->[0] eq 'v' ) {
- $volume_number = 1;
- }
+ # ignore $9, used for authority link
+ next if ( $series_subfield->[0] eq '9' );
+ my $volume_number;
my $code = $series_subfield->[0];
my $value = $series_subfield->[1];
my $linkvalue = $value;
$linkvalue =~ s/(\(|\))//g;
- if ( $counter != 0 ) {
- push @link_loop, { link => $linkvalue, operator => ' and ', };
- } else {
- push @link_loop, { link => $linkvalue, operator => undef, };
- }
- my $separator;
- if ( $counter != 0 ) {
- $separator = C4::Context->preference('authoritysep');
+
+ # see if this is an instance of a volume
+ if ( $code eq 'v' ) {
+ $volume_number = 1;
}
+
+ push @link_loop, {
+ 'link' => $linkvalue,
+ operator => (scalar @link_loop) ? ' and ' : undef
+ };
+
if ($volume_number) {
push @subfields_loop, { volumenum => $value };
} else {
- if ( $series_subfield->[0] ne '9' ) {
- push @subfields_loop, {
- code => $code,
- value => $value,
- link_loop => \@link_loop,
- separator => $separator,
- volumenum => $volume_number,
- };
+ push @subfields_loop, {
+ code => $code,
+ value => $value,
+ link_loop => \@link_loop,
+ separator => (scalar @subfields_loop) ? $authoritysep : '',
+ volumenum => $volume_number,
}
}
- $counter++;
}
push @marcseries, { MARCSERIES_SUBFIELDS_LOOP => \@subfields_loop };
- #$marcsubjct = {MARCSUBJCT => $field->as_string(),};
- #push @marcsubjcts, $marcsubjct;
- #$subjct = $value;
-
}
- my $marcseriessarray = \@marcseries;
- return $marcseriessarray;
+ return \@marcseries;
} #end getMARCseriess
=head2 GetMarcHosts
$sth2->finish;
}
$sth->finish;
- return undef;
+ return;
}
=head2 _koha_delete_biblioitems
$sth2->finish;
}
$sth->finish;
- return undef;
+ return;
}
=head1 UNEXPORTED FUNCTIONS
&DelBranchCategory
&CheckCategoryUnique
&mybranch
+ &GetBranchesCount
);
@EXPORT_OK = qw( &onlymine &mybranch get_branch_code_from_name );
}
return C4::Context->userenv->{branch} || '';
}
-sub GetBranchesLoop (;$$) { # since this is what most pages want anyway
+sub GetBranchesLoop { # since this is what most pages want anyway
my $branch = @_ ? shift : mybranch(); # optional first argument is branchcode of "my branch", if preselection is wanted.
my $onlymine = @_ ? shift : onlymine();
my $branches = GetBranches($onlymine);
=cut
#TODO manage category types. rename possibly to 'agency domains' ? as borrowergroups are called categories.
-sub GetCategoryTypes() {
+sub GetCategoryTypes {
return ( 'searchdomain','properties');
}
=cut
-sub GetBranch ($$) {
+sub GetBranch {
my ( $query, $branches ) = @_; # get branch for this query from branches
my $branch = $query->param('branch');
my %cookie = $query->cookie('userenv');
=cut
-sub GetBranchesInCategory($) {
+sub GetBranchesInCategory {
my ($categorycode) = @_;
my @branches;
my $dbh = C4::Context->dbh();
return $sth->fetchrow_array;
}
+sub GetBranchesCount {
+ my $dbh = C4::Context->dbh();
+ my $query = "SELECT COUNT(*) AS branches_count FROM branches";
+ my $sth = $dbh->prepare( $query );
+ $sth->execute();
+ my $row = $sth->fetchrow_hashref();
+ return $row->{'branches_count'};
+}
+
1;
__END__
($marcrecord, $charset_result, $charset_errors) =
MarcToUTF8Record($marcarray[$i]."\x1D", C4::Context->preference("marcflavour"), $encoding);
+ # Normalize the record so it doesn't have separated diacritics
+ SetUTF8Flag($marcrecord);
+
# warn "$i : $marcarray[$i]";
# FIXME - currently this does nothing
my @warnings = $marcrecord->warnings();
$query .= "z3950random = ?";
@bind=($z3950random);
} else {
- $search =~ s/(\s+)/\%/g;
@bind=();
- if ($search) {
+ if (defined($search) && length($search)>0) {
+ $search =~ s/(\s+)/\%/g;
$query .= "title like ? OR author like ?";
push(@bind,"%$search%", "%$search%");
}
- if ($search && $isbn) {
+ if ($#bind!=-1 && defined($isbn) && length($isbn)>0) {
$query .= " and ";
}
- if ($isbn) {
+ if (defined($isbn) && length($isbn)>0) {
$query .= "isbn like ?";
push(@bind,"$isbn%");
}
quantityreceived > 0 AND
datecancellationprinted IS NULL
|);
-
$sth->execute($budget_id);
my $sum = $sth->fetchrow_array;
+
+ $sth = $dbh->prepare(qq|
+ SELECT SUM(shipmentcost) AS sum
+ FROM aqinvoices
+ WHERE shipmentcost_budgetid = ?
+ AND closedate IS NOT NULL
+ |);
+ $sth->execute($budget_id);
+ my ($shipmentcost_sum) = $sth->fetchrow_array;
+ $sum += $shipmentcost_sum;
+
return $sum;
}
quantityreceived = 0 AND
datecancellationprinted IS NULL
|);
-
$sth->execute($budget_id);
my $sum = $sth->fetchrow_array;
+
+ $sth = $dbh->prepare(qq|
+ SELECT SUM(shipmentcost) AS sum
+ FROM aqinvoices
+ WHERE shipmentcost_budgetid = ?
+ AND closedate IS NULL
+ |);
+ $sth->execute($budget_id);
+ my ($shipmentcost_sum) = $sth->fetchrow_array;
+ $sum += $shipmentcost_sum;
+
return $sum;
}
}
return $self;
}
+=head2 delete_holiday_range
+
+ delete_holiday_range(day => $day,
+ month => $month,
+ year => $year);
+
+Delete a holiday range of dates for $self->{branchcode}.
+
+C<$day> Is the day month to make the date to delete.
+
+C<$month> Is month to make the date to delete.
+
+C<$year> Is year to make the date to delete.
+
+=cut
+
+sub delete_holiday_range {
+ my $self = shift;
+ my %options = @_;
+
+ my $dbh = C4::Context->dbh();
+ my $sth = $dbh->prepare("DELETE FROM special_holidays WHERE (branchcode = ?) AND (day = ?) AND (month = ?) AND (year = ?)");
+ $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
+}
+
+=head2 delete_holiday_range_repeatable
+
+ delete_holiday_range_repeatable(day => $day,
+ month => $month);
+
+Delete a holiday for $self->{branchcode}.
+
+C<$day> Is the day month to make the date to delete.
+
+C<$month> Is month to make the date to delete.
+
+=cut
+
+sub delete_holiday_range_repeatable {
+ my $self = shift;
+ my %options = @_;
+
+ my $dbh = C4::Context->dbh();
+ my $sth = $dbh->prepare("DELETE FROM repeatable_holidays WHERE (branchcode = ?) AND (day = ?) AND (month = ?)");
+ $sth->execute($self->{branchcode}, $options{day}, $options{month});
+}
+
+=head2 delete_exception_holiday_range
+
+ delete_exception_holiday_range(weekday => $weekday
+ day => $day,
+ month => $month,
+ year => $year);
+
+Delete a holiday for $self->{branchcode}.
+
+C<$day> Is the day month to make the date to delete.
+
+C<$month> Is month to make the date to delete.
+
+C<$year> Is year to make the date to delete.
+
+=cut
+
+sub delete_exception_holiday_range {
+ my $self = shift;
+ my %options = @_;
+
+ my $dbh = C4::Context->dbh();
+ my $sth = $dbh->prepare("DELETE FROM special_holidays WHERE (branchcode = ?) AND (isexception = 1) AND (day = ?) AND (month = ?) AND (year = ?)");
+ $sth->execute($self->{branchcode}, $options{day}, $options{month}, $options{year});
+}
=head2 isHoliday
#
if ( $borrower->{'category_type'} eq 'X' && ( $item->{barcode} )) {
# stats only borrower -- add entry to statistics table, and return issuingimpossible{STATS} = 1 .
- &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itemtype'},$borrower->{'borrowernumber'});
+ &UpdateStats(C4::Context->userenv->{'branch'},'localuse','','',$item->{'itemnumber'},$item->{'itemtype'},$borrower->{'borrowernumber'}, undef, $item->{'ccode'});
ModDateLastSeen( $item->{'itemnumber'} );
return( { STATS => 1 }, {});
}
}
}
}
+
+## check for high holds decreasing loan period
+ my $decrease_loan = C4::Context->preference('decreaseLoanHighHolds');
+ if ( $decrease_loan && $decrease_loan == 1 ) {
+ my ( $reserved, $num, $duration, $returndate ) =
+ checkHighHolds( $item, $borrower );
+
+ if ( $num >= C4::Context->preference('decreaseLoanHighHoldsValue') ) {
+ $needsconfirmation{HIGHHOLDS} = {
+ num_holds => $num,
+ duration => $duration,
+ returndate => output_pref($returndate),
+ };
+ }
+ }
+
return ( \%issuingimpossible, \%needsconfirmation, \%alerts );
}
+=head2 CanBookBeReturned
+
+ ($returnallowed, $message) = CanBookBeReturned($item, $branch)
+
+Check whether the item can be returned to the provided branch
+
+=over 4
+
+=item C<$item> is a hash of item information as returned from GetItem
+
+=item C<$branch> is the branchcode where the return is taking place
+
+=back
+
+Returns:
+
+=over 4
+
+=item C<$returnallowed> is 0 or 1, corresponding to whether the return is allowed (1) or not (0)
+
+=item C<$message> is the branchcode where the item SHOULD be returned, if the return is not allowed
+
+=back
+
+=cut
+
+sub CanBookBeReturned {
+ my ($item, $branch) = @_;
+ my $allowreturntobranch = C4::Context->preference("AllowReturnToBranch") || 'anywhere';
+
+ # assume return is allowed to start
+ my $allowed = 1;
+ my $message;
+
+ # identify all cases where return is forbidden
+ if ($allowreturntobranch eq 'homebranch' && $branch ne $item->{'homebranch'}) {
+ $allowed = 0;
+ $message = $item->{'homebranch'};
+ } elsif ($allowreturntobranch eq 'holdingbranch' && $branch ne $item->{'holdingbranch'}) {
+ $allowed = 0;
+ $message = $item->{'holdingbranch'};
+ } elsif ($allowreturntobranch eq 'homeorholdingbranch' && $branch ne $item->{'homebranch'} && $branch ne $item->{'holdingbranch'}) {
+ $allowed = 0;
+ $message = $item->{'homebranch'}; # FIXME: choice of homebranch is arbitrary
+ }
+
+ return ($allowed, $message);
+}
+
+=head2 CheckHighHolds
+
+ used when syspref decreaseLoanHighHolds is active. Returns 1 or 0 to define whether the minimum value held in
+ decreaseLoanHighHoldsValue is exceeded, the total number of outstanding holds, the number of days the loan
+ has been decreased to (held in syspref decreaseLoanHighHoldsValue), and the new due date
+
+=cut
+
+sub checkHighHolds {
+ my ( $item, $borrower ) = @_;
+ my $biblio = GetBiblioFromItemNumber( $item->{itemnumber} );
+ my $branch = _GetCircControlBranch( $item, $borrower );
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare(
+'select count(borrowernumber) as num_holds from reserves where biblionumber=?'
+ );
+ $sth->execute( $item->{'biblionumber'} );
+ my ($holds) = $sth->fetchrow_array;
+ if ($holds) {
+ my $issuedate = DateTime->now( time_zone => C4::Context->tz() );
+
+ my $calendar = Koha::Calendar->new( branchcode => $branch );
+
+ my $itype =
+ ( C4::Context->preference('item-level_itypes') )
+ ? $biblio->{'itype'}
+ : $biblio->{'itemtype'};
+ my $orig_due =
+ C4::Circulation::CalcDateDue( $issuedate, $itype, $branch,
+ $borrower );
+
+ my $reduced_datedue =
+ $calendar->addDate( $issuedate,
+ C4::Context->preference('decreaseLoanHighHoldsDuration') );
+
+ if ( DateTime->compare( $reduced_datedue, $orig_due ) == -1 ) {
+ return ( 1, $holds,
+ C4::Context->preference('decreaseLoanHighHoldsDuration'),
+ $reduced_datedue );
+ }
+ }
+ return ( 0, 0, 0, undef );
+}
+
=head2 AddIssue
&AddIssue($borrower, $barcode, [$datedue], [$cancelreserve], [$issuedate])
}
if ($borrower and $barcode and $barcodecheck ne '0'){#??? wtf
# find which item we issue
- my $item = GetItem('', $barcode) or return undef; # if we don't get an Item, abort.
+ my $item = GetItem('', $barcode) or return; # if we don't get an Item, abort.
my $branch = _GetCircControlBranch($item,$borrower);
# get actual issuing if there is one
C4::Context->userenv->{'branch'},
'issue', $charge,
($sipmode ? "SIP-$sipmode" : ''), $item->{'itemnumber'},
- $item->{'itype'}, $borrower->{'borrowernumber'}
+ $item->{'itype'}, $borrower->{'borrowernumber'}, undef, $item->{'ccode'}
);
# Send a checkout slip.
return $irule if defined($irule) ;
# if no rule matches,
- return undef;
+ return;
}
=head2 GetBranchBorrowerCircRule
$branches->{$hbr}->{PE} and $messages->{'IsPermanent'} = $hbr;
}
- # if indy branches and returning to different branch, refuse the return unless canreservefromotherbranches is turned on
- if ($hbr ne $branch && C4::Context->preference("IndependantBranches") && !(C4::Context->preference("canreservefromotherbranches"))){
+ # check if the return is allowed at this branch
+ my ($returnallowed, $message) = CanBookBeReturned($item, $branch);
+ unless ($returnallowed){
$messages->{'Wrongbranch'} = {
Wrongbranch => $branch,
- Rightbranch => $hbr,
+ Rightbranch => $message
};
$doreturn = 0;
- # bailing out here - in this case, current desired behavior
- # is to act as if no return ever happened at all.
- # FIXME - even in an indy branches situation, there should
- # still be an option for the library to accept the item
- # and transfer it to its owning library.
return ( $doreturn, $messages, $issue, $borrower );
}
if ( $item->{'wthdrawn'} ) { # book has been cancelled
$messages->{'wthdrawn'} = 1;
- $doreturn = 0;
+ $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems");
}
# case of a return of document (deal with issues and holdingbranch)
# find reserves.....
# if we don't have a reserve with the status W, we launch the Checkreserves routine
- my ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} );
+ my ($resfound, $resrec);
+ ($resfound, $resrec, undef) = C4::Reserves::CheckReserves( $item->{'itemnumber'} ) unless ( $item->{'wthdrawn'} );
if ($resfound) {
$resrec->{'ResFound'} = $resfound;
$messages->{'ResFound'} = $resrec;
$branch, $stat_type, '0', '',
$item->{'itemnumber'},
$biblio->{'itemtype'},
- $borrowernumber
+ $borrowernumber, undef, $item->{'ccode'}
);
# Send a check-in slip. # NOTE: borrower may be undef. probably shouldn't try to send messages then.
return 0 unless $data; # no warning, there's just nothing to fix
my $uquery;
- my @bind = ($borrowernumber, $item, $data->{'accountno'});
+ my @bind = ($data->{'accountlines_id'});
if ($exemptfine) {
$uquery = "update accountlines set accounttype='FFOR', amountoutstanding=0";
if (C4::Context->preference("FinesLog")) {
} else {
$uquery = "update accountlines set accounttype='F' ";
}
- $uquery .= " where (borrowernumber = ?) and (itemnumber = ?) and (accountno = ?)";
+ $uquery .= " where (accountlines_id = ?)";
my $usth = $dbh->prepare($uquery);
return $usth->execute(@bind);
}
$amountleft = $data->{'amountoutstanding'} - $amount; # Um, isn't this the same as ZERO? We just tested those two things are ==
}
my $usth = $dbh->prepare("UPDATE accountlines SET accounttype = 'LR',amountoutstanding='0'
- WHERE (borrowernumber = ?)
- AND (itemnumber = ?) AND (accountno = ?) ");
- $usth->execute($data->{'borrowernumber'},$itemnumber,$acctno); # We might be adjusting an account for some OTHER borrowernumber now. Not the one we passed in.
+ WHERE (accountlines_id = ?)");
+ $usth->execute($data->{'accountlines_id'}); # We might be adjusting an account for some OTHER borrowernumber now. Not the one we passed in.
#check if any credit is left if so writeoff other accounts
my $nextaccntno = getnextacctno($data->{'borrowernumber'});
$amountleft *= -1 if ($amountleft < 0);
$newamtos = $accdata->{'amountoutstanding'} - $amountleft;
$amountleft = 0;
}
- my $thisacct = $accdata->{'accountno'};
+ my $thisacct = $accdata->{'accountlines_id'};
# FIXME: move prepares outside while loop!
my $usth = $dbh->prepare("UPDATE accountlines SET amountoutstanding= ?
- WHERE (borrowernumber = ?)
- AND (accountno=?)");
- $usth->execute($newamtos,$data->{'borrowernumber'},'$thisacct'); # FIXME: '$thisacct' is a string literal!
+ WHERE (accountlines_id = ?)");
+ $usth->execute($newamtos,'$thisacct'); # FIXME: '$thisacct' is a string literal!
$usth = $dbh->prepare("INSERT INTO accountoffsets
(borrowernumber, accountno, offsetaccount, offsetamount)
VALUES
sub GetBiblioIssues {
my $biblionumber = shift;
- return undef unless $biblionumber;
+ return unless $biblionumber;
my $dbh = C4::Context->dbh;
my $query = "
SELECT issues.*,items.barcode,biblio.biblionumber,biblio.title, biblio.author,borrowers.cardnumber,borrowers.surname,borrowers.firstname
=cut
sub AddRenewal {
- my $borrowernumber = shift or return undef;
- my $itemnumber = shift or return undef;
+ my $borrowernumber = shift or return;
+ my $itemnumber = shift or return;
my $branch = shift;
my $datedue = shift;
my $lastreneweddate = shift || DateTime->now(time_zone => C4::Context->tz)->ymd();
- my $item = GetItem($itemnumber) or return undef;
- my $biblio = GetBiblioFromItemNumber($itemnumber) or return undef;
+ my $item = GetItem($itemnumber) or return;
+ my $biblio = GetBiblioFromItemNumber($itemnumber) or return;
my $dbh = C4::Context->dbh;
# Find the issues record for this book
# based on the value of the RenewalPeriodBase syspref.
unless ($datedue) {
- my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ) or return undef;
+ my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber ) or return;
my $itemtype = (C4::Context->preference('item-level_itypes')) ? $biblio->{'itype'} : $biblio->{'itemtype'};
$datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ?
'Rent', $charge, $itemnumber );
}
# Log the renewal
- UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber);
+ UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber, undef, $item->{'ccode'});
return $datedue;
}
if ($ismemcached) {
return $memcached;
} else {
- return undef;
+ return;
}
}
if (/Postgres|Pg|PostgresSQL/) { return("Pg"); }
if (/oracle/) { return("Oracle"); }
}
- return undef; # Just in case
+ return; # Just in case
}
sub import {
$conf_fname = CONFIG_FNAME;
} else {
warn "unable to locate Koha configuration file koha-conf.xml";
- return undef;
+ return;
}
}
$self->{"config_file"} = $conf_fname;
warn "read_config_file($conf_fname) returned undef" if !defined($self->{"config"});
- return undef if !defined($self->{"config"});
+ return if !defined($self->{"config"});
$self->{"dbh"} = undef; # Database handle
$self->{"Zconn"} = undef; # Zebra Connections
=cut
-sub _common_config ($$) {
+sub _common_config {
my $var = shift;
my $term = shift;
- return undef if !defined($context->{$term});
+ return if !defined($context->{$term});
# Presumably $self->{$term} might be
# undefined if the config file given to &new
# didn't exist, and the caller didn't bother
return $sysprefs{$var};
}
-sub boolean_preference ($) {
+sub boolean_preference {
my $self = shift;
my $var = shift; # The system preference to return
my $it = preference($self, $var);
#'
sub set_userenv {
my ($usernum, $userid, $usercnum, $userfirstname, $usersurname, $userbranch, $branchname, $userflags, $emailaddress, $branchprinter)= @_;
- my $var=$context->{"activeuser"};
+ my $var=$context->{"activeuser"} || '';
my $cell = {
"number" => $usernum,
"id" => $userid,
return $cell;
}
-sub set_shelves_userenv ($$) {
- my ($type, $shelves) = @_ or return undef;
- my $activeuser = $context->{activeuser} or return undef;
+sub set_shelves_userenv {
+ my ($type, $shelves) = @_ or return;
+ my $activeuser = $context->{activeuser} or return;
$context->{userenv}->{$activeuser}->{barshelves} = $shelves if $type eq 'bar';
$context->{userenv}->{$activeuser}->{pubshelves} = $shelves if $type eq 'pub';
$context->{userenv}->{$activeuser}->{totshelves} = $shelves if $type eq 'tot';
}
-sub get_shelves_userenv () {
+sub get_shelves_userenv {
my $active;
unless ($active = $context->{userenv}->{$context->{activeuser}}) {
$debug and warn "get_shelves_userenv cannot retrieve context->{userenv}->{context->{activeuser}}";
- return undef;
+ return;
}
my $totshelves = $active->{totshelves} or undef;
my $pubshelves = $active->{pubshelves} or undef;
{ my ($iData, $iWidth, $iHeight, $iFormat,$aiData, $aiWidth, $aiHeight, $aiFormat) = @_;
my ($namnet, $utrad);
if (! $PDF::Reuse::pos) # If no output is active, it is no use to continue
- { return undef;
+ { return;
}
prJpegBlob($aiData, $aiWidth, $aiHeight, $aiFormat);
my $altObjNr = $PDF::Reuse::objNr;
{ my ($iData, $iWidth, $iHeight, $iFormat, $altArrayObjNr) = @_;
my ($iLangd, $namnet, $utrad);
if (! $PDF::Reuse::pos) # If no output is active, it is no use to continue
- { return undef;
+ { return;
}
my $checkidOld = $PDF::Reuse::checkId;
if (!$iFormat)
$namnet = 'Ig' . $PDF::Reuse::imageNr;
$PDF::Reuse::objNr++;
$PDF::Reuse::objekt[$PDF::Reuse::objNr] = $PDF::Reuse::pos;
- open (BILDFIL, "<$iFile") || errLog("Couldn't open $iFile, $!, aborts");
- binmode BILDFIL;
+ open (my $fh, '<', "$iFile") || errLog("Couldn't open $iFile, $!, aborts");
+ binmode $fh;
my $iStream;
- sysread BILDFIL, $iStream, $iLangd;
+ sysread $fh, $iStream, $iLangd;
$utrad = "$PDF::Reuse::objNr 0 obj\n<</Type/XObject/Subtype/Image/Name/$namnet" .
"/Width $iWidth /Height $iHeight /BitsPerComponent 8 " .
($altArrayObjNr ? "/Alternates $altArrayObjNr 0 R " : "") .
"/Filter/DCTDecode/ColorSpace/DeviceRGB"
. "/Length $iLangd >>stream\n$iStream\nendstream\nendobj\n";
- close BILDFIL;
+ close $fh;
$PDF::Reuse::pos += syswrite $PDF::Reuse::UTFIL, $utrad;
if ($PDF::Reuse::runfil)
{ $PDF::Reuse::log .= "Cid~$PDF::Reuse::checkId\n";
#"Mozilla/4.76 [en] (Win98; U)", # if for some reason you want to go stealth, you might prefer this
}
-sub image_url (;$) {
- ($user and $pass) or return undef;
+sub image_url {
+ ($user and $pass) or return;
my $isbn = (@_ ? shift : '');
$isbn =~ s/(p|-)//g; # sanitize
return $image_url . $isbn;
}
-sub link_url (;$) {
+sub link_url {
my $isbn = (@_ ? shift : '');
$isbn =~ s/(p|-)//g; # sanitize
- $link_url or return undef;
+ $link_url or return;
return $link_url . $isbn;
}
-sub content_cafe_url ($) {
- ($user and $pass) or return undef;
+sub content_cafe_url {
+ ($user and $pass) or return;
my $isbn = (@_ ? shift : '');
$isbn =~ s/(p|-)//g; # sanitize
return "http://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=$user&Password=$pass&Options=Y&ItemKey=$isbn";
}
-sub http_jacket_link ($) {
- my $isbn = shift or return undef;
+sub http_jacket_link {
+ my $isbn = shift or return;
$isbn =~ s/(p|-)//g; # sanitize
my $image = availability($isbn);
my $alt = "Buy this book";
return sprintf qq(<a class="btlink" href="%s">%s</a>),$link,($image||$alt);
}
-sub availability ($) {
- my $isbn = shift or return undef;
- ($user and $pass) or return undef;
+sub availability {
+ my $isbn = shift or return;
+ ($user and $pass) or return;
$isbn =~ s/(p|-)//g; # sanitize
my $url = "http://contentcafe2.btol.com/ContentCafe/InventoryAvailability.asmx/CheckInventory?UserID=$user&Password=$pass&Value=$isbn";
$debug and warn __PACKAGE__ . " request:\n$url\n";
use C4::Branch;
use C4::Accounts;
use C4::Biblio;
-use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber);
+use C4::Reserves qw(AddReserve CancelReserve GetReservesFromBiblionumber GetReservesFromBorrowernumber CanBookBeReserved CanItemBeReserved);
use C4::Context;
use C4::AuthoritiesMarc;
use C4::ILSDI::Utility;
# Add additional fields
$reserve->{'item'} = $item;
$reserve->{'branchname'} = $branchname;
- $reserve->{'title'} = ( GetBiblio( $reserve->{'biblionumber'} ) )[1]->{'title'};
+ $reserve->{'title'} = GetBiblio( $reserve->{'biblionumber'} )->{'title'};
}
$borrower->{'holds'}->{'hold'} = \@reserves;
}
# Issues management
if ( $cgi->param('show_loans') eq "1" ) {
my $issues = GetPendingIssues($borrowernumber);
+ foreach my $issue ( @$issues ){
+ $issue->{'issuedate'} = $issue->{'issuedate'}->strftime('%Y-%m-%d %H:%M');
+ $issue->{'date_due'} = $issue->{'date_due'}->strftime('%Y-%m-%d %H:%M');
+ }
$borrower->{'loans'}->{'loan'} = $issues;
}
# Get the biblio record, or return an error code
my $biblionumber = $cgi->param('bib_id');
- my ( $count, $biblio ) = GetBiblio( $biblionumber );
+ my $biblio = GetBiblio( $biblionumber );
return { code => 'RecordNotFound' } unless $$biblio{biblionumber};
my $title = $$biblio{title};
# Get the biblio or return an error code
my $biblionumber = $cgi->param('bib_id');
- my ( $count, $biblio ) = GetBiblio($biblionumber);
+ my $biblio = GetBiblio($biblionumber);
return { code => 'RecordNotFound' } unless $$biblio{biblionumber};
my $title = $$biblio{title};
package C4::ImportBatch;
-# Copyright (C) 2007 LibLime
+# Copyright (C) 2007 LibLime, 2012 C & P Bibliography Services
#
# This file is part of Koha.
#
use C4::Biblio;
use C4::Items;
use C4::Charset;
+use C4::AuthoritiesMarc;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
GetImportRecordMarcXML
AddImportBatch
GetImportBatch
+ AddAuthToBatch
AddBiblioToBatch
AddItemsToImportBiblio
+ ModAuthorityInBatch
ModBiblioInBatch
BatchStageMarcRecords
- BatchFindBibDuplicates
- BatchCommitBibRecords
- BatchRevertBibRecords
+ BatchFindDuplicates
+ BatchCommitRecords
+ BatchRevertRecords
CleanBatch
GetAllImportBatches
GetStagedWebserviceBatches
GetImportBatchRangeDesc
GetNumberOfNonZ3950ImportBatches
- GetImportBibliosRange
+ GetImportRecordsRange
GetItemNumbersFromImportBatch
GetImportBatchStatus
my (@fields, @vals);
foreach (qw( matcher_id template_id branchcode
overlay_action nomatch_action item_action
- import_status batch_type file_name comments )) {
+ import_status batch_type file_name comments record_type )) {
if (exists $params->{$_}) {
push @fields, $_;
push @vals, $params->{$_};
my $z3950random = shift;
my $update_counts = @_ ? shift : 1;
- my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'biblio', $encoding, $z3950random);
+ my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'biblio', $encoding, $z3950random, C4::Context->preference('marcflavour'));
_add_biblio_fields($import_record_id, $marc_record);
_update_batch_record_counts($batch_id) if $update_counts;
return $import_record_id;
sub ModBiblioInBatch {
my ($import_record_id, $marc_record) = @_;
- _update_import_record_marc($import_record_id, $marc_record);
+ _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('marcflavour'));
_update_biblio_fields($import_record_id, $marc_record);
}
+=head2 AddAuthToBatch
+
+ my $import_record_id = AddAuthToBatch($batch_id, $record_sequence,
+ $marc_record, $encoding, $z3950random, $update_counts, [$marc_type]);
+
+=cut
+
+sub AddAuthToBatch {
+ my $batch_id = shift;
+ my $record_sequence = shift;
+ my $marc_record = shift;
+ my $encoding = shift;
+ my $z3950random = shift;
+ my $update_counts = @_ ? shift : 1;
+ my $marc_type = shift || C4::Context->preference('marcflavour');
+
+ $marc_type = 'UNIMARCAUTH' if $marc_type eq 'UNIMARC';
+
+ my $import_record_id = _create_import_record($batch_id, $record_sequence, $marc_record, 'auth', $encoding, $z3950random, $marc_type);
+ _add_auth_fields($import_record_id, $marc_record);
+ _update_batch_record_counts($batch_id) if $update_counts;
+ return $import_record_id;
+}
+
+=head2 ModAuthInBatch
+
+ ModAuthInBatch($import_record_id, $marc_record);
+
+=cut
+
+sub ModAuthInBatch {
+ my ($import_record_id, $marc_record) = @_;
+
+ my $marcflavour = C4::Context->preference('marcflavour');
+ _update_import_record_marc($import_record_id, $marc_record, $marcflavour eq 'UNIMARC' ? 'UNIMARCAUTH' : 'USMARC');
+
+}
+
=head2 BatchStageMarcRecords
($batch_id, $num_records, $num_items, @invalid_records) =
- BatchStageMarcRecords($encoding, $marc_records, $file_name,
+ BatchStageMarcRecords($record_type, $encoding, $marc_records, $file_name,
$comments, $branch_code, $parse_items,
$leave_as_staging,
$progress_interval, $progress_callback);
=cut
sub BatchStageMarcRecords {
+ my $record_type = shift;
my $encoding = shift;
my $marc_records = shift;
my $file_name = shift;
my $branch_code = shift;
my $parse_items = shift;
my $leave_as_staging = shift;
-
+
# optional callback to monitor status
# of job
my $progress_interval = 0;
batch_type => 'batch',
file_name => $file_name,
comments => $comments,
+ record_type => $record_type,
} );
if ($parse_items) {
SetImportBatchItemAction($batch_id, 'always_add');
SetImportBatchItemAction($batch_id, 'ignore');
}
+ my $marc_type = C4::Context->preference('marcflavour');
+ $marc_type .= 'AUTH' if ($marc_type eq 'UNIMARC' && $record_type eq 'auth');
my @invalid_records = ();
my $num_valid = 0;
my $num_items = 0;
&$progress_callback($rec_num);
}
my ($marc_record, $charset_guessed, $char_errors) =
- MarcToUTF8Record($marc_blob, C4::Context->preference("marcflavour"), $encoding);
+ MarcToUTF8Record($marc_blob, $marc_type, $encoding);
$encoding = $charset_guessed unless $encoding;
if (scalar($marc_record->fields()) == 0) {
push @invalid_records, $marc_blob;
} else {
+
+ # Normalize the record so it doesn't have separated diacritics
+ SetUTF8Flag($marc_record);
+
$num_valid++;
- $import_record_id = AddBiblioToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0);
- if ($parse_items) {
- my @import_items_ids = AddItemsToImportBiblio($batch_id, $import_record_id, $marc_record, 0);
- $num_items += scalar(@import_items_ids);
+ if ($record_type eq 'biblio') {
+ $import_record_id = AddBiblioToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0);
+ if ($parse_items) {
+ my @import_items_ids = AddItemsToImportBiblio($batch_id, $import_record_id, $marc_record, 0);
+ $num_items += scalar(@import_items_ids);
+ }
+ } elsif ($record_type eq 'auth') {
+ $import_record_id = AddAuthToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0, $marc_type);
}
}
}
if ($#import_items_ids > -1) {
_update_batch_record_counts($batch_id) if $update_counts;
- _update_import_record_marc($import_record_id, $marc_record);
+ _update_import_record_marc($import_record_id, $marc_record, C4::Context->preference('marcflavour'));
}
return @import_items_ids;
}
-=head2 BatchFindBibDuplicates
+=head2 BatchFindDuplicates
- my $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher,
+ my $num_with_matches = BatchFindDuplicates($batch_id, $matcher,
$max_matches, $progress_interval, $progress_callback);
Goes through the records loaded in the batch and attempts to
=cut
-sub BatchFindBibDuplicates {
+sub BatchFindDuplicates {
my $batch_id = shift;
my $matcher = shift;
my $max_matches = @_ ? shift : 10;
my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("SELECT import_record_id, marc
+ my $sth = $dbh->prepare("SELECT import_record_id, record_type, marc
FROM import_records
- JOIN import_biblios USING (import_record_id)
WHERE import_batch_id = ?");
$sth->execute($batch_id);
my $num_with_matches = 0;
return $num_with_matches;
}
-=head2 BatchCommitBibRecords
+=head2 BatchCommitRecords
- my ($num_added, $num_updated, $num_items_added, $num_items_errored,
- $num_ignored) = BatchCommitBibRecords($batch_id, $framework,
- $progress_interval, $progress_callback);
+ my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) =
+ BatchCommitRecords($batch_id, $framework,
+ $progress_interval, $progress_callback);
=cut
-sub BatchCommitBibRecords {
+sub BatchCommitRecords {
my $batch_id = shift;
my $framework = shift;
$progress_interval = 0 unless 'CODE' eq ref $progress_callback;
}
+ my $record_type;
my $num_added = 0;
my $num_updated = 0;
my $num_items_added = 0;
my $num_items_errored = 0;
my $num_ignored = 0;
# commit (i.e., save, all records in the batch)
- # FIXME biblio only at the moment
SetImportBatchStatus('importing');
my $overlay_action = GetImportBatchOverlayAction($batch_id);
my $nomatch_action = GetImportBatchNoMatchAction($batch_id);
my $item_action = GetImportBatchItemAction($batch_id);
+ my $item_tag;
+ my $item_subfield;
my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("SELECT import_record_id, status, overlay_status, marc, encoding
+ my $sth = $dbh->prepare("SELECT import_records.import_record_id, record_type, status, overlay_status, marc, encoding
FROM import_records
- JOIN import_biblios USING (import_record_id)
+ LEFT JOIN import_auths ON (import_records.import_record_id=import_auths.import_record_id)
+ LEFT JOIN import_biblios ON (import_records.import_record_id=import_biblios.import_record_id)
WHERE import_batch_id = ?");
$sth->execute($batch_id);
+ my $marcflavour = C4::Context->preference('marcflavour');
my $rec_num = 0;
while (my $rowref = $sth->fetchrow_hashref) {
+ $record_type = $rowref->{'record_type'};
$rec_num++;
if ($progress_interval and (0 == ($rec_num % $progress_interval))) {
&$progress_callback($rec_num);
next;
}
+ my $marc_type;
+ if ($marcflavour eq 'UNIMARC' && $record_type eq 'auth') {
+ $marc_type = 'UNIMARCAUTH';
+ } elsif ($marcflavour eq 'UNIMARC') {
+ $marc_type = 'UNIMARC';
+ } else {
+ $marc_type = 'USMARC';
+ }
my $marc_record = MARC::Record->new_from_usmarc($rowref->{'marc'});
- # remove any item tags - rely on BatchCommitItems
- my ($item_tag,$item_subfield) = &GetMarcFromKohaField("items.itemnumber",'');
- foreach my $item_field ($marc_record->field($item_tag)) {
- $marc_record->delete_field($item_field);
+ if ($record_type eq 'biblio') {
+ # remove any item tags - rely on BatchCommitItems
+ ($item_tag,$item_subfield) = &GetMarcFromKohaField("items.itemnumber",'');
+ foreach my $item_field ($marc_record->field($item_tag)) {
+ $marc_record->delete_field($item_field);
+ }
}
- # decide what what to do with the bib and item records
- my ($bib_result, $item_result, $bib_match) =
+ my ($record_result, $item_result, $record_match) =
_get_commit_action($overlay_action, $nomatch_action, $item_action,
- $rowref->{'overlay_status'}, $rowref->{'import_record_id'});
+ $rowref->{'overlay_status'}, $rowref->{'import_record_id'}, $record_type);
- if ($bib_result eq 'create_new') {
+ my $recordid;
+ my $query;
+ if ($record_result eq 'create_new') {
$num_added++;
- my ($biblionumber, $biblioitemnumber) = AddBiblio($marc_record, $framework);
- my $sth = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?");
- $sth->execute($biblionumber, $rowref->{'import_record_id'});
- $sth->finish();
- if ($item_result eq 'create_new') {
- my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $biblionumber);
- $num_items_added += $bib_items_added;
- $num_items_errored += $bib_items_errored;
+ if ($record_type eq 'biblio') {
+ my $biblioitemnumber;
+ ($recordid, $biblioitemnumber) = AddBiblio($marc_record, $framework);
+ $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
+ if ($item_result eq 'create_new') {
+ my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid);
+ $num_items_added += $bib_items_added;
+ $num_items_errored += $bib_items_errored;
+ }
+ } else {
+ $recordid = AddAuthority($marc_record, undef, GuessAuthTypeCode($marc_record));
+ $query = "UPDATE import_auths SET matched_authid = ? WHERE import_record_id = ?";
}
+ my $sth = $dbh->prepare_cached($query);
+ $sth->execute($recordid, $rowref->{'import_record_id'});
+ $sth->finish();
SetImportRecordStatus($rowref->{'import_record_id'}, 'imported');
- } elsif ($bib_result eq 'replace') {
+ } elsif ($record_result eq 'replace') {
$num_updated++;
- my $biblionumber = $bib_match;
- my ($count, $oldbiblio) = GetBiblio($biblionumber);
- my $oldxml = GetXmlBiblio($biblionumber);
-
- # remove item fields so that they don't get
- # added again if record is reverted
- my $old_marc = MARC::Record->new_from_xml(StripNonXmlChars($oldxml), 'UTF-8', $rowref->{'encoding'});
- foreach my $item_field ($old_marc->field($item_tag)) {
- $old_marc->delete_field($item_field);
- }
+ $recordid = $record_match;
+ my $oldxml;
+ if ($record_type eq 'biblio') {
+ my ($count, $oldbiblio) = GetBiblio($recordid);
+ $oldxml = GetXmlBiblio($recordid);
+
+ # remove item fields so that they don't get
+ # added again if record is reverted
+ my $old_marc = MARC::Record->new_from_xml(StripNonXmlChars($oldxml), 'UTF-8', $rowref->{'encoding'}, $marc_type);
+ foreach my $item_field ($old_marc->field($item_tag)) {
+ $old_marc->delete_field($item_field);
+ }
+ $oldxml = $old_marc->as_xml($marc_type);
+
+ ModBiblio($marc_record, $recordid, $oldbiblio->{'frameworkcode'});
+ $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?";
+
+ if ($item_result eq 'create_new') {
+ my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid);
+ $num_items_added += $bib_items_added;
+ $num_items_errored += $bib_items_errored;
+ }
+ } else {
+ $oldxml = GetAuthorityXML($recordid);
- ModBiblio($marc_record, $biblionumber, $oldbiblio->{'frameworkcode'});
+ ModAuthority($recordid, $marc_record, GuessAuthTypeCode($marc_record));
+ $query = "UPDATE import_auths SET matched_authid = ? WHERE import_record_id = ?";
+ }
my $sth = $dbh->prepare_cached("UPDATE import_records SET marcxml_old = ? WHERE import_record_id = ?");
- $sth->execute($old_marc->as_xml(), $rowref->{'import_record_id'});
+ $sth->execute($oldxml, $rowref->{'import_record_id'});
$sth->finish();
- my $sth2 = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?");
- $sth2->execute($biblionumber, $rowref->{'import_record_id'});
+ my $sth2 = $dbh->prepare_cached($query);
+ $sth2->execute($recordid, $rowref->{'import_record_id'});
$sth2->finish();
- if ($item_result eq 'create_new') {
- my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $biblionumber);
- $num_items_added += $bib_items_added;
- $num_items_errored += $bib_items_errored;
- }
SetImportRecordOverlayStatus($rowref->{'import_record_id'}, 'match_applied');
SetImportRecordStatus($rowref->{'import_record_id'}, 'imported');
- } elsif ($bib_result eq 'ignore') {
+ } elsif ($record_result eq 'ignore') {
$num_ignored++;
- my $biblionumber = $bib_match;
- if (defined $biblionumber and $item_result eq 'create_new') {
- my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $biblionumber);
+ if ($record_type eq 'biblio' and defined $recordid and $item_result eq 'create_new') {
+ my ($bib_items_added, $bib_items_errored) = BatchCommitItems($rowref->{'import_record_id'}, $recordid);
$num_items_added += $bib_items_added;
$num_items_errored += $bib_items_errored;
# still need to record the matched biblionumber so that the
# items can be reverted
my $sth2 = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?");
- $sth2->execute($biblionumber, $rowref->{'import_record_id'});
+ $sth2->execute($recordid, $rowref->{'import_record_id'});
SetImportRecordOverlayStatus($rowref->{'import_record_id'}, 'match_applied');
}
SetImportRecordStatus($rowref->{'import_record_id'}, 'ignored');
return ($num_items_added, $num_items_errored);
}
-=head2 BatchRevertBibRecords
+=head2 BatchRevertRecords
my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted,
- $num_ignored) = BatchRevertBibRecords($batch_id);
+ $num_ignored) = BatchRevertRecords($batch_id);
=cut
-sub BatchRevertBibRecords {
+sub BatchRevertRecords {
my $batch_id = shift;
+ my $record_type;
my $num_deleted = 0;
my $num_errors = 0;
my $num_reverted = 0;
- my $num_items_deleted = 0;
my $num_ignored = 0;
+ my $num_items_deleted = 0;
# commit (i.e., save, all records in the batch)
- # FIXME biblio only at the moment
SetImportBatchStatus('reverting');
my $overlay_action = GetImportBatchOverlayAction($batch_id);
my $nomatch_action = GetImportBatchNoMatchAction($batch_id);
my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("SELECT import_record_id, status, overlay_status, marcxml_old, encoding, matched_biblionumber
+ my $sth = $dbh->prepare("SELECT import_records.import_record_id, record_type, status, overlay_status, marcxml_old, encoding, matched_biblionumber, matched_authid
FROM import_records
- JOIN import_biblios USING (import_record_id)
+ LEFT JOIN import_auths ON (import_records.import_record_id=import_auths.import_record_id)
+ LEFT JOIN import_biblios ON (import_records.import_record_id=import_biblios.import_record_id)
WHERE import_batch_id = ?");
$sth->execute($batch_id);
+ my $marc_type;
+ my $marcflavour = C4::Context->preference('marcflavour');
while (my $rowref = $sth->fetchrow_hashref) {
+ $record_type = $rowref->{'record_type'};
if ($rowref->{'status'} eq 'error' or $rowref->{'status'} eq 'reverted') {
$num_ignored++;
next;
}
+ if ($marcflavour eq 'UNIMARC' && $record_type eq 'auth') {
+ $marc_type = 'UNIMARCAUTH';
+ } elsif ($marcflavour eq 'UNIMARC') {
+ $marc_type = 'UNIMARC';
+ } else {
+ $marc_type = 'USMARC';
+ }
- my $bib_result = _get_revert_action($overlay_action, $rowref->{'overlay_status'}, $rowref->{'status'});
+ my $record_result = _get_revert_action($overlay_action, $rowref->{'overlay_status'}, $rowref->{'status'});
- if ($bib_result eq 'delete') {
- $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
- my $error = DelBiblio($rowref->{'matched_biblionumber'});
+ if ($record_result eq 'delete') {
+ my $error = undef;
+ if ($record_type eq 'biblio') {
+ $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+ $error = DelBiblio($rowref->{'matched_biblionumber'});
+ } else {
+ my $deletedauthid = DelAuthority($rowref->{'matched_authid'});
+ }
if (defined $error) {
$num_errors++;
} else {
$num_deleted++;
SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted');
}
- } elsif ($bib_result eq 'restore') {
+ } elsif ($record_result eq 'restore') {
$num_reverted++;
- my $old_record = MARC::Record->new_from_xml(StripNonXmlChars($rowref->{'marcxml_old'}), 'UTF-8', $rowref->{'encoding'});
- my $biblionumber = $rowref->{'matched_biblionumber'};
- my ($count, $oldbiblio) = GetBiblio($biblionumber);
- $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
- ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'});
+ my $old_record = MARC::Record->new_from_xml(StripNonXmlChars($rowref->{'marcxml_old'}), 'UTF-8', $rowref->{'encoding'}, $marc_type);
+ if ($record_type eq 'biblio') {
+ my $biblionumber = $rowref->{'matched_biblionumber'};
+ my ($count, $oldbiblio) = GetBiblio($biblionumber);
+ $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+ ModBiblio($old_record, $biblionumber, $oldbiblio->{'frameworkcode'});
+ } else {
+ my $authid = $rowref->{'matched_authid'};
+ ModAuthority($authid, $old_record, GuessAuthTypeCode($old_record));
+ }
SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted');
- } elsif ($bib_result eq 'ignore') {
- $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+ } elsif ($record_result eq 'ignore') {
+ if ($record_type eq 'biblio') {
+ $num_items_deleted += BatchRevertItems($rowref->{'import_record_id'}, $rowref->{'matched_biblionumber'});
+ }
SetImportRecordStatus($rowref->{'import_record_id'}, 'reverted');
}
- # remove matched_biblionumber only if there is no 'imported' item left
- my $sth2 = $dbh->prepare_cached("UPDATE import_biblios SET matched_biblionumber = NULL WHERE import_record_id = ? AND NOT EXISTS (SELECT * FROM import_items WHERE import_items.import_record_id=import_biblios.import_record_id and status='imported')" );
+ my $query;
+ if ($record_type eq 'biblio') {
+ # remove matched_biblionumber only if there is no 'imported' item left
+ $query = "UPDATE import_biblios SET matched_biblionumber = NULL WHERE import_record_id = ?";
+ $query = "UPDATE import_biblios SET matched_biblionumber = NULL WHERE import_record_id = ? AND NOT EXISTS (SELECT * FROM import_items WHERE import_items.import_record_id=import_biblios.import_record_id and status='imported')";
+ } else {
+ $query = "UPDATE import_auths SET matched_authid = NULL WHERE import_record_id = ?";
+ }
+ my $sth2 = $dbh->prepare_cached($query);
$sth2->execute($rowref->{'import_record_id'});
}
return $count;
}
-=head2 GetImportBibliosRange
+=head2 GetImportRecordsRange
- my $results = GetImportBibliosRange($batch_id, $offset, $results_per_group);
+ my $results = GetImportRecordsRange($batch_id, $offset, $results_per_group);
Returns a reference to an array of hash references corresponding to
-import_biblios/import_records rows for a given batch
+import_biblios/import_auths/import_records rows for a given batch
starting at the given offset.
=cut
-sub GetImportBibliosRange {
+sub GetImportRecordsRange {
my ($batch_id, $offset, $results_per_group, $status) = @_;
my $dbh = C4::Context->dbh;
- my $query = "SELECT title, author, isbn, issn, import_record_id, record_sequence,
- status, overlay_status, matched_biblionumber
+ my $query = "SELECT title, author, isbn, issn, authorized_heading, import_records.import_record_id,
+ record_sequence, status, overlay_status,
+ matched_biblionumber, matched_authid, record_type
FROM import_records
- JOIN import_biblios USING (import_record_id)
+ LEFT JOIN import_auths ON (import_records.import_record_id=import_auths.import_record_id)
+ LEFT JOIN import_biblios ON (import_records.import_record_id=import_biblios.import_record_id)
WHERE import_batch_id = ?";
my @params;
push(@params, $batch_id);
my $dbh = C4::Context->dbh;
# FIXME currently biblio only
- my $sth = $dbh->prepare_cached("SELECT title, author, biblionumber, score
+ my $sth = $dbh->prepare_cached("SELECT title, author, biblionumber,
+ candidate_match_id, score, record_type
FROM import_records
JOIN import_record_matches USING (import_record_id)
- JOIN biblio ON (biblionumber = candidate_match_id)
+ LEFT JOIN biblio ON (biblionumber = candidate_match_id)
WHERE import_record_id = ?
ORDER BY score DESC, biblionumber DESC");
$sth->bind_param(1, $import_record_id);
my $results = [];
$sth->execute();
while (my $row = $sth->fetchrow_hashref) {
+ if ($row->{'record_type'} eq 'auth') {
+ $row->{'authorized_heading'} = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } );
+ }
+ next if ($row->{'record_type'} eq 'biblio' && not $row->{'biblionumber'});
push @$results, $row;
last if $best_only;
}
# internal functions
sub _create_import_record {
- my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random) = @_;
+ my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random, $marc_type) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml,
record_type, encoding, z3950random)
VALUES (?, ?, ?, ?, ?, ?, ?)");
- $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml(),
+ $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml($marc_type),
$record_type, $encoding, $z3950random);
my $import_record_id = $dbh->{'mysql_insertid'};
$sth->finish();
}
sub _update_import_record_marc {
- my ($import_record_id, $marc_record) = @_;
+ my ($import_record_id, $marc_record, $marc_type) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("UPDATE import_records SET marc = ?, marcxml = ?
WHERE import_record_id = ?");
- $sth->execute($marc_record->as_usmarc(), $marc_record->as_xml(C4::Context->preference('marcflavour')), $import_record_id);
+ $sth->execute($marc_record->as_usmarc(), $marc_record->as_xml($marc_type), $import_record_id);
+ $sth->finish();
+}
+
+sub _add_auth_fields {
+ my ($import_record_id, $marc_record) = @_;
+
+ my $controlnumber;
+ if ($marc_record->field('001')) {
+ $controlnumber = $marc_record->field('001')->data();
+ }
+ my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marc_record });
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare("INSERT INTO import_auths (import_record_id, control_number, authorized_heading) VALUES (?, ?, ?)");
+ $sth->execute($import_record_id, $controlnumber, $authorized_heading);
$sth->finish();
}
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare_cached("UPDATE import_batches SET
- num_biblios = (
+ num_records = (
SELECT COUNT(*)
FROM import_records
- WHERE import_batch_id = import_batches.import_batch_id
- AND record_type = 'biblio'),
+ WHERE import_batch_id = import_batches.import_batch_id),
num_items = (
SELECT COUNT(*)
FROM import_records
}
sub _get_commit_action {
- my ($overlay_action, $nomatch_action, $item_action, $overlay_status, $import_record_id) = @_;
+ my ($overlay_action, $nomatch_action, $item_action, $overlay_status, $import_record_id, $record_type) = @_;
- my ($bib_result, $bib_match, $item_result);
-
- if ($overlay_status ne 'no_match') {
- $bib_match = GetBestRecordMatch($import_record_id);
- if ($overlay_action eq 'replace') {
- $bib_result = defined($bib_match) ? 'replace' : 'create_new';
- } elsif ($overlay_action eq 'create_new') {
- $bib_result = 'create_new';
- } elsif ($overlay_action eq 'ignore') {
- $bib_result = 'ignore';
- }
- $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_matches') ? 'create_new' : 'ignore';
- } else {
- $bib_result = $nomatch_action;
- $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_new') ? 'create_new' : 'ignore';
- }
+ if ($record_type eq 'biblio') {
+ my ($bib_result, $bib_match, $item_result);
+
+ if ($overlay_status ne 'no_match') {
+ $bib_match = GetBestRecordMatch($import_record_id);
+ if ($overlay_action eq 'replace') {
+ $bib_result = defined($bib_match) ? 'replace' : 'create_new';
+ } elsif ($overlay_action eq 'create_new') {
+ $bib_result = 'create_new';
+ } elsif ($overlay_action eq 'ignore') {
+ $bib_result = 'ignore';
+ }
+ $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_matches') ? 'create_new' : 'ignore';
+ } else {
+ $bib_result = $nomatch_action;
+ $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_new') ? 'create_new' : 'ignore';
+ }
+ return ($bib_result, $item_result, $bib_match);
+ } else { # must be auths
+ my ($auth_result, $auth_match);
+
+ if ($overlay_status ne 'no_match') {
+ $auth_match = GetBestRecordMatch($import_record_id);
+ if ($overlay_action eq 'replace') {
+ $auth_result = defined($auth_match) ? 'replace' : 'create_new';
+ } elsif ($overlay_action eq 'create_new') {
+ $auth_result = 'create_new';
+ } elsif ($overlay_action eq 'ignore') {
+ $auth_result = 'ignore';
+ }
+ } else {
+ $auth_result = $nomatch_action;
+ }
- return ($bib_result, $item_result, $bib_match);
+ return ($auth_result, undef, $auth_match);
+
+ }
}
sub _get_revert_action {
mkdir $tempdir;
};
if ($@) {
- return undef;
+ return;
} else {
return $tempdir;
}
$tempdir = _createTmpDir($tmp);
}
if ($tempdir) {
+ my $fh;
# populate tempdir directory with the ods elements
eval {
- if (open(OUT, "> $tempdir/content.xml")) {
- print OUT $strContent;
- close(OUT);
+ if (open($fh, '>', "$tempdir/content.xml")) {
+ print {$fh} $strContent;
+ close($fh);
}
- if (open(OUT, "> $tempdir/mimetype")) {
- print OUT 'application/vnd.oasis.opendocument.spreadsheet';
- close(OUT);
+ if (open($fh, '>', "$tempdir/mimetype")) {
+ print {$fh} 'application/vnd.oasis.opendocument.spreadsheet';
+ close($fh);
}
- if (open(OUT, "> $tempdir/meta.xml")) {
- print OUT _getMeta($lang);
- close(OUT);
+ if (open($fh, '>', "$tempdir/meta.xml")) {
+ print {$fh} _getMeta($lang);
+ close($fh);
}
- if (open(OUT, "> $tempdir/styles.xml")) {
- print OUT ODS_STYLES_STR;
- close(OUT);
+ if (open($fh, '>', "$tempdir/styles.xml")) {
+ print {$fh} ODS_STYLES_STR;
+ close($fh);
}
- if (open(OUT, "> $tempdir/settings.xml")) {
- print OUT ODS_SETTINGS_STR;
- close(OUT);
+ if (open($fh, '>', "$tempdir/settings.xml")) {
+ print {$fh} ODS_SETTINGS_STR;
+ close($fh);
}
mkdir($tempdir.'/META-INF/');
mkdir($tempdir.'/Configurations2/');
mkdir($tempdir.'/Configurations2/menubar/');
mkdir($tempdir.'/Configurations2/progressbar/');
mkdir($tempdir.'/Configurations2/toolbar/');
- if (open(OUT, "> $tempdir/META-INF/manifest.xml")) {
- print OUT ODS_MANIFEST_STR;
- close(OUT);
+
+ if (open($fh, '>', "$tempdir/META-INF/manifest.xml")) {
+ print {$fh} ODS_MANIFEST_STR;
+ close($fh);
}
};
if ($@) {
my $ok = 0;
# read ods file and return as a string
if (-f "$tempdir/new.ods") {
- if (open (MYFILE, "$tempdir/new.ods")) {
- binmode MYFILE;
+ if (open ($fh, '<', "$tempdir/new.ods")) {
+ binmode $fh;
my $buffer;
- while (read (MYFILE, $buffer, 65536)) {
+ while (read ($fh, $buffer, 65536)) {
$$strODSRef .= $buffer;
}
- close(MYFILE);
+ close($fh);
$ok = 1;
}
}
my @frameworklist;
map {
my $name = substr( $_, 0, -4 );
- open FILE, "<:utf8","$dir/$requirelevel/$name.txt";
- my $lines = <FILE>;
+ open my $fh, "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt";
+ my $lines = <$fh>;
$lines =~ s/\n|\r/<br \/>/g;
use utf8;
utf8::encode($lines) unless ( utf8::is_utf8($lines) );
my @frameworklist;
map {
my $name = substr( $_, 0, -4 );
- open FILE, "<:utf8","$dir/$requirelevel/$name.txt";
- my $lines = <FILE>;
+ open my $fh , "<:encoding(UTF-8)", "$dir/$requirelevel/$name.txt";
+ my $lines = <$fh>;
$lines =~ s/\n|\r/<br \/>/g;
use utf8;
utf8::encode($lines) unless ( utf8::is_utf8($lines) );
'DateTime::TimeZone' => {
'usage' => 'Core',
'required' => '1',
- 'min_ver' => '1.26'
+ 'min_ver' => '1.20'
},
'DateTime::Format::DateParse' => {
'usage' => 'Core',
'usage' => 'Core',
'required' => '0',
'min_ver' => '0.14',
-
+ },
+ 'Test::Deep' => {
+ 'usage' => 'Core',
+ 'required' => '0',
+ 'min_ver' => '0.106',
},
'Test::YAML::Valid' => {
'usage' => 'Core',
'required' => '1',
'min_ver' => '1.23',
},
+ 'AnyEvent' => {
+ 'usage' => 'Command line scripts',
+ 'required' => '0',
+ 'min_ver' => '5.0',
+ },
+ 'AnyEvent::HTTP' => {
+ 'usage' => 'Command line scripts',
+ 'required' => '0',
+ 'min_ver' => '2.13',
+ },
};
1;
return $class->new($self);
} else {
carp $dbh->errstr;
- return undef;
+ return;
}
}
}
if (exists $self->{$attr}) {
return $self->{$attr};
} else {
- return undef;
+ return;
}
}
$item->{'more_subfields_xml'} = _get_unlinked_subfields_xml($unlinked_item_subfields);
};
- $item->{'itemnumber'} = $itemnumber or return undef;
+ $item->{'itemnumber'} = $itemnumber or return;
$item->{onloan} = undef if $item->{itemlost};
# delete from items table
$sth = $dbh->prepare("DELETE FROM items WHERE itemnumber=?");
$sth->execute($itemnum);
- return undef;
+ return;
}
=head2 _marc_from_item_hash
if ( ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.location' )
&& $defaultvalues
&& $defaultvalues->{'location'} ) {
- my $temp = $itemrecord->field($subfield) if ($itemrecord);
+
+ my $temp; # make perlcritic happy :)
+ $temp = $itemrecord->field($subfield) if ($itemrecord);
+
unless ($temp) {
$defaultvalue = $defaultvalues->{location} if $defaultvalues;
}
#use warnings; FIXME - Bug 2505
use C4::Context;
-
+use C4::Branch qw(GetBranchesCount);
use Memoize;
use DateTime;
use DateTime::Format::MySQL;
}
# FIXME.. this should be moved to a MARC-specific module
-sub subfield_is_koha_internal_p ($) {
+sub subfield_is_koha_internal_p {
my ($subfield) = @_;
# We could match on 'lib' and 'tab' (and 'mandatory', & more to come!)
}
}
-sub getitemtypeimagelocation($$) {
+sub getitemtypeimagelocation {
my ( $src, $image ) = @_;
return '' if ( !$image );
=cut
-sub GetPrinter ($$) {
+sub GetPrinter {
my ( $query, $printers ) = @_; # get printer for this query from printers
my $printer = $query->param('printer');
my %cookie = $query->cookie('userenv');
tags => [ qw/ 225a / ],
sep => ', ',
},
- ];
- my $library_facet = {
- idx => 'branch',
- label => 'Libraries',
- tags => [ qw/ 995b / ],
- expanded => '1',
- };
- push @$facets, $library_facet unless C4::Context->preference("singleBranchMode");
+ ];
+
+ my $library_facet;
+ unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) {
+ $library_facet = {
+ idx => 'branch',
+ label => 'Libraries',
+ tags => [ qw/ 995b / ],
+ };
+ } else {
+ $library_facet = {
+ idx => 'location',
+ label => 'Location',
+ tags => [ qw/ 995c / ],
+ };
+ }
+ push( @$facets, $library_facet );
}
else {
$facets = [
sep => ', ',
},
];
+
my $library_facet;
- $library_facet = {
- idx => 'branch',
- label => 'Libraries',
- tags => [ qw/ 952b / ],
- sep => ', ',
- expanded => '1',
- };
- push @$facets, $library_facet unless C4::Context->preference("singleBranchMode");
+ unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) {
+ $library_facet = {
+ idx => 'branch',
+ label => 'Libraries',
+ tags => [ qw / 952b / ],
+ };
+ } else {
+ $library_facet = {
+ idx => 'location',
+ label => 'Location',
+ tags => [ qw / 952c / ],
+ };
+ }
+ push( @$facets, $library_facet );
}
return $facets;
}
=cut
sub GetAuthorisedValueByCode {
- my ( $category, $authvalcode ) = @_;
+ my ( $category, $authvalcode, $opac ) = @_;
+ my $field = $opac ? 'lib_opac' : 'lib';
my $dbh = C4::Context->dbh;
- my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category=? AND authorised_value =?");
+ my $sth = $dbh->prepare("SELECT $field FROM authorised_values WHERE category=? AND authorised_value =?");
$sth->execute( $category, $authvalcode );
while ( my $data = $sth->fetchrow_hashref ) {
- return $data->{'lib'};
+ return $data->{ $field };
}
}
}
return \%values;
} else {
- return undef;
+ return;
}
}
}
return \%values;
} else {
- return undef;
+ return;
}
}
$isbn =~ s/(.*)( \| )(.*)/$1/;
return _isbn_cleanup($isbn);
}
- return undef unless $record;
+ return unless $record;
if ($marcflavour eq 'UNIMARC') {
@fields = $record->field('010');
if ($isbn) {
return _isbn_cleanup($isbn);
} else {
- return undef;
+ return;
}
}
}
if ($isbn) {
return _isbn_cleanup($isbn);
} else {
- return undef;
+ return;
}
}
}
$oclc =~ s/\(OCoLC\)//;
return $oclc;
} else {
- return undef;
+ return;
}
}
}
use C4::Debug;
use Date::Calc qw( Add_Delta_Days );
use Encode;
+use Unicode::Normalize;
use Carp;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
return \%letters;
}
+=head2 GetLetter( %params )
+
+ retrieves the letter template
+
+ %params hash:
+ module => letter module, mandatory
+ letter_code => letter code, mandatory
+ branchcode => for letter selection, if missing default system letter taken
+ Return value:
+ letter fields hashref (title & content useful)
+
+=cut
+
+sub GetLetter {
+ my %params = @_;
+
+ my $module = $params{module} or croak "No module";
+ my $letter_code = $params{letter_code} or croak "No letter_code";
+ my $branchcode = $params{branchcode} || '';
+
+ my $letter = getletter( $module, $letter_code, $branchcode )
+ or warn( "No $module $letter_code letter"),
+ return;
+
+ return $letter;
+}
+
my %letter;
sub getletter {
my ( $module, $code, $branchcode ) = @_;
+ $branchcode ||= '';
+
if ( C4::Context->preference('IndependantBranches')
and $branchcode
and C4::Context->userenv ) {
+
$branchcode = C4::Context->userenv->{'branch'};
}
=head2 GetPreparedLetter( %params )
+ retrieves letter template and performs substituion processing
+
%params hash:
module => letter module, mandatory
letter_code => letter code, mandatory
my $module = $params{module} or croak "No module";
my $letter_code = $params{letter_code} or croak "No letter_code";
my $branchcode = $params{branchcode} || '';
+ my $tables = $params{tables};
+ my $substitute = $params{substitute};
+ my $repeat = $params{repeat};
my $letter = getletter( $module, $letter_code, $branchcode )
or warn( "No $module $letter_code letter"),
return;
+ my $prepared_letter = GetProcessedLetter(
+ module => $module,
+ letter_code => $letter_code,
+ letter => $letter,
+ branchcode => $branchcode,
+ tables => $tables,
+ substitute => $substitute,
+ repeat => $repeat
+ );
+
+ return $prepared_letter;
+}
+
+=head2 GetProcessedLetter( %params )
+
+ given a letter, with possible pre-processing do standard processing
+ allows one to perform letter template processing beforehand
+
+ %params hash:
+ module => letter module, mandatory
+ letter_code => letter code, mandatory
+ letter => letter, mandatory
+ branchcode => for letter selection, if missing default system letter taken
+ tables => a hashref with table names as keys. Values are either:
+ - a scalar - primary key value
+ - an arrayref - primary key values
+ - a hashref - full record
+ substitute => custom substitution key/value pairs
+ repeat => records to be substituted on consecutive lines:
+ - an arrayref - tries to guess what needs substituting by
+ taking remaining << >> tokensr; not recommended
+ - a hashref token => @tables - replaces <token> << >> << >> </token>
+ subtemplate for each @tables row; table is a hashref as above
+ want_librarian => boolean, if set to true triggers librarian details
+ substitution from the userenv
+ Return value:
+ letter fields hashref (title & content useful)
+
+=cut
+
+sub GetProcessedLetter {
+ my %params = @_;
+
+ my $module = $params{module} or croak "No module";
+ my $letter_code = $params{letter_code} or croak "No letter_code";
+ my $letter = $params{letter} or croak "No letter";
+ my $branchcode = $params{branchcode} || '';
my $tables = $params{tables};
my $substitute = $params{substitute};
my $repeat = $params{repeat};
+
$tables || $substitute || $repeat
or carp( "ERROR: nothing to substitute - both 'tables' and 'substitute' are empty" ),
return;
return;
}
+ # It was found that the some utf8 codes, cause the text to be truncated from that point onward when stored,
+ # so we normalize utf8 with NFC so that mysql will store 'all' of the content in its TEXT column type
+ # Note: It is also done in _add_attachments accordingly.
+ $params->{'letter'}->{'title'} = NFC($params->{'letter'}->{'title'}); # subject
+ $params->{'letter'}->{'content'} = NFC($params->{'letter'}->{'content'});
+
# If we have any attachments we should encode then into the body.
if ( $params->{'attachments'} ) {
$params->{'letter'} = _add_attachments(
$message->attach(
Type => $letter->{'content-type'} || 'TEXT',
Data => $letter->{'is_html'}
- ? _wrap_html($letter->{'content'}, $letter->{'title'})
- : $letter->{'content'},
+ ? _wrap_html($letter->{'content'}, NFC($letter->{'title'}))
+ : NFC($letter->{'content'}),
);
foreach my $attachment ( @$attachments ) {
+
+ if ($attachment->{'content'} =~ m/text/o) { # NFC normailze any "text" related content-type attachments
+ $attachment->{'content'} = NFC($attachment->{'content'});
+ }
+ $attachment->{'filename'} = NFC($attachment->{'filename'});
+
$message->attach(
Type => $attachment->{'type'},
Data => $attachment->{'content'},
if ( !defined $authid && $self->{'broader_headings'} ) {
my $field = $heading->field();
- my @subfields = $field->subfields();
+ my @subfields = grep { $_->[0] ne '9' } $field->subfields();
if ( scalar @subfields > 1 ) {
pop @subfields;
- $field->replace_with(
+ $field =
MARC::Field->new(
$field->tag,
$field->indicator(1),
$field->indicator(2),
- map { $_[0] => $_[1] } @subfields
- )
- );
+ map { $_->[0] => $_->[1] } @subfields
+ );
( $authid, $fuzzy ) =
$self->get_link( C4::Heading->new_from_bib_field($field),
$behavior );
package C4::Matcher;
-# Copyright (C) 2007 LibLime
+# Copyright (C) 2007 LibLime, 2012 C & P Bibliography Services
#
# This file is part of Koha.
#
use C4::Context;
use MARC::Record;
-use C4::Search;
-use C4::Biblio;
use vars qw($VERSION);
$sth->execute($matcher_id); # relying on cascading deletes to clean up everything
}
+=head2 record_type
+
+ $matcher->record_type('biblio');
+ my $record_type = $matcher->record_type();
+
+Accessor method.
+
+=cut
+
+sub record_type {
+ my $self = shift;
+ @_ ? $self->{'record_type'} = shift : $self->{'record_type'};
+}
+
=head2 threshold
$matcher->threshold(1000);
);
}
-=head2 find_matches
+=head2 get_matches
my @matches = $matcher->get_matches($marc_record, $max_matches);
foreach $match (@matches) {
my @source_keys = _get_match_keys($source_record, $matchpoint);
next if scalar(@source_keys) == 0;
# build query
- my $query = join(" or ", map { "$matchpoint->{'index'}=$_" } @source_keys);
- # FIXME only searching biblio index at the moment
- my ($error, $searchresults, $total_hits) = SimpleSearch($query, 0, $max_matches);
+ my $query;
+ my $error;
+ my $searchresults;
+ my $total_hits;
+ if ($self->{'record_type'} eq 'biblio') {
+ $query = join(" or ", map { "$matchpoint->{'index'}=$_" } @source_keys);
+# FIXME only searching biblio index at the moment
+ require C4::Search;
+ ($error, $searchresults, $total_hits) = C4::Search::SimpleSearch($query, 0, $max_matches);
+ } elsif ($self->{'record_type'} eq 'authority') {
+ my $authresults;
+ my @marclist;
+ my @and_or;
+ my @excluding = [];
+ my @operator;
+ my @value;
+ foreach my $key (@source_keys) {
+ push @marclist, $matchpoint->{'index'};
+ push @and_or, 'or';
+ push @operator, 'exact';
+ push @value, $key;
+ }
+ require C4::AuthoritiesMarc;
+ ($authresults, $total_hits) = C4::AuthoritiesMarc::SearchAuthorities(
+ \@marclist, \@and_or, \@excluding, \@operator,
+ \@value, 0, 20, undef, 'AuthidAsc', 1
+ );
+ foreach my $result (@$authresults) {
+ push @$searchresults, $result->{'authid'};
+ }
+ }
if (defined $error ) {
warn "search failed ($query) $error";
# get rid of any that don't meet the required checks
%matches = map { _passes_required_checks($source_record, $_, $self->{'required_checks'}) ? ($_ => $matches{$_}) : () }
- keys %matches;
+ keys %matches unless ($self->{'record_type'} eq 'auth');
my @results = ();
- foreach my $marcblob (keys %matches) {
- my $target_record = MARC::Record->new_from_usmarc($marcblob);
- my $result = TransformMarcToKoha(C4::Context->dbh, $target_record, '');
- # FIXME - again, bibliospecific
- # also, can search engine be induced to give just the number in the first place?
- my $record_number = $result->{'biblionumber'};
- push @results, { 'record_id' => $record_number, 'score' => $matches{$marcblob} };
+ if ($self->{'record_type'} eq 'biblio') {
+ require C4::Biblio;
+ foreach my $marcblob (keys %matches) {
+ my $target_record = MARC::Record->new_from_usmarc($marcblob);
+ my $record_number;
+ my $result = C4::Biblio::TransformMarcToKoha(C4::Context->dbh, $target_record, '');
+ $record_number = $result->{'biblionumber'};
+ push @results, { 'record_id' => $record_number, 'score' => $matches{$marcblob} };
+ }
+ } elsif ($self->{'record_type'} eq 'authority') {
+ require C4::AuthoritiesMarc;
+ foreach my $authid (keys %matches) {
+ push @results, { 'record_id' => $authid, 'score' => $matches{$authid} };
+ }
}
@results = sort { $b->{'score'} cmp $a->{'score'} } @results;
if (scalar(@results) > $max_matches) {
$result->{'matcher_id'} = $self->{'id'};
$result->{'code'} = $self->{'code'};
$result->{'description'} = $self->{'description'};
+ $result->{'record_type'} = $self->{'record_type'};
$result->{'matchpoints'} = [];
foreach my $matchpoint (@{ $self->{'matchpoints'} }) {
sub GetAllIssues {
my ( $borrowernumber, $order, $limit ) = @_;
- #FIXME: sanity-check order and limit
- my $dbh = C4::Context->dbh;
+ my $dbh = C4::Context->dbh;
my $query =
- "SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
+'SELECT *, issues.timestamp as issuestimestamp, issues.renewals AS renewals,items.renewals AS totalrenewals,items.timestamp AS itemstimestamp
FROM issues
LEFT JOIN items on items.itemnumber=issues.itemnumber
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
LEFT JOIN biblio ON items.biblionumber=biblio.biblionumber
LEFT JOIN biblioitems ON items.biblioitemnumber=biblioitems.biblioitemnumber
WHERE borrowernumber=? AND old_issues.itemnumber IS NOT NULL
- order by $order";
- if ( $limit != 0 ) {
+ order by ' . $order;
+ if ($limit) {
$query .= " limit $limit";
}
my $sth = $dbh->prepare($query);
- $sth->execute($borrowernumber, $borrowernumber);
- my @result;
- my $i = 0;
- while ( my $data = $sth->fetchrow_hashref ) {
- push @result, $data;
- }
-
- return \@result;
+ $sth->execute( $borrowernumber, $borrowernumber );
+ return $sth->fetchall_arrayref( {} );
}
if (@$msgs) {
return $class->new($msgs->[0]);
} else {
- return undef;
+ return;
}
}
if (@$msgs) {
return $class->new($msgs->[0]);
} else {
- return undef;
+ return;
}
}
}
if (not $self->metadata) {
carp "Can't append to messages that don't have metadata.";
- return undef;
+ return;
}
my $metadata = $self->metadata;
push @{$metadata->{body}}, $item;
=cut
sub pagination_bar {
- my $base_url = (@_ ? shift : $ENV{SCRIPT_NAME} . $ENV{QUERY_STRING}) or return undef;
+ my $base_url = (@_ ? shift : $ENV{SCRIPT_NAME} . $ENV{QUERY_STRING}) or return;
my $nb_pages = (@_) ? shift : 1;
my $current_page = (@_) ? shift : undef; # delay default until later
my $startfrom_name = (@_) ? shift : 'page';
=cut
-sub output_with_http_headers($$$$;$) {
+sub output_with_http_headers {
my ( $query, $cookie, $data, $content_type, $status ) = @_;
$status ||= '200 OK';
print $query->header($options), $data;
}
-sub output_html_with_http_headers ($$$;$) {
+sub output_html_with_http_headers {
my ( $query, $cookie, $data, $status ) = @_;
output_with_http_headers( $query, $cookie, $data, 'html', $status );
}
# set the queue to "file" (or " file", if real queues aren't allowed
# to have spaces in them). Or perhaps if $queue eq "" and
# $env->{file} ne "", then that should mean "print to $env->{file}".
+
+ my $fh;
if ( $queue eq "" || $queue eq 'nulllp' ) {
return;
- #open( PRINTER, ">/tmp/kohaiss" );
+ #open( $fh, ">/tmp/kohaiss" );
}
else {
# This is a reasonable assumption, but only because every other
# printing package has a wrapper script called 'lpr'. It'd still
# be better to be able to customize this.
- open( PRINTER, "| lpr -P $queue > /dev/null" )
+ open( $fh, "-|", "lpr -P $queue > /dev/null" )
or die "Couldn't write to queue:$queue!\n";
}
# print $queue;
#open (FILE,">/tmp/$file");
- print PRINTER $text;
- print PRINTER "\r\n" x 7 ;
- close PRINTER;
+ print $fh $text;
+ print $fh "\r\n" x 7 ;
+ close $fh;
#system("lpr /tmp/$file");
}
use C4::Context;
use C4::Dates qw/format_date format_date_in_iso/;
use C4::Templates qw/themelanguage/;
-use C4::Dates;
+use C4::Koha;
+use C4::Output;
use XML::Simple;
use XML::Dumper;
use C4::Debug;
# use Data::Dumper;
BEGIN {
- # set the version for version checking
+ # set the version for version checking
$VERSION = 3.07.00.049;
- require Exporter;
- @ISA = qw(Exporter);
- @EXPORT = qw(
- get_report_types get_report_areas get_columns build_query get_criteria
- save_report get_saved_reports execute_query get_saved_report create_compound run_compound
- get_column_type get_distinct_values save_dictionary get_from_dictionary
- delete_definition delete_report format_results get_sql
- nb_rows update_sql
- );
-}
-
-our %table_areas;
-$table_areas{'1'} =
- [ 'borrowers', 'statistics','items', 'biblioitems' ]; # circulation
-$table_areas{'2'} = [ 'items', 'biblioitems', 'biblio' ]; # catalogue
-$table_areas{'3'} = [ 'borrowers' ]; # patrons
-$table_areas{'4'} = ['aqorders', 'biblio', 'items']; # acquisitions
-$table_areas{'5'} = [ 'borrowers', 'accountlines' ]; # accounts
-our %keys;
-$keys{'1'} = [
- 'statistics.borrowernumber=borrowers.borrowernumber',
- 'items.itemnumber = statistics.itemnumber',
- 'biblioitems.biblioitemnumber = items.biblioitemnumber'
-];
-$keys{'2'} = [
- 'items.biblioitemnumber=biblioitems.biblioitemnumber',
- 'biblioitems.biblionumber=biblio.biblionumber'
-];
-$keys{'3'} = [ ];
-$keys{'4'} = [
- 'aqorders.biblionumber=biblio.biblionumber',
- 'biblio.biblionumber=items.biblionumber'
-];
-$keys{'5'} = ['borrowers.borrowernumber=accountlines.borrowernumber'];
-
-# have to do someting here to know if its dropdown, free text, date etc
-
-our %criteria;
-# reports on circulation
-$criteria{'1'} = [
- 'statistics.type', 'borrowers.categorycode',
- 'statistics.branch',
- 'biblioitems.publicationyear|date',
- 'items.dateaccessioned|date'
-];
-# reports on catalogue
-$criteria{'2'} =
- [ 'items.itemnumber|textrange', 'items.biblionumber|textrange', 'items.barcode|textrange',
- 'biblio.frameworkcode', 'items.holdingbranch', 'items.homebranch',
- 'biblio.datecreated|daterange', 'biblio.timestamp|daterange', 'items.onloan|daterange',
- 'items.ccode', 'items.itemcallnumber|textrange', 'items.itype',
- 'items.itemlost', 'items.location' ];
-# reports on borrowers
-$criteria{'3'} = ['borrowers.branchcode', 'borrowers.categorycode'];
-# reports on acquisition
-$criteria{'4'} = ['aqorders.datereceived|date'];
-
-# reports on accounting
-$criteria{'5'} = ['borrowers.branchcode', 'borrowers.categorycode'];
-
-# Adds itemtypes to criteria, according to the syspref
-if (C4::Context->preference('item-level_itypes')) {
- unshift @{ $criteria{'1'} }, 'items.itype';
- unshift @{ $criteria{'2'} }, 'items.itype';
-} else {
- unshift @{ $criteria{'1'} }, 'biblioitems.itemtype';
- unshift @{ $criteria{'2'} }, 'biblioitems.itemtype';
+ require Exporter;
+ @ISA = qw(Exporter);
+ @EXPORT = qw(
+ get_report_types get_report_areas get_report_groups get_columns build_query get_criteria
+ save_report get_saved_reports execute_query get_saved_report create_compound run_compound
+ get_column_type get_distinct_values save_dictionary get_from_dictionary
+ delete_definition delete_report format_results get_sql
+ nb_rows update_sql build_authorised_value_list
+ );
}
=head1 NAME
=over 2
+=item get_report_areas()
+
+This will return a list of all the available report areas
+
=cut
+my @REPORT_AREA = (
+ [CIRC => "Circulation"],
+ [CAT => "Catalogue"],
+ [PAT => "Patrons"],
+ [ACQ => "Acquisition"],
+ [ACC => "Accounts"],
+);
+my $AREA_NAME_SQL_SNIPPET
+ = "CASE report_area " .
+ join (" ", map "WHEN '$_->[0]' THEN '$_->[1]'", @REPORT_AREA) .
+ " END AS areaname";
+sub get_report_areas {
+ return \@REPORT_AREA
+}
+
+my %table_areas = (
+ CIRC => [ 'borrowers', 'statistics', 'items', 'biblioitems' ],
+ CAT => [ 'items', 'biblioitems', 'biblio' ],
+ PAT => ['borrowers'],
+ ACQ => [ 'aqorders', 'biblio', 'items' ],
+ ACC => [ 'borrowers', 'accountlines' ],
+);
+my %keys = (
+ CIRC => [ 'statistics.borrowernumber=borrowers.borrowernumber',
+ 'items.itemnumber = statistics.itemnumber',
+ 'biblioitems.biblioitemnumber = items.biblioitemnumber' ],
+ CAT => [ 'items.biblioitemnumber=biblioitems.biblioitemnumber',
+ 'biblioitems.biblionumber=biblio.biblionumber' ],
+ PAT => [],
+ ACQ => [ 'aqorders.biblionumber=biblio.biblionumber',
+ 'biblio.biblionumber=items.biblionumber' ],
+ ACC => ['borrowers.borrowernumber=accountlines.borrowernumber'],
+);
+
+# have to do someting here to know if its dropdown, free text, date etc
+my %criteria = (
+ CIRC => [ 'statistics.type', 'borrowers.categorycode', 'statistics.branch',
+ 'biblioitems.publicationyear|date', 'items.dateaccessioned|date' ],
+ CAT => [ 'items.itemnumber|textrange', 'items.biblionumber|textrange',
+ 'items.barcode|textrange', 'biblio.frameworkcode',
+ 'items.holdingbranch', 'items.homebranch',
+ 'biblio.datecreated|daterange', 'biblio.timestamp|daterange',
+ 'items.onloan|daterange', 'items.ccode',
+ 'items.itemcallnumber|textrange', 'items.itype', 'items.itemlost',
+ 'items.location' ],
+ PAT => [ 'borrowers.branchcode', 'borrowers.categorycode' ],
+ ACQ => ['aqorders.datereceived|date'],
+ ACC => [ 'borrowers.branchcode', 'borrowers.categorycode' ],
+);
+
+# Adds itemtypes to criteria, according to the syspref
+if ( C4::Context->preference('item-level_itypes') ) {
+ unshift @{ $criteria{'CIRC'} }, 'items.itype';
+ unshift @{ $criteria{'CAT'} }, 'items.itype';
+} else {
+ unshift @{ $criteria{'CIRC'} }, 'biblioitems.itemtype';
+ unshift @{ $criteria{'CAT'} }, 'biblioitems.itemtype';
+}
+
=item get_report_types()
This will return a list of all the available report types
}
-=item get_report_areas()
+=item get_report_groups()
-This will return a list of all the available report areas
+This will return a list of all the available report areas with groups
=cut
-sub get_report_areas {
+sub get_report_groups {
my $dbh = C4::Context->dbh();
- # FIXME these should be in the database
- my @reports = ( 'Circulation', 'Catalog', 'Patrons', 'Acquisitions', 'Accounts');
- my @reports2;
- for ( my $i = 0 ; $i < 5 ; $i++ ) {
- my %hashrep;
- $hashrep{id} = $i + 1;
- $hashrep{name} = $reports[$i];
- push @reports2, \%hashrep;
+ my $groups = GetAuthorisedValues('REPORT_GROUP');
+ my $subgroups = GetAuthorisedValues('REPORT_SUBGROUP');
+
+ my %groups_with_subgroups = map { $_->{authorised_value} => {
+ name => $_->{lib},
+ groups => {}
+ } } @$groups;
+ foreach (@$subgroups) {
+ my $sg = $_->{authorised_value};
+ my $g = $_->{lib_opac}
+ or warn( qq{REPORT_SUBGROUP "$sg" without REPORT_GROUP (lib_opac)} ),
+ next;
+ my $g_sg = $groups_with_subgroups{$g}
+ or warn( qq{REPORT_SUBGROUP "$sg" with invalid REPORT_GROUP "$g"} ),
+ next;
+ $g_sg->{subgroups}{$sg} = $_->{lib};
}
- return ( \@reports2 );
-
+ return \%groups_with_subgroups
}
=item get_all_tables()
sub get_columns {
# this calls the internal fucntion _get_columns
- my ($area,$cgi) = @_;
- my $tables = $table_areas{$area};
+ my ( $area, $cgi ) = @_;
+ my $tables = $table_areas{$area}
+ or die qq{Unsuported report area "$area"};
+
my @allcolumns;
my $first = 1;
foreach my $table (@$tables) {
=item execute_query
- ($results, $total, $error) = execute_query($sql, $offset, $limit)
+ ($results, $error) = execute_query($sql, $offset, $limit)
When passed C<$sql>, this function returns an array ref containing a result set
=cut
sub save_report {
- my ( $borrowernumber, $sql, $name, $type, $notes, $cache_expiry, $public ) = @_;
- $cache_expiry ||= 300;
+ my ($fields) = @_;
+ my $borrowernumber = $fields->{borrowernumber};
+ my $sql = $fields->{sql};
+ my $name = $fields->{name};
+ my $type = $fields->{type};
+ my $notes = $fields->{notes};
+ my $area = $fields->{area};
+ my $group = $fields->{group};
+ my $subgroup = $fields->{subgroup};
+ my $cache_expiry = $fields->{cache_expiry} || 300;
+ my $public = $fields->{public};
+
my $dbh = C4::Context->dbh();
- $sql =~ s/(\s*\;\s*)$//; # removes trailing whitespace and /;/
- my $query =
-"INSERT INTO saved_sql (borrowernumber,date_created,last_modified,savedsql,report_name,type,notes,cache_expiry, public) VALUES (?,now(),now(),?,?,?,?,?,?)";
- $dbh->do( $query, undef, $borrowernumber, $sql, $name, $type, $notes, $cache_expiry, $public );
+ $sql =~ s/(\s*\;\s*)$//; # removes trailing whitespace and /;/
+ my $query = "INSERT INTO saved_sql (borrowernumber,date_created,last_modified,savedsql,report_name,report_area,report_group,report_subgroup,type,notes,cache_expiry,public) VALUES (?,now(),now(),?,?,?,?,?,?,?,?,?)";
+ $dbh->do($query, undef, $borrowernumber, $sql, $name, $area, $group, $subgroup, $type, $notes, $cache_expiry, $public);
+
my $id = $dbh->selectrow_array("SELECT max(id) FROM saved_sql WHERE borrowernumber=? AND report_name=?", undef,
$borrowernumber, $name);
return $id;
}
sub update_sql {
- my $id = shift || croak "No Id given";
- my $sql = shift;
- my $reportname = shift;
- my $notes = shift;
- my $cache_expiry = shift;
- my $public = shift;
-
- # not entirely a magic number, Cache::Memcached::Set assumed any expiry >= (60*60*24*30) is an absolute unix timestamp (rather than relative seconds)
+ my $id = shift || croak "No Id given";
+ my $fields = shift;
+ my $sql = $fields->{sql};
+ my $name = $fields->{name};
+ my $notes = $fields->{notes};
+ my $group = $fields->{group};
+ my $subgroup = $fields->{subgroup};
+ my $cache_expiry = $fields->{cache_expiry};
+ my $public = $fields->{public};
+
if( $cache_expiry >= 2592000 ){
die "Please specify a cache expiry less than 30 days\n";
}
- my $dbh = C4::Context->dbh();
- $sql =~ s/(\s*\;\s*)$//; # removes trailing whitespace and /;/
- my $query = "UPDATE saved_sql SET savedsql = ?, last_modified = now(), report_name = ?, notes = ?, cache_expiry = ?, public = ? WHERE id = ? ";
- my $sth = $dbh->prepare($query);
- $sth->execute( $sql, $reportname, $notes, $cache_expiry, $public, $id );
- $sth->finish();
+ my $dbh = C4::Context->dbh();
+ $sql =~ s/(\s*\;\s*)$//; # removes trailing whitespace and /;/
+ my $query = "UPDATE saved_sql SET savedsql = ?, last_modified = now(), report_name = ?, report_group = ?, report_subgroup = ?, notes = ?, cache_expiry = ?, public = ? WHERE id = ? ";
+ $dbh->do($query, undef, $sql, $name, $group, $subgroup, $notes, $cache_expiry, $public, $id );
}
sub store_results {
}
sub delete_report {
- my ( $id ) = @_;
- my $dbh = C4::Context->dbh();
- my $query = "DELETE FROM saved_sql WHERE id = ?";
- my $sth = $dbh->prepare($query);
- $sth->execute($id);
+ my ($id) = @_;
+ my $dbh = C4::Context->dbh();
+ my $query = "DELETE FROM saved_sql WHERE id = ?";
+ my $sth = $dbh->prepare($query);
+ $sth->execute($id);
}
-# $filter is either { date => $d, author => $a, keyword => $kw }
-# or $keyword. Optional.
+
+my $SAVED_REPORTS_BASE_QRY = <<EOQ;
+SELECT s.*, r.report, r.date_run, $AREA_NAME_SQL_SNIPPET, av_g.lib AS groupname, av_sg.lib AS subgroupname,
+b.firstname AS borrowerfirstname, b.surname AS borrowersurname
+FROM saved_sql s
+LEFT JOIN saved_reports r ON r.report_id = s.id
+LEFT OUTER JOIN authorised_values av_g ON (av_g.category = 'REPORT_GROUP' AND av_g.authorised_value = s.report_group)
+LEFT OUTER JOIN authorised_values av_sg ON (av_sg.category = 'REPORT_SUBGROUP' AND av_sg.lib_opac = s.report_group AND av_sg.authorised_value = s.report_subgroup)
+LEFT OUTER JOIN borrowers b USING (borrowernumber)
+EOQ
my $DATE_FORMAT = "%d/%m/%Y";
sub get_saved_reports {
+# $filter is either { date => $d, author => $a, keyword => $kw, }
+# or $keyword. Optional.
my ($filter) = @_;
$filter = { keyword => $filter } if $filter && !ref( $filter );
+ my ($group, $subgroup) = @_;
my $dbh = C4::Context->dbh();
+ my $query = $SAVED_REPORTS_BASE_QRY;
my (@cond,@args);
- my $query = "SELECT saved_sql.id, report_id, report,
- date_run, date_created, last_modified, savedsql, last_run,
- report_name, type, notes,
- borrowernumber, surname as borrowersurname, firstname as borrowerfirstname,
- cache_expiry, public
- FROM saved_sql
- LEFT JOIN saved_reports ON saved_reports.report_id = saved_sql.id
- LEFT OUTER JOIN borrowers USING (borrowernumber)";
if ($filter) {
if (my $date = $filter->{date}) {
$date = format_date_in_iso($date);
savedsql LIKE ?";
push @args, $keyword, $keyword, $keyword, $keyword;
}
+ if ($filter->{group}) {
+ push @cond, "report_group = ?";
+ push @args, $filter->{group};
+ }
+ if ($filter->{subgroup}) {
+ push @cond, "report_subgroup = ?";
+ push @args, $filter->{subgroup};
+ }
}
$query .= " WHERE ".join( " AND ", map "($_)", @cond ) if @cond;
$query .= " ORDER by date_created";
sub get_saved_report {
my $dbh = C4::Context->dbh();
my $query;
- my $sth;
my $report_arg;
if ($#_ == 0 && ref $_[0] ne 'HASH') {
($report_arg) = @_;
} else {
return;
}
- $sth = $dbh->prepare($query);
- $sth->execute($report_arg);
- my $data = $sth->fetchrow_hashref();
- return ( $data->{'savedsql'}, $data->{'type'}, $data->{'report_name'}, $data->{'notes'}, $data->{'cache_expiry'}, $data->{'public'}, $data->{'id'} );
+ return $dbh->selectrow_hashref($query, undef, $report_arg);
}
=item create_compound($masterID,$subreportID)
=cut
sub create_compound {
- my ($masterID,$subreportID) = @_;
- my $dbh = C4::Context->dbh();
- # get the reports
- my ($mastersql,$mastertype) = get_saved_report($masterID);
- my ($subsql,$subtype) = get_saved_report($subreportID);
-
- # now we have to do some checking to see how these two will fit together
- # or if they will
- my ($mastertables,$subtables);
- if ($mastersql =~ / from (.*) where /i){
- $mastertables = $1;
- }
- if ($subsql =~ / from (.*) where /i){
- $subtables = $1;
- }
- return ($mastertables,$subtables);
+ my ( $masterID, $subreportID ) = @_;
+ my $dbh = C4::Context->dbh();
+
+ # get the reports
+ my $master = get_saved_report($masterID);
+ my $mastersql = $master->{savedsql};
+ my $mastertype = $master->{type};
+ my $sub = get_saved_report($subreportID);
+ my $subsql = $master->{savedsql};
+ my $subtype = $master->{type};
+
+ # now we have to do some checking to see how these two will fit together
+ # or if they will
+ my ( $mastertables, $subtables );
+ if ( $mastersql =~ / from (.*) where /i ) {
+ $mastertables = $1;
+ }
+ if ( $subsql =~ / from (.*) where /i ) {
+ $subtables = $1;
+ }
+ return ( $mastertables, $subtables );
}
=item get_column_type($column)
}
sub save_dictionary {
- my ($name,$description,$sql,$area) = @_;
- my $dbh = C4::Context->dbh();
- my $query = "INSERT INTO reports_dictionary (name,description,saved_sql,area,date_created,date_modified)
+ my ( $name, $description, $sql, $area ) = @_;
+ my $dbh = C4::Context->dbh();
+ my $query = "INSERT INTO reports_dictionary (name,description,saved_sql,report_area,date_created,date_modified)
VALUES (?,?,?,?,now(),now())";
my $sth = $dbh->prepare($query);
$sth->execute($name,$description,$sql,$area) || return 0;
return 1;
}
+my $DICTIONARY_BASE_QRY = <<EOQ;
+SELECT d.*, $AREA_NAME_SQL_SNIPPET
+FROM reports_dictionary d
+EOQ
sub get_from_dictionary {
- my ($area,$id) = @_;
- my $dbh = C4::Context->dbh();
- my $query = "SELECT * FROM reports_dictionary";
- if ($area){
- $query.= " WHERE area = ?";
- }
- elsif ($id){
- $query.= " WHERE id = ?"
- }
- my $sth = $dbh->prepare($query);
- if ($id){
- $sth->execute($id);
- }
- elsif ($area) {
- $sth->execute($area);
- }
- else {
- $sth->execute();
- }
- my @loop;
- my @reports = ( 'Circulation', 'Catalog', 'Patrons', 'Acquisitions', 'Accounts');
- while (my $data = $sth->fetchrow_hashref()){
- $data->{'areaname'}=$reports[$data->{'area'}-1];
- push @loop,$data;
-
- }
- return (\@loop);
+ my ( $area, $id ) = @_;
+ my $dbh = C4::Context->dbh();
+ my $query = $DICTIONARY_BASE_QRY;
+ if ($area) {
+ $query .= " WHERE report_area = ?";
+ } elsif ($id) {
+ $query .= " WHERE id = ?";
+ }
+ my $sth = $dbh->prepare($query);
+ if ($id) {
+ $sth->execute($id);
+ } elsif ($area) {
+ $sth->execute($area);
+ } else {
+ $sth->execute();
+ }
+ my @loop;
+ while ( my $data = $sth->fetchrow_hashref() ) {
+ push @loop, $data;
+ }
+ return ( \@loop );
}
sub delete_definition {
close COLUMNS;
return \%columns;
}
+
+=item build_authorised_value_list($authorised_value)
+
+Returns an arrayref - hashref pair. The hashref consists of
+various code => name lists depending on the $authorised_value.
+The arrayref is the hashref keys, in appropriate order
+
+=cut
+
+sub build_authorised_value_list {
+ my ( $authorised_value ) = @_;
+
+ my $dbh = C4::Context->dbh;
+ my @authorised_values;
+ my %authorised_lib;
+
+ # builds list, depending on authorised value...
+ if ( $authorised_value eq "branches" ) {
+ my $branches = GetBranchesLoop();
+ foreach my $thisbranch (@$branches) {
+ push @authorised_values, $thisbranch->{value};
+ $authorised_lib{ $thisbranch->{value} } = $thisbranch->{branchname};
+ }
+ } elsif ( $authorised_value eq "itemtypes" ) {
+ my $sth = $dbh->prepare("SELECT itemtype,description FROM itemtypes ORDER BY description");
+ $sth->execute;
+ while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) {
+ push @authorised_values, $itemtype;
+ $authorised_lib{$itemtype} = $description;
+ }
+ } elsif ( $authorised_value eq "cn_source" ) {
+ my $class_sources = GetClassSources();
+ my $default_source = C4::Context->preference("DefaultClassificationSource");
+ foreach my $class_source ( sort keys %$class_sources ) {
+ next
+ unless $class_sources->{$class_source}->{'used'}
+ or ( $class_source eq $default_source );
+ push @authorised_values, $class_source;
+ $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
+ }
+ } elsif ( $authorised_value eq "categorycode" ) {
+ my $sth = $dbh->prepare("SELECT categorycode, description FROM categories ORDER BY description");
+ $sth->execute;
+ while ( my ( $categorycode, $description ) = $sth->fetchrow_array ) {
+ push @authorised_values, $categorycode;
+ $authorised_lib{$categorycode} = $description;
+ }
+
+ #---- "true" authorised value
+ } else {
+ my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
+
+ $authorised_values_sth->execute($authorised_value);
+
+ while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
+ push @authorised_values, $value;
+ $authorised_lib{$value} = $lib;
+
+ # For item location, we show the code and the libelle
+ $authorised_lib{$value} = $lib;
+ }
+ }
+
+ return (\@authorised_values, \%authorised_lib);
+}
+
1;
__END__
tables => {
'reserves' => $reserve,
'branches' => $reserve->{branchcode},
- 'borrowers' => $reserve,
- 'biblio' => $reserve,
- 'items' => $reserve,
+ 'borrowers' => $reserve->{borrowernumber},
+ 'biblio' => $reserve->{biblionumber},
+ 'items' => $reserve->{itemnumber},
},
);
}
if (!defined($item)) {
$trans->screen_msg("Item not checked out to " . $patron->name); # not checked out to $patron_id
$trans->ok(0);
- } elsif (!$item->available($patron_id)) {
- $trans->screen_msg("Item unavailable due to outstanding holds");
- $trans->ok(0);
} else {
- $trans->renewal_ok(1);
- $trans->desensitize(0); # It's already checked out
- $trans->do_renew();
- syslog("LOG_DEBUG", "done renew (ok:%s): %s renews %s", $trans->renewal_ok, $patron_id, $item_id);
-
-# $item->{due_date} = $nb_due_date if $no_block eq 'Y';
-# $item->{sip_item_properties} = $item_props if $item_props;
+ $trans->do_renew();
+ if ($trans->renewal_ok()) {
+ $item->{due_date} = $trans->{due};
+ $trans->desensitize(0);
+ }
}
return $trans;
my $shelf = $self->{item}->hold_shelf;
my $barcode = $self->{item}->id;
my $patron_barcode = $self->{patron}->id;
+ my $overridden_duedate; # usually passed as undef to AddIssue
$debug and warn "do_checkout: patron (" . $patron_barcode . ")";
my $borrower = $self->{patron}->getmemberdetails_object();
$debug and warn "do_checkout borrower: . " . Dumper $borrower;
$noerror = 0;
}
} else {
- foreach my $confirmation (keys %$needsconfirmation) {
+ foreach my $confirmation (keys %{$needsconfirmation}) {
if ($confirmation eq 'RENEW_ISSUE'){
$self->screen_msg("Item already checked out to you: renewing item.");
} elsif ($confirmation eq 'RESERVED' or $confirmation eq 'RESERVE_WAITING') {
$self->screen_msg("Item already checked out to another patron. Please return item for check-in.");
$noerror = 0;
} elsif ($confirmation eq 'DEBT') { # don't do anything, it's the minor debt, and alarms fire elsewhere
+ } elsif ($confirmation eq 'HIGHHOLDS') {
+ $overridden_duedate = $needsconfirmation->{$confirmation}->{returndate};
+ $self->screen_msg('Loan period reduced for high-demand item');
} else {
$self->screen_msg($needsconfirmation->{$confirmation});
$noerror = 0;
# TODO: adjust representation in $self->item
}
# can issue
- $debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, undef, 0)\n"
+ $debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, $overridden_duedate, 0)\n"
# . "w/ \$borrower: " . Dumper($borrower)
. "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv);
- my $due_dt = AddIssue($borrower, $barcode, undef, 0);
+ my $due_dt = AddIssue($borrower, $barcode, $overridden_duedate, 0);
if ($due_dt) {
$self->{due} = $due_dt->clone();
} else {
use strict;
use ILS;
-use ILS::Transaction;
use C4::Circulation;
use C4::Members;
-our @ISA = qw(ILS::Transaction);
+use base qw(ILS::Transaction);
my %fields = (
- renewal_ok => 0,
+ renewal_ok => 0,
);
sub new {
- my $class = shift;
- my $self = $class->SUPER::new();
+ my $class = shift;
+ my $self = $class->SUPER::new();
foreach my $element (keys %fields) {
- $self->{_permitted}->{$element} = $fields{$element};
- }
+ $self->{_permitted}->{$element} = $fields{$element};
+ }
- @{$self}{keys %fields} = values %fields; # overkill?
- return bless $self, $class;
+ @{$self}{keys %fields} = values %fields; # overkill?
+ return bless $self, $class;
}
sub do_renew_for {
- my $self = shift;
- my $borrower = shift;
- my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
- if ($renewokay){
- $self->{due} = AddIssue( $borrower, $self->{item}->id, undef, 0 );
- $self->renewal_ok(1);
- } else {
- $self->screen_msg(($self->screen_msg || '') . " " . $renewerror);
- $self->renewal_ok(0);
- }
- $! and warn "do_renew_for error: $!";
- $self->ok(1) unless $!;
- return $self;
+ my $self = shift;
+ my $borrower = shift;
+ my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
+ if ($renewokay){
+ $self->{due} = undef;
+ my $due_date = AddIssue( $borrower, $self->{item}->id, undef, 0 );
+ if ($due_date) {
+ $self->{due} = $due_date;
+ }
+ $self->renewal_ok(1);
+ } else {
+ $renewerror=~s/on_reserve/Item unavailable due to outstanding holds/;
+ $renewerror=~s/too_many/Item has reached maximum renewals/;
+ $self->screen_msg($renewerror);
+ $self->renewal_ok(0);
+ }
+ $self->ok(1);
+ return;
}
sub do_renew {
- my $self = shift;
- my $borrower = GetMember( 'cardnumber'=>$self->{patron}->id);
- return $self->do_renew_for($borrower);
-}
+ my $self = shift;
+ my $borrower = GetMember( cardnumber => $self->{patron}->id );
+ return $self->do_renew_for($borrower);
+}
1;
-#
+#
# RenewAll: class to manage status of "Renew All" transaction
package ILS::Transaction::RenewAll;
use Sys::Syslog qw(syslog);
use ILS::Item;
-use ILS::Transaction::Renew;
-use C4::Members; # GetMember
+use C4::Members qw( GetMember );
-our @ISA = qw(ILS::Transaction::Renew);
+use base qw(ILS::Transaction::Renew);
my %fields = (
- renewed => [],
- unrenewed => [],
+ renewed => [],
+ unrenewed => [],
);
sub new {
- my $class = shift;
- my $self = $class->SUPER::new();
+ my $class = shift;
+ my $self = $class->SUPER::new();
- foreach my $element (keys %fields) {
- $self->{_permitted}->{$element} = $fields{$element};
- }
+ foreach my $element ( keys %fields ) {
+ $self->{_permitted}->{$element} = $fields{$element};
+ }
- @{$self}{keys %fields} = values %fields;
- return bless $self, $class;
+ @{$self}{ keys %fields } = values %fields;
+ return bless $self, $class;
}
sub do_renew_all {
- my $self = shift;
- my $patron = $self->{patron}; # SIP's patron
- my $borrower = GetMember('cardnumber'=>$patron->id); # Koha's patron
- my $all_ok = 1;
- $self->{renewed} = [];
+ my $self = shift;
+ my $patron = $self->{patron}; # SIP's patron
+ my $borrower = GetMember( cardnumber => $patron->id ); # Koha's patron
+ my $all_ok = 1;
+ $self->{renewed} = [];
$self->{unrenewed} = [];
- foreach my $itemx (@{$patron->{items}}) {
- my $item_id = $itemx->{barcode};
- my $item = new ILS::Item $item_id;
- if (!defined($item)) {
- syslog("LOG_WARNING",
- "renew_all: Invalid item id '%s' associated with patron '%s'",
- $item_id, $patron->id);
- $all_ok = 0;
- next;
- }
- $self->{item} = $item;
- $self->do_renew_for($borrower);
- if ($self->ok) {
- $item->{due_date} = $self->{due}->clone();
- push @{$self->renewed }, $item_id;
- } else {
- push @{$self->{unrenewed}}, $item_id;
- }
- }
- $self->ok($all_ok);
- return $self;
+ foreach my $itemx ( @{ $patron->{items} } ) {
+ my $item_id = $itemx->{barcode};
+ my $item = ILS::Item->new($item_id);
+ if ( !defined($item) ) {
+ syslog(
+ 'LOG_WARNING',
+ q|renew_all: Invalid item id '%s' associated with patron '%s'|,
+ $item_id,
+ $patron->id
+ );
+
+ # $all_ok = 0; Do net set as still ok
+ push @{ $self->unrenewed }, $item_id;
+ next;
+ }
+ $self->{item} = $item;
+ $self->do_renew_for($borrower);
+ if ( $self->renewal_ok ) {
+ $item->{due_date} = $self->{due};
+ push @{ $self->{renewed} }, $item_id;
+ }
+ else {
+ push @{ $self->{unrenewed} }, $item_id;
+ }
+ $self->screen_msg(q{}); # clear indiv message
+ }
+ $self->ok($all_ok);
+ return $self;
}
1;
$patron = $status->patron;
$item = $status->item;
- if ($status->ok) {
+ if ($status->renewal_ok) {
$resp .= '1';
$resp .= $status->renewal_ok ? 'Y' : 'N';
if ($ils->supports('magnetic media')) {
$resp .= add_field(FID_PATRON_ID, $patron->id);
$resp .= add_field(FID_ITEM_ID, $item->id);
$resp .= add_field(FID_TITLE_ID, $item->title_id);
- $resp .= add_field(FID_DUE_DATE, Sip::timestamp($item->due_date));
+ if ($item->due_date) {
+ $resp .= add_field(FID_DUE_DATE, Sip::timestamp($item->due_date));
+ } else {
+ $resp .= add_field(FID_DUE_DATE, q{});
+ }
if ($ils->supports('security inhibit')) {
$resp .= add_field(FID_SECURITY_INHIBIT,
$status->security_inhibit);
=cut
-sub GetPrimaryKeys($) {
+sub GetPrimaryKeys {
my $tablename=shift;
my $hash_columns=_get_columns($tablename);
return grep { $hash_columns->{$_}->{'Key'} =~/PRI/i} keys %$hash_columns;
=cut
-sub _get_columns($) {
+sub _get_columns {
my ($tablename) = @_;
unless ( exists( $hashref->{$tablename} ) ) {
my $dbh = C4::Context->dbh;
=cut
-sub _filter_columns ($$;$) {
+sub _filter_columns {
my ($tablename,$research, $filtercolumns)=@_;
if ($filtercolumns){
return (@$filtercolumns);
use YAML;
use URI::Escape;
use Business::ISBN;
+use MARC::Record;
+use MARC::Field;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $DEBUG);
. $@->code() . ") "
. $@->addinfo() . " "
. $@->diagset();
- warn $error;
+ warn $error." for query: $query";
return ( $error, undef, undef );
}
}
sub getRecords {
my (
$koha_query, $simple_query, $sort_by_ref, $servers_ref,
- $results_per_page, $offset, $expanded_facet, $branches,$itemtypes,
- $query_type, $scan
+ $results_per_page, $offset, $expanded_facet, $branches,
+ $itemtypes, $query_type, $scan, $opac
) = @_;
my @servers = @$servers_ref;
}
}
+ # also, if it's a location code, use the name instead of the code
+ if ( $link_value =~ /location/ ) {
+ $facet_label_value = GetKohaAuthorisedValueLib('LOC', $one_facet, $opac);
+ }
+
# but we're down with the whole label being in the link's title.
push @this_facets_array, {
facet_count => $facets_counter->{$link_value}->{$one_facet},
facet_title_value => $one_facet,
facet_link_value => $facet_link_value,
type_link_value => $link_value,
- };
+ } if ( $facet_label_value );
}
}
return \@indexes;
}
+=head2 _handle_exploding_index
+
+ my $query = _handle_exploding_index($index, $term)
+
+Callback routine to generate the search for "exploding" indexes (i.e.
+those indexes which are turned into multiple or-connected searches based
+on authority data).
+
+=cut
+
+sub _handle_exploding_index {
+ my ( $index, $term ) = @_;
+
+ return unless ($index =~ m/(su-br|su-na|su-rl)/ && $term);
+
+ my $marcflavour = C4::Context->preference('marcflavour');
+
+ my $codesubfield = $marcflavour eq 'UNIMARC' ? '5' : 'w';
+ my $wantedcodes = '';
+ my @subqueries = ( "(su=\"$term\")");
+ my ($error, $results, $total_hits) = SimpleSearch( "Heading,wrdl=$term", undef, undef, [ "authorityserver" ] );
+ foreach my $auth (@$results) {
+ my $record = MARC::Record->new_from_usmarc($auth);
+ my @references = $record->field('5..');
+ if (@references) {
+ if ($index eq 'su-br') {
+ $wantedcodes = 'g';
+ } elsif ($index eq 'su-na') {
+ $wantedcodes = 'h';
+ } elsif ($index eq 'su-rl') {
+ $wantedcodes = '';
+ }
+ foreach my $reference (@references) {
+ my $codes = $reference->subfield($codesubfield);
+ push @subqueries, '(su="' . $reference->as_string('abcdefghijlmnopqrstuvxyz') . '")' if (($codes && $codes eq $wantedcodes) || !$wantedcodes);
+ }
+ }
+ }
+ return join(' or ', @subqueries);
+}
+
+=head2 parseQuery
+
+ ( $operators, $operands, $indexes, $limits,
+ $sort_by, $scan, $lang ) =
+ buildQuery ( $operators, $operands, $indexes, $limits, $sort_by, $scan, $lang);
+
+Shim function to ease the transition from buildQuery to a new QueryParser.
+This function is called at the beginning of buildQuery, and modifies
+buildQuery's input. If it can handle the input, it returns a query that
+buildQuery will not try to parse.
+=cut
+
+sub parseQuery {
+ my ( $operators, $operands, $indexes, $limits, $sort_by, $scan, $lang) = @_;
+
+ my @operators = $operators ? @$operators : ();
+ my @indexes = $indexes ? @$indexes : ();
+ my @operands = $operands ? @$operands : ();
+ my @limits = $limits ? @$limits : ();
+ my @sort_by = $sort_by ? @$sort_by : ();
+
+ my $query = $operands[0];
+ my $index;
+ my $term;
+
+# TODO: once we are using QueryParser, all this special case code for
+# exploded search indexes will be replaced by a callback to
+# _handle_exploding_index
+ if ( $query =~ m/^(.*)\b(su-br|su-na|su-rl)[:=](\w.*)$/ ) {
+ $query = $1;
+ $index = $2;
+ $term = $3;
+ } else {
+ $query = '';
+ for ( my $i = 0 ; $i <= @operands ; $i++ ) {
+ if ($operands[$i] && $indexes[$i] =~ m/(su-br|su-na|su-rl)/) {
+ $index = $indexes[$i];
+ $term = $operands[$i];
+ } elsif ($operands[$i]) {
+ $query .= $operators[$i] eq 'or' ? ' or ' : ' and ' if ($query);
+ $query .= "($indexes[$i]:$operands[$i])";
+ }
+ }
+ }
+
+ if ($index) {
+ my $queryPart = _handle_exploding_index($index, $term);
+ if ($queryPart) {
+ $query .= "($queryPart)";
+ }
+ $operators = ();
+ $operands[0] = "ccl=$query";
+ }
+
+ return ( $operators, \@operands, $indexes, $limits, $sort_by, $scan, $lang);
+}
+
=head2 buildQuery
( $error, $query,
warn "---------\nEnter buildQuery\n---------" if $DEBUG;
+ ( $operators, $operands, $indexes, $limits, $sort_by, $scan, $lang) = parseQuery($operators, $operands, $indexes, $limits, $sort_by, $scan, $lang);
+
# dereference
my @operators = $operators ? @$operators : ();
my @indexes = $indexes ? @$indexes : ();
my $q=$';
# This is needed otherwise ccl= and &limit won't work together, and
# this happens when selecting a subject on the opac-detail page
- if (@limits) {
+ @limits = grep {!/^$/} @limits;
+ if ( @limits ) {
$q .= ' and '.join(' and ', @limits);
}
return ( undef, $q, $q, "q=ccl=$q", $q, '', '', '', '', 'ccl' );
my %group_OR_limits;
my $availability_limit;
foreach my $this_limit (@limits) {
+ next unless $this_limit;
if ( $this_limit =~ /available/ ) {
#
## 'available' is defined as (items.onloan is NULL) and (items.itemlost = 0)
my $items_count = scalar(@fields);
my $maxitems_pref = C4::Context->preference('maxItemsinSearchResults');
my $maxitems = $maxitems_pref ? $maxitems_pref - 1 : 1;
+ my @hiddenitems; # hidden itemnumbers based on OpacHiddenItems syspref
# loop through every item
- my @hiddenitems;
foreach my $field (@fields) {
my $item;
}
$item->{description} = $itemtypes{ $item->{itype} }{description};
- # Hidden items
+ # OPAC hidden items
if ($is_opac) {
+ # hidden because lost
+ if ($hidelostitems && $item->{itemlost}) {
+ $hideatopac_count++;
+ next;
+ }
+ # hidden based on OpacHiddenItems syspref
my @hi = C4::Items::GetHiddenItemnumbers($item);
- $item->{'hideatopac'} = @hi;
- push @hiddenitems, @hi;
+ if (scalar @hi) {
+ push @hiddenitems, @hi;
+ $hideatopac_count++;
+ next;
+ }
}
my $hbranch = C4::Context->preference('HomeOrHoldingBranch') eq 'homebranch' ? 'homebranch' : 'holdingbranch';
|| $item->{itemlost}
|| $item->{damaged}
|| $item->{notforloan} > 0
- || $item->{hideatopac}
|| $reservestatus eq 'Waiting'
|| ($transfertwhen ne ''))
{
$wthdrawn_count++ if $item->{wthdrawn};
$itemlost_count++ if $item->{itemlost};
$itemdamaged_count++ if $item->{damaged};
- $hideatopac_count++ if $item->{hideatopac};
$item_in_transit_count++ if $transfertwhen ne '';
$item_onhold_count++ if $reservestatus eq 'Waiting';
$item->{status} = $item->{wthdrawn} . "-" . $item->{itemlost} . "-" . $item->{damaged} . "-" . $item->{notforloan};
$other_count++;
my $key = $prefix . $item->{status};
- foreach (qw(wthdrawn itemlost damaged branchname itemcallnumber hideatopac)) {
+ foreach (qw(wthdrawn itemlost damaged branchname itemcallnumber)) {
$other_items->{$key}->{$_} = $item->{$_};
}
$other_items->{$key}->{intransit} = ( $transfertwhen ne '' ) ? 1 : 0;
$can_place_holds = 1;
$available_count++;
$available_items->{$prefix}->{count}++ if $item->{$hbranch};
- foreach (qw(branchname itemcallnumber hideatopac description)) {
+ foreach (qw(branchname itemcallnumber description)) {
$available_items->{$prefix}->{$_} = $item->{$_};
}
$available_items->{$prefix}->{location} = $shelflocations->{ $item->{location} };
}
}
} # notforloan, item level and biblioitem level
- if ($items_count > 0) {
- next if $is_opac && $hideatopac_count >= $items_count;
- next if $hidelostitems && $itemlost_count >= $items_count;
- }
+
+ # if all items are hidden, do not show the record
+ if ($items_count > 0 && $hideatopac_count == $items_count) {
+ next;
+ }
+
my ( $availableitemscount, $onloanitemscount, $otheritemscount );
for my $key ( sort keys %$onloan_items ) {
(++$onloanitemscount > $maxitems) and last;
@EXPORT = qw(
&NewSubscription &ModSubscription &DelSubscription &GetSubscriptions
&GetSubscription &CountSubscriptionFromBiblionumber &GetSubscriptionsFromBiblionumber
+ &SearchSubscriptions
&GetFullSubscriptionsFromBiblionumber &GetFullSubscription &ModSubscriptionHistory
&HasSubscriptionStrictlyExpired &HasSubscriptionExpired &GetExpirationDate &abouttoexpire
=cut
-sub GetSubscriptionHistoryFromSubscriptionId() {
+sub GetSubscriptionHistoryFromSubscriptionId {
my $dbh = C4::Context->dbh;
my $query = qq|
SELECT *
=cut
-sub GetSerialStatusFromSerialId() {
+sub GetSerialStatusFromSerialId {
my $dbh = C4::Context->dbh;
my $query = qq|
SELECT status
return @results;
}
+=head2 SearchSubscriptions
+
+@results = SearchSubscriptions($args);
+$args is a hashref. Its keys can be contained: title, issn, ean, publisher, bookseller and branchcode
+
+this function gets all subscriptions which have title like $title, ISSN like $issn, EAN like $ean, publisher like $publisher, bookseller like $bookseller AND branchcode eq $branch.
+
+return:
+a table of hashref. Each hash containt the subscription.
+
+=cut
+
+sub SearchSubscriptions {
+ my ( $args ) = @_;
+
+ my $query = qq{
+ SELECT subscription.*, subscriptionhistory.*, biblio.*, biblioitems.issn
+ FROM subscription
+ LEFT JOIN subscriptionhistory USING(subscriptionid)
+ LEFT JOIN biblio ON biblio.biblionumber = subscription.biblionumber
+ LEFT JOIN biblioitems ON biblioitems.biblionumber = subscription.biblionumber
+ LEFT JOIN aqbooksellers ON subscription.aqbooksellerid = aqbooksellers.id
+ };
+ my @where_strs;
+ my @where_args;
+ if( $args->{biblionumber} ) {
+ push @where_strs, "biblio.biblionumber = ?";
+ push @where_args, $args->{biblionumber};
+ }
+ if( $args->{title} ){
+ push @where_strs, "biblio.title LIKE ?";
+ push @where_args, "%$args->{title}%";
+ }
+ if( $args->{issn} ){
+ push @where_strs, "biblioitems.issn LIKE ?";
+ push @where_args, "%$args->{issn}%";
+ }
+ if( $args->{ean} ){
+ push @where_strs, "biblioitems.ean LIKE ?";
+ push @where_args, "%$args->{ean}%";
+ }
+ if( $args->{publisher} ){
+ push @where_strs, "biblioitems.publishercode LIKE ?";
+ push @where_args, "%$args->{publisher}%";
+ }
+ if( $args->{bookseller} ){
+ push @where_strs, "aqbooksellers.name LIKE ?";
+ push @where_args, "%$args->{bookseller}%";
+ }
+ if( $args->{branch} ){
+ push @where_strs, "subscription.branchcode = ?";
+ push @where_args, "$args->{branch}";
+ }
+
+ if(@where_strs){
+ $query .= " WHERE " . join(" AND ", @where_strs);
+ }
+
+ my $dbh = C4::Context->dbh;
+ my $sth = $dbh->prepare($query);
+ $sth->execute(@where_args);
+ my $results = $sth->fetchall_arrayref( {} );
+ $sth->finish;
+
+ return @$results;
+}
+
+
=head2 GetSerials
($totalissues,@serials) = GetSerials($subscriptionid);
=cut
-sub GetNextExpected($) {
+sub GetNextExpected {
my ($subscriptionid) = @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare('SELECT serialid, planneddate FROM serial WHERE subscriptionid=? AND status=?');
=cut
-sub ModNextExpected($$) {
+sub ModNextExpected {
my ( $subscriptionid, $date ) = @_;
my $dbh = C4::Context->dbh;
logaction( "SERIAL", "ADD", $subscriptionid, "" ) if C4::Context->preference("SubscriptionLog");
#set serial flag on biblio if not already set.
- my ( $null, ($bib) ) = GetBiblio($biblionumber);
+ my $bib = GetBiblio($biblionumber);
if ( !$bib->{'serial'} ) {
my $record = GetMarcBiblio($biblionumber);
my ( $tag, $subf ) = GetMarcFromKohaField( 'biblio.serial', $bib->{'frameworkcode'} );
=cut
-sub GetNextDate(@) {
+sub GetNextDate {
my ( $planneddate, $subscription ) = @_;
my @irreg = split( /\,/, $subscription->{irregularity} );
my @prev_items = reverse GetShelfInfo($sth_prev_items, $marcflavour);
my @next_items = GetShelfInfo($sth_next_items, $marcflavour);
- my $next_itemnumber = $next_items[-1]->{itemnumber} if @next_items;
- my $next_biblionumber = $next_items[-1]->{biblionumber} if @next_items;
+ my (
+ $next_itemnumber, $next_biblionumber,
+ $prev_itemnumber, $prev_biblionumber
+ );
+
+ $next_itemnumber = $next_items[-1]->{itemnumber} if @next_items;
+ $next_biblionumber = $next_items[-1]->{biblionumber} if @next_items;
- my $prev_itemnumber = $prev_items[0]->{itemnumber} if @prev_items;
- my $prev_biblionumber = $prev_items[0]->{biblionumber} if @prev_items;
+ $prev_itemnumber = $prev_items[0]->{itemnumber} if @prev_items;
+ $prev_biblionumber = $prev_items[0]->{biblionumber} if @prev_items;
my %result = (
next => \@next_items,
my (
$branch, $type,
$amount, $other, $itemnum,
- $itemtype, $borrowernumber, $accountno
+ $itemtype, $borrowernumber, $accountno, $ccode
)
= @_;
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare(
"INSERT INTO statistics
(datetime, branch, type, value,
- other, itemnumber, itemtype, borrowernumber, proccode)
- VALUES (now(),?,?,?,?,?,?,?,?)"
+ other, itemnumber, itemtype, borrowernumber, proccode, ccode)
+ VALUES (now(),?,?,?,?,?,?,?,?,?)"
);
$sth->execute(
$branch, $type, $amount,
$other, $itemnum, $itemtype, $borrowernumber,
- $accountno
+ $accountno, $ccode
);
}
BEGIN {
$VERSION = 3.07.00.049;
@ISA = qw(Exporter);
- @EXPORT_OK = qw(
- &get_tag &get_tags &get_tag_rows
- &add_tags &add_tag
- &delete_tag_row_by_id
- &remove_tag
- &delete_tag_rows_by_ids
- &rectify_weights
- &get_approval_rows
- &blacklist
- &whitelist
- &is_approved
- &approval_counts
- &get_count_by_tag_status
- &get_filters
- );
+ @EXPORT_OK = qw(
+ &get_tag &get_tags &get_tag_rows
+ &add_tags &add_tag
+ &delete_tag_row_by_id
+ &remove_tag
+ &delete_tag_rows_by_ids
+ &get_approval_rows
+ &blacklist
+ &whitelist
+ &is_approved
+ &approval_counts
+ &get_count_by_tag_status
+ &get_filters
+ stratify_tags
+ );
# %EXPORT_TAGS = ();
$ext_dict = C4::Context->preference('TagsExternalDictionary');
if ($debug) {
}
}
+=head1 C4::Tags.pm - Support for user tagging of biblios.
+
+More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG"}.
+
+=cut
+
INIT {
$ext_dict and $Lingua::Ispell::path = $ext_dict;
$debug and print STDERR "\$Lingua::Ispell::path = $Lingua::Ispell::path\n";
}
sub remove_tag {
- my $tag_id = shift or return undef;
+ my $tag_id = shift or return;
my $user_id = (@_) ? shift : undef;
my $rows = (defined $user_id) ?
get_tag_rows({tag_id=>$tag_id, borrowernumber=>$user_id}) :
get_tag_rows({tag_id=>$tag_id}) ;
$rows or return 0;
- (scalar(@$rows) == 1) or return undef; # should never happen (duplicate ids)
+ (scalar(@$rows) == 1) or return; # should never happen (duplicate ids)
my $row = shift(@$rows);
($tag_id == $row->{tag_id}) or return 0;
my $tags = get_tags({term=>$row->{term}, biblionumber=>$row->{biblionumber}});
}
sub delete_tag_index {
- (@_) or return undef;
+ (@_) or return;
my $sth = C4::Context->dbh->prepare("DELETE FROM tags_index WHERE term = ? AND biblionumber = ? LIMIT 1");
$sth->execute(@_);
return $sth->rows || 0;
}
sub delete_tag_approval {
- (@_) or return undef;
+ (@_) or return;
my $sth = C4::Context->dbh->prepare("DELETE FROM tags_approval WHERE term = ? LIMIT 1");
$sth->execute(shift);
return $sth->rows || 0;
}
sub delete_tag_row_by_id {
- (@_) or return undef;
+ (@_) or return;
my $sth = C4::Context->dbh->prepare("DELETE FROM tags_all WHERE tag_id = ? LIMIT 1");
$sth->execute(shift);
return $sth->rows || 0;
}
sub delete_tag_rows_by_ids {
- (@_) or return undef;
+ (@_) or return;
my $i=0;
foreach(@_) {
$i += delete_tag_row_by_id($_);
}
sub is_approved {
- my $term = shift or return undef;
+ my $term = shift or return;
my $sth = C4::Context->dbh->prepare("SELECT approved FROM tags_approval WHERE term = ?");
$sth->execute($term);
unless ($sth->rows) {
}
sub get_tag_index {
- my $term = shift or return undef;
+ my $term = shift or return;
my $sth;
if (@_) {
$sth = C4::Context->dbh->prepare("SELECT * FROM tags_index WHERE term = ? AND biblionumber = ?");
sub whitelist {
my $operator = shift;
- defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+ defined $operator or return; # have to test defined to allow =0 (kohaadmin)
if ($ext_dict) {
foreach (@_) {
spellcheck($_) or next;
# a term mistakenly, you can still reverse it. But there is no going back to "neutral".
sub blacklist {
my $operator = shift;
- defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+ defined $operator or return; # have to test defined to allow =0 (kohaadmin)
foreach (@_) {
my $aref = get_approval_rows({term=>$_});
if ($aref and scalar @$aref) {
}
sub add_filter {
my $operator = shift;
- defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+ defined $operator or return; # have to test defined to allow =0 (kohaadmin)
my $query = "INSERT INTO tags_blacklist (regexp,y,z) VALUES (?,?,?)";
# my $sth = C4::Context->dbh->prepare($query);
return scalar @_;
}
sub remove_filter {
my $operator = shift;
- defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
+ defined $operator or return; # have to test defined to allow =0 (kohaadmin)
my $query = "REMOVE FROM tags_blacklist WHERE blacklist_id = ?";
# my $sth = C4::Context->dbh->prepare($query);
# $sth->execute($term);
sub add_tag_approval { # or disapproval
$debug and warn "add_tag_approval(" . join(", ",map {defined($_) ? $_ : 'UNDEF'} @_) . ")";
- my $term = shift or return undef;
+ my $term = shift or return;
my $query = "SELECT * FROM tags_approval WHERE term = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($term);
sub mod_tag_approval {
my $operator = shift;
- defined $operator or return undef; # have to test defined to allow =0 (kohaadmin)
- my $term = shift or return undef;
+ defined $operator or return; # have to test defined to allow =0 (kohaadmin)
+ my $term = shift or return;
my $approval = (scalar @_ ? shift : 1); # default is to approve
my $query = "UPDATE tags_approval SET approved_by=?, approved=?, date_approved=NOW() WHERE term = ?";
$debug and print STDERR "mod_tag_approval query: $query\nmod_tag_approval args: ($operator,$approval,$term)\n";
}
sub add_tag_index {
- my $term = shift or return undef;
- my $biblionumber = shift or return undef;
+ my $term = shift or return;
+ my $biblionumber = shift or return;
my $query = "SELECT * FROM tags_index WHERE term = ? AND biblionumber = ?";
my $sth = C4::Context->dbh->prepare($query);
$sth->execute($term,$biblionumber);
}
sub get_tag { # by tag_id
- (@_) or return undef;
+ (@_) or return;
my $sth = C4::Context->dbh->prepare("$select_all WHERE tag_id = ?");
$sth->execute(shift);
return $sth->fetchrow_hashref;
}
-sub rectify_weights {
- my $dbh = C4::Context->dbh;
- my $sth;
- my $query = "
- SELECT term,biblionumber,count(*) as count
- FROM tags_all
- ";
- (@_) and $query .= " WHERE term =? ";
- $query .= " GROUP BY term,biblionumber ";
- $sth = $dbh->prepare($query);
- if (@_) {
- $sth->execute(shift);
- } else {
- $sth->execute();
- }
- my $results = $sth->fetchall_arrayref({}) or return undef;
- my %tally = ();
- foreach (@$results) {
- _set_weight($_->{count},$_->{term},$_->{biblionumber});
- $tally{$_->{term}} += $_->{count};
- }
- foreach (keys %tally) {
- _set_weight_total($tally{$_},$_);
- }
- return ($results,\%tally);
-}
-
sub increment_weights {
increment_weight(@_);
increment_weight_total(shift);
}
sub add_tag { # biblionumber,term,[borrowernumber,approvernumber]
- my $biblionumber = shift or return undef;
- my $term = shift or return undef;
+ my $biblionumber = shift or return;
+ my $term = shift or return;
my $borrowernumber = (@_) ? shift : 0; # the user, default to kohaadmin
$term =~ s/^\s+//;
$term =~ s/\s+$//;
- ($term) or return undef; # must be more than whitespace
+ ($term) or return; # must be more than whitespace
my $rows = get_tag_rows({biblionumber=>$biblionumber, borrowernumber=>$borrowernumber, term=>$term, limit=>1});
my $query = "INSERT INTO tags_all
(borrowernumber,biblionumber,term,date_created)
"add_tag query args: ($borrowernumber,$biblionumber,$term)\n";
if (scalar @$rows) {
$debug and carp "Duplicate tag detected. Tag not added.";
- return undef;
+ return;
}
# add to tags_all regardless of approaval
my $sth = C4::Context->dbh->prepare($query);
}
}
+# This takes a set of tags, as returned by C<get_approval_rows> and divides
+# them up into a number of "strata" based on their weight. This is useful
+# to display them in a number of different sizes.
+#
+# Usage:
+# ($min, $max) = stratify_tags($strata, $tags);
+# $stratum: the number of divisions you want
+# $tags: the tags, as provided by get_approval_rows
+# $min: the minumum stratum value
+# $max: the maximum stratum value. This may be the same as $min if there
+# is only one weight. Beware of divide by zeros.
+# This will add a field to the tag called "stratum" containing the calculated
+# value.
+sub stratify_tags {
+ my ( $strata, $tags ) = @_;
+
+ my ( $min, $max );
+ foreach (@$tags) {
+ my $w = $_->{weight_total};
+ $min = $w if ( !defined($min) || $min > $w );
+ $max = $w if ( !defined($max) || $max < $w );
+ }
+
+ # normalise min to zero
+ $max = $max - $min;
+ my $orig_min = $min;
+ $min = 0;
+
+ # if min and max are the same, just make it 1
+ my $span = ( $strata - 1 ) / ( $max || 1 );
+ foreach (@$tags) {
+ my $w = $_->{weight_total};
+ $_->{stratum} = int( ( $w - $orig_min ) * $span );
+ }
+ return ( $min, $max );
+}
+
1;
__END__
-=head1 C4::Tags.pm - Support for user tagging of biblios.
-
-More verose debugging messages are sent in the presence of non-zero $ENV{"DEBUG"}.
-
=head2 add_tag(biblionumber,term[,borrowernumber])
=head3 TO DO: Add real perldoc
}
-sub maxwidth (@) {
+sub maxwidth {
(@_) or return 0;
return (sort {$a <=> $b} map {length} @_)[-1];
}
-sub hashdump ($$) {
+sub hashdump {
my $pre = shift;
my $val = shift;
if (ref($val) =~ /HASH/) {
" SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
biblio.*, biblioitems.itemtype, biblioitems.publicationyear as year, biblioitems.publishercode, biblioitems.place, biblioitems.size, biblioitems.pages
FROM virtualshelfcontents vc
- LEFT JOIN biblio ON vc.biblionumber = biblio.biblionumber
+ JOIN biblio ON vc.biblionumber = biblio.biblionumber
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype
WHERE vc.shelfnumber=? ";
my $authorsort;
my $yearsort;
my $tag_quantity;
- my $sortfield = ( $query->param('sortfield') ? $query->param('sortfield') : 'title' );
+ my $sortfield = ( $sorton ? $sorton : 'title' );
if ( $sortfield eq 'author' ) {
$authorsort = 'author';
}
my ($authtypecode, $marcxml) = $sth->fetchrow;
my $record=eval {MARC::Record->new_from_xml(StripNonXmlChars($marcxml),'UTF-8',
(C4::Context->preference("marcflavour") eq "UNIMARC"?"UNIMARCAUTH":C4::Context->preference("marcflavour")))};
- return undef if ($@);
+ return if ($@);
$record->encoding('UTF-8');
my $self = $class->SUPER::new( { authid => $authid,
$repeat_sth->execute( $branch, 1 );
$self->{day_month_closed_days} = {};
while ( my $tuple = $repeat_sth->fetchrow_hashref ) {
- $self->{day_month_closed_days}->{ $tuple->{day} }->{ $tuple->{month} } =
+ $self->{day_month_closed_days}->{ $tuple->{month} }->{ $tuple->{day} } =
1;
}
+
my $special = $dbh->prepare(
-'SELECT day, month, year, title, description FROM special_holidays WHERE ( branchcode = ? ) AND (isexception = ?)'
+'SELECT day, month, year FROM special_holidays WHERE branchcode = ? AND isexception = ?'
);
$special->execute( $branch, 1 );
my $dates = [];
- while ( my ( $day, $month, $year, $title, $description ) =
- $special->fetchrow ) {
+ while ( my ( $day, $month, $year ) = $special->fetchrow ) {
push @{$dates},
DateTime->new(
day => $day,
}
$self->{exception_holidays} =
DateTime::Set->from_datetimes( dates => $dates );
- $special->execute( $branch, 1 );
+
+ $special->execute( $branch, 0 );
$dates = [];
- while ( my ( $day, $month, $year, $title, $description ) =
- $special->fetchrow ) {
+ while ( my ( $day, $month, $year ) = $special->fetchrow ) {
push @{$dates},
DateTime->new(
day => $day,
)->truncate( to => 'day' );
}
$self->{single_holidays} = DateTime::Set->from_datetimes( dates => $dates );
- $self->{days_mode} = C4::Context->preference('useDaysMode');
- $self->{test} = 0;
+ $self->{days_mode} = C4::Context->preference('useDaysMode');
+ $self->{test} = 0;
return;
}
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
+A third parameter allows to specify if the output format contains the hours and minutes.
+If it is not defined, the default value is 0;
+
=cut
sub output_pref {
my $dt = shift;
- my $force_pref = shift; # if testing we want to override Context
+ my $force_pref = shift; # if testing we want to override Context
+ my $dateonly = shift || 0; # if you don't want the hours and minutes
return unless defined $dt;
defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
given ($pref) {
when (/^iso/) {
- return $dt->strftime('%Y-%m-%d %H:%M');
+ return $dateonly
+ ? $dt->strftime('%Y-%m-%d')
+ : $dt->strftime('%Y-%m-%d %H:%M');
}
when (/^metric/) {
- return $dt->strftime('%d/%m/%Y %H:%M');
+ return $dateonly
+ ? $dt->strftime('%d/%m/%Y')
+ : $dt->strftime('%d/%m/%Y %H:%M');
}
when (/^us/) {
- return $dt->strftime('%m/%d/%Y %H:%M');
+ return $dateonly
+ ? $dt->strftime('%m/%d/%Y')
+ : $dt->strftime('%m/%d/%Y %H:%M');
}
default {
- return $dt->strftime('%Y-%m-%d %H:%M');
+ return $dateonly
+ ? $dt->strftime('%Y-%m-%d')
+ : $dt->strftime('%Y-%m-%d %H:%M');
}
}
my $record = shift;
my $newrecord;
- return undef unless defined $record;
+ return unless defined $record;
if (ref $record eq 'ARRAY') {
my @recarray;
my $options = $param->{options} || '';
my @plugins = ();
- foreach my $plugin ( $param->{plugins} ) {
+ foreach my $plugin ( @{$param->{plugins}} ) {
next unless $plugin;
my $plugin_module =
$plugin =~ m/:/
my %suggestions;
+ my $index = scalar @{ $self->plugins };
+
foreach my $pluginobj ( @{ $self->plugins } ) {
next unless $pluginobj;
my $pluginres = $pluginobj->get_suggestions($param);
foreach my $suggestion (@$pluginres) {
$suggestions{ $suggestion->{'search'} }->{'relevance'} +=
- $suggestion->{'relevance'};
+ $suggestion->{'relevance'} * $index;
$suggestions{ $suggestion->{'search'} }->{'label'} |=
$suggestion->{'label'};
}
+ $index--;
}
my @results = ();
in $param->{'search'}, and return them in a hashref with the suggestions
as keys and relevance as values.
-The following variables must be defined in each filter:
- our $NAME ='Filter';
- our $VERSION = '1.0';
+B<NAME> - return a string with the name of the plugin.
+
+B<VERSION> - return a string with the version of the plugin.
These methods may be overriden:
__PACKAGE__->mk_ro_accessors(qw( name version ));
__PACKAGE__->mk_accessors(qw( params ));
-our $NAME = 'Base';
-our $VERSION = '1.0';
=head2 new
use Carp;
use base qw(Koha::SuggestionEngine::Base);
-our $NAME = 'AuthorityFile';
-our $VERSION = '1.0';
+
+=head2 NAME
+ my $name = $plugin->NAME;
+
+=cut
+
+sub NAME {
+ return 'AuthorityFile';
+}
+
+=head2 VERSION
+ my $version = $plugin->VERSION;
+
+=cut
+
+sub VERSION {
+ return '1.1';
+}
=head2 get_suggestions
{
'search' => "an=$auth->{'authid'}",
relevance => $count--,
- label => $auth->{summary}->{authorized}->[0]
+ label => $auth->{summary}->{authorized}->[0]->{heading}
};
}
return \@results;
}
+
+1;
--- /dev/null
+package Koha::SuggestionEngine::Plugin::ExplodedTerms;
+
+# 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.
+
+=head1 NAME
+
+Koha::SuggestionEngine::Plugin::ExplodedTerms - suggest searches for broader/narrower/related subjects
+
+=head1 SYNOPSIS
+
+
+=head1 DESCRIPTION
+
+Plugin to suggest expanding the search by adding broader/narrower/related
+subjects to subject searches.
+
+=cut
+
+use strict;
+use warnings;
+use Carp;
+use C4::Templates qw(gettemplate); # This is necessary for translatability
+
+use base qw(Koha::SuggestionEngine::Base);
+
+=head2 NAME
+ my $name = $plugin->NAME;
+
+=cut
+
+sub NAME {
+ return 'ExplodedTerms';
+}
+
+=head2 VERSION
+ my $version = $plugin->VERSION;
+
+=cut
+
+sub VERSION {
+ return '1.0';
+}
+
+=head2 get_suggestions
+
+ my $suggestions = $plugin->get_suggestions(\%param);
+
+Return suggestions for the specified search that add broader/narrower/related
+terms to the search.
+
+=cut
+
+sub get_suggestions {
+ my $self = shift;
+ my $param = shift;
+
+ my $search = $param->{'search'};
+
+ return if ( $search =~ m/^(ccl=|cql=|pqf=)/ );
+ $search =~ s/(su|su-br|su-na|su-rl)[:=](\w*)/OP!$2/g;
+ return if ( $search =~ m/\w+[:=]\w+/ );
+
+ my @indexes = (
+ 'su-na',
+ 'su-br',
+ 'su-rl'
+ );
+ my $cgi = new CGI;
+ my $template = C4::Templates::gettemplate('text/explodedterms.tt', 'opac', $cgi);
+ my @results;
+ foreach my $index (@indexes) {
+ my $thissearch = $search;
+ $thissearch = "$index=$thissearch"
+ unless ( $thissearch =~ s/OP!/$index=/g );
+ $template->{VARS}->{index} = $index;
+ my $label = pack("U0a*", $template->output); #FIXME: C4::Templates is
+ # returning incorrectly-marked UTF-8. This fixes the problem, but is
+ # an annoying workaround.
+ push @results,
+ {
+ 'search' => $thissearch,
+ relevance => 100,
+ # FIXME: it'd be nice to have some empirical measure of
+ # "relevance" in this case, but we don't.
+ label => $label
+ };
+ } return \@results;
+}
+
+1;
use Carp;
use base qw(Koha::SuggestionEngine::Base);
-our $NAME = 'Null';
-our $VERSION = '1.0';
+
+=head2 NAME
+ my $name = $plugin->NAME;
+
+=cut
+
+sub NAME {
+ return 'Null';
+}
+
+=head2 VERSION
+ my $version = $plugin->VERSION;
+
+=cut
+
+sub VERSION {
+ return '1.1';
+}
=head2 get_suggestions
return \@result;
}
+
+1;
--- /dev/null
+package Koha::Template::Plugin::KohaAuthorisedValues;
+
+# Copyright ByWater Solutions 2012
+
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+
+use Template::Plugin;
+use base qw( Template::Plugin );
+
+use C4::Koha;
+
+=pod
+
+This plugin allows one to get the description for an authorised value
+from within a template.
+
+First, include the line '[% USE KohaAuthorisedValues %]' at the top
+of the template to enable the plugin.
+
+To use, call KohaAuthorisedValues.GetByCode with the category
+of the authorised value, the code to look up, and optionally,
+the OPAC flag ( if set, it will return the OPAC description rather
+than the Intranet description ).
+
+For example: [% KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %]
+will print the OPAC description for the LOST value stored in item.itemlost.
+
+=cut
+
+sub GetByCode {
+ my ( $self, $category, $code, $opac ) = @_;
+ return GetAuthorisedValueByCode( $category, $code, $opac );
+}
+
+1;
sub display_configuration {
my $config = shift;
my $dirmap = shift;
+ my @version = grep /\/usr\/share\/perl\//, @INC;
+ push @version, ('/usr/share/perl/5.10') if !$version[0];
print "\n\nKoha will be installed with the following configuration parameters:\n\n";
foreach my $key (sort keys %$config) {
print sprintf("%-25.25s%s\n", $key, $config->{$key});
print "\n\nTo change any configuration setting, please run\n";
print "perl Makefile.PL again. To override one of the target\n";
print "directories, you can do so on the command line like this:\n";
- print "\nperl Makefile.PL PERL_MODULE_DIR=/usr/share/perl/5.8\n\n";
+ print "\nperl Makefile.PL PERL_MODULE_DIR=$version[0]\n\n";
print "You can also set different default values for parameters\n";
print "or override directory locations by using environment variables.\n";
print "\nFor example:\n\n";
my $errZebraConnection = C4::Context->Zconn("biblioserver",0)->errcode();
+my $warnIsRootUser = (! $loggedinuser);
+
$template->param(
kohaVersion => $kohaVersion,
osVersion => $osVersion,
warnPrefBiblioAddsAuthorities => $warnPrefBiblioAddsAuthorities,
warnPrefEasyAnalyticalRecords => $warnPrefEasyAnalyticalRecords,
errZebraConnection => $errZebraConnection,
+ warnIsRootUser => $warnIsRootUser,
);
my @components = ();
my $orderinfo = $input->Vars;
$orderinfo->{'list_price'} ||= 0;
$orderinfo->{'uncertainprice'} ||= 0;
-#my $ordernumber = $input->param('ordernumber');
-#my $basketno = $input->param('basketno');
-#my $booksellerid = $input->param('booksellerid');
-#my $existing = $input->param('existing'); # existing biblio, (not basket or order)
-#my $title = $input->param('title');
-#my $author = $input->param('author');
-#my $publicationyear= $input->param('publicationyear');
-#my $isbn = $input->param('ISBN');
-#my $itemtype = $input->param('format');
-#my $quantity = $input->param('quantity'); # FIXME: else ERROR!
-#my $branch = $input->param('branch');
-#my $series = $input->param('series');
-#my $notes = $input->param('notes');
-#my $budget_id = $input->param('budget_id');
-#my $sort1 = $input->param('sort1');
-#my $sort2 = $input->param('sort2');
-#my $rrp = $input->param('rrp');
-#my $ecost = $input->param('ecost');
-#my $gst = $input->param('GST');
-#my $budget = $input->param('budget');
-#my $cost = $input->param('cost');
-#my $sub = $input->param('sub');
-#my $purchaseorder = $input->param('purchaseordernumber');
-#my $invoice = $input->param('invoice');
-#my $publishercode = $input->param('publishercode');
-#my $suggestionid = $input->param('suggestionid');
-#my $biblionumber = $input->param('biblionumber');
-#my $uncertainprice = $input->param('uncertainprice');
-#my $import_batch_id= $input->param('import_batch_id');
-#
-#my $createbibitem = $input->param('createbibitem');
-#
-my $user = $input->remote_user;
+
+my $user = $input->remote_user;
+
# create, modify or delete biblio
# create if $quantity>=0 and $existing='no'
# modify if $quantity>=0 and $existing='yes'
"biblio.copyrightdate" => $$orderinfo{publicationyear} ? $$orderinfo{publicationyear}: "",
"biblioitems.itemtype" => $$orderinfo{itemtype} ? $$orderinfo{itemtype} : "",
"biblioitems.editionstatement"=> $$orderinfo{editionstatement} ? $$orderinfo{editionstatement} : "",
+ "aqorders.branchcode" => $$orderinfo{branchcode} ? $$orderinfo{branchcode} : "",
+ "aqorders.quantity" => $$orderinfo{quantity} ? $$orderinfo{quantity} : "",
+ "aqorders.listprice" => $$orderinfo{listprice} ? $$orderinfo{listprice} : "",
+ "aqorders.uncertainprice" => $$orderinfo{uncertainprice} ? $$orderinfo{uncertainprice} : "",
+ "aqorders.rrp" => $$orderinfo{rrp} ? $$orderinfo{rrp} : "",
+ "aqorders.ecost" => $$orderinfo{ecost} ? $$orderinfo{ecost} : "",
+ "aqorders.discount" => $$orderinfo{discount} ? $$orderinfo{discount} : "",
});
# create the record in catalogue, with framework ''
$orderinfo->{biblionumber}=$biblionumber;
}
+ $orderinfo->{unitprice} = $orderinfo->{ecost} if not defined $orderinfo->{unitprice} or $orderinfo->{unitprice} eq '';
+
# if we already have $ordernumber, then it's an ordermodif
if ($$orderinfo{ordernumber}) {
ModOrder( $orderinfo);
# retrieve the file you want to import
my $import_batch_id = $cgiparams->{'import_batch_id'};
- my $biblios = GetImportBibliosRange($import_batch_id);
+ my $biblios = GetImportRecordsRange($import_batch_id);
for my $biblio (@$biblios){
# 1st insert the biblio, or find it through matcher
my ( $marcblob, $encoding ) = GetImportRecordMarc( $biblio->{'import_record_id'} );
# 3rd add order
my $patron = C4::Members->GetMember( borrowernumber => $loggedinuser );
my $branch = C4::Branch->GetBranchDetail( $patron->{branchcode} );
- my ($invoice);
# get quantity in the MARC record (1 if none)
my $quantity = GetMarcQuantity($marcrecord, C4::Context->preference('marcflavour')) || 1;
my %orderinfo = (
"biblionumber", $biblionumber, "basketno", $cgiparams->{'basketno'},
"quantity", $quantity, "branchcode", $branch,
- "booksellerinvoicenumber", $invoice,
"budget_id", $budget_id, "uncertainprice", 1,
"sort1", $cgiparams->{'sort1'},"sort2", $cgiparams->{'sort2'},
"notes", $cgiparams->{'notes'}, "budget_id", $cgiparams->{'budget_id'},
my $price = GetMarcPrice($marcrecord, C4::Context->preference('marcflavour'));
if ($price){
- $orderinfo{'listprice'} = $price;
eval {
require C4::Acquisition;
import C4::Acquisition qw/GetBasket/;
}
my $basket = GetBasket( $orderinfo{basketno} );
my $bookseller = GetBookSellerFromId( $basket->{booksellerid} );
- my $gst = $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
- $orderinfo{'unitprice'} = $orderinfo{listprice} - ( $orderinfo{listprice} * ( $bookseller->{discount} / 100 ) );
- $orderinfo{'ecost'} = $orderinfo{unitprice};
+ $orderinfo{gstrate} = $bookseller->{gstrate};
+ if ( $bookseller->{listincgst} ) {
+ $orderinfo{ecost} = $price;
+ } else {
+ $orderinfo{ecost} = $price * ( 1 + $orderinfo{gstrate} );
+ }
+ $orderinfo{rrp} = ( $orderinfo{ecost} * 100 ) / ( 100 - $bookseller->{discount} );
+ $orderinfo{listprice} = $orderinfo{rrp};
+ $orderinfo{unitprice} = $orderinfo{ecost};
+ $orderinfo{total} = $orderinfo{ecost};
} else {
$orderinfo{'listprice'} = 0;
}
- $orderinfo{'rrp'} = $orderinfo{'listprice'};
# remove uncertainprice flag if we have found a price in the MARC record
$orderinfo{uncertainprice} = 0 if $orderinfo{listprice};
}
} elsif ( scalar(@$budgets) ) {
$CGIsort1 = GetAuthvalueDropbox( @$budgets[0]->{'sort1_authcat'}, '' );
-} else {
- $CGIsort1 = GetAuthvalueDropbox( '', '' );
}
-
# if CGIsort is successfully fetched, the use it
# else - failback to plain input-field
if ($CGIsort1) {
}
} elsif ( scalar(@$budgets) ) {
$CGIsort2 = GetAuthvalueDropbox( @$budgets[0]->{sort2_authcat}, '' );
-} else {
- $CGIsort2 = GetAuthvalueDropbox( '', '' );
}
-
if ($CGIsort2) {
$template->param( CGIsort2 => $CGIsort2 );
} else {
foreach my $batch (@$batches) {
if ($batch->{'import_status'} eq "staged") {
# check if there is at least 1 line still staged
- my $stagedList=GetImportBibliosRange($batch->{'import_batch_id'}, undef, undef, 'staged');
+ my $stagedList=GetImportRecordsRange($batch->{'import_batch_id'}, undef, undef, 'staged');
if (scalar @$stagedList) {
my ($staged_date, $staged_hour) = split (/ /, $batch->{'upload_timestamp'});
push @list, {
sub import_biblios_list {
my ($template, $import_batch_id) = @_;
my $batch = GetImportBatch($import_batch_id,'staged');
- my $biblios = GetImportBibliosRange($import_batch_id,'','','staged');
+ my $biblios = GetImportRecordsRange($import_batch_id,'','','staged');
my @list = ();
foreach my $biblio (@$biblios) {
authorisedby => $basket->{authorisedby},
authorisedbyname => $basket->{authorisedbyname},
closedate => $basket->{closedate},
+ deliveryplace => $basket->{deliveryplace},
+ billingplace => $basket->{billingplace},
active => $bookseller->{'active'},
booksellerid => $bookseller->{'id'},
name => $bookseller->{'name'},
"loggedinuser: $loggedinuser; creationdate: %s; authorisedby: %s",
$basket->{creationdate}, $basket->{authorisedby};
- #to get active currency
- my $cur = GetCurrency();
+ #to get active currency
+ my $cur = GetCurrency();
my @results = GetOrders( $basketno );
-
- my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
- $gist = 0 if $gist == 0.0000;
- my $discount = $bookseller->{'discount'} / 100;
- my $total_rrp = 0; # RRP Total, its value will be assigned to $total_rrp_gsti or $total_rrp_gste depending of $bookseller->{'listincgst'}
- my $total_rrp_gsti = 0; # RRP Total, GST included
- my $total_rrp_gste = 0; # RRP Total, GST excluded
- my $gist_rrp = 0;
- my $total_rrp_est = 0;
-
- my $qty_total;
my @books_loop;
- my $suggestion;
- for my $order ( @results ) {
- my $rrp = $order->{'listprice'} || 0;
- my $qty = $order->{'quantity'} || 0;
- if (!defined $order->{quantityreceived}) {
- $order->{quantityreceived} = 0;
- }
- for ( qw(rrp ecost quantityreceived)) {
- if (!defined $order->{$_}) {
- $order->{$_} = 0;
- }
- }
-
- my $budget = GetBudget( $order->{'budget_id'} );
- $rrp = ConvertCurrency( $order->{'currency'}, $rrp );
-
- $total_rrp += $qty * $order->{'rrp'};
- my $line_total = $qty * $order->{'ecost'};
- $total_rrp_est += $qty * $order->{'ecost'};
- # FIXME: what about the "actual cost" field?
- $qty_total += $qty;
- my %line = %{ $order };
- my $biblionumber = $order->{'biblionumber'};
- my $countbiblio = CountBiblioInOrders($biblionumber);
- my $ordernumber = $order->{'ordernumber'};
- my @subscriptions = GetSubscriptionsId ($biblionumber);
- my $itemcount = GetItemsCount($biblionumber);
- my $holds = GetHolds ($biblionumber);
- my @items = GetItemnumbersFromOrder( $ordernumber );
- my $itemholds;
- foreach my $item (@items){
- my $nb = GetItemHolds($biblionumber, $item);
- if ($nb){
- $itemholds += $nb;
- }
- }
- # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
- $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
- $line{items} = ($itemcount) - (scalar @items);
- $line{left_item} = 1 if $line{items} >= 1;
- $line{left_biblio} = 1 if $countbiblio > 1;
- $line{biblios} = $countbiblio - 1;
- $line{left_subscription} = 1 if scalar @subscriptions >= 1;
- $line{subscriptions} = scalar @subscriptions;
- ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
- $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
- $line{holds} = $holds;
- $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
- $line{order_received} = ( $qty == $order->{'quantityreceived'} );
- $line{basketno} = $basketno;
- $line{budget_name} = $budget->{budget_name};
- $line{rrp} = sprintf( "%.2f", $line{'rrp'} );
- $line{ecost} = sprintf( "%.2f", $line{'ecost'} );
- $line{line_total} = sprintf( "%.2f", $line_total );
- if ($line{uncertainprice}) {
+ my @book_foot_loop;
+ my %foot;
+ my $total_quantity = 0;
+ my $total_gste = 0;
+ my $total_gsti = 0;
+ my $total_gstvalue = 0;
+ for my $order (@results) {
+ my $line = get_order_infos( $order, $bookseller);
+ if ( $line->{uncertainprice} ) {
$template->param( uncertainprices => 1 );
- $line{rrp} .= ' (Uncertain)';
}
- if ($line{'title'}){
- my $volume = $order->{'volume'};
- my $seriestitle = $order->{'seriestitle'};
- $line{'title'} .= " / $seriestitle" if $seriestitle;
- $line{'title'} .= " / $volume" if $volume;
- } else {
- $line{'title'} = "Deleted bibliographic notice, can't find title.";
- }
-
- $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber});
- $line{suggestionid} = $suggestion->{suggestionid};
- $line{surnamesuggestedby} = $suggestion->{surnamesuggestedby};
- $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
-
- push @books_loop, \%line;
+
+ push @books_loop, $line;
+
+ $foot{$$line{gstgsti}}{gstgsti} = $$line{gstgsti};
+ $foot{$$line{gstgsti}}{gstvalue} += $$line{gstvalue};
+ $total_gstvalue += $$line{gstvalue};
+ $foot{$$line{gstgsti}}{quantity} += $$line{quantity};
+ $total_quantity += $$line{quantity};
+ $foot{$$line{gstgsti}}{totalgste} += $$line{totalgste};
+ $total_gste += $$line{totalgste};
+ $foot{$$line{gstgsti}}{totalgsti} += $$line{totalgsti};
+ $total_gsti += $$line{totalgsti};
}
-my $total_est_gste;
- my $total_est_gsti;
- my $gist_est;
- if ($gist){ # if we have GST
- if ( $bookseller->{'listincgst'} ) { # if prices already includes GST
- $total_rrp_gsti = $total_rrp; # we know $total_rrp_gsti
- $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 ); # and can reverse compute other values
- $gist_rrp = $total_rrp_gsti - $total_rrp_gste; #
- $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount );
- $total_est_gsti = $total_rrp_est;
- } else { # if prices does not include GST
- $total_rrp_gste = $total_rrp; # then we use the common way to compute other values
- $gist_rrp = $total_rrp_gste * $gist; #
- $total_rrp_gsti = $total_rrp_gste + $gist_rrp; #
- $total_est_gste = $total_rrp_est;
- $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount );
- }
- $gist_est = $gist_rrp - ( $gist_rrp * $discount );
- } else {
- $total_rrp_gsti = $total_rrp;
- $total_est_gsti = $total_rrp_est;
-}
+ push @book_foot_loop, map {$_} values %foot;
+
+ # Get cancelled orders
+ @results = GetCancelledOrders($basketno);
+ my @cancelledorders_loop;
+ for my $order (@results) {
+ my $line = get_order_infos( $order, $bookseller);
+ push @cancelledorders_loop, $line;
+ }
my $contract = &GetContract($basket->{contractnumber});
my @orders = GetOrders($basketno);
+ if ($basket->{basketgroupid}){
+ my $basketgroup = GetBasketgroup($basket->{basketgroupid});
+ for my $key (keys %$basketgroup ){
+ $basketgroup->{"basketgroup$key"} = delete $basketgroup->{$key};
+ }
+ $basketgroup->{basketgroupdeliveryplace} = C4::Branch::GetBranchName( $basketgroup->{basketgroupdeliveryplace} );
+ $basketgroup->{basketgroupbillingplace} = C4::Branch::GetBranchName( $basketgroup->{basketgroupbillingplace} );
+ $template->param(%$basketgroup);
+ }
my $borrower= GetMember('borrowernumber' => $loggedinuser);
my $budgets = GetBudgetHierarchy;
my $has_budgets = 0;
authorisedbyname => $basket->{authorisedbyname},
closedate => $basket->{closedate},
estimateddeliverydate=> $estimateddeliverydate,
+ deliveryplace => C4::Branch::GetBranchName( $basket->{deliveryplace} ),
+ billingplace => C4::Branch::GetBranchName( $basket->{billingplace} ),
active => $bookseller->{'active'},
booksellerid => $bookseller->{'id'},
name => $bookseller->{'name'},
books_loop => \@books_loop,
+ book_foot_loop => \@book_foot_loop,
cancelledorders_loop => \@cancelledorders,
- gist_rate => sprintf( "%.2f", $gist * 100 ) . '%',
- total_rrp_gste => sprintf( "%.2f", $total_rrp_gste ),
- total_est_gste => sprintf( "%.2f", $total_est_gste ),
- gist_est => sprintf( "%.2f", $gist_est ),
- gist_rrp => sprintf( "%.2f", $gist_rrp ),
- total_rrp_gsti => sprintf( "%.2f", $total_rrp_gsti ),
- total_est_gsti => sprintf( "%.2f", $total_est_gsti ),
-# currency => $bookseller->{'listprice'},
- currency => $cur->{'currency'},
- qty_total => $qty_total,
- GST => $gist,
+ total_quantity => $total_quantity,
+ total_gste => sprintf( "%.2f", $total_gste ),
+ total_gsti => sprintf( "%.2f", $total_gsti ),
+ total_gstvalue => sprintf( "%.2f", $total_gstvalue ),
+ currency => $cur->{'currency'},
+ listincgst => $bookseller->{listincgst},
basketgroups => $basketgroups,
grouped => $basket->{basketgroupid},
unclosable => @orders ? 0 : 1,
);
}
+sub get_order_infos {
+ my $order = shift;
+ my $bookseller = shift;
+ my $qty = $order->{'quantity'} || 0;
+ if ( !defined $order->{quantityreceived} ) {
+ $order->{quantityreceived} = 0;
+ }
+ my $budget = GetBudget( $order->{'budget_id'} );
+
+ my %line = %{ $order };
+ $line{order_received} = ( $qty == $order->{'quantityreceived'} );
+ $line{basketno} = $basketno;
+ $line{budget_name} = $budget->{budget_name};
+ $line{rrp} = ConvertCurrency( $order->{'currency'}, $line{rrp} ); # FIXME from comm
+ if ( $bookseller->{'listincgst'} ) {
+ $line{rrpgsti} = sprintf( "%.2f", $line{rrp} );
+ $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 );
+ $line{rrpgste} = sprintf( "%.2f", $line{rrp} / ( 1 + ( $line{gstgsti} / 100 ) ) );
+ $line{gstgste} = sprintf( "%.2f", $line{gstgsti} / ( 1 + ( $line{gstgsti} / 100 ) ) );
+ $line{ecostgsti} = sprintf( "%.2f", $line{ecost} );
+ $line{ecostgste} = sprintf( "%.2f", $line{ecost} / ( 1 + ( $line{gstgsti} / 100 ) ) );
+ $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity});
+ $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} );
+ $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} );
+ } else {
+ $line{rrpgsti} = sprintf( "%.2f", $line{rrp} * ( 1 + ( $line{gstrate} ) ) );
+ $line{rrpgste} = sprintf( "%.2f", $line{rrp} );
+ $line{gstgsti} = sprintf( "%.2f", $line{gstrate} * 100 );
+ $line{gstgste} = sprintf( "%.2f", $line{gstrate} * 100 );
+ $line{ecostgsti} = sprintf( "%.2f", $line{ecost} * ( 1 + ( $line{gstrate} ) ) );
+ $line{ecostgste} = sprintf( "%.2f", $line{ecost} );
+ $line{gstvalue} = sprintf( "%.2f", ( $line{ecostgsti} - $line{ecostgste} ) * $line{quantity});
+ $line{totalgste} = sprintf( "%.2f", $order->{quantity} * $line{ecostgste} );
+ $line{totalgsti} = sprintf( "%.2f", $order->{quantity} * $line{ecostgsti} );
+ }
+
+ if ( $line{uncertainprice} ) {
+ $line{rrpgste} .= ' (Uncertain)';
+ }
+ if ( $line{'title'} ) {
+ my $volume = $order->{'volume'};
+ my $seriestitle = $order->{'seriestitle'};
+ $line{'title'} .= " / $seriestitle" if $seriestitle;
+ $line{'title'} .= " / $volume" if $volume;
+ } else {
+ $line{'title'} = "Deleted bibliographic notice, can't find title.";
+ }
+
+ my $biblionumber = $order->{'biblionumber'};
+ my $countbiblio = CountBiblioInOrders($biblionumber);
+ my $ordernumber = $order->{'ordernumber'};
+ my @subscriptions = GetSubscriptionsId ($biblionumber);
+ my $itemcount = GetItemsCount($biblionumber);
+ my $holds = GetHolds ($biblionumber);
+ my @items = GetItemnumbersFromOrder( $ordernumber );
+ my $itemholds;
+ foreach my $item (@items){
+ my $nb = GetItemHolds($biblionumber, $item);
+ if ($nb){
+ $itemholds += $nb;
+ }
+ }
+ # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
+ $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
+ $line{items} = ($itemcount) - (scalar @items);
+ $line{left_item} = 1 if $line{items} >= 1;
+ $line{left_biblio} = 1 if $countbiblio > 1;
+ $line{biblios} = $countbiblio - 1;
+ $line{left_subscription} = 1 if scalar @subscriptions >= 1;
+ $line{subscriptions} = scalar @subscriptions;
+ ($holds >= 1) ? $line{left_holds} = 1 : $line{left_holds} = 0;
+ $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
+ $line{holds} = $holds;
+ $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
+
+
+ my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber});
+ $line{suggestionid} = $$suggestion{suggestionid};
+ $line{surnamesuggestedby} = $$suggestion{surnamesuggestedby};
+ $line{firstnamesuggestedby} = $$suggestion{firstnamesuggestedby};
+
+ return \%line;
+}
+
output_html_with_http_headers $query, $cookie, $template->output;
my $borrower = GetMember( ( 'borrowernumber' => $loggedinuser ) );
$billingplace = $billingplace || $borrower->{'branchcode'};
$deliveryplace = $deliveryplace || $borrower->{'branchcode'};
-
- my $branches = GetBranches;
-
- # Build the combobox to select the billing place
- my @billingplaceloop;
- for (sort keys %$branches) {
- push @billingplaceloop, {
- value => $_,
- selected => $_ eq $billingplace,
- branchname => $branches->{$_}->{branchname},
- };
- }
- $template->param( billingplaceloop => \@billingplaceloop );
-
- # Build the combobox to select the delivery place
- my @deliveryplaceloop;
- for (sort keys %$branches) {
- push @deliveryplaceloop, {
- value => $_,
- selected => $_ eq $deliveryplace,
- branchname => $branches->{$_}->{branchname},
- };
- }
- $template->param( deliveryplaceloop => \@deliveryplaceloop );
+
+ my $branches = C4::Branch::GetBranchesLoop( $billingplace );
+ $template->param( billingplaceloop => $branches );
+ $branches = C4::Branch::GetBranchesLoop( $deliveryplace );
+ $template->param( deliveryplaceloop => $branches );
$template->param( booksellerid => $booksellerid );
}
use CGI;
use C4::Context;
use C4::Auth;
+use C4::Branch;
use C4::Output;
use C4::Acquisition qw/GetBasket NewBasket GetContracts ModBasketHeader/;
use C4::Bookseller qw/GetBookSellerFromId GetBookSeller/;
#parameters:
my $booksellerid = $input->param('booksellerid');
my $basketno = $input->param('basketno');
+my $branches = GetBranches;
my $basket;
my $op = $input ->param('op');
my $is_an_edit= $input ->param('is_an_edit');
$template->param(contractloop => \@contractloop,
basketcontractnumber => $basket->{'contractnumber'});
}
- my @booksellers = GetBookSeller();
+ my @booksellers = C4::Bookseller::GetBookSeller();
$template->param( add_form => 1,
basketname => $basket->{'basketname'},
basketnote => $basket->{'note'},
booksellerid => $booksellerid,
basketno => $basketno,
booksellers => \@booksellers,
- );
+ deliveryplace => $basket->{deliveryplace},
+ billingplace => $basket->{billingplace},
+ );
+
+ my $billingplace = $basket->{'billingplace'} || C4::Context->userenv->{"branch"};
+ my $deliveryplace = $basket->{'deliveryplace'} || C4::Context->userenv->{"branch"};
+
+ # Build the combobox to select the billing place
+ my @billingplaceloop;
+
+ my $branches = C4::Branch::GetBranchesLoop( $billingplace );
+ $template->param( billingplaceloop => $branches );
+ $branches = C4::Branch::GetBranchesLoop( $deliveryplace );
+ $template->param( deliveryplaceloop => $branches );
+
#End Edit
} elsif ( $op eq 'add_validate' ) {
#we are confirming the changes, save the basket
- my $basketno;
if ( $is_an_edit ) {
- $basketno = $input->param('basketno');
- ModBasketHeader( $input->param('basketno'), $input->param('basketname'), $input->param('basketnote'), $input->param('basketbooksellernote'), $input->param('basketcontractnumber') || undef, $input->param('basketbooksellerid') );
+ ModBasketHeader(
+ $basketno,
+ $input->param('basketname'),
+ $input->param('basketnote'),
+ $input->param('basketbooksellernote'),
+ $input->param('basketcontractnumber') || undef,
+ $input->param('basketbooksellerid'),
+ $input->param('deliveryplace'),
+ $input->param('billingplace'),
+ );
} else { #New basket
- $basketno = NewBasket($booksellerid, $loggedinuser, $input->param('basketname'), $input->param('basketnote'), $input->param('basketbooksellernote'), $input->param('basketcontractnumber'));
+ $basketno = NewBasket(
+ $booksellerid,
+ $loggedinuser,
+ $input->param('basketname'),
+ $input->param('basketnote'),
+ $input->param('basketbooksellernote'),
+ $input->param('basketcontractnumber') || undef,
+ undef,
+ $input->param('deliveryplace'),
+ $input->param('billingplace'),
+ );
}
print $input->redirect('basket.pl?basketno='.$basketno);
exit 0;
my $input = new CGI;
my $budget_id = $input->param('budget_id');
-my $sort_id = $input->param('sort');
+my $sort_nb = $input->param('sort');
+die "sort parameter can only be 1 or 2" unless ($sort_nb == 1 || $sort_nb == 2);
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "acqui/ajax.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => {editcatalogue => 'edit_catalogue'},
+ flagsrequired => {acquisition => 'order_manage'},
debug => 0,
}
);
-my $budget = GetBudget($budget_id);
-my $dropbox_values = GetAuthvalueDropbox( $budget->{'sort'.$sort_id.'_authcat'}, '' );
+my $ret_html;
+my $name = 'sort'.$sort_nb;
+my $authcat_field = 'sort'.$sort_nb.'_authcat';
-my @authorised_values;
-my %authorised_lib;
+my $budget = GetBudget($budget_id);
-foreach ( @$dropbox_values) {
- push @authorised_values, $_->{value};
- $authorised_lib{$_->{value}} = $_->{label};
-}
+if ( $budget && $budget->{$authcat_field} ) {
+ # with custom Asort* planning values
+ my $dropbox_values = GetAuthvalueDropbox( $budget->{$authcat_field}, '' );
-my $budget_authvalue_dropbox = CGI::scrolling_list(
- -values => \@authorised_values,
- -labels => \%authorised_lib,
- -default => $authorised_values[0],
-);
+ my @authorised_values;
+ my %authorised_lib;
+ my $default_value;
+ foreach ( @$dropbox_values) {
+ push @authorised_values, $_->{value};
+ $authorised_lib{$_->{value}} = $_->{label};
+ $default_value = $_->{value} if $_->{'default'};
+ }
-# strip off select tags
-$budget_authvalue_dropbox =~ s/^\<select.*?\"\>//;
-$budget_authvalue_dropbox =~ s/\<\/select\>$//;
-chomp $budget_authvalue_dropbox;
+ $ret_html = CGI::scrolling_list(
+ -values => \@authorised_values,
+ -labels => \%authorised_lib,
+ -default => $default_value,
+ -override => 1,
+ -size => 1,
+ -multiple => 0,
+ -name => $name,
+ -id => $name,
+ );
+
+} else {
+ # free input
+ $ret_html = '<input type="text" size="20" name="'.$name.'" id="'.$name.'" />';
+}
-$template->param( return => $budget_authvalue_dropbox );
+$template->param( 'return' => $ret_html );
output_html_with_http_headers $input, $cookie, $template->output;
use C4::Context;
use C4::Acquisition;
use C4::Biblio;
+use C4::Bookseller;
use C4::Items;
use C4::Search;
use List::MoreUtils qw/any/;
checkauth($input, 0, $flagsrequired, 'intranet');
-my $user=$input->remote_user;
-my $biblionumber = $input->param('biblionumber');
-my $biblioitemnumber=$input->param('biblioitemnumber');
-my $ordernumber=$input->param('ordernumber');
-my $origquantityrec=$input->param('origquantityrec');
-my $quantityrec=$input->param('quantityrec');
-my $quantity=$input->param('quantity');
-my $unitprice=$input->param('cost');
-my $invoiceno=$input->param('invoice');
-my $datereceived=$input->param('datereceived');
-my $replacement=$input->param('rrp');
-my $gst=$input->param('gst');
-my $freight=$input->param('freight');
-my $booksellerid = $input->param('booksellerid');
-my $cnt=0;
+my $user = $input->remote_user;
+my $biblionumber = $input->param('biblionumber');
+my $biblioitemnumber = $input->param('biblioitemnumber');
+my $ordernumber = $input->param('ordernumber');
+my $origquantityrec = $input->param('origquantityrec');
+my $quantityrec = $input->param('quantityrec');
+my $quantity = $input->param('quantity');
+my $unitprice = $input->param('cost');
+my $invoiceid = $input->param('invoiceid');
+my $invoice = GetInvoice($invoiceid);
+my $invoiceno = $invoice->{invoicenumber};
+my $datereceived = $invoice->{shipmentdate};
+my $booksellerid = $input->param('booksellerid');
+my $cnt = 0;
my $error_url_str;
-my $ecost = $input->param('ecost');
-my $note = $input->param("note");
+my $ecost = $input->param('ecost');
+my $rrp = $input->param('rrp');
+my $note = $input->param("note");
+my $order = GetOrder($ordernumber);
#need old recievedate if we update the order, parcel.pl only shows the right parcel this way FIXME
if ($quantityrec > $origquantityrec ) {
+ my @received_items = ();
+ if(C4::Context->preference('AcqCreateItem') eq 'ordering') {
+ @received_items = $input->param('items_to_receive');
+ }
+
+ $order->{rrp} = $rrp;
+ $order->{ecost} = $ecost;
+ $order->{unitprice} = $unitprice;
+ my $bookseller = C4::Bookseller::GetBookSellerFromId($booksellerid);
+ if ( $bookseller->{listincgst} ) {
+ if ( not $bookseller->{invoiceincgst} ) {
+ $order->{rrp} = $order->{rrp} * ( 1 + $order->{gstrate} );
+ $order->{ecost} = $order->{ecost} * ( 1 + $order->{gstrate} );
+ $order->{unitprice} = $order->{unitprice} * ( 1 + $order->{gstrate} );
+ }
+ } else {
+ if ( $bookseller->{invoiceincgst} ) {
+ $order->{rrp} = $order->{rrp} / ( 1 + $order->{gstrate} );
+ $order->{ecost} = $order->{ecost} / ( 1 + $order->{gstrate} );
+ $order->{unitprice} = $order->{unitprice} / ( 1 + $order->{gstrate} );
+ }
+ }
+
+ my $new_ordernumber = $ordernumber;
+ # save the quantity received.
+ if ( $quantityrec > 0 ) {
+ ($datereceived, $new_ordernumber) = ModReceiveOrder(
+ $biblionumber,
+ $ordernumber,
+ $quantityrec,
+ $user,
+ $order->{unitprice},
+ $order->{ecost},
+ $invoiceno,
+ $order->{rrp},
+ undef,
+ $datereceived,
+ \@received_items,
+ );
+ }
+
# now, add items if applicable
if (C4::Context->preference('AcqCreateItem') eq 'receiving') {
$itemhash{$item}->{'indicator'},'ITEM');
my $record=MARC::Record::new_from_xml($xml, 'UTF-8');
my (undef,$bibitemnum,$itemnumber) = AddItemFromMarc($record,$biblionumber);
- NewOrderItem($itemnumber, $ordernumber);
+ NewOrderItem($itemnumber, $new_ordernumber);
}
}
- my @received_items = ();
- if(C4::Context->preference('AcqCreateItem') eq 'ordering') {
- @received_items = $input->param('items_to_receive');
- }
-
- # save the quantity received.
- $datereceived = ModReceiveOrder($biblionumber,$ordernumber, $quantityrec ,$user,$unitprice,$invoiceno,$freight,$replacement,undef,$datereceived, \@received_items);
}
update_item( $_ ) foreach GetItemnumbersFromOrder( $ordernumber );
-print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoice=$invoiceno&booksellerid=$booksellerid&freight=$freight&gst=$gst&datereceived=$datereceived$error_url_str");
+print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid");
################################ End of script ################################
booksellerid => $booksellerid,
dateaccessioned => $datereceived,
price => $unitprice,
- replacementprice => $replacement,
+ replacementprice => $rrp,
replacementpricedate => $datereceived,
}, $biblionumber, $itemnumber );
}
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright 2011 BibLibre SARL
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 NAME
+
+invoice.pl
+
+=head1 DESCRIPTION
+
+Invoice details
+
+=cut
+
+use strict;
+use warnings;
+
+use CGI;
+use C4::Auth;
+use C4::Output;
+use C4::Acquisition;
+use C4::Bookseller qw/GetBookSellerFromId/;
+use C4::Budgets;
+
+my $input = new CGI;
+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
+ {
+ template_name => 'acqui/invoice.tmpl',
+ query => $input,
+ type => 'intranet',
+ authnotrequired => 0,
+ flagsrequired => { 'acquisition' => '*' },
+ debug => 1,
+ }
+);
+
+my $invoiceid = $input->param('invoiceid');
+my $op = $input->param('op');
+
+if ( $op && $op eq 'close' ) {
+ CloseInvoice($invoiceid);
+ my $referer = $input->param('referer');
+ if ($referer) {
+ print $input->redirect($referer);
+ exit 0;
+ }
+}
+elsif ( $op && $op eq 'reopen' ) {
+ ReopenInvoice($invoiceid);
+ my $referer = $input->param('referer');
+ if ($referer) {
+ print $input->redirect($referer);
+ exit 0;
+ }
+}
+elsif ( $op && $op eq 'mod' ) {
+ my $shipmentdate = $input->param('shipmentdate');
+ my $billingdate = $input->param('billingdate');
+ my $shipmentcost = $input->param('shipmentcost');
+ my $shipment_budget_id = $input->param('shipment_budget_id');
+ ModInvoice(
+ invoiceid => $invoiceid,
+ shipmentdate => C4::Dates->new($shipmentdate)->output("iso"),
+ billingdate => C4::Dates->new($billingdate)->output("iso"),
+ shipmentcost => $shipmentcost,
+ shipmentcost_budgetid => $shipment_budget_id
+ );
+ if ($input->param('reopen')) {
+ ReopenInvoice($invoiceid);
+ } elsif ($input->param('close')) {
+ CloseInvoice($invoiceid);
+ }
+ $template->param( modified => 1 );
+}
+
+my $details = GetInvoiceDetails($invoiceid);
+my $bookseller = GetBookSellerFromId( $details->{booksellerid} );
+my @orders_loop = ();
+my $orders = $details->{'orders'};
+my $qty_total;
+my @books_loop;
+my @book_foot_loop;
+my %foot;
+my $total_quantity = 0;
+my $total_rrp = 0;
+my $total_est = 0;
+
+foreach my $order (@$orders) {
+ my $line = get_infos( $order, $bookseller );
+
+ $total_quantity += $$line{quantity};
+ $total_rrp += $order->{quantity} * $order->{rrp};
+ $total_est += $order->{quantity} * $order->{'ecost'};
+
+ my %row = ( %$order, %$line );
+ push @orders_loop, \%row;
+}
+
+my $gist = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
+my $discount =
+ $bookseller->{'discount'} ? ( $bookseller->{discount} / 100 ) : 0;
+my $total_est_gste;
+my $total_est_gsti;
+my $total_rrp_gsti; # RRP Total, GST included
+my $total_rrp_gste; # RRP Total, GST excluded
+my $gist_est;
+my $gist_rrp;
+if ($gist) {
+
+ # if we have GST
+ if ( $bookseller->{'listincgst'} ) {
+
+ # if prices already includes GST
+
+ # we know $total_rrp_gsti
+ $total_rrp_gsti = $total_rrp;
+
+ # and can reverse compute other values
+ $total_rrp_gste = $total_rrp_gsti / ( $gist + 1 );
+
+ $gist_rrp = $total_rrp_gsti - $total_rrp_gste;
+ $total_est_gste = $total_rrp_gste - ( $total_rrp_gste * $discount );
+ $total_est_gsti = $total_est;
+ }
+ else {
+ # if prices does not include GST
+
+ # then we use the common way to compute other values
+ $total_rrp_gste = $total_rrp;
+ $gist_rrp = $total_rrp_gste * $gist;
+ $total_rrp_gsti = $total_rrp_gste + $gist_rrp;
+ $total_est_gste = $total_est;
+ $total_est_gsti = $total_rrp_gsti - ( $total_rrp_gsti * $discount );
+ }
+ $gist_est = $gist_rrp - ( $gist_rrp * $discount );
+}
+else {
+ $total_rrp_gste = $total_rrp_gsti = $total_rrp;
+ $total_est_gste = $total_est_gsti = $total_est;
+ $gist_rrp = $gist_est = 0;
+}
+my $total_gsti_shipment = $total_est_gsti + $details->{shipmentcost};
+
+my $format = "%.2f";
+$template->param(
+ total_rrp_gste => sprintf( $format, $total_rrp_gste ),
+ total_rrp_gsti => sprintf( $format, $total_rrp_gsti ),
+ total_est_gste => sprintf( $format, $total_est_gste ),
+ total_est_gsti => sprintf( $format, $total_est_gsti ),
+ gist_rrp => sprintf( $format, $gist_rrp ),
+ gist_est => sprintf( $format, $gist_est ),
+ total_gsti_shipment => sprintf( $format, $total_gsti_shipment ),
+ gist => sprintf( $format, $gist * 100 ),
+);
+
+my $budgets = GetBudgets();
+my @budgets_loop;
+my $shipmentcost_budgetid = $details->{shipmentcost_budgetid};
+foreach my $budget (@$budgets) {
+ next unless CanUserUseBudget( $loggedinuser, $budget, $flags );
+ my %line = %{$budget};
+ if ( $shipmentcost_budgetid
+ and $budget->{budget_id} == $shipmentcost_budgetid )
+ {
+ $line{selected} = 1;
+ }
+ push @budgets_loop, \%line;
+}
+
+$template->param(
+ invoiceid => $details->{'invoiceid'},
+ invoicenumber => $details->{'invoicenumber'},
+ suppliername => $details->{'suppliername'},
+ supplierid => $details->{'booksellerid'},
+ datereceived => $details->{'datereceived'},
+ shipmentdate => $details->{'shipmentdate'},
+ billingdate => $details->{'billingdate'},
+ invoiceclosedate => $details->{'closedate'},
+ shipmentcost => sprintf( $format, $details->{'shipmentcost'} || 0 ),
+ orders_loop => \@orders_loop,
+ total_quantity => $total_quantity,
+ invoiceincgst => $bookseller->{invoiceincgst},
+ currency => $bookseller->{listprice},
+ DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+ budgets_loop => \@budgets_loop,
+);
+
+sub get_infos {
+ my $order = shift;
+ my $bookseller = shift;
+ my $qty = $order->{'quantity'} || 0;
+ if ( !defined $order->{quantityreceived} ) {
+ $order->{quantityreceived} = 0;
+ }
+ my $budget = GetBudget( $order->{'budget_id'} );
+
+ my %line = %{$order};
+ $line{order_received} = ( $qty == $order->{'quantityreceived'} );
+ $line{budget_name} = $budget->{budget_name};
+ $line{total} = $qty * $order->{ecost};
+
+ if ( $line{uncertainprice} ) {
+ $line{rrp} .= ' (Uncertain)';
+ }
+ if ( $line{'title'} ) {
+ my $volume = $order->{'volume'};
+ my $seriestitle = $order->{'seriestitle'};
+ $line{'title'} .= " / $seriestitle" if $seriestitle;
+ $line{'title'} .= " / $volume" if $volume;
+ }
+ else {
+ $line{'title'} = "Deleted bibliographic notice, can't find title.";
+ }
+
+ return \%line;
+}
+
+output_html_with_http_headers $input, $cookie, $template->output;
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright 2011 BibLibre SARL
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 NAME
+
+invoices.pl
+
+=head1 DESCRIPTION
+
+Search for invoices
+
+=cut
+
+use strict;
+use warnings;
+
+use CGI;
+use C4::Auth;
+use C4::Output;
+
+use C4::Acquisition;
+use C4::Bookseller qw/GetBookSeller/;
+use C4::Branch;
+
+my $input = new CGI;
+my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
+ {
+ template_name => 'acqui/invoices.tmpl',
+ query => $input,
+ type => 'intranet',
+ authnotrequired => 0,
+ flagsrequired => { 'acquisition' => '*' },
+ debug => 1,
+ }
+);
+
+my $invoicenumber = $input->param('invoicenumber');
+my $supplier = $input->param('supplier');
+my $shipmentdatefrom = $input->param('shipmentdatefrom');
+my $shipmentdateto = $input->param('shipmentdateto');
+my $billingdatefrom = $input->param('billingdatefrom');
+my $billingdateto = $input->param('billingdateto');
+my $isbneanissn = $input->param('isbneanissn');
+my $title = $input->param('title');
+my $author = $input->param('author');
+my $publisher = $input->param('publisher');
+my $publicationyear = $input->param('publicationyear');
+my $branch = $input->param('branch');
+my $op = $input->param('op');
+
+my @results_loop = ();
+if ( $op and $op eq "do_search" ) {
+ my $shipmentdatefrom_iso = C4::Dates->new($shipmentdatefrom)->output("iso");
+ my $shipmentdateto_iso = C4::Dates->new($shipmentdateto)->output("iso");
+ my $billingdatefrom_iso = C4::Dates->new($billingdatefrom)->output("iso");
+ my $billingdateto_iso = C4::Dates->new($billingdateto)->output("iso");
+ my @invoices = GetInvoices(
+ invoicenumber => $invoicenumber,
+ suppliername => $supplier,
+ shipmentdatefrom => $shipmentdatefrom_iso,
+ shipmentdateto => $shipmentdateto_iso,
+ billingdatefrom => $billingdatefrom_iso,
+ billingdateto => $billingdateto_iso,
+ isbneanissn => $isbneanissn,
+ title => $title,
+ author => $author,
+ publisher => $publisher,
+ publicationyear => $publicationyear,
+ branchcode => $branch
+ );
+ foreach (@invoices) {
+ my %row = (
+ invoiceid => $_->{invoiceid},
+ billingdate => $_->{billingdate},
+ invoicenumber => $_->{invoicenumber},
+ suppliername => $_->{suppliername},
+ receivedbiblios => $_->{receivedbiblios},
+ receiveditems => $_->{receiveditems},
+ subscriptionid => $_->{subscriptionid},
+ closedate => $_->{closedate},
+ );
+ push @results_loop, \%row;
+ }
+}
+
+# Build suppliers list
+my @suppliers = GetBookSeller(undef);
+my @suppliers_loop = ();
+my $suppliername;
+foreach (@suppliers) {
+ my $selected = 0;
+ if ( $supplier && $supplier == $_->{'id'} ) {
+ $selected = 1;
+ $suppliername = $_->{'name'};
+ }
+ my %row = (
+ suppliername => $_->{'name'},
+ supplierid => $_->{'id'},
+ selected => $selected,
+ );
+ push @suppliers_loop, \%row;
+}
+
+# Build branches list
+my $branches = GetBranches();
+my @branches_loop = ();
+my $branchname;
+foreach ( sort keys %$branches ) {
+ my $selected = 0;
+ if ( $branch && $branch eq $_ ) {
+ $selected = 1;
+ $branchname = $branches->{$_}->{'branchname'};
+ }
+ my %row = (
+ branchcode => $_,
+ branchname => $branches->{$_}->{'branchname'},
+ selected => $selected,
+ );
+ push @branches_loop, \%row;
+}
+
+$template->param(
+ do_search => ( $op and $op eq "do_search" ) ? 1 : 0,
+ results_loop => \@results_loop,
+ invoicenumber => $invoicenumber,
+ supplier => $supplier,
+ suppliername => $suppliername,
+ billingdatefrom => $billingdatefrom,
+ billingdateto => $billingdateto,
+ isbneanissn => $isbneanissn,
+ title => $title,
+ author => $author,
+ publisher => $publisher,
+ publicationyear => $publicationyear,
+ branch => $branch,
+ branchname => $branchname,
+ suppliers_loop => \@suppliers_loop,
+ branches_loop => \@branches_loop,
+ DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+);
+
+output_html_with_http_headers $input, $cookie, $template->output;
=cut
-use strict;
-use warnings;
+use Modern::Perl;
use CGI;
use C4::Bookseller qw( GetBooksellersWithLateOrders );
use C4::Auth;
use C4::Acquisition;
use C4::Letters;
use C4::Branch; # GetBranches
+use Koha::DateUtils;
my $input = new CGI;
my ($template, $loggedinuser, $cookie) = get_template_and_user({
});
my $booksellerid = $input->param('booksellerid') || undef; # we don't want "" or 0
-my $delay = $input->param('delay');
+my $delay = $input->param('delay');
+
+# Get the "date from" param if !defined is today
my $estimateddeliverydatefrom = $input->param('estimateddeliverydatefrom');
my $estimateddeliverydateto = $input->param('estimateddeliverydateto');
+
+my $estimateddeliverydatefrom_dt =
+ $estimateddeliverydatefrom
+ ? dt_from_string($estimateddeliverydatefrom)
+ : undef;
+
+# Get the "date to" param. If it is not defined and $delay is not defined too, it is the today's date.
+my $estimateddeliverydateto_dt = $estimateddeliverydateto
+ ? dt_from_string($estimateddeliverydateto)
+ : ( not defined $delay and not defined $estimateddeliverydatefrom)
+ ? dt_from_string()
+ : undef;
+
+# Format the output of "date from" and "date to"
+if ($estimateddeliverydatefrom_dt) {
+ $estimateddeliverydatefrom = output_pref($estimateddeliverydatefrom_dt, undef, 1);
+}
+if ($estimateddeliverydateto_dt) {
+ $estimateddeliverydateto = output_pref($estimateddeliverydateto_dt, undef, 1);
+}
+
my $branch = $input->param('branch');
my $op = $input->param('op');
}
}
-my %supplierlist = GetBooksellersWithLateOrders(
- $delay,
- $branch,
- C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
- C4::Dates->new($estimateddeliverydateto)->output("iso")
-);
+my @parameters = ( $delay, $branch );
+push @parameters, $estimateddeliverydatefrom_dt
+ ? $estimateddeliverydatefrom_dt->ymd()
+ : undef;
+
+push @parameters, $estimateddeliverydateto_dt
+ ? $estimateddeliverydateto_dt->ymd()
+ : undef;
+
+my %supplierlist = GetBooksellersWithLateOrders(@parameters);
my (@sloopy); # supplier loop
foreach (keys %supplierlist){
$template->param(Supplier=>$supplierlist{$booksellerid}) if ($booksellerid);
$template->param(booksellerid=>$booksellerid) if ($booksellerid);
-my @lateorders = GetLateOrders(
- $delay,
- $booksellerid,
- $branch,
- C4::Dates->new($estimateddeliverydatefrom)->output("iso"),
- C4::Dates->new($estimateddeliverydateto)->output("iso")
-);
+@parameters =
+ ( $delay, $booksellerid, $branch );
+if ($estimateddeliverydatefrom_dt) {
+ push @parameters, $estimateddeliverydatefrom_dt->ymd();
+}
+else {
+ push @parameters, undef;
+}
+if ($estimateddeliverydateto_dt) {
+ push @parameters, $estimateddeliverydateto_dt->ymd();
+}
+my @lateorders = GetLateOrders( @parameters );
my $total;
foreach (@lateorders){
}
} elsif(@{$budgets}){
$CGIsort1 = GetAuthvalueDropbox( @$budgets[0]->{'sort1_authcat'}, '' );
-}else{
- $CGIsort1 = GetAuthvalueDropbox( '', '' );
}
# if CGIsort is successfully fetched, the use it
}
} elsif(@{$budgets}) {
$CGIsort2 = GetAuthvalueDropbox( @$budgets[0]->{sort2_authcat}, '' );
-}else{
- $CGIsort2 = GetAuthvalueDropbox( '', '' );
}
if ($CGIsort2) {
budget_name => $budget_name
) if ($close);
+# get option values for gist syspref
+my @gst_values = map {
+ option => $_
+}, split( '\|', C4::Context->preference("gist") );
+
+my $cur = GetCurrency();
+
$template->param(
existing => $biblionumber,
ordernumber => $ordernumber,
suggestionid => $suggestion->{suggestionid},
surnamesuggestedby => $suggestion->{surnamesuggestedby},
firstnamesuggestedby => $suggestion->{firstnamesuggestedby},
- biblionumber => $biblionumber,
- uncertainprice => $data->{'uncertainprice'},
- authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'},
- biblioitemnumber => $data->{'biblioitemnumber'},
- discount_2dp => sprintf( "%.2f", $bookseller->{'discount'}) , # for display
- discount => $bookseller->{'discount'},
+ biblionumber => $biblionumber,
+ uncertainprice => $data->{'uncertainprice'},
+ authorisedbyname => $borrower->{'firstname'} . " " . $borrower->{'surname'},
+ biblioitemnumber => $data->{'biblioitemnumber'},
+ discount_2dp => sprintf( "%.2f", $bookseller->{'discount'} ) , # for display
+ discount => $bookseller->{'discount'},
+ orderdiscount_2dp => sprintf( "%.2f", $data->{'discount'} || 0 ),
+ orderdiscount => $data->{'discount'},
listincgst => $bookseller->{'listincgst'},
invoiceincgst => $bookseller->{'invoiceincgst'},
name => $bookseller->{'name'},
cur_active_sym => $active_currency->{'symbol'},
cur_active => $active_currency->{'currency'},
loop_currencies => \@loop_currency,
+ currency_rate => $cur->{rate},
orderexists => ( $new eq 'yes' ) ? 0 : 1,
title => $data->{'title'},
author => $data->{'author'},
quantity => $data->{'quantity'},
quantityrec => $data->{'quantity'},
rrp => $data->{'rrp'},
- listprice => sprintf("%.2f", $data->{'listprice'}||$data->{'price'}||$listprice),
- total => sprintf("%.2f", ($data->{'ecost'}||0)*($data->{'quantity'}||0) ),
- ecost => $data->{'ecost'},
- unitprice => sprintf("%.2f", $data->{'unitprice'}||0),
+ gst_values => \@gst_values,
+ gstrate => $data->{gstrate} ? $data->{gstrate}+0.0 : $bookseller->{gstrate} ? $bookseller->{gstrate}+0.0 : 0,
+ gstreg => $bookseller->{'gstreg'},
+ listprice => sprintf( "%.2f", $data->{listprice} || $data->{price} || $listprice),
+ total => sprintf( "%.2f", ($data->{ecost} || 0) * ($data->{'quantity'} || 0) ),
+ ecost => sprintf( "%.2f", $data->{ecost} || 0),
+ unitprice => sprintf( "%.2f", $data->{unitprice} || 0),
notes => $data->{'notes'},
publishercode => $data->{'publishercode'},
barcode_subfield => $barcode_subfield,
-
import_batch_id => $import_batch_id,
-
-# CHECKME: gst-stuff needs verifing, mason.
- gstrate => $bookseller->{'gstrate'} // C4::Context->preference("gist") // 0,
- gstreg => $bookseller->{'gstreg'},
(uc(C4::Context->preference("marcflavour"))) => 1
);
=item receive
-=item invoice
+=item invoiceid
-the number of this invoice.
+the id of this invoice.
=item freight
my $input = new CGI;
my $dbh = C4::Context->dbh;
-my $booksellerid = $input->param('booksellerid');
+my $invoiceid = $input->param('invoiceid');
+my $invoice = GetInvoice($invoiceid);
+my $booksellerid = $invoice->{booksellerid};
+my $freight = $invoice->{shipmentcost};
+my $datereceived = $invoice->{shipmentdate};
my $ordernumber = $input->param('ordernumber');
my $search = $input->param('receive');
-my $invoice = $input->param('invoice');
-my $freight = $input->param('freight');
-my $datereceived = $input->param('datereceived');
-
$datereceived = $datereceived ? C4::Dates->new($datereceived, 'iso') : C4::Dates->new();
my $bookseller = GetBookSellerFromId($booksellerid);
-my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst'));
-my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
my $results = SearchOrder($ordernumber,$search);
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
$template->param(items => \@items);
}
- if ( $order->{'unitprice'} == 0 ) {
- $order->{'unitprice'} = '';
- }
+ $order->{quantityreceived} = '' if $order->{quantityreceived} == 0;
+ $order->{unitprice} = '' if $order->{unitprice} == 0;
+
+ my $rrp;
+ my $ecost;
+ my $unitprice;
+ if ( $bookseller->{listincgst} ) {
+ if ( $bookseller->{invoiceincgst} ) {
+ $rrp = $order->{rrp};
+ $ecost = $order->{ecost};
+ $unitprice = $order->{unitprice};
+ } else {
+ $rrp = $order->{rrp} / ( 1 + $order->{gstrate} );
+ $ecost = $order->{ecost} / ( 1 + $order->{gstrate} );
+ $unitprice = $order->{unitprice} / ( 1 + $order->{gstrate} );
+ }
+ } else {
+ if ( $bookseller->{invoiceincgst} ) {
+ $rrp = $order->{rrp} * ( 1 + $order->{gstrate} );
+ $ecost = $order->{ecost} * ( 1 + $order->{gstrate} );
+ $unitprice = $order->{unitprice} * ( 1 + $order->{gstrate} );
+ } else {
+ $rrp = $order->{rrp};
+ $ecost = $order->{ecost};
+ $unitprice = $order->{unitprice};
+ }
+ }
- my $suggestion = GetSuggestionInfoFromBiblionumber($order->{'biblionumber'});
+ my $suggestion = GetSuggestionInfoFromBiblionumber($order->{biblionumber});
- my $authorisedby = $order->{'authorisedby'};
+ my $authorisedby = $order->{authorisedby};
my $member = GetMember( borrowernumber => $authorisedby );
- my $budget = GetBudget( $order->{'budget_id'} );
+ my $budget = GetBudget( $order->{budget_id} );
$template->param(
AcqCreateItem => $AcqCreateItem,
biblioitemnumber => $order->{'biblioitemnumber'},
booksellerid => $order->{'booksellerid'},
freight => $freight,
- gst => $gst,
+ gstrate => $order->{gstrate} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0,
name => $bookseller->{'name'},
date => format_date($order->{entrydate}),
title => $order->{'title'},
quantity => $order->{'quantity'},
quantityreceivedplus1 => $order->{'quantityreceived'} + 1,
quantityreceived => $order->{'quantityreceived'},
- rrp => $order->{'rrp'},
- ecost => sprintf( "%.2f",$order->{'ecost'}),
- unitprice => sprintf( "%.2f",$order->{'unitprice'}),
+ rrp => sprintf( "%.2f", $rrp ),
+ ecost => sprintf( "%.2f", $ecost ),
+ unitprice => sprintf( "%.2f", $unitprice),
memberfirstname => $member->{firstname} || "",
membersurname => $member->{surname} || "",
- invoice => $invoice,
+ invoiceid => $invoice->{invoiceid},
+ invoice => $invoice->{invoicenumber},
datereceived => $datereceived->output(),
datereceived_iso => $datereceived->output('iso'),
notes => $order->{notes},
for ( my $i = 0 ; $i < $count ; $i++ ) {
my %line = %{ @$results[$i] };
- $line{invoice} = $invoice;
+ $line{invoice} = $invoice->{invoicenumber};
$line{datereceived} = $datereceived->output();
$line{freight} = $freight;
- $line{gst} = $gst;
+ $line{gstrate} = @$results[$i]->{'gstrate'} || $bookseller->{gstrate} || C4::Context->preference("gist") || 0;
$line{title} = @$results[$i]->{'title'};
$line{author} = @$results[$i]->{'author'};
- $line{booksellerid} = $booksellerid;
+ $line{booksellerid} = $booksellerid;
push @loop, \%line;
}
$template->param(
loop => \@loop,
- booksellerid => $booksellerid,
+ booksellerid => $booksellerid,
+ invoiceid => $invoice->{invoiceid},
);
}
my $op = $input->param('op');
is the bookseller invoice number.
-=item freight
-
=item gst
=cut
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
+
use C4::Auth;
use C4::Acquisition;
use C4::Budgets;
use JSON;
my $input=new CGI;
-my $booksellerid=$input->param('booksellerid');
-my $bookseller=GetBookSellerFromId($booksellerid);
-
-my $invoice=$input->param('invoice') || '';
-my $freight=$input->param('freight');
-my $input_gst = ($input->param('gst') eq '' ? undef : $input->param('gst'));
-my $gst= $input_gst // $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
-my $datereceived = ($input->param('op') eq ('new' or "search")) ? C4::Dates->new($input->param('datereceived'))
- : C4::Dates->new($input->param('datereceived'), 'iso');
-$datereceived = C4::Dates->new() unless $datereceived;
-my $code = $input->param('code');
-my @rcv_err = $input->param('error');
-my @rcv_err_barcode = $input->param('error_bc');
-my $startfrom=$input->param('startfrom');
-my $resultsperpage = $input->param('resultsperpage');
-$resultsperpage = 20 unless ($resultsperpage);
-$startfrom=0 unless ($startfrom);
+
+sub get_value_with_gst_params {
+ my $value = shift;
+ my $gstrate = shift;
+ my $bookseller = shift;
+ if ( $bookseller->{listincgst} ) {
+ if ( $bookseller->{invoiceincgst} ) {
+ return $value;
+ } else {
+ return $value / ( 1 + $gstrate );
+ }
+ } else {
+ if ( $bookseller->{invoiceincgst} ) {
+ return $value * ( 1 + $gstrate );
+ } else {
+ return $value;
+ }
+ }
+}
+
+sub get_gste {
+ my $value = shift;
+ my $gstrate = shift;
+ my $bookseller = shift;
+ return $bookseller->{invoiceincgst}
+ ? $value / ( 1 + $gstrate )
+ : $value;
+}
+
+sub get_gst {
+ my $value = shift;
+ my $gstrate = shift;
+ my $bookseller = shift;
+ return $bookseller->{invoiceincgst}
+ ? $value / ( 1 + $gstrate ) * $gstrate
+ : $value * ( 1 + $gstrate ) - $value;
+}
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/parcel.tmpl",
query => $input,
- type => "intranet",
+ type => "intranet",
authnotrequired => 0,
flagsrequired => {acquisition => 'order_receive'},
debug => 1,
});
+my $invoiceid = $input->param('invoiceid');
+my $op = $input->param('op') // '';
+
+if ($op eq 'cancelreceipt') {
+ my $ordernumber = $input->param('ordernumber');
+ my $parent_ordernumber = CancelReceipt($ordernumber);
+ unless($parent_ordernumber) {
+ $template->param(error_cancelling_receipt => 1);
+ }
+}
+
+my $invoice = GetInvoiceDetails($invoiceid);
+my $booksellerid = $invoice->{booksellerid};
+my $bookseller = GetBookSellerFromId($booksellerid);
+my $gst = $bookseller->{gstrate} // C4::Context->preference("gist") // 0;
+my $datereceived = C4::Dates->new();
+my $code = $input->param('code');
+my @rcv_err = $input->param('error');
+my @rcv_err_barcode = $input->param('error_bc');
+my $startfrom=$input->param('startfrom');
+my $resultsperpage = $input->param('resultsperpage');
+$resultsperpage = 20 unless ($resultsperpage);
+$startfrom=0 unless ($startfrom);
+
+
+
# If receiving error, report the error (coming from finishrecieve.pl(sic)).
if( scalar(@rcv_err) ) {
my $cnt=0;
}
my $cfstr = "%.2f"; # currency format string -- could get this from currency table.
-my @parcelitems = GetParcel($booksellerid, $invoice, $datereceived->output('iso'));
+my @parcelitems = @{ $invoice->{orders} };
my $countlines = scalar @parcelitems;
my $totalprice = 0;
-my $totalfreight = 0;
my $totalquantity = 0;
my $total;
-my $tototal;
my @loop_received = ();
-
-for (my $i = 0 ; $i < $countlines ; $i++) {
-
- #$total=($parcelitems[$i]->{'unitprice'} + $parcelitems[$i]->{'freight'}) * $parcelitems[$i]->{'quantityreceived'}; #weird, are the freight fees counted by book? (pierre)
- $total = ($parcelitems[$i]->{'unitprice'}) * $parcelitems[$i]->{'quantityreceived'}; #weird, are the freight fees counted by book? (pierre)
- $parcelitems[$i]->{'unitprice'} += 0;
+my @book_foot_loop;
+my %foot;
+my $total_quantity = 0;
+my $total_gste = 0;
+my $total_gsti = 0;
+
+for my $item ( @parcelitems ) {
+ $item->{unitprice} = get_value_with_gst_params( $item->{unitprice}, $item->{gstrate}, $bookseller );
+ $total = ( $item->{'unitprice'} ) * $item->{'quantityreceived'};
+ $item->{'unitprice'} += 0;
my %line;
- %line = %{ $parcelitems[$i] };
- $line{invoice} = $invoice;
- $line{gst} = $gst;
+ %line = %{ $item };
+ my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
+ $line{ecost} = sprintf( "%.2f", $ecost );
+ $line{invoice} = $invoice->{invoicenumber};
$line{total} = sprintf($cfstr, $total);
- $line{booksellerid} = $booksellerid;
- push @loop_received, \%line;
- $totalprice += $parcelitems[$i]->{'unitprice'};
- $line{unitprice} = sprintf($cfstr, $parcelitems[$i]->{'unitprice'});
+ $line{booksellerid} = $invoice->{booksellerid};
+ $totalprice += $item->{'unitprice'};
+ $line{unitprice} = sprintf( $cfstr, $item->{'unitprice'} );
+ my $gste = get_gste( $line{total}, $line{gstrate}, $bookseller );
+ my $gst = get_gst( $line{total}, $line{gstrate}, $bookseller );
+ $foot{$line{gstrate}}{gstrate} = $line{gstrate};
+ $foot{$line{gstrate}}{value} += sprintf( "%.2f", $gst );
+ $total_quantity += $line{quantity};
+ $total_gste += $gste;
+ $total_gsti += $gste + $gst;
my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber});
$line{suggestionid} = $suggestion->{suggestionid};
$line{surnamesuggestedby} = $suggestion->{surnamesuggestedby};
$line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
- #double FIXME - totalfreight is redefined later.
-
-# FIXME - each order in a parcel holds the freight for the whole parcel. This means if you receive a parcel with items from multiple budgets, you'll see the freight charge in each budget..
- if ($i > 0 && $totalfreight != $parcelitems[$i]->{'freight'}) {
- warn "FREIGHT CHARGE MISMATCH!!";
+ if ( $line{parent_ordernumber} != $line{ordernumber} ) {
+ if ( grep { $_->{ordernumber} == $line{parent_ordernumber} }
+ @parcelitems )
+ {
+ $line{cannot_cancel} = 1;
+ }
}
- $totalfreight = $parcelitems[$i]->{'freight'};
- $totalquantity += $parcelitems[$i]->{'quantityreceived'};
- $tototal += $total;
-}
-# We get the pending orders either all or filtered
-my $pendingorders;
-if($input->param('op') eq "search"){
- my $search = $input->param('summaryfilter') || '';
- my $ean = $input->param('eanfilter') || '';
- my $basketno = $input->param('basketfilter') || '';
- my $orderno = $input->param('orderfilter') || '';
- my $grouped;
- my $owner;
- $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean);
-}else{
- $pendingorders = GetPendingOrders($booksellerid);
+ my $budget = GetBudget( $line{budget_id} );
+ $line{budget_name} = $budget->{'budget_name'};
+
+ push @loop_received, \%line;
+ $totalquantity += $item->{'quantityreceived'};
+
}
-my $countpendings = scalar @$pendingorders;
+push @book_foot_loop, map { $_ } values %foot;
-# pending orders totals
-my ($totalPunitprice, $totalPquantity, $totalPecost, $totalPqtyrcvd);
-my $ordergrandtotal;
my @loop_orders = ();
-for (my $i = 0 ; $i < $countpendings ; $i++) {
- my %line;
- %line = %{$pendingorders->[$i]};
-
- $line{quantity}+=0;
- $line{quantityreceived}+=0;
- $line{unitprice}+=0;
- $totalPunitprice += $line{unitprice};
- $totalPquantity +=$line{quantity};
- $totalPqtyrcvd +=$line{quantityreceived};
- $totalPecost += $line{ecost};
- $line{ecost} = sprintf("%.2f",$line{ecost});
- $line{ordertotal} = sprintf("%.2f",$line{ecost}*$line{quantity});
- $line{unitprice} = sprintf("%.2f",$line{unitprice});
- $line{invoice} = $invoice;
- $line{gst} = $gst;
- $line{total} = $total;
- $line{booksellerid} = $booksellerid;
- $ordergrandtotal += $line{ecost} * $line{quantity};
-
- my $biblionumber = $line{'biblionumber'};
- my $countbiblio = CountBiblioInOrders($biblionumber);
- my $ordernumber = $line{'ordernumber'};
- my @subscriptions = GetSubscriptionsId ($biblionumber);
- my $itemcount = GetItemsCount($biblionumber);
- my $holds = GetHolds ($biblionumber);
- my @items = GetItemnumbersFromOrder( $ordernumber );
- my $itemholds;
- foreach my $item (@items){
- my $nb = GetItemHolds($biblionumber, $item);
- if ($nb){
- $itemholds += $nb;
+if(!defined $invoice->{closedate}) {
+ my $pendingorders;
+ if($input->param('op') eq "search"){
+ my $search = $input->param('summaryfilter') || '';
+ my $ean = $input->param('eanfilter') || '';
+ my $basketno = $input->param('basketfilter') || '';
+ my $orderno = $input->param('orderfilter') || '';
+ my $grouped;
+ my $owner;
+ $pendingorders = GetPendingOrders($booksellerid,$grouped,$owner,$basketno,$orderno,$search,$ean);
+ }else{
+ $pendingorders = GetPendingOrders($booksellerid);
+ }
+ my $countpendings = scalar @$pendingorders;
+
+ for (my $i = 0 ; $i < $countpendings ; $i++) {
+ my %line;
+ %line = %{$pendingorders->[$i]};
+
+ my $ecost = get_value_with_gst_params( $line{ecost}, $line{gstrate}, $bookseller );
+ $line{unitprice} = get_value_with_gst_params( $line{unitprice}, $line{gstrate}, $bookseller );
+ $line{quantity} += 0;
+ $line{quantityreceived} += 0;
+ $line{unitprice}+=0;
+ $line{ecost} = sprintf( "%.2f", $ecost );
+ $line{ordertotal} = sprintf( "%.2f", $ecost * $line{quantity} );
+ $line{unitprice} = sprintf("%.2f",$line{unitprice});
+ $line{invoice} = $invoice;
+ $line{booksellerid} = $booksellerid;
+
+
+
+ my $biblionumber = $line{'biblionumber'};
+ my $countbiblio = CountBiblioInOrders($biblionumber);
+ my $ordernumber = $line{'ordernumber'};
+ my @subscriptions = GetSubscriptionsId ($biblionumber);
+ my $itemcount = GetItemsCount($biblionumber);
+ my $holds = GetHolds ($biblionumber);
+ my @items = GetItemnumbersFromOrder( $ordernumber );
+ my $itemholds;
+ foreach my $item (@items){
+ my $nb = GetItemHolds($biblionumber, $item);
+ if ($nb){
+ $itemholds += $nb;
+ }
}
+
+ my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber});
+ $line{suggestionid} = $suggestion->{suggestionid};
+ $line{surnamesuggestedby} = $suggestion->{surnamesuggestedby};
+ $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
+
+ # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
+ $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
+ $line{items} = ($itemcount) - (scalar @items);
+ $line{left_item} = 1 if $line{items} >= 1;
+ $line{left_biblio} = 1 if $countbiblio > 1;
+ $line{biblios} = $countbiblio - 1;
+ $line{left_subscription} = 1 if scalar @subscriptions >= 1;
+ $line{subscriptions} = scalar @subscriptions;
+ $line{left_holds} = ($holds >= 1) ? 1 : 0;
+ $line{left_holds_on_order} = 1 if $line{left_holds}==1 && ($line{items} == 0 || $itemholds );
+ $line{holds} = $holds;
+ $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
+
+ my $budget = GetBudget( $line{budget_id} );
+ $line{budget_name} = $budget->{'budget_name'};
+
+ push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
}
- my $suggestion = GetSuggestionInfoFromBiblionumber($line{biblionumber});
- $line{suggestionid} = $suggestion->{suggestionid};
- $line{surnamesuggestedby} = $suggestion->{surnamesuggestedby};
- $line{firstnamesuggestedby} = $suggestion->{firstnamesuggestedby};
+ my $count = $countpendings;
- # if the biblio is not in other orders and if there is no items elsewhere and no subscriptions and no holds we can then show the link "Delete order and Biblio" see bug 5680
- $line{can_del_bib} = 1 if $countbiblio <= 1 && $itemcount == scalar @items && !(@subscriptions) && !($holds);
- $line{items} = ($itemcount) - (scalar @items);
- $line{left_item} = 1 if $line{items} >= 1;
- $line{left_biblio} = 1 if $countbiblio > 1;
- $line{biblios} = $countbiblio - 1;
- $line{left_subscription} = 1 if scalar @subscriptions >= 1;
- $line{subscriptions} = scalar @subscriptions;
- $line{left_holds} = 1 if $holds >= 1;
- $line{left_holds_on_order} = 1 if $line{left_holds} == 1 && ($line{items} == 0 || $itemholds );
- $line{holds} = $holds;
- $line{holds_on_order} = $itemholds?$itemholds:$holds if $line{left_holds_on_order};
-
-
- push @loop_orders, \%line if ($i >= $startfrom and $i < $startfrom + $resultsperpage);
-}
-$freight = $totalfreight unless $freight;
-my $count = $countpendings;
-
-if ($count>$resultsperpage){
- my $displaynext=0;
- my $displayprev=$startfrom;
- if(($count - ($startfrom+$resultsperpage)) > 0 ) {
- $displaynext = 1;
- }
+ if ($count>$resultsperpage){
+ my $displaynext=0;
+ my $displayprev=$startfrom;
+ if(($count - ($startfrom+$resultsperpage)) > 0 ) {
+ $displaynext = 1;
+ }
- my @numbers = ();
- for (my $i=1; $i<$count/$resultsperpage+1; $i++) {
- my $highlight=0;
- ($startfrom/$resultsperpage==($i-1)) && ($highlight=1);
- push @numbers, { number => $i,
- highlight => $highlight ,
- startfrom => ($i-1)*$resultsperpage};
- }
+ my @numbers = ();
+ for (my $i=1; $i<$count/$resultsperpage+1; $i++) {
+ my $highlight=0;
+ ($startfrom/$resultsperpage==($i-1)) && ($highlight=1);
+ push @numbers, { number => $i,
+ highlight => $highlight ,
+ startfrom => ($i-1)*$resultsperpage};
+ }
- my $from = $startfrom*$resultsperpage+1;
- my $to;
- if($count < (($startfrom+1)*$resultsperpage)){
- $to = $count;
- } else {
- $to = (($startfrom+1)*$resultsperpage);
+ my $from = $startfrom*$resultsperpage+1;
+ my $to;
+ if($count < (($startfrom+1)*$resultsperpage)){
+ $to = $count;
+ } else {
+ $to = (($startfrom+1)*$resultsperpage);
+ }
+ $template->param(numbers=>\@numbers,
+ displaynext=>$displaynext,
+ displayprev=>$displayprev,
+ nextstartfrom=>(($startfrom+$resultsperpage<$count)?$startfrom+$resultsperpage:$count),
+ prevstartfrom=>(($startfrom-$resultsperpage>0)?$startfrom-$resultsperpage:0)
+ );
}
- $template->param(numbers=>\@numbers,
- displaynext=>$displaynext,
- displayprev=>$displayprev,
- nextstartfrom=>(($startfrom+$resultsperpage<$count)?$startfrom+$resultsperpage:$count),
- prevstartfrom=>(($startfrom-$resultsperpage>0)?$startfrom-$resultsperpage:0)
- );
-}
-#$totalfreight=$freight;
-$tototal = $tototal + $freight;
+ $template->param(
+ loop_orders => \@loop_orders,
+ );
+}
$template->param(
- invoice => $invoice,
+ invoiceid => $invoice->{invoiceid},
+ invoice => $invoice->{invoicenumber},
+ invoiceclosedate => $invoice->{closedate},
datereceived => $datereceived->output('iso'),
invoicedatereceived => $datereceived->output('iso'),
formatteddatereceived => $datereceived->output(),
name => $bookseller->{'name'},
- booksellerid => $booksellerid,
- gst => $gst,
- freight => $freight,
- invoice => $invoice,
+ booksellerid => $bookseller->{id},
countreceived => $countlines,
loop_received => \@loop_received,
- countpending => $countpendings,
+ booksellerid => $booksellerid,
loop_orders => \@loop_orders,
+ book_foot_loop => \@book_foot_loop,
totalprice => sprintf($cfstr, $totalprice),
- totalfreight => $totalfreight,
totalquantity => $totalquantity,
- tototal => sprintf($cfstr, $tototal),
- ordergrandtotal => sprintf($cfstr, $ordergrandtotal),
- gst => $gst,
- grandtot => sprintf($cfstr, $tototal + $gst),
- totalPunitprice => sprintf("%.2f", $totalPunitprice),
- totalPquantity => $totalPquantity,
- totalPqtyrcvd => $totalPqtyrcvd,
- totalPecost => sprintf("%.2f", $totalPecost),
resultsperpage => $resultsperpage,
- (uc(C4::Context->preference("marcflavour"))) => 1
+ (uc(C4::Context->preference("marcflavour"))) => 1,
+ total_quantity => $total_quantity,
+ total_gste => sprintf( "%.2f", $total_gste ),
+ total_gsti => sprintf( "%.2f", $total_gsti ),
);
output_html_with_http_headers $input, $cookie, $template->output;
-
sort list of order by 'orderby'.
Orderby can be equals to
* datereceived desc (default value)
- * aqorders.booksellerinvoicenumber
+ * invoicenumber
* datereceived
- * aqorders.booksellerinvoicenumber desc
+ * invoicenumber desc
=item filter
use C4::Dates qw/format_date/;
use C4::Acquisition;
use C4::Bookseller qw/ GetBookSellerFromId /;
+use C4::Budgets;
my $input = CGI->new;
my $booksellerid = $input->param('booksellerid');
my $datefrom = $input->param('datefrom');
my $dateto = $input->param('dateto');
my $resultsperpage = $input->param('resultsperpage');
+my $op = $input->param('op');
$resultsperpage ||= 20;
-our ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+our ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
{ template_name => 'acqui/parcels.tmpl',
query => $input,
type => 'intranet',
}
);
+if($op and $op eq 'new') {
+ my $invoicenumber = $input->param('invoice');
+ my $shipmentdate = $input->param('shipmentdate');
+ my $shipmentcost = $input->param('shipmentcost');
+ my $shipmentcost_budgetid = $input->param('shipmentcost_budgetid');
+ if($shipmentdate) {
+ $shipmentdate = C4::Dates->new($shipmentdate)->output('iso');
+ }
+ my $invoiceid = AddInvoice(
+ invoicenumber => $invoicenumber,
+ booksellerid => $booksellerid,
+ shipmentdate => $shipmentdate,
+ shipmentcost => $shipmentcost,
+ shipmentcost_budgetid => $shipmentcost_budgetid,
+ );
+ if(defined $invoiceid) {
+ # Successful 'Add'
+ print $input->redirect("/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid");
+ exit 0;
+ } else {
+ $template->param(error_failed_to_create_invoice => 1);
+ }
+}
+
my $bookseller = GetBookSellerFromId($booksellerid);
-my @parcels = GetParcels( $booksellerid, $order, $code, $datefrom, $dateto );
+my @parcels = GetInvoices(
+ supplierid => $booksellerid,
+ invoicenumber => $code,
+ shipmentdatefrom => $datefrom,
+ shipmentdateto => $dateto,
+ order_by => $order
+);
my $count_parcels = @parcels;
# multi page display gestion
push @{$loopres},
{ number => $i + 1,
- code => $p->{booksellerinvoicenumber},
- nullcode => $p->{booksellerinvoicenumber} eq 'NULL',
- emptycode => $p->{booksellerinvoicenumber} eq q{},
- raw_datereceived => $p->{datereceived},
- datereceived => format_date( $p->{datereceived} ),
- bibcount => $p->{biblio},
- reccount => $p->{itemsreceived},
- itemcount => $p->{itemsexpected},
+ invoiceid => $p->{invoiceid},
+ code => $p->{invoicenumber},
+ nullcode => $p->{invoicenumber} eq 'NULL',
+ emptycode => $p->{invoicenumber} eq q{},
+ raw_datereceived => $p->{shipmentdate},
+ datereceived => format_date( $p->{shipmentdate} ),
+ bibcount => $p->{receivedbiblios} || 0,
+ reccount => $p->{receiveditems} || 0,
+ itemcount => $p->{itemsexpected} || 0,
};
}
if ($count_parcels) {
$template->param( searchresults => $loopres, count => $count_parcels );
}
+
+my $budgets = GetBudgets();
+my @budgets_loop;
+foreach my $budget (@$budgets) {
+ next unless CanUserUseBudget($loggedinuser, $budget, $flags);
+ push @budgets_loop, $budget;
+}
+
$template->param(
orderby => $order,
filter => $code,
resultsperpage => $resultsperpage,
name => $bookseller->{'name'},
DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
- datereceived_today => C4::Dates->new()->output(),
+ shipmentdate_today => C4::Dates->new()->output(),
booksellerid => $booksellerid,
GST => C4::Context->preference('gist'),
+ budgets => \@budgets_loop,
);
output_html_with_http_headers $input, $cookie, $template->output;
use warnings;
use utf8;
-use C4::Branch qw(GetBranchDetail);
+use C4::Branch qw(GetBranchDetail GetBranchName);
BEGIN {
use Exporter ();
$text->font( $pdf->corefont("Times", -encoding => "utf8"), 6/mm );
$text->translate(20/mm, ($height-15)/mm);
$text->text("Order N°".$basketgroup->{'id'}.". Basket N° ".$basket->{basketno}.". ".$basket->{booksellernote});
-
+ $text->translate(20/mm, ($height-20)/mm);
+ $text->font( $pdf->corefont("Times", -encoding => "utf8"), 4/mm );
+ $text->text( ( $basket->{billingplace} ? "Billing at " . C4::Branch::GetBranchName( $basket->{billingplace} ) : "" )
+ . ( $basket->{billingplace} and $basket->{deliveryplace} ? " and " : "" )
+ . ( $basket->{deliveryplace} ? "delivery at " . C4::Branch::GetBranchName( $basket->{deliveryplace}) : "" )
+ );
+
my $pdftable = new PDF::Table();
my $abaskets;
my $arrbasket;
aqbasket.booksellerid,
itype,
title,
- aqorders.booksellerinvoicenumber,
+ aqorders.invoiceid,
+ aqinvoices.invoicenumber,
quantityreceived,
unitprice,
- freight,
datereceived,
aqorders.biblionumber
FROM (aqorders, aqbasket)
biblio.biblionumber=aqorders.biblionumber
LEFT JOIN aqorders_items ON
aqorders.ordernumber=aqorders_items.ordernumber
+LEFT JOIN aqinvoices ON
+ aqorders.invoiceid = aqinvoices.invoiceid
WHERE
aqorders.basketno=aqbasket.basketno AND
budget_id=? AND
if ( $sth->err ) {
die "An error occurred fetching records: " . $sth->errstr;
}
-my $total = 0;
+my $subtotal = 0;
my $toggle;
my @spent;
while ( my $data = $sth->fetchrow_hashref ) {
my $recv = $data->{'quantityreceived'};
if ( $recv > 0 ) {
- my $subtotal = $recv * ( $data->{'unitprice'} + $data->{'freight'} );
- $data->{'subtotal'} = sprintf( "%.2f", $subtotal );
- $data->{'freight'} = sprintf( "%.2f", $data->{'freight'} );
+ my $rowtotal = $recv * $data->{'unitprice'};
+ $data->{'rowtotal'} = sprintf( "%.2f", $rowtotal );
$data->{'unitprice'} = sprintf( "%.2f", $data->{'unitprice'} );
- $total += $subtotal;
+ $subtotal += $rowtotal;
push @spent, $data;
}
}
-$total = sprintf( "%.2f", $total );
-$template->{VARS}->{'fund'} = $bookfund;
-$template->{VARS}->{'spent'} = \@spent;
-$template->{VARS}->{'total'} = $total;
-$template->{VARS}->{'fund_code'} = $fund_code;
+my $total = $subtotal;
+$query = qq{
+ SELECT invoicenumber, shipmentcost
+ FROM aqinvoices
+ WHERE shipmentcost_budgetid = ?
+};
+$sth = $dbh->prepare($query);
+$sth->execute($bookfund);
+my @shipmentcosts;
+while (my $data = $sth->fetchrow_hashref) {
+ push @shipmentcosts, {
+ shipmentcost => sprintf("%.2f", $data->{shipmentcost}),
+ invoicenumber => $data->{invoicenumber}
+ };
+ $total += $data->{shipmentcost};
+}
$sth->finish;
+$total = sprintf( "%.2f", $total );
+
+$template->param(
+ fund => $bookfund,
+ spent => \@spent,
+ subtotal => $subtotal,
+ shipmentcosts => \@shipmentcosts,
+ total => $total,
+ fund_code => $fund_code
+);
+
output_html_with_http_headers $input, $cookie, $template->output;
debug => 1,
}
);
-my $seller_gstrate = $supplier->{'gstrate'};
-# ensure the scalar isn't flagged as a string
-$seller_gstrate = ( defined $seller_gstrate ) ? $seller_gstrate + 0 : undef;
-my $tax_rate = $seller_gstrate // C4::Context->preference('gist') // 0;
-$tax_rate *= 100;
#build array for currencies
if ( $op eq 'display' ) {
gstreg => $supplier->{'gstreg'},
listincgst => $supplier->{'listincgst'},
invoiceincgst => $supplier->{'invoiceincgst'},
+ gstrate => $supplier->{'gstrate'} + 0.0,
discount => $supplier->{'discount'},
deliverytime => $supplier->{deliverytime},
invoiceprice => $supplier->{'invoiceprice'},
listprice => $supplier->{'listprice'},
- GST => $tax_rate,
- default_tax => defined($seller_gstrate),
basketcount => $supplier->{'basketcount'},
subscriptioncount => $supplier->{'subscriptioncount'},
contracts => $contracts,
};
}
- my $default_gst_rate = (C4::Context->preference('gist') * 100) || '0.0';
+ # get option values from gist syspref
+ my @gst_values = map {
+ option => $_
+ }, split( '\|', C4::Context->preference("gist") );
- my $gstrate = defined $supplier->{gstrate} ? $supplier->{gstrate} * 100 : '';
$template->param(
booksellerid => $booksellerid,
name => $supplier->{'name'},
gstreg => $supplier->{'gstreg'},
listincgst => $supplier->{'listincgst'},
invoiceincgst => $supplier->{'invoiceincgst'},
- gstrate => $gstrate,
+ gstrate => $supplier->{gstrate} ? $supplier->{'gstrate'}+0.0 : 0,
+ gst_values => \@gst_values,
discount => $supplier->{'discount'},
deliverytime => $supplier->{deliverytime},
loop_currency => $loop_currency,
- GST => $tax_rate,
enter => 1,
- default_gst_rate => $default_gst_rate,
);
}
$data{'listincgst'}=$input->param('list_gst');
$data{'invoiceincgst'}=$input->param('invoice_gst');
#have to transform this into fraction so it's easier to use
-my $gstrate = $input->param('gstrate');
-if ($gstrate eq '') {
- $data{'gstrate'} = undef;
-} else {
- $data{'gstrate'} = $input->param('gstrate')/100;
-}
-$data{'discount'}=$input->param('discount');
+$data{'gstrate'} = $input->param('gstrate');
+$data{'discount'} = $input->param('discount');
$data{deliverytime} = $input->param('deliverytime');
$data{'active'}=$input->param('status');
if($data{'name'}) {
);
-my $dbh = C4::Context->dbh;
-my $error = $input->param('error');
-my $biblionumber = $input->param('biblionumber');
-$biblionumber = 0 unless $biblionumber;
-my $frameworkcode = $input->param('frameworkcode');
-my $title = $input->param('title');
-my $author = $input->param('author');
-my $isbn = $input->param('isbn');
-my $issn = $input->param('issn');
-my $lccn = $input->param('lccn');
+my $dbh = C4::Context->dbh;
+my $error = $input->param('error');
+my $biblionumber = $input->param('biblionumber');
+$biblionumber = 0 unless $biblionumber;
+my $frameworkcode = $input->param('frameworkcode');
+my $title = $input->param('title');
+my $author = $input->param('author');
+my $isbn = $input->param('isbn');
+my $issn = $input->param('issn');
+my $lccn = $input->param('lccn');
my $lccall = $input->param('lccall');
-my $subject= $input->param('subject');
-my $dewey = $input->param('dewey');
-my $controlnumber = $input->param('controlnumber');
-my $op = $input->param('op');
-my $booksellerid = $input->param('booksellerid');
-my $basketno = $input->param('basketno');
+my $subject = $input->param('subject');
+my $dewey = $input->param('dewey');
+my $controlnumber = $input->param('controlnumber');
+my $op = $input->param('op');
+my $booksellerid = $input->param('booksellerid');
+my $basketno = $input->param('basketno');
+
+my $page = $input->param('current_page') || 1;
+$page = $input->param('goto_page') if $input->param('changepage_goto');
+my $show_next = 0;
+my $total_pages = 0;
+
my $noconnection;
my $attr = '';
my $term;
);
+$template->param(
+ isbn => $isbn,
+ issn => $issn,
+ lccn => $lccn,
+ lccall => $lccall,
+ title => $title,
+ author => $author,
+ controlnumber=> $controlnumber,
+ biblionumber => $biblionumber,
+ dewey => $dewey,
+ subject => $subject,
+);
if ( $op ne "do_search" ) {
my $sth = $dbh->prepare("select id,host,name,checked from z3950servers order by host");
$sth->execute();
my $serverloop = $sth->fetchall_arrayref( {} );
$template->param(
- isbn => $isbn,
- issn => $issn,
- lccn => $lccn,
- lccall => $lccall,
- title => $title,
- author => $author,
- controlnumber=> $controlnumber,
serverloop => $serverloop,
opsearch => "search",
- biblionumber => $biblionumber,
);
output_html_with_http_headers $input, $cookie, $template->output;
exit;
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) {
warn "numresults = $numresults" if $DEBUG;
my $i;
my $result = '';
- if ( $numresults > 0 ) {
- for (
- $i = 0 ;
- $i < ( ( $numresults < 20 ) ? ($numresults) : (20) ) ;
- $i++
- )
- {
+ if ( $numresults > 0 and $numresults >= (($page-1)*20)) {
+ $show_next = 1 if $numresults >= ($page*20);
+ $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
+ for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
my $rec = $oResult[$k]->record($i);
if ($rec) {
my $marcrecord;
## In HEAD i change everything to UTF-8
# In rel2_2 i am not sure what encoding is so no character conversion is done here
##Add necessary encoding changes to here -TG
+
+ # Normalize the record so it doesn't have separated diacritics
+ SetUTF8Flag($marcrecord);
+
my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
$oldbiblio->{isbn} =~ s/ |-|\.//g if $oldbiblio->{isbn};
# pad | and ( with spaces to allow line breaks in the HTML
} #$numresults
}
} # if $k !=0
- # print $template->output if $firstresult !=1;
+ my $numberpending = $nremaining - 1;
+
+ my @servers = ();
+ foreach my $id (@id) {
+ push(@servers,{id => $id});
+ }
+
+ $template->param(
+ breeding_loop => \@breeding_loop,
+ server => $servername[$k],
+ numberpending => $numberpending,
+ current_page => $page,
+ servers => \@servers,
+ total_pages => $total_pages,
+ );
+ $template->param(show_nextbutton=>1) if $show_next;
+ $template->param(show_prevbutton=>1) if $page != 1;
+
+ # print $template->output if $firstresult !=1;
$firstresult++;
} # while nremaining
#my $sort1_authcat = $input->param('sort1_authcat');
#my $sort2_authcat = $input->param('sort2_authcat');
-my $pagesize = 20;
+my $activepagesize = 20;
+my $inactivepagesize = 20;
$searchfield =~ s/\,//g;
my ($template, $borrowernumber, $cookie, $staff_flags ) = get_template_and_user(
## add or modify a budget period (preparation)
## get information about the budget period that must be modified
-
if ($budget_period_id) { # MOD
my $budgetperiod_hash=GetBudgetPeriod($budget_period_id);
# get dropboxes
- FormatData($budgetperiod_hash);
my $editnum = new Number::Format(
'int_curr_symbol' => '',
my $total = 0;
my $data = GetBudgetPeriod( $budget_period_id);
- FormatData($data);
$$data{'budget_period_total'}=$num->format_price( $data->{'budget_period_total'});
$template->param(
%$data
# DEFAULT - DISPLAY AQPERIODS TABLE
# -------------------------------------------------------------------
# display the list of budget periods
- my $results = GetBudgetPeriods();
- $template->param( period_button_only => 1 ) unless (@$results) ;
- my $page = $input->param('page') || 1;
- my $first = ( $page - 1 ) * $pagesize;
- # if we are on the last page, the number of the last word to display
- # must not exceed the length of the results array
- my $last = min( $first + $pagesize - 1, scalar @{$results} - 1, );
- my $toggle = 0;
- my @period_loop;
- foreach my $result ( @{$results}[ $first .. $last ] ) {
- my $budgetperiod = $result;
- FormatData($budgetperiod);
- $budgetperiod->{'budget_period_total'} = $num->format_price( $budgetperiod->{'budget_period_total'} );
- $budgetperiod->{budget_active} = 1;
- push( @period_loop, $budgetperiod );
- }
- $template->param(
- period_loop => \@period_loop,
- pagination_bar => pagination_bar("aqbudgetperiods.pl",getnbpages(scalar(@$results),$pagesize),$page),
- );
+my $activepage = $input->param('apage') || 1;
+my $inactivepage = $input->param('ipage') || 1;
+# Get active budget periods
+my $results = GetBudgetPeriods(
+ {budget_period_active => 1},
+ [{budget_period_description => 0}]
+);
+my $first = ( $activepage - 1 ) * $activepagesize;
+my $last = min( $first + $activepagesize - 1, scalar @{$results} - 1, );
+my @period_active_loop;
+
+foreach my $result ( @{$results}[ $first .. $last ] ) {
+ my $budgetperiod = $result;
+ $budgetperiod->{'budget_period_total'} = $num->format_price( $budgetperiod->{'budget_period_total'} );
+ $budgetperiod->{budget_active} = 1;
+ push( @period_active_loop, $budgetperiod );
+}
+my $url = "aqbudgetperiods.pl";
+$url .= "?ipage=$inactivepage" if($inactivepage != 1);
+my $active_pagination_bar = pagination_bar ($url, getnbpages( scalar(@$results), $activepagesize), $activepage, "apage");
+
+# Get inactive budget periods
+$results = GetBudgetPeriods(
+ {budget_period_active => 0},
+ [{budget_period_enddate => 1}]
+);
+
+$first = ( $inactivepage - 1 ) * $inactivepagesize;
+$last = min( $first + $inactivepagesize - 1, scalar @{$results} - 1, );
+my @period_inactive_loop;
+foreach my $result ( @{$results}[ $first .. $last ] ) {
+ my $budgetperiod = $result;
+ $budgetperiod->{'budget_period_total'} = $num->format_price( $budgetperiod->{'budget_period_total'} );
+ $budgetperiod->{budget_active} = 1;
+ push( @period_inactive_loop, $budgetperiod );
+}
+$url = "aqbudgetperiods.pl?tab=2";
+$url .= "&apage=$activepage" if($activepage != 1);
+my $inactive_pagination_bar = pagination_bar ($url, getnbpages( scalar(@$results), $inactivepagesize), $inactivepage, "ipage");
+
+my $tab = $input->param('tab') ? $input->param('tab') - 1 : 0;
+$template->param(
+ period_active_loop => \@period_active_loop,
+ period_inactive_loop => \@period_inactive_loop,
+ active_pagination_bar => $active_pagination_bar,
+ inactive_pagination_bar => $inactive_pagination_bar,
+ tab => $tab,
+ dateformat => C4::Context->preference('dateformat'),
+);
$template->param($op=>1);
output_html_with_http_headers $input, $cookie, $template->output;
exit 0;
sub default_form {
- # build categories list
- my $sth = $dbh->prepare("select distinct category from authorised_values");
- $sth->execute;
- my @category_list;
- my %categories; # a hash, to check that some hardcoded categories exist.
- while ( my ($category) = $sth->fetchrow_array) {
- push(@category_list,$category);
- $categories{$category} = 1;
- }
- # push koha system categories
- foreach (qw(Asort1 Asort2 Bsort1 Bsort2 SUGGEST DAMAGED LOST)) {
+ # build categories list
+ my $sth = $dbh->prepare("select distinct category from authorised_values");
+ $sth->execute;
+ my @category_list;
+ my %categories; # a hash, to check that some hardcoded categories exist.
+ while ( my ($category) = $sth->fetchrow_array ) {
+ push( @category_list, $category );
+ $categories{$category} = 1;
+ }
+
+ # push koha system categories
+ foreach (qw(Asort1 Asort2 Bsort1 Bsort2 SUGGEST DAMAGED LOST REPORT_GROUP REPORT_SUBGROUP)) {
push @category_list, $_ unless $categories{$_};
}
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use CGI;
+use C4::Context;
+use C4::Auth;
+use C4::Output;
+use Koha::SuggestionEngine;
+use Module::Load::Conditional qw(can_load);
+use JSON;
+
+my $input = new CGI;
+
+my ($template, $loggedinuser, $cookie)
+ = get_template_and_user({template_name => "admin/didyoumean.tt",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {parameters => 'parameters_remaining_permissions'},
+ debug => 1,
+ });
+
+my $opacplugins = from_json(C4::Context->preference('OPACdidyoumean') || '[]');
+
+my $intraplugins = from_json(C4::Context->preference('INTRAdidyoumean') || '[]');
+
+my @pluginlist = Koha::SuggestionEngine::AvailablePlugins();
+foreach my $plugin (@pluginlist) {
+ next if $plugin eq 'Koha::SuggestionEngine::Plugin::Null';
+ next unless (can_load( modules => { "$plugin" => undef } ));
+ push @$opacplugins, { name => $plugin->NAME } unless grep { $_->{name} eq $plugin->NAME } @$opacplugins;
+ push @$intraplugins, { name => $plugin->NAME } unless grep { $_->{name} eq $plugin->NAME } @$intraplugins;
+}
+$template->{VARS}->{OPACpluginlist} = $opacplugins;
+$template->{VARS}->{INTRApluginlist} = $intraplugins;
+output_html_with_http_headers $input, $cookie, $template->output;
my $field = $query->param('fieldname');
my $fieldcode = $query->param('marcfield');
my $subfieldcode = $query->param('marcsubfield');
-my $op = $query->param('op');
+my $op = $query->param('op') || q{};
my $id = $query->param('id');
my ($template, $loggedinuser, $cookie)
$u++;
}
$sth->finish;
- $dbh->disconnect;
return ( $cnt, \@results );
}
$row_data{delete} = "$script_name?op=delete_confirm&searchfield=" .$results[$i]->{'mts_tagfield'}."&frameworkcode=".$frameworkcode;
$j=$i;
my @internal_loop = ();
- while ( ( $results[$i]->{'tagfield'} == $results[$j]->{'tagfield'} ) and ( $j < $cnt ) ) {
+ while ( ( $j < $cnt ) and ( $results[$i]->{'tagfield'} == $results[$j]->{'tagfield'} ) ) {
my %subfield_data;
$subfield_data{tagsubfield} = $results[$j]->{'tagsubfield'};
$subfield_data{liblibrarian} = $results[$j]->{'liblibrarian'};
sub add_update_matching_rule {
my $template = shift;
my $matcher_id = shift;
+ my $record_type = $input->param('record_type') || 'biblio';
# do parsing
- my $matcher = C4::Matcher->new('biblio', 1000); # FIXME biblio only for now
+ my $matcher = C4::Matcher->new($record_type, 1000);
$matcher->code($input->param('code'));
$matcher->description($input->param('description'));
$matcher->threshold($input->param('threshold'));
my $matcher = C4::Matcher->fetch($matcher_id);
- $template->param(matcher_id => $matcher_id);
- $template->param(code => $matcher->code());
- $template->param(description => $matcher->description());
- $template->param(threshold => $matcher->threshold());
+ $template->{VARS}->{'matcher_id'} = $matcher_id;
+ $template->{VARS}->{'code'} = $matcher->code();
+ $template->{VARS}->{'description'} = $matcher->description();
+ $template->{VARS}->{'threshold'} = $matcher->threshold();
+ $template->{VARS}->{'record_type'} = $matcher->record_type();
my $matcher_info = $matcher->dump();
my @matchpoints = ();
if ( $op eq 'search' ) {
my $searchfield = $input->param( 'searchfield' );
- $searchfield =~ s/[^a-zA-Z0-9_ -]//g;
+ $searchfield =~ s/\p{IsC}//g;
+ $searchfield =~ s/\s+/ /;
+ $searchfield =~ s/^\s+//;
+ $searchfield =~ s/\s+$//;
$template->param( searchfield => $searchfield );
my $type=$input->param('type');
my $branch = $input->param('branch') || ( C4::Branch::onlymine() ? ( C4::Branch::mybranch() || '*' ) : '*' );
-my $op = $input->param('op');
+my $op = $input->param('op') || q{};
if ($op eq 'delete') {
my $itemtype = $input->param('itemtype');
$tabsysprefs{OverdueNoticeBcc} = "Circulation";
$tabsysprefs{OverduesBlockCirc} = "Circulation";
$tabsysprefs{UseTransportCostMatrix} = "Circulation";
-
+$tabsysprefs{AllowReturnToBranch} = "Circulation";
# Staff Client
$tabsysprefs{template} = "StaffClient";
$sth->execute;
}
- my @results;
- while (my $data=$sth->fetchrow_hashref) {
- push(@results,$data);
- }
- $sth->finish;
- $dbh->disconnect;
- return (scalar(@results),\@results);
+ my @results;
+ while (my $data=$sth->fetchrow_hashref) {
+ push(@results,$data);
+ }
+ $sth->finish;
+ return (scalar(@results),\@results);
}
my $input = new CGI;
use warnings;
use CGI;
+use URI::Escape;
use C4::Auth;
use C4::Context;
use C4::Biblio;
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 $op = $query->param('op') || '';
+my $authtypecode = $query->param('authtypecode') || '';
+my $authid = $query->param('authid') || '';
-my $authid = $query->param('authid');
my ( $template, $loggedinuser, $cookie );
my $authtypes = getauthtypes;
);
&DelAuthority( $authid, 1 );
- $op = "do_search";
+ if ( $query->param('operator') ) {
+ # query contains search params so perform search
+ $op = "do_search";
+ }
+ else {
+ $op = '';
+ }
}
if ( $op eq "do_search" ) {
- my @marclist = $query->param('marclist');
- my @and_or = $query->param('and_or');
- my @excluding = $query->param('excluding');
- my @operator = $query->param('operator');
- my $orderby = $query->param('orderby');
- my @value = $query->param('value');
+ my $marclist = $query->param('marclist') || '';
+ my $and_or = $query->param('and_or') || '';
+ my $excluding = $query->param('excluding') || '';
+ my $operator = $query->param('operator') || '';
+ my $orderby = $query->param('orderby') || '';
+ my $value = $query->param('value') || '';
my $startfrom = $query->param('startfrom') || 1;
my $resultsperpage = $query->param('resultsperpage') || 20;
- my ( $results, $total ) =
- SearchAuthorities( \@marclist, \@and_or, \@excluding, \@operator, \@value,
- ( $startfrom - 1 ) * $resultsperpage,
- $resultsperpage, $authtypecode, $orderby );
+ my ( $results, $total ) = SearchAuthorities(
+ [$marclist], [$and_or],
+ [$excluding], [$operator],
+ [$value], ( $startfrom - 1 ) * $resultsperpage,
+ $resultsperpage, $authtypecode,
+ $orderby
+ );
( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
);
$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'),
+ marclist => $marclist,
+ and_or => $and_or,
+ excluding => $excluding,
+ operator => $operator,
+ orderby => $orderby,
+ value => $value,
+ authtypecode => $authtypecode,
startfrom => $startfrom,
resultsperpage => $resultsperpage,
);
- my @field_data = ();
-
# we must get parameters once again. Because if there is a mainentry, it
# has been replaced by something else during the search, thus the links
# 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] };
- }
- }
# construction of the url of each page
- my $base_url =
- 'authorities-home.pl?'
- . join( '&', map { $_->{term} . '=' . $_->{val} } @field_data )
- . '&'
- . join(
- '&',
- map { $_->{term} . '=' . $_->{val} } (
- { term => 'resultsperpage', val => $resultsperpage },
- { term => 'type', val => 'intranet' },
- { term => 'op', val => 'do_search' },
- { term => 'authtypecode', val => $authtypecode },
- { term => 'orderby', val => $orderby },
- )
- );
+ my $value_url = uri_escape($value);
+ my $base_url = "authorities-home.pl?"
+ ."marclist=$marclist"
+ ."&and_or=$and_or"
+ ."&excluding=$excluding"
+ ."&operator=$operator"
+ ."&value=$value_url"
+ ."&resultsperpage=$resultsperpage"
+ ."&type=intranet"
+ ."&op=do_search"
+ ."&authtypecode=$authtypecode"
+ ."&orderby=$orderby";
my $from = ( $startfrom - 1 ) * $resultsperpage + 1;
my $to;
}
-$template->param( authtypesloop => \@authtypesloop, );
+$template->param(
+ authtypesloop => \@authtypesloop,
+ op => $op,
+);
$template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour");
id=\"".$subfield_data{id}."\"
name=\"".$subfield_data{id}."\"
value=\"$value\"
- class=\"input_marceditor readonly\"
- tabindex=\"1\"
- readonly=\"readonly\" \/>
+ class=\"input_marceditor\"
+ tabindex=\"1\" \/>
<a href=\"#\" class=\"buttonDot\"
onclick=\"openAuth(this.parentNode.getElementsByTagName('input')[1].id,'".$tagslib->{$tag}->{$subfield}->{authtypecode}."'); return false;\" tabindex=\"1\" title=\"Tag Editor\">...</a>
";
build_hidden_data;
$template->param(authid =>$authid,
duplicateauthid => $duplicateauthid,
- duplicateauthvalue => $duplicateauthvalue->{authorized}->[0],
+ duplicateauthvalue => $duplicateauthvalue->{'authorized'}->[0]->{'heading'},
);
}
} elsif ($op eq "delete") {
# Get all values for each distinct subfield
my %subfields;
for ( $field->subfields ) {
+ next if $_->[0] == "9"; # $9 will be set with authid value
my $letter = $_->[0];
next if defined $subfields{$letter};
my @values = $field->subfield($letter);
my @subf=$field->subfields;
# loop through each subfield
for my $i (0..$#subf) {
- $subf[$i][0] = "@" unless $subf[$i][0];
+ $subf[$i][0] = "@" unless defined $subf[$i][0];
# next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{tab} ne $tabloop);
next if ($tagslib->{$field->tag()}->{$subf[$i][0]}->{hidden});
my %subfield_data;
my @subf=$field->subfields;
# loop through each subfield
for my $i (0..$#subf) {
- $subf[$i][0] = "@" unless $subf[$i][0];
+ $subf[$i][0] = "@" unless defined $subf[$i][0];
next
if (
$tagslib->{ $field->tag() }->{ $subf[$i][0] }->{tab}
}
if (C4::Context->preference("AuthDisplayHierarchy")){
- my $trees=BuildUnimarcHierarchies($authid);
- my @trees = split /;/,$trees ;
- push @trees,$trees unless (@trees);
- my @loophierarchies;
- foreach my $tree (@trees){
- my @tree=split /,/,$tree;
- push @tree,$tree unless (@tree);
- my $cnt=0;
- my @loophierarchy;
- foreach my $element (@tree){
- my $elementdata = GetAuthority($element);
- $record= $elementdata if ($authid==$element);
- push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
- $cnt++;
- }
- push @loophierarchies, { 'loopelement' =>\@loophierarchy};
- }
- $template->param(
- 'displayhierarchy' =>C4::Context->preference("AuthDisplayHierarchy"),
- 'loophierarchies' =>\@loophierarchies,
- );
+ $template->{VARS}->{'displayhierarchy'} = C4::Context->preference("AuthDisplayHierarchy");
+ $template->{VARS}->{'loophierarchies'} = GenerateHierarchy($authid);
}
my $count = CountUsage($authid);
}
);
-my $record = GetMarcBiblio($biblionumber);
+my $record = GetMarcBiblio($biblionumber, 1);
$template->param( ocoins => GetCOinSBiblio($record) );
if ( not defined $record ) {
# loop through each subfield
for my $i ( 0 .. $#subf ) {
- $subf[$i][0] = "@" unless $subf[$i][0];
+ $subf[$i][0] = "@" unless defined $subf[$i][0];
next
if (
$tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{tab}
my %cell;
my $serials_to_display;
$cell{subscriptionid} = $subscription->{subscriptionid};
- $cell{subscriptionnotes} = $subscription->{notes};
+ $cell{subscriptionnotes} = $subscription->{internalnotes};
+ $cell{missinglist} = $subscription->{missinglist};
+ $cell{librariannote} = $subscription->{librariannote};
$cell{branchcode} = $subscription->{branchcode};
$cell{branchname} = GetBranchName($subscription->{branchcode});
$cell{hasalert} = $subscription->{hasalert};
$analytics_flag=1;
$item->{countanalytics} = $countanalytics;
}
- if ($item->{'materials'} ne ''){
+ if (defined($item->{'materials'}) && $item->{'materials'} =~ /\S/){
$materials_flag = 1;
}
push @itemloop, $item;
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
my $imagenumber = $query->param('imagenumber');
-my ( $count, $biblio ) = GetBiblio($biblionumber);
+my $biblio = GetBiblio($biblionumber);
my $itemcount = GetItemsCount($biblionumber);
my @items = GetItemsInfo($biblionumber);
);
} else {
$issues = GetBiblioIssues($biblionumber);
- my (undef,@biblio)=GetBiblio($biblionumber);
+ my $biblio = GetBiblio($biblionumber);
my $total = scalar @$issues;
$template->param(
- %{$biblio[0]},
+ %{$biblio},
);
}
foreach (@{$issues}){
}
my $order = GetOrderFromItemnumber( $item->{'itemnumber'} );
- my $basket = GetBasket( $order->{'basketno'} );
- $item->{'booksellerid'} = $basket->{'booksellerid'};
$item->{'ordernumber'} = $order->{'ordernumber'};
$item->{'basketno'} = $order->{'basketno'};
- $item->{'booksellerinvoicenumber'} = $order->{'booksellerinvoicenumber'};
$item->{'orderdate'} = $order->{'entrydate'};
if ($item->{'basketno'}){
my $basket = GetBasket($item->{'basketno'});
my $bookseller = GetBookSellerFromId($basket->{'booksellerid'});
$item->{'vendor'} = $bookseller->{'name'};
}
+ $item->{'invoiceid'} = $order->{'invoiceid'};
+ if($item->{invoiceid}) {
+ my $invoice = GetInvoice($item->{invoiceid});
+ $item->{invoicenumber} = $invoice->{invoicenumber} if $invoice;
+ }
$item->{'datereceived'} = $order->{'datereceived'};
if ($item->{notforloantext} or $item->{itemlost} or $item->{damaged} or $item->{wthdrawn}) {
. C4::Context->preference('defaultSortOrder');
}
-@sort_by = split("\0",$params->{'sort_by'}) if $params->{'sort_by'};
+@sort_by = $cgi->param('sort_by');
$sort_by[0] = $default_sort_by unless $sort_by[0];
foreach my $sort (@sort_by) {
$template->param($sort => 1) if $sort;
$template->param('sort_by' => $sort_by[0]);
# Use the servers defined, or just search our local catalog(default)
-my @servers;
-@servers = split("\0",$params->{'server'}) if $params->{'server'};
+my @servers = $cgi->param('server');
unless (@servers) {
#FIXME: this should be handled using Context.pm
@servers = ("biblioserver");
}
# operators include boolean and proximity operators and are used
# to evaluate multiple operands
-my @operators;
-@operators = split("\0",$params->{'op'}) if $params->{'op'};
+my @operators = $cgi->param('op');
# indexes are query qualifiers, like 'title', 'author', etc. They
# can be single or multiple parameters separated by comma: kw,right-Truncation
-my @indexes;
-@indexes = split("\0",$params->{'idx'});
+my @indexes = $cgi->param('idx');
# if a simple index (only one) display the index used in the top search box
if ($indexes[0] && (!$indexes[1] || $params->{'scan'})) {
# an operand can be a single term, a phrase, or a complete ccl query
-my @operands;
-@operands = split("\0",$params->{'q'}) if $params->{'q'};
+my @operands = $cgi->param('q');
# limits are use to limit to results to a pre-defined category such as branch or language
-my @limits;
-@limits = split("\0",$params->{'limit'}) if $params->{'limit'};
+my @limits = $cgi->param('limit');
if($params->{'multibranchlimit'}) {
push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
-#!/usr/bin/perl
+#!/usr/bin/perl
# Copyright 2009 BibLibre
# Moving items from the other record to the reference record
my $itemnumbers = get_itemnumbers_of($frombiblio);
foreach my $itloop ($itemnumbers->{$frombiblio}) {
- foreach my $itemnumber (@$itloop) {
- my $res = MoveItemFromBiblio($itemnumber, $frombiblio, $tobiblio);
- if (not defined $res) {
- push @notmoveditems, $itemnumber;
- }
- }
+ foreach my $itemnumber (@$itloop) {
+ my $res = MoveItemFromBiblio($itemnumber, $frombiblio, $tobiblio);
+ if (not defined $res) {
+ push @notmoveditems, $itemnumber;
+ }
+ }
}
# If some items could not be moved :
if (scalar(@notmoveditems) > 0) {
- my $itemlist = join(' ',@notmoveditems);
- push @errors, "The following items could not be moved from the old record to the new one: $itemlist";
+ my $itemlist = join(' ',@notmoveditems);
+ push @errors, { code => "CANNOT_MOVE", value => $itemlist };
}
# Moving subscriptions from the other record to the reference record
my $subcount = CountSubscriptionFromBiblionumber($frombiblio);
if ($subcount > 0) {
- $sth = $dbh->prepare("UPDATE subscription SET biblionumber = ? WHERE biblionumber = ?");
- $sth->execute($tobiblio, $frombiblio);
+ $sth = $dbh->prepare("UPDATE subscription SET biblionumber = ? WHERE biblionumber = ?");
+ $sth->execute($tobiblio, $frombiblio);
- $sth = $dbh->prepare("UPDATE subscriptionhistory SET biblionumber = ? WHERE biblionumber = ?");
- $sth->execute($tobiblio, $frombiblio);
+ $sth = $dbh->prepare("UPDATE subscriptionhistory SET biblionumber = ? WHERE biblionumber = ?");
+ $sth->execute($tobiblio, $frombiblio);
}
# Deleting the other record
if (scalar(@errors) == 0) {
- # Move holds
- MergeHolds($dbh,$tobiblio,$frombiblio);
- my $error = DelBiblio($frombiblio);
- push @errors, $error if ($error);
+ # Move holds
+ MergeHolds($dbh,$tobiblio,$frombiblio);
+ my $error = DelBiblio($frombiblio);
+ push @errors, $error if ($error);
}
# Parameters
$template->param(
- result => 1,
- biblio1 => $input->param('biblio1')
+ result => 1,
+ biblio1 => $input->param('biblio1')
);
#-------------------------
my $biblionumber = $input->param('biblionumber');
if (scalar(@biblionumber) != 2) {
- push @errors, "An unexpected number of records was provided for merging. Currently only two records at a time can be merged.";
+ push @errors, { code => "WRONG_COUNT", value => scalar(@biblionumber) };
}
else {
my $data1 = GetBiblioData($biblionumber[0]);
if (@errors) {
# Errors
- my @errors_loop = map{{error => $_}}@errors;
- $template->param( errors => \@errors_loop );
+ $template->param( errors => \@errors );
}
output_html_with_http_headers $input, $cookie, $template->output;
foreach my $field (@fields) {
- my $fieldtag = $field->tag();
- if ($fieldtag < 10) {
- if ($tagslib->{$fieldtag}->{'@'}->{'tab'} >= 0) {
- push @array, {
- field => [
- {
- tag => $fieldtag,
- key => createKey(),
- value => $field->data(),
- }
- ]
- };
- }
- } else {
- my @subfields = $field->subfields();
- my @subfield_array;
- foreach my $subfield (@subfields) {
- if ($tagslib->{$fieldtag}->{@$subfield[0]}->{'tab'} >= 0) {
- push @subfield_array, {
- subtag => @$subfield[0],
- subkey => createKey(),
- value => @$subfield[1],
- };
- }
-
- }
-
- if ($tagslib->{$fieldtag}->{'tab'} >= 0 && $fieldtag ne '995') {
- push @array, {
- field => [
- {
- tag => $fieldtag,
- key => createKey(),
- indicator1 => $field->indicator(1),
- indicator2 => $field->indicator(2),
- subfield => [@subfield_array],
- }
- ]
- };
- }
-
- }
+ my $fieldtag = $field->tag();
+ if ($fieldtag < 10) {
+ if ($tagslib->{$fieldtag}->{'@'}->{'tab'} >= 0) {
+ push @array, {
+ field => [
+ {
+ tag => $fieldtag,
+ key => createKey(),
+ value => $field->data(),
+ }
+ ]
+ };
+ }
+ } else {
+ my @subfields = $field->subfields();
+ my @subfield_array;
+ foreach my $subfield (@subfields) {
+ if ($tagslib->{$fieldtag}->{@$subfield[0]}->{'tab'} >= 0) {
+ push @subfield_array, {
+ subtag => @$subfield[0],
+ subkey => createKey(),
+ value => @$subfield[1],
+ };
+ }
+
+ }
+
+ if ($tagslib->{$fieldtag}->{'tab'} >= 0 && $fieldtag ne '995') {
+ push @array, {
+ field => [
+ {
+ tag => $fieldtag,
+ key => createKey(),
+ indicator1 => $field->indicator(1),
+ indicator2 => $field->indicator(2),
+ subfield => [@subfield_array],
+ }
+ ]
+ };
+ }
+
+ }
}
return [@array];
return int(rand(1000000));
}
-
-
# having CGI parse the POST request
my %cookies = fetch CGI::Cookie;
-my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => '1' });
+my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' });
if ($auth_status ne "ok") {
my $reply = CGI->new("");
print $reply->header(-type => 'text/html');
my $defaultval = Field008();
sub plugin_parameters {
- my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
- return "";
+ my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+ return "";
}
sub plugin_javascript {
- my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
- my $function_name= $field_number;
- my $res="
+ my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+ my $function_name= $field_number;
+ my $res="
<script type=\"text/javascript\">
//<![CDATA[
function Focus$function_name(subfield_managed) {
if (!document.getElementById(\"$field_number\").value) {
- var authtype=document.forms['f'].elements['authtypecode'].value;
- var fieldval='$dateentered$defaultval';
- if(authtype && (authtype == 'TOPIC_TERM' || authtype == 'GENRE/FORM' || authtype == 'CHRON_TERM')) {
- fieldval= fieldval.substr(0,14)+'b'+fieldval.substr(15);
- }
+ var authtype=document.forms['f'].elements['authtypecode'].value;
+ var fieldval='$dateentered$defaultval';
+ if(authtype && (authtype == 'TOPIC_TERM' || authtype == 'GENRE/FORM' || authtype == 'CHRON_TERM')) {
+ fieldval= fieldval.substr(0,14)+'b'+fieldval.substr(15);
+ }
document.getElementById(\"$field_number\").value=fieldval;
}
return 1;
}
function Blur$function_name(subfield_managed) {
- return 1;
+ return 1;
}
function Clic$function_name(i) {
- var authtype=document.forms['f'].elements['authtypecode'].value;
- defaultvalue=document.getElementById(\"$field_number\").value;
- newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=$field_number&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+ var authtype=document.forms['f'].elements['authtypecode'].value;
+ defaultvalue=document.getElementById(\"$field_number\").value;
+ newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=$field_number&result=\"+defaultvalue+\"&authtypecode=\"+authtype,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
}
//]]>
</script>
";
- return ($function_name,$res);
+ return ($function_name,$res);
}
sub plugin {
- my ($input) = @_;
- my $index= $input->param('index');
- my $result= $input->param('result');
- my $authtype= $input->param('authtypecode')||'';
- substr($defaultval,14-6,1)='b' if $authtype=~ /TOPIC_TERM|GENRE.FORM|CHRON_TERM/;
+ my ($input) = @_;
+ my $index= $input->param('index');
+ my $result= $input->param('result');
+ my $authtype= $input->param('authtypecode')||'';
+ substr($defaultval,14-6,1)='b' if $authtype=~ /TOPIC_TERM|GENRE.FORM|CHRON_TERM/;
- my $dbh = C4::Context->dbh;
+ my $dbh = C4::Context->dbh;
- my ($template, $loggedinuser, $cookie)
+ my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "cataloguing/value_builder/marc21_field_008_authorities.tmpl",
- query => $input,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {editcatalogue => '*'},
- debug => 1,
- });
- $result = "$dateentered$defaultval" unless $result;
- my $f1 = substr($result,0,6);
- my $f6 = substr($result,6,1);
- my $f7 = substr($result,7,1);
- my $f8 = substr($result,8,1);
- my $f9 = substr($result,9,1);
- my $f10 = substr($result,10,1);
- my $f11 = substr($result,11,1);
- my $f12 = substr($result,12,1);
- my $f13 = substr($result,13,1);
- my $f14 = substr($result,14,1);
- my $f15 = substr($result,15,1);
- my $f16 = substr($result,16,1);
- my $f17 = substr($result,17,1);
- my $f28 = substr($result,28,1);
- my $f29 = substr($result,29,1);
- my $f31 = substr($result,31,1);
- my $f32 = substr($result,32,1);
- my $f33 = substr($result,33,1);
- my $f38 = substr($result,38,1);
- my $f39 = substr($result,39,1);
-
-if ((!$f1) ||($f1 =~ m/ /)){
- $f1=$dateentered;
-}
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {editcatalogue => '*'},
+ debug => 1,
+ });
+ $result = "$dateentered$defaultval" unless $result;
+ my @f;
+ for(0,6..17,28,29,31..33,38,39) {
+ $f[$_]=substr($result,$_,$_==0?6:1);
+ }
+ $template->param(index => $index);
+
+ $f[0]= $dateentered if !$f[0] || $f[0]=~/\s/;
+ $template->param(f1 => $f[0]);
- $template->param( index => $index,
- f1 => $f1,
- f6 => $f6,
- "f6$f6" => $f6,
- f7 => $f7,
- "f7$f7" => $f7,
- f8 => $f8,
- "f8$f8" => $f8,
- f9 => $f9,
- "f9$f9" => $f9,
- f10 => $f10,
- "f10$f10" => $f10,
- f11 => $f11,
- "f11$f11" => $f11,
- f12 => $f12,
- "f12$f12" => $f12,
- f13 => $f13,
- "f13$f13" => $f13,
- f14 => $f14,
- "f14$f14" => $f14,
- f15 => $f15,
- "f15$f15" => $f15,
- f16 => $f16,
- "f16$f16" => $f16,
- f17 => $f17,
- "f17$f17" => $f17,
- f28 => $f28,
- "f28$f28" => $f28,
- f29 => $f29,
- "f29$f29" => $f29,
- f31 => $f31,
- "f31$f31" => $f31,
- f32 => $f32,
- "f32$f32" => $f32,
- f33 => $f33,
- "f33$f33" => $f33,
- f38 => $f38,
- "f38$f38" => $f38,
- f39 => $f39,
- "f39$f39" => $f39,
- );
- output_html_with_http_headers $input, $cookie, $template->output;
+ for(6..17,28,29,31..33,38,39) {
+ $template->param(
+ "f$_" => $f[$_],
+ "f$_".($f[$_] eq '|'? 'pipe': $f[$_]) => $f[$_],
+ );
+ }
+ output_html_with_http_headers $input, $cookie, $template->output;
}
sub Field008 {
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright Biblibre 2007 - CILEA 2011
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+
+use CGI;
+use C4::Output;
+use C4::Context;
+use C4::Search;
+use C4::Auth;
+use C4::Output;
+
+use C4::Biblio;
+use C4::Koha;
+use MARC::Record;
+use C4::Branch;
+use C4::ItemType;
+
+sub plugin_parameters {
+ my ( $dbh, $record, $tagslib, $i, $tabloop ) = @_;
+ return "";
+}
+
+sub plugin_javascript {
+ my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
+ my $function_name = $field_number;
+ my $res = "
+ <script type='text/javascript'>
+ function Focus$function_name(subfield_managed) {
+ return 1;
+ }
+
+ function Blur$function_name(subfield_managed) {
+ return 1;
+ }
+
+ function Clic$function_name(i) {
+ defaultvalue=document.getElementById(\"$field_number\").value;
+ window.open(\"/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=\" + i + \"&result=\"+defaultvalue,\"marc21_field_7\"+i+\"\",'width=900,height=700,toolbar=false,scrollbars=yes');
+
+ }
+ </script>
+ ";
+
+ return ( $function_name, $res );
+}
+
+# sub plugin
+#
+# input arg :
+# -- op could be equals to
+# * fillinput :
+# * do_search :
+#
+
+sub plugin {
+ my ($input) = @_;
+ my $dbh = C4::Context->dbh;
+ my $query = new CGI;
+ my $op = $query->param('op');
+ my $type = $query->param('type');
+ my $startfrom = $query->param('startfrom');
+ $startfrom = 0 if ( !defined $startfrom );
+ my ( $template, $loggedinuser, $cookie );
+ my $resultsperpage;
+ my $searchdesc;
+
+ if ( $op eq "fillinput" ) {
+ my $biblionumber = $query->param('biblionumber');
+ my $index = $query->param('index');
+ my $marcrecord;
+
+ # open template
+ ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name =>
+ "cataloguing/value_builder/marc21_linking_section.tt",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { editcatalogue => '*' },
+ debug => 1,
+ }
+ );
+
+ #get marc record
+ $marcrecord = GetMarcBiblio($biblionumber);
+
+ my $subfield_value_9 = $biblionumber;
+ my $subfield_value_0 = $biblionumber;
+
+ #my $subfield_value_0;
+ #$subfield_value_0 = $marcrecord->field('001')->data
+ # if $marcrecord->field('001');
+ my $subfield_value_w;
+ if ( $marcrecord->field('001') ) {
+ $subfield_value_w = $marcrecord->field('001')->data;
+ }
+ else {
+ $subfield_value_w = $biblionumber;
+ }
+
+ my $subfield_value_a;
+ my $subfield_value_c;
+ my $subfield_value_d;
+ my $subfield_value_e;
+
+ my $subfield_value_h;
+
+ my $subfield_value_i;
+
+ my $subfield_value_p;
+
+ my $subfield_value_t;
+ if ( $marcrecord->field('245') ) {
+ $subfield_value_t = $marcrecord->title();
+ }
+
+ my $subfield_value_u;
+ my $subfield_value_v;
+ my $subfield_value_x;
+ my $subfield_value_y;
+ my $subfield_value_z;
+
+ $subfield_value_x = $marcrecord->field('022')->subfield("a")
+ if ( $marcrecord->field('022') );
+ $subfield_value_z = $marcrecord->field('020')->subfield("a")
+ if ( $marcrecord->field('020') );
+
+ # escape the 's
+ $subfield_value_9 =~ s/'/\\'/g;
+ $subfield_value_0 =~ s/'/\\'/g;
+ $subfield_value_a =~ s/'/\\'/g;
+ $subfield_value_c =~ s/'/\\'/g;
+ $subfield_value_d =~ s/'/\\'/g;
+ $subfield_value_e =~ s/'/\\'/g;
+ $subfield_value_h =~ s/'/\\'/g;
+ $subfield_value_i =~ s/'/\\'/g;
+ $subfield_value_p =~ s/'/\\'/g;
+ $subfield_value_t =~ s/'/\\'/g;
+ $subfield_value_u =~ s/'/\\'/g;
+ $subfield_value_v =~ s/'/\\'/g;
+ $subfield_value_w =~ s/'/\\'/g;
+ $subfield_value_x =~ s/'/\\'/g;
+ $subfield_value_y =~ s/'/\\'/g;
+ $subfield_value_z =~ s/'/\\'/g;
+ $template->param(
+ fillinput => 1,
+ index => $query->param('index') . "",
+ biblionumber => $biblionumber ? $biblionumber : "",
+ subfield_value_9 => "$subfield_value_9",
+ subfield_value_0 => "$subfield_value_0",
+ subfield_value_a => "$subfield_value_a",
+ subfield_value_c => "$subfield_value_c",
+ subfield_value_d => "$subfield_value_d",
+ subfield_value_e => "$subfield_value_e",
+ subfield_value_h => "$subfield_value_h",
+ subfield_value_i => "$subfield_value_i",
+ subfield_value_p => "$subfield_value_p",
+ subfield_value_t => "$subfield_value_t",
+ subfield_value_u => "$subfield_value_u",
+ subfield_value_v => "$subfield_value_v",
+ subfield_value_w => "$subfield_value_w",
+ subfield_value_x => "$subfield_value_x",
+ subfield_value_y => "$subfield_value_y",
+ subfield_value_z => "$subfield_value_z",
+ );
+###############################################################
+ }
+ elsif ( $op eq "do_search" ) {
+ my $search = $query->param('search');
+ my $itype = $query->param('itype');
+ my $startfrom = $query->param('startfrom');
+ my $resultsperpage = $query->param('resultsperpage') || 20;
+ my $orderby;
+ $search = 'kw,wrdl=' . $search . ' and mc-itemtype=' . $itype if $itype;
+ my ( $errors, $results, $total_hits ) =
+ SimpleSearch( $search, $startfrom * $resultsperpage,
+ $resultsperpage );
+ if ( defined $errors ) {
+ $results = [];
+ }
+ my $total = @{$results};
+
+ # warn " biblio count : ".$total;
+
+ ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name =>
+ "cataloguing/value_builder/marc21_linking_section.tt",
+ query => $query,
+ type => 'intranet',
+ authnotrequired => 0,
+ debug => 1,
+ }
+ );
+
+ # multi page display gestion
+ my $displaynext = 0;
+ my $displayprev = $startfrom;
+
+ if ( ( $total_hits - ( ( $startfrom + 1 ) * ($resultsperpage) ) ) > 0 )
+ {
+ $displaynext = 1;
+ }
+ my @arrayresults;
+ my @field_data = ($search);
+ for ( my $i = 0 ; $i < $resultsperpage ; $i++ ) {
+ my $record = MARC::Record::new_from_usmarc( $results->[$i] );
+ my $rechash = TransformMarcToKoha( $dbh, $record );
+ my $pos;
+ my $countitems = $rechash->{itembumber} ? 1 : 0;
+ while ( index( $rechash->{itemnumber}, '|', $pos ) > 0 ) {
+ $countitems += 1;
+ $pos = index( $rechash->{itemnumber}, '|', $pos ) + 1;
+ }
+ $rechash->{totitem} = $countitems;
+ my @holdingbranches = split /\|/, $rechash->{holdingbranch};
+ my @itemcallnumbers = split /\|/, $rechash->{itemcallnumber};
+ my $CN;
+ for ( my $i = 0 ; $i < @holdingbranches ; $i++ ) {
+ $CN .=
+ $holdingbranches[$i] . " ( " . $itemcallnumbers[$i] . " ) |";
+ }
+ $CN =~ s/ \|$//;
+ $rechash->{CN} = $CN;
+ push @arrayresults, $rechash;
+ }
+
+ # for(my $i = 0 ; $i <= $#marclist ; $i++)
+ # {
+ # push @field_data, { term => "marclist", val=>$marclist[$i] };
+ # push @field_data, { term => "and_or", val=>$and_or[$i] };
+ # push @field_data, { term => "excluding", val=>$excluding[$i] };
+ # push @field_data, { term => "operator", val=>$operator[$i] };
+ # push @field_data, { term => "value", val=>$value[$i] };
+ # }
+
+ my @numbers = ();
+
+ if ( $total > $resultsperpage ) {
+ for ( my $i = 1 ; $i < $total / $resultsperpage + 1 ; $i++ ) {
+ if ( $i < 16 ) {
+ my $highlight = 0;
+ ( $startfrom == ( $i - 1 ) ) && ( $highlight = 1 );
+ push @numbers,
+ {
+ number => $i,
+ highlight => $highlight,
+ searchdata => \@field_data,
+ startfrom => ( $i - 1 )
+ };
+ }
+ }
+ }
+
+ my $from = $startfrom * $resultsperpage + 1;
+ my $to;
+
+ if ( $total_hits < $from + $resultsperpage ) {
+ $to = $total_hits;
+ }
+ else {
+ $to = $from + $resultsperpage;
+ }
+ my $defaultview =
+ 'BiblioDefaultView' . C4::Context->preference('BiblioDefaultView');
+
+# my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search";
+# foreach my $sort (@sort_by){
+# $link.="&sort_by=".$sort."&";
+# }
+# $template->param(
+# pagination_bar => pagination_bar(
+# $link,
+# getnbpages($hits, $results_per_page),
+# $page,
+# 'page'
+# ),
+# );
+ $template->param(
+ result => \@arrayresults,
+ index => $query->param('index') . "",
+ startfrom => $startfrom,
+ displaynext => $displaynext,
+ displayprev => $displayprev,
+ resultsperpage => $resultsperpage,
+ orderby => $orderby,
+ startfromnext => $startfrom + 1,
+ startfromprev => $startfrom - 1,
+ searchdata => \@field_data,
+ total => $total_hits,
+ from => $from,
+ to => $to,
+ numbers => \@numbers,
+ search => $search,
+ $defaultview => 1,
+ Search => 0
+ );
+
+ }
+ else {
+ ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name =>
+ "cataloguing/value_builder/marc21_linking_section.tt",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ }
+ );
+
+ my $sth = $dbh->prepare(
+ "Select itemtype,description from itemtypes order by description");
+ $sth->execute;
+ my @itemtype;
+ my %itemtypes;
+ push @itemtype, "";
+ $itemtypes{''} = "";
+ while ( my ( $value, $lib ) = $sth->fetchrow_array ) {
+ push @itemtype, $value;
+ $itemtypes{$value} = $lib;
+ }
+
+ my $CGIitemtype = CGI::scrolling_list(
+ -name => 'value',
+ -values => \@itemtype,
+ -labels => \%itemtypes,
+ -size => 1,
+ -multiple => 0
+ );
+ $sth->finish;
+
+ my @branchloop;
+ my @select_branch;
+ my %select_branches;
+ my $branches = GetBranches;
+ push @select_branch, "";
+ $select_branches{''} = "";
+ foreach my $thisbranch ( keys %$branches ) {
+ push @select_branch, $branches->{$thisbranch}->{'branchcode'};
+ $select_branches{ $branches->{$thisbranch}->{'branchcode'} } =
+ $branches->{$thisbranch}->{'branchname'};
+ }
+ my $CGIbranch = CGI::scrolling_list(
+ -name => 'value',
+ -values => \@select_branch,
+ -labels => \%select_branches,
+ -size => 1,
+ -multiple => 0
+ );
+ $sth->finish;
+
+ my $req = $dbh->prepare(
+"select distinctrow left(publishercode,45) from biblioitems order by publishercode"
+ );
+ $req->execute;
+ my @select;
+ push @select, "";
+ while ( my ($value) = $req->fetchrow ) {
+ push @select, $value;
+ }
+ my $CGIpublisher = CGI::scrolling_list(
+ -name => 'value',
+ -id => 'publisher',
+ -values => \@select,
+ -size => 1,
+ -multiple => 0
+ );
+
+# my $sth=$dbh->prepare("select description,itemtype from itemtypes order by description");
+# $sth->execute;
+# while (my ($description,$itemtype) = $sth->fetchrow) {
+# $classlist.="<option value=\"$itemtype\">$description</option>\n";
+# }
+# $sth->finish;
+
+ my @itemtypes = C4::ItemType->all;
+
+ $template->param( #classlist => $classlist,
+ CGIitemtype => $CGIitemtype,
+ CGIbranch => $CGIbranch,
+ CGIPublisher => $CGIpublisher,
+ itypeloop => \@itemtypes,
+ index => $query->param('index'),
+ Search => 1,
+ );
+ }
+ output_html_with_http_headers $query, $cookie, $template->output;
+}
+
+1;
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright 2012 BibLibre SARL
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+use C4::Auth;
+use CGI;
+use C4::Context;
+
+=head1 DESCRIPTION
+
+This plugin is based on authorised values INVENTORY.
+It is used for stocknumber computation.
+
+If the user send an empty string, we return a simple incremented stocknumber.
+If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented.
+In this case, a stocknumber has this form : "PREFIX 0009678570".
+ - PREFIX is an upercase word
+ - a space separator
+ - 10 digits, with leading 0s if needed
+
+=cut
+
+sub plugin_parameters {
+}
+
+sub plugin_javascript {
+ my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+ my $res = qq{
+ <script type='text/javascript'>
+ function Focus$field_number() {
+ return 1;
+ }
+
+ function Blur$field_number() {
+ return 1;
+ }
+
+ function Clic$field_number() {
+ var code = document.getElementById('$field_number');
+ \$.ajax({
+ url: '/cgi-bin/koha/cataloguing/plugin_launcher.pl',
+ type: 'POST',
+ data: {
+ 'plugin_name': 'stocknumberAV.pl',
+ 'code' : code.value,
+ },
+ success: function(data){
+ var field = document.getElementById('$field_number');
+ field.value = data;
+ return 1;
+ }
+ });
+ }
+ </script>
+ };
+
+ return ($field_number,$res);
+}
+
+sub plugin {
+ my ($input) = @_;
+ my $code = $input->param('code');
+
+ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ { template_name => "cataloguing/value_builder/ajax.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { editcatalogue => '*' },
+ debug => 1,
+ }
+ );
+
+ my $dbh = C4::Context->dbh;
+
+ # If a prefix is submited, we look for the highest stocknumber with this prefix, and return it incremented
+ $code =~ s/ *$//g;
+ if ( $code =~ m/^[A-Z]+$/ ) {
+ my $sth = $dbh->prepare("SELECT lib FROM authorised_values WHERE category='INVENTORY' AND authorised_value=?");
+ $sth->execute( $code);
+
+ if ( my $valeur = $sth->fetchrow ) {
+ $template->param( return => $code . ' ' . sprintf( '%010s', ( $valeur + 1 ) ), );
+ my $sth2 = $dbh->prepare("UPDATE authorised_values SET lib=? WHERE category='INVENTORY' AND authorised_value=?");
+ $sth2->execute($valeur+1,$code);
+ } else {
+ $template->param( return => "There is no defined value for $code");
+ }
+ # The user entered a custom value, we don't touch it, this could be handled in js
+ } else {
+ $template->param( return => $code, );
+ }
+
+ output_html_with_http_headers $input, $cookie, $template->output;
+}
+
+1;
my $srchany = $input->param('srchany');
my $random = $input->param('random') || rand(1000000000); # this var is not useful anymore just kept for rel2_2 compatibility
my $op = $input->param('op');
+
+my $page = $input->param('current_page') || 1;
+$page = $input->param('goto_page') if $input->param('changepage_goto');
+my $show_next = 0;
+my $total_pages = 0;
+
my $numberpending;
my $attr = '';
my $term;
});
$template->param( frameworkcode => $frameworkcode, );
+$template->param(
+ isbn => $isbn,
+ issn => $issn,
+ lccn => $lccn,
+ lccall => $lccall,
+ title => $title,
+ author => $author,
+ controlnumber=> $controlnumber,
+ stdid => $stdid,
+ srchany => $srchany,
+ biblionumber => $biblionumber,
+ dewey => $dewey,
+ subject => $subject,
+);
if ( $op ne "do_search" ) {
my $sth = $dbh->prepare("SELECT id,host,name,checked FROM z3950servers ORDER BY rank, name");
$sth->execute();
my $serverloop = $sth->fetchall_arrayref( {} );
$template->param(
- isbn => $isbn,
- issn => $issn,
- lccn => $lccn,
- lccall => $lccall,
- title => $title,
- author => $author,
- controlnumber=> $controlnumber,
- stdid => $stdid,
- srchany => $srchany,
serverloop => $serverloop,
opsearch => "search",
- biblionumber => $biblionumber,
);
output_html_with_http_headers $input, $cookie, $template->output;
}
my $numresults = $oResult[$k]->size();
my $i;
my $result = '';
- if ( $numresults > 0 ) {
- for ($i = 0; $i < (($numresults < 20) ? $numresults : 20); $i++) {
+ if ( $numresults > 0 and $numresults >= (($page-1)*20)) {
+ $show_next = 1 if $numresults >= ($page*20);
+ $total_pages = int($numresults/20)+1 if $total_pages < ($numresults/20);
+ for ($i = ($page-1)*20; $i < (($numresults < ($page*20)) ? $numresults : ($page*20)); $i++) {
my $rec = $oResult[$k]->record($i);
if ($rec) {
my $marcrecord;
## In HEAD i change everything to UTF-8
# In rel2_2 i am not sure what encoding is so no character conversion is done here
##Add necessary encoding changes to here -TG
+
+ # Normalize the record so it doesn't have separated diacritics
+ SetUTF8Flag($marcrecord);
+
my $oldbiblio = TransformMarcToKoha( $dbh, $marcrecord, "" );
$oldbiblio->{isbn} =~ s/ |-|\.//g if $oldbiblio->{isbn};
# pad | and ( with spaces to allow line breaks in the HTML
}
} # if $k !=0
$numberpending = $nremaining - 1;
+
+ my @servers = ();
+ foreach my $id (@id) {
+ push(@servers,{id => $id});
+ }
+
$template->param(
breeding_loop => \@breeding_loop,
server => $servername[$k],
numberpending => $numberpending,
biblionumber => $biblionumber,
- errconn => \@errconn
+ errconn => \@errconn,
+ current_page => $page,
+ servers => \@servers,
+ total_pages => $total_pages,
);
+ $template->param(show_nextbutton=>1) if $show_next;
+ $template->param(show_prevbutton=>1) if $page != 1;
output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0;
our %renew_failed = {};
for (@failedrenews) { $renew_failed{$_} = 1; }
+my @failedreturns = $query->param('failedreturn');
+our %return_failed = {};
+for (@failedreturns) { $return_failed{$_} = 1; }
+
my $findborrower = $query->param('findborrower');
$findborrower =~ s|,| |g;
my $borrowernumber = $query->param('borrowernumber');
$it->{'od'} = $it->{'overdue'};
($it->{'author'} eq '') and $it->{'author'} = ' ';
$it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}};
+ $it->{'return_failed'} = $return_failed{$it->{'barcode'}};
- if ( $it->{'issuedate'} gt $todaysdate or $it->{'lastreneweddate'} gt $todaysdate ) {
+ if ( $it->{'issuedate'}."" gt $todaysdate or $it->{'lastreneweddate'} gt $todaysdate ) {
(!$relatives) ? push @todaysissues, $it : push @relissues, $it;
} else {
(!$relatives) ? push @previousissues, $it : push @relprevissues, $it;
my $input = new CGI;
my $startdate=$input->param('from');
my $enddate=$input->param('to');
-my $run_report=$input->param('run_report');
+my $run_report = ( not defined $input->param('run_report') ) ? 1 : $input->param('run_report');
my $theme = $input->param('theme'); # only used if allowthemeoverride is set
my $todaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", $year, $month, $day);
my $yesterdaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -1));
# changed from delivered range of 10 years-yesterday to 2 days ago-today
-# Find two days ago for the default shelf pull start and end dates
-my $pastdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -2));
+# Find two days ago for the default shelf pull start and end dates, unless HoldsToPullStartDate sys pref is set.
+my $defaultstartdate = ( C4::Context->preference('HoldsToPullStartDate') ) ? "-".C4::Context->preference('HoldsToPullStartDate') : -2;
+my $pastdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, $defaultstartdate));
# Predefine the start and end dates if they are not already defined
$startdate =~ s/^\s+//;
push(
@reservedata,
{
- reservedate => format_date( $data->{l_reservedate} ),
- priority => $data->{priority},
- name => $data->{l_patron},
- title => $data->{title},
- author => $data->{author},
- borrowernumber => $data->{borrowernumber},
- itemnum => $data->{itemnumber},
- phone => $data->{phone},
- email => $data->{email},
- biblionumber => $data->{biblionumber},
- statusw => ( $data->{found} eq "W" ),
- statusf => ( $data->{found} eq "F" ),
- holdingbranch => $data->{l_holdingbranch},
- branch => $data->{l_branch},
- itemcallnumber => $data->{l_itemcallnumber},
- enumchron => $data->{l_enumchron},
- copyno => $data->{l_copynumber},
- notes => $data->{notes},
- notificationdate => $data->{notificationdate},
- reminderdate => $data->{reminderdate},
- count => $data->{icount},
- rcount => $data->{rcount},
- pullcount => $data->{icount} <= $data->{rcount} ? $data->{icount} : $data->{rcount},
- itype => $data->{l_itype},
- location => $data->{l_location}
+ reservedate => format_date( $data->{l_reservedate} ),
+ priority => $data->{priority},
+ name => $data->{l_patron},
+ title => $data->{title},
+ author => $data->{author},
+ borrowernumber => $data->{borrowernumber},
+ itemnum => $data->{itemnumber},
+ phone => $data->{phone},
+ email => $data->{email},
+ biblionumber => $data->{biblionumber},
+ statusw => ( $data->{found} eq "W" ),
+ statusf => ( $data->{found} eq "F" ),
+ holdingbranch => $data->{l_holdingbranch},
+ branch => $data->{l_branch},
+ itemcallnumber => $data->{l_itemcallnumber},
+ enumchron => $data->{l_enumchron},
+ copyno => $data->{l_copynumber},
+ notes => $data->{notes},
+ notificationdate=> $data->{notificationdate},
+ reminderdate => $data->{reminderdate},
+ count => $data->{icount},
+ rcount => $data->{rcount},
+ pullcount => $data->{icount} <= $data->{rcount} ? $data->{icount} : $data->{rcount},
+ itype => $data->{l_itype},
+ location => $data->{l_location},
}
);
}
}
$template->param(
- todaysdate => format_date($todaysdate),
+ todaysdate => format_date($todaysdate),
from => $startdate,
- to => $enddate,
+ to => $enddate,
run_report => $run_report,
- reserveloop => \@reservedata,
+ reserveloop => \@reservedata,
"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
- DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
- dateformat => C4::Context->preference("dateformat"),
+ DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
+ dateformat => C4::Context->preference("dateformat"),
+ HoldsToPullStartDate => (C4::Context->preference('HoldsToPullStartDate')?C4::Context->preference('HoldsToPullStartDate'):2),
);
output_html_with_http_headers $input, $cookie, $template->output;
$input{duedate} = 0;
$returneditems{0} = $barcode;
$riduedate{0} = 0;
- if ( $messages->{'wthdrawn'} ) {
- $input{withdrawn} = 1;
- $input{borrowernumber} = 'Item Cancelled'; # FIXME: should be in display layer ?
- $riborrowernumber{0} = 'Item Cancelled';
- }
- else {
- $input{borrowernumber} = ' '; # This seems clearly bogus.
- $riborrowernumber{0} = ' ';
- }
push( @inputloop, \%input );
}
}
}
elsif ( $code eq 'wthdrawn' ) {
$err{withdrawn} = 1;
- $exit_required_p = 1;
+ $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems");
}
elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) {
if ( $messages->{'IsPermanent'} ne $userenv_branch ) {
dropboxdate => output_pref($dropboxdate),
overduecharges => $overduecharges,
soundon => C4::Context->preference("SoundOn"),
+ BlockReturnOfWithdrawnItems => C4::Context->preference("BlockReturnOfWithdrawnItems"),
);
### Comment out rotating collections for now to allow it a little more time to bake
rm -r $(TMP)/var/run
rm -r $(TMP)/var/lock
rm $(TMP)/var/log/koha/README
+ rm $(TMP)/etc/koha/searchengine/solr/config.yaml
+ rm $(TMP)/etc/koha/searchengine/solr/indexes.yaml
+ rm $(TMP)/etc/koha/solr/indexes.yaml
# rm $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/jquery/jquery.js
# ln -s /usr/share/javascript/jquery/jquery.js \
# $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/jquery/jquery.js
# $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/jquery/jquery.js
rm -r \
$(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce
+ mkdir -p $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce/jscripts
ln -s /usr/share/tinymce2/www \
- $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce
+ $(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/js/tinymce/jscripts/tiny_mce
rm -r \
$(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/yui
ln -s /usr/share/javascript/yui \
$(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/lib/yui
rm -r \
- $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/yui
+ $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/lib/yui
ln -s /usr/share/javascript/yui \
- $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/lib/yui
+ $(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/lib/yui
install -d $(TMP)/etc/apache2/sites-available
install -d $(TMP)/etc/apache2/sites-enabled
install -d $(TMP)/etc/apache2/conf.d
sed -i $(TMP)/usr/share/koha/koha-conf.xml.in \
-e '/^ <user>/s/>.*</>_DBC_DBUSER_</' \
-e '/^ <pass>/s/>.*</>_DBC_DBPASS_</'
- install -m 0644 koha-tmpl/opac-tmpl/prog/en/lib/yui/skin.css \
- koha-tmpl/opac-tmpl/prog/en/lib/yui/reset-fonts-grids.css \
+ install -m 0644 koha-tmpl/opac-tmpl/lib/yui/skin.css \
+ koha-tmpl/opac-tmpl/lib/yui/reset-fonts-grids.css \
$(TMP)/usr/share/koha/intranet/htdocs/intranet-tmpl/prog/en/css
- install -m 0644 koha-tmpl/opac-tmpl/prog/en/lib/yui/skin.css \
- koha-tmpl/opac-tmpl/prog/en/lib/yui/reset-fonts-grids.css \
+ install -m 0644 koha-tmpl/opac-tmpl/lib/yui/skin.css \
+ koha-tmpl/opac-tmpl/lib/yui/reset-fonts-grids.css \
$(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css
install -m 0644 koha-tmpl/intranet-tmpl/prog/en/lib/yui/menu-button-arrow-disabled.png \
$(TMP)/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/css
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
-September 3 2012 Kathryn Tyree becomes the 189th developer to have a patch pushed
+August 22 2012 Koha 3.8.4 released releases
+August 22 2012 Koha 3.6.8 released releases
+September 3 2012 Kathryn Tyree becomes the 189th developer to have a patch pushed
+September 11 2012 Melia Meggs becomes the 190th developer to have a patch pushed
+September 20 2012 Joseph Alway beomes the 191st developer to have a patch pushed
+September 22 2012 Koha 3.8.5 released releases
+September 22 2012 Koha 3.6.8 released releases
+October 13 2012 Ivan Brown becomes the 192nd developer to have a patch pushed
\ No newline at end of file
att 9043 Kind-of-record
att 9046 Record-status
att 9050 Subject-heading-thesaurus
+att 9051 Previous-heading-see-from
# Personal Name
att 1 Personal-name
<kohaidx:index_control_field tag="008" offset="16" length="1">
<kohaidx:target_index>Heading-use-series-added-entry:w</kohaidx:target_index>
</kohaidx:index_control_field>
+
+ <!-- 010 LC Number -->
+ <kohaidx:index_subfields tag="010" subfields="az">
+ <kohaidx:target_index>LC-card-number:w</kohaidx:target_index>
+ <kohaidx:target_index>LC-card-number:p</kohaidx:target_index>
+ </kohaidx:index_subfields>
+
+ <!-- 040 cataloging agencies -->
+ <kohaidx:index_subfields tag="040" subfields="acd">
+ <kohaidx:target_index>Record-source:w</kohaidx:target_index>
+ <kohaidx:target_index>Record-source:p</kohaidx:target_index>
+ </kohaidx:index_subfields>
+
<!-- Personal name headings -->
<kohaidx:index_subfields tag="100" subfields="abcdefghjklmnopqrstvxyz">
<kohaidx:target_index>See-from:p</kohaidx:target_index>
<kohaidx:target_index>See-from:s</kohaidx:target_index>
</kohaidx:index_heading>
+ <kohaidx:index_heading_conditional tag="450" test="substring(marc:subfield[@code='w']/text(), 2, 1)" subfields="abvxyz" subdivisions="vxyz">
+ <kohaidx:target_index>Previous-heading-see-from:p</kohaidx:target_index>
+ </kohaidx:index_heading_conditional>
<kohaidx:index_match_heading tag="450" subfields="abvxyz" subdivisions="vxyz">
<kohaidx:target_index>Match:w</kohaidx:target_index>
<kohaidx:target_index>Match:p</kohaidx:target_index>
<xslo:template match="text()" mode="index_subfields"/>
<xslo:template match="text()" mode="index_data_field"/>
<xslo:template match="text()" mode="index_heading"/>
+ <xslo:template match="text()" mode="index_heading_conditional"/>
<xslo:template match="text()" mode="index_match_heading"/>
<xslo:template match="text()" mode="index_subject_thesaurus"/>
<xslo:template match="/">
<xslo:apply-templates mode="index_subfields"/>
<xslo:apply-templates mode="index_data_field"/>
<xslo:apply-templates mode="index_heading"/>
+ <xslo:apply-templates mode="index_heading_conditional"/>
<xslo:apply-templates mode="index_match_heading"/>
<xslo:apply-templates mode="index_subject_thesaurus"/>
</z:record>
<xslo:value-of select="substring(., 17, 1)"/>
</z:index>
</xslo:template>
+ <xslo:template mode="index_subfields" match="marc:datafield[@tag='010']">
+ <xslo:for-each select="marc:subfield">
+ <xslo:if test="contains('az', @code)">
+ <z:index name="LC-card-number:w LC-card-number:p">
+ <xslo:value-of select="."/>
+ </z:index>
+ </xslo:if>
+ </xslo:for-each>
+ </xslo:template>
+ <xslo:template mode="index_subfields" match="marc:datafield[@tag='040']">
+ <xslo:for-each select="marc:subfield">
+ <xslo:if test="contains('acd', @code)">
+ <z:index name="Record-source:w Record-source:p">
+ <xslo:value-of select="."/>
+ </z:index>
+ </xslo:if>
+ </xslo:for-each>
+ </xslo:template>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='100']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('abcdefghjklmnopqrstvxyz', @code)">
<xslo:value-of select="normalize-space($raw_heading)"/>
</z:index>
</xslo:template>
+ <xslo:template mode="index_heading_conditional" match="marc:datafield[@tag='450']">
+ <xslo:if test="substring(marc:subfield[@code='w']/text(), 2, 1)">
+ <z:index name="Previous-heading-see-from:p">
+ <xslo:variable name="raw_heading">
+ <xslo:for-each select="marc:subfield">
+ <xslo:if test="contains('abvxyz', @code)" name="Previous-heading-see-from:p">
+ <xslo:if test="position() > 1">
+ <xslo:choose>
+ <xslo:when test="contains('vxyz', @code)">
+ <xslo:text>--</xslo:text>
+ </xslo:when>
+ <xslo:otherwise>
+ <xslo:value-of select="substring(' ', 1, 1)"/>
+ </xslo:otherwise>
+ </xslo:choose>
+ </xslo:if>
+ <xslo:value-of select="."/>
+ </xslo:if>
+ </xslo:for-each>
+ </xslo:variable>
+ <xslo:value-of select="normalize-space($raw_heading)"/>
+ </z:index>
+ </xslo:if>
+ </xslo:template>
<xslo:template mode="index_match_heading" match="marc:datafield[@tag='100']">
<z:index name="Match:w Match:p Match-heading:p Match-heading:s">
<xslo:variable name="raw_heading">
</index_data_field>
<!--record.abs line 177: melm 650$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="650" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 178: melm 650 Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="650">
</index_data_field>
<!--record.abs line 179: melm 651$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="651" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 180: melm 651 Name-geographic,Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="651">
</index_data_field>
<!--record.abs line 181: melm 652$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="652" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 183: melm 653$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="653" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 184: melm 653 Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="653">
</index_data_field>
<!--record.abs line 185: melm 654$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="654" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 186: melm 654 Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="654">
</index_data_field>
<!--record.abs line 187: melm 655$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="655" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 188: melm 655 Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="655">
</index_data_field>
<!--record.abs line 189: melm 656$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="656" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 190: melm 656 Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="656">
</index_data_field>
<!--record.abs line 191: melm 657$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="657" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 192: melm 657 Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="657">
</index_data_field>
<!--record.abs line 197: melm 690$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="690" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 198: melm 690 Subject,Subject:p-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="690">
</index_subfields>
<!--record.abs line 211: melm 710$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="710" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 212: melm 710 Author,Author:p,Corporate-name,Name-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="710">
</index_subfields>
<!--record.abs line 216: melm 711$9 Koha-Auth-Number -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="711" subfields="9">
- <target_index>Koha-Auth-Number :w</target_index>
+ <target_index>Koha-Auth-Number:w</target_index>
</index_subfields>
<!--record.abs line 218: melm 711 Author,Author:p,Author-name-corporate,Name,Conference-name-->
<index_data_field xmlns="http://www.koha-community.org/schemas/index-defs" tag="711">
<xslo:template mode="index_subfields" match="marc:datafield[@tag='650']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='651']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='652']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='653']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='654']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='655']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='656']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='657']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
<xslo:template mode="index_subfields" match="marc:datafield[@tag='690']">
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
</xslo:for-each>
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
</xslo:for-each>
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('9', @code)">
- <z:index name="Koha-Auth-Number :w">
+ <z:index name="Koha-Auth-Number:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
</xslo:for-each>
<xslo:for-each select="marc:subfield">
<xslo:if test="contains('3', @code)">
- <z:index name="materials-specified :w">
+ <z:index name="materials-specified:w">
<xslo:value-of select="."/>
</z:index>
</xslo:if>
melm 630$r Music-key,Subject,Subject:p
melm 630$9 Koha-Auth-Number
melm 630 Subject,Subject:p
-melm 650$9 Koha-Auth-Number
+melm 650$9 Koha-Auth-Number
melm 650 Subject,Subject:p
-melm 651$9 Koha-Auth-Number
+melm 651$9 Koha-Auth-Number
melm 651 Name-geographic,Subject,Subject:p
-melm 652$9 Koha-Auth-Number
+melm 652$9 Koha-Auth-Number
#melm 652 subject-heading,subject-heading:p
-melm 653$9 Koha-Auth-Number
+melm 653$9 Koha-Auth-Number
melm 653 Subject,Subject:p
-melm 654$9 Koha-Auth-Number
+melm 654$9 Koha-Auth-Number
melm 654 Subject,Subject:p
-melm 655$9 Koha-Auth-Number
+melm 655$9 Koha-Auth-Number
melm 655 Subject,Subject:p
-melm 656$9 Koha-Auth-Number
+melm 656$9 Koha-Auth-Number
melm 656 Subject,Subject:p
-melm 657$9 Koha-Auth-Number
+melm 657$9 Koha-Auth-Number
melm 657 Subject,Subject:p
-melm 658$a curriculum:w,curriculum:p,Subject,Subject:p
-melm 658$b curriculum:w,curriculum:p,Subject,Subject:p
-melm 658$c curriculum:w,curriculum:p,Subject,Subject:p
+melm 658$a curriculum:w,curriculum:p,Subject,Subject:p
+melm 658$b curriculum:w,curriculum:p,Subject,Subject:p
+melm 658$c curriculum:w,curriculum:p,Subject,Subject:p
melm 658 Subject,Subject:p
-melm 690$9 Koha-Auth-Number
+melm 690$9 Koha-Auth-Number
melm 690 Subject,Subject:p
melm 700$9 Cross-Reference,Koha-Auth-Number
melm 710$t Author-title,Name-and-title,Title,Title-uniform
#melm 710$a author,author:p,Name-and-title
melm 710$a Name-and-title
-melm 710$9 Koha-Auth-Number
+melm 710$9 Koha-Auth-Number
melm 710 Author,Author:p,Corporate-name,Name
melm 711$a Name-and-title
#melm 711$t author,Author-title,Title,Title-uniform
melm 711$t Author-title,Title,Title-uniform
-melm 711$9 Koha-Auth-Number
+melm 711$9 Koha-Auth-Number
#melm 711 author,Author-name-corporate,Name,Conference-name
melm 711 Author,Author:p,Author-name-corporate,Name,Conference-name
melm 730$n Thematic-number
melm 952$0 withdrawn:n,withdrawn:w
melm 952$1 lost,lost:n
melm 952$2 classification-source
-melm 952$3 materials-specified
+melm 952$3 materials-specified
melm 952$4 damaged:n,damaged:w
melm 952$5 restricted:n,restricted:w
melm 952$6 cn-sort:n,cn-sort:s
<!--record.abs line 142: melm 225$e Title-series,Title-series:p -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="225" subfields="e">
<target_index>Title-series:w</target_index>
- <target_index>Title-series:p </target_index>
+ <target_index>Title-series:p</target_index>
</index_subfields>
<!--record.abs line 144: melm 225$f Author,Author:p,Name-and-title,Name-and-title:p-->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="225" subfields="f">
<!--record.abs line 146: melm 225$h Title-series,Title-series:p -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="225" subfields="h">
<target_index>Title-series:w</target_index>
- <target_index>Title-series:p </target_index>
+ <target_index>Title-series:p</target_index>
</index_subfields>
<!--record.abs line 148: melm 225$i Title-series,Title-series:p -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="225" subfields="i">
<target_index>Title-series:w</target_index>
- <target_index>Title-series:p </target_index>
+ <target_index>Title-series:p</target_index>
</index_subfields>
<!--record.abs line 150: melm 225$v Title-series,Title-series:p -->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="225" subfields="v">
<target_index>Title-series:w</target_index>
- <target_index>Title-series:p </target_index>
+ <target_index>Title-series:p</target_index>
</index_subfields>
<!--record.abs line 151: melm 225$x ISSN-->
<index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="225" subfields="x">
#Series
melm 225$a Title-series,Title-series:p
melm 225$d Title-series,Title-series:p
-#SubTitle
-melm 225$e Title-series,Title-series:p
+#SubTit
+melm 225$e Title-series,Title-series:p
#Authors
melm 225$f Author,Author:p,Name-and-title,Name-and-title:p
#Part-Title
-melm 225$h Title-series,Title-series:p
+melm 225$h Title-series,Title-series:p
#Part Number
-melm 225$i Title-series,Title-series:p
+melm 225$i Title-series,Title-series:p
#Volume
-melm 225$v Title-series,Title-series:p
+melm 225$v Title-series,Title-series:p
melm 225$x ISSN
melm 230$a Electronic-ressource
<xsl:key name="index_subfields_tag" match="kohaidx:index_subfields" use="@tag"/>
<xsl:key name="index_heading_tag" match="kohaidx:index_heading" use="@tag"/>
<xsl:key name="index_data_field_tag" match="kohaidx:index_data_field" use="@tag"/>
+ <xsl:key name="index_heading_conditional_tag" match="kohaidx:index_heading_conditional" use="@tag"/>
<xsl:key name="index_match_heading_tag" match="kohaidx:index_match_heading" use="@tag"/>
<xsl:template match="kohaidx:index_defs">
<xslo:template match="text()" mode="index_subfields"/>
<xslo:template match="text()" mode="index_data_field"/>
<xslo:template match="text()" mode="index_heading"/>
+ <xslo:template match="text()" mode="index_heading_conditional"/>
<xslo:template match="text()" mode="index_match_heading"/>
<xslo:template match="text()" mode="index_subject_thesaurus"/>
<xslo:template match="/">
<xslo:apply-templates mode="index_subfields"/>
<xslo:apply-templates mode="index_data_field"/>
<xslo:apply-templates mode="index_heading"/>
+ <xslo:apply-templates mode="index_heading_conditional"/>
<xslo:apply-templates mode="index_match_heading"/>
<xslo:apply-templates mode="index_subject_thesaurus"/>
</z:record>
<xsl:call-template name="handle-index-subfields"/>
<xsl:call-template name="handle-index-data-field"/>
<xsl:call-template name="handle-index-heading"/>
+ <xsl:call-template name="handle-index-heading-conditional"/>
<xsl:call-template name="handle-index-match-heading"/>
<xsl:apply-templates/>
<xslo:template match="*">
</xsl:for-each>
</xsl:template>
+ <xsl:template name="handle-index-heading-conditional">
+ <xsl:for-each select="//kohaidx:index_heading_conditional[generate-id() = generate-id(key('index_heading_conditional_tag', @tag)[1])]">
+ <xslo:template mode="index_heading_conditional">
+ <xslo:if>
+ <xsl:attribute name="test"><xsl:value-of select="@test"/></xsl:attribute>
+ <xsl:for-each select="key('index_heading_conditional_tag', @tag)">
+ <xsl:call-template name="handle-one-index-heading"/>
+ </xsl:for-each>
+ </xslo:if>
+ </xslo:template>
+ </xsl:for-each>
+ </xsl:template>
+
<xsl:template name="handle-one-data-field">
<xsl:variable name="indexes">
<xsl:call-template name="get-target-indexes"/>
use C4::Context;
use CGI;
+sub _help_template_file_of_url {
+ my $url = shift;
+ my $file;
+ if ($url =~ /koha\/(.*)\.pl/) {
+ $file = $1;
+ } else {
+ $file = 'mainpage';
+ }
+ $file =~ s/[^a-zA-Z0-9_\-\/]*//g;
+ return "help/$file.tt";
+}
+
my $query = new CGI;
# find the script that called the online help using the CGI referer()
our $refer = $query->param('url');
$refer = $query->referer() if !$refer || $refer eq 'undefined';
-
-$refer =~ /koha\/(.*)\.pl/;
-my $file = $1;
-$file =~ s/[^a-zA-Z0-9_\-\/]*//g;
-my $from = "help/$file.tt";
+my $from = _help_template_file_of_url($refer);
my $template = C4::Templates::gettemplate($from, 'intranet', $query);
$template->param( referer => $refer );
output_html_with_http_headers $query, "", $template->output;
-
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use C4::Context;
+my $dbh = C4::Context->dbh;
+
+$dbh->do(
+q|CREATE TABLE `import_auths` (
+ import_record_id int(11) NOT NULL,
+ matched_authid int(11) default NULL,
+ control_number varchar(25) default NULL,
+ authorized_heading varchar(128) default NULL,
+ original_source varchar(25) default NULL,
+ CONSTRAINT import_auths_ibfk_1 FOREIGN KEY (import_record_id)
+ REFERENCES import_records (import_record_id) ON DELETE CASCADE ON UPDATE CASCADE,
+ KEY matched_authid (matched_authid)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;|
+);
+$dbh->do("ALTER TABLE import_batches
+ CHANGE COLUMN num_biblios num_records int(11) NOT NULL default 0,
+ ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'");
+$dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN
+ (SELECT import_batch_id FROM import_records WHERE record_type='auth')");
+
+print "Upgrade done (Added support for staging authorities)\n";
INSERT INTO `z3950servers`
(`host`, `port`, `db`, `userid`, `password`, `name`, `id`, `checked`, `rank`, `syntax`, `encoding`) VALUES
('z3950.loc.gov',7090,'Voyager','','','LIBRARY OF CONGRESS',1,1,1,'USMARC','MARC-8'),
-('hopkins1.bobst.nyu.edu',9991,'NYU01PUB','','','NEW YORK UNIVERSITY LIBRARIES',5,0,0,'USMARC','MARC-8'),
('clio-db.cc.columbia.edu',7090,'voyager','','','COLUMBIA UNIVERSITY',6,0,0,'USMARC','MARC-8'),
-('catalog.nypl.org',210,'innopac','','','NEW YORK PUBLIC LIBRARY',7,0,0,'USMARC','MARC-8'),
('siris-libraries.si.edu',210,'Default','','','SMITHSONIAN INSTITUTION LIBRARIES',10,0,0,'USMARC','MARC-8');
INSERT INTO `repeatable_holidays` VALUES
-(2,'',0,NULL,NULL,'','Sundays'),
-(3,'',NULL,1,1,'','New Year\'s Day'),
-(4,'',NULL,25,12,'','Christmas');
+(2,'MPL',0,NULL,NULL,'','Sundays'),
+(3,'MPL',NULL,1,1,'','New Year\'s Day'),
+(4,'MPL',NULL,25,12,'','Christmas');
INSERT INTO `z3950servers`
(`host`, `port`, `db`, `userid`, `password`, `name`, `id`, `checked`, `rank`, `syntax`, `encoding`) VALUES
('z3950.loc.gov',7090,'Voyager','','','LIBRARY OF CONGRESS',1,1,1,'USMARC','MARC-8'),
-('hopkins1.bobst.nyu.edu',9991,'NYU01PUB','','','NEW YORK UNIVERSITY LIBRARIES',5,0,0,'USMARC','MARC-8'),
('clio-db.cc.columbia.edu',7090,'voyager','','','COLUMBIA UNIVERSITY',6,0,0,'USMARC','MARC-8'),
-('catalog.nypl.org',210,'innopac','','','NEW YORK PUBLIC LIBRARY',7,0,0,'USMARC','MARC-8'),
('siris-libraries.si.edu',210,'Default','','','SMITHSONIAN INSTITUTION LIBRARIES',10,0,0,'USMARC','MARC-8');
INSERT INTO `z3950servers`
(`host`, `port`, `db`, `userid`, `password`, `name`, `id`, `checked`, `rank`, `syntax`, `encoding`) VALUES
('z3950.loc.gov',7090,'Voyager','','','LIBRARY OF CONGRESS',1,1,1,'USMARC','MARC-8'),
-('hopkins1.bobst.nyu.edu',9991,'NYU01PUB','','','NEW YORK UNIVERSITY LIBRARIES',5,0,0,'USMARC','MARC-8'),
('clio-db.cc.columbia.edu',7090,'voyager','','','COLUMBIA UNIVERSITY',6,0,0,'USMARC','MARC-8'),
-('catalog.nypl.org',210,'innopac','','','NEW YORK PUBLIC LIBRARY',7,0,0,'USMARC','MARC-8'),
('siris-libraries.si.edu',210,'Default','','','SMITHSONIAN INSTITUTION LIBRARIES',10,0,0,'USMARC','MARC-8');
UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'opaclanguages';
UPDATE systempreferences SET value = 1 WHERE variable = 'opaclanguagesdisplay';
UPDATE systempreferences SET value = 'Bienvenue dans Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock';
+UPDATE systempreferences SET value = 'bibtex|dc|marcxml|marc8|utf8|marcstd|ris' WHERE variable = 'OpacExportOptions';
DROP TABLE IF EXISTS `authorised_values`;
CREATE TABLE `authorised_values` ( -- stores values for authorized values categories and values
`id` int(11) NOT NULL auto_increment, -- unique key, used to identify the authorized value
- `category` varchar(10) NOT NULL default '', -- key used to identify the authorized value category
+ `category` varchar(16) NOT NULL default '', -- key used to identify the authorized value category
`authorised_value` varchar(80) NOT NULL default '', -- code use to identify the authorized value
- `lib` varchar(80) default NULL, -- authorized value description as printed in the staff client
- `lib_opac` VARCHAR(80) default NULL, -- authorized value description as printed in the OPAC
+ `lib` varchar(200) default NULL, -- authorized value description as printed in the staff client
+ `lib_opac` varchar(200) default NULL, -- authorized value description as printed in the OPAC
`imageurl` varchar(200) default NULL, -- authorized value URL
PRIMARY KEY (`id`),
KEY `name` (`category`),
`cn_class` varchar(30) default NULL,
`cn_item` varchar(10) default NULL,
`cn_suffix` varchar(10) default NULL,
- `cn_sort` varchar(30) default NULL,
- `agerestriction` varchar(255) default NULL,
+ `cn_sort` varchar(30) default NULL, -- normalized version of the call number used for sorting
+ `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
`totalissues` int(10),
`marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML
PRIMARY KEY (`biblioitemnumber`),
`altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
`altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
`altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
- `altcontactaddress3` varchar(255) default NULL, -- the third address line for the alternate contact for the patron/borrower
- `altcontactstate` text default NULL, -- the city and state for the alternate contact for the patron/borrower
+ `altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
+ `altcontactstate` text default NULL, -- the state for the alternate contact for the patron/borrower
`altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
`altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
`altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
`staff_searchable` tinyint(1) NOT NULL default 0, -- defines if this field is searchable via the patron search in the staff client (1 for yes, 0 for no)
`authorised_value_category` varchar(10) default NULL, -- foreign key from authorised_values that links this custom field to an authorized value category
`display_checkout` tinyint(1) NOT NULL default 0,-- defines if this field displays in checkout screens
- `category_code` VARCHAR(1) NULL DEFAULT NULL,-- defines a category for an attribute_type
+ `category_code` VARCHAR(10) NULL DEFAULT NULL,-- defines a category for an attribute_type
`class` VARCHAR(255) NOT NULL DEFAULT '',-- defines a class for an attribute_type
PRIMARY KEY (`code`),
KEY `auth_val_cat_idx` (`authorised_value_category`)
`cn_class` varchar(30) default NULL,
`cn_item` varchar(10) default NULL,
`cn_suffix` varchar(10) default NULL,
- `cn_sort` varchar(30) default NULL,
- `agerestriction` varchar(255) default NULL,
+ `cn_sort` varchar(30) default NULL, -- normalized version of the call number used for sorting
+ `agerestriction` varchar(255) default NULL, -- target audience/age restriction from the bib record (MARC21 521$a)
`totalissues` int(10),
`marcxml` longtext NOT NULL, -- full bibliographic MARC record in MARCXML
PRIMARY KEY (`biblioitemnumber`),
`altcontactsurname` varchar(255) default NULL, -- surname or last name of the alternate contact for the patron/borrower
`altcontactaddress1` varchar(255) default NULL, -- the first address line for the alternate contact for the patron/borrower
`altcontactaddress2` varchar(255) default NULL, -- the second address line for the alternate contact for the patron/borrower
- `altcontactaddress3` varchar(255) default NULL, -- the third address line for the alternate contact for the patron/borrower
- `altcontactstate` text default NULL, -- the city and state for the alternate contact for the patron/borrower
+ `altcontactaddress3` varchar(255) default NULL, -- the city for the alternate contact for the patron/borrower
+ `altcontactstate` text default NULL, -- the state for the alternate contact for the patron/borrower
`altcontactzipcode` varchar(50) default NULL, -- the zipcode for the alternate contact for the patron/borrower
`altcontactcountry` text default NULL, -- the country for the alternate contact for the patron/borrower
`altcontactphone` varchar(50) default NULL, -- the phone number for the alternate contact for the patron/borrower
`matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
`template_id` int(11) default NULL,
`branchcode` varchar(10) default NULL,
- `num_biblios` int(11) NOT NULL default 0, -- number of bib records in the file
+ `num_records` int(11) NOT NULL default 0, -- number of records in the file
`num_items` int(11) NOT NULL default 0, -- number of items in the file
`upload_timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP, -- date and time the file was uploaded
`overlay_action` enum('replace', 'create_new', 'use_template', 'ignore') NOT NULL default 'create_new', -- how to handle duplicate records
`item_action` enum('always_add', 'add_only_for_matches', 'add_only_for_new', 'ignore') NOT NULL default 'always_add', -- what to do with item records
`import_status` enum('staging', 'staged', 'importing', 'imported', 'reverting', 'reverted', 'cleaned') NOT NULL default 'staging', -- the status of the imported file
`batch_type` enum('batch', 'z3950', 'webservice') NOT NULL default 'batch', -- where this batch has come from
+ `record_type` enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio', -- type of record in the batch
`file_name` varchar(100), -- the name of the file uploaded
`comments` mediumtext, -- any comments added when the file was uploaded
PRIMARY KEY (`import_batch_id`),
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
+-- Table structure for table `import_auths`
+--
+
+DROP TABLE IF EXISTS `import_auths`;
+CREATE TABLE `import_auths` (
+ `import_record_id` int(11) NOT NULL,
+ `matched_authid` int(11) default NULL,
+ `control_number` varchar(25) default NULL,
+ `authorized_heading` varchar(128) default NULL,
+ `original_source` varchar(25) default NULL,
+ CONSTRAINT `import_auths_ibfk_1` FOREIGN KEY (`import_record_id`)
+ REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE,
+ KEY `matched_authid` (`matched_authid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
-- Table structure for table `import_biblios`
--
`date_created` datetime default NULL, -- date and time this definition was created
`date_modified` datetime default NULL, -- date and time this definition was last modified
`saved_sql` text, -- SQL snippet for us in reports
- `area` int(11) default NULL, -- Koha module this definition is for (1 = Circulation, 2 = Catalog, 3 = Patrons, 4 = Acquistions, 5 = Accounts)
- PRIMARY KEY (`id`)
+ report_area varchar(6) DEFAULT NULL, -- Koha module this definition is for Circulation, Catalog, Patrons, Acquistions, Accounts)
+ PRIMARY KEY (id),
+ KEY dictionary_area_idx (report_area)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
`notes` text, -- the notes or description given to this report
`cache_expiry` int NOT NULL default 300,
`public` boolean NOT NULL default FALSE,
+ report_area varchar(6) default NULL,
+ report_group varchar(80) default NULL,
+ report_subgroup varchar(80) default NULL,
PRIMARY KEY (`id`),
+ KEY sql_area_group_idx (report_group, report_subgroup),
KEY boridx (`borrowernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`itemtype` varchar(10) default NULL, -- foreign key from the itemtypes table, links transaction to a specific item type
`borrowernumber` int(11) default NULL, -- foreign key from the borrowers table, links transaction to a specific borrower
`associatedborrower` int(11) default NULL,
+ `ccode` int(11) default NULL, -- foreign key from the items table, links transaction to a specific collection code
KEY `timeidx` (`datetime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `accountlines`;
CREATE TABLE `accountlines` (
+ `accountlines_id` int(11) NOT NULL AUTO_INCREMENT,
`borrowernumber` int(11) NOT NULL default 0,
`accountno` smallint(6) NOT NULL default 0,
`itemnumber` int(11) default NULL,
`notify_level` int(2) NOT NULL default 0,
`note` text NULL default NULL,
`manager_id` int(11) NULL,
+ PRIMARY KEY (`accountlines_id`),
KEY `acctsborridx` (`borrowernumber`),
KEY `timeidx` (`timestamp`),
KEY `itemnumber` (`itemnumber`),
`authorisedby` varchar(10) default NULL, -- the borrowernumber of the person who created the basket
`booksellerinvoicenumber` mediumtext, -- appears to always be NULL
`basketgroupid` int(11), -- links this basket to its group (aqbasketgroups.id)
+ `deliveryplace` varchar(10) default NULL, -- basket delivery place
+ `billingplace` varchar(10) default NULL, -- basket billing place
PRIMARY KEY (`basketno`),
KEY `booksellerid` (`booksellerid`),
KEY `basketgroupid` (`basketgroupid`),
`listprice` decimal(28,6) default NULL, -- the vendor price for this line item
`totalamount` decimal(28,6) default NULL, -- not used? always NULL
`datereceived` date default NULL, -- the date this order was received
- `booksellerinvoicenumber` mediumtext, -- the invoice number this line item was received on
+ invoiceid int(11) default NULL, -- id of invoice
`freight` decimal(28,6) default NULL, -- shipping costs (not used)
`unitprice` decimal(28,6) default NULL, -- the actual cost entered when receiving this line item
`quantityreceived` smallint(6) NOT NULL default 0, -- the quantity that have been received so far
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this order line was last modified
`rrp` decimal(13,2) default NULL, -- the replacement cost for this line item
`ecost` decimal(13,2) default NULL, -- the estimated cost for this line item
- `gst` decimal(13,2) default NULL, -- the tax rate for this line item
+ `gstrate` decimal(6,4) default NULL, -- the tax rate for this line item
+ `discount` float(6,4) default NULL, -- the discount for this line item
`budget_id` int(11) NOT NULL, -- the fund this order goes against (aqbudgets.budget_id)
`budgetgroup_id` int(11) NOT NULL, -- not used? always zero
`budgetdate` date default NULL, -- not used? always NULL
`uncertainprice` tinyint(1), -- was this price uncertain (1 for yes, 0 for no)
`claims_count` int(11) default 0, -- count of claim letters generated
`claimed_date` date default NULL, -- last date a claim was generated
+ parent_ordernumber int(11) default NULL, -- ordernumber of parent order line, or same as ordernumber if no parent
PRIMARY KEY (`ordernumber`),
KEY `basketno` (`basketno`),
KEY `biblionumber` (`biblionumber`),
KEY `budget_id` (`budget_id`),
CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE,
- CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE
+ CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
+ CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
KEY `ordernumber` (`ordernumber`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+--
+-- Table structure for table aqinvoices
+--
+
+DROP TABLE IF EXISTS aqinvoices;
+CREATE TABLE aqinvoices (
+ invoiceid int(11) NOT NULL AUTO_INCREMENT, -- ID of the invoice, primary key
+ invoicenumber mediumtext NOT NULL, -- Name of invoice
+ booksellerid int(11) NOT NULL, -- foreign key to aqbooksellers
+ shipmentdate date default NULL, -- date of shipment
+ billingdate date default NULL, -- date of billing
+ closedate date default NULL, -- invoice close date, NULL means the invoice is open
+ shipmentcost decimal(28,6) default NULL, -- shipment cost
+ shipmentcost_budgetid int(11) default NULL, -- foreign key to aqbudgets, link the shipment cost to a budget
+ PRIMARY KEY (invoiceid),
+ CONSTRAINT aqinvoices_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT aqinvoices_fk_shipmentcost_budgetid FOREIGN KEY (shipmentcost_budgetid) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+
--
-- Table structure for table `fieldmapping`
--
(`host`, `port`, `db`, `userid`, `password`, `name`, `id`, `checked`, `rank`, `syntax`, `encoding`) VALUES
('193.59.172.100',210,'INNOPAC','','','BIBLIOTEKA NARODOWA',1,1,1,'MARC21','UTF8'),
('62.181.1.243',4321,'bilbo','','','BP BEMOWO',2,1,1,'MARC21','UTF8'),
-('z3950.loc.gov',7090,'Voyager','','','LIBRARY OF CONGRESS',3,0,1,'USMARC','MARC-8'),
-('bobcat.nyu.edu',210,'advance','','','NEW YORK UNIVERSITY LIBRARIES',4,0,0,'USMARC','MARC-8'),
-('catnyp.nypl.org',210,'innopac','','','NEW YORK PUBLIC LIBRARY',5,0,0,'USMARC','MARC-8');
+('z3950.loc.gov',7090,'Voyager','','','LIBRARY OF CONGRESS',3,0,1,'USMARC','MARC-8');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACViewOthersSuggestions',0,'If ON, allows all suggestions to be displayed in the OPAC',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACURLOpenInNewWindow',0,'If ON, URLs in the OPAC open in a new window',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACUserCSS','','Add CSS to be included in the OPAC in an embedded <style> tag.',NULL,'free');
-INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemsResultsDisplay',"statuses",'statuses : show only the status of items in result list. itemdisplay : show full location of items (branch+location+callnumber) as in staff interface',"statuses|itemdetails",'Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemsResultsDisplay',0,'If OFF : show only the status of items in result list.If ON : show full location of items (branch+location+callnumber) as in staff interface','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('uppercasesurnames',0,'If ON, surnames are converted to upper case in patron entry form',NULL,'YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Specify the agency that controls the circulation and fines policy',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('finesCalendar',"noFinesWhenClosed",'Specify whether to use the Calendar in calculating duedates and fines',"ignoreCalendar|noFinesWhenClosed",'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('PatronsPerPage','20','Number of Patrons Per Page displayed by default','20','Integer');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranch','holdingbranch','Used by Circulation to determine which branch of an item to check with independent branches on, and by search to determine which branch to choose for availability ','holdingbranch|homebranch','Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HomeOrHoldingBranchReturn','homebranch','Used by Circulation to determine which branch of an item to check checking-in items','holdingbranch|homebranch','Choice');
+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('AllowReturnToBranch', 'anywhere', 'Where an item may be returned', 'anywhere|homebranch|holdingbranch|homeorholdingbranch', 'Choice');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacHighlightedWords','1','If Set, then queried words are higlighted in OPAC','','YesNo');
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH','0','if ON, OAI-PMH server is enabled',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacStarRatings','all',NULL,'disable|all|details','Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacBrowseResults','1','Disable/enable browsing and paging search results from the OPAC detail page.',NULL,'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SvcMaxReportRows','10','Maximum number of rows to return via the report web service.',NULL,'Integer');
+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('decreaseLoanHighHolds', NULL, '', 'Decreases the loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue', 'YesNo');
+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('decreaseLoanHighHoldsValue', NULL, '', 'Specifies a threshold for the minimum number of holds needed to trigger a reduction in loan duration (used with decreaseLoanHighHolds)', 'Integer');
+INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('decreaseLoanHighHoldsDuration', NULL, '', 'Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds', 'Integer');
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReservesControlBranch','PatronLibrary','ItemHomeLibrary|PatronLibrary','Branch checked for members reservations rights','Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IssueLostItem', 'alert', 'alert|confirm|nothing', 'Defines what should be done when an attempt is made to issue an item that has been marked as lost.', 'Choice');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('SuspendHoldsIntranet', '1', NULL , 'Allow holds to be suspended from the intranet.', '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');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AgeRestrictionMarker','','Markers for age restriction indication, e.g. FSK|PEGI|Age|',NULL,'free');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AgeRestrictionOverride',0,'Allow staff to check out an item with age restriction.',NULL,'YesNo');
-INSERT INTO systempreferences (variable,value,explanation,type) VALUES('DidYouMeanFromAuthorities','0','Suggest searches based on authority file.','YesNo');
INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('IncludeSeeFromInSearches','0','','Include see-from references in searches.','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACMobileUserCSS','','Include the following CSS for the mobile view on all pages in the OPAC:',NULL,'free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacMainUserBlockMobile','','Show the following HTML in its own column on the main page of the OPAC (mobile version):',NULL,'free');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo');
+INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidyoumean',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
+INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');
+INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer');
$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);
}
"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);
}
$DBversion = "3.09.00.036";
$dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AgeRestrictionOverride',0,'Allow staff to check out an item with age restriction.',NULL,'YesNo')");
print "Upgrade to $DBversion done (Add colum agerestriction to biblioitems and deletedbiblioitems, add system preferences AgeRestrictionMarker and AgeRestrictionOverride)\n";
- SetVersion($DBversion);
+ SetVersion ($DBversion);
}
$DBversion = "3.09.00.037";
SetVersion($DBversion)
}
+$DBversion = "3.09.00.043";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("
+ ALTER TABLE aqorders
+ ADD parent_ordernumber int(11) DEFAULT NULL
+ ");
+ $dbh->do("
+ UPDATE aqorders
+ SET parent_ordernumber = ordernumber;
+ ");
+ print "Upgrade to $DBversion done (Adding parent_ordernumber in aqorders)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = '3.09.00.044';
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE statistics ADD COLUMN ccode VARCHAR ( 10 ) NULL AFTER associatedborrower");
+ $dbh->do("UPDATE statistics SET statistics.ccode = ( SELECT items.ccode FROM items WHERE statistics.itemnumber = items.itemnumber )");
+ $dbh->do("UPDATE statistics SET statistics.ccode = (
+ SELECT deleteditems.ccode FROM deleteditems
+ WHERE statistics.itemnumber = deleteditems.itemnumber
+ ) WHERE statistics.ccode IS NULL");
+ print "Upgrade done ( Added Collection Code to Statistics table. )\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.045";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE borrower_attribute_types MODIFY category_code VARCHAR( 10 ) NULL DEFAULT NULL");
+ print "Upgrade to $DBversion done. (Bug 8002: Update patron attribute types table from varchar(1) to varchar(10) category_code)\nWarning to Koha System Administrators: If you use borrower attributes defined by borrower categories, you have to check your configuration. A bug may have removed your attribute links to borrower categories.\nPlease check, and fix it if necessary.";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.046";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE `accountlines` ADD `accountlines_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST;");
+ print "Upgrade to $DBversion done (adding accountlines_id field in accountlines table)\n";
+ SetVersion($DBversion);
+}
+
+
+$DBversion = "3.09.00.047";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ # to preserve default behaviour as best as possible, set this new preference differently depending on whether IndependantBranches is set or not
+ my $prefvalue = 'anywhere';
+ if (C4::Context->preference("IndependantBranches")) { $prefvalue = 'homeorholdingbranch';}
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowReturnToBranch', '$prefvalue', 'Where an item may be returned', 'anywhere|homebranch|holdingbranch|homeorholdingbranch', 'Choice');");
+
+ print "Upgrade to $DBversion done: adding AllowReturnToBranch syspref (bug 6151)";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.048";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE authorised_values MODIFY lib varchar(200)");
+ $dbh->do("ALTER TABLE authorised_values MODIFY lib_opac varchar(200)");
+
+ print "Upgrade to $DBversion done (Raise the length of Authorised Values descriptions)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.049";
+if(C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OPACMobileUserCSS','','Include the following CSS for the mobile view on all pages in the OPAC:',NULL,'free');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacMainUserBlockMobile','','Show the following HTML in its own column on the main page of the OPAC (mobile version):',NULL,'free');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowLibrariesPulldownMobile','1','Show the libraries pulldown on the mobile version of the OPAC.',NULL,'YesNo');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowFiltersPulldownMobile','1','Show the search filters pulldown on the mobile version of the OPAC.',NULL,'YesNo');");
+ print "Upgrade to $DBversion done (Add OPACMobileUserCSS, OpacMainUserBlockMobile, OpacShowLibrariesPulldownMobile and OpacShowFiltersPulldownMobile sysprefs)\n";
+ SetVersion($DBversion);
+}
+
+
+
+$DBversion = "3.09.00.050";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE authorised_values MODIFY category varchar(16) NOT NULL DEFAULT '';");
+ $dbh->do("INSERT INTO authorised_values (category, authorised_value, lib) VALUES
+ ('REPORT_GROUP', 'CIRC', 'Circulation'),
+ ('REPORT_GROUP', 'CAT', 'Catalog'),
+ ('REPORT_GROUP', 'PAT', 'Patrons'),
+ ('REPORT_GROUP', 'ACQ', 'Acquisitions'),
+ ('REPORT_GROUP', 'ACC', 'Accounts');");
+
+ $dbh->do("ALTER TABLE reports_dictionary ADD report_area varchar(6) DEFAULT NULL;");
+ $dbh->do("UPDATE reports_dictionary SET report_area = CASE area
+ WHEN 1 THEN 'CIRC'
+ WHEN 2 THEN 'CAT'
+ WHEN 3 THEN 'PAT'
+ WHEN 4 THEN 'ACQ'
+ WHEN 5 THEN 'ACC'
+ END;");
+ $dbh->do("ALTER TABLE reports_dictionary DROP area;");
+ $dbh->do("ALTER TABLE reports_dictionary ADD KEY dictionary_area_idx (report_area);");
+
+ $dbh->do("ALTER TABLE saved_sql ADD report_area varchar(6) DEFAULT NULL;");
+ $dbh->do("ALTER TABLE saved_sql ADD report_group varchar(80) DEFAULT NULL;");
+ $dbh->do("ALTER TABLE saved_sql ADD report_subgroup varchar(80) DEFAULT NULL;");
+ $dbh->do("ALTER TABLE saved_sql ADD KEY sql_area_group_idx (report_group, report_subgroup);");
+
+ print "Upgrade to $DBversion done saved_sql new fields report_group and report_area; authorised_values.category 16 char \n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.051";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("
+ CREATE TABLE aqinvoices (
+ invoiceid int(11) NOT NULL AUTO_INCREMENT,
+ invoicenumber mediumtext NOT NULL,
+ booksellerid int(11) NOT NULL,
+ shipmentdate date default NULL,
+ billingdate date default NULL,
+ closedate date default NULL,
+ shipmentcost decimal(28,6) default NULL,
+ shipmentcost_budgetid int(11) default NULL,
+ PRIMARY KEY (invoiceid),
+ CONSTRAINT aqinvoices_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT aqinvoices_fk_shipmentcost_budgetid FOREIGN KEY (shipmentcost_budgetid) REFERENCES aqbudgets (budget_id) ON DELETE SET NULL ON UPDATE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8
+ ");
+
+ # Fill this new table with existing invoices
+ my $sth = $dbh->prepare("
+ SELECT aqorders.booksellerinvoicenumber AS invoicenumber, aqbasket.booksellerid, aqorders.datereceived
+ FROM aqorders
+ LEFT JOIN aqbasket ON aqorders.basketno = aqbasket.basketno
+ WHERE aqorders.booksellerinvoicenumber IS NOT NULL
+ AND aqorders.booksellerinvoicenumber != ''
+ GROUP BY aqorders.booksellerinvoicenumber
+ ");
+ $sth->execute;
+ my $results = $sth->fetchall_arrayref({});
+ $sth = $dbh->prepare("
+ INSERT INTO aqinvoices (invoicenumber, booksellerid, shipmentdate) VALUES (?,?,?)
+ ");
+ foreach(@$results) {
+ $sth->execute($_->{invoicenumber}, $_->{booksellerid}, $_->{datereceived});
+ }
+
+ # Add the column in aqorders, fill it with correct value
+ # and then drop booksellerinvoicenumber column
+ $dbh->do("
+ ALTER TABLE aqorders
+ ADD COLUMN invoiceid int(11) default NULL AFTER booksellerinvoicenumber,
+ ADD CONSTRAINT aqorders_ibfk_3 FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE SET NULL ON UPDATE CASCADE
+ ");
+
+ $dbh->do("
+ UPDATE aqorders, aqinvoices
+ SET aqorders.invoiceid = aqinvoices.invoiceid
+ WHERE aqorders.booksellerinvoicenumber = aqinvoices.invoicenumber
+ ");
+
+ $dbh->do("
+ ALTER TABLE aqorders
+ DROP COLUMN booksellerinvoicenumber
+ ");
+
+ print "Upgrade to $DBversion done (Add aqinvoices table) \n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.052";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('decreaseLoanHighHolds', NULL, '', 'Decreases the loan period for items with number of holds above the threshold specified in decreaseLoanHighHoldsValue', 'YesNo');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('decreaseLoanHighHoldsValue', NULL, '', 'Specifies a threshold for the minimum number of holds needed to trigger a reduction in loan duration (used with decreaseLoanHighHolds)', 'Integer');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('decreaseLoanHighHoldsDuration', NULL, '', 'Specifies a number of days that a loan is reduced to when used in conjunction with decreaseLoanHighHolds', 'Integer');");
+ print "Upgrade to $DBversion done (Add systempreferences to decrease loan length on high demand items decreaseLoanHighHolds, decreaseLoanHighHoldsValue and decreaseLoanHighHoldsDuration) \n";
+ SetVersion ($DBversion);
+}
+
+
+$DBversion = "3.09.00.053";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do(
+ q|CREATE TABLE `import_auths` (
+ import_record_id int(11) NOT NULL,
+ matched_authid int(11) default NULL,
+ control_number varchar(25) default NULL,
+ authorized_heading varchar(128) default NULL,
+ original_source varchar(25) default NULL,
+ CONSTRAINT import_auths_ibfk_1 FOREIGN KEY (import_record_id)
+ REFERENCES import_records (import_record_id) ON DELETE CASCADE ON UPDATE CASCADE,
+ KEY matched_authid (matched_authid)
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;|
+ );
+ $dbh->do("ALTER TABLE import_batches
+ CHANGE COLUMN num_biblios num_records int(11) NOT NULL default 0,
+ ADD COLUMN record_type enum('biblio', 'auth', 'holdings') NOT NULL default 'biblio'");
+ $dbh->do("UPDATE import_batches SET record_type='auth' WHERE import_batch_id IN
+ (SELECT import_batch_id FROM import_records WHERE record_type='auth')");
+
+ print "Upgrade to $DBversion done (Added support for staging authorities)\n";
+ SetVersion ($DBversion);
+}
+
+$DBversion = "3.09.00.054";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE aqorders CHANGE COLUMN gst gstrate DECIMAL(6,4) DEFAULT NULL");
+ print "Upgrade to $DBversion done (Change column name in aqorders gst --> gstrate)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.055";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE aqorders ADD discount float(6,4) DEFAULT NULL AFTER gstrate");
+ print "Upgrade to $DBversion done (Add discount field in aqorders table)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.056";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('AuthDisplayHierarchy','0','Display authority hierarchies','','YesNo')");
+ print "Upgrade to $DBversion done (Add system preference AuthDisplayHierarchy)\n";
+ SetVersion($DBversion);
+}
+
+
+$DBversion = "3.09.00.057";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE aqbasket ADD deliveryplace VARCHAR(10) default NULL AFTER basketgroupid;");
+ $dbh->do("ALTER TABLE aqbasket ADD billingplace VARCHAR(10) default NULL AFTER deliveryplace;");
+ print "Upgrade to $DBversion done (Bug 5356: Added billingplace, deliveryplace to the aqbasket table)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.058";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidyoumean',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free');");
+ print "Upgrade to $DBversion done (Add Did You Mean? configuration)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion ="3.09.00.059";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');");
+ print "Upgrade to $DBversion done (Add system preference BlockReturnOfWithdrawnItems)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.060";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer')");
+ print "Upgrade to $DBversion done (Added HoldsToPullStartDate syspref)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.09.00.061";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("UPDATE systempreferences set value=0 WHERE variable='OPACItemsResultsDisplay' AND value='statuses'");
+ $dbh->do("UPDATE systempreferences set value=1 WHERE variable='OPACItemsResultsDisplay' AND value='itemdetails'");
+ $dbh->do("UPDATE systempreferences SET explanation='If No, show only the status of items in result list. If Yes, show full location of items (branchlocation+callnumber) as in staff interface',options=NULL,type='YesNo' WHERE variable='OPACItemsResultsDisplay'");
+ print "Upgrade to $DBversion done (Fixes Bug 5409, Set the syspref value to 1 if it is itemdetails and 0 if it is statuses, leaving it alone if it is already 1 or 0 and change the type of the syspref to YesNo.)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
--- /dev/null
+/*
+ * jsTree 1.0-rc3
+ * http://jstree.com/
+ *
+ * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
+ *
+ * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
+ * $Revision: 236 $
+ */
+
+/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
+/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
+
+"use strict";
+
+// top wrapper to prevent multiple inclusion (is this OK?)
+(function () { if(jQuery && jQuery.jstree) { return; }
+ var is_ie6 = false, is_ie7 = false, is_ff2 = false;
+
+/*
+ * jsTree core
+ */
+(function ($) {
+ // Common functions not related to jsTree
+ // decided to move them to a `vakata` "namespace"
+ $.vakata = {};
+ // CSS related functions
+ $.vakata.css = {
+ get_css : function(rule_name, delete_flag, sheet) {
+ rule_name = rule_name.toLowerCase();
+ var css_rules = sheet.cssRules || sheet.rules,
+ j = 0;
+ do {
+ if(css_rules.length && j > css_rules.length + 5) { return false; }
+ if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
+ if(delete_flag === true) {
+ if(sheet.removeRule) { sheet.removeRule(j); }
+ if(sheet.deleteRule) { sheet.deleteRule(j); }
+ return true;
+ }
+ else { return css_rules[j]; }
+ }
+ }
+ while (css_rules[++j]);
+ return false;
+ },
+ add_css : function(rule_name, sheet) {
+ if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
+ if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
+ return $.vakata.css.get_css(rule_name);
+ },
+ remove_css : function(rule_name, sheet) {
+ return $.vakata.css.get_css(rule_name, true, sheet);
+ },
+ add_sheet : function(opts) {
+ var tmp = false, is_new = true;
+ if(opts.str) {
+ if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
+ if(tmp) { is_new = false; }
+ else {
+ tmp = document.createElement("style");
+ tmp.setAttribute('type',"text/css");
+ if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
+ }
+ if(tmp.styleSheet) {
+ if(is_new) {
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ tmp.styleSheet.cssText = opts.str;
+ }
+ else {
+ tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
+ }
+ }
+ else {
+ tmp.appendChild(document.createTextNode(opts.str));
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ }
+ return tmp.sheet || tmp.styleSheet;
+ }
+ if(opts.url) {
+ if(document.createStyleSheet) {
+ try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
+ }
+ else {
+ tmp = document.createElement('link');
+ tmp.rel = 'stylesheet';
+ tmp.type = 'text/css';
+ tmp.media = "all";
+ tmp.href = opts.url;
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ return tmp.styleSheet;
+ }
+ }
+ }
+ };
+
+ // private variables
+ var instances = [], // instance array (used by $.jstree.reference/create/focused)
+ focused_instance = -1, // the index in the instance array of the currently focused instance
+ plugins = {}, // list of included plugins
+ prepared_move = {}; // for the move_node function
+
+ // jQuery plugin wrapper (thanks to jquery UI widget function)
+ $.fn.jstree = function (settings) {
+ var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
+ args = Array.prototype.slice.call(arguments, 1),
+ returnValue = this;
+
+ // if a method call execute the method on all selected instances
+ if(isMethodCall) {
+ if(settings.substring(0, 1) == '_') { return returnValue; }
+ this.each(function() {
+ var instance = instances[$.data(this, "jstree_instance_id")],
+ methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
+ if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
+ });
+ }
+ else {
+ this.each(function() {
+ // extend settings and allow for multiple hashes and $.data
+ var instance_id = $.data(this, "jstree_instance_id"),
+ a = [],
+ b = settings ? $.extend({}, true, settings) : {},
+ c = $(this),
+ s = false,
+ t = [];
+ a = a.concat(args);
+ if(c.data("jstree")) { a.push(c.data("jstree")); }
+ b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
+
+ // if an instance already exists, destroy it first
+ if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
+ // push a new empty object to the instances array
+ instance_id = parseInt(instances.push({}),10) - 1;
+ // store the jstree instance id to the container element
+ $.data(this, "jstree_instance_id", instance_id);
+ // clean up all plugins
+ b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
+ b.plugins.unshift("core");
+ // only unique plugins
+ b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+
+ // extend defaults with passed data
+ s = $.extend(true, {}, $.jstree.defaults, b);
+ s.plugins = b.plugins;
+ $.each(plugins, function (i, val) {
+ if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
+ else { t.push(i); }
+ });
+ s.plugins = t;
+
+ // push the new object to the instances array (at the same time set the default classes to the container) and init
+ instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
+ // init all activated plugins for this instance
+ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
+ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
+ // initialize the instance
+ setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
+ });
+ }
+ // return the jquery selection (or if it was a method call that returned a value - the returned value)
+ return returnValue;
+ };
+ // object to store exposed functions and objects
+ $.jstree = {
+ defaults : {
+ plugins : []
+ },
+ _focused : function () { return instances[focused_instance] || null; },
+ _reference : function (needle) {
+ // get by instance id
+ if(instances[needle]) { return instances[needle]; }
+ // get by DOM (if still no luck - return null
+ var o = $(needle);
+ if(!o.length && typeof needle === "string") { o = $("#" + needle); }
+ if(!o.length) { return null; }
+ return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
+ },
+ _instance : function (index, container, settings) {
+ // for plugins to store data in
+ this.data = { core : {} };
+ this.get_settings = function () { return $.extend(true, {}, settings); };
+ this._get_settings = function () { return settings; };
+ this.get_index = function () { return index; };
+ this.get_container = function () { return container; };
+ this.get_container_ul = function () { return container.children("ul:eq(0)"); };
+ this._set_settings = function (s) {
+ settings = $.extend(true, {}, settings, s);
+ };
+ },
+ _fn : { },
+ plugin : function (pname, pdata) {
+ pdata = $.extend({}, {
+ __init : $.noop,
+ __destroy : $.noop,
+ _fn : {},
+ defaults : false
+ }, pdata);
+ plugins[pname] = pdata;
+
+ $.jstree.defaults[pname] = pdata.defaults;
+ $.each(pdata._fn, function (i, val) {
+ val.plugin = pname;
+ val.old = $.jstree._fn[i];
+ $.jstree._fn[i] = function () {
+ var rslt,
+ func = val,
+ args = Array.prototype.slice.call(arguments),
+ evnt = new $.Event("before.jstree"),
+ rlbk = false;
+
+ if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
+
+ // Check if function belongs to the included plugins of this instance
+ do {
+ if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
+ func = func.old;
+ } while(func);
+ if(!func) { return; }
+
+ // context and function to trigger events, then finally call the function
+ if(i.indexOf("_") === 0) {
+ rslt = func.apply(this, args);
+ }
+ else {
+ rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
+ if(rslt === false) { return; }
+ if(typeof rslt !== "undefined") { args = rslt; }
+
+ rslt = func.apply(
+ $.extend({}, this, {
+ __callback : function (data) {
+ this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
+ },
+ __rollback : function () {
+ rlbk = this.get_rollback();
+ return rlbk;
+ },
+ __call_old : function (replace_arguments) {
+ return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
+ }
+ }), args);
+ }
+
+ // return the result
+ return rslt;
+ };
+ $.jstree._fn[i].old = val.old;
+ $.jstree._fn[i].plugin = pname;
+ });
+ },
+ rollback : function (rb) {
+ if(rb) {
+ if(!$.isArray(rb)) { rb = [ rb ]; }
+ $.each(rb, function (i, val) {
+ instances[val.i].set_rollback(val.h, val.d);
+ });
+ }
+ }
+ };
+ // set the prototype for all instances
+ $.jstree._fn = $.jstree._instance.prototype = {};
+
+ // load the css when DOM is ready
+ $(function() {
+ // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
+ var u = navigator.userAgent.toLowerCase(),
+ v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+ css_string = '' +
+ '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
+ '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
+ '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
+ '.jstree > ul > li { margin-left:0px; } ' +
+ '.jstree-rtl > ul > li { margin-right:0px; } ' +
+ '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
+ '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
+ '.jstree a:focus { outline: none; } ' +
+ '.jstree a > ins { height:16px; width:16px; } ' +
+ '.jstree a > .jstree-icon { margin-right:3px; } ' +
+ '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
+ 'li.jstree-open > ul { display:block; } ' +
+ 'li.jstree-closed > ul { display:none; } ';
+ // Correct IE 6 (does not support the > CSS selector)
+ if(/msie/.test(u) && parseInt(v, 10) == 6) {
+ is_ie6 = true;
+
+ // fix image flicker and lack of caching
+ try {
+ document.execCommand("BackgroundImageCache", false, true);
+ } catch (err) { }
+
+ css_string += '' +
+ '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
+ '.jstree li li { margin-left:18px; } ' +
+ '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
+ 'li.jstree-open ul { display:block; } ' +
+ 'li.jstree-closed ul { display:none !important; } ' +
+ '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
+ '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
+ '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
+ }
+ // Correct IE 7 (shifts anchor nodes onhover)
+ if(/msie/.test(u) && parseInt(v, 10) == 7) {
+ is_ie7 = true;
+ css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
+ }
+ // correct ff2 lack of display:inline-block
+ if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
+ is_ff2 = true;
+ css_string += '' +
+ '.jstree ins { display:-moz-inline-box; } ' +
+ '.jstree li { line-height:12px; } ' + // WHY??
+ '.jstree a { display:-moz-inline-box; } ' +
+ '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
+ /* this shouldn't be here as it is theme specific */
+ }
+ // the default stylesheet
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+
+ // core functions (open, close, create, update, delete)
+ $.jstree.plugin("core", {
+ __init : function () {
+ this.data.core.locked = false;
+ this.data.core.to_open = this.get_settings().core.initially_open;
+ this.data.core.to_load = this.get_settings().core.initially_load;
+ },
+ defaults : {
+ html_titles : false,
+ animation : 500,
+ initially_open : [],
+ initially_load : [],
+ open_parents : true,
+ notify_plugins : true,
+ rtl : false,
+ load_open : false,
+ strings : {
+ loading : "Loading ...",
+ new_node : "New node",
+ multiple_selection : "Multiple selection"
+ }
+ },
+ _fn : {
+ init : function () {
+ this.set_focus();
+ if(this._get_settings().core.rtl) {
+ this.get_container().addClass("jstree-rtl").css("direction", "rtl");
+ }
+ this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>" + this._get_string("loading") + "</a></li></ul>");
+ this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
+
+ this.get_container()
+ .delegate("li > ins", "click.jstree", $.proxy(function (event) {
+ var trgt = $(event.target);
+ // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
+ this.toggle_node(trgt);
+ }, this))
+ .bind("mousedown.jstree", $.proxy(function () {
+ this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
+ }, this))
+ .bind("dblclick.jstree", function (event) {
+ var sel;
+ if(document.selection && document.selection.empty) { document.selection.empty(); }
+ else {
+ if(window.getSelection) {
+ sel = window.getSelection();
+ try {
+ sel.removeAllRanges();
+ sel.collapse();
+ } catch (err) { }
+ }
+ }
+ });
+ if(this._get_settings().core.notify_plugins) {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var o = this._get_node(data.rslt.obj),
+ t = this;
+ if(o === -1) { o = this.get_container_ul(); }
+ if(!o.length) { return; }
+ o.find("li").each(function () {
+ var th = $(this);
+ if(th.data("jstree")) {
+ $.each(th.data("jstree"), function (plugin, values) {
+ if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
+ t["_" + plugin + "_notify"].call(t, th, values);
+ }
+ });
+ }
+ });
+ }, this));
+ }
+ if(this._get_settings().core.load_open) {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var o = this._get_node(data.rslt.obj),
+ t = this;
+ if(o === -1) { o = this.get_container_ul(); }
+ if(!o.length) { return; }
+ o.find("li.jstree-open:not(:has(ul))").each(function () {
+ t.load_node(this, $.noop, $.noop);
+ });
+ }, this));
+ }
+ this.__callback();
+ this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
+ },
+ destroy : function () {
+ var i,
+ n = this.get_index(),
+ s = this._get_settings(),
+ _this = this;
+
+ $.each(s.plugins, function (i, val) {
+ try { plugins[val].__destroy.apply(_this); } catch(err) { }
+ });
+ this.__callback();
+ // set focus to another instance if this one is focused
+ if(this.is_focused()) {
+ for(i in instances) {
+ if(instances.hasOwnProperty(i) && i != n) {
+ instances[i].set_focus();
+ break;
+ }
+ }
+ }
+ // if no other instance found
+ if(n === focused_instance) { focused_instance = -1; }
+ // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
+ this.get_container()
+ .unbind(".jstree")
+ .undelegate(".jstree")
+ .removeData("jstree_instance_id")
+ .find("[class^='jstree']")
+ .andSelf()
+ .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
+ $(document)
+ .unbind(".jstree-" + n)
+ .undelegate(".jstree-" + n);
+ // remove the actual data
+ instances[n] = null;
+ delete instances[n];
+ },
+
+ _core_notify : function (n, data) {
+ if(data.opened) {
+ this.open_node(n, false, true);
+ }
+ },
+
+ lock : function () {
+ this.data.core.locked = true;
+ this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
+ this.__callback({});
+ },
+ unlock : function () {
+ this.data.core.locked = false;
+ this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
+ this.__callback({});
+ },
+ is_locked : function () { return this.data.core.locked; },
+ save_opened : function () {
+ var _this = this;
+ this.data.core.to_open = [];
+ this.get_container_ul().find("li.jstree-open").each(function () {
+ if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
+ });
+ this.__callback(_this.data.core.to_open);
+ },
+ save_loaded : function () { },
+ reload_nodes : function (is_callback) {
+ var _this = this,
+ done = true,
+ current = [],
+ remaining = [];
+ if(!is_callback) {
+ this.data.core.reopen = false;
+ this.data.core.refreshing = true;
+ this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ if(this.data.core.to_open.length) {
+ this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
+ }
+ }
+ if(this.data.core.to_load.length) {
+ $.each(this.data.core.to_load, function (i, val) {
+ if(val == "#") { return true; }
+ if($(val).length) { current.push(val); }
+ else { remaining.push(val); }
+ });
+ if(current.length) {
+ this.data.core.to_load = remaining;
+ $.each(current, function (i, val) {
+ if(!_this._is_loaded(val)) {
+ _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
+ done = false;
+ }
+ });
+ }
+ }
+ if(this.data.core.to_open.length) {
+ $.each(this.data.core.to_open, function (i, val) {
+ _this.open_node(val, false, true);
+ });
+ }
+ if(done) {
+ // TODO: find a more elegant approach to syncronizing returning requests
+ if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
+ this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
+ this.data.core.refreshing = false;
+ this.reopen();
+ }
+ },
+ reopen : function () {
+ var _this = this;
+ if(this.data.core.to_open.length) {
+ $.each(this.data.core.to_open, function (i, val) {
+ _this.open_node(val, false, true);
+ });
+ }
+ this.__callback({});
+ },
+ refresh : function (obj) {
+ var _this = this;
+ this.save_opened();
+ if(!obj) { obj = -1; }
+ obj = this._get_node(obj);
+ if(!obj) { obj = -1; }
+ if(obj !== -1) { obj.children("UL").remove(); }
+ else { this.get_container_ul().empty(); }
+ this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
+ },
+ // Dummy function to fire after the first load (so that there is a jstree.loaded event)
+ loaded : function () {
+ this.__callback();
+ },
+ // deal with focus
+ set_focus : function () {
+ if(this.is_focused()) { return; }
+ var f = $.jstree._focused();
+ if(f) { f.unset_focus(); }
+
+ this.get_container().addClass("jstree-focused");
+ focused_instance = this.get_index();
+ this.__callback();
+ },
+ is_focused : function () {
+ return focused_instance == this.get_index();
+ },
+ unset_focus : function () {
+ if(this.is_focused()) {
+ this.get_container().removeClass("jstree-focused");
+ focused_instance = -1;
+ }
+ this.__callback();
+ },
+
+ // traverse
+ _get_node : function (obj) {
+ var $obj = $(obj, this.get_container());
+ if($obj.is(".jstree") || obj == -1) { return -1; }
+ $obj = $obj.closest("li", this.get_container());
+ return $obj.length ? $obj : false;
+ },
+ _get_next : function (obj, strict) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
+ if(!obj.length) { return false; }
+ if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
+
+ if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
+ else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
+ else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
+ },
+ _get_prev : function (obj, strict) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
+ if(!obj.length) { return false; }
+ if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
+
+ if(obj.prev("li").length) {
+ obj = obj.prev("li").eq(0);
+ while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
+ return obj;
+ }
+ else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
+ },
+ _get_parent : function (obj) {
+ obj = this._get_node(obj);
+ if(obj == -1 || !obj.length) { return false; }
+ var o = obj.parentsUntil(".jstree", "li:eq(0)");
+ return o.length ? o : -1;
+ },
+ _get_children : function (obj) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
+ if(!obj.length) { return false; }
+ return obj.children("ul:eq(0)").children("li");
+ },
+ get_path : function (obj, id_mode) {
+ var p = [],
+ _this = this;
+ obj = this._get_node(obj);
+ if(obj === -1 || !obj || !obj.length) { return false; }
+ obj.parentsUntil(".jstree", "li").each(function () {
+ p.push( id_mode ? this.id : _this.get_text(this) );
+ });
+ p.reverse();
+ p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
+ return p;
+ },
+
+ // string functions
+ _get_string : function (key) {
+ return this._get_settings().core.strings[key] || key;
+ },
+
+ is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
+ is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
+ is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
+ correct_state : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { return false; }
+ obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
+ this.__callback({ "obj" : obj });
+ },
+ // open/close
+ open_node : function (obj, callback, skip_animation) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+ t = this;
+ if(!this._is_loaded(obj)) {
+ obj.children("a").addClass("jstree-loading");
+ this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
+ }
+ else {
+ if(this._get_settings().core.open_parents) {
+ obj.parentsUntil(".jstree",".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ }
+ if(s) { obj.children("ul").css("display","none"); }
+ obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
+ if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
+ else { t.after_open(obj); }
+ this.__callback({ "obj" : obj });
+ if(callback) { callback.call(); }
+ }
+ },
+ after_open : function (obj) { this.__callback({ "obj" : obj }); },
+ close_node : function (obj, skip_animation) {
+ obj = this._get_node(obj);
+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+ t = this;
+ if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
+ if(s) { obj.children("ul").attr("style","display:block !important"); }
+ obj.removeClass("jstree-open").addClass("jstree-closed");
+ if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
+ else { t.after_close(obj); }
+ this.__callback({ "obj" : obj });
+ },
+ after_close : function (obj) { this.__callback({ "obj" : obj }); },
+ toggle_node : function (obj) {
+ obj = this._get_node(obj);
+ if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
+ if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
+ },
+ open_all : function (obj, do_animation, original_obj) {
+ obj = obj ? this._get_node(obj) : -1;
+ if(!obj || obj === -1) { obj = this.get_container_ul(); }
+ if(original_obj) {
+ obj = obj.find("li.jstree-closed");
+ }
+ else {
+ original_obj = obj;
+ if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
+ else { obj = obj.find("li.jstree-closed"); }
+ }
+ var _this = this;
+ obj.each(function () {
+ var __this = this;
+ if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
+ else { _this.open_node(this, false, !do_animation); }
+ });
+ // so that callback is fired AFTER all nodes are open
+ if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
+ },
+ close_all : function (obj, do_animation) {
+ var _this = this;
+ obj = obj ? this._get_node(obj) : this.get_container();
+ if(!obj || obj === -1) { obj = this.get_container_ul(); }
+ obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
+ this.__callback({ "obj" : obj });
+ },
+ clean_node : function (obj) {
+ obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
+ obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
+ obj.removeClass("jstree-last")
+ .filter("li:last-child").addClass("jstree-last").end()
+ .filter(":has(li)")
+ .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
+ obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
+ this.__callback({ "obj" : obj });
+ },
+ // rollback
+ get_rollback : function () {
+ this.__callback();
+ return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
+ },
+ set_rollback : function (html, data) {
+ this.get_container().empty().append(html);
+ this.data = data;
+ this.__callback();
+ },
+ // Dummy functions to be overwritten by any datastore plugin included
+ load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
+ _is_loaded : function (obj) { return true; },
+
+ // Basic operations: create
+ create_node : function (obj, position, js, callback, is_loaded) {
+ obj = this._get_node(obj);
+ position = typeof position === "undefined" ? "last" : position;
+ var d = $("<li />"),
+ s = this._get_settings().core,
+ tmp;
+
+ if(obj !== -1 && !obj.length) { return false; }
+ if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
+
+ this.__rollback();
+
+ if(typeof js === "string") { js = { "data" : js }; }
+ if(!js) { js = {}; }
+ if(js.attr) { d.attr(js.attr); }
+ if(js.metadata) { d.data(js.metadata); }
+ if(js.state) { d.addClass("jstree-" + js.state); }
+ if(!js.data) { js.data = this._get_string("new_node"); }
+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+ $.each(js.data, function (i, m) {
+ tmp = $("<a />");
+ if($.isFunction(m)) { m = m.call(this, js); }
+ if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
+ else {
+ if(!m.attr) { m.attr = {}; }
+ if(!m.attr.href) { m.attr.href = '#'; }
+ tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
+ if(m.language) { tmp.addClass(m.language); }
+ }
+ tmp.prepend("<ins class='jstree-icon'> </ins>");
+ if(!m.icon && js.icon) { m.icon = js.icon; }
+ if(m.icon) {
+ if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+ else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+ }
+ d.append(tmp);
+ });
+ d.prepend("<ins class='jstree-icon'> </ins>");
+ if(obj === -1) {
+ obj = this.get_container();
+ if(position === "before") { position = "first"; }
+ if(position === "after") { position = "last"; }
+ }
+ switch(position) {
+ case "before": obj.before(d); tmp = this._get_parent(obj); break;
+ case "after" : obj.after(d); tmp = this._get_parent(obj); break;
+ case "inside":
+ case "first" :
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ obj.children("ul").prepend(d);
+ tmp = obj;
+ break;
+ case "last":
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ obj.children("ul").append(d);
+ tmp = obj;
+ break;
+ default:
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ if(!position) { position = 0; }
+ tmp = obj.children("ul").children("li").eq(position);
+ if(tmp.length) { tmp.before(d); }
+ else { obj.children("ul").append(d); }
+ tmp = obj;
+ break;
+ }
+ if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
+ this.clean_node(tmp);
+ this.__callback({ "obj" : d, "parent" : tmp });
+ if(callback) { callback.call(this, d); }
+ return d;
+ },
+ // Basic operations: rename (deal with text)
+ get_text : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ var s = this._get_settings().core.html_titles;
+ obj = obj.children("a:eq(0)");
+ if(s) {
+ obj = obj.clone();
+ obj.children("INS").remove();
+ return obj.html();
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ return obj.nodeValue;
+ }
+ },
+ set_text : function (obj, val) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ obj = obj.children("a:eq(0)");
+ if(this._get_settings().core.html_titles) {
+ var tmp = obj.children("INS").clone();
+ obj.html(val).prepend(tmp);
+ this.__callback({ "obj" : obj, "name" : val });
+ return true;
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ this.__callback({ "obj" : obj, "name" : val });
+ return (obj.nodeValue = val);
+ }
+ },
+ rename_node : function (obj, val) {
+ obj = this._get_node(obj);
+ this.__rollback();
+ if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
+ },
+ // Basic operations: deleting nodes
+ delete_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ this.__rollback();
+ var p = this._get_parent(obj), prev = $([]), t = this;
+ obj.each(function () {
+ prev = prev.add(t._get_prev(this));
+ });
+ obj = obj.detach();
+ if(p !== -1 && p.find("> ul > li").length === 0) {
+ p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
+ }
+ this.clean_node(p);
+ this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
+ return obj;
+ },
+ prepare_move : function (o, r, pos, cb, is_cb) {
+ var p = {};
+
+ p.ot = $.jstree._reference(o) || this;
+ p.o = p.ot._get_node(o);
+ p.r = r === - 1 ? -1 : this._get_node(r);
+ p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
+ if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
+ this.__callback(prepared_move);
+ if(cb) { cb.call(this, prepared_move); }
+ return;
+ }
+ p.ot = $.jstree._reference(p.o) || this;
+ p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
+ if(p.r === -1 || !p.r) {
+ p.cr = -1;
+ switch(p.p) {
+ case "first":
+ case "before":
+ case "inside":
+ p.cp = 0;
+ break;
+ case "after":
+ case "last":
+ p.cp = p.rt.get_container().find(" > ul > li").length;
+ break;
+ default:
+ p.cp = p.p;
+ break;
+ }
+ }
+ else {
+ if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
+ return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
+ }
+ switch(p.p) {
+ case "before":
+ p.cp = p.r.index();
+ p.cr = p.rt._get_parent(p.r);
+ break;
+ case "after":
+ p.cp = p.r.index() + 1;
+ p.cr = p.rt._get_parent(p.r);
+ break;
+ case "inside":
+ case "first":
+ p.cp = 0;
+ p.cr = p.r;
+ break;
+ case "last":
+ p.cp = p.r.find(" > ul > li").length;
+ p.cr = p.r;
+ break;
+ default:
+ p.cp = p.p;
+ p.cr = p.r;
+ break;
+ }
+ }
+ p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
+ p.op = p.ot._get_parent(p.o);
+ p.cop = p.o.index();
+ if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
+ if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
+ //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
+ p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
+ prepared_move = p;
+ this.__callback(prepared_move);
+ if(cb) { cb.call(this, prepared_move); }
+ },
+ check_move : function () {
+ var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
+ if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
+ if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
+ obj.o.each(function () {
+ if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
+ });
+ return ret;
+ },
+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+ if(!is_prepared) {
+ return this.prepare_move(obj, ref, position, function (p) {
+ this.move_node(p, false, false, is_copy, true, skip_check);
+ });
+ }
+ if(is_copy) {
+ prepared_move.cy = true;
+ }
+ if(!skip_check && !this.check_move()) { return false; }
+
+ this.__rollback();
+ var o = false;
+ if(is_copy) {
+ o = obj.o.clone(true);
+ o.find("*[id]").andSelf().each(function () {
+ if(this.id) { this.id = "copy_" + this.id; }
+ });
+ }
+ else { o = obj.o; }
+
+ if(obj.or.length) { obj.or.before(o); }
+ else {
+ if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
+ obj.np.children("ul:eq(0)").append(o);
+ }
+
+ try {
+ obj.ot.clean_node(obj.op);
+ obj.rt.clean_node(obj.np);
+ if(!obj.op.find("> ul > li").length) {
+ obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
+ }
+ } catch (e) { }
+
+ if(is_copy) {
+ prepared_move.cy = true;
+ prepared_move.oc = o;
+ }
+ this.__callback(prepared_move);
+ return prepared_move;
+ },
+ _get_move : function () { return prepared_move; }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree ui plugin
+ * This plugins handles selecting/deselecting/hovering/dehovering nodes
+ */
+(function ($) {
+ var scrollbar_width, e1, e2;
+ $(function() {
+ if (/msie/.test(navigator.userAgent.toLowerCase())) {
+ e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+ e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+ scrollbar_width = e1.width() - e2.width();
+ e1.add(e2).remove();
+ }
+ else {
+ e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
+ .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
+ scrollbar_width = 100 - e1.width();
+ e1.parent().remove();
+ }
+ });
+ $.jstree.plugin("ui", {
+ __init : function () {
+ this.data.ui.selected = $();
+ this.data.ui.last_selected = false;
+ this.data.ui.hovered = null;
+ this.data.ui.to_select = this.get_settings().ui.initially_select;
+
+ this.get_container()
+ .delegate("a", "click.jstree", $.proxy(function (event) {
+ event.preventDefault();
+ event.currentTarget.blur();
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.select_node(event.currentTarget, true, event);
+ }
+ }, this))
+ .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.hover_node(event.target);
+ }
+ }, this))
+ .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.dehover_node(event.target);
+ }
+ }, this))
+ .bind("reopen.jstree", $.proxy(function () {
+ this.reselect();
+ }, this))
+ .bind("get_rollback.jstree", $.proxy(function () {
+ this.dehover_node();
+ this.save_selected();
+ }, this))
+ .bind("set_rollback.jstree", $.proxy(function () {
+ this.reselect();
+ }, this))
+ .bind("close_node.jstree", $.proxy(function (event, data) {
+ var s = this._get_settings().ui,
+ obj = this._get_node(data.rslt.obj),
+ clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
+ _this = this;
+ if(s.selected_parent_close === false || !clk.length) { return; }
+ clk.each(function () {
+ _this.deselect_node(this);
+ if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
+ });
+ }, this))
+ .bind("delete_node.jstree", $.proxy(function (event, data) {
+ var s = this._get_settings().ui.select_prev_on_delete,
+ obj = this._get_node(data.rslt.obj),
+ clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
+ _this = this;
+ clk.each(function () { _this.deselect_node(this); });
+ if(s && clk.length) {
+ data.rslt.prev.each(function () {
+ if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
+ });
+ }
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (event, data) {
+ if(data.rslt.cy) {
+ data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
+ }
+ }, this));
+ },
+ defaults : {
+ select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
+ select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
+ select_range_modifier : "shift",
+ selected_parent_close : "select_parent", // false, "deselect", "select_parent"
+ selected_parent_open : true,
+ select_prev_on_delete : true,
+ disable_selecting_children : false,
+ initially_select : []
+ },
+ _fn : {
+ _get_node : function (obj, allow_multiple) {
+ if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
+ var $obj = $(obj, this.get_container());
+ if($obj.is(".jstree") || obj == -1) { return -1; }
+ $obj = $obj.closest("li", this.get_container());
+ return $obj.length ? $obj : false;
+ },
+ _ui_notify : function (n, data) {
+ if(data.selected) {
+ this.select_node(n, false);
+ }
+ },
+ save_selected : function () {
+ var _this = this;
+ this.data.ui.to_select = [];
+ this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
+ this.__callback(this.data.ui.to_select);
+ },
+ reselect : function () {
+ var _this = this,
+ s = this.data.ui.to_select;
+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ // this.deselect_all(); WHY deselect, breaks plugin state notifier?
+ $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
+ this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
+ this.__callback();
+ },
+ refresh : function (obj) {
+ this.save_selected();
+ return this.__call_old();
+ },
+ hover_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
+ if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
+ this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
+ this._fix_scroll(obj);
+ this.__callback({ "obj" : obj });
+ },
+ dehover_node : function () {
+ var obj = this.data.ui.hovered, p;
+ if(!obj || !obj.length) { return false; }
+ p = obj.children("a").removeClass("jstree-hovered").parent();
+ if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
+ this.__callback({ "obj" : obj });
+ },
+ select_node : function (obj, check, e) {
+ obj = this._get_node(obj);
+ if(obj == -1 || !obj || !obj.length) { return false; }
+ var s = this._get_settings().ui,
+ is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
+ is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
+ is_selected = this.is_selected(obj),
+ proceed = true,
+ t = this;
+ if(check) {
+ if(s.disable_selecting_children && is_multiple &&
+ (
+ (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
+ (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
+ )
+ ) {
+ return false;
+ }
+ proceed = false;
+ switch(!0) {
+ case (is_range):
+ this.data.ui.last_selected.addClass("jstree-last-selected");
+ obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
+ if(s.select_limit == -1 || obj.length < s.select_limit) {
+ this.data.ui.last_selected.removeClass("jstree-last-selected");
+ this.data.ui.selected.each(function () {
+ if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
+ });
+ is_selected = false;
+ proceed = true;
+ }
+ else {
+ proceed = false;
+ }
+ break;
+ case (is_selected && !is_multiple):
+ this.deselect_all();
+ is_selected = false;
+ proceed = true;
+ break;
+ case (!is_selected && !is_multiple):
+ if(s.select_limit == -1 || s.select_limit > 0) {
+ this.deselect_all();
+ proceed = true;
+ }
+ break;
+ case (is_selected && is_multiple):
+ this.deselect_node(obj);
+ break;
+ case (!is_selected && is_multiple):
+ if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
+ proceed = true;
+ }
+ break;
+ }
+ }
+ if(proceed && !is_selected) {
+ if(!is_range) { this.data.ui.last_selected = obj; }
+ obj.children("a").addClass("jstree-clicked");
+ if(s.selected_parent_open) {
+ obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+ }
+ this.data.ui.selected = this.data.ui.selected.add(obj);
+ this._fix_scroll(obj.eq(0));
+ this.__callback({ "obj" : obj, "e" : e });
+ }
+ },
+ _fix_scroll : function (obj) {
+ var c = this.get_container()[0], t;
+ if(c.scrollHeight > c.offsetHeight) {
+ obj = this._get_node(obj);
+ if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
+ t = obj.offset().top - this.get_container().offset().top;
+ if(t < 0) {
+ c.scrollTop = c.scrollTop + t - 1;
+ }
+ if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
+ c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
+ }
+ }
+ },
+ deselect_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(this.is_selected(obj)) {
+ obj.children("a").removeClass("jstree-clicked");
+ this.data.ui.selected = this.data.ui.selected.not(obj);
+ if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
+ this.__callback({ "obj" : obj });
+ }
+ },
+ toggle_select : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(this.is_selected(obj)) { this.deselect_node(obj); }
+ else { this.select_node(obj); }
+ },
+ is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
+ get_selected : function (context) {
+ return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
+ },
+ deselect_all : function (context) {
+ var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
+ ret.children("a.jstree-clicked").removeClass("jstree-clicked");
+ this.data.ui.selected = $([]);
+ this.data.ui.last_selected = false;
+ this.__callback({ "obj" : ret });
+ }
+ }
+ });
+ // include the selection plugin by default
+ $.jstree.defaults.plugins.push("ui");
+})(jQuery);
+//*/
+
+/*
+ * jsTree CRRM plugin
+ * Handles creating/renaming/removing/moving nodes by user interaction.
+ */
+(function ($) {
+ $.jstree.plugin("crrm", {
+ __init : function () {
+ this.get_container()
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ if(this._get_settings().crrm.move.open_onmove) {
+ var t = this;
+ data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ }
+ }, this));
+ },
+ defaults : {
+ input_width_limit : 200,
+ move : {
+ always_copy : false, // false, true or "multitree"
+ open_onmove : true,
+ default_position : "last",
+ check_move : function (m) { return true; }
+ }
+ },
+ _fn : {
+ _show_input : function (obj, callback) {
+ obj = this._get_node(obj);
+ var rtl = this._get_settings().core.rtl,
+ w = this._get_settings().crrm.input_width_limit,
+ w1 = obj.children("ins").width(),
+ w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
+ t = this.get_text(obj),
+ h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
+ h2 = obj.css("position","relative").append(
+ $("<input />", {
+ "value" : t,
+ "class" : "jstree-rename-input",
+ // "size" : t.length,
+ "css" : {
+ "padding" : "0",
+ "border" : "1px solid silver",
+ "position" : "absolute",
+ "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
+ "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
+ "top" : "0px",
+ "height" : (this.data.core.li_height - 2) + "px",
+ "lineHeight" : (this.data.core.li_height - 2) + "px",
+ "width" : "150px" // will be set a bit further down
+ },
+ "blur" : $.proxy(function () {
+ var i = obj.children(".jstree-rename-input"),
+ v = i.val();
+ if(v === "") { v = t; }
+ h1.remove();
+ i.remove(); // rollback purposes
+ this.set_text(obj,t); // rollback purposes
+ this.rename_node(obj, v);
+ callback.call(this, obj, v, t);
+ obj.css("position","");
+ }, this),
+ "keyup" : function (event) {
+ var key = event.keyCode || event.which;
+ if(key == 27) { this.value = t; this.blur(); return; }
+ else if(key == 13) { this.blur(); return; }
+ else {
+ h2.width(Math.min(h1.text("pW" + this.value).width(),w));
+ }
+ },
+ "keypress" : function(event) {
+ var key = event.keyCode || event.which;
+ if(key == 13) { return false; }
+ }
+ })
+ ).children(".jstree-rename-input");
+ this.set_text(obj, "");
+ h1.css({
+ fontFamily : h2.css('fontFamily') || '',
+ fontSize : h2.css('fontSize') || '',
+ fontWeight : h2.css('fontWeight') || '',
+ fontStyle : h2.css('fontStyle') || '',
+ fontStretch : h2.css('fontStretch') || '',
+ fontVariant : h2.css('fontVariant') || '',
+ letterSpacing : h2.css('letterSpacing') || '',
+ wordSpacing : h2.css('wordSpacing') || ''
+ });
+ h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
+ },
+ rename : function (obj) {
+ obj = this._get_node(obj);
+ this.__rollback();
+ var f = this.__callback;
+ this._show_input(obj, function (obj, new_name, old_name) {
+ f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
+ });
+ },
+ create : function (obj, position, js, callback, skip_rename) {
+ var t, _this = this;
+ obj = this._get_node(obj);
+ if(!obj) { obj = -1; }
+ this.__rollback();
+ t = this.create_node(obj, position, js, function (t) {
+ var p = this._get_parent(t),
+ pos = $(t).index();
+ if(callback) { callback.call(this, t); }
+ if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
+ if(!skip_rename) {
+ this._show_input(t, function (obj, new_name, old_name) {
+ _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
+ });
+ }
+ else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
+ });
+ return t;
+ },
+ remove : function (obj) {
+ obj = this._get_node(obj, true);
+ var p = this._get_parent(obj), prev = this._get_prev(obj);
+ this.__rollback();
+ obj = this.delete_node(obj);
+ if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var s = this._get_settings().crrm.move;
+ if(!s.check_move.call(this, this._get_move())) { return false; }
+ return true;
+ },
+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+ var s = this._get_settings().crrm.move;
+ if(!is_prepared) {
+ if(typeof position === "undefined") { position = s.default_position; }
+ if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
+ return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
+ }
+ // if the move is already prepared
+ if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
+ is_copy = true;
+ }
+ this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
+ },
+
+ cut : function (obj) {
+ obj = this._get_node(obj, true);
+ if(!obj || !obj.length) { return false; }
+ this.data.crrm.cp_nodes = false;
+ this.data.crrm.ct_nodes = obj;
+ this.__callback({ "obj" : obj });
+ },
+ copy : function (obj) {
+ obj = this._get_node(obj, true);
+ if(!obj || !obj.length) { return false; }
+ this.data.crrm.ct_nodes = false;
+ this.data.crrm.cp_nodes = obj;
+ this.__callback({ "obj" : obj });
+ },
+ paste : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj || !obj.length) { return false; }
+ var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
+ if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
+ if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
+ if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
+ this.__callback({ "obj" : obj, "nodes" : nodes });
+ }
+ }
+ });
+ // include the crr plugin by default
+ // $.jstree.defaults.plugins.push("crrm");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themes plugin
+ * Handles loading and setting themes, as well as detecting path to themes, etc.
+ */
+(function ($) {
+ var themes_loaded = [];
+ // this variable stores the path to the themes folder - if left as false - it will be autodetected
+ $.jstree._themes = false;
+ $.jstree.plugin("themes", {
+ __init : function () {
+ this.get_container()
+ .bind("init.jstree", $.proxy(function () {
+ var s = this._get_settings().themes;
+ this.data.themes.dots = s.dots;
+ this.data.themes.icons = s.icons;
+ this.set_theme(s.theme, s.url);
+ }, this))
+ .bind("loaded.jstree", $.proxy(function () {
+ // bound here too, as simple HTML tree's won't honor dots & icons otherwise
+ if(!this.data.themes.dots) { this.hide_dots(); }
+ else { this.show_dots(); }
+ if(!this.data.themes.icons) { this.hide_icons(); }
+ else { this.show_icons(); }
+ }, this));
+ },
+ defaults : {
+ theme : "default",
+ url : false,
+ dots : true,
+ icons : true
+ },
+ _fn : {
+ set_theme : function (theme_name, theme_url) {
+ if(!theme_name) { return false; }
+ if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
+ if($.inArray(theme_url, themes_loaded) == -1) {
+ $.vakata.css.add_sheet({ "url" : theme_url });
+ themes_loaded.push(theme_url);
+ }
+ if(this.data.themes.theme != theme_name) {
+ this.get_container().removeClass('jstree-' + this.data.themes.theme);
+ this.data.themes.theme = theme_name;
+ }
+ this.get_container().addClass('jstree-' + theme_name);
+ if(!this.data.themes.dots) { this.hide_dots(); }
+ else { this.show_dots(); }
+ if(!this.data.themes.icons) { this.hide_icons(); }
+ else { this.show_icons(); }
+ this.__callback();
+ },
+ get_theme : function () { return this.data.themes.theme; },
+
+ show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
+ hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
+ toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
+
+ show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
+ hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
+ toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
+ }
+ });
+ // autodetect themes path
+ $(function () {
+ if($.jstree._themes === false) {
+ $("script").each(function () {
+ if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
+ $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
+ return false;
+ }
+ });
+ }
+ if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
+ });
+ // include the themes plugin by default
+ $.jstree.defaults.plugins.push("themes");
+})(jQuery);
+//*/
+
+/*
+ * jsTree hotkeys plugin
+ * Enables keyboard navigation for all tree instances
+ * Depends on the jstree ui & jquery hotkeys plugins
+ */
+(function ($) {
+ var bound = [];
+ function exec(i, event) {
+ var f = $.jstree._focused(), tmp;
+ if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
+ tmp = f._get_settings().hotkeys[i];
+ if(tmp) { return tmp.call(f, event); }
+ }
+ }
+ $.jstree.plugin("hotkeys", {
+ __init : function () {
+ if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
+ if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
+ $.each(this._get_settings().hotkeys, function (i, v) {
+ if(v !== false && $.inArray(i, bound) == -1) {
+ $(document).bind("keydown", i, function (event) { return exec(i, event); });
+ bound.push(i);
+ }
+ });
+ this.get_container()
+ .bind("lock.jstree", $.proxy(function () {
+ if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
+ }, this))
+ .bind("unlock.jstree", $.proxy(function () {
+ if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
+ }, this));
+ this.enable_hotkeys();
+ },
+ defaults : {
+ "up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "ctrl+up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "shift+up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "ctrl+down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "shift+down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "ctrl+left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "shift+left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "ctrl+right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "shift+right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "space" : function () {
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
+ return false;
+ },
+ "ctrl+space" : function (event) {
+ event.type = "click";
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+ return false;
+ },
+ "shift+space" : function (event) {
+ event.type = "click";
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+ return false;
+ },
+ "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
+ "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
+ },
+ _fn : {
+ enable_hotkeys : function () {
+ this.data.hotkeys.enabled = true;
+ },
+ disable_hotkeys : function () {
+ this.data.hotkeys.enabled = false;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree JSON plugin
+ * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.jstree.plugin("json_data", {
+ __init : function() {
+ var s = this._get_settings().json_data;
+ if(s.progressive_unload) {
+ this.get_container().bind("after_close.jstree", function (e, data) {
+ data.rslt.obj.children("ul").remove();
+ });
+ }
+ },
+ defaults : {
+ // `data` can be a function:
+ // * accepts two arguments - node being loaded and a callback to pass the result to
+ // * will be executed in the current tree's scope & ajax won't be supported
+ data : false,
+ ajax : false,
+ correct_state : true,
+ progressive_render : false,
+ progressive_unload : false
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ var s = this._get_settings().json_data;
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
+ },
+ refresh : function (obj) {
+ obj = this._get_node(obj);
+ var s = this._get_settings().json_data;
+ if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
+ obj.removeData("jstree_children");
+ }
+ return this.__call_old();
+ },
+ load_node_json : function (obj, s_call, e_call) {
+ var s = this.get_settings().json_data, d,
+ error_func = function () {},
+ success_func = function () {};
+ obj = this._get_node(obj);
+
+ if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
+ d = this._parse_json(obj.data("jstree_children"), obj);
+ if(d) {
+ obj.append(d);
+ if(!s.progressive_unload) { obj.removeData("jstree_children"); }
+ }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ return;
+ }
+
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+ // function option added here for easier model integration (also supporting async - see callback)
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ d = this._parse_json(d, obj);
+ if(!d) {
+ if(obj === -1 || !obj) {
+ if(s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ else {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) { this.correct_state(obj); }
+ }
+ if(e_call) { e_call.call(this); }
+ }
+ else {
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }, this));
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ d = this._parse_json(s.data, obj);
+ if(d) {
+ this.get_container().children("ul").empty().append(d.children());
+ this.clean_node();
+ }
+ else {
+ if(s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().json_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj != -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().json_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
+ return error_func.call(this, x, t, "");
+ }
+ d = this._parse_json(d, obj);
+ if(d) {
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj === -1 || !obj) {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ },
+ _parse_json : function (js, obj, is_callback) {
+ var d = false,
+ p = this._get_settings(),
+ s = p.json_data,
+ t = p.core.html_titles,
+ tmp, i, j, ul1, ul2;
+
+ if(!js) { return d; }
+ if(s.progressive_unload && obj && obj !== -1) {
+ obj.data("jstree_children", d);
+ }
+ if($.isArray(js)) {
+ d = $();
+ if(!js.length) { return false; }
+ for(i = 0, j = js.length; i < j; i++) {
+ tmp = this._parse_json(js[i], obj, true);
+ if(tmp.length) { d = d.add(tmp); }
+ }
+ }
+ else {
+ if(typeof js == "string") { js = { data : js }; }
+ if(!js.data && js.data !== "") { return d; }
+ d = $("<li />");
+ if(js.attr) { d.attr(js.attr); }
+ if(js.metadata) { d.data(js.metadata); }
+ if(js.state) { d.addClass("jstree-" + js.state); }
+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+ $.each(js.data, function (i, m) {
+ tmp = $("<a />");
+ if($.isFunction(m)) { m = m.call(this, js); }
+ if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
+ else {
+ if(!m.attr) { m.attr = {}; }
+ if(!m.attr.href) { m.attr.href = '#'; }
+ tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
+ if(m.language) { tmp.addClass(m.language); }
+ }
+ tmp.prepend("<ins class='jstree-icon'> </ins>");
+ if(!m.icon && js.icon) { m.icon = js.icon; }
+ if(m.icon) {
+ if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+ else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+ }
+ d.append(tmp);
+ });
+ d.prepend("<ins class='jstree-icon'> </ins>");
+ if(js.children) {
+ if(s.progressive_render && js.state !== "open") {
+ d.addClass("jstree-closed").data("jstree_children", js.children);
+ }
+ else {
+ if(s.progressive_unload) { d.data("jstree_children", js.children); }
+ if($.isArray(js.children) && js.children.length) {
+ tmp = this._parse_json(js.children, obj, true);
+ if(tmp.length) {
+ ul2 = $("<ul />");
+ ul2.append(tmp);
+ d.append(ul2);
+ }
+ }
+ }
+ }
+ }
+ if(!is_callback) {
+ ul1 = $("<ul />");
+ ul1.append(d);
+ d = ul1;
+ }
+ return d;
+ },
+ get_json : function (obj, li_attr, a_attr, is_callback) {
+ var result = [],
+ s = this._get_settings(),
+ _this = this,
+ tmp1, tmp2, li, a, t, lang;
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+ if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
+ a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+ obj.each(function () {
+ li = $(this);
+ tmp1 = { data : [] };
+ if(li_attr.length) { tmp1.attr = { }; }
+ $.each(li_attr, function (i, v) {
+ tmp2 = li.attr(v);
+ if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
+ tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ }
+ });
+ if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
+ if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
+ if(li.data()) { tmp1.metadata = li.data(); }
+ a = li.children("a");
+ a.each(function () {
+ t = $(this);
+ if(
+ a_attr.length ||
+ $.inArray("languages", s.plugins) !== -1 ||
+ t.children("ins").get(0).style.backgroundImage.length ||
+ (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
+ ) {
+ lang = false;
+ if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+ $.each(s.languages, function (l, lv) {
+ if(t.hasClass(lv)) {
+ lang = lv;
+ return false;
+ }
+ });
+ }
+ tmp2 = { attr : { }, title : _this.get_text(t, lang) };
+ $.each(a_attr, function (k, z) {
+ tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ });
+ if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+ $.each(s.languages, function (k, z) {
+ if(t.hasClass(z)) { tmp2.language = z; return true; }
+ });
+ }
+ if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+ tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ }
+ if(t.children("ins").get(0).style.backgroundImage.length) {
+ tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
+ }
+ }
+ else {
+ tmp2 = _this.get_text(t);
+ }
+ if(a.length > 1) { tmp1.data.push(tmp2); }
+ else { tmp1.data = tmp2; }
+ });
+ li = li.find("> ul > li");
+ if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
+ result.push(tmp1);
+ });
+ return result;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree languages plugin
+ * Adds support for multiple language versions in one tree
+ * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
+ * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
+ */
+(function ($) {
+ $.jstree.plugin("languages", {
+ __init : function () { this._load_css(); },
+ defaults : [],
+ _fn : {
+ set_lang : function (i) {
+ var langs = this._get_settings().languages,
+ st = false,
+ selector = ".jstree-" + this.get_index() + ' a';
+ if(!$.isArray(langs) || langs.length === 0) { return false; }
+ if($.inArray(i,langs) == -1) {
+ if(!!langs[i]) { i = langs[i]; }
+ else { return false; }
+ }
+ if(i == this.data.languages.current_language) { return true; }
+ st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
+ if(st !== false) { st.style.display = "none"; }
+ st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
+ if(st !== false) { st.style.display = ""; }
+ this.data.languages.current_language = i;
+ this.__callback(i);
+ return true;
+ },
+ get_lang : function () {
+ return this.data.languages.current_language;
+ },
+ _get_string : function (key, lang) {
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.strings;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ }
+ if(s[lang] && s[lang][key]) { return s[lang][key]; }
+ if(s[key]) { return s[key]; }
+ return key;
+ },
+ get_text : function (obj, lang) {
+ obj = this._get_node(obj) || this.data.ui.last_selected;
+ if(!obj.size()) { return false; }
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.html_titles;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ obj = obj.children("a." + lang);
+ }
+ else { obj = obj.children("a:eq(0)"); }
+ if(s) {
+ obj = obj.clone();
+ obj.children("INS").remove();
+ return obj.html();
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ return obj.nodeValue;
+ }
+ },
+ set_text : function (obj, val, lang) {
+ obj = this._get_node(obj) || this.data.ui.last_selected;
+ if(!obj.size()) { return false; }
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.html_titles,
+ tmp;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ obj = obj.children("a." + lang);
+ }
+ else { obj = obj.children("a:eq(0)"); }
+ if(s) {
+ tmp = obj.children("INS").clone();
+ obj.html(val).prepend(tmp);
+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+ return true;
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+ return (obj.nodeValue = val);
+ }
+ },
+ _load_css : function () {
+ var langs = this._get_settings().languages,
+ str = "/* languages css */",
+ selector = ".jstree-" + this.get_index() + ' a',
+ ln;
+ if($.isArray(langs) && langs.length) {
+ this.data.languages.current_language = langs[0];
+ for(ln = 0; ln < langs.length; ln++) {
+ str += selector + "." + langs[ln] + " {";
+ if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
+ str += " } ";
+ }
+ this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
+ }
+ },
+ create_node : function (obj, position, js, callback) {
+ var t = this.__call_old(true, obj, position, js, function (t) {
+ var langs = this._get_settings().languages,
+ a = t.children("a"),
+ ln;
+ if($.isArray(langs) && langs.length) {
+ for(ln = 0; ln < langs.length; ln++) {
+ if(!a.is("." + langs[ln])) {
+ t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
+ }
+ }
+ a.not("." + langs.join(", .")).remove();
+ }
+ if(callback) { callback.call(this, t); }
+ });
+ return t;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree cookies plugin
+ * Stores the currently opened/selected nodes in a cookie and then restores them
+ * Depends on the jquery.cookie plugin
+ */
+(function ($) {
+ $.jstree.plugin("cookies", {
+ __init : function () {
+ if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
+
+ var s = this._get_settings().cookies,
+ tmp;
+ if(!!s.save_loaded) {
+ tmp = $.cookie(s.save_loaded);
+ if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
+ }
+ if(!!s.save_opened) {
+ tmp = $.cookie(s.save_opened);
+ if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
+ }
+ if(!!s.save_selected) {
+ tmp = $.cookie(s.save_selected);
+ if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
+ }
+ this.get_container()
+ .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
+ this.get_container()
+ .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
+ if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
+ }, this));
+ }, this));
+ },
+ defaults : {
+ save_loaded : "jstree_load",
+ save_opened : "jstree_open",
+ save_selected : "jstree_select",
+ auto_save : true,
+ cookie_options : {}
+ },
+ _fn : {
+ save_cookie : function (c) {
+ if(this.data.core.refreshing) { return; }
+ var s = this._get_settings().cookies;
+ if(!c) { // if called manually and not by event
+ if(s.save_loaded) {
+ this.save_loaded();
+ $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+ }
+ if(s.save_opened) {
+ this.save_opened();
+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+ }
+ if(s.save_selected && this.data.ui) {
+ this.save_selected();
+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+ }
+ return;
+ }
+ switch(c) {
+ case "open_node":
+ case "close_node":
+ if(!!s.save_opened) {
+ this.save_opened();
+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+ }
+ if(!!s.save_loaded) {
+ this.save_loaded();
+ $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+ }
+ break;
+ case "select_node":
+ case "deselect_node":
+ if(!!s.save_selected && this.data.ui) {
+ this.save_selected();
+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+ }
+ break;
+ }
+ }
+ }
+ });
+ // include cookies by default
+ // $.jstree.defaults.plugins.push("cookies");
+})(jQuery);
+//*/
+
+/*
+ * jsTree sort plugin
+ * Sorts items alphabetically (or using any other function)
+ */
+(function ($) {
+ $.jstree.plugin("sort", {
+ __init : function () {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var obj = this._get_node(data.rslt.obj);
+ obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
+ this.sort(obj);
+ }, this))
+ .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
+ this.sort(data.rslt.obj.parent());
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
+ this.sort(m.children("ul"));
+ }, this));
+ },
+ defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
+ _fn : {
+ sort : function (obj) {
+ var s = this._get_settings().sort,
+ t = this;
+ obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
+ obj.find("> li > ul").each(function() { t.sort($(this)); });
+ this.clean_node(obj);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree DND plugin
+ * Drag and drop plugin for moving/copying nodes
+ */
+(function ($) {
+ var o = false,
+ r = false,
+ m = false,
+ ml = false,
+ sli = false,
+ sti = false,
+ dir1 = false,
+ dir2 = false,
+ last_pos = false;
+ $.vakata.dnd = {
+ is_down : false,
+ is_drag : false,
+ helper : false,
+ scroll_spd : 10,
+ init_x : 0,
+ init_y : 0,
+ threshold : 5,
+ helper_left : 5,
+ helper_top : 10,
+ user_data : {},
+
+ drag_start : function (e, data, html) {
+ if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
+ try {
+ e.currentTarget.unselectable = "on";
+ e.currentTarget.onselectstart = function() { return false; };
+ if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
+ } catch(err) { }
+ $.vakata.dnd.init_x = e.pageX;
+ $.vakata.dnd.init_y = e.pageY;
+ $.vakata.dnd.user_data = data;
+ $.vakata.dnd.is_down = true;
+ $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
+ $(document).bind("mousemove", $.vakata.dnd.drag);
+ $(document).bind("mouseup", $.vakata.dnd.drag_stop);
+ return false;
+ },
+ drag : function (e) {
+ if(!$.vakata.dnd.is_down) { return; }
+ if(!$.vakata.dnd.is_drag) {
+ if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
+ $.vakata.dnd.helper.appendTo("body");
+ $.vakata.dnd.is_drag = true;
+ $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ }
+ else { return; }
+ }
+
+ // maybe use a scrolling parent element instead of document?
+ if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
+ var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
+ if(e.pageY - t < 20) {
+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+ if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+ }
+ if($(window).height() - (e.pageY - t) < 20) {
+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+ if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+ }
+
+ if(e.pageX - l < 20) {
+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+ if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+ }
+ if($(window).width() - (e.pageX - l) < 20) {
+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+ if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+ }
+ }
+
+ $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
+ $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ },
+ drag_stop : function (e) {
+ if(sli) { clearInterval(sli); }
+ if(sti) { clearInterval(sti); }
+ $(document).unbind("mousemove", $.vakata.dnd.drag);
+ $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
+ $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ $.vakata.dnd.helper.remove();
+ $.vakata.dnd.init_x = 0;
+ $.vakata.dnd.init_y = 0;
+ $.vakata.dnd.user_data = {};
+ $.vakata.dnd.is_down = false;
+ $.vakata.dnd.is_drag = false;
+ }
+ };
+ $(function() {
+ var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+ });
+
+ $.jstree.plugin("dnd", {
+ __init : function () {
+ this.data.dnd = {
+ active : false,
+ after : false,
+ inside : false,
+ before : false,
+ off : false,
+ prepared : false,
+ w : 0,
+ to1 : false,
+ to2 : false,
+ cof : false,
+ cw : false,
+ ch : false,
+ i1 : false,
+ i2 : false,
+ mto : false
+ };
+ this.get_container()
+ .bind("mouseenter.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(this.data.themes) {
+ m.attr("class", "jstree-" + this.data.themes.theme);
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ //if($(e.currentTarget).find("> ul > li").length === 0) {
+ if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+ var tr = $.jstree._reference(e.target), dc;
+ if(tr.data.dnd.foreign) {
+ dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }
+ else {
+ tr.prepare_move(o, tr.get_container(), "last");
+ if(tr.check_move()) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }
+ }
+ }
+ }, this))
+ .bind("mouseup.jstree", $.proxy(function (e) {
+ //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+ var tr = $.jstree._reference(e.currentTarget), dc;
+ if(tr.data.dnd.foreign) {
+ dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+ tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ }
+ }
+ else {
+ tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
+ }
+ }
+ }, this))
+ .bind("mouseleave.jstree", $.proxy(function (e) {
+ if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+ return false;
+ }
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ }
+ }
+ }, this))
+ .bind("mousemove.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ var cnt = this.get_container()[0];
+
+ // Horizontal scroll
+ if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else if(e.pageX - 24 < this.data.dnd.cof.left) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ }
+
+ // Vertical scroll
+ if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else if(e.pageY - 24 < this.data.dnd.cof.top) {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ }
+
+ }
+ }, this))
+ .bind("scroll.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
+ m.hide();
+ ml.hide();
+ }
+ }, this))
+ .delegate("a", "mousedown.jstree", $.proxy(function (e) {
+ if(e.which === 1) {
+ this.start_drag(e.currentTarget, e);
+ return false;
+ }
+ }, this))
+ .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ this.dnd_enter(e.currentTarget);
+ }
+ }, this))
+ .delegate("a", "mousemove.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
+ this.dnd_enter(e.currentTarget);
+ }
+ if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
+ this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
+ if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
+ this.dnd_show();
+ }
+ }, this))
+ .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+ return false;
+ }
+ if(m) { m.hide(); }
+ if(ml) { ml.hide(); }
+ /*
+ var ec = $(e.currentTarget).closest("li"),
+ er = $(e.relatedTarget).closest("li");
+ if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
+ if(m) { m.hide(); }
+ if(ml) { ml.hide(); }
+ }
+ */
+ this.data.dnd.mto = setTimeout(
+ (function (t) { return function () { t.dnd_leave(e); }; })(this),
+ 0);
+ }
+ }, this))
+ .delegate("a", "mouseup.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ this.dnd_finish(e);
+ }
+ }, this));
+
+ $(document)
+ .bind("drag_stop.vakata", $.proxy(function () {
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.after = false;
+ this.data.dnd.before = false;
+ this.data.dnd.inside = false;
+ this.data.dnd.off = false;
+ this.data.dnd.prepared = false;
+ this.data.dnd.w = false;
+ this.data.dnd.to1 = false;
+ this.data.dnd.to2 = false;
+ this.data.dnd.i1 = false;
+ this.data.dnd.i2 = false;
+ this.data.dnd.active = false;
+ this.data.dnd.foreign = false;
+ if(m) { m.css({ "top" : "-2000px" }); }
+ if(ml) { ml.css({ "top" : "-2000px" }); }
+ }, this))
+ .bind("drag_start.vakata", $.proxy(function (e, data) {
+ if(data.data.jstree) {
+ var et = $(data.event.target);
+ if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
+ this.dnd_enter(et);
+ }
+ }
+ }, this));
+ /*
+ .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
+ var h = $.vakata.dnd.helper.children("ins");
+ if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
+ h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
+ }
+ else {
+ h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
+ }
+ }
+ }, this)); */
+
+
+
+ var s = this._get_settings().dnd;
+ if(s.drag_target) {
+ $(document)
+ .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
+ o = e.target;
+ $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
+ if(this.data.themes) {
+ if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ var cnt = this.get_container();
+ this.data.dnd.cof = cnt.offset();
+ this.data.dnd.cw = parseInt(cnt.width(),10);
+ this.data.dnd.ch = parseInt(cnt.height(),10);
+ this.data.dnd.foreign = true;
+ e.preventDefault();
+ }, this));
+ }
+ if(s.drop_target) {
+ $(document)
+ .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }, this))
+ .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ }
+ }, this))
+ .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+ this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
+ }
+ }, this));
+ }
+ },
+ defaults : {
+ copy_modifier : "ctrl",
+ check_timeout : 100,
+ open_timeout : 500,
+ drop_target : ".jstree-drop",
+ drop_check : function (data) { return true; },
+ drop_finish : $.noop,
+ drag_target : ".jstree-draggable",
+ drag_finish : $.noop,
+ drag_check : function (data) { return { after : false, before : false, inside : true }; }
+ },
+ _fn : {
+ dnd_prepare : function () {
+ if(!r || !r.length) { return; }
+ this.data.dnd.off = r.offset();
+ if(this._get_settings().core.rtl) {
+ this.data.dnd.off.right = this.data.dnd.off.left + r.width();
+ }
+ if(this.data.dnd.foreign) {
+ var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
+ this.data.dnd.after = a.after;
+ this.data.dnd.before = a.before;
+ this.data.dnd.inside = a.inside;
+ this.data.dnd.prepared = true;
+ return this.dnd_show();
+ }
+ this.prepare_move(o, r, "before");
+ this.data.dnd.before = this.check_move();
+ this.prepare_move(o, r, "after");
+ this.data.dnd.after = this.check_move();
+ if(this._is_loaded(r)) {
+ this.prepare_move(o, r, "inside");
+ this.data.dnd.inside = this.check_move();
+ }
+ else {
+ this.data.dnd.inside = false;
+ }
+ this.data.dnd.prepared = true;
+ return this.dnd_show();
+ },
+ dnd_show : function () {
+ if(!this.data.dnd.prepared) { return; }
+ var o = ["before","inside","after"],
+ r = false,
+ rtl = this._get_settings().core.rtl,
+ pos;
+ if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
+ else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
+ o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
+ }
+ else { o = ["after","inside","before"]; }
+ $.each(o, $.proxy(function (i, val) {
+ if(this.data.dnd[val]) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ r = val;
+ return false;
+ }
+ }, this));
+ if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
+
+ pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
+ switch(r) {
+ case "before":
+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
+ if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
+ break;
+ case "after":
+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
+ if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
+ break;
+ case "inside":
+ m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
+ if(ml) { ml.hide(); }
+ break;
+ default:
+ m.hide();
+ if(ml) { ml.hide(); }
+ break;
+ }
+ last_pos = r;
+ return r;
+ },
+ dnd_open : function () {
+ this.data.dnd.to2 = false;
+ this.open_node(r, $.proxy(this.dnd_prepare,this), true);
+ },
+ dnd_finish : function (e) {
+ if(this.data.dnd.foreign) {
+ if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
+ this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
+ }
+ }
+ else {
+ this.dnd_prepare();
+ this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
+ }
+ o = false;
+ r = false;
+ m.hide();
+ if(ml) { ml.hide(); }
+ },
+ dnd_enter : function (obj) {
+ if(this.data.dnd.mto) {
+ clearTimeout(this.data.dnd.mto);
+ this.data.dnd.mto = false;
+ }
+ var s = this._get_settings().dnd;
+ this.data.dnd.prepared = false;
+ r = this._get_node(obj);
+ if(s.check_timeout) {
+ // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
+ }
+ else {
+ this.dnd_prepare();
+ }
+ if(s.open_timeout) {
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if(r && r.length && r.hasClass("jstree-closed")) {
+ // if the node is closed - open it, then recalculate
+ this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
+ }
+ }
+ else {
+ if(r && r.length && r.hasClass("jstree-closed")) {
+ this.dnd_open();
+ }
+ }
+ },
+ dnd_leave : function (e) {
+ this.data.dnd.after = false;
+ this.data.dnd.before = false;
+ this.data.dnd.inside = false;
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ m.hide();
+ if(ml) { ml.hide(); }
+ if(r && r[0] === e.target.parentNode) {
+ if(this.data.dnd.to1) {
+ clearTimeout(this.data.dnd.to1);
+ this.data.dnd.to1 = false;
+ }
+ if(this.data.dnd.to2) {
+ clearTimeout(this.data.dnd.to2);
+ this.data.dnd.to2 = false;
+ }
+ }
+ },
+ start_drag : function (obj, e) {
+ o = this._get_node(obj);
+ if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
+ var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
+ cnt = this.get_container();
+ if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"<").replace(/>/ig,">"); }
+ $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
+ if(this.data.themes) {
+ if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ this.data.dnd.cof = cnt.offset();
+ this.data.dnd.cw = parseInt(cnt.width(),10);
+ this.data.dnd.ch = parseInt(cnt.height(),10);
+ this.data.dnd.active = true;
+ }
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
+ ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
+ '} ' +
+ '#vakata-dragged .jstree-ok { background:green; } ' +
+ '#vakata-dragged .jstree-invalid { background:red; } ' +
+ '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
+ '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
+ ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
+ ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
+ '}' +
+ '';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ m = $("<div />").attr({ id : "jstree-marker" }).hide().html("»")
+ .bind("mouseleave mouseenter", function (e) {
+ m.hide();
+ ml.hide();
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ })
+ .appendTo("body");
+ ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
+ .bind("mouseup", function (e) {
+ if(r && r.length) {
+ r.children("a").trigger(e);
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ })
+ .bind("mouseleave", function (e) {
+ var rt = $(e.relatedTarget);
+ if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
+ if(r && r.length) {
+ r.children("a").trigger(e);
+ m.hide();
+ ml.hide();
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ })
+ .appendTo("body");
+ $(document).bind("drag_start.vakata", function (e, data) {
+ if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
+ });
+ $(document).bind("drag_stop.vakata", function (e, data) {
+ if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
+ });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree checkbox plugin
+ * Inserts checkboxes in front of every node
+ * Depends on the ui plugin
+ * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
+ */
+(function ($) {
+ $.jstree.plugin("checkbox", {
+ __init : function () {
+ this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
+ if(this.data.ui && this.data.checkbox.noui) {
+ this.select_node = this.deselect_node = this.deselect_all = $.noop;
+ this.get_selected = this.get_checked;
+ }
+
+ this.get_container()
+ .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
+ this._prepare_checkboxes(data.rslt.obj);
+ }, this))
+ .bind("loaded.jstree", $.proxy(function (e) {
+ this._prepare_checkboxes();
+ }, this))
+ .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
+ e.preventDefault();
+ if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
+ else { this.check_node(e.target); }
+ if(this.data.ui && this.data.checkbox.noui) {
+ this.save_selected();
+ if(this.data.cookies) { this.save_cookie("select_node"); }
+ }
+ else {
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }, this));
+ },
+ defaults : {
+ override_ui : false,
+ two_state : false,
+ real_checkboxes : false,
+ checked_parent_open : true,
+ real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
+ },
+ __destroy : function () {
+ this.get_container()
+ .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
+ .find("ins.jstree-checkbox").remove();
+ },
+ _fn : {
+ _checkbox_notify : function (n, data) {
+ if(data.checked) {
+ this.check_node(n, false);
+ }
+ },
+ _prepare_checkboxes : function (obj) {
+ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+ if(obj === false) { return; } // added for removing root nodes
+ var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
+ obj.each(function () {
+ t = $(this);
+ c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
+ t.find("li").andSelf().each(function () {
+ var $t = $(this), nm;
+ $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
+ if(rc) {
+ if(!$t.children(":checkbox").length) {
+ nm = rcn.call(_this, $t);
+ $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
+ }
+ else {
+ $t.children(":checkbox").addClass("jstree-real-checkbox");
+ }
+ }
+ if(!ts) {
+ if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
+ $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
+ }
+ }
+ else {
+ if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
+ $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
+ }
+ }
+ });
+ });
+ if(!ts) {
+ obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
+ }
+ },
+ change_state : function (obj, state) {
+ obj = this._get_node(obj);
+ var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
+ if(!obj || obj === -1) { return false; }
+ state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
+ if(this._get_settings().checkbox.two_state) {
+ if(state) {
+ obj.removeClass("jstree-checked").addClass("jstree-unchecked");
+ if(rc) { obj.children(":checkbox").prop("checked", false); }
+ }
+ else {
+ obj.removeClass("jstree-unchecked").addClass("jstree-checked");
+ if(rc) { obj.children(":checkbox").prop("checked", true); }
+ }
+ }
+ else {
+ if(state) {
+ coll = obj.find("li").andSelf();
+ if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
+ coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+ if(rc) { coll.children(":checkbox").prop("checked", false); }
+ }
+ else {
+ coll = obj.find("li").andSelf();
+ if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
+ coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+ if(rc) { coll.children(":checkbox").prop("checked", true); }
+ if(this.data.ui) { this.data.ui.last_selected = obj; }
+ this.data.checkbox.last_selected = obj;
+ }
+ obj.parentsUntil(".jstree", "li").each(function () {
+ var $this = $(this);
+ if(state) {
+ if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
+ $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+ return false;
+ }
+ else {
+ $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+ if(rc) { $this.children(":checkbox").prop("checked", false); }
+ }
+ }
+ else {
+ if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
+ $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+ return false;
+ }
+ else {
+ $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+ if(rc) { $this.children(":checkbox").prop("checked", true); }
+ }
+ }
+ });
+ }
+ if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
+ this.__callback(obj);
+ return true;
+ },
+ check_node : function (obj) {
+ if(this.change_state(obj, false)) {
+ obj = this._get_node(obj);
+ if(this._get_settings().checkbox.checked_parent_open) {
+ var t = this;
+ obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+ }
+ this.__callback({ "obj" : obj });
+ }
+ },
+ uncheck_node : function (obj) {
+ if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
+ },
+ check_all : function () {
+ var _this = this,
+ coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+ coll.each(function () {
+ _this.change_state(this, false);
+ });
+ this.__callback();
+ },
+ uncheck_all : function () {
+ var _this = this,
+ coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+ coll.each(function () {
+ _this.change_state(this, true);
+ });
+ this.__callback();
+ },
+
+ is_checked : function(obj) {
+ obj = this._get_node(obj);
+ return obj.length ? obj.is(".jstree-checked") : false;
+ },
+ get_checked : function (obj, get_all) {
+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+ return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
+ },
+ get_unchecked : function (obj, get_all) {
+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+ return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
+ },
+
+ show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
+ hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
+
+ _repair_state : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return; }
+ if(this._get_settings().checkbox.two_state) {
+ obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
+ return;
+ }
+ var rc = this._get_settings().checkbox.real_checkboxes,
+ a = obj.find("> ul > .jstree-checked").length,
+ b = obj.find("> ul > .jstree-undetermined").length,
+ c = obj.find("> ul > li").length;
+ if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
+ else if(a === 0 && b === 0) { this.change_state(obj, true); }
+ else if(a === c) { this.change_state(obj, false); }
+ else {
+ obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+ }
+ },
+ reselect : function () {
+ if(this.data.ui && this.data.checkbox.noui) {
+ var _this = this,
+ s = this.data.ui.to_select;
+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ this.deselect_all();
+ $.each(s, function (i, val) { _this.check_node(val); });
+ this.__callback();
+ }
+ else {
+ this.__call_old();
+ }
+ },
+ save_loaded : function () {
+ var _this = this;
+ this.data.core.to_load = [];
+ this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
+ if(this.id) { _this.data.core.to_load.push("#" + this.id); }
+ });
+ }
+ }
+ });
+ $(function() {
+ var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree XML plugin
+ * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.vakata.xslt = function (xml, xsl, callback) {
+ var rs = "", xm, xs, processor, support;
+ // TODO: IE9 no XSLTProcessor, no document.recalc
+ if(document.recalc) {
+ xm = document.createElement('xml');
+ xs = document.createElement('xml');
+ xm.innerHTML = xml;
+ xs.innerHTML = xsl;
+ $("body").append(xm).append(xs);
+ setTimeout( (function (xm, xs, callback) {
+ return function () {
+ callback.call(null, xm.transformNode(xs.XMLDocument));
+ setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
+ };
+ })(xm, xs, callback), 100);
+ return true;
+ }
+ if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
+ xml = new DOMParser().parseFromString(xml, "text/xml");
+ xsl = new DOMParser().parseFromString(xsl, "text/xml");
+ // alert(xml.transformNode());
+ // callback.call(null, new XMLSerializer().serializeToString(rs));
+
+ }
+ if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
+ processor = new XSLTProcessor();
+ support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
+ if(!support) { return false; }
+ xml = new DOMParser().parseFromString(xml, "text/xml");
+ xsl = new DOMParser().parseFromString(xsl, "text/xml");
+ if($.isFunction(processor.transformDocument)) {
+ rs = document.implementation.createDocument("", "", null);
+ processor.transformDocument(xml, xsl, rs, null);
+ callback.call(null, new XMLSerializer().serializeToString(rs));
+ return true;
+ }
+ else {
+ processor.importStylesheet(xsl);
+ rs = processor.transformToFragment(xml, document);
+ callback.call(null, $("<div />").append(rs).html());
+ return true;
+ }
+ }
+ return false;
+ };
+ var xsl = {
+ 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
+ '<xsl:template match="/">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="/root" />' +
+ ' </xsl:call-template>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <ul>' +
+ ' <xsl:for-each select="$node/item">' +
+ ' <xsl:variable name="children" select="count(./item) > 0" />' +
+ ' <li>' +
+ ' <xsl:attribute name="class">' +
+ ' <xsl:if test="position() = last()">jstree-last </xsl:if>' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' <xsl:value-of select="@class" />' +
+ ' </xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
+ ' <xsl:for-each select="content/name">' +
+ ' <a>' +
+ ' <xsl:attribute name="href">' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+ ' <xsl:otherwise>#</xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' </xsl:attribute>' +
+ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins>' +
+ ' <xsl:attribute name="class">jstree-icon ' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+ ' </xsl:attribute>' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+ ' <xsl:text> </xsl:text>' +
+ ' </ins>' +
+ ' <xsl:copy-of select="./child::node()" />' +
+ ' </a>' +
+ ' </xsl:for-each>' +
+ ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
+ ' </li>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>',
+
+ 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
+ '<xsl:template match="/">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <xsl:param name="is_last" />' +
+ ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />' +
+ ' <li>' +
+ ' <xsl:attribute name="class">' +
+ ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' <xsl:value-of select="@class" />' +
+ ' </xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
+ ' <xsl:for-each select="content/name">' +
+ ' <a>' +
+ ' <xsl:attribute name="href">' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+ ' <xsl:otherwise>#</xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' </xsl:attribute>' +
+ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins>' +
+ ' <xsl:attribute name="class">jstree-icon ' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+ ' </xsl:attribute>' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+ ' <xsl:text> </xsl:text>' +
+ ' </ins>' +
+ ' <xsl:copy-of select="./child::node()" />' +
+ ' </a>' +
+ ' </xsl:for-each>' +
+ ' <xsl:if test="$children">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ ' </xsl:if>' +
+ ' </li>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>'
+ },
+ escape_xml = function(string) {
+ return string
+ .toString()
+ .replace(/&/g, '&')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''');
+ };
+ $.jstree.plugin("xml_data", {
+ defaults : {
+ data : false,
+ ajax : false,
+ xsl : "flat",
+ clean_node : false,
+ correct_state : true,
+ get_skip_empty : false,
+ get_include_preamble : true
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ var s = this._get_settings().xml_data;
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+ },
+ load_node_xml : function (obj, s_call, e_call) {
+ var s = this.get_settings().xml_data,
+ error_func = function () {},
+ success_func = function () {};
+
+ obj = this._get_node(obj);
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ this.parse_xml(d, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }
+ }, this));
+ }, this));
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ this.parse_xml(s.data, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ this.get_container().children("ul").empty().append(d.children());
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }, this));
+ }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().xml_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj !== -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ d = x.responseText;
+ var sf = this.get_settings().xml_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+ return error_func.call(this, x, t, "");
+ }
+ this.parse_xml(d, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }
+ }, this));
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ },
+ parse_xml : function (xml, callback) {
+ var s = this._get_settings().xml_data;
+ $.vakata.xslt(xml, xsl[s.xsl], callback);
+ },
+ get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
+ var result = "",
+ s = this._get_settings(),
+ _this = this,
+ tmp1, tmp2, li, a, lang;
+ if(!tp) { tp = "flat"; }
+ if(!is_callback) { is_callback = 0; }
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+ if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
+
+ a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+ if(!is_callback) {
+ if(s.xml_data.get_include_preamble) {
+ result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
+ }
+ result += "<root>";
+ }
+ obj.each(function () {
+ result += "<item";
+ li = $(this);
+ $.each(li_attr, function (i, v) {
+ var t = li.attr(v);
+ if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+ result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+ }
+ });
+ if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
+ if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
+ if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
+ result += ">";
+ result += "<content>";
+ a = li.children("a");
+ a.each(function () {
+ tmp1 = $(this);
+ lang = false;
+ result += "<name";
+ if($.inArray("languages", s.plugins) !== -1) {
+ $.each(s.languages, function (k, z) {
+ if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
+ });
+ }
+ if(a_attr.length) {
+ $.each(a_attr, function (k, z) {
+ var t = tmp1.attr(z);
+ if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+ result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+ }
+ });
+ }
+ if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+ result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
+ }
+ if(tmp1.children("ins").get(0).style.backgroundImage.length) {
+ result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
+ }
+ result += ">";
+ result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
+ result += "</name>";
+ });
+ result += "</content>";
+ tmp2 = li[0].id || true;
+ li = li.find("> ul > li");
+ if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
+ else { tmp2 = ""; }
+ if(tp == "nest") { result += tmp2; }
+ result += "</item>";
+ if(tp == "flat") { result += tmp2; }
+ });
+ if(!is_callback) { result += "</root>"; }
+ return result;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree search plugin
+ * Enables both sync and async search on the tree
+ * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
+ */
+(function ($) {
+ $.expr[':'].jstree_contains = function(a,i,m){
+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+ };
+ $.expr[':'].jstree_title_contains = function(a,i,m) {
+ return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+ };
+ $.jstree.plugin("search", {
+ __init : function () {
+ this.data.search.str = "";
+ this.data.search.result = $();
+ if(this._get_settings().search.show_only_matches) {
+ this.get_container()
+ .bind("search.jstree", function (e, data) {
+ $(this).children("ul").find("li").hide().removeClass("jstree-last");
+ data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
+ .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
+ })
+ .bind("clear_search.jstree", function () {
+ $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
+ });
+ }
+ },
+ defaults : {
+ ajax : false,
+ search_method : "jstree_contains", // for case insensitive - jstree_contains
+ show_only_matches : false
+ },
+ _fn : {
+ search : function (str, skip_async) {
+ if($.trim(str) === "") { this.clear_search(); return; }
+ var s = this.get_settings().search,
+ t = this,
+ error_func = function () { },
+ success_func = function () { };
+ this.data.search.str = str;
+
+ if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
+ this.search.supress_callback = true;
+ error_func = function () { };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().search.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ this.data.search.to_open = d;
+ this._search_open();
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
+ if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
+ if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
+ $.ajax(s.ajax);
+ return;
+ }
+ if(this.data.search.result.length) { this.clear_search(); }
+ this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
+ this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ this.__callback({ nodes : this.data.search.result, str : str });
+ },
+ clear_search : function (str) {
+ this.data.search.result.removeClass("jstree-search");
+ this.__callback(this.data.search.result);
+ this.data.search.result = $();
+ },
+ _search_open : function (is_callback) {
+ var _this = this,
+ done = true,
+ current = [],
+ remaining = [];
+ if(this.data.search.to_open.length) {
+ $.each(this.data.search.to_open, function (i, val) {
+ if(val == "#") { return true; }
+ if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
+ else { remaining.push(val); }
+ });
+ if(current.length) {
+ this.data.search.to_open = remaining;
+ $.each(current, function (i, val) {
+ _this.open_node(val, function () { _this._search_open(true); });
+ });
+ done = false;
+ }
+ }
+ if(done) { this.search(this.data.search.str, true); }
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree contextmenu plugin
+ */
+(function ($) {
+ $.vakata.context = {
+ hide_on_mouseleave : false,
+
+ cnt : $("<div id='vakata-contextmenu' />"),
+ vis : false,
+ tgt : false,
+ par : false,
+ func : false,
+ data : false,
+ rtl : false,
+ show : function (s, t, x, y, d, p, rtl) {
+ $.vakata.context.rtl = !!rtl;
+ var html = $.vakata.context.parse(s), h, w;
+ if(!html) { return; }
+ $.vakata.context.vis = true;
+ $.vakata.context.tgt = t;
+ $.vakata.context.par = p || t || null;
+ $.vakata.context.data = d || null;
+ $.vakata.context.cnt
+ .html(html)
+ .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
+
+ if($.vakata.context.hide_on_mouseleave) {
+ $.vakata.context.cnt
+ .one("mouseleave", function(e) { $.vakata.context.hide(); });
+ }
+
+ h = $.vakata.context.cnt.height();
+ w = $.vakata.context.cnt.width();
+ if(x + w > $(document).width()) {
+ x = $(document).width() - (w + 5);
+ $.vakata.context.cnt.find("li > ul").addClass("right");
+ }
+ if(y + h > $(document).height()) {
+ y = y - (h + t[0].offsetHeight);
+ $.vakata.context.cnt.find("li > ul").addClass("bottom");
+ }
+
+ $.vakata.context.cnt
+ .css({ "left" : x, "top" : y })
+ .find("li:has(ul)")
+ .bind("mouseenter", function (e) {
+ var w = $(document).width(),
+ h = $(document).height(),
+ ul = $(this).children("ul").show();
+ if(w !== $(document).width()) { ul.toggleClass("right"); }
+ if(h !== $(document).height()) { ul.toggleClass("bottom"); }
+ })
+ .bind("mouseleave", function (e) {
+ $(this).children("ul").hide();
+ })
+ .end()
+ .css({ "visibility" : "visible" })
+ .show();
+ $(document).triggerHandler("context_show.vakata");
+ },
+ hide : function () {
+ $.vakata.context.vis = false;
+ $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
+ $(document).triggerHandler("context_hide.vakata");
+ },
+ parse : function (s, is_callback) {
+ if(!s) { return false; }
+ var str = "",
+ tmp = false,
+ was_sep = true;
+ if(!is_callback) { $.vakata.context.func = {}; }
+ str += "<ul>";
+ $.each(s, function (i, val) {
+ if(!val) { return true; }
+ $.vakata.context.func[i] = val.action;
+ if(!was_sep && val.separator_before) {
+ str += "<li class='vakata-separator vakata-separator-before'></li>";
+ }
+ was_sep = false;
+ str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
+ if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
+ if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
+ str += "> </ins><a href='#' rel='" + i + "'>";
+ if(val.submenu) {
+ str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>»</span>";
+ }
+ str += val.label + "</a>";
+ if(val.submenu) {
+ tmp = $.vakata.context.parse(val.submenu, true);
+ if(tmp) { str += tmp; }
+ }
+ str += "</li>";
+ if(val.separator_after) {
+ str += "<li class='vakata-separator vakata-separator-after'></li>";
+ was_sep = true;
+ }
+ });
+ str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
+ str += "</ul>";
+ $(document).triggerHandler("context_parse.vakata");
+ return str.length > 10 ? str : false;
+ },
+ exec : function (i) {
+ if($.isFunction($.vakata.context.func[i])) {
+ // if is string - eval and call it!
+ $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
+ return true;
+ }
+ else { return false; }
+ }
+ };
+ $(function () {
+ var css_string = '' +
+ '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
+ '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
+ '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
+ '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
+ '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
+ '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
+ '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
+ '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
+ '#vakata-contextmenu .right { right:100%; left:auto; } ' +
+ '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
+ '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+ $.vakata.context.cnt
+ .delegate("a","click", function (e) { e.preventDefault(); })
+ .delegate("a","mouseup", function (e) {
+ if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
+ $.vakata.context.hide();
+ }
+ else { $(this).blur(); }
+ })
+ .delegate("a","mouseover", function () {
+ $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
+ })
+ .appendTo("body");
+ $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
+ if(typeof $.hotkeys !== "undefined") {
+ $(document)
+ .bind("keydown", "up", function (e) {
+ if($.vakata.context.vis) {
+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
+ o.addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "down", function (e) {
+ if($.vakata.context.vis) {
+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
+ o.addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "right", function (e) {
+ if($.vakata.context.vis) {
+ $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "left", function (e) {
+ if($.vakata.context.vis) {
+ $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "esc", function (e) {
+ $.vakata.context.hide();
+ e.preventDefault();
+ })
+ .bind("keydown", "space", function (e) {
+ $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
+ e.preventDefault();
+ });
+ }
+ });
+
+ $.jstree.plugin("contextmenu", {
+ __init : function () {
+ this.get_container()
+ .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
+ e.preventDefault();
+ if(!$(e.currentTarget).hasClass("jstree-loading")) {
+ this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+ }
+ }, this))
+ .delegate("a", "click.jstree", $.proxy(function (e) {
+ if(this.data.contextmenu) {
+ $.vakata.context.hide();
+ }
+ }, this))
+ .bind("destroy.jstree", $.proxy(function () {
+ // TODO: move this to descruct method
+ if(this.data.contextmenu) {
+ $.vakata.context.hide();
+ }
+ }, this));
+ $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
+ },
+ defaults : {
+ select_node : false, // requires UI plugin
+ show_at_node : true,
+ items : { // Could be a function that should return an object like this one
+ "create" : {
+ "separator_before" : false,
+ "separator_after" : true,
+ "label" : "Create",
+ "action" : function (obj) { this.create(obj); }
+ },
+ "rename" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Rename",
+ "action" : function (obj) { this.rename(obj); }
+ },
+ "remove" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Delete",
+ "action" : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
+ },
+ "ccp" : {
+ "separator_before" : true,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Edit",
+ "action" : false,
+ "submenu" : {
+ "cut" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Cut",
+ "action" : function (obj) { this.cut(obj); }
+ },
+ "copy" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Copy",
+ "action" : function (obj) { this.copy(obj); }
+ },
+ "paste" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Paste",
+ "action" : function (obj) { this.paste(obj); }
+ }
+ }
+ }
+ }
+ },
+ _fn : {
+ show_contextmenu : function (obj, x, y) {
+ obj = this._get_node(obj);
+ var s = this.get_settings().contextmenu,
+ a = obj.children("a:visible:eq(0)"),
+ o = false,
+ i = false;
+ if(s.select_node && this.data.ui && !this.is_selected(obj)) {
+ this.deselect_all();
+ this.select_node(obj, true);
+ }
+ if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
+ o = a.offset();
+ x = o.left;
+ y = o.top + this.data.core.li_height;
+ }
+ i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
+ if($.isFunction(i)) { i = i.call(this, obj); }
+ this.data.contextmenu = true;
+ $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
+ if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree types plugin
+ * Adds support types of nodes
+ * You can set an attribute on each li node, that represents its type.
+ * According to the type setting the node may get custom icon/validation rules
+ */
+(function ($) {
+ $.jstree.plugin("types", {
+ __init : function () {
+ var s = this._get_settings().types;
+ this.data.types.attach_to = [];
+ this.get_container()
+ .bind("init.jstree", $.proxy(function () {
+ var types = s.types,
+ attr = s.type_attr,
+ icons_css = "",
+ _this = this;
+
+ $.each(types, function (i, tp) {
+ $.each(tp, function (k, v) {
+ if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
+ });
+ if(!tp.icon) { return true; }
+ if( tp.icon.image || tp.icon.position) {
+ if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
+ else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
+ if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
+ if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
+ else { icons_css += ' background-position:0 0; '; }
+ icons_css += '} ';
+ }
+ });
+ if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
+ }, this))
+ .bind("before.jstree", $.proxy(function (e, data) {
+ var s, t,
+ o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
+ d = o && o !== -1 && o.length ? o.data("jstree") : false;
+ if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
+ if($.inArray(data.func, this.data.types.attach_to) !== -1) {
+ if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
+ s = this._get_settings().types.types;
+ t = this._get_type(data.args[0]);
+ if(
+ (
+ (s[t] && typeof s[t][data.func] !== "undefined") ||
+ (s["default"] && typeof s["default"][data.func] !== "undefined")
+ ) && this._check(data.func, data.args[0]) === false
+ ) {
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ }, this));
+ if(is_ie6) {
+ this.get_container()
+ .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
+ var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
+ c = false,
+ s = this._get_settings().types;
+ $.each(s.types, function (i, tp) {
+ if(tp.icon && (tp.icon.image || tp.icon.position)) {
+ c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
+ if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
+ c.css("backgroundPosition", tp.icon.position || "0 0");
+ }
+ });
+ }, this));
+ }
+ },
+ defaults : {
+ // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
+ max_children : -1,
+ // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
+ max_depth : -1,
+ // defines valid node types for the root nodes
+ valid_children : "all",
+
+ // whether to use $.data
+ use_data : false,
+ // where is the type stores (the rel attribute of the LI element)
+ type_attr : "rel",
+ // a list of types
+ types : {
+ // the default type
+ "default" : {
+ "max_children" : -1,
+ "max_depth" : -1,
+ "valid_children": "all"
+
+ // Bound functions - you can bind any other function here (using boolean or function)
+ //"select_node" : true
+ }
+ }
+ },
+ _fn : {
+ _types_notify : function (n, data) {
+ if(data.type && this._get_settings().types.use_data) {
+ this.set_type(data.type, n);
+ }
+ },
+ _get_type : function (obj) {
+ obj = this._get_node(obj);
+ return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
+ },
+ set_type : function (str, obj) {
+ obj = this._get_node(obj);
+ var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
+ if(ret) { this.__callback({ obj : obj, type : str}); }
+ return ret;
+ },
+ _check : function (rule, obj, opts) {
+ obj = this._get_node(obj);
+ var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
+ if(obj === -1) {
+ if(!!s[rule]) { v = s[rule]; }
+ else { return; }
+ }
+ else {
+ if(t === false) { return; }
+ data = s.use_data ? obj.data("jstree") : false;
+ if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
+ else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
+ else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
+ }
+ if($.isFunction(v)) { v = v.call(this, obj); }
+ if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
+ // also include the node itself - otherwise if root node it is not checked
+ obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
+ // check if current depth already exceeds global tree depth
+ if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
+ d = (i === 0) ? v : _this._check(rule, this, false);
+ // check if current node max depth is already matched or exceeded
+ if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
+ // otherwise - set the max depth to the current value minus current depth
+ if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
+ // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
+ if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
+ });
+ }
+ return v;
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var m = this._get_move(),
+ s = m.rt._get_settings().types,
+ mc = m.rt._check("max_children", m.cr),
+ md = m.rt._check("max_depth", m.cr),
+ vc = m.rt._check("valid_children", m.cr),
+ ch = 0, d = 1, t;
+
+ if(vc === "none") { return false; }
+ if($.isArray(vc) && m.ot && m.ot._get_type) {
+ m.o.each(function () {
+ if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
+ });
+ if(d === false) { return false; }
+ }
+ if(s.max_children !== -2 && mc !== -1) {
+ ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
+ if(ch + m.o.length > mc) { return false; }
+ }
+ if(s.max_depth !== -2 && md !== -1) {
+ d = 0;
+ if(md === 0) { return false; }
+ if(typeof m.o.d === "undefined") {
+ // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
+ t = m.o;
+ while(t.length > 0) {
+ t = t.find("> ul > li");
+ d ++;
+ }
+ m.o.d = d;
+ }
+ if(md - m.o.d < 0) { return false; }
+ }
+ return true;
+ },
+ create_node : function (obj, position, js, callback, is_loaded, skip_check) {
+ if(!skip_check && (is_loaded || this._is_loaded(obj))) {
+ var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
+ s = this._get_settings().types,
+ mc = this._check("max_children", p),
+ md = this._check("max_depth", p),
+ vc = this._check("valid_children", p),
+ ch;
+ if(typeof js === "string") { js = { data : js }; }
+ if(!js) { js = {}; }
+ if(vc === "none") { return false; }
+ if($.isArray(vc)) {
+ if(!js.attr || !js.attr[s.type_attr]) {
+ if(!js.attr) { js.attr = {}; }
+ js.attr[s.type_attr] = vc[0];
+ }
+ else {
+ if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
+ }
+ }
+ if(s.max_children !== -2 && mc !== -1) {
+ ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
+ if(ch + 1 > mc) { return false; }
+ }
+ if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
+ }
+ return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree HTML plugin
+ * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.jstree.plugin("html_data", {
+ __init : function () {
+ // this used to use html() and clean the whitespace, but this way any attached data was lost
+ this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
+ // remove white space from LI node - otherwise nodes appear a bit to the right
+ this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
+ },
+ defaults : {
+ data : false,
+ ajax : false,
+ correct_state : true
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+ },
+ load_node_html : function (obj, s_call, e_call) {
+ var d,
+ s = this.get_settings().html_data,
+ error_func = function () {},
+ success_func = function () {};
+ obj = this._get_node(obj);
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
+ d = $(d);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }, this));
+ break;
+ case (!s.data && !s.ajax):
+ if(!obj || obj == -1) {
+ this.get_container()
+ .children("ul").empty()
+ .append(this.data.html_data.original_container_html)
+ .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+ this.clean_node();
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ d = $(s.data);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ this.get_container()
+ .children("ul").empty().append(d.children())
+ .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+ this.clean_node();
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ obj = this._get_node(obj);
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().html_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj != -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().html_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+ return error_func.call(this, x, t, "");
+ }
+ if(d) {
+ d = $(d);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ }
+ }
+ });
+ // include the HTML data plugin by default
+ $.jstree.defaults.plugins.push("html_data");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themeroller plugin
+ * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
+ */
+(function ($) {
+ $.jstree.plugin("themeroller", {
+ __init : function () {
+ var s = this._get_settings().themeroller;
+ this.get_container()
+ .addClass("ui-widget-content")
+ .addClass("jstree-themeroller")
+ .delegate("a","mouseenter.jstree", function (e) {
+ if(!$(e.currentTarget).hasClass("jstree-loading")) {
+ $(this).addClass(s.item_h);
+ }
+ })
+ .delegate("a","mouseleave.jstree", function () {
+ $(this).removeClass(s.item_h);
+ })
+ .bind("init.jstree", $.proxy(function (e, data) {
+ data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
+ this._themeroller(data.inst.get_container().find("> ul > li"));
+ }, this))
+ .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.obj);
+ }, this))
+ .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
+ this._themeroller();
+ }, this))
+ .bind("close_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.obj);
+ }, this))
+ .bind("delete_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.parent);
+ }, this))
+ .bind("correct_state.jstree", $.proxy(function (e, data) {
+ data.rslt.obj
+ .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
+ .find("> a > ins.ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
+ }, this))
+ .bind("select_node.jstree", $.proxy(function (e, data) {
+ data.rslt.obj.children("a").addClass(s.item_a);
+ }, this))
+ .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
+ this.get_container()
+ .find("a." + s.item_a).removeClass(s.item_a).end()
+ .find("a.jstree-clicked").addClass(s.item_a);
+ }, this))
+ .bind("dehover_node.jstree", $.proxy(function (e, data) {
+ data.rslt.obj.children("a").removeClass(s.item_h);
+ }, this))
+ .bind("hover_node.jstree", $.proxy(function (e, data) {
+ this.get_container()
+ .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
+ data.rslt.obj.children("a").addClass(s.item_h);
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.o);
+ this._themeroller(data.rslt.op);
+ }, this));
+ },
+ __destroy : function () {
+ var s = this._get_settings().themeroller,
+ c = [ "ui-icon" ];
+ $.each(s, function (i, v) {
+ v = v.split(" ");
+ if(v.length) { c = c.concat(v); }
+ });
+ this.get_container()
+ .removeClass("ui-widget-content")
+ .find("." + c.join(", .")).removeClass(c.join(" "));
+ },
+ _fn : {
+ _themeroller : function (obj) {
+ var s = this._get_settings().themeroller;
+ obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
+ obj
+ .find("li.jstree-closed")
+ .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
+ .end()
+ .end()
+ .end()
+ .end()
+ .find("li.jstree-open")
+ .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
+ .end()
+ .end()
+ .end()
+ .end()
+ .find("li.jstree-leaf")
+ .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
+ }
+ },
+ defaults : {
+ "opened" : "ui-icon-triangle-1-se",
+ "closed" : "ui-icon-triangle-1-e",
+ "item" : "ui-state-default",
+ "item_h" : "ui-state-hover",
+ "item_a" : "ui-state-active",
+ "item_open" : "ui-icon-folder-open",
+ "item_clsd" : "ui-icon-folder-collapsed",
+ "item_leaf" : "ui-icon-document"
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '.jstree-themeroller .ui-icon { overflow:visible; } ' +
+ '.jstree-themeroller a { padding:0 2px; } ' +
+ '.jstree-themeroller .jstree-no-icon { display:none; }';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree unique plugin
+ * Forces different names amongst siblings (still a bit experimental)
+ * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
+ */
+(function ($) {
+ $.jstree.plugin("unique", {
+ __init : function () {
+ this.get_container()
+ .bind("before.jstree", $.proxy(function (e, data) {
+ var nms = [], res = true, p, t;
+ if(data.func == "move_node") {
+ // obj, ref, position, is_copy, is_prepared, skip_check
+ if(data.args[4] === true) {
+ if(data.args[0].o && data.args[0].o.length) {
+ data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+ res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
+ }
+ }
+ }
+ if(data.func == "create_node") {
+ // obj, position, js, callback, is_loaded
+ if(data.args[4] || this._is_loaded(data.args[0])) {
+ p = this._get_node(data.args[0]);
+ if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
+ p = this._get_parent(data.args[0]);
+ if(!p || p === -1) { p = this.get_container(); }
+ }
+ if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
+ else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
+ else { nms.push(data.args[2].data); }
+ res = this._check_unique(nms, p.find("> ul > li"), "create_node");
+ }
+ }
+ if(data.func == "rename_node") {
+ // obj, val
+ nms.push(data.args[1]);
+ t = this._get_node(data.args[0]);
+ p = this._get_parent(t);
+ if(!p || p === -1) { p = this.get_container(); }
+ res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
+ }
+ if(!res) {
+ e.stopPropagation();
+ return false;
+ }
+ }, this));
+ },
+ defaults : {
+ error_callback : $.noop
+ },
+ _fn : {
+ _check_unique : function (nms, p, func) {
+ var cnms = [];
+ p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
+ if(!cnms.length || !nms.length) { return true; }
+ cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+ if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
+ this._get_settings().unique.error_callback.call(null, nms, p, func);
+ return false;
+ }
+ return true;
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var p = this._get_move(), nms = [];
+ if(p.o && p.o.length) {
+ p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+ return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
+ }
+ return true;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree wholerow plugin
+ * Makes select and hover work on the entire width of the node
+ * MAY BE HEAVY IN LARGE DOM
+ */
+(function ($) {
+ $.jstree.plugin("wholerow", {
+ __init : function () {
+ if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
+ this.data.wholerow.html = false;
+ this.data.wholerow.to = false;
+ this.get_container()
+ .bind("init.jstree", $.proxy(function (e, data) {
+ this._get_settings().core.animation = 0;
+ }, this))
+ .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
+ this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
+ }, this))
+ .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
+ if(this.data.to) { clearTimeout(this.data.to); }
+ this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this, data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
+ }, this))
+ .bind("deselect_all.jstree", $.proxy(function (e, data) {
+ this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
+ }, this))
+ .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
+ data.rslt.obj.each(function () {
+ var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
+ // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
+ ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
+ });
+ }, this))
+ .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
+ this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
+ if(e.type === "hover_node") {
+ var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
+ // ref.children("a").addClass("jstree-hovered");
+ ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
+ }
+ }, this))
+ .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
+ var n = $(e.currentTarget);
+ if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
+ n.closest("li").children("a:visible:eq(0)").click();
+ e.stopImmediatePropagation();
+ })
+ .delegate("li", "mouseover.jstree", $.proxy(function (e) {
+ e.stopImmediatePropagation();
+ if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
+ this.hover_node(e.currentTarget);
+ return false;
+ }, this))
+ .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
+ if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
+ this.dehover_node(e.currentTarget);
+ }, this));
+ if(is_ie7 || is_ie6) {
+ $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
+ }
+ },
+ defaults : {
+ },
+ __destroy : function () {
+ this.get_container().children(".jstree-wholerow").remove();
+ this.get_container().find(".jstree-wholerow-span").remove();
+ },
+ _fn : {
+ _prepare_wholerow_span : function (obj) {
+ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+ if(obj === false) { return; } // added for removing root nodes
+ obj.each(function () {
+ $(this).find("li").andSelf().each(function () {
+ var $t = $(this);
+ if($t.children(".jstree-wholerow-span").length) { return true; }
+ $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'> </span>");
+ });
+ });
+ },
+ _prepare_wholerow_ul : function () {
+ var o = this.get_container().children("ul").eq(0), h = o.html();
+ o.addClass("jstree-wholerow-real");
+ if(this.data.wholerow.last_html !== h) {
+ this.data.wholerow.last_html = h;
+ this.get_container().children(".jstree-wholerow").remove();
+ this.get_container().append(
+ o.clone().removeClass("jstree-wholerow-real")
+ .wrapAll("<div class='jstree-wholerow' />").parent()
+ .width(o.parent()[0].scrollWidth)
+ .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
+ .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
+ );
+ }
+ }
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
+ '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
+ '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
+ '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
+ '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
+ '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
+ '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
+ '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
+ if(is_ff2) {
+ css_string += '' +
+ '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
+ '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
+ }
+ if(is_ie7 || is_ie6) {
+ css_string += '' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
+ '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
+ }
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+* jsTree model plugin
+* This plugin gets jstree to use a class model to retrieve data, creating great dynamism
+*/
+(function ($) {
+ var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
+ validateInterface = function(obj, inter) {
+ var valid = true;
+ obj = obj || {};
+ inter = [].concat(inter);
+ $.each(inter, function (i, v) {
+ if(!$.isFunction(obj[v])) { valid = false; return false; }
+ });
+ return valid;
+ };
+ $.jstree.plugin("model", {
+ __init : function () {
+ if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
+ this._get_settings().json_data.data = function (n, b) {
+ var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
+ if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
+ if(this._get_settings().model.async) {
+ obj.getChildren($.proxy(function (data) {
+ this.model_done(data, b);
+ }, this));
+ }
+ else {
+ this.model_done(obj.getChildren(), b);
+ }
+ };
+ },
+ defaults : {
+ object : false,
+ id_prefix : false,
+ async : false
+ },
+ _fn : {
+ model_done : function (data, callback) {
+ var ret = [],
+ s = this._get_settings(),
+ _this = this;
+
+ if(!$.isArray(data)) { data = [data]; }
+ $.each(data, function (i, nd) {
+ var r = nd.getProps() || {};
+ r.attr = nd.getAttr() || {};
+ if(nd.getChildrenCount()) { r.state = "closed"; }
+ r.data = nd.getName();
+ if(!$.isArray(r.data)) { r.data = [r.data]; }
+ if(_this.data.types && $.isFunction(nd.getType)) {
+ r.attr[s.types.type_attr] = nd.getType();
+ }
+ if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
+ if(!r.metadata) { r.metadata = { }; }
+ r.metadata.jstree_model = nd;
+ ret.push(r);
+ });
+ callback.call(null, ret);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+})();
\ No newline at end of file
--- /dev/null
+/*
+ * jsTree classic theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
+
+.jstree-classic li,
+.jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-classic li { background-position:-90px 0; background-repeat:repeat-y; }
+.jstree-classic li.jstree-last { background:transparent; }
+.jstree-classic .jstree-open > ins { background-position:-72px 0; }
+.jstree-classic .jstree-closed > ins { background-position:-54px 0; }
+.jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
+
+.jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
+.jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
+.jstree-classic a .jstree-icon { background-position:-56px -19px; }
+.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
+.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+
+.jstree-classic.jstree-focused { background:white; }
+
+.jstree-classic .jstree-no-dots li,
+.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+
+.jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
+
+.jstree-classic .jstree-search { font-style:italic; }
+
+.jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
+
+#vakata-dragged.jstree-classic ins { background:transparent !important; }
+#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
+
+.jstree-classic a.jstree-search { color:aqua; }
+.jstree-classic .jstree-locked a { color:silver; cursor:default; }
+
+#vakata-contextmenu.jstree-classic-context,
+#vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-classic-context li { }
+#vakata-contextmenu.jstree-classic-context a { color:black; }
+#vakata-contextmenu.jstree-classic-context a:hover,
+#vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
+
+/* IE6 BEGIN */
+.jstree-classic li,
+.jstree-classic ins,
+#vakata-dragged.jstree-classic .jstree-invalid,
+#vakata-dragged.jstree-classic .jstree-ok,
+#jstree-marker.jstree-classic { _background-image:url("d.gif"); }
+.jstree-classic .jstree-open ins { _background-position:-72px 0; }
+.jstree-classic .jstree-closed ins { _background-position:-54px 0; }
+.jstree-classic .jstree-leaf ins { _background-position:-36px 0; }
+.jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; }
+.jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; }
+.jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; }
+#vakata-contextmenu.jstree-classic-context ins { _display:none; }
+#vakata-contextmenu.jstree-classic-context li { _zoom:1; }
+.jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
+.jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
+/* IE6 END */
\ No newline at end of file
padding-top : 1em;
}
-#login {
+#login_controls {
position : absolute;
right : .5em;
}
background-color : #E8E8E8;
border : 1px solid #BCBCBC;
-moz-border-radius : 5px;
+ border-radius : 5px;
display : inline-block;
font-size : 85%;
padding : .3em .5em .3em .5em;
display: inline;
}
+#hierarchies a {
+ font-weight: normal;
+ text-decoration: underline;
+ color: #069;
+}
+
+#hierarchies a:hover {
+ color: #990033;
+}
+
+#didyoumeanopac, #didyoumeanintranet {
+ float: left;
+ width: 260px;
+}
+
+.pluginlist {
+ padding-bottom: 10px;
+}
+.plugin {
+ margin: 0 1em 1em 0;
+}
+.pluginname {
+ margin: 0.3em;
+ padding-bottom: 4px;
+ padding-left: 0.2em;
+ background-color: #E6F0F2;
+}
+.pluginname .ui-icon {
+ float: right;
+}
+.plugindesc {
+ padding: 0.4em;
+}
+.ui-sortable-placeholder {
+ border: 1px dotted black;
+ visibility: visible !important;
+ height: 80px !important;
+}
+.ui-sortable-placeholder * {
+ visibility: hidden;
+}
+
/* jQuery UI Datepicker */
.ui-datepicker table {
width: 100%;
<ul>
<li><a href="/cgi-bin/koha/acqui/lateorders.pl">Late orders</a></li>
[% IF ( suggestion ) %]<li><a href="/cgi-bin/koha/suggestion/suggestion.pl">Suggestions</a></li>[% ELSE %][% END %]
+ <li><a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a></li>
[% IF ( CAN_user_acquisition_budget_manage ) %]
<li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></li>
<li><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></li>
[% IF ( NoZebra ) %]<li><a href="/cgi-bin/koha/admin/stopwords.pl">Stop words</a></li>[% END %]
<!-- <li><a href="/cgi-bin/koha/admin/printers.pl">Network Printers</a></li> -->
<li><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></li>
+ <li><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></li>
</ul>
</div>
</div>
[% CASE 'broader' %](Broader heading)
[% CASE 'narrower' %](Narrower heading)
[% CASE 'parent' %](Immediate parent body)
- [% CASE %]([% type | html %])
+ [% CASE %][% IF type %]([% type | html %])[% END %]
[% END %]</span>[% END %]
[% END %]
[% END %]
<div class="gradient">
<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1>
<!-- Begin Authorities Resident Search Box -->
+<script type="text/javascript">
+//<![CDATA[
+ $(document).ready(function() {
+ var searchType = '[% marclist %]';
+ if (searchType) {
+ if ('mainentry' == searchType) {
+ $("#header_search").tabs( "option", "selected", 0 );
+ } else if ('match' == searchType) {
+ $("#header_search").tabs( "option", "selected", 1 );
+ } else if ('all' == searchType) {
+ $("#header_search").tabs( "option", "selected", 2 );
+ }
+ }
+ });
+//]]>
+</script>
<div id="header_search" class="residentsearch">
<div id="main_heading" class="residentsearch">
<p class="tip">Enter authorized heading:</p>
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<select name="operator">
+ [% IF ( operator == 'contains' ) %]
+ <option value="contains" selected="selected">contains</option>
+ [% ELSE %]
<option value="contains">contains</option>
+ [% END %]
+ [% IF ( operator == 'start' ) %]
+ <option value="start" selected="selected">starts with</option>
+ [% ELSE %]
<option value="start">starts with</option>
+ [% END %]
+ [% IF ( operator == 'is' ) %]
+ <option value="is" selected="selected">is exactly</option>
+ [% ELSE %]
<option value="is">is exactly</option>
+ [% END %]
</select>
<input id="value_mainentry" type="text" name="value" value="[% value %]" />
<select name="orderby">
- <option value="">None</option>
+ [% IF ( orderby == 'HeadingAsc' ) %]
<option value="HeadingAsc" selected="selected">Heading A-Z</option>
+ [% ELSE %]
+ <option value="HeadingAsc">Heading A-Z</option>
+ [% END %]
+ [% IF ( orderby == 'HeadingDsc' ) %]
+ <option value="HeadingDsc" selected="selected">Heading Z-A</option>
+ [% ELSE %]
<option value="HeadingDsc">Heading Z-A</option>
+ [% END %]
+ [% IF ( orderby == '' && op ) %]
+ <option value="" selected="selected">None</option>
+ [% ELSE %]
+ <option value="">None</option>
+ [% END %]
</select>
<input type="submit" class="submit" value="Submit" />
</form>
</select>
<input type="hidden" name="marclist" value="match" />
<select name="operator">
+ [% IF ( operator == 'contains' ) %]
+ <option value="contains" selected="selected">contains</option>
+ [% ELSE %]
<option value="contains">contains</option>
+ [% END %]
+ [% IF ( operator == 'start' ) %]
+ <option value="start" selected="selected">starts with</option>
+ [% ELSE %]
<option value="start">starts with</option>
+ [% END %]
+ [% IF ( operator == 'is' ) %]
+ <option value="is" selected="selected">is exactly</option>
+ [% ELSE %]
<option value="is">is exactly</option>
+ [% END %]
</select>
<input id="value_matchheading" type="text" name="value" value="[% value %]" />
<select name="orderby">
- <option value="">None</option>
+ [% IF ( orderby == 'HeadingAsc' ) %]
<option value="HeadingAsc" selected="selected">Heading A-Z</option>
+ [% ELSE %]
+ <option value="HeadingAsc">Heading A-Z</option>
+ [% END %]
+ [% IF ( orderby == 'HeadingDsc' ) %]
+ <option value="HeadingDsc" selected="selected">Heading Z-A</option>
+ [% ELSE %]
<option value="HeadingDsc">Heading Z-A</option>
+ [% END %]
+ [% IF ( orderby == '' && op ) %]
+ <option value="" selected="selected">None</option>
+ [% ELSE %]
+ <option value="">None</option>
+ [% END %]
</select>
<input type="submit" class="submit" value="Submit" />
</form>
<input type="hidden" name="and_or" value="and" />
<input type="hidden" name="excluding" value="" />
<select name="operator">
+ [% IF ( operator == 'contains' ) %]
+ <option value="contains" selected="selected">contains</option>
+ [% ELSE %]
<option value="contains">contains</option>
+ [% END %]
+ [% IF ( operator == 'start' ) %]
+ <option value="start" selected="selected">starts with</option>
+ [% ELSE %]
<option value="start">starts with</option>
+ [% END %]
+ [% IF ( operator == 'is' ) %]
+ <option value="is" selected="selected">is exactly</option>
+ [% ELSE %]
<option value="is">is exactly</option>
+ [% END %]
</select>
<input id="value_anywhere" type="text" name="value" value="[% value %]" />
<select name="orderby">
- <option value="">None</option>
+ [% IF ( orderby == 'HeadingAsc' ) %]
<option value="HeadingAsc" selected="selected">Heading A-Z</option>
+ [% ELSE %]
+ <option value="HeadingAsc">Heading A-Z</option>
+ [% END %]
+ [% IF ( orderby == 'HeadingDsc' ) %]
+ <option value="HeadingDsc" selected="selected">Heading Z-A</option>
+ [% ELSE %]
<option value="HeadingDsc">Heading Z-A</option>
+ [% END %]
+ [% IF ( orderby == '' && op ) %]
+ <option value="" selected="selected">None</option>
+ [% ELSE %]
+ <option value="">None</option>
+ [% END %]
</select>
<input type="submit" class="submit" value="Submit" />
</form>
--- /dev/null
+[% BLOCK showhierarchy %]
+ [% FOREACH tree IN trees %]
+ [% PROCESS showtree tree = tree %]
+ [% END %]
+[% END %]
+[% BLOCK showtree %]
+ <ul class="hierarchy">
+ [% FOREACH node IN tree %]
+ <li id="hier[% node.authid %]" class="[% node.class %] authnode">
+ [% IF ( node.current_value ) %]
+ <span class='currentauth'>[% node.value | html %]</span>
+ [% ELSE %]
+ <a href="detail.pl?authid=[% node.authid %]" title="Term">[% node.value | html %]</a>
+ [% END %]
+ [% IF ( node.children && node.children.size > 0 ) %]
+ [% PROCESS showtree tree = node.children %]
+ [% END %]
+ </li>
+ [% END %]
+ </ul>
+[% END %]
[% END %]
[% IF ( EasyAnalyticalRecords ) %][% IF ( analyze ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% IF ( object ) %][% object %]&analyze=1[% ELSE %][% biblionumber %]&analyze=1[% END %]">Analytics</a></li>[% END %]
- [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-home.pl?searched=1&biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %]
+ [% IF ( subscriptionsnumber ) %]<li><a href="/cgi-bin/koha/serials/serials-search.pl?searched=1&biblionumber=[% biblionumber %]">Subscription(s)</a></li>[% END %]
</ul>
<ul>
[% IF ( issuehistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]
<script type="text/javascript">
//<![CDATA[
+
+var debug = "[% debug %]";
+var dformat = "[% dateformat %]";
+var sentmsg = 0;
+if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
+
+function Date_from_syspref(dstring) {
+ var dateX = dstring.split(/[-/]/);
+ if (debug > 1 && sentmsg < 1) {sentmsg++; alert("Date_from_syspref(" + dstring + ") splits to:\n" + dateX.join("\n"));}
+ if (dformat === "iso") {
+ return new Date(dateX[0], (dateX[1] - 1), dateX[2]); // YYYY-MM-DD to (YYYY,m(0-11),d)
+ } else if (dformat === "us") {
+ return new Date(dateX[2], (dateX[0] - 1), dateX[1]); // MM/DD/YYYY to (YYYY,m(0-11),d)
+ } else if (dformat === "metric") {
+ return new Date(dateX[2], (dateX[1] - 1), dateX[0]); // DD/MM/YYYY to (YYYY,m(0-11),d)
+ } else {
+ if (debug > 0) {alert("KOHA ERROR - Unrecognized date format: " +dformat);}
+ return 0;
+ }
+}
+
/* Instead of including multiple localization files as you would normally see with
jQueryUI we expose the localization strings in the default configuration */
jQuery(function($){
[% IF ( CAN_user_editcatalogue_edit_catalogue ) %]{ text: _("Edit record"), url: "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]&frameworkcode=&op=" },[% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Edit items"), url: "/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber %]" },[% END %]
[% IF ( CAN_user_tools_items_batchmod ) %]{ text: _("Edit items in batch"), url: "/cgi-bin/koha/tools/batchMod.pl?op=show&biblionumber=[% biblionumber %]&src=CATALOGUING" },[% END %]
+ [% IF ( CAN_user_tools_items_batchdel ) %]{ text: _("Delete items in batch"), url: "/cgi-bin/koha/tools/batchMod.pl?del=1&op=show&biblionumber=[% biblionumber %]&src=CATALOGUING" },[% END %]
[% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Attach item"), url: "/cgi-bin/koha/cataloguing/moveitem.pl?biblionumber=[% biblionumber %]" },[% END %]
[% IF ( EasyAnalyticalRecords ) %][% IF ( CAN_user_editcatalogue_edit_items ) %]{ text: _("Link to host item"), url: "/cgi-bin/koha/cataloguing/linkitem.pl?biblionumber=[% biblionumber %]" },[% END %][% END %]
[% IF ( LocalCoverImages || OPACLocalCoverImages) %][% IF ( CAN_user_tools_upload_local_cover_images ) %]{ text: _("Upload image"), url: "/cgi-bin/koha/tools/upload-cover-image.pl?biblionumber=[% biblionumber %]&filetype=image" },[% END %][% END %]
[% IF ( CAN_user_reserveforothers ) %]
[% UNLESS ( norequests ) %]<li><a id="placehold" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% biblionumber %]">Place hold</a></li>[% END %]
[% END %]
- [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<li id="z3950searchc"><input type="button" id="z3950search" value="Z39.50 search" onclick="PopupZ3950(); return false;" /></li>[% END %]
+ [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]<li id="z3950searchc"><input type="button" id="z3950search" value="Z39.50 Search" onclick="if (confirm(_('Please note that this Z39.50 search could replace the current record.'))){ PopupZ3950(); } return false;" /></li>[% END %]
</ul>
</form>
</div>
[% IF ( facets_loo.type_label_Series ) %]Series[% END %]
[% IF ( facets_loo.type_label_ItemTypes ) %]Item types[% END %]
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
+[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
<ul>
[% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %]&limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
<li class="showmore"><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %][% IF ( offset ) %]&offset=[% offset %][% END %]&expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
</li>
</ul>
</div>
- <div id="login">
+ <div id="login_controls">
[% IF ( AutoLocation ) %]
<strong>
[% LoginBranchname %]
-[% IF category_type == 'I' %]
- [% surname %] [% IF othernames %] ([% othernames %]) [% END %]
-[% ELSE %]
- [% IF invert_name %]
- [% surname %], [% firstname %]
+[% IF ( borrower.borrowernumber ) %]
+ [% IF borrower.category_type == 'I' %]
+ [% borrower.surname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %]
[% ELSE %]
- [% firstname %] [% surname %]
+ [% IF invert_name %]
+ [% borrower.surname %], [% borrower.firstname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %]
+ [% ELSE %]
+ [% borrower.firstname %] [% IF borrower.othernames %] ([% borrower.othernames %]) [% END %] [% borrower.surname %]
+ [% END %]
[% END %]
-[% END %]
-([% cardnumber %])
+ ([% borrower.cardnumber %])
+[% ELSIF ( borrowernumber ) %]
+ [% IF category_type == 'I' %]
+ [% surname %] [% IF othernames %] ([% othernames %]) [% END %]
+ [% ELSE %]
+ [% IF invert_name %]
+ [% surname %], [% firstname %] [% IF othernames %] ([% othernames %]) [% END %]
+ [% ELSE %]
+ [% firstname %] [% IF othernames %] ([% othernames %]) [% END %] [% surname %]
+ [% END %]
+ [% END %]
+ ([% cardnumber %])
+[% END %]
\ No newline at end of file
<form action="/cgi-bin/koha/admin/preferences.pl">
<input type="hidden" name="tab" value="[% last_tab %]" />
<input type="hidden" name="op" value="search" />
- <input type="text" size="40" name="searchfield" value="[% searchfield %]" />
+ <input type="text" size="40" name="searchfield" value="[% searchfield |html %]" />
<input type="submit" class="submit" value="Search" />
</form>
</div>
<option value="se"> Series title</option>
<option value="su">Subject</option>
<option value="su,phr"> Subject as phrase</option>
+ [% IF ( expanded_options ) %]
+ <option value="su-br"> Subject and broader terms</option>
+ <option value="su-na"> Subject and narrower terms</option>
+ <option value="su-rl"> Subject and related terms</option>
+ [% END %]
<option value="bc">Barcode</option>
<option value="location">Shelving location</option>
<option value="sn">Standard number</option>
<div class="gradient">
-<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Serials Resident Search Box -->
-<div id="header_search">
- <div id="subscription_search" class="residentsearch">
+ <h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Serials Resident Search Box -->
+ <div id="header_search">
+ <div id="subscription_search" class="residentsearch">
<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 %]" />
+ <form action="/cgi-bin/koha/serials/serials-search.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 %]" />
- [% IF (UNIMARC) %]
- <label for="EAN_filter">EAN:</label> <input type="text" size="20" maxlength="40" name="EAN_filter" id="EAN_filter" value="[% EAN_filter %]" />
- [% END %]
- <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>
- </div>
+ [% IF (UNIMARC) %]
+ <label for="EAN_filter">EAN:</label> <input type="text" size="20" maxlength="40" name="EAN_filter" id="EAN_filter" value="[% EAN_filter %]" />
+ [% END %]
+ <label for="title_filter">Title:</label> <input type="text" size="20" maxlength="40" name="title_filter" id="title_filter" value="[% title_filter %]" />
+ <input value="Submit" class="submit" type="submit" /> <a href="/cgi-bin/koha/serials/serials-search.pl">Advanced search</a>
+ </form>
+ </div>
[% INCLUDE 'patron-search-box.inc' %]
- [% IF ( CAN_user_catalogue ) %]
- <div id="catalog_search" class="residentsearch">
- <p class="tip">Enter search keywords:</p>
- <form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="cat-search-block">
- <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
- <input type="submit" value="Submit" class="submit" />
- </form>
- </div>
- [% END %]
- <ul>
- <li><a href="#subscription_search">Search subscriptions</a></li>
- [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %]
- [% IF ( CAN_user_catalogue ) %]<li><a href="#catalog_search">Search the catalog</a></li>[% END %]
- </ul>
-</div><!-- /header_search -->
+ [% IF ( CAN_user_catalogue ) %]
+ <div id="catalog_search" class="residentsearch">
+ <p class="tip">Enter search keywords:</p>
+ <form action="/cgi-bin/koha/catalogue/search.pl" method="get" id="cat-search-block">
+ <input type="text" name="q" id="search-form" size="40" value="" title="Enter the terms you wish to search for." class="form-text" />
+ <input type="submit" value="Submit" class="submit" />
+ </form>
+ </div>
+ [% END %]
+ <ul>
+ <li><a href="#subscription_search">Search subscriptions</a></li>
+ [% IF ( CAN_user_circulate ) %]<li><a href="#circ_search">Check out</a></li>[% END %]
+ [% IF ( CAN_user_catalogue ) %]<li><a href="#catalog_search">Search the catalog</a></li>[% END %]
+ </ul>
+ </div><!-- /header_search -->
</div><!-- /gradient -->
<!-- End Serials Resident Search Box -->
// NEXT BLOCK IS USED BY NEWORDERBEMPTY
-function calcNeworderTotal(){
- //collect values
- var f = document.getElementById('Aform');
- var quantity = new Number(f.quantity.value);
- var discount = new Number(f.discount.value);
- var listinc = new Number (f.listinc.value);
- //var currency = f.currency.value;
- var applygst = new Number (f.applygst.value);
- var listprice = new Number(f.listprice.value);
- var invoiceingst = new Number (f.invoiceincgst.value);
-// var exchangerate = new Number(f.elements[currency].value); //get exchange rate
- var currcode = new String(document.getElementById('currency').value);
- var exchangerate = new Number(document.getElementById(currcode).value);
-
- var gst_on=(!listinc && invoiceingst);
-
- //do real stuff
+function updateCosts(){
+ var quantity = new Number($("#quantity").val());
+ var discount = new Number($("#discount").val());
+ var applygst = new Number ($("#applygst").val());
+ var listprice = new Number($("#listprice").val());
+ var exchangerate = new Number($("#currency_rate").val());
+ var gst_on=false;
+
var rrp = new Number(listprice*exchangerate);
var ecost = rrp;
- if (100-discount != 100) { //Prevent rounding issues if no discount
- ecost = new Number(Math.floor(rrp * (100 - discount ))/100);
- }
- var GST = new Number(0);
- if (gst_on) {
- rrp=rrp * (1+f.gstrate.value / 100);
- GST=ecost * f.gstrate.value / 100;
+ if ( 100-discount != 100 ) { //Prevent rounding issues if no discount
+ ecost = new Number(Math.floor(rrp * (100 - discount )) / 100);
}
+ var total = new Number( ecost * quantity);
+ $("#rrp").val(rrp.toFixed(2));
+ $("#ecost").val(ecost.toFixed(2));
+ $("#total").val(total.toFixed(2));
+ $("listprice").val(listprice.toFixed(2));
- var total = new Number( (ecost + GST) * quantity);
-
- f.rrp.value = rrp.toFixed(2);
-
-// f.rrp.value = rrp
-// f.rrp.value = 'moo'
-
- f.ecost.value = ecost.toFixed(2);
- f.total.value = total.toFixed(2);
- f.listprice.value = listprice.toFixed(2);
-
-// gst-stuff needs verifing, mason.
- if (f.GST) {
- f.GST.value=GST;
- }
return true;
}
for (i=1;i<=2;i++) {
- var sort_dropbox = document.getElementById('sort'+i);
+ var sort_zone = document.getElementById('sort'+i+'_zone');
var url = '../acqui/fetch_sort_dropbox.pl?sort='+i+'&budget_id='+budgetId;
var xmlhttp = null;
}
};
// rc = eval ( xmlhttp.responseText );
- sort_dropbox.innerHTML = xmlhttp.responseText;
+ var retRootType = xmlhttp.responseXML.firstChild.nodeName;
+ var existingInputs = sort_zone.getElementsByTagName('input');
+ if (existingInputs.length > 0 && retRootType == 'input') {
+ // when sort is already an input, do not override to preseve value
+ return;
+ }
+ sort_zone.innerHTML = xmlhttp.responseText;
}
}
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
- list-style:none;
- padding: 2px;
- margin: 0;
- display:block;
- float: left;
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
}
.ui-menu .ui-menu {
- margin-top: -3px;
+ margin-top: -3px;
}
.ui-menu .ui-menu-item {
- margin:0;
- padding: 0;
- zoom: 1;
- float: left;
- clear: left;
- width: 100%;
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
}
.ui-menu .ui-menu-item a {
- text-decoration:none;
- display:block;
- padding:.2em .4em;
- line-height:1.5;
- zoom:1;
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
- font-weight: normal;
- margin: -1px;
+ font-weight: normal;
+ margin: -1px;
}
/*!
* jQuery UI Slider 1.8.23
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.sortable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=this.options.axis==="x"||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=this.options.axis==="y"||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i],this.direction=j-h>0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.23"})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.autocomplete.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
</div>
<div id="sysinfo">
+ [% IF (warnIsRootUser) %]
+ <h2>Warning regarding current user</h2>
+ <p>It seems that you are logged in as database administrative user. A lot of things will not work with this account.</p>
+ <p>Usually you need to log in with a regular staff account. To create a staff account, create a branch, a patron category 'Staff' and add a new patron. Then give this patron permissions from 'More' in the toolbar.</p>
+ [% END %]
<h2>Warnings regarding the system configuration</h2>
[% IF ( (prefNoZebra) || (warnPrefBiblioAddsAuthorities) || warnPrefEasyAnalyticalRecords ) %]
<table>
<li>Jon Aker</li>
<li>Edward Allen</li>
<li>Francisco M. Marzoa Alonso</li>
+ <li>Joseph Alway</li>
<li>Cindy Murdock Ames</li>
<li>Richard Anderson</li>
<li><a href="https://www.ohloh.net/p/koha/contributors/6620692181851">Nahuel Angelinetti</a></li>
<li>Gaetan Boisson</li>
<li>Danny Bouman</li>
<li>Stan Brinkerhoff</li>
+ <li>Ivan Brown</li>
<li>Roger Buck</li>
<li>Steven Callender</li>
<li><a href="https://www.ohloh.net/p/koha/contributors/6620692376789">Jared Camins-Esakov</a></li>
<li>Brig C. McCoy</li>
<li>Dorian Meid (German translation)</li>
<li>Meenakshi. R</li>
+ <li>Melia Meggs</li>
<li>Matthias Meusburger</li>
<li>Sophie Meynieux</li>
<li>Alan Millar</li>
[% ELSE %]
<li>
<label for="currency">Currency:</label>
- <select name="currency" id="currency" onchange="calcNeworderTotal();">
+ <select name="currency" id="currency">
[% FOREACH loop_currencie IN loop_currencies %]
[% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
</select>
</li>
<li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
<label for="sort1">Planning value1: </label>
-
+ <span id="sort1_zone">
[% IF CGIsort1 %]
<select id="sort1" size="1" name="sort1">
[% FOREACH sort_opt IN CGIsort1 %]
[% ELSE %]
<input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
[% END %]
+ </span>
</li>
<li>
<label for="sort2">Planning value2: </label>
-
- [% IF CGIsort2 %]
- <select id="sort2" size="1" name="sort1">
- [% FOREACH sort_opt IN CGIsort2 %]
- [% IF sort_opt.default %]
- <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
- [% ELSE %]
- <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
+ <span id="sort2_zone">
+ [% IF CGIsort2 %]
+ <select id="sort2" size="1" name="sort1">
+ [% FOREACH sort_opt IN CGIsort2 %]
+ [% IF sort_opt.default %]
+ <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
+ [% ELSE %]
+ <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
+ [% END %]
[% END %]
+ </select>
+ [% ELSE %]
+ <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
[% END %]
- </select>
- [% ELSE %]
- <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
- [% END %]
+ </span>
</li>
<li>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
[% INCLUDE 'datatables-strings.inc' %]
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+
+<script type="text/javascript">
+//<![CDATA[
+ function updateColumnsVisibility(visible) {
+ if ( visible ) {
+ $("table .gste, .gsti").show();
+ } else {
+ [% IF ( listincgst ) %]
+ $("table .gste").hide();
+ [% ELSE %]
+ $("table .gsti").hide();
+ [% END %]
+ }
+ }
+
+ $(document).ready(function() {
+ $("#show_all_details").click(function(){
+ updateColumnsVisibility($(this+":checked").val());
+ });
+
+ $("#show_all_details").attr('checked', false);
+ updateColumnsVisibility(false);
+ });
+//]]>
+</script>
+
[% UNLESS ( closedate ) %]
<script type="text/javascript">
//<![CDATA[
// YUI Toolbar Functions
function yuiToolbar() {
new YAHOO.widget.Button("reopenbutton");
+ new YAHOO.widget.Button("exportbutton");
}
//]]>
</script>
<ul id="toolbar-list" class="toolbar">
<li><a href="javascript:confirm_reopen([% skip_confirm_reopen %]);" class="button" id="reopenbutton">Reopen this basket</a></li>
+ <li><a href="[% script_name %]?op=export&basketno=[% basketno %]&booksellerid=[% booksellerid %]" class="button" id="exportbutton">Export this basket as CSV</a></li>
</ul>
</div>
[% END %]
[% IF ( basketcontractno ) %]
<li><span class="label">Contract name:</span> <a href="../admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]&booksellerid=[% booksellerid %]">[% basketcontractname %]</a></li>
[% END %]
+ [% IF ( deliveryplace ) %]<li><span class="label">Delivery place:</span> [% deliveryplace %]</li>[% END %]
+ [% IF ( billingplace ) %]<li><span class="label">Billing place:</span> [% billingplace %]</li>[% END %]
[% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span> [% authorisedbyname %]</li>[% END %]
[% IF ( creationdate ) %]<li><span class="label">Opened on:</span> [% creationdate | $KohaDates %]</li>[% END %]
[% IF ( closedate ) %]<li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>[% END %]
<input type="submit" value="Change basket group" /></p>
</form>
+ [% IF ( basketgroupdeliveryplace ) %]<p>Basket group delivery place: [% basketgroupdeliveryplace %]</p>[% END %]
+ [% IF ( basketgroupbillingplace ) %]<p>Basket group billing place: [% basketgroupbillingplace %]</p>[% END %]
</div>
[% END %]
</div>
[% UNLESS ( delete_confirm ) %]
<div id="acqui_basket_content" class="yui-g">
- <h2>Order Details</h2>
[% IF ( books_loop ) %]
+ <h2>Orders</h2>
+ <label for="show_all_details">
+ <input type="checkbox" style="vertical-align: middle;" id="show_all_details" />
+ Show all details
+ </label>
<table id="orders">
<thead>
<tr>
<th>Order</th>
- <th>RRP</th>
- <th>Est.</th>
+ <th class="gste">RRP tax exc.</th>
+ <th class="gste">ecost tax exc.</th>
+ <th class="gsti">RRP tax inc.</th>
+ <th class="gsti">ecost tax inc.</th>
<th>Qty.</th>
- <th>Total</th>
+ <th class="gste">Total tax exc. ([% currency %])</th>
+ <th class="gsti">Total tax inc. ([% currency %])</th>
+ <th>GST %</th>
+ <th>GST</th>
<th>Fund</th>
[% IF ( active ) %]
[% UNLESS ( closedate ) %]
</tr>
</thead>
<tfoot>
- [% IF ( GST ) %]
- <tr>
- <th scope="row">Total tax exc.</th>
- <td>[% total_rrp_gste %]</td>
- <td> </td>
- <td>[% qty_total %]</td>
- <td>[% total_est_gste %]</td>
+ [% FOREACH foot_loo IN book_foot_loop %]
+ <tr>
+ <th>Total (GST [% foot_loo.gstgsti %])</th>
+ <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
+ <th>[% foot_loo.quantity %]</th>
+ <th class="gste">[% foot_loo.totalgste %]</th>
+ <th class="gsti">[% foot_loo.totalgsti %]</th>
+ <th/>
+ <th>[% foot_loo.gstvalue %]</th>
+ <th/>
[% IF ( active ) %]
- [% IF ( closedate ) %]
- <td colspan="1" rowspan="3"> </td>
- [% ELSE %]
- <td colspan="3" rowspan="3"> </td>
+ [% UNLESS ( closedate ) %]
+ <th> </th>
+ <th> </th>
[% END %]
[% END %]
- </tr>
- <tr>
- <th scope="row">Tax ([% gist_rate %])</th>
- <td>[% gist_rrp %]</td>
- <td> </td>
- <td> </td>
- <td>[% gist_est %]</td>
- </tr>
- <tr>
- <th scope="row">Total tax inc. ([% currency %])</th>
- <td>[% total_rrp_gsti %]</td>
- <td> </td>
- <td>[% qty_total %]</td>
- <td>[% total_est_gsti %]</td>
- </tr>
- [% ELSE %]
+ </tr>
+ [% END %]
<tr>
- <th scope="row">Total ([% currency %])</th>
- <td>[% total_rrp_gsti %]</td>
- <td> </td>
- <td>[% qty_total %]</td>
- <td>[% total_est_gsti %]</td>
- <td colspan="3"> </td>
+ <th>Total ([% currency %])</th>
+ <th class="gste"/><th class="gste"/><th class="gsti"/><th class="gsti"/>
+ <th>[% total_quantity %]</th>
+ <th class="gste">[% total_gste %]</th>
+ <th class="gsti">[% total_gsti %]</th>
+ <th/>
+ <th>[% total_gstvalue %]</th>
+ <th/>
+ [% IF ( active ) %]
+ [% UNLESS ( closedate ) %]
+ <th> </th>
+ <th> </th>
+ [% END %]
+ [% END %]
</tr>
- [% END %]
</tfoot>
<tbody>
[% FOREACH books_loo IN books_loop %]
[% END %]
</p>
</td>
- <td class="number [% IF books_loo.rrp.search('^0') %]error[% END %]">[% books_loo.rrp %]</td>
- <td class="number [% IF books_loo.ecost.search('^0') %]error[% END %]">[% books_loo.ecost %]</td>
+ <td class="number gste [% IF books_loo.rrpgste.search('^0') %]error[% END %]">[% books_loo.rrpgste %]</td>
+ <td class="number gste [% IF books_loo.ecostgste.search('^0') %]error[% END %]">[% books_loo.ecostgste %]</td>
+ <td class="number gsti [% IF books_loo.rrpgsti.search('^0') %]error[% END %]">[% books_loo.rrpgsti %]</td>
+ <td class="number gsti [% IF books_loo.ecostgsti.search('^0') %]error[% END %]">[% books_loo.ecostgsti %]</td>
<td class="number [% IF books_loo.quantity.search('^0') %]error[% END %]">[% books_loo.quantity %]</td>
- <td class="number [% IF books_loo.line_total.search('^0') %]error[% END %]">[% books_loo.line_total %]</td>
+ <td class="number gste [% IF books_loo.totalgste.search('^0') %]error[% END %]">[% books_loo.totalgste %]</td>
+ <td class="number gsti [% IF books_loo.totalgsti.search('^0') %]error[% END %]">[% books_loo.totalgsti %]</td>
+ <td class="number [% IF books_loo.gstgsti.search('^0') %]error[% END %]">[% books_loo.gstgsti %]</td>
+ <td class="number [% IF books_loo.gstvalue.search('^0') %]error[% END %]">[% books_loo.gstvalue %]</td>
<td>[% books_loo.budget_name %]</td>
[% IF ( active ) %]
[% UNLESS ( closedate ) %]
[% END %]
</tbody>
</table>
- [% ELSE %]
- <table>
- <tr><td>Basket empty</td></tr>
- </table>
[% END %]
[% IF ( listincgst ) %]<small class="highlight">** Vendor's listings already include tax.</small>
[% END %]
<thead>
<tr>
<th>Order</th>
- <th>RRP</th>
- <th>Est.</th>
+ <th class="gste">RRP tax exc.</th>
+ <th class="gste">ecost tax exc.</th>
+ <th class="gsti">RRP tax inc.</th>
+ <th class="gsti">ecost tax inc.</th>
<th>Qty.</th>
- <th>Total</th>
+ <th class="gste">Total tax exc. ([% currency %])</th>
+ <th class="gsti">Total tax inc. ([% currency %])</th>
+ <th>GST %</th>
+ <th>GST</th>
<th>Fund</th>
</tr>
</thead>
[% IF ( books_loo.editionstatement ) %], [% books_loo.editionstatement %][% END %]
</p>
</td>
- <td><p>[% order.rrp %]</p></td>
- <td><p>[% order.ecost %]</p></td>
- <td><p>[% order.quantity %]</p></td>
- <td><p>[% order.line_total %]</p></td>
- <td><p>[% order.budget_name %]</p></td>
+ <td class="number gste">[% order.rrpgste %]</td>
+ <td class="number gste">[% order.ecostgste %]</td>
+ <td class="number gsti">[% order.rrpgsti %]</td>
+ <td class="number gsti">[% order.ecostgsti %]</td>
+ <td class="number">[% order.quantity %]</td>
+ <td class="number gste">[% order.totalgste %]</td>
+ <td class="number gsti">[% order.totalgsti %]</td>
+ <td class="number">[% order.gstgsti %]</td>
+ <td class="number">[% order.gstvalue %]</td>
+ <td>[% order.budget_name %]
</tr>
[% END %]
</tbody>
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
<input type="hidden" name="confirm" value="1" />
<input type="hidden" name="basketgroupname" value="[% basketgroupname %]" />
- <input type="submit" class="approve" value="Yes, Close (Y)" accesskey="y" />
- <input type="submit" class="deny" value="No, Don't Close (N)" accesskey="n" onclick="javascript:window.location='/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]';return false;" />
+ <input type="submit" class="approve" value="Yes, close (Y)" accesskey="y" />
+ <input type="submit" class="deny" value="No, don't close (N)" accesskey="n" onclick="javascript:window.location='/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]';return false;" />
</form>
</div>
[% END %]
<input type="text" name="basketgroupname" id="basketgroupname" value="[% name %]" /></li>
<li><label for="billingplace">Billing place:</label>
<select name="billingplace" id="billingplace" style="width:13em;">
+ <option value="">--</option>
[% FOREACH billingplaceloo IN billingplaceloop %]
[% IF ( billingplaceloo.selected ) %]<option value="[% billingplaceloo.value %]" selected="selected">[% billingplaceloo.branchname %]</option>
[% ELSE %]<option value="[% billingplaceloo.value %]">[% billingplaceloo.branchname %]</option>[% END%]
<label for="basketname" class="required">Basket name</label>
<input type="text" name="basketname" id="basketname" size="40" maxlength="80" value="[% basketname %]" />
</li>
+ <li>
+ <label for="billingplace">Billing Place:</label>
+ <select name="billingplace" id="billingplace">
+ <option value="">--</option>
+ [% FOREACH billingplace IN billingplaceloop %]
+ [% IF ( billingplace.selected ) %]
+ <option value="[% billingplace.value %]" selected="selected">
+ [% ELSE %]
+ <option value="[% billingplace.value %]">
+ [% END %]
+ [% billingplace.branchname %]
+ </option>
+ [% END %]
+ </select>
+ </li>
+ <li>
+ <label for="deliveryplace">Delivery Place:</label>
+ <select name="deliveryplace" id="deliveryplace">
+ <option value="">--</option>
+ [% FOREACH deliveryplace IN deliveryplaceloop %]
+ [% IF ( deliveryplace.selected ) %]
+ <option value="[% deliveryplace.value %]" selected="selected">
+ [% ELSE %]
+ <option value="[% deliveryplace.value %]">
+ [% END %]
+ [% deliveryplace.branchname %]
+ </option>
+ [% END %]
+ </select>
+ </li>
<li>
<label for="basketbooksellerid">Vendor</label>
<select name="basketbooksellerid" id="basketbooksellerid">
<br />[% suggestions_loo.author %] <br /> [% suggestions_loo.isbn %]</td>
<td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% suggestions_loo.id %]">[% suggestions_loo.name %]</a></td>
<td>[% suggestions_loo.creationdate | $KohaDates %]</td>
- <td>[% suggestions_loo.datereceived | $KohaDates %]</td>
+ <td>
+ [% IF suggestions_loo.datereceived %]
+ [% suggestions_loo.datereceived | $KohaDates %]
+ [% END %]
+ </td>
<td>[% suggestions_loo.quantity %]</td>
<td>[% suggestions_loo.ecost %]</td>
</tr>
--- /dev/null
+[% USE KohaDates %]
+
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha › Acquisitions › Invoice</title>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'doc-head-close.inc' %]
+[% INCLUDE 'calendar.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+<script type="text/javascript">
+//<![CDATA[
+ $(document).ready(function() {
+ $("#orderst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ bInfo: false,
+ bPaginate: false,
+ bFilter: false,
+ sDom: "t"
+ }));
+ });
+//]]>
+</script>
+</head>
+
+<body>
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'acquisitions-search.inc' %]
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/invoices.pl">Invoices</a> › <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">[% invoicenumber %]</a></div>
+
+<div id="doc3" class="yui-t2">
+
+<div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+ [% IF ( modified ) %]
+ <div class="dialog">
+ <p>Invoice has been modified</p>
+ </div>
+ [% END %]
+ <h1>Invoice: [% invoicenumber %]</h1>
+
+ <p>Supplier: [% suppliername %]</p>
+ <form action="" method="post">
+ <fieldset>
+ <label for="shipmentdate">Shipment date:</label>
+ <input type="text" size="10" id="shipmentdate" name="shipmentdate" value="[% shipmentdate | $KohaDates %]" readonly="readonly" class="datepicker" />
+ <p></p>
+ <label for="billingdate">Billing date:</label>
+ <input type="text" size="10" id="billingdate" name="billingdate" value="[% billingdate | $KohaDates %]" readonly="readonly" class="datepicker" />
+ <p></p>
+ <label for="shipmentcost">Shipment cost:</label>
+ <input type="text" size="10" id="shipmentcost" name="shipmentcost" value="[% shipmentcost %]" />
+ <label for="shipment_budget_id">Budget:</label>
+ <select id="shipment_budget_id" name="shipment_budget_id">
+ <option value="">No budget</option>
+ [% FOREACH budget IN budgets_loop %]
+ [% IF ( budget.selected ) %]
+ <option selected="selected" value="[% budget.budget_id %]">
+ [% ELSE %]
+ <option value="[% budget.budget_id %]">
+ [% END %]
+ [% budget.budget_name %]
+ </option>
+ [% END %]
+ </select>
+ <p></p>
+ <label>Status:</label>
+ [% IF ( invoiceclosedate ) %]
+ Closed on [% invoiceclosedate | $KohaDates %].
+ <p></p>
+ <input type="checkbox" name="reopen" id="reopen" />
+ <label for="reopen">Reopen</label>
+ [% ELSE %]
+ Open.
+ <p></p>
+ <input type="checkbox" name="close" id="close" />
+ <label for="close">Close</label>
+ [% END %]
+ <input type="hidden" name="op" value="mod" />
+ <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
+ <fieldset class="action">
+ <input type="submit" value="Save">
+ </fieldset>
+ </fieldset>
+ </form>
+ <p>
+ <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Go to receipt page</a>
+ </p>
+ <h2>Invoice details</h2>
+ [% IF orders_loop.size %]
+ <table id="orderst">
+ <thead>
+ <tr>
+ <th>Summary</th>
+ <th>Publisher</th>
+ <th>Branch</th>
+ <th>RRP</th>
+ <th>Est.</th>
+ <th>Qty.</th>
+ <th>Total</th>
+ <th>Fund</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH order IN orders_loop %]
+ <tr>
+ <td><p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title %]</a>
+ [% IF ( order.author ) %]
+ <br /><em>by</em> [% order.author %]
+ [% END %]
+ </p></td>
+ <td>
+ [% IF ( order.publishercode ) %]
+ <p>[% order.publishercode %]
+ [% IF ( order.publicationyear ) %]
+ - [% order.publicationyear %]
+ [% END %]
+ </p>
+ [% END %]
+ </td>
+ <td><p>[% order.branchcode %]</p></td>
+ <td>[% order.rrp %]</td>
+ <td>[% order.ecost %]</td>
+ <td class="number">[% order.quantity %]</td>
+ <td>[% order.total %]</td>
+ <td>[% order.budget_name %]</td>
+ </tr>
+ [% END %]
+ </tbody>
+ <tfoot>
+ <tr>
+ <th colspan="3">Total Tax Exc.</th>
+ <th>[% total_rrp_gste %]</th>
+ <th> </th>
+ <th>[% total_quantity %]</th>
+ <th>[% total_est_gste %]</th>
+ <th> </th>
+ </tr>
+ <tr>
+ <th colspan='3'>Tax ([% gist %]%)</th>
+ <th>[% gist_rrp %]</th>
+ <th> </th>
+ <th> </th>
+ <th>[% gist_est %]</th>
+ <th> </th>
+ </tr>
+ <tr>
+ <th colspan='3'>Total Tax Inc. ([% currency %])</th>
+ <th>[% total_rrp_gsti %]</th>
+ <th> </th>
+ <th>[% total_quantity %]</th>
+ <th>[% total_est_gsti %]</th>
+ <th> </th>
+ </tr>
+ <tr>
+ <th colspan="3">Total + Shipment cost ([% currency %])</th>
+ <th> </th>
+ <th> </th>
+ <th>[% total_quantity %]</th>
+ <th>[% total_gsti_shipment %]</th>
+ <th> </th>
+ </tr>
+ </tfoot>
+ </table>
+ [% ELSE %]
+ <p>No orders yet</p>
+ [% END %]
+ </div>
+ </div>
+ <div class="yui-b">
+ [% INCLUDE 'acquisitions-menu.inc' %]
+ </div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
--- /dev/null
+[% USE KohaDates %]
+
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha › Acquisitions › Invoices</title>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+[% INCLUDE 'calendar.inc' %]
+<script type="text/javascript">
+//<![CDATA[
+$(document).ready(function() {
+ $("#resultst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ bInfo: false,
+ bPaginate: false,
+ bFilter: false,
+ sDom: "t",
+ aoColumnDefs: [
+ { "bSortable": false, "aTargets": [6] }
+ ]
+ }));
+});
+//]]>
+</script>
+</head>
+
+<body>
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'acquisitions-search.inc' %]
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › Invoices</div>
+
+<div id="doc3" class="yui-t2">
+
+<div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+ <h1>Invoices</h1>
+ [% IF ( do_search ) %]
+ [% IF ( results_loop ) %]
+ <table id="resultst">
+ <thead>
+ <tr>
+ <th>Invoice no.</th>
+ <th>Vendor</th>
+ <th>Billing date</th>
+ <th>Received biblios</th>
+ <th>Received items</th>
+ <th>Status</th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH result IN results_loop %]
+ <tr>
+ <td>[% result.invoicenumber %]</td>
+ <td>[% result.suppliername %]</td>
+ <td>
+ [% IF (result.billingdate) %]
+ [% result.billingdate | $KohaDates %]
+ [% END %]
+ </td>
+ <td>[% result.receivedbiblios %]</td>
+ <td>[% result.receiveditems %]</td>
+ <td>
+ [% IF ( result.closedate ) %]
+ Closed on [% result.closedate | $KohaDates %]
+ [% ELSE %]
+ Open
+ [% END %]
+ </td>
+ <td>
+ <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% result.invoiceid %]">Details</a> /
+ [% IF ( result.closedate ) %]
+ <a href="invoice.pl?op=reopen&invoiceid=[% result.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% supplier %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Reopen</a>
+ [% ELSE %]
+ <a href="invoice.pl?op=close&invoiceid=[% result.invoiceid %]&referer=/cgi-bin/koha/acqui/invoices.pl%3Fop=do_search%26invoicenumber=[% invoicenumber %]%26supplier=[% supplier %]%26billingdatefrom=[% billingdatefrom %]%26billingdateto=[% billingdateto %]%26isbneanissn=[% isbneanissn %]%26title=[% title %]%26author=[% author %]%26publisher=[% publisher %]%26publicationyear=[% publicationyear %]%26branch=[% branch %]">Close</a>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ [% ELSE %]
+ <p>Sorry, but there is no results for your search.</p>
+ <p>Search was:
+ <ul>
+ [% IF ( invoicenumber ) %]
+ <li>Invoice no.: [% invoicenumber %]</li>
+ [% END %]
+ [% IF ( supplier ) %]
+ <li>Vendor: [% suppliername %]</li>
+ [% END %]
+ [% IF ( billingdatefrom ) %]
+ <li>Billing date:
+ [% IF ( billingdateto ) %]
+ From [% billingdatefrom %]
+ To [% billingdateto %]
+ [% ELSE %]
+ All since [% billingdatefrom %]
+ [% END %]
+ </li>
+ [% ELSE %]
+ [% IF ( billingdateto ) %]
+ <li>Billing date:
+ All until [% billingdateto %]
+ </li>
+ [% END %]
+ [% END %]
+ [% IF ( isbneanissn ) %]
+ <li>ISBN/EAN/ISSN: [% isbneanissn %]</li>
+ [% END %]
+ [% IF ( title ) %]
+ <li>Title: [% title %]</li>
+ [% END %]
+ [% IF ( author ) %]
+ <li>Author: [% author %]</li>
+ [% END %]
+ [% IF ( publisher ) %]
+ <li>Publisher: [% publisher %]</li>
+ [% END %]
+ [% IF ( publicationyear ) %]
+ <li>Publication year: [% publicationyear %]</li>
+ [% END %]
+ [% IF ( branch ) %]
+ <li>Branch: [% branchname %]</li>
+ [% END %]
+ </ul>
+ </p>
+ [% END %]<!-- results_loop -->
+ [% ELSE %]
+ <p>Please fill in the form to the left to make a search.</p>
+ [% END %]<!-- do_search -->
+ </div>
+ </div>
+ <div class="yui-b">
+ <form action="" method="get">
+ <fieldset class="brief">
+ <h3>Search filters</h3>
+ <ol>
+ <li>
+ <label for="invoicenumber">Invoice no:</label>
+ <input type="text" id="invoicenumber" name="invoicenumber" value="[% invoicenumber %]" />
+ </li>
+ <li>
+ <label for="supplier">Supplier:</label>
+ <select id="supplier" name="supplier">
+ <option value="">All</option>
+ [% FOREACH supplier IN suppliers_loop %]
+ [% IF ( supplier.selected ) %]
+ <option selected="selected" value="[% supplier.supplierid %]">[% supplier.suppliername %]</option>
+ [% ELSE %]
+ <option value="[% supplier.supplierid %]">[% supplier.suppliername %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ <li>
+ <fieldset class="brief">
+ <legend>Shipment date</legend>
+ <ol>
+ <li>
+ <label for="shipmentdatefrom">From:</label>
+ <input type="text" id="shipmentdatefrom" name="shipmentdatefrom" size="10" value="[% shipmentdatefrom %]" class="datepicker" />
+ </li>
+ <li>
+ <label for="shipmentdateto">To:</label>
+ <input type="text" id="shipmentdateto" name="shipmentdateto" size="10" value="[% shipmentdateto %]" class="datepicker" />
+ </li>
+ </ol>
+ </fieldset>
+ </li>
+ <li>
+ <fieldset class="brief">
+ <legend>Billing date</legend>
+ <ol>
+ <li>
+ <label for="billingdatefrom">From:</label>
+ <input type="text" id="billingdatefrom" name="billingdatefrom" size="10" value="[% billingdatefrom %]" class="datepicker" />
+ </li>
+ <li>
+ <label for="billingdateto">To:</label>
+ <input type="text" id="billingdateto" name="billingdateto" size="10" value="[% billingdateto %]" class="datepicker" />
+ </li>
+ </ol>
+ </fieldset>
+ </li>
+ <li>
+ <label for="isbneanissn">ISBN / EAN / ISSN:</label>
+ <input type="text" id="isbneanissn" name="isbneanissn" value="[% isbneanissn %]" />
+ </li>
+ <li>
+ <label for="title">Title:</label>
+ <input type="text" id="title" name="title" value="[% title %]" />
+ </li>
+ <li>
+ <label for="author">Author:</label>
+ <input type="text" id="author" name="author" value="[% author %]" />
+ </li>
+ <li>
+ <label for="publisher">Publisher:</label>
+ <input type="text" id="publisher" name="publisher" value="[% publisher %]" />
+ </li>
+ <li>
+ <label for="publicationyear">Publication year:</label>
+ <input type="text" id="publicationyear" name="publicationyear" value="[% publicationyear %]" />
+ </li>
+ <li>
+ <label for="branch">Branch:</label>
+ <select id="branch" name="branch">
+ <option value="">All</option>
+ [% FOREACH branch IN branches_loop %]
+ [% IF ( branch.selected ) %]
+ <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+ [% ELSE %]
+ <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ </ol>
+ <fieldset class="action">
+ <input type="submit" value="Search" />
+ </fieldset>
+ </fieldset>
+ <input type="hidden" name="op" id="op" value="do_search" />
+ </form>
+ [% INCLUDE 'acquisitions-menu.inc' %]
+ </div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
[% END %]
$("#quantity").change(function() {
- calcNeworderTotal();
+ updateCosts();
});
//We apply the fonction only for modify option
});
[% END %]
+ //keep a copy of all budgets before removing the inactives
+ disabledBudgetsCopy = $('#budget_id').html();
+ $('#budget_id .b_inactive').remove();
+
$('#showallbudgets').click(function() {
- if ( $('#budget_id .b_inactive').is(":visible") )
- {
- $('#budget_id .b_inactive').hide();
+ if ($(this).is(":checked")) {
+ $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
}
else {
- $('#budget_id .b_inactive').show();
+ $('#budget_id .b_inactive').remove();
}
});
});
//]]>
</script>
</head>
-<body id="acq_neworderempty" class="acq">
+<body id="acq_neworderempty" class="acq" onload="updateCosts()">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
<input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
- <input type="hidden" name="discount" value="[% discount %]" />
- <input type="hidden" name="listinc" value="[% listincgst %]" />
-<!-- <input type="hidden" name="currency" value="[% currency %]" />-->
- <input type="hidden" name="applygst" value="[% gstreg %]" />
- <input type="hidden" name="invoiceincgst" value="[% invoiceincgst %]" />
- <input type="hidden" name="gstrate" value="[% gstrate %]" />
+ <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
+ <input type="hidden" name="applygst" id="applygst" value="[% gstreg %]" />
+ <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
<input type="hidden" name="suggestionid" value="[% suggestionid %]" />
<input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
+ <input type="hidden" name="currency_rate" id="currency_rate" value="[% currency_rate %]" />
- [% FOREACH loop_currencie IN loop_currencies %]
- <input type="hidden" id="[% loop_currencie.currcode %]" name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
- [% END %]
<ol><li>
[% IF ( biblionumber ) %]
<span class="label">Title</span>
[% IF (AcqCreateItemOrdering) %]
<input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
[% ELSE %]
- <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" />
+ <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
[% END %]
[% END %]
<!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
<option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
[% ELSE %]
[% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
- [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none;">[% budget_loo.b_txt %]</option>
+ [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option>
[% END %]
[% END %]
[% END %]
<input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
[% ELSE %]
<label for="currency">Currency:</label>
- <select name="currency" id="currency" onchange="calcNeworderTotal();">
+ <select name="currency" id="currency" onchange="updateCosts();">
[% FOREACH loop_currencie IN loop_currencies %]
[% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
</select>
</li>
<li>
[% IF ( close ) %]
- <span class="label">Vendor price: </span>
+ <span class="label">Vendor price: </span>
<input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
[% ELSE %]
<label for="listprice">Vendor price: </label>
- <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="calcNeworderTotal()" />
+ <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" />
[% END %]
</li>
[% UNLESS ( close ) %]
[% END %]
</li>
[% END %]
- <li>
+ <li>
[% IF ( close ) %]
- <span class="label">Replacement cost: </span>
- <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
+ <span class="label">Tax rate: </span>
+ <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
[% ELSE %]
- <label for="rrp">Replacement cost: </label>
- <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
+ <label for="gst">Tax rate: </label>
+ <select name="gstrate" id="gstrate" onchange="updateCosts();">
+ [% FOREACH gst IN gst_values %]
+ [% IF ( gst.option == gstrate ) %]
+ <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
+ [% ELSE %]
+ <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
+ [% END %]
+ [% END %]
+ </select>
[% END %]
</li>
<li>
+ <label for="discount">Discount: </label>
[% IF ( close ) %]
- <label for="ecost">Budgeted cost: </label>
- <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" />
+ [% IF ( orderdiscount ) %]
+ <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
+ [% ELSE %]
+ <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
+ [% END %]
[% ELSE %]
- <label for="ecost">Budgeted cost: </label>
- <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
+ [% IF ( orderdiscount ) %]
+ <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
+ [% ELSE %]
+ <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
+ [% END %]
[% END %]
- [% IF ( discount_2dp ) %] (adjusted for [% discount_2dp %]% discount) [% END %]
-
</li>
- [% IF ( GST ) %]
<li>
[% IF ( close ) %]
- <label for="GST">Budgeted GST: </label>
- <input type="text" id="" size="20" name="gst" value="" id="GST" readonly="readonly" />
+ <span class="label">Replacement cost: </span>
+ <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
[% ELSE %]
- <label for="GST">Budgeted GST: </label>
- <input type="text" size="20" name="gst" id="GST" value="" />
+ <label for="rrp">Replacement cost: </label>
+ <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
+ [% END %]
+ </li>
+ <li>
+ [% IF ( close ) %]
+ <label for="ecost">Budgeted cost: </label>
+ <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" />
+ [% ELSE %]
+ <label for="ecost">Budgeted cost: </label>
+ <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
[% END %]
</li>
- [% END %]
<li>
[% IF ( close ) %]
- <label for="total">Total: </label>
- <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
+ <label for="total">Total: </label>
+ <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
[% ELSE %]
- <label for="total">Total: </label>
- <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
+ <label for="total">Total: </label>
+ <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
[% END %]
</li>
<li>
[% IF ( close ) %]
- <label for="cost">Actual cost: </label>
- <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
+ <label for="unitprice">Actual cost: </label>
+ <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
[% ELSE %]
- <label for="cost">Actual cost: </label>
- <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
+ <label for="unitprice">Actual cost: </label>
+ <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
[% END %]
</li>
<li>
</li>
<li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
<label for="sort1">Statistic 1: </label>
-
+ <span id="sort1_zone">
[% IF CGIsort1 %]
<select id="sort1" size="1" name="sort1">
[% FOREACH sort_opt IN CGIsort1 %]
[% END %]
</select>
[% ELSE %]
-
<input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
[% END %]
+ </span>
</li>
<li>
<label for="sort2">Statistic 2: </label>
-
+ <span id="sort2_zone">
[% IF CGIsort2 %]
<select id="sort2" size="1" name="sort2">
[% FOREACH sort_opt IN CGIsort2 %]
[% ELSE %]
<input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
[% END %]
+ </span>
</li>
</ol>
</fieldset>
[% END %]
[% END %]
<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+ <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
<input type="hidden" name="ordernumber" value="[% ordernumber %]" />
<input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
<input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
- <input type="hidden" name="freight" value="[% freight %]" />
- <input type="hidden" name="gst" value="[% gst %]" />
+ <input type="hidden" name="gstrate" value="[% gstrate %]" />
</div>
<div class="yui-u">
<fieldset class="rows">
<input type="text" size="20" name="cost" id="cost" value="[% ecost %]" />
[% END %]</li></ol>
<label for="note">Notes: </label><textarea name="note" width="40" rows="8" >[% notes %]</textarea>
- <input type="hidden" name="invoice" value="[% invoice %]" />
</fieldset>
</div>
</div><div class="yui-g"><fieldset class="action">
<input type="submit" value="Save" />
- <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% supplierid %]&invoice=[% invoice %]&gst=[% gst %]&freight=[% freight %]">Cancel</a>
+ <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Cancel</a>
</fieldset></div> </form>
[% ELSE %]
<div id="acqui_acquire_orderlist">
<tr>
<td>[% loo.basketno %]</td>
<td>[% loo.isbn %]</td>
- <td><a href="orderreceive.pl?datereceived=[% loo.datereceived %]&receive=[% loo.ordernumber %]&biblio=[% loo.biblionumber %]&invoice=[% loo.invoice %]&freight=[% loo.freight %]&gst=[% loo.gst %]&id=[% loo.id %]">[% loo.title |html %]</a></td>
+ <td><a href="orderreceive.pl?ordernumber=[% loo.ordernumber %]&invoiceid=[% invoiceid %]">[% loo.title |html %]</a></td>
<td>[% loo.author %]</td>
<td>[% loo.quantity %]</td>
<td>[% loo.quantityreceived %]</td>
$(document).ready(function(){
var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
- { "aTargets": [ 3, 7, 8 ], "bSortable": false, "bSearchable": false },
+ { "aTargets": [ 3, 8, 9 ], "bSortable": false, "bSearchable": false },
],
"aoColumns": [
{ "sType": "num-html" },
null,
null,
null,
+ null,
],
"sPaginationType": "four_button"
} ) );
var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
- { "aTargets": [ 3 ], "bSortable": false, "bSearchable": false },
+ { "aTargets": [ 3, -1 ], "bSortable": false, "bSearchable": false },
],
"aoColumns": [
{ "sType": "num-html" },
null,
null,
null,
+ null
],
"sPaginationType": "four_button"
} ) );
+/*
+ $("#pendingt").tablesorter({
+ headers: { 2: { sorter: 'articles' },3: { sorter: false },8:{sorter:false}}
+ });
+*/
rowCountPending = $("#pendingt tbody.filterclass tr").length;
rowCountReceived = $("#receivedt tbody.filterclass tr").length;
$("#pendingcollapserow").remove();
$("#pendingt tr").show();
$("#pendingt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
- $("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:pendingExpand();\">" + _("Click here to show all ") + rowCountPending + _(" items") + "<\/a>.<\/p>");
+ $("#pendingt").before("<p id=\"pendingcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " <a href=\"javascript:pendingExpand();\">" + _("Click here to show all ") + rowCountPending + _(" items") + "<\/a>.<\/p>");
}
$("#pendingcollapserow").remove();
$("#pendingt tr").show();
$("#pendingt tbody.filterclass tr.orderfound").remove();
- $("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + "<a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
+ $("#pendingt").before("<p id=\"pendingcollapserow\">" + rowCountPending + _(" items are displayed.") + " <a href=\"javascript:pendingCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
}
// Collapse already received items table
$.cookie("receivedKeepExpanded", 0, { path: "/", expires: 9999 });
$("#receivedcollapserow").remove();
$("#receivedt tbody.filterclass tr:gt(" + (rowsToCollapse-1) + ")").hide();
- $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + "<a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
+ $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("Only the first ") + rowsToCollapse + _(" items are displayed.") + " <a href=\"javascript:receivedExpand();\">" + _("Click here to show all ") + rowCountReceived + _(" items") + "<\/a>.<\/p>");
}
// Expand already received items table
$.cookie("receivedKeepExpanded", 1, { path: "/", expires: 9999 });
$("#receivedcollapserow").remove();
$("#receivedt tr").show();
- $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + "<a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
+ $("#receivedt").before("<p id=\"receivedcollapserow\">" + _("All ") + rowCountReceived + _(" items are displayed.") + " <a href=\"javascript:receivedCollapse();\">" + _("Click here to show only the first ") + rowsToCollapse + _(" items") + "<\/a>.<\/p>");
}
//]]>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › [% IF ( datereceived ) %]
- Receipt summary for <i>[% name %]</i> [% IF ( invoice ) %]<i>[ [% invoice %] ]</i>[% END %] on <i>[% formatteddatereceived %]</i>
- [% ELSE %]
- Receive orders from [% name %]
- [% END %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> ›
+ [% IF ( datereceived ) %]
+ Receipt summary for <i>[% name %]</i>
+ [% IF ( invoice ) %]
+ <i>[ [% invoice %] ]</i>
+ [% END %]
+ on <i>[% formatteddatereceived %]</i>
+ [% ELSE %]
+ Receive orders from [% name %]
+ [% END %]
+</div>
<div id="doc3" class="yui-t2">
[% END %]
[% END %]
+ [% IF (error_cancelling_receipt) %]
+ <div class="error">
+ Cannot cancel receipt. Possible reasons :
+ <ul>
+ <li>
+ The order line you trying to cancel was created from a partial receipt
+ of another order line which is already received. Try to cancel this
+ one first and retry.
+ </li>
+ <li>
+ The order line you trying to cancel was created from a partial receipt
+ of another order line which has been deleted. Cancellation is not
+ possible.
+ </li>
+ </ul>
+ </div>
+ [% END %]
+
<div id="acqui_receive_summary">
<p><strong>Invoice number:</strong> [% invoice %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% formatteddatereceived %]</p>
- <!-- TODO: Add date picker, change rcv date. -->
</div>
+[% UNLESS (invoiceclosedate) %]
<div id="acqui_receive_search">
<h3>Pending orders</h3>
<th>Quantity</th>
<th>Unit cost</th>
<th>Order cost</th>
+ <th>Fund</th>
<th> </th>
<th> </th>
</tr>
</thead>
- <tfoot>
- <tr><td colspan="4" class="total">TOTAL</td>
- <td> [% totalPquantity %] </td>
- <td> </td>
- <td>[% ordergrandtotal %]</td>
- <td> </td>
- <td> </td>
- </tr>
- </tfoot>
<tbody class="filterclass">
[% FOREACH loop_order IN loop_orders %]
<tr>
<td>[% loop_order.quantity %]</td>
<td>[% loop_order.ecost %]</td>
<td>[% loop_order.ordertotal %]</td>
+ <td>[% loop_order.budget_name %]</td>
<td>
- <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&datereceived=[% invoicedatereceived %]&invoice=[% invoice %]&gst=[% loop_order.gst %]&freight=[% loop_order.freight %]&booksellerid=[% loop_order.booksellerid %]">Receive</a>
-
+ <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&invoiceid=[% invoiceid %]">Receive</a>
</td>
<td>
- [% IF ( loop_order.left_holds_on_order ) %]
- <span class="button" title="Can't delete order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first">Can't delete order</span><br>
- [% ELSE %]
- <a href="javascript:confirm_delete_item([% loop_order.ordernumber %],[% loop_order.basketno %],[% loop_order.biblionumber %])" class="button">Delete order</a><br>
- [% END %]
- [% IF ( loop_order.can_del_bib ) %]
- <a href="javascript:confirm_delete_biblio([% loop_order.ordernumber %],[% loop_order.basketno %],[% loop_order.biblionumber %])" class="button">Delete order and catalog record</a><br>
- [% ELSE %]
- <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
- [% END %]
- [% IF ( loop_order.left_item ) %]
- <b title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</b><br>
- [% END %]
- [% IF ( loop_order.left_biblio ) %]
- <b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</b><br>
- [% END %]
- [% IF ( loop_order.left_subscription ) %]
- <b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</b><br>
- [% END %]
- [% IF ( loop_order.left_holds ) %]
- <b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</b>
- [% END %]
- </td>
- </tr>
+ [% IF ( loop_order.left_holds_on_order ) %]
+ <span class="button" title="Can't delete order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first">Can't delete order</span><br>
+ [% ELSE %]
+ <a href="javascript:confirm_delete_item([% loop_order.ordernumber %],[% loop_order.biblionumber %])" class="button">Delete order</a><br>
+ [% END %]
+ [% IF ( loop_order.can_del_bib ) %]
+ <a href="javascript:confirm_delete_biblio([% loop_order.ordernumber %],[% loop_order.biblionumber %])" class="button">Delete order and catalog record</a><br>
+ [% ELSE %]
+ <span class="button" title="Can't delete catalog record, see constraints below">Can't delete order and catalog record</span><br>
+ [% END %]
+ [% IF ( loop_order.left_item ) %]
+ <b title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</b><br>
+ [% END %]
+ [% IF ( loop_order.left_biblio ) %]
+ <b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</b><br>
+ [% END %]
+ [% IF ( loop_order.left_subscription ) %]
+ <b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</b><br>
+ [% END %]
+ [% IF ( loop_order.left_holds ) %]
+ <b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</b>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>[% ELSE %]There are no pending orders.[% END %]
+ <div id="resultnumber">
+ <!-- Row of numbers corresponding to search result pages -->
+ [% IF ( displayprev ) %]
+ <a href="parcel.pl?invoiceid=[% invoiceid %]&startfrom=[% prevstartfrom %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber"><< Previous</a>
[% END %]
- </tbody>
- </table>[% ELSE %]There are no pending orders.[% END %]
- <div id="resultnumber">
- <!-- Row of numbers corresponding to search result pages -->
- [% IF ( displayprev ) %]
- <a href="parcel.pl?type=intra&booksellerid=[% booksellerid %]&startfrom=[% prevstartfrom %][% IF ( datereceived ) %]&datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber"><< Previous</a>
- [% END %]
- [% FOREACH number IN numbers %]
- [% IF ( number.highlight ) %]
- <span class="current">[% number.number %]</span>
- [% ELSE %]
- <a href="parcel.pl?type=intra&booksellerid=[% booksellerid %]&startfrom=[% number.startfrom %][% IF ( datereceived ) %]&datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber">[% number.number %]</a>
- [% END %]
- [% END %]
- [% IF ( displaynext ) %]
- <a href="parcel.pl?type=intra&booksellerid=[% booksellerid %]&startfrom=[% nextstartfrom %][% IF ( datereceived ) %]&datereceived=[% datereceived %][% END %][% IF ( invoice ) %]&invoice=[% invoice %][% END %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber">Next >></a>
- [% END %]
- </div>
-</div>
+ [% FOREACH number IN numbers %]
+ [% IF ( number.highlight ) %]
+ <span class="current">[% number.number %]</span>
+ [% ELSE %]
+ <a href="parcel.pl?invoiceid=[% invoiceid %]&startfrom=[% number.startfrom %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber">[% number.number %]</a>
+ [% END %]
+ [% END %]
+ [% IF ( displaynext ) %]
+ <a href="parcel.pl?invoiceid=[% invoiceid %]&startfrom=[% nextstartfrom %][% IF ( resultsperpage ) %]&resultsperpage=[% resultsperpage %][% END %]#resultnumber">Next >></a>
+ [% END %]
+ </div>
+ </div>
+[% ELSE %]
+ <p>
+ Invoice is closed, so you can't receive orders anymore.
+ <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
+ </p>
+[% END %]
+
<div id="acqui_receive_receivelist">
<h3>Already received</h3>
+
[% IF ( loop_received ) %]
<form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
<table id="receivedt">
<th>Est cost</th>
<th>Actual cost</th>
<th>TOTAL</th>
+ <th></th>
</tr>
</thead>
<tfoot>
- <tr>
- <td colspan="4" class="total">SUBTOTAL</td>
- <td colspan="2"> </td>
- <td>[% totalprice %]</td>
- <td>[% tototal %]</td>
- </tr>
-
- [% IF ( totalfreight ) %]
- <tr>
- <td colspan="6">
- </td>
- <td>Shipping</td>
- <td>[% totalfreight %]</td>
- </tr>
- [% END %]
- [% IF ( gst ) %]
- <tr>
- <td colspan="6">
- <p class="message">
- <b>HELP</b><br />
- The total at the bottom of the page should be within a few cents of the total for the invoice.
- </p>
- </td>
- <td><b>Tax rate</b></td>
- <td>[% gst %]</td>
- </tr>
- [% END %]
- <tr>
- <td colspan="4" class="total">TOTAL</td>
- <td>[% totalquantity %]</td>
- <td colspan="2"> </td>
- <td>[% grandtot %]</td>
- </tr>
+ <tr>
+ <th colspan="7" class="total">Total tax exc.</th>
+ <th>[% total_gste %]</th>
+ <th></th>
+ </tr>
+ [% FOREACH book_foot IN book_foot_loop %]
+ <tr>
+ <th colspan="7">Total (GST [% book_foot.gstrate * 100 | format ("%.1f") %]%)</th>
+ <th>[% book_foot.value %]</th>
+ <th></th>
+ </tr>
+ [% END %]
+ <tr>
+ <th colspan="7" class="total">Total tax inc.</th>
+ <th>[% total_gsti %]</th>
+ <th></th>
+ </tr>
</tfoot>
<tbody class="filterclass">
[% FOREACH loop_receive IN loop_received %]
<td>[% loop_receive.ecost %]</td>
<td>[% loop_receive.unitprice %]</td>
<td>[% loop_receive.total %]</td>
+ <td>
+ [% IF (loop_receive.cannot_cancel) %]
+ [% span_title = BLOCK %]
+ Cannot cancel receipt of this order line because it
+ was created from a partial receipt of order line no.
+ [% loop_receive.parent_ordernumber %], which is
+ already received. Try cancelling this one first and
+ retry.
+ [% END %]
+ <span title="[% span_title | collapse %]">
+ Can't cancel receipt
+ </span>
+ [% ELSE %]
+ <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% loop_receive.ordernumber %]">Cancel receipt</a>
+ [% END %]
+ </td>
</tr>
[% END %]
</tbody>
</div>
<!--<form action="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]" method="post">-->
-<form action="parcels.pl?booksellerid=[% booksellerid %]" method="post">
- <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
- <fieldset class="action">
- <input type="submit" value="Finish receiving" />
- </fieldset>
-</form>
+[% IF (invoiceclosedate) %]
+ <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">View invoice</a>
+[% ELSE %]
+ <form action="/cgi-bin/koha/acqui/invoice.pl" method="get">
+ <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
+ <fieldset class="action">
+ <input type="submit" value="Finish receiving" />
+ </fieldset>
+ </form>
+[% END %]
</div>
</div>
<input type="hidden" value="[% invoice %]" name="invoice" />
<input type="hidden" value="[% invoicedatereceived %]" name="datereceived" />
<input type="submit" value="Filter" />
- <a href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% booksellerid %]&invoice=[% invoice %]&op=new&datereceived=[% formatteddatereceived %]">Clear</a>
+ <a href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% booksellerid %]&invoice=[% invoice %]&op=new&datereceived=[% formatteddatereceived %]">Clear</a>
</fieldset>
<div id="bd">
<div id="yui-main">
<div class="yui-b">
-
+
+[% IF ( error_failed_to_create_invoice ) %]
+ <div id="error" class="dialog error">
+ <p>An error has occured. Invoice cannot be created.</p>
+ </div>
+[% END %]
<h1>Receive shipment from vendor <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name %]</a></h1>
[% IF ( count ) %]
[% searchresult.number %]
</td>
<td>
- <a href="/cgi-bin/koha/acqui/parcel.pl?type=intra&booksellerid=[% booksellerid |url %]&datereceived=[% searchresult.raw_datereceived |url %][% IF ( searchresult.code ) %]&invoice=[% searchresult.code |url %][% END %]">
- [% searchresult.datereceived %]</a>
+ [% searchresult.datereceived %]
</td>
<td>
- [% IF ( searchresult.code ) %][% searchresult.code %][% ELSE %]<acronym title="not available">n/a</acronym>[% END %]
+ [% IF ( searchresult.code ) %]
+ <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% searchresult.invoiceid %]">[% searchresult.code %]</a>
+ [% ELSE %]
+ <acronym title="not available">n/a</acronym>
+ [% END %]
</td>
<td>
[% searchresult.reccount %]
[% END %]
<div id="parcels_new_parcel">
- <form method="get" action="parcel.pl">
+ <form method="get" action="parcels.pl">
<fieldset class="rows">
<legend>Receive a new shipment</legend>
<ol> <li>
<label for="freight">Shipping:</label>
<input type="text" size="20" id="freight" name="freight" />
</li> -->
- <li><label for="datereceived">Shipment date: </label>
- <input type="text" id="datereceived" name="datereceived" maxlength="10" size="10" value="[% datereceived_today %]" class="datepicker" />
- <div class="hint">[% INCLUDE 'date-format.inc' %]</div> </li>
+ <li>
+ <label for="shipmentdate">Shipment date: </label>
+ <input type="text" id="shipmentdate" name="shipmentdate" maxlength="10" size="10" value="[% shipmentdate_today %]" class="datepicker" />
+ <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
+ </li>
+ <li>
+ <label for="shipmentcost">Shipment cost: </label>
+ <input type="text" id="shipmentcost" name="shipmentcost" size="10" />
+ </li>
+ <li>
+ <label for="shipmentcost_budgetid">Budget: </label>
+ <select id="shipmentcost_budgetid" name="shipmentcost_budgetid">
+ <option value="">No budget</option>
+ [% FOREACH budget IN budgets %]
+ <option value="[% budget.budget_id %]">[% budget.budget_name %]</option>
+ [% END %]
+ </select>
+ </li>
</ol>
</fieldset>
<fieldset class="action"><input type="submit" class="button" value="Next" /> <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">Cancel</a></fieldset>
<li><label for="datefrom">From:</label><input type="text" size="9" id="datefrom" name="datefrom" value="[% datefrom %]" /><br />
<label for="dateto">To:</label><input type="text" size="9" id="dateto" name="dateto" value="[% dateto %]" /></li>
<li><label for="orderby">Sort by :</label><select name="orderby" id="orderby">
- <option value="aqorders.booksellerinvoicenumber">Invoice number</option>
- <option value="datereceived"> Date received</option>
- <option value="datereceived desc"> Date received reverse</option>
- <option value="aqorders.booksellerinvoicenumber desc"> Invoice number reverse</option>
+ <option value="invoicenumber">Invoice number</option>
+ <option value="shipmentdate">Shipment date</option>
+ <option value="shipmentdate desc">Shipment date reverse</option>
+ <option value="invoicenumber desc">Invoice number reverse</option>
</select><br />
<label for="resultsperpage">Results per page :</label><select name="resultsperpage" id="resultsperpage">
<option value="20">20</option>
<th> Itemtype </th>
<th> Received </th>
<th> Unit price </th>
- <th> Freight per item </th>
<th> Date ordered </th>
<th> Date received </th>
<th> Subtotal </th>
[% order.title %]
</td>
<td class="cell">
- <a href="/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=[% order.ordernumber %]&biblio=[% order.biblionumber %]&invoice=[% order.booksellerinvoicenumber %]&booksellerid=[% order.booksellerid %]&catview=yes">[% order.ordernumber %]</a>
+ <a href="/cgi-bin/koha/acqui/orderreceive.pl?ordernumber=[% order.ordernumber %]&biblio=[% order.biblionumber %]&invoiceid=[% order.invoiceid %]">[% order.ordernumber %]</a>
</td>
<td class="cell">
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid %]">[% order.booksellerid %]</a>
</td>
<td class="cell">
- <a href="/cgi-bin/koha/acqui/parcel.pl?invoice=[% order.booksellerinvoicenumber %]&booksellerid=[% order.booksellerid %]&datereceived=[% order.datereceived %]">[% order.booksellerinvoicenumber %]</a>
+ <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid %]">[% order.invoicenumber %]</a>
</td>
<td class="cell">
[% order.itype %]
[% order.unitprice %]
</td>
<td class="cell" align="right">
- [% order.freight %]
- </td>
- <td class="cell" align="right">
[% order.entrydate | $KohaDates %]
</td>
<td class="cell" align="right">
[% order.datereceived | $KohaDates %]
</td>
<td class="cell" align="right">
- [% order.subtotal %]
+ [% order.rowtotal %]
</td>
</tr>
[% END %]
<tfoot>
- <tr valign="top">
- <td> Total </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td> </td>
- <td align="right">
- [% total %]
- </td>
+ [% IF shipmentcosts.size %]
+ <tr valign="top">
+ <td colspan="9"> Sub total </td>
+ <td align="right"> [% subtotal %] </td>
+ </tr>
+ [% FOREACH shipmentcost IN shipmentcosts %]
+ <tr>
+ <td></td>
+ <td colspan="8">Shipment cost for invoice [% shipmentcost.invoicenumber %]</td>
+ <td class="total">[% shipmentcost.shipmentcost %]</td>
+ </tr>
+ [% END %]
+ [% END %]
+ <tr>
+ <td colspan="9">TOTAL</td>
+ <td class="total">[% total %]</td>
</tr>
</tfoot>
-
</table>
</div>
</li>
</ol>
<ol class="radio">
- <li><label for="gstyes" class="radio">Tax Number Registered:</label>
+ <li><label for="gstyes" class="radio">Tax number registered:</label>
[% IF ( gstreg ) %]
<label for="gstyes">Yes</label> <input type="radio" name="gst" id="gstyes" value="1" checked="checked" />
<label for="gstno">No</label> <input type="radio" name="gst" id="gstno" value="0" />
<label for="invoice_gstno">Don't include tax</label> <input type="radio" id="invoice_gstno" name="invoice_gst" value="0" checked="checked" />
[% END %]</li>
</ol>
+ <ol>
+ <li>
+ <label for="gst">Tax rate</label>
+ <select name="gstrate" id="gstrate">
+ [% FOREACH gst IN gst_values %]
+ [% IF ( gstrate == gst.option ) %]
+ <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format ("%.1f") %] %</option>
+ [% ELSE %]
+ <option value="[% gst.option %]">[% gst.option * 100 | format ("%.1f") %] %</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ </ol>
<ol>
<li><label for="discount">Discount</label>
<input type="text" size="6" id="discount" name="discount" value="[% discount %]" />%</li>
- <li><label for="gstrate">Tax rate</label><input type="text" name="gstrate" id="gstrate" size="6" value="[% gstrate %]"/>% (leave blank for default tax of [% default_gst_rate %]%)</li>
<li>
<label for="deliverytime">Delivery time</label>
<input type="text" size="2" id="deliverytime" name="deliverytime" value="[% deliverytime %]" /> days
[% END %]</p>
<p><strong>List prices are: </strong>[% listprice %]</p>
<p><strong>Invoice prices are: </strong>[% invoiceprice %]</p>
- [% IF ( GST ) %]<p><strong>Tax number registered: </strong>
+ [% IF ( gstrate ) %]<p><strong>Tax number registered: </strong>
[% IF ( gstreg ) %]Yes[% ELSE %]No[% END %]</p>
<p><strong>List item price includes tax: </strong>
[% IF ( listincgst ) %]Yes[% ELSE %]No[% END %]</p>
<p><strong>Discount: </strong>
[% discount %] %</p>
<p><strong>Tax rate: </strong>
- [% GST %]%[% UNLESS ( default_tax ) %] (default)[% END %]</p>
+ [% 0 + gstrate * 100 | format("%.1f") %]%</p>
[% IF deliverytime.defined %]
<p><strong>Delivery time: </strong>
[% deliverytime %] days</p>
"aoColumnDefs": [
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false },
],
- "sPaginationType": "four_button"
+ "bPaginate": false
} ) );
$("#CheckAll").click(function(){
row.addClass("selected");
});
});
+
+[% IF ( total_pages ) %]
+function validate_goto_page(){
+ var page = $('#goto_page').val();
+ if(isNaN(page)) {
+ alert(_("The page entered is not a number."));
+ return false;
+ }
+ else if(page < 1 || page > [% total_pages %] ) {
+ alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+[% END %]
+
//]]>
</script>
<style type="text/css">
<div class="yui-u first">
<fieldset class="rows">
<ol><li><label for="searchtitle">Title: </label> <input type="text" id="searchtitle" name="title" value="[% title |html %]" /></li>
- <li><label for="isbn">ISBN/ISSN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
+ <li><label for="isbn">ISBN: </label> <input type="text" id="isbn" name="isbn" value="[% isbn %]" /></li>
<li><label for="lccall">LC call number: </label> <input type="text" id="lccall" name="lccall" value="" /></li>
<li><label for="controlnumber">Control no.: </label> <input type="text" id="controlnumber" name="controlnumber" value="" /></li>
</ol>
</div>
<div class="yui-u">
<fieldset class="rows"> <ol><li><label for="author">Author: </label> <input type="text" id="author" name="author" value="[% author %]" /><!-- <label for="Keyword">Keyword</label> <input type="text" name="keyword" value="" /> --></li>
+ <li><label for="issn">ISSN: </label> <input type="text" id="issn" name="issn" value="[% issn %]" /></li>
<li> <label for="subject">Subject heading: </label> <input type="text" id="subject" name="subject" value="" /></li>
<li><label for="dewey">Dewey: </label> <input type="text" id="dewey" name="dewey" value="" /></li></ol></fieldset>
<fieldset class="rows" >
[% END %]
[% END %]</tbody>
</table>
+
+ <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
+ <input type="hidden" name="op" id="op" value="do_search" />
+ <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
+ <input type="hidden" id="searchtitle" name="title" value="[% title |html %]" />
+ <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
+ <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
+ <input type="hidden" id="author" name="author" value="[% author %]" />
+ <input type="hidden" id="subject" name="subject" value="[% subject %]" />
+ <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
+ <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+ <input type="hidden" name="controlnumber" value="[% controlnumber %]" />
+ <input type="hidden" name="basketno" value="[% basketno %]" />
+ <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
+
+ [% FOREACH server IN servers %]
+ <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
+ [% END %]
+
+ [% IF ( show_prevbutton ) %]
+ <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
+ [% END %]
+ Page [% current_page %] / [% total_pages %]
+ [% IF ( show_nextbutton ) %]
+ <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
+ [% END %]
+ <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
+ </form>
+
[% ELSE %]
[% IF ( emptyserverlist ) %]
<div class="dialog alert">You didn't select any Z39.50 target.</div>
<dd>Printers (UNIX paths).</dd> -->
<dt><a href="/cgi-bin/koha/admin/z3950servers.pl">Z39.50 client targets</a></dt>
<dd>Define which servers to query for MARC data in the integrated Z39.50 client.</dd>
+ <dt><a href="/cgi-bin/koha/admin/didyoumean.pl">Did you mean?</a></dt>
+ <dd>Choose which plugins to use to suggest searches to patrons and staff.</dd>
</dl>
</div>
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
// #################################################################################
// Javascript
alert(alertString2);
}
}
- $(document).ready(function() {
- $("#periodsh").tablesorter({
- widgets : ['zebra'],
- sortList: [[0,0]],
- headers: {6:{sorter:false}}
- });
- });
+
+
+
+ [% IF ( dateformat == 'metric' ) %]
+ dt_add_type_uk_date();
+ [% END %]
+ $(document).ready(function() {
+ var tabs = $('#budgetsTabs').tabs();
+ [% IF ( tab ) %]
+ tabs.tabs('select', [% tab %]);
+ [% END %]
+ $("#activeperiodst,#inactiveperiodst").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "aoColumnDefs": [
+ {
+ [% IF ( dateformat == 'metric' ) %]
+ "aTargets": [ 1, 2 ], "sType": "uk_date",
+ [% END %]
+ "bSortable": false, 'aTargets':['_all'],
+ },
+ ],
+ "sPaginationType": "four_button",
+ "bAutoWidth": false,
+ "bPaginate": false,
+ "bInfo": false,
+ "bFilter": false,
+ } ) );
+ });
</script>
<title>
<li>
<label class="required" for="from">Start date</label>
- <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate %]" class="datepickerfrom" />
+ <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<label class="required" for="to">End date</label>
- <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate %]" class="datepickerto" />
+ <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<ol>
<li>
<label class="required" for="from">Start date</label>
- <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate %]" class="datepickerfrom" />
+ <input type="text" size="10" id="from" name="budget_period_startdate" value="[% budget_period_startdate | $KohaDates %]" class="datepickerfrom" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
<li>
<label class="required" for="to">End date</label>
- <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate %]" class="datepickerto" />
+ <input type="text" size="10" id="to" name="budget_period_enddate" value="[% budget_period_enddate | $KohaDates %]" class="datepickerto" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
</li>
[% END %]
<!-- DEFAULT display budget periods list -->
[% IF ( else ) %]
- <h2>Budgets administration</h2>
-
- [% INCLUDE 'budgets-active-currency.inc' %]
-
- <table id="periodsh">
- <thead>
- <tr>
- <th>Budget name</th>
- <th>Start date</th>
- <th>End date</th>
- <th>Active</th>
- <th>Locked</th>
- <th>Total</th>
- <th>Actions</th>
- </tr>
- </thead>
- <tbody>
- [% FOREACH period_loo IN period_loop %]
- [% IF ( loop.odd ) %]
- <tr>
- [% ELSE %]
- <tr class="highlight">
- [% END %]
- <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id %]" title="View funds for [% period_loo.budget_period_description %]">[% period_loo.budget_period_description %]</a></td>
- <td>[% period_loo.budget_period_startdate %]</td>
- <td>[% period_loo.budget_period_enddate %]</td>
- <td>[% IF ( period_loo.budget_period_active ) %]<span style="color:green;">Active</span> [% ELSE %][% END %] </td>
- <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span> [% ELSE %][% END %] </td>
- <td align='right'>[% period_loo.budget_period_total %]</td>
- <td>
- <a href="[% period_loo.script_name %]?op=add_form&budget_period_id=[% period_loo.budget_period_id |html %]">Edit</a>
- <a href="[% period_loo.script_name %]?op=delete_confirm&budget_period_id=[% period_loo.budget_period_id %]">Delete</a>
- <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% period_loo.budget_period_id %]">Add fund</a>
- </td>
- </tr>
- [% END %]
- [% UNLESS ( period_loop ) %]
- <tr><td colspan="7">No budget</td></tr>
- [% END %]
- </tbody>
- </table>
- <div class="pages">[% pagination_bar %]</div>
+ <h2>Budgets administration</h2>
+
+ [% INCLUDE 'budgets-active-currency.inc' %]
+
+ <div id="budgetsTabs" class="toptabs">
+ <ul>
+ <li><a href="#active">Active Budgets</a></li>
+ <li><a href="#inactive">Inactive Budgets</a></li>
+ </ul>
+
+ <div id="active">
+ [% IF ( period_active_loop ) %]
+ <table id="activeperiodst">
+ <thead>
+ <tr>
+ <th>Budget name</th>
+ <th>Start date</th>
+ <th>End date</th>
+ <th>Locked</th>
+ <th>Total</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH period_active IN period_active_loop %]
+ <tr>
+ <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_active.budget_period_id %]" title="View funds for [% period_active.budget_period_description %]">[% period_active.budget_period_description %]</a></td>
+ <td>[% period_active.budget_period_startdate | $KohaDates %]</td>
+ <td>[% period_active.budget_period_enddate | $KohaDates %]</td>
+ <td>
+ [% IF ( period_active.budget_period_locked ) %]
+ <span style="color:green;">Locked</span>
+ [% END %]
+ </td>
+ <td align='right'>[% period_active.budget_period_total %]</td>
+ <td>
+ <a href="[% script_name %]?op=add_form&budget_period_id=[% period_active.budget_period_id |html %]">Edit</a>
+ <a href="[% script_name %]?op=delete_confirm&budget_period_id=[% period_active.budget_period_id %]">Delete</a>
+ <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% period_active.budget_period_id %]">Add Fund</a>
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ [% ELSE %]
+ No active budgets
+ [% END %]
+ <div class="paginationBar">[% active_pagination_bar %]</div>
+ </div>
+ <div id="inactive">
+ [% IF ( period_inactive_loop ) %]
+ <table id="inactiveperiodst">
+ <thead>
+ <tr>
+ <th>Budget name</th>
+ <th>Start date</th>
+ <th>End date</th>
+ <th>Locked</th>
+ <th>Total</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH period_loo IN period_inactive_loop %]
+ [% IF ( loop.odd ) %]
+ <tr>
+ [% ELSE %]
+ <tr class="highlight">
+ [% END %]
+ <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% period_loo.budget_period_id %]" title="View funds for [% period_loo.budget_period_description %]">[% period_loo.budget_period_description %]</a></td>
+ <td>[% period_loo.budget_period_startdate | $KohaDates %]</td>
+ <td>[% period_loo.budget_period_enddate | $KohaDates %]</td>
+ <td> [% IF ( period_loo.budget_period_locked ) %]<span style="color:green;">Locked</span> [% ELSE %][% END %] </td>
+ <td align='right'>[% period_loo.budget_period_total %]</td>
+ <td>
+ <a href="[% period_loo.script_name %]?op=add_form&budget_period_id=[% period_loo.budget_period_id |html %]">Edit</a>
+ <a href="[% period_loo.script_name %]?op=delete_confirm&budget_period_id=[% period_loo.budget_period_id %]">Delete</a>
+ <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% period_loo.budget_period_id %]">Add fund</a>
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ [% ELSE %]
+ No inactive budgets
+ [% END %]
+ <div class="pages">[% inactive_pagination_bar %]</div>
+ </div>
+ </div>
[% END %]
ok=1;
_alertString += _("- Name missing") + "\n";
}
- var startDate = Date_from_syspref($("#contractstartdate").val());
- var endDate = Date_from_syspref($("#contractenddate").val());
+ var startDate = Date_from_syspref($("#from").val());
+ var endDate = Date_from_syspref($("#to").val());
if (!parseInt(startDate.getTime())) {
ok=1;
_alertString += _("- Start date missing or invalid.") + "\n";
</li>
<li>
<label for="lib">Description</label>
- <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="80" />
+ <input type="text" name="lib" id="lib" value="[% lib %]" maxlength="200" />
</li>
<li>
<label for="lib_opac">Description (OPAC)</label>
- <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="80" />
+ <input type="text" name="lib_opac" id="lib_opac" value="[% lib_opac %]" maxlength="200" />
</li>
</ol>
<div id="icons" class="toptabs" style="clear:both">
--- /dev/null
+[% BLOCK pluginlist %]
+<div class="pluginlist">
+[% FOREACH plugin IN plugins %]
+ <div class="plugin">
+ <div class="pluginname">
+ [% IF plugin.enabled %]<input type="checkbox" checked="checked" id="checkbox_[% type %][% plugin.name %]">[% ELSE %]<input type="checkbox" id="checkbox_[% type %][% plugin.name %]">[% END %]
+ <label class='pluginlabel' for="checkbox_[% type %][% plugin.name %]">[% plugin.name %]</label></div>
+ <div class="plugindesc">
+ [% SWITCH plugin.name %]
+ [% CASE 'AuthorityFile' %]
+ Suggest authorities which are relevant to the term the user searched for.
+ [% CASE 'ExplodedTerms' %]
+ Suggest that patrons expand their searches to include
+ broader/narrower/related terms.
+ [% END %]
+ </div>
+ </div>
+[% END %]
+</div>
+[% END %]
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha › Administration › Did you mean?</title>
+[% INCLUDE 'doc-head-close.inc' %]
+<script>
+ $(document).ready(function() {
+ $( ".pluginlist" ).sortable();
+ $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
+ .find( ".pluginname" )
+ .addClass( "ui-widget-header ui-corner-all" )
+ .end()
+ .find( ".plugindesc" );
+ });
+
+ function yesimeant() {
+ var OPACdidyoumean = serialize_plugins('opac');
+ var INTRAdidyoumean = serialize_plugins('intranet');
+
+ var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean) + "&pref_INTRAdidyoumean=" + encodeURIComponent(INTRAdidyoumean);
+
+ $.ajax({
+ data: data,
+ type: 'POST',
+ url: '/cgi-bin/koha/svc/config/systempreferences/',
+ success: function () { alert("Successfully saved configuration"); },
+ });
+ return false;
+ }
+
+ function serialize_plugins(interface) {
+ var serializedconfig = '[';
+ $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
+ var name = $(this).find('.pluginlabel').text();
+ var enabled = $(this).find('input:checkbox:checked').length ?
+ ', "enabled": 1' : '';
+ serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
+ });
+ serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
+ serializedconfig += ']';
+ return serializedconfig;
+ }
+</script>
+</head>
+<body id="admin_didyoumean" class="admin">
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'cat-search.inc' %]
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › Did you mean?</div>
+
+<div id="doc3" class="yui-t2">
+
+ <div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+ <h3>Did you mean?</h3>
+ <noscript><div class="dialog alert"><strong>Please enable Javascript:</strong>
+ Configuring <em>Did you mean?</em> plugins requires Javascript. If
+ you are unable to use Javascript, you may be able to enter the
+ configuration (which is stored in JSON in the OPACdidyoumean and
+ INTRAdidyoumean system preferences) in the Local Preferences tab in
+ the system preference editor, but this is unsupported, not
+ recommended, and likely will not work.</div></noscript>
+ <div id="didyoumeanlegend">
+ Please put the <em>Did you mean?</em> plugins in order by significance, from
+ most significant to least significant, and check the box to enable those
+ plugins that you want to use. (NOTE: <em>Did you mean?</em> functionality
+ is not yet enabled on the staff client)
+ </div>
+ <form action="/cgi-bin/koha/admin/didyoumean.pl" method="post">
+ <fieldset id="didyoumeanopac">
+ <legend>OPAC</legend>
+ [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
+ </fieldset>
+ <fieldset id="didyoumeanintranet">
+ <legend>Intranet</legend>
+ [% PROCESS pluginlist plugins=INTRApluginlist type='intranet' %]
+ </fieldset>
+ <fieldset class="action"><button class="save-all submit" onclick="yesimeant();return false;" type="submit">Save configuration</button> <a href="#" onclick="window.location.reload(true);" class="cancel">Cancel</a></fieldset>
+ </form>
+
+ </div>
+ </div>
+<div class="yui-b">
+[% INCLUDE 'admin-menu.inc' %]
+</div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
<div class="yui-b">
[% INCLUDE 'admin-menu.inc' %]
</div>
-</div>
+
[% INCLUDE 'intranet-bottom.inc' %]
<input type="text" id="threshold" name="threshold" size="5" maxlength="5"
value="[% threshold |html %]" /> <span class="required">Required</span>
</li>
+ <li><label for="record_type" class="required">Record type: </label>
+ <select id="record_type" name="record_type">
+ [% IF ( record_type == "authority" ) %]
+ <option value="biblio">Bibliographic record</option>
+ <option value="authority" selected="selected">Authority record</option>
+ [% ELSE %]
+ <option value="biblio" selected="selected">Bibliographic record</option>
+ <option value="authority">Authority record</option>
+ [% END %]
+ </select><span class="required">Required</span>
+ </li>
</ol>
</fieldset>
[% END %]
[% IF ( search_not_found ) %]
<div class="dialog alert">
- No system preferences matched your search for <strong>[% searchfield %]</strong>. You can try a different search or <a href="/cgi-bin/koha/admin/preferences.pl?tab=[% last_tab %]">return to where you were before.</a>
+ No system preferences matched your search for <strong>[% searchfield |html %]</strong>. You can try a different search or <a href="/cgi-bin/koha/admin/preferences.pl?tab=[% last_tab %]">return to where you were before.</a>
</div>
[% END %]
[% FOREACH TAB IN TABS %]
US: 360,000.00 (US)
FR: 360 000,00 (FR)
-
- - The default tax rate is
+ - Default tax rates are
- pref: gist
- - (enter in numeric form, 0.12 for 12%)
+ - (enter in numeric form, 0.12 for 12%. First is the default. If you want more than 1 value, please separate with |)
Printing:
-
Authorities:
General:
-
+ - pref: AuthDisplayHierarchy
+ default: no
+ choices:
+ yes: Display
+ no: "Don't display"
+ - broader term/narrower term hierarchies when viewing authorities.
+ -
- When editing records,
- pref: BiblioAddsAuthorities
default: no
EAN13: incremental EAN-13 barcodes
"OFF": not generated automatically.
-
- - When a new item is added, should it be prefilled with last created item values?
+ - When a new item is added,
- 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
+ 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
no: "Don't allow"
- staff to specify a due date for a checkout.
-
+ - Set the default start date for the Holds to pull list to
+ - pref: HoldsToPullStartDate
+ class: integer
+ - day(s) ago.
+ -
- pref: AllowAllMessageDeletion
choices:
yes: Allow
choices:
yes: Allow
no: "Don't allow"
- - checkouts of items items reserved to someone else. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items.
+ - checkouts of items reserved to someone else. If allowed do not generate RESERVE_WAITING and RESERVED warning. This allows self checkouts for those items.
-
- pref: AllFinesNeedOverride
choices:
homebranch: the library the item is from.
holdingbranch: the library the item was checked out from.
-
+ - Allow materials to be returned to
+ - pref: AllowReturnToBranch
+ type: choice
+ choices:
+ anywhere: to any library.
+ homebranch: only the library the item is from.
+ holdingbranch: only the library the item was checked out from.
+ homeorholdingbranch: either the library the item is from or the library it was checked out from.
+ -
- Calculate the due date using
- pref: useDaysMode
choices:
no: "Prevent"
- patrons from checking out an item whose rental charge would take them over the limit.
-
+ - "Restrict patrons with the following target audience values from checking out inappropriate materials:"
- pref: AgeRestrictionMarker
- - "E.g. FSK|PEGI|Age| (No white space near |). Entry in MARC field (e.g. 521a) as defined for agerestriction in Koha to MARC mapping. Entry in MARC field like FSK 12 or PEGI 12 would mean: Borrower must be 12 years old. (Empty: Do not apply age restriction.)"
+ - "E.g. enter target audience keyword(s) split by | (bar) FSK|PEGI|Age| (No white space near |). Be sure to map agerestriction in Koha to MARC mapping (e.g. 521$a). A MARC field value of FSK 12 or PEGI 12 would mean: Borrower must be 12 years old. Leave empty to not apply an age restriction."
-
- pref: AgeRestrictionOverride
choices:
alert: "display a message"
nothing : "do nothing"
- .
+ Checkin Policy:
+ -
+ - pref: BlockReturnOfWithdrawnItems
+ choices:
+ yes: Block
+ no: "Don't block"
+ - returning of items that have been withdrawn.
Holds Policy:
-
- pref: AllowHoldPolicyOverride
yes: Allow
no: "Don't allow"
- holds to be suspended from the OPAC.
+ -
+ - pref: decreaseLoanHighHolds
+ choices:
+ yes: Enable
+ no: "Don't enable"
+ - the reduction of loan period to
+ - pref: decreaseLoanHighHoldsDuration
+ class: integer
+ - days for items with more than
+ - pref: decreaseLoanHighHoldsValue
+ class: integer
+ - holds.
Fines Policy:
-
- Calculate fines based on days overdue
type: textarea
class: code
-
+ - "Include the following CSS for the mobile view on all pages in the OPAC:"
+ - pref: OPACMobileUserCSS
+ type: textarea
+ class: code
+ -
- "Show the following HTML in its own column on the main page of the OPAC:"
- pref: OpacMainUserBlock
type: textarea
class: code
-
+ - "Show the following HTML in its own column on the main page of the OPAC (mobile version):"
+ - pref: OpacMainUserBlockMobile
+ type: textarea
+ class: code
+ -
+ - pref: OpacShowLibrariesPulldownMobile
+ choices:
+ yes: Show
+ no: "Don't show"
+ - the libraries pulldown on the mobile version of the OPAC.
+ -
+ - pref: OpacShowFiltersPulldownMobile
+ choices:
+ yes: Show
+ no: "Don't show"
+ - the search filters pulldown on the mobile version of the OPAC.
+ -
- "Show the following HTML on the left hand column of the main page and patron account on the OPAC (generally navigation links):"
- pref: OpacNav
type: textarea
no: "Don't allow"
- patrons to browse subject authorities on OPAC (run misc/cronjobs/build_browser_and_cloud.pl to create the browser list)
-
+ - pref: OpacCloud
+ choices:
+ yes: Show
+ no: "Don't show"
+ - a subject cloud on OPAC (run misc/cronjobs/build_browser_and_cloud.pl to build)
+ -
- pref: OpacAuthorities
choices:
yes: Allow
<li>same library, same patron type, all item types</li>
<li>same library, all patron types, same item type</li>
<li>same library, all patron types, all item types</li>
- <li>all libraries, same patron type, same item type</li>
- <li>all libraries, same patron type, all item types</li>
- <li>all libraries, all patron types, same item type</li>
- <li>all libraries, all patron types, all item types</li>
+ <li>default (all libraries), same patron type, same item type</li>
+ <li>default (all libraries), same patron type, all item types</li>
+ <li>default (all libraries), all patron types, same item type</li>
+ <li>default (all libraries), all patron types, all item types</li>
</ul>
<p>To modify a rule, create a new one with the same patron type and item type.</p>
</div>
</form>
</div>
<div id="defaults-for-this-library" class="container">
- <h3>Default checkout, hold and return policy for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
+ <h3>Default checkout, hold and return policy[% IF ( humanbranch ) %] for [% humanbranch %][% END %]</h3>
<p>You can set a default maximum number of checkouts, hold policy and return policy that will be used if none is defined below for a particular item type or category.</p>
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
<input type="hidden" name="op" value="set-branch-defaults" />
</div>
[% IF ( show_branch_cat_rule_form ) %]
<div id="holds-policy-by-patron-category" class="container">
- <h3>Checkout limit by patron category for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
+ <h3>[% IF humanbranch %]Checkout limit by patron category for [% humanbranch %][% ELSE %]Default checkout limit by patron category[% END %]</h3>
<p>For this library, you can specify the maximum number of loans that
a patron of a given category can make, regardless of the item type.
</p>
</div>
[% END %]
<div id="holds-policy-by-item-type" class="container">
- <h3>Holds policy by item type for [% IF ( humanbranch ) %][% humanbranch %][% ELSE %]all libraries[% END %]</h3>
+ <h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3>
<p>
For this library, you can edit rules for given itemtypes, regardless
of the patron's category.
}
var field_start = whichfield.parentNode.parentNode;
-
- // browse all its subfields (clear and $9)
- var subfields = field_start.getElementsByTagName('input');
- var re = /^tag_\d*_code_/;
- for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
- if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
- var code = subfields[i]; // code is the first input
- var subfield = subfields[i+1]; // subfield the second
-
- [% IF ( clear ) %]
- if (subfield){subfield.value="" ;}
- [% ELSE %]
- if(code.value=='9'){
- subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
- }
- [% END %]
- }
- }
// Sets the good number of form fields for the specified subfield
// Returns false if the cloning failed
});
}
+ [% UNLESS ( clear ) %]
[% FOREACH SUBFIELD_LOO IN SUBFIELD_LOOP %]
SetSubfieldValues(
"[% tag_number |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %][% SUBFIELD_LOO.marc_subfield |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]"
[% END %]
);
[% END %]
+ [% END %]
+
+ // browse all its subfields (clear and $9)
+ var subfields = field_start.getElementsByTagName('input');
+ var re = /^tag_\d*_code_/;
+ for(var i=0, len = subfields.length ; i< len ; i++) { // browse all subfields
+ if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
+ var code = subfields[i]; // code is the first input
+ var subfield = subfields[i+1]; // subfield the second
+
+ [% IF ( clear ) %]
+ if (subfield){subfield.value="" ;}
+ [% ELSE %]
+ if(code.value=='9'){
+ subfield.value = "[% authid |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
+ break;
+ }
+ [% END %]
+ }
+ }
opener.close();
window.close();
+[% PROCESS 'authorities.inc' %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Authorities ›
[% IF ( unknownauthid ) %]
[% END %]
</title>
[% INCLUDE 'doc-head-close.inc' %]
+[% IF ( displayhierarchy ) %]
+<script language="javascript" type="text/javascript" src="/intranet-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
+[% END %]
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$('#authoritiestabs').tabs();
+ [% IF ( displayhierarchy ) %]
+ var current_nodes = [];
+ $('.currentauth').each(function() {
+ current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
+ });
+ $('#hierarchies').jstree({
+ "plugins": [ "themes", "html_data"],
+ "themes": { "theme": "classic",
+ "icons": false },
+ "core": { "initially_open": current_nodes }
+ });
+ [% END %]
});
function confirm_deletion() {
var is_confirmed = confirm('Are you sure you want to delete this authority?');
if (is_confirmed) {
- window.location="authorities-home.pl?op=delete&authid=[% authid %]";
+ window.location="authorities-home.pl?op=delete&authid=[% authid %]";
}
}
function Dopop(link) {
}
//]]>
</script>
-[% IF ( displayhierarchy ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css" />
<script type="text/javascript">
-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";
- }
- }
-}
function Help() {
newin=window.open("/cgi-bin/koha/help.pl","KohaHelp",'width=600,height=600,toolbar=false,scrollbars=yes');
}
window.location="/cgi-bin/koha/authorities/authorities-home.pl?op=do_search&type=intranet&authtypecode="+X+"&value="+Y+"&marclist=&and_or=and&excluding=&operator=contains";
}
</script>
- [% END %]
</head>
<body id="auth_detail" class="auth">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'authorities-toolbar.inc' %]
[% 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.ifparents ) %]
- [% FOREACH loopparent IN loopelemen.loopparents %]
- <div name="[% loopparent.loopauthid %]p" class="parent"> <a href="detail.pl?authid=[% loopparent.parentauthid %]">[% loopparent.parentvalue %]</a></div>
- [% END %]
- [% END %]
- [% IF ( loopelemen.current_value ) %]
- [% loopelemen.value %]
- [% ELSE %]
- <a href="detail.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="detail.pl?authid=[% loopchildre.childauthid %]">[% loopchildre.childvalue %]</a></div>
- [% END %]
- [% END %]
- </div>
- [% END %]
-
- </div>
-[% END %]
+<div id="hierarchies">
+[% PROCESS showhierarchy trees = loophierarchies %]
</div>
[% END %]
var is_confirmed = confirm('Are you sure you want to delete this authority?');
if (is_confirmed) {
- window.location="authorities-home.pl?op=delete&authid="
- + id
- + "&marclist=[% marclist %]&and_or=[% and_or %]&excluding=[% excluding %]&operator=[%operator%]&orderby=[% orderby %]&value=[% value %]&startfrom=[% startfrom %]&resultsperpage=[% resultsperpage %]";
+ window.location="authorities-home.pl?op=delete"
+ + "&authid=" + id
+ + "&type=intranet"
+ + "&authtypecode=[% authtypecode %]"
+ + "&marclist=[% marclist %]"
+ + "&and_or=[% and_or %]"
+ + "&excluding=[% excluding %]"
+ + "&operator=[% operator %]"
+ + "&orderby=[% orderby %]"
+ + "&value=[% value |url %]"
+ + "&startfrom=[% startfrom %]"
+ + "&resultsperpage=[% resultsperpage %]";
}
}
function Help() {
[% IF ( subscription.branchname ) %]<h3>At library: [% subscription.branchname %]</h3>[% ELSE %]
[% IF ( subscription.branchcode ) %]<h3>At library: [% subscription.branchcode %]</h3>[% END %][% END %]
[% IF ( subscription.subscriptionnotes ) %]<p>[% subscription.subscriptionnotes FILTER html_line_break %] </p>[% END %]
+ [% IF ( subscription.missinglist ) %]<p>Missing issues: [% subscription.missinglist %] </p>[% END %]
+ [% IF ( subscription.librariannote ) %]<p>([% subscription.librariannote %])</p>[% END %]
[% IF ( subscription.latestserials ) %]
<p> The [% subscription.staffdisplaycount %] latest issues related to this subscription:</p>
<table>
<script type="text/javascript" id="js">
$(document).ready(function() {
$("#table_issues").dataTable($.extend(true, {}, dataTablesDefaults, {
-// maybe some defaults?
+ "aaSorting": [[ 4, "desc" ]]
})
);
}); </script>
[% IF ITEM_DAT.dateaccessioned %]
<li><span class="label">Accession date:</span>
- [% IF ( CAN_user_acquisition_order_receive && ITEM_DAT.booksellerinvoicenumber ) %]
- <a href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% ITEM_DAT.booksellerid %]&invoice=[% ITEM_DAT.booksellerinvoicenumber %]&datereceived=[% ITEM_DAT.datereceived %]">[% ITEM_DAT.dateaccessioned | $KohaDates %]</a>
+ [% IF ( CAN_user_acquisition_order_receive && ITEM_DAT.invoiceid ) %]
+ <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% ITEM_DAT.invoiceid %]">[% ITEM_DAT.dateaccessioned | $KohaDates %]</a>
[% ELSE %]
[% ITEM_DAT.dateaccessioned | $KohaDates %]
[% END %]
</li>
[% END %]
- [% IF ( ITEM_DAT.booksellerinvoicenumber ) %]
+ [% IF ( ITEM_DAT.invoicenumber ) %]
<li><span class="label">Invoice number:</span>
- [% ITEM_DAT.booksellerinvoicenumber %]
+ [% ITEM_DAT.invoicenumber %]
</li>
[% END %]
<b>[% IF ( SEARCH_RESULT.title ) %][% SEARCH_RESULT.title |html %][% ELSE %]No title[% END %]</b>
</a>
[% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield %][% END %]
- [% IF ( SEARCH_RESULT.volume ) %],[% SEARCH_RESULT.volume %][% END %] [% IF ( SEARCH_RESULT.volumeddesc ) %], [% SEARCH_RESULT.volumeddesc %][% END %]
+ [% IF ( SEARCH_RESULT.seriestitle ) %][% SEARCH_RESULT.seriestitle %][% END %]
+ [% IF ( SEARCH_RESULT.volume ) %][% SEARCH_RESULT.volume %][% END %] [% IF ( SEARCH_RESULT.volumeddesc ) %], [% SEARCH_RESULT.volumeddesc %][% END %]
</p>
[% IF ( SEARCH_RESULT.summary ) %]
[% IF ( SEARCH_RESULT.author ) %]
type: "button",
label: _("Z39.50 Search"),
container: "z3950searchc",
- onclick: {fn:function(){PopupZ3950()}}
+ onclick: {fn:function(){if (confirm(_("Please note that this Z39.50 search could replace the current record."))) PopupZ3950()}}
});
}
<h1>Merging records</h1>
[% IF ( result ) %]
[% IF ( errors ) %]
+
[% FOREACH error IN errors %]
- <div class="dialog alert">[% error.error %].<br />Therefore, the record to be merged has not been deleted.</div>
- [% END %]
+ <div class="dialog alert">
- [% ELSE %]
- <script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>
- <p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
+ [% IF error.code == 'CANNOT_MOVE' %]
+ The following items could not be moved from the old record to the new one: [% error.value %]
+ [% ELSE %]
+ [% error %]
+ [% END %]
+
+ <br />Therefore, the record to be merged has not been deleted.</div>
[% END %]
+ [% ELSE %]
+ <script type="text/javascript">window.location.href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]"</script>
+ <p>The merging was successful. <a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblio1 %]">Click here to see the merged record.</a></p>
+ [% END %]
+
[% ELSE %]
[% IF ( choosereference ) %]
[% ELSE %]
[% IF ( errors ) %]
<div class="dialog alert">
- [% FOREACH error IN errors %]
- <p>[% error.error %]</p>
- [% END %]
+ [% FOREACH error IN errors %]
+ <p>
+ [% IF error.code == 'WRONG_COUNT' %]
+ Number of records provided for merging: [% error.value %]. Currently only 2 records can be merged at a time.
+ [% ELSE %]
+ [% error %]
+ [% END %]
+
+ </p>
+ [% END %]
</div>
[% ELSE %]
<form id="mergeform" action="/cgi-bin/koha/cataloguing/merge.pl" method="post" onsubmit="return mergeformsubmit()">
--- /dev/null
+[% INCLUDE 'doc-head-open.inc' %]
+<title>Koha › Cataloguing › plugin for links</title>
+[% INCLUDE 'doc-head-close.inc' %]
+[% IF ( fillinput ) %]
+ <script language="javascript" type="text/javascript">
+
+ function go() {
+
+ var index_start = "[% index %]";
+ var whichfield;
+ try {
+ whichfield = opener.opener.document.getElementById(index_start);
+ } catch(e) {
+ return;
+ }
+
+ // browse all its subfields
+
+ var subfields = whichfield.parentNode.parentNode.getElementsByTagName('input');
+
+ var re = /^tag_\d*_code_/;
+ for(var i=0, len = subfields.length ; i< len ; i++) {
+ if(subfields[i].getAttribute('name').match(re)){ // it s a subfield
+ var code = subfields[i];
+ var subfield = subfields[i+1];
+
+ if(code.value == '9'){
+ subfield.value = "[% subfield_value_9 %]";
+ }
+ if(code.value == '0'){
+ subfield.value = "[% subfield_value_0 %]";
+ }
+ if(code.value == 'a'){
+ subfield.value = "[% subfield_value_a %]";
+ }
+ if(code.value == 'c'){
+ subfield.value = "[% subfield_value_c %]";
+ }
+ if(code.value == 'd'){
+ subfield.value = "[% subfield_value_d %]";
+ }
+ if(code.value == 'e'){
+ subfield.value = "[% subfield_value_e %]";
+ }
+ if(code.value == 'h'){
+ subfield.value = "[% subfield_value_h %]";
+ }
+ if(code.value == 'i'){
+ subfield.value = "[% subfield_value_i %]";
+ }
+ if(code.value == 'p'){
+ subfield.value = "[% subfield_value_p %]";
+ }
+ if(code.value == 't'){
+ subfield.value = "[% subfield_value_t %]";
+ }
+ if(code.value == 'u'){
+ subfield.value = "[% subfield_value_u %]";
+ }
+ if(code.value == 'v'){
+ subfield.value = "[% subfield_value_v %]";
+ }
+ if(code.value == 'w'){
+ subfield.value = "[% subfield_value_w %]";
+ }
+ if(code.value == 'x'){
+ subfield.value = "[% subfield_value_x %]";
+ }
+ if(code.value == 'y'){
+ subfield.value = "[% subfield_value_y %]";
+ }
+ if(code.value == 'z'){
+ subfield.value = "[% subfield_value_z %]";
+ }
+ }
+ }
+ return false;
+ }
+
+ window.onload = go();
+ opener.close();
+ window.close();
+ //]]>
+</script>
+
+</head>
+<body style="padding:1em;">
+<h3>MARC21 Plugin to build links between records</h3>
+[% ELSE %]
+ <script type="text/javascript">
+//<![CDATA[
+// document.getElementById('searchbox').focus();
+
+ function report(value2report) {
+ if (document.f_pop.result.value.length==0) {
+ document.f_pop.result.value = value2report;
+ } else {
+ document.f_pop.result.value = document.f_pop.result.value+'|'+value2report;
+ }
+ return true;
+ }
+ function finish() {
+ opener.document.f.field_value[[% index %]].value= document.f_pop.result.value;
+ self.close();
+ return false;
+ }
+ //]]>
+</script>
+
+</head>
+<body style="padding:1em;">
+<h3>Plugin to build links between records</h3>
+ [% IF ( Search ) %]
+ <div id="MARC21_Linking_section_search">
+ <h2>Search for</h2>
+ <form name="f" method="post" action="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl">
+
+ <p>
+ <input type="hidden" name="plugin_name" value="marc21_linking_section.pl" />
+ <input type="hidden" name="index" value="[% index %]" />
+ <input type="hidden" name="result" value="marc12 field 7 [% index %]" />
+ <input type="hidden" name="op" value="do_search" />
+ <label class="label100" for="searchbox">Any word</label>
+ <input type="text" name="search" id="searchbox" size="35" /><br />
+ <label for="itypeloop">Item type</label>
+ <select name="itype" id="itypeloop">
+ <option value="">All Item Types</option>
+ [% FOREACH itypeloo IN itypeloop %]
+ [% IF ( itypeloo.selected ) %]
+ <option value="[% itypeloo.itemtype %]" selected="selected">[% itypeloo.description %]</option>
+ [% ELSE %]
+ <option value="[% itypeloo.itemtype %]">[% itypeloo.description %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </p>
+ <p>
+ <input type="submit" value="Start search" />
+ </p>
+
+ </div>
+ </form>
+
+ [% ELSE %]
+
+
+ <h2>Search results</h2>
+ <div id="MARC21_Linking_section__resultnumber">
+ <p>[% IF ( displayprev ) %] <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index %]&startfrom=[% startfromprev %]&search=[% search %]&resultsperpage=[% resultsperpage %]&type=intranet&op=do_search"><< Previous</a>[% END %]
+ [% FOREACH number IN numbers %]
+ [% IF ( number.highlight ) %] <span class="highlight">[% number.number %]</span>
+ [% ELSE %] <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index %]&startfrom=[% number.startfrom %]&search=[% number.search |url %]&resultsperpage=[% number.resultsperpage %]&type=intranet&op=do_search">[% number.number %]</a>
+ [% END %]
+ [% END %]
+ [% IF ( displaynext ) %]
+ <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index %]&startfrom=[% startfromnext %]&search=[% search %]&resultsperpage=[% resultsperpage %]&type=intranet&op=do_search">Next>></a>
+ [% END %]</p>
+ <p class="resultcount">
+ [% IF ( total ) %]Results [% from %] to [% to %] of [% total %]
+ [% ELSE %]No results found
+ [% END %]</p></div>
+ <div id="resultlist">
+ <table>
+ <tr>
+ <th>Concise description</th>
+ <th> </th>
+ </tr>
+ [% FOREACH resul IN result %]
+ [% IF ( resul.title ) %]
+ <tr>
+ [% IF ( resul.even ) %]<td class="hilighted">
+ [% ELSE %]<td>[% END %]
+ [% IF ( resul.MARC_ON ) %]
+ <a_class="transparent resultlist" href="/cgi-bin/koha/MARCdetail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title |html %]</a>
+ [% ELSE %]
+ <a_class="transparent resultlist" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% resul.biblionumber |url %]">[% resul.title |html %]</a> [% END %]
+ <p>[% resul.author %]
+ [% IF ( resul.publishercode ) %]- [% resul.publishercode %][% END %]
+ [% IF ( resul.place ) %] ; [% resul.place %][% END %]
+ [% IF ( resul.pages ) %] - [% resul.pages %][% END %]
+ [% IF ( resul.notes ) %] : [% resul.notes %][% END %]
+ [% IF ( resul.size ) %] ; [% resul.size %][% END %]
+ </p>
+ </td>
+
+ <td>
+ [% IF ( resul.biblionumber ) %]
+ <a href="javascript:jumpfull('/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index %]&biblionumber=[% resul.biblionumber %]&type=intranet&op=fillinput')">Choose</a>
+ [% ELSE %]
+ <a href="javascript:jumpfull('/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index %]&type=intranet&op=fillinput')">Clear field</a>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ [% END %]
+ </table>
+ </div>
+ <div id="resultnumber">
+ <p>
+ [% IF ( displayprev ) %]
+ <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&amp;index=[% index %]&amp;startfrom=[% startfromprev %]&amp;search=[% search |url %]&amp;resultsperpage=[% resultsperpage %]&amp;type=intranet&amp;op=do_search">
+ << Previous
+ </a>
+ [% END %]
+
+ [% FOREACH number IN numbers %]
+ [% IF ( number.highlight ) %]
+ <span class="highlight">
+ [% number.number %]
+ </span>
+ [% ELSE %]
+ <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index %]&startfrom=[% number.startfrom %]&search=[% number.search %]&resultsperpage=[% number.resultsperpage %]&type=intranet&op=do_search">
+ [% number.number %]
+ </a>
+ [% END %]
+ [% END %]
+
+ [% IF ( displaynext ) %]
+ <a class="resultnumber" href="/cgi-bin/koha/cataloguing/plugin_launcher.pl?plugin_name=marc21_linking_section.pl&index=[% index %]&startfrom=[% startfromnext %]&search=[% search %]&resultsperpage=[% resultsperpage %]&type=intranet&op=do_search">
+ Next>>
+ </a>
+ [% END %]
+ </p>
+ </div>
+
+<script type="text/javascript">
+//<![CDATA[
+ function jumpfull(page){
+ window.open(page,'','fullscreen,scrollbars');
+ }
+//]]>
+</script>
+
+
+ [% END %]
+
+[% END %]
+[% INCLUDE 'popup-bottom.inc' %]
});
});
+[% IF ( total_pages ) %]
+function validate_goto_page(){
+ var page = $('#goto_page').val();
+ if(isNaN(page)) {
+ alert(_("The page entered is not a number."));
+ return false;
+ }
+ else if(page < 1 || page > [% total_pages %] ) {
+ alert(_("The page should be a number between 1 and ") + [% total_pages %] + ".");
+ return false;
+ }
+ else {
+ return true;
+ }
+}
+[% END %]
+
//]]>
</script>
<style type="text/css">
[% END %]
[% END %]</tbody>
</table>
+
+ <form method="post" action="z3950_search.pl" id="page_form" name="page_form" class="checkboxed">
+ <input type="hidden" name="op" id="op" value="do_search" />
+ <input type="hidden" name="current_page" id="current_page" value="[% current_page %]" />
+ <input type="hidden" id="title" name="title" value="[% title %]" />
+ <input type="hidden" id="isbn" name="isbn" value="[% isbn %]" />
+ <input type="hidden" id="lccall" name="lccall" value="[% lccall %]" />
+ <input type="hidden" id="controlnumber" name="controlnumber" value="[% controlnumber %]" />
+ <input type="hidden" id="srchany" name="srchany" value="[% srchany %]" />
+ <input type="hidden" id="author" name="author" value="[% author %]" />
+ <input type="hidden" id="subject" name="subject" value="[% subject %]" />
+ <input type="hidden" id="dewey" name="dewey" value="[% dewey %]" />
+ <input type="hidden" id="stdid" name="stdid" value="[% stdid %]" />
+ <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
+ <input type="hidden" name="frameworkcode" value="[% frameworkcode %]" />
+
+ [% FOREACH server IN servers %]
+ <input type="hidden" name="id" id="z3950_[% server.id %]" value="[% server.id %]" />
+ [% END %]
+
+ [% IF ( show_prevbutton ) %]
+ <input type="button" name="changepage_prev" value="Previous Page" onclick="$('#current_page').val([% current_page %]-1);$('#page_form').submit();" />
+ [% END %]
+ Page [% current_page %] / [% total_pages %]
+ [% IF ( show_nextbutton ) %]
+ <input type="button" name="changepage_next" value="Next Page" onclick="$('#current_page').val([% current_page %]+1);$('#page_form').submit();" />
+ [% END %]
+ <br />Go to page : <input id="goto_page" name="goto_page" value="[% current_page %]" size="4" /><input type="submit" name="changepage_goto" onclick="return validate_goto_page();" value="Go" />
+ </form>
+
<p><form method="get" action="/cgi-bin/koha/cataloguing/z3950_search.pl"><input type="hidden" name="biblionumber" value="[% biblionumber %]"/><input type="hidden" name="frameworkcode" value="[% frameworkcode %]"/><input type="submit" value="Try Another Search"/></form></p>
[% ELSE %]
[% IF ( errconn ) %]
[% IF ( ITEM_LOST ) %]
<li>This item has been lost with a status of "[% ITEM_LOST %]". Check out anyway?</li>
[% END %]
+
+[% IF HIGHHOLDS %]
+ <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration %] days (due [% HIGHHOLDS.returndate %]). Check out anyway?</li>
+[% END %]
</ul>
+[% IF HIGHHOLDS %]
+ <script language="JavaScript" type="text/javascript">
+ $(document).ready(function() {
+ $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate %]');
+ });
+ </script>
+[% END %]
<form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
[% IF ( RESERVED ) %]
</td>
[% END %]
[% IF ( previssue.return_failed ) %]
- <td class="problem">Checkin failed</td>
+ <td class="problem">Check-in failed</td>
[% ELSE %]
[% IF ( previssue.renew_error_on_reserve ) %]
<td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% previssue.biblionumber %]">On hold</a>
<input type="text" size="10" id="to" name="to" value="[% to %]" class="datepickerto" />
</li>
</ol>
-<p><i>(Inclusive, default is two days ago to today, set other date ranges as needed. )</i></p>
+<p><i>(Inclusive, default is [% HoldsToPullStartDate %] days ago to today, set other date ranges as needed. )</i></p>
<fieldset class="action"><input type="submit" name="run_report" value="Submit" class="submit"/></fieldset>
</fieldset>
</form>
</div>
</div>
</div>
-[% INCLUDE 'intranet-bottom.inc' %]
\ No newline at end of file
+[% INCLUDE 'intranet-bottom.inc' %]
[% IF ( wrongbranch ) %]
-<div class="dialog alert"><h3>Cannot Check In</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
+<div class="dialog alert"><h3>Cannot check in</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
</div>
[% END %]
<!-- case of a mistake in transfer loop -->
<p class="problem">Item was lost, now found.</p>
[% END %]
[% IF ( errmsgloo.withdrawn ) %]
- <p class="problem">Item is withdrawn.</p>
+ [% IF BlockReturnOfWithdrawnItems %]
+ <h3>Cannot Check In</h3>
+ <p class="problem">Item is withdrawn. <strong>NOT CHECKED IN</strong></p>
+ [% ELSE %]
+ <p class="problem">Item is withdrawn.</p>
+ [% END %]
[% END %]
[% IF ( errmsgloo.debarred ) %]
<p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %] </p>
› <a href="/cgi-bin/koha/circ/waitingreserves.pl">Holds awaiting pickup</a>
</div>
-<div id="doc" class="yui-t7">
+<div id="doc3" class="yui-t7">
<div id="bd">
<div id="yui-main">
[% IF ( cancel_result ) %]
[% FOREACH cancel_result %]
[% IF ( messagetransfert ) %]
- <div>
- <h2>Hold find for ([% nextreservtitle %]), must be transferred</h2>
- <p>This hold placed by : <b> [% nextreservsurname %] [% nextreservfirstname %]</b> at the library : <b> [% branchname %] </b>, Please transfer this hold.
+ <div class="dialog message">
+ <h2>This item is on hold for pick-up at [% branchname %]</h2>
+ <p><strong>[% nextreservtitle %]</strong> is on hold for <strong> [% nextreservsurname %], [% nextreservfirstname %]</strong>.
+ Please retain this item and check it in to process the hold.
</p>
<form name="cancelReservewithtransfert" action="waitingreserves.pl" method="post">
- <input type="submit" class="button" />
+ <input type="submit" class="submit" value="OK" />
</form>
</div>
[% END %]
[% IF ( waiting ) %]
- <div id="bloc25">
- <h2>This hold is waiting</h2>
- <p>This hold ([% nextreservtitle %]) was placed by <b> : [% nextreservsurname %] [% nextreservfirstname %]</b>,
- Please retain this hold.
+ <div class="dialog message">
+ <h2>This item is on hold for pick-up at your library</h2>
+ <p><strong>[% nextreservtitle %]</strong> is on hold for <strong>[% nextreservsurname %], [% nextreservfirstname %]</strong>.
+ Please retain this item and check it in to process the hold.
</p>
<form name="cancelReservewithwaiting" action="waitingreserves.pl" method="post">
- <input type="submit" />
+ <input type="submit" class="submit" value="OK"/>
</form>
</div>
[% END %]
<fieldset class="rows">
<ol>
<li>
- <label for="template_id" style="width:9em">Select a template to be applied: </label>
+ <label for="template_id" style="width:20em">Select a template to be applied: </label>
<select name="template_id" id="template_id">
[% FOREACH template IN templates %]
<option value="[% template.template_id %]">[% template.template_code %]</option>
</select>
</li>
<li>
- <label for="layout_id" style="width:9em">Select a layout to be applied: </label>
+ <label for="layout_id" style="width:20em">Select a layout to be applied: </label>
<select name="layout_id" id="layout_id">
[% FOREACH layout IN layouts %]
<option value="[% layout.layout_id %]">[% layout.layout_name %]</option>
</select>
</li>
<li>
- <label for="start_label" style="width:9em">Enter starting label number: </label>
+ <label for="start_label" style="width:20em">Enter starting label position (for PDF): </label>
<input type="text" size="5" id="start_label" name="start_label" class="focus" title="Starting label number" value="1"/>
</li>
</ol>
[% IF ( reverse_col ) %]
<td>
[% IF ( account.payment ) %]
- <a href="boraccount.pl?action=reverse&borrowernumber=[% account.borrowernumber %]&accountno=[% account.accountno %]">Reverse</a>
+ <a href="boraccount.pl?action=reverse&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]">Reverse</a>
[% ELSE %]
[% END %]
[% END %]
<td>
[% IF ( account.payment ) %]
- <a target="_blank" href="printfeercpt.pl?action=print&borrowernumber=[% account.borrowernumber %]&accountno=[% account.accountno %]">Print</a>
+ <a target="_blank" href="printfeercpt.pl?action=print&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]">Print</a>
[% ELSE %]
- <a target="_blank" href="printinvoice.pl?action=print&borrowernumber=[% account.borrowernumber %]&accountno=[% account.accountno %]">Print</a>
+ <a target="_blank" href="printinvoice.pl?action=print&accountlines_id=[% account.accountlines_id %]&borrowernumber=[% account.borrowernumber %]">Print</a>
[% END %]
</td>
</tr>
<td>[% resultsloo.cardnumber %]</td>
<td style="white-space: nowrap;">
<a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resultsloo.borrowernumber %]">
- [% INCLUDE 'patron-title.inc' category_type = resultsloo.category_type firstname = resultsloo.firstname surname = resultsloo.surname othernames = resultsloo.othernames cardnumber = resultsloo.cardnumber invert_name = 1%]
+ [% INCLUDE 'patron-title.inc' borrowernumber = resultsloo.borrowernumber category_type = resultsloo.category_type firstname = resultsloo.firstname surname = resultsloo.surname othernames = resultsloo.othernames cardnumber = resultsloo.cardnumber invert_name = 1%]
</a> <br />
[% IF ( resultsloo.streetnumber ) %][% resultsloo.streetnumber %] [% END %][% resultsloo.address %][% IF ( resultsloo.address2 ) %]<br />[% resultsloo.address2 %][% END %][% IF ( resultsloo.city ) %]<br />[% resultsloo.city %][% IF ( resultsloo.state ) %],[% END %][% END %][% IF ( resultsloo.state ) %] [% resultsloo.state %][% END %] [% IF ( resultsloo.zipcode ) %] [% resultsloo.zipcode %][% END %][% IF ( resultsloo.country ) %], [% resultsloo.country %][% END %]</td>
<td>[% resultsloo.category_description %] ([% resultsloo.category_type %])</td>
- <td>[% resultsloo.branchcode %]</td>
+ <td>[% resultsloo.branchname %]</td>
<td>[% resultsloo.dateexpiry %]</td>
<td>[% IF ( resultsloo.overdues ) %]<span class="overdue"><strong>[% resultsloo.overdues %]</strong></span>[% ELSE %][% resultsloo.overdues %][% END %]/[% resultsloo.issues %]</td>
<td>[% IF ( resultsloo.fines < 0 ) %]<span class="credit">[% resultsloo.fines %]</span> [% ELSIF resultsloo.fines > 0 %] <span class="debit"><strong>[% resultsloo.fines %]</strong></span> [% ELSE %] [% resultsloo.fines %] [% END %]</td>
});
function clear_entry(node) {
- var original = node.parentNode.parentNode;
+ var original = $(node).parent();
$("textarea", original).attr('value', '');
$("select", original).attr('value', '');
}
<label for="cardnumber">
[% END %]
Card number: </label>
- [% IF ( opduplicate ) %]
- <input type="text" id="cardnumber" name="cardnumber" size="20" />
- [% ELSE %]
- <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
- [% END %]
+ <input type="text" id="cardnumber" name="cardnumber" size="20" value="[% cardnumber %]" />
[% IF ( mandatorycardnumber ) %]<span class="required">Required</span>[% END %]</li>
[% END %]
[% UNLESS nobranchcode %]
</fieldset>
[% END %] [% END %]
+[% UNLESS ( check_member ) %]
<fieldset class="action">
<input type="submit" name="save" onclick="return check_form_borrowers();" value="Save" />
[% IF ( opadd ) %]
<a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a>
[% END %]
</fieldset>
+[% END %]
</form>
</div>
</td>
[% END %]
[% IF ( issueloo.return_failed ) %]
- <td class="problem">Checkin failed</td>
+ <td class="problem">Check-in failed</td>
[% ELSE %]
[% IF ( issueloo.norenew_reason_on_reserve ) %]
<td><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% issueloo.biblionumber %]">On hold</a></td>
<input type="hidden" name="description[% line.accountno %]" value="[% line.description %]" />
<input type="hidden" name="accounttype[% line.accountno %]" value="[% line.accounttype %]" />
<input type="hidden" name="amount[% line.accountno %]" value="[% line.amount %]" />
+ <input type="hidden" name="accountlines_id[% line.accountno %]" value="[% line.accountlines_id %]" />
<input type="hidden" name="amountoutstanding[% line.accountno %]" value="[% line.amountoutstanding %]" />
<input type="hidden" name="borrowernumber[% line.accountno %]" value="[% line.borrowernumber %]" />
<input type="hidden" name="accountno[% line.accountno %]" value="[% line.accountno %]" />
<input type="hidden" name="amount" id="amount" value="[% amount %]" />
<input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
<input type="hidden" name="accountno" id="accountno" value="[% accountno %]" />
+ <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
<input type="hidden" name="title" id="title" value="[% title %]" />
<fieldset class="rows">
<input type="hidden" name="amount" id="amount" value="[% amount %]" />
<input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
<input type="hidden" name="accountno" id="accountno" value="[% accountno %]" />
+ <input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
<input type="hidden" name="title" id="title" value="[% title %]" />
<table>
<thead><tr>
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]
<div class="yui-b">
[% INCLUDE 'circ-toolbar.inc' %]
<h1>Circulation history</h1>
-[% IF ( loop_reading ) %]
+[% IF loop_reading %]
<form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
<th>Date due</th>
<th>Return date</th>
</thead>
-[% FOREACH loop_readin IN loop_reading %]
- [% IF ( loop_readin.returndate ) %]<tr>[% ELSE %]<tr class="onissue">[% END %]
+[% FOREACH issue IN loop_reading %]
+ [% IF issue.returndate %]<tr>[% ELSE %]<tr class="onissue">[% END %]
<td>
- [% loop_readin.issuestimestamp %]
+ [% issue.issuestimestamp | $KohaDates %]
</td>
- <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_readin.biblionumber %]">[% loop_readin.title |html %]</a></td>
+ <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% issue.biblionumber %]">[% issue.title |html %]</a></td>
- <td>[% loop_readin.author %]</td>
+ <td>[% issue.author %]</td>
- <td>[% loop_readin.classification %]</td>
+ <td>
+ [% IF issue.classification %]
+ [% issue.classification %]
+ [% ELSE %]
+ [% issue.itemcallnumber %]
+ [% END %]
+ </td>
- <td>[% loop_readin.barcode %]</td>
+ <td>[% issue.barcode %]</td>
<td>
- [% loop_readin.renewals %]</td>
+ [% issue.renewals %]</td>
<td>
- [% loop_readin.issuedate %]</td>
+ [% issue.issuedate | $KohaDates %]</td>
<td>
- [% loop_readin.issuingbranch %]</td>
- <td>[% IF ( loop_readin.date_due ) %][% loop_readin.date_due %][% ELSE %] [% END %]</td>
+ [% issue.issuingbranch %]</td>
+ <td>[% IF issue.date_due %]
+ [% issue.date_due | $KohaDates %]
+ [% ELSE %] [% END %]</td>
<td>
- [% IF ( loop_readin.returndate ) %]
- [% loop_readin.returndate %]
+ [% IF issue.returndate %]
+ [% issue.returndate | $KohaDates %]
[% ELSE %]
Checked Out
[% END %]
<form action="/cgi-bin/koha/reports/dictionary.pl" method="post">
<input type="hidden" name="phase" value="View Dictionary" />
[% IF ( areas ) %]
- Filter by area <select name="areas">
+ Filter by area <select name="area">
<option value="">All</option>
[% FOREACH area IN areas %]
[% IF ( area.selected ) %]
<ol><li><input type="hidden" name="phase" value="New Term step 3" />
<input type="hidden" name="definition_name" value="[% definition_name %]" />
<input type="hidden" name="definition_description" value="[% definition_description %]" />
-<label for="areas">Select table </label><select name="areas" id="areas">
+<label for="area">Select table </label><select name="area" id="area">
[% FOREACH area IN areas %]
<option value="[% area.id %]">[% area.name %]</option>
[% END %]
<script type="text/javascript">
//<![CDATA[
+var group_subgroups = {};
+var no_subgroup_label = _( "(None)" );
+function load_group_subgroups () {
+ var group = $("#group").val();
+ var sg = $("#subgroup");
+ var has_subgroups = false;
+ $(sg).empty().append('<option value="">' + no_subgroup_label + '</option>');
+ if (group) {
+ $.each( group_subgroups[group], function(index, value) {
+ has_subgroups = true;
+ $('<option value="' + value[0] + '">' + value[1] + '</option>').appendTo(sg);
+ } );
+ }
+ if (has_subgroups) {
+ $(sg).show();
+ } else {
+ $(sg).hide();
+ }
+}
$(document).ready(function(){
[% IF ( showsql ) %]
$("#sql").focus(function() {
[% END %]
// call the tablesorter plugin
$("#table_reports").tablesorter({
+ widgets : ['zebra'],
sortList: [[1,0]],
headers: {
6: { sorter: false},
<th>ID</th>
<th>Report name</th>
<th>Type</th>
+ <th>Area</th>
+ <th>Group</th>
+ <th>Subgroup</th>
<th>Notes</th>
<th>Author</th>
<th>Creation date</th>
</thead>
<tbody>
[% FOREACH savedreport IN savedreports %]
-[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+[% UNLESS ( loop.odd ) %]<tr class="odd">[% ELSE %]<tr>[% END %]
<td>[% savedreport.id %]</td>
<td>[% savedreport.report_name %]</td>
<td>[% savedreport.type %]</td>
+<td>[% savedreport.areaname %]</td>
+<td>[% savedreport.groupname %]</td>
+<td>[% savedreport.subgroupname %]</td>
<td>[% savedreport.notes %]</td>
<td>[% savedreport.borrowersurname %][% IF ( savedreport.borrowerfirstname ) %], [% savedreport.borrowerfirstname %][% END %] ([% savedreport.borrowernumber %])</td>
<td>[% savedreport.date_created %]</td>
<form action="/cgi-bin/koha/reports/guided_reports.pl">
<fieldset class="rows">
<legend>Step 1 of 6: Choose a module to report on,[% IF (usecache) %] Set cache expiry, [% END %] and Choose report visibility </legend>
-<ol><li><label for="areas">Choose: </label><select name="areas" id="areas">
+<ol><li><label for="area">Choose: </label><select name="area" id="area">
[% FOREACH area IN areas %]
<option value="[% area.id %]">[% area.name %]</option>
[% END %]
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
<input type="hidden" name="sql" value="[% sql |html %]" />
<input type="hidden" name="type" value="[% type %]" />
+<input type="hidden" name="area" value="[% area %]" />
<input type="hidden" name="public" value="[% public %]" />
<input type="hidden" name="cache_expiry" value="[% cache_expiry %]" />
<fieldset class="rows">
<legend>Save your custom report</legend>
<ol>
<li><label for="reportname">Report name: </label><input type="text" id="reportname" name="reportname" /></li>
+ [% IF groups_with_subgroups %]
+ <li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();">
+ [% FOR g IN groups_with_subgroups %]
+ [% IF g.selected %]
+ <option value="[% g.id %]" selected>[% g.name %]</option>
+ [% ELSE %]
+ <option value="[% g.id %]">[% g.name %]</option>
+ [% END %]
+ <script type="text/javascript">
+ var g_sg = new Array();
+ [% FOR sg IN g.subgroups %]
+ g_sg.push(["[% sg.id %]", "[% sg.name %]"]);
+ [% IF sg.selected %]
+ $(document).ready(function() {
+ $("#subgroup").val("[% sg.id %]");
+ });
+ [% END %]
+ [% END %]
+ group_subgroups["[% g.id %]"] = g_sg;
+ </script>
+ [% END %]
+ </select></li>
+ <li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup">
+ </select></li>
+ [% END %]
<li><label for="notes">Notes:</label> <textarea name="notes" id="notes"></textarea></li>
</ol></fieldset>
<fieldset class="action"><input type="hidden" name="phase" value="Save Report" />
[% END %]
[% IF ( create ) %]
+<script type="text/javascript">
+$(document).ready(function() {
+ load_group_subgroups();
+});
+</script>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
<fieldset class="rows">
<legend>Create report from SQL</legend>
[% IF ( reportname ) %]<input type="text" id="reportname" name="reportname" value="[% reportname %]" />
[% ELSE %]<input type="text" id="reportname" name="reportname" />[% END %]
</li>
+ [% IF groups_with_subgroups %]
+ <li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();">
+ [% FOR g IN groups_with_subgroups %]
+ [% IF g.selected %]
+ <option value="[% g.id %]" selected>[% g.name %]</option>
+ [% ELSE %]
+ <option value="[% g.id %]">[% g.name %]</option>
+ [% END %]
+ <script type="text/javascript">
+ var g_sg = new Array();
+ [% FOR sg IN g.subgroups %]
+ g_sg.push(["[% sg.id %]", "[% sg.name %]"]);
+ [% IF sg.selected %]
+ $(document).ready(function() {
+ $("#subgroup").val("[% sg.id %]");
+ });
+ [% END %]
+ [% END %]
+ group_subgroups["[% g.id %]"] = g_sg;
+ </script>
+ [% END %]
+ </select></li>
+ <li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup">
+ </select></li>
+ [% END %]
[% IF (public) %]
<li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0">No (default)</option> <option value="1" selected="selected">Yes</public> </select></li>
[% ELSE %]
[% END %]
[% IF ( editsql ) %]
+<script type="text/javascript">
+$(document).ready(function() {
+ load_group_subgroups();
+});
+</script>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="post">
<input type="hidden" name="phase" value="Update SQL" />
<input type="hidden" name="id" value="[% id %]"/>
<legend>Edit SQL report</legend>
<ol>
<li><label for="reportname">Report name:</label><input type="text" id="reportname" name="reportname" value="[% reportname %]" size="50" /></li>
+ [% IF groups_with_subgroups %]
+ <li><label for="group">Report group: </label><select name="group" id="group" onChange="load_group_subgroups();">
+ [% FOR g IN groups_with_subgroups %]
+ [% IF g.selected %]
+ <option value="[% g.id %]" selected>[% g.name %]</option>
+ [% ELSE %]
+ <option value="[% g.id %]">[% g.name %]</option>
+ [% END %]
+ <script type="text/javascript">
+ var g_sg = new Array();
+ [% FOR sg IN g.subgroups %]
+ g_sg.push(["[% sg.id %]", "[% sg.name %]"]);
+ [% IF sg.selected %]
+ $(document).ready(function() {
+ $("#subgroup").val("[% sg.id %]");
+ });
+ [% END %]
+ [% END %]
+ group_subgroups["[% g.id %]"] = g_sg;
+ </script>
+ [% END %]
+ </select></li>
+ <li><label for="subgroup">Report subgroup: </label><select name="subgroup" id="subgroup">
+ </select></li>
+ [% END %]
[% IF (public) %]
<li><label for="public">Report is public:</label><select id="public" name="public"> <option value="0">No (default)</option> <option value="1" selected="selected">Yes</public> </select></li>
[% ELSE %]
[% IF ( saved1 ) %]
<div id="saved-reports-filter">
+<script type="text/javascript">
+$(document).ready(function() {
+ no_subgroup_label = _( "-- All --" );
+ load_group_subgroups();
+});
+</script>
<form action="/cgi-bin/koha/reports/guided_reports.pl" method="get">
<input type="hidden" name="phase" value="Use saved" />
<input type="hidden" name="filter_set" value="1" />
<fieldset class="brief">
<h3>Filter</h3>
<ol>
+ <li><label for="group">Choose Group and Subgroup: </label>
+ <select name="group" id="group" onChange="load_group_subgroups();">
+ <option value="">-- All --</option>
+ [% FOR g IN groups_with_subgroups %]
+ [% IF g.selected %]
+ <option value="[% g.id %]" selected>[% g.name %]</option>
+ [% ELSE %]
+ <option value="[% g.id %]">[% g.name %]</option>
+ [% END %]
+ <script type="text/javascript">
+ var g_sg = new Array();
+ [% FOR sg IN g.subgroups %]
+ g_sg.push(["[% sg.id %]", "[% sg.name %]"]);
+ [% IF sg.selected %]
+ $(document).ready(function() {
+ $("#subgroup").val("[% sg.id %]");
+ });
+ [% END %]
+ [% END %]
+ group_subgroups["[% g.id %]"] = g_sg;
+ </script>
+ [% END %]
+ </select>
+ <select name="subgroup" id="subgroup"></select>
+ </li>
<li><label for="filter_date">Date:</label> <input type="text" id="filter_date" name="filter_date" size="10" value="[% filter_date %]" class="datepicker" />
<div class="hint">[% INCLUDE 'date-format.inc' %]</div>
}
// Filter by date
function filterByDate() {
- var beginDate = Date_from_syspref($("#begindate").val()).getTime();
- var endDate = Date_from_syspref($("#enddate").val()).getTime();
+ var beginDate = Date_from_syspref($("#from").val()).getTime();
+ var endDate = Date_from_syspref($("#to").val()).getTime();
// Checks if the beginning date is valid
if (!parseInt(beginDate)) {
[% FOREACH member IN m_loop %]
<tr><td>[% member.name %]</td>
<td>
- <select name="itemrank" onchange="reorder_item([%- subscriptionid -%], [%- member.routingid -%], this.option[this.selectedIndex].value)">
+ <select name="itemrank" onchange="reorder_item([%- subscriptionid -%], [%- member.routingid -%], this.value)">
[% rankings = [1 .. m_loop.size] %]
[% FOREACH r IN rankings %]
[% IF r == member.ranking %]
<h1>Subscription information for <i>[% bibliotitle %]</i></h1>
<div id="action">
- <a href="/cgi-bin/koha/serials/serials-home.pl?biblionumber=[% biblionumber %]">Subscriptions</a>
+ <a href="/cgi-bin/koha/serials/serials-search.pl?biblionumber=[% biblionumber %]">Subscriptions</a>
<a href="/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=[% biblionumber %]">Back to biblio</a>
<a href="/cgi-bin/koha/serials/serial-issues.pl?biblionumber=[% biblionumber %]&selectview=full">Complete view</a>
</div>
<script type="text/javascript">
//<![CDATA[
+function generateReceive(subscriptionid) {
+ if(nbissues=prompt(_("How many issues do you want to receive ?"))){
+ document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid+'&nbissues='+nbissues;
+ }
+}
function print_slip(subscriptionid,issue){
var myurl = 'routing-preview.pl?ok=1&subscriptionid='+subscriptionid+'&issue='+issue;
window.open(myurl,'PrintSlip','width=500,height=500,toolbar=no,scrollbars=yes');
<p>
<input type="submit" value="Edit serials" />
<input type="button" value="Generate Next" onclick="javascript:generateNext([% subscriptionidlist %])" />
+ [% IF ( subscriptions.size == 1 and !serialsadditems ) %] <input type="button" value="Multi receiving" onclick="javascript:generateReceive([% subscriptionidlist %])" />[% END %]
</p>
[% END %]
[% INCLUDE 'doc-head-close.inc' %]
<script language="JavaScript" type="text/javascript">
//<![CDATA[
+function generateReceive() {
+ var subscriptionid = document.getElementsByName("subscriptionid")[0].value;
+ if(nbissues=prompt(_("How many issues do you want to receive ?"))){
+ document.location = 'serials-collection.pl?op=gennext&subscriptionid='+subscriptionid+'&nbissues='+nbissues;
+ }
+}
function popup(subscriptionid) {
window.open("subscription-renew.pl?subscriptionid="+subscriptionid,"subscription_renewal",'width=700,height=400,toolbar=false,scrollbars=yes');
}
<h1>Serial edition <i>[% bibliotitle %]</i>
[% IF location %] ( [% location %] ) [% END %]
[% IF ( callnumber ) %] callnumber: [% callnumber %][% END %]</h1>
+[% IF internalnotes %]<p>Nonpublic note: [% internalnotes %]</p>[% END %]
<form method="post" name="f" action="serials-edit.pl" id="serials_edit">
<!--onsubmit="return barcode_check()">-->
</table>
<fieldset class="action"><input type="submit" value="Save" class="button" accesskey="w" />
+ [% UNLESS ( serialsadditems ) %] <input type="button" onclick="javascript:generateReceive()" value="Multi receiving">[% END %]
</form>
</div>
[% INCLUDE 'doc-head-open.inc' %]
[% USE KohaDates %]
<title>Koha › Serials [% biblionumber %]</title>
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
[% INCLUDE 'doc-head-close.inc' %]
-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
-[% INCLUDE 'datatables-strings.inc' %]
-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
-<script type="text/javascript">
-//<![CDATA[
- $(document).ready(function() {
- var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
- "aoColumnDefs": [
- { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
- ],
- "sPaginationType": "four_button"
- } ) );
-
- srlt.fnAddFilters("filter", 750);
- });
- //]]>
-</script>
</head>
<body id="ser_serials-home" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Serials </div>
<div id="doc3" class="yui-t2">
-
- <div id="bd">
- <div id="yui-main">
- <div class="yui-b">
- [% INCLUDE 'serials-toolbar.inc' %]
-
-[% IF ( information ) %]
-Serials updated :
-<table>
- <tr>
- <th>
- Serialseq
- </th>
- <th>
- Status
- </th>
- <th>
- Published date
- </th>
- <th>
- Planned date
- </th>
- <th>
- Notes
- </th>
- </tr>
-[% FOREACH informatio IN information %]
- <tr>
- <td>
- [% informatio.serialseq %]
- </td>
- <td>
- [% informatio.status %]
- </td>
- <td>
- [% informatio.publisheddate %]
- </td>
- <td>
- [% informatio.planneddate %]
- </td>
- <td>
- [% informatio.notes %]
- </td>
- </tr>
-[% END %]
-</table>
-[% END %]
- [% IF ( done_searched ) %]
-<h2>Serials subscriptions</h2>
-
- <table id="srlt">
- <thead>
- <tr>
- <th>ISSN</th>
- <th>Title</th>
- <th> Notes </th>
- <th>Library</th>
- <th>Call number</th>
- <th>Expiration date</th>
- [% IF ( routing && CAN_user_serials_routing ) %]
- <th>Routing list</th>
- [% END %]
- <th> </th>
- <th> </th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
- <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
- <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
- <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
- <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
- <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
- [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
- <td></td>
- <td></td>
- </tr>
- </tfoot>
- <tbody>
- [% FOREACH subscription IN subscriptions %]
- <tr>
- <td>
- [% IF ( subscription.issn ) %][% subscription.issn %]
- [% END %]
- </td>
- <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
- </td>
- <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
- [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
- </td>
- <td>
- [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
- </td>
- <td>
- [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
- </td>
- <td>
- [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
- </td>
- [% IF ( routing && CAN_user_serials_routing ) %]
- <td>
- [% IF ( subscription.cannotedit ) %]
-
- [% 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 %]&op=new">New</a>
- [% END %]
- [% END %]
- </td>
- [% END %]
- <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
- </td>
- <td>
- [% IF ( subscription.cannotedit ) %]
-
- [% ELSE %]
- [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&serstatus=1,3,7">Serial receive</a>[% END %]
- [% END %]
- </td>
- </tr>
- [% END %]
- </tbody>
- </table>
-
- [% END %]
-
-</div>
-</div>
-
-<div class="yui-b">
-[% INCLUDE 'serials-menu.inc' %]
-</div>
+<div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+ [% INCLUDE 'serials-toolbar.inc' %]
+ </div>
+ </div>
+ <div class="yui-b">
+ [% INCLUDE 'serials-menu.inc' %]
+ </div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]
--- /dev/null
+[% INCLUDE 'doc-head-open.inc' %]
+[% USE KohaDates %]
+<title>Koha › Serials [% biblionumber %]</title>
+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
+[% INCLUDE 'doc-head-close.inc' %]
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
+<script type="text/javascript">
+//<![CDATA[
+ $(document).ready(function() {
+ var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
+ "aoColumnDefs": [
+ { "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
+ ],
+ "sPaginationType": "four_button"
+ } ) );
+
+ srlt.fnAddFilters("filter", 750);
+ });
+ //]]>
+</script>
+</head>
+<body id="ser_serials-home" class="ser">
+[% INCLUDE 'header.inc' %]
+[% INCLUDE 'serials-search.inc' %]
+
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div>
+
+<div id="doc3" class="yui-t2">
+ <div id="bd">
+ <div id="yui-main">
+ <div class="yui-b">
+ [% INCLUDE 'serials-toolbar.inc' %]
+
+ <h2>Serials subscriptions</h2>
+ [% UNLESS ( done_searched ) %]
+ <div id="advsearch">
+ <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
+ <fieldset class="rows">
+ <legend>Search subscriptions</legend>
+ <ol>
+ <li>
+ <label for="issn">ISSN:</label>
+ <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
+ </li>
+ <li>
+ <label for="title">Title:</label>
+ <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
+ </li>
+ [% IF ( marcflavour == "UNIMARC" ) %]
+ <li>
+ <label for="ean">EAN:</label>
+ <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
+ </li>
+ [% END %]
+ <li>
+ <label for="publisher">Publisher:</label>
+ <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
+ </li>
+ <li>
+ <label for="bookseller">Bookseller:</label>
+ <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
+ </li>
+ <li>
+ <label for="branch">Branch:</label>
+ <select id="branch" name="branch_filter">
+ <option value="">All</option>
+ [% FOREACH branch IN branches_loop %]
+ [% IF ( branch.selected ) %]
+ <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+ [% ELSE %]
+ <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ </ol>
+ <input type="hidden" name="searched" value="1" />
+ <fieldset class="action">
+ <input type="submit" value="Search" />
+ </fieldset>
+ </fieldset>
+ </form>
+ </div>
+ [% END %]
+ [% IF ( done_searched ) %]
+ [% IF ( subscriptions ) %]
+ <table id="srlt">
+ <thead>
+ <tr>
+ <th>ISSN</th>
+ <th>Title</th>
+ <th> Notes </th>
+ <th>Library</th>
+ <th>Call number</th>
+ <th>Expiration date</th>
+ [% IF ( routing && CAN_user_serials_routing ) %]
+ <th>Routing list</th>
+ [% END %]
+ <th> </th>
+ <th> </th>
+ </tr>
+ </thead>
+ <tfoot>
+ <tr>
+ <td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
+ <td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
+ <td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
+ <td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
+ <td><input type="text" class="filter" data-column_num="4" placeholder="Search callnumber" /></td>
+ <td><input type="text" class="filter" data-column_num="5" placeholder="Search expiration date" /></td>
+ [% IF ( routing && CAN_user_serials_routing ) %]<td></td>[% END %]
+ <td></td>
+ <td></td>
+ </tr>
+ </tfoot>
+ <tbody>
+ [% FOREACH subscription IN subscriptions %]
+ <tr>
+ <td>
+ [% IF ( subscription.issn ) %][% subscription.issn %]
+ [% END %]
+ </td>
+ <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a>
+ </td>
+ <td>[% IF ( subscription.notes ) %][% subscription.notes %][% END %]
+ [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
+ </td>
+ <td>
+ [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
+ </td>
+ <td>
+ [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %]
+ </td>
+ <td>
+ [% IF ( subscription.enddate ) %][% subscription.enddate | $KohaDates %][% END %]
+ </td>
+ [% IF ( routing && CAN_user_serials_routing ) %]
+ <td>
+ [% IF ( subscription.cannotedit ) %]
+
+ [% 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 %]&op=new">New</a>
+ [% END %]
+ [% END %]
+ </td>
+ [% END %]
+ <td><a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]">Issue history</a>
+ </td>
+ <td>
+ [% IF ( subscription.cannotedit ) %]
+
+ [% ELSE %]
+ [% IF ( CAN_user_serials_receive_serials ) %]<a href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&serstatus=1,3,7">Serial receive</a>[% END %]
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ [% ELSE %]
+ There is no subscription for your search.
+ [% END %]
+ [% END %]
+ </div>
+ </div>
+
+ <div class="yui-b">
+ [% INCLUDE 'serials-menu.inc' %]
+ [% IF ( done_searched ) %]
+ <div id="advsearch">
+ <form action="/cgi-bin/koha/serials/serials-search.pl" method="get">
+ <fieldset class="brief">
+ <h4>Search subscriptions</h4>
+ <ol>
+ <li>
+ <label for="issn">ISSN:</label>
+ <input type="text" id="issn" name="ISSN_filter" value="[% ISSN_filter %]" />
+ </li>
+ <li>
+ <label for="title">Title:</label>
+ <input type="text" id="title" name="title_filter" value="[% title_filter %]" />
+ </li>
+ [% IF ( marcflavour == "UNIMARC" ) %]
+ <li>
+ <label for="ean">EAN:</label>
+ <input type="text" id="ean" name="EAN_filter" value="[% EAN_filter %]" />
+ </li>
+ [% END %]
+ <li>
+ <label for="publisher">Publisher:</label>
+ <input type="text" id="publisher" name="publisher_filter" value="[% publisher_filter %]" />
+ </li>
+ <li>
+ <label for="bookseller">Bookseller:</label>
+ <input type="text" id="bookseller" name="bookseller_filter" value="[% bookseller_filter %]" />
+ </li>
+ <li>
+ <label for="branch">Branch:</label>
+ <select id="branch" name="branch_filter">
+ <option value="">All</option>
+ [% FOREACH branch IN branches_loop %]
+ [% IF ( branch.selected ) %]
+ <option selected="selected" value="[% branch.branchcode %]">[% branch.branchname %]</option>
+ [% ELSE %]
+ <option value="[% branch.branchcode %]">[% branch.branchname %]</option>
+ [% END %]
+ [% END %]
+ </select>
+ </li>
+ </ol>
+ <input type="hidden" name="searched" value="1" />
+ <fieldset class="action">
+ <input type="submit" value="Search" />
+ </fieldset>
+ </div>
+ </fieldset>
+ </form>
+ [% END %]
+ </div>
+</div>
+[% INCLUDE 'intranet-bottom.inc' %]
</div>
</div>
</div>
+ [% IF ( show_acquisition_details ) %]
+ <div id="acquisition_details">
+ <h2>Acquisition details</h2>
+ <table>
+ <thead>
+ <tr><th></th><th>Price exc. taxes</th><th>Price inc. taxes</th><th>fund</th><th></th></tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>Ordered amount</td>
+ <td>[% valuegste_ordered %]</td>
+ <td>[% valuegsti_ordered %]</td>
+ <td>[% budget_name_ordered %]</td>
+ <td>
+ [% IF ( ordered_exists ) %]
+ <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">See basket informations</a>
+ [% END %]
+ </td>
+ </tr>
+ <tr>
+ <td>Spent amount</td>
+ <td>[% valuegste_spent %]</td>
+ <td>[% valuegsti_spent %]</td>
+ <td>[% budget_name_spent %]</td>
+ <td>
+ [% IF ( spent_exists ) %]
+ <a href="/cgi-bin/koha/acqui/invoice.pl?invoicenumber=[% invoicenumber %]">See invoice informations</a>
+ [% END %]
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ [% END %]
<div id="subscription_planning">
<div class="yui-g">
<div class="rows">
<form name="f" action="batchMod.pl" method="post">
+ <input type="hidden" name="src" id="src" value="[% src %]" />
+ <input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber %]" />
<input type="hidden" name="op" value="[% op %]" />
<input type="hidden" name="uploadedfileid" id="uploadedfileid" value="" />
<input type="hidden" name="completedJobID" id="completedJobID" value="" />
</div>
[% END %]
- <p><a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a></p>
+ <p>
+ [% IF ( src == 'CATALOGUING') %]
+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber %]">Done</a>
+ [% ELSE %]
+ <a href="/cgi-bin/koha/tools/batchMod.pl?del=1">Return to batch item deletion</a>
+ [% END %]
+ </p>
[% END %]
</div>
</div>
$(this).parent().find(".hint").toggle(); return false;
});
$("#dateofrange").datepicker();
+ $("#datecancelrange").datepicker();
$("#dateofrange").each(function () { this.value = "" });
+ $("#datecancelrange").each(function () { this.value = "" });
$("#jcalendar-container").datepicker({
beforeShowDay: function(thedate) {
var day = thedate.getDate();
<input type="hidden" id="showBranchName" name="showBranchName" />
</li>
<li>
- <strong>Date:</strong>
+ <strong>From Date:</strong>
<span id="showDaynameOutput"></span>,
[% IF ( dateformat_us ) %]<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>/<span id="showYearOutput"></span>[% ELSIF ( dateformat_metric ) %]<span id="showDayOutput"></span>/<span id="showMonthOutput"></span>/<span id="showYearOutput"></span>[% ELSE %]<span id="showYearOutput"></span>/<span id="showMonthOutput"></span>/<span id="showDayOutput"></span>[% END %]
<input type="hidden" id="showMonth" name="showMonth" />
<input type="hidden" id="showYear" name="showYear" />
</li>
+ <li class="dateinsert">
+ <b>To Date : </b>
+ <input type="text" id="datecancelrange" name="datecancelrange" size="20" value="[% datecancelrange %]" class="datepicker"/>
+ </li>
<li><label for="showTitle">Title: </label><input type="text" name="showTitle" id="showTitle" size="35" /></li>
<!-- showTitle is necessary for exception radio button to work properly -->
<label for="showDescription">Description:</label>
<a href="#" class="helptext">[?]</a>
<div class="hint">You can make an exception for this holiday rule. This means that you will be able to say that for a repeatable holiday there is one day which is going to be an exception.</div>
</div></li>
+ <li class="radio"><input type="radio" name="showOperation" id="showOperationExcRange" value="exceptionrange" />
+ <label for="newOperationFieldException">Generate exceptions on a range of dates.</label>
+ <a href="#" class="helptext">[?]</a>
+ <div class="hint">You can make an exception on a range of dates repeated yearly.</div>
+ </li>
<li class="radio"><input type="radio" name="showOperation" id="showOperationDel" value="delete" /> <label for="showOperationDel" id="showOperationDelLabel">Delete this holiday</label>
<a href="#" class="helptext">[?]</a>
- <div class="hint">This will delete this holiday rule. If it is a repeatable holiday, this option checks for posible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.</div></li>
+ <div class="hint">This will delete this holiday rule. If it is a repeatable holiday, this option checks for possible exceptions. If an exception exists, this option will remove the exception and set the date to a regular holiday.</div></li>
+ <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRange" value="deleterange" /> <label for="showOperationDelRange" id="showOperationDelLabelRange">Delete the single holidays on a range</label>.
+ <a href="#" class="helptext">[?]</a>
+ <div class="hint">This will delete the single holidays rules only. The repeatable holidays and exceptions will not be deleted.</div>
+ </li>
+ <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeat" value="deleterangerepeat" /> <label for="showOperationDelRangeRepeat" id="showOperationDelLabelRangeRepeat">Delete the repeated holidays on a range</label>.
+ <a href="#" class="helptext">[?]</a>
+ <div class="hint">This will delete the repeated holidays rules only. The repeatable holidays will be deleted but not the exceptions.</div>
+ </li>
+ <li class="radio"><input type="radio" name="showOperation" id="showOperationDelRangeRepeatExcept" value="deleterangerepeatexcept" /> <label for="showOperationDelRangeRepeatExcept" id="showOperationDelLabelRangeRepeatExcept">Delete the exceptions on a range</label>.
+ <a href="#" class="helptext">[?]</a>
+ <div class="hint">This will delete the exceptions inside a given range. Be careful about your scope range if it is oversized you could slow down Koha.</div>
+ </li>
<li class="radio"><input type="radio" name="showOperation" id="showOperationEdit" value="edit" checked="checked" /> <label for="showOperationEdit">Edit this holiday</label>
- <a href="#" class="helptext">[?]</a>
- <div class="hint">This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.</div></li>
-
+ <a href="#" class="helptext">[?]</a>
+ <div class="hint">This will save changes to the holiday's title and description. If the information for a repeatable holiday is modified, it affects all of the dates on which the holiday is repeated.</div></li>
</ol>
<fieldset class="action">
<input type="submit" name="submit" value="Save" />
<li class="radio"><input type="radio" name="newOperation" id="newOperationField" value="holidayrange" />
<label for="newOperationField">Holidays on a range</label>.
<a href="#" class="helptext">[?]</a>
- <div class="hint">Make a single holiday on a range. For example, selecting August 1st, 2012 and August 10st, 2012 will make all days between 1st and 10st holiday, but will not affect August 1st-10st in other years.</div>
+ <div class="hint">Make a single holiday on a range. For example, selecting August 1st, 2012 and August 10st, 2012 will make all days between 1st and 10st holiday, but will not affect August 1-10 in other years.</div>
</li>
<li class="radio"><input type="radio" name="newOperation" id="newOperationFieldyear" value="holidayrangerepeat" />
<label for="newOperationFieldyear">Holidays repeated yearly on a range</label>.
<a href="#" class="helptext">[?]</a>
- <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1st, 2012 and August 10st, 2012 will make all days between 1st and 10st holiday, and will affect August 1st-10st in other years.</div>
+ <div class="hint">Make a single holiday on a range repeated yearly. For example, selecting August 1st, 2012 and August 10st, 2012 will make all days between 1st and 10st holiday, and will affect August 1-10 in other years.</div>
</li>
<li class="radio">
<input type="checkbox" name="allBranches" id="allBranches" />
+[% BLOCK final_match_link %]
+ [% IF ( record.record_type == 'biblio' ) %]
+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record.final_match_id %]">[% record.final_match_id %]</a>
+ [% ELSIF ( record.record_type == 'auth' ) %]
+ <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record.final_match_id %]">[% record.final_match_id %]</a>
+ [% END %]
+[% END %]
+[% BLOCK match_link %]
+ [% IF ( record_lis.match_id ) %]
+ <tr>
+ <td />
+ [% IF ( record.record_type == 'biblio' ) %]
+ <td class="highlight" colspan="4">Matches biblio [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td>
+ [% ELSIF ( record.record_type == 'auth' ) %]
+ <td class="highlight" colspan="4">Matches authority [% record_lis.match_id %] (score = [% record_lis.match_score %]): <a href="/cgi-bin/koha/authorities/detail.pl?authid=[% record_lis.match_id %]">[% record_lis.match_citation %]</a></td>
+ [% END %]
+ </tr>
+ [% END %]
+[% END %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Tools › Manage staged MARC records
[% IF ( import_batch_id ) %]
<fieldset class="rows" id="staged-record-matching-rules">
<ol>
<li><span class="label">File name:</span> [% file_name %]</li>
- <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %](none)[% END %]</li>
+ <li><span class="label">Comments:</span> [% IF ( comments ) %][% comments %][% ELSE %](none)[% END %]</li>
+ <li><span class="label">Type:</span> [% IF ( record_type == 'auth' ) %]Authority records[% ELSE %]Bibliographic records[% END %]</li>
<li><span class="label">Staged:</span> [% upload_timestamp %]</li>
<li><span class="label">Status:</span> [% import_status %]</li>
<li>
<th>#</th>
<th>File name</th>
<th>Comments</th>
+ <th>Type</th>
<th>Status</th>
<th>Staged</th>
- <th># Bibs</th>
+ <th># Records</th>
<th># Items</th>
<th>Action</th>
</tr>
<td>[% batch_lis.import_batch_id %]</td>
<td><a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]">[% batch_lis.file_name %]</a></td>
<td>[% batch_lis.comments %]</td>
+ <td>[% IF ( batch_lis.record_type == 'auth' ) %]Authority[% ELSE %]Bibliographic[% END %]</td>
<td>[% batch_lis.import_status %]</td>
<td>[% batch_lis.upload_timestamp %]</td>
- <td>[% batch_lis.num_biblios %]</td>
+ <td>[% batch_lis.num_records %]</td>
<td>[% batch_lis.num_items %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]&op=create_labels">(Create label batch)</a>[% END %]</td>
<td>[% IF ( batch_lis.can_clean ) %]
<form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" >
[% END %]
[% END %]
-[% IF ( biblio_list ) %]
+[% IF ( record_list ) %]
[% IF ( pages ) %]
<div class="pages">
Page
<th>Citation</th>
<th>Status</th>
<th>Match?</th>
- <th>Bib</th>
+ <th>Record</th>
</tr>
- [% FOREACH biblio_lis IN biblio_list %]
+ [% FOREACH record_lis IN record_list %]
[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
- <td>[% biblio_lis.record_sequence %]</td>
- <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio_lis.import_record_id %]" rel="gb_page_center[600,500]">[% biblio_lis.citation %]</a></td>
- <td>[% biblio_lis.status %]</td>
- <td>[% biblio_lis.overlay_status %]</td>
- <td>[% IF ( biblio_lis.final_match_biblionumber ) %]
- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.final_match_biblionumber %]">[% biblio_lis.final_match_biblionumber %]</a>
+ <td>[% record_lis.record_sequence %]</td>
+ <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% record_lis.import_record_id %]" rel="gb_page_center[600,500]">[% record_lis.citation %]</a></td>
+ <td>[% record_lis.status %]</td>
+ <td>[% record_lis.overlay_status %]</td>
+ <td>[% IF ( record_lis.final_match_id ) %]
+ [% PROCESS final_match_link record=record_lis %]
[% END %]
</td>
</tr>
- [% IF ( biblio_lis.match_biblionumber ) %]
- <tr>
- <td />
- <td class="highlight" colspan="4">Matches biblio [% biblio_lis.match_biblionumber %] (score = [% biblio_lis.match_score %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio_lis.match_biblionumber %]">[% biblio_lis.match_citation %]</a></td>
- </tr>
- [% END %]
+ [% PROCESS match_link record=record_lis %]
[% END %]
</table>
[% IF ( pages ) %]
//<![CDATA[
$(document).ready(function(){
$("#processfile").hide();
+ $("#record_type").change(function() {
+ if ($(this).val() == 'auth') {
+ $('#items').hide();
+ } else {
+ $('#items').show();
+ }
+ });
});
function CheckForm(f) {
if ($("#fileToUpload").value == '') {
[% IF ( uploadmarc ) %]
<p>MARC staging results :</p>
<ul>
+ [% SWITCH (record_type) %]
+ [% CASE 'biblio' %]
+ <li>Processing bibliographic records</li>
+ [% CASE 'auth' %]
+ <li>Processing authority records</li>
+ [% END %]
<li>[% total %] records in file</li>
<li>[% import_errors %] records not staged because of MARC error</li>
<li>[% staged %] records staged</li>
</ul>
[% ELSE %]
<ul>
- <li>Select a MARC file to stage in the import reservoir. It will be parsed, and each valid record staged for later import into the catalog.</li>
- <li>You can enter a name for this import. It may be useful, when creating a biblio, to remember where the suggested MARC data comes from!</li>
+ <li>Select a MARC file to stage in the import reservoir. It will be parsed, and each valid record staged for later import into the catalog.</li>
+ <li>You can enter a name for this import. It may be useful, when creating a record, to remember where the suggested MARC data comes from!</li>
</ul>
<form method="post" action="[% SCRIPT_NAME %]" id="uploadfile" enctype="multipart/form-data">
<fieldset class="rows" id="uploadform">
<input type="text" id="comments" name="comments" />
</li>
+ <li>
+ <label for='record_type'>Record type:</label>
+ <select name='record_type' id='record_type'>
+ <option value='biblio' selected='selected'>Bibliographic</option>
+ <option value='auth'>Authority</option>
+ </select>
+ </li>
<li>
<label for="encoding">Character encoding: </label>
<select name="encoding" id="encoding"><option value="utf8" selected="selected">UTF-8 (Default)</option><option value="MARC-8">MARC 8</option><option value="ISO_5426">ISO 5426</option><option value="ISO_6937">ISO 6937</option><option value=ISO_8859-1">ISO 8859-1</option><option value="EUC-KR">EUC-KR</option></select>
[% END %]
</select>
</li>
- <li><label for="overlay_action">Action if matching bibliographic record found: </label>
+ <li><label for="overlay_action">Action if matching record found: </label>
[% INCLUDE 'tools-overlay-action.inc' %]
</li>
<li><label for="nomatch_action">Action if no match is found: </label>
</li>
</ol>
</fieldset>
- <fieldset class="rows">
+ <fieldset class="rows" id="items">
<legend>Check for embedded item record data?</legend>
<ol>
<li class="radio">
<xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
<xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
<xsl:variable name="biblionumber" select="marc:datafield[@tag=999]/marc:subfield[@code='c']"/>
- <xsl:variable name="materialTypeCode">
+ <xsl:variable name="typeOf008">
+ <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
<xsl:choose>
<xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
<xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
</xsl:when>
</xsl:choose>
</xsl:variable>
- <xsl:variable name="materialTypeLabel">
- <xsl:choose>
- <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Bok</xsl:when>
- <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">Film og video</xsl:when>
- <xsl:when test="$field019b='c' or $field019b='d' or contains($field019b,'da') or contains($field019b,'db') or contains($field019b,'dc') or contains($field019b,'dd') or contains($field019b,'dg') or contains($field019b,'dh') or contains($field019b,'di') or contains($field019b,'dj') or contains($field019b,'dk') or $leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Musikalier</xsl:when>
- <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kart</xsl:when>
- <xsl:when test="$field019b='f' or $field019b='i' or contains($field019b,'ib') or contains($field019b,'ic') or contains($field019b,'fd') or contains($field019b,'ff') or contains($field019b,'fi') or $leader6='k'">Grafisk materiale</xsl:when>
- <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
- <xsl:when test="$leader6='o'">Kombidokument</xsl:when>
- <xsl:when test="$field019b='h' or $leader6='r'">Tredimensjonal gjenstand</xsl:when>
- <xsl:when test="$field019b='j' or $leader6='a'">
- <xsl:choose>
- <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Bok</xsl:when>
- <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Periodikum</xsl:when>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
-
- </xsl:variable>
<!-- Tittel og ansvarsopplysninger -->
<xsl:if test="marc:datafield[@tag=245]">
</xsl:choose>
- <xsl:if test="$materialTypeCode!=''">
- <span class="results_summary"><span class="label">Materialtype: </span>
- <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
- <xsl:value-of select="$materialTypeLabel"/>
+ <xsl:if test="$typeOf008!=''">
+ <span class="results_summary">
+ <span class="label">Materialtype: </span>
+ <xsl:choose>
+ <xsl:when test="$typeOf008='Mon'"><img src="/intranet-tmpl/prog/img/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+ <xsl:when test="$typeOf008='Per'"><img src="/intranet-tmpl/prog/img/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+ <xsl:when test="$typeOf008='Fil'"><img src="/intranet-tmpl/prog/img/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+ <xsl:when test="$typeOf008='Kar'"><img src="/intranet-tmpl/prog/img/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+ <xsl:when test="$typeOf008='FV'"><img src="/intranet-tmpl/prog/img/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+ <xsl:when test="$typeOf008='Mus'"><img src="/intranet-tmpl/prog/img/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+ <xsl:when test="$typeOf008='gra'"><img src="/intranet-tmpl/prog/img/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+ <xsl:when test="$typeOf008='kom'"><img src="/intranet-tmpl/prog/img/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+ <xsl:when test="$typeOf008='trd'"><img src="/intranet-tmpl/prog/img/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
+ </xsl:choose>
</span>
</xsl:if>
<xsl:variable name="controlField007-01" select="substring($controlField007,2,1)"/>
<xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
<xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
-
<xsl:variable name="typeOf008">
- <!-- Codes with upper case first letter below are from the NORMARC standard, lower case first letter are made up. -->
+ <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
<xsl:choose>
<xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
<xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
<span class="results_summary">
<xsl:if test="$typeOf008!=''">
- <span class="label">Type: </span>
-
+ <span class="label">Materialtype: </span>
<xsl:choose>
- <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="Bok" title="Bok"/> Bok</xsl:when>
- <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/prog/famfamfam/silk/newspaper.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
- <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/prog/famfamfam/silk/computer_link.png" alt="Fil" title="Fil"/> Fil</xsl:when>
- <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/prog/famfamfam/silk/map.png" alt="Kart" title="Kart"/> Kart</xsl:when>
- <xsl:when test="$typeOf008='FV'"><img src="/opac-tmpl/prog/famfamfam/silk/film.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
- <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
- <xsl:when test="$typeOf008='gra'"> Grafisk materiale</xsl:when>
- <xsl:when test="$typeOf008='kom'"> Kombidokumenter</xsl:when>
- <xsl:when test="$typeOf008='trd'"> Tre-dimensjonale gjenstander</xsl:when>
+ <xsl:when test="$typeOf008='Mon'"><img src="/intranet-tmpl/prog/img/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+ <xsl:when test="$typeOf008='Per'"><img src="/intranet-tmpl/prog/img/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+ <xsl:when test="$typeOf008='Fil'"><img src="/intranet-tmpl/prog/img/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+ <xsl:when test="$typeOf008='Kar'"><img src="/intranet-tmpl/prog/img/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+ <xsl:when test="$typeOf008='FV'"><img src="/intranet-tmpl/prog/img/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+ <xsl:when test="$typeOf008='Mus'"><img src="/intranet-tmpl/prog/img/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+ <xsl:when test="$typeOf008='gra'"><img src="/intranet-tmpl/prog/img/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+ <xsl:when test="$typeOf008='kom'"><img src="/intranet-tmpl/prog/img/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+ <xsl:when test="$typeOf008='trd'"><img src="/intranet-tmpl/prog/img/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="string-length(normalize-space($physicalDescription))">
--- /dev/null
+/* ## 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;
+}
--- /dev/null
+/* ================================
+ * !Main
+ * ================================*/
+
+div.clear {
+ clear: both;
+}
+
+body {
+ min-width:1000px;
+ font-family: "Lucida Grande", Arial;
+ padding:0;
+ background-color : #eaeae6;
+}
+
+#container {
+ background: #fff;
+ border:1px solid #d2d2cf;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+ margin:0 20px;
+ padding: 10px;
+ overflow: hidden;
+}
+
+a:link,
+a:visited {
+ color: #007fae;
+}
+a:hover {
+ color: #00a5e2;
+}
+
+#container #ctn_lt {
+ padding-left: 15px;
+}
+
+#opacnav {
+ width:240px;
+}
+
+#opacmainuserblock, #news {
+ margin-left:7em;
+}
+
+/* ================================
+ * !Header
+ * ================================*/
+
+#header-wrapper {
+ background: none;
+}
+
+#opac-main-search {
+ background: none;
+ border: none;
+ display: table;
+ margin: 40px 0 0 !important;
+ padding: 0.7em 0 0 0.5em;
+ width: 100%;
+}
+*:first-child+html #opac-main-search {
+ display: block;
+}
+#opac-main-search a.logo {
+ display: table-cell;
+ padding: 8px 0 0 13px;
+ vertical-align: top;
+ width: 145px;
+}
+
+#opac-main-search #fluid {
+ display: table-cell;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ vertical-align: top;
+}
+
+#opac-main-search div#libraryname {
+ display: table-cell;
+ float: none;
+ vertical-align: top;
+ overflow: hidden;
+ text-align: center;
+ padding: 0 11px 17px;
+ width: 128px;
+}
+
+/* IE 7 Hack */
+*:first-child+html #opac-main-search a.logo,
+*:first-child+html #opac-main-search #fluid,
+*:first-child+html #opac-main-search div#libraryname {
+ display: block;
+ float: left;
+ height: 100px;
+}
+*:first-child+html #opac-main-search #fluid {
+ width: 800px;
+}
+#opac-main-search div#libraryname h1 {
+ background-repeat: no-repeat;
+ background-position: 0 0;
+ display: block;
+ margin: 0;
+ position: relative;
+}
+#opac-main-search div#libraryname h1 img {
+ display: block;
+ margin: 0 0 7px;
+ max-height: 80px;
+}
+
+#opac-main-search div#libraryname span#official-website {
+ background: url("../../images/arrow-right-grey-logo.png") no-repeat scroll 0 50%;
+ font: 11px/14px Arial;
+ padding: 0 0 0 10px;
+}
+#opac-main-search div#libraryname span#official-website a {
+ color: #696965;
+ text-decoration: none;
+}
+#opac-main-search div#libraryname span#official-website a:hover {
+ text-decoration: underline;
+}
+
+
+/* search form */
+
+form#searchform {
+ background: #a7a7a2 url("../../images/bg-search-bar.png") repeat-x scroll 0 0;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+ display: block;
+ padding: 12px 10px;
+ position: relative;
+}
+
+form#searchform label {
+ display: none;
+}
+
+form.single-library .input-wrapper {
+ margin: 0 237px 0 0;
+}
+form.multi-libraries .input-wrapper {
+ margin: 0 416px 0 0;
+}
+form#searchform .input-wrapper input[type="text"] {
+ background: #fff;
+ border: 1px solid #A0A09A;
+ -webkit-border-radius: 8px;
+ -moz-border-radius: 8px;
+ border-radius: 8px;
+ color: #868684;
+ font-size: 12px !important;
+ padding: 8px 8px 9px;
+ width: 100% !important;
+}
+
+form#searchform select {
+ left: -9999em;
+ position: absolute;
+}
+
+form.multi-libraries #filters .jqTransformSelectWrapper {
+ position: absolute;
+ right: 229px;
+ top: 12px;
+}
+
+form.single-library #filters .jqTransformSelectWrapper,
+form.multi-libraries #libraries .jqTransformSelectWrapper {
+ position: absolute;
+ right: 50px;
+ top: 12px;
+}
+
+form#searchform input[type="submit"] {
+ background: #619bb5 url("../../images/btn-search-bar.png") no-repeat 50% 50%;
+ border: 1px solid #adadaa;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ color: #fff;
+ cursor: pointer;
+ font-size: 0;
+ font-weight: normal;
+ height: 33px;
+ margin-left: 4px;
+ margin-top: 0;
+ padding: 0;
+ position: absolute;
+ right: 10px;
+ top: 12px;
+ width: 34px;
+}
+
+#moresearches {
+ margin: 7px 10px 0;
+}
+#moresearches a:link,
+#moresearches a:visited {
+ background: url("../../images/arrow-right-grey-11x6.png") no-repeat scroll left center transparent;
+ color: #007fae;
+ font-size: 12px;
+ font-weight: normal;
+ margin-right: 12px;
+ padding-left: 12px;
+ text-decoration: none;
+}
+#moresearches a:hover {
+ color: #00a5e2;
+}
+
+#moresearches span.pipe {
+ display: none;
+}
+
+.transparent {
+ zoom: 1;
+ filter: alpha(opacity=50);
+ opacity: 0.5;
+}
+
+div#top-bar {
+ z-index: 9999999;
+ position: fixed;
+ top:0;
+ left:0;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 29px;
+ background: #454543 url("../../images/img_bg_header.png") repeat-x 0 0;
+}
+
+
+ul#menu-left {
+ margin: 0 0 0 30px;
+ padding: 0;
+ display: block;
+ float: left;
+ width: auto;
+ height: 29px;
+}
+ul#menu-left li {
+ margin: 0;
+ padding: 0 8px 0 10px;
+ float: left;
+ height: 29px;
+ list-style-type: none;
+ background: url("../../images/img_sep_header.png") no-repeat left top;
+}
+ul#menu-left li#listsmenulink {
+ padding: 1px 0 0 12px;
+ border: none;
+}
+ul#menu-left #listsmenulink:hover {
+ background: url("../../images/img_sep_header.png") no-repeat left top !important;
+}
+ul#menu-left li a#cartmenulink,
+ul#menu-left li#listsmenulink a {
+ margin: 2px 0 0 0;
+ color: #9EE1FF;
+ font-family: Arial;
+ font-size: 13px;
+ font-weight: bold;
+ text-decoration: none;
+ border: none;
+}
+ul#menu-left li a#cartmenulink:hover,
+ul#menu-left li#listsmenulink a:hover {
+ color: #9EE1FF;
+}
+
+ul#menu-left li#listsmenulink a {
+ padding: 2px 0 0;
+}
+
+ul#menu-left li a#cartmenulink span,
+ul#menu-left li#listsmenulink a span {
+ margin: 0;
+ padding: 0;
+}
+ul#menu-left li a#cartmenulink span#basketcount {
+ margin: 0 0 0 5px;
+ padding: 0;
+ background: none;
+}
+ul#menu-left li a#cartmenulink span img,
+ul#menu-left li#listsmenulink a span img {
+ display: none;
+}
+
+ul#menu-left li a#cartmenulink {
+ padding: 0 0 0 30px;
+ background: url("../../images/img_toolbar-button-cart.png") no-repeat left center;
+}
+ul#menu-left li#listsmenulink a {
+ padding: 0 0 0 20px;
+ background: url("../../images/img_toolbar-button-lists.png") no-repeat left center;
+}
+
+div#cartDetails,
+div#listsmenu {
+ z-index: 9999999;
+ top: 29px !important;
+ margin: 0;
+ padding: 10px !important;
+ background: #649EB8;
+ border-left: 1px solid #A0A09A !important;
+ border-right: 1px solid #A0A09A !important;
+ border-bottom: 1px solid #A0A09A !important;
+ -webkit-border-radius: 0 0 7px 7px;
+ -moz-border-radius: 0 0 7px 7px;
+ border-radius: 0 0 7px 7px;
+}
+div#cartDetails {
+ margin-left: -9px;
+}
+
+
+#members {
+ background: none;
+ margin: 0;
+ padding: 0;
+ float: right;
+}
+#members ul {
+ margin: 0;
+ margin-right: 20px;
+ float: right;
+}
+#members li {
+ background: none;
+ margin:0;
+ float: left;
+ border-right: none;
+}
+#members ul li a {
+ background: url("../../images/img_sep_header.png") no-repeat scroll right top transparent;
+ color: #9EE1FF;
+ display: block;
+ font-family: Arial;
+ font-size: 13px;
+ height: 22px;
+ padding: 7px 14px 0 3px;
+ text-decoration: none;
+}
+
+#members li span.members {
+ color:#fff;
+ padding:7px 14px 0 9px;
+ float: left;
+ background: url(../../images/img_sep_header.png) no-repeat right top;
+ height: 22px;
+}
+
+#members li span.members a {
+ display:inline;
+ background: none;
+ padding: 0;
+}
+
+#members li a {
+ padding:7px 14px 0 9px;
+}
+
+#members li a.logout {
+ color:#ff825b;
+ font-weight: normal;
+ padding:7px 14px 0 9px;
+}
+
+div#listsmenu {
+ margin-left: 1px;
+}
+div#listsmenu h4 {
+ margin: 0 !important;
+ color: #fff;
+}
+div#listsmenu ul li {
+ margin: 0 !important;
+ padding: 0 !important;
+ height: auto !important;
+ background: none !important;
+}
+div#listsmenu ul li {
+ float: none !important;
+ margin: 0 !important;
+ padding: 0 !important;
+ list-style-type: none !important;
+ background: none !important;
+}
+div#listsmenu a {
+ margin: 0 !important;
+ padding: 0 !important;
+ color: #fff !important;
+ font-weight: normal !important;
+ text-decoration: none;
+ background: none !important;
+}
+div#listsmenu a:hover {
+ text-decoration: underline;
+}
+
+#cartDetails,#cartUpdate,#holdDetails,#listsDetails {
+ background-color : #FFF;
+ border: 1px solid #739acf;
+ color : #fff;
+ display : none;
+ margin : 0;
+ padding : 10px;
+ text-align : center;
+ width : 180px;
+ box-shadow: 1px 1px 3px #666;
+ -moz-box-shadow: 1px 1px 3px #666;
+ -webkit-box-shadow: 1px 1px 3px #666;
+
+}
+
+#cartmenulink, #listsmenulink {
+ display : block;
+ position : relative;
+ background : #aaa;
+ padding : 5px;
+ float : left;
+ color : #333;
+ text-decoration : none;
+ cursor : pointer;
+}
+
+#cartmenulink {
+ background : #98CB58;
+ color : #336600;
+ font-size : 105%;
+}
+
+#cartmenulink[class], #listsmenulink[class] {
+ background-image : ;
+ background-position : ;
+}
+
+#cartmenulink span, #listsmenulink span {
+ padding : 0 0 5px 10px;
+ background-position:;
+ left:;
+ margin-bottom:;
+}
+
+#cartmenulink *, #listsmenulink * {
+ background-image : none;
+}
+
+#cartmenulink span#basketcount span {
+ color:#fff;
+ margin:0 0 0 5px;
+ padding:0;
+ background:none;
+ font-size:15px;
+ font-weight:bold;
+}
+
+
+/* ================================
+ * !jQtransform
+ * ================================*/
+
+.jqTransformSelectWrapper {
+ background: none repeat scroll 0 0 #FFFFFF;
+ border: 1px solid #A0A09A;
+ border-radius: 8px 8px 8px 8px;
+ color: #252525;
+ font-family: Arial,Helvetica,sans-serif;
+ font-size: 13px;
+ float: left;
+ margin-left: 5px;
+ padding: 0;
+ position: relative;
+ width: 171px !important;
+}
+.jqTransformSelectWrapper div {
+ height: 19px;
+ padding: 9px 5px 4px;
+ text-indent: 4px;
+}
+.jqTransformSelectWrapper div span {
+ cursor: pointer;
+ float: left;
+}
+
+.jqTransformSelectWrapper div a {
+ background: url("../../images/img_select-puce.png") no-repeat scroll 0 50% transparent;
+ display: block;
+ height: 26px;
+ outline: medium none;
+ position: absolute;
+ right: 3px;
+ top: 3px;
+ width: 25px;
+}
+
+.jqTransformSelectWrapper ul {
+ background: none repeat scroll 0 0 #FFFFFF;
+ border: 1px solid #A0A09A;
+ -webkit-border-radius: 7px;
+ -moz-border-radius: 7px;
+ border-radius: 7px;
+ height: auto !important;
+ padding: 5px 0 !important;
+ position: absolute;
+ width: 100% !important;
+}
+.jqTransformSelectWrapper ul li {
+ background: none repeat scroll 0 0 transparent !important;
+ list-style: none outside none !important;
+ margin: 0 !important;
+ padding: 0 5px !important;
+}
+.jqTransformSelectWrapper ul li a {
+ color: #252525 !important;
+ display: block;
+ font-family: Arial,Helvetica,sans-serif;
+ font-size: 13px;
+ font-weight: normal;
+ padding-left: 5px;
+ text-decoration: none;
+}
+.jqTransformSelectWrapper ul li a:hover {
+ background: none repeat scroll 0 0 #F5F5F4;
+}
+
+
+/* ================================
+ * !Footer
+ * ================================*/
+
+#main_footer {
+ padding:0 30px;
+ font-family:"Lucida Grande", Arial;
+ margin-bottom: 65px;
+}
+
+#main_footer .colleft {
+ float:left;
+ margin-top:8px;
+}
+
+#main_footer .colleft ul {
+ padding:0;
+}
+
+#main_footer .colleft li {
+ display:inline;
+ list-style:none;
+}
+
+#main_footer .colleft li.first {
+ background:url(../../images/img_sep_footer.png) no-repeat right top;
+ padding-right: 8px;
+ margin-right: 10px;
+}
+
+#main_footer .colleft li a {
+ color:#4f91b0;
+ text-decoration:none;
+ font-size:14px;
+ font-weight: normal;
+}
+#main_footer .colleft li a:hover {
+ color:#00a5e2;
+}
+
+#main_footer .colleft .copy {
+ font-size:12px;
+ color:#5f5f5f;
+ margin-top:10px;
+}
+
+#main_footer .colright {
+ float:right;
+ width: auto;
+}
+
+#main_footer .colright .koha {
+ float:left;
+ background: url(../../images/img_logo_koha.jpg) no-repeat bottom right;
+ width: 168px;
+ height: 40px;
+}
+#main_footer .colright .koha a {
+ display:block;
+ padding:0;
+ width: 168px;
+ height: 40px;
+ color:#5f5f5f;
+ text-decoration: none;
+ font-weight: normal;
+}
+
+div#changelanguage {
+ padding-bottom: 2em;
+}
+
+
+/* ================================
+ * !Page : Search results
+ * ================================*/
+
+/* breacrumbs */
+
+body#results #breadcrumbs {
+ margin: -1px 0 17px 2px;
+ padding: 0;
+}
+body#results #breadcrumbs p {
+ font: normal 11px/11px Arial;
+ margin: 0;
+ padding: 0;
+}
+body#results #breadcrumbs p a {
+ color: #007fae;
+ display: inline;
+ text-decoration: none;
+}
+body#results #breadcrumbs p a:hover {
+ color: #00a5e2;
+}
+
+body#results #breadcrumbs p a img {
+ vertical-align: middle;
+}
+
+body#results #breadcrumbs p .rsaquo {
+ color: #8d8d89;
+ font-size: 20px;
+ line-height: 11px;
+ vertical-align: sub;
+}
+
+/* IE7 Hack */
+*:first-child+html body#results #breadcrumbs p span {
+ display: inline;
+ font-size: 11px;
+ font-weight: bold;
+ vertical-align: top;
+}
+
+body#results #breadcrumbs p strong {
+ color: #5f5f5f;
+}
+
+.nb_results {
+ font-weight: bold;
+}
+
+/* search-facets */
+
+body#results #search-facets {
+ border: none;
+}
+body#results #search-facets h4 {
+ background: none;
+ border-bottom: 1px solid #E8E8E8;
+ font-size: 90%;
+ margin: 0 9px 10px 0;
+ padding: 13px 0 7px;
+ text-align: left;
+}
+
+body#results #search-facets a {
+ color: #007fae;
+}
+body#results #search-facets a:hover {
+ color: #00a5e2;
+}
+
+
+/* userresults */
+
+body#results div#userresults {
+ border-left: 1px solid #c8c8c4;
+ padding: 0 20px 0;
+}
+
+
+/* searchresults */
+
+body#results tr {
+ border: none;
+}
+body#results tr td {
+ background: #fff url("../../images/bg-result-light.png") repeat-x 0 0;
+ border-top: 1px solid #c8c8c4;
+ border-bottom: none;
+ height: 115px;
+ padding-top: 15px;
+}
+
+body#results .searchresults td.resultscontrol {
+ background: #ddddda url("../../images/bg-results-control.png") repeat-x 0 100%;
+ -moz-border-radius-topleft: 6px;
+ -moz-border-radius-topright: 6px;
+ -moz-border-radius-bottomright: 0px;
+ -moz-border-radius-bottomleft: 0px;
+ -webkit-border-radius: 6px 6px 0px 0px;
+ border-radius: 6px 6px 0px 0px;
+ border: none;
+ border-bottom: 1px solid #b0b0ae;
+ padding: 2px 7px 6px;
+ height: auto;
+}
+
+
+/* Navigation */
+
+body#results a.nav:link, div.pages a:link {
+ background-color: #EEEEEE;
+ border: 1px solid #CCCC99;
+ color: #007FAE;
+ font-weight: bold;
+ padding: 1px 5px;
+ text-decoration: none;
+}
+body#results a.nav:hover, div.pages a:hover {
+ color: #00A5E2;
+}
+
+
+
+/* ================================
+ * !Page : Opac detail
+ * ================================*/
+
+body#opac-detail .nav_results ul.pg_menu {
+ display: table;
+ height: auto;
+ overflow: hidden;
+ padding: 0;
+ width: 100%;
+}
+body#opac-detail .nav_results ul.pg_menu li {
+ display: table-cell;
+ float: none;
+}
--- /dev/null
+input.search_init {
+ color: #999999;
+}
+.sorting_asc {
+ padding-right: 19px;
+ background: url("../../img/asc.gif") no-repeat scroll right center #EEEEEE;
+}
+.sorting_desc {
+ padding-right: 19px;
+ background: url("../../img/desc.gif") no-repeat scroll right center #EEEEEE;
+}
+.sorting {
+ padding-right: 19px;
+ background: url("../../img/ascdesc.gif") no-repeat scroll right center #EEEEEE;
+}
+.sorting_asc_disabled {
+ padding-right: 19px;
+ background: url("../../img/datatables/sort_asc_disabled.png") no-repeat scroll right center #EEEEEE;
+}
+.sorting_desc_disabled {
+ padding-right: 19px;
+ background: url("../../img/datatables/sort_desc_disabled.png") no-repeat scroll right center #EEEEEE;
+}
+.sorting_disabled {
+ padding-right: 19px;
+ background-color: #EEEEEE;
+}
+
+div.top {clear : both; }
+
+div.top.pager,
+div.bottom.pager {
+ background-color : #E5E5E5;
+ padding : 0;
+}
+
+div.bottom.pager div.dataTables_paginate.paging_full_numbers,
+div.bottom.pager div.dataTables_paginate.paging_four_button {
+ border-right-width : 0;
+}
+
+div.dataTables_filter,
+div.dataTables_length,
+div.dataTables_info,
+div.dataTables_paginate {
+ float: left;
+ padding : .3em .5em .3em .5em;
+
+}
+div.dataTables_length {
+ border-right : 1px solid #686868;
+ line-height:1.9em;
+}
+div.dataTables_info {
+ border-right : 1px solid #AAA;
+ line-height:1.9em;
+}
+div.dataTables_length,
+div.dataTables_filter {
+ border-left : 1px solid #FFF;
+}
+div.dataTables_filter {
+ line-height : 1.9em;
+}
+div.dataTables_paginate {
+ background-color : #F4F4F4;
+ font-size: 110%;
+ padding : 0;
+}
+
+.paging_full_numbers span.paginate_button,
+.paging_full_numbers span.paginate_active {
+ border-right : 1px solid #AAA;
+ border-left : 1px solid #FFF;
+ display : block;
+ float : left;
+ line-height:1.6em;
+ padding: .3em .7em;
+ cursor: pointer;
+}
+
+.paging_full_numbers span.paginate_button {
+ color : #0000CC;
+}
+.paging_full_numbers span.paginate_button.first {
+ background-image : url('../../img/first.png');
+ background-repeat: no-repeat;
+ background-position : 2px center;
+ padding-left : 2em;
+}
+.paging_full_numbers span.paginate_button.previous {
+ background-image : url('../../img/prev.png');
+ background-repeat: no-repeat;
+ background-position : 2px center;
+ padding-left : 2em;
+}
+.paging_full_numbers span.paginate_button.next {
+ background-image : url('../../img/next.png');
+ background-repeat: no-repeat;
+ background-position : right center;
+ padding-right : 2em;
+}
+.paging_full_numbers span.paginate_button.last {
+ background-image : url('../../img/last.png');
+ background-repeat: no-repeat;
+ background-position : right center;
+ border-right : 1px solid #686868;
+ padding-right : 2em;
+}
+div.bottom.pager .paging_full_numbers span.paginate_button.last {
+ border-right-width : 0;
+}
+.paging_full_numbers span.paginate_active {
+ background-color : #FFFFEA;
+ color : #000;
+ font-weight: bold;
+}
+
+.paging_full_numbers span.paginate_button:hover {
+ background-color: #FFC;
+}
+
+.paging_full_numbers span.paginate_button.paginate_button_disabled {
+ color : #666;
+}
+
+/* Two-button version */
+
+div.dataTables_paginate.paging_two_button,
+div.dataTables_paginate.paging_four_button {
+ background-color : transparent;
+ border-right : 1px solid #686868;
+ border-left : 1px solid #FFF;
+ line-height : 1.8em;
+}
+.paginate_disabled_first,
+.paginate_enabled_first,
+.paginate_disabled_previous,
+.paginate_enabled_previous,
+.paginate_disabled_next,
+.paginate_enabled_next,
+.paginate_disabled_last,
+.paginate_enabled_last {
+ float: left;
+ height: 16px;
+ margin: .5em;
+ width: 16px;
+}
+.paginate_disabled_first {
+ background-image: url("../../img/first-disabled.png");
+}
+.paginate_enabled_first {
+ background-image: url("../../img/first.png");
+ cursor: pointer;
+}
+.paginate_disabled_previous {
+ background-image: url("../../img/prev-disabled.png");
+}
+.paginate_enabled_previous {
+ background-image: url("../../img/prev.png");
+ cursor: pointer;
+}
+.paginate_disabled_next {
+ background-image: url("../../img/next-disabled.png");
+}
+.paginate_enabled_next {
+ background-image: url("../../img/next.png");
+ cursor: pointer;
+}
+.paginate_disabled_last {
+ background-image: url("../../img/last-disabled.png");
+}
+.paginate_enabled_last {
+ background-image: url("../../img/last.png");
+ cursor: pointer;
+}
+
+
+/*
+table.display {
+ width: 100%;
+}
+table.display thead th {
+ border-bottom: 1px solid black;
+ cursor: pointer;
+ font-weight: bold;
+ padding: 3px 18px 3px 10px;
+}
+.dataTables_wrapper {
+ clear: both;
+ position: relative;
+}
+.dataTables_processing {
+ background-color: white;
+ border: 1px solid #DDDDDD;
+ color: #999999;
+ font-size: 14px;
+ height: 30px;
+ left: 50%;
+ margin-left: -125px;
+ margin-top: -15px;
+ padding: 14px 0 2px;
+ position: fixed;
+ text-align: center;
+ top: 50%;
+ width: 250px;
+}
+.dataTables_info {
+ float: left;
+ width: 60%;
+}
+.dataTables_paginate {
+ float: right;
+ text-align: right;
+ width: 44px;
+}
+.paging_full_numbers {
+ height: 22px;
+ line-height: 22px;
+ width: 400px;
+}
+.paging_full_numbers span.paginate_button,
+ .paging_full_numbers span.paginate_active {
+ border: 1px solid #aaa;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ padding: 2px 5px;
+ margin: 0 3px;
+ cursor: pointer;
+ *cursor: hand;
+}
+
+.paging_full_numbers span.paginate_button {
+ background-color: #ddd;
+}
+
+.paging_full_numbers span.paginate_button:hover {
+ background-color: #ccc;
+}
+
+.paging_full_numbers span.paginate_active {
+ background-color: #99B3FF;
+}
+.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next {
+ float: left;
+ height: 19px;
+ margin-left: 3px;
+ width: 19px;
+}
+.paginate_disabled_previous {
+ background-image: url("../../img/datatables/back_disabled.jpg");
+}
+.paginate_enabled_previous {
+ background-image: url("../../img/datatables/back_enabled.jpg");
+}
+.paginate_disabled_next {
+ background-image: url("../../img/datatables/forward_disabled.jpg");
+}
+.paginate_enabled_next {
+ background-image: url("../../img/datatables/forward_enabled.jpg");
+}
+.spacer {
+ clear: both;
+ height: 20px;
+}
--- /dev/null
+.hierarchies {
+ background-color:#fff;
+ color:#000000;
+ padding:5px;
+ margin-left:50px;
+ -moz-border-radius:6px;
+ display:block;
+ font-size:10px;
+}
+.hierarchy {
+ padding:5px;
+ width:90%;
+ -moz-border-radius:6px;
+ display:block;
+}
+.child {
+ display:none;
+ margin-left : 50px;
+ width:150%;
+}
+.child a:hover{
+ background-color:#BFCFFF;
+}
+.parent {
+ display:none;
+ margin-left : -50px;
+}
+.parent a:hover{
+ background-color:#BFCFFF;
+}
+.child0{
+ width : 20%;
+ text-align : left;
+}
+.child0 a:hover{
+ background-color:#BFCFFF;
+}
+.child1{
+ width : 20%;
+ text-align : left;
+ margin-left : 50px;
+}
+.child1 a:hover{
+ background-color:#BFCFFF;
+}
+.child2{
+ width : 20%;
+ text-align : left;
+ margin-left : 100px;
+}
+.child2 a:hover{
+ background-color:#BFCFFF;
+}
+.child3{
+ width : 20%;
+ text-align : left;
+ margin-left : 150px;
+}
+.child3 a:hover{
+ background-color:#BFCFFF;
+}
+.child4{
+ width : 20%;
+ text-align : left;
+ margin-left : 200px;
+}
+.child4 a:hover{
+ background-color:#BFCFFF;
+}
+.child5{
+ width : 20%;
+ text-align : left;
+ margin-left : 250px;
+}
+.child5 a:hover{
+ background-color:#BFCFFF;
+}
+.child6{
+ width : 20%;
+ text-align : left;
+ margin-left : 300px;
+}
+.child6 a:hover{
+ background-color:#BFCFFF;
+}
+.child7{
+ width : 20%;
+ text-align : left;
+ margin-left : 350px;
+}
+.child7 a:hover{
+ background-color:#BFCFFF;
+}
+.child8{
+ width : 10%;
+ text-align : left;
+ margin-left : 400px;
+}
+.child8 a:hover{
+ background-color:#BFCFFF;
+}
+.parents{
+ display:inline;
+ cursor:crosshair;
+}
\ No newline at end of file
--- /dev/null
+/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
+div.rating-cancel,div.star-rating{float:left;width:15px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
+div.rating-cancel,div.rating-cancel a{background:url(../../images/delete.gif) no-repeat 0 -16px}
+div.star-rating,div.star-rating a{background:url(../../images/star.gif) no-repeat 0 0px}
+div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
+div.star-rating-on a{background-position:0 -32px!important}
+div.star-rating-hover a{background-position:0 -16px}
+/* Read Only CSS */
+div.star-rating-readonly a{cursor:default !important}
+/* Partial Star CSS */
+div.star-rating{background:transparent!important;overflow:hidden!important}
+/* END jQuery.Rating Plugin CSS */
--- /dev/null
+/*
+ Mobile stylesheet
+ Frédérick Capovilla, 2012 - Libéo
+*/
+
+/* Hidden elements */
+
+.mobile-hidden,
+body#opac-main #login,
+body#opac-main #login~div,
+body#opac-main #opacnav,
+body#opac-main #opacmainuserblock,
+body#opac-main #news,
+body#results #facetcontainer,
+body#opac-detail #ulactioncontainer>:not(#action),
+body#opac-detail #ulactioncontainer #action a:not(.reserve),
+body#opac-detail #shelfbrowser,
+body#opac-detail #views,
+body#opac-detail div#bibliodescriptions>ul>li:nth-of-type(n+3),
+body#results #userresults .pages:nth-of-type(1),
+body#results #userresults>br,
+body#results td.select.selectcol,
+body#results span.results_summary.actions>:not(.hold),
+body#results span.addto,
+body#results span#placehold,
+body#results span.checkall,
+body#results span.clearall,
+body#results .searchresults td.resultscontrol,
+body#advsearch form div.yui-g:nth-last-of-type(-n+4),
+body#opac-readingrecord ul.ui-tabs-nav li,
+body#opac-login-page #opac-main-search div#libraryname,
+#leftmenus>:not(#menu),
+#top-bar #menu-left,
+#members>ul>li:nth-child(2),
+#moresearches,
+#breadcrumbs>p:nth-of-type(1),
+#main_footer .colleft,
+#opac-main-search a.logo {
+ display:none !important;
+}
+
+
+/* General */
+
+body{
+ min-width: 100px;
+}
+
+#doc, #doc2, #doc3, #doc4, .yui-t1, .yui-t2, .yui-t3, .yui-t4, .yui-t5, .yui-t6, .yui-t7 {
+ min-width: 100px;
+}
+
+.yui-ge div.first, .yui-gf .yui-g, .yui-gf .yui-u{
+ width: 100%;
+}
+
+#bd:after, .yui-g:after, .yui-gb:after, .yui-gc:after, .yui-gd:after, .yui-ge:after, .yui-gf:after {
+ content: "";
+}
+
+#container{
+ border-radius: 0;
+ margin: 0;
+ padding: 0;
+ padding-bottom: 10px;
+ border: 0;
+}
+
+#container #ctn_lt {
+ padding: 0 10px;
+ padding-left: auto;
+}
+
+#doc3{
+ margin: 0;
+ width: 100%;
+}
+
+#opac-main-search {
+ margin: 0 !important;
+ padding: 0;
+}
+
+#main_footer{
+ margin-bottom: 0;
+}
+
+#yui-main .yui-b {
+ margin: 0 !important;
+}
+
+#breadcrumbs{
+ margin: 0 !important;
+ padding: 0 !important;
+}
+
+body#results #breadcrumbs>*{
+ padding: 20px !important;
+}
+
+
+/* Main */
+
+body#opac-main #container #ctn_lt{
+ padding: 15px;
+}
+
+body#opac-main #opacmainuserblockmobile {
+ display: block;
+}
+
+
+
+/* Results */
+
+body#results div#userresults {
+ padding: 0;
+ border: 0;
+}
+
+body#results .yui-t1 #yui-main .yui-b {
+ margin: 0;
+}
+
+body#results #container #ctn_lt{
+ padding: 0;
+}
+
+body#results .searchresults td.resultscontrol{
+ border-radius: 0;
+}
+
+body#results .searchresults .resort{
+ width: 50%;
+ float:right;
+}
+
+body#results .searchresults #sort_by{
+ width: 100%;
+}
+
+body#results .searchresults .cartlist{
+ width:50%;
+}
+
+body#results .results_summary.actions .hold {
+ font-size: 140%;
+ font-weight: bold;
+ margin-left: 0;
+}
+
+
+/* Cancel highlighting */
+
+a .term {
+ text-decoration: inherit;
+}
+
+.term {
+ background-color: inherit;
+ color: inherit;
+}
+
+
+/* Details */
+
+body#opac-detail #ctn_lt,
+body#opac-marcdetail #ctn_lt,
+body#opac-isbddetail #ctn_lt{
+ margin: 10px;
+ padding: 0;
+}
+
+body#opac-detail #opac-detail-yui-ge {
+ padding-top: 15px;
+}
+
+#views>span {
+ display:block;
+}
+
+body#opac-detail #ulactioncontainer{
+ position: absolute;
+ top: 0;
+ right: 0;
+}
+
+body#opac-detail #container {
+ position: relative;
+}
+
+body#opac-detail #ulactioncontainer ul{
+ margin-top: 0;
+ padding: 5px;
+}
+
+body#opac-detail #ulactioncontainer li{
+ margin: 0;
+ padding: 0;
+}
+
+/* Logo in the footer */
+
+#opac-main-search div#libraryname {
+ display: block;
+ position: absolute;
+ bottom: -116px;
+ left: 0;
+ padding: 0 20px;
+}
+
+#opac-main-search div#libraryname img {
+ display: block;
+}
+
+#doc3{
+ position: relative;
+}
+
+#main_footer {
+ padding-top: 29px;
+}
+
+#main_footer .colright,
+#main_footer .colleft{
+ float: none;
+}
+
+#main_footer .colright .koha{
+ float: right;
+ overflow: hidden;
+ text-indent: -5000em;
+ width: 92px;
+ height: 80px;
+ background-position: center;
+}
+
+
+/* Login bar */
+
+div#top-bar {
+ display: block;
+ position: absolute;
+ left: 0;
+ bottom: -29px;
+ top: auto;
+ overflow: hidden;
+ z-index: auto;
+}
+
+#members ul{
+ margin: 0;
+}
+
+
+/* Search bar */
+
+form#searchform {
+ border-radius: 0;
+ padding-top: 50px;
+}
+
+form#searchform #filters .jqTransformSelectWrapper,
+form#searchform #libraries .jqTransformSelectWrapper {
+ position: relative;
+ left: 0;
+ top: 0;
+ border-radius: 3px;
+}
+
+form.multi-libraries #filters .jqTransformSelectWrapper{
+ width: 49% !important;
+ float: left;
+}
+
+form.multi-libraries #libraries .jqTransformSelectWrapper{
+ width: 49% !important;
+ float: right;
+}
+
+form.single-library #filters .jqTransformSelectWrapper,
+form.multi-libraries.single-field-mobile #filters .jqTransformSelectWrapper,
+form.multi-libraries.single-field-mobile #libraries .jqTransformSelectWrapper{
+ width: 100% !important;
+ float:left;
+}
+
+form.multi-libraries .input-wrapper{
+ margin: 0;
+}
+
+form#searchform .input-wrapper input[type="text"]{
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ border-radius: 3px;
+}
+
+form#searchform .input-wrapper{
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+ position: absolute;
+ top: 15px;
+ left: 0;
+ width: 100%;
+ padding: 0 10px;
+ padding-right: 46px;
+}
+
+form#searchform input[type="submit"]{
+ position: absolute;
+ border-radius: 0;
+ top: 15px;
+ right: 10px;
+}
+
+.jqTransformSelectWrapper{
+ margin: 0;
+}
+
+.jqTransformSelectWrapper div{
+ overflow: hidden;
+}
+
+.jqTransformSelectWrapper div span{
+ white-space:nowrap;
+}
+
+.jqTransformSelectWrapper div a{
+ border-left: 5px solid #FFF;
+ border-right: 5px solid #FFF;
+ background-color: white;
+ box-shadow: -3px 0 5px #FFF;
+ right: 0px;
+ border-radius: 8px;
+}
+
+.jqTransformSelectWrapper ul li a{
+ padding: 10px 0;
+}
+
+#opac-main-search #fluid {
+ display: block;
+}
+
+
+/* Login screen */
+
+#holds, #opac-auth {
+ min-width: 0;
+ width: auto;
+}
+
+
+/* User */
+
+body#opac-user .yui-b,
+body#opac-passwd .yui-b,
+body#opac-search-history .yui-b,
+body#opac-readingrecord .yui-b,
+body#opac-userupdate .yui-b,
+body#opac-account .yui-b{
+ width: auto;
+ float: none;
+}
+
+body#opac-user #yui-main ,
+body#opac-passwd #yui-main ,
+body#opac-search-history #yui-main ,
+body#opac-readingrecord #yui-main ,
+body#opac-userupdate #yui-main ,
+body#opac-account #yui-main {
+ float: none;
+ margin: 0;
+}
+
+body#opac-userupdate .yui-g .yui-u{
+ width: 100%;
+}
+
+body#opac-passwd fieldset,
+body#opac-userupdate fieldset{
+ margin: 1em 0;
+}
+
+.renewals {
+ display: inline;
+}
+
+
+/* Tables */
+
+body#opac-user #checkoutst td.links,
+body#opac-user thead,
+body#opac-holds div:not(.calendar) table>tbody>tr:nth-child(1),
+body#opac-readingrecord #readingrec tr:nth-child(1),
+body#opac-detail #holdingst thead,
+body#opac-detail #holdingst td.call_no a{
+ display: none !important;
+}
+
+body#opac-detail table#holdingst,
+body#opac-readingrecord table,
+body#opac-holds div:not(.calendar) table,
+body#opac-user table#holdst,
+body#opac-user table#checkoutst{
+ border-right: none;
+ border-top: none;
+ border: none;
+ counter-reset: item;
+}
+
+body#opac-detail #holdingst tr,
+body#opac-readingrecord tr,
+body#opac-holds div:not(.calendar) tr,
+body#opac-user #holdst tr,
+body#opac-user #checkoutst tr{
+ border: none;
+ display: block;
+ position: relative;
+ margin-left: 10px;
+ margin-bottom: 10px;
+}
+
+body#opac-detail #holdingst td,
+body#opac-readingrecord td,
+body#opac-holds div:not(.calendar) td,
+body#opac-user #holdst td,
+body#opac-user #checkoutst td{
+ display: block;
+ border: 1px solid #DDD;
+ position: relative;
+}
+
+body#opac-user #checkoutst caption {
+ display: block;
+}
+
+body#opac-detail #holdingst tr:before,
+body#opac-readingrecord tr:before,
+body#opac-holds div:not(.calendar) tr:not(.copiesrow):before,
+body#opac-user #holdst tr:before,
+body#opac-user #checkoutst tr:before {
+ font-weight: bold;
+ content: counter(item) ". ";
+ counter-increment: item;
+ display: block;
+ position: absolute;
+ left: -13px;
+ top: 4px;
+}
+
+body#opac-detail #holdingst td:before,
+body#opac-readingrecord td:before,
+body#opac-holds div:not(.calendar) td:before,
+body#opac-user #holdst td:before,
+body#opac-user #checkoutst td:before {
+ font-weight: bold;
+}
+
+body#opac-detail #holdingst td.itype:before {content: "Item type : ";}
+body#opac-detail #holdingst td.location:before {content: "Location : ";}
+body#opac-detail #holdingst td.collection:before {content: "Collection : ";}
+body#opac-detail #holdingst td.call_no:before {content: "Call Number : ";}
+body#opac-detail #holdingst td.vol_info:before {content: "Vol Info : ";}
+body#opac-detail #holdingst td.url:before {content: "URL : ";}
+body#opac-detail #holdingst td.copynumber:before {content: "Copy Number : ";}
+body#opac-detail #holdingst td.status:before {content: "Status : ";}
+body#opac-detail #holdingst td.notes:before {content: "Notes : ";}
+body#opac-detail #holdingst td.date_due:before {content: "Date Due : ";}
+body#opac-detail #holdingst td.barcode:before {content: "Barcode : ";}
+body#opac-detail #holdingst td.holds_count:before {content: "Item holds : ";}
+
+body#opac-user #checkoutst td.date_due:before {content: "Date due : ";}
+body#opac-user #checkoutst td.call_no:before {content: "Call No. : ";}
+body#opac-user #checkoutst td.fines:before {content: "Fines : ";}
+
+body#opac-user #holdst td.reservedate:before {content: "Placed On : ";}
+body#opac-user #holdst td.expirationdate:before {content: "Expires On : ";}
+body#opac-user #holdst td.branch:before {content: "Pick Up Location : ";}
+body#opac-user #holdst td.priority:before {content: "Priority : ";}
+body#opac-user #holdst td.status:before {content: "Status : ";}
+
+body#opac-readingrecord #readingrec td:nth-child(3):before {content: "Item Type : ";}
+body#opac-readingrecord #readingrec td:nth-child(4):before {content: "Call No. : ";}
+body#opac-readingrecord #readingrec td:nth-child(5):before {content: "Date : ";}
+
+body#opac-holds #bibitemloop>tbody>tr:not(.copiesrow) td.hold:before {content: "Hold : ";}
+body#opac-holds #bibitemloop>tbody>tr:not(.copiesrow) td.itype:before {content: "Item Type : ";}
+body#opac-holds #bibitemloop>tbody>tr:not(.copiesrow) td.priority:before {content: "Priority : ";}
+body#opac-holds #bibitemloop>tbody>tr:not(.copiesrow) td.reserve_date:before {content: "Hold Starts On Date : ";}
+body#opac-holds #bibitemloop>tbody>tr:not(.copiesrow) td.expiration_date:before {content: "Hold Not Needed After : ";}
+body#opac-holds #bibitemloop>tbody>tr:not(.copiesrow) td.place_on_type:before {content: "Place On : ";}
+body#opac-holds #bibitemloop>tbody>tr:not(.copiesrow) td.branch:before {content: "Pickup Location : ";}
+
+body#opac-holds #bibitemloop table td.copy:before {content: "Copy : ";}
+body#opac-holds #bibitemloop table td.itype:before {content: "Item Type : ";}
+body#opac-holds #bibitemloop table td.barcode:before {content: "Barcode : ";}
+body#opac-holds #bibitemloop table td.homebranch:before {content: "Home Library : ";}
+body#opac-holds #bibitemloop table td.holdingbranch:before {content: "Last Location : ";}
+body#opac-holds #bibitemloop table td.call_no:before {content: "Call Number : ";}
+body#opac-holds #bibitemloop table td.vol_info:before {content: "Vol Info : ";}
+body#opac-holds #bibitemloop table td.information:before {content: "Information : ";}
+
+
+/* Holds */
+
+body#opac-holds tr.copiesrow {
+ margin-left: 25px;
+}
+
+body#opac-holds tr.copiesrow>td:nth-child(1) {
+ display: none;
+}
+
+body#opac-holds #bibitemloop tr {
+ margin-bottom: 0;
+}
+
+
+/* User Fines table */
+
+body#opac-account #useraccount th:nth-child(3),
+body#opac-account #useraccount td:nth-child(3) {
+ display: none !important;
+}
+
+body#opac-account #useraccount table {
+ position: relative;
+ margin-bottom: 50px;
+}
+
+body#opac-account #useraccount tfoot {
+ display: block;
+ position: absolute;
+ bottom: 0;
+ right: 0;
+ bottom: -23px;
+}
+
+body#opac-account #useraccount thead th {
+ padding: 2px 10px;
+}
+
+body#opac-account #useraccount tbody td:nth-child(1) {
+ min-width: 70px;
+}
+
+body#opac-account #useraccount tbody td:nth-child(4) {
+ text-align: right;
+}
+
+body#opac-account #useraccount tfoot th {
+ display: none;
+}
+
+body#opac-account #useraccount tfoot td {
+ border-right: 1px solid #DDD;
+}
+
+body#opac-account #useraccount tfoot td:before {
+ content: "Total due : "
+}
+
+
+/* User menu */
+
+#leftmenus>#menu ul li.messaging,
+#leftmenus>#menu ul li.suggestions,
+#leftmenus>#menu ul li.privateshelves,
+#leftmenus>#menu {
+ display: none;
+}
+
+.mobile_only {
+ display: block;
+}
+
+body.mobile_menu form#searchform .input-wrapper{
+ padding-left: 90px;
+}
+
+body.mobile_menu_opened #doc3>div,
+body.mobile_menu_opened #main_footer>div {
+ position: relative;
+ left: 200px;
+}
+
+body.mobile_menu_opened #main_footer {
+ display: none;
+}
+
+body.mobile_menu_opened #doc3 {
+ overflow: hidden;
+ min-height: 380px;
+}
+
+body.mobile_menu_opened #ctn_rb>.ctn_in>.yui-b {
+ position: static;
+}
+
+body.mobile_menu_opened #leftmenus>#menu {
+ display: block;
+ position: absolute;
+ width: 200px;
+ height: 100%;
+ top: 0;
+ left: -201px;
+ padding: 0;
+ z-index: 999;
+}
+
+#mobile_menu_button {
+ position: absolute;
+ cursor: pointer;
+ background: url(../../images/mobile-menu-button.png) no-repeat scroll 50% 50%;
+ border: 0px;
+ font-size: 0;
+ width: 76px;
+ height: 38px;
+ top: 13px;
+ left: 6px;
+}
--- /dev/null
+@import url("../../../lib/yui/reset-fonts-grids.css");
+@import url("../../../lib/yui/skin.css");
+
+a {
+ font-weight : bold;
+}
+
+a,
+a:visited,
+.ui-widget-content a,
+.ui-widget-content a:visited {
+ color : #006699;
+}
+
+a:hover,#toolbar input.editshelf:hover,input.editshelf:hover,a.editshelf:hover,input.deleteshelf:hover {
+ color : #990033;
+}
+
+a.disabled {
+ color : #888888 !important;
+}
+
+body {
+ background-color : white;
+ text-align : left;
+ padding : 0 0 2.5em 0;
+}
+
+.required {
+ color : #C00;
+}
+
+caption {
+ font-size : 140%;
+ font-weight : bold;
+ line-height : 144%;
+ text-align : left;
+}
+
+fieldset {
+ background-color: #FFF;
+ border : 2px solid #EEEEEE;
+ margin : 1em 1em 1em 0;
+ padding : 1em;
+}
+
+fieldset.rows {
+ border-width : 1px;
+ border-bottom : 1px solid black;
+ float : left;
+ font-size : 90%;
+ clear : left;
+ margin: .9em 0 0 0;
+ padding: 0;
+ width: 100%;
+}
+
+fieldset.rows legend {
+ margin-left: 1em;
+ font-weight: bold;
+ font-size : 110%;
+}
+
+fieldset.rows label, fieldset.rows span.label {
+ float: left;
+ font-weight : bold;
+ width: 9em;
+ margin-right: 1em;
+ text-align: right;
+}
+
+fieldset.rows fieldset {
+ border-width : 1px;
+ margin : 0;
+ padding : .3em;
+}
+
+fieldset.rows ol {
+ padding: 1em 1em 0 1em;
+ list-style-type: none;
+}
+
+fieldset.rows li {
+ float : left;
+ clear : left;
+ padding-bottom: 1em;
+ list-style-type: none;
+ width: 100%;
+}
+
+fieldset.rows.left li {
+ padding-bottom : .4em;
+}
+
+fieldset.rows li.radio {
+ padding-left: 9em;
+ width : auto;
+}
+
+fieldset.rows li.radio label {
+ float : none;
+ width : auto;
+ margin : 0 0 0 1em;
+}
+
+fieldset.rows ol.radio label {
+ width : auto;
+ float : none;
+ margin-right : 0;
+}
+
+fieldset.rows ol.radio label.radio {
+ float : left;
+ width : 12em;
+ margin-right : 1em;
+}
+
+fieldset.rows table {
+ clear : both;
+ margin-left : 1em;
+}
+
+fieldset.rows td label {
+ float : none;
+ font-weight : normal;
+ width : auto;
+}
+
+fieldset.holds {
+ background-color : #F3F3F3;
+ border: 0;
+ font-size : 110%;
+ padding : 1px;
+}
+
+fieldset.holds ol {
+ margin : 0;
+ padding : 0;
+}
+
+fieldset.holds li {
+ background-color : #FFF;
+ border-bottom : 1px solid #F3F3F3;
+ padding : .3em;
+}
+
+fieldset.holds label, fieldset.holds span.label {
+
+}
+
+fieldset.action {
+ clear : both;
+ float : none;
+ border : none;
+ margin : 0;
+ padding : 1em 0 .3em 0;
+ width : auto;
+}
+
+fieldset.action p {
+ margin-bottom : 1em;
+}
+
+form {
+ display : inline;
+ margin : 0;
+ padding : 0;
+}
+
+h1 {
+ font-size : 138.5%;
+}
+
+h1#library {
+ font-size : 100%;
+ font-weight : normal;
+ margin : .2em 0 .2em .5em;
+}
+
+
+h1#libraryname {
+ background:transparent url(../../images/koha-logo.gif) no-repeat scroll 0%;
+ border: 0;
+ float : left !important;
+ margin:0;
+ padding:0;
+ width:120px;
+}
+
+h1#libraryname a {
+ border:0;
+ cursor:pointer;
+ display:block;
+ height:0px !important;
+ margin:0;
+ overflow:hidden;
+ padding:40px 0 0;
+ text-decoration:none;
+ width:120px;
+}
+
+h1,h2,h3,h4,h5,h6 {
+ font-weight : bold;
+ margin : .5em 0;
+}
+
+h2 {
+ font-size : 131%;
+}
+
+h5.author {
+}
+
+h3 {
+ font-size : 123.1%;
+}
+
+h4 {
+ font-size : 116%;
+}
+
+h5 {
+ font-size : 108%;
+}
+
+h6 {
+ font-size : 100%;
+}
+
+input[type=submit],
+input[type=button],
+input[type=reset],
+fieldset.brief input[type=submit],
+fieldset.brief input[type=button],
+fieldset.brief input[type=reset]
+{
+ background: #f4f9fc; /* Old browsers */
+ background: -moz-linear-gradient(top, #f4f9fc 0%, #dfeefa 4%, #bfd5ea 93%, #a1c4e2 97%, #b8d0e6 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f4f9fc), color-stop(4%,#dfeefa), color-stop(93%,#bfd5ea), color-stop(97%,#a1c4e2), color-stop(100%,#b8d0e6)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f9fc', endColorstr='#b8d0e6',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* W3C */
+ border-top: 1px solid #cccccc;
+ border-left: 1px solid #cccccc;
+ border-right: 1px solid #eeeeee;
+ border-bottom: 1px solid #eeeeee;
+ color : #333;
+ font-size : 93%;
+ font-weight : bold;
+ padding : 4px;
+}
+
+input[type=submit]:active, input[type=button]:active, input[type=reset]:active {
+ border: 1px inset #666666;
+}
+
+td.resultscontrol,
+.searchresults td.resultscontrol {
+ background-color : #EEE;
+ border : 1px solid #E8E8E8;
+ vertical-align : middle;
+ padding : 3px 3px 5px 5px;
+}
+
+table {
+ background-color: #FFF;
+ border-collapse : collapse;
+ margin : 1em 0;
+ border-right : 1px solid #dddddd;
+ border-top : 1px solid #dddddd;
+}
+
+td,th {
+ background-color: #FFF;
+ border-left : 1px solid #dddddd;
+ border-bottom : 1px solid #dddddd;
+ padding : 3px 5px;
+}
+
+td.place_on_type table,
+td.place_on_type table td {
+ border : 0;
+}
+td caption {
+ font-size : 105%;
+}
+
+th {
+ background-color:#EEE;
+ font-weight : bold;
+ padding : 2px 23px;
+ text-align : center;
+}
+
+th.sum {
+ text-align: right;
+}
+
+td.sum {
+ background-color: #FFC;
+ font-weight: bold;
+}
+
+th[scope=row] {
+ text-align : right;
+}
+
+tr.highlight td, tr.highlight th, tr.odd td {
+ background-color : #F3F3F3;
+ border-top : 1px solid #DDDDDD;
+ border-bottom : 1px solid #DDDDDD;
+}
+
+tr.even td, tr.even.highlight td {
+ background-color: #FFF;
+}
+
+tr.grouplabel td {
+ background-color : #E8E8E8;
+ border : 1px solid #DDDDDD;
+ border-right : 1px solid #DDDDDD;
+ text-align : center;
+ font-weight : bold;
+ padding: 10px;
+}
+
+tr.reserved td {
+ background-color : #eeffd4;
+}
+tr.transfered td {
+ background-color : #e8f0f6;
+}
+
+#editions table, #editions td {
+ border : 0;
+}
+
+.header {
+ background-image:url("../../images/ascdesc.gif");
+ background-position:right center;
+ background-repeat:no-repeat;
+ cursor:pointer;
+}
+.headerSortUp {
+ background-image:url("../../images/asc.gif");
+}
+.headerSortDown {
+ background-image:url("../../images/desc.gif");
+}
+
+ul {
+ list-style : disc;
+ padding-left : 1em;
+}
+
+li {
+ list-style : disc;
+}
+
+p.availability {
+ font-size : 87%;
+}
+
+.available {
+ color : #006600;
+}
+
+.waiting,.intransit,.notforloan,.checkedout,.lost,.notonhold {
+ display : block;
+}
+.notforloan {
+ color : #900;
+}
+.lost {
+ color : #666;
+}
+.waiting {
+
+}
+
+/* "problem" enhancement */
+.problem {
+ color : white;
+ background-color : red;
+}
+
+/* style for search terms in catalogsearch */
+.term {
+ /* color : blue; */
+ color : #990000;
+ background-color : #FFFFCC;
+}
+
+a .term {
+ text-decoration : underline;
+}
+
+/* style for shelving location in catalogsearch */
+.shelvingloc {
+ display : block;
+ font-style : italic;
+}
+
+.transfered {
+ background-color : #F9FF9A;
+}
+
+/* action buttons */
+#action {
+ margin-top : .5em;
+ background-color : #F3F3F3;
+ border : 1px solid #E8E8E8;
+ padding-bottom : 3px;
+}
+
+#action li {
+ list-style : none;
+ margin : .2em;
+ padding : .3em 0;
+}
+
+#action a {
+ background-position : 5px center;
+ background-repeat : no-repeat;
+ text-decoration : none;
+ padding-left : 35px;
+}
+
+#action a.print {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -186px;
+ background-repeat: no-repeat;
+}
+
+#action a#furthersearches {
+ background-image: url("../../images/sprite.png");
+ background-position: 106px -295px;
+ background-repeat: no-repeat;
+ border : 1px solid #F3F3F3;
+ margin-left : 5px;
+ padding : 2px 26px 2px 10px;
+ text-decoration : none;
+}
+
+#action a#furthersearches:hover {
+ border-top : 1px solid #FFF;
+ border-left : 1px solid #FFF;
+ border-right : 1px solid #979797;
+ border-bottom : 1px solid #979797;
+}
+
+#action a.reserve,
+.searchresults a.reserve {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -144px;
+ background-repeat: no-repeat;
+}
+
+#action a.addtoshelf, #toolbar a.addtoshelf {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -225px;
+ background-repeat: no-repeat;
+}
+
+#action a.addtocart, #toolbar a.addtocart {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -265px;
+ background-repeat: no-repeat;
+}
+
+#action a.cartRemove, .actions a.cartRemove {
+ color: #cc3333;
+ font-size : 90%;
+ margin : 0;
+ padding: 0;
+}
+
+#action a.incart {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -265px;
+ background-repeat: no-repeat;
+ color : #666;
+}
+
+/* toolbar buttons */
+
+#toolbar,
+#selections-toolbar {
+background-color:#EEEEEE;
+border:1px solid #E8E8E8;
+margin : 0 0;
+padding:3px 3px 5px 5px;
+vertical-align:middle;
+}
+
+#basket #toolbar {
+ padding: 7px 5px 9px 9px;
+}
+
+#selections-toolbar {
+background: #E8E8E8; /* Old browsers */
+background: -moz-linear-gradient(top, #b2b2b2 0%, #e0e0e0 14%, #e8e8e8 100%); /* FF3.6+ */
+background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b2b2b2), color-stop(14%,#e0e0e0), color-stop(100%,#e8e8e8)); /* Chrome,Safari4+ */
+background: -webkit-linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /* Chrome10+,Safari5.1+ */
+background: -o-linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /* Opera 11.10+ */
+background: -ms-linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /* IE10+ */
+background: linear-gradient(top, #b2b2b2 0%,#e0e0e0 14%,#e8e8e8 100%); /* W3C */
+filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e0e0e0', endColorstr='#e8e8e8',GradientType=0 ); /* IE6-9 */
+ margin : 0 0 1em 0;
+ padding-top : .5em;
+ padding-left : 10px;
+}
+
+#toolbar a,
+#selections-toolbar a,
+#toolbar input,
+#selections-toolbar input {
+ white-space : nowrap;
+}
+
+#toolbar ul {
+ padding-left : 0;
+}
+
+#toolbar ul li {
+ display : inline;
+ list-style : none;
+}
+
+#toolbar ul li a {
+ border-left : 1px solid #e8e8e8;
+}
+
+#toolbar ul li:first-child a {
+ border-left : 0;
+}
+
+
+#toolbar a.print {
+ background-image: url("../../images/sprite.png");
+ background-position : 0px -423px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 30px;
+}
+
+#toolbar a.brief {
+ background-image : url("../../images/sprite.png");
+ background-position : -2px -868px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 27px;
+}
+
+#toolbar a.detail {
+ background-image : url("../../images/sprite.png");
+ background-position : -2px -898px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 27px;
+}
+
+#toolbar a.download {
+ background-image : url("../../images/sprite.png");
+ background-position : 2px -348px;
+ background-repeat: no-repeat;
+ padding-left : 28px;
+ text-decoration : none;
+}
+
+#toolbar a.editshelf {
+ background-image : url("../../images/sprite.png");
+ background-position : 2px -348px;
+ background-repeat: no-repeat;
+ padding-left : 26px;
+ text-decoration : none;
+}
+
+#toolbar a.empty {
+ background-image : url("../../images/sprite.png");
+ background-position : 2px -598px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 30px;
+}
+
+#toolbar a.hide {
+ background-image : url("../../images/sprite.png");
+ background-position: -3px -814px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 26px;
+}
+
+#toolbar a.hold,
+#selections-toolbar a.hold {
+ background-image: url("../../images/sprite.png");
+ background-position : -5px -453px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 23px;
+}
+
+#selections-toolbar a.hold.disabled {
+ background-image: url("../../images/sprite.png");
+ background-position : -5px -621px;
+ background-repeat: no-repeat;
+}
+
+#selections-toolbar a.removeitems,
+#selections-toolbar a.deleteshelf {
+ background-image : url("../../images/sprite.png");
+ background-position : 2px -690px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 25px;
+}
+
+
+#selections-toolbar a.removeitems.disabled,
+#selections-toolbar a.deleteshelf.disabled {
+ background-image: url("../../images/sprite.png");
+ background-position : 2px -712px;
+ background-repeat: no-repeat;
+}
+
+#toolbar a.send,
+a.send {
+ background-image: url("../../images/sprite.png");
+ background-position : 2px -386px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 28px;
+}
+
+#toolbar a.new {
+ background-image : url("../../images/sprite.png");
+ background-position : -4px -922px;
+ background-repeat : no-repeat;
+ padding-left : 23px;
+ text-decoration : none;
+}
+
+#toolbar input.editshelf,
+input.editshelf {
+ background-image : url("../../images/sprite.png");
+ background-position : 2px -732px;
+ background-repeat: no-repeat;
+ border : 0;
+ color : #006699;
+ cursor : pointer;
+ font-size : 100%;
+ padding-left : 29px;
+ text-decoration : none;
+}
+
+#toolbar input.newshelf,
+#toolbar a.newshelf,
+a.newshelf {
+ background-image: url("../../images/sprite.png"); /* add to list icon */
+ background-position: -4px -864px;
+ background-repeat: no-repeat;
+ border : 0;
+ color : #006699;
+ cursor : pointer;
+ font-size : 100%;
+ margin: 0 0.5em;
+ padding-left : 23px;
+ text-decoration : none;
+}
+
+a.newshelf.disabled {
+ background-image: url("../../images/sprite.png"); /* add to list icon */
+ background-position: -4px -791px;
+ background-repeat: no-repeat;
+}
+
+#toolbar input.deleteshelf,
+input.deleteshelf {
+ background-image : url("../../images/sprite.png");
+ background-position : 2px -685px;
+ background-repeat: no-repeat;
+ border : 0;
+ color : #006699;
+ cursor : pointer;
+ font-size : 100%;
+ padding-left : 25px;
+ text-decoration : none;
+}
+
+#toolbar input.deleteshelf:hover {
+ color: #990033;
+}
+
+
+#toolbar input.editshelf:active,
+input.editshelf:active,
+#toolbar input.deleteshelf:active,
+input.deleteshelf:active {
+ border : 0;
+}
+
+#selections {
+ font-weight : bold;
+}
+
+#tagsel_span input.submit,
+#tagsel_tag {
+ background-image : url("../../images/sprite.png"); /* tag icon */
+ background-position : 7px -640px;
+ background-repeat : no-repeat;
+ padding-left : 25px;
+ text-decoration: none;
+}
+
+#tagsel_tag {
+ background-position : -1px -643px;
+}
+
+#tagsel_tag.disabled {
+ background-position : -1px -667px;
+}
+
+#tagslist li { display : inline; }
+
+a.tag_results_add {
+ background-image: url(../../images/tag-small.png);
+ background-position : -1px center;
+ background-repeat : no-repeat;
+ padding-left : 13px;
+ text-decoration: none;
+}
+
+#login4tags {
+ background-image: url(../../images/tag-small-disabled.png);
+ background-position : -1px center;
+ background-repeat : no-repeat;
+ padding-left : 13px;
+ text-decoration: none;
+ margin-left: 1em;
+}
+
+.tag_results_input {
+ background-color: #EEE;
+ display: none;
+ margin-left: 1em;
+ padding: 0.3em;
+}
+
+#placehold input.submit:hover,
+#tagsel_span input.submit:hover {
+ color: #990033;
+}
+
+#addto {
+ max-width : 10em;
+}
+
+.addto a.addtocart {
+ background-image: url("../../images/sprite.png"); /* cart icon */
+ background-position: -5px -265px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 33px;
+}
+
+#placehold input.submit {
+ background-image: url("../../images/sprite.png"); /* place hold icon */
+ background-position: -1px -140px;
+ background-repeat: no-repeat;
+ text-decoration : none;
+ padding-left : 23px;
+}
+
+#placehold input.submit,
+#tagsel_span input.submit {
+ border : 0;
+ background-color: transparent;
+ font-size : 100%;
+ font-weight : bold;
+ padding-left : 31px;
+ color : #336699;
+ cursor : pointer;
+}
+.searchresults a.highlight_toggle {
+ background-image: url("../../images/sprite.png"); /* place hold icon */
+ background-position: -11px -841px;
+ background-repeat: no-repeat;
+ display: none;
+ font-weight: normal;
+ padding : 0 10px 0 21px;
+}
+
+/* the itemtype list in advanced search */
+.advsearch table {
+ border-collapse : separate;
+ border-spacing : 3px;
+ border : 0px;
+ margin : 0px;
+ background-color : white;
+ border : 0px solid #D8DEB8;
+}
+
+.advsearch table tr td {
+ background-color : #F8F8EB;
+ border : 0px;
+ margin : 0px;
+ width : 700px;
+}
+
+.advsearch td {
+ font-size : 0.8em;
+ background-color : #F8F8EB;
+}
+
+body#advsearch #breadcrumbs {
+ line-height : 1px;
+ height : 1px;
+ padding : 0;
+}
+
+body#advsearch #cartmenulink,
+body#advsearch #listsmenulink {
+ float : right;
+}
+
+#advsearch #branchloop,
+#advsearch #sort_by {
+ width : 23em;
+}
+
+#auth {
+ float : left;
+}
+
+#facets {
+
+}
+
+/* the footer */
+#footer {
+ margin-top : 30px;
+ margin-left : 30%;
+ margin-right : 20%;
+ border-top : 1px solid #384b73;
+ color : #384b73;
+ font-size : 1em;
+ text-align : center;
+}
+
+/* facets bloc */
+/* the USER information block */
+#librarian_information {
+ float : right;
+ font-size : 10pt;
+}
+
+#header-wrapper {
+ background-color: #FFF;
+}
+
+#holds,#opac-auth {
+ min-width : 750px;
+ width : 57.69em;
+ margin : auto;
+}
+
+#members {
+ background-color: #fff;
+ font-size : 85%;
+ margin-left : -10px;
+ margin-right : -10px;
+ padding : 4px 0 4px 0;
+ color : #000066;
+}
+
+#members a {
+ text-decoration : none;
+}
+
+#members a.logout {
+ color : #cc3333;
+ font-weight : bold;
+ padding : 0 .3em 0 .3em;
+ text-decoration : none;
+}
+
+#members li:last-child {
+ border-right : 0;
+}
+
+#members li {
+ border-right : 1px solid black;
+ display : inline;
+ list-style : none;
+ margin : 0;
+ padding : 0 .5em;
+}
+
+#members ul {
+ margin : 0;
+ padding : 0;
+ text-align : right;
+}
+
+#opac-main-search {
+ background: #8fb4e8; /* Old browsers */
+ background: -moz-linear-gradient(top, #8fb4e8 0%, #8cb1e5 19%, #80a8dc 48%, #7da5d8 52%, #7198cf 83%, #618ac0 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#8fb4e8), color-stop(19%,#8cb1e5), color-stop(48%,#80a8dc), color-stop(52%,#7da5d8), color-stop(83%,#7198cf), color-stop(100%,#618ac0)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #8fb4e8 0%,#8cb1e5 19%,#80a8dc 48%,#7da5d8 52%,#7198cf 83%,#618ac0 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #8fb4e8 0%,#8cb1e5 19%,#80a8dc 48%,#7da5d8 52%,#7198cf 83%,#618ac0 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(top, #8fb4e8 0%,#8cb1e5 19%,#80a8dc 48%,#7da5d8 52%,#7198cf 83%,#618ac0 100%); /* IE10+ */
+ background: linear-gradient(top, #8fb4e8 0%,#8cb1e5 19%,#80a8dc 48%,#7da5d8 52%,#7198cf 83%,#618ac0 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#8fb4e8', endColorstr='#618ac0',GradientType=0 ); /* IE6-9 */
+ border-top : 1px solid #335599;
+ border-bottom : 1px solid #335599;
+ margin-left : -10px;
+ margin-right : -10px;
+ padding : .7em 0 .4em .5em;
+ font-size : 108%;
+ line-height : 116%;
+}
+
+#opac-main-search form {
+ display : inline;
+ padding-right : 1em;
+}
+
+#opac-main-search label {
+ color : #FFFFCC;
+ font-weight : bold;
+ margin : .2em .3em 0 0;
+}
+
+#masthead_search,
+#select_library {
+ max-width: 10em;
+ width: 10em;
+}
+
+
+#search-facets ul {
+ margin : 0;
+ padding : .3em;
+}
+
+#search-facets {
+ border : 1px solid #e8e8e8;
+}
+
+#search-facets h4 {
+ background-color : #EEE;
+ border-bottom : 1px solid #e8e8e8;
+ font-size : 90%;
+ margin : 0;
+ padding : .7em .2em;
+ text-align : center;
+}
+
+#search-facets ul li {
+ font-weight : bold;
+ list-style-type : none;
+}
+
+#search-facets li li {
+ font-weight : normal;
+ font-size : 85%;
+ margin-bottom : 2px;
+ padding : .1em .2em;
+}
+
+#search-facets li li a {
+ font-weight : normal;
+}
+
+#search-facets li.showmore a {
+ font-weight : bold;
+ text-indent : 1em;
+}
+
+.suggestion {
+ background-color : #EEEEEB;
+ border : 1px solid #DDDED3;
+ margin : 10px auto;
+ padding : 4px;
+ width : 35%;
+}
+
+#facets ul {
+ margin : 0;
+ padding : 0;
+}
+
+#facets ul li {
+ font-weight : bold;
+ text-align : left;
+ list-style : none;
+}
+
+#facets ul ul li {
+ border : 0;
+ font-size : 85%;
+ font-weight : normal;
+ padding : 2px;
+ text-align : left;
+}
+
+#facets ul ul li a {
+ font-weight : normal;
+ text-decoration : underline;
+}
+
+#facets h4 {
+ font-size : 93%;
+ padding:3px;
+ text-align:center;
+ background-color:#E7E7CA;
+ line-height:1.8em;
+ margin-left:-1px;
+ margin-right:-1px;
+ margin-top:-1px;
+}
+
+#breadcrumbs {
+ padding : .7em;
+}
+
+p {
+ margin: .7em 0;
+}
+
+strong {
+ font-weight : bold;
+}
+
+em {
+ font-style : italic;
+}
+
+
+table#marc,
+table#marc td,
+table#marc th {
+ background-color : transparent;
+ border : 0;
+}
+
+table#marc p span.label {
+ font-weight : bold;
+}
+
+table#marc p,
+table#marc ul {
+ padding-bottom: .6em;
+}
+
+table#items,
+table#items td
+table#items th {
+ border-width : 1px solid #EEE;
+ font-size : 90%;
+}
+
+
+table#marc div.results_summary {
+ clear : left;
+}
+table#marc div.results_summary ul {
+ display : inline;
+ float : none;
+ clear : none;
+ margin: 0;
+ padding: 0;
+ list-style : none;
+}
+
+table#marc div.results_summary ul li {
+ display : inline;
+}
+
+#basketcount {
+ display : inline;
+}
+
+#bookcover {
+ float : left;
+ margin : 0;
+ padding : 0;
+}
+
+#bookcover img {
+ margin : 0 1em 1em 0;
+}
+
+fieldset.brief {
+ border : 1px solid #E8E8E8;
+}
+
+fieldset.brief legend {
+ font-weight : bold;
+ font-size : 100%;
+}
+
+fieldset.brief label {
+ display : block;
+ padding : .3em 0;
+}
+
+fieldset.brief input+input {
+ margin-top : 3px;
+}
+
+fieldset.brief input, fieldset.brief textarea, fieldset.brief select {
+ background-color: #F3F3F3;
+ border-top : 1px solid #979797;
+ border-left : 1px solid #979797;
+ border-right : 1px solid #DDDDDD;
+ border-bottom : 1px solid #DDDDDD;
+ font-size : 140%;
+ padding : .2em;
+ font-weight: normal;
+}
+
+fieldset.brief textarea {
+ font-size: 105%;
+}
+
+fieldset.brief input:focus {
+ background-color: #FFFFCC;
+}
+
+fieldset.brief ol, fieldset.brief li {
+ list-style-type : none;
+}
+
+fieldset.brief div.hint, fieldset.rows div.hint {
+ color : #666666;
+ font-size : 100%;
+ margin : .4em;
+}
+
+h2 span.hint {
+ font-size: 76%;
+ font-weight : normal;
+}
+.thumbnail {
+ border : 0;
+ float : left;
+ margin : 0pt 5px 5px 0pt;
+}
+a.cancel {
+ padding-left : 1em;
+}
+
+.resultscontrol, .resultscontrol select {
+ font-size: 90%;
+}
+
+.cartlist {
+ margin-top : 5px;
+}
+
+.cartlist input.submit, #tagsel_button {
+ background-color : #d8deb8;
+ background-image : none;
+ border-color : #bebf84;
+ color : #333;
+ font-size : 87%;
+ padding : 2px 0;
+ margin : 0 0 0 0;
+}
+
+#CheckAll, #CheckNone {
+ font-weight : normal;
+ margin : 0 .5em;
+}
+
+.resultscontrol label {
+ font-weight : bold;
+ margin-left : .5em;
+}
+
+.resort {
+ float : right;
+ margin-top : 5px;
+}
+
+.searchresults p.details {
+ color : #979797;
+}
+
+.searchresults p {
+ margin: 0;
+ padding: 0 0 .6em 0;
+}
+
+td.resultscontrol img {
+ vertical-align: middle;
+}
+
+.searchresults table td {
+}
+
+.searchresults table {
+ margin : 0;
+}
+
+.searchresults td, .searchresults th, .searchresults table {
+ border: 0;
+}
+.searchresults td {
+ vertical-align: top;
+}
+
+.searchresults tr {
+ border-bottom : 1px solid #f3f3f3;
+}
+
+.searchresults tr:first-child {
+ border : 0;
+}
+
+.searchresults table {
+ border-top : 0px solid #CCCCCC;
+ width : 100%;
+}
+
+.searchresults a.reserve, .searchresults a.reserve:visited {
+ background-position:left top;
+ background-repeat:no-repeat;
+ float:right;
+ padding:2px 3px 2px 26px;
+}
+
+.searchresults a.reserve {
+ background-color:transparent;
+ color:#006699;
+}
+
+.unavailable, .tagerror, .tagerror:visited {
+ color: #990033;
+}
+
+#libraryname {
+ float : left;
+ line-height : 2em;
+}
+
+#corner {
+ float : right;
+ line-height : 2em;
+}
+
+.pages {
+ line-height : 1.8em;
+ text-align: center;
+}
+
+.current,
+.currentPage {
+ background-color: #FFFFFF;
+ color: #3366CC;
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:link.nav,
+div.pages a:link {
+ background-color: #EEE;
+ border: 1px solid #CCCC99;
+ color: #3366CC;
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:visited.nav,
+div.pages a:visited {
+ background-color: #EEE;
+ border: 1px solid #CCCC99;
+ color: #3366CC;
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:hover.nav,
+div.pages a:hover {
+ background-color: #FFFFCC;
+ border: 1px solid #CCCC99;
+ color: #CC3333;
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:active.nav,
+div.pages a:active {
+ background-color: #FFFFCC;
+ border: 1px solid #CCCC99;
+ color: #D25500;
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+/* Tabs */
+ul.link-tabs {
+ list-style-type: none;
+ margin: 9px 0 -2px 5px;
+ padding: 0;
+}
+
+ul.link-tabs li {
+ display: inline;
+ padding: 0px;
+}
+
+ul.link-tabs li a {
+ font-weight: bold;
+ padding: 2px 4px 2px 4px;
+ text-decoration: none;
+ border-top: 1px solid #DDDDDD;
+ border-left : 1px solid #DDDDDD;
+ border-right : 1px solid #666666;
+}
+
+ul.link-tabs li#power_formButton a, ul.link-tabs li#proximity_formButton a {
+ padding: 2px 4px 3px 4px;
+}
+
+ul.link-tabs li.off a {
+ background-color: #EEEEEB;
+ border-bottom: 1px solid #DDDDDD;
+}
+
+ul.link-tabs li.off a:hover {
+ padding: 2px 3px 2px 4px;
+ background-color: #FFFFEC;
+ border-top: 1px solid #BEBF84;
+ border-left : 1px solid #BEBF84;
+ border-right : 2px solid #333333;
+}
+
+ul.link-tabs li.on a {
+ background-color: #FFFFFF;
+ border-bottom: 1px solid #FFFFFF;
+}
+
+ul.link-tabs li a.debit {
+ background-color : #FFFF99;
+ color : #990033;
+}
+
+div.tab-container {
+ border : 1px solid #DDDDDD;
+ margin-top : 4px;
+ padding : .7em;
+ width : 90%;
+}
+
+tr.overdue td {
+ background-color : #ffcccc;
+ border-bottom : 1px solid #ffaeae;
+ border-right : 1px solid #ffaeae;
+ font-weight : bold;
+}
+
+td.overdue {
+ color : #cc3333;
+}
+
+.renewals {
+ display:block;
+ font-size:0.8em;
+ padding:0.5em;
+}
+
+table#marc, table#marc td, table#marc th {
+ border : 0;
+}
+
+table#marc th {
+ background-color : transparent;
+ text-align : left;
+}
+
+table#marc td:first-child {
+ text-indent : 2em;
+}
+#masthead {
+float: left;
+width: 120px;
+}
+
+#fluid {
+margin-left: 124px;
+margin-top : .4em;
+padding-left : 1em;
+}
+
+#fluid-offset {
+float : right;
+width: 100%;
+}
+
+#translControl{
+float : left;
+padding-left : .4em;
+}
+
+.clearfix:after {
+ content: ".";
+ display: block;
+ height: 0;
+ clear: both;
+ visibility: hidden;
+}
+
+/* Hides from IE-mac \*/
+* html .clearfix {height: 1%;}
+/* End hide from IE-mac */
+
+.results_summary {
+ display: block;
+ font-size : 85%;
+ color: #707070;
+ padding : 0 0 .5em 0;
+}
+.results_summary .results_summary {
+ font-size : 100%;
+}
+
+.results_summary.actions {
+ margin-top : .5em;
+}
+
+.m880 {
+ display:block;
+ text-align:right;
+ float:right;
+ width:50%;
+ padding-left:20px
+}
+
+.searchresults .tagstatus {
+ display: block;
+ color: #707070;
+}
+
+.results_summary .label {
+ color: #202020;
+}
+
+.results_summary a {
+ font-weight: normal;
+}
+
+.actions a {
+ margin-left : 1em;
+ text-decoration : none;
+}
+
+.actions a.hold {
+ background-image : url("../../images/sprite.png");
+ background-position : -10px -542px;
+ background-repeat: no-repeat;
+ padding-left : 16px;
+}
+
+.actions a.addtocart {
+ background-image : url("../../images/sprite.png");
+ background-position : -10px -572px;
+ background-repeat: no-repeat;
+ padding-left : 15px;
+ display : none;
+}
+
+.actions a.addtoshelf {
+ background-image : url("../../images/sprite.png");
+ background-position: -10px -27px;
+ background-repeat: no-repeat;
+ padding-left : 13px;
+}
+
+.dialog {
+ border: 1px solid #bcbcbc;
+ padding : .5em;
+ margin : 1em auto;
+ width: 65%;
+ }
+
+.dialog h2, .dialog h3, .dialog h4 {
+ margin : auto;
+ text-align : center;
+ }
+
+div.alert {
+ background: #fef8d3; /* Old browsers */
+ background: -moz-linear-gradient(top, #fef8d3 0%, #ffec91 9%, #ffed87 89%, #f9dc00 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fef8d3), color-stop(9%,#ffec91), color-stop(89%,#ffed87), color-stop(100%,#f9dc00)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fef8d3', endColorstr='#f9dc00',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* W3C */
+ text-align : center;
+}
+
+div.alert strong {
+ color : #900;
+}
+
+div.message {
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #f4f6fa 2%, #eaeef5 23%, #e8edf6 94%, #cddbf2 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(2%,#f4f6fa), color-stop(23%,#eaeef5), color-stop(94%,#e8edf6), color-stop(100%,#cddbf2)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* W3C */
+ border : 1px solid #bcbcbc;
+ width : 55%;
+}
+
+#moresearches {
+ clear : left;
+ color : #000099;
+ font-size : 90%;
+ line-height : 110%;
+ margin : .6em 0 .3em 0;
+}
+
+#moresearches a:link, #moresearches a:visited {
+ color : #e5ebff;
+ font-weight : normal;
+ text-decoration : none;
+}
+
+#news th {
+ text-align : left;
+ padding : 3px 5px;
+}
+
+#opac-main-search #listsmenu a, #opac-main-search #listsmenu h4 {
+ color : #000;
+ font-weight : normal;
+}
+ #opac-main-search #listsmenu h4 {
+ font-size : 90%;
+ font-weight : bold;
+ margin : 0 .2em;
+ }
+
+#opac-main-search #listsmenu .yuimenuitemlabel {
+ cursor : pointer;
+}
+
+#opac-main-search #listsmenu .bd {
+ background: #eef4fe; /* Old browsers */
+ background: -moz-linear-gradient(left, #eef4fe 0%, #eef4fe 88%, #f6f9fe 98%, #ffffff 99%, #a5c2f6 99%, #e6eefe 100%, #cbdefe 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, right top, color-stop(0%,#eef4fe), color-stop(88%,#eef4fe), color-stop(98%,#f6f9fe), color-stop(99%,#ffffff), color-stop(99%,#a5c2f6), color-stop(100%,#e6eefe), color-stop(100%,#cbdefe)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eef4fe', endColorstr='#cbdefe',GradientType=1 ); /* IE6-9 */
+ background: linear-gradient(left, #eef4fe 0%,#eef4fe 88%,#f6f9fe 98%,#ffffff 99%,#a5c2f6 99%,#e6eefe 100%,#cbdefe 100%); /* W3C */
+ border : 1px solid #739acf;
+ padding : .3em 1em 0 0;
+}
+
+#opac-main-search #listsmenu .yuimenuitemlabel.selected {
+ background-color : #fff;
+}
+
+#opac-main-search #listsmenu ul {
+ border-color : #b8d0e6;
+}
+
+.selectcol {
+ vertical-align: top;
+ width: 10px;
+}
+.itypecol {
+ vertical-align: top;
+ width: 10px;
+}
+#container {
+ color : #000;
+}
+
+div#changelanguage{
+ background-color: #fff;
+ border-top: 1px solid #CCC;
+ color : #666;
+ font-size : 85%;
+ padding : 1em;
+ margin-top : 2em;
+ }
+
+div#changelanguage a {
+ font-weight : normal;
+ padding : .5em 0;
+}
+
+div#changelanguage li.yuimenuitem {
+ font-size: 120%;
+ font-weight: normal;
+ margin: 0;
+ padding: 0 1em;
+}
+div#changelanguage li.yuimenuitem a.yuimenuitemlabel {
+ padding: 0;
+}
+
+ul#i18nMenu {
+ margin : 0;
+ padding : .2em 0;
+ }
+
+ul#i18nMenu li {
+ border-left : 1px solid #CCC;
+ display : inline;
+ list-style : none;
+ padding : 0 .4em;
+ }
+
+ul#i18nMenu li:first-child {
+ border-left : 0;
+ }
+
+ul#i18nMenu li ul li {
+ border : 0;
+ display : block;
+ padding : 0;
+ }
+
+
+ul#i18nMenu li.more a {
+ background-image : url("../../images/sprite.png");
+ background-position : 37px -940px;
+ background-repeat:no-repeat;
+ padding-right: 1.3em;
+}
+
+ul#i18nMenu li.more ul li a {
+ background-image : none;
+ padding: 0 1.3em;
+}
+
+span.lang{
+ float:left;
+ border-right : 1px solid black;
+ padding : 0 .5em;
+}
+
+#cartDetails,#cartUpdate,#holdDetails,#listsDetails {
+ background-color : #FFF;
+ border: 1px solid #739acf;
+ color : black;
+ display : none;
+ margin : 0;
+ padding : 10px;
+ text-align : center;
+ width : 180px;
+ box-shadow: 1px 1px 3px #666;
+ -moz-box-shadow: 1px 1px 3px #666;
+ -webkit-box-shadow: 1px 1px 3px #666;
+ z-index: 2;
+
+}
+
+.yui-panel .hd, .yui-panel .bd, .yui-panel .ft {
+ background-color : transparent;
+ border : 0;
+ padding : inherit;
+}
+
+#login #userid, #login #password {
+ width : 98%;
+}
+
+#opac-main-search input.submit {
+ background: #e6f3fe; /* Old browsers */
+ background: -moz-linear-gradient(top, #e6f3fe 0%, #dfeefa 8%, #bfd5ea 49%, #b8d0e6 52%, #b8d0e6 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#e6f3fe), color-stop(8%,#dfeefa), color-stop(49%,#bfd5ea), color-stop(52%,#b8d0e6), color-stop(100%,#b8d0e6)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e6f3fe', endColorstr='#b8d0e6',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #e6f3fe 0%,#dfeefa 8%,#bfd5ea 49%,#b8d0e6 52%,#b8d0e6 100%); /* W3C */
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ -webkit-box-shadow: 1px 1px 1px 1px , , .3);
+ -moz-box-shadow: 1px 1px 1px 1px , , .3);
+ box-shadow: 1px 1px 1px 1px , , .3);
+
+ color : #333;
+ font-weight : normal;
+ font-size : 80%;
+ padding : 2px;
+}
+
+div#menu {
+ border-right : 1px solid #979797;
+ font-size : 94%;
+ margin-right : .5em;
+ padding-top : 1em;
+ padding-bottom : 2em;
+}
+
+div#menu li a {
+ background: #eeeeee; /* Old browsers */
+ background: -moz-linear-gradient(left, #eeeeee 0%, #eeeeee 96%, #e6e6e6 97%, #cccccc 99%, #c1c1c1 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, right top, color-stop(0%,#eeeeee), color-stop(96%,#eeeeee), color-stop(97%,#e6e6e6), color-stop(99%,#cccccc), color-stop(100%,#c1c1c1)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* IE10+ */
+ background: linear-gradient(left, #eeeeee 0%,#eeeeee 96%,#e6e6e6 97%,#cccccc 99%,#c1c1c1 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#c1c1c1',GradientType=1 ); /* IE6-9 */
+ text-decoration : none;
+ display : block;
+ border : 1px solid #979797;
+ font-size : 111%;
+ margin : .5em 0;
+ padding : .4em .3em;
+ margin-right : -1px;
+}
+
+div#menu li a:hover {
+ background: #eaeef5; /* Old browsers */
+ background: -moz-linear-gradient(left, #eaeef5 0%, #dee6f4 96%, #c4d5ef 98%, #a2bee8 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, right top, color-stop(0%,#eaeef5), color-stop(96%,#dee6f4), color-stop(98%,#c4d5ef), color-stop(100%,#a2bee8)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* Opera 11.10+ */
+ background: -ms-linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* IE10+ */
+ background: linear-gradient(left, #eaeef5 0%,#dee6f4 96%,#c4d5ef 98%,#a2bee8 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eaeef5', endColorstr='#a2bee8',GradientType=1 ); /* IE6-9 */
+}
+
+div#menu li.active a:hover {
+ background-color : #fff;
+ color : #0000CC;
+}
+
+#menu ul li {
+ list-style-type : none;
+}
+
+#menu ul li.active a {
+ background-color : #FFF;
+ background-image : none;
+ border-right : 0;
+ font-weight : bold;
+}
+
+.left {
+ float : left;
+}
+
+.right {
+ float : right;
+}
+
+#searchsubmit {
+ cursor : default;
+ font-size : 87%;
+ font-weight : normal;
+ margin-top : 0;
+ margin-left : .2em;
+ padding: 2px 2px 1px 2px;
+}
+
+#export,#further,.detailtagcell {
+ margin-top : .5em;
+ background-color : #F3F3F3;
+ border : 1px solid #E8E8E8;
+ font-size : 76%;
+ padding : 3px;
+ text-align : center;
+}
+#furtherm { margin-top : .5em; }
+
+#export label, .detailtagcell label {
+ display : block;
+ font-weight : bold;
+ font-size : 110%;
+ margin-bottom : 2px;
+}
+
+#export input, .detailtagcell input {
+ 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;
+ height: 10px;
+ margin: 0;
+ padding: 0;
+}
+
+span.starMT {
+ background: url(../../images/star-ratings-empty.gif) top left no-repeat;
+ display : block;
+ height: 10px;
+ margin: 0 10px 0 10px;
+ padding: 0;
+ position: relative;
+ width: 50px;
+}
+
+#cartmenulink, #listsmenulink {
+ background-repeat: no-repeat;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+ display : block;
+ position : relative;
+ float : left;
+ color : #333;
+ text-decoration : none;
+ cursor : pointer;
+ font-size : 105%;
+ font-weight : bold;
+ line-height : 185%;
+ margin-left : 1.5em;
+ padding : .3em .7em;
+}
+
+#listsmenulink {
+ background : #9FBFFF;
+ background: url("../../images/sprite.png"),-moz-linear-gradient(top, #d7e5ff 0%, #b1cbff 50%, #9fbfff 100%); /* FF3.6+ */
+ background: url("../../images/sprite.png"),-webkit-gradient(linear, left top, left bottom, color-stop(0%,#d7e5ff), color-stop(50%,#b1cbff), color-stop(100%,#9fbfff)); /* Chrome,Safari4+ */
+ background: url("../../images/sprite.png"),-webkit-linear-gradient(top, #d7e5ff 0%,#b1cbff 50%,#9fbfff 100%); /* Chrome10+,Safari5.1+ */
+ background: url("../../images/sprite.png"),-o-linear-gradient(top, #d7e5ff 0%,#b1cbff 50%,#9fbfff 100%); /* Opera 11.10+ */
+ background: url("../../images/sprite.png"),-ms-linear-gradient(top, #d7e5ff 0%,#b1cbff 50%,#9fbfff 100%); /* IE10+ */
+ background: url("../../images/sprite.png"),linear-gradient(top, #d7e5ff 0%,#b1cbff 50%,#9fbfff 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d7e5ff', endColorstr='#9fbfff',GradientType=0 ); /* IE6-9 */
+ background-position: 40px -287px,top left;
+ background-repeat: no-repeat;
+ border: 1px solid #629DCF;
+ color : #006699;
+ padding-right: 20px;
+}
+
+#listsmenulink:hover {
+ background-color : #b8d0e6;
+ background: url("../../images/sprite.png"),-moz-linear-gradient(top, #e2ecf5 0%, #c3d8ea 50%, #b8d0e6 100%); /* FF3.6+ */
+ background: url("../../images/sprite.png"),-webkit-gradient(linear, left top, left bottom, color-stop(0%,#e2ecf5), color-stop(50%,#c3d8ea), color-stop(100%,#b8d0e6)); /* Chrome,Safari4+ */
+ background: url("../../images/sprite.png"),-webkit-linear-gradient(top, #e2ecf5 0%,#c3d8ea 50%,#b8d0e6 100%); /* Chrome10+,Safari5.1+ */
+ background: url("../../images/sprite.png"),-o-linear-gradient(top, #e2ecf5 0%,#c3d8ea 50%,#b8d0e6 100%); /* Opera 11.10+ */
+ background: url("../../images/sprite.png"),-ms-linear-gradient(top, #e2ecf5 0%,#c3d8ea 50%,#b8d0e6 100%); /* IE10+ */
+ background: url("../../images/sprite.png"),linear-gradient(top, #e2ecf5 0%,#c3d8ea 50%,#b8d0e6 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e2ecf5', endColorstr='#b8d0e6',GradientType=0 ); /* IE6-9 */
+ background-repeat: no-repeat;
+ background-position: 40px -287px,top left;
+}
+
+#cartmenulink {
+ background: #98CB58; /* Old browsers */
+ background: url("../../images/sprite.png"),-moz-linear-gradient(top, #d5eaba 0%, #b7db8a 50%, #98cb59 100%); /* FF3.6+ */
+ background: url("../../images/sprite.png"),-webkit-gradient(linear, left top, left bottom, color-stop(0%,#d5eaba), color-stop(50%,#b7db8a), color-stop(100%,#98cb59)); /* Chrome,Safari4+ */
+ background: url("../../images/sprite.png"),-webkit-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* Chrome10+,Safari5.1+ */
+ background: url("../../images/sprite.png"),-o-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* Opera 11.10+ */
+ background: url("../../images/sprite.png"),-ms-linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* IE10+ */
+ background: url("../../images/sprite.png"),linear-gradient(top, #d5eaba 0%,#b7db8a 50%,#98cb59 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d5eaba', endColorstr='#98cb59',GradientType=0 ); /* IE6-9 */
+ background-position: -5px -256px, left top;
+ background-repeat: no-repeat;
+ border: 1px solid #5EA28C;
+ color : #336600;
+ padding-left : 30px;
+}
+
+#cartmenulink:hover {
+ background-color : #BFDE96;
+ background: url("../../images/sprite.png"),-moz-linear-gradient(top, #e5f1d4 0%, #cbe4aa 50%, #c0de98 100%); /* FF3.6+ */
+ background: url("../../images/sprite.png"),-webkit-gradient(linear, left top, left bottom, color-stop(0%,#e5f1d4), color-stop(50%,#cbe4aa), color-stop(100%,#c0de98)); /* Chrome,Safari4+ */
+ background: url("../../images/sprite.png"),-webkit-linear-gradient(top, #e5f1d4 0%,#cbe4aa 50%,#c0de98 100%); /* Chrome10+,Safari5.1+ */
+ background: url("../../images/sprite.png"),-o-linear-gradient(top, #e5f1d4 0%,#cbe4aa 50%,#c0de98 100%); /* Opera 11.10+ */
+ background: url("../../images/sprite.png"),-ms-linear-gradient(top, #e5f1d4 0%,#cbe4aa 50%,#c0de98 100%); /* IE10+ */
+ background: url("../../images/sprite.png"),linear-gradient(top, #e5f1d4 0%,#cbe4aa 50%,#c0de98 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e5f1d4', endColorstr='#c0de98',GradientType=0 ); /* IE6-9 */
+ background-repeat: no-repeat;
+ background-position: -5px -256px, left top;
+}
+
+/* IE 6 & 7 don't do multiple backgrounds, so remove extra padding */
+* html #listsmenulink,
+*+html #listsmenulink {
+ padding-right : .7em;
+}
+
+/* IE 6 & 7 don't do multiple backgrounds, so remove extra padding */
+* html #cartmenulink,
+*+html #cartmenulink {
+ padding-left : .7em;
+}
+
+/* IE 8 doesn't do multiple backgrounds, so remove extra padding */
+#listsmenulink {
+ padding-right: .7em\0/;
+}
+
+/* IE 8 doesn't do multiple backgrounds, so remove extra padding */
+#cartmenulink {
+ padding-left: .7em\0/;
+}
+
+#cartmenulink span#basketcount {
+ background-image : none;
+ float : none;
+ display : inline;
+ height : auto;
+ position : relative;
+ margin : 0;
+ padding : 0;
+ left : auto;
+ right : auto;
+ top : auto;
+}
+
+#cartmenulink span#basketcount span {
+ background-image : none;
+ background-color : #E6FCB7;
+ color : #000;
+ display : inline;
+ float : none;
+ font-size : 80%;
+ font-weight : normal;
+ margin : 0 0 0 .9em;
+ padding : 0 .3em 0 .3em;
+ position : relative;
+ left : auto;
+ right : auto;
+ top : auto;
+}
+
+#views {
+ border-bottom : 1px solid #E8E8E8;
+ margin-bottom : .5em;
+ padding : 0 2em 2px 0.2em;
+ white-space : nowrap;
+}
+
+span.view {
+ padding : 0.2em .2em 2px .2em;
+}
+
+#bibliodescriptions,
+#isbdcontents {
+ clear : left;
+ margin-top : .5em;
+}
+
+a#MARCview, span#MARCview, a#MARCviewPop, a#ISBDview, span#ISBDview, a#Normalview, a#Briefhistory, span#Normalview, a#Fullhistory, span#Fullhistory, span#Briefhistory {
+ background-repeat : no-repeat;
+ font-size : 87%;
+ font-weight : normal;
+ padding : .2em .5em;
+ padding-left : 21px;
+ text-decoration: none;
+}
+
+a#MARCview, span#MARCview {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -26px;
+ background-repeat: no-repeat;
+}
+a#MARCviewPop, span#MARCviewPop {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -26px;
+ background-repeat: no-repeat;
+}
+a#ISBDview, span#ISBDview {
+ background-image: url("../../images/sprite.png");
+ background-position: -5px -55px;
+ background-repeat: no-repeat;
+}
+a#Normalview, span#Normalview {
+ background-image: url("../../images/sprite.png");
+ background-position: -7px 3px;
+ background-repeat: no-repeat;
+ padding-left : 15px;
+}
+
+a#MARCview, a#MARCviewPop, a#ISBDview, a#Normalview, a#Fullhistory, a#Briefhistory {
+ background-color : #F3F3F3;
+ border-left : 1px solid #E8E8E8;
+}
+
+#shelfbrowser table {
+ margin : 0 20px;
+}
+#shelfbrowser table, #shelfbrowser td, #shelfbrowser th {
+ border : 0;
+ font-size : 90%;
+ text-align : center;
+}
+#shelfbrowser a {
+ font-size : 110%;
+ text-decoration : none;
+}
+#shelfbrowser td, #shelfbrowser th {
+ vertical-align : bottom;
+ width : 20%;
+}
+#shelfbrowser td.top {
+ vertical-align : top;
+}
+#shelfbrowser td.top a {
+ text-decoration : underline;
+}
+#shelfbrowser a {
+ display : block;
+}
+
+#comments .commentline {
+ border-bottom : 2px solid #eeeeeb;
+ margin : 0 -.5em 0 -.5em;
+ padding : 0 .5em .5em .5em;
+}
+#comments .yours {
+ background-color : #effed5;
+}
+.commentline .avatar {
+ float : right;
+ padding-left : .5em;
+}
+#comments #addcomment {
+ margin : 0 -1em -1em -1em;
+ padding : .3em 1em;
+}
+input.tagbutton {
+ padding : 1px !important;
+}
+table#items th {
+ padding : 2px;
+}
+#action {
+ /*margin-top: 0;*/
+}
+#similars h4 {
+ text-align : left;
+}
+#similars table,
+#similars td {
+ border : 0;
+ margin : 0;
+}
+#similars td {
+ width : 13em;
+}
+#similars a {
+ display : block;
+ font-weight : normal;
+}
+#furtherm a,
+#furtherm a:link,
+#furtherm a:visited {
+ color : #006699;
+}
+#furtherm h4 {
+ font-size : 106%;
+ margin : .1em .5em;
+}
+#furtherm .bd {
+ background-color : #F3F3F3;
+ border:1px solid #DDD;
+}
+.results_summary img {
+ margin : 0 5px;
+ }
+span.no-image {
+ background-color : #FFF;
+ border: 1px solid #979797;
+ color : #AAA;
+ display:block;
+ font-size : 86%;
+ font-weight : bold;
+ text-align : center;
+ width : 75px;
+}
+#bookcover span.no-image {
+ margin-right : 10px;
+ margin-bottom : 10px;
+}
+#shelfbrowser a:link span.no-image,
+#shelfbrowser a:visited span.no-image,
+#shelfbrowser a:hover span.no-image,
+#shelfbrowser a:active span.no-image {
+ font-size : 95%;
+}
+#shelfbrowser a:link span.no-image,
+#shelfbrowser a:visited span.no-image,
+#shelfbrowser a:hover span.no-image,
+#shelfbrowser a:active span.no-image,
+td.jacketcell a:link,
+td.jacketcell a:visited,
+td.jacketcell a:hover,
+td.jacketcell a:active,
+a.p1:link,
+a.p1:visited,
+a.p1:hover,
+a.p1:active {
+ color : #AAA;
+ text-decoration : none;
+ font-weight : bold;
+}
+
+.copies_row > td:first-child {
+ border-left-style : none;
+}
+
+.rtl {
+ unicode-bidi: embed;
+ direction: rtl;
+ text-align: right;
+}
+
+div.ft {
+ clear : both;
+}
+#basket td ul li {
+ font-size:90%;
+ list-style:disc outside url("../../images/item-bullet.gif");
+ padding:0.2em 0;
+}
+
+#recentcomments {
+ margin:auto;
+ max-width:750px;
+ margin-left: 13.3207em;
+}
+
+.searchresults .commentline {
+ background-color : rgb(255, 255, 204);
+ background-color : rgba(255, 255, 204, 0.4);
+ border : 1px solid #CCC;
+ display: inline-block;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+ -webkit-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
+ -moz-box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
+ box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
+ margin : .3em;
+ padding : .4em;
+}
+
+.searchresults .commentline.yours {
+ background-color : rgb(239, 254, 213);
+ background-color : rgba(239, 254, 213, 0.4);
+}
+
+#plainmarc table { border: 0; margin: .7em 0 0 0; font-family: monospace; font-size: 95%; }
+#plainmarc th { background-color : #FFF; border: 0; white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; }
+#plainmarc td { border: 0; padding : 2px; vertical-align: top; }
+
+#catalogue_detail_biblio h1 { float:left; margin:0 1em 1em 0; }
+#catalogue_detail_biblio h1.title { float:none; margin-top:1em; }
+#catalogue_detail_biblio h3 {clear:both; }
+
+#opac-detail #Normalview { font-weight:bold; }
+#opac-marcdetail #Normalview { font-weight:normal; }
+#opac-marcdetail #MARCview { font-weight:bold; }
+#opac-isbddetail #Normalview { font-weight:normal; }
+#opac-isbddetail #ISBDview { font-weight:bold; }
+#opac-isbddetail #isbdcontents { margin-top: 2em; }
+
+div.bibmessage { background-color : #ffffb0; border-radius : 5px; padding : 3px; margin : 2px; }
+
+#renewcontrols {
+ float: right;
+ font-size: 66%;
+}
+
+#renewcontrols a {
+ background-repeat : no-repeat;
+ text-decoration:none;
+ padding : .1em .4em;
+ padding-left : 18px;
+}
+
+#renewselected_link {
+ background-image : url("../../images/sprite.png");
+ background-position : -5px -988px;
+ background-repeat: no-repeat;
+}
+
+#renewall_link {
+ background-image : url("../../images/sprite.png");
+ background-position : -8px -964px;
+ background-repeat: no-repeat;
+}
+
+.koha_url {
+ color: #666666;
+}
+
+div.koha_url {
+ border-top: none !important;
+}
+span.koha_url {
+ position: absolute;
+ right: 0;
+ font-size: 85%;
+}
+a.koha_url {
+ text-decoration:none;
+}
+/* pagination */
+.pagination {
+ position: absolute;
+ top:32px;
+ left: -1px;
+ width: 100%;
+ height:auto;
+ border: 1px solid #D0D0D0;
+ display: none;
+ background-color:#F3F3F3;
+ padding-bottom:10px;
+}
+
+
+/* nav */
+.nav .close_pagination {
+ padding-right: 10px;
+ position: absolute;
+ right: 3px;
+ top: -25px;
+}
+.nav .close_pagination a {
+ text-decoration:none!important;
+}
+
+.nav ul {
+ padding-top: 10px;
+}
+
+.nav li {
+ list-style:none;
+ float:left;
+ padding:4px;
+ color:#999;
+}
+
+.nav li a {
+ text-decoration:none!important;
+}
+
+.nav li a:hover {
+ text-decoration:underline;
+}
+
+.nav li ul {
+ float:left;
+}
+
+.back {
+ float:right;
+}
+
+.back input{
+ background:none!important;
+ color:#999!important;
+}
+
+.pagination_list {
+ float:bottom;
+}
+.pagination_list ul {
+ padding-top: 40px;
+ padding-left:0px;
+}
+.pagination_list li {
+ list-style:none;
+ float:bottom;
+ padding:4px;
+ color:#999;
+ /* border-bottom : 1px solid #DDDDDD;*/
+}
+.pagination_list li.highlight {
+ background-color : #F3F3F3;
+ border-top : 1px solid #DDDDDD;
+ border-bottom : 1px solid #DDDDDD;
+}
+.pagination_list span.li_pag_index {
+ color: #999999;
+ float: left;
+ font-size: 15px;
+ font-weight: bold;
+ padding-right: 10px;
+ text-align: right;
+ width: 13px;
+
+}
+
+.pagination_list li a {padding-left:0px;}
+
+
+.nav_results {
+ background-color: #F3F3F3;
+ border: 1px solid #D0D0D0;
+ margin-top: 0.5em;
+ position:relative;
+}
+
+.nav_results .l_Results a {
+ background:#E1E1E1 url("../../images/sprite.png") no-repeat 0px -504px;
+ color:#006699;
+ display:block;
+ padding:8px 28px;
+ text-decoration:none;
+}
+.nav_results .l_Results a:hover {
+ background-color:#D9D9D9;
+}
+.nav_results ul.pg_menu {
+ border-top: 1px solid #D0D0D0;
+ white-space : nowrap;
+}
+.nav_results ul.pg_menu li {
+ color:#B2B2B2;
+ display:inline;
+ list-style:none;
+ margin: 0;
+}
+.nav_results ul.pg_menu li.back_results a {
+ border-left: 1px solid #D0D0D0;
+ border-right: 1px solid #D0D0D0;
+}
+.nav_results ul.pg_menu li a,
+.nav_results ul.pg_menu li span {
+ background-color: #F3F3F3;
+ display : block;
+ float:left;
+ padding:.4em .5em;
+ text-decoration:none;
+ font-weight:normal;
+ text-align:center;
+}
+
+.nav_results ul.pg_menu li span {
+ color : #B2B2B2;
+}
+
+.nav_results ul.pg_menu li.left_results a {
+ padding-left : 0;
+}
+
+.nav_results ul.pg_menu li a:hover {
+}
+
+.nav_results #listResults{
+ line-height: 0.7em;
+}
+
+.nav_results #listResults li {
+ background-color:#999999;
+ color:#C5C5C5;
+ font-weight:normal;
+ display:block;
+ margin-right:1px;
+ font-size:0.9em;
+ padding:5px 0px;
+ text-align:center;
+ min-width:20px;
+}
+
+.nav_results #listResults li:hover {background-color:#006699;}
+
+.nav_results #listResults li a { color:#FFFFFF; font-weight:normal;}
+
+a.localimage img {
+ border : 1px solid #8EB3E7;
+ margin : 0 .5em;
+ padding : .3em;
+}
+
+p.patronimage {
+ border:1px solid #EEE;
+ border-bottom-color:#000;
+ margin: 0.9em 0 0;
+ padding:1em;
+}
+
+p.patronimage.edit {
+ border-color:#E8E8E8;
+ margin: 1em 1em 1em 0;
+}
+
+span.sep {
+ color: #888;
+ padding: 0 .2em;
+ text-shadow: 1px 1px 0 #FFF;
+}
+
+#daily-quote {
+ /*border-top : 1px solid #000000;*/
+ border : 1px solid #000000;
+ margin-top: 2px;
+ margin-bottom: 10px;
+ margin-left: 2px;
+ margin-right: 2px;
+ width: 300px;
+ text-align: center;
+}
+
+#daily-quote h1 {
+ font-size: 18px;
+ font-weight: normal;
+ margin: 0;
+}
+
+#daily-quote div {
+ font-size: 12px;
+ margin: 5px;
+}
+
+/* jQuery UI standard tabs */
+.ui-tabs-nav .ui-tabs-selected a,
+.ui-tabs-nav a:hover,
+.ui-tabs-nav a:focus,
+.ui-tabs-nav a:active,
+.ui-tabs-nav span.a {
+ background: none repeat scroll 0 0 transparent;
+ outline: 0 none;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected {
+ background-color : #FFF;
+ border : 1px solid #D8D8D8;
+}
+
+.ui-widget,
+.ui-widget input,
+.ui-widget select,
+.ui-widget textarea,
+.ui-widget button {
+ font-family : inherit;
+ font-size : inherit;
+}
+ul.ui-tabs-nav li {
+ list-style : none;
+}
+.ui-tabs.ui-widget-content {
+ background : transparent none;
+ border : 0;
+}
+
+.ui-tabs .ui-tabs-panel {
+ border : 1px solid #D8D8D8;
+}
+.ui-tabs-nav.ui-widget-header {
+ border : 0;
+ background : none;
+}
+.ui-tabs .ui-tabs-nav li {
+ background: #F3F3F3 none;
+ border: 1px solid #D8D8D8;
+ margin-right : .4em;
+}
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a {
+ color : #000;
+ font-weight : bold;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-state-default.ui-state-hover {
+ background : #F3F3F3 none;
+}
+
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected.ui-state-hover {
+ background : #FFF none;
+}
+
+.ui-tabs .ui-state-default a,
+.ui-tabs .ui-state-default a:link,
+.ui-tabs .ui-state-default a:visited {
+ color: #006699;
+}
+
+.ui-tabs .ui-state-hover a,
+.ui-tabs .ui-state-hover a:link,
+.ui-tabs .ui-state-hover a:visited {
+ color: #990033;
+}
+
+.statictabs ul {
+ background: none repeat scroll 0 0 transparent;
+ border: 0 none;
+ margin: 0;
+ padding: 0.2em 0.2em 0;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ color: #222222;
+ font-weight: bold;
+ font-size: 100%;
+ line-height: 1.3;
+ list-style: none outside none;
+ outline: 0 none;
+ text-decoration: none;
+}
+
+.statictabs ul:after {
+ clear: both;
+}
+
+.statictabs ul:before,
+.statictabs ul:after {
+ content: "";
+ display: table;
+}
+
+.statictabs ul li {
+ background: none repeat scroll 0 0 #E6F0F2;
+ border: 1px solid #B9D8D9;
+ border-bottom: 0 none !important;
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ float: left;
+ list-style: none outside none;
+ margin-bottom: 0;
+ margin-right: 0.4em;
+ padding: 0;
+ position: relative;
+ white-space: nowrap;
+ top: 1px;
+ color: #555555;
+ font-weight: normal;
+
+}
+
+.statictabs ul li.active {
+ background-color: #FFFFFF;
+ color: #212121;
+ font-weight: normal;
+ padding-bottom: 1px;
+}
+
+.statictabs ul li a {
+ color: #004D99;
+ cursor: pointer;
+ float: left;
+ padding: 0.5em 1em;
+ text-decoration: none;
+}
+
+.statictabs ul li a:hover {
+ background-color : #EDF4F5;
+ border-top-right-radius: 4px;
+ border-top-left-radius: 4px;
+ color : #538200;
+}
+
+.statictabs ul li.active a {
+ color: #000000;
+ font-weight: bold;
+ cursor: text;
+ background: none repeat scroll 0 0 transparent;
+ outline: 0 none;
+}
+
+.statictabs .tabs-container {
+ border: 1px solid #B9D8D9;
+ background: none repeat scroll 0 0 transparent;
+ display: block;
+ padding: 1em 1.4em;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+ color: #222222;
+}
+
+.authref {
+ text-indent: 2em;
+}
+
+.authref .label {
+ font-style: italic;
+}
+
+.authstanza {
+ margin-top: 1em;
+}
+
+.authstanzaheading {
+ font-weight: bold;
+}
+
+.authstanza li {
+ margin-left: 0.5em;
+}
+
+#didyoumean {
+ background-color: #EEE;
+ border: 1px solid #E8E8E8;
+ margin: 0 0 0.5em;
+ text-align: left;
+ padding: 0.5em;
+ border-radius: 3px 3px 3px 3px;
+}
+
+.suggestionlabel {
+ font-weight: bold;
+}
+
+.searchsuggestion {
+ padding: 0.2em 0.5em;
+ white-space: nowrap;
+ display: inline-block;
+}
+
+
+/* jQuery UI Datepicker */
+.ui-datepicker-trigger {
+ vertical-align: middle;
+ margin : 0 3px;
+}
+.ui-datepicker {
+ -moz-box-shadow: 1px 1px 3px 0 #666;
+ -webkit-box-shadow: 1px 1px 3px 0 #666;
+ box-shadow: 1px 1px 3px 0 #666;
+}
+
+body#opac-main #opacmainuserblockmobile {
+ display: none;
+}
+
+#hierarchies a {
+ font-weight: normal;
+ text-decoration: underline;
+ color: #069;
+}
+
+#hierarchies a:hover {
+ color: #990033;
+}
+
+.mobile_only {
+ display : none;
+}
+
+/* different sizes for different tags in opac-tags.tt */
+.tagweight0 {
+ font-size: 12px;
+}
+
+.tagweight1 {
+ font-size: 14px;
+}
+
+.tagweight2 {
+ font-size: 16px;
+}
+
+.tagweight3 {
+ font-size: 18px;
+}
+
+.tagweight4 {
+ font-size: 20px;
+}
+
+.tagweight5 {
+ font-size: 22px;
+}
+
+.tagweight6 {
+ font-size: 24px;
+}
+
+.tagweight7 {
+ font-size: 26px;
+}
+
+.tagweight8 {
+ font-size: 28px;
+}
+
+.tagweight9 {
+ font-size: 30px;
+}
--- /dev/null
+a:link {
+ color : #000066;
+ text-decoration: none;
+}
+
+a:visited {
+ color : #000066;
+ text-decoration: none;
+}
+
+a:hover {
+ color : #993300;
+ text-decoration: none;
+}
+
+body {
+ background-color : #FFF;
+ color : #333333;
+ font-family : arial, geneva, sans-serif;
+ font-size : 14px;
+ margin : 0px 0px 0px 0px;
+ word-wrap : break-word;
+}
+
+caption {
+ color : #000066;
+ font-size : 18px;
+ font-weight : bold;
+ margin-top : 5px;
+ text-align : left;
+}
+
+div.table {
+ width : 100%;
+}
+
+form {
+ margin : 0px;
+ padding : 0px;
+}
+
+h1
+ {
+ color : #000066;
+ font-size : 22px;
+ font-weight : bold;
+ margin-bottom : 3px;
+ margin-top : 3px;
+}
+
+h2 {
+ color : #000066;
+ font-size : 20px;
+ font-weight : bold;
+ margin-bottom : 3px;
+ margin-top : 3px;
+}
+
+h3 {
+ color : #000066;
+ font-size : 18px;
+ font-weight : bold;
+ margin-bottom : 3px;
+ margin-top : 3px;
+}
+
+h4 {
+ color : #000066;
+ font-size : 16px;
+ font-weight : bold;
+ margin-bottom : 3px;
+ margin-top : 3px;
+}
+
+h5 {
+ color : #000066;
+ font-size : 15px;
+ font-weight : bold;
+ margin-bottom : 1px;
+ margin-top : 1px;
+}
+
+h6 {
+ color : #000066;
+ font-size : 14px;
+ font-weight : bold;
+ margin-bottom : 1px;
+ margin-top : 1px;
+}
+
+p {
+ margin-top : 0px;
+}
+
+table {
+ background-color : #FFFFFF;
+ border-bottom : 0px solid #CCCCCC;
+ border-collapse : collapse;
+ border-left : 0px solid #CCCCCC;
+ margin : 3px 0px 5px 0px;
+ padding : 0px;
+ width : 99%;
+}
+
+td {
+ background-color : #FFF;
+ border-bottom : 1px solid #CCCCCC;
+ border-right : 1px solid #CCCCCC;
+ padding : 5px 5px 5px 5px;
+ vertical-align : top;
+}
+
+td:last-child {
+ background-color : #FFF;
+ border-bottom : 1px solid #CCCCCC;
+ border-right : 0px solid #CCCCCC;
+ padding : 5px 5px 5px 5px;
+ vertical-align : top;
+}
+
+th {
+ background-color : #E9E9E9;
+ border-bottom : 1px solid #CCCCCC;
+ border-right : 1px solid #CCCCCC;
+ font-weight : bold;
+ padding : 5px 5px 5px 5px;
+}
+
+th:last-child {
+ background-color : #E9E9E9;
+ border-bottom : 1px solid #CCCCCC;
+ border-right : 0px solid #CCCCCC;
+ font-weight : bold;
+ padding : 5px 5px 5px 5px;
+}
+
+tr.highlight {
+ background-color: #e9e9e9;
+}
+
+body#basket tr.highlight {
+ background-color : transparent;
+}
+
+body#basket a {
+ font-weight : bold;
+}
+
+body#basket table {
+ border-top : 1px solid #EEE;
+ border-left : 1px solid #EEE;
+}
+body#basket td,
+body#basket th {
+ background-color : transparent;
+ padding : 2px;
+}
+
+body#basket th {
+ background-color : #EEE;
+}
+
+body#basket th,
+body#basket th[scope=col] {
+ text-align : center;
+ vertical-align : middle;
+}
+
+body#basket th[scope=row] {
+ font-size : 89%;
+ text-align : right;
+ vertical-align : top;
+ width : 10%;
+}
+
+body#basket p {
+ font-size : 85%;
+ margin : .2em 0;
+ text-indent : .5em;
+}
+
+.error {
+ font-weight: bold;
+}
+
+.ex {
+ font-family : "Courier New", Courier, monospace;
+}
+.inline {
+ display : inline;
+}
+
+.screen {
+ display : none;
+}
+
+#bookcover {
+ float:left;
+ margin:0pt;
+ padding:0pt;
+}
+
+#members,#opac-main-search,#opac-user-views .ui-tabs-nav,input,h2 span.hint,td.resultscontrol,.pages,.suggestion,.views,#action,#export,#bibliodescriptions .ui-tabs-nav,#addshelf,fieldset.action, .list-actions, .ft, #facetcontainer,.results_summary.actions,.koha_url,.yui-b {
+ display : none;
+}
+
+#userresults {
+ position : absolute;
+ right : 0px;
+ word-wrap : break-word;
+ display : block;
+}
+
+div#userupdate input,div#userupdate textarea {
+ display : inline;
+ border : 0;
+}
+
+#yui-main,
+#yui-main .yui-b,
+.yui-t1 #yui-main .yui-b {
+ display : block !important;
+ margin : 0 !important;
+ padding : 0 !important;
+ width : auto !important;
+ float : none !important;
+}
--- /dev/null
+
+body #main {
+ margin-left : 2%;
+ background-color: #eeeeee;
+
+}
+
+/* TWO COLUMNS, RIGHT SIDEBAR */
+
+
+body#withsidebar #main {
+ float: left;
+ margin-left: 1%;
+ width: 58%;
+ }
+
+html body#withsidebar #main {
+ margin-left: .5%;
+ }
+
+body#withsidebar #sidebar
+ {
+ float: left;
+ margin-top : 2.4em;
+ width: 39%;
+}
+
+/* THREE COLUMNS */
+
+body#tricolumn #main_wrapper {
+ float: left;
+ width: 100%;
+}
+
+body#tricolumn #main
+ {
+ margin: 0 150px 0 175px;
+ }
+
+body#tricolumn #nav
+ {
+ float: left;
+ margin-left: -100%;
+ width: 175px;
+ }
+body#tricolumn #sidebar
+ {
+ float: left;
+ margin-left: -150px;
+ width: 150px;
+ }
+
+/* TWO COLUMNS LEFT NAVIGATION */
+
+body#withnav #main_wrapper
+ {
+ float: left;
+ width: 100%;
+ }
+
+body#withnav #main
+ {
+ margin: 0 0 0 175px;
+ }
+
+body#withnav #nav
+ {
+ float: left;
+ margin-left: -100%;
+ width: 175px;
+ }
+
+body#withnav #main .content-block {
+ padding-left : 10px;
+}
+
+/* END TWO COLUMNS RIGHT NAVIGATION */
+
+a {
+ font-weight: bold;
+}
+
+a:link, a:visited, a:active {
+ text-decoration : underline;
+ color :navy;
+}
+
+a:link.current {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:link.nav {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+
+}
+
+a:visited.current {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:visited.nav {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:hover.current {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:hover.nav {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+
+}
+
+a:active.current {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a:active.nav {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+a.help {
+ padding: 3px;
+ text-decoration: none;
+}
+
+a.title {
+ font-size: 1.2em;
+ font-style: normal;
+ font-weight: bold;
+}
+
+body {
+ font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
+ font-size: 73%;
+ margin: 0;
+ padding: 0;
+ background-color : #eeeeee;
+}
+
+input, select, th, td {
+ font-size:1em
+}
+
+caption {
+ font-family: Arial, Geneva, Helvetica, sans-serif;
+ font-size : 1.3em;
+ font-weight: bold;
+ margin: 0;
+ padding: 5px 0 3px 0;
+ text-align: left;
+}
+
+div.bookcover {
+ float: right;
+}
+
+div.details td.details {
+ text-align: left;
+}
+
+div.details ul {
+ list-style-type: circle;
+ margin-left: 0;
+ text-align: left;
+}
+
+div.error {
+ padding: 3px 10px 3px 10px;
+ width: 75%;
+}
+
+div.error li {
+ margin-bottom: .5em;
+}
+
+div.form, div.details {
+ margin: 0 auto;
+ padding: 0 0 0 6px;
+}
+
+div.notes {
+ text-align: left;
+}
+
+div.sidebar-box+div.sidebar-box {
+ margin-top: 5px;
+}
+
+div.tab {
+ display: block;
+ margin-right: 0px;
+ width: 100%;
+}
+
+div.tab p {
+ margin: 0;
+ padding: 3px 0;
+}
+
+div.tab p.MARCtag {
+ clear: both;
+ font-weight: bold; /* style for tag definition (700 - Statement of responsability) */
+ margin: 0;
+ padding: 2px;
+}
+
+div.tab table {
+}
+
+div.tabbloc {
+ font-family: Arial, Helvetica, sans-serif;
+}
+
+div.table {
+ width: 95%;
+}
+
+dl.details dt {
+ font-weight: bold;
+ margin: .5em 0;
+}
+
+dl.details dd {
+ margin-left: 1em;
+}
+
+dl.details ul {
+ padding: 0;
+ margin-left: 1em;
+}
+
+dl.details ul p {
+ margin-left : 0;
+}
+
+em.new {
+ font-style: normal;
+ font-weight: bold;
+}
+
+form {
+ display: inline;
+ margin: 0;
+ padding: 0;
+}
+
+h1 {
+ font-size: 1.8em;
+ padding: 5px 0 3px 0;
+}
+
+h1,h2,h3,h4,h5,h6 {
+ font-family: arial, geneva, helvetica, sans-serif;
+ margin: 0;
+}
+
+h1.logo {
+ display: inline;
+ margin: 10px 0 0 10px;
+
+}
+
+h1.title {
+ font-style: italic;
+ padding: 5px 0 3px 0;
+ color: navy;
+}
+
+h2 {
+ font-size: 1.6em;
+ padding: 5px 0 3px 0;
+
+}
+
+h2#libraryname {
+ padding-left : 5px;
+}
+
+h3 {
+ font-size: 1.4em;
+ padding: 5px 0 3px 0;
+}
+
+h3.author {
+ padding: 0 0 3px 15px;
+}
+
+h3+p {
+ margin: .4em 0 .4em 0;
+}
+
+h4 {
+ font-size: 1.3em;
+ padding: 5px 0 3px 0;
+}
+
+h5 {
+ font-size: 1.2em;
+ margin: 0;
+ padding: 10px 0 2px 0;
+}
+
+h5+p {
+ margin-top: 0;
+ padding-top: 0;
+}
+
+h6 {
+ font-size: 1.1em;
+}
+
+input.add, a.add {
+ background-image: url(../images/add.gif);
+}
+
+input.addchecked, a.addchecked {
+ background-image: url(../images/addtobasket.gif);
+}
+
+input.back, a.back {
+ background-image: url(../images/back.gif);
+}
+
+input.brief, a.brief {
+ background-image: url(../images/brief.gif);
+}
+
+input.cancel {
+ font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
+ font-size : .9em;
+ font-weight: bold;
+ padding: 2px;
+}
+
+input.cart, a.cart {
+ background-image: url(../images/cart.gif);
+}
+
+input.clearall, a.clearall {
+ background-image: url(../images/clearbasket.gif);
+}
+
+input.close, a.close {
+ background-image: url(../images/close.gif);
+}
+
+input.delete, a.delete {
+ background-image: url(../images/delete.gif);
+}
+
+input.detail, a.detail {
+ background-image: url(../images/detail.gif);
+}
+
+input.edit, a.edit {
+ background-image: url(../images/edit.gif);
+}
+
+input.icon {
+ background-position: left;
+ background-repeat: no-repeat;
+ font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
+ font-size : .9em;
+ font-weight: bold;
+ padding: 2px 2px 2px 22px;
+}
+
+input.isbd, a.isbd {
+ background-image: url(../images/isbd.gif);
+}
+
+input.print, a.print {
+ background-image: url(../images/print2.gif);
+}
+
+input.remove, a.remove {
+ background-image: url(../images/remove.gif);
+}
+
+input.reserve, a.reserve {
+ background-image: url(../images/placereserve.gif);
+}
+
+input.send, a.send {
+ background-image: url(../images/send.gif);
+}
+
+input.shelf, a.shelf {
+ background-image: url(../images/addtoshelf.gif);
+}
+
+input.trash, a.trash {
+ background-image: url(../images/trash.gif);
+}
+
+p {
+ padding: 0 10px 0 10px;
+}
+
+p.error, div.error {
+ font-weight: normal;
+ margin: auto;
+ padding: 5px 20px 5px 20px;
+}
+
+p.error+p.error, div.error+div.error {
+ margin-top: 5px;
+}
+
+p+h3 {
+ margin-top: .6em;
+}
+
+p+h5 {
+ margin: 0;
+ padding: 3px 0 2px 0;
+}
+
+span.itemicon {
+ float : left;
+ font-size: .9em;
+ margin: 2px;
+ white-space: nowrap;
+}
+
+span.print {
+ font-size: .7em;
+ font-weight: normal;
+ padding-left: .7em;
+}
+
+table {
+ border-collapse: collapse;
+ margin: 5px 0 5px 0;
+ padding: 0;
+}
+
+*html td, *html th {
+ font-size : .8em;
+}
+
+td {
+ padding: 3px;
+}
+
+td.input, div.form td, div.details td {
+ border-left: 0;
+ border-right: 0;
+ padding: 2px 2px 2px 4px;
+ text-align: right;
+}
+
+td.credit {
+ text-align: right;
+}
+
+td.debit {
+ text-align: right;
+}
+
+td.sum, th.sum {
+ text-align: right;
+}
+
+td.sum {
+ font-weight: bold;
+}
+
+td.label {
+ font-weight: bold;
+ line-height: 1.5em;
+ padding: 4px;
+}
+
+td.label, div.form th, div.details th {
+ border-right: 0;
+ border-top: 0;
+ font-weight: bold;
+ padding: 2px 2px 2px 4px;
+ text-align: left;
+ vertical-align: top;
+}
+
+td.search-options select {
+}
+
+td:last-child {
+ padding: 3px;
+}
+
+th {
+ font-weight: bold;
+ padding: 2px;
+}
+
+th a {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+th:last-child {
+ font-weight: bold;
+ padding: 2px;
+}
+
+th[scope="row"] {
+ font-weight: normal;
+ text-align: right;
+}
+
+ul#facets {
+ margin: 3px;
+}
+
+#nav ul#facets {
+ margin : 0;
+ padding : 0;
+}
+
+#nav ul#facets li {
+ font-weight: bold;
+ text-align: left;
+}
+
+#nav ul#facets li#branch_facet, #nav ul#facets li#subject_facet, #nav ul#facets li#series_facet, #nav ul#facets li#author_facet {
+}
+
+#nav ul#facets ul li {
+ border: 0;
+ font-size: .95em;
+ font-weight: normal;
+ padding: 2px;
+ text-align: left;
+}
+
+#nav ul#facets ul li a {
+ font-weight: normal;
+ text-decoration: underline;
+}
+
+#nav ul#facets ul li.showmore {
+ text-align: center;
+}
+
+#nav ul#facets ul li.showmore a {
+ font-weight: bold;
+ text-decoration: none;
+}
+
+/* Tabs */
+ul.link-tabs {
+ list-style-type: none;
+ margin: 9px 0 -2px 5px;
+ padding: 0;
+}
+
+ul.link-tabs li {
+ display: inline;
+ padding: 0px;
+}
+
+ul.link-tabs li a {
+ font-weight: bold;
+ padding: 2px 4px 2px 4px;
+ text-decoration: none;
+}
+
+ul.link-tabs li#power_formButton a, ul.link-tabs li#proximity_formButton a {
+ padding: 2px 4px 3px 4px;
+}
+
+ul.link-tabs li.off a {
+}
+
+ul.link-tabs li.off a:hover {
+ padding: 2px 3px 2px 4px;
+}
+
+ul.link-tabs li.on a {
+}
+
+.clear {
+ clear: both;
+ line-height: .1em;
+}
+
+.content-block {
+ padding: 5px;
+}
+
+#home {
+ text-align : center;
+}
+
+#home #searchform input.submit {
+ font-size : 1.3em;
+}
+
+div#advanced-search p {
+ margin: .4em;
+
+}
+
+div#advanced-search fieldset {
+ /*margin-left : -1em;*/
+ margin-bottom: .3em;
+ background-color : #eeeeee;
+
+}
+
+div#advanced-search fieldset p {
+ margin-left : 1em;
+ white-space: nowrap;
+
+
+}
+
+table.itemtypes {
+ border-collapse: separate;
+ border-spacing: 3px;
+ display: block;
+ padding: 0;
+ margin: 0;
+}
+
+div#advanced-search legend, div#sidebar legend {
+ font-weight: bold;
+}
+
+div#advanced-search label {
+
+}
+
+.count {
+ font-weight: normal;
+}
+
+.current {
+ font-weight: bold;
+ padding: 1px 5px 1px 5px;
+ text-decoration: none;
+}
+
+.detail-sidebar {
+ float: right;
+ padding: 5px;
+ margin-left : 15px;
+ margin-right : 5px;
+ text-align: center;
+ width : 25%;
+}
+
+.detail-sidebar .further {
+ float: none;
+ text-align: left;
+ width : 90%;
+}
+
+.further {
+ margin: 5px;
+ text-align: left;
+ width : 90%;
+}
+
+.ex {
+ font-family: "Courier New", Courier, monospace;
+}
+
+.further h4 {
+ padding: 2px;
+}
+
+.further li {
+ padding: 2px 0;
+}
+
+.further ul, .further li {
+ list-style: none;
+ margin: .5em 0 .7em .4em;
+ padding: 0;
+}
+
+.inline {
+ display: inline;
+}
+
+.item-datedue {
+ font-style: italic;
+}
+
+.item-details {
+ display: block;
+ margin: 0 0 0 25px;
+}
+
+.item-reserved, .item-notforloan, .item-lost, .item-cancelled, .item-damaged, .item-reserved {
+ display: block;
+}
+
+.labelsubfield {
+ clear: both; /* style for each subfield (like : a Publication year), just before the biblio subfield */
+ float: left;
+ font-weight: bold;
+ margin-left: 30px;
+ width: 12em;
+}
+
+.left {
+ float: left;
+}
+
+.loggedin {
+ font-weight: bold;
+}
+
+.login-note {
+ width: 35%;
+}
+
+.menu {
+ line-height: 3em;
+ font-size: 1.2em;
+ margin: 0;
+ padding: 5px;
+}
+
+.menu a.logout {
+ font-weight: bold;
+ padding: 3px 15px 3px 15px;
+ text-decoration: none;
+}
+
+.menu a:link, #members a:link {
+ padding: 2px;
+}
+
+.menu a:visited, #members a:visited {
+ padding: 2px;
+}
+
+.menu a:hover, #members a:hover {
+ padding: 2px;
+}
+
+.menu a:active, #members a:active {
+ padding: 2px;
+}
+
+.menu input {
+}
+
+.menu label {
+ font-weight: bold;
+}
+
+.menu p {
+ margin: 0;
+ padding: 0;
+}
+
+.menu p+p {
+ margin-top: 5px;
+}
+
+.note {
+ margin: 10px auto;
+ padding: 4px 4px 4px 4px;
+ width: 35%;
+}
+
+.opac-detail {
+ padding: 4px;
+}
+
+.opac-detail dd {
+ display: block;
+ line-height: 1.5em;
+ padding: 4px;
+ text-align: right;
+}
+
+.operations {
+ margin-top: 7px;
+ padding: 0 10px;
+ text-align: center;
+ width: 100%;
+}
+
+.operations img {
+ padding: 5px;
+}
+
+.operations li {
+ list-style-type: none;
+ margin: 0;
+ padding-bottom: 2px;
+}
+
+.operations li a, .operations li a:visited {
+ background-position: top left;
+ background-repeat: no-repeat;
+ border-style: outset;
+ display: block;
+ padding: 3px 3px 3px 26px;
+ text-decoration: none;
+}
+
+.searchresults a.reserve, .searchresults a.reserve:visited {
+ background-position: top left;
+ background-repeat: no-repeat;/*
+ border-style: outset;*/
+ float: right;
+ padding: 2px 3px 2px 26px;
+ /*text-decoration: none;*/
+}
+
+.operations li a:active {
+ border-style: inset;
+}
+
+.operations ul {
+ margin: 0;
+ padding: 0;
+ width: 90%;
+}
+
+.overdue {
+ font-weight: bold;
+}
+
+.pages {
+ line-height : 1.8em;
+ text-align: center;
+}
+
+.rejected {
+ text-decoration: line-through;
+}
+
+.right {
+ float: right;
+}
+
+.search-main {
+ float: left;
+ width: 65%;
+}
+
+.searchresults input, .searchresults label, .searchresults select {
+ font-size: .8em;
+}
+
+.searchresults p {
+ margin: 0;
+ padding: 0;
+ padding-top : .6em;
+}
+
+.searchresults p img {
+ vertical-align: middle;
+}
+
+.searchresults table td {
+ vertical-align: top;
+}
+
+p.searchresults {
+ margin-top : -5px;
+ text-align : right;
+ vertical-align : middle;
+ padding-bottom : 3px;
+}
+
+.selected {
+ text-decoration: none;
+}
+
+.sidebar-box {
+ margin-bottom: 0;
+}
+
+.sidebar-box h3, .sidebar-box h4 {
+ margin-left: 10px;
+}
+
+.sidebar-box p {
+ margin: 3px 10px;
+ padding: 0;
+}
+
+.submit {
+ font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
+ font-size : .9em;
+ font-weight: bold;
+ padding: 2px;
+}
+
+.term {
+ font-weight: bold;
+}
+
+.thumbnail {
+ border: 0;
+ float: left;
+ margin: 0 5px 5px 0;
+}
+
+.title {
+ font-style: italic;
+ font-weight: bold;
+}
+
+#sidebar .content-block {
+ margin : 0 10px 0 0;
+}
+
+form#auth h3 {
+ font-size : 1.1em;
+}
+
+#footer {
+ clear: both;
+ padding: 10px;
+ text-align: center;
+}
+
+#corner {
+ position: absolute;
+ top: 10px;
+ right: 5px;
+}
+
+#corner a.cart {
+ background-image : url(../images/cart-small.gif);
+ background-position: left;
+ background-repeat : no-repeat;
+ padding: 0 15px;
+ text-decoration: none;
+}
+
+#languages {
+ display: inline;
+}
+
+#languages ul {
+ display : inline;
+ list-style: none;
+ margin: 0;
+ padding : 0;
+}
+
+#languages ul li {
+ display: inline;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: .9em;
+}
+
+#languages ul li a {
+ font-weight: normal;
+ padding: 0 3px;
+ text-decoration: none;
+}
+
+#loose_form label, #keyword_form label, #precise_form label, #cql_form label, #advanced label, #cql label, #power label, #proximity label {
+ font-weight: bold;
+ text-align: right;
+}
+
+#loose_form, #keyword_form, #precise_form, #cql_form, #advanced, #cql, #power, #proximity {
+ margin: 5px;
+ width: 96%;
+}
+
+/*#main {
+ margin-left: 20%;
+ margin-right: 0;
+ padding: 0;
+ position: relative;
+}*/
+
+#masthead {
+ margin: 0;
+ margin-bottom : 1em;
+ padding: 0;
+ text-align:center;
+
+}
+
+#members {
+ font-size: .8em;
+ font-weight: bold;
+ padding: 4px 0 4px 0;
+}
+
+#members a.card {
+ background-image: url(../images/card.gif);
+ background-position: left;
+ background-repeat: no-repeat;
+ display: block;
+ padding-left: 39px;
+}
+
+#members a.logout {
+ font-weight: bold;
+ padding: 0 .3em 0 .3em;
+ text-decoration: none;
+}
+
+#members li {
+ display: inline;
+ list-style: none;
+ margin: 0;
+}
+
+#members ul li a:link, #members ul li a:visited, #members ul li a:hover, #members ul li a:active, #members span.members {
+ padding : 4px;
+}
+
+#members ul li:last-child {
+}
+
+#members ul li a:hover {
+}
+
+#members ul {
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+/*#nav {
+ float: left;
+ margin: 0;
+ padding: 0;
+ width: 20%;
+}*/
+
+#nav a {
+ font-family: Arial, Geneva, Helvetica, sans-serif;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+#nav h6 {
+ padding: 3px;
+ text-align: center;
+}
+
+#nav li ul li {
+ font-family: Arial, Geneva, Helvetica, sans-serif;
+ list-style: none;
+ margin: 0;
+ padding: 5px 3px 5px 3px;
+ text-align: right;
+}
+
+#nav li ul li a {
+ font-family: Arial, Geneva, Helvetica, sans-serif;
+ font-weight: bold;
+ text-decoration: none;
+}
+
+#nav ul {
+ margin: 0;
+ padding: 0;
+}
+
+#nav ul li {
+ font-family: Arial, Geneva, Helvetica, sans-serif;
+ list-style: none;
+ margin: 0;
+ padding: 3px 8px 3px 3px;
+ text-align: right;
+}
+
+#nav ul li+li {
+ margin: 0;
+}
+
+#power_formButton, #proximity_formButton {
+}
+
+#results, .results {
+ font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
+ margin: 0;
+ padding: 7px 0 10px 0;
+}
+
+#search-footer {
+ margin: auto;
+ text-align: center;
+}
+
+#search-footer a {
+ margin: 3px 5px 3px 5px;
+ padding: 2px 5px;
+ text-decoration: none;
+}
+
+#searchform input.submit {
+ font-size: .8em;
+}
+
+#search-sidebar {
+ float: right;
+ margin: 10px;
+ padding: 3px;
+ width: 30%;
+}
+
+#search-sidebar .sidebar-box label {
+ display: block;
+ text-align: left;
+}
+
+/*#sidebar {
+ float: right;
+ margin: 20px;
+ padding: 5px;
+ width: 20%;
+}*/
+
+#sidebar .submit {
+ font-family: Verdana, Arial, Geneva, Helvetica, sans-serif;
+ font-weight: bold;
+ padding: 2px;
+ font-size: 1em;
+}
+
+#sidebar h3 {
+ font-family: Arial, Geneva, Helvetica, sans-serif;
+ margin: 0;
+ padding: 5px 0 1px 0;
+}
+
+#sort {
+ margin: .3em;
+}
+
+#sort, #sort select, #sort input {
+}
+
+#starFull {
+ background: url(../images/bluestars.png) top left no-repeat;
+ height: 25px;
+ margin: 0;
+ padding: 0;
+}
+
+#starMT {
+ background: url(../images/emptystars.png) top left no-repeat;
+ height: 25px;
+ margin: 0 3px 0 30px;
+ padding: 0;
+ position: relative;
+ width: 100px;
+}
+
+#window {
+ margin-left: 2%;
+ margin-right: 2%;
+ margin-top: 2%;
+ padding: 10px;
+}
+
+#window .class {
+ display: block;
+ font-weight: bold;
+ padding: 0 0 5px 3px;
+}
+
+#window div.menu {
+ margin: 0;
+
+}
+
+div#item-details {
+ margin-bottom : 1.5em;
+}
+
+div#item-details img {
+ float : left;
+ padding : 1em;
+}
+
+div#item-details p {
+ margin : .1em 0;
+ line-height : 1.6em;
+}
+
+div#holdings table {
+ width : 100%;
+}
+
+div#holdings td, div#holdings th {
+ padding : 5px;
+}
+
+div#holdings, div#descriptions, div#reviews, div#serials, div#publicshelves, div#privateshelves, div#fines, div#waiting, div#overdues, div#issues, div#reserves {
+ margin-top : 4px;
+ padding : .7em;
+ width : 90%;
+}
+
+#usermenu {
+ font-size: .9em;
+ font-weight: bold;
+ margin-top : -1.1em;
+ margin-bottom : 1em;
+ padding: 4px 0 4px 0;
+
+
+}
+
+#usermenu li {
+ display: inline;
+ list-style: none;
+ margin: 0;
+}
+
+#usermenu ul li a:link, #usermenu ul li a:visited, #usermenu ul li a:hover, #usermenu ul li a:active, #usermenu span.members {
+ padding : 4px;
+}
+
+#usermenu ul li:last-child {
+}
+
+#usermenu ul li a:hover {
+}
+
+#usermenu ul {
+ margin: 0;
+ padding: 0;
+ text-align: right;
+}
+
+table.featured-item {
+ border-collapse : separate;
+ border-spacing: 9px;
+ margin : 5px;
+ text-align : center;
+}
+
+table.featured-item td {
+ vertical-align : top;
+}
+
+table.featured-item a img {
+ margin : auto;
+}
+
+table.featured-item a.title {
+ display : block;
+ font-size : 1em;
+ margin-bottom : .4em;
+}
+
+table.featured-item .author {
+ display : block;
+ font-size : .95em;
+ margin-bottom : .2em;
+}
+
+table.featured-item .publisher {
+ display : block;
+ font-size : .8em;
+}
+
+/* COLORS, BACKGROUNDS, AND BORDERS */
+
+a {
+ color: #006699;
+}
+
+a:link.current {
+ background-color: transparent;
+ color: #3366CC;
+}
+
+a:link.nav {
+ background-color: #EFF1DC;
+ border: 1px solid #CCCC99;
+ color: #3366CC;
+}
+
+a:visited {
+ color: #006699;
+}
+
+a:visited.current {
+ background-color: transparent;
+ color: #3366CC;
+}
+
+a:visited.nav {
+ background-color: #EFF1DC;
+ border: 1px solid #CCCC99;
+ color: #3366CC;
+}
+
+a:hover {
+ color: orange;
+}
+
+a:hover.current {
+ background-color: #CCFF00;
+ color: #CC3333;
+}
+
+a:hover.nav {
+ background-color: #FFFFCC;
+ border: 1px solid #CCCC99;
+ color: #CC3333;
+}
+
+a:active {
+ color: #990033;
+}
+
+a:active.current {
+ background-color: #99CC00;
+ color: #FFFF99;
+}
+
+a:active.nav {
+ background-color: #FFFFCC;
+ border: 1px solid #CCCC99;
+ color: #D25500;
+}
+
+a.reserve {
+ background-color: #006699;
+ color: White;
+}
+
+body {
+ background-color: #eeeeee;
+}
+
+body#withsidebar #main {
+ border: 0;
+
+}
+ul {
+background-color:#eeeeee;
+text-align: left;
+}
+
+caption {
+ color: #000066;
+}
+
+div.error h3 {
+ color: #990000;
+}
+
+div.form, div.details {
+ background-color: #ffffff;
+}
+
+div.tab {
+ background-color: transparent;
+}
+
+div.tab p {
+ border-bottom: 1px solid #FFFFFF;
+ border-top: 1px solid #D8DEB8;
+}
+
+div.tabbloc {
+ background-color: transparent;
+}
+
+div#advanced-search fieldset {
+ border-right : 1px none #999999;
+ border-top : 1px none #999999;
+ border-bottom : 1px none #999999;
+ border-left : 1px none #999999;
+}
+
+div#advanced-search legend {
+ color : #003366;
+}
+
+dl.details dt {
+ color: #000066;
+}
+
+em.new {
+ color: #CC3333;
+}
+
+h1,h2,h3,h4,h5,h6 {
+ color: navy;
+ background-color:navy;
+ color:white;
+}
+
+h1.logo {
+ color: #D3DFAD;
+
+}
+
+h1#libraryname a {
+ color: #000066;
+ margin-left: .3em;
+ text-decoration: none;
+}
+
+input.icon {
+ background-color: #6699CC;
+ border: 1px outset #666666;
+ color: #FFFFCC;
+}
+
+p.availability {
+ color: #666666;
+ font-size: .9em;
+}
+
+p.error, div.error {
+ background-color: #FFFFCC;
+ border: 1px dashed #CC6600;
+}
+
+span.itemicon {
+ background-color : #F8F8EB;
+ border: 1px solid #D8DEB8;
+}
+
+table {
+ background-color: #FFFFFF;
+}
+
+table.itemtypes td {
+ background-color: #F8F8EB;
+ border: 1px solid #D8DEB8;
+}
+
+td {
+ background-color: #FFFFFF;
+ border-bottom: 1px solid #DDDDDD;
+ border-right: 1px solid #DDDDDD;
+}
+
+td.input, div.form td, div.details td {
+ border-bottom: 1px solid #CCCCCC;
+ border-left: 0;
+ border-right: 0;
+ color: #000000;
+}
+
+td.credit {
+ color: #000066;
+}
+
+td.debit {
+ color: #990000;
+}
+
+td.sum, th.sum {
+}
+
+td.sum {
+ background-color : #FFFFCC;
+}
+
+td.label {
+ border-bottom: 1px solid #CCCCCC;
+ border-left: 1px solid #CCCCCC;
+ color: #000088;
+}
+
+td.label, div.form th, div.details th {
+ background-color: #FFFFFF;
+ border-bottom: 1px solid #CCCCCC;
+ border-left: 1px solid #CCCCCC;
+ border-right: 0;
+ border-top: 0;
+ color: #000088;
+}
+
+div.details {
+ padding: 5px;
+
+}
+
+div.details table, div.details td, div.details th {
+ border: 0;
+ border-bottom: 1px solid #DDDDDD;
+}
+
+td.overdue {
+ color: #CC0000;
+}
+
+td:last-child {
+ border-bottom: 1px solid #CCCCCC;
+ border-right: 0 solid #CCCCCC;
+}
+
+th {
+ background-color: #EFF1DC;
+ border-bottom: 1px solid #CCCCCC;
+ border-right: 1px solid #CCCCCC;
+}
+
+th:last-child {
+ background-color: #EFF1DC;
+ border-bottom: 1px solid #CCCCCC;
+ border-right: 0 solid #CCCCCC;
+}
+
+th[scope="row"] {
+ background-color: #E7E7CA;
+}
+
+tr.highlight {
+ background-color: #F8F8EB;
+}
+
+tr.highlight th[scope="row"] {
+ background-color: #EEEEEE;
+}
+
+tr.overdue td {
+ background-color: #FFDDDD;
+}
+
+input.cancel {
+ background-color: #990033;
+ border: 1px outset #666666;
+ color: #FFFFCC;
+}
+
+.available {
+ color : #006600;
+}
+
+.content-block {
+ background-color: #FFFFFF;
+}
+
+.current {
+ background-color: #FFFFFF;
+ color: #3366CC;
+}
+
+.detail-sidebar {
+ background-color: #EEEEEB;
+}
+
+.further {
+ background-color: #EEEEEB;
+ border: 2px solid #DDDED3;
+ color: #CCCC99;
+}
+
+.further h4 {
+ background-color: #D8DEB8;
+}
+
+.further li {
+}
+
+.issued {
+ color: #999999;
+}
+
+.labelsubfield {
+}
+
+.loggedin {
+ color: #D8DEB8;
+}
+
+.loggedinusername {
+ color: #666666;
+}
+
+.marcsubfieldletter {
+ background-color: #EFF1DC;
+}
+
+.marcsubfieldname {
+ background-color: #EFF1DC;
+}
+
+.MARCtag {
+ background-color: #EEEEEE;
+ color: #000066; /* style for tag definition (700 - Statement of responsability) */
+}
+
+.menu {
+ background-image : url(../images/menu-background.gif);
+ background-repeat: repeat-x;
+ background-color: #6699CC;
+ border-top: 1px solid #335599;
+ border-bottom: 1px solid #335599;
+ color: #FFFFFF;
+
+}
+
+.menu a:link {
+ color : #FFFFCC;
+}
+
+.menu a:visited {
+ color : #FFFFCC;
+}
+
+.menu a:hover {
+ color : #FFFFFF;
+}
+
+.menu a:active {
+ color : #FFFF99;
+}
+
+#members a:link {
+ color: #0099CC;
+}
+
+#members a:visited {
+ color: #0099CC;
+}
+
+#members a:hover {
+ color: #990000;
+}
+
+#members a:active {
+ color: #990000;
+}
+
+.menu input.submit {
+ background-color : #6BA037;
+ color: #FFFFFF;
+}
+
+.note {
+ background-color: #EEEEEB;
+ border-bottom: 1px solid #DDDED3;
+ border-left: 1px solid #DDDED3;
+ border-right: 1px solid #DDDED3;
+ border-top: 1px solid #DDDED3;
+}
+
+.opac-detail {
+ background-color: #FFFFCC;
+}
+
+.opac-detail dd {
+ border-bottom: 1px solid #E7E7CA;
+ color: #000000;
+}
+
+.operations li a, .operations li a:visited {
+ background-color: #6699CC;
+ border: 2px solid #D8DEB8;
+ color: #FFFFCC;
+}
+
+.operations li a:hover {
+ background-color: #0099FF;
+ color: #FFFF99;
+}
+
+.operations li a:active {
+ background-color: #0099FF;
+ color: #FFFF99;
+}
+
+
+.item-reserved {
+ color : #009933;
+}
+
+.item-datedue {
+ color: #999999;
+}
+
+.item-notforloan, .item-lost, .item-cancelled, .item-damaged, .item-reserved {
+}
+
+.searchresults td, .searchresults th, .searchresults table {
+ border: 0;
+}
+
+.searchresults tr {
+ border-bottom : 1px solid #CCCCCC;
+}
+
+.searchresults table {
+ border-top : 0px solid #CCCCCC;
+}
+
+p.searchresults {
+ background-color : #EFF1DC;
+}
+
+.searchresults a.reserve {
+ background-color : transparent;
+ color : #006699;/*
+ background-color : #6699CC;
+ border: 1px outset #666666;
+ color : White;*/
+}
+
+.sidebar-box {
+ border: 1px dashed #CCCCCC;
+}
+
+.subfield {
+ background-color: #EFF1DC;
+}
+
+.subfieldvalue {
+ background-color: #FFFFFF;
+}
+
+.submit {
+ background-color: #EEC95A;
+ border: 3px outset #666666;
+ color: #FFFFFF;
+}
+
+.term {
+ background-color: #FFFFCC;
+ color: #990000;
+}
+
+.unavailable {
+ color: #990033;
+}
+
+#footer {
+ border-top: 1px solid #EEEEEE;
+}
+
+#languages ul li a {
+ border: 1px solid #D8DEB8;
+}
+
+#languages ul li a:hover {
+ background-color: #FFFFCC;
+}
+
+#main {
+ background-color: transparent;/*
+ border-top: 1px solid #EEEEEE;*/
+}
+
+#masthead {
+ background-color: #FFFFFF;/*
+ border-bottom: 1px solid #EEEEEE;*/
+}
+
+#members {
+ background-image : url(../images/member-menu-background.gif);
+ background-repeat: repeat-x;
+ border-top: 1px solid #9999CC;
+ border-bottom : 1px solid #9999CC;
+ background-color: #AFBCCF;
+ color: #000066;
+}
+
+#members ul li a:link, #members ul li a:visited, #members span.members {
+ background-image : url(../images/member-menu-background-link.gif);
+ background-repeat: repeat-x;
+ border-left: 1px solid #9999CC;
+ color: #006699;
+}
+
+#members ul li:last-child a {
+ border-right : 1px solid #9999CC;
+}
+
+#members ul li a:hover, #members ul li a:active {
+ background-image : url(../images/member-menu-background-hover.gif);
+ background-repeat: repeat-x;
+}
+
+#members a {
+ text-decoration: none;
+}
+
+#members a.logout:link, #members a.logout:visited, #members a.logout:hover, #members a.logout:active {
+ background-image : url(../images/member-menu-background-logout.gif);
+ background-repeat: repeat-x;
+ color: #000000;
+}
+
+#members a:hover.logout {
+ background-image : url(../images/member-menu-background-logout-hover.gif);
+ background-repeat: repeat-x;
+ color: #000000;
+}
+
+#nav {
+ /*background-color: #EFF1DC;*/
+ border : 1px solid #EFF1DC;
+
+}
+
+#nav h6 {
+ background-color: #E7E7CA;
+ line-height : 1.8em;
+ margin-left: -1px;
+ margin-top : -1px;
+ margin-right : -1px;
+}
+
+#nav li ul li {/*
+ background-color: #E7E7CA;*/
+ border-bottom: 0 solid #D8DEB8;
+ border-left: 0 solid #FFFFCC;
+ border-right: 0 solid #006699;
+ border-top: 0 solid #FFFFCC;
+}
+
+#nav li ul li a {
+ color: #0000FF;
+}
+
+#nav li ul li a:link {
+ color: #335599;
+}
+
+#nav li ul li a:visited {
+ color: #335599;
+}
+
+#nav li ul li a:hover {
+ color: #CC3333;
+}
+
+#nav ul li {
+ /* background-color: #EFF1DC; */
+ border-bottom: 0px solid #CCCC99;
+ border-left: 0 solid #FFFFCC;
+ border-right: 0 solid #006699;
+ border-top: 0 solid #FFFFCC;
+}
+
+#nav ul li+li {
+ border-bottom: 0px solid #CCCC99;
+ border-left: 0 solid #FFFFCC;
+ border-right: 0 solid #006699;
+}
+
+#results, .results {
+ color: #000066;
+}
+
+#search-sidebar {
+ background-color: #F8F8EB;
+}
+
+#sidebar {
+ /*background-color: #F8F8EB;
+ border: 1px dashed #666666;*/
+}
+
+#sidebar .content-block {
+ background-color : #EEEEEE;
+}
+
+#sidebar fieldset {
+ background-color: #F9F9FF;
+}
+
+#sidebar legend {
+ color : #003366;
+}
+
+#sidebar .submit {
+/* background-color: #EEC95A; */
+ color: #FFFFFF;
+}
+
+#sidebar h3 {
+ color: #000066;
+}
+
+#window {
+ background-color: #E7E7CA;
+ border-left: 1px solid #CCCC99;
+}
+ul.link-tabs {
+}
+
+ul.link-tabs li {
+}
+
+ul.link-tabs li a {
+ border-top: 1px solid #DDDDDD;
+ border-left : 1px solid #DDDDDD;
+ border-right : 1px solid #666666;
+}
+
+ul.link-tabs li.on a {
+ background-color: #FFFFFF;
+ border-bottom: 1px solid #FFFFFF;
+}
+
+ul.link-tabs li.off a {
+ background-color: #EEEEEB;
+ border-bottom: 1px solid #DDDDDD;
+}
+
+ul.link-tabs li.off a:hover {
+ background-color: #FFFFEC;
+ border-top: 1px solid #BEBF84;
+ border-left : 1px solid #BEBF84;
+ border-right : 2px solid #333333;
+}
+
+ul.link-tabs li a.debit {
+ background-color : #FFFF99;
+ color : #990033;
+}
+
+div#holdings, div#descriptions, div#reviews, div#serials, div#publicshelves, div#privateshelves, div#fines, div#waiting, div#overdues, div#issues, div#reserves {
+ border : 1px solid #DDDDDD;
+}
+
+div#holdings table {
+ border-top : 1px solid #DDDDDD;
+ border-right : 1px solid #DDDDDD;
+}
+
+div#holdings td, div#holdings th {
+ border-left : 1px solid #DDDDDD;
+ border-bottom : 1px solid #DDDDDD;
+}
+
+#usermenu {
+ background-image : url(../images/usermenu-background.gif);
+ background-repeat: repeat-x;
+ background-color: #EEEEEB;
+ border-top: 1px solid #EEEEEE;
+ border-bottom: 1px solid #335599;
+ color: #000000;
+}
+
+#usermenu ul li a:link, #usermenu ul li a:visited {
+ background-image : url(../images/usermenu-background.gif);
+ background-repeat: repeat-x;
+ border-left: 1px solid #9999CC;
+ color: #006699;
+}
+
+#usermenu ul li:last-child a {
+ border-right : 1px solid #9999CC;
+}
+
+#usermenu ul li a:hover, #usermenu ul li a:active {
+ background-image : url(../images/usermenu-background-hover.gif);
+ background-repeat: repeat-x;
+}
+
+#usermenu a {
+ text-decoration: none;
+}
+
+table.featured-item {
+ border : 0;
+}
+
+table.featured-item td {
+ border : 1px solid #CCCCCC;
+}
+
+table.featured-item a img {
+}
+
+table.featured-item a.title {
+}
+
+table.featured-item .author {
+}
+
+table.featured-item .publisher {
+}
+h1{
+background-color: #eeeeee;
+color: navy;
+background-image: url(./acceuil.jpg);
+background-repeat:no-repeat;
+}
+h1.authority
+{
+background-image:none;
+
+}
\ No newline at end of file
--- /dev/null
+@import url("../../../lib/yui/reset-fonts-grids.css");
+@import url("../../../lib/yui/skin.css");
+
+a {
+ font-weight : bold;
+}
+
+a, a:visited {
+ color : #006699;
+}
+
+a:hover,input.editshelf:hover,a.editshelf:hover,input.deleteshelf:hover {
+ color : #990033;
+}
+
+body {
+ background-color : white;
+ text-align : left;
+ padding : 0 0 2.5em 0;
+}
+
+caption {
+ font-size : 110%;
+ text-align : left;
+ font-weight : bold;
+}
+
+fieldset {
+ background-color: #FFF;
+ border : 2px solid #EEEEEE;
+ margin : 1em 1em 1em 0;
+ padding : 1em;
+}
+
+h1,h2,h3,h4,h5,h6 {
+ font-weight : bold;
+ margin : .5em 0;
+}
+
+h1 {
+ font-size : 138.5%;
+}
+
+h2 {
+ font-size : 134%;
+}
+
+h3 {
+ font-size : 123.1%;
+}
+
+h4 {
+ font-size : 116%;
+}
+
+h5 {
+ font-size : 108%;
+}
+
+h6 {
+ font-size : 100%;
+}
+
+input[type=submit],
+input[type=button],
+input[type=reset],
+fieldset.brief input[type=submit],
+fieldset.brief input[type=button],
+fieldset.brief input[type=reset]
+{
+ background: #f4f9fc; /* Old browsers */
+ background: -moz-linear-gradient(top, #f4f9fc 0%, #dfeefa 4%, #bfd5ea 93%, #a1c4e2 97%, #b8d0e6 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f4f9fc), color-stop(4%,#dfeefa), color-stop(93%,#bfd5ea), color-stop(97%,#a1c4e2), color-stop(100%,#b8d0e6)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f4f9fc', endColorstr='#b8d0e6',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #f4f9fc 0%,#dfeefa 4%,#bfd5ea 93%,#a1c4e2 97%,#b8d0e6 100%); /* W3C */
+ border-top: 1px solid #cccccc;
+ border-left: 1px solid #cccccc;
+ border-right: 1px solid #eeeeee;
+ border-bottom: 1px solid #eeeeee;
+ color : #333;
+ font-size : 93%;
+ font-weight : bold;
+ padding : 4px;
+}
+
+input[type=submit]:active, input[type=button]:active, input[type=reset]:active {
+ border: 1px inset #666666;
+ float : none;
+}
+.dialog {
+ border: 1px solid #bcbcbc;
+ padding : .5em;
+ margin : 1em auto;
+ width: 65%;
+ }
+
+.dialog h2, .dialog h3, .dialog h4 {
+ margin : auto;
+ text-align : center;
+ }
+
+div.alert {
+ background: #fef8d3; /* Old browsers */
+ background: -moz-linear-gradient(top, #fef8d3 0%, #ffec91 9%, #ffed87 89%, #f9dc00 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#fef8d3), color-stop(9%,#ffec91), color-stop(89%,#ffed87), color-stop(100%,#f9dc00)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fef8d3', endColorstr='#f9dc00',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #fef8d3 0%,#ffec91 9%,#ffed87 89%,#f9dc00 100%); /* W3C */
+ text-align : center;
+}
+
+div.alert strong {
+ color : #900;
+}
+
+div.message {
+ background: #ffffff; /* Old browsers */
+ background: -moz-linear-gradient(top, #ffffff 0%, #f4f6fa 2%, #eaeef5 23%, #e8edf6 94%, #cddbf2 100%); /* FF3.6+ */
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(2%,#f4f6fa), color-stop(23%,#eaeef5), color-stop(94%,#e8edf6), color-stop(100%,#cddbf2)); /* Chrome,Safari4+ */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Chrome10+,Safari5.1+ */
+ background: -o-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* Opera11.10+ */
+ background: -ms-linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* IE10+ */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cddbf2',GradientType=0 ); /* IE6-9 */
+ background: linear-gradient(top, #ffffff 0%,#f4f6fa 2%,#eaeef5 23%,#e8edf6 94%,#cddbf2 100%); /* W3C */
+ border : 1px solid #bcbcbc;
+ width : 55%;
+}
+
+.dialog input {
+ background : #FFF none;
+ border : 1px solid #bcbcbc;
+ margin : .4em;
+ padding : .4em;
+ }
+
+
+.dialog input.back {
+ background : #FFF url(../../famfamfam/silk/arrow_left.png) no-repeat 4px center;
+ padding : .4em .4em .4em 25px;
+ }
+
+.dialog input.return {
+ background : #FFF url(../../famfamfam/silk/book_previous.png) no-repeat 4px center;
+ padding : .4em .4em .4em 25px;
+ }
+
+.dialog input.renew {
+ background : #FFF url(../../famfamfam/silk/arrow_refresh.png) no-repeat 4px center;
+ padding : .4em .4em .4em 25px;
+ }
+
+.dialog input.cancel {
+ background : #FFF url(../../famfamfam/silk/cancel.png) no-repeat 4px center;
+ padding : .4em .4em .4em 25px;
+ }
+
+input.finish {
+ background : #dbe7ff url(../../famfamfam/silk/stop.png) no-repeat 4px center;
+ border : 1px outset #666;
+ padding : .2em .2em .2em 25px;
+}
+
+table {
+ background-color: #FFF;
+ border-collapse : collapse;
+ margin : 1em 0;
+ border-right : 1px solid #dddddd;
+ border-top : 1px solid #dddddd;
+}
+
+td,th {
+ background-color: #FFF;
+ border-left : 1px solid #dddddd;
+ border-bottom : 1px solid #dddddd;
+ padding : 3px 3px;
+}
+
+th {
+ background-color:#EEE;
+ font-weight : bold;
+ padding : 2px 23px;
+ text-align : center;
+}
+
+tr.highlight td, tr.highlight th, tr.odd td {
+ background-color : #F3F3F3;
+ border-top : 1px solid #DDDDDD;
+ border-bottom : 1px solid #DDDDDD;
+}
+
+tr.even td, tr.even.highlight td {
+ background-color: #FFF;
+}
+
+.header {
+ background-image:url("../../images/ascdesc.gif");
+ background-position:right center;
+ background-repeat:no-repeat;
+ cursor:pointer;
+}
+.headerSortUp {
+ background-image:url("../../images/asc.gif");
+}
+.headerSortDown {
+ background-image:url("../../images/desc.gif");
+}
+
+p {
+ margin: .7em 0;
+}
+
+strong {
+ font-weight : bold;
+}
+
+em {
+ font-style : italic;
+}
+#borrowerdetails {
+ margin-top : 1em;
+}
+#barcode,
+#patronid {
+ font-size : 125%;
+ padding-bottom : 3px;
+}
+input.focus {
+ background-color : #FFC;
+ border : 2px inset #336699;
+}
+#checkouthelp {
+ background : #FFF url("../../famfamfam/silk/help.png") no-repeat 4px center;
+ padding : 3px 3px 3px 26px;
+ position : absolute;
+ top : 0;
+ right : 0;
+}
+div.button {
+ float : left;
+ margin-top : 2em;
+ padding : .4em 0;
+}
+div.button a:link,
+div.button a:visited,
+div.button a:hover,
+div.button a:active {
+ background : #FFF url(../../famfamfam/silk/book_previous.png) no-repeat 4px center;
+ border : 1px outset #666;
+ color : #000;
+ padding : .4em .4em .4em 25px;
+ text-decoration : none;
+}
+div.button a:active {
+ border : 1px inset #666;
+}
+
+div.koha_url {
+ border-top: none !important;
+}
+span.koha_url {
+ position: absolute;
+ right: 0;
+}
+a.koha_url {
+ text-decoration: none;
+ color: #666666;
+}
+
+div#changelanguage{
+ background-color: #fff;
+ border-top: 1px solid #CCC;
+ color : #666;
+ font-size : 85%;
+ padding : 1em;
+ margin-top : 2em;
+ }
+
+div#changelanguage a {
+ font-weight : normal;
+ padding : .5em 0;
+}
+
+div#changelanguage li.yuimenuitem {
+ font-size: 120%;
+ font-weight: normal;
+ margin: 0;
+ padding: 0 1em;
+}
+div#changelanguage li.yuimenuitem a.yuimenuitemlabel {
+ padding: 0;
+}
+
+ul#i18nMenu {
+ margin : 0;
+ padding : .2em 0;
+ }
+
+ul#i18nMenu li {
+ border-left : 1px solid #CCC;
+ display : inline;
+ list-style : none;
+ padding : 0 .4em;
+ }
+
+ul#i18nMenu li:first-child {
+ border-left : 0;
+ }
+
+ul#i18nMenu li ul li {
+ border : 0;
+ display : block;
+ padding : 0;
+ }
+
+
+ul#i18nMenu li.more a {
+ background-image : url("../../images/sprite.png");
+ background-position : 37px -940px;
+ background-repeat:no-repeat;
+ padding-right: 1.3em;
+}
+
+ul#i18nMenu li.more ul li a {
+ background-image : none;
+ padding: 0 1.3em;
+}
+
+span.lang{
+ float:left;
+ border-right : 1px solid black;
+ padding : 0 .5em;
+}
+
+div.ft {
+ clear : both;
+}
--- /dev/null
+</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
+<link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
+<link rel="stylesheet" type="text/css" href="[% themelang %]/lib/jquery/jquery-ui.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/reset-fonts-grids.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/skin.css" />
+[% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %]
+[% IF (opaclayoutstylesheet.match('^https?:|^\/')) %]
+ <link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet %]" />
+[% ELSE %]
+ <link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opaclayoutstylesheet %]" />
+[% END %]
+[% 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 %]" />
+[% END %]
+<link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
+<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no">
+<link rel="stylesheet" type="text/css" media="screen and (max-width:700px)" href="[% themelang %]/css/mobile.css" />
+[% IF ( OPACMobileUserCSS ) %]<style type="text/css" media="screen and (max-width:700px)">[% OPACMobileUserCSS %]</style>[% END %]
+[% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
+<!-- yui js -->
+<script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script>
+<script type="text/javascript" src="[% yuipath %]/container/container-min.js"></script>
+<script type="text/javascript" src="[% yuipath %]/menu/menu-min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/jquery-ui.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.hoverIntent.minified.js"></script>
+<script type="text/javascript" language="javascript" src="[% themelang %]/js/script.js"></script>
+[% IF ( OPACAmazonCoverImages ) %]
+<script type="text/javascript" language="javascript">//<![CDATA[
+ var NO_AMAZON_IMAGE = _("No cover image available");
+//]]>
+</script>
+<script type="text/javascript" language="javascript" src="[% themelang %]/js/amazonimages.js"></script>
+[% END %]
+[% IF ( SyndeticsCoverImages ) %]
+<script type="text/javascript" language="javascript">//<![CDATA[
+ var NO_AMAZON_IMAGE = _("No cover image available");
+ //]]>
+</script>
+<script type="text/javascript" language="javascript" src="[% themelang %]/js/amazonimages.js"></script> [% END %]
+
+[% IF ( opacbookbag ) %]<script type="text/javascript" language="javascript" src="[% themelang %]/js/basket.js">
+[% ELSIF ( virtualshelves ) %]<script type="text/javascript" language="javascript" src="[% themelang %]/js/basket.js">
+[% ELSE %]<script type="text/javascript" language="javascript"> var readCookie;[% END %]
+</script>
+
+<script type="text/javascript" language="javascript">
+//<![CDATA[
+ [% IF ( opacbookbag ) %]var MSG_BASKET_EMPTY = _("Your cart is currently empty");
+ var MSG_RECORD_IN_BASKET = _("This item is already in your cart");
+ var MSG_RECORD_ADDED = _("This item has been added to your cart");
+ var MSG_RECORD_REMOVED = _("This item has been removed from your cart");
+ var MSG_NRECORDS_ADDED = _(" item(s) added to your cart");
+ var MSG_NRECORDS_IN_BASKET = _("already in your cart");
+ var MSG_NO_RECORD_SELECTED = _("No item was selected");
+ var MSG_NO_RECORD_ADDED = _("No item was added to your cart");
+ var MSG_CONFIRM_DEL_BASKET = _("Are you sure you want to empty your cart?");
+ var MSG_CONFIRM_DEL_RECORDS = _("Are you sure you want to remove the selected items?");
+ var MSG_ITEM_IN_CART = _("In your cart");
+ var MSG_IN_YOUR_CART = _("Items in your cart: ");
+ var MSG_ITEM_NOT_IN_CART = _("Add to your cart");
+ $("#cartDetails").ready(function(){ $("#cmspan").html("<a href=\"#\" id=\"cartmenulink\" class=\"\"><span> "+_("Cart")+"<span id=\"basketcount\"><\/span><\/span><\/a>"); });
+ [% ELSE %][% IF ( virtualshelves ) %]
+ var MSG_NO_RECORD_SELECTED = _("No item was selected");[% END %][% END %]
+ [% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %]var MSG_TAGS_DISABLED = _("Sorry, tags are not enabled on this system.");
+ var MSG_TAG_ALL_BAD = _("Error! Your tag was entirely markup code. It was NOT added. Please try again with plain text.");
+ var MSG_ILLEGAL_PARAMETER = _("Error! Illegal parameter");
+ var MSG_TAG_SCRUBBED = _("Note: your tag contained markup code that was removed. The tag was added as ");
+ var MSG_ADD_TAG_FAILED = _("Error! The add_tag operation failed on");
+ var MSG_ADD_TAG_FAILED_NOTE = _("Note: you can only tag an item with a given term once. Check 'My Tags' to see your current tags.");
+ var MSG_DELETE_TAG_FAILED = _("Error! You cannot delete the tag");
+ var MSG_DELETE_TAG_FAILED_NOTE = _("Note: you can only delete your own tags.")
+ var MSG_LOGIN_REQUIRED = _("You must be logged in to add tags.");
+ var MSG_TAGS_ADDED = _("Tags added: ");
+ var MSG_TAGS_DELETED = _("Tags added: ");
+ var MSG_TAGS_ERRORS = _("Errors: ");
+ var MSG_MULTI_ADD_TAG_FAILED = _("Unable to add one or more tags.");[% END %][% END %]
+ [% IF ( OPACAmazonCoverImages ) %]$(window).load(function() {
+ verify_images();
+ });[% END %]
+ [% IF ( SyndeticsCoverImages ) %]$(window).load(function() {
+ verify_images();
+ });[% END %]
+//]]>
+[% IF ( opacbookbag ) %]</script><script type="text/javascript" language="javascript" src="[% themelang %]/js/basket.js">
+[% ELSIF ( virtualshelves ) %]</script><script type="text/javascript" language="javascript" src="[% themelang %]/js/basket.js">
+[% ELSE %]</script><script type="text/javascript" language="javascript">var readCookie;[% END %]</script>
+[% IF ( opacuserlogin ) %][% IF ( TagsEnabled ) %]<script type="text/javascript" language="javascript" src="[% themelang %]/js/tags.js"></script>[% END %][% ELSE %][% END %]
+[% IF ( GoogleJackets ) %]
+<script type="text/javascript" language="javascript" src="[% themelang %]/js/google-jackets.js"></script>
+<script type="text/javascript" language="javascript">
+//<![CDATA[
+ var NO_GOOGLE_JACKET = _("No cover image available");
+//]]>
+</script>
+[% END %]
+[% IF OpenLibraryCovers %]
+<script type="text/javascript" language="javascript" src="[% themelang %]/js/openlibrary.js"></script>
+<script type="text/javascript" language="javascript">
+//<![CDATA[
+var NO_OL_JACKET = _("No cover image available");
+//]]>
+</script>
+[% END %]
+
+[% IF OPACLocalCoverImages %]
+<script type="text/javascript" language="javascript" src="[% themelang %]/js/localcovers.js"></script>
+<script type="text/javascript" language="javascript">
+//<![CDATA[
+var NO_LOCAL_JACKET = _("No cover image available");
+//]]>
+</script>
+[% END %]
+
+[% IF ( BakerTaylorEnabled ) %]<script type="text/javascript" language="javascript" src="[% themelang %]/js/bakertaylorimages.js"></script>
+<script type="text/javascript" language="javascript">
+//<![CDATA[
+ var NO_BAKERTAYLOR_IMAGE = _("No cover image available");
+ $(window).load(function(){
+ bt_verify_images();
+ });
+//]]>
+</script>[% END %]
+<link rel="unapi-server" type="application/xml" title="unAPI" href="[% OPACBaseURL %]/cgi-bin/koha/unapi" />
+[% IF ( GoogleIndicTransliteration ) %]
+ <script type="text/javascript" src="http://www.google.com/jsapi"></script>
+ <script type="text/javascript" language="javascript" src="[% themelang %]/js/googleindictransliteration.js"></script>
+[% END %]
--- /dev/null
+<div id="header-wrapper">
+
+<div id="top-bar">
+<ul id="menu-left">
+ <!-- [% IF ( opacbookbag ) %] -->
+ <li>
+ <span id="cmspan"></span>
+ <div id="cartDetails">Your cart is empty.</div>
+ </li>
+ <!-- [% END %] -->
+
+ [% IF ( virtualshelves ) %]
+
+ <li id="listsmenulink">
+ <a href="/cgi-bin/koha/opac-shelves.pl" class="">
+ <span>Lists</span>
+ </a>
+ <div id="listsmenu" class="yuimenu" style="display: none">
+ <h4>Public lists</h4>
+ [% IF ( pubshelves ) %]
+ <ul class="first-of-type">
+ [% FOREACH pubshelvesloo IN pubshelvesloop %]
+ <li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% pubshelvesloo.shelfnumber %]&sortfield=[% pubshelvesloo.sortfield %]">[% pubshelvesloo.shelfname |html %]</a></li>
+ [% END %]
+ <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=publicshelves">[View All]</a></li>
+ </ul>
+ [% ELSE %]
+ No public lists
+ [% END %]
+ [% IF ( opacuserlogin ) %]
+ <h4>Your lists</h4>
+ [% IF ( loggedinusername ) %]
+ [% IF ( barshelves ) %]
+ <ul class="first-of-type">
+ [% FOREACH barshelvesloo IN barshelvesloop %]
+ <li class="yuimenuitem"><a href="/cgi-bin/koha/opac-shelves.pl?viewshelf=[% barshelvesloo.shelfnumber %]&sortfield=[% barshelvesloo.sortfield %]">[% barshelvesloo.shelfname |html %]</a></li>
+ [% END %]
+ <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">[View all]</a></li>
+ </ul>
+ [% ELSE %]
+ <ul class="first-of-type">
+ <li>No private lists</li>
+ <li class="yuimenuitem"><a class="yuimenuitemlabel" href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">[New list]</a></li></ul>
+ [% END %]
+ [% ELSE %]
+ <ul class="first-of-type"><li><a href="/cgi-bin/koha/opac-user.pl">Log in to create your own lists</a></li></ul>
+ [% END %]
+ [% END %]
+ </div><!-- /listmenu /virtualshelves -->
+[% END %]
+<div id="listsDetails"></div>
+
+</li>
+</ul>
+
+ <div id="members">
+ [% IF ( opacuserlogin ) %]
+ <ul>
+ [% UNLESS ( loggedinusername ) %]
+ <li><a href="/cgi-bin/koha/opac-user.pl">Log in to your account</a></li>[% END %]
+ [% IF ( loggedinusername ) %]
+ <li><span class="members">Welcome, <a href="/cgi-bin/koha/opac-user.pl"><span class="loggedinusername">[% FOREACH USER_INF IN USER_INFO %][% USER_INF.title %] [% USER_INF.firstname %] [% USER_INF.surname %][% END %]</span></a></span></li>
+
+ [% END %]
+ [% IF ( ShowOpacRecentSearchLink ) %]
+ <li><a href="/cgi-bin/koha/opac-search-history.pl" title="View your search history">Search history</a></li>
+ [% END %]
+ [% IF ( loggedinusername ) %]<li><a class="logout" id="logout" href="/cgi-bin/koha/opac-main.pl?logout.x=1">Log Out</a></li>[% END %]
+ </ul>
+ [% END %]
+ </div>
+
+ <div class="clear"></div>
+
+</div>
+
+<div id="opac-main-search" class="yui-g">
+
+<a class="logo" href="/cgi-bin/koha/opac-main.pl">
+ <img src="/opac-tmpl/ccsr/images/logo-koha.png" alt="Koha Online Catalog" />
+</a>
+
+<div id="fluid">
+
+[% IF ( OpacPublic ) %]
+<div id="fluid-offset">
+[% UNLESS ( advsearch ) %]
+[% IF ( OpacAddMastheadLibraryPulldown ) %]
+ [% IF ( OpacShowFiltersPulldownMobile and not OpacShowLibrariesPulldownMobile ) or ( not OpacShowFiltersPulldownMobile and OpacShowLibrariesPulldownMobile ) %]
+ <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries single-field-mobile">
+ [% ELSE %]
+ <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries">
+ [% END %]
+[% ELSE %]
+ <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="single-library">
+[% END %]
+ <label for="masthead_search" class="left"> Search
+ [% UNLESS ( OpacAddMastheadLibraryPulldown ) %]
+ [% IF ( mylibraryfirst ) %] (in [% mylibraryfirst %] only)[% END %]
+ [% END %]
+ </label>
+ [% IF ( OpacShowFiltersPulldownMobile ) %]
+ <div id="filters">
+ [% ELSE %]
+ <div id="filters" class="mobile-hidden">
+ [% END %]
+ <select name="idx" id="masthead_search" class="left">
+ [% IF ( ms_kw ) %]
+ <option selected="selected" value="">Library catalog</option>
+ [% ELSE %]
+ <option value="">Library catalog</option>
+ [% END %]
+ [% IF ( ms_ti ) %]
+ <option selected="selected" value="ti">Title</option>
+ [% ELSE %]
+ <option value="ti">Title</option>
+ [% END %]
+ [% IF ( ms_au ) %]
+ <option selected="selected" value="au">Author</option>
+ [% ELSE %]
+ <option value="au">Author</option>
+ [% END %]
+ [% IF ( ms_su ) %]
+ <option selected="selected" value="su">Subject</option>
+ [% ELSE %]
+ <option value="su">Subject</option>
+ [% END %]
+ [% IF ( ms_nb ) %]
+ <option selected="selected" value="nb">ISBN</option>
+ [% ELSE %]
+ <option value="nb">ISBN</option>
+ [% END %]
+ [% IF ( ms_se ) %]
+ <option selected="selected" value="se">Series</option>
+ [% ELSE %]
+ <option value="se">Series</option>
+ [% END %]
+ [% IF ( ms_callnum ) %]
+ <option selected="selected" value="callnum">Call number</option>
+ [% ELSE %]
+ <option value="callnum">Call number</option>
+ [% END %]</select>
+ </div>
+
+<div class="input-wrapper">
+[% IF ( ms_value ) %]
+ <input type="text" id = "transl1" name="q" value="[% ms_value |html %]" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div>
+[% ELSE %]
+ <input type="text" id = "transl1" name="q" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div>
+[% END %]
+</div>
+
+ [% IF ( OpacAddMastheadLibraryPulldown ) %]
+ [% IF ( OpacShowLibrariesPulldownMobile ) %]
+ <div id="libraries">
+ [% ELSE %]
+ <div id="libraries" class="mobile-hidden">
+ [% END %]
+ <select name="limit" id="select_library" class="left">
+ <option value="">All libraries</option>
+ [% FOREACH BranchesLoo IN BranchesLoop %]
+ [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>
+ [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %]
+ [% END %]
+ </select>
+ </div>
+ [% ELSE %]
+ [% IF ( opac_limit_override ) %]
+ [% IF ( opac_search_limit ) %]
+ <input name="limit" value="[% opac_search_limit %]" type="hidden" />
+ [% END %]
+ [% ELSE %]
+ [% IF ( mylibraryfirst ) %]
+ <input name="limit" value="branch:[% mylibraryfirst %]" type="hidden" />
+ [% END %]
+ [% END %]
+ [% END %]
+
+
+ <input type="submit" value="Go" id="searchsubmit" class="left" />
+[% IF ( opacbookbag ) %]<span id="cmspan"></span>[% END %]
+
+ <div class="clear"></div>
+
+ </form>
+[% ELSE %] <!--advsearch -->
+ [% IF ( OpacAddMastheadLibraryPulldown ) %]
+ [% IF ( OpacShowFiltersPulldownMobile and not OpacShowLibrariesPulldownMobile ) or ( not OpacShowFiltersPulldownMobile and OpacShowLibrariesPulldownMobile ) %]
+ <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries single-field-mobile">
+ [% ELSE %]
+ <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="multi-libraries">
+ [% END %]
+ [% ELSE %]
+ <form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform" class="single-library">
+ [% END %]
+ <label for="masthead_search" class="left"> Search
+ [% UNLESS ( OpacAddMastheadLibraryPulldown ) %]
+ [% IF ( mylibraryfirst ) %] (in [% mylibraryfirst %] only)[% END %]
+ [% END %]
+ </label>
+ [% IF ( OpacShowFiltersPulldownMobile ) %]
+ <div id="filters" class="transparent">
+ [% ELSE %]
+ <div id="filters" class="transparent mobile-hidden">
+ [% END %]
+ <select name="idx" id="masthead_search" class="left" disabled="disabled">
+ <option selected="selected" value="">Library Catalog</option>
+ </select>
+ </div>
+
+<div class="input-wrapper">
+ <input type="text" id = "transl1" name="q" class="left transparent" style="width: 35%; font-size: 111%;" disabled="disabled"/><div id="translControl"></div>
+</div>
+
+ [% IF ( OpacAddMastheadLibraryPulldown ) %]
+ [% IF ( OpacShowLibrariesPulldownMobile ) %]
+ <div id="libraries">
+ [% ELSE %]
+ <div id="libraries" class="mobile-hidden">
+ [% END %]
+ <select name="limit" id="select_library" class="left transparent">
+ <option value="">All Libraries</option>
+ </select>
+ </div>
+ [% END %]
+
+
+ <input type="submit" value="Go" id="searchsubmit" class="left transparent" disabled="disabled" />
+[% IF ( opacbookbag ) %]<span id="cmspan"></span>[% END %]
+
+ <div class="clear"></div>
+
+ </form>
+[% END %]
+
+<div id="moresearches">
+<a href="/cgi-bin/koha/opac-search.pl">Advanced search</a>
+[% IF ( OpacBrowser ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-browser.pl">Browse by hierarchy</a>[% END %]
+[% IF ( OpacAuthorities ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-authorities-home.pl">Browse by author or subject</a>[% END %]
+[% IF ( opacuserlogin && reviewson && OpacShowRecentComments ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-showreviews.pl">Recent comments</a>[% END %]
+[% IF ( TagsEnabled ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags.pl">Tag cloud</a>[% END %]
+[% IF ( OpacCloud ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-tags_subject.pl">Subject cloud</a>[% END %]
+[% IF ( OpacTopissue ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-topissues.pl">Most popular</a>[% END %]
+[% IF ( suggestion ) %]
+ [% IF ( AnonSuggestions ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a>
+ [% ELSIF ( OPACViewOthersSuggestions ) %]<span class="pipe"> | </span><a href="/cgi-bin/koha/opac-suggestions.pl">Purchase suggestions</a>
+ [% END %]
+[% END %]
+</div>
+ </div>
+</div>
+
+<div id="libraryname">
+ [% IF ( opacheader ) %]
+ <h1>
+ [% opacheader %]
+ </h1>
+ [% END %]
+</div>
+
+[% END %] <!-- OpacPublic -->
+
+</div>
+</div>
+
+<div id="container">
+<div id="ctn_lt">
+<div id="ctn_rt">
+<div id="ctn_lb">
+<div id="ctn_rb">
+
+<div id="breadcrumbs" class="yui-g">
+<p><a href="/cgi-bin/koha/opac-main.pl" title="Home">Home</a>
+[% IF ( searchdesc ) %]<span class="rsaquo"> › </span><a href="/cgi-bin/koha/opac-search.pl" title="Search">Search</a><span class="rsaquo"> › </span>
+[% 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 %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" class="rsssearchlink">
+<img src="/opac-tmpl/ccsr/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 %]&format=rss2" class="rsssearchlink"><img src="/opac-tmpl/ccsr/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 %]
+</p>
+[% IF ( OPACNoResultsFound ) %]
+<div id="noresultsfound">
+[% OPACNoResultsFound %]
+</div>
+[% END %]
+
+</div>
+[% END %]</p>[% END %]</div>
+
+<div class="ctn_in">
--- /dev/null
+[% IF IsPatronPage %]
+[% INCLUDE usermenu.inc %]
+[% END %]
+[% OpacNav %]
+[% OpacNavBottom %]
--- /dev/null
+[% IF ( opaccredits ) %]
+ <div class="ft">
+ [% opaccredits %]
+ </div>
+[% END %]
+</div>
+
+<div class="clear"></div>
+</div>
+</div>
+</div>
+</div>
+</div>
+</div>
+
+<div id="main_footer">
+ <div class="colleft">
+ </div>
+ [% IF ( OpacKohaUrl ) %]
+ <div class="colright">
+ <div class="koha">
+ [% IF template.name.match('opac-main.tt') %]
+ <a class="koha_url" href="http://koha-community.org">Powered by</a>
+ [% ELSE %]
+ <a class="koha_url" rel="nofollow" href="http://koha-community.org">Powered by</a>
+ [% END %]
+ </div>
+ </div>
+ [% END %]
+ <div class="clear"></div>
+</div>
+
+[% IF ( opaclanguagesdisplay || OpacKohaUrl ) %]
+ [% IF ( languages_loop && opaclanguagesdisplay ) %]
+ [% UNLESS ( one_language_enabled ) %]
+ <div id="changelanguage" class="ft">
+ <div class="lang" style="float:left;padding: 0.1em 0;"><strong>Languages: </strong></div>
+ <ul id="i18nMenu" class="footermenu">
+ [% FOREACH languages_loo IN languages_loop %]
+
+ [% IF ( languages_loo.group_enabled ) %]
+ [% IF ( languages_loo.plural ) %]
+ <li class="more" style="float:left;"><a class="sublangs" id="show[% languages_loo.rfc4646_subtag %]" href="#">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</a><div id="sub[% languages_loo.rfc4646_subtag %]">
+ <div class="bd"><ul>
+ [% FOREACH sublanguages_loo IN languages_loo.sublanguages_loop %]
+ [% IF ( sublanguages_loo.enabled ) %]
+ [% IF ( sublanguages_loo.sublanguage_current ) %]
+ <li> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</li>
+ [% ELSE %]
+ <li><a href="/cgi-bin/koha/changelanguage.pl?language=[% sublanguages_loo.rfc4646_subtag %]"> [% sublanguages_loo.native_description %] [% sublanguages_loo.script_description %] [% sublanguages_loo.region_description %] [% sublanguages_loo.variant_description %] ([% sublanguages_loo.rfc4646_subtag %])</a></li>
+ [% END %]
+ [% END %]
+
+ [% END %]
+ </ul></div></div></li>
+
+ [% ELSE %]
+ [% IF ( languages_loo.group_enabled ) %]
+ [% IF ( languages_loo.current ) %]
+ <li style="float:left;">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</li>
+ [% ELSE %]
+ <li style="float:left;"><a href="/cgi-bin/koha/changelanguage.pl?language=[% languages_loo.rfc4646_subtag %]">[% IF ( languages_loo.native_description ) %][% languages_loo.native_description %][% ELSE %][% languages_loo.rfc4646_subtag %][% END %]</a></li>
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+
+ [% END %]
+ </ul>
+ </div>
+ [% END %]
+ [% END %]
+
+[% END %]
+
+
+<script type="text/javascript" src="/opac-tmpl/lib/jquery/plugins/jquery.jqtransform_select.js"></script>
+<script type="text/javascript">
+$(function() {
+ //find all form with class jqtransform and apply the plugin
+ $("form#searchform").jqTransform();
+});
+
+[% IF ( opacuserjs ) %][% opacuserjs %][% END %]
+
+</script>
+
+<!-- /ADD JQUERY PLUGIN JQTRANSFORM - LIBÉO -->
+
+</body>
+</html>
--- /dev/null
+[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %]
+<div id="menu">
+<ul>
+ [% IF ( userview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-user.pl">my summary</a></li>
+ [% IF ( OPACFinesTab ) %]
+ [% IF ( accountview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-account.pl">my fines</a></li>
+ [% END %]
+ [% IF ( userupdateview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-userupdate.pl">my personal details</a></li>
+ [% IF ( TagsEnabled ) %]
+ [% IF ( tagsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-tags.pl?mine=1">my tags</a></li>
+ [% END %]
+ [% IF ( OpacPasswordChange ) %]
+ [% IF ( passwdview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-passwd.pl">change my password</a></li>
+ [% END %]
+ [% IF ( ShowOpacRecentSearchLink ) %]
+ [% IF ( searchhistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-search-history.pl">my search history</a></li>
+ [% END %]
+ [% IF ( opacreadinghistory ) %]
+ [% IF ( readingrecview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-readingrecord.pl">my reading history</a></li>
+ [% IF ( OPACPrivacy ) %]
+ [% IF ( privacyview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/opac-privacy.pl">my privacy</a></li>
+ [% END %]
+ [% END %]
+ [% IF ( suggestion ) %]
+ [% UNLESS ( AnonSuggestions ) %]
+ [% IF ( suggestionsview ) %]<li class="active suggestions">[% ELSE %]<li class="suggestions">[% END %]<a href="/cgi-bin/koha/opac-suggestions.pl">my purchase suggestions</a></li>
+ [% END %]
+ [% END %]
+ [% IF ( EnhancedMessagingPreferences ) %]
+ [% IF ( messagingview ) %]<li class="active messaging">[% ELSE %]<li class="messaging">[% END %]<a href="/cgi-bin/koha/opac-messaging.pl">my messaging</a></li>
+ [% END %]
+ [% IF ( virtualshelves ) %]
+ [% IF ( listsview ) %]<li class="active privateshelves">[% ELSE %]<li class="privateshelves">[% END %]<a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">my lists</a></li>
+ [% END %]
+
+</ul>
+</div>
+[% END %][% ELSE %][% END %]
--- /dev/null
+// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
+function verify_images() {
+ $("img").each(function(i){
+ if ((this.src.indexOf('images.amazon.com') >= 0) || (this.src.indexOf('g-images.amazon.com') >=0) || (this.src.indexOf('syndetics.com') >=0) ) {
+ w = this.width;
+ h = this.height;
+ if ((w == 1) || (h == 1)) {
+ $(this).parent().html("<span class=\"no-image\">"+NO_AMAZON_IMAGE+"</span>");
+ } else if ((this.complete != null) && (!this.complete)) {
+ $(this).parent().html("<span class=\"no-image\">"+NO_AMAZON_IMAGE+"</span>");
+ }
+ }
+ });
+ }
--- /dev/null
+// http://www.oreillynet.com/pub/a/javascript/2003/10/21/amazonhacks.html
+function bt_verify_images() {
+ $("img").each(function(i){
+ if (this.src.indexOf('btol.com') >= 0) {
+ h = this.height;
+ if (h == 20) {
+ $(this).before("<span class=\"no-image\" style=\"margin-bottom:5px;width:80px;\">"+NO_BAKERTAYLOR_IMAGE+"</span>");
+ }
+ }
+ });
+ }
--- /dev/null
+//////////////////////////////////////////////////////////////////////////////
+// BASIC FUNCTIONS FOR COOKIE MANAGEMENT //
+//////////////////////////////////////////////////////////////////////////////
+
+var CGIBIN = "/cgi-bin/koha/";
+
+
+var nameCookie = "bib_list";
+var valCookie = readCookie(nameCookie);
+
+if(valCookie){
+ var arrayRecords = valCookie.split("/");
+ if(arrayRecords.length > 0){
+ var basketcount = arrayRecords.length-1;
+ } else {
+ var basketcount = "";
+ }
+} else {
+ var basketcount = "";
+}
+
+function writeCookie(name, val, wd) {
+ if (wd) {
+ parent.opener.document.cookie = name + "=" + val;
+ }
+ else {
+ parent.document.cookie = name + "=" + val;
+ }
+}
+
+function readCookieValue (str, val_beg) {
+ var val_end = str.indexOf(";", val_end);
+ if (val_end == -1)
+ val_end = str.length;
+ return str.substring(val_beg, val_end);
+}
+
+function readCookie(name, wd) {
+ var str_name = name + "=";
+ var str_len = str_name.length;
+ var str_cookie = "";
+ if (wd) {
+ str_cookie = parent.opener.document.cookie;
+ }
+ else {
+ str_cookie = parent.document.cookie;
+ }
+ // fixed - getting the part of the basket that is bib_list
+ var cookie_parts = str_cookie.split(";");
+ for(var i=0;i < cookie_parts.length;i++) {
+ var c = cookie_parts[i];
+ while (c.charAt(0)==' ') c = c.substring(1,c.length);
+ if(c.indexOf(str_name) == 0) return c.substring(str_name.length,c.length);
+ }
+ return null;
+}
+
+function delCookie(name) {
+ var exp = new Date();
+ exp.setTime(exp.getTime()-1);
+ if(parent.opener){
+ parent.opener.document.cookie = name + "=null; expires=" + exp.toGMTString();
+ } else {
+ document.cookie = name + "=null; expires=" + exp.toGMTString();
+ }
+}
+
+///////////////////////////////////////////////////////////////////
+// SPECIFIC FUNCTIONS USING COOKIES //
+///////////////////////////////////////////////////////////////////
+
+function openBasket() {
+ var strCookie = "";
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ if ( valCookie ) {
+ strCookie = nameCookie + "=" + valCookie;
+ }
+
+ if ( strCookie ) {
+ var iW = 820;
+ var iH = 450;
+ var optWin = "dependant=yes,status=yes,scrollbars=yes,resizable=yes,toolbar=no,location=yes,height="+iH+",width="+iW;
+ var loc = CGIBIN + "opac-basket.pl?" + strCookie;
+ var basket = open(loc, "basket", optWin);
+ if (window.focus) {basket.focus()}
+ }
+ else {
+ showCartUpdate(MSG_BASKET_EMPTY);
+ }
+}
+
+function addRecord(val, selection,NoMsgAlert) {
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ var write = 0;
+
+ if ( ! valCookie ) { // empty basket
+ valCookie = val + '/';
+ write = 1;
+ updateBasket(1);
+ }
+ else {
+ // is this record already in the basket ?
+ var found = false;
+ var arrayRecords = valCookie.split("/");
+ for (var i = 0; i < valCookie.length - 1; i++) {
+ if (val == arrayRecords[i]) {
+ found = true;
+ break;
+ }
+ }
+ if ( found ) {
+ if (selection) {
+ return 0;
+ }
+ if (! NoMsgAlert ) {
+ showCartUpdate(MSG_RECORD_IN_BASKET);
+ }
+ }
+ else {
+ valCookie += val + '/';
+ write = 1;
+ updateBasket(arrayRecords.length);
+ }
+ }
+
+ if (write) {
+ writeCookie(nameCookie, valCookie);
+ if (selection) { // when adding a selection of records
+ updateLink(val,"add");
+ return 1;
+ }
+ if (! NoMsgAlert ) {
+ showCartUpdate(MSG_RECORD_ADDED);
+ updateLink(val,"add");
+ }
+ }
+}
+
+function AllAreChecked(s){
+ if (! s.length) { return false;}
+ var l = s.length;
+ for (var i=0; i < l; i++) {
+ if(! s[i].checked) { return false; }
+ }
+ return true;
+}
+
+function SelectAll(){
+ if(document.bookbag_form.biblionumber.length > 0) {
+ var checky = AllAreChecked(document.bookbag_form.biblionumber);
+ var l = document.bookbag_form.biblionumber.length;
+ for (var i=0; i < l; i++) {
+ document.bookbag_form.biblionumber[i].checked = (checky) ? false : true;
+ }
+ }
+}
+
+function addMultiple(){
+ var c_value = "";
+ if(document.bookbag_form.biblionumber.length > 0) {
+ for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
+ if (document.bookbag_form.biblionumber[i].checked) {
+ c_value = c_value + document.bookbag_form.biblionumber[i].value + "/";
+ }
+ }
+ addSelRecords(c_value);
+ } else {
+ c_value = c_value + document.bookbag_form.biblionumber.value + "/";
+ addSelRecords(c_value);
+ }
+}
+
+function addSelRecords(valSel) { // function for adding a selection of biblios to the basket
+ // from the results list
+ var arrayRecords = valSel.split("/");
+ var i = 0;
+ var nbAdd = 0;
+ for (i=0;i<arrayRecords.length;i++) {
+ if (arrayRecords[i]) {
+ nbAdd += addRecord(arrayRecords[i], 1);
+ }
+ else {
+ break;
+ }
+ }
+ var msg = "";
+ if (nbAdd) {
+ if (i > nbAdd) {
+ msg = nbAdd+" "+MSG_NRECORDS_ADDED+", "+(i-nbAdd)+" "+MSG_NRECORDS_IN_BASKET;
+ }
+ else {
+ msg = nbAdd+" "+MSG_NRECORDS_ADDED;
+ }
+ }
+ else {
+ if (i < 1) {
+ msg = MSG_NO_RECORD_SELECTED;
+ }
+ else {
+ msg = MSG_NO_RECORD_ADDED+" ("+MSG_NRECORDS_IN_BASKET+") !";
+ }
+ }
+ showCartUpdate(msg);
+}
+
+function showCartUpdate(msg){
+ // set body of popup window
+ $("#cartDetails").html(msg);
+ showCart();
+ setTimeout("hideCart()",2000);
+}
+
+function showListsUpdate(msg){
+ // set body of popup window
+ $("#listsDetails").html(msg);
+ showLists();
+ setTimeout("hideLists()",2000);
+}
+
+function selRecord(num, status) {
+ var str = document.myform.records.value
+ if (status){
+ str += num+"/";
+ }
+ else {
+ str = delRecord(num, str);
+ }
+
+ document.myform.records.value = str;
+}
+
+function delSingleRecord(biblionumber){
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ var arrayRecords = valCookie.split("/");
+ var pos = jQuery.inArray(biblionumber,arrayRecords);
+ arrayRecords.splice(pos,1);
+ valCookie = arrayRecords.join("/");
+ writeCookie( nameCookie, valCookie );
+ updateBasket( arrayRecords.length-1 );
+ updateLink(biblionumber,"del");
+ showCartUpdate(MSG_RECORD_REMOVED);
+}
+
+function delSelRecords() {
+ var recordsSel = 0;
+ var end = 0;
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie, 1);
+ if (valCookie) {
+ var str = document.myform.records.value;
+ if (str.length > 0){
+ recordsSel = 1;
+ var str2 = valCookie;
+ while (!end){
+ s = str.indexOf("/");
+ if (s>0){
+ num = str.substring(0, s);
+ str = delRecord(num,str);
+ str2 = delRecord(num,str2);
+ updateLink(num,"del",top.opener);
+ } else {
+ end = 1;
+ }
+ }
+
+ if (str2.length == 0) { // equivalent to emptying the basket
+ var rep = false;
+ rep = confirm(MSG_CONFIRM_DEL_BASKET);
+ if (rep) {
+ delCookie(nameCookie);
+ document.location = "about:blank";
+ updateBasket(0,top.opener);
+ window.close();
+ } else {
+ return;
+ }
+ } else {
+ writeCookie(nameCookie, str2, 1);
+ }
+ }
+ }
+
+ if (recordsSel) {
+ var strCookie = "";
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie, 1);
+ strCookie = nameCookie + "=" + valCookie;
+ var arrayRecords = valCookie.split("/");
+ updateBasket(arrayRecords.length-1,top.opener);
+ document.location = CGIBIN + "opac-basket.pl?" + strCookie;
+ }
+ else {
+ alert(MSG_NO_RECORD_SELECTED);
+ }
+}
+
+function delRecord (n, s) {
+ var re = /\d/;
+ var aux = s;
+ var found = 0;
+ var pos = -1;
+
+ while (!found) {
+ pos = aux.indexOf(n, pos+1);
+ var charAfter = aux.charAt(pos+n.length); // character right after the researched string
+ if (charAfter.match(re)) { // record number inside another one
+ continue;
+ }
+ else { // good record number
+ aux = s.substring(0, pos)+ s.substring(pos+n.length+1, s.length);
+ s = aux;
+ found = 1;
+ }
+ }
+
+ return s;
+}
+
+
+function delBasket() {
+ var nameCookie = "bib_list";
+
+ var rep = false;
+ rep = confirm(MSG_CONFIRM_DEL_BASKET);
+ if (rep) {
+ delCookie(nameCookie);
+ updateAllLinks(top.opener);
+ document.location = "about:blank";
+ updateBasket(0,top.opener);
+ window.close();
+ }
+}
+
+
+function quit() {
+ if (document.myform.records.value) {
+ var rep = false;
+ rep = confirm(MSG_CONFIRM_DEL_RECORDS);
+ if (rep) {
+ delSelRecords();
+ }
+ }
+ updateBasket(arrayRecords.length-1,top.opener);
+ window.close();
+}
+
+function sendBasket() {
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ var strCookie = nameCookie + "=" + valCookie;
+
+ var loc = CGIBIN + "opac-sendbasket.pl?" + strCookie;
+
+ var optWin="dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100";
+ var win_form = open(loc,"win_form",optWin);
+}
+
+function downloadBasket() {
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ var strCookie = nameCookie + "=" + valCookie;
+
+ var loc = CGIBIN + "opac-downloadcart.pl?" + strCookie;
+
+ open(loc,"win_form",'dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100');
+}
+
+function printBasket() {
+ var loc = document.location + "&print=1";
+ document.location = loc;
+}
+
+function showMore() {
+ var strCookie = "";
+
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ if (valCookie) {
+ strCookie = nameCookie + "=" + valCookie;
+ }
+ var loc = CGIBIN + "opac-basket.pl?" + strCookie + "&verbose=1";
+ document.location = loc;
+}
+
+function showLess() {
+ var strCookie = "";
+
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ if (valCookie) {
+ strCookie = nameCookie + "=" + valCookie;
+ }
+ var loc = CGIBIN + "opac-basket.pl?" + strCookie + "&verbose=0";
+ document.location = loc;
+}
+
+function updateBasket(updated_value,target) {
+ if(target){
+ target.$('#basketcount').html("<span>"+updated_value+"</span>");
+ target.$('#cartDetails').html(MSG_IN_YOUR_CART+updated_value);
+ } else {
+ $('#basketcount').html("<span>"+updated_value+"</span>");
+ $('#cartDetails').html(MSG_IN_YOUR_CART+updated_value);
+ }
+ var basketcount = updated_value;
+}
+
+function openBiblio(dest,biblionumber) {
+ openerURL=dest+"?biblionumber="+biblionumber;
+ opener.document.location = openerURL;
+ opener.focus();
+}
+
+function addSelToShelf() {
+ var items = document.getElementById('records').value;
+ if(items){
+ document.location = "/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber="+items;
+ } else {
+ alert(MSG_NO_RECORD_SELECTED);
+ }
+}
+
+/// vShelfAdd() builds url string for multiple-biblio adds.
+
+function vShelfAdd() {
+ bibs= new Array;
+ if(document.bookbag_form.biblionumber.length > 0) {
+ for (var i=0; i < document.bookbag_form.biblionumber.length; i++) {
+ if (document.bookbag_form.biblionumber[i].checked) {
+ bibs.push("biblionumber=" + document.bookbag_form.biblionumber[i].value);
+ }
+ }
+ if (bibs.length == 0) { showListsUpdate(MSG_NO_RECORD_SELECTED); }
+ return bibs.join("&");
+ } else {
+ if (document.bookbag_form.biblionumber.checked) {
+ return "biblionumber=" + document.bookbag_form.biblionumber.value;
+ }
+ }
+}
+
+function showCart(){
+ var position = $("#cartmenulink").offset();
+ var scrolld = $(window).scrollTop();
+ var top = position.top + $("#cartmenulink").outerHeight();
+ if( scrolld > top ){
+ top = scrolld + 15;
+ }
+ var menuWidth = 200;
+ var buttonWidth = $("#cartmenulink").innerWidth();
+ var buttonOffset = menuWidth - buttonWidth;
+ var left = position.left;
+ $("#cartDetails").css("position","fixed").css("left",left);
+ $("#cartDetails").fadeIn("fast");
+}
+
+function showLists(){
+ var position = $("#listsmenulink").offset();
+ var top = position.top + $("#listsmenulink").outerHeight();
+ var menuWidth = 200;
+ var buttonWidth = $("#listsmenulink").innerWidth();
+ var buttonOffset = menuWidth - buttonWidth;
+ var left = position.left;
+ $("#listsDetails").css("position","fixed").css("top",top);
+ $("#listsDetails").css("position","fixed").css("left",left);
+ $("#listsDetails").fadeIn("fast");
+}
+
+function hideCart(){
+ $("#cartDetails").fadeOut("fast");
+}
+
+function hideLists(){
+ $("#listsDetails").fadeOut("fast");
+}
+
+function updateLink(val,op,target){
+ if(target){
+ if(op == "add"){
+ target.$("a.cart"+val).html(MSG_ITEM_IN_CART).addClass("incart");
+ target.$("a.cartR"+val).show();
+ } else {
+ target.$("a.cart"+val).html(MSG_ITEM_NOT_IN_CART).removeClass("incart").addClass("addtocart cart"+val);
+ target.$("a.cartR"+val).hide();
+ }
+ } else {
+ if(op == "add"){
+ $("a.cart"+val).html(MSG_ITEM_IN_CART).addClass("incart");
+ $("a.cartR"+val).show();
+ } else {
+ $("a.cart"+val).html(MSG_ITEM_NOT_IN_CART).removeClass("incart").addClass("addtocart cart"+val);
+ $("a.cartR"+val).hide();
+ }
+ }
+}
+
+function updateAllLinks(target){
+ if(target){
+ target.$("a.incart").html(MSG_ITEM_NOT_IN_CART).removeClass("incart").addClass("addtocart");
+ target.$("a.cartRemove").hide();
+ } else {
+ $("a.incart").html(MSG_ITEM_NOT_IN_CART).removeClass("incart").addClass("addtocart");
+ $("a.cartRemove").hide();
+ }
+}
+
+$("#cartDetails").ready(function(){
+ $("#cartDetails,#cartmenulink").click(function(){ hideCart(); });
+ $("#cartmenulink").click(function(){ openBasket(); return false; });
+ $("#cartmenulink").hoverIntent(function(){
+ showCart();
+ },function(){
+ hideCart();
+ });
+ if(basketcount){ updateBasket(basketcount) }
+});
+
+$("#listsmenu").ready(function(){
+ $("#listsmenulink").mouseenter(function(){
+ var position = $("#listsmenulink").offset();
+ var top = position.top + $("#listsmenulink").outerHeight();
+ var menuWidth = 200;
+ var buttonWidth = $("#listsmenulink").innerWidth();
+ var buttonOffset = menuWidth - buttonWidth;
+ var left = position.left;
+ $("#listsmenu").css("position","fixed").css("top",top);
+ $("#listsmenu").css("position","fixed").css("left",left);
+ $("#listsmenu").fadeIn("fast");
+ });
+ $("#listsmenulink").mouseleave(function(){
+ $("#listsmenu").fadeOut("fast");
+ });
+});
--- /dev/null
+// These default options are for translation but can be used
+// for any other datatables settings
+// MSG_DT_* variables comes from datatables-strings.inc
+// To use it, write:
+// $("#table_id").dataTable($.extend(true, {}, dataTableDefaults, {
+// // other settings
+// } ) );
+var dataTablesDefaults = {
+ "oLanguage": {
+ "oPaginate": {
+ "sFirst" : window.MSG_DT_FIRST || "First",
+ "sLast" : window.MSG_DT_LAST || "Last",
+ "sNext" : window.MSG_DT_NEXT || "Next",
+ "sPrevious" : window.MSG_DT_PREVIOUS || "Previous"
+ },
+ "sEmptyTable" : window.MSG_DT_EMPTY_TABLE || "No data available in table",
+ "sInfo" : window.MSG_DT_INFO || "Showing _START_ to _END_ of _TOTAL_ entries",
+ "sInfoEmpty" : window.MSG_DT_INFO_EMPTY || "No entries to show",
+ "sInfoFiltered" : window.MSG_DT_INFO_FILTERED || "(filtered from _MAX_ total entries)",
+ "sLengthMenu" : window.MSG_DT_LENGTH_MENU || "Show _MENU_ entries",
+ "sLoadingRecords" : window.MSG_DT_LOADING_RECORDS || "Loading...",
+ "sProcessing" : window.MSG_DT_PROCESSING || "Processing...",
+ "sSearch" : window.MSG_DT_SEARCH || "Search:",
+ "sZeroRecords" : window.MSG_DT_ZERO_RECORDS || "No matching records found"
+ },
+ "sDom": '<"top pager"ilpf>t<"bottom pager"ip>'
+};
+
+
+// Return an array of string containing the values of a particular column
+$.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) {
+ // check that we have a column id
+ if ( typeof iColumn == "undefined" ) return new Array();
+ // by default we only wany unique data
+ if ( typeof bUnique == "undefined" ) bUnique = true;
+ // by default we do want to only look at filtered data
+ if ( typeof bFiltered == "undefined" ) bFiltered = true;
+ // by default we do not wany to include empty values
+ if ( typeof bIgnoreEmpty == "undefined" ) bIgnoreEmpty = true;
+ // list of rows which we're going to loop through
+ var aiRows;
+ // use only filtered rows
+ if (bFiltered == true) aiRows = oSettings.aiDisplay;
+ // use all rows
+ else aiRows = oSettings.aiDisplayMaster; // all row numbers
+
+ // set up data array
+ var asResultData = new Array();
+ for (var i=0,c=aiRows.length; i<c; i++) {
+ iRow = aiRows[i];
+ var aData = this.fnGetData(iRow);
+ var sValue = aData[iColumn];
+ // ignore empty values?
+ if (bIgnoreEmpty == true && sValue.length == 0) continue;
+ // ignore unique values?
+ else if (bUnique == true && jQuery.inArray(sValue, asResultData) > -1) continue;
+ // else push the value onto the result data array
+ else asResultData.push(sValue);
+ }
+ return asResultData;
+}
+
+// List of unbind keys (Ctrl, Alt, Direction keys, etc.)
+// These keys must not launch filtering
+var blacklist_keys = new Array(0, 16, 17, 18, 37, 38, 39, 40);
+
+// Set a filtering delay for global search field
+jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) {
+ /*
+ * Inputs: object:oSettings - dataTables settings object - automatically given
+ * integer:iDelay - delay in milliseconds
+ * Usage: $('#example').dataTable().fnSetFilteringDelay(250);
+ * Author: Zygimantas Berziunas (www.zygimantas.com) and Allan Jardine
+ * License: GPL v2 or BSD 3 point style
+ * Contact: zygimantas.berziunas /AT\ hotmail.com
+ */
+ var
+ _that = this,
+ iDelay = (typeof iDelay == 'undefined') ? 250 : iDelay;
+
+ this.each( function ( i ) {
+ $.fn.dataTableExt.iApiIndex = i;
+ var
+ $this = this,
+ oTimerId = null,
+ sPreviousSearch = null,
+ anControl = $( 'input', _that.fnSettings().aanFeatures.f );
+
+ anControl.unbind( 'keyup.DT' ).bind( 'keyup.DT', function(event) {
+ var $$this = $this;
+ if (blacklist_keys.indexOf(event.keyCode) != -1) {
+ return this;
+ }else if ( event.keyCode == '13' ) {
+ $.fn.dataTableExt.iApiIndex = i;
+ _that.fnFilter( $(this).val() );
+ } else {
+ if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
+ window.clearTimeout(oTimerId);
+ sPreviousSearch = anControl.val();
+ oTimerId = window.setTimeout(function() {
+ $.fn.dataTableExt.iApiIndex = i;
+ _that.fnFilter( anControl.val() );
+ }, iDelay);
+ }
+ }
+ });
+
+ return this;
+ } );
+ return this;
+}
+
+// Add a filtering delay on general search and on all input (with a class 'filter')
+jQuery.fn.dataTableExt.oApi.fnAddFilters = function ( oSettings, sClass, iDelay ) {
+ var table = this;
+ this.fnSetFilteringDelay(iDelay);
+ var filterTimerId = null;
+ $("input."+sClass).keyup(function(event) {
+ if (blacklist_keys.indexOf(event.keyCode) != -1) {
+ return this;
+ }else if ( event.keyCode == '13' ) {
+ table.fnFilter( $(this).val(), $(this).attr('data-column_num') );
+ } else {
+ window.clearTimeout(filterTimerId);
+ var input = this;
+ filterTimerId = window.setTimeout(function() {
+ table.fnFilter($(input).val(), $(input).attr('data-column_num'));
+ }, iDelay);
+ }
+ });
+}
+
+// Useful if you want to filter on dates with 2 inputs (start date and end date)
+// You have to include calendar.inc to use it
+function dt_add_rangedate_filter(begindate_id, enddate_id, dateCol) {
+ $.fn.dataTableExt.afnFiltering.push(
+ function( oSettings, aData, iDataIndex ) {
+
+ var beginDate = Date_from_syspref($("#"+begindate_id).val()).getTime();
+ var endDate = Date_from_syspref($("#"+enddate_id).val()).getTime();
+
+ var data = Date_from_syspref(aData[dateCol]).getTime();
+
+ if ( !parseInt(beginDate) && ! parseInt(endDate) ) {
+ return true;
+ }
+ else if ( beginDate <= data && !parseInt(endDate) ) {
+ return true;
+ }
+ else if ( data <= endDate && !parseInt(beginDate) ) {
+ return true;
+ }
+ else if ( beginDate <= data && data <= endDate) {
+ return true;
+ }
+ return false;
+ }
+ );
+}
+
+//Sorting for dates (uk format)
+function dt_add_type_uk_date() {
+ jQuery.fn.dataTableExt.aTypes.unshift(
+ function ( sData )
+ {
+ if (sData.match(/(0[1-9]|[12][0-9]|3[01])\/(0[1-9]|1[012])\/(19|20|21)\d\d/))
+ {
+ return 'uk_date';
+ }
+ return null;
+ }
+ );
+
+ jQuery.fn.dataTableExt.oSort['uk_date-asc'] = function(a,b) {
+ var re = /(\d{2}\/\d{2}\/\d{4})/;
+ a.match(re);
+ var ukDatea = RegExp.$1.split("/");
+ b.match(re);
+ var ukDateb = RegExp.$1.split("/");
+
+ var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
+ var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
+
+ return ((x < y) ? -1 : ((x > y) ? 1 : 0));
+ };
+
+ jQuery.fn.dataTableExt.oSort['uk_date-desc'] = function(a,b) {
+ var re = /(\d{2}\/\d{2}\/\d{4})/;
+ a.match(re);
+ var ukDatea = RegExp.$1.split("/");
+ b.match(re);
+ var ukDateb = RegExp.$1.split("/");
+
+ var x = (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
+ var y = (ukDateb[2] + ukDateb[1] + ukDateb[0]) * 1;
+
+ return ((x < y) ? 1 : ((x > y) ? -1 : 0));
+ };
+}
+
+// Sorting on html contains
+// <a href="foo.pl">bar</a> sort on 'bar'
+function dt_overwrite_html_sorting_localeCompare() {
+ jQuery.fn.dataTableExt.oSort['html-asc'] = function(a,b) {
+ a = a.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ b = b.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ if (typeof(a.localeCompare == "function")) {
+ return a.localeCompare(b);
+ } else {
+ return (a > b) ? 1 : ((a < b) ? -1 : 0);
+ }
+ };
+
+ jQuery.fn.dataTableExt.oSort['html-desc'] = function(a,b) {
+ a = a.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ b = b.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ if(typeof(b.localeCompare == "function")) {
+ return b.localeCompare(a);
+ } else {
+ return (b > a) ? 1 : ((b < a) ? -1 : 0);
+ }
+ };
+}
+
+// Sorting on string without accentued characters
+function dt_overwrite_string_sorting_localeCompare() {
+ jQuery.fn.dataTableExt.oSort['string-asc'] = function(a,b) {
+ a = a.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ b = b.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ if (typeof(a.localeCompare == "function")) {
+ return a.localeCompare(b);
+ } else {
+ return (a > b) ? 1 : ((a < b) ? -1 : 0);
+ }
+ };
+
+ jQuery.fn.dataTableExt.oSort['string-desc'] = function(a,b) {
+ a = a.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ b = b.replace(/<.*?>/g, "").replace(/\s+/g, " ");
+ if(typeof(b.localeCompare == "function")) {
+ return b.localeCompare(a);
+ } else {
+ return (b > a) ? 1 : ((b < a) ? -1 : 0);
+ }
+ };
+}
+
+// Replace a node with a html and js contain.
+function replace_html( original_node, type ) {
+ switch ( $(original_node).attr('data-type') ) {
+ case "range_dates":
+ var id = $(original_node).attr("data-id");
+ var format = $(original_node).attr("data-format");
+ replace_html_date( original_node, id, format );
+ break;
+ default:
+ alert("_(This node can't be replaced)");
+ }
+}
+
+// Replace a node with a "From [date] To [date]" element
+// Used on tfoot > td
+function replace_html_date( original_node, id, format ) {
+ var node = $('<span style="white-space:nowrap">' + _("From") + '<input type="text" id="' + id + 'from" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'from").val("").change();\' >×</a></span><br/><span style="white-space:nowrap">' + _("To") + '<input type="text" id="' + id + 'to" readonly="readonly" placeholder=\'' + _("Pick date") + '\' size="7" /><a title="Delete this filter" style="cursor:pointer" onclick=\'$("#' + id + 'to").val("").change();\' >×</a></span>');
+ $(original_node).replaceWith(node);
+ var script = document.createElement( 'script' );
+ script.type = 'text/javascript';
+ var script_content = "Calendar.setup({";
+ script_content += " inputField: \"" + id + "from\",";
+ script_content += " ifFormat: \"" + format + "\",";
+ script_content += " button: \"" + id + "from\",";
+ script_content += " onClose: function(){ $(\"#" + id + "from\").change(); this.hide();}";
+ script_content += " });";
+ script_content += " Calendar.setup({";
+ script_content += " inputField: \"" + id + "to\",";
+ script_content += " ifFormat: \"" + format + "\",";
+ script_content += " button: \"" + id + "to\",";
+ script_content += " onClose: function(){ $(\"#" + id + "to\").change(); this.hide();}";
+ script_content += " });";
+ script.text = script_content;
+ $(original_node).append( script );
+}
+
+$.fn.dataTableExt.oPagination.four_button = {
+ /*
+ * Function: oPagination.four_button.fnInit
+ * Purpose: Initalise dom elements required for pagination with a list of the pages
+ * Returns: -
+ * Inputs: object:oSettings - dataTables settings object
+ * node:nPaging - the DIV which contains this pagination control
+ * function:fnCallbackDraw - draw function which must be called on update
+ */
+ "fnInit": function ( oSettings, nPaging, fnCallbackDraw )
+ {
+ nFirst = document.createElement( 'span' );
+ nPrevious = document.createElement( 'span' );
+ nNext = document.createElement( 'span' );
+ nLast = document.createElement( 'span' );
+
+/* nFirst.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sFirst ) );
+ nPrevious.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sPrevious ) );
+ nNext.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sNext ) );
+ nLast.appendChild( document.createTextNode( oSettings.oLanguage.oPaginate.sLast ) );*/
+
+ nFirst.className = "paginate_button first";
+ nPrevious.className = "paginate_button previous";
+ nNext.className="paginate_button next";
+ nLast.className = "paginate_button last";
+
+ nPaging.appendChild( nFirst );
+ nPaging.appendChild( nPrevious );
+ nPaging.appendChild( nNext );
+ nPaging.appendChild( nLast );
+
+ $(nFirst).click( function () {
+ oSettings.oApi._fnPageChange( oSettings, "first" );
+ fnCallbackDraw( oSettings );
+ } );
+
+ $(nPrevious).click( function() {
+ oSettings.oApi._fnPageChange( oSettings, "previous" );
+ fnCallbackDraw( oSettings );
+ } );
+
+ $(nNext).click( function() {
+ oSettings.oApi._fnPageChange( oSettings, "next" );
+ fnCallbackDraw( oSettings );
+ } );
+
+ $(nLast).click( function() {
+ oSettings.oApi._fnPageChange( oSettings, "last" );
+ fnCallbackDraw( oSettings );
+ } );
+
+ /* Disallow text selection */
+ $(nFirst).bind( 'selectstart', function () { return false; } );
+ $(nPrevious).bind( 'selectstart', function () { return false; } );
+ $(nNext).bind( 'selectstart', function () { return false; } );
+ $(nLast).bind( 'selectstart', function () { return false; } );
+ },
+
+ /*
+ * Function: oPagination.four_button.fnUpdate
+ * Purpose: Update the list of page buttons shows
+ * Returns: -
+ * Inputs: object:oSettings - dataTables settings object
+ * function:fnCallbackDraw - draw function which must be called on update
+ */
+ "fnUpdate": function ( oSettings, fnCallbackDraw )
+ {
+ if ( !oSettings.aanFeatures.p )
+ {
+ return;
+ }
+
+ /* Loop over each instance of the pager */
+ var an = oSettings.aanFeatures.p;
+ for ( var i=0, iLen=an.length ; i<iLen ; i++ )
+ {
+ var buttons = an[i].getElementsByTagName('span');
+ if ( oSettings._iDisplayStart === 0 )
+ {
+ buttons[0].className = "paginate_disabled_first";
+ buttons[1].className = "paginate_disabled_previous";
+ }
+ else
+ {
+ buttons[0].className = "paginate_enabled_first";
+ buttons[1].className = "paginate_enabled_previous";
+ }
+
+ if ( oSettings.fnDisplayEnd() == oSettings.fnRecordsDisplay() )
+ {
+ buttons[2].className = "paginate_disabled_next";
+ buttons[3].className = "paginate_disabled_last";
+ }
+ else
+ {
+ buttons[2].className = "paginate_enabled_next";
+ buttons[3].className = "paginate_enabled_last";
+ }
+ }
+ }
+};
--- /dev/null
+if (typeof KOHA == "undefined" || !KOHA) {
+ var KOHA = {};
+}
+
+/**
+ * A namespace for Google related functions.
+ */
+KOHA.Google = {
+
+
+ /**
+ * Search all:
+ * <div title="biblionumber" id="isbn" class="gbs-thumbnail"></div>
+ * or
+ * <div title="biblionumber" id="isbn" class="gbs-thumbnail-preview"></div>
+ * and run a search with all collected isbns to Google Book Search.
+ * The result is asynchronously returned by Google and catched by
+ * gbsCallBack().
+ */
+ GetCoverFromIsbn: function(newWindow) {
+ var bibkeys = [];
+ $("div [id^=gbs-thumbnail]").each(function(i) {
+ bibkeys.push($(this).attr("class")); // id=isbn
+ });
+ bibkeys = bibkeys.join(',');
+ var scriptElement = document.createElement("script");
+ this.openInNewWindow=newWindow;
+ scriptElement.setAttribute("id", "jsonScript");
+ scriptElement.setAttribute("src",
+ "http://books.google.com/books?bibkeys=" + escape(bibkeys) +
+ "&jscmd=viewapi&callback=KOHA.Google.gbsCallBack");
+ scriptElement.setAttribute("type", "text/javascript");
+ document.documentElement.firstChild.appendChild(scriptElement);
+
+ },
+
+ /**
+ * Add cover pages <div
+ * and link to preview if div id is gbs-thumbnail-preview
+ */
+ gbsCallBack: function(booksInfo) {
+ var target = '';
+ if (this.openInNewWindow) {
+ target = 'target="_blank" ';
+ }
+ for (id in booksInfo) {
+ var book = booksInfo[id];
+ $("."+book.bib_key).each(function() {
+ var a = document.createElement("a");
+ a.href = book.info_url;
+ if (typeof(book.thumbnail_url) != "undefined") {
+ var img = document.createElement("img");
+ img.src = book.thumbnail_url;
+ $(this).append(img);
+ var re = /^gbs-thumbnail-preview/;
+ if ( re.exec($(this).attr("id")) ) {
+ $(this).append(
+ '<div style="margin-bottom:5px; margin-top:-5px;font-size:9px">' +
+ '<a '+target+'href="' +
+ book.info_url +
+ '"><img src="' +
+ 'http://books.google.com/intl/en/googlebooks/images/gbs_preview_sticker1.gif' +
+ '"></a></div>'
+ );
+ }
+ } else {
+ var message = document.createElement("span");
+ $(message).attr("class","no-image");
+ $(message).html(NO_GOOGLE_JACKET);
+ $(this).append(message);
+ }
+ });
+ }
+ }
+};
--- /dev/null
+ // Load the Google Transliteration API
+ google.load("elements", "1", {
+ packages: "transliteration"
+ });
+
+ function onLoad() {
+ var options = {
+ sourceLanguage: 'en',
+ destinationLanguage: ['hi','kn','ml','ta','te'],
+ shortcutKey: 'ctrl+g',
+ transliterationEnabled: true
+ };
+
+ // Create an instance on TransliterationControl with the required
+ // options.
+ var control =
+ new google.elements.transliteration.TransliterationControl(options);
+
+ // Enable transliteration in the textfields with the given ids.
+ var ids = [ "transl1" ];
+ control.makeTransliteratable(ids);
+
+ // Show the transliteration control which can be used to toggle between
+ // English and Hindi and also choose other destination language.
+ control.showControl('translControl');
+ }
+ google.setOnLoadCallback(onLoad);
--- /dev/null
+if (typeof KOHA == "undefined" || !KOHA) {
+ var KOHA = {};
+}
+
+/**
+ * A namespace for local cover related functions.
+ */
+KOHA.LocalCover = {
+
+
+ /**
+ * Search all:
+ * <div title="biblionumber" id="isbn" class="openlibrary-thumbnail"></div>
+ * or
+ * <div title="biblionumber" id="isbn" class="openlibrary-thumbnail-preview"></div>
+ * and run a search with all collected isbns to Open Library Book Search.
+ * The result is asynchronously returned by OpenLibrary and catched by
+ * olCallBack().
+ */
+ GetCoverFromBibnumber: function(uselink) {
+ $("div[id^=local-thumbnail],span[id^=local-thumbnail]").each(function(i) {
+ var mydiv = this;
+ var message = document.createElement("span");
+ $(message).attr("class","no-image");
+ $(message).html(NO_LOCAL_JACKET);
+ $(mydiv).append(message);
+ var img = $("<img />").attr('src',
+ '/cgi-bin/koha/opac-image.pl?thumbnail=1&biblionumber=' + $(mydiv).attr("class"))
+ .load(function () {
+ if (!this.complete || typeof this.naturalWidth == "undefined" || this.naturalWidth == 0) {
+ } else {
+ if (uselink) {
+ var a = $("<a />").attr('href', '/cgi-bin/koha/opac-imageviewer.pl?biblionumber=' + $(mydiv).attr("class"));
+ $(a).append(img);
+ $(mydiv).append(a);
+ } else {
+ $(mydiv).append(img);
+ }
+ $(mydiv).children('.no-image').remove();
+ }
+ })
+ });
+ }
+};
--- /dev/null
+if (typeof KOHA == "undefined" || !KOHA) {
+ var KOHA = {};
+}
+
+/**
+ * A namespace for OpenLibrary related functions.
+ */
+KOHA.OpenLibrary = {
+
+
+ /**
+ * Search all:
+ * <div title="biblionumber" id="isbn" class="openlibrary-thumbnail"></div>
+ * or
+ * <div title="biblionumber" id="isbn" class="openlibrary-thumbnail-preview"></div>
+ * and run a search with all collected isbns to Open Library Book Search.
+ * The result is asynchronously returned by OpenLibrary and catched by
+ * olCallBack().
+ */
+ GetCoverFromIsbn: function() {
+ var bibkeys = [];
+ $("div [id^=openlibrary-thumbnail]").each(function(i) {
+ bibkeys.push("ISBN:" + $(this).attr("class")); // id=isbn
+ });
+ bibkeys = bibkeys.join(',');
+ var scriptElement = document.createElement("script");
+ scriptElement.setAttribute("id", "jsonScript");
+ scriptElement.setAttribute("src",
+ "http://openlibrary.org/api/books?bibkeys=" + escape(bibkeys) +
+ "&callback=KOHA.OpenLibrary.olCallBack&jscmd=data");
+ scriptElement.setAttribute("type", "text/javascript");
+ document.documentElement.firstChild.appendChild(scriptElement);
+ },
+
+ /**
+ * Add cover pages <div
+ * and link to preview if div id is gbs-thumbnail-preview
+ */
+ olCallBack: function(booksInfo) {
+ for (id in booksInfo) {
+ var book = booksInfo[id];
+ var isbn = id.substring(5);
+ $("."+isbn).each(function() {
+ var is_opacdetail = /openlibrary-thumbnail-preview/.exec($(this).attr("id"));
+ var a = document.createElement("a");
+ a.href = booksInfo.url;
+ if (book.cover) {
+ var img = document.createElement("img");
+ if (is_opacdetail) {
+ img.src = book.cover.medium;
+ $(this).append(img);
+ $(this).append('<div class="results_summary">' + '<a href="' + book.url + '">Preview</a></div>');
+ } else {
+ img.src = book.cover.small;
+ $(this).append(img);
+ }
+ } else {
+ var message = document.createElement("span");
+ $(message).attr("class","no-image");
+ $(message).html(NO_OL_JACKET);
+ $(this).append(message);
+ }
+ });
+ }
+ }
+};
--- /dev/null
+function _(s) { return s } // dummy function for gettext
+function confirmDelete(message) {
+ return (confirm(message) ? true : false);
+}
+
+function Dopop(link) {
+ newin=window.open(link,'popup','width=500,height=400,toolbar=false,scrollbars=yes,resizeable=yes');
+}
+
+$.datepicker.setDefaults({
+ showOn: "both",
+ changeMonth: true,
+ changeYear: true,
+ buttonImage: '/opac-tmpl/prog/famfamfam/silk/calendar.png',
+ buttonImageOnly: true,
+ showButtonPanel: true
+ });
+
+$(document).ready(function(){
+ $(".close").click(function(){
+ window.close();
+ });
+ $(".focus").focus();
+ $( ".datepicker" ).datepicker();
+ // http://jqueryui.com/demos/datepicker/#date-range
+ var dates = $( ".datepickerfrom, .datepickerto" ).datepicker({
+ changeMonth: true,
+ numberOfMonths: 1,
+ onSelect: function( selectedDate ) {
+ var option = this.id == "from" ? "minDate" : "maxDate",
+ instance = $( this ).data( "datepicker" );
+ date = $.datepicker.parseDate(
+ instance.settings.dateFormat ||
+ $.datepicker._defaults.dateFormat,
+ selectedDate, instance.settings );
+ dates.not( this ).datepicker( "option", option, date );
+ }
+ });
+ // clear the basket when user logs out
+ $("#logout").click(function(){
+ var nameCookie = "bib_list";
+ var valCookie = readCookie(nameCookie);
+ if (valCookie) { // basket has contents
+ updateBasket(0,null);
+ delCookie(nameCookie);
+ return true;
+ } else {
+ return true;
+ }
+ });
+
+
+ // Add the mobile menu button if we are in some sections of the opac
+ if($('body#opac-user, body#opac-passwd, body#opac-search-history, body#opac-readingrecord, body#opac-userupdate, body#opac-usersuggestions, body#opac-account, body#opac-privacy, body#opac-usertags').length != 0) {
+ $('body').addClass('mobile_menu');
+
+ var button = $('<input type="button" id="mobile_menu_button" value="">').addClass('mobile_only');
+ $('#searchform').append(button);
+
+ button.click(function() {
+ if($('body').hasClass('mobile_menu_opened')){
+ $('body').removeClass('mobile_menu_opened');
+ }
+ else {
+ $('body').addClass('mobile_menu_opened');
+ }
+ });
+ }
+});
+
+// build Change Language menus
+YAHOO.util.Event.onContentReady("changelanguage", function () {
+ $(".sublangs").each(function(){
+ var menuid = $(this).attr("id");
+ var menuid = menuid.replace("show","");
+
+ var oMenu = new YAHOO.widget.Menu("sub"+menuid, { zindex: 2 });
+ function positionoMenu() {
+ oMenu.align("bl", "tl");
+ }
+ oMenu.subscribe("beforeShow", function () {
+ if (this.getRoot() == this) {
+ positionoMenu();
+ }
+ });
+ oMenu.render();
+ oMenu.cfg.setProperty("context", ["show"+menuid, "bl", "tl"]);
+ function onYahooClick(p_oEvent) {
+ // Position and display the menu
+ positionoMenu();
+ oMenu.show();
+ // Stop propagation and prevent the default "click" behavior
+ YAHOO.util.Event.stopEvent(p_oEvent);
+ }
+ YAHOO.util.Event.addListener("show"+menuid, "click", onYahooClick);
+ YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionoMenu);
+
+ });
+});
+
+/*
+// Build lists menu
+YAHOO.util.Event.onContentReady("listsmenu", function () {
+ YAHOO.widget.Menu.prototype.onRender = function () { };
+ $("#listsmenu").css("display","block").css("visibility","hidden");
+ $("#listsmenulink").attr("href","#");
+ var listMenu = new YAHOO.widget.Menu("listsmenu");
+ listMenu.render();
+ listMenu.cfg.setProperty("context", ["listsmenulink", "tr", "br"]);
+ listMenu.cfg.setProperty("effect",{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.05});
+ listMenu.subscribe("beforeShow",positionlistMenu);
+ listMenu.subscribe("show", listMenu.focus);
+ function positionlistMenu() {
+ listMenu.align("tr", "br");
+ }
+ YAHOO.util.Event.addListener("listsmenulink", "click", listMenu.show, null, listMenu);
+ YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionlistMenu);
+ });
+*/
+
+jQuery.fn.preventDoubleFormSubmit = function() {
+ jQuery(this).submit(function() {
+ if (this.beenSubmitted)
+ return false;
+ else
+ this.beenSubmitted = true;
+ });
+};
--- /dev/null
+if (typeof KOHA == "undefined" || !KOHA) {
+ var KOHA = {};
+}
+
+/**
+* A namespace for Tags related functions.
+* readCookie is expected to already be declared. That's why the assignment below is unscoped.
+* readCookie should be from basket.js or undefined.
+
+$.ajaxSetup({
+ url: "/cgi-bin/koha/opac-tags.pl",
+ type: "POST",
+ dataType: "script"
+});
+*/
+if (typeof(readCookie) == "undefined") {
+ readCookie = function (name) { // from http://www.quirksmode.org/js/cookies.html
+ var nameEQ = name + "=";
+ var ca = document.cookie.split(';');
+ for (var i=0;i < ca.length;i++) {
+ var c = ca[i];
+ while (c.charAt(0)==' '){ c = c.substring(1,c.length); }
+ if (c.indexOf(nameEQ) == 0){ return c.substring(nameEQ.length,c.length); }
+ }
+ return null;
+ }
+}
+KOHA.Tags = {
+ add_tag_button: function(){
+ var mybibnum = $(this).attr("title");
+ var mynewtag = "newtag" + mybibnum;
+ var mytagid = "#" + mynewtag;
+ var mydata = {CGISESSID: readCookie('CGISESSID')}; // Someday this should be OPACSESSID
+ mydata[mynewtag] = $(mytagid).val(); // need [bracket] for variable property id
+ var response; // AJAX from server will assign value to response.
+ $.post(
+ "/cgi-bin/koha/opac-tags.pl",
+ mydata,
+ function(data){
+ // alert("AJAX Response: " + data);
+ eval(data);
+ // alert("counts: " + response["added"] + response["deleted"] + response["errors"]);
+ KOHA.Tags.set_tag_status(
+ mytagid + "_status",
+ KOHA.Tags.common_status(response["added"], response["deleted"], response["errors"])
+ );
+ if (response.alerts) {
+ alert(response.alerts.join("\n\n"));
+ }
+ },
+ 'script'
+ );
+ return false;
+ },
+ common_status : function(addcount, delcount, errcount) {
+ var cstat = "";
+ if (addcount && addcount > 0) {cstat += MSG_TAGS_ADDED + addcount + ". " ;}
+ if (delcount && delcount > 0) {cstat += MSG_TAGS_DELETED + delcount + ". " ;}
+ if (errcount && errcount > 0) {cstat += MSG_TAGS_ERRORS + errcount + ". " ;}
+ return cstat;
+ },
+ set_tag_status : function(tagid, newstatus) {
+ $(tagid).html(newstatus);
+ $(tagid).css({display:"inline"});
+ },
+ append_tag_status : function(tagid, newstatus) {
+ $(tagid).append(newstatus);
+ $(tagid).css({display:"inline"});
+ },
+
+ tag_message: {
+ tagsdisabled : function(arg) {return (MSG_TAGS_DISABLED);},
+ scrubbed_all_bad : function(arg) {return (MSG_TAG_ALL_BAD);},
+ badparam : function(arg) {return (MSG_ILLEGAL_PARAMETER+" "+arg);},
+ scrubbed : function(arg) {return (MSG_TAG_SCRUBBED+" "+arg);},
+ failed_add_tag : function(arg) {return (MSG_ADD_TAG_FAILED+ " "+arg+" "+MSG_ADD_TAG_FAILED_NOTE);},
+ failed_delete : function(arg) {return (MSG_DELETE_TAG_FAILED+ " "+arg+" "+MSG_DELETE_TAG_FAILED_NOTE);},
+ login : function(arg) {return (MSG_LOGIN_REQUIRED);}
+ },
+
+ // Used to tag multiple items at once. The main difference
+ // is that status is displayed on a per item basis.
+ add_multitags_button : function(bibarray, tag){
+ var mydata = {CGISESSID: readCookie('CGISESSID')}; // Someday this should be OPACSESSID
+ for (var i = 0; i < bibarray.length; i++) {
+ var mynewtag = "newtag" + bibarray[i];
+ mydata[mynewtag] = tag;
+ }
+ var response; // AJAX from server will assign value to response.
+ $.post(
+ "/cgi-bin/koha/opac-tags.pl",
+ mydata,
+ function(data){
+ eval(data);
+ $(".tagstatus").empty();
+ var bibErrors = false;
+
+ // Display the status for each tagged bib
+ for (var i = 0; i < bibarray.length; i++) {
+ var bib = bibarray[i];
+ var mytagid = "#newtag" + bib;
+ var status = "";
+
+ // Number of tags added.
+ if (response[bib]) {
+ var added = response[bib]["added"];
+ if (added > 0) {
+ status = MSG_TAGS_ADDED + added + ". ";
+ KOHA.Tags.set_tag_status(mytagid + "_status", status);
+ }
+
+ // Show a link that opens an error dialog, if necessary.
+ var errors = response[bib]["errors"];
+ if (errors.length > 0) {
+ bibErrors = true;
+ var errid = "tagerr_" + bib;
+ var errstat = "<a id=\"" + errid + "\" class=\"tagerror\" href=\"#\">";
+ errstat += MSG_TAGS_ERRORS + errors.length + ". ";
+ errstat += "</a>";
+ KOHA.Tags.append_tag_status(mytagid + "_status", errstat);
+ var errmsg = "";
+ for (var e = 0; e < errors.length; e++){
+ if (e) {
+ errmsg += "\n\n";
+ }
+ errmsg += errors[e];
+ }
+ $("#" + errid).click(function(){
+ alert(errmsg);
+ });
+ }
+ }
+ }
+
+ if (bibErrors || response["global_errors"]) {
+ var msg = "";
+ if (bibErrors) {
+ msg = MSG_MULTI_ADD_TAG_FAILED;
+ }
+
+ // Show global errors in a dialog.
+ if (response["global_errors"]) {
+ var global_errors = response["global_errors"];
+ var msg;
+ for (var e = 0; e < global_errors.length; e++) {
+ msg += "\n\n";
+ msg += response.alerts[global_errors[e]];
+ }
+ }
+ alert(msg);
+ }
+ },
+ 'script'
+ );
+ return false;
+ }
+};
--- /dev/null
+AJS={BASE_URL:"",drag_obj:null,drag_elm:null,_drop_zones:[],_cur_pos:null,join:function(_1,_2){
+try{
+return _2.join(_1);
+}
+catch(e){
+var r=_2[0]||"";
+AJS.map(_2,function(_4){
+r+=_1+_4;
+},1);
+return r+"";
+}
+},getScrollTop:function(){
+var t;
+if(document.documentElement&&document.documentElement.scrollTop){
+t=document.documentElement.scrollTop;
+}else{
+if(document.body){
+t=document.body.scrollTop;
+}
+}
+return t;
+},addClass:function(){
+var _6=AJS.forceArray(arguments);
+var _7=_6.pop();
+var _8=function(o){
+if(!new RegExp("(^|\\s)"+_7+"(\\s|$)").test(o.className)){
+o.className+=(o.className?" ":"")+_7;
+}
+};
+AJS.map(_6,function(_a){
+_8(_a);
+});
+},setStyle:function(){
+var _b=AJS.forceArray(arguments);
+var _c=_b.pop();
+var _d=_b.pop();
+AJS.map(_b,function(_e){
+_e.style[_d]=AJS.getCssDim(_c);
+});
+},_getRealScope:function(fn,_10,_11,_12){
+var _13=window;
+_10=AJS.$A(_10);
+if(fn._cscope){
+_13=fn._cscope;
+}
+return function(){
+var _14=[];
+var i=0;
+if(_11){
+i=1;
+}
+AJS.map(arguments,function(arg){
+_14.push(arg);
+},i);
+_14=_14.concat(_10);
+if(_12){
+_14=_14.reverse();
+}
+return fn.apply(_13,_14);
+};
+},preloadImages:function(){
+AJS.AEV(window,"load",AJS.$p(function(_17){
+AJS.map(_17,function(src){
+var pic=new Image();
+pic.src=src;
+});
+},arguments));
+},_createDomShortcuts:function(){
+var _1a=["ul","li","td","tr","th","tbody","table","input","span","b","a","div","img","button","h1","h2","h3","br","textarea","form","p","select","option","iframe","script","center","dl","dt","dd","small","pre"];
+var _1b=function(elm){
+var _1d="return AJS.createDOM.apply(null, ['"+elm+"', arguments]);";
+var _1e="function() { "+_1d+" }";
+eval("AJS."+elm.toUpperCase()+"="+_1e);
+};
+AJS.map(_1a,_1b);
+AJS.TN=function(_1f){
+return document.createTextNode(_1f);
+};
+},documentInsert:function(elm){
+if(typeof (elm)=="string"){
+elm=AJS.HTML2DOM(elm);
+}
+document.write("<span id=\"dummy_holder\"></span>");
+AJS.swapDOM(AJS.$("dummy_holder"),elm);
+},getWindowSize:function(doc){
+doc=doc||document;
+var _22,_23;
+if(self.innerHeight){
+_22=self.innerWidth;
+_23=self.innerHeight;
+}else{
+if(doc.documentElement&&doc.documentElement.clientHeight){
+_22=doc.documentElement.clientWidth;
+_23=doc.documentElement.clientHeight;
+}else{
+if(doc.body){
+_22=doc.body.clientWidth;
+_23=doc.body.clientHeight;
+}
+}
+}
+return {"w":_22,"h":_23};
+},flattenList:function(_24){
+var r=[];
+var _26=function(r,l){
+AJS.map(l,function(o){
+if(o==null){
+}else{
+if(AJS.isArray(o)){
+_26(r,o);
+}else{
+r.push(o);
+}
+}
+});
+};
+_26(r,_24);
+return r;
+},setEventKey:function(e){
+e.key=e.keyCode?e.keyCode:e.charCode;
+if(window.event){
+e.ctrl=window.event.ctrlKey;
+e.shift=window.event.shiftKey;
+}else{
+e.ctrl=e.ctrlKey;
+e.shift=e.shiftKey;
+}
+switch(e.key){
+case 63232:
+e.key=38;
+break;
+case 63233:
+e.key=40;
+break;
+case 63235:
+e.key=39;
+break;
+case 63234:
+e.key=37;
+break;
+}
+},removeElement:function(){
+var _2b=AJS.forceArray(arguments);
+AJS.map(_2b,function(elm){
+AJS.swapDOM(elm,null);
+});
+},_unloadListeners:function(){
+if(AJS.listeners){
+AJS.map(AJS.listeners,function(elm,_2e,fn){
+AJS.REV(elm,_2e,fn);
+});
+}
+AJS.listeners=[];
+},partial:function(fn){
+var _31=AJS.forceArray(arguments);
+return AJS.$b(fn,null,_31.slice(1,_31.length).reverse(),false,true);
+},getIndex:function(elm,_33,_34){
+for(var i=0;i<_33.length;i++){
+if(_34&&_34(_33[i])||elm==_33[i]){
+return i;
+}
+}
+return -1;
+},isDefined:function(o){
+return (o!="undefined"&&o!=null);
+},isArray:function(obj){
+return obj instanceof Array;
+},setLeft:function(){
+var _38=AJS.forceArray(arguments);
+_38.splice(_38.length-1,0,"left");
+AJS.setStyle.apply(null,_38);
+},appendChildNodes:function(elm){
+if(arguments.length>=2){
+AJS.map(arguments,function(n){
+if(AJS.isString(n)){
+n=AJS.TN(n);
+}
+if(AJS.isDefined(n)){
+elm.appendChild(n);
+}
+},1);
+}
+return elm;
+},isOpera:function(){
+return (navigator.userAgent.toLowerCase().indexOf("opera")!=-1);
+},isString:function(obj){
+return (typeof obj=="string");
+},hideElement:function(elm){
+var _3d=AJS.forceArray(arguments);
+AJS.map(_3d,function(elm){
+elm.style.display="none";
+});
+},setOpacity:function(elm,p){
+elm.style.opacity=p;
+elm.style.filter="alpha(opacity="+p*100+")";
+},setHeight:function(){
+var _41=AJS.forceArray(arguments);
+_41.splice(_41.length-1,0,"height");
+AJS.setStyle.apply(null,_41);
+},setWidth:function(){
+var _42=AJS.forceArray(arguments);
+_42.splice(_42.length-1,0,"width");
+AJS.setStyle.apply(null,_42);
+},createArray:function(v){
+if(AJS.isArray(v)&&!AJS.isString(v)){
+return v;
+}else{
+if(!v){
+return [];
+}else{
+return [v];
+}
+}
+},isDict:function(o){
+var _45=String(o);
+return _45.indexOf(" Object")!=-1;
+},isMozilla:function(){
+return (navigator.userAgent.toLowerCase().indexOf("gecko")!=-1&&navigator.productSub>=20030210);
+},_listenOnce:function(elm,_47,fn){
+var _49=function(){
+AJS.removeEventListener(elm,_47,_49);
+fn(arguments);
+};
+return _49;
+},addEventListener:function(elm,_4b,fn,_4d,_4e){
+if(!_4e){
+_4e=false;
+}
+var _4f=AJS.$A(elm);
+AJS.map(_4f,function(_50){
+if(_4d){
+fn=AJS._listenOnce(_50,_4b,fn);
+}
+if(AJS.isIn(_4b,["submit","load","scroll","resize"])){
+var old=elm["on"+_4b];
+elm["on"+_4b]=function(){
+if(old){
+fn(arguments);
+return old(arguments);
+}else{
+return fn(arguments);
+}
+};
+return;
+}
+if(AJS.isIn(_4b,["keypress","keydown","keyup","click"])){
+var _52=fn;
+fn=function(e){
+AJS.setEventKey(e);
+return _52.apply(null,arguments);
+};
+}
+if(_50.attachEvent){
+_50.attachEvent("on"+_4b,fn);
+}else{
+if(_50.addEventListener){
+_50.addEventListener(_4b,fn,_4e);
+}
+}
+AJS.listeners=AJS.$A(AJS.listeners);
+AJS.listeners.push([_50,_4b,fn]);
+});
+},createDOM:function(_54,_55){
+var i=0,_57;
+elm=document.createElement(_54);
+if(AJS.isDict(_55[i])){
+for(k in _55[0]){
+_57=_55[0][k];
+if(k=="style"){
+elm.style.cssText=_57;
+}else{
+if(k=="class"||k=="className"){
+elm.className=_57;
+}else{
+elm.setAttribute(k,_57);
+}
+}
+}
+i++;
+}
+if(_55[0]==null){
+i=1;
+}
+AJS.map(_55,function(n){
+if(n){
+if(AJS.isString(n)||AJS.isNumber(n)){
+n=AJS.TN(n);
+}
+elm.appendChild(n);
+}
+},i);
+return elm;
+},setTop:function(){
+var _59=AJS.forceArray(arguments);
+_59.splice(_59.length-1,0,"top");
+AJS.setStyle.apply(null,_59);
+},getElementsByTagAndClassName:function(_5a,_5b,_5c){
+var _5d=[];
+if(!AJS.isDefined(_5c)){
+_5c=document;
+}
+if(!AJS.isDefined(_5a)){
+_5a="*";
+}
+var els=_5c.getElementsByTagName(_5a);
+var _5f=els.length;
+var _60=new RegExp("(^|\\s)"+_5b+"(\\s|$)");
+for(i=0,j=0;i<_5f;i++){
+if(_60.test(els[i].className)||_5b==null){
+_5d[j]=els[i];
+j++;
+}
+}
+return _5d;
+},removeClass:function(){
+var _61=AJS.forceArray(arguments);
+var cls=_61.pop();
+var _63=function(o){
+o.className=o.className.replace(new RegExp("\\s?"+cls,"g"),"");
+};
+AJS.map(_61,function(elm){
+_63(elm);
+});
+},bindMethods:function(_66){
+for(var k in _66){
+var _68=_66[k];
+if(typeof (_68)=="function"){
+_66[k]=AJS.$b(_68,_66);
+}
+}
+},log:function(o){
+if(AJS.isMozilla()){
+console.log(o);
+}else{
+var div=AJS.DIV({"style":"color: green"});
+AJS.ACN(AJS.getBody(),AJS.setHTML(div,""+o));
+}
+},isNumber:function(obj){
+return (typeof obj=="number");
+},map:function(_6c,fn,_6e,_6f){
+var i=0,l=_6c.length;
+if(_6e){
+i=_6e;
+}
+if(_6f){
+l=_6f;
+}
+for(i;i<l;i++){
+fn.apply(null,[_6c[i],i]);
+}
+},removeEventListener:function(elm,_73,fn,_75){
+if(!_75){
+_75=false;
+}
+if(elm.removeEventListener){
+elm.removeEventListener(_73,fn,_75);
+if(AJS.isOpera()){
+elm.removeEventListener(_73,fn,!_75);
+}
+}else{
+if(elm.detachEvent){
+elm.detachEvent("on"+_73,fn);
+}
+}
+},getCssDim:function(dim){
+if(AJS.isString(dim)){
+return dim;
+}else{
+return dim+"px";
+}
+},setHTML:function(elm,_78){
+elm.innerHTML=_78;
+return elm;
+},bind:function(fn,_7a,_7b,_7c,_7d){
+fn._cscope=_7a;
+return AJS._getRealScope(fn,_7b,_7c,_7d);
+},forceArray:function(_7e){
+var r=[];
+AJS.map(_7e,function(elm){
+r.push(elm);
+});
+return r;
+},update:function(l1,l2){
+for(var i in l2){
+l1[i]=l2[i];
+}
+return l1;
+},getBody:function(){
+return AJS.$bytc("body")[0];
+},HTML2DOM:function(_84,_85){
+var d=AJS.DIV();
+d.innerHTML=_84;
+if(_85){
+return d.childNodes[0];
+}else{
+return d;
+}
+},getElement:function(id){
+if(AJS.isString(id)||AJS.isNumber(id)){
+return document.getElementById(id);
+}else{
+return id;
+}
+},showElement:function(){
+var _88=AJS.forceArray(arguments);
+AJS.map(_88,function(elm){
+elm.style.display="";
+});
+},swapDOM:function(_8a,src){
+_8a=AJS.getElement(_8a);
+var _8c=_8a.parentNode;
+if(src){
+src=AJS.getElement(src);
+_8c.replaceChild(src,_8a);
+}else{
+_8c.removeChild(_8a);
+}
+return src;
+},isIn:function(elm,_8e){
+var i=AJS.getIndex(elm,_8e);
+if(i!=-1){
+return true;
+}else{
+return false;
+}
+}};
+AJS.$=AJS.getElement;
+AJS.$$=AJS.getElements;
+AJS.$f=AJS.getFormElement;
+AJS.$p=AJS.partial;
+AJS.$b=AJS.bind;
+AJS.$A=AJS.createArray;
+AJS.DI=AJS.documentInsert;
+AJS.ACN=AJS.appendChildNodes;
+AJS.RCN=AJS.replaceChildNodes;
+AJS.AEV=AJS.addEventListener;
+AJS.REV=AJS.removeEventListener;
+AJS.$bytc=AJS.getElementsByTagAndClassName;
+AJS.addEventListener(window,"unload",AJS._unloadListeners);
+AJS._createDomShortcuts();
+AJS.Class=function(_90){
+var fn=function(){
+if(arguments[0]!="no_init"){
+return this.init.apply(this,arguments);
+}
+};
+fn.prototype=_90;
+AJS.update(fn,AJS.Class.prototype);
+return fn;
+};
+AJS.Class.prototype={extend:function(_92){
+var _93=new this("no_init");
+for(k in _92){
+var _94=_93[k];
+var cur=_92[k];
+if(_94&&_94!=cur&&typeof cur=="function"){
+cur=this._parentize(cur,_94);
+}
+_93[k]=cur;
+}
+return new AJS.Class(_93);
+},implement:function(_96){
+AJS.update(this.prototype,_96);
+},_parentize:function(cur,_98){
+return function(){
+this.parent=_98;
+return cur.apply(this,arguments);
+};
+}};
+AJS.$=AJS.getElement;
+AJS.$$=AJS.getElements;
+AJS.$f=AJS.getFormElement;
+AJS.$b=AJS.bind;
+AJS.$p=AJS.partial;
+AJS.$FA=AJS.forceArray;
+AJS.$A=AJS.createArray;
+AJS.DI=AJS.documentInsert;
+AJS.ACN=AJS.appendChildNodes;
+AJS.RCN=AJS.replaceChildNodes;
+AJS.AEV=AJS.addEventListener;
+AJS.REV=AJS.removeEventListener;
+AJS.$bytc=AJS.getElementsByTagAndClassName;
+AJSDeferred=function(req){
+this.callbacks=[];
+this.errbacks=[];
+this.req=req;
+};
+AJSDeferred.prototype={excCallbackSeq:function(req,_9b){
+var _9c=req.responseText;
+while(_9b.length>0){
+var fn=_9b.pop();
+var _9e=fn(_9c,req);
+if(_9e){
+_9c=_9e;
+}
+}
+},callback:function(){
+this.excCallbackSeq(this.req,this.callbacks);
+},errback:function(){
+if(this.errbacks.length==0){
+alert("Error encountered:\n"+this.req.responseText);
+}
+this.excCallbackSeq(this.req,this.errbacks);
+},addErrback:function(fn){
+this.errbacks.unshift(fn);
+},addCallback:function(fn){
+this.callbacks.unshift(fn);
+},addCallbacks:function(fn1,fn2){
+this.addCallback(fn1);
+this.addErrback(fn2);
+},sendReq:function(_a3){
+if(AJS.isObject(_a3)){
+this.req.send(AJS.queryArguments(_a3));
+}else{
+if(AJS.isDefined(_a3)){
+this.req.send(_a3);
+}else{
+this.req.send("");
+}
+}
+}};
+script_loaded=true;
+
+
+script_loaded=true;
\ No newline at end of file
--- /dev/null
+AJS.fx={_shades:{0:"ffffff",1:"ffffee",2:"ffffdd",3:"ffffcc",4:"ffffbb",5:"ffffaa",6:"ffff99"},highlight:function(_1,_2){
+var _3=new AJS.fx.Base();
+_3.elm=AJS.$(_1);
+_3.setOptions(_2);
+_3.options.duration=600;
+AJS.update(_3,{increase:function(){
+if(this.now==7){
+_1.style.backgroundColor="transparent";
+}else{
+_1.style.backgroundColor="#"+AJS.fx._shades[Math.floor(this.now)];
+}
+}});
+return _3.custom(6,0);
+},fadeIn:function(_4,_5){
+_5=_5||{};
+if(!_5.from){
+_5.from=0;
+AJS.setOpacity(_4,0);
+}
+if(!_5.to){
+_5.to=1;
+}
+var s=new AJS.fx.Style(_4,"opacity",_5);
+return s.custom(_5.from,_5.to);
+},fadeOut:function(_7,_8){
+_8=_8||{};
+if(!_8.from){
+_8.from=1;
+}
+if(!_8.to){
+_8.to=0;
+}
+_8.duration=300;
+var s=new AJS.fx.Style(_7,"opacity",_8);
+return s.custom(_8.from,_8.to);
+},setWidth:function(_a,_b){
+var s=new AJS.fx.Style(_a,"width",_b);
+return s.custom(_b.from,_b.to);
+},setHeight:function(_d,_e){
+var s=new AJS.fx.Style(_d,"height",_e);
+return s.custom(_e.from,_e.to);
+}};
+AJS.fx.Base=new AJS.Class({init:function(){
+AJS.bindMethods(this);
+},setOptions:function(_10){
+this.options=AJS.update({onStart:function(){
+},onComplete:function(){
+},transition:AJS.fx.Transitions.sineInOut,duration:500,wait:true,fps:50},_10||{});
+},step:function(){
+var _11=new Date().getTime();
+if(_11<this.time+this.options.duration){
+this.cTime=_11-this.time;
+this.setNow();
+}else{
+setTimeout(AJS.$b(this.options.onComplete,this,[this.elm]),10);
+this.clearTimer();
+this.now=this.to;
+}
+this.increase();
+},setNow:function(){
+this.now=this.compute(this.from,this.to);
+},compute:function(_12,to){
+var _14=to-_12;
+return this.options.transition(this.cTime,_12,_14,this.options.duration);
+},clearTimer:function(){
+clearInterval(this.timer);
+this.timer=null;
+return this;
+},_start:function(_15,to){
+if(!this.options.wait){
+this.clearTimer();
+}
+if(this.timer){
+return;
+}
+setTimeout(AJS.$p(this.options.onStart,this.elm),10);
+this.from=_15;
+this.to=to;
+this.time=new Date().getTime();
+this.timer=setInterval(this.step,Math.round(1000/this.options.fps));
+return this;
+},custom:function(_17,to){
+return this._start(_17,to);
+},set:function(to){
+this.now=to;
+this.increase();
+return this;
+},setStyle:function(elm,_1b,val){
+if(this.property=="opacity"){
+AJS.setOpacity(elm,val);
+}else{
+AJS.setStyle(elm,_1b,val);
+}
+}});
+AJS.fx.Style=AJS.fx.Base.extend({init:function(elm,_1e,_1f){
+this.parent();
+this.elm=elm;
+this.setOptions(_1f);
+this.property=_1e;
+},increase:function(){
+this.setStyle(this.elm,this.property,this.now);
+}});
+AJS.fx.Styles=AJS.fx.Base.extend({init:function(elm,_21){
+this.parent();
+this.elm=AJS.$(elm);
+this.setOptions(_21);
+this.now={};
+},setNow:function(){
+for(p in this.from){
+this.now[p]=this.compute(this.from[p],this.to[p]);
+}
+},custom:function(obj){
+if(this.timer&&this.options.wait){
+return;
+}
+var _23={};
+var to={};
+for(p in obj){
+_23[p]=obj[p][0];
+to[p]=obj[p][1];
+}
+return this._start(_23,to);
+},increase:function(){
+for(var p in this.now){
+this.setStyle(this.elm,p,this.now[p]);
+}
+}});
+AJS.fx.Transitions={linear:function(t,b,c,d){
+return c*t/d+b;
+},sineInOut:function(t,b,c,d){
+return -c/2*(Math.cos(Math.PI*t/d)-1)+b;
+}};
+script_loaded=true;
+
+
+script_loaded=true;
\ No newline at end of file
--- /dev/null
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+\f
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+\f
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>GreyBox - About</title>
+
+ <script type="text/javascript">
+ var GB_ROOT_DIR = "./greybox/";
+ </script>
+
+ <script type="text/javascript" src="greybox/AJS.js"></script>
+ <script type="text/javascript" src="greybox/AJS_fx.js"></script>
+ <script type="text/javascript" src="greybox/gb_scripts.js"></script>
+ <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
+
+ <script type="text/javascript" src="static_files/help.js"></script>
+ <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body>
+
+<script>
+ insertHeader();
+ insertMenu('about');
+</script>
+
+<p>
+GreyBox is copyrighted work by <a href="http://amix.dk/">Amir Salihefendic</a>.
+</p>
+
+<p>
+It is based on <a href="http://orangoo.com/labs/AJS/">AJS</a> JavaScript library.
+</p>
+
+<p>
+It is realesed under <a href="LGPL.txt">LGPL</a>.
+</p>
+
+<h3>Links</h3>
+<ul>
+ <li> <a href="http://orangoo.com/labs/GreyBox/">GreyBox official site</a> </li>
+</ul>
+
+<h3>Need help?</h3>
+<ul>
+ <li><a href="http://groups.google.com/group/greybox">GreyBox Google group</a> - A group where you can ask questions and get answers</li>
+ <li><a href="http://orangoo.com/labs/GreyBox/FAQ/">GreyBox FAQ</a> -Frequently Asked Questions about GreyBox</li>
+</ul>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>GreyBox - Advance usage</title>
+
+ <script type="text/javascript">
+ var GB_ROOT_DIR = "./greybox/";
+ </script>
+
+ <script type="text/javascript" src="greybox/AJS.js"></script>
+ <script type="text/javascript" src="greybox/AJS_fx.js"></script>
+ <script type="text/javascript" src="greybox/gb_scripts.js"></script>
+ <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
+
+ <script type="text/javascript" src="static_files/help.js"></script>
+ <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+<body>
+
+<script>
+insertHeader();
+insertMenu('adv_usage');
+</script>
+
+<h2>Methods for showing windows</h2>
+
+<h3 class="first">GB_show</h3>
+
+<h4>Signature:</h4>
+<script>
+insertCode(
+ 'GB_show(caption, url, /*optional*/ height, width, callback_fn)'
+);
+</script>
+
+<h4>Example:</h4>
+<script>
+insertCode(
+ '<a href="http://google.com/" onclick="return GB_show(\'Google\', this.href)">Visit Google</a>'
+);
+</script>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com/" onclick="return GB_show('Google', this.href)">Visit Google</a>
+
+
+<h3>GB_showCenter</h3>
+
+<h4>Signature:</h4>
+<script>
+insertCode(
+ 'GB_showCenter(caption, url, /* optional */ height, width, callback_fn)'
+);
+</script>
+
+<h4>Example:</h4>
+<script>
+insertCode(
+ '<a href="http://google.com/" onclick="return GB_showCenter(\'Google\', this.href)">Visit Google</a>'
+);
+</script>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com/" onclick="return GB_showCenter('Google', this.href)">Visit Google</a>
+
+
+<h3>GB_showFullScreen</h3>
+
+<h4>Signature:</h4>
+<script>
+insertCode(
+ 'GB_showFullScreen(caption, url, callback_fn)'
+);
+</script>
+
+<h4>Example:</h4>
+<script>
+insertCode(
+ '<a href="http://google.com/" onclick="return GB_showFullScreen(\'Google\', this.href)">Visit Google</a>'
+);
+</script>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com/" onclick="return GB_showFullScreen('Google', this.href)">Visit Google</a>
+
+<h2>Methods for showing overlays</h2>
+
+<h3 class="first">GB_showImage</h3>
+<h4>Signature:</h4>
+<script>
+insertCode(
+ 'GB_showImage(caption, url, callback_fn)'
+);
+</script>
+
+<h4>Example:</h4>
+<script>
+insertCode(
+ '<a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg"\n'+
+ 'onclick="return GB_showImage(\'Flower\', this.href)">A flower in my hand</a>'
+);
+</script>
+
+<h4>Example rendered:</h4>
+<a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg" onclick="return GB_showImage('Flower', this.href)">A flower in my hand</a>
+
+<h3>GB_showPage</h3>
+<h4>Signature:</h4>
+<script>
+insertCode(
+ 'GB_showPage(caption, url, callback_fn)'
+);
+</script>
+
+<h4>Example:</h4>
+<script>
+insertCode(
+ '<a href="http://google.com" onclick="return GB_showPage(\'Google\', this.href)">Show Google in another layout</a>'
+);
+</script>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com" onclick="return GB_showPage('Google', this.href)">Show Google in another layout</a>
+
+
+<h2>Methods for showing sets</h2>
+
+<h3 class="first">GB_showFullScreenSet</h3>
+<h4>Signature:</h4>
+<script>
+insertCode(
+ 'GB_showFullScreenSet(set, start_index, callback_fn)'
+);
+</script>
+
+<h4>Example:</h4>
+<script>
+insertCode(
+ "<script>",
+ "var page_set = [{'caption': 'Google', 'url': 'http://google.com/'},",
+ " {'caption': 'Yahoo', 'url': 'http://yahoo.com/'}];",
+ "<\/script>",
+ '<a href="#" onclick="return GB_showFullScreenSet(page_set, 1)">Show first page in page_set</a>'
+);
+</script>
+
+<h4>Example rendered:</h4>
+<script>
+var page_set = [{'caption': 'Google', 'url': 'http://google.com/'},
+ {'caption': 'Yahoo', 'url': 'http://yahoo.com/'}];
+</script>
+<a href="#" onclick="return GB_showFullScreenSet(page_set, 1)">Show first page in page_set</a>
+
+<h3>GB_showImageSet</h3>
+<h4>Signature:</h4>
+<script>
+insertCode(
+ 'GB_showImageSet(set, start_index, callback_fn)'
+);
+</script>
+
+<h4>Example:</h4>
+<script>
+insertCode(
+ "<script>",
+ "var image_set = [{'caption': 'Flower', 'url': 'http://static.flickr.com/119/294309231_a3d2a339b9.jpg'},",
+ " {'caption': 'Nice waterfall', 'url': 'http://www.widerange.org/images/large/plitvicka.jpg'}];",
+ "<\/script>",
+ '<a href="#" onclick="return GB_showImageSet(image_set, 1)">Show first picture in image_set</a>'
+);
+</script>
+
+<h4>Example rendered:</h4>
+<script>
+var image_set = [{'caption': 'Flower', 'url': 'http://static.flickr.com/119/294309231_a3d2a339b9.jpg'},
+ {'caption': 'Nice waterfall', 'url': 'http://www.widerange.org/images/large/plitvicka.jpg'}];
+</script>
+<a href="#" onclick="return GB_showImageSet(image_set, 1)">Show first picture in image_set</a>
+
+
+</body>
+</html>
--- /dev/null
+#!/usr/bin/env python
+"""
+Used to combine the different parts of GreyBox.
+- Python 2.4 required
+- Java 1.4+ required
+- Dojo's JavaScript compressor (http://dojotoolkit.org/docs/compressor_system.html). Place it under compression_lib/custom_rhino.jar
+"""
+import os, sys, shutil
+from compression_lib import AJS_minify
+
+
+if __name__ == '__main__':
+ args = sys.argv
+
+ if len(args) < 2:
+ print """
+Usage is:
+ python combiner.py [full|gallery|window]
+Example usage:
+ python combiner.py full
+The files will be store in greybox_dist/* depending on the dist. type
+"""
+ sys.exit(0)
+
+ type = args[1]
+ output_dir = 'greybox'
+
+ ##
+ # Config file list
+ #
+ js = []
+ css = []
+ static = []
+
+ append = lambda l, x: l.append('greybox_source/%s' % x)
+
+ def appendBase():
+ append(js, 'base/base.js')
+ append(js, 'auto_deco.js')
+ append(css, 'base/base.css')
+ append(static, 'base/indicator.gif')
+ append(static, 'base/loader_frame.html')
+
+ def appendSet():
+ append(js, 'set/set.js')
+ append(css, 'set/set.css')
+ append(static, 'set/next.gif')
+ append(static, 'set/prev.gif')
+
+ def appendGallery():
+ append(js, 'gallery/gallery.js')
+ append(css, 'gallery/gallery.css')
+ append(static, 'gallery/g_close.gif')
+
+ def appendWindow():
+ append(js, 'window/window.js')
+ append(css, 'window/window.css')
+ append(static, 'window/header_bg.gif')
+ append(static, 'window/w_close.gif')
+
+ appendBase()
+
+ if type == 'full':
+ appendGallery()
+ appendSet()
+ appendWindow()
+ elif type == 'gallery':
+ appendGallery()
+ appendSet()
+ elif type == 'window':
+ appendWindow()
+ else:
+ sys.exit('Uknown type')
+
+ print 'Follwoing styles are used:'
+ for style in css:
+ print ' %s' % style
+
+ print 'Follwoing JavaScript is used:'
+ for script in js:
+ print ' %s' % script
+
+ ##
+ # Copy the files
+ #
+ try:
+ shutil.rmtree(output_dir)
+ except:
+ pass
+ os.mkdir(output_dir)
+
+ def concatFiles(f_list):
+ data = []
+ for f in f_list:
+ data.append(open(f, 'r').read())
+ return '\n\n'.join(data)
+
+ def copyFiles(f_list):
+ for f in f_list:
+ shutil.copy(f, output_dir)
+
+ copyFiles(static)
+ fp = open('%s/%s' % (output_dir, 'gb_styles.css'), 'w')
+ fp.write(concatFiles(css))
+ fp.close()
+ print 'Compressed styles in %s' % ('greybox/gb_styles.css')
+
+ ##
+ # Concat js
+ #
+ fp = open('%s/%s' % (output_dir, 'gb_scripts_tmp.js'), 'w')
+ fp.write(concatFiles(js))
+ fp.close()
+
+ AJS_minify.AJS_SRC = 'greybox_source/base/AJS.js'
+ AJS_minify.AJS_MINI_SRC = 'greybox/AJS_tmp.js'
+ files = ['greybox/gb_scripts_tmp.js', 'greybox_source/base/AJS_fx.js', 'static_files/help.js']
+ code_analyzer = AJS_minify.ExternalCodeAnalyzer(files)
+ composer = AJS_minify.AjsComposer(code_analyzer.findFunctions())
+ composer.writeToOutput()
+
+ os.popen('java -jar compression_lib/custom_rhino.jar -c greybox/AJS_tmp.js > greybox/AJS.js')
+ os.remove('greybox/AJS_tmp.js')
+ os.popen('java -jar compression_lib/custom_rhino.jar -c greybox_source/base/AJS_fx.js > greybox/AJS_fx.js')
+ print 'Compressed AJS.js and AJS.js into greybox/'
+
+ os.popen('java -jar compression_lib/custom_rhino.jar -c greybox/gb_scripts_tmp.js > greybox/gb_scripts.js')
+ os.remove('greybox/gb_scripts_tmp.js')
+ print 'Compressed JavaScript in %s' % ('greybox/gb_scripts.css')
+
+ #Append script_loaded
+ open('greybox/AJS.js', 'a').write('\nscript_loaded=true;')
+ open('greybox/AJS_fx.js', 'a').write('\nscript_loaded=true;')
+ open('greybox/gb_scripts.js', 'a').write('\nscript_loaded=true;')
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>GreyBox - Compressing GreyBox</title>
+
+ <script type="text/javascript">
+ var GB_ROOT_DIR = "./greybox/";
+ </script>
+
+ <script type="text/javascript" src="greybox/AJS.js"></script>
+ <script type="text/javascript" src="greybox/AJS_fx.js"></script>
+ <script type="text/javascript" src="greybox/gb_scripts.js"></script>
+ <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
+
+ <script type="text/javascript" src="static_files/help.js"></script>
+ <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+<body>
+
+<script>
+insertHeader();
+insertMenu('cmpr');
+</script>
+
+<h2>Code structure</h2>
+<ul>
+ <li><b>greybox:</b> Generated and compressed JavaScript and CSS is located here</li>
+ <li><b>greybox_source:</b> CSS and JavaScript structured in directories.</li>
+</ul>
+It's not recommend that you alter code in the <b>greybox</b> directory, since it's computer generated and very unreadable!
+
+
+<h2>Download Dojo ShrinkSafe</h2>
+To make the filesize as small as possible GreyBox JavaScript is compressed down using <a href="http://alex.dojotoolkit.org/shrinksafe/">Dojo ShrinkSafe</a>. This library requires <a href="http://www.java.com/getjava/">Java</a>, so make sure you got Java installed. Download following JAR file:
+<ul>
+ <li><a href="http://svn.dojotoolkit.org/dojo/trunk/buildscripts/lib/custom_rhino.jar">custom_rhino.jar</a></li>
+</ul>
+Place <b>custom_rhino.jar</b> in GreyBox's <b>compression_lib</b> directory.
+
+
+<h2>Compressing GreyBox</h2>
+Now, you are ready to compress GreyBox. This is done by running a Python script called <b>combiner.py</b>. I.e. you need to download and install <a href="http://www.python.org/download/">Pyhton</a>.
+
+<p>
+You can run <b>combiner.py</b> in following ways:
+</p>
+
+<ul>
+ <li><b>python combiner.py full:</b> Compress everything</li>
+ <li><b>python combiner.py gallery:</b> Compress only gallery related CSS and JavaScript</li>
+ <li><b>python combiner.py window:</b> Compress only window related CSS and JavaScript</li>
+</ul>
+
+</body>
+</html>
--- /dev/null
+#!/usr/bin/env python
+#Last-update: 08/05/07 12:39:17
+import re
+import sys
+from sets import Set
+
+##
+# External files
+#
+AJS_SRC = 'AJS.js'
+AJS_MINI_SRC = 'AJS_compressed.js'
+
+
+##
+# Standard stuff that may change in the future
+#
+DOM_SHORTCUTS = [
+ "ul", "li", "td", "tr", "th",
+ "tbody", "table", "input", "span", "b",
+ "a", "div", "img", "button", "h1",
+ "h2", "h3", "br", "textarea", "form",
+ "p", "select", "option", "iframe", "script",
+ "center", "dl", "dt", "dd", "small",
+ "pre", "tn"
+]
+
+FN_SHORTCUTS = {
+ '$': 'getElement',
+ '$$': 'getElements',
+ '$f': 'getFormElement',
+ '$b': 'bind',
+ '$p': 'partial',
+ '$A': 'createArray',
+ 'DI': 'documentInsert',
+ 'ACN': 'appendChildNodes',
+ 'RCN': 'replaceChildNodes',
+ 'AEV': 'addEventListener',
+ 'REV': 'removeEventListener',
+ '$bytc': 'getElementsByTagAndClassName'
+}
+
+AJS_TEMPLATE = """//AJS JavaScript library (minify'ed version)
+//Copyright (c) 2006 Amir Salihefendic. All rights reserved.
+//Copyright (c) 2005 Bob Ippolito. All rights reserved.
+//License: http://www.opensource.org/licenses/mit-license.php
+//Visit http://orangoo.com/AmiNation/AJS for full version.
+AJS = {
+BASE_URL: "",
+drag_obj: null,
+drag_elm: null,
+_drop_zones: [],
+_cur_pos: null,
+
+%(functions)s
+}
+
+AJS.$ = AJS.getElement;
+AJS.$$ = AJS.getElements;
+AJS.$f = AJS.getFormElement;
+AJS.$p = AJS.partial;
+AJS.$b = AJS.bind;
+AJS.$A = AJS.createArray;
+AJS.DI = AJS.documentInsert;
+AJS.ACN = AJS.appendChildNodes;
+AJS.RCN = AJS.replaceChildNodes;
+AJS.AEV = AJS.addEventListener;
+AJS.REV = AJS.removeEventListener;
+AJS.$bytc = AJS.getElementsByTagAndClassName;
+
+AJS.addEventListener(window, 'unload', AJS._unloadListeners);
+AJS._createDomShortcuts();
+
+%(AJSClass)s
+
+%(AJSDeferred)s
+script_loaded = true;
+"""
+
+
+def getAjsCode():
+ return open(AJS_SRC).read()
+
+def writeAjsMini(code):
+ open(AJS_MINI_SRC, "w").write(code)
+
+
+class AjsAnalyzer:
+
+ def __init__(self):
+ self.code = getAjsCode()
+ self.ajs_fns = {}
+ self.ajs_deps = {}
+ self._parseAJS()
+ self._findDeps()
+
+ def _parseAJS(self):
+ ajs_code = re.search("AJS =(.|\n)*\n}\n", self.code).group(0)
+ fns = re.findall("\s+((\w*?):.*?{(.|\n)*?\n\s*})(,|\n+})\n", ajs_code)
+ for f in fns:
+ self.ajs_fns[f[1]] = f[0]
+
+ def getFnCode(self, fn_name, caller=None):
+ """
+ Returns the code of function and it's dependencies as a list
+ """
+ fn_name = self._unfoldFn(fn_name)
+ r = []
+ if self.ajs_fns.get(fn_name):
+ r.append(self.ajs_fns[fn_name])
+ for dep_fn in self.ajs_deps[fn_name]:
+ if fn_name != dep_fn and dep_fn != caller:
+ r.extend(self.getFnCode(dep_fn, fn_name))
+ elif fn_name not in ['listeners', 'Class']:
+ print 'Could not find "%s"' % fn_name
+ return r
+
+ def getAjsClassCode(self):
+ return re.search("AJS.Class =(.|\n)*\n};\n", self.code).group(0)
+
+ def getAjsDeferredCode(self):
+ return re.search("AJSDeferred =(.|\n)*\n};\n", self.code).group(0)
+
+ def _findDeps(self):
+ """
+ Parses AJS and for every function it finds dependencies for the other functions.
+ """
+ for fn_name, fn_code in self.ajs_fns.items():
+ self.ajs_deps[fn_name] = self._findFns(fn_code)
+
+ def _findFns(self, inner):
+ """
+ Searches after AJS.fnX( in inner and returns all the fnX in a Set.
+ """
+ s = re.findall("AJS\.([\w_$]*?)(?:\(|,|\.)", inner)
+ s = list(Set(s))
+ return self._unfoldFns(s)
+
+ def _unfoldFns(self, list):
+ """
+ Unfolds:
+ AJS.B, AJS.H1 etc. to _createDomShortcuts
+ AJS.$ to AJS.getElement etc.
+ """
+ return [self._unfoldFn(n) for n in list]
+
+ def _unfoldFn(self, fn_name):
+ if fn_name.lower() in DOM_SHORTCUTS:
+ return "_createDomShortcuts"
+ elif FN_SHORTCUTS.get(fn_name):
+ return FN_SHORTCUTS[fn_name]
+ else:
+ return fn_name
+
+
+class ExternalCodeAnalyzer:
+
+ def __init__(self, files):
+ self.found_ajs_fns = []
+ self.files = files
+
+ def findFunctions(self):
+ for f in self.files:
+ self.found_ajs_fns.extend( self._parseFile(f) )
+ return list(Set(self.found_ajs_fns))
+
+ def _parseFile(self, f):
+ """
+ Parses the file, looks for AJS functions and returns all the found functions.
+ """
+ code = open(f).read()
+ return re.findall("AJS\.([\w_$]*?)\(", code)
+
+
+
+class AjsComposer:
+
+ def __init__(self, fn_list):
+ self.code = getAjsCode()
+ self.analyzer = AjsAnalyzer()
+ self.fn_list = fn_list
+
+ #Append standard functions
+ req = ['_unloadListeners', 'createDOM', '_createDomShortcuts', 'log', 'addEventListener']
+ self.fn_list.extend(req)
+
+ #Append AJSDeferred only if needed
+ in_list = lambda x: x in self.fn_list
+ if in_list('getRequest') or in_list('loadJSONDoc'):
+ self.deferred = self._minify(self.analyzer.getAjsDeferredCode())
+ self.fn_list.append('isObject')
+ else:
+ self.deferred = ''
+
+ def writeToOutput(self):
+ fns = self._getFns()
+ d = {}
+ d['functions'] = ",\n".join(fns)
+ d['AJSDeferred'] = self.deferred
+ d['AJSClass'] = self.analyzer.getAjsClassCode()
+
+ mini_code = AJS_TEMPLATE % d
+ writeAjsMini(mini_code)
+
+ def _minify(self, code):
+ new_lines = []
+ for l in code.split("\n"):
+ if l not in ['\n', '']:
+ new_lines.append(l.lstrip())
+ return "\n".join(new_lines)
+
+ def _getFns(self):
+ """
+ Returns a list with real code of functions
+ """
+ r = []
+ for fn in self.fn_list:
+ r.extend(self.analyzer.getFnCode(fn))
+
+ r = list(Set(r))
+ return [self._minify(fn) for fn in r]
+
+
+if __name__ == '__main__':
+ args = sys.argv
+
+ if len(args) < 3:
+ print """Usage is:
+ python AJS_minify.py [-o output_file] ajs_file js_file.js html_using_ajs.html ...
+Example usage:
+ Using relative paths:
+ python AJS_minify.py -o AJS_mini.js AJS.js test.js index.html
+ This will create AJS_mini.js from test.js and index.html.
+ Using absolute paths:
+ python AJS_minify.py ~/Desktop/AJS/AJS.js ~/Desktop/GreyBox_v3_42/greybox/greybox.js
+ This will create a new file called '%s' that has the needed AJS functions.""" % AJS_MINI_SRC
+
+ sys.exit(0)
+
+ if sys.argv[1] == '-o':
+ AJS_MINI_SRC = sys.argv[2]
+ AJS_SRC = sys.argv[3]
+ FILES = sys.argv[4:]
+ else:
+ AJS_SRC = sys.argv[1]
+ FILES = sys.argv[2:]
+
+ print 'Parsing through:\n %s' % "\n ".join(FILES)
+
+ code_analyzer = ExternalCodeAnalyzer(FILES)
+ found_fns = code_analyzer.findFunctions()
+ print 'Found following AJS functions:\n %s' % ("\n ".join(found_fns))
+
+ composer = AjsComposer(found_fns)
+ composer.writeToOutput()
+ print "Written the minified code to '%s'" % AJS_MINI_SRC
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>GreyBox - Examples</title>
+
+ <script type="text/javascript">
+ var GB_ROOT_DIR = "./greybox/";
+ </script>
+
+ <script type="text/javascript" src="greybox/AJS.js"></script>
+ <script type="text/javascript" src="greybox/AJS_fx.js"></script>
+ <script type="text/javascript" src="greybox/gb_scripts.js"></script>
+ <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
+
+ <script type="text/javascript" src="static_files/help.js"></script>
+ <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+<body>
+
+<script>
+ insertHeader();
+ insertMenu('examples');
+</script>
+
+
+<h3>One website</h3>
+<ul>
+ <li>
+ <a href="http://google.com/" title="Google" rel="gb_page_center[640, 480]">Launch google.com in a 640x480 window</a>
+ </li>
+ <li>
+ <a href="http://google.com/" title="Google" rel="gb_page_fs[]">Launch google.com in fullscreen window</a>
+ </li>
+</ul>
+
+<h3>Website gallery</h3>
+<ul>
+ <li>
+ <a href="http://google.com/" title="Google" rel="gb_pageset[search_sites]">Launch Google search</a>
+ </li>
+ <li>
+ <a href="http://search.yahoo.com/" rel="gb_pageset[search_sites]">Launch Yahoo search</a>
+ </li>
+ <li>
+ <a href="http://www.koders.com/" rel="gb_pageset[search_sites]">Launch Koders search</a>
+ </li>
+</ul>
+
+<h3>Image gallery</h3>
+<script type="text/javascript">
+var image_set = [{'caption': 'Flower', 'url': 'http://static.flickr.com/119/294309231_a3d2a339b9.jpg'},
+ {'caption': 'Nice waterfall', 'url': 'http://www.widerange.org/images/large/plitvicka.jpg'}];
+</script>
+
+<ul>
+ <li>
+ <a href="#" onclick="return GB_showImageSet(image_set, 1)">Launch gallery</a>
+ </li>
+
+ <li>
+ <a href="static_files/night_valley.jpg" rel="gb_imageset[nice_pics]" title="Night valley">
+ <img src="static_files/night_valley_thumb.jpg" />
+ </a>
+ </li>
+
+ <li>
+ <a href="static_files/salt.jpg" rel="gb_imageset[nice_pics]" title="Salt flats in Chile">
+ <img src="static_files/salt_thumb.gif" />
+ </a>
+ </li>
+</ul>
+
+<h3>Without loading</h3>
+<script type="text/javascript">
+GB_myShow = function(caption, url, /* optional */ height, width, callback_fn) {
+ var options = {
+ caption: caption,
+ height: height || 500,
+ width: width || 500,
+ fullscreen: false,
+ show_loading: false,
+ callback_fn: callback_fn
+ }
+ var win = new GB_Window(options);
+ return win.show(url);
+}
+</script>
+<ul>
+ <li>
+ <a href="http://google.com/" onclick="return GB_myShow('Google', this.href)">Visit Google without loading</a>
+ </li>
+</ul>
+
+</body>
+</html>
--- /dev/null
+var GB_SETS = {};
+function decoGreyboxLinks() {
+ var as = AJS.$bytc('a');
+ AJS.map(as, function(a) {
+ if(a.getAttribute('href') && a.getAttribute('rel')) {
+ var rel = a.getAttribute('rel');
+ if(rel.indexOf('gb_') == 0) {
+ var name = rel.match(/\w+/)[0];
+ var attrs = rel.match(/\[(.*)\]/)[1];
+ var index = 0;
+
+ var item = {
+ 'caption': a.title || '',
+ 'url': a.href
+ }
+
+ //Set up GB_SETS
+ if(name == 'gb_pageset' || name == 'gb_imageset') {
+ if(!GB_SETS[attrs]) { GB_SETS[attrs] = []; }
+ GB_SETS[attrs].push(item);
+ index = GB_SETS[attrs].length;
+ }
+
+ //Append onclick
+ if(name == 'gb_pageset') {
+ a.onclick = function() {
+ GB_showFullScreenSet(GB_SETS[attrs], index);
+ return false;
+ };
+ }
+ if(name == 'gb_imageset') {
+ a.onclick = function() {
+ GB_showImageSet(GB_SETS[attrs], index);
+ return false;
+ };
+ }
+ if(name == 'gb_image') {
+ a.onclick = function() {
+ GB_showImage(item.caption, item.url);
+ return false;
+ };
+ }
+ if(name == 'gb_page') {
+ a.onclick = function() {
+ var sp = attrs.split(/, ?/);
+ GB_show(item.caption, item.url, parseInt(sp[1]), parseInt(sp[0]));
+ return false;
+ };
+ }
+ if(name == 'gb_page_fs') {
+ a.onclick = function() {
+ GB_showFullScreen(item.caption, item.url);
+ return false;
+ };
+ }
+ if(name == 'gb_page_center') {
+ a.onclick = function() {
+ var sp = attrs.split(/, ?/);
+ GB_showCenter(item.caption, item.url, parseInt(sp[1]), parseInt(sp[0]));
+ return false;
+ };
+ }
+ }
+ }});
+}
+
+AJS.AEV(window, 'load', decoGreyboxLinks);
--- /dev/null
+/*
+Last Modified: 29/01/07 14:16:09
+
+AJS JavaScript library
+ A very small library with a lot of functionality
+AUTHOR
+ 4mir Salihefendic (http://amix.dk) - amix@amix.dk
+LICENSE
+ Copyright (c) 2006 Amir Salihefendic. All rights reserved.
+ Copyright (c) 2005 Bob Ippolito. All rights reserved.
+ http://www.opensource.org/licenses/mit-license.php
+VERSION
+ 3.7
+SITE
+ http://orangoo.com/AmiNation/AJS
+**/
+if(!AJS) {
+var AJS = {
+ BASE_URL: "",
+
+ drag_obj: null,
+ drag_elm: null,
+ _drop_zones: [],
+ _drag_zones: [],
+ _cur_pos: null,
+
+ ajaxErrorHandler: null,
+
+////
+// General accessor functions
+////
+ getQueryArgument: function(var_name) {
+ var query = window.location.search.substring(1);
+ var vars = query.split("&");
+ for (var i=0;i<vars.length;i++) {
+ var pair = vars[i].split("=");
+ if (pair[0] == var_name) {
+ return pair[1];
+ }
+ }
+ return null;
+ },
+
+ isIe: function() {
+ return (navigator.userAgent.toLowerCase().indexOf("msie") != -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1);
+ },
+ isNetscape7: function() {
+ return (navigator.userAgent.toLowerCase().indexOf("netscape") != -1 && navigator.userAgent.toLowerCase().indexOf("7.") != -1);
+ },
+ isSafari: function() {
+ return (navigator.userAgent.toLowerCase().indexOf("khtml") != -1);
+ },
+ isOpera: function() {
+ return (navigator.userAgent.toLowerCase().indexOf("opera") != -1);
+ },
+ isMozilla: function() {
+ return (navigator.userAgent.toLowerCase().indexOf("gecko") != -1 && navigator.productSub >= 20030210);
+ },
+
+
+////
+// Array functions
+////
+ //Shortcut: AJS.$A
+ createArray: function(v) {
+ if(AJS.isArray(v) && !AJS.isString(v))
+ return v;
+ else if(!v)
+ return [];
+ else
+ return [v];
+ },
+
+ forceArray: function(args) {
+ var r = [];
+ AJS.map(args, function(elm) {
+ r.push(elm);
+ });
+ return r;
+ },
+
+ join: function(delim, list) {
+ try {
+ return list.join(delim);
+ }
+ catch(e) {
+ var r = list[0] || '';
+ AJS.map(list, function(elm) {
+ r += delim + elm;
+ }, 1);
+ return r + '';
+ }
+ },
+
+ isIn: function(elm, list) {
+ var i = AJS.getIndex(elm, list);
+ if(i != -1)
+ return true;
+ else
+ return false;
+ },
+
+ getIndex: function(elm, list/*optional*/, eval_fn) {
+ for(var i=0; i < list.length; i++)
+ if(eval_fn && eval_fn(list[i]) || elm == list[i])
+ return i;
+ return -1;
+ },
+
+ getFirst: function(list) {
+ if(list.length > 0)
+ return list[0];
+ else
+ return null;
+ },
+
+ getLast: function(list) {
+ if(list.length > 0)
+ return list[list.length-1];
+ else
+ return null;
+ },
+
+ update: function(l1, l2) {
+ for(var i in l2)
+ l1[i] = l2[i];
+ return l1;
+ },
+
+ flattenList: function(list) {
+ var r = [];
+ var _flatten = function(r, l) {
+ AJS.map(l, function(o) {
+ if(o == null) {}
+ else if (AJS.isArray(o))
+ _flatten(r, o);
+ else
+ r.push(o);
+ });
+ }
+ _flatten(r, list);
+ return r;
+ },
+
+
+////
+// Functional programming
+////
+ map: function(list, fn,/*optional*/ start_index, end_index) {
+ var i = 0, l = list.length;
+ if(start_index)
+ i = start_index;
+ if(end_index)
+ l = end_index;
+ for(i; i < l; i++)
+ fn.apply(null, [list[i], i]);
+ },
+
+ rmap: function(list, fn) {
+ var i = list.length-1, l = 0;
+ for(i; i >= l; i--)
+ fn.apply(null, [list[i], i]);
+ },
+
+ filter: function(list, fn, /*optional*/ start_index, end_index) {
+ var r = [];
+ AJS.map(list, function(elm) {
+ if(fn(elm))
+ r.push(elm);
+ }, start_index, end_index);
+ return r;
+ },
+
+ partial: function(fn) {
+ var args = AJS.forceArray(arguments);
+ return AJS.$b(fn, null, args.slice(1, args.length).reverse(), false, true);
+ },
+
+
+////
+// DOM functions
+////
+ //Shortcut: AJS.$
+ getElement: function(id) {
+ if(AJS.isString(id) || AJS.isNumber(id))
+ return document.getElementById(id);
+ else
+ return id;
+ },
+
+ //Shortcut: AJS.$$
+ getElements: function(/*id1, id2, id3*/) {
+ var args = AJS.forceArray(arguments);
+ var elements = new Array();
+ for (var i = 0; i < args.length; i++) {
+ var element = AJS.getElement(args[i]);
+ elements.push(element);
+ }
+ return elements;
+ },
+
+ //Shortcut: AJS.$bytc
+ getElementsByTagAndClassName: function(tag_name, class_name, /*optional*/ parent) {
+ var class_elements = [];
+ if(!AJS.isDefined(parent))
+ parent = document;
+ if(!AJS.isDefined(tag_name))
+ tag_name = '*';
+
+ var els = parent.getElementsByTagName(tag_name);
+ var els_len = els.length;
+ var pattern = new RegExp("(^|\\s)" + class_name + "(\\s|$)");
+
+ for (i = 0, j = 0; i < els_len; i++) {
+ if ( pattern.test(els[i].className) || class_name == null ) {
+ class_elements[j] = els[i];
+ j++;
+ }
+ }
+ return class_elements;
+ },
+
+ _nodeWalk: function(elm, tag_name, class_name, fn_next_elm) {
+ var p = fn_next_elm(elm);
+
+ var checkFn;
+ if(tag_name && class_name) {
+ checkFn = function(p) {
+ return AJS.nodeName(p) == tag_name && AJS.hasClass(p, class_name);
+ }
+ }
+ else if(tag_name) {
+ checkFn = function(p) { return AJS.nodeName(p) == tag_name; }
+ }
+ else {
+ checkFn = function(p) { return AJS.hasClass(p, class_name); }
+ }
+
+ while(p) {
+ if(checkFn(p))
+ return p;
+ p = fn_next_elm(p);
+ }
+ return null;
+ },
+
+ getParentBytc: function(elm, tag_name, class_name) {
+ return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.parentNode; });
+ },
+
+ getPreviousSiblingBytc: function(elm, tag_name, class_name) {
+ return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.previousSibling; });
+ },
+
+ getNextSiblingBytc: function(elm, tag_name, class_name) {
+ return AJS._nodeWalk(elm, tag_name, class_name, function(m) { return m.nextSibling; });
+ },
+
+ //Shortcut: AJS.$f
+ getFormElement: function(form, name) {
+ form = AJS.$(form);
+ var r = null;
+ AJS.map(form.elements, function(elm) {
+ if(elm.name && elm.name == name)
+ r = elm;
+ });
+ return r;
+ },
+
+ formContents: function(form) {
+ var form = AJS.$(form);
+ var r = {};
+ var fn = function(elms) {
+ AJS.map(elms, function(e) {
+ if(e.name)
+ r[e.name] = e.value || '';
+ });
+ }
+ fn(AJS.$bytc('input', null, form));
+ fn(AJS.$bytc('textarea', null, form));
+ return r;
+ },
+
+ getBody: function() {
+ return AJS.$bytc('body')[0]
+ },
+
+ nodeName: function(elm) {
+ return elm.nodeName.toLowerCase();
+ },
+
+ hasParent: function(elm, parent_to_consider, max_look_up) {
+ if(elm == parent_to_consider)
+ return true;
+ if(max_look_up == 0)
+ return false;
+ return AJS.hasParent(elm.parentNode, parent_to_consider, max_look_up-1);
+ },
+
+ isElementHidden: function(elm) {
+ return elm.style.visibility == "hidden";
+ },
+
+ //Shortcut: AJS.DI
+ documentInsert: function(elm) {
+ if(typeof(elm) == 'string')
+ elm = AJS.HTML2DOM(elm);
+ document.write('<span id="dummy_holder"></span>');
+ AJS.swapDOM(AJS.$('dummy_holder'), elm);
+ },
+
+ cloner: function(element) {
+ return function() {
+ return element.cloneNode(true);
+ }
+ },
+
+ appendToTop: function(elm/*, elms...*/) {
+ var args = AJS.forceArray(arguments).slice(1);
+ if(args.length >= 1) {
+ var first_child = elm.firstChild;
+ if(first_child) {
+ while(true) {
+ var t_elm = args.shift();
+ if(t_elm)
+ AJS.insertBefore(t_elm, first_child);
+ else
+ break;
+ }
+ }
+ else {
+ AJS.ACN.apply(null, arguments);
+ }
+ }
+ return elm;
+ },
+
+ //Shortcut: AJS.ACN
+ appendChildNodes: function(elm/*, elms...*/) {
+ if(arguments.length >= 2) {
+ AJS.map(arguments, function(n) {
+ if(AJS.isString(n))
+ n = AJS.TN(n);
+ if(AJS.isDefined(n))
+ elm.appendChild(n);
+ }, 1);
+ }
+ return elm;
+ },
+
+ //Shortcut: AJS.RCN
+ replaceChildNodes: function(elm/*, elms...*/) {
+ var child;
+ while ((child = elm.firstChild))
+ elm.removeChild(child);
+ if (arguments.length < 2)
+ return elm;
+ else
+ return AJS.appendChildNodes.apply(null, arguments);
+ return elm;
+ },
+
+ insertAfter: function(elm, reference_elm) {
+ reference_elm.parentNode.insertBefore(elm, reference_elm.nextSibling);
+ return elm;
+ },
+
+ insertBefore: function(elm, reference_elm) {
+ reference_elm.parentNode.insertBefore(elm, reference_elm);
+ return elm;
+ },
+
+ showElement: function(/*elms...*/) {
+ var args = AJS.forceArray(arguments);
+ AJS.map(args, function(elm) { elm.style.display = ''});
+ },
+
+ hideElement: function(elm) {
+ var args = AJS.forceArray(arguments);
+ AJS.map(args, function(elm) { elm.style.display = 'none'});
+ },
+
+ swapDOM: function(dest, src) {
+ dest = AJS.getElement(dest);
+ var parent = dest.parentNode;
+ if (src) {
+ src = AJS.getElement(src);
+ parent.replaceChild(src, dest);
+ } else {
+ parent.removeChild(dest);
+ }
+ return src;
+ },
+
+ removeElement: function(/*elm1, elm2...*/) {
+ var args = AJS.forceArray(arguments);
+ AJS.map(args, function(elm) { AJS.swapDOM(elm, null); });
+ },
+
+ createDOM: function(name, attrs) {
+ var i=0, attr;
+ elm = document.createElement(name);
+
+ if(AJS.isDict(attrs[i])) {
+ for(k in attrs[0]) {
+ attr = attrs[0][k];
+ if(k == "style")
+ elm.style.cssText = attr;
+ else if(k == "class" || k == 'className')
+ elm.className = attr;
+ else {
+ elm.setAttribute(k, attr);
+ }
+ }
+ i++;
+ }
+
+ if(attrs[0] == null)
+ i = 1;
+
+ AJS.map(attrs, function(n) {
+ if(n) {
+ if(AJS.isString(n) || AJS.isNumber(n))
+ n = AJS.TN(n);
+ elm.appendChild(n);
+ }
+ }, i);
+ return elm;
+ },
+
+ _createDomShortcuts: function() {
+ var elms = [
+ "ul", "li", "td", "tr", "th",
+ "tbody", "table", "input", "span", "b",
+ "a", "div", "img", "button", "h1",
+ "h2", "h3", "br", "textarea", "form",
+ "p", "select", "option", "iframe", "script",
+ "center", "dl", "dt", "dd", "small",
+ "pre"
+ ];
+ var extends_ajs = function(elm) {
+ var c_dom = "return AJS.createDOM.apply(null, ['" + elm + "', arguments]);";
+ var c_fun_dom = 'function() { ' + c_dom + ' }';
+ eval("AJS." + elm.toUpperCase() + "=" + c_fun_dom);
+ }
+ AJS.map(elms, extends_ajs);
+ AJS.TN = function(text) { return document.createTextNode(text) };
+ },
+
+ getCssDim: function(dim) {
+ if(AJS.isString(dim))
+ return dim;
+ else
+ return dim + "px";
+ },
+ getCssProperty: function(elm, prop) {
+ elm = AJS.$(elm);
+ var y;
+ if(elm.currentStyle)
+ y = elm.currentStyle[prop];
+ else if (window.getComputedStyle)
+ y = document.defaultView.getComputedStyle(elm,null).getPropertyValue(prop);
+ return y;
+ },
+
+ setStyle: function(/*elm1, elm2..., property, new_value*/) {
+ var args = AJS.forceArray(arguments);
+ var new_val = args.pop();
+ var property = args.pop();
+ AJS.map(args, function(elm) {
+ elm.style[property] = AJS.getCssDim(new_val);
+ });
+ },
+
+ setWidth: function(/*elm1, elm2..., width*/) {
+ var args = AJS.forceArray(arguments);
+ args.splice(args.length-1, 0, 'width');
+ AJS.setStyle.apply(null, args);
+ },
+ setHeight: function(/*elm1, elm2..., height*/) {
+ var args = AJS.forceArray(arguments);
+ args.splice(args.length-1, 0, 'height');
+ AJS.setStyle.apply(null, args);
+ },
+ setLeft: function(/*elm1, elm2..., left*/) {
+ var args = AJS.forceArray(arguments);
+ args.splice(args.length-1, 0, 'left');
+ AJS.setStyle.apply(null, args);
+ },
+ setTop: function(/*elm1, elm2..., top*/) {
+ var args = AJS.forceArray(arguments);
+ args.splice(args.length-1, 0, 'top');
+ AJS.setStyle.apply(null, args);
+ },
+ setClass: function(/*elm1, elm2..., className*/) {
+ var args = AJS.forceArray(arguments);
+ var c = args.pop();
+ AJS.map(args, function(elm) { elm.className = c});
+ },
+ addClass: function(/*elm1, elm2..., className*/) {
+ var args = AJS.forceArray(arguments);
+ var cls = args.pop();
+ var add_class = function(o) {
+ if(!new RegExp("(^|\\s)" + cls + "(\\s|$)").test(o.className))
+ o.className += (o.className ? " " : "") + cls;
+ };
+ AJS.map(args, function(elm) { add_class(elm); });
+ },
+ hasClass: function(elm, cls) {
+ if(!elm.className)
+ return false;
+ return elm.className == cls ||
+ elm.className.search(new RegExp(" " + cls)) != -1
+ },
+ removeClass: function(/*elm1, elm2..., className*/) {
+ var args = AJS.forceArray(arguments);
+ var cls = args.pop();
+ var rm_class = function(o) {
+ o.className = o.className.replace(new RegExp("\\s?" + cls, 'g'), "");
+ };
+ AJS.map(args, function(elm) { rm_class(elm); });
+ },
+
+ setHTML: function(elm, html) {
+ elm.innerHTML = html;
+ return elm;
+ },
+
+ RND: function(tmpl, ns, scope) {
+ scope = scope || window;
+ var fn = function(w, g) {
+ g = g.split("|");
+ var cnt = ns[g[0]];
+ for(var i=1; i < g.length; i++)
+ cnt = scope[g[i]](cnt);
+ if(cnt == '')
+ return '';
+ if(cnt == 0 || cnt == -1)
+ cnt += '';
+ return cnt || w;
+ };
+ return tmpl.replace(/%\(([A-Za-z0-9_|.]*)\)/g, fn);
+ },
+
+ HTML2DOM: function(html,/*optional*/ first_child) {
+ var d = AJS.DIV();
+ d.innerHTML = html;
+ if(first_child)
+ return d.childNodes[0];
+ else
+ return d;
+ },
+
+ preloadImages: function(/*img_src1, ..., img_srcN*/) {
+ AJS.AEV(window, 'load', AJS.$p(function(args) {
+ AJS.map(args, function(src) {
+ var pic = new Image();
+ pic.src = src;
+ });
+ }, arguments));
+ },
+
+
+////
+// Effects
+////
+ setOpacity: function(elm, p) {
+ elm.style.opacity = p;
+ elm.style.filter = "alpha(opacity="+ p*100 +")";
+ },
+
+
+////
+// Ajax functions
+////
+ getXMLHttpRequest: function() {
+ var try_these = [
+ function () { return new XMLHttpRequest(); },
+ function () { return new ActiveXObject('Msxml2.XMLHTTP'); },
+ function () { return new ActiveXObject('Microsoft.XMLHTTP'); },
+ function () { return new ActiveXObject('Msxml2.XMLHTTP.4.0'); },
+ function () { throw "Browser does not support XMLHttpRequest"; }
+ ];
+ for (var i = 0; i < try_these.length; i++) {
+ var func = try_these[i];
+ try {
+ return func();
+ } catch (e) {
+ }
+ }
+ },
+
+ getRequest: function(url, data, type) {
+ if(!type)
+ type = "POST";
+ var req = AJS.getXMLHttpRequest();
+
+ if(url.indexOf("http://") == -1) {
+ if(AJS.BASE_URL != '') {
+ if(AJS.BASE_URL.lastIndexOf('/') != AJS.BASE_URL.length-1)
+ AJS.BASE_URL += '/';
+ url = AJS.BASE_URL + url;
+ }
+ else
+ url = window.location + url;
+ }
+
+ req.open(type, url, true);
+ if(type == "POST")
+ req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+ return AJS._sendXMLHttpRequest(req);
+ },
+
+ _sendXMLHttpRequest: function(req, data) {
+ var d = new AJSDeferred(req);
+
+ var onreadystatechange = function () {
+ if (req.readyState == 4) {
+ var status = '';
+ try {
+ status = req.status;
+ }
+ catch(e) {};
+ if(status == 200 || status == 304 || req.responseText == null) {
+ d.callback();
+ }
+ else {
+ if(AJS.ajaxErrorHandler)
+ AJS.ajaxErrorHandler(req.responseText, req);
+ else
+ d.errback();
+ }
+ }
+ }
+ req.onreadystatechange = onreadystatechange;
+ return d;
+ },
+
+ _reprString: function(o) {
+ return ('"' + o.replace(/(["\\])/g, '\\$1') + '"'
+ ).replace(/[\f]/g, "\\f"
+ ).replace(/[\b]/g, "\\b"
+ ).replace(/[\n]/g, "\\n"
+ ).replace(/[\t]/g, "\\t"
+ ).replace(/[\r]/g, "\\r");
+ },
+
+ serializeJSON: function(o) {
+ var objtype = typeof(o);
+ if (objtype == "undefined") {
+ return "undefined";
+ } else if (objtype == "number" || objtype == "boolean") {
+ return o + "";
+ } else if (o === null) {
+ return "null";
+ }
+ if (objtype == "string") {
+ return AJS._reprString(o);
+ }
+ var me = arguments.callee;
+ if (objtype != "function" && typeof(o.length) == "number") {
+ var res = [];
+ for (var i = 0; i < o.length; i++) {
+ var val = me(o[i]);
+ if (typeof(val) != "string") {
+ val = "undefined";
+ }
+ res.push(val);
+ }
+ return "[" + res.join(",") + "]";
+ }
+ // it's a function with no adapter, bad
+ if (objtype == "function")
+ return null;
+ res = [];
+ for (var k in o) {
+ var useKey;
+ if (typeof(k) == "number") {
+ useKey = '"' + k + '"';
+ } else if (typeof(k) == "string") {
+ useKey = AJS._reprString(k);
+ } else {
+ // skip non-string or number keys
+ continue;
+ }
+ val = me(o[k]);
+ if (typeof(val) != "string") {
+ // skip non-serializable values
+ continue;
+ }
+ res.push(useKey + ":" + val);
+ }
+ return "{" + res.join(",") + "}";
+ },
+
+ loadJSONDoc: function(url) {
+ var d = AJS.getRequest(url);
+ var eval_req = function(data, req) {
+ var text = req.responseText;
+ if(text == "Error")
+ d.errback(req);
+ else
+ return AJS.evalTxt(text);
+ };
+ d.addCallback(eval_req);
+ return d;
+ },
+
+ evalTxt: function(txt) {
+ try {
+ return eval('('+ txt + ')');
+ }
+ catch(e) {
+ return eval(txt);
+ }
+ },
+
+ evalScriptTags: function(html) {
+ var script_data = html.match(/<script.*?>((\n|\r|.)*?)<\/script>/g);
+ if(script_data != null) {
+ for(var i=0; i < script_data.length; i++) {
+ var script_only = script_data[i].replace(/<script.*?>/g, "");
+ script_only = script_only.replace(/<\/script>/g, "");
+ eval(script_only);
+ }
+ }
+ },
+
+ queryArguments: function(data) {
+ var post_data = [];
+ for(k in data)
+ post_data.push(k + "=" + AJS.urlencode(data[k]));
+ return post_data.join("&");
+ },
+
+
+////
+// Position and size
+////
+ getMousePos: function(e) {
+ var posx = 0;
+ var posy = 0;
+ if (!e) var e = window.event;
+ if (e.pageX || e.pageY)
+ {
+ posx = e.pageX;
+ posy = e.pageY;
+ }
+ else if (e.clientX || e.clientY)
+ {
+ posx = e.clientX + document.body.scrollLeft;
+ posy = e.clientY + document.body.scrollTop;
+ }
+ return {x: posx, y: posy};
+ },
+
+ getScrollTop: function() {
+ //From: http://www.quirksmode.org/js/doctypes.html
+ var t;
+ if (document.documentElement && document.documentElement.scrollTop)
+ t = document.documentElement.scrollTop;
+ else if (document.body)
+ t = document.body.scrollTop;
+ return t;
+ },
+
+ absolutePosition: function(elm) {
+ var posObj = {'x': elm.offsetLeft, 'y': elm.offsetTop};
+ if(elm.offsetParent) {
+ var temp_pos = AJS.absolutePosition(elm.offsetParent);
+ posObj.x += temp_pos.x;
+ posObj.y += temp_pos.y;
+ }
+ // safari bug
+ if (AJS.isSafari() && elm.style.position == 'absolute' ) {
+ posObj.x -= document.body.offsetLeft;
+ posObj.y -= document.body.offsetTop;
+ }
+ return posObj;
+ },
+
+ getWindowSize: function(doc) {
+ doc = doc || document;
+ var win_w, win_h;
+ if (self.innerHeight) {
+ win_w = self.innerWidth;
+ win_h = self.innerHeight;
+ } else if (doc.documentElement && doc.documentElement.clientHeight) {
+ win_w = doc.documentElement.clientWidth;
+ win_h = doc.documentElement.clientHeight;
+ } else if (doc.body) {
+ win_w = doc.body.clientWidth;
+ win_h = doc.body.clientHeight;
+ }
+ return {'w': win_w, 'h': win_h};
+ },
+
+ isOverlapping: function(elm1, elm2) {
+ var pos_elm1 = AJS.absolutePosition(elm1);
+ var pos_elm2 = AJS.absolutePosition(elm2);
+
+ var top1 = pos_elm1.y;
+ var left1 = pos_elm1.x;
+ var right1 = left1 + elm1.offsetWidth;
+ var bottom1 = top1 + elm1.offsetHeight;
+ var top2 = pos_elm2.y;
+ var left2 = pos_elm2.x;
+ var right2 = left2 + elm2.offsetWidth;
+ var bottom2 = top2 + elm2.offsetHeight;
+ var getSign = function(v) {
+ if(v > 0) return "+";
+ else if(v < 0) return "-";
+ else return 0;
+ }
+
+ if ((getSign(top1 - bottom2) != getSign(bottom1 - top2)) &&
+ (getSign(left1 - right2) != getSign(right1 - left2)))
+ return true;
+ return false;
+ },
+
+
+////
+// Events
+////
+ getEventElm: function(e) {
+ if(e && !e.type && !e.keyCode)
+ return e
+ var targ;
+ if (!e) var e = window.event;
+ if (e.target) targ = e.target;
+ else if (e.srcElement) targ = e.srcElement;
+ if (targ.nodeType == 3) // defeat Safari bug
+ targ = targ.parentNode;
+ return targ;
+ },
+
+ _getRealScope: function(fn, /*optional*/ extra_args, dont_send_event, rev_extra_args) {
+ var scope = window;
+ extra_args = AJS.$A(extra_args);
+ if(fn._cscope)
+ scope = fn._cscope;
+
+ return function() {
+ //Append all the orginal arguments + extra_args
+ var args = [];
+ var i = 0;
+ if(dont_send_event)
+ i = 1;
+
+ AJS.map(arguments, function(arg) { args.push(arg) }, i);
+ args = args.concat(extra_args);
+ if(rev_extra_args)
+ args = args.reverse();
+ return fn.apply(scope, args);
+ };
+ },
+
+ _unloadListeners: function() {
+ if(AJS.listeners)
+ AJS.map(AJS.listeners, function(elm, type, fn) { AJS.REV(elm, type, fn) });
+ AJS.listeners = [];
+ },
+
+ setEventKey: function(e) {
+ e.key = e.keyCode ? e.keyCode : e.charCode;
+
+ if(window.event) {
+ e.ctrl = window.event.ctrlKey;
+ e.shift = window.event.shiftKey;
+ }
+ else {
+ e.ctrl = e.ctrlKey;
+ e.shift = e.shiftKey;
+ }
+ switch(e.key) {
+ case 63232:
+ e.key = 38;
+ break;
+ case 63233:
+ e.key = 40;
+ break;
+ case 63235:
+ e.key = 39;
+ break;
+ case 63234:
+ e.key = 37;
+ break;
+ }
+ },
+
+ //Shortcut: AJS.AEV
+ addEventListener: function(elm, type, fn, /*optional*/listen_once, cancle_bubble) {
+ if(!cancle_bubble)
+ cancle_bubble = false;
+
+ var elms = AJS.$A(elm);
+ AJS.map(elms, function(elmz) {
+ if(listen_once)
+ fn = AJS._listenOnce(elmz, type, fn);
+
+ //Hack since it does not work in all browsers
+ if(AJS.isIn(type, ['submit', 'load', 'scroll', 'resize'])) {
+ var old = elm['on' + type];
+ elm['on' + type] = function() {
+ if(old) {
+ fn(arguments);
+ return old(arguments);
+ }
+ else
+ return fn(arguments);
+ };
+ return;
+ }
+
+ //Fix keyCode
+ if(AJS.isIn(type, ['keypress', 'keydown', 'keyup', 'click'])) {
+ var old_fn = fn;
+ fn = function(e) {
+ AJS.setEventKey(e);
+ return old_fn.apply(null, arguments);
+ }
+ }
+
+ if (elmz.attachEvent) {
+ //FIXME: We ignore cancle_bubble for IE... could be a problem?
+ elmz.attachEvent("on" + type, fn);
+ }
+ else if(elmz.addEventListener)
+ elmz.addEventListener(type, fn, cancle_bubble);
+
+ AJS.listeners = AJS.$A(AJS.listeners);
+ AJS.listeners.push([elmz, type, fn]);
+ });
+ },
+
+ //Shortcut: AJS.REV
+ removeEventListener: function(elm, type, fn, /*optional*/cancle_bubble) {
+ if(!cancle_bubble)
+ cancle_bubble = false;
+ if(elm.removeEventListener) {
+ elm.removeEventListener(type, fn, cancle_bubble);
+ if(AJS.isOpera())
+ elm.removeEventListener(type, fn, !cancle_bubble);
+ }
+ else if(elm.detachEvent)
+ elm.detachEvent("on" + type, fn);
+ },
+
+ //Shortcut: AJS.$b
+ bind: function(fn, scope, /*optional*/ extra_args, dont_send_event, rev_extra_args) {
+ fn._cscope = scope;
+ return AJS._getRealScope(fn, extra_args, dont_send_event, rev_extra_args);
+ },
+
+ bindMethods: function(self) {
+ for (var k in self) {
+ var func = self[k];
+ if (typeof(func) == 'function') {
+ self[k] = AJS.$b(func, self);
+ }
+ }
+ },
+
+ _listenOnce: function(elm, type, fn) {
+ var r_fn = function() {
+ AJS.removeEventListener(elm, type, r_fn);
+ fn(arguments);
+ }
+ return r_fn;
+ },
+
+ callLater: function(fn, interval) {
+ var fn_no_send = function() {
+ fn();
+ };
+ window.setTimeout(fn_no_send, interval);
+ },
+
+ preventDefault: function(e) {
+ if(AJS.isIe())
+ window.event.returnValue = false;
+ else
+ e.preventDefault();
+ },
+
+
+////
+// Drag and drop
+////
+ dragAble: function(elm, /*optional*/ handler, args) {
+ if(!args)
+ args = {};
+ if(!AJS.isDefined(args['move_x']))
+ args['move_x'] = true;
+ if(!AJS.isDefined(args['move_y']))
+ args['move_y'] = true;
+ if(!AJS.isDefined(args['moveable']))
+ args['moveable'] = false;
+ if(!AJS.isDefined(args['hide_on_move']))
+ args['hide_on_move'] = true;
+ if(!AJS.isDefined(args['on_mouse_up']))
+ args['on_mouse_up'] = null;
+ if(!AJS.isDefined(args['cursor']))
+ args['cursor'] = 'move';
+ if(!AJS.isDefined(args['max_move']))
+ args['max_move'] = {'top': null, 'left': null};
+
+ elm = AJS.$(elm);
+
+ if(!handler)
+ handler = elm;
+
+ handler = AJS.$(handler);
+ var old_cursor = handler.style.cursor;
+ handler.style.cursor = args['cursor'];
+ elm.style.position = 'relative';
+
+ AJS.addClass(handler, '_ajs_handler');
+ handler._args = args;
+ handler._elm = elm;
+ AJS.AEV(handler, 'mousedown', AJS._dragStart);
+ },
+
+ _dragStart: function(e) {
+ var handler = AJS.getEventElm(e);
+ if(!AJS.hasClass(handler, '_ajs_handler')) {
+ handler = AJS.getParentBytc(handler, null, '_ajs_handler');
+ }
+ if(handler)
+ AJS._dragInit(e, handler._elm, handler._args);
+ },
+
+ dropZone: function(elm, args) {
+ elm = AJS.$(elm);
+ var item = {elm: elm};
+ AJS.update(item, args);
+ AJS._drop_zones.push(item);
+ },
+
+ removeDragAble: function(elm) {
+ AJS.REV(elm, 'mousedown', AJS._dragStart);
+ elm.style.cursor = '';
+ },
+
+ removeDropZone: function(elm) {
+ var i = AJS.getIndex(elm, AJS._drop_zones, function(item) {
+ if(item.elm == elm) return true;
+ });
+ if(i != -1) {
+ AJS._drop_zones.splice(i, 1);
+ }
+ },
+
+ _dragInit: function(e, click_elm, args) {
+ AJS.drag_obj = new Object();
+ AJS.drag_obj.args = args;
+
+ AJS.drag_obj.click_elm = click_elm;
+ AJS.drag_obj.mouse_pos = AJS.getMousePos(e);
+ AJS.drag_obj.click_elm_pos = AJS.absolutePosition(click_elm);
+
+ AJS.AEV(document, 'mousemove', AJS._dragMove, false, true);
+ AJS.AEV(document, 'mouseup', AJS._dragStop, false, true);
+
+ if (AJS.isIe())
+ window.event.cancelBubble = true;
+ AJS.preventDefault(e);
+ },
+
+ _initDragElm: function(elm) {
+ if(AJS.drag_elm && AJS.drag_elm.style.display == 'none')
+ AJS.removeElement(AJS.drag_elm);
+
+ if(!AJS.drag_elm) {
+ AJS.drag_elm = AJS.DIV();
+ var d = AJS.drag_elm;
+ AJS.insertBefore(d, AJS.getBody().firstChild);
+ AJS.setHTML(d, elm.innerHTML);
+
+ d.className = elm.className;
+ d.style.cssText = elm.style.cssText;
+
+ d.style.position = 'absolute';
+ d.style.zIndex = 10000;
+
+ var t = AJS.absolutePosition(elm);
+ AJS.setTop(d, t.y);
+ AJS.setLeft(d, t.x);
+
+ if(AJS.drag_obj.args.on_init) {
+ AJS.drag_obj.args.on_init(elm);
+ }
+ }
+ },
+
+ _dragMove: function(e) {
+ var drag_obj = AJS.drag_obj;
+ var click_elm = drag_obj.click_elm;
+
+ AJS._initDragElm(click_elm);
+ var drag_elm = AJS.drag_elm;
+
+ if(drag_obj.args['hide_on_move'])
+ click_elm.style.visibility = 'hidden';
+
+ var cur_pos = AJS.getMousePos(e);
+
+ var mouse_pos = drag_obj.mouse_pos;
+
+ var click_elm_pos = drag_obj.click_elm_pos;
+
+ AJS.map(AJS._drop_zones, function(d_z) {
+ if(AJS.isOverlapping(d_z['elm'], drag_elm)) {
+ if(d_z['elm'] != drag_elm) {
+ var on_hover = d_z['on_hover'];
+ if(on_hover)
+ on_hover(d_z['elm'], click_elm, drag_elm);
+ }
+ }
+ });
+
+ if(drag_obj.args['on_drag'])
+ drag_obj.args['on_drag'](click_elm, e);
+
+ var max_move_top = drag_obj.args['max_move']['top'];
+ var max_move_left = drag_obj.args['max_move']['left'];
+ var p;
+ if(drag_obj.args['move_x']) {
+ p = cur_pos.x - (mouse_pos.x - click_elm_pos.x);
+ if(max_move_left == null || max_move_left <= p)
+ AJS.setLeft(elm, p);
+ }
+
+ if(drag_obj.args['move_y']) {
+ p = cur_pos.y - (mouse_pos.y - click_elm_pos.y);
+ if(max_move_top == null || max_move_top <= p)
+ AJS.setTop(elm, p);
+ }
+ if(AJS.isIe()) {
+ window.event.cancelBubble = true;
+ window.event.returnValue = false;
+ }
+ else
+ e.preventDefault();
+ },
+
+ _dragStop: function(e) {
+ var drag_obj = AJS.drag_obj;
+ var drag_elm = AJS.drag_elm;
+ var click_elm = drag_obj.click_elm;
+
+ AJS.REV(document, "mousemove", AJS._dragMove, true);
+ AJS.REV(document, "mouseup", AJS._dragStop, true);
+
+ var dropped = false;
+ AJS.map(AJS._drop_zones, function(d_z) {
+ if(AJS.isOverlapping(d_z['elm'], click_elm)) {
+ if(d_z['elm'] != click_elm) {
+ var on_drop = d_z['on_drop'];
+ if(on_drop) {
+ dropped = true;
+ on_drop(d_z['elm'], click_elm);
+ }
+ }
+ }
+ });
+
+ if(drag_obj.args['moveable']) {
+ var t = parseInt(click_elm.style.top) || 0;
+ var l = parseInt(click_elm.style.left) || 0;
+ var drag_elm_xy = AJS.absolutePosition(drag_elm);
+ var click_elm_xy = AJS.absolutePosition(click_elm);
+ AJS.setTop(click_elm, t + drag_elm_xy.y - click_elm_xy.y);
+ AJS.setLeft(click_elm, l + drag_elm_xy.x - click_elm_xy.x);
+ }
+
+ if(!dropped && drag_obj.args['on_mouse_up'])
+ drag_obj.args['on_mouse_up'](click_elm, e);
+
+ if(drag_obj.args['hide_on_move'])
+ drag_obj.click_elm.style.visibility = 'visible';
+
+ if(drag_obj.args.on_end) {
+ drag_obj.args.on_end(click_elm);
+ }
+
+ AJS._dragObj = null;
+ if(drag_elm)
+ AJS.hideElement(drag_elm);
+ AJS.drag_elm = null;
+ },
+
+
+////
+// Misc.
+////
+ keys: function(obj) {
+ var rval = [];
+ for (var prop in obj) {
+ rval.push(prop);
+ }
+ return rval;
+ },
+
+ values: function(obj) {
+ var rval = [];
+ for (var prop in obj) {
+ rval.push(obj[prop]);
+ }
+ return rval;
+ },
+
+ urlencode: function(str) {
+ return encodeURIComponent(str.toString());
+ },
+
+ isDefined: function(o) {
+ return (o != "undefined" && o != null)
+ },
+
+ isArray: function(obj) {
+ return obj instanceof Array;
+ },
+
+ isString: function(obj) {
+ return (typeof obj == 'string');
+ },
+
+ isNumber: function(obj) {
+ return (typeof obj == 'number');
+ },
+
+ isObject: function(obj) {
+ return (typeof obj == 'object');
+ },
+
+ isFunction: function(obj) {
+ return (typeof obj == 'function');
+ },
+
+ isDict: function(o) {
+ var str_repr = String(o);
+ return str_repr.indexOf(" Object") != -1;
+ },
+
+ exportToGlobalScope: function() {
+ for(e in AJS)
+ eval(e + " = AJS." + e);
+ },
+
+ log: function(o) {
+ if(AJS.isMozilla())
+ console.log(o);
+ else {
+ var div = AJS.DIV({'style': 'color: green'});
+ AJS.ACN(AJS.getBody(), AJS.setHTML(div, ''+o));
+ }
+ }
+
+}
+
+AJS.Class = function(members) {
+ var fn = function() {
+ if(arguments[0] != 'no_init') {
+ return this.init.apply(this, arguments);
+ }
+ }
+ fn.prototype = members;
+ AJS.update(fn, AJS.Class.prototype);
+ return fn;
+}
+AJS.Class.prototype = {
+ extend: function(members) {
+ var parent = new this('no_init');
+ for(k in members) {
+ var prev = parent[k];
+ var cur = members[k];
+ if (prev && prev != cur && typeof cur == 'function') {
+ cur = this._parentize(cur, prev);
+ }
+ parent[k] = cur;
+ }
+ return new AJS.Class(parent);
+ },
+
+ implement: function(members) {
+ AJS.update(this.prototype, members);
+ },
+
+ _parentize: function(cur, prev) {
+ return function(){
+ this.parent = prev;
+ return cur.apply(this, arguments);
+ }
+ }
+};
+
+//Shortcuts
+AJS.$ = AJS.getElement;
+AJS.$$ = AJS.getElements;
+AJS.$f = AJS.getFormElement;
+AJS.$b = AJS.bind;
+AJS.$p = AJS.partial;
+AJS.$FA = AJS.forceArray;
+AJS.$A = AJS.createArray;
+AJS.DI = AJS.documentInsert;
+AJS.ACN = AJS.appendChildNodes;
+AJS.RCN = AJS.replaceChildNodes;
+AJS.AEV = AJS.addEventListener;
+AJS.REV = AJS.removeEventListener;
+AJS.$bytc = AJS.getElementsByTagAndClassName;
+
+AJSDeferred = function(req) {
+ this.callbacks = [];
+ this.errbacks = [];
+ this.req = req;
+}
+AJSDeferred.prototype = {
+ excCallbackSeq: function(req, list) {
+ var data = req.responseText;
+ while (list.length > 0) {
+ var fn = list.pop();
+ var new_data = fn(data, req);
+ if(new_data)
+ data = new_data;
+ }
+ },
+
+ callback: function () {
+ this.excCallbackSeq(this.req, this.callbacks);
+ },
+
+ errback: function() {
+ if(this.errbacks.length == 0)
+ alert("Error encountered:\n" + this.req.responseText);
+
+ this.excCallbackSeq(this.req, this.errbacks);
+ },
+
+ addErrback: function(fn) {
+ this.errbacks.unshift(fn);
+ },
+
+ addCallback: function(fn) {
+ this.callbacks.unshift(fn);
+ },
+
+ addCallbacks: function(fn1, fn2) {
+ this.addCallback(fn1);
+ this.addErrback(fn2);
+ },
+
+ sendReq: function(data) {
+ if(AJS.isObject(data)) {
+ this.req.send(AJS.queryArguments(data));
+ }
+ else if(AJS.isDefined(data))
+ this.req.send(data);
+ else {
+ this.req.send("");
+ }
+ }
+};
+
+//Prevent memory-leaks
+AJS.addEventListener(window, 'unload', AJS._unloadListeners);
+AJS._createDomShortcuts()
+}
+
+script_loaded = true;
--- /dev/null
+/*
+Last Modified: 25/12/06 18:26:30
+
+AJS effects
+ A very small library with a lot of functionality
+AUTHOR
+ 4mir Salihefendic (http://amix.dk) - amix@amix.dk
+LICENSE
+ Copyright (c) 2006 Amir Salihefendic. All rights reserved.
+ Copyright (c) 2005 Bob Ippolito. All rights reserved.
+ Copyright (c) 2006 Valerio Proietti, http://www.mad4milk.net
+ http://www.opensource.org/licenses/mit-license.php
+VERSION
+ 3.6
+SITE
+ http://orangoo.com/AmiNation/AJS
+**/
+AJS.fx = {
+ _shades: {0: 'ffffff', 1: 'ffffee', 2: 'ffffdd',
+ 3: 'ffffcc', 4: 'ffffbb', 5: 'ffffaa',
+ 6: 'ffff99'},
+
+ highlight: function(elm, options) {
+ var base = new AJS.fx.Base();
+ base.elm = AJS.$(elm);
+ base.setOptions(options);
+ base.options.duration = 600;
+
+ AJS.update(base, {
+ increase: function(){
+ if(this.now == 7)
+ elm.style.backgroundColor = 'transparent';
+ else
+ elm.style.backgroundColor = '#' + AJS.fx._shades[Math.floor(this.now)];
+ }
+ });
+ return base.custom(6, 0);
+ },
+
+ fadeIn: function(elm, options) {
+ options = options || {};
+ if(!options.from) {
+ options.from = 0;
+ AJS.setOpacity(elm, 0);
+ }
+ if(!options.to) options.to = 1;
+ var s = new AJS.fx.Style(elm, 'opacity', options);
+ return s.custom(options.from, options.to);
+ },
+
+ fadeOut: function(elm, options) {
+ options = options || {};
+ if(!options.from) options.from = 1;
+ if(!options.to) options.to = 0;
+ options.duration = 300;
+ var s = new AJS.fx.Style(elm, 'opacity', options);
+ return s.custom(options.from, options.to);
+ },
+
+ setWidth: function(elm, options) {
+ var s = new AJS.fx.Style(elm, 'width', options);
+ return s.custom(options.from, options.to);
+ },
+
+ setHeight: function(elm, options) {
+ var s = new AJS.fx.Style(elm, 'height', options);
+ return s.custom(options.from, options.to);
+ }
+}
+
+
+//From moo.fx
+AJS.fx.Base = new AJS.Class({
+ init: function() {
+ AJS.bindMethods(this);
+ },
+
+ setOptions: function(options){
+ this.options = AJS.update({
+ onStart: function(){},
+ onComplete: function(){},
+ transition: AJS.fx.Transitions.sineInOut,
+ duration: 500,
+ wait: true,
+ fps: 50
+ }, options || {});
+ },
+
+ step: function(){
+ var time = new Date().getTime();
+ if (time < this.time + this.options.duration){
+ this.cTime = time - this.time;
+ this.setNow();
+ } else {
+ setTimeout(AJS.$b(this.options.onComplete, this, [this.elm]), 10);
+ this.clearTimer();
+ this.now = this.to;
+ }
+ this.increase();
+ },
+
+ setNow: function(){
+ this.now = this.compute(this.from, this.to);
+ },
+
+ compute: function(from, to){
+ var change = to - from;
+ return this.options.transition(this.cTime, from, change, this.options.duration);
+ },
+
+ clearTimer: function(){
+ clearInterval(this.timer);
+ this.timer = null;
+ return this;
+ },
+
+ _start: function(from, to){
+ if (!this.options.wait) this.clearTimer();
+ if (this.timer) return;
+ setTimeout(AJS.$p(this.options.onStart, this.elm), 10);
+ this.from = from;
+ this.to = to;
+ this.time = new Date().getTime();
+ this.timer = setInterval(this.step, Math.round(1000/this.options.fps));
+ return this;
+ },
+
+ custom: function(from, to){
+ return this._start(from, to);
+ },
+
+ set: function(to){
+ this.now = to;
+ this.increase();
+ return this;
+ },
+
+ setStyle: function(elm, property, val) {
+ if(this.property == 'opacity')
+ AJS.setOpacity(elm, val);
+ else
+ AJS.setStyle(elm, property, val);
+ }
+});
+
+AJS.fx.Style = AJS.fx.Base.extend({
+ init: function(elm, property, options) {
+ this.parent();
+ this.elm = elm;
+ this.setOptions(options);
+ this.property = property;
+ },
+
+ increase: function(){
+ this.setStyle(this.elm, this.property, this.now);
+ }
+});
+
+AJS.fx.Styles = AJS.fx.Base.extend({
+ init: function(elm, options){
+ this.parent();
+ this.elm = AJS.$(elm);
+ this.setOptions(options);
+ this.now = {};
+ },
+
+ setNow: function(){
+ for (p in this.from)
+ this.now[p] = this.compute(this.from[p], this.to[p]);
+ },
+
+ custom: function(obj){
+ if (this.timer && this.options.wait) return;
+ var from = {};
+ var to = {};
+ for (p in obj){
+ from[p] = obj[p][0];
+ to[p] = obj[p][1];
+ }
+ return this._start(from, to);
+ },
+
+ increase: function(){
+ for (var p in this.now) this.setStyle(this.elm, p, this.now[p]);
+ }
+});
+
+//Transitions (c) 2003 Robert Penner (http://www.robertpenner.com/easing/), BSD License.
+AJS.fx.Transitions = {
+ linear: function(t, b, c, d) { return c*t/d + b; },
+ sineInOut: function(t, b, c, d) { return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b; }
+};
+
+script_loaded = true;
--- /dev/null
+/* Last-Modified: 28/06/06 00:08:22 */
+#GB_overlay {
+ background-color: #000;
+ position: absolute;
+ margin: auto;
+ top: 0;
+ left: 0;
+ z-index: 100;
+}
+
+#GB_window {
+ left: 0;
+ top: 0;
+ font-size: 1px;
+ position: absolute;
+ overflow: visible;
+ z-index: 150;
+}
+
+#GB_window .content {
+ width: auto;
+ margin: 0;
+ padding: 0;
+}
+
+#GB_frame {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ overflow: auto;
+ white-space: nowrap;
+}
--- /dev/null
+var GB_CURRENT = null;
+
+GB_hide = function() {
+ GB_CURRENT.hide();
+}
+
+GreyBox = new AJS.Class({
+ init: function(options) {
+ this.use_fx = AJS.fx;
+ this.type = "page";
+ this.overlay_click_close = false;
+ this.salt = 0;
+ this.root_dir = GB_ROOT_DIR;
+ this.callback_fns = [];
+ this.reload_on_close = false;
+ this.src_loader = this.root_dir + 'loader_frame.html';
+
+ //Solve the www issue
+ var h_www = window.location.hostname.indexOf('www');
+ var src_www = this.src_loader.indexOf('www');
+ if(h_www != -1 && src_www == -1)
+ this.src_loader = this.src_loader.replace('://', '://www.');
+
+ if(h_www == -1 && src_www != -1)
+ this.src_loader = this.src_loader.replace('://www.', '://');
+
+ this.show_loading = true;
+ AJS.update(this, options);
+ },
+
+ addCallback: function(fn) {
+ if(fn) this.callback_fns.push(fn);
+ },
+
+ show: function(url) {
+ GB_CURRENT = this;
+ this.url = url;
+
+ var elms = [AJS.$bytc("object"), AJS.$bytc("select")];
+ AJS.map(AJS.flattenList(elms), function(elm) {
+ elm.style.visibility = "hidden";
+ });
+
+ this.createElements();
+ return false;
+ },
+
+ hide: function() {
+ var c_bs = this.callback_fns;
+ if(c_bs != []) {
+ AJS.map(c_bs, function(fn) {
+ fn();
+ });
+ }
+
+ this.onHide();
+ if(this.use_fx) {
+ var elm = this.overlay;
+ AJS.fx.fadeOut(this.overlay, {
+ onComplete: function() {
+ AJS.removeElement(elm);
+ elm = null;
+ },
+ duration: 300
+ });
+ AJS.removeElement(this.g_window);
+ }
+ else {
+ AJS.removeElement(this.g_window, this.overlay);
+ }
+
+ this.removeFrame();
+
+ AJS.REV(window, "scroll", _GB_setOverlayDimension);
+ AJS.REV(window, "resize", _GB_update);
+
+ var elms = [AJS.$bytc("object"), AJS.$bytc("select")];
+ AJS.map(AJS.flattenList(elms), function(elm) {
+ elm.style.visibility = "visible";
+ });
+
+ GB_CURRENT = null;
+
+ if(this.reload_on_close)
+ window.location.reload();
+ },
+
+ update: function() {
+ this.setOverlayDimension();
+ this.setFrameSize();
+ this.setWindowPosition();
+ },
+
+ createElements: function() {
+ this.initOverlay();
+
+ this.g_window = AJS.DIV({'id': 'GB_window'});
+ AJS.hideElement(this.g_window);
+ AJS.getBody().insertBefore(this.g_window, this.overlay.nextSibling);
+
+ this.initFrame();
+ this.initHook();
+ this.update();
+
+ var me = this;
+ if(this.use_fx) {
+ AJS.fx.fadeIn(this.overlay, {
+ duration: 300,
+ to: 0.7,
+ onComplete: function() {
+ me.onShow();
+ AJS.showElement(me.g_window);
+ me.startLoading();
+ }
+ });
+ }
+ else {
+ AJS.setOpacity(this.overlay, 0.7);
+ AJS.showElement(this.g_window);
+ this.onShow();
+ this.startLoading();
+ }
+
+ AJS.AEV(window, "scroll", _GB_setOverlayDimension);
+ AJS.AEV(window, "resize", _GB_update);
+ },
+
+ removeFrame: function() {
+ try{ AJS.removeElement(this.iframe); }
+ catch(e) {}
+
+ this.iframe = null;
+ },
+
+ startLoading: function() {
+ this.iframe.src = this.src_loader + '?s='+this.salt++;
+ AJS.showElement(this.iframe);
+ },
+
+ setOverlayDimension: function() {
+ var page_size = AJS.getWindowSize();
+ if(AJS.isMozilla() || AJS.isOpera())
+ AJS.setWidth(this.overlay, "100%");
+ else
+ AJS.setWidth(this.overlay, page_size.w);
+
+ var max_height = Math.max(AJS.getScrollTop()+page_size.h, AJS.getScrollTop()+this.height);
+
+ if(max_height < AJS.getScrollTop())
+ AJS.setHeight(this.overlay, max_height);
+ else
+ AJS.setHeight(this.overlay, AJS.getScrollTop()+page_size.h);
+ },
+
+ initOverlay: function() {
+ this.overlay = AJS.DIV({'id': 'GB_overlay'});
+
+ if(this.overlay_click_close)
+ AJS.AEV(this.overlay, "click", GB_hide);
+
+ AJS.setOpacity(this.overlay, 0);
+ AJS.getBody().insertBefore(this.overlay, AJS.getBody().firstChild);
+ },
+
+ initFrame: function() {
+ if(!this.iframe) {
+ var d = {'name': 'GB_frame', 'class': 'GB_frame', 'frameBorder': 0};
+ this.iframe = AJS.IFRAME(d);
+ this.middle_cnt = AJS.DIV({'class': 'content'}, this.iframe);
+
+ this.top_cnt = AJS.DIV();
+ this.bottom_cnt = AJS.DIV();
+
+ AJS.ACN(this.g_window, this.top_cnt, this.middle_cnt, this.bottom_cnt);
+ }
+ },
+
+ /* Can be implemented */
+ onHide: function() {},
+ onShow: function() {},
+ setFrameSize: function() {},
+ setWindowPosition: function() {},
+ initHook: function() {}
+
+});
+
+_GB_update = function() { if(GB_CURRENT) GB_CURRENT.update(); }
+_GB_setOverlayDimension = function() { if(GB_CURRENT) GB_CURRENT.setOverlayDimension(); }
+
+AJS.preloadImages(GB_ROOT_DIR+'indicator.gif');
+
+script_loaded = true;
--- /dev/null
+<!--
+Notice: I feel so dirty doing this, but its the only way to make it cross browser.
+-->
+<html>
+<head>
+ <script>
+ var GB = parent.GB_CURRENT;
+ document.write('<script type="text/javascript" src="AJS.js"><\/script>');
+ if(GB.use_fx) {
+ document.write('<script type="text/javascript" src="AJS_fx.js"><\/script>');
+ }
+ </script>
+ <style>
+ body {
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+ }
+
+ #GB_frame {
+ visibility: hidden;
+ width: 100%;
+ height: 100%;
+ }
+
+ #loading {
+ padding-top: 50px;
+ position: absolute;
+ width: 100%;
+ top: 0;
+ text-align: center;
+ vertical-align: middle;
+ }
+ </style>
+</head>
+<body>
+
+<div id="loading">
+ <img src="indicator.gif">
+</div>
+
+<script>
+var loading = AJS.$('loading');
+var gb_type = GB.type;
+var gb_url = GB.url;
+
+//Start loading in the iframe
+if(gb_type == "page") {
+ document.write('<iframe id="GB_frame" src="' + gb_url + '" frameborder="0"></iframe>');
+}
+else {
+ var img_holder = new Image();
+ img_holder.src = gb_url;
+ document.write('<img id="GB_frame" src="' + gb_url + '">');
+}
+var frame = AJS.$('GB_frame');
+</script>
+
+</body>
+<script>
+function setupOuterGB() {
+ frame.style.visibility = 'visible';
+ GB.setFrameSize();
+ GB.setWindowPosition();
+}
+
+function loaded() {
+ AJS.removeElement(loading);
+
+ GB.overlay.innerHTML += " "; //Safari bugfix
+
+ if(gb_type == "image") {
+ if(img_holder.width != 0 && img_holder.height != 0) {
+ var width = img_holder.width;
+ var height = img_holder.height;
+
+ GB.width = width;
+ GB.height = height;
+
+ setupOuterGB();
+
+ if(GB.use_fx) {
+ AJS.setOpacity(frame, 0);
+ AJS.fx.fadeIn(frame);
+ }
+ }
+ }
+ else {
+ GB.width = frame.offsetWidth;
+ GB.height = frame.offsetHeight;
+ setupOuterGB();
+ }
+}
+
+if(GB.show_loading) {
+ AJS.AEV(window, 'load', function(e) {
+ loaded();
+ });
+}
+else {
+ loaded();
+}
+</script>
+</html>
--- /dev/null
+.GB_Gallery {
+ margin: 0 22px 0 22px;
+}
+
+.GB_Gallery .content {
+ background-color: #fff;
+ border: 3px solid #ddd;
+}
+
+.GB_header {
+ top: 10px;
+ left: 0;
+ margin: 0;
+ z-index: 500;
+ position: absolute;
+ border-bottom: 2px solid #555;
+ border-top: 2px solid #555;
+}
+
+.GB_header .inner {
+ background-color: #333;
+ font-family: Arial, Verdana, sans-serif;
+ padding: 2px 20px 2px 20px;
+}
+
+.GB_header table {
+ margin: 0;
+ width: 100%;
+ border-collapse: collapse;
+}
+
+.GB_header .caption {
+ text-align: left;
+ color: #eee;
+ white-space: nowrap;
+ font-size: 20px;
+}
+
+.GB_header .close {
+ text-align: right;
+}
+
+.GB_header .close img {
+ z-index: 500;
+ cursor: pointer;
+}
+
+.GB_header .middle {
+ white-space: nowrap;
+ text-align: center;
+}
--- /dev/null
+GB_showImage = function(caption, url, callback_fn) {
+ var options = {
+ width: 300,
+ height: 300,
+ type: 'image',
+
+ fullscreen: false,
+ center_win: true,
+ caption: caption,
+ callback_fn: callback_fn
+ }
+ var win = new GB_Gallery(options);
+ return win.show(url);
+}
+
+GB_showPage = function(caption, url, callback_fn) {
+ var options = {
+ type: 'page',
+
+ caption: caption,
+ callback_fn: callback_fn,
+ fullscreen: true,
+ center_win: false
+ }
+ var win = new GB_Gallery(options);
+ return win.show(url);
+}
+
+GB_Gallery = GreyBox.extend({
+ init: function(options) {
+ this.parent({});
+ this.img_close = this.root_dir + 'g_close.gif';
+ AJS.update(this, options);
+ this.addCallback(this.callback_fn);
+ },
+
+ initHook: function() {
+ AJS.addClass(this.g_window, 'GB_Gallery');
+
+ var inner = AJS.DIV({'class': 'inner'});
+ this.header = AJS.DIV({'class': 'GB_header'}, inner);
+ AJS.setOpacity(this.header, 0);
+ AJS.getBody().insertBefore(this.header, this.overlay.nextSibling);
+
+ var td_caption = AJS.TD({'id': 'GB_caption', 'class': 'caption', 'width': '40%'}, this.caption);
+ var td_middle = AJS.TD({'id': 'GB_middle', 'class': 'middle', 'width': '20%'});
+
+ var img_close = AJS.IMG({'src': this.img_close});
+ AJS.AEV(img_close, 'click', GB_hide);
+ var td_close = AJS.TD({'class': 'close', 'width': '40%'}, img_close);
+
+ var tbody = AJS.TBODY(AJS.TR(td_caption, td_middle, td_close));
+
+ var table = AJS.TABLE({'cellspacing': '0', 'cellpadding': 0, 'border': 0}, tbody);
+ AJS.ACN(inner, table);
+
+ if(this.fullscreen)
+ AJS.AEV(window, 'scroll', AJS.$b(this.setWindowPosition, this));
+ else
+ AJS.AEV(window, 'scroll', AJS.$b(this._setHeaderPos, this));
+ },
+
+ setFrameSize: function() {
+ var overlay_w = this.overlay.offsetWidth;
+ var page_size = AJS.getWindowSize();
+
+ if(this.fullscreen) {
+ this.width = overlay_w-40;
+ this.height = page_size.h-80;
+ }
+ AJS.setWidth(this.iframe, this.width);
+ AJS.setHeight(this.iframe, this.height);
+
+ AJS.setWidth(this.header, overlay_w);
+ },
+
+ _setHeaderPos: function() {
+ AJS.setTop(this.header, AJS.getScrollTop()+10);
+ },
+
+ setWindowPosition: function() {
+ var overlay_w = this.overlay.offsetWidth;
+ var page_size = AJS.getWindowSize();
+ AJS.setLeft(this.g_window, ((overlay_w - 50 - this.width)/2));
+
+ var header_top = AJS.getScrollTop()+55;
+ if(!this.center_win) {
+ AJS.setTop(this.g_window, header_top);
+ }
+ else {
+ var fl = ((page_size.h - this.height) /2) + 20 + AJS.getScrollTop();
+ if(fl < 0) fl = 0;
+ if(header_top > fl) {
+ fl = header_top;
+ }
+ AJS.setTop(this.g_window, fl);
+ }
+ this._setHeaderPos();
+ },
+
+ onHide: function() {
+ AJS.removeElement(this.header);
+ AJS.removeClass(this.g_window, 'GB_Gallery');
+ },
+
+ onShow: function() {
+ if(this.use_fx)
+ AJS.fx.fadeIn(this.header, {to: 1});
+ else
+ AJS.setOpacity(this.header, 1);
+ }
+});
+
+AJS.preloadImages(GB_ROOT_DIR+'g_close.gif');
--- /dev/null
+#GB_middle {
+ color: #eee;
+}
+
+#GB_middle img {
+ cursor: pointer;
+ vertical-align: middle;
+}
+
+#GB_middle .disabled {
+ cursor: default;
+}
+
+#GB_middle .left {
+ padding-right: 10px;
+}
+
+#GB_middle .right {
+ padding-left: 10px;
+}
--- /dev/null
+GB_showFullScreenSet = function(set, start_index, callback_fn) {
+ var options = {
+ type: 'page',
+ fullscreen: true,
+ center_win: false
+ }
+ var gb_sets = new GB_Sets(options, set);
+ gb_sets.addCallback(callback_fn);
+ gb_sets.showSet(start_index-1);
+ return false;
+}
+
+GB_showImageSet = function(set, start_index, callback_fn) {
+ var options = {
+ type: 'image',
+ fullscreen: false,
+ center_win: true,
+ width: 300,
+ height: 300
+ }
+ var gb_sets = new GB_Sets(options, set);
+ gb_sets.addCallback(callback_fn);
+ gb_sets.showSet(start_index-1);
+ return false;
+}
+
+GB_Sets = GB_Gallery.extend({
+ init: function(options, set) {
+ this.parent(options);
+ if(!this.img_next) this.img_next = this.root_dir + 'next.gif';
+ if(!this.img_prev) this.img_prev = this.root_dir + 'prev.gif';
+ this.current_set = set;
+ },
+
+ showSet: function(start_index) {
+ this.current_index = start_index;
+
+ var item = this.current_set[this.current_index];
+ this.show(item.url);
+ this._setCaption(item.caption);
+
+ this.btn_prev = AJS.IMG({'class': 'left', src: this.img_prev});
+ this.btn_next = AJS.IMG({'class': 'right', src: this.img_next});
+
+ AJS.AEV(this.btn_prev, 'click', AJS.$b(this.switchPrev, this));
+ AJS.AEV(this.btn_next, 'click', AJS.$b(this.switchNext, this));
+
+ GB_STATUS = AJS.SPAN({'class': 'GB_navStatus'});
+ AJS.ACN(AJS.$('GB_middle'), this.btn_prev, GB_STATUS, this.btn_next);
+
+ this.updateStatus();
+ },
+
+ updateStatus: function() {
+ AJS.setHTML(GB_STATUS, (this.current_index + 1) + ' / ' + this.current_set.length);
+ if(this.current_index == 0) {
+ AJS.addClass(this.btn_prev, 'disabled');
+ }
+ else {
+ AJS.removeClass(this.btn_prev, 'disabled');
+ }
+
+ if(this.current_index == this.current_set.length-1) {
+ AJS.addClass(this.btn_next, 'disabled');
+ }
+ else {
+ AJS.removeClass(this.btn_next, 'disabled');
+ }
+ },
+
+ _setCaption: function(caption) {
+ AJS.setHTML(AJS.$('GB_caption'), caption);
+ },
+
+ updateFrame: function() {
+ var item = this.current_set[this.current_index];
+ this._setCaption(item.caption);
+ this.url = item.url;
+ this.startLoading();
+ },
+
+ switchPrev: function() {
+ if(this.current_index != 0) {
+ this.current_index--;
+ this.updateFrame();
+ this.updateStatus();
+ }
+ },
+
+ switchNext: function() {
+ if(this.current_index != this.current_set.length-1) {
+ this.current_index++
+ this.updateFrame();
+ this.updateStatus();
+ }
+ }
+});
+
+AJS.AEV(window, 'load', function() {
+ AJS.preloadImages(GB_ROOT_DIR+'next.gif', GB_ROOT_DIR+'prev.gif');
+});
--- /dev/null
+.GB_Window .content {
+ background-color: #fff;
+ border: 3px solid #ccc;
+ border-top: none;
+}
+
+.GB_Window .header {
+ border-bottom: 1px solid #aaa;
+ border-top: 1px solid #999;
+ border-left: 3px solid #ccc;
+ border-right: 3px solid #ccc;
+ margin: 0;
+
+ height: 22px;
+ font-size: 12px;
+ padding: 3px 0;
+ color: #333;
+}
+
+.GB_Window .caption {
+ font-size: 12px;
+ text-align: left;
+ font-weight: bold;
+ white-space: nowrap;
+ padding-right: 20px;
+}
+
+.GB_Window .close { text-align: right; }
+.GB_Window .close span {
+ font-size: 12px;
+ cursor: pointer;
+}
+.GB_Window .close img {
+ cursor: pointer;
+ padding: 0 3px 0 0;
+}
+
+.GB_Window .on { border-bottom: 1px solid #333; }
+.GB_Window .click { border-bottom: 1px solid red; }
--- /dev/null
+GB_show = function(caption, url, /* optional */ height, width, callback_fn) {
+ var options = {
+ caption: caption,
+ height: height || 500,
+ width: width || 500,
+ fullscreen: false,
+ callback_fn: callback_fn
+ }
+ var win = new GB_Window(options);
+ return win.show(url);
+}
+
+GB_showCenter = function(caption, url, /* optional */ height, width, callback_fn) {
+ var options = {
+ caption: caption,
+ center_win: true,
+ height: height || 500,
+ width: width || 500,
+ fullscreen: false,
+ callback_fn: callback_fn
+ }
+ var win = new GB_Window(options);
+ return win.show(url);
+}
+
+GB_showFullScreen = function(caption, url, callback_fn) {
+ var options = {
+ caption: caption,
+ fullscreen: true,
+ callback_fn: callback_fn
+ }
+ var win = new GB_Window(options);
+ return win.show(url);
+}
+
+GB_Window = GreyBox.extend({
+ init: function(options) {
+ this.parent({});
+ this.img_header = this.root_dir+"header_bg.gif";
+ this.img_close = this.root_dir+"w_close.gif";
+ this.show_close_img = true;
+ AJS.update(this, options);
+ this.addCallback(this.callback_fn);
+ },
+
+ initHook: function() {
+ AJS.addClass(this.g_window, 'GB_Window');
+
+ this.header = AJS.TABLE({'class': 'header'});
+ this.header.style.backgroundImage = "url("+ this.img_header +")";
+
+ var td_caption = AJS.TD({'class': 'caption'}, this.caption);
+ var td_close = AJS.TD({'class': 'close'});
+
+ if(this.show_close_img) {
+ var img_close = AJS.IMG({'src': this.img_close});
+ var span = AJS.SPAN('Close');
+
+ var btn = AJS.DIV(img_close, span);
+
+ AJS.AEV([img_close, span], 'mouseover', function() { AJS.addClass(span, 'on'); });
+ AJS.AEV([img_close, span], 'mouseout', function() { AJS.removeClass(span, 'on'); });
+ AJS.AEV([img_close, span], 'mousedown', function() { AJS.addClass(span, 'click'); });
+ AJS.AEV([img_close, span], 'mouseup', function() { AJS.removeClass(span, 'click'); });
+ AJS.AEV([img_close, span], 'click', GB_hide);
+
+ AJS.ACN(td_close, btn);
+ }
+
+ tbody_header = AJS.TBODY();
+ AJS.ACN(tbody_header, AJS.TR(td_caption, td_close));
+
+ AJS.ACN(this.header, tbody_header);
+ AJS.ACN(this.top_cnt, this.header);
+
+ if(this.fullscreen)
+ AJS.AEV(window, 'scroll', AJS.$b(this.setWindowPosition, this));
+ },
+
+ setFrameSize: function() {
+ if(this.fullscreen) {
+ var page_size = AJS.getWindowSize();
+ overlay_h = page_size.h;
+ this.width = Math.round(this.overlay.offsetWidth - (this.overlay.offsetWidth/100)*10);
+ this.height = Math.round(overlay_h - (overlay_h/100)*10);
+ }
+
+ AJS.setWidth(this.header, this.width+6); //6 is for the left+right border
+ AJS.setWidth(this.iframe, this.width);
+ AJS.setHeight(this.iframe, this.height);
+ },
+
+ setWindowPosition: function() {
+ var page_size = AJS.getWindowSize();
+ AJS.setLeft(this.g_window, ((page_size.w - this.width)/2)-13);
+
+ if(!this.center_win) {
+ AJS.setTop(this.g_window, AJS.getScrollTop());
+ }
+ else {
+ var fl = ((page_size.h - this.height) /2) - 20 + AJS.getScrollTop();
+ if(fl < 0)
+ fl = 0;
+ AJS.setTop(this.g_window, fl);
+ }
+ }
+});
+
+AJS.preloadImages(GB_ROOT_DIR+'w_close.gif', GB_ROOT_DIR+'header_bg.gif');
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>GreyBox - Installation</title>
+
+ <script type="text/javascript" src="greybox/AJS.js"></script>
+
+ <script type="text/javascript" src="static_files/help.js"></script>
+ <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+<body>
+
+<script>
+ insertHeader();
+ insertMenu('installation');
+</script>
+
+<ol>
+<li>
+Append following to your header section (in between <code><header>...</header></code>).
+<br />
+<span class="hl">GB_ROOT_DIR</span> is the URL where static files are located:
+<pre>
+<code><script type="text/javascript">
+ var GB_ROOT_DIR = "http://mydomain.com/greybox/";
+</script></code>
+</pre>
+</li>
+GB_ROOT_DIR should be absolute.
+
+<li>
+Append also following scripts and one stylesheet:
+<pre>
+<code><script type="text/javascript" src="greybox/AJS.js"></script>
+<script type="text/javascript" src="greybox/AJS_fx.js"></script>
+<script type="text/javascript" src="greybox/gb_scripts.js"></script>
+<link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" /></code>
+</pre>
+
+AJS_fx.js is optional, it's used for effects. If you don't wish effects, then don't include AJS_fx.js in your header section.
+</li>
+
+<li>
+That's it, you are now ready to use GreyBox!
+</li>
+</ol>
+
+</body>
+</html>
--- /dev/null
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+<head>
+ <title>GreyBox - Normal usage</title>
+
+ <script type="text/javascript">
+ var GB_ROOT_DIR = "./greybox/";
+ </script>
+
+ <script type="text/javascript" src="greybox/AJS.js"></script>
+ <script type="text/javascript" src="greybox/AJS_fx.js"></script>
+ <script type="text/javascript" src="greybox/gb_scripts.js"></script>
+ <link href="greybox/gb_styles.css" rel="stylesheet" type="text/css" media="all" />
+
+ <script type="text/javascript" src="static_files/help.js"></script>
+ <link href="static_files/help.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body>
+
+<script>
+ insertHeader();
+ insertMenu('nrm_usage');
+</script>
+
+<h2>Showing images</h2>
+
+<h3 class="first">Showing one image:</h3>
+<h4>Syntax:</h4>
+<pre>
+<code><a href="URL" title="CAPTION" rel="gb_image[]">HTML</a></code>
+</pre>
+
+<h4>Example:</h4>
+<pre>
+<code><a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg" title="Flower" rel="gb_image[]">Show flower</a></code>
+</pre>
+
+<h4>Example rendered:</h4>
+<a href="http://static.flickr.com/119/294309231_a3d2a339b9.jpg" title="Flower" rel="gb_image[]">Show flower</a>
+
+
+<h3>Showing a group of images:</h3>
+<h4>Syntax:</h4>
+<pre>
+<code><a href="URL" title="CAPTION" rel="gb_imageset[NAME]">HTML</a></code>
+<code><a href="URL" title="CAPTION" rel="gb_imageset[NAME]">HTML</a></code>
+</pre>
+
+<h4>Example:</h4>
+<pre>
+<code><a href="static_files/salt.jpg" rel="gb_imageset[nice_pics]" title="Salt flats in Chile">Salt flats</a></code>
+<code><a href="static_files/night_valley.jpg" rel="gb_imageset[nice_pics]" title="Night valley">Night valley</a></code>
+</pre>
+
+<h4>Example rendered:</h4>
+<a href="static_files/salt.jpg" rel="gb_imageset[nice_pics]" title="Salt flats in Chile">Salt flats</a>
+<a href="static_files/night_valley.jpg" rel="gb_imageset[nice_pics]" title="Night valley">Night valley</a>
+
+
+<h2>Showing pages</h2>
+
+<h3>Showing one page:</h3>
+<h4>Syntax:</h4>
+<pre>
+<code><a href="URL" title="CAPTION" rel="gb_page[WIDTH, HEIGHT]">HTML</a></code>
+</pre>
+
+<h4>Example:</h4>
+<pre>
+<code><a href="http://google.com/" title="Google" rel="gb_page[500, 500]">Launch Google.com</a></code>
+</pre>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com/" title="Google" rel="gb_page[500, 500]">Launch Google.com</a>
+
+
+<h3>Showing one page as center window:</h3>
+<h4>Syntax:</h4>
+<pre>
+<code><a href="URL" title="CAPTION" rel="gb_page_center[WIDTH, HEIGHT]">HTML</a></code>
+</pre>
+
+<h4>Example:</h4>
+<pre>
+<code><a href="http://google.com/" title="Google" rel="gb_page_center[500, 500]">Launch Google.com</a></code>
+</pre>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com/" title="Google" rel="gb_page_center[500, 500]">Launch Google.com</a>
+
+
+<h3>Showing one page in fullscreen:</h3>
+<h4>Syntax:</h4>
+<pre>
+<code><a href="URL" title="CAPTION" rel="gb_page_fs[]">HTML</a></code>
+</pre>
+
+<h4>Example:</h4>
+<pre>
+<code><a href="http://google.com/" title="Google" rel="gb_page_fs[]">Launch Google.com</a></code>
+</pre>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com/" title="Google" rel="gb_page_fs[]">Launch Google.com</a>
+
+<h3>Showing a group of pages:</h3>
+<h4>Syntax:</h4>
+<pre>
+<code><a href="URL" title="CAPTION" rel="gb_pageset[NAME]">HTML</a></code>
+<code><a href="URL" title="CAPTION" rel="gb_pageset[NAME]">HTML</a></code>
+</pre>
+
+<h4>Example:</h4>
+<pre>
+<code><a href="http://google.com/" title="Google" rel="gb_pageset[search_sites]">Launch Google search</a></code>
+<code><a href="http://search.yahoo.com/" rel="gb_pageset[search_sites]">Launch Yahoo search</a></code>
+</pre>
+
+<h4>Example rendered:</h4>
+<a href="http://google.com/" title="Google" rel="gb_pageset[search_sites]">Launch Google search</a>
+<a href="http://search.yahoo.com/" rel="gb_pageset[search_sites]">Launch Yahoo search</a>
+
+
+</body>
+</html>
--- /dev/null
+body {
+ font-family: helvetica, verdana, sans-serif;
+ font-size: 12px;
+ background-color: #fff;
+ padding: 10px 35px 35px 35px;
+ width: 800px;
+ margin: auto;
+}
+
+#top {
+ text-align: center;
+}
+
+h2 {
+ font-size: 18px;
+ color: #333;
+ margin: 35px 0 10px 0;
+}
+
+h3 {
+ color: #333;
+ border-bottom: 1px solid #999;
+ font-size: 15px;
+ margin: 30px 0 3px 0;
+}
+
+.first {
+ margin-top: 20px;
+}
+
+h4 {
+ color: black;
+ font-size: 13px;
+ margin: 10px 0 5px 0;
+}
+
+pre {
+ font-size: 11px;
+ margin-top: 5px;
+ padding: 4px;
+ background-color: #e3e2c6;
+ border: 1px solid #999;
+}
+
+.hl {
+ background-color: #ffffcc;
+}
+
+ol {
+ margin: 0;
+ padding: 0 0px 0 20px;
+}
+
+li {
+ padding: 5px 0 5px 0;
+}
+
+img {
+ border: 0;
+}
+
+/*
+ * Menu
+ */
+#menu {
+ border-bottom: 1px solid #999;
+ margin: 20px 0px;
+ padding: 10px 0pt 5px;
+ text-align: center;
+}
+
+#menu li {
+ display: inline;
+ margin: 0px;
+ padding: 0px;
+}
+
+#menu a {
+ background: #ddd none repeat;
+ border: 1px solid #999;
+ margin: 0 5px 0 5px;
+ padding: 5px;
+}
+
+#menu a.current {
+ background: #fff none repeat;
+ border-bottom: 1px solid #fff;
+}
+
+#menu a {
+ color: black;
+ text-decoration: none;
+}
--- /dev/null
+var tmpl_header = AJS.join('', [
+ '<div id="top"> <img src="static_files/logo.gif" alt="" /> <br />',
+ '<span style="font-weight: bold; color: #333">A pop-up window that doesn\'t suck.</span>',
+ '</div>'
+]);
+
+function insertHeader() {
+ AJS.DI(tmpl_header);
+}
+
+var LINKS = {
+ 'installation': 'installation.html',
+ 'examples': 'examples.html',
+ 'nrm_usage': 'normal_usage.html',
+ 'adv_usage': 'advance_usage.html',
+ 'cmpr': 'compressing_greybox.html',
+ 'about': 'about.html'
+}
+
+function insertMenu(current_page) {
+ var menu = AJS.UL({id: 'menu'});
+ var create_item = function(cls, name) {
+ var item = AJS.LI({'class': cls});
+ AJS.ACN(item, AJS.A({href: LINKS[cls]}, name));
+ return item;
+ }
+ var items = [
+ create_item('installation', 'Installation'),
+ create_item('examples', 'Examples'),
+ create_item('nrm_usage', 'Normal usage'),
+ create_item('adv_usage', 'Advance usage'),
+ create_item('cmpr', 'Compressing GreyBox'),
+ create_item('about', 'About')
+ ];
+
+ AJS.map(items, function(item) {
+ if(item.className == current_page) {
+ AJS.addClass(AJS.$bytc('a', null, item)[0], 'current');
+ }
+ AJS.ACN(menu, item);
+ });
+ AJS.DI(menu);
+}
+
+function insertCode() {
+ var code = AJS.join('\n', arguments);
+ var result = '<pre><code>';
+ code = code.replace(/</g, '<').replace(/>/g, '>');
+ result += code;
+ result += '</code></pre>';
+ document.write(result);
+}
--- /dev/null
+var GB_CURRENT=null;
+GB_hide=function(){
+GB_CURRENT.hide();
+};
+GreyBox=new AJS.Class({init:function(_1){
+this.use_fx=AJS.fx;
+this.type="page";
+this.overlay_click_close=false;
+this.salt=0;
+this.root_dir=GB_ROOT_DIR;
+this.callback_fns=[];
+this.reload_on_close=false;
+this.src_loader=this.root_dir+"loader_frame.html";
+var _2=window.location.hostname.indexOf("www");
+var _3=this.src_loader.indexOf("www");
+if(_2!=-1&&_3==-1){
+this.src_loader=this.src_loader.replace("://","://www.");
+}
+if(_2==-1&&_3!=-1){
+this.src_loader=this.src_loader.replace("://www.","://");
+}
+this.show_loading=true;
+AJS.update(this,_1);
+},addCallback:function(fn){
+if(fn){
+this.callback_fns.push(fn);
+}
+},show:function(_5){
+GB_CURRENT=this;
+this.url=_5;
+var _6=[AJS.$bytc("object"),AJS.$bytc("select")];
+AJS.map(AJS.flattenList(_6),function(_7){
+_7.style.visibility="hidden";
+});
+this.createElements();
+return false;
+},hide:function(){
+var _8=this.callback_fns;
+if(_8!=[]){
+AJS.map(_8,function(fn){
+fn();
+});
+}
+this.onHide();
+if(this.use_fx){
+var _a=this.overlay;
+AJS.fx.fadeOut(this.overlay,{onComplete:function(){
+AJS.removeElement(_a);
+_a=null;
+},duration:300});
+AJS.removeElement(this.g_window);
+}else{
+AJS.removeElement(this.g_window,this.overlay);
+}
+this.removeFrame();
+AJS.REV(window,"scroll",_GB_setOverlayDimension);
+AJS.REV(window,"resize",_GB_update);
+var _b=[AJS.$bytc("object"),AJS.$bytc("select")];
+AJS.map(AJS.flattenList(_b),function(_c){
+_c.style.visibility="visible";
+});
+GB_CURRENT=null;
+if(this.reload_on_close){
+window.location.reload();
+}
+},update:function(){
+this.setOverlayDimension();
+this.setFrameSize();
+this.setWindowPosition();
+},createElements:function(){
+this.initOverlay();
+this.g_window=AJS.DIV({"id":"GB_window"});
+AJS.hideElement(this.g_window);
+AJS.getBody().insertBefore(this.g_window,this.overlay.nextSibling);
+this.initFrame();
+this.initHook();
+this.update();
+var me=this;
+if(this.use_fx){
+AJS.fx.fadeIn(this.overlay,{duration:300,to:0.7,onComplete:function(){
+me.onShow();
+AJS.showElement(me.g_window);
+me.startLoading();
+}});
+}else{
+AJS.setOpacity(this.overlay,0.7);
+AJS.showElement(this.g_window);
+this.onShow();
+this.startLoading();
+}
+AJS.AEV(window,"scroll",_GB_setOverlayDimension);
+AJS.AEV(window,"resize",_GB_update);
+},removeFrame:function(){
+try{
+AJS.removeElement(this.iframe);
+}
+catch(e){
+}
+this.iframe=null;
+},startLoading:function(){
+this.iframe.src=this.src_loader+"?s="+this.salt++;
+AJS.showElement(this.iframe);
+},setOverlayDimension:function(){
+var _e=AJS.getWindowSize();
+if(AJS.isMozilla()||AJS.isOpera()){
+AJS.setWidth(this.overlay,"100%");
+}else{
+AJS.setWidth(this.overlay,_e.w);
+}
+var _f=Math.max(AJS.getScrollTop()+_e.h,AJS.getScrollTop()+this.height);
+if(_f<AJS.getScrollTop()){
+AJS.setHeight(this.overlay,_f);
+}else{
+AJS.setHeight(this.overlay,AJS.getScrollTop()+_e.h);
+}
+},initOverlay:function(){
+this.overlay=AJS.DIV({"id":"GB_overlay"});
+if(this.overlay_click_close){
+AJS.AEV(this.overlay,"click",GB_hide);
+}
+AJS.setOpacity(this.overlay,0);
+AJS.getBody().insertBefore(this.overlay,AJS.getBody().firstChild);
+},initFrame:function(){
+if(!this.iframe){
+var d={"name":"GB_frame","class":"GB_frame","frameBorder":0};
+this.iframe=AJS.IFRAME(d);
+this.middle_cnt=AJS.DIV({"class":"content"},this.iframe);
+this.top_cnt=AJS.DIV();
+this.bottom_cnt=AJS.DIV();
+AJS.ACN(this.g_window,this.top_cnt,this.middle_cnt,this.bottom_cnt);
+}
+},onHide:function(){
+},onShow:function(){
+},setFrameSize:function(){
+},setWindowPosition:function(){
+},initHook:function(){
+}});
+_GB_update=function(){
+if(GB_CURRENT){
+GB_CURRENT.update();
+}
+};
+_GB_setOverlayDimension=function(){
+if(GB_CURRENT){
+GB_CURRENT.setOverlayDimension();
+}
+};
+AJS.preloadImages(GB_ROOT_DIR+"indicator.gif");
+script_loaded=true;
+var GB_SETS={};
+function decoGreyboxLinks(){
+var as=AJS.$bytc("a");
+AJS.map(as,function(a){
+if(a.getAttribute("href")&&a.getAttribute("rel")){
+var rel=a.getAttribute("rel");
+if(rel.indexOf("gb_")==0){
+var _14=rel.match(/\w+/)[0];
+var _15=rel.match(/\[(.*)\]/)[1];
+var _16=0;
+var _17={"caption":a.title||"","url":a.href};
+if(_14=="gb_pageset"||_14=="gb_imageset"){
+if(!GB_SETS[_15]){
+GB_SETS[_15]=[];
+}
+GB_SETS[_15].push(_17);
+_16=GB_SETS[_15].length;
+}
+if(_14=="gb_pageset"){
+a.onclick=function(){
+GB_showFullScreenSet(GB_SETS[_15],_16);
+return false;
+};
+}
+if(_14=="gb_imageset"){
+a.onclick=function(){
+GB_showImageSet(GB_SETS[_15],_16);
+return false;
+};
+}
+if(_14=="gb_image"){
+a.onclick=function(){
+GB_showImage(_17.caption,_17.url);
+return false;
+};
+}
+if(_14=="gb_page"){
+a.onclick=function(){
+var sp=_15.split(/, ?/);
+GB_show(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
+return false;
+};
+}
+if(_14=="gb_page_fs"){
+a.onclick=function(){
+GB_showFullScreen(_17.caption,_17.url);
+return false;
+};
+}
+if(_14=="gb_page_center"){
+a.onclick=function(){
+var sp=_15.split(/, ?/);
+GB_showCenter(_17.caption,_17.url,parseInt(sp[1]),parseInt(sp[0]));
+return false;
+};
+}
+}
+}
+});
+}
+AJS.AEV(window,"load",decoGreyboxLinks);
+GB_showImage=function(_1a,url,_1c){
+var _1d={width:300,height:300,type:"image",fullscreen:false,center_win:true,caption:_1a,callback_fn:_1c};
+var win=new GB_Gallery(_1d);
+return win.show(url);
+};
+GB_showPage=function(_1f,url,_21){
+var _22={type:"page",caption:_1f,callback_fn:_21,fullscreen:true,center_win:false};
+var win=new GB_Gallery(_22);
+return win.show(url);
+};
+GB_Gallery=GreyBox.extend({init:function(_24){
+this.parent({});
+this.img_close=this.root_dir+"g_close.gif";
+AJS.update(this,_24);
+this.addCallback(this.callback_fn);
+},initHook:function(){
+AJS.addClass(this.g_window,"GB_Gallery");
+var _25=AJS.DIV({"class":"inner"});
+this.header=AJS.DIV({"class":"GB_header"},_25);
+AJS.setOpacity(this.header,0);
+AJS.getBody().insertBefore(this.header,this.overlay.nextSibling);
+var _26=AJS.TD({"id":"GB_caption","class":"caption","width":"40%"},this.caption);
+var _27=AJS.TD({"id":"GB_middle","class":"middle","width":"20%"});
+var _28=AJS.IMG({"src":this.img_close});
+AJS.AEV(_28,"click",GB_hide);
+var _29=AJS.TD({"class":"close","width":"40%"},_28);
+var _2a=AJS.TBODY(AJS.TR(_26,_27,_29));
+var _2b=AJS.TABLE({"cellspacing":"0","cellpadding":0,"border":0},_2a);
+AJS.ACN(_25,_2b);
+if(this.fullscreen){
+AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
+}else{
+AJS.AEV(window,"scroll",AJS.$b(this._setHeaderPos,this));
+}
+},setFrameSize:function(){
+var _2c=this.overlay.offsetWidth;
+var _2d=AJS.getWindowSize();
+if(this.fullscreen){
+this.width=_2c-40;
+this.height=_2d.h-80;
+}
+AJS.setWidth(this.iframe,this.width);
+AJS.setHeight(this.iframe,this.height);
+AJS.setWidth(this.header,_2c);
+},_setHeaderPos:function(){
+AJS.setTop(this.header,AJS.getScrollTop()+10);
+},setWindowPosition:function(){
+var _2e=this.overlay.offsetWidth;
+var _2f=AJS.getWindowSize();
+AJS.setLeft(this.g_window,((_2e-50-this.width)/2));
+var _30=AJS.getScrollTop()+55;
+if(!this.center_win){
+AJS.setTop(this.g_window,_30);
+}else{
+var fl=((_2f.h-this.height)/2)+20+AJS.getScrollTop();
+if(fl<0){
+fl=0;
+}
+if(_30>fl){
+fl=_30;
+}
+AJS.setTop(this.g_window,fl);
+}
+this._setHeaderPos();
+},onHide:function(){
+AJS.removeElement(this.header);
+AJS.removeClass(this.g_window,"GB_Gallery");
+},onShow:function(){
+if(this.use_fx){
+AJS.fx.fadeIn(this.header,{to:1});
+}else{
+AJS.setOpacity(this.header,1);
+}
+}});
+AJS.preloadImages(GB_ROOT_DIR+"g_close.gif");
+GB_showFullScreenSet=function(set,_33,_34){
+var _35={type:"page",fullscreen:true,center_win:false};
+var _36=new GB_Sets(_35,set);
+_36.addCallback(_34);
+_36.showSet(_33-1);
+return false;
+};
+GB_showImageSet=function(set,_38,_39){
+var _3a={type:"image",fullscreen:false,center_win:true,width:300,height:300};
+var _3b=new GB_Sets(_3a,set);
+_3b.addCallback(_39);
+_3b.showSet(_38-1);
+return false;
+};
+GB_Sets=GB_Gallery.extend({init:function(_3c,set){
+this.parent(_3c);
+if(!this.img_next){
+this.img_next=this.root_dir+"next.gif";
+}
+if(!this.img_prev){
+this.img_prev=this.root_dir+"prev.gif";
+}
+this.current_set=set;
+},showSet:function(_3e){
+this.current_index=_3e;
+var _3f=this.current_set[this.current_index];
+this.show(_3f.url);
+this._setCaption(_3f.caption);
+this.btn_prev=AJS.IMG({"class":"left",src:this.img_prev});
+this.btn_next=AJS.IMG({"class":"right",src:this.img_next});
+AJS.AEV(this.btn_prev,"click",AJS.$b(this.switchPrev,this));
+AJS.AEV(this.btn_next,"click",AJS.$b(this.switchNext,this));
+GB_STATUS=AJS.SPAN({"class":"GB_navStatus"});
+AJS.ACN(AJS.$("GB_middle"),this.btn_prev,GB_STATUS,this.btn_next);
+this.updateStatus();
+},updateStatus:function(){
+AJS.setHTML(GB_STATUS,(this.current_index+1)+" / "+this.current_set.length);
+if(this.current_index==0){
+AJS.addClass(this.btn_prev,"disabled");
+}else{
+AJS.removeClass(this.btn_prev,"disabled");
+}
+if(this.current_index==this.current_set.length-1){
+AJS.addClass(this.btn_next,"disabled");
+}else{
+AJS.removeClass(this.btn_next,"disabled");
+}
+},_setCaption:function(_40){
+AJS.setHTML(AJS.$("GB_caption"),_40);
+},updateFrame:function(){
+var _41=this.current_set[this.current_index];
+this._setCaption(_41.caption);
+this.url=_41.url;
+this.startLoading();
+},switchPrev:function(){
+if(this.current_index!=0){
+this.current_index--;
+this.updateFrame();
+this.updateStatus();
+}
+},switchNext:function(){
+if(this.current_index!=this.current_set.length-1){
+this.current_index++;
+this.updateFrame();
+this.updateStatus();
+}
+}});
+AJS.AEV(window,"load",function(){
+AJS.preloadImages(GB_ROOT_DIR+"next.gif",GB_ROOT_DIR+"prev.gif");
+});
+GB_show=function(_42,url,_44,_45,_46){
+var _47={caption:_42,height:_44||500,width:_45||500,fullscreen:false,callback_fn:_46};
+var win=new GB_Window(_47);
+return win.show(url);
+};
+GB_showCenter=function(_49,url,_4b,_4c,_4d){
+var _4e={caption:_49,center_win:true,height:_4b||500,width:_4c||500,fullscreen:false,callback_fn:_4d};
+var win=new GB_Window(_4e);
+return win.show(url);
+};
+GB_showFullScreen=function(_50,url,_52){
+var _53={caption:_50,fullscreen:true,callback_fn:_52};
+var win=new GB_Window(_53);
+return win.show(url);
+};
+GB_Window=GreyBox.extend({init:function(_55){
+this.parent({});
+this.img_header=this.root_dir+"header_bg.gif";
+this.img_close=this.root_dir+"w_close.gif";
+this.show_close_img=true;
+AJS.update(this,_55);
+this.addCallback(this.callback_fn);
+},initHook:function(){
+AJS.addClass(this.g_window,"GB_Window");
+this.header=AJS.TABLE({"class":"header"});
+this.header.style.backgroundImage="url("+this.img_header+")";
+var _56=AJS.TD({"class":"caption"},this.caption);
+var _57=AJS.TD({"class":"close"});
+if(this.show_close_img){
+var _58=AJS.IMG({"src":this.img_close});
+var _59=AJS.SPAN("Close");
+var btn=AJS.DIV(_58,_59);
+AJS.AEV([_58,_59],"mouseover",function(){
+AJS.addClass(_59,"on");
+});
+AJS.AEV([_58,_59],"mouseout",function(){
+AJS.removeClass(_59,"on");
+});
+AJS.AEV([_58,_59],"mousedown",function(){
+AJS.addClass(_59,"click");
+});
+AJS.AEV([_58,_59],"mouseup",function(){
+AJS.removeClass(_59,"click");
+});
+AJS.AEV([_58,_59],"click",GB_hide);
+AJS.ACN(_57,btn);
+}
+tbody_header=AJS.TBODY();
+AJS.ACN(tbody_header,AJS.TR(_56,_57));
+AJS.ACN(this.header,tbody_header);
+AJS.ACN(this.top_cnt,this.header);
+if(this.fullscreen){
+AJS.AEV(window,"scroll",AJS.$b(this.setWindowPosition,this));
+}
+},setFrameSize:function(){
+if(this.fullscreen){
+var _5b=AJS.getWindowSize();
+overlay_h=_5b.h;
+this.width=Math.round(this.overlay.offsetWidth-(this.overlay.offsetWidth/100)*10);
+this.height=Math.round(overlay_h-(overlay_h/100)*10);
+}
+AJS.setWidth(this.header,this.width+6);
+AJS.setWidth(this.iframe,this.width);
+AJS.setHeight(this.iframe,this.height);
+},setWindowPosition:function(){
+var _5c=AJS.getWindowSize();
+AJS.setLeft(this.g_window,((_5c.w-this.width)/2)-13);
+if(!this.center_win){
+AJS.setTop(this.g_window,AJS.getScrollTop());
+}else{
+var fl=((_5c.h-this.height)/2)-20+AJS.getScrollTop();
+if(fl<0){
+fl=0;
+}
+AJS.setTop(this.g_window,fl);
+}
+}});
+AJS.preloadImages(GB_ROOT_DIR+"w_close.gif",GB_ROOT_DIR+"header_bg.gif");
+
+
+script_loaded=true;
\ No newline at end of file
--- /dev/null
+/* Last-Modified: 28/06/06 00:08:22 */
+#GB_overlay {
+ background-color: #000;
+ position: absolute;
+ margin: auto;
+ top: 0;
+ left: 0;
+ z-index: 100;
+}
+
+#GB_window {
+ left: 0;
+ top: 0;
+ font-size: 1px;
+ position: absolute;
+ overflow: visible;
+ z-index: 150;
+}
+
+#GB_window .content {
+ width: auto;
+ margin: 0;
+ padding: 0;
+}
+
+#GB_frame {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ overflow: auto;
+ white-space: nowrap;
+}
+
+
+.GB_Gallery {
+ margin: 0 22px 0 22px;
+}
+
+.GB_Gallery .content {
+ background-color: #fff;
+ border: 3px solid #ddd;
+}
+
+.GB_header {
+ top: 10px;
+ left: 0;
+ margin: 0;
+ z-index: 500;
+ position: absolute;
+ border-bottom: 2px solid #555;
+ border-top: 2px solid #555;
+}
+
+.GB_header .inner {
+ background-color: #333;
+ font-family: Arial, Verdana, sans-serif;
+ padding: 2px 20px 2px 20px;
+}
+
+.GB_header table {
+ margin: 0;
+ width: 100%;
+ border-collapse: separate;
+ border-right: 0px;
+ border-top: 0px;
+}
+
+.GB_header td {
+ background-color: #333333;
+ border-bottom: 0px;
+ border-left: 0px;
+ padding: 0em 0em;
+}
+
+.GB_header .caption {
+ text-align: left;
+ color: #eee;
+ white-space: nowrap;
+ font-size: 20px;
+ border-collapse: separate;
+}
+
+.GB_header .close {
+ text-align: right;
+}
+
+.GB_header .close img {
+ z-index: 500;
+ cursor: pointer;
+}
+
+.GB_header .middle {
+ white-space: nowrap;
+ text-align: center;
+}
+
+
+#GB_middle {
+ color: #eee;
+}
+
+#GB_middle img {
+ cursor: pointer;
+ vertical-align: middle;
+}
+
+#GB_middle .disabled {
+ cursor: default;
+}
+
+#GB_middle .left {
+ padding-right: 10px;
+}
+
+#GB_middle .right {
+ padding-left: 10px;
+}
+
+
+.GB_Window .content {
+ background-color: #fff;
+ border: 3px solid #ccc;
+ border-top: none;
+}
+
+.GB_Window .header {
+ border-bottom: 1px solid #aaa;
+ border-top: 1px solid #999;
+ border-left: 3px solid #ccc;
+ border-right: 3px solid #ccc;
+ margin: 0;
+
+ height: 22px;
+ font-size: 12px;
+ padding: 3px 0;
+ color: #333;
+}
+
+.GB_Window .caption {
+ font-size: 12px;
+ text-align: left;
+ font-weight: bold;
+ white-space: nowrap;
+ padding-right: 20px;
+}
+
+.GB_Window .close { text-align: right; }
+.GB_Window .close span {
+ font-size: 12px;
+ cursor: pointer;
+}
+.GB_Window .close img {
+ cursor: pointer;
+ padding: 0 3px 0 0;
+}
+
+.GB_Window .on { border-bottom: 1px solid #333; }
+.GB_Window .click { border-bottom: 1px solid red; }
--- /dev/null
+<!--
+Notice: I feel so dirty doing this, but its the only way to make it cross browser.
+-->
+<html>
+<head>
+ <script>
+ var GB = parent.GB_CURRENT;
+ document.write('<script type="text/javascript" src="AJS.js"><\/script>');
+ if(GB.use_fx) {
+ document.write('<script type="text/javascript" src="AJS_fx.js"><\/script>');
+ }
+ </script>
+ <style>
+ body {
+ padding: 0;
+ margin: 0;
+ overflow: hidden;
+ }
+
+ #GB_frame {
+ visibility: hidden;
+ width: 100%;
+ height: 100%;
+ }
+
+ #loading {
+ padding-top: 50px;
+ position: absolute;
+ width: 100%;
+ top: 0;
+ text-align: center;
+ vertical-align: middle;
+ }
+ </style>
+</head>
+<body>
+
+<div id="loading">
+ <img src="indicator.gif">
+</div>
+
+<script>
+var loading = AJS.$('loading');
+var gb_type = GB.type;
+var gb_url = GB.url;
+
+//Start loading in the iframe
+if(gb_type == "page") {
+ document.write('<iframe id="GB_frame" src="' + gb_url + '" frameborder="0"></iframe>');
+}
+else {
+ var img_holder = new Image();
+ img_holder.src = gb_url;
+ document.write('<img id="GB_frame" src="' + gb_url + '">');
+}
+var frame = AJS.$('GB_frame');
+</script>
+
+</body>
+<script>
+function setupOuterGB() {
+ frame.style.visibility = 'visible';
+ GB.setFrameSize();
+ GB.setWindowPosition();
+}
+
+function loaded() {
+ AJS.removeElement(loading);
+
+ GB.overlay.innerHTML += " "; //Safari bugfix
+
+ if(gb_type == "image") {
+ if(img_holder.width != 0 && img_holder.height != 0) {
+ var width = img_holder.width;
+ var height = img_holder.height;
+
+ GB.width = width;
+ GB.height = height;
+
+ setupOuterGB();
+
+ if(GB.use_fx) {
+ AJS.setOpacity(frame, 0);
+ AJS.fx.fadeIn(frame);
+ }
+ }
+ }
+ else {
+ GB.width = frame.offsetWidth;
+ GB.height = frame.offsetHeight;
+ setupOuterGB();
+ }
+}
+
+if(GB.show_loading) {
+ AJS.AEV(window, 'load', function(e) {
+ loaded();
+ });
+}
+else {
+ loaded();
+}
+</script>
+</html>
--- /dev/null
+/*!
+ * jQuery UI CSS Framework 1.8.20
+ *
+ * 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/Theming/API
+ */
+
+/* Layout helpers
+----------------------------------*/
+.ui-helper-hidden { display: none; }
+.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
+.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
+.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; }
+.ui-helper-clearfix:after { clear: both; }
+.ui-helper-clearfix { zoom: 1; }
+.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
+
+
+/* Interaction Cues
+----------------------------------*/
+.ui-state-disabled { cursor: default !important; }
+
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Overlays */
+.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
+
+
+/*!
+ * jQuery UI CSS Framework 1.8.20
+ *
+ * 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/Theming/API
+ *
+ * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px
+ */
+
+
+/* Component containers
+----------------------------------*/
+.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 a { color: #222222; }
+.ui-widget-header { border: 1px solid #B9D8D9; background: #E6F0F2 none; 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 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 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 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 #fcefa1; background: #fbf9ee; 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 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; }
+.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
+.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
+
+/* Icons
+----------------------------------*/
+
+/* states and images */
+.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); }
+.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); }
+.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); }
+.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
+.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
+
+/* positioning */
+.ui-icon-carat-1-n { background-position: 0 0; }
+.ui-icon-carat-1-ne { background-position: -16px 0; }
+.ui-icon-carat-1-e { background-position: -32px 0; }
+.ui-icon-carat-1-se { background-position: -48px 0; }
+.ui-icon-carat-1-s { background-position: -64px 0; }
+.ui-icon-carat-1-sw { background-position: -80px 0; }
+.ui-icon-carat-1-w { background-position: -96px 0; }
+.ui-icon-carat-1-nw { background-position: -112px 0; }
+.ui-icon-carat-2-n-s { background-position: -128px 0; }
+.ui-icon-carat-2-e-w { background-position: -144px 0; }
+.ui-icon-triangle-1-n { background-position: 0 -16px; }
+.ui-icon-triangle-1-ne { background-position: -16px -16px; }
+.ui-icon-triangle-1-e { background-position: -32px -16px; }
+.ui-icon-triangle-1-se { background-position: -48px -16px; }
+.ui-icon-triangle-1-s { background-position: -64px -16px; }
+.ui-icon-triangle-1-sw { background-position: -80px -16px; }
+.ui-icon-triangle-1-w { background-position: -96px -16px; }
+.ui-icon-triangle-1-nw { background-position: -112px -16px; }
+.ui-icon-triangle-2-n-s { background-position: -128px -16px; }
+.ui-icon-triangle-2-e-w { background-position: -144px -16px; }
+.ui-icon-arrow-1-n { background-position: 0 -32px; }
+.ui-icon-arrow-1-ne { background-position: -16px -32px; }
+.ui-icon-arrow-1-e { background-position: -32px -32px; }
+.ui-icon-arrow-1-se { background-position: -48px -32px; }
+.ui-icon-arrow-1-s { background-position: -64px -32px; }
+.ui-icon-arrow-1-sw { background-position: -80px -32px; }
+.ui-icon-arrow-1-w { background-position: -96px -32px; }
+.ui-icon-arrow-1-nw { background-position: -112px -32px; }
+.ui-icon-arrow-2-n-s { background-position: -128px -32px; }
+.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
+.ui-icon-arrow-2-e-w { background-position: -160px -32px; }
+.ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
+.ui-icon-arrowstop-1-n { background-position: -192px -32px; }
+.ui-icon-arrowstop-1-e { background-position: -208px -32px; }
+.ui-icon-arrowstop-1-s { background-position: -224px -32px; }
+.ui-icon-arrowstop-1-w { background-position: -240px -32px; }
+.ui-icon-arrowthick-1-n { background-position: 0 -48px; }
+.ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
+.ui-icon-arrowthick-1-e { background-position: -32px -48px; }
+.ui-icon-arrowthick-1-se { background-position: -48px -48px; }
+.ui-icon-arrowthick-1-s { background-position: -64px -48px; }
+.ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
+.ui-icon-arrowthick-1-w { background-position: -96px -48px; }
+.ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
+.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
+.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
+.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
+.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
+.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
+.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
+.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
+.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
+.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
+.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
+.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
+.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
+.ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
+.ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
+.ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
+.ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
+.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
+.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
+.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
+.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
+.ui-icon-arrow-4 { background-position: 0 -80px; }
+.ui-icon-arrow-4-diag { background-position: -16px -80px; }
+.ui-icon-extlink { background-position: -32px -80px; }
+.ui-icon-newwin { background-position: -48px -80px; }
+.ui-icon-refresh { background-position: -64px -80px; }
+.ui-icon-shuffle { background-position: -80px -80px; }
+.ui-icon-transfer-e-w { background-position: -96px -80px; }
+.ui-icon-transferthick-e-w { background-position: -112px -80px; }
+.ui-icon-folder-collapsed { background-position: 0 -96px; }
+.ui-icon-folder-open { background-position: -16px -96px; }
+.ui-icon-document { background-position: -32px -96px; }
+.ui-icon-document-b { background-position: -48px -96px; }
+.ui-icon-note { background-position: -64px -96px; }
+.ui-icon-mail-closed { background-position: -80px -96px; }
+.ui-icon-mail-open { background-position: -96px -96px; }
+.ui-icon-suitcase { background-position: -112px -96px; }
+.ui-icon-comment { background-position: -128px -96px; }
+.ui-icon-person { background-position: -144px -96px; }
+.ui-icon-print { background-position: -160px -96px; }
+.ui-icon-trash { background-position: -176px -96px; }
+.ui-icon-locked { background-position: -192px -96px; }
+.ui-icon-unlocked { background-position: -208px -96px; }
+.ui-icon-bookmark { background-position: -224px -96px; }
+.ui-icon-tag { background-position: -240px -96px; }
+.ui-icon-home { background-position: 0 -112px; }
+.ui-icon-flag { background-position: -16px -112px; }
+.ui-icon-calendar { background-position: -32px -112px; }
+.ui-icon-cart { background-position: -48px -112px; }
+.ui-icon-pencil { background-position: -64px -112px; }
+.ui-icon-clock { background-position: -80px -112px; }
+.ui-icon-disk { background-position: -96px -112px; }
+.ui-icon-calculator { background-position: -112px -112px; }
+.ui-icon-zoomin { background-position: -128px -112px; }
+.ui-icon-zoomout { background-position: -144px -112px; }
+.ui-icon-search { background-position: -160px -112px; }
+.ui-icon-wrench { background-position: -176px -112px; }
+.ui-icon-gear { background-position: -192px -112px; }
+.ui-icon-heart { background-position: -208px -112px; }
+.ui-icon-star { background-position: -224px -112px; }
+.ui-icon-link { background-position: -240px -112px; }
+.ui-icon-cancel { background-position: 0 -128px; }
+.ui-icon-plus { background-position: -16px -128px; }
+.ui-icon-plusthick { background-position: -32px -128px; }
+.ui-icon-minus { background-position: -48px -128px; }
+.ui-icon-minusthick { background-position: -64px -128px; }
+.ui-icon-close { background-position: -80px -128px; }
+.ui-icon-closethick { background-position: -96px -128px; }
+.ui-icon-key { background-position: -112px -128px; }
+.ui-icon-lightbulb { background-position: -128px -128px; }
+.ui-icon-scissors { background-position: -144px -128px; }
+.ui-icon-clipboard { background-position: -160px -128px; }
+.ui-icon-copy { background-position: -176px -128px; }
+.ui-icon-contact { background-position: -192px -128px; }
+.ui-icon-image { background-position: -208px -128px; }
+.ui-icon-video { background-position: -224px -128px; }
+.ui-icon-script { background-position: -240px -128px; }
+.ui-icon-alert { background-position: 0 -144px; }
+.ui-icon-info { background-position: -16px -144px; }
+.ui-icon-notice { background-position: -32px -144px; }
+.ui-icon-help { background-position: -48px -144px; }
+.ui-icon-check { background-position: -64px -144px; }
+.ui-icon-bullet { background-position: -80px -144px; }
+.ui-icon-radio-off { background-position: -96px -144px; }
+.ui-icon-radio-on { background-position: -112px -144px; }
+.ui-icon-pin-w { background-position: -128px -144px; }
+.ui-icon-pin-s { background-position: -144px -144px; }
+.ui-icon-play { background-position: 0 -160px; }
+.ui-icon-pause { background-position: -16px -160px; }
+.ui-icon-seek-next { background-position: -32px -160px; }
+.ui-icon-seek-prev { background-position: -48px -160px; }
+.ui-icon-seek-end { background-position: -64px -160px; }
+.ui-icon-seek-start { background-position: -80px -160px; }
+/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */
+.ui-icon-seek-first { background-position: -80px -160px; }
+.ui-icon-stop { background-position: -96px -160px; }
+.ui-icon-eject { background-position: -112px -160px; }
+.ui-icon-volume-off { background-position: -128px -160px; }
+.ui-icon-volume-on { background-position: -144px -160px; }
+.ui-icon-power { background-position: 0 -176px; }
+.ui-icon-signal-diag { background-position: -16px -176px; }
+.ui-icon-signal { background-position: -32px -176px; }
+.ui-icon-battery-0 { background-position: -48px -176px; }
+.ui-icon-battery-1 { background-position: -64px -176px; }
+.ui-icon-battery-2 { background-position: -80px -176px; }
+.ui-icon-battery-3 { background-position: -96px -176px; }
+.ui-icon-circle-plus { background-position: 0 -192px; }
+.ui-icon-circle-minus { background-position: -16px -192px; }
+.ui-icon-circle-close { background-position: -32px -192px; }
+.ui-icon-circle-triangle-e { background-position: -48px -192px; }
+.ui-icon-circle-triangle-s { background-position: -64px -192px; }
+.ui-icon-circle-triangle-w { background-position: -80px -192px; }
+.ui-icon-circle-triangle-n { background-position: -96px -192px; }
+.ui-icon-circle-arrow-e { background-position: -112px -192px; }
+.ui-icon-circle-arrow-s { background-position: -128px -192px; }
+.ui-icon-circle-arrow-w { background-position: -144px -192px; }
+.ui-icon-circle-arrow-n { background-position: -160px -192px; }
+.ui-icon-circle-zoomin { background-position: -176px -192px; }
+.ui-icon-circle-zoomout { background-position: -192px -192px; }
+.ui-icon-circle-check { background-position: -208px -192px; }
+.ui-icon-circlesmall-plus { background-position: 0 -208px; }
+.ui-icon-circlesmall-minus { background-position: -16px -208px; }
+.ui-icon-circlesmall-close { background-position: -32px -208px; }
+.ui-icon-squaresmall-plus { background-position: -48px -208px; }
+.ui-icon-squaresmall-minus { background-position: -64px -208px; }
+.ui-icon-squaresmall-close { background-position: -80px -208px; }
+.ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
+.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
+.ui-icon-grip-solid-vertical { background-position: -32px -224px; }
+.ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
+.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
+.ui-icon-grip-diagonal-se { background-position: -80px -224px; }
+
+
+/* Misc visuals
+----------------------------------*/
+
+/* Corner radius */
+.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
+.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
+.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
+
+/* 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
+ *
+ * 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/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;
+}
+
+/* workarounds */
+* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
+
+/*
+ * jQuery UI Menu 1.8.20
+ *
+ * Copyright 2010, 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/Menu#theming
+ */
+.ui-menu {
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
+}
+.ui-menu li {
+ list-style:none;
+}
+.ui-menu .ui-menu {
+ margin-top: -3px;
+}
+.ui-menu .ui-menu-item {
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
+}
+.ui-menu .ui-menu-item a {
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
+}
+.ui-menu .ui-menu-item a.ui-state-hover,
+.ui-menu .ui-menu-item a.ui-state-active {
+ font-weight: normal;
+ margin: -1px;
+}
+/*!
+ * jQuery UI Tabs 1.8.20
+ *
+ * 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/Tabs#theming
+ */
+.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */
+.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; }
+.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; }
+.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; }
+.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; }
+.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
+.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
+ *
+ * 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/Datepicker#theming
+ */
+.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
+.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
+.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
+.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
+.ui-datepicker .ui-datepicker-prev { left:2px; }
+.ui-datepicker .ui-datepicker-next { right:2px; }
+.ui-datepicker .ui-datepicker-prev-hover { left:1px; }
+.ui-datepicker .ui-datepicker-next-hover { right:1px; }
+.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
+.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
+.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
+.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 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; }
+.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
+.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
+
+/* with multiple calendars */
+.ui-datepicker.ui-datepicker-multi { width:auto; }
+.ui-datepicker-multi .ui-datepicker-group { float:left; }
+.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
+.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
+.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
+.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
+.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
+.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
+.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
+
+/* RTL support */
+.ui-datepicker-rtl { direction: rtl; }
+.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
+.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
+.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group { float:right; }
+.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
+
+/* 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*/
+ top: -4px; /*must have*/
+ left: -4px; /*must have*/
+ width: 200px; /*must have*/
+ height: 200px; /*must have*/
+}
\ No newline at end of file
--- /dev/null
+/*! jQuery UI - v1.8.21 - 2012-06-05
+* 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
+* 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
+* 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
+* 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
+* 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
+* 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…</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
+* 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?" ":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?" ":""));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?" ":"")+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
--- /dev/null
+/*! jQuery v1.7.2 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
+a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
+.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
\ No newline at end of file
--- /dev/null
+/*
+ *
+ * Copyright (c) 2006-2008 Sam Collett (http://www.texotela.co.uk)
+ * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
+ * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
+ *
+ * Version 2.1
+ * Demo: http://www.texotela.co.uk/code/jquery/checkboxes/
+ *
+ * $LastChangedDate$
+ * $Rev$
+ */
+;(function(d){d.fn.toggleCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=!this.checked}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.checkCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=true}).filter(":checked");c=e});if(!b){c=this}return c};d.fn.unCheckCheckboxes=function(a,b){a=a||"*";b=b||false;var c=d([]);this.each(function(){var e=d("input[type=checkbox]",this).filter(a).each(function(){this.checked=false}).filter(":not(:checked)");c=e});if(!b){c=this}return c};d.radioCheckboxGroup=function(e,a){a=a||"*";var b="input[type=checkbox]";if(e){b+="[name="+e+"]"}var c=d(b).filter(a);c.click(function(){c.not(this).each(function(){this.checked=false}).end()})}})(jQuery);
\ No newline at end of file
--- /dev/null
+/*
+ * File: jquery.dataTables.min.js
+ * Version: 1.8.1
+ * Author: Allan Jardine (www.sprymedia.co.uk)
+ * Info: www.datatables.net
+ *
+ * Copyright 2008-2010 Allan Jardine, all rights reserved.
+ *
+ * This source file is free software, under either the GPL v2 license or a
+ * BSD style license, available at:
+ * http://datatables.net/license_gpl2
+ * http://datatables.net/license_bsd
+ *
+ * This source file 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 license files for details.
+ */
+(function(i,wa,p){i.fn.dataTableSettings=[];var D=i.fn.dataTableSettings;i.fn.dataTableExt={};var o=i.fn.dataTableExt;o.sVersion="1.8.1";o.sErrMode="alert";o.iApiIndex=0;o.oApi={};o.afnFiltering=[];o.aoFeatures=[];o.ofnSearch={};o.afnSortData=[];o.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active",
+sPageButtonStaticDisabled:"paginate_button paginate_button_disabled",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled",
+sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sSortIcon:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};o.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",
+sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled",sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",
+sPageFirst:"first ui-corner-tl ui-corner-bl",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",
+sSortableAsc:"ui-state-default",sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sSortIcon:"DataTables_sort_icon",sScrollWrapper:"dataTables_scroll",
+sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};o.oPagination={two_button:{fnInit:function(g,l,r){var s,w,y;if(g.bJUI){s=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev;
+s.appendChild(y)}else{s=p.createElement("div");w=p.createElement("div")}s.className=g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;s.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;l.appendChild(s);l.appendChild(w);i(s).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&r(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&r(g)});i(s).bind("selectstart.DT",function(){return false});i(w).bind("selectstart.DT",function(){return false});
+if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");s.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p)for(var l=g.aanFeatures.p,r=0,s=l.length;r<s;r++)if(l[r].childNodes.length!==0){l[r].childNodes[0].className=g._iDisplayStart===0?g.oClasses.sPagePrevDisabled:g.oClasses.sPagePrevEnabled;l[r].childNodes[1].className=g.fnDisplayEnd()==g.fnRecordsDisplay()?g.oClasses.sPageNextDisabled:
+g.oClasses.sPageNextEnabled}}},iFullNumbersShowPages:5,full_numbers:{fnInit:function(g,l,r){var s=p.createElement("span"),w=p.createElement("span"),y=p.createElement("span"),G=p.createElement("span"),x=p.createElement("span");s.innerHTML=g.oLanguage.oPaginate.sFirst;w.innerHTML=g.oLanguage.oPaginate.sPrevious;G.innerHTML=g.oLanguage.oPaginate.sNext;x.innerHTML=g.oLanguage.oPaginate.sLast;var v=g.oClasses;s.className=v.sPageButton+" "+v.sPageFirst;w.className=v.sPageButton+" "+v.sPagePrevious;G.className=
+v.sPageButton+" "+v.sPageNext;x.className=v.sPageButton+" "+v.sPageLast;l.appendChild(s);l.appendChild(w);l.appendChild(y);l.appendChild(G);l.appendChild(x);i(s).bind("click.DT",function(){g.oApi._fnPageChange(g,"first")&&r(g)});i(w).bind("click.DT",function(){g.oApi._fnPageChange(g,"previous")&&r(g)});i(G).bind("click.DT",function(){g.oApi._fnPageChange(g,"next")&&r(g)});i(x).bind("click.DT",function(){g.oApi._fnPageChange(g,"last")&&r(g)});i("span",l).bind("mousedown.DT",function(){return false}).bind("selectstart.DT",
+function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){l.setAttribute("id",g.sTableId+"_paginate");s.setAttribute("id",g.sTableId+"_first");w.setAttribute("id",g.sTableId+"_previous");G.setAttribute("id",g.sTableId+"_next");x.setAttribute("id",g.sTableId+"_last")}},fnUpdate:function(g,l){if(g.aanFeatures.p){var r=o.oPagination.iFullNumbersShowPages,s=Math.floor(r/2),w=Math.ceil(g.fnRecordsDisplay()/g._iDisplayLength),y=Math.ceil(g._iDisplayStart/g._iDisplayLength)+1,G=
+"",x,v=g.oClasses;if(w<r){s=1;x=w}else if(y<=s){s=1;x=r}else if(y>=w-s){s=w-r+1;x=w}else{s=y-Math.ceil(r/2)+1;x=s+r-1}for(r=s;r<=x;r++)G+=y!=r?'<span class="'+v.sPageButton+'">'+r+"</span>":'<span class="'+v.sPageButtonActive+'">'+r+"</span>";x=g.aanFeatures.p;var z,Y=function(L){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;l(g);L.preventDefault()},V=function(){return false};r=0;for(s=x.length;r<s;r++)if(x[r].childNodes.length!==0){z=i("span:eq(2)",x[r]);z.html(G);i("span",z).bind("click.DT",
+Y).bind("mousedown.DT",V).bind("selectstart.DT",V);z=x[r].getElementsByTagName("span");z=[z[0],z[1],z[z.length-2],z[z.length-1]];i(z).removeClass(v.sPageButton+" "+v.sPageButtonActive+" "+v.sPageButtonStaticDisabled);if(y==1){z[0].className+=" "+v.sPageButtonStaticDisabled;z[1].className+=" "+v.sPageButtonStaticDisabled}else{z[0].className+=" "+v.sPageButton;z[1].className+=" "+v.sPageButton}if(w===0||y==w||g._iDisplayLength==-1){z[2].className+=" "+v.sPageButtonStaticDisabled;z[3].className+=" "+
+v.sPageButtonStaticDisabled}else{z[2].className+=" "+v.sPageButton;z[3].className+=" "+v.sPageButton}}}}}};o.oSort={"string-asc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?-1:g>l?1:0},"string-desc":function(g,l){if(typeof g!="string")g="";if(typeof l!="string")l="";g=g.toLowerCase();l=l.toLowerCase();return g<l?1:g>l?-1:0},"html-asc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<
+l?-1:g>l?1:0},"html-desc":function(g,l){g=g.replace(/<.*?>/g,"").toLowerCase();l=l.replace(/<.*?>/g,"").toLowerCase();return g<l?1:g>l?-1:0},"date-asc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return g-l},"date-desc":function(g,l){g=Date.parse(g);l=Date.parse(l);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(l)||l==="")l=Date.parse("01/01/1970 00:00:00");return l-
+g},"numeric-asc":function(g,l){return(g=="-"||g===""?0:g*1)-(l=="-"||l===""?0:l*1)},"numeric-desc":function(g,l){return(l=="-"||l===""?0:l*1)-(g=="-"||g===""?0:g*1)}};o.aTypes=[function(g){if(typeof g=="number")return"numeric";else if(typeof g!="string")return null;var l,r=false;l=g.charAt(0);if("0123456789-".indexOf(l)==-1)return null;for(var s=1;s<g.length;s++){l=g.charAt(s);if("0123456789.".indexOf(l)==-1)return null;if(l=="."){if(r)return null;r=true}}return"numeric"},function(g){var l=Date.parse(g);
+if(l!==null&&!isNaN(l)||typeof g=="string"&&g.length===0)return"date";return null},function(g){if(typeof g=="string"&&g.indexOf("<")!=-1&&g.indexOf(">")!=-1)return"html";return null}];o.fnVersionCheck=function(g){var l=function(x,v){for(;x.length<v;)x+="0";return x},r=o.sVersion.split(".");g=g.split(".");for(var s="",w="",y=0,G=g.length;y<G;y++){s+=l(r[y],3);w+=l(g[y],3)}return parseInt(s,10)>=parseInt(w,10)};o._oExternConfig={iNextUnique:0};i.fn.dataTable=function(g){function l(){this.fnRecordsTotal=
+function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1?this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance=
+this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false,bDeferRender:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...",sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table",
+sLoadingRecords:"Loading...",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.aoHeader=[];this.aoFooter=[];this.iNextId=0;this.asDataSearch=[];this.oPreviousSearch={sSearch:"",bRegex:false,
+bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.asDestoryStrips=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=this.fnPreDrawCallback=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=this.bDeferLoading=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button";
+this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.sAjaxDataProp="aaData";this.bAjaxDataGet=true;this.jqXHR=null;this.fnServerData=function(a,b,c,d){d.jqXHR=i.ajax({url:a,data:b,success:c,dataType:"json",cache:false,error:function(f,e){e=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})};
+this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b=a+"";a=b.split("");var c="";b=b.length;for(var d=0;d<b;d++){if(d%3===0&&d!==0)c=","+c;c=a[b-d-1]+c}}return c};this.aLengthMenu=[10,25,50,100];this.bDrawing=this.iDraw=0;this.iDrawError=-1;this._iDisplayLength=10;this._iDisplayStart=0;this._iDisplayEnd=10;this._iRecordsDisplay=this._iRecordsTotal=0;this.bJUI=false;this.oClasses=o.oStdClasses;this.bSortCellsTop=this.bSorted=this.bFiltered=false;this.oInit=null}function r(a){return function(){var b=
+[A(this[o.iApiIndex])].concat(Array.prototype.slice.call(arguments));return o.oApi[a].apply(this,b)}}function s(a){var b,c,d=a.iInitDisplayStart;if(a.bInitialised===false)setTimeout(function(){s(a)},200);else{xa(a);V(a);L(a,a.aoHeader);a.nTFoot&&L(a,a.aoFooter);K(a,true);a.oFeatures.bAutoWidth&&ea(a);b=0;for(c=a.aoColumns.length;b<c;b++)if(a.aoColumns[b].sWidth!==null)a.aoColumns[b].nTh.style.width=u(a.aoColumns[b].sWidth);if(a.oFeatures.bSort)R(a);else if(a.oFeatures.bFilter)M(a,a.oPreviousSearch);
+else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}if(a.sAjaxSource!==null&&!a.oFeatures.bServerSide)a.fnServerData.call(a.oInstance,a.sAjaxSource,[],function(f){var e=f;if(a.sAjaxDataProp!=="")e=Z(a.sAjaxDataProp)(f);for(b=0;b<e.length;b++)v(a,e[b]);a.iInitDisplayStart=d;if(a.oFeatures.bSort)R(a);else{a.aiDisplay=a.aiDisplayMaster.slice();E(a);C(a)}K(a,false);w(a,f)},a);else if(!a.oFeatures.bServerSide){K(a,false);w(a)}}}function w(a,b){a._bInitComplete=true;if(typeof a.fnInitComplete=="function")typeof b!=
+"undefined"?a.fnInitComplete.call(a.oInstance,a,b):a.fnInitComplete.call(a.oInstance,a)}function y(a,b,c){n(a.oLanguage,b,"sProcessing");n(a.oLanguage,b,"sLengthMenu");n(a.oLanguage,b,"sEmptyTable");n(a.oLanguage,b,"sLoadingRecords");n(a.oLanguage,b,"sZeroRecords");n(a.oLanguage,b,"sInfo");n(a.oLanguage,b,"sInfoEmpty");n(a.oLanguage,b,"sInfoFiltered");n(a.oLanguage,b,"sInfoPostFix");n(a.oLanguage,b,"sSearch");if(typeof b.oPaginate!="undefined"){n(a.oLanguage.oPaginate,b.oPaginate,"sFirst");n(a.oLanguage.oPaginate,
+b.oPaginate,"sPrevious");n(a.oLanguage.oPaginate,b.oPaginate,"sNext");n(a.oLanguage.oPaginate,b.oPaginate,"sLast")}typeof b.sEmptyTable=="undefined"&&typeof b.sZeroRecords!="undefined"&&n(a.oLanguage,b,"sZeroRecords","sEmptyTable");typeof b.sLoadingRecords=="undefined"&&typeof b.sZeroRecords!="undefined"&&n(a.oLanguage,b,"sZeroRecords","sLoadingRecords");c&&s(a)}function G(a,b){var c=a.aoColumns.length;b={sType:null,_bAutoType:true,bVisible:true,bSearchable:true,bSortable:true,asSorting:["asc","desc"],
+sSortingClass:a.oClasses.sSortable,sSortingClassJUI:a.oClasses.sSortJUI,sTitle:b?b.innerHTML:"",sName:"",sWidth:null,sWidthOrig:null,sClass:null,fnRender:null,bUseRendered:true,iDataSort:c,mDataProp:c,fnGetData:null,fnSetData:null,sSortDataType:"std",sDefaultContent:null,sContentPadding:"",nTh:b?b:p.createElement("th"),nTf:null};a.aoColumns.push(b);if(typeof a.aoPreSearchCols[c]=="undefined"||a.aoPreSearchCols[c]===null)a.aoPreSearchCols[c]={sSearch:"",bRegex:false,bSmart:true};else{if(typeof a.aoPreSearchCols[c].bRegex==
+"undefined")a.aoPreSearchCols[c].bRegex=true;if(typeof a.aoPreSearchCols[c].bSmart=="undefined")a.aoPreSearchCols[c].bSmart=true}x(a,c,null)}function x(a,b,c){b=a.aoColumns[b];if(typeof c!="undefined"&&c!==null){if(typeof c.sType!="undefined"){b.sType=c.sType;b._bAutoType=false}n(b,c,"bVisible");n(b,c,"bSearchable");n(b,c,"bSortable");n(b,c,"sTitle");n(b,c,"sName");n(b,c,"sWidth");n(b,c,"sWidth","sWidthOrig");n(b,c,"sClass");n(b,c,"fnRender");n(b,c,"bUseRendered");n(b,c,"iDataSort");n(b,c,"mDataProp");
+n(b,c,"asSorting");n(b,c,"sSortDataType");n(b,c,"sDefaultContent");n(b,c,"sContentPadding")}b.fnGetData=Z(b.mDataProp);b.fnSetData=ya(b.mDataProp);if(!a.oFeatures.bSort)b.bSortable=false;if(!b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableNone;b.sSortingClassJUI=""}else if(b.bSortable||i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortable;b.sSortingClassJUI=a.oClasses.sSortJUI}else if(i.inArray("asc",
+b.asSorting)!=-1&&i.inArray("desc",b.asSorting)==-1){b.sSortingClass=a.oClasses.sSortableAsc;b.sSortingClassJUI=a.oClasses.sSortJUIAscAllowed}else if(i.inArray("asc",b.asSorting)==-1&&i.inArray("desc",b.asSorting)!=-1){b.sSortingClass=a.oClasses.sSortableDesc;b.sSortingClassJUI=a.oClasses.sSortJUIDescAllowed}}function v(a,b){var c;c=typeof b.length=="number"?b.slice():i.extend(true,{},b);b=a.aoData.length;var d={nTr:null,_iId:a.iNextId++,_aData:c,_anHidden:[],_sRowStripe:""};a.aoData.push(d);for(var f,
+e=0,h=a.aoColumns.length;e<h;e++){c=a.aoColumns[e];typeof c.fnRender=="function"&&c.bUseRendered&&c.mDataProp!==null&&N(a,b,e,c.fnRender({iDataRow:b,iDataColumn:e,aData:d._aData,oSettings:a}));if(c._bAutoType&&c.sType!="string"){f=H(a,b,e,"type");if(f!==null&&f!==""){f=fa(f);if(c.sType===null)c.sType=f;else if(c.sType!=f)c.sType="string"}}}a.aiDisplayMaster.push(b);a.oFeatures.bDeferRender||z(a,b);return b}function z(a,b){var c=a.aoData[b],d;if(c.nTr===null){c.nTr=p.createElement("tr");typeof c._aData.DT_RowId!=
+"undefined"&&c.nTr.setAttribute("id",c._aData.DT_RowId);typeof c._aData.DT_RowClass!="undefined"&&i(c.nTr).addClass(c._aData.DT_RowClass);for(var f=0,e=a.aoColumns.length;f<e;f++){var h=a.aoColumns[f];d=p.createElement("td");d.innerHTML=typeof h.fnRender=="function"&&(!h.bUseRendered||h.mDataProp===null)?h.fnRender({iDataRow:b,iDataColumn:f,aData:c._aData,oSettings:a}):H(a,b,f,"display");if(h.sClass!==null)d.className=h.sClass;if(h.bVisible){c.nTr.appendChild(d);c._anHidden[f]=null}else c._anHidden[f]=
+d}}}function Y(a){var b,c,d,f,e,h,j,k,m;if(a.bDeferLoading||a.sAjaxSource===null){j=a.nTBody.childNodes;b=0;for(c=j.length;b<c;b++)if(j[b].nodeName.toUpperCase()=="TR"){k=a.aoData.length;a.aoData.push({nTr:j[b],_iId:a.iNextId++,_aData:[],_anHidden:[],_sRowStripe:""});a.aiDisplayMaster.push(k);h=j[b].childNodes;d=e=0;for(f=h.length;d<f;d++){m=h[d].nodeName.toUpperCase();if(m=="TD"||m=="TH"){N(a,k,e,i.trim(h[d].innerHTML));e++}}}}j=$(a);h=[];b=0;for(c=j.length;b<c;b++){d=0;for(f=j[b].childNodes.length;d<
+f;d++){e=j[b].childNodes[d];m=e.nodeName.toUpperCase();if(m=="TD"||m=="TH")h.push(e)}}h.length!=j.length*a.aoColumns.length&&J(a,1,"Unexpected number of TD elements. Expected "+j.length*a.aoColumns.length+" and got "+h.length+". DataTables does not support rowspan / colspan in the table body, and there must be one cell for each row/column combination.");d=0;for(f=a.aoColumns.length;d<f;d++){if(a.aoColumns[d].sTitle===null)a.aoColumns[d].sTitle=a.aoColumns[d].nTh.innerHTML;j=a.aoColumns[d]._bAutoType;
+m=typeof a.aoColumns[d].fnRender=="function";e=a.aoColumns[d].sClass!==null;k=a.aoColumns[d].bVisible;var t,q;if(j||m||e||!k){b=0;for(c=a.aoData.length;b<c;b++){t=h[b*f+d];if(j&&a.aoColumns[d].sType!="string"){q=H(a,b,d,"type");if(q!==""){q=fa(q);if(a.aoColumns[d].sType===null)a.aoColumns[d].sType=q;else if(a.aoColumns[d].sType!=q)a.aoColumns[d].sType="string"}}if(m){q=a.aoColumns[d].fnRender({iDataRow:b,iDataColumn:d,aData:a.aoData[b]._aData,oSettings:a});t.innerHTML=q;a.aoColumns[d].bUseRendered&&
+N(a,b,d,q)}if(e)t.className+=" "+a.aoColumns[d].sClass;if(k)a.aoData[b]._anHidden[d]=null;else{a.aoData[b]._anHidden[d]=t;t.parentNode.removeChild(t)}}}}}function V(a){var b,c,d;a.nTHead.getElementsByTagName("tr");if(a.nTHead.getElementsByTagName("th").length!==0){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);if(a.aoColumns[b].sTitle!=c.innerHTML)c.innerHTML=a.aoColumns[b].sTitle}}else{var f=p.createElement("tr");b=0;
+for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;c.innerHTML=a.aoColumns[b].sTitle;a.aoColumns[b].sClass!==null&&i(c).addClass(a.aoColumns[b].sClass);f.appendChild(c)}i(a.nTHead).html("")[0].appendChild(f);W(a.aoHeader,a.nTHead)}if(a.bJUI){b=0;for(d=a.aoColumns.length;b<d;b++){c=a.aoColumns[b].nTh;f=p.createElement("div");f.className=a.oClasses.sSortJUIWrapper;i(c).contents().appendTo(f);var e=p.createElement("span");e.className=a.oClasses.sSortIcon;f.appendChild(e);c.appendChild(f)}}d=function(){this.onselectstart=
+function(){return false};return false};if(a.oFeatures.bSort)for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable!==false){ga(a,a.aoColumns[b].nTh,b);i(a.aoColumns[b].nTh).bind("mousedown.DT",d)}else i(a.aoColumns[b].nTh).addClass(a.oClasses.sSortableNone);a.oClasses.sFooterTH!==""&&i(">tr>th",a.nTFoot).addClass(a.oClasses.sFooterTH);if(a.nTFoot!==null){c=S(a,null,a.aoFooter);b=0;for(d=a.aoColumns.length;b<d;b++)if(typeof c[b]!="undefined")a.aoColumns[b].nTf=c[b]}}function L(a,b,c){var d,f,
+e,h=[],j=[],k=a.aoColumns.length;if(typeof c=="undefined")c=false;d=0;for(f=b.length;d<f;d++){h[d]=b[d].slice();h[d].nTr=b[d].nTr;for(e=k-1;e>=0;e--)!a.aoColumns[e].bVisible&&!c&&h[d].splice(e,1);j.push([])}d=0;for(f=h.length;d<f;d++){if(h[d].nTr){a=0;for(e=h[d].nTr.childNodes.length;a<e;a++)h[d].nTr.removeChild(h[d].nTr.childNodes[0])}e=0;for(b=h[d].length;e<b;e++){k=c=1;if(typeof j[d][e]=="undefined"){h[d].nTr.appendChild(h[d][e].cell);for(j[d][e]=1;typeof h[d+c]!="undefined"&&h[d][e].cell==h[d+
+c][e].cell;){j[d+c][e]=1;c++}for(;typeof h[d][e+k]!="undefined"&&h[d][e].cell==h[d][e+k].cell;){for(a=0;a<c;a++)j[d+a][e+k]=1;k++}h[d][e].cell.setAttribute("rowspan",c);h[d][e].cell.setAttribute("colspan",k)}}}}function C(a){var b,c,d=[],f=0,e=false;b=a.asStripClasses.length;c=a.aoOpenRows.length;if(!(a.fnPreDrawCallback!==null&&a.fnPreDrawCallback.call(a.oInstance,a)===false)){a.bDrawing=true;if(typeof a.iInitDisplayStart!="undefined"&&a.iInitDisplayStart!=-1){a._iDisplayStart=a.oFeatures.bServerSide?
+a.iInitDisplayStart:a.iInitDisplayStart>=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(a.bDeferLoading){a.bDeferLoading=false;a.iDraw++}else if(a.oFeatures.bServerSide){if(!a.bDestroying&&!za(a))return}else a.iDraw++;if(a.aiDisplay.length!==0){var h=a._iDisplayStart,j=a._iDisplayEnd;if(a.oFeatures.bServerSide){h=0;j=a.aoData.length}for(h=h;h<j;h++){var k=a.aoData[a.aiDisplay[h]];k.nTr===null&&z(a,a.aiDisplay[h]);var m=k.nTr;if(b!==0){var t=a.asStripClasses[f%b];if(k._sRowStripe!=
+t){i(m).removeClass(k._sRowStripe).addClass(t);k._sRowStripe=t}}if(typeof a.fnRowCallback=="function"){m=a.fnRowCallback.call(a.oInstance,m,a.aoData[a.aiDisplay[h]]._aData,f,h);if(!m&&!e){J(a,0,"A node was not returned by fnRowCallback");e=true}}d.push(m);f++;if(c!==0)for(k=0;k<c;k++)m==a.aoOpenRows[k].nParent&&d.push(a.aoOpenRows[k].nTr)}}else{d[0]=p.createElement("tr");if(typeof a.asStripClasses[0]!="undefined")d[0].className=a.asStripClasses[0];e=a.oLanguage.sZeroRecords.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()));
+if(a.iDraw==1&&a.sAjaxSource!==null&&!a.oFeatures.bServerSide)e=a.oLanguage.sLoadingRecords;else if(typeof a.oLanguage.sEmptyTable!="undefined"&&a.fnRecordsTotal()===0)e=a.oLanguage.sEmptyTable;b=p.createElement("td");b.setAttribute("valign","top");b.colSpan=X(a);b.className=a.oClasses.sRowEmpty;b.innerHTML=e;d[f].appendChild(b)}typeof a.fnHeaderCallback=="function"&&a.fnHeaderCallback.call(a.oInstance,i(">tr",a.nTHead)[0],aa(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);typeof a.fnFooterCallback==
+"function"&&a.fnFooterCallback.call(a.oInstance,i(">tr",a.nTFoot)[0],aa(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=c.length-1;b>=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b<c;b++)f.appendChild(d[b]);a.nTBody.appendChild(f);e!==null&&e.appendChild(a.nTBody)}for(b=a.aoDrawCallback.length-
+1;b>=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function ba(a){if(a.oFeatures.bSort)R(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)M(a,a.oPreviousSearch);else{E(a);C(a)}}function za(a){if(a.bAjaxDataGet){K(a,true);var b=a.aoColumns.length,c=[],d,f;a.iDraw++;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns",value:ha(a)});
+c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:-1});for(f=0;f<b;f++){d=a.aoColumns[f].mDataProp;c.push({name:"mDataProp_"+f,value:typeof d=="function"?"function":d})}if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(f=0;f<b;f++){c.push({name:"sSearch_"+f,value:a.aoPreSearchCols[f].sSearch});c.push({name:"bRegex_"+
+f,value:a.aoPreSearchCols[f].bRegex});c.push({name:"bSearchable_"+f,value:a.aoColumns[f].bSearchable})}}if(a.oFeatures.bSort!==false){d=a.aaSortingFixed!==null?a.aaSortingFixed.length:0;var e=a.aaSorting.length;c.push({name:"iSortingCols",value:d+e});for(f=0;f<d;f++){c.push({name:"iSortCol_"+f,value:a.aaSortingFixed[f][0]});c.push({name:"sSortDir_"+f,value:a.aaSortingFixed[f][1]})}for(f=0;f<e;f++){c.push({name:"iSortCol_"+(f+d),value:a.aaSorting[f][0]});c.push({name:"sSortDir_"+(f+d),value:a.aaSorting[f][1]})}for(f=
+0;f<b;f++)c.push({name:"bSortable_"+f,value:a.aoColumns[f].bSortable})}a.fnServerData.call(a.oInstance,a.sAjaxSource,c,function(h){Aa(a,h)},a);return false}else return true}function Aa(a,b){if(typeof b.sEcho!="undefined")if(b.sEcho*1<a.iDraw)return;else a.iDraw=b.sEcho*1;if(!a.oScroll.bInfinite||a.oScroll.bInfinite&&(a.bSorted||a.bFiltered))ia(a);a._iRecordsTotal=b.iTotalRecords;a._iRecordsDisplay=b.iTotalDisplayRecords;var c=ha(a);if(c=typeof b.sColumns!="undefined"&&c!==""&&b.sColumns!=c)var d=
+Ba(a,b.sColumns);b=Z(a.sAjaxDataProp)(b);for(var f=0,e=b.length;f<e;f++)if(c){for(var h=[],j=0,k=a.aoColumns.length;j<k;j++)h.push(b[f][d[j]]);v(a,h)}else v(a,b[f]);a.aiDisplay=a.aiDisplayMaster.slice();a.bAjaxDataGet=false;C(a);a.bAjaxDataGet=true;K(a,false)}function xa(a){var b=p.createElement("div");a.nTable.parentNode.insertBefore(b,a.nTable);a.nTableWrapper=p.createElement("div");a.nTableWrapper.className=a.oClasses.sWrapper;a.sTableId!==""&&a.nTableWrapper.setAttribute("id",a.sTableId+"_wrapper");
+a.nTableReinsertBefore=a.nTable.nextSibling;for(var c=a.nTableWrapper,d=a.sDom.split(""),f,e,h,j,k,m,t,q=0;q<d.length;q++){e=0;h=d[q];if(h=="<"){j=p.createElement("div");k=d[q+1];if(k=="'"||k=='"'){m="";for(t=2;d[q+t]!=k;){m+=d[q+t];t++}if(m=="H")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-tl ui-corner-tr ui-helper-clearfix";else if(m=="F")m="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl ui-corner-br ui-helper-clearfix";if(m.indexOf(".")!=-1){k=m.split(".");j.setAttribute("id",k[0].substr(1,
+k[0].length-1));j.className=k[1]}else if(m.charAt(0)=="#")j.setAttribute("id",m.substr(1,m.length-1));else j.className=m;q+=t}c.appendChild(j);c=j}else if(h==">")c=c.parentNode;else if(h=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=Ca(a);e=1}else if(h=="f"&&a.oFeatures.bFilter){f=Da(a);e=1}else if(h=="r"&&a.oFeatures.bProcessing){f=Ea(a);e=1}else if(h=="t"){f=Fa(a);e=1}else if(h=="i"&&a.oFeatures.bInfo){f=Ga(a);e=1}else if(h=="p"&&a.oFeatures.bPaginate){f=Ha(a);e=1}else if(o.aoFeatures.length!==
+0){j=o.aoFeatures;t=0;for(k=j.length;t<k;t++)if(h==j[t].cFeature){if(f=j[t].fnInit(a))e=1;break}}if(e==1&&f!==null){if(typeof a.aanFeatures[h]!="object")a.aanFeatures[h]=[];a.aanFeatures[h].push(f);c.appendChild(f)}}b.parentNode.replaceChild(a.nTableWrapper,b)}function Fa(a){if(a.oScroll.sX===""&&a.oScroll.sY==="")return a.nTable;var b=p.createElement("div"),c=p.createElement("div"),d=p.createElement("div"),f=p.createElement("div"),e=p.createElement("div"),h=p.createElement("div"),j=a.nTable.cloneNode(false),
+k=a.nTable.cloneNode(false),m=a.nTable.getElementsByTagName("thead")[0],t=a.nTable.getElementsByTagName("tfoot").length===0?null:a.nTable.getElementsByTagName("tfoot")[0],q=typeof g.bJQueryUI!="undefined"&&g.bJQueryUI?o.oJUIClasses:o.oStdClasses;c.appendChild(d);e.appendChild(h);f.appendChild(a.nTable);b.appendChild(c);b.appendChild(f);d.appendChild(j);j.appendChild(m);if(t!==null){b.appendChild(e);h.appendChild(k);k.appendChild(t)}b.className=q.sScrollWrapper;c.className=q.sScrollHead;d.className=
+q.sScrollHeadInner;f.className=q.sScrollBody;e.className=q.sScrollFoot;h.className=q.sScrollFootInner;if(a.oScroll.bAutoCss){c.style.overflow="hidden";c.style.position="relative";e.style.overflow="hidden";f.style.overflow="auto"}c.style.border="0";c.style.width="100%";e.style.border="0";d.style.width="150%";j.removeAttribute("id");j.style.marginLeft="0";a.nTable.style.marginLeft="0";if(t!==null){k.removeAttribute("id");k.style.marginLeft="0"}d=i(">caption",a.nTable);h=0;for(k=d.length;h<k;h++)j.appendChild(d[h]);
+if(a.oScroll.sX!==""){c.style.width=u(a.oScroll.sX);f.style.width=u(a.oScroll.sX);if(t!==null)e.style.width=u(a.oScroll.sX);i(f).scroll(function(){c.scrollLeft=this.scrollLeft;if(t!==null)e.scrollLeft=this.scrollLeft})}if(a.oScroll.sY!=="")f.style.height=u(a.oScroll.sY);a.aoDrawCallback.push({fn:Ia,sName:"scrolling"});a.oScroll.bInfinite&&i(f).scroll(function(){if(!a.bDrawing)if(i(this).scrollTop()+i(this).height()>i(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()<a.fnRecordsDisplay()){ja(a,
+"next");E(a);C(a)}});a.nScrollHead=c;a.nScrollFoot=e;return b}function Ia(a){var b=a.nScrollHead.getElementsByTagName("div")[0],c=b.getElementsByTagName("table")[0],d=a.nTable.parentNode,f,e,h,j,k,m,t,q,I=[];h=a.nTable.getElementsByTagName("thead");h.length>0&&a.nTable.removeChild(h[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}h=a.nTHead.cloneNode(true);a.nTable.insertBefore(h,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true);
+a.nTable.insertBefore(k,a.nTable.childNodes[1])}if(a.oScroll.sX===""){d.style.width="100%";b.parentNode.style.width="100%"}var O=S(a,h);f=0;for(e=O.length;f<e;f++){t=Ja(a,f);O[f].style.width=a.aoColumns[t].sWidth}a.nTFoot!==null&&P(function(B){B.style.width=""},k.getElementsByTagName("tr"));f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){a.nTable.style.width="100%";if(i.browser.msie&&i.browser.version<=7)a.nTable.style.width=u(i(a.nTable).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sXInner!==
+"")a.nTable.style.width=u(a.oScroll.sXInner);else if(f==i(d).width()&&i(d).height()<i(a.nTable).height()){a.nTable.style.width=u(f-a.oScroll.iBarWidth);if(i(a.nTable).outerWidth()>f-a.oScroll.iBarWidth)a.nTable.style.width=u(f)}else a.nTable.style.width=u(f);f=i(a.nTable).outerWidth();if(a.oScroll.sX===""){d.style.width=u(f+a.oScroll.iBarWidth);b.parentNode.style.width=u(f+a.oScroll.iBarWidth)}e=a.nTHead.getElementsByTagName("tr");h=h.getElementsByTagName("tr");P(function(B,F){m=B.style;m.paddingTop=
+"0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;q=i(B).width();F.style.width=u(q);I.push(q)},h,e);i(h).height(0);if(a.nTFoot!==null){j=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");P(function(B,F){m=B.style;m.paddingTop="0";m.paddingBottom="0";m.borderTopWidth="0";m.borderBottomWidth="0";m.height=0;q=i(B).width();F.style.width=u(q);I.push(q)},j,k);i(j).height(0)}P(function(B){B.innerHTML="";B.style.width=u(I.shift())},h);a.nTFoot!==null&&P(function(B){B.innerHTML=
+"";B.style.width=u(I.shift())},j);if(i(a.nTable).outerWidth()<f)if(a.oScroll.sX==="")J(a,1,"The table cannot fit into the current element which will cause column misalignment. It is suggested that you enable x-scrolling or increase the width the table has in which to be drawn");else a.oScroll.sXInner!==""&&J(a,1,"The table cannot fit into the current element which will cause column misalignment. It is suggested that you increase the sScrollXInner property to allow it to draw in a larger area, or simply remove that parameter to allow automatic calculation");
+if(a.oScroll.sY==="")if(i.browser.msie&&i.browser.version<=7)d.style.height=u(a.nTable.offsetHeight+a.oScroll.iBarWidth);if(a.oScroll.sY!==""&&a.oScroll.bCollapse){d.style.height=u(a.oScroll.sY);j=a.oScroll.sX!==""&&a.nTable.offsetWidth>d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight<d.offsetHeight)d.style.height=u(i(a.nTable).height()+j)}j=i(a.nTable).outerWidth();c.style.width=u(j);b.style.width=u(j+a.oScroll.iBarWidth);if(a.nTFoot!==null){b=a.nScrollFoot.getElementsByTagName("div")[0];
+c=b.getElementsByTagName("table")[0];b.style.width=u(a.nTable.offsetWidth+a.oScroll.iBarWidth);c.style.width=u(a.nTable.offsetWidth)}if(a.bSorted||a.bFiltered)d.scrollTop=0}function ca(a){if(a.oFeatures.bAutoWidth===false)return false;ea(a);for(var b=0,c=a.aoColumns.length;b<c;b++)a.aoColumns[b].nTh.style.width=a.aoColumns[b].sWidth}function Da(a){var b=a.oLanguage.sSearch;b=b.indexOf("_INPUT_")!==-1?b.replace("_INPUT_",'<input type="text" />'):b===""?'<input type="text" />':b+' <input type="text" />';
+var c=p.createElement("div");c.className=a.oClasses.sFilter;c.innerHTML="<label>"+b+"</label>";a.sTableId!==""&&typeof a.aanFeatures.f=="undefined"&&c.setAttribute("id",a.sTableId+"_filter");b=i("input",c);b.val(a.oPreviousSearch.sSearch.replace('"',"""));b.bind("keyup.DT",function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f<e;f++)d[f]!=this.parentNode&&i("input",d[f]).val(this.value);this.value!=a.oPreviousSearch.sSearch&&M(a,{sSearch:this.value,bRegex:a.oPreviousSearch.bRegex,bSmart:a.oPreviousSearch.bSmart})});
+b.bind("keypress.DT",function(d){if(d.keyCode==13)return false});return c}function M(a,b,c){Ka(a,b.sSearch,c,b.bRegex,b.bSmart);for(b=0;b<a.aoPreSearchCols.length;b++)La(a,a.aoPreSearchCols[b].sSearch,b,a.aoPreSearchCols[b].bRegex,a.aoPreSearchCols[b].bSmart);o.afnFiltering.length!==0&&Ma(a);a.bFiltered=true;a._iDisplayStart=0;E(a);C(a);ka(a,0)}function Ma(a){for(var b=o.afnFiltering,c=0,d=b.length;c<d;c++)for(var f=0,e=0,h=a.aiDisplay.length;e<h;e++){var j=a.aiDisplay[e-f];if(!b[c](a,da(a,j,"filter"),
+j)){a.aiDisplay.splice(e-f,1);f++}}}function La(a,b,c,d,f){if(b!==""){var e=0;b=la(b,d,f);for(d=a.aiDisplay.length-1;d>=0;d--){f=ma(H(a,a.aiDisplay[d],c,"filter"),a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Ka(a,b,c,d,f){var e=la(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(o.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length||a.oPreviousSearch.sSearch.length>
+b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!==0){a.aiDisplay.splice(0,a.aiDisplay.length);ka(a,1);for(c=0;c<a.aiDisplayMaster.length;c++)e.test(a.asDataSearch[c])&&a.aiDisplay.push(a.aiDisplayMaster[c])}else{var h=0;for(c=0;c<a.asDataSearch.length;c++)if(!e.test(a.asDataSearch[c])){a.aiDisplay.splice(c-h,1);h++}}a.oPreviousSearch.sSearch=b;a.oPreviousSearch.bRegex=d;a.oPreviousSearch.bSmart=f}function ka(a,b){a.asDataSearch.splice(0,a.asDataSearch.length);b=typeof b!="undefined"&&b==1?a.aiDisplayMaster:
+a.aiDisplay;for(var c=0,d=b.length;c<d;c++)a.asDataSearch[c]=na(a,da(a,b[c],"filter"))}function na(a,b){var c="";if(typeof a.__nTmpFilter=="undefined")a.__nTmpFilter=p.createElement("div");for(var d=a.__nTmpFilter,f=0,e=a.aoColumns.length;f<e;f++)if(a.aoColumns[f].bSearchable)c+=ma(b[f],a.aoColumns[f].sType)+" ";if(c.indexOf("&")!==-1){d.innerHTML=c;c=d.textContent?d.textContent:d.innerText;c=c.replace(/\n/g," ").replace(/\r/g,"")}return c}function la(a,b,c){if(c){a=b?a.split(" "):oa(a).split(" ");
+a="^(?=.*?"+a.join(")(?=.*?")+").*$";return new RegExp(a,"i")}else{a=b?a:oa(a);return new RegExp(a,"i")}}function ma(a,b){if(typeof o.ofnSearch[b]=="function")return o.ofnSearch[b](a);else if(b=="html")return a.replace(/\n/g," ").replace(/<.*?>/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");else if(a===null)return"";return a}function R(a,b){var c,d,f,e,h=[],j=[],k=o.oSort;d=a.aoData;var m=a.aoColumns;if(!a.oFeatures.bServerSide&&(a.aaSorting.length!==0||a.aaSortingFixed!==null)){h=a.aaSortingFixed!==
+null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(c=0;c<h.length;c++){var t=h[c][0];f=pa(a,t);e=a.aoColumns[t].sSortDataType;if(typeof o.afnSortData[e]!="undefined"){var q=o.afnSortData[e](a,t,f);f=0;for(e=d.length;f<e;f++)N(a,f,t,q[f])}}c=0;for(d=a.aiDisplayMaster.length;c<d;c++)j[a.aiDisplayMaster[c]]=c;var I=h.length;a.aiDisplayMaster.sort(function(O,B){var F,qa;for(c=0;c<I;c++){F=m[h[c][0]].iDataSort;qa=m[F].sType;F=k[(qa?qa:"string")+"-"+h[c][1]](H(a,O,F,"sort"),H(a,B,F,"sort"));
+if(F!==0)return F}return k["numeric-asc"](j[O],j[B])})}if((typeof b=="undefined"||b)&&!a.oFeatures.bDeferRender)T(a);a.bSorted=true;if(a.oFeatures.bFilter)M(a,a.oPreviousSearch,1);else{a.aiDisplay=a.aiDisplayMaster.slice();a._iDisplayStart=0;E(a);C(a)}}function ga(a,b,c,d){i(b).bind("click.DT",function(f){if(a.aoColumns[c].bSortable!==false){var e=function(){var h,j;if(f.shiftKey){for(var k=false,m=0;m<a.aaSorting.length;m++)if(a.aaSorting[m][0]==c){k=true;h=a.aaSorting[m][0];j=a.aaSorting[m][2]+
+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")a.aaSorting.splice(m,1);else{a.aaSorting[m][1]=a.aoColumns[h].asSorting[j];a.aaSorting[m][2]=j}break}k===false&&a.aaSorting.push([c,a.aoColumns[c].asSorting[0],0])}else if(a.aaSorting.length==1&&a.aaSorting[0][0]==c){h=a.aaSorting[0][0];j=a.aaSorting[0][2]+1;if(typeof a.aoColumns[h].asSorting[j]=="undefined")j=0;a.aaSorting[0][1]=a.aoColumns[h].asSorting[j];a.aaSorting[0][2]=j}else{a.aaSorting.splice(0,a.aaSorting.length);a.aaSorting.push([c,a.aoColumns[c].asSorting[0],
+0])}R(a)};if(a.oFeatures.bProcessing){K(a,true);setTimeout(function(){e();a.oFeatures.bServerSide||K(a,false)},0)}else e();typeof d=="function"&&d(a)}})}function T(a){var b,c,d,f,e,h=a.aoColumns.length,j=a.oClasses;for(b=0;b<h;b++)a.aoColumns[b].bSortable&&i(a.aoColumns[b].nTh).removeClass(j.sSortAsc+" "+j.sSortDesc+" "+a.aoColumns[b].sSortingClass);f=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(b=0;b<a.aoColumns.length;b++)if(a.aoColumns[b].bSortable){e=a.aoColumns[b].sSortingClass;
+d=-1;for(c=0;c<f.length;c++)if(f[c][0]==b){e=f[c][1]=="asc"?j.sSortAsc:j.sSortDesc;d=c;break}i(a.aoColumns[b].nTh).addClass(e);if(a.bJUI){c=i("span",a.aoColumns[b].nTh);c.removeClass(j.sSortJUIAsc+" "+j.sSortJUIDesc+" "+j.sSortJUI+" "+j.sSortJUIAscAllowed+" "+j.sSortJUIDescAllowed);c.addClass(d==-1?a.aoColumns[b].sSortingClassJUI:f[d][1]=="asc"?j.sSortJUIAsc:j.sSortJUIDesc)}}else i(a.aoColumns[b].nTh).addClass(a.aoColumns[b].sSortingClass);e=j.sSortColumn;if(a.oFeatures.bSort&&a.oFeatures.bSortClasses){d=
+Q(a);if(a.oFeatures.bDeferRender)i(d).removeClass(e+"1 "+e+"2 "+e+"3");else if(d.length>=h)for(b=0;b<h;b++)if(d[b].className.indexOf(e+"1")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"1",""))}else if(d[b].className.indexOf(e+"2")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(e+"2",""))}else if(d[b].className.indexOf(e+"3")!=-1){c=0;for(a=d.length/h;c<a;c++)d[h*c+b].className=i.trim(d[h*c+b].className.replace(" "+
+e+"3",""))}j=1;var k;for(b=0;b<f.length;b++){k=parseInt(f[b][0],10);c=0;for(a=d.length/h;c<a;c++)d[h*c+k].className+=" "+e+j;j<3&&j++}}}function Ha(a){if(a.oScroll.bInfinite)return null;var b=p.createElement("div");b.className=a.oClasses.sPaging+a.sPaginationType;o.oPagination[a.sPaginationType].fnInit(a,b,function(c){E(c);C(c)});typeof a.aanFeatures.p=="undefined"&&a.aoDrawCallback.push({fn:function(c){o.oPagination[c.sPaginationType].fnUpdate(c,function(d){E(d);C(d)})},sName:"pagination"});return b}
+function ja(a,b){var c=a._iDisplayStart;if(b=="first")a._iDisplayStart=0;else if(b=="previous"){a._iDisplayStart=a._iDisplayLength>=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength<a.fnRecordsDisplay())a._iDisplayStart+=a._iDisplayLength}else a._iDisplayStart=0;else if(b=="last")if(a._iDisplayLength>=0){b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart=
+0;else J(a,0,"Unknown paging action: "+b);return c!=a._iDisplayStart}function Ga(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Na,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b}function Na(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),h=a.fnFormatNumber(c),j=
+a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",j)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",e).replace("_END_",h).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",
+e).replace("_END_",h).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b<c;b++)i(a[b]).html(e)}}function Ca(a){if(a.oScroll.bInfinite)return null;var b='<select size="1" '+(a.sTableId===""?"":'name="'+a.sTableId+'_length"')+">",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]==
+"object"){c=0;for(d=a.aLengthMenu[0].length;c<d;c++)b+='<option value="'+a.aLengthMenu[0][c]+'">'+a.aLengthMenu[1][c]+"</option>"}else{c=0;for(d=a.aLengthMenu.length;c<d;c++)b+='<option value="'+a.aLengthMenu[c]+'">'+a.aLengthMenu[c]+"</option>"}b+="</select>";var f=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");f.className=a.oClasses.sLength;f.innerHTML="<label>"+a.oLanguage.sLengthMenu.replace("_MENU_",b)+"</label>";i('select option[value="'+
+a._iDisplayLength+'"]',f).attr("selected",true);i("select",f).bind("change.DT",function(){var e=i(this).val(),h=a.aanFeatures.l;c=0;for(d=h.length;c<d;c++)h[c]!=this.parentNode&&i("select",h[c]).val(e);a._iDisplayLength=parseInt(e,10);E(a);if(a.fnDisplayEnd()==a.fnRecordsDisplay()){a._iDisplayStart=a.fnDisplayEnd()-a._iDisplayLength;if(a._iDisplayStart<0)a._iDisplayStart=0}if(a._iDisplayLength==-1)a._iDisplayStart=0;C(a)});return f}function Ea(a){var b=p.createElement("div");a.sTableId!==""&&typeof a.aanFeatures.r==
+"undefined"&&b.setAttribute("id",a.sTableId+"_processing");b.innerHTML=a.oLanguage.sProcessing;b.className=a.oClasses.sProcessing;a.nTable.parentNode.insertBefore(b,a.nTable);return b}function K(a,b){if(a.oFeatures.bProcessing){a=a.aanFeatures.r;for(var c=0,d=a.length;c<d;c++)a[c].style.visibility=b?"visible":"hidden"}}function Ja(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible===true&&c++;if(c==b)return d}return null}function pa(a,b){for(var c=-1,d=0;d<a.aoColumns.length;d++){a.aoColumns[d].bVisible===
+true&&c++;if(d==b)return a.aoColumns[d].bVisible===true?c:null}return null}function U(a,b){var c,d;c=a._iDisplayStart;for(d=a._iDisplayEnd;c<d;c++)if(a.aoData[a.aiDisplay[c]].nTr==b)return a.aiDisplay[c];c=0;for(d=a.aoData.length;c<d;c++)if(a.aoData[c].nTr==b)return c;return null}function X(a){for(var b=0,c=0;c<a.aoColumns.length;c++)a.aoColumns[c].bVisible===true&&b++;return b}function E(a){a._iDisplayEnd=a.oFeatures.bPaginate===false?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength>a.aiDisplay.length||
+a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Oa(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=u(a);b.appendChild(c);a=c.offsetWidth;b.removeChild(c);return a}function ea(a){var b=0,c,d=0,f=a.aoColumns.length,e,h=i("th",a.nTHead);for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d++;if(a.aoColumns[e].sWidth!==null){c=Oa(a.aoColumns[e].sWidthOrig,a.nTable.parentNode);if(c!==
+null)a.aoColumns[e].sWidth=u(c);b++}}if(f==h.length&&b===0&&d==f&&a.oScroll.sX===""&&a.oScroll.sY==="")for(e=0;e<a.aoColumns.length;e++){c=i(h[e]).width();if(c!==null)a.aoColumns[e].sWidth=u(c)}else{b=a.nTable.cloneNode(false);e=a.nTHead.cloneNode(true);d=p.createElement("tbody");c=p.createElement("tr");b.removeAttribute("id");b.appendChild(e);if(a.nTFoot!==null){b.appendChild(a.nTFoot.cloneNode(true));P(function(k){k.style.width=""},b.getElementsByTagName("tr"))}b.appendChild(d);d.appendChild(c);
+d=i("thead th",b);if(d.length===0)d=i("tbody tr:eq(0)>td",b);h=S(a,e);for(e=d=0;e<f;e++){var j=a.aoColumns[e];if(j.bVisible&&j.sWidthOrig!==null&&j.sWidthOrig!=="")h[e-d].style.width=u(j.sWidthOrig);else if(j.bVisible)h[e-d].style.width="";else d++}for(e=0;e<f;e++)if(a.aoColumns[e].bVisible){d=Pa(a,e);if(d!==null){d=d.cloneNode(true);if(a.aoColumns[e].sContentPadding!=="")d.innerHTML+=a.aoColumns[e].sContentPadding;c.appendChild(d)}}f=a.nTable.parentNode;f.appendChild(b);if(a.oScroll.sX!==""&&a.oScroll.sXInner!==
+"")b.style.width=u(a.oScroll.sXInner);else if(a.oScroll.sX!==""){b.style.width="";if(i(b).width()<f.offsetWidth)b.style.width=u(f.offsetWidth)}else if(a.oScroll.sY!=="")b.style.width=u(f.offsetWidth);b.style.visibility="hidden";Qa(a,b);f=i("tbody tr:eq(0)",b).children();if(f.length===0)f=S(a,i("thead",b)[0]);if(a.oScroll.sX!==""){for(e=d=c=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c+=a.aoColumns[e].sWidthOrig===null?i(f[d]).outerWidth():parseInt(a.aoColumns[e].sWidth.replace("px",""),
+10)+(i(f[d]).outerWidth()-i(f[d]).width());d++}b.style.width=u(c);a.nTable.style.width=u(c)}for(e=d=0;e<a.aoColumns.length;e++)if(a.aoColumns[e].bVisible){c=i(f[d]).width();if(c!==null&&c>0)a.aoColumns[e].sWidth=u(c);d++}a.nTable.style.width=u(i(b).outerWidth());b.parentNode.removeChild(b)}}function Qa(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){i(b).width();b.style.width=u(i(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!=="")b.style.width=u(i(b).outerWidth())}function Pa(a,b){var c=
+Ra(a,b);if(c<0)return null;if(a.aoData[c].nTr===null){var d=p.createElement("td");d.innerHTML=H(a,c,b,"");return d}return Q(a,c)[b]}function Ra(a,b){for(var c=-1,d=-1,f=0;f<a.aoData.length;f++){var e=H(a,f,b,"display")+"";e=e.replace(/<.*?>/g,"");if(e.length>c){c=e.length;d=f}}return d}function u(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b=a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+"px"}function Va(a,b){if(a.length!=b.length)return 1;for(var c=
+0;c<a.length;c++)if(a[c]!=b[c])return 2;return 0}function fa(a){for(var b=o.aTypes,c=b.length,d=0;d<c;d++){var f=b[d](a);if(f!==null)return f}return"string"}function A(a){for(var b=0;b<D.length;b++)if(D[b].nTable==a)return D[b];return null}function aa(a){for(var b=[],c=a.aoData.length,d=0;d<c;d++)b.push(a.aoData[d]._aData);return b}function $(a){for(var b=[],c=0,d=a.aoData.length;c<d;c++)a.aoData[c].nTr!==null&&b.push(a.aoData[c].nTr);return b}function Q(a,b){var c=[],d,f,e,h,j;f=0;var k=a.aoData.length;
+if(typeof b!="undefined"){f=b;k=b+1}for(f=f;f<k;f++){j=a.aoData[f];if(j.nTr!==null){b=[];e=0;for(h=j.nTr.childNodes.length;e<h;e++){d=j.nTr.childNodes[e].nodeName.toLowerCase();if(d=="td"||d=="th")b.push(j.nTr.childNodes[e])}e=d=0;for(h=a.aoColumns.length;e<h;e++)if(a.aoColumns[e].bVisible)c.push(b[e-d]);else{c.push(j._anHidden[e]);d++}}}return c}function oa(a){return a.replace(new RegExp("(\\/|\\.|\\*|\\+|\\?|\\||\\(|\\)|\\[|\\]|\\{|\\}|\\\\|\\$|\\^)","g"),"\\$1")}function ra(a,b){for(var c=-1,d=
+0,f=a.length;d<f;d++)if(a[d]==b)c=d;else a[d]>b&&a[d]--;c!=-1&&a.splice(c,1)}function Ba(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d<f;d++)for(var e=0;e<f;e++)if(a.aoColumns[d].sName==b[e]){c.push(e);break}return c}function ha(a){for(var b="",c=0,d=a.aoColumns.length;c<d;c++)b+=a.aoColumns[c].sName+",";if(b.length==d)return"";return b.slice(0,-1)}function J(a,b,c){a=a.sTableId===""?"DataTables warning: "+c:"DataTables warning (table id = '"+a.sTableId+"'): "+c;if(b===0)if(o.sErrMode==
+"alert")alert(a);else throw a;else typeof console!="undefined"&&typeof console.log!="undefined"&&console.log(a)}function ia(a){a.aoData.splice(0,a.aoData.length);a.aiDisplayMaster.splice(0,a.aiDisplayMaster.length);a.aiDisplay.splice(0,a.aiDisplay.length);E(a)}function sa(a){if(!(!a.oFeatures.bStateSave||typeof a.bDestroying!="undefined")){var b,c,d,f="{";f+='"iCreate":'+(new Date).getTime()+",";f+='"iStart":'+(a.oScroll.bInfinite?0:a._iDisplayStart)+",";f+='"iEnd":'+(a.oScroll.bInfinite?a._iDisplayLength:
+a._iDisplayEnd)+",";f+='"iLength":'+a._iDisplayLength+",";f+='"sFilter":"'+encodeURIComponent(a.oPreviousSearch.sSearch)+'",';f+='"sFilterEsc":'+!a.oPreviousSearch.bRegex+",";f+='"aaSorting":[ ';for(b=0;b<a.aaSorting.length;b++)f+="["+a.aaSorting[b][0]+',"'+a.aaSorting[b][1]+'"],';f=f.substring(0,f.length-1);f+="],";f+='"aaSearchCols":[ ';for(b=0;b<a.aoPreSearchCols.length;b++)f+='["'+encodeURIComponent(a.aoPreSearchCols[b].sSearch)+'",'+!a.aoPreSearchCols[b].bRegex+"],";f=f.substring(0,f.length-
+1);f+="],";f+='"abVisCols":[ ';for(b=0;b<a.aoColumns.length;b++)f+=a.aoColumns[b].bVisible+",";f=f.substring(0,f.length-1);f+="]";b=0;for(c=a.aoStateSave.length;b<c;b++){d=a.aoStateSave[b].fn(a,f);if(d!=="")f=d}f+="}";Sa(a.sCookiePrefix+a.sInstance,f,a.iCookieDuration,a.sCookiePrefix,a.fnCookieCallback)}}function Ta(a,b){if(a.oFeatures.bStateSave){var c,d,f;d=ta(a.sCookiePrefix+a.sInstance);if(d!==null&&d!==""){try{c=typeof i.parseJSON=="function"?i.parseJSON(d.replace(/'/g,'"')):eval("("+d+")")}catch(e){return}d=
+0;for(f=a.aoStateLoad.length;d<f;d++)if(!a.aoStateLoad[d].fn(a,c))return;a.oLoadedState=i.extend(true,{},c);a._iDisplayStart=c.iStart;a.iInitDisplayStart=c.iStart;a._iDisplayEnd=c.iEnd;a._iDisplayLength=c.iLength;a.oPreviousSearch.sSearch=decodeURIComponent(c.sFilter);a.aaSorting=c.aaSorting.slice();a.saved_aaSorting=c.aaSorting.slice();if(typeof c.sFilterEsc!="undefined")a.oPreviousSearch.bRegex=!c.sFilterEsc;if(typeof c.aaSearchCols!="undefined")for(d=0;d<c.aaSearchCols.length;d++)a.aoPreSearchCols[d]=
+{sSearch:decodeURIComponent(c.aaSearchCols[d][0]),bRegex:!c.aaSearchCols[d][1]};if(typeof c.abVisCols!="undefined"){b.saved_aoColumns=[];for(d=0;d<c.abVisCols.length;d++){b.saved_aoColumns[d]={};b.saved_aoColumns[d].bVisible=c.abVisCols[d]}}}}}function Sa(a,b,c,d,f){var e=new Date;e.setTime(e.getTime()+c*1E3);c=wa.location.pathname.split("/");a=a+"_"+c.pop().replace(/[\/:]/g,"").toLowerCase();var h;if(f!==null){h=typeof i.parseJSON=="function"?i.parseJSON(b):eval("("+b+")");b=f(a,h,e.toGMTString(),
+c.join("/")+"/")}else b=a+"="+encodeURIComponent(b)+"; expires="+e.toGMTString()+"; path="+c.join("/")+"/";f="";e=9999999999999;if((ta(a)!==null?p.cookie.length:b.length+p.cookie.length)+10>4096){a=p.cookie.split(";");for(var j=0,k=a.length;j<k;j++)if(a[j].indexOf(d)!=-1){var m=a[j].split("=");try{h=eval("("+decodeURIComponent(m[1])+")")}catch(t){continue}if(typeof h.iCreate!="undefined"&&h.iCreate<e){f=m[0];e=h.iCreate}}if(f!=="")p.cookie=f+"=; expires=Thu, 01-Jan-1970 00:00:01 GMT; path="+c.join("/")+
+"/"}p.cookie=b}function ta(a){var b=wa.location.pathname.split("/");a=a+"_"+b[b.length-1].replace(/[\/:]/g,"").toLowerCase()+"=";b=p.cookie.split(";");for(var c=0;c<b.length;c++){for(var d=b[c];d.charAt(0)==" ";)d=d.substring(1,d.length);if(d.indexOf(a)===0)return decodeURIComponent(d.substring(a.length,d.length))}return null}function W(a,b){b=b.getElementsByTagName("tr");var c,d,f,e,h,j,k,m,t=function(O,B,F){for(;typeof O[B][F]!="undefined";)F++;return F};a.splice(0,a.length);d=0;for(j=b.length;d<
+j;d++)a.push([]);d=0;for(j=b.length;d<j;d++){f=0;for(k=b[d].childNodes.length;f<k;f++){c=b[d].childNodes[f];if(c.nodeName.toUpperCase()=="TD"||c.nodeName.toUpperCase()=="TH"){var q=c.getAttribute("colspan")*1,I=c.getAttribute("rowspan")*1;q=!q||q===0||q===1?1:q;I=!I||I===0||I===1?1:I;m=t(a,d,0);for(h=0;h<q;h++)for(e=0;e<I;e++){a[d+e][m+h]={cell:c,unique:q==1?true:false};a[d+e].nTr=b[d]}}}}}function S(a,b,c){var d=[];if(typeof c=="undefined"){c=a.aoHeader;if(typeof b!="undefined"){c=[];W(c,b)}}b=0;
+for(var f=c.length;b<f;b++)for(var e=0,h=c[b].length;e<h;e++)if(c[b][e].unique&&(typeof d[e]=="undefined"||!a.bSortCellsTop))d[e]=c[b][e].cell;return d}function Ua(){var a=p.createElement("p"),b=a.style;b.width="100%";b.height="200px";var c=p.createElement("div");b=c.style;b.position="absolute";b.top="0px";b.left="0px";b.visibility="hidden";b.width="200px";b.height="150px";b.overflow="hidden";c.appendChild(a);p.body.appendChild(c);b=a.offsetWidth;c.style.overflow="scroll";a=a.offsetWidth;if(b==a)a=
+c.clientWidth;p.body.removeChild(c);return b-a}function P(a,b,c){for(var d=0,f=b.length;d<f;d++)for(var e=0,h=b[d].childNodes.length;e<h;e++)if(b[d].childNodes[e].nodeType==1)typeof c!="undefined"?a(b[d].childNodes[e],c[d].childNodes[e]):a(b[d].childNodes[e])}function n(a,b,c,d){if(typeof d=="undefined")d=c;if(typeof b[c]!="undefined")a[d]=b[c]}function da(a,b,c){for(var d=[],f=0,e=a.aoColumns.length;f<e;f++)d.push(H(a,b,f,c));return d}function H(a,b,c,d){var f=a.aoColumns[c];if((c=f.fnGetData(a.aoData[b]._aData))===
+undefined){if(a.iDrawError!=a.iDraw&&f.sDefaultContent===null){J(a,0,"Requested unknown parameter '"+f.mDataProp+"' from the data source for row "+b);a.iDrawError=a.iDraw}return f.sDefaultContent}if(c===null&&f.sDefaultContent!==null)c=f.sDefaultContent;if(d=="display"&&c===null)return"";return c}function N(a,b,c,d){a.aoColumns[c].fnSetData(a.aoData[b]._aData,d)}function Z(a){if(a===null)return function(){return null};else if(typeof a=="function")return function(c){return a(c)};else if(typeof a==
+"string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c){return c[b[0]][b[1]]}:b.length==3?function(c){return c[b[0]][b[1]][b[2]]}:function(c){for(var d=0,f=b.length;d<f;d++)c=c[b[d]];return c}}else return function(c){return c[a]}}function ya(a){if(a===null)return function(){};else if(typeof a=="function")return function(c,d){return a(c,d)};else if(typeof a=="string"&&a.indexOf(".")!=-1){var b=a.split(".");return b.length==2?function(c,d){c[b[0]][b[1]]=d}:b.length==3?function(c,
+d){c[b[0]][b[1]][b[2]]=d}:function(c,d){for(var f=0,e=b.length-1;f<e;f++)c=c[b[f]];c[b[b.length-1]]=d}}else return function(c,d){c[a]=d}}this.oApi={};this.fnDraw=function(a){var b=A(this[o.iApiIndex]);if(typeof a!="undefined"&&a===false){E(b);C(b)}else ba(b)};this.fnFilter=function(a,b,c,d,f){var e=A(this[o.iApiIndex]);if(e.oFeatures.bFilter){if(typeof c=="undefined")c=false;if(typeof d=="undefined")d=true;if(typeof f=="undefined")f=true;if(typeof b=="undefined"||b===null){M(e,{sSearch:a,bRegex:c,
+bSmart:d},1);if(f&&typeof e.aanFeatures.f!="undefined"){b=e.aanFeatures.f;c=0;for(d=b.length;c<d;c++)i("input",b[c]).val(a)}}else{e.aoPreSearchCols[b].sSearch=a;e.aoPreSearchCols[b].bRegex=c;e.aoPreSearchCols[b].bSmart=d;M(e,e.oPreviousSearch,1)}}};this.fnSettings=function(){return A(this[o.iApiIndex])};this.fnVersionCheck=o.fnVersionCheck;this.fnSort=function(a){var b=A(this[o.iApiIndex]);b.aaSorting=a;R(b)};this.fnSortListener=function(a,b,c){ga(A(this[o.iApiIndex]),a,b,c)};this.fnAddData=function(a,
+b){if(a.length===0)return[];var c=[],d,f=A(this[o.iApiIndex]);if(typeof a[0]=="object")for(var e=0;e<a.length;e++){d=v(f,a[e]);if(d==-1)return c;c.push(d)}else{d=v(f,a);if(d==-1)return c;c.push(d)}f.aiDisplay=f.aiDisplayMaster.slice();if(typeof b=="undefined"||b)ba(f);return c};this.fnDeleteRow=function(a,b,c){var d=A(this[o.iApiIndex]);a=typeof a=="object"?U(d,a):a;var f=d.aoData.splice(a,1),e=i.inArray(a,d.aiDisplay);d.asDataSearch.splice(e,1);ra(d.aiDisplayMaster,a);ra(d.aiDisplay,a);typeof b==
+"function"&&b.call(this,d,f);if(d._iDisplayStart>=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[o.iApiIndex]);ia(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[o.iApiIndex]);this.fnClose(a);var f=p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;e.colSpan=X(d);if(typeof b.jquery!="undefined"||typeof b==
+"object")e.appendChild(b);else e.innerHTML=b;b=i("tr",d.nTBody);i.inArray(a,b)!=-1&&i(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[o.iApiIndex]),c=0;c<b.aoOpenRows.length;c++)if(b.aoOpenRows[c].nParent==a){(a=b.aoOpenRows[c].nTr.parentNode)&&a.removeChild(b.aoOpenRows[c].nTr);b.aoOpenRows.splice(c,1);return 0}return 1};this.fnGetData=function(a,b){var c=A(this[o.iApiIndex]);if(typeof a!="undefined"){a=typeof a=="object"?U(c,a):a;if(typeof b!=
+"undefined")return H(c,a,b,"");return typeof c.aoData[a]!="undefined"?c.aoData[a]._aData:null}return aa(c)};this.fnGetNodes=function(a){var b=A(this[o.iApiIndex]);if(typeof a!="undefined")return typeof b.aoData[a]!="undefined"?b.aoData[a].nTr:null;return $(b)};this.fnGetPosition=function(a){var b=A(this[o.iApiIndex]),c=a.nodeName.toUpperCase();if(c=="TR")return U(b,a);else if(c=="TD"||c=="TH"){c=U(b,a.parentNode);for(var d=Q(b,c),f=0;f<b.aoColumns.length;f++)if(d[f]==a)return[c,pa(b,f),f]}return null};
+this.fnUpdate=function(a,b,c,d,f){var e=A(this[o.iApiIndex]);b=typeof b=="object"?U(e,b):b;if(i.isArray(a)&&typeof a=="object"){e.aoData[b]._aData=a.slice();for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(H(e,b,c),b,c,false,false)}else if(typeof a=="object"){e.aoData[b]._aData=i.extend(true,{},a);for(c=0;c<e.aoColumns.length;c++)this.fnUpdate(H(e,b,c),b,c,false,false)}else{a=a;N(e,b,c,a);if(e.aoColumns[c].fnRender!==null){a=e.aoColumns[c].fnRender({iDataRow:b,iDataColumn:c,aData:e.aoData[b]._aData,
+oSettings:e});e.aoColumns[c].bUseRendered&&N(e,b,c,a)}if(e.aoData[b].nTr!==null)Q(e,b)[c].innerHTML=a}c=i.inArray(b,e.aiDisplay);e.asDataSearch[c]=na(e,da(e,b,"filter"));if(typeof f=="undefined"||f)ca(e);if(typeof d=="undefined"||d)ba(e);return 0};this.fnSetColumnVis=function(a,b,c){var d=A(this[o.iApiIndex]),f,e;e=d.aoColumns.length;var h,j;if(d.aoColumns[a].bVisible!=b){if(b){for(f=j=0;f<a;f++)d.aoColumns[f].bVisible&&j++;j=j>=X(d);if(!j)for(f=a;f<e;f++)if(d.aoColumns[f].bVisible){h=f;break}f=0;
+for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null)j?d.aoData[f].nTr.appendChild(d.aoData[f]._anHidden[a]):d.aoData[f].nTr.insertBefore(d.aoData[f]._anHidden[a],Q(d,f)[h])}else{f=0;for(e=d.aoData.length;f<e;f++)if(d.aoData[f].nTr!==null){h=Q(d,f)[a];d.aoData[f]._anHidden[a]=h;h.parentNode.removeChild(h)}}d.aoColumns[a].bVisible=b;L(d,d.aoHeader);d.nTFoot&&L(d,d.aoFooter);f=0;for(e=d.aoOpenRows.length;f<e;f++)d.aoOpenRows[f].nTr.colSpan=X(d);if(typeof c=="undefined"||c){ca(d);C(d)}sa(d)}};this.fnPageChange=
+function(a,b){var c=A(this[o.iApiIndex]);ja(c,a);E(c);if(typeof b=="undefined"||b)C(c)};this.fnDestroy=function(){var a=A(this[o.iApiIndex]),b=a.nTableWrapper.parentNode,c=a.nTBody,d,f;a.bDestroying=true;d=0;for(f=a.aoColumns.length;d<f;d++)a.aoColumns[d].bVisible===false&&this.fnSetColumnVis(d,true);i(a.nTableWrapper).find("*").andSelf().unbind(".DT");i("tbody>tr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();if(a.nTable!=a.nTHead.parentNode){i(">thead",a.nTable).remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&&
+a.nTable!=a.nTFoot.parentNode){i(">tfoot",a.nTable).remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);i(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];T(a);i($(a)).removeClass(a.asStripClasses.join(" "));if(a.bJUI){i("th",a.nTHead).removeClass([o.oStdClasses.sSortable,o.oJUIClasses.sSortableAsc,o.oJUIClasses.sSortableDesc,o.oJUIClasses.sSortableNone].join(" "));i("th span."+o.oJUIClasses.sSortIcon,a.nTHead).remove();i("th",a.nTHead).each(function(){var e=
+i("div."+o.oJUIClasses.sSortJUIWrapper,this),h=e.contents();i(this).append(h);e.remove()})}else i("th",a.nTHead).removeClass([o.oStdClasses.sSortable,o.oStdClasses.sSortableAsc,o.oStdClasses.sSortableDesc,o.oStdClasses.sSortableNone].join(" "));a.nTableReinsertBefore?b.insertBefore(a.nTable,a.nTableReinsertBefore):b.appendChild(a.nTable);d=0;for(f=a.aoData.length;d<f;d++)a.aoData[d].nTr!==null&&c.appendChild(a.aoData[d].nTr);if(a.oFeatures.bAutoWidth===true)a.nTable.style.width=u(a.sDestroyWidth);
+i(">tr:even",c).addClass(a.asDestoryStrips[0]);i(">tr:odd",c).addClass(a.asDestoryStrips[1]);d=0;for(f=D.length;d<f;d++)D[d]==a&&D.splice(d,1);a=null};this.fnAdjustColumnSizing=function(a){var b=A(this[o.iApiIndex]);ca(b);if(typeof a=="undefined"||a)this.fnDraw(false);else if(b.oScroll.sX!==""||b.oScroll.sY!=="")this.oApi._fnScrollDraw(b)};for(var ua in o.oApi)if(ua)this[ua]=r(ua);this.oApi._fnExternApiFunc=r;this.oApi._fnInitalise=s;this.oApi._fnInitComplete=w;this.oApi._fnLanguageProcess=y;this.oApi._fnAddColumn=
+G;this.oApi._fnColumnOptions=x;this.oApi._fnAddData=v;this.oApi._fnCreateTr=z;this.oApi._fnGatherData=Y;this.oApi._fnBuildHead=V;this.oApi._fnDrawHead=L;this.oApi._fnDraw=C;this.oApi._fnReDraw=ba;this.oApi._fnAjaxUpdate=za;this.oApi._fnAjaxUpdateDraw=Aa;this.oApi._fnAddOptionsHtml=xa;this.oApi._fnFeatureHtmlTable=Fa;this.oApi._fnScrollDraw=Ia;this.oApi._fnAjustColumnSizing=ca;this.oApi._fnFeatureHtmlFilter=Da;this.oApi._fnFilterComplete=M;this.oApi._fnFilterCustom=Ma;this.oApi._fnFilterColumn=La;
+this.oApi._fnFilter=Ka;this.oApi._fnBuildSearchArray=ka;this.oApi._fnBuildSearchRow=na;this.oApi._fnFilterCreateSearch=la;this.oApi._fnDataToSearch=ma;this.oApi._fnSort=R;this.oApi._fnSortAttachListener=ga;this.oApi._fnSortingClasses=T;this.oApi._fnFeatureHtmlPaginate=Ha;this.oApi._fnPageChange=ja;this.oApi._fnFeatureHtmlInfo=Ga;this.oApi._fnUpdateInfo=Na;this.oApi._fnFeatureHtmlLength=Ca;this.oApi._fnFeatureHtmlProcessing=Ea;this.oApi._fnProcessingDisplay=K;this.oApi._fnVisibleToColumnIndex=Ja;this.oApi._fnColumnIndexToVisible=
+pa;this.oApi._fnNodeToDataIndex=U;this.oApi._fnVisbleColumns=X;this.oApi._fnCalculateEnd=E;this.oApi._fnConvertToWidth=Oa;this.oApi._fnCalculateColumnWidths=ea;this.oApi._fnScrollingWidthAdjust=Qa;this.oApi._fnGetWidestNode=Pa;this.oApi._fnGetMaxLenString=Ra;this.oApi._fnStringToCss=u;this.oApi._fnArrayCmp=Va;this.oApi._fnDetectType=fa;this.oApi._fnSettingsFromNode=A;this.oApi._fnGetDataMaster=aa;this.oApi._fnGetTrNodes=$;this.oApi._fnGetTdNodes=Q;this.oApi._fnEscapeRegex=oa;this.oApi._fnDeleteIndex=
+ra;this.oApi._fnReOrderIndex=Ba;this.oApi._fnColumnOrdering=ha;this.oApi._fnLog=J;this.oApi._fnClearTable=ia;this.oApi._fnSaveState=sa;this.oApi._fnLoadState=Ta;this.oApi._fnCreateCookie=Sa;this.oApi._fnReadCookie=ta;this.oApi._fnDetectHeader=W;this.oApi._fnGetUniqueThs=S;this.oApi._fnScrollBarWidth=Ua;this.oApi._fnApplyToChildren=P;this.oApi._fnMap=n;this.oApi._fnGetRowData=da;this.oApi._fnGetCellData=H;this.oApi._fnSetCellData=N;this.oApi._fnGetObjectDataFn=Z;this.oApi._fnSetObjectDataFn=ya;var va=
+this;return this.each(function(){var a=0,b,c,d,f;a=0;for(b=D.length;a<b;a++){if(D[a].nTable==this)if(typeof g=="undefined"||typeof g.bRetrieve!="undefined"&&g.bRetrieve===true)return D[a].oInstance;else if(typeof g.bDestroy!="undefined"&&g.bDestroy===true){D[a].oInstance.fnDestroy();break}else{J(D[a],0,"Cannot reinitialise DataTable.\n\nTo retrieve the DataTables object for this table, please pass either no arguments to the dataTable() function, or set bRetrieve to true. Alternatively, to destory the old table and create a new one, set bDestroy to true (note that a lot of changes to the configuration can be made through the API which is usually much faster).");
+return}if(D[a].sTableId!==""&&D[a].sTableId==this.getAttribute("id")){D.splice(a,1);break}}var e=new l;D.push(e);var h=false,j=false;a=this.getAttribute("id");if(a!==null){e.sTableId=a;e.sInstance=a}else e.sInstance=o._oExternConfig.iNextUnique++;if(this.nodeName.toLowerCase()!="table")J(e,0,"Attempted to initialise DataTables on a node which is not a table: "+this.nodeName);else{e.nTable=this;e.oInstance=va.length==1?va:i(this).dataTable();e.oApi=va.oApi;e.sDestroyWidth=i(this).width();if(typeof g!=
+"undefined"&&g!==null){e.oInit=g;n(e.oFeatures,g,"bPaginate");n(e.oFeatures,g,"bLengthChange");n(e.oFeatures,g,"bFilter");n(e.oFeatures,g,"bSort");n(e.oFeatures,g,"bInfo");n(e.oFeatures,g,"bProcessing");n(e.oFeatures,g,"bAutoWidth");n(e.oFeatures,g,"bSortClasses");n(e.oFeatures,g,"bServerSide");n(e.oFeatures,g,"bDeferRender");n(e.oScroll,g,"sScrollX","sX");n(e.oScroll,g,"sScrollXInner","sXInner");n(e.oScroll,g,"sScrollY","sY");n(e.oScroll,g,"bScrollCollapse","bCollapse");n(e.oScroll,g,"bScrollInfinite",
+"bInfinite");n(e.oScroll,g,"iScrollLoadGap","iLoadGap");n(e.oScroll,g,"bScrollAutoCss","bAutoCss");n(e,g,"asStripClasses");n(e,g,"fnPreDrawCallback");n(e,g,"fnRowCallback");n(e,g,"fnHeaderCallback");n(e,g,"fnFooterCallback");n(e,g,"fnCookieCallback");n(e,g,"fnInitComplete");n(e,g,"fnServerData");n(e,g,"fnFormatNumber");n(e,g,"aaSorting");n(e,g,"aaSortingFixed");n(e,g,"aLengthMenu");n(e,g,"sPaginationType");n(e,g,"sAjaxSource");n(e,g,"sAjaxDataProp");n(e,g,"iCookieDuration");n(e,g,"sCookiePrefix");
+n(e,g,"sDom");n(e,g,"bSortCellsTop");n(e,g,"oSearch","oPreviousSearch");n(e,g,"aoSearchCols","aoPreSearchCols");n(e,g,"iDisplayLength","_iDisplayLength");n(e,g,"bJQueryUI","bJUI");n(e.oLanguage,g,"fnInfoCallback");typeof g.fnDrawCallback=="function"&&e.aoDrawCallback.push({fn:g.fnDrawCallback,sName:"user"});typeof g.fnStateSaveCallback=="function"&&e.aoStateSave.push({fn:g.fnStateSaveCallback,sName:"user"});typeof g.fnStateLoadCallback=="function"&&e.aoStateLoad.push({fn:g.fnStateLoadCallback,sName:"user"});
+if(e.oFeatures.bServerSide&&e.oFeatures.bSort&&e.oFeatures.bSortClasses)e.aoDrawCallback.push({fn:T,sName:"server_side_sort_classes"});else e.oFeatures.bDeferRender&&e.aoDrawCallback.push({fn:T,sName:"defer_sort_classes"});if(typeof g.bJQueryUI!="undefined"&&g.bJQueryUI){e.oClasses=o.oJUIClasses;if(typeof g.sDom=="undefined")e.sDom='<"H"lfr>t<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!=="")e.oScroll.iBarWidth=Ua();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart=
+g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;Ta(e,g);e.aoDrawCallback.push({fn:sa,sName:"state_save"})}if(typeof g.iDeferLoading!="undefined"){e.bDeferLoading=true;e._iRecordsTotal=g.iDeferLoading;e._iRecordsDisplay=g.iDeferLoading}if(typeof g.aaData!="undefined")j=true;if(typeof g!="undefined"&&typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!==
+""){e.oLanguage.sUrl=g.oLanguage.sUrl;i.getJSON(e.oLanguage.sUrl,null,function(t){y(e,t,true)});h=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"){e.asStripClasses.push(e.oClasses.sStripOdd);e.asStripClasses.push(e.oClasses.sStripEven)}c=false;d=i(">tbody>tr",this);a=0;for(b=e.asStripClasses.length;a<b;a++)if(d.filter(":lt(2)").hasClass(e.asStripClasses[a])){c=true;break}if(c){e.asDestoryStrips=["",""];if(i(d[0]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[0]+=
+e.oClasses.sStripOdd+" ";if(i(d[0]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[0]+=e.oClasses.sStripEven;if(i(d[1]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[1]+=e.oClasses.sStripOdd+" ";if(i(d[1]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[1]+=e.oClasses.sStripEven;d.removeClass(e.asStripClasses.join(" "))}c=[];var k;a=this.getElementsByTagName("thead");if(a.length!==0){W(e.aoHeader,a[0]);c=S(e)}if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a<b;a++)k.push(null)}else k=
+g.aoColumns;a=0;for(b=k.length;a<b;a++){if(typeof g.saved_aoColumns!="undefined"&&g.saved_aoColumns.length==b){if(k[a]===null)k[a]={};k[a].bVisible=g.saved_aoColumns[a].bVisible}G(e,c?c[a]:null)}if(typeof g.aoColumnDefs!="undefined")for(a=g.aoColumnDefs.length-1;a>=0;a--){var m=g.aoColumnDefs[a].aTargets;i.isArray(m)||J(e,1,"aTargets must be an array of targets, not a "+typeof m);c=0;for(d=m.length;c<d;c++)if(typeof m[c]=="number"&&m[c]>=0){for(;e.aoColumns.length<=m[c];)G(e);x(e,m[c],g.aoColumnDefs[a])}else if(typeof m[c]==
+"number"&&m[c]<0)x(e,e.aoColumns.length+m[c],g.aoColumnDefs[a]);else if(typeof m[c]=="string"){b=0;for(f=e.aoColumns.length;b<f;b++)if(m[c]=="_all"||i(e.aoColumns[b].nTh).hasClass(m[c]))x(e,b,g.aoColumnDefs[a])}}if(typeof k!="undefined"){a=0;for(b=k.length;a<b;a++)x(e,a,k[a])}a=0;for(b=e.aaSorting.length;a<b;a++){if(e.aaSorting[a][0]>=e.aoColumns.length)e.aaSorting[a][0]=0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&&
+typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c<d;c++)if(e.aaSorting[a][1]==k.asSorting[c]){e.aaSorting[a][2]=c;break}}T(e);a=i(">thead",this);if(a.length===0){a=[p.createElement("thead")];this.appendChild(a[0])}e.nTHead=a[0];a=i(">tbody",this);if(a.length===0){a=[p.createElement("tbody")];this.appendChild(a[0])}e.nTBody=a[0];a=i(">tfoot",this);if(a.length>0){e.nTFoot=a[0];W(e.aoFooter,e.nTFoot)}if(j)for(a=0;a<g.aaData.length;a++)v(e,g.aaData[a]);
+else Y(e);e.aiDisplay=e.aiDisplayMaster.slice();e.bInitialised=true;h===false&&s(e)}})}})(jQuery,window,document);
--- /dev/null
+/*
+
+highlight v3
+
+Highlights arbitrary terms.
+
+<http://johannburkard.de/blog/programming/javascript/highlight-javascript-text-higlighting-jquery-plugin.html>
+
+MIT license.
+
+Johann Burkard
+<http://johannburkard.de>
+<mailto:jb@eaio.com>
+
+*/
+
+jQuery.fn.highlight = function(pat) {
+ function innerHighlight(node, pat) {
+ var skip = 0;
+ if (node.nodeType == 3) {
+ var pos = node.data.toUpperCase().indexOf(pat);
+ if (pos >= 0) {
+ var spannode = document.createElement('span');
+ spannode.className = 'term';
+ var middlebit = node.splitText(pos);
+ var endbit = middlebit.splitText(pat.length);
+ var middleclone = middlebit.cloneNode(true);
+ spannode.appendChild(middleclone);
+ middlebit.parentNode.replaceChild(spannode, middlebit);
+ skip = 1;
+ }
+ }
+ else if (node.nodeType == 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) {
+ for (var i = 0; i < node.childNodes.length; ++i) {
+ i += innerHighlight(node.childNodes[i], pat);
+ }
+ }
+ return skip;
+ }
+ return this.each(function() {
+ innerHighlight(this, pat.toUpperCase());
+ });
+};
+
+jQuery.fn.removeHighlight = function() {
+ return this.find("span.term").each(function() {
+ this.parentNode.firstChild.nodeName;
+ with (this.parentNode) {
+ replaceChild(this.firstChild, this);
+ normalize();
+ }
+ }).end();
+};
--- /dev/null
+/**
+* hoverIntent r5 // 2007.03.27 // jQuery 1.1.2+
+* <http://cherne.net/brian/resources/jquery.hoverIntent.html>
+*
+* @param f onMouseOver function || An object with configuration options
+* @param g onMouseOut function || Nothing (use configuration options object)
+* @author Brian Cherne <brian@cherne.net>
+*/
+(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY;var track=function(ev){cX=ev.pageX;cY=ev.pageY;};var compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev]);}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}};var delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev]);};var handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this){try{p=p.parentNode;}catch(e){p=this;}}if(p==this){return false;}var ev=jQuery.extend({},e);var ob=this;if(ob.hoverIntent_t){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);}if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1){ob.hoverIntent_t=setTimeout(function(){compare(ev,ob);},cfg.interval);}}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1){ob.hoverIntent_t=setTimeout(function(){delay(ev,ob);},cfg.timeout);}}};return this.mouseover(handleHover).mouseout(handleHover);};})(jQuery);
\ No newline at end of file
--- /dev/null
+(function($){$.extend({metadata:{defaults:{type:'class',name:'metadata',cre:/({.*})/,single:'metadata'},setType:function(type,name){this.defaults.type=type;this.defaults.name=name;},get:function(elem,opts){var settings=$.extend({},this.defaults,opts);if(!settings.single.length)settings.single='metadata';var data=$.data(elem,settings.single);if(data)return data;data="{}";var getData=function(data){if(typeof data!="string")return data;if(data.indexOf('{')<0){data=eval("("+data+")");}}
+var getObject=function(data){if(typeof data!="string")return data;data=eval("("+data+")");return data;}
+if(settings.type=="html5"){var object={};$(elem.attributes).each(function(){var name=this.nodeName;if(name.match(/^data-/))name=name.replace(/^data-/,'');else return true;object[name]=getObject(this.nodeValue);});}else{if(settings.type=="class"){var m=settings.cre.exec(elem.className);if(m)
+data=m[1];}else if(settings.type=="elem"){if(!elem.getElementsByTagName)returnvar;e=elem.getElementsByTagName(settings.name);if(e.length)
+data=$.trim(e[0].innerHTML);}else if(elem.getAttribute!=undefined){var attr=elem.getAttribute(settings.name);if(attr)
+data=attr;}
+object=getObject(data.indexOf("{")<0?"{"+data+"}":data);}
+$.data(elem,settings.single,object);return object;}}});$.fn.metadata=function(opts){return $.metadata.get(this[0],opts);};})(jQuery);
\ No newline at end of file
--- /dev/null
+/*
+ ### jQuery Star Rating Plugin v3.14 - 2012-01-26 ###
+ * Home: http://www.fyneworks.com/jquery/star-rating/
+ * Code: http://code.google.com/p/jquery-star-rating-plugin/
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ ###
+*/
+
+/*# AVOID COLLISIONS #*/
+;if(window.jQuery) (function($){
+/*# AVOID COLLISIONS #*/
+
+ // IE6 Background Image Fix
+ if ($.browser.msie) try { document.execCommand("BackgroundImageCache", false, true)} catch(e) { };
+ // Thanks to http://www.visualjquery.com/rating/rating_redux.html
+
+ // plugin initialization
+ $.fn.rating = function(options){
+ if(this.length==0) return this; // quick fail
+
+ // Handle API methods
+ if(typeof arguments[0]=='string'){
+ // Perform API methods on individual elements
+ if(this.length>1){
+ var args = arguments;
+ return this.each(function(){
+ $.fn.rating.apply($(this), args);
+ });
+ };
+ // Invoke API method handler
+ $.fn.rating[arguments[0]].apply(this, $.makeArray(arguments).slice(1) || []);
+ // Quick exit...
+ return this;
+ };
+
+ // Initialize options for this call
+ var options = $.extend(
+ {}/* new object */,
+ $.fn.rating.options/* default options */,
+ options || {} /* just-in-time options */
+ );
+
+ // Allow multiple controls with the same name by making each call unique
+ $.fn.rating.calls++;
+
+ // loop through each matched element
+ this
+ .not('.star-rating-applied')
+ .addClass('star-rating-applied')
+ .each(function(){
+
+ // Load control parameters / find context / etc
+ var control, input = $(this);
+ var eid = (this.name || 'unnamed-rating').replace(/\[|\]/g, '_').replace(/^\_+|\_+$/g,'');
+ var context = $(this.form || document.body);
+
+ // FIX: http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=23
+ var raters = context.data('rating');
+ if(!raters || raters.call!=$.fn.rating.calls) raters = { count:0, call:$.fn.rating.calls };
+ var rater = raters[eid];
+
+ // if rater is available, verify that the control still exists
+ if(rater) control = rater.data('rating');
+
+ if(rater && control)//{// save a byte!
+ // add star to control if rater is available and the same control still exists
+ control.count++;
+
+ //}// save a byte!
+ else{
+ // create new control if first star or control element was removed/replaced
+
+ // Initialize options for this rater
+ control = $.extend(
+ {}/* new object */,
+ options || {} /* current call options */,
+ ($.metadata? input.metadata(): ($.meta?input.data():null)) || {}, /* metadata options */
+ { count:0, stars: [], inputs: [] }
+ );
+
+ // increment number of rating controls
+ control.serial = raters.count++;
+
+ // create rating element
+ rater = $('<span class="star-rating-control"/>');
+ input.before(rater);
+
+ // Mark element for initialization (once all stars are ready)
+ rater.addClass('rating-to-be-drawn');
+
+ // Accept readOnly setting from 'disabled' property
+ if(input.attr('disabled') || input.hasClass('disabled')) control.readOnly = true;
+
+ // Accept required setting from class property (class='required')
+ if(input.hasClass('required')) control.required = true;
+
+ // Create 'cancel' button
+ rater.append(
+ control.cancel = $('<div class="rating-cancel"><a title="' + control.cancel + '">' + control.cancelValue + '</a></div>')
+ .mouseover(function(){
+ $(this).rating('drain');
+ $(this).addClass('star-rating-hover');
+ //$(this).rating('focus');
+ })
+ .mouseout(function(){
+ $(this).rating('draw');
+ $(this).removeClass('star-rating-hover');
+ //$(this).rating('blur');
+ })
+ .click(function(){
+ $(this).rating('select');
+ })
+ .data('rating', control)
+ );
+
+ }; // first element of group
+
+ // insert rating star
+ var star = $('<div class="star-rating rater-'+ control.serial +'"><a title="' + (this.title || this.value) + '">' + this.value + '</a></div>');
+ rater.append(star);
+
+ // inherit attributes from input element
+ if(this.id) star.attr('id', this.id);
+ if(this.className) star.addClass(this.className);
+
+ // Half-stars?
+ if(control.half) control.split = 2;
+
+ // Prepare division control
+ if(typeof control.split=='number' && control.split>0){
+ var stw = ($.fn.width ? star.width() : 0) || control.starWidth;
+ var spi = (control.count % control.split), spw = Math.floor(stw/control.split);
+ star
+ // restrict star's width and hide overflow (already in CSS)
+ .width(spw)
+ // move the star left by using a negative margin
+ // this is work-around to IE's stupid box model (position:relative doesn't work)
+ .find('a').css({ 'margin-left':'-'+ (spi*spw) +'px' })
+ };
+
+ // readOnly?
+ if(control.readOnly)//{ //save a byte!
+ // Mark star as readOnly so user can customize display
+ star.addClass('star-rating-readonly');
+ //} //save a byte!
+ else//{ //save a byte!
+ // Enable hover css effects
+ star.addClass('star-rating-live')
+ // Attach mouse events
+ .mouseover(function(){
+ $(this).rating('fill');
+ $(this).rating('focus');
+ })
+ .mouseout(function(){
+ $(this).rating('draw');
+ $(this).rating('blur');
+ })
+ .click(function(){
+ $(this).rating('select');
+ })
+ ;
+ //}; //save a byte!
+
+ // set current selection
+ if(this.checked) control.current = star;
+
+ // set current select for links
+ if(this.nodeName=="A"){
+ if($(this).hasClass('selected'))
+ control.current = star;
+ };
+
+ // hide input element
+ input.hide();
+
+ // backward compatibility, form element to plugin
+ input.change(function(){
+ $(this).rating('select');
+ });
+
+ // attach reference to star to input element and vice-versa
+ star.data('rating.input', input.data('rating.star', star));
+
+ // store control information in form (or body when form not available)
+ control.stars[control.stars.length] = star[0];
+ control.inputs[control.inputs.length] = input[0];
+ control.rater = raters[eid] = rater;
+ control.context = context;
+
+ input.data('rating', control);
+ rater.data('rating', control);
+ star.data('rating', control);
+ context.data('rating', raters);
+ }); // each element
+
+ // Initialize ratings (first draw)
+ $('.rating-to-be-drawn').rating('draw').removeClass('rating-to-be-drawn');
+
+ return this; // don't break the chain...
+ };
+
+ /*--------------------------------------------------------*/
+
+ /*
+ ### Core functionality and API ###
+ */
+ $.extend($.fn.rating, {
+ // Used to append a unique serial number to internal control ID
+ // each time the plugin is invoked so same name controls can co-exist
+ calls: 0,
+
+ focus: function(){
+ var control = this.data('rating'); if(!control) return this;
+ if(!control.focus) return this; // quick fail if not required
+ // find data for event
+ var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
+ // focus handler, as requested by focusdigital.co.uk
+ if(control.focus) control.focus.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
+ }, // $.fn.rating.focus
+
+ blur: function(){
+ var control = this.data('rating'); if(!control) return this;
+ if(!control.blur) return this; // quick fail if not required
+ // find data for event
+ var input = $(this).data('rating.input') || $( this.tagName=='INPUT' ? this : null );
+ // blur handler, as requested by focusdigital.co.uk
+ if(control.blur) control.blur.apply(input[0], [input.val(), $('a', input.data('rating.star'))[0]]);
+ }, // $.fn.rating.blur
+
+ fill: function(){ // fill to the current mouse position.
+ var control = this.data('rating'); if(!control) return this;
+ // do not execute when control is in read-only mode
+ if(control.readOnly) return;
+ // Reset all stars and highlight them up to this element
+ this.rating('drain');
+ this.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-hover');
+ },// $.fn.rating.fill
+
+ drain: function() { // drain all the stars.
+ var control = this.data('rating'); if(!control) return this;
+ // do not execute when control is in read-only mode
+ if(control.readOnly) return;
+ // Reset all stars
+ control.rater.children().filter('.rater-'+ control.serial).removeClass('star-rating-on').removeClass('star-rating-hover');
+ },// $.fn.rating.drain
+
+ draw: function(){ // set value and stars to reflect current selection
+ var control = this.data('rating'); if(!control) return this;
+ // Clear all stars
+ this.rating('drain');
+ // Set control value
+ if(control.current){
+ control.current.data('rating.input').attr('checked','checked');
+ control.current.prevAll().andSelf().filter('.rater-'+ control.serial).addClass('star-rating-on');
+ }
+ else
+ $(control.inputs).removeAttr('checked');
+ // Show/hide 'cancel' button
+ control.cancel[control.readOnly || control.required?'hide':'show']();
+ // Add/remove read-only classes to remove hand pointer
+ this.siblings()[control.readOnly?'addClass':'removeClass']('star-rating-readonly');
+ },// $.fn.rating.draw
+
+
+
+
+
+ select: function(value,wantCallBack){ // select a value
+
+ // ***** MODIFICATION *****
+ // Thanks to faivre.thomas - http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=27
+ //
+ // ***** LIST OF MODIFICATION *****
+ // ***** added Parameter wantCallBack : false if you don't want a callback. true or undefined if you want postback to be performed at the end of this method'
+ // ***** recursive calls to this method were like : ... .rating('select') it's now like .rating('select',undefined,wantCallBack); (parameters are set.)
+ // ***** line which is calling callback
+ // ***** /LIST OF MODIFICATION *****
+
+ var control = this.data('rating'); if(!control) return this;
+ // do not execute when control is in read-only mode
+ if(control.readOnly) return;
+ // clear selection
+ control.current = null;
+ // programmatically (based on user input)
+ if(typeof value!='undefined'){
+ // select by index (0 based)
+ if(typeof value=='number')
+ return $(control.stars[value]).rating('select',undefined,wantCallBack);
+ // select by literal value (must be passed as a string
+ if(typeof value=='string')
+ //return
+ $.each(control.stars, function(){
+ if($(this).data('rating.input').val()==value) $(this).rating('select',undefined,wantCallBack);
+ });
+ }
+ else
+ control.current = this[0].tagName=='INPUT' ?
+ this.data('rating.star') :
+ (this.is('.rater-'+ control.serial) ? this : null);
+
+ // Update rating control state
+ this.data('rating', control);
+ // Update display
+ this.rating('draw');
+ // find data for event
+ var input = $( control.current ? control.current.data('rating.input') : null );
+ // click callback, as requested here: http://plugins.jquery.com/node/1655
+
+ // **** MODIFICATION *****
+ // Thanks to faivre.thomas - http://code.google.com/p/jquery-star-rating-plugin/issues/detail?id=27
+ //
+ //old line doing the callback :
+ //if(control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event
+ //
+ //new line doing the callback (if i want :)
+ if((wantCallBack ||wantCallBack == undefined) && control.callback) control.callback.apply(input[0], [input.val(), $('a', control.current)[0]]);// callback event
+ //to ensure retro-compatibility, wantCallBack must be considered as true by default
+ // **** /MODIFICATION *****
+
+ },// $.fn.rating.select
+
+
+
+
+
+ readOnly: function(toggle, disable){ // make the control read-only (still submits value)
+ var control = this.data('rating'); if(!control) return this;
+ // setread-only status
+ control.readOnly = toggle || toggle==undefined ? true : false;
+ // enable/disable control value submission
+ if(disable) $(control.inputs).attr("disabled", "disabled");
+ else $(control.inputs).removeAttr("disabled");
+ // Update rating control state
+ this.data('rating', control);
+ // Update display
+ this.rating('draw');
+ },// $.fn.rating.readOnly
+
+ disable: function(){ // make read-only and never submit value
+ this.rating('readOnly', true, true);
+ },// $.fn.rating.disable
+
+ enable: function(){ // make read/write and submit value
+ this.rating('readOnly', false, false);
+ }// $.fn.rating.select
+
+ });
+
+ /*--------------------------------------------------------*/
+
+ /*
+ ### Default Settings ###
+ eg.: You can override default control like this:
+ $.fn.rating.options.cancel = 'Clear';
+ */
+ $.fn.rating.options = { //$.extend($.fn.rating, { options: {
+ cancel: 'Cancel Rating', // advisory title for the 'cancel' link
+ cancelValue: '', // value to submit when user click the 'cancel' link
+ split: 0, // split the star into how many parts?
+
+ // Width of star image in case the plugin can't work it out. This can happen if
+ // the jQuery.dimensions plugin is not available OR the image is hidden at installation
+ starWidth: 16//,
+
+ //NB.: These don't need to be pre-defined (can be undefined/null) so let's save some code!
+ //half: false, // just a shortcut to control.split = 2
+ //required: false, // disables the 'cancel' button so user can only select one of the specified values
+ //readOnly: false, // disable rating plugin interaction/ values cannot be changed
+ //focus: function(){}, // executed when stars are focused
+ //blur: function(){}, // executed when stars are focused
+ //callback: function(){}, // executed when a star is clicked
+ }; //} });
+
+ /*--------------------------------------------------------*/
+
+ /*
+ ### Default implementation ###
+ The plugin will attach itself to file inputs
+ with the class 'multi' when the page loads
+ */
+ $(function(){
+ $('input[type=radio].star').rating();
+ });
+
+
+
+/*# AVOID COLLISIONS #*/
+})(jQuery);
+/*# AVOID COLLISIONS #*/
--- /dev/null
+
+(function($){$.extend({tablesorter:new function(){var parsers=[],widgets=[];this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",decimal:'.',debug:false};function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms");}this.benchmark=benchmark;function log(s){if(typeof console!="undefined"&&typeof console.debug!="undefined"){console.log(s);}else{alert(s);}}function buildParserCache(table,$headers){if(table.config.debug){var parsersDebug="";}var rows=table.tBodies[0].rows;if(table.tBodies[0].rows[0]){var list=[],cells=rows[0].cells,l=cells.length;for(var i=0;i<l;i++){var p=false;if($.metadata&&($($headers[i]).metadata()&&$($headers[i]).metadata().sorter)){p=getParserById($($headers[i]).metadata().sorter);}else if((table.config.headers[i]&&table.config.headers[i].sorter)){p=getParserById(table.config.headers[i].sorter);}if(!p){p=detectParserForColumn(table,cells[i]);}if(table.config.debug){parsersDebug+="column:"+i+" parser:"+p.id+"\n";}list.push(p);}}if(table.config.debug){log(parsersDebug);}return list;};function detectParserForColumn(table,node){var l=parsers.length;for(var i=1;i<l;i++){if(parsers[i].is($.trim(getElementText(table.config,node)),table,node)){return parsers[i];}}return parsers[0];}function getParserById(name){var l=parsers.length;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==name.toLowerCase()){return parsers[i];}}return false;}function buildCache(table){if(table.config.debug){var cacheTime=new Date();}var totalRows=(table.tBodies[0]&&table.tBodies[0].rows.length)||0,totalCells=(table.tBodies[0].rows[0]&&table.tBodies[0].rows[0].cells.length)||0,parsers=table.config.parsers,cache={row:[],normalized:[]};for(var i=0;i<totalRows;++i){var c=table.tBodies[0].rows[i],cols=[];cache.row.push($(c));for(var j=0;j<totalCells;++j){cols.push(parsers[j].format(getElementText(table.config,c.cells[j]),table,c.cells[j]));}cols.push(i);cache.normalized.push(cols);cols=null;};if(table.config.debug){benchmark("Building cache for "+totalRows+" rows:",cacheTime);}return cache;};function getElementText(config,node){if(!node)return"";var t="";if(config.textExtraction=="simple"){if(node.childNodes[0]&&node.childNodes[0].hasChildNodes()){t=node.childNodes[0].innerHTML;}else{t=node.innerHTML;}}else{if(typeof(config.textExtraction)=="function"){t=config.textExtraction(node);}else{t=$(node).text();}}return t;}function appendToTable(table,cache){if(table.config.debug){var appendTime=new Date()}var c=cache,r=c.row,n=c.normalized,totalRows=n.length,checkCell=(n[0].length-1),tableBody=$(table.tBodies[0]),rows=[];for(var i=0;i<totalRows;i++){rows.push(r[n[i][checkCell]]);if(!table.config.appender){var o=r[n[i][checkCell]];var l=o.length;for(var j=0;j<l;j++){tableBody[0].appendChild(o[j]);}}}if(table.config.appender){table.config.appender(table,rows);}rows=null;if(table.config.debug){benchmark("Rebuilt table:",appendTime);}applyWidget(table);setTimeout(function(){$(table).trigger("sortEnd");},0);};function buildHeaders(table){if(table.config.debug){var time=new Date();}var meta=($.metadata)?true:false,tableHeadersRows=[];for(var i=0;i<table.tHead.rows.length;i++){tableHeadersRows[i]=0;};$tableHeaders=$("thead th",table);$tableHeaders.each(function(index){this.count=0;this.column=index;this.order=formatSortingOrder(table.config.sortInitialOrder);if(checkHeaderMetadata(this)||checkHeaderOptions(table,index))this.sortDisabled=true;if(!this.sortDisabled){$(this).addClass(table.config.cssHeader);}table.config.headerList[index]=this;});if(table.config.debug){benchmark("Built headers:",time);log($tableHeaders);}return $tableHeaders;};function checkCellColSpan(table,rows,row){var arr=[],r=table.tHead.rows,c=r[row].cells;for(var i=0;i<c.length;i++){var cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(table,headerArr,row++));}else{if(table.tHead.length==1||(cell.rowSpan>1||!r[row+1])){arr.push(cell);}}}return arr;};function checkHeaderMetadata(cell){if(($.metadata)&&($(cell).metadata().sorter===false)){return true;};return false;}function checkHeaderOptions(table,i){if((table.config.headers[i])&&(table.config.headers[i].sorter===false)){return true;};return false;}function applyWidget(table){var c=table.config.widgets;var l=c.length;for(var i=0;i<l;i++){getWidgetById(c[i]).format(table);}}function getWidgetById(name){var l=widgets.length;for(var i=0;i<l;i++){if(widgets[i].id.toLowerCase()==name.toLowerCase()){return widgets[i];}}};function formatSortingOrder(v){if(typeof(v)!="Number"){i=(v.toLowerCase()=="desc")?1:0;}else{i=(v==(0||1))?v:0;}return i;}function isValueInArray(v,a){var l=a.length;for(var i=0;i<l;i++){if(a[i][0]==v){return true;}}return false;}function setHeadersCss(table,$headers,list,css){$headers.removeClass(css[0]).removeClass(css[1]);var h=[];$headers.each(function(offset){if(!this.sortDisabled){h[this.column]=$(this);}});var l=list.length;for(var i=0;i<l;i++){h[list[i][0]].addClass(css[list[i][1]]);}}function fixColumnWidth(table,$headers){var c=table.config;if(c.widthFixed){var colgroup=$('<colgroup>');$("tr:first td",table.tBodies[0]).each(function(){colgroup.append($('<col>').css('width',$(this).width()));});$(table).prepend(colgroup);};}function updateHeaderSortCount(table,sortList){var c=table.config,l=sortList.length;for(var i=0;i<l;i++){var s=sortList[i],o=c.headerList[s[0]];o.count=s[1];o.count++;}}function multisort(table,sortList,cache){if(table.config.debug){var sortTime=new Date();}var dynamicExp="var sortWrapper = function(a,b) {",l=sortList.length;for(var i=0;i<l;i++){var c=sortList[i][0];var order=sortList[i][1];var s=(getCachedSortType(table.config.parsers,c)=="text")?((order==0)?"sortText":"sortTextDesc"):((order==0)?"sortNumeric":"sortNumericDesc");var e="e"+i;dynamicExp+="var "+e+" = "+s+"(a["+c+"],b["+c+"]); ";dynamicExp+="if("+e+") { return "+e+"; } ";dynamicExp+="else { ";}var orgOrderCol=cache.normalized[0].length-1;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(var i=0;i<l;i++){dynamicExp+="}; ";}dynamicExp+="return 0; ";dynamicExp+="}; ";eval(dynamicExp);cache.normalized.sort(sortWrapper);if(table.config.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time:",sortTime);}return cache;};function sortText(a,b){return((a<b)?-1:((a>b)?1:0));};function sortTextDesc(a,b){return((b<a)?-1:((b>a)?1:0));};function sortNumeric(a,b){return a-b;};function sortNumericDesc(a,b){return b-a;};function getCachedSortType(parsers,i){return parsers[i].type;};this.construct=function(settings){return this.each(function(){if(!this.tHead||!this.tBodies)return;var $this,$document,$headers,cache,config,shiftDown=0,sortOrder;this.config={};config=$.extend(this.config,$.tablesorter.defaults,settings);$this=$(this);$headers=buildHeaders(this);this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);var sortCSS=[config.cssDesc,config.cssAsc];fixColumnWidth(this);$headers.click(function(e){$this.trigger("sortStart");var totalRows=($this[0].tBodies[0]&&$this[0].tBodies[0].rows.length)||0;if(!this.sortDisabled&&totalRows>0){var $cell=$(this);var i=this.column;this.order=this.count++%2;if(!e[config.sortMultiSortKey]){config.sortList=[];if(config.sortForce!=null){var a=config.sortForce;for(var j=0;j<a.length;j++){if(a[j][0]!=i){config.sortList.push(a[j]);}}}config.sortList.push([i,this.order]);}else{if(isValueInArray(i,config.sortList)){for(var j=0;j<config.sortList.length;j++){var s=config.sortList[j],o=config.headerList[s[0]];if(s[0]==i){o.count=s[1];o.count++;s[1]=o.count%2;}}}else{config.sortList.push([i,this.order]);}};setTimeout(function(){setHeadersCss($this[0],$headers,config.sortList,sortCSS);appendToTable($this[0],multisort($this[0],config.sortList,cache));},1);return false;}}).mousedown(function(){if(config.cancelSelection){this.onselectstart=function(){return false};return false;}});$this.bind("update",function(){this.config.parsers=buildParserCache(this,$headers);cache=buildCache(this);}).bind("sorton",function(e,list){$(this).trigger("sortStart");config.sortList=list;var sortList=config.sortList;updateHeaderSortCount(this,sortList);setHeadersCss(this,$headers,sortList,sortCSS);appendToTable(this,multisort(this,sortList,cache));}).bind("appendCache",function(){appendToTable(this,cache);}).bind("applyWidgetId",function(e,id){getWidgetById(id).format(this);}).bind("applyWidgets",function(){applyWidget(this);});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){config.sortList=$(this).metadata().sortlist;}if(config.sortList.length>0){$this.trigger("sorton",[config.sortList]);}applyWidget(this);});};this.addParser=function(parser){var l=parsers.length,a=true;for(var i=0;i<l;i++){if(parsers[i].id.toLowerCase()==parser.id.toLowerCase()){a=false;}}if(a){parsers.push(parser);};};this.addWidget=function(widget){widgets.push(widget);};this.formatFloat=function(s){var i=parseFloat(s);return(isNaN(i))?0:i;};this.formatInt=function(s){var i=parseInt(s);return(isNaN(i))?0:i;};this.isDigit=function(s,config){var DECIMAL='\\'+config.decimal;var exp='/(^[+]?0('+DECIMAL+'0+)?$)|(^([-+]?[1-9][0-9]*)$)|(^([-+]?((0?|[1-9][0-9]*)'+DECIMAL+'(0*[1-9][0-9]*)))$)|(^[-+]?[1-9]+[0-9]*'+DECIMAL+'0+$)/';return RegExp(exp).test($.trim(s));};this.clearTableBody=function(table){if($.browser.msie){function empty(){while(this.firstChild)this.removeChild(this.firstChild);}empty.apply(table.tBodies[0]);}else{table.tBodies[0].innerHTML="";}};}});$.fn.extend({tablesorter:$.tablesorter.construct});var ts=$.tablesorter;ts.addParser({id:"text",is:function(s){return true;},format:function(s){return $.trim(s.toLowerCase());},type:"text"});ts.addParser({id:"digit",is:function(s,table){var c=table.config;return $.tablesorter.isDigit(s,c);},format:function(s){return $.tablesorter.formatFloat(s);},type:"numeric"});ts.addParser({id:"currency",is:function(s){return/^[£$€?.]/.test(s);},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9.]/g),""));},type:"numeric"});ts.addParser({id:"ipAddress",is:function(s){return/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s);},format:function(s){var a=s.split("."),r="",l=a.length;for(var i=0;i<l;i++){var item=a[i];if(item.length==2){r+="0"+item;}else{r+=item;}}return $.tablesorter.formatFloat(r);},type:"numeric"});ts.addParser({id:"url",is:function(s){return/^(https?|ftp|file):\/\/$/.test(s);},format:function(s){return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''));},type:"text"});ts.addParser({id:"isoDate",is:function(s){return/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s);},format:function(s){return $.tablesorter.formatFloat((s!="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"0");},type:"numeric"});ts.addParser({id:"percent",is:function(s){return/\%$/.test($.trim(s));},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""));},type:"numeric"});ts.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/));},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"shortDate",is:function(s){return/\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s);},format:function(s,table){var c=table.config;s=s.replace(/\-/g,"/");if(c.dateFormat=="us"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$1/$2");}else if(c.dateFormat=="uk"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/,"$3/$2/$1");}else if(c.dateFormat=="dd/mm/yy"||c.dateFormat=="dd-mm-yy"){s=s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/,"$1/$2/$3");}return $.tablesorter.formatFloat(new Date(s).getTime());},type:"numeric"});ts.addParser({id:"time",is:function(s){return/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s);},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime());},type:"numeric"});ts.addParser({id:"metadata",is:function(s){return false;},format:function(s,table,cell){var c=table.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(cell).metadata()[p];},type:"numeric"});ts.addWidget({id:"zebra",format:function(table){if(table.config.debug){var time=new Date();}$("tr:visible",table.tBodies[0]).filter(':even').removeClass(table.config.widgetZebra.css[1]).addClass(table.config.widgetZebra.css[0]).end().filter(':odd').removeClass(table.config.widgetZebra.css[0]).addClass(table.config.widgetZebra.css[1]);if(table.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time);}}});})(jQuery);
\ No newline at end of file
--- /dev/null
+/*!
+ * jQuery Tools v1.2.6 - The missing UI library for the Web
+ *
+ * tooltip/tooltip.js
+ *
+ * NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.
+ *
+ * http://flowplayer.org/tools/
+ *
+ */
+(function(a){a.tools=a.tools||{version:"v1.2.6"},a.tools.tooltip={conf:{effect:"toggle",fadeOutSpeed:"fast",predelay:0,delay:30,opacity:1,tip:0,fadeIE:!1,position:["top","center"],offset:[0,0],relative:!1,cancelDefault:!0,events:{def:"mouseenter,mouseleave",input:"focus,blur",widget:"focus mouseenter,blur mouseleave",tooltip:"mouseenter,mouseleave"},layout:"<div/>",tipClass:"tooltip"},addEffect:function(a,c,d){b[a]=[c,d]}};var b={toggle:[function(a){var b=this.getConf(),c=this.getTip(),d=b.opacity;d<1&&c.css({opacity:d}),c.show(),a.call()},function(a){this.getTip().hide(),a.call()}],fade:[function(b){var c=this.getConf();!a.browser.msie||c.fadeIE?this.getTip().fadeTo(c.fadeInSpeed,c.opacity,b):(this.getTip().show(),b())},function(b){var c=this.getConf();!a.browser.msie||c.fadeIE?this.getTip().fadeOut(c.fadeOutSpeed,b):(this.getTip().hide(),b())}]};function c(b,c,d){var e=d.relative?b.position().top:b.offset().top,f=d.relative?b.position().left:b.offset().left,g=d.position[0];e-=c.outerHeight()-d.offset[0],f+=b.outerWidth()+d.offset[1],/iPad/i.test(navigator.userAgent)&&(e-=a(window).scrollTop());var h=c.outerHeight()+b.outerHeight();g=="center"&&(e+=h/2),g=="bottom"&&(e+=h),g=d.position[1];var i=c.outerWidth()+b.outerWidth();g=="center"&&(f-=i/2),g=="left"&&(f-=i);return{top:e,left:f}}function d(d,e){var f=this,g=d.add(f),h,i=0,j=0,k=d.attr("title"),l=d.attr("data-tooltip"),m=b[e.effect],n,o=d.is(":input"),p=o&&d.is(":checkbox, :radio, select, :button, :submit"),q=d.attr("type"),r=e.events[q]||e.events[o?p?"widget":"input":"def"];if(!m)throw"Nonexistent effect \""+e.effect+"\"";r=r.split(/,\s*/);if(r.length!=2)throw"Tooltip: bad events configuration for "+q;d.bind(r[0],function(a){clearTimeout(i),e.predelay?j=setTimeout(function(){f.show(a)},e.predelay):f.show(a)}).bind(r[1],function(a){clearTimeout(j),e.delay?i=setTimeout(function(){f.hide(a)},e.delay):f.hide(a)}),k&&e.cancelDefault&&(d.removeAttr("title"),d.data("title",k)),a.extend(f,{show:function(b){if(!h){l?h=a(l):e.tip?h=a(e.tip).eq(0):k?h=a(e.layout).addClass(e.tipClass).appendTo(document.body).hide().append(k):(h=d.next(),h.length||(h=d.parent().next()));if(!h.length)throw"Cannot find tooltip for "+d}if(f.isShown())return f;h.stop(!0,!0);var o=c(d,h,e);e.tip&&h.html(d.data("title")),b=a.Event(),b.type="onBeforeShow",g.trigger(b,[o]);if(b.isDefaultPrevented())return f;o=c(d,h,e),h.css({position:"absolute",top:o.top,left:o.left}),n=!0,m[0].call(f,function(){b.type="onShow",n="full",g.trigger(b)});var p=e.events.tooltip.split(/,\s*/);h.data("__set")||(h.unbind(p[0]).bind(p[0],function(){clearTimeout(i),clearTimeout(j)}),p[1]&&!d.is("input:not(:checkbox, :radio), textarea")&&h.unbind(p[1]).bind(p[1],function(a){a.relatedTarget!=d[0]&&d.trigger(r[1].split(" ")[0])}),e.tip||h.data("__set",!0));return f},hide:function(c){if(!h||!f.isShown())return f;c=a.Event(),c.type="onBeforeHide",g.trigger(c);if(!c.isDefaultPrevented()){n=!1,b[e.effect][1].call(f,function(){c.type="onHide",g.trigger(c)});return f}},isShown:function(a){return a?n=="full":n},getConf:function(){return e},getTip:function(){return h},getTrigger:function(){return d}}),a.each("onHide,onBeforeShow,onShow,onBeforeHide".split(","),function(b,c){a.isFunction(e[c])&&a(f).bind(c,e[c]),f[c]=function(b){b&&a(f).bind(c,b);return f}})}a.fn.tooltip=function(b){var c=this.data("tooltip");if(c)return c;b=a.extend(!0,{},a.tools.tooltip.conf,b),typeof b.position=="string"&&(b.position=b.position.split(/,?\s/)),this.each(function(){c=new d(a(this),b),a(this).data("tooltip",c)});return b.api?c:this}})(jQuery);
--- /dev/null
+License
+
+The Crystal Project are released under LGPL.
+
+GNU General Public License.
+
+ 0.
+
+ This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+ Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+ 1.
+
+ You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+ You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+ 2.
+
+ You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+ 1. The modified work must itself be a software library.
+ 2. You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+ 3. You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+ 4. If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+ These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+ Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+ In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+ 3.
+
+ You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+ Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+ 4.
+
+ You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+ 5.
+
+ A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+ However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+ 6.
+
+ As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+ 1. Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) .
+ 2. Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+ 3. Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+ 4. If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+ 5. Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+ It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+ 7.
+
+ You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+ 1.
+
+ Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+ 2.
+
+ Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+ 8.
+
+ You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+ 9.
+
+ You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+ 10.
+
+ Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+ 11.
+
+ If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+ If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+ It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+ This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+ 12.
+
+ If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+ 13.
+
+ The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+ 14.
+
+ If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+No Warranty
+
+ 15.
+
+ Because the library is licensed free of charge, there is no warranty for the library, to the extent permitted by applicable law. Except when otherwise stated in writing the copyright holders and/or other parties provide the library "as is" without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the library is with you. Should the library prove defective, you assume the cost of all necessary servicing, repair or correction.
+ 16.
+
+ In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the library as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the library (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the library to operate with any other software), even if such holder or other party has been advised of the possibility of such damages.
--- /dev/null
+The Crystal Clear icon set was created by
+Everaldo Coelho, http://www.everaldo.com/
+Submitted: Oct 11 2003
+Updated: Jun 16 2007
+
+Icons were acquired from Wikimedia Commons,
+http://commons.wikimedia.org/wiki/Crystal_Clear, 30 Jan 2010.
+
+The images were renamed, organized and re-sized to create this packager in a
+standard icon package format. This was preformed by Jeff Israel at the Open
+Icon Library.
+
+This package was created by the Open Icon Library,
+http://openiconlibrary.sourceforge.net/ and is available for download there.T
+All Icons are free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 COPYING.txt or http://www.everaldo.com/crystal/?action=license for details.
+
+---------------
+
+Added to this set were three images by RayAna Min Park (August 2011):
+
+books-closed.png
+books-open-cd.png
+books-open.png
+
+All Icons are free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
\ No newline at end of file
--- /dev/null
+mini icons - famfamfam.com\r
+Contact: mjames@gmail.com
\ No newline at end of file
--- /dev/null
+mini icons - famfamfam.com\r
+Contact: mjames@gmail.com
\ No newline at end of file
--- /dev/null
+/*
+ *
+ * jqTransform
+ * by mathieu vilaplana mvilaplana@dfc-e.com
+ * Designer ghyslain armand garmand@dfc-e.com
+ *
+ *
+ * Version 1.0 25.09.08
+ * Version 1.1 06.08.09
+ * Add event click on Checkbox and Radio
+ * Auto calculate the size of a select element
+ * Can now, disabled the elements
+ * Correct bug in ff if click on select (overflow=hidden)
+ * No need any more preloading !!
+ *
+ ******************************************** */
+
+(function($){
+ var defaultOptions = {preloadImg:true};
+ var jqTransformImgPreloaded = false;
+
+ var jqTransformPreloadHoverFocusImg = function(strImgUrl) {
+ //guillemets to remove for ie
+ strImgUrl = strImgUrl.replace(/^url\((.*)\)/,'$1').replace(/^\"(.*)\"$/,'$1');
+ var imgHover = new Image();
+ imgHover.src = strImgUrl.replace(/\.([a-zA-Z]*)$/,'-hover.$1');
+ var imgFocus = new Image();
+ imgFocus.src = strImgUrl.replace(/\.([a-zA-Z]*)$/,'-focus.$1');
+ };
+
+
+ /***************************
+ Labels
+ ***************************/
+ var jqTransformGetLabel = function(objfield){
+ var selfForm = $(objfield.get(0).form);
+ var oLabel = objfield.next();
+ if(!oLabel.is('label')) {
+ oLabel = objfield.prev();
+ if(oLabel.is('label')){
+ var inputname = objfield.attr('id');
+ if(inputname){
+ oLabel = selfForm.find('label[for="'+inputname+'"]');
+ }
+ }
+ }
+ if(oLabel.is('label')){return oLabel.css('cursor','pointer');}
+ return false;
+ };
+
+ /* Hide all open selects */
+ var jqTransformHideSelect = function(oTarget){
+ var ulVisible = $('.jqTransformSelectWrapper ul:visible');
+ ulVisible.each(function(){
+ var oSelect = $(this).parents(".jqTransformSelectWrapper:first").find("select").get(0);
+ //do not hide if click on the label object associated to the select
+ if( !(oTarget && oSelect.oLabel && oSelect.oLabel.get(0) == oTarget.get(0)) ){$(this).hide();}
+ });
+ };
+ /* Check for an external click */
+ var jqTransformCheckExternalClick = function(event) {
+ if ($(event.target).parents('.jqTransformSelectWrapper').length === 0) { jqTransformHideSelect($(event.target)); }
+ };
+
+ /* Apply document listener */
+ var jqTransformAddDocumentListener = function (){
+ $(document).mousedown(jqTransformCheckExternalClick);
+ };
+
+ /* Add a new handler for the reset action */
+ var jqTransformReset = function(f){
+ var sel;
+ $('.jqTransformSelectWrapper select', f).each(function(){sel = (this.selectedIndex<0) ? 0 : this.selectedIndex; $('ul', $(this).parent()).each(function(){$('a:eq('+ sel +')', this).click();});});
+ $('a.jqTransformCheckbox, a.jqTransformRadio', f).removeClass('jqTransformChecked');
+ $('input:checkbox, input:radio', f).each(function(){if(this.checked){$('a', $(this).parent()).addClass('jqTransformChecked');}});
+ };
+
+ /***************************
+ Buttons
+ ***************************/
+ $.fn.jqTransInputButton = function(){
+ return this.each(function(){
+ var newBtn = $('<button id="'+ this.id +'" name="'+ this.name +'" type="'+ this.type +'" class="'+ this.className +' jqTransformButton"><span><span>'+ $(this).attr('value') +'</span></span>')
+ .hover(function(){newBtn.addClass('jqTransformButton_hover');},function(){newBtn.removeClass('jqTransformButton_hover')})
+ .mousedown(function(){newBtn.addClass('jqTransformButton_click')})
+ .mouseup(function(){newBtn.removeClass('jqTransformButton_click')})
+ ;
+ $(this).replaceWith(newBtn);
+ });
+ };
+
+ /***************************
+ Text Fields
+ ***************************/
+ $.fn.jqTransInputText = function(){
+ return this.each(function(){
+ var $input = $(this);
+
+ if($input.hasClass('jqtranformdone') || !$input.is('input')) {return;}
+ $input.addClass('jqtranformdone');
+
+ var oLabel = jqTransformGetLabel($(this));
+ oLabel && oLabel.bind('click',function(){$input.focus();});
+
+ var inputSize=$input.width();
+ if($input.attr('size')){
+ inputSize = $input.attr('size')*10;
+ $input.css('width',inputSize);
+ }
+
+ $input.addClass("jqTransformInput").wrap('<div class="jqTransformInputWrapper"><div class="jqTransformInputInner"><div></div></div></div>');
+ var $wrapper = $input.parent().parent().parent();
+ $wrapper.css("width", inputSize+10);
+ $input
+ .focus(function(){$wrapper.addClass("jqTransformInputWrapper_focus");})
+ .blur(function(){$wrapper.removeClass("jqTransformInputWrapper_focus");})
+ .hover(function(){$wrapper.addClass("jqTransformInputWrapper_hover");},function(){$wrapper.removeClass("jqTransformInputWrapper_hover");})
+ ;
+
+ /* If this is safari we need to add an extra class */
+ $.browser.safari && $wrapper.addClass('jqTransformSafari');
+ $.browser.safari && $input.css('width',$wrapper.width()+16);
+ this.wrapper = $wrapper;
+
+ });
+ };
+
+ /***************************
+ Check Boxes
+ ***************************/
+ $.fn.jqTransCheckBox = function(){
+ return this.each(function(){
+ if($(this).hasClass('jqTransformHidden')) {return;}
+
+ var $input = $(this);
+ var inputSelf = this;
+
+ //set the click on the label
+ var oLabel=jqTransformGetLabel($input);
+ oLabel && oLabel.click(function(){aLink.trigger('click');});
+
+ var aLink = $('<a href="#" class="jqTransformCheckbox"></a>');
+ //wrap and add the link
+ $input.addClass('jqTransformHidden').wrap('<span class="jqTransformCheckboxWrapper"></span>').parent().prepend(aLink);
+ //on change, change the class of the link
+ $input.change(function(){
+ this.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked');
+ return true;
+ });
+ // Click Handler, trigger the click and change event on the input
+ aLink.click(function(){
+ //do nothing if the original input is disabled
+ if($input.attr('disabled')){return false;}
+ //trigger the envents on the input object
+ $input.trigger('click').trigger("change");
+ return false;
+ });
+
+ // set the default state
+ this.checked && aLink.addClass('jqTransformChecked');
+ });
+ };
+ /***************************
+ Radio Buttons
+ ***************************/
+ $.fn.jqTransRadio = function(){
+ return this.each(function(){
+ if($(this).hasClass('jqTransformHidden')) {return;}
+
+ var $input = $(this);
+ var inputSelf = this;
+
+ oLabel = jqTransformGetLabel($input);
+ oLabel && oLabel.click(function(){aLink.trigger('click');});
+
+ var aLink = $('<a href="#" class="jqTransformRadio" rel="'+ this.name +'"></a>');
+ $input.addClass('jqTransformHidden').wrap('<span class="jqTransformRadioWrapper"></span>').parent().prepend(aLink);
+
+ $input.change(function(){
+ inputSelf.checked && aLink.addClass('jqTransformChecked') || aLink.removeClass('jqTransformChecked');
+ return true;
+ });
+ // Click Handler
+ aLink.click(function(){
+ if($input.attr('disabled')){return false;}
+ $input.trigger('click').trigger('change');
+
+ // uncheck all others of same name input radio elements
+ $('input[name="'+$input.attr('name')+'"]',inputSelf.form).not($input).each(function(){
+ $(this).attr('type')=='radio' && $(this).trigger('change');
+ });
+
+ return false;
+ });
+ // set the default state
+ inputSelf.checked && aLink.addClass('jqTransformChecked');
+ });
+ };
+
+ /***************************
+ TextArea
+ ***************************/
+ $.fn.jqTransTextarea = function(){
+ return this.each(function(){
+ var textarea = $(this);
+
+ if(textarea.hasClass('jqtransformdone')) {return;}
+ textarea.addClass('jqtransformdone');
+
+ oLabel = jqTransformGetLabel(textarea);
+ oLabel && oLabel.click(function(){textarea.focus();});
+
+ var strTable = '<table cellspacing="0" cellpadding="0" border="0" class="jqTransformTextarea">';
+ strTable +='<tr><td id="jqTransformTextarea-tl"></td><td id="jqTransformTextarea-tm"></td><td id="jqTransformTextarea-tr"></td></tr>';
+ strTable +='<tr><td id="jqTransformTextarea-ml"> </td><td id="jqTransformTextarea-mm"><div></div></td><td id="jqTransformTextarea-mr"> </td></tr>';
+ strTable +='<tr><td id="jqTransformTextarea-bl"></td><td id="jqTransformTextarea-bm"></td><td id="jqTransformTextarea-br"></td></tr>';
+ strTable +='</table>';
+ var oTable = $(strTable)
+ .insertAfter(textarea)
+ .hover(function(){
+ !oTable.hasClass('jqTransformTextarea-focus') && oTable.addClass('jqTransformTextarea-hover');
+ },function(){
+ oTable.removeClass('jqTransformTextarea-hover');
+ })
+ ;
+
+ textarea
+ .focus(function(){oTable.removeClass('jqTransformTextarea-hover').addClass('jqTransformTextarea-focus');})
+ .blur(function(){oTable.removeClass('jqTransformTextarea-focus');})
+ .appendTo($('#jqTransformTextarea-mm div',oTable))
+ ;
+ this.oTable = oTable;
+ if($.browser.safari){
+ $('#jqTransformTextarea-mm',oTable)
+ .addClass('jqTransformSafariTextarea')
+ .find('div')
+ .css('height',textarea.height())
+ .css('width',textarea.width())
+ ;
+ }
+ });
+ };
+
+ /***************************
+ Select
+ ***************************/
+ $.fn.jqTransSelect = function(){
+ return this.each(function(index){
+ var $select = $(this);
+
+ if($select.hasClass('jqTransformHidden')) {return;}
+ if($select.attr('multiple')) {return;}
+
+ var oLabel = jqTransformGetLabel($select);
+ /* First thing we do is Wrap it */
+ var $wrapper = $select
+ .addClass('jqTransformHidden')
+ .wrap('<div class="jqTransformSelectWrapper"></div>')
+ .parent()
+ .css({zIndex: 1000-index})
+ ;
+
+ /* Now add the html for the select */
+ $wrapper.prepend('<div><span></span><a href="#" class="jqTransformSelectOpen"></a></div><ul></ul>');
+ var $ul = $('ul', $wrapper).css('width',$select.width()).hide();
+ /* Now we add the options */
+ $('option', this).each(function(i){
+ var oLi = $('<li><a href="#" index="'+ i +'">'+ $(this).html() +'</a></li>');
+ $ul.append(oLi);
+ });
+
+ /* Add click handler to the a */
+ $ul.find('a').click(function(){
+ $('a.selected', $wrapper).removeClass('selected');
+ $(this).addClass('selected');
+ /* Fire the onchange event */
+ if ($select[0].selectedIndex != $(this).attr('index') && $select[0].onchange) { $select[0].selectedIndex = $(this).attr('index'); $select[0].onchange(); }
+ $select[0].selectedIndex = $(this).attr('index');
+ $('span:eq(0)', $wrapper).html($(this).html());
+ $ul.hide();
+ return false;
+ });
+ /* Set the default */
+ $('a:eq('+ this.selectedIndex +')', $ul).click();
+ $('span:first', $wrapper).click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');});
+ oLabel && oLabel.click(function(){$("a.jqTransformSelectOpen",$wrapper).trigger('click');});
+ this.oLabel = oLabel;
+
+ /* Apply the click handler to the Open */
+ var oLinkOpen = $('a.jqTransformSelectOpen', $wrapper)
+ .click(function(){
+ //Check if box is already open to still allow toggle, but close all other selects
+ if( $ul.css('display') == 'none' ) {jqTransformHideSelect();}
+ if($select.attr('disabled')){return false;}
+
+ $ul.slideToggle('fast', function(){
+ var offSet = ($('a.selected', $ul).offset().top - $ul.offset().top);
+ $ul.animate({scrollTop: offSet});
+ });
+ return false;
+ })
+ ;
+
+ // Set the new width
+ var iSelectWidth = $select.outerWidth();
+ var oSpan = $('span:first',$wrapper);
+ var newWidth = (iSelectWidth > oSpan.innerWidth())?iSelectWidth+oLinkOpen.outerWidth():$wrapper.width();
+ $wrapper.css('width',newWidth);
+ $ul.css('width',newWidth-2);
+ oSpan.css({width:iSelectWidth});
+
+ // Calculate the height if necessary, less elements that the default height
+ //show the ul to calculate the block, if ul is not displayed li height value is 0
+ $ul.css({display:'block',visibility:'hidden'});
+ var iSelectHeight = ($('li',$ul).length)*($('li:first',$ul).height());//+1 else bug ff
+ (iSelectHeight < $ul.height()) && $ul.css({height:iSelectHeight,'overflow':'hidden'});//hidden else bug with ff
+ $ul.css({display:'none',visibility:'visible'});
+
+ });
+ };
+ $.fn.jqTransform = function(options){
+ var opt = $.extend({},defaultOptions,options);
+
+ /* each form */
+ return this.each(function(){
+ var selfForm = $(this);
+ if(selfForm.hasClass('jqtransformdone')) {return;}
+ selfForm.addClass('jqtransformdone');
+
+ //$('input:submit, input:reset, input[type="button"]', this).jqTransInputButton();
+ //$('input:text, input:password', this).jqTransInputText();
+ //$('input:checkbox', this).jqTransCheckBox();
+ //$('input:radio', this).jqTransRadio();
+ //$('textarea', this).jqTransTextarea();
+
+ if( $('select', this).jqTransSelect().length > 0 ){jqTransformAddDocumentListener();}
+ selfForm.bind('reset',function(){var action = function(){jqTransformReset(this);}; window.setTimeout(action, 10);});
+
+ //preloading dont needed anymore since normal, focus and hover image are the same one
+ /*if(opt.preloadImg && !jqTransformImgPreloaded){
+ jqTransformImgPreloaded = true;
+ var oInputText = $('input:text:first', selfForm);
+ if(oInputText.length > 0){
+ //pour ie on eleve les ""
+ var strWrapperImgUrl = oInputText.get(0).wrapper.css('background-image');
+ jqTransformPreloadHoverFocusImg(strWrapperImgUrl);
+ var strInnerImgUrl = $('div.jqTransformInputInner',$(oInputText.get(0).wrapper)).css('background-image');
+ jqTransformPreloadHoverFocusImg(strInnerImgUrl);
+ }
+
+ var oTextarea = $('textarea',selfForm);
+ if(oTextarea.length > 0){
+ var oTable = oTextarea.get(0).oTable;
+ $('td',oTable).each(function(){
+ var strImgBack = $(this).css('background-image');
+ jqTransformPreloadHoverFocusImg(strImgBack);
+ });
+ }
+ }*/
+
+
+ }); /* End Form each */
+
+ };/* End the Plugin */
+
+})(jQuery);
--- /dev/null
+/*
+ * jsTree 1.0-rc3
+ * http://jstree.com/
+ *
+ * Copyright (c) 2010 Ivan Bozhanov (vakata.com)
+ *
+ * Licensed same as jquery - under the terms of either the MIT License or the GPL Version 2 License
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ * $Date: 2011-02-09 01:17:14 +0200 (ср, 09 февр 2011) $
+ * $Revision: 236 $
+ */
+
+/*jslint browser: true, onevar: true, undef: true, bitwise: true, strict: true */
+/*global window : false, clearInterval: false, clearTimeout: false, document: false, setInterval: false, setTimeout: false, jQuery: false, navigator: false, XSLTProcessor: false, DOMParser: false, XMLSerializer: false*/
+
+"use strict";
+
+// top wrapper to prevent multiple inclusion (is this OK?)
+(function () { if(jQuery && jQuery.jstree) { return; }
+ var is_ie6 = false, is_ie7 = false, is_ff2 = false;
+
+/*
+ * jsTree core
+ */
+(function ($) {
+ // Common functions not related to jsTree
+ // decided to move them to a `vakata` "namespace"
+ $.vakata = {};
+ // CSS related functions
+ $.vakata.css = {
+ get_css : function(rule_name, delete_flag, sheet) {
+ rule_name = rule_name.toLowerCase();
+ var css_rules = sheet.cssRules || sheet.rules,
+ j = 0;
+ do {
+ if(css_rules.length && j > css_rules.length + 5) { return false; }
+ if(css_rules[j].selectorText && css_rules[j].selectorText.toLowerCase() == rule_name) {
+ if(delete_flag === true) {
+ if(sheet.removeRule) { sheet.removeRule(j); }
+ if(sheet.deleteRule) { sheet.deleteRule(j); }
+ return true;
+ }
+ else { return css_rules[j]; }
+ }
+ }
+ while (css_rules[++j]);
+ return false;
+ },
+ add_css : function(rule_name, sheet) {
+ if($.jstree.css.get_css(rule_name, false, sheet)) { return false; }
+ if(sheet.insertRule) { sheet.insertRule(rule_name + ' { }', 0); } else { sheet.addRule(rule_name, null, 0); }
+ return $.vakata.css.get_css(rule_name);
+ },
+ remove_css : function(rule_name, sheet) {
+ return $.vakata.css.get_css(rule_name, true, sheet);
+ },
+ add_sheet : function(opts) {
+ var tmp = false, is_new = true;
+ if(opts.str) {
+ if(opts.title) { tmp = $("style[id='" + opts.title + "-stylesheet']")[0]; }
+ if(tmp) { is_new = false; }
+ else {
+ tmp = document.createElement("style");
+ tmp.setAttribute('type',"text/css");
+ if(opts.title) { tmp.setAttribute("id", opts.title + "-stylesheet"); }
+ }
+ if(tmp.styleSheet) {
+ if(is_new) {
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ tmp.styleSheet.cssText = opts.str;
+ }
+ else {
+ tmp.styleSheet.cssText = tmp.styleSheet.cssText + " " + opts.str;
+ }
+ }
+ else {
+ tmp.appendChild(document.createTextNode(opts.str));
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ }
+ return tmp.sheet || tmp.styleSheet;
+ }
+ if(opts.url) {
+ if(document.createStyleSheet) {
+ try { tmp = document.createStyleSheet(opts.url); } catch (e) { }
+ }
+ else {
+ tmp = document.createElement('link');
+ tmp.rel = 'stylesheet';
+ tmp.type = 'text/css';
+ tmp.media = "all";
+ tmp.href = opts.url;
+ document.getElementsByTagName("head")[0].appendChild(tmp);
+ return tmp.styleSheet;
+ }
+ }
+ }
+ };
+
+ // private variables
+ var instances = [], // instance array (used by $.jstree.reference/create/focused)
+ focused_instance = -1, // the index in the instance array of the currently focused instance
+ plugins = {}, // list of included plugins
+ prepared_move = {}; // for the move_node function
+
+ // jQuery plugin wrapper (thanks to jquery UI widget function)
+ $.fn.jstree = function (settings) {
+ var isMethodCall = (typeof settings == 'string'), // is this a method call like $().jstree("open_node")
+ args = Array.prototype.slice.call(arguments, 1),
+ returnValue = this;
+
+ // if a method call execute the method on all selected instances
+ if(isMethodCall) {
+ if(settings.substring(0, 1) == '_') { return returnValue; }
+ this.each(function() {
+ var instance = instances[$.data(this, "jstree_instance_id")],
+ methodValue = (instance && $.isFunction(instance[settings])) ? instance[settings].apply(instance, args) : instance;
+ if(typeof methodValue !== "undefined" && (settings.indexOf("is_") === 0 || (methodValue !== true && methodValue !== false))) { returnValue = methodValue; return false; }
+ });
+ }
+ else {
+ this.each(function() {
+ // extend settings and allow for multiple hashes and $.data
+ var instance_id = $.data(this, "jstree_instance_id"),
+ a = [],
+ b = settings ? $.extend({}, true, settings) : {},
+ c = $(this),
+ s = false,
+ t = [];
+ a = a.concat(args);
+ if(c.data("jstree")) { a.push(c.data("jstree")); }
+ b = a.length ? $.extend.apply(null, [true, b].concat(a)) : b;
+
+ // if an instance already exists, destroy it first
+ if(typeof instance_id !== "undefined" && instances[instance_id]) { instances[instance_id].destroy(); }
+ // push a new empty object to the instances array
+ instance_id = parseInt(instances.push({}),10) - 1;
+ // store the jstree instance id to the container element
+ $.data(this, "jstree_instance_id", instance_id);
+ // clean up all plugins
+ b.plugins = $.isArray(b.plugins) ? b.plugins : $.jstree.defaults.plugins.slice();
+ b.plugins.unshift("core");
+ // only unique plugins
+ b.plugins = b.plugins.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+
+ // extend defaults with passed data
+ s = $.extend(true, {}, $.jstree.defaults, b);
+ s.plugins = b.plugins;
+ $.each(plugins, function (i, val) {
+ if($.inArray(i, s.plugins) === -1) { s[i] = null; delete s[i]; }
+ else { t.push(i); }
+ });
+ s.plugins = t;
+
+ // push the new object to the instances array (at the same time set the default classes to the container) and init
+ instances[instance_id] = new $.jstree._instance(instance_id, $(this).addClass("jstree jstree-" + instance_id), s);
+ // init all activated plugins for this instance
+ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { instances[instance_id].data[val] = {}; });
+ $.each(instances[instance_id]._get_settings().plugins, function (i, val) { if(plugins[val]) { plugins[val].__init.apply(instances[instance_id]); } });
+ // initialize the instance
+ setTimeout(function() { if(instances[instance_id]) { instances[instance_id].init(); } }, 0);
+ });
+ }
+ // return the jquery selection (or if it was a method call that returned a value - the returned value)
+ return returnValue;
+ };
+ // object to store exposed functions and objects
+ $.jstree = {
+ defaults : {
+ plugins : []
+ },
+ _focused : function () { return instances[focused_instance] || null; },
+ _reference : function (needle) {
+ // get by instance id
+ if(instances[needle]) { return instances[needle]; }
+ // get by DOM (if still no luck - return null
+ var o = $(needle);
+ if(!o.length && typeof needle === "string") { o = $("#" + needle); }
+ if(!o.length) { return null; }
+ return instances[o.closest(".jstree").data("jstree_instance_id")] || null;
+ },
+ _instance : function (index, container, settings) {
+ // for plugins to store data in
+ this.data = { core : {} };
+ this.get_settings = function () { return $.extend(true, {}, settings); };
+ this._get_settings = function () { return settings; };
+ this.get_index = function () { return index; };
+ this.get_container = function () { return container; };
+ this.get_container_ul = function () { return container.children("ul:eq(0)"); };
+ this._set_settings = function (s) {
+ settings = $.extend(true, {}, settings, s);
+ };
+ },
+ _fn : { },
+ plugin : function (pname, pdata) {
+ pdata = $.extend({}, {
+ __init : $.noop,
+ __destroy : $.noop,
+ _fn : {},
+ defaults : false
+ }, pdata);
+ plugins[pname] = pdata;
+
+ $.jstree.defaults[pname] = pdata.defaults;
+ $.each(pdata._fn, function (i, val) {
+ val.plugin = pname;
+ val.old = $.jstree._fn[i];
+ $.jstree._fn[i] = function () {
+ var rslt,
+ func = val,
+ args = Array.prototype.slice.call(arguments),
+ evnt = new $.Event("before.jstree"),
+ rlbk = false;
+
+ if(this.data.core.locked === true && i !== "unlock" && i !== "is_locked") { return; }
+
+ // Check if function belongs to the included plugins of this instance
+ do {
+ if(func && func.plugin && $.inArray(func.plugin, this._get_settings().plugins) !== -1) { break; }
+ func = func.old;
+ } while(func);
+ if(!func) { return; }
+
+ // context and function to trigger events, then finally call the function
+ if(i.indexOf("_") === 0) {
+ rslt = func.apply(this, args);
+ }
+ else {
+ rslt = this.get_container().triggerHandler(evnt, { "func" : i, "inst" : this, "args" : args, "plugin" : func.plugin });
+ if(rslt === false) { return; }
+ if(typeof rslt !== "undefined") { args = rslt; }
+
+ rslt = func.apply(
+ $.extend({}, this, {
+ __callback : function (data) {
+ this.get_container().triggerHandler( i + '.jstree', { "inst" : this, "args" : args, "rslt" : data, "rlbk" : rlbk });
+ },
+ __rollback : function () {
+ rlbk = this.get_rollback();
+ return rlbk;
+ },
+ __call_old : function (replace_arguments) {
+ return func.old.apply(this, (replace_arguments ? Array.prototype.slice.call(arguments, 1) : args ) );
+ }
+ }), args);
+ }
+
+ // return the result
+ return rslt;
+ };
+ $.jstree._fn[i].old = val.old;
+ $.jstree._fn[i].plugin = pname;
+ });
+ },
+ rollback : function (rb) {
+ if(rb) {
+ if(!$.isArray(rb)) { rb = [ rb ]; }
+ $.each(rb, function (i, val) {
+ instances[val.i].set_rollback(val.h, val.d);
+ });
+ }
+ }
+ };
+ // set the prototype for all instances
+ $.jstree._fn = $.jstree._instance.prototype = {};
+
+ // load the css when DOM is ready
+ $(function() {
+ // code is copied from jQuery ($.browser is deprecated + there is a bug in IE)
+ var u = navigator.userAgent.toLowerCase(),
+ v = (u.match( /.+?(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
+ css_string = '' +
+ '.jstree ul, .jstree li { display:block; margin:0 0 0 0; padding:0 0 0 0; list-style-type:none; } ' +
+ '.jstree li { display:block; min-height:18px; line-height:18px; white-space:nowrap; margin-left:18px; min-width:18px; } ' +
+ '.jstree-rtl li { margin-left:0; margin-right:18px; } ' +
+ '.jstree > ul > li { margin-left:0px; } ' +
+ '.jstree-rtl > ul > li { margin-right:0px; } ' +
+ '.jstree ins { display:inline-block; text-decoration:none; width:18px; height:18px; margin:0 0 0 0; padding:0; } ' +
+ '.jstree a { display:inline-block; line-height:16px; height:16px; color:black; white-space:nowrap; text-decoration:none; padding:1px 2px; margin:0; } ' +
+ '.jstree a:focus { outline: none; } ' +
+ '.jstree a > ins { height:16px; width:16px; } ' +
+ '.jstree a > .jstree-icon { margin-right:3px; } ' +
+ '.jstree-rtl a > .jstree-icon { margin-left:3px; margin-right:0; } ' +
+ 'li.jstree-open > ul { display:block; } ' +
+ 'li.jstree-closed > ul { display:none; } ';
+ // Correct IE 6 (does not support the > CSS selector)
+ if(/msie/.test(u) && parseInt(v, 10) == 6) {
+ is_ie6 = true;
+
+ // fix image flicker and lack of caching
+ try {
+ document.execCommand("BackgroundImageCache", false, true);
+ } catch (err) { }
+
+ css_string += '' +
+ '.jstree li { height:18px; margin-left:0; margin-right:0; } ' +
+ '.jstree li li { margin-left:18px; } ' +
+ '.jstree-rtl li li { margin-left:0px; margin-right:18px; } ' +
+ 'li.jstree-open ul { display:block; } ' +
+ 'li.jstree-closed ul { display:none !important; } ' +
+ '.jstree li a { display:inline; border-width:0 !important; padding:0px 2px !important; } ' +
+ '.jstree li a ins { height:16px; width:16px; margin-right:3px; } ' +
+ '.jstree-rtl li a ins { margin-right:0px; margin-left:3px; } ';
+ }
+ // Correct IE 7 (shifts anchor nodes onhover)
+ if(/msie/.test(u) && parseInt(v, 10) == 7) {
+ is_ie7 = true;
+ css_string += '.jstree li a { border-width:0 !important; padding:0px 2px !important; } ';
+ }
+ // correct ff2 lack of display:inline-block
+ if(!/compatible/.test(u) && /mozilla/.test(u) && parseFloat(v, 10) < 1.9) {
+ is_ff2 = true;
+ css_string += '' +
+ '.jstree ins { display:-moz-inline-box; } ' +
+ '.jstree li { line-height:12px; } ' + // WHY??
+ '.jstree a { display:-moz-inline-box; } ' +
+ '.jstree .jstree-no-icons .jstree-checkbox { display:-moz-inline-stack !important; } ';
+ /* this shouldn't be here as it is theme specific */
+ }
+ // the default stylesheet
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+
+ // core functions (open, close, create, update, delete)
+ $.jstree.plugin("core", {
+ __init : function () {
+ this.data.core.locked = false;
+ this.data.core.to_open = this.get_settings().core.initially_open;
+ this.data.core.to_load = this.get_settings().core.initially_load;
+ },
+ defaults : {
+ html_titles : false,
+ animation : 500,
+ initially_open : [],
+ initially_load : [],
+ open_parents : true,
+ notify_plugins : true,
+ rtl : false,
+ load_open : false,
+ strings : {
+ loading : "Loading ...",
+ new_node : "New node",
+ multiple_selection : "Multiple selection"
+ }
+ },
+ _fn : {
+ init : function () {
+ this.set_focus();
+ if(this._get_settings().core.rtl) {
+ this.get_container().addClass("jstree-rtl").css("direction", "rtl");
+ }
+ this.get_container().html("<ul><li class='jstree-last jstree-leaf'><ins> </ins><a class='jstree-loading' href='#'><ins class='jstree-icon'> </ins>" + this._get_string("loading") + "</a></li></ul>");
+ this.data.core.li_height = this.get_container_ul().find("li.jstree-closed, li.jstree-leaf").eq(0).height() || 18;
+
+ this.get_container()
+ .delegate("li > ins", "click.jstree", $.proxy(function (event) {
+ var trgt = $(event.target);
+ // if(trgt.is("ins") && event.pageY - trgt.offset().top < this.data.core.li_height) { this.toggle_node(trgt); }
+ this.toggle_node(trgt);
+ }, this))
+ .bind("mousedown.jstree", $.proxy(function () {
+ this.set_focus(); // This used to be setTimeout(set_focus,0) - why?
+ }, this))
+ .bind("dblclick.jstree", function (event) {
+ var sel;
+ if(document.selection && document.selection.empty) { document.selection.empty(); }
+ else {
+ if(window.getSelection) {
+ sel = window.getSelection();
+ try {
+ sel.removeAllRanges();
+ sel.collapse();
+ } catch (err) { }
+ }
+ }
+ });
+ if(this._get_settings().core.notify_plugins) {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var o = this._get_node(data.rslt.obj),
+ t = this;
+ if(o === -1) { o = this.get_container_ul(); }
+ if(!o.length) { return; }
+ o.find("li").each(function () {
+ var th = $(this);
+ if(th.data("jstree")) {
+ $.each(th.data("jstree"), function (plugin, values) {
+ if(t.data[plugin] && $.isFunction(t["_" + plugin + "_notify"])) {
+ t["_" + plugin + "_notify"].call(t, th, values);
+ }
+ });
+ }
+ });
+ }, this));
+ }
+ if(this._get_settings().core.load_open) {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var o = this._get_node(data.rslt.obj),
+ t = this;
+ if(o === -1) { o = this.get_container_ul(); }
+ if(!o.length) { return; }
+ o.find("li.jstree-open:not(:has(ul))").each(function () {
+ t.load_node(this, $.noop, $.noop);
+ });
+ }, this));
+ }
+ this.__callback();
+ this.load_node(-1, function () { this.loaded(); this.reload_nodes(); });
+ },
+ destroy : function () {
+ var i,
+ n = this.get_index(),
+ s = this._get_settings(),
+ _this = this;
+
+ $.each(s.plugins, function (i, val) {
+ try { plugins[val].__destroy.apply(_this); } catch(err) { }
+ });
+ this.__callback();
+ // set focus to another instance if this one is focused
+ if(this.is_focused()) {
+ for(i in instances) {
+ if(instances.hasOwnProperty(i) && i != n) {
+ instances[i].set_focus();
+ break;
+ }
+ }
+ }
+ // if no other instance found
+ if(n === focused_instance) { focused_instance = -1; }
+ // remove all traces of jstree in the DOM (only the ones set using jstree*) and cleans all events
+ this.get_container()
+ .unbind(".jstree")
+ .undelegate(".jstree")
+ .removeData("jstree_instance_id")
+ .find("[class^='jstree']")
+ .andSelf()
+ .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); });
+ $(document)
+ .unbind(".jstree-" + n)
+ .undelegate(".jstree-" + n);
+ // remove the actual data
+ instances[n] = null;
+ delete instances[n];
+ },
+
+ _core_notify : function (n, data) {
+ if(data.opened) {
+ this.open_node(n, false, true);
+ }
+ },
+
+ lock : function () {
+ this.data.core.locked = true;
+ this.get_container().children("ul").addClass("jstree-locked").css("opacity","0.7");
+ this.__callback({});
+ },
+ unlock : function () {
+ this.data.core.locked = false;
+ this.get_container().children("ul").removeClass("jstree-locked").css("opacity","1");
+ this.__callback({});
+ },
+ is_locked : function () { return this.data.core.locked; },
+ save_opened : function () {
+ var _this = this;
+ this.data.core.to_open = [];
+ this.get_container_ul().find("li.jstree-open").each(function () {
+ if(this.id) { _this.data.core.to_open.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); }
+ });
+ this.__callback(_this.data.core.to_open);
+ },
+ save_loaded : function () { },
+ reload_nodes : function (is_callback) {
+ var _this = this,
+ done = true,
+ current = [],
+ remaining = [];
+ if(!is_callback) {
+ this.data.core.reopen = false;
+ this.data.core.refreshing = true;
+ this.data.core.to_open = $.map($.makeArray(this.data.core.to_open), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ this.data.core.to_load = $.map($.makeArray(this.data.core.to_load), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ if(this.data.core.to_open.length) {
+ this.data.core.to_load = this.data.core.to_load.concat(this.data.core.to_open);
+ }
+ }
+ if(this.data.core.to_load.length) {
+ $.each(this.data.core.to_load, function (i, val) {
+ if(val == "#") { return true; }
+ if($(val).length) { current.push(val); }
+ else { remaining.push(val); }
+ });
+ if(current.length) {
+ this.data.core.to_load = remaining;
+ $.each(current, function (i, val) {
+ if(!_this._is_loaded(val)) {
+ _this.load_node(val, function () { _this.reload_nodes(true); }, function () { _this.reload_nodes(true); });
+ done = false;
+ }
+ });
+ }
+ }
+ if(this.data.core.to_open.length) {
+ $.each(this.data.core.to_open, function (i, val) {
+ _this.open_node(val, false, true);
+ });
+ }
+ if(done) {
+ // TODO: find a more elegant approach to syncronizing returning requests
+ if(this.data.core.reopen) { clearTimeout(this.data.core.reopen); }
+ this.data.core.reopen = setTimeout(function () { _this.__callback({}, _this); }, 50);
+ this.data.core.refreshing = false;
+ this.reopen();
+ }
+ },
+ reopen : function () {
+ var _this = this;
+ if(this.data.core.to_open.length) {
+ $.each(this.data.core.to_open, function (i, val) {
+ _this.open_node(val, false, true);
+ });
+ }
+ this.__callback({});
+ },
+ refresh : function (obj) {
+ var _this = this;
+ this.save_opened();
+ if(!obj) { obj = -1; }
+ obj = this._get_node(obj);
+ if(!obj) { obj = -1; }
+ if(obj !== -1) { obj.children("UL").remove(); }
+ else { this.get_container_ul().empty(); }
+ this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); });
+ },
+ // Dummy function to fire after the first load (so that there is a jstree.loaded event)
+ loaded : function () {
+ this.__callback();
+ },
+ // deal with focus
+ set_focus : function () {
+ if(this.is_focused()) { return; }
+ var f = $.jstree._focused();
+ if(f) { f.unset_focus(); }
+
+ this.get_container().addClass("jstree-focused");
+ focused_instance = this.get_index();
+ this.__callback();
+ },
+ is_focused : function () {
+ return focused_instance == this.get_index();
+ },
+ unset_focus : function () {
+ if(this.is_focused()) {
+ this.get_container().removeClass("jstree-focused");
+ focused_instance = -1;
+ }
+ this.__callback();
+ },
+
+ // traverse
+ _get_node : function (obj) {
+ var $obj = $(obj, this.get_container());
+ if($obj.is(".jstree") || obj == -1) { return -1; }
+ $obj = $obj.closest("li", this.get_container());
+ return $obj.length ? $obj : false;
+ },
+ _get_next : function (obj, strict) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
+ if(!obj.length) { return false; }
+ if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
+
+ if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
+ else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
+ else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
+ },
+ _get_prev : function (obj, strict) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().find("> ul > li:last-child"); }
+ if(!obj.length) { return false; }
+ if(strict) { return (obj.prevAll("li").length > 0) ? obj.prevAll("li:eq(0)") : false; }
+
+ if(obj.prev("li").length) {
+ obj = obj.prev("li").eq(0);
+ while(obj.hasClass("jstree-open")) { obj = obj.children("ul:eq(0)").children("li:last"); }
+ return obj;
+ }
+ else { var o = obj.parentsUntil(".jstree","li:eq(0)"); return o.length ? o : false; }
+ },
+ _get_parent : function (obj) {
+ obj = this._get_node(obj);
+ if(obj == -1 || !obj.length) { return false; }
+ var o = obj.parentsUntil(".jstree", "li:eq(0)");
+ return o.length ? o : -1;
+ },
+ _get_children : function (obj) {
+ obj = this._get_node(obj);
+ if(obj === -1) { return this.get_container().children("ul:eq(0)").children("li"); }
+ if(!obj.length) { return false; }
+ return obj.children("ul:eq(0)").children("li");
+ },
+ get_path : function (obj, id_mode) {
+ var p = [],
+ _this = this;
+ obj = this._get_node(obj);
+ if(obj === -1 || !obj || !obj.length) { return false; }
+ obj.parentsUntil(".jstree", "li").each(function () {
+ p.push( id_mode ? this.id : _this.get_text(this) );
+ });
+ p.reverse();
+ p.push( id_mode ? obj.attr("id") : this.get_text(obj) );
+ return p;
+ },
+
+ // string functions
+ _get_string : function (key) {
+ return this._get_settings().core.strings[key] || key;
+ },
+
+ is_open : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-open"); },
+ is_closed : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-closed"); },
+ is_leaf : function (obj) { obj = this._get_node(obj); return obj && obj !== -1 && obj.hasClass("jstree-leaf"); },
+ correct_state : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { return false; }
+ obj.removeClass("jstree-closed jstree-open").addClass("jstree-leaf").children("ul").remove();
+ this.__callback({ "obj" : obj });
+ },
+ // open/close
+ open_node : function (obj, callback, skip_animation) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(!obj.hasClass("jstree-closed")) { if(callback) { callback.call(); } return false; }
+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+ t = this;
+ if(!this._is_loaded(obj)) {
+ obj.children("a").addClass("jstree-loading");
+ this.load_node(obj, function () { t.open_node(obj, callback, skip_animation); }, callback);
+ }
+ else {
+ if(this._get_settings().core.open_parents) {
+ obj.parentsUntil(".jstree",".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ }
+ if(s) { obj.children("ul").css("display","none"); }
+ obj.removeClass("jstree-closed").addClass("jstree-open").children("a").removeClass("jstree-loading");
+ if(s) { obj.children("ul").stop(true, true).slideDown(s, function () { this.style.display = ""; t.after_open(obj); }); }
+ else { t.after_open(obj); }
+ this.__callback({ "obj" : obj });
+ if(callback) { callback.call(); }
+ }
+ },
+ after_open : function (obj) { this.__callback({ "obj" : obj }); },
+ close_node : function (obj, skip_animation) {
+ obj = this._get_node(obj);
+ var s = skip_animation || is_ie6 ? 0 : this._get_settings().core.animation,
+ t = this;
+ if(!obj.length || !obj.hasClass("jstree-open")) { return false; }
+ if(s) { obj.children("ul").attr("style","display:block !important"); }
+ obj.removeClass("jstree-open").addClass("jstree-closed");
+ if(s) { obj.children("ul").stop(true, true).slideUp(s, function () { this.style.display = ""; t.after_close(obj); }); }
+ else { t.after_close(obj); }
+ this.__callback({ "obj" : obj });
+ },
+ after_close : function (obj) { this.__callback({ "obj" : obj }); },
+ toggle_node : function (obj) {
+ obj = this._get_node(obj);
+ if(obj.hasClass("jstree-closed")) { return this.open_node(obj); }
+ if(obj.hasClass("jstree-open")) { return this.close_node(obj); }
+ },
+ open_all : function (obj, do_animation, original_obj) {
+ obj = obj ? this._get_node(obj) : -1;
+ if(!obj || obj === -1) { obj = this.get_container_ul(); }
+ if(original_obj) {
+ obj = obj.find("li.jstree-closed");
+ }
+ else {
+ original_obj = obj;
+ if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); }
+ else { obj = obj.find("li.jstree-closed"); }
+ }
+ var _this = this;
+ obj.each(function () {
+ var __this = this;
+ if(!_this._is_loaded(this)) { _this.open_node(this, function() { _this.open_all(__this, do_animation, original_obj); }, !do_animation); }
+ else { _this.open_node(this, false, !do_animation); }
+ });
+ // so that callback is fired AFTER all nodes are open
+ if(original_obj.find('li.jstree-closed').length === 0) { this.__callback({ "obj" : original_obj }); }
+ },
+ close_all : function (obj, do_animation) {
+ var _this = this;
+ obj = obj ? this._get_node(obj) : this.get_container();
+ if(!obj || obj === -1) { obj = this.get_container_ul(); }
+ obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); });
+ this.__callback({ "obj" : obj });
+ },
+ clean_node : function (obj) {
+ obj = obj && obj != -1 ? $(obj) : this.get_container_ul();
+ obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li");
+ obj.removeClass("jstree-last")
+ .filter("li:last-child").addClass("jstree-last").end()
+ .filter(":has(li)")
+ .not(".jstree-open").removeClass("jstree-leaf").addClass("jstree-closed");
+ obj.not(".jstree-open, .jstree-closed").addClass("jstree-leaf").children("ul").remove();
+ this.__callback({ "obj" : obj });
+ },
+ // rollback
+ get_rollback : function () {
+ this.__callback();
+ return { i : this.get_index(), h : this.get_container().children("ul").clone(true), d : this.data };
+ },
+ set_rollback : function (html, data) {
+ this.get_container().empty().append(html);
+ this.data = data;
+ this.__callback();
+ },
+ // Dummy functions to be overwritten by any datastore plugin included
+ load_node : function (obj, s_call, e_call) { this.__callback({ "obj" : obj }); },
+ _is_loaded : function (obj) { return true; },
+
+ // Basic operations: create
+ create_node : function (obj, position, js, callback, is_loaded) {
+ obj = this._get_node(obj);
+ position = typeof position === "undefined" ? "last" : position;
+ var d = $("<li />"),
+ s = this._get_settings().core,
+ tmp;
+
+ if(obj !== -1 && !obj.length) { return false; }
+ if(!is_loaded && !this._is_loaded(obj)) { this.load_node(obj, function () { this.create_node(obj, position, js, callback, true); }); return false; }
+
+ this.__rollback();
+
+ if(typeof js === "string") { js = { "data" : js }; }
+ if(!js) { js = {}; }
+ if(js.attr) { d.attr(js.attr); }
+ if(js.metadata) { d.data(js.metadata); }
+ if(js.state) { d.addClass("jstree-" + js.state); }
+ if(!js.data) { js.data = this._get_string("new_node"); }
+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+ $.each(js.data, function (i, m) {
+ tmp = $("<a />");
+ if($.isFunction(m)) { m = m.call(this, js); }
+ if(typeof m == "string") { tmp.attr('href','#')[ s.html_titles ? "html" : "text" ](m); }
+ else {
+ if(!m.attr) { m.attr = {}; }
+ if(!m.attr.href) { m.attr.href = '#'; }
+ tmp.attr(m.attr)[ s.html_titles ? "html" : "text" ](m.title);
+ if(m.language) { tmp.addClass(m.language); }
+ }
+ tmp.prepend("<ins class='jstree-icon'> </ins>");
+ if(!m.icon && js.icon) { m.icon = js.icon; }
+ if(m.icon) {
+ if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+ else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+ }
+ d.append(tmp);
+ });
+ d.prepend("<ins class='jstree-icon'> </ins>");
+ if(obj === -1) {
+ obj = this.get_container();
+ if(position === "before") { position = "first"; }
+ if(position === "after") { position = "last"; }
+ }
+ switch(position) {
+ case "before": obj.before(d); tmp = this._get_parent(obj); break;
+ case "after" : obj.after(d); tmp = this._get_parent(obj); break;
+ case "inside":
+ case "first" :
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ obj.children("ul").prepend(d);
+ tmp = obj;
+ break;
+ case "last":
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ obj.children("ul").append(d);
+ tmp = obj;
+ break;
+ default:
+ if(!obj.children("ul").length) { obj.append("<ul />"); }
+ if(!position) { position = 0; }
+ tmp = obj.children("ul").children("li").eq(position);
+ if(tmp.length) { tmp.before(d); }
+ else { obj.children("ul").append(d); }
+ tmp = obj;
+ break;
+ }
+ if(tmp === -1 || tmp.get(0) === this.get_container().get(0)) { tmp = -1; }
+ this.clean_node(tmp);
+ this.__callback({ "obj" : d, "parent" : tmp });
+ if(callback) { callback.call(this, d); }
+ return d;
+ },
+ // Basic operations: rename (deal with text)
+ get_text : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ var s = this._get_settings().core.html_titles;
+ obj = obj.children("a:eq(0)");
+ if(s) {
+ obj = obj.clone();
+ obj.children("INS").remove();
+ return obj.html();
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ return obj.nodeValue;
+ }
+ },
+ set_text : function (obj, val) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ obj = obj.children("a:eq(0)");
+ if(this._get_settings().core.html_titles) {
+ var tmp = obj.children("INS").clone();
+ obj.html(val).prepend(tmp);
+ this.__callback({ "obj" : obj, "name" : val });
+ return true;
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ this.__callback({ "obj" : obj, "name" : val });
+ return (obj.nodeValue = val);
+ }
+ },
+ rename_node : function (obj, val) {
+ obj = this._get_node(obj);
+ this.__rollback();
+ if(obj && obj.length && this.set_text.apply(this, Array.prototype.slice.call(arguments))) { this.__callback({ "obj" : obj, "name" : val }); }
+ },
+ // Basic operations: deleting nodes
+ delete_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ this.__rollback();
+ var p = this._get_parent(obj), prev = $([]), t = this;
+ obj.each(function () {
+ prev = prev.add(t._get_prev(this));
+ });
+ obj = obj.detach();
+ if(p !== -1 && p.find("> ul > li").length === 0) {
+ p.removeClass("jstree-open jstree-closed").addClass("jstree-leaf");
+ }
+ this.clean_node(p);
+ this.__callback({ "obj" : obj, "prev" : prev, "parent" : p });
+ return obj;
+ },
+ prepare_move : function (o, r, pos, cb, is_cb) {
+ var p = {};
+
+ p.ot = $.jstree._reference(o) || this;
+ p.o = p.ot._get_node(o);
+ p.r = r === - 1 ? -1 : this._get_node(r);
+ p.p = (typeof pos === "undefined" || pos === false) ? "last" : pos; // TODO: move to a setting
+ if(!is_cb && prepared_move.o && prepared_move.o[0] === p.o[0] && prepared_move.r[0] === p.r[0] && prepared_move.p === p.p) {
+ this.__callback(prepared_move);
+ if(cb) { cb.call(this, prepared_move); }
+ return;
+ }
+ p.ot = $.jstree._reference(p.o) || this;
+ p.rt = $.jstree._reference(p.r) || this; // r === -1 ? p.ot : $.jstree._reference(p.r) || this
+ if(p.r === -1 || !p.r) {
+ p.cr = -1;
+ switch(p.p) {
+ case "first":
+ case "before":
+ case "inside":
+ p.cp = 0;
+ break;
+ case "after":
+ case "last":
+ p.cp = p.rt.get_container().find(" > ul > li").length;
+ break;
+ default:
+ p.cp = p.p;
+ break;
+ }
+ }
+ else {
+ if(!/^(before|after)$/.test(p.p) && !this._is_loaded(p.r)) {
+ return this.load_node(p.r, function () { this.prepare_move(o, r, pos, cb, true); });
+ }
+ switch(p.p) {
+ case "before":
+ p.cp = p.r.index();
+ p.cr = p.rt._get_parent(p.r);
+ break;
+ case "after":
+ p.cp = p.r.index() + 1;
+ p.cr = p.rt._get_parent(p.r);
+ break;
+ case "inside":
+ case "first":
+ p.cp = 0;
+ p.cr = p.r;
+ break;
+ case "last":
+ p.cp = p.r.find(" > ul > li").length;
+ p.cr = p.r;
+ break;
+ default:
+ p.cp = p.p;
+ p.cr = p.r;
+ break;
+ }
+ }
+ p.np = p.cr == -1 ? p.rt.get_container() : p.cr;
+ p.op = p.ot._get_parent(p.o);
+ p.cop = p.o.index();
+ if(p.op === -1) { p.op = p.ot ? p.ot.get_container() : this.get_container(); }
+ if(!/^(before|after)$/.test(p.p) && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp++; }
+ //if(p.p === "before" && p.op && p.np && p.op[0] === p.np[0] && p.o.index() < p.cp) { p.cp--; }
+ p.or = p.np.find(" > ul > li:nth-child(" + (p.cp + 1) + ")");
+ prepared_move = p;
+ this.__callback(prepared_move);
+ if(cb) { cb.call(this, prepared_move); }
+ },
+ check_move : function () {
+ var obj = prepared_move, ret = true, r = obj.r === -1 ? this.get_container() : obj.r;
+ if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; }
+ if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; }
+ obj.o.each(function () {
+ if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; }
+ });
+ return ret;
+ },
+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+ if(!is_prepared) {
+ return this.prepare_move(obj, ref, position, function (p) {
+ this.move_node(p, false, false, is_copy, true, skip_check);
+ });
+ }
+ if(is_copy) {
+ prepared_move.cy = true;
+ }
+ if(!skip_check && !this.check_move()) { return false; }
+
+ this.__rollback();
+ var o = false;
+ if(is_copy) {
+ o = obj.o.clone(true);
+ o.find("*[id]").andSelf().each(function () {
+ if(this.id) { this.id = "copy_" + this.id; }
+ });
+ }
+ else { o = obj.o; }
+
+ if(obj.or.length) { obj.or.before(o); }
+ else {
+ if(!obj.np.children("ul").length) { $("<ul />").appendTo(obj.np); }
+ obj.np.children("ul:eq(0)").append(o);
+ }
+
+ try {
+ obj.ot.clean_node(obj.op);
+ obj.rt.clean_node(obj.np);
+ if(!obj.op.find("> ul > li").length) {
+ obj.op.removeClass("jstree-open jstree-closed").addClass("jstree-leaf").children("ul").remove();
+ }
+ } catch (e) { }
+
+ if(is_copy) {
+ prepared_move.cy = true;
+ prepared_move.oc = o;
+ }
+ this.__callback(prepared_move);
+ return prepared_move;
+ },
+ _get_move : function () { return prepared_move; }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree ui plugin
+ * This plugins handles selecting/deselecting/hovering/dehovering nodes
+ */
+(function ($) {
+ var scrollbar_width, e1, e2;
+ $(function() {
+ if (/msie/.test(navigator.userAgent.toLowerCase())) {
+ e1 = $('<textarea cols="10" rows="2"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+ e2 = $('<textarea cols="10" rows="2" style="overflow: hidden;"></textarea>').css({ position: 'absolute', top: -1000, left: 0 }).appendTo('body');
+ scrollbar_width = e1.width() - e2.width();
+ e1.add(e2).remove();
+ }
+ else {
+ e1 = $('<div />').css({ width: 100, height: 100, overflow: 'auto', position: 'absolute', top: -1000, left: 0 })
+ .prependTo('body').append('<div />').find('div').css({ width: '100%', height: 200 });
+ scrollbar_width = 100 - e1.width();
+ e1.parent().remove();
+ }
+ });
+ $.jstree.plugin("ui", {
+ __init : function () {
+ this.data.ui.selected = $();
+ this.data.ui.last_selected = false;
+ this.data.ui.hovered = null;
+ this.data.ui.to_select = this.get_settings().ui.initially_select;
+
+ this.get_container()
+ .delegate("a", "click.jstree", $.proxy(function (event) {
+ event.preventDefault();
+ event.currentTarget.blur();
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.select_node(event.currentTarget, true, event);
+ }
+ }, this))
+ .delegate("a", "mouseenter.jstree", $.proxy(function (event) {
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.hover_node(event.target);
+ }
+ }, this))
+ .delegate("a", "mouseleave.jstree", $.proxy(function (event) {
+ if(!$(event.currentTarget).hasClass("jstree-loading")) {
+ this.dehover_node(event.target);
+ }
+ }, this))
+ .bind("reopen.jstree", $.proxy(function () {
+ this.reselect();
+ }, this))
+ .bind("get_rollback.jstree", $.proxy(function () {
+ this.dehover_node();
+ this.save_selected();
+ }, this))
+ .bind("set_rollback.jstree", $.proxy(function () {
+ this.reselect();
+ }, this))
+ .bind("close_node.jstree", $.proxy(function (event, data) {
+ var s = this._get_settings().ui,
+ obj = this._get_node(data.rslt.obj),
+ clk = (obj && obj.length) ? obj.children("ul").find("a.jstree-clicked") : $(),
+ _this = this;
+ if(s.selected_parent_close === false || !clk.length) { return; }
+ clk.each(function () {
+ _this.deselect_node(this);
+ if(s.selected_parent_close === "select_parent") { _this.select_node(obj); }
+ });
+ }, this))
+ .bind("delete_node.jstree", $.proxy(function (event, data) {
+ var s = this._get_settings().ui.select_prev_on_delete,
+ obj = this._get_node(data.rslt.obj),
+ clk = (obj && obj.length) ? obj.find("a.jstree-clicked") : [],
+ _this = this;
+ clk.each(function () { _this.deselect_node(this); });
+ if(s && clk.length) {
+ data.rslt.prev.each(function () {
+ if(this.parentNode) { _this.select_node(this); return false; /* if return false is removed all prev nodes will be selected */}
+ });
+ }
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (event, data) {
+ if(data.rslt.cy) {
+ data.rslt.oc.find("a.jstree-clicked").removeClass("jstree-clicked");
+ }
+ }, this));
+ },
+ defaults : {
+ select_limit : -1, // 0, 1, 2 ... or -1 for unlimited
+ select_multiple_modifier : "ctrl", // on, or ctrl, shift, alt
+ select_range_modifier : "shift",
+ selected_parent_close : "select_parent", // false, "deselect", "select_parent"
+ selected_parent_open : true,
+ select_prev_on_delete : true,
+ disable_selecting_children : false,
+ initially_select : []
+ },
+ _fn : {
+ _get_node : function (obj, allow_multiple) {
+ if(typeof obj === "undefined" || obj === null) { return allow_multiple ? this.data.ui.selected : this.data.ui.last_selected; }
+ var $obj = $(obj, this.get_container());
+ if($obj.is(".jstree") || obj == -1) { return -1; }
+ $obj = $obj.closest("li", this.get_container());
+ return $obj.length ? $obj : false;
+ },
+ _ui_notify : function (n, data) {
+ if(data.selected) {
+ this.select_node(n, false);
+ }
+ },
+ save_selected : function () {
+ var _this = this;
+ this.data.ui.to_select = [];
+ this.data.ui.selected.each(function () { if(this.id) { _this.data.ui.to_select.push("#" + this.id.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:")); } });
+ this.__callback(this.data.ui.to_select);
+ },
+ reselect : function () {
+ var _this = this,
+ s = this.data.ui.to_select;
+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ // this.deselect_all(); WHY deselect, breaks plugin state notifier?
+ $.each(s, function (i, val) { if(val && val !== "#") { _this.select_node(val); } });
+ this.data.ui.selected = this.data.ui.selected.filter(function () { return this.parentNode; });
+ this.__callback();
+ },
+ refresh : function (obj) {
+ this.save_selected();
+ return this.__call_old();
+ },
+ hover_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ //if(this.data.ui.hovered && obj.get(0) === this.data.ui.hovered.get(0)) { return; }
+ if(!obj.hasClass("jstree-hovered")) { this.dehover_node(); }
+ this.data.ui.hovered = obj.children("a").addClass("jstree-hovered").parent();
+ this._fix_scroll(obj);
+ this.__callback({ "obj" : obj });
+ },
+ dehover_node : function () {
+ var obj = this.data.ui.hovered, p;
+ if(!obj || !obj.length) { return false; }
+ p = obj.children("a").removeClass("jstree-hovered").parent();
+ if(this.data.ui.hovered[0] === p[0]) { this.data.ui.hovered = null; }
+ this.__callback({ "obj" : obj });
+ },
+ select_node : function (obj, check, e) {
+ obj = this._get_node(obj);
+ if(obj == -1 || !obj || !obj.length) { return false; }
+ var s = this._get_settings().ui,
+ is_multiple = (s.select_multiple_modifier == "on" || (s.select_multiple_modifier !== false && e && e[s.select_multiple_modifier + "Key"])),
+ is_range = (s.select_range_modifier !== false && e && e[s.select_range_modifier + "Key"] && this.data.ui.last_selected && this.data.ui.last_selected[0] !== obj[0] && this.data.ui.last_selected.parent()[0] === obj.parent()[0]),
+ is_selected = this.is_selected(obj),
+ proceed = true,
+ t = this;
+ if(check) {
+ if(s.disable_selecting_children && is_multiple &&
+ (
+ (obj.parentsUntil(".jstree","li").children("a.jstree-clicked").length) ||
+ (obj.children("ul").find("a.jstree-clicked:eq(0)").length)
+ )
+ ) {
+ return false;
+ }
+ proceed = false;
+ switch(!0) {
+ case (is_range):
+ this.data.ui.last_selected.addClass("jstree-last-selected");
+ obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf();
+ if(s.select_limit == -1 || obj.length < s.select_limit) {
+ this.data.ui.last_selected.removeClass("jstree-last-selected");
+ this.data.ui.selected.each(function () {
+ if(this !== t.data.ui.last_selected[0]) { t.deselect_node(this); }
+ });
+ is_selected = false;
+ proceed = true;
+ }
+ else {
+ proceed = false;
+ }
+ break;
+ case (is_selected && !is_multiple):
+ this.deselect_all();
+ is_selected = false;
+ proceed = true;
+ break;
+ case (!is_selected && !is_multiple):
+ if(s.select_limit == -1 || s.select_limit > 0) {
+ this.deselect_all();
+ proceed = true;
+ }
+ break;
+ case (is_selected && is_multiple):
+ this.deselect_node(obj);
+ break;
+ case (!is_selected && is_multiple):
+ if(s.select_limit == -1 || this.data.ui.selected.length + 1 <= s.select_limit) {
+ proceed = true;
+ }
+ break;
+ }
+ }
+ if(proceed && !is_selected) {
+ if(!is_range) { this.data.ui.last_selected = obj; }
+ obj.children("a").addClass("jstree-clicked");
+ if(s.selected_parent_open) {
+ obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+ }
+ this.data.ui.selected = this.data.ui.selected.add(obj);
+ this._fix_scroll(obj.eq(0));
+ this.__callback({ "obj" : obj, "e" : e });
+ }
+ },
+ _fix_scroll : function (obj) {
+ var c = this.get_container()[0], t;
+ if(c.scrollHeight > c.offsetHeight) {
+ obj = this._get_node(obj);
+ if(!obj || obj === -1 || !obj.length || !obj.is(":visible")) { return; }
+ t = obj.offset().top - this.get_container().offset().top;
+ if(t < 0) {
+ c.scrollTop = c.scrollTop + t - 1;
+ }
+ if(t + this.data.core.li_height + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0) > c.offsetHeight) {
+ c.scrollTop = c.scrollTop + (t - c.offsetHeight + this.data.core.li_height + 1 + (c.scrollWidth > c.offsetWidth ? scrollbar_width : 0));
+ }
+ }
+ },
+ deselect_node : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(this.is_selected(obj)) {
+ obj.children("a").removeClass("jstree-clicked");
+ this.data.ui.selected = this.data.ui.selected.not(obj);
+ if(this.data.ui.last_selected.get(0) === obj.get(0)) { this.data.ui.last_selected = this.data.ui.selected.eq(0); }
+ this.__callback({ "obj" : obj });
+ }
+ },
+ toggle_select : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return false; }
+ if(this.is_selected(obj)) { this.deselect_node(obj); }
+ else { this.select_node(obj); }
+ },
+ is_selected : function (obj) { return this.data.ui.selected.index(this._get_node(obj)) >= 0; },
+ get_selected : function (context) {
+ return context ? $(context).find("a.jstree-clicked").parent() : this.data.ui.selected;
+ },
+ deselect_all : function (context) {
+ var ret = context ? $(context).find("a.jstree-clicked").parent() : this.get_container().find("a.jstree-clicked").parent();
+ ret.children("a.jstree-clicked").removeClass("jstree-clicked");
+ this.data.ui.selected = $([]);
+ this.data.ui.last_selected = false;
+ this.__callback({ "obj" : ret });
+ }
+ }
+ });
+ // include the selection plugin by default
+ $.jstree.defaults.plugins.push("ui");
+})(jQuery);
+//*/
+
+/*
+ * jsTree CRRM plugin
+ * Handles creating/renaming/removing/moving nodes by user interaction.
+ */
+(function ($) {
+ $.jstree.plugin("crrm", {
+ __init : function () {
+ this.get_container()
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ if(this._get_settings().crrm.move.open_onmove) {
+ var t = this;
+ data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ }
+ }, this));
+ },
+ defaults : {
+ input_width_limit : 200,
+ move : {
+ always_copy : false, // false, true or "multitree"
+ open_onmove : true,
+ default_position : "last",
+ check_move : function (m) { return true; }
+ }
+ },
+ _fn : {
+ _show_input : function (obj, callback) {
+ obj = this._get_node(obj);
+ var rtl = this._get_settings().core.rtl,
+ w = this._get_settings().crrm.input_width_limit,
+ w1 = obj.children("ins").width(),
+ w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
+ t = this.get_text(obj),
+ h1 = $("<div />", { css : { "position" : "absolute", "top" : "-200px", "left" : (rtl ? "0px" : "-1000px"), "visibility" : "hidden" } }).appendTo("body"),
+ h2 = obj.css("position","relative").append(
+ $("<input />", {
+ "value" : t,
+ "class" : "jstree-rename-input",
+ // "size" : t.length,
+ "css" : {
+ "padding" : "0",
+ "border" : "1px solid silver",
+ "position" : "absolute",
+ "left" : (rtl ? "auto" : (w1 + w2 + 4) + "px"),
+ "right" : (rtl ? (w1 + w2 + 4) + "px" : "auto"),
+ "top" : "0px",
+ "height" : (this.data.core.li_height - 2) + "px",
+ "lineHeight" : (this.data.core.li_height - 2) + "px",
+ "width" : "150px" // will be set a bit further down
+ },
+ "blur" : $.proxy(function () {
+ var i = obj.children(".jstree-rename-input"),
+ v = i.val();
+ if(v === "") { v = t; }
+ h1.remove();
+ i.remove(); // rollback purposes
+ this.set_text(obj,t); // rollback purposes
+ this.rename_node(obj, v);
+ callback.call(this, obj, v, t);
+ obj.css("position","");
+ }, this),
+ "keyup" : function (event) {
+ var key = event.keyCode || event.which;
+ if(key == 27) { this.value = t; this.blur(); return; }
+ else if(key == 13) { this.blur(); return; }
+ else {
+ h2.width(Math.min(h1.text("pW" + this.value).width(),w));
+ }
+ },
+ "keypress" : function(event) {
+ var key = event.keyCode || event.which;
+ if(key == 13) { return false; }
+ }
+ })
+ ).children(".jstree-rename-input");
+ this.set_text(obj, "");
+ h1.css({
+ fontFamily : h2.css('fontFamily') || '',
+ fontSize : h2.css('fontSize') || '',
+ fontWeight : h2.css('fontWeight') || '',
+ fontStyle : h2.css('fontStyle') || '',
+ fontStretch : h2.css('fontStretch') || '',
+ fontVariant : h2.css('fontVariant') || '',
+ letterSpacing : h2.css('letterSpacing') || '',
+ wordSpacing : h2.css('wordSpacing') || ''
+ });
+ h2.width(Math.min(h1.text("pW" + h2[0].value).width(),w))[0].select();
+ },
+ rename : function (obj) {
+ obj = this._get_node(obj);
+ this.__rollback();
+ var f = this.__callback;
+ this._show_input(obj, function (obj, new_name, old_name) {
+ f.call(this, { "obj" : obj, "new_name" : new_name, "old_name" : old_name });
+ });
+ },
+ create : function (obj, position, js, callback, skip_rename) {
+ var t, _this = this;
+ obj = this._get_node(obj);
+ if(!obj) { obj = -1; }
+ this.__rollback();
+ t = this.create_node(obj, position, js, function (t) {
+ var p = this._get_parent(t),
+ pos = $(t).index();
+ if(callback) { callback.call(this, t); }
+ if(p.length && p.hasClass("jstree-closed")) { this.open_node(p, false, true); }
+ if(!skip_rename) {
+ this._show_input(t, function (obj, new_name, old_name) {
+ _this.__callback({ "obj" : obj, "name" : new_name, "parent" : p, "position" : pos });
+ });
+ }
+ else { _this.__callback({ "obj" : t, "name" : this.get_text(t), "parent" : p, "position" : pos }); }
+ });
+ return t;
+ },
+ remove : function (obj) {
+ obj = this._get_node(obj, true);
+ var p = this._get_parent(obj), prev = this._get_prev(obj);
+ this.__rollback();
+ obj = this.delete_node(obj);
+ if(obj !== false) { this.__callback({ "obj" : obj, "prev" : prev, "parent" : p }); }
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var s = this._get_settings().crrm.move;
+ if(!s.check_move.call(this, this._get_move())) { return false; }
+ return true;
+ },
+ move_node : function (obj, ref, position, is_copy, is_prepared, skip_check) {
+ var s = this._get_settings().crrm.move;
+ if(!is_prepared) {
+ if(typeof position === "undefined") { position = s.default_position; }
+ if(position === "inside" && !s.default_position.match(/^(before|after)$/)) { position = s.default_position; }
+ return this.__call_old(true, obj, ref, position, is_copy, false, skip_check);
+ }
+ // if the move is already prepared
+ if(s.always_copy === true || (s.always_copy === "multitree" && obj.rt.get_index() !== obj.ot.get_index() )) {
+ is_copy = true;
+ }
+ this.__call_old(true, obj, ref, position, is_copy, true, skip_check);
+ },
+
+ cut : function (obj) {
+ obj = this._get_node(obj, true);
+ if(!obj || !obj.length) { return false; }
+ this.data.crrm.cp_nodes = false;
+ this.data.crrm.ct_nodes = obj;
+ this.__callback({ "obj" : obj });
+ },
+ copy : function (obj) {
+ obj = this._get_node(obj, true);
+ if(!obj || !obj.length) { return false; }
+ this.data.crrm.ct_nodes = false;
+ this.data.crrm.cp_nodes = obj;
+ this.__callback({ "obj" : obj });
+ },
+ paste : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj || !obj.length) { return false; }
+ var nodes = this.data.crrm.ct_nodes ? this.data.crrm.ct_nodes : this.data.crrm.cp_nodes;
+ if(!this.data.crrm.ct_nodes && !this.data.crrm.cp_nodes) { return false; }
+ if(this.data.crrm.ct_nodes) { this.move_node(this.data.crrm.ct_nodes, obj); this.data.crrm.ct_nodes = false; }
+ if(this.data.crrm.cp_nodes) { this.move_node(this.data.crrm.cp_nodes, obj, false, true); }
+ this.__callback({ "obj" : obj, "nodes" : nodes });
+ }
+ }
+ });
+ // include the crr plugin by default
+ // $.jstree.defaults.plugins.push("crrm");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themes plugin
+ * Handles loading and setting themes, as well as detecting path to themes, etc.
+ */
+(function ($) {
+ var themes_loaded = [];
+ // this variable stores the path to the themes folder - if left as false - it will be autodetected
+ $.jstree._themes = false;
+ $.jstree.plugin("themes", {
+ __init : function () {
+ this.get_container()
+ .bind("init.jstree", $.proxy(function () {
+ var s = this._get_settings().themes;
+ this.data.themes.dots = s.dots;
+ this.data.themes.icons = s.icons;
+ this.set_theme(s.theme, s.url);
+ }, this))
+ .bind("loaded.jstree", $.proxy(function () {
+ // bound here too, as simple HTML tree's won't honor dots & icons otherwise
+ if(!this.data.themes.dots) { this.hide_dots(); }
+ else { this.show_dots(); }
+ if(!this.data.themes.icons) { this.hide_icons(); }
+ else { this.show_icons(); }
+ }, this));
+ },
+ defaults : {
+ theme : "default",
+ url : false,
+ dots : true,
+ icons : true
+ },
+ _fn : {
+ set_theme : function (theme_name, theme_url) {
+ if(!theme_name) { return false; }
+ if(!theme_url) { theme_url = $.jstree._themes + theme_name + '/style.css'; }
+ if($.inArray(theme_url, themes_loaded) == -1) {
+ $.vakata.css.add_sheet({ "url" : theme_url });
+ themes_loaded.push(theme_url);
+ }
+ if(this.data.themes.theme != theme_name) {
+ this.get_container().removeClass('jstree-' + this.data.themes.theme);
+ this.data.themes.theme = theme_name;
+ }
+ this.get_container().addClass('jstree-' + theme_name);
+ if(!this.data.themes.dots) { this.hide_dots(); }
+ else { this.show_dots(); }
+ if(!this.data.themes.icons) { this.hide_icons(); }
+ else { this.show_icons(); }
+ this.__callback();
+ },
+ get_theme : function () { return this.data.themes.theme; },
+
+ show_dots : function () { this.data.themes.dots = true; this.get_container().children("ul").removeClass("jstree-no-dots"); },
+ hide_dots : function () { this.data.themes.dots = false; this.get_container().children("ul").addClass("jstree-no-dots"); },
+ toggle_dots : function () { if(this.data.themes.dots) { this.hide_dots(); } else { this.show_dots(); } },
+
+ show_icons : function () { this.data.themes.icons = true; this.get_container().children("ul").removeClass("jstree-no-icons"); },
+ hide_icons : function () { this.data.themes.icons = false; this.get_container().children("ul").addClass("jstree-no-icons"); },
+ toggle_icons: function () { if(this.data.themes.icons) { this.hide_icons(); } else { this.show_icons(); } }
+ }
+ });
+ // autodetect themes path
+ $(function () {
+ if($.jstree._themes === false) {
+ $("script").each(function () {
+ if(this.src.toString().match(/jquery\.jstree[^\/]*?\.js(\?.*)?$/)) {
+ $.jstree._themes = this.src.toString().replace(/jquery\.jstree[^\/]*?\.js(\?.*)?$/, "") + 'themes/';
+ return false;
+ }
+ });
+ }
+ if($.jstree._themes === false) { $.jstree._themes = "themes/"; }
+ });
+ // include the themes plugin by default
+ $.jstree.defaults.plugins.push("themes");
+})(jQuery);
+//*/
+
+/*
+ * jsTree hotkeys plugin
+ * Enables keyboard navigation for all tree instances
+ * Depends on the jstree ui & jquery hotkeys plugins
+ */
+(function ($) {
+ var bound = [];
+ function exec(i, event) {
+ var f = $.jstree._focused(), tmp;
+ if(f && f.data && f.data.hotkeys && f.data.hotkeys.enabled) {
+ tmp = f._get_settings().hotkeys[i];
+ if(tmp) { return tmp.call(f, event); }
+ }
+ }
+ $.jstree.plugin("hotkeys", {
+ __init : function () {
+ if(typeof $.hotkeys === "undefined") { throw "jsTree hotkeys: jQuery hotkeys plugin not included."; }
+ if(!this.data.ui) { throw "jsTree hotkeys: jsTree UI plugin not included."; }
+ $.each(this._get_settings().hotkeys, function (i, v) {
+ if(v !== false && $.inArray(i, bound) == -1) {
+ $(document).bind("keydown", i, function (event) { return exec(i, event); });
+ bound.push(i);
+ }
+ });
+ this.get_container()
+ .bind("lock.jstree", $.proxy(function () {
+ if(this.data.hotkeys.enabled) { this.data.hotkeys.enabled = false; this.data.hotkeys.revert = true; }
+ }, this))
+ .bind("unlock.jstree", $.proxy(function () {
+ if(this.data.hotkeys.revert) { this.data.hotkeys.enabled = true; }
+ }, this));
+ this.enable_hotkeys();
+ },
+ defaults : {
+ "up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "ctrl+up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "shift+up" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_prev(o));
+ return false;
+ },
+ "down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "ctrl+down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "shift+down" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected || -1;
+ this.hover_node(this._get_next(o));
+ return false;
+ },
+ "left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "ctrl+left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "shift+left" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o) {
+ if(o.hasClass("jstree-open")) { this.close_node(o); }
+ else { this.hover_node(this._get_prev(o)); }
+ }
+ return false;
+ },
+ "right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "ctrl+right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "shift+right" : function () {
+ var o = this.data.ui.hovered || this.data.ui.last_selected;
+ if(o && o.length) {
+ if(o.hasClass("jstree-closed")) { this.open_node(o); }
+ else { this.hover_node(this._get_next(o)); }
+ }
+ return false;
+ },
+ "space" : function () {
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").click(); }
+ return false;
+ },
+ "ctrl+space" : function (event) {
+ event.type = "click";
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+ return false;
+ },
+ "shift+space" : function (event) {
+ event.type = "click";
+ if(this.data.ui.hovered) { this.data.ui.hovered.children("a:eq(0)").trigger(event); }
+ return false;
+ },
+ "f2" : function () { this.rename(this.data.ui.hovered || this.data.ui.last_selected); },
+ "del" : function () { this.remove(this.data.ui.hovered || this._get_node(null)); }
+ },
+ _fn : {
+ enable_hotkeys : function () {
+ this.data.hotkeys.enabled = true;
+ },
+ disable_hotkeys : function () {
+ this.data.hotkeys.enabled = false;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree JSON plugin
+ * The JSON data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.jstree.plugin("json_data", {
+ __init : function() {
+ var s = this._get_settings().json_data;
+ if(s.progressive_unload) {
+ this.get_container().bind("after_close.jstree", function (e, data) {
+ data.rslt.obj.children("ul").remove();
+ });
+ }
+ },
+ defaults : {
+ // `data` can be a function:
+ // * accepts two arguments - node being loaded and a callback to pass the result to
+ // * will be executed in the current tree's scope & ajax won't be supported
+ data : false,
+ ajax : false,
+ correct_state : true,
+ progressive_render : false,
+ progressive_unload : false
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_json(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ var s = this._get_settings().json_data;
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!s.ajax && !s.progressive_render && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
+ },
+ refresh : function (obj) {
+ obj = this._get_node(obj);
+ var s = this._get_settings().json_data;
+ if(obj && obj !== -1 && s.progressive_unload && ($.isFunction(s.data) || !!s.ajax)) {
+ obj.removeData("jstree_children");
+ }
+ return this.__call_old();
+ },
+ load_node_json : function (obj, s_call, e_call) {
+ var s = this.get_settings().json_data, d,
+ error_func = function () {},
+ success_func = function () {};
+ obj = this._get_node(obj);
+
+ if(obj && obj !== -1 && (s.progressive_render || s.progressive_unload) && !obj.is(".jstree-open, .jstree-leaf") && obj.children("ul").children("li").length === 0 && obj.data("jstree_children")) {
+ d = this._parse_json(obj.data("jstree_children"), obj);
+ if(d) {
+ obj.append(d);
+ if(!s.progressive_unload) { obj.removeData("jstree_children"); }
+ }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ return;
+ }
+
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+ // function option added here for easier model integration (also supporting async - see callback)
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ d = this._parse_json(d, obj);
+ if(!d) {
+ if(obj === -1 || !obj) {
+ if(s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ else {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) { this.correct_state(obj); }
+ }
+ if(e_call) { e_call.call(this); }
+ }
+ else {
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }, this));
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ d = this._parse_json(s.data, obj);
+ if(d) {
+ this.get_container().children("ul").empty().append(d.children());
+ this.clean_node();
+ }
+ else {
+ if(s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().json_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj != -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().json_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "") || (!$.isArray(d) && !$.isPlainObject(d))) {
+ return error_func.call(this, x, t, "");
+ }
+ d = this._parse_json(d, obj);
+ if(d) {
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.append(d).children("a.jstree-loading").removeClass("jstree-loading"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj === -1 || !obj) {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "json"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ },
+ _parse_json : function (js, obj, is_callback) {
+ var d = false,
+ p = this._get_settings(),
+ s = p.json_data,
+ t = p.core.html_titles,
+ tmp, i, j, ul1, ul2;
+
+ if(!js) { return d; }
+ if(s.progressive_unload && obj && obj !== -1) {
+ obj.data("jstree_children", d);
+ }
+ if($.isArray(js)) {
+ d = $();
+ if(!js.length) { return false; }
+ for(i = 0, j = js.length; i < j; i++) {
+ tmp = this._parse_json(js[i], obj, true);
+ if(tmp.length) { d = d.add(tmp); }
+ }
+ }
+ else {
+ if(typeof js == "string") { js = { data : js }; }
+ if(!js.data && js.data !== "") { return d; }
+ d = $("<li />");
+ if(js.attr) { d.attr(js.attr); }
+ if(js.metadata) { d.data(js.metadata); }
+ if(js.state) { d.addClass("jstree-" + js.state); }
+ if(!$.isArray(js.data)) { tmp = js.data; js.data = []; js.data.push(tmp); }
+ $.each(js.data, function (i, m) {
+ tmp = $("<a />");
+ if($.isFunction(m)) { m = m.call(this, js); }
+ if(typeof m == "string") { tmp.attr('href','#')[ t ? "html" : "text" ](m); }
+ else {
+ if(!m.attr) { m.attr = {}; }
+ if(!m.attr.href) { m.attr.href = '#'; }
+ tmp.attr(m.attr)[ t ? "html" : "text" ](m.title);
+ if(m.language) { tmp.addClass(m.language); }
+ }
+ tmp.prepend("<ins class='jstree-icon'> </ins>");
+ if(!m.icon && js.icon) { m.icon = js.icon; }
+ if(m.icon) {
+ if(m.icon.indexOf("/") === -1) { tmp.children("ins").addClass(m.icon); }
+ else { tmp.children("ins").css("background","url('" + m.icon + "') center center no-repeat"); }
+ }
+ d.append(tmp);
+ });
+ d.prepend("<ins class='jstree-icon'> </ins>");
+ if(js.children) {
+ if(s.progressive_render && js.state !== "open") {
+ d.addClass("jstree-closed").data("jstree_children", js.children);
+ }
+ else {
+ if(s.progressive_unload) { d.data("jstree_children", js.children); }
+ if($.isArray(js.children) && js.children.length) {
+ tmp = this._parse_json(js.children, obj, true);
+ if(tmp.length) {
+ ul2 = $("<ul />");
+ ul2.append(tmp);
+ d.append(ul2);
+ }
+ }
+ }
+ }
+ }
+ if(!is_callback) {
+ ul1 = $("<ul />");
+ ul1.append(d);
+ d = ul1;
+ }
+ return d;
+ },
+ get_json : function (obj, li_attr, a_attr, is_callback) {
+ var result = [],
+ s = this._get_settings(),
+ _this = this,
+ tmp1, tmp2, li, a, t, lang;
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+ if(!is_callback && this.data.types) { li_attr.push(s.types.type_attr); }
+ a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+ obj.each(function () {
+ li = $(this);
+ tmp1 = { data : [] };
+ if(li_attr.length) { tmp1.attr = { }; }
+ $.each(li_attr, function (i, v) {
+ tmp2 = li.attr(v);
+ if(tmp2 && tmp2.length && tmp2.replace(/jstree[^ ]*/ig,'').length) {
+ tmp1.attr[v] = (" " + tmp2).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ }
+ });
+ if(li.hasClass("jstree-open")) { tmp1.state = "open"; }
+ if(li.hasClass("jstree-closed")) { tmp1.state = "closed"; }
+ if(li.data()) { tmp1.metadata = li.data(); }
+ a = li.children("a");
+ a.each(function () {
+ t = $(this);
+ if(
+ a_attr.length ||
+ $.inArray("languages", s.plugins) !== -1 ||
+ t.children("ins").get(0).style.backgroundImage.length ||
+ (t.children("ins").get(0).className && t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').length)
+ ) {
+ lang = false;
+ if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+ $.each(s.languages, function (l, lv) {
+ if(t.hasClass(lv)) {
+ lang = lv;
+ return false;
+ }
+ });
+ }
+ tmp2 = { attr : { }, title : _this.get_text(t, lang) };
+ $.each(a_attr, function (k, z) {
+ tmp2.attr[z] = (" " + (t.attr(z) || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ });
+ if($.inArray("languages", s.plugins) !== -1 && $.isArray(s.languages) && s.languages.length) {
+ $.each(s.languages, function (k, z) {
+ if(t.hasClass(z)) { tmp2.language = z; return true; }
+ });
+ }
+ if(t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+ tmp2.icon = t.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"");
+ }
+ if(t.children("ins").get(0).style.backgroundImage.length) {
+ tmp2.icon = t.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","");
+ }
+ }
+ else {
+ tmp2 = _this.get_text(t);
+ }
+ if(a.length > 1) { tmp1.data.push(tmp2); }
+ else { tmp1.data = tmp2; }
+ });
+ li = li.find("> ul > li");
+ if(li.length) { tmp1.children = _this.get_json(li, li_attr, a_attr, true); }
+ result.push(tmp1);
+ });
+ return result;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree languages plugin
+ * Adds support for multiple language versions in one tree
+ * This basically allows for many titles coexisting in one node, but only one of them being visible at any given time
+ * This is useful for maintaining the same structure in many languages (hence the name of the plugin)
+ */
+(function ($) {
+ $.jstree.plugin("languages", {
+ __init : function () { this._load_css(); },
+ defaults : [],
+ _fn : {
+ set_lang : function (i) {
+ var langs = this._get_settings().languages,
+ st = false,
+ selector = ".jstree-" + this.get_index() + ' a';
+ if(!$.isArray(langs) || langs.length === 0) { return false; }
+ if($.inArray(i,langs) == -1) {
+ if(!!langs[i]) { i = langs[i]; }
+ else { return false; }
+ }
+ if(i == this.data.languages.current_language) { return true; }
+ st = $.vakata.css.get_css(selector + "." + this.data.languages.current_language, false, this.data.languages.language_css);
+ if(st !== false) { st.style.display = "none"; }
+ st = $.vakata.css.get_css(selector + "." + i, false, this.data.languages.language_css);
+ if(st !== false) { st.style.display = ""; }
+ this.data.languages.current_language = i;
+ this.__callback(i);
+ return true;
+ },
+ get_lang : function () {
+ return this.data.languages.current_language;
+ },
+ _get_string : function (key, lang) {
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.strings;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ }
+ if(s[lang] && s[lang][key]) { return s[lang][key]; }
+ if(s[key]) { return s[key]; }
+ return key;
+ },
+ get_text : function (obj, lang) {
+ obj = this._get_node(obj) || this.data.ui.last_selected;
+ if(!obj.size()) { return false; }
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.html_titles;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ obj = obj.children("a." + lang);
+ }
+ else { obj = obj.children("a:eq(0)"); }
+ if(s) {
+ obj = obj.clone();
+ obj.children("INS").remove();
+ return obj.html();
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ return obj.nodeValue;
+ }
+ },
+ set_text : function (obj, val, lang) {
+ obj = this._get_node(obj) || this.data.ui.last_selected;
+ if(!obj.size()) { return false; }
+ var langs = this._get_settings().languages,
+ s = this._get_settings().core.html_titles,
+ tmp;
+ if($.isArray(langs) && langs.length) {
+ lang = (lang && $.inArray(lang,langs) != -1) ? lang : this.data.languages.current_language;
+ obj = obj.children("a." + lang);
+ }
+ else { obj = obj.children("a:eq(0)"); }
+ if(s) {
+ tmp = obj.children("INS").clone();
+ obj.html(val).prepend(tmp);
+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+ return true;
+ }
+ else {
+ obj = obj.contents().filter(function() { return this.nodeType == 3; })[0];
+ this.__callback({ "obj" : obj, "name" : val, "lang" : lang });
+ return (obj.nodeValue = val);
+ }
+ },
+ _load_css : function () {
+ var langs = this._get_settings().languages,
+ str = "/* languages css */",
+ selector = ".jstree-" + this.get_index() + ' a',
+ ln;
+ if($.isArray(langs) && langs.length) {
+ this.data.languages.current_language = langs[0];
+ for(ln = 0; ln < langs.length; ln++) {
+ str += selector + "." + langs[ln] + " {";
+ if(langs[ln] != this.data.languages.current_language) { str += " display:none; "; }
+ str += " } ";
+ }
+ this.data.languages.language_css = $.vakata.css.add_sheet({ 'str' : str, 'title' : "jstree-languages" });
+ }
+ },
+ create_node : function (obj, position, js, callback) {
+ var t = this.__call_old(true, obj, position, js, function (t) {
+ var langs = this._get_settings().languages,
+ a = t.children("a"),
+ ln;
+ if($.isArray(langs) && langs.length) {
+ for(ln = 0; ln < langs.length; ln++) {
+ if(!a.is("." + langs[ln])) {
+ t.append(a.eq(0).clone().removeClass(langs.join(" ")).addClass(langs[ln]));
+ }
+ }
+ a.not("." + langs.join(", .")).remove();
+ }
+ if(callback) { callback.call(this, t); }
+ });
+ return t;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree cookies plugin
+ * Stores the currently opened/selected nodes in a cookie and then restores them
+ * Depends on the jquery.cookie plugin
+ */
+(function ($) {
+ $.jstree.plugin("cookies", {
+ __init : function () {
+ if(typeof $.cookie === "undefined") { throw "jsTree cookie: jQuery cookie plugin not included."; }
+
+ var s = this._get_settings().cookies,
+ tmp;
+ if(!!s.save_loaded) {
+ tmp = $.cookie(s.save_loaded);
+ if(tmp && tmp.length) { this.data.core.to_load = tmp.split(","); }
+ }
+ if(!!s.save_opened) {
+ tmp = $.cookie(s.save_opened);
+ if(tmp && tmp.length) { this.data.core.to_open = tmp.split(","); }
+ }
+ if(!!s.save_selected) {
+ tmp = $.cookie(s.save_selected);
+ if(tmp && tmp.length && this.data.ui) { this.data.ui.to_select = tmp.split(","); }
+ }
+ this.get_container()
+ .one( ( this.data.ui ? "reselect" : "reopen" ) + ".jstree", $.proxy(function () {
+ this.get_container()
+ .bind("open_node.jstree close_node.jstree select_node.jstree deselect_node.jstree", $.proxy(function (e) {
+ if(this._get_settings().cookies.auto_save) { this.save_cookie((e.handleObj.namespace + e.handleObj.type).replace("jstree","")); }
+ }, this));
+ }, this));
+ },
+ defaults : {
+ save_loaded : "jstree_load",
+ save_opened : "jstree_open",
+ save_selected : "jstree_select",
+ auto_save : true,
+ cookie_options : {}
+ },
+ _fn : {
+ save_cookie : function (c) {
+ if(this.data.core.refreshing) { return; }
+ var s = this._get_settings().cookies;
+ if(!c) { // if called manually and not by event
+ if(s.save_loaded) {
+ this.save_loaded();
+ $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+ }
+ if(s.save_opened) {
+ this.save_opened();
+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+ }
+ if(s.save_selected && this.data.ui) {
+ this.save_selected();
+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+ }
+ return;
+ }
+ switch(c) {
+ case "open_node":
+ case "close_node":
+ if(!!s.save_opened) {
+ this.save_opened();
+ $.cookie(s.save_opened, this.data.core.to_open.join(","), s.cookie_options);
+ }
+ if(!!s.save_loaded) {
+ this.save_loaded();
+ $.cookie(s.save_loaded, this.data.core.to_load.join(","), s.cookie_options);
+ }
+ break;
+ case "select_node":
+ case "deselect_node":
+ if(!!s.save_selected && this.data.ui) {
+ this.save_selected();
+ $.cookie(s.save_selected, this.data.ui.to_select.join(","), s.cookie_options);
+ }
+ break;
+ }
+ }
+ }
+ });
+ // include cookies by default
+ // $.jstree.defaults.plugins.push("cookies");
+})(jQuery);
+//*/
+
+/*
+ * jsTree sort plugin
+ * Sorts items alphabetically (or using any other function)
+ */
+(function ($) {
+ $.jstree.plugin("sort", {
+ __init : function () {
+ this.get_container()
+ .bind("load_node.jstree", $.proxy(function (e, data) {
+ var obj = this._get_node(data.rslt.obj);
+ obj = obj === -1 ? this.get_container().children("ul") : obj.children("ul");
+ this.sort(obj);
+ }, this))
+ .bind("rename_node.jstree create_node.jstree create.jstree", $.proxy(function (e, data) {
+ this.sort(data.rslt.obj.parent());
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ var m = data.rslt.np == -1 ? this.get_container() : data.rslt.np;
+ this.sort(m.children("ul"));
+ }, this));
+ },
+ defaults : function (a, b) { return this.get_text(a) > this.get_text(b) ? 1 : -1; },
+ _fn : {
+ sort : function (obj) {
+ var s = this._get_settings().sort,
+ t = this;
+ obj.append($.makeArray(obj.children("li")).sort($.proxy(s, t)));
+ obj.find("> li > ul").each(function() { t.sort($(this)); });
+ this.clean_node(obj);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree DND plugin
+ * Drag and drop plugin for moving/copying nodes
+ */
+(function ($) {
+ var o = false,
+ r = false,
+ m = false,
+ ml = false,
+ sli = false,
+ sti = false,
+ dir1 = false,
+ dir2 = false,
+ last_pos = false;
+ $.vakata.dnd = {
+ is_down : false,
+ is_drag : false,
+ helper : false,
+ scroll_spd : 10,
+ init_x : 0,
+ init_y : 0,
+ threshold : 5,
+ helper_left : 5,
+ helper_top : 10,
+ user_data : {},
+
+ drag_start : function (e, data, html) {
+ if($.vakata.dnd.is_drag) { $.vakata.drag_stop({}); }
+ try {
+ e.currentTarget.unselectable = "on";
+ e.currentTarget.onselectstart = function() { return false; };
+ if(e.currentTarget.style) { e.currentTarget.style.MozUserSelect = "none"; }
+ } catch(err) { }
+ $.vakata.dnd.init_x = e.pageX;
+ $.vakata.dnd.init_y = e.pageY;
+ $.vakata.dnd.user_data = data;
+ $.vakata.dnd.is_down = true;
+ $.vakata.dnd.helper = $("<div id='vakata-dragged' />").html(html); //.fadeTo(10,0.25);
+ $(document).bind("mousemove", $.vakata.dnd.drag);
+ $(document).bind("mouseup", $.vakata.dnd.drag_stop);
+ return false;
+ },
+ drag : function (e) {
+ if(!$.vakata.dnd.is_down) { return; }
+ if(!$.vakata.dnd.is_drag) {
+ if(Math.abs(e.pageX - $.vakata.dnd.init_x) > 5 || Math.abs(e.pageY - $.vakata.dnd.init_y) > 5) {
+ $.vakata.dnd.helper.appendTo("body");
+ $.vakata.dnd.is_drag = true;
+ $(document).triggerHandler("drag_start.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ }
+ else { return; }
+ }
+
+ // maybe use a scrolling parent element instead of document?
+ if(e.type === "mousemove") { // thought of adding scroll in order to move the helper, but mouse poisition is n/a
+ var d = $(document), t = d.scrollTop(), l = d.scrollLeft();
+ if(e.pageY - t < 20) {
+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+ if(!sti) { dir1 = "up"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() - $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+ }
+ if($(window).height() - (e.pageY - t) < 20) {
+ if(sti && dir1 === "up") { clearInterval(sti); sti = false; }
+ if(!sti) { dir1 = "down"; sti = setInterval(function () { $(document).scrollTop($(document).scrollTop() + $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sti && dir1 === "down") { clearInterval(sti); sti = false; }
+ }
+
+ if(e.pageX - l < 20) {
+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+ if(!sli) { dir2 = "left"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() - $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+ }
+ if($(window).width() - (e.pageX - l) < 20) {
+ if(sli && dir2 === "left") { clearInterval(sli); sli = false; }
+ if(!sli) { dir2 = "right"; sli = setInterval(function () { $(document).scrollLeft($(document).scrollLeft() + $.vakata.dnd.scroll_spd); }, 150); }
+ }
+ else {
+ if(sli && dir2 === "right") { clearInterval(sli); sli = false; }
+ }
+ }
+
+ $.vakata.dnd.helper.css({ left : (e.pageX + $.vakata.dnd.helper_left) + "px", top : (e.pageY + $.vakata.dnd.helper_top) + "px" });
+ $(document).triggerHandler("drag.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ },
+ drag_stop : function (e) {
+ if(sli) { clearInterval(sli); }
+ if(sti) { clearInterval(sti); }
+ $(document).unbind("mousemove", $.vakata.dnd.drag);
+ $(document).unbind("mouseup", $.vakata.dnd.drag_stop);
+ $(document).triggerHandler("drag_stop.vakata", { "event" : e, "data" : $.vakata.dnd.user_data });
+ $.vakata.dnd.helper.remove();
+ $.vakata.dnd.init_x = 0;
+ $.vakata.dnd.init_y = 0;
+ $.vakata.dnd.user_data = {};
+ $.vakata.dnd.is_down = false;
+ $.vakata.dnd.is_drag = false;
+ }
+ };
+ $(function() {
+ var css_string = '#vakata-dragged { display:block; margin:0 0 0 0; padding:4px 4px 4px 24px; position:absolute; top:-2000px; line-height:16px; z-index:10000; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+ });
+
+ $.jstree.plugin("dnd", {
+ __init : function () {
+ this.data.dnd = {
+ active : false,
+ after : false,
+ inside : false,
+ before : false,
+ off : false,
+ prepared : false,
+ w : 0,
+ to1 : false,
+ to2 : false,
+ cof : false,
+ cw : false,
+ ch : false,
+ i1 : false,
+ i2 : false,
+ mto : false
+ };
+ this.get_container()
+ .bind("mouseenter.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(this.data.themes) {
+ m.attr("class", "jstree-" + this.data.themes.theme);
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ //if($(e.currentTarget).find("> ul > li").length === 0) {
+ if(e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+ var tr = $.jstree._reference(e.target), dc;
+ if(tr.data.dnd.foreign) {
+ dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }
+ else {
+ tr.prepare_move(o, tr.get_container(), "last");
+ if(tr.check_move()) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }
+ }
+ }
+ }, this))
+ .bind("mouseup.jstree", $.proxy(function (e) {
+ //if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && $(e.currentTarget).find("> ul > li").length === 0) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && e.currentTarget === e.target && $.vakata.dnd.user_data.obj && $($.vakata.dnd.user_data.obj).length && $($.vakata.dnd.user_data.obj).parents(".jstree:eq(0)")[0] !== e.target) { // node should not be from the same tree
+ var tr = $.jstree._reference(e.currentTarget), dc;
+ if(tr.data.dnd.foreign) {
+ dc = tr._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ if(dc === true || dc.inside === true || dc.before === true || dc.after === true) {
+ tr._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : tr.get_container(), is_root : true });
+ }
+ }
+ else {
+ tr.move_node(o, tr.get_container(), "last", e[tr._get_settings().dnd.copy_modifier + "Key"]);
+ }
+ }
+ }, this))
+ .bind("mouseleave.jstree", $.proxy(function (e) {
+ if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+ return false;
+ }
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if($.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ }
+ }
+ }, this))
+ .bind("mousemove.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ var cnt = this.get_container()[0];
+
+ // Horizontal scroll
+ if(e.pageX + 24 > this.data.dnd.cof.left + this.data.dnd.cw) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft += $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else if(e.pageX - 24 < this.data.dnd.cof.left) {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ this.data.dnd.i1 = setInterval($.proxy(function () { this.scrollLeft -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else {
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ }
+
+ // Vertical scroll
+ if(e.pageY + 24 > this.data.dnd.cof.top + this.data.dnd.ch) {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop += $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else if(e.pageY - 24 < this.data.dnd.cof.top) {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.i2 = setInterval($.proxy(function () { this.scrollTop -= $.vakata.dnd.scroll_spd; }, cnt), 100);
+ }
+ else {
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ }
+
+ }
+ }, this))
+ .bind("scroll.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && m && ml) {
+ m.hide();
+ ml.hide();
+ }
+ }, this))
+ .delegate("a", "mousedown.jstree", $.proxy(function (e) {
+ if(e.which === 1) {
+ this.start_drag(e.currentTarget, e);
+ return false;
+ }
+ }, this))
+ .delegate("a", "mouseenter.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ this.dnd_enter(e.currentTarget);
+ }
+ }, this))
+ .delegate("a", "mousemove.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(!r || !r.length || r.children("a")[0] !== e.currentTarget) {
+ this.dnd_enter(e.currentTarget);
+ }
+ if(typeof this.data.dnd.off.top === "undefined") { this.data.dnd.off = $(e.target).offset(); }
+ this.data.dnd.w = (e.pageY - (this.data.dnd.off.top || 0)) % this.data.core.li_height;
+ if(this.data.dnd.w < 0) { this.data.dnd.w += this.data.core.li_height; }
+ this.dnd_show();
+ }
+ }, this))
+ .delegate("a", "mouseleave.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ if(e.relatedTarget && e.relatedTarget.id && e.relatedTarget.id === "jstree-marker-line") {
+ return false;
+ }
+ if(m) { m.hide(); }
+ if(ml) { ml.hide(); }
+ /*
+ var ec = $(e.currentTarget).closest("li"),
+ er = $(e.relatedTarget).closest("li");
+ if(er[0] !== ec.prev()[0] && er[0] !== ec.next()[0]) {
+ if(m) { m.hide(); }
+ if(ml) { ml.hide(); }
+ }
+ */
+ this.data.dnd.mto = setTimeout(
+ (function (t) { return function () { t.dnd_leave(e); }; })(this),
+ 0);
+ }
+ }, this))
+ .delegate("a", "mouseup.jstree", $.proxy(function (e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree) {
+ this.dnd_finish(e);
+ }
+ }, this));
+
+ $(document)
+ .bind("drag_stop.vakata", $.proxy(function () {
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if(this.data.dnd.i1) { clearInterval(this.data.dnd.i1); }
+ if(this.data.dnd.i2) { clearInterval(this.data.dnd.i2); }
+ this.data.dnd.after = false;
+ this.data.dnd.before = false;
+ this.data.dnd.inside = false;
+ this.data.dnd.off = false;
+ this.data.dnd.prepared = false;
+ this.data.dnd.w = false;
+ this.data.dnd.to1 = false;
+ this.data.dnd.to2 = false;
+ this.data.dnd.i1 = false;
+ this.data.dnd.i2 = false;
+ this.data.dnd.active = false;
+ this.data.dnd.foreign = false;
+ if(m) { m.css({ "top" : "-2000px" }); }
+ if(ml) { ml.css({ "top" : "-2000px" }); }
+ }, this))
+ .bind("drag_start.vakata", $.proxy(function (e, data) {
+ if(data.data.jstree) {
+ var et = $(data.event.target);
+ if(et.closest(".jstree").hasClass("jstree-" + this.get_index())) {
+ this.dnd_enter(et);
+ }
+ }
+ }, this));
+ /*
+ .bind("keydown.jstree-" + this.get_index() + " keyup.jstree-" + this.get_index(), $.proxy(function(e) {
+ if($.vakata.dnd.is_drag && $.vakata.dnd.user_data.jstree && !this.data.dnd.foreign) {
+ var h = $.vakata.dnd.helper.children("ins");
+ if(e[this._get_settings().dnd.copy_modifier + "Key"] && h.hasClass("jstree-ok")) {
+ h.parent().html(h.parent().html().replace(/ \(Copy\)$/, "") + " (Copy)");
+ }
+ else {
+ h.parent().html(h.parent().html().replace(/ \(Copy\)$/, ""));
+ }
+ }
+ }, this)); */
+
+
+
+ var s = this._get_settings().dnd;
+ if(s.drag_target) {
+ $(document)
+ .delegate(s.drag_target, "mousedown.jstree-" + this.get_index(), $.proxy(function (e) {
+ o = e.target;
+ $.vakata.dnd.drag_start(e, { jstree : true, obj : e.target }, "<ins class='jstree-icon'></ins>" + $(e.target).text() );
+ if(this.data.themes) {
+ if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ var cnt = this.get_container();
+ this.data.dnd.cof = cnt.offset();
+ this.data.dnd.cw = parseInt(cnt.width(),10);
+ this.data.dnd.ch = parseInt(cnt.height(),10);
+ this.data.dnd.foreign = true;
+ e.preventDefault();
+ }, this));
+ }
+ if(s.drop_target) {
+ $(document)
+ .delegate(s.drop_target, "mouseenter.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active && this._get_settings().dnd.drop_check.call(this, { "o" : o, "r" : $(e.target), "e" : e })) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ }
+ }, this))
+ .delegate(s.drop_target, "mouseleave.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ }
+ }, this))
+ .delegate(s.drop_target, "mouseup.jstree-" + this.get_index(), $.proxy(function (e) {
+ if(this.data.dnd.active && $.vakata.dnd.helper.children("ins").hasClass("jstree-ok")) {
+ this._get_settings().dnd.drop_finish.call(this, { "o" : o, "r" : $(e.target), "e" : e });
+ }
+ }, this));
+ }
+ },
+ defaults : {
+ copy_modifier : "ctrl",
+ check_timeout : 100,
+ open_timeout : 500,
+ drop_target : ".jstree-drop",
+ drop_check : function (data) { return true; },
+ drop_finish : $.noop,
+ drag_target : ".jstree-draggable",
+ drag_finish : $.noop,
+ drag_check : function (data) { return { after : false, before : false, inside : true }; }
+ },
+ _fn : {
+ dnd_prepare : function () {
+ if(!r || !r.length) { return; }
+ this.data.dnd.off = r.offset();
+ if(this._get_settings().core.rtl) {
+ this.data.dnd.off.right = this.data.dnd.off.left + r.width();
+ }
+ if(this.data.dnd.foreign) {
+ var a = this._get_settings().dnd.drag_check.call(this, { "o" : o, "r" : r });
+ this.data.dnd.after = a.after;
+ this.data.dnd.before = a.before;
+ this.data.dnd.inside = a.inside;
+ this.data.dnd.prepared = true;
+ return this.dnd_show();
+ }
+ this.prepare_move(o, r, "before");
+ this.data.dnd.before = this.check_move();
+ this.prepare_move(o, r, "after");
+ this.data.dnd.after = this.check_move();
+ if(this._is_loaded(r)) {
+ this.prepare_move(o, r, "inside");
+ this.data.dnd.inside = this.check_move();
+ }
+ else {
+ this.data.dnd.inside = false;
+ }
+ this.data.dnd.prepared = true;
+ return this.dnd_show();
+ },
+ dnd_show : function () {
+ if(!this.data.dnd.prepared) { return; }
+ var o = ["before","inside","after"],
+ r = false,
+ rtl = this._get_settings().core.rtl,
+ pos;
+ if(this.data.dnd.w < this.data.core.li_height/3) { o = ["before","inside","after"]; }
+ else if(this.data.dnd.w <= this.data.core.li_height*2/3) {
+ o = this.data.dnd.w < this.data.core.li_height/2 ? ["inside","before","after"] : ["inside","after","before"];
+ }
+ else { o = ["after","inside","before"]; }
+ $.each(o, $.proxy(function (i, val) {
+ if(this.data.dnd[val]) {
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-ok");
+ r = val;
+ return false;
+ }
+ }, this));
+ if(r === false) { $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid"); }
+
+ pos = rtl ? (this.data.dnd.off.right - 18) : (this.data.dnd.off.left + 10);
+ switch(r) {
+ case "before":
+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top - 6) + "px" }).show();
+ if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top - 1) + "px" }).show(); }
+ break;
+ case "after":
+ m.css({ "left" : pos + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 6) + "px" }).show();
+ if(ml) { ml.css({ "left" : (pos + 8) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height - 1) + "px" }).show(); }
+ break;
+ case "inside":
+ m.css({ "left" : pos + ( rtl ? -4 : 4) + "px", "top" : (this.data.dnd.off.top + this.data.core.li_height/2 - 5) + "px" }).show();
+ if(ml) { ml.hide(); }
+ break;
+ default:
+ m.hide();
+ if(ml) { ml.hide(); }
+ break;
+ }
+ last_pos = r;
+ return r;
+ },
+ dnd_open : function () {
+ this.data.dnd.to2 = false;
+ this.open_node(r, $.proxy(this.dnd_prepare,this), true);
+ },
+ dnd_finish : function (e) {
+ if(this.data.dnd.foreign) {
+ if(this.data.dnd.after || this.data.dnd.before || this.data.dnd.inside) {
+ this._get_settings().dnd.drag_finish.call(this, { "o" : o, "r" : r, "p" : last_pos });
+ }
+ }
+ else {
+ this.dnd_prepare();
+ this.move_node(o, r, last_pos, e[this._get_settings().dnd.copy_modifier + "Key"]);
+ }
+ o = false;
+ r = false;
+ m.hide();
+ if(ml) { ml.hide(); }
+ },
+ dnd_enter : function (obj) {
+ if(this.data.dnd.mto) {
+ clearTimeout(this.data.dnd.mto);
+ this.data.dnd.mto = false;
+ }
+ var s = this._get_settings().dnd;
+ this.data.dnd.prepared = false;
+ r = this._get_node(obj);
+ if(s.check_timeout) {
+ // do the calculations after a minimal timeout (users tend to drag quickly to the desired location)
+ if(this.data.dnd.to1) { clearTimeout(this.data.dnd.to1); }
+ this.data.dnd.to1 = setTimeout($.proxy(this.dnd_prepare, this), s.check_timeout);
+ }
+ else {
+ this.dnd_prepare();
+ }
+ if(s.open_timeout) {
+ if(this.data.dnd.to2) { clearTimeout(this.data.dnd.to2); }
+ if(r && r.length && r.hasClass("jstree-closed")) {
+ // if the node is closed - open it, then recalculate
+ this.data.dnd.to2 = setTimeout($.proxy(this.dnd_open, this), s.open_timeout);
+ }
+ }
+ else {
+ if(r && r.length && r.hasClass("jstree-closed")) {
+ this.dnd_open();
+ }
+ }
+ },
+ dnd_leave : function (e) {
+ this.data.dnd.after = false;
+ this.data.dnd.before = false;
+ this.data.dnd.inside = false;
+ $.vakata.dnd.helper.children("ins").attr("class","jstree-invalid");
+ m.hide();
+ if(ml) { ml.hide(); }
+ if(r && r[0] === e.target.parentNode) {
+ if(this.data.dnd.to1) {
+ clearTimeout(this.data.dnd.to1);
+ this.data.dnd.to1 = false;
+ }
+ if(this.data.dnd.to2) {
+ clearTimeout(this.data.dnd.to2);
+ this.data.dnd.to2 = false;
+ }
+ }
+ },
+ start_drag : function (obj, e) {
+ o = this._get_node(obj);
+ if(this.data.ui && this.is_selected(o)) { o = this._get_node(null, true); }
+ var dt = o.length > 1 ? this._get_string("multiple_selection") : this.get_text(o),
+ cnt = this.get_container();
+ if(!this._get_settings().core.html_titles) { dt = dt.replace(/</ig,"<").replace(/>/ig,">"); }
+ $.vakata.dnd.drag_start(e, { jstree : true, obj : o }, "<ins class='jstree-icon'></ins>" + dt );
+ if(this.data.themes) {
+ if(m) { m.attr("class", "jstree-" + this.data.themes.theme); }
+ if(ml) { ml.attr("class", "jstree-" + this.data.themes.theme); }
+ $.vakata.dnd.helper.attr("class", "jstree-dnd-helper jstree-" + this.data.themes.theme);
+ }
+ this.data.dnd.cof = cnt.offset();
+ this.data.dnd.cw = parseInt(cnt.width(),10);
+ this.data.dnd.ch = parseInt(cnt.height(),10);
+ this.data.dnd.active = true;
+ }
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '#vakata-dragged ins { display:block; text-decoration:none; width:16px; height:16px; margin:0 0 0 0; padding:0; position:absolute; top:4px; left:4px; ' +
+ ' -moz-border-radius:4px; border-radius:4px; -webkit-border-radius:4px; ' +
+ '} ' +
+ '#vakata-dragged .jstree-ok { background:green; } ' +
+ '#vakata-dragged .jstree-invalid { background:red; } ' +
+ '#jstree-marker { padding:0; margin:0; font-size:12px; overflow:hidden; height:12px; width:8px; position:absolute; top:-30px; z-index:10001; background-repeat:no-repeat; display:none; background-color:transparent; text-shadow:1px 1px 1px white; color:black; line-height:10px; } ' +
+ '#jstree-marker-line { padding:0; margin:0; line-height:0%; font-size:1px; overflow:hidden; height:1px; width:100px; position:absolute; top:-30px; z-index:10000; background-repeat:no-repeat; display:none; background-color:#456c43; ' +
+ ' cursor:pointer; border:1px solid #eeeeee; border-left:0; -moz-box-shadow: 0px 0px 2px #666; -webkit-box-shadow: 0px 0px 2px #666; box-shadow: 0px 0px 2px #666; ' +
+ ' -moz-border-radius:1px; border-radius:1px; -webkit-border-radius:1px; ' +
+ '}' +
+ '';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ m = $("<div />").attr({ id : "jstree-marker" }).hide().html("»")
+ .bind("mouseleave mouseenter", function (e) {
+ m.hide();
+ ml.hide();
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ })
+ .appendTo("body");
+ ml = $("<div />").attr({ id : "jstree-marker-line" }).hide()
+ .bind("mouseup", function (e) {
+ if(r && r.length) {
+ r.children("a").trigger(e);
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ })
+ .bind("mouseleave", function (e) {
+ var rt = $(e.relatedTarget);
+ if(rt.is(".jstree") || rt.closest(".jstree").length === 0) {
+ if(r && r.length) {
+ r.children("a").trigger(e);
+ m.hide();
+ ml.hide();
+ e.preventDefault();
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ })
+ .appendTo("body");
+ $(document).bind("drag_start.vakata", function (e, data) {
+ if(data.data.jstree) { m.show(); if(ml) { ml.show(); } }
+ });
+ $(document).bind("drag_stop.vakata", function (e, data) {
+ if(data.data.jstree) { m.hide(); if(ml) { ml.hide(); } }
+ });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree checkbox plugin
+ * Inserts checkboxes in front of every node
+ * Depends on the ui plugin
+ * DOES NOT WORK NICELY WITH MULTITREE DRAG'N'DROP
+ */
+(function ($) {
+ $.jstree.plugin("checkbox", {
+ __init : function () {
+ this.data.checkbox.noui = this._get_settings().checkbox.override_ui;
+ if(this.data.ui && this.data.checkbox.noui) {
+ this.select_node = this.deselect_node = this.deselect_all = $.noop;
+ this.get_selected = this.get_checked;
+ }
+
+ this.get_container()
+ .bind("open_node.jstree create_node.jstree clean_node.jstree refresh.jstree", $.proxy(function (e, data) {
+ this._prepare_checkboxes(data.rslt.obj);
+ }, this))
+ .bind("loaded.jstree", $.proxy(function (e) {
+ this._prepare_checkboxes();
+ }, this))
+ .delegate( (this.data.ui && this.data.checkbox.noui ? "a" : "ins.jstree-checkbox") , "click.jstree", $.proxy(function (e) {
+ e.preventDefault();
+ if(this._get_node(e.target).hasClass("jstree-checked")) { this.uncheck_node(e.target); }
+ else { this.check_node(e.target); }
+ if(this.data.ui && this.data.checkbox.noui) {
+ this.save_selected();
+ if(this.data.cookies) { this.save_cookie("select_node"); }
+ }
+ else {
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }, this));
+ },
+ defaults : {
+ override_ui : false,
+ two_state : false,
+ real_checkboxes : false,
+ checked_parent_open : true,
+ real_checkboxes_names : function (n) { return [ ("check_" + (n[0].id || Math.ceil(Math.random() * 10000))) , 1]; }
+ },
+ __destroy : function () {
+ this.get_container()
+ .find("input.jstree-real-checkbox").removeClass("jstree-real-checkbox").end()
+ .find("ins.jstree-checkbox").remove();
+ },
+ _fn : {
+ _checkbox_notify : function (n, data) {
+ if(data.checked) {
+ this.check_node(n, false);
+ }
+ },
+ _prepare_checkboxes : function (obj) {
+ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+ if(obj === false) { return; } // added for removing root nodes
+ var c, _this = this, t, ts = this._get_settings().checkbox.two_state, rc = this._get_settings().checkbox.real_checkboxes, rcn = this._get_settings().checkbox.real_checkboxes_names;
+ obj.each(function () {
+ t = $(this);
+ c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked";
+ t.find("li").andSelf().each(function () {
+ var $t = $(this), nm;
+ $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'> </ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
+ if(rc) {
+ if(!$t.children(":checkbox").length) {
+ nm = rcn.call(_this, $t);
+ $t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
+ }
+ else {
+ $t.children(":checkbox").addClass("jstree-real-checkbox");
+ }
+ }
+ if(!ts) {
+ if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
+ $t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
+ }
+ }
+ else {
+ if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
+ $t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
+ }
+ }
+ });
+ });
+ if(!ts) {
+ obj.find(".jstree-checked").parent().parent().each(function () { _this._repair_state(this); });
+ }
+ },
+ change_state : function (obj, state) {
+ obj = this._get_node(obj);
+ var coll = false, rc = this._get_settings().checkbox.real_checkboxes;
+ if(!obj || obj === -1) { return false; }
+ state = (state === false || state === true) ? state : obj.hasClass("jstree-checked");
+ if(this._get_settings().checkbox.two_state) {
+ if(state) {
+ obj.removeClass("jstree-checked").addClass("jstree-unchecked");
+ if(rc) { obj.children(":checkbox").prop("checked", false); }
+ }
+ else {
+ obj.removeClass("jstree-unchecked").addClass("jstree-checked");
+ if(rc) { obj.children(":checkbox").prop("checked", true); }
+ }
+ }
+ else {
+ if(state) {
+ coll = obj.find("li").andSelf();
+ if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
+ coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+ if(rc) { coll.children(":checkbox").prop("checked", false); }
+ }
+ else {
+ coll = obj.find("li").andSelf();
+ if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
+ coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+ if(rc) { coll.children(":checkbox").prop("checked", true); }
+ if(this.data.ui) { this.data.ui.last_selected = obj; }
+ this.data.checkbox.last_selected = obj;
+ }
+ obj.parentsUntil(".jstree", "li").each(function () {
+ var $this = $(this);
+ if(state) {
+ if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
+ $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+ return false;
+ }
+ else {
+ $this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
+ if(rc) { $this.children(":checkbox").prop("checked", false); }
+ }
+ }
+ else {
+ if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
+ $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+ return false;
+ }
+ else {
+ $this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
+ if(rc) { $this.children(":checkbox").prop("checked", true); }
+ }
+ }
+ });
+ }
+ if(this.data.ui && this.data.checkbox.noui) { this.data.ui.selected = this.get_checked(); }
+ this.__callback(obj);
+ return true;
+ },
+ check_node : function (obj) {
+ if(this.change_state(obj, false)) {
+ obj = this._get_node(obj);
+ if(this._get_settings().checkbox.checked_parent_open) {
+ var t = this;
+ obj.parents(".jstree-closed").each(function () { t.open_node(this, false, true); });
+ }
+ this.__callback({ "obj" : obj });
+ }
+ },
+ uncheck_node : function (obj) {
+ if(this.change_state(obj, true)) { this.__callback({ "obj" : this._get_node(obj) }); }
+ },
+ check_all : function () {
+ var _this = this,
+ coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+ coll.each(function () {
+ _this.change_state(this, false);
+ });
+ this.__callback();
+ },
+ uncheck_all : function () {
+ var _this = this,
+ coll = this._get_settings().checkbox.two_state ? this.get_container_ul().find("li") : this.get_container_ul().children("li");
+ coll.each(function () {
+ _this.change_state(this, true);
+ });
+ this.__callback();
+ },
+
+ is_checked : function(obj) {
+ obj = this._get_node(obj);
+ return obj.length ? obj.is(".jstree-checked") : false;
+ },
+ get_checked : function (obj, get_all) {
+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+ return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-checked") : obj.find("> ul > .jstree-checked, .jstree-undetermined > ul > .jstree-checked");
+ },
+ get_unchecked : function (obj, get_all) {
+ obj = !obj || obj === -1 ? this.get_container() : this._get_node(obj);
+ return get_all || this._get_settings().checkbox.two_state ? obj.find(".jstree-unchecked") : obj.find("> ul > .jstree-unchecked, .jstree-undetermined > ul > .jstree-unchecked");
+ },
+
+ show_checkboxes : function () { this.get_container().children("ul").removeClass("jstree-no-checkboxes"); },
+ hide_checkboxes : function () { this.get_container().children("ul").addClass("jstree-no-checkboxes"); },
+
+ _repair_state : function (obj) {
+ obj = this._get_node(obj);
+ if(!obj.length) { return; }
+ if(this._get_settings().checkbox.two_state) {
+ obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
+ return;
+ }
+ var rc = this._get_settings().checkbox.real_checkboxes,
+ a = obj.find("> ul > .jstree-checked").length,
+ b = obj.find("> ul > .jstree-undetermined").length,
+ c = obj.find("> ul > li").length;
+ if(c === 0) { if(obj.hasClass("jstree-undetermined")) { this.change_state(obj, false); } }
+ else if(a === 0 && b === 0) { this.change_state(obj, true); }
+ else if(a === c) { this.change_state(obj, false); }
+ else {
+ obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
+ if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
+ }
+ },
+ reselect : function () {
+ if(this.data.ui && this.data.checkbox.noui) {
+ var _this = this,
+ s = this.data.ui.to_select;
+ s = $.map($.makeArray(s), function (n) { return "#" + n.toString().replace(/^#/,"").replace(/\\\//g,"/").replace(/\//g,"\\\/").replace(/\\\./g,".").replace(/\./g,"\\.").replace(/\:/g,"\\:"); });
+ this.deselect_all();
+ $.each(s, function (i, val) { _this.check_node(val); });
+ this.__callback();
+ }
+ else {
+ this.__call_old();
+ }
+ },
+ save_loaded : function () {
+ var _this = this;
+ this.data.core.to_load = [];
+ this.get_container_ul().find("li.jstree-closed.jstree-undetermined").each(function () {
+ if(this.id) { _this.data.core.to_load.push("#" + this.id); }
+ });
+ }
+ }
+ });
+ $(function() {
+ var css_string = '.jstree .jstree-real-checkbox { display:none; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree XML plugin
+ * The XML data store. Datastores are build by overriding the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.vakata.xslt = function (xml, xsl, callback) {
+ var rs = "", xm, xs, processor, support;
+ // TODO: IE9 no XSLTProcessor, no document.recalc
+ if(document.recalc) {
+ xm = document.createElement('xml');
+ xs = document.createElement('xml');
+ xm.innerHTML = xml;
+ xs.innerHTML = xsl;
+ $("body").append(xm).append(xs);
+ setTimeout( (function (xm, xs, callback) {
+ return function () {
+ callback.call(null, xm.transformNode(xs.XMLDocument));
+ setTimeout( (function (xm, xs) { return function () { $(xm).remove(); $(xs).remove(); }; })(xm, xs), 200);
+ };
+ })(xm, xs, callback), 100);
+ return true;
+ }
+ if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor === "undefined") {
+ xml = new DOMParser().parseFromString(xml, "text/xml");
+ xsl = new DOMParser().parseFromString(xsl, "text/xml");
+ // alert(xml.transformNode());
+ // callback.call(null, new XMLSerializer().serializeToString(rs));
+
+ }
+ if(typeof window.DOMParser !== "undefined" && typeof window.XMLHttpRequest !== "undefined" && typeof window.XSLTProcessor !== "undefined") {
+ processor = new XSLTProcessor();
+ support = $.isFunction(processor.transformDocument) ? (typeof window.XMLSerializer !== "undefined") : true;
+ if(!support) { return false; }
+ xml = new DOMParser().parseFromString(xml, "text/xml");
+ xsl = new DOMParser().parseFromString(xsl, "text/xml");
+ if($.isFunction(processor.transformDocument)) {
+ rs = document.implementation.createDocument("", "", null);
+ processor.transformDocument(xml, xsl, rs, null);
+ callback.call(null, new XMLSerializer().serializeToString(rs));
+ return true;
+ }
+ else {
+ processor.importStylesheet(xsl);
+ rs = processor.transformToFragment(xml, document);
+ callback.call(null, $("<div />").append(rs).html());
+ return true;
+ }
+ }
+ return false;
+ };
+ var xsl = {
+ 'nest' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/html" />' +
+ '<xsl:template match="/">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="/root" />' +
+ ' </xsl:call-template>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <ul>' +
+ ' <xsl:for-each select="$node/item">' +
+ ' <xsl:variable name="children" select="count(./item) > 0" />' +
+ ' <li>' +
+ ' <xsl:attribute name="class">' +
+ ' <xsl:if test="position() = last()">jstree-last </xsl:if>' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' <xsl:value-of select="@class" />' +
+ ' </xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'class\' and name() != \'state\' and name() != \'hasChildren\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
+ ' <xsl:for-each select="content/name">' +
+ ' <a>' +
+ ' <xsl:attribute name="href">' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+ ' <xsl:otherwise>#</xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' </xsl:attribute>' +
+ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins>' +
+ ' <xsl:attribute name="class">jstree-icon ' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+ ' </xsl:attribute>' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+ ' <xsl:text> </xsl:text>' +
+ ' </ins>' +
+ ' <xsl:copy-of select="./child::node()" />' +
+ ' </a>' +
+ ' </xsl:for-each>' +
+ ' <xsl:if test="$children or @hasChildren"><xsl:call-template name="nodes"><xsl:with-param name="node" select="current()" /></xsl:call-template></xsl:if>' +
+ ' </li>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>',
+
+ 'flat' : '<' + '?xml version="1.0" encoding="utf-8" ?>' +
+ '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >' +
+ '<xsl:output method="html" encoding="utf-8" omit-xml-declaration="yes" standalone="no" indent="no" media-type="text/xml" />' +
+ '<xsl:template match="/">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[not(@parent_id) or @parent_id=0 or not(@parent_id = //item/@id)]">' + /* the last `or` may be removed */
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ '</xsl:template>' +
+ '<xsl:template name="nodes">' +
+ ' <xsl:param name="node" />' +
+ ' <xsl:param name="is_last" />' +
+ ' <xsl:variable name="children" select="count(//item[@parent_id=$node/attribute::id]) > 0" />' +
+ ' <li>' +
+ ' <xsl:attribute name="class">' +
+ ' <xsl:if test="$is_last = true()">jstree-last </xsl:if>' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@state = \'open\'">jstree-open </xsl:when>' +
+ ' <xsl:when test="$children or @hasChildren or @state = \'closed\'">jstree-closed </xsl:when>' +
+ ' <xsl:otherwise>jstree-leaf </xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' <xsl:value-of select="@class" />' +
+ ' </xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'parent_id\' and name() != \'hasChildren\' and name() != \'class\' and name() != \'state\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins class="jstree-icon"><xsl:text> </xsl:text></ins>' +
+ ' <xsl:for-each select="content/name">' +
+ ' <a>' +
+ ' <xsl:attribute name="href">' +
+ ' <xsl:choose>' +
+ ' <xsl:when test="@href"><xsl:value-of select="@href" /></xsl:when>' +
+ ' <xsl:otherwise>#</xsl:otherwise>' +
+ ' </xsl:choose>' +
+ ' </xsl:attribute>' +
+ ' <xsl:attribute name="class"><xsl:value-of select="@lang" /> <xsl:value-of select="@class" /></xsl:attribute>' +
+ ' <xsl:attribute name="style"><xsl:value-of select="@style" /></xsl:attribute>' +
+ ' <xsl:for-each select="@*">' +
+ ' <xsl:if test="name() != \'style\' and name() != \'class\' and name() != \'href\'">' +
+ ' <xsl:attribute name="{name()}"><xsl:value-of select="." /></xsl:attribute>' +
+ ' </xsl:if>' +
+ ' </xsl:for-each>' +
+ ' <ins>' +
+ ' <xsl:attribute name="class">jstree-icon ' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and not(contains(@icon,\'/\'))"><xsl:value-of select="@icon" /></xsl:if>' +
+ ' </xsl:attribute>' +
+ ' <xsl:if test="string-length(attribute::icon) > 0 and contains(@icon,\'/\')"><xsl:attribute name="style">background:url(<xsl:value-of select="@icon" />) center center no-repeat;</xsl:attribute></xsl:if>' +
+ ' <xsl:text> </xsl:text>' +
+ ' </ins>' +
+ ' <xsl:copy-of select="./child::node()" />' +
+ ' </a>' +
+ ' </xsl:for-each>' +
+ ' <xsl:if test="$children">' +
+ ' <ul>' +
+ ' <xsl:for-each select="//item[@parent_id=$node/attribute::id]">' +
+ ' <xsl:call-template name="nodes">' +
+ ' <xsl:with-param name="node" select="." />' +
+ ' <xsl:with-param name="is_last" select="number(position() = last())" />' +
+ ' </xsl:call-template>' +
+ ' </xsl:for-each>' +
+ ' </ul>' +
+ ' </xsl:if>' +
+ ' </li>' +
+ '</xsl:template>' +
+ '</xsl:stylesheet>'
+ },
+ escape_xml = function(string) {
+ return string
+ .toString()
+ .replace(/&/g, '&')
+ .replace(/</g, '<')
+ .replace(/>/g, '>')
+ .replace(/"/g, '"')
+ .replace(/'/g, ''');
+ };
+ $.jstree.plugin("xml_data", {
+ defaults : {
+ data : false,
+ ajax : false,
+ xsl : "flat",
+ clean_node : false,
+ correct_state : true,
+ get_skip_empty : false,
+ get_include_preamble : true
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_xml(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ var s = this._get_settings().xml_data;
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+ },
+ load_node_xml : function (obj, s_call, e_call) {
+ var s = this.get_settings().xml_data,
+ error_func = function () {},
+ success_func = function () {};
+
+ obj = this._get_node(obj);
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case (!s.data && !s.ajax): throw "Neither data nor ajax settings supplied.";
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ this.parse_xml(d, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }
+ }, this));
+ }, this));
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ this.parse_xml(s.data, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ this.get_container().children("ul").empty().append(d.children());
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }, this));
+ }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().xml_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj !== -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ d = x.responseText;
+ var sf = this.get_settings().xml_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+ return error_func.call(this, x, t, "");
+ }
+ this.parse_xml(d, $.proxy(function (d) {
+ if(d) {
+ d = d.replace(/ ?xmlns="[^"]*"/ig, "");
+ if(d.length > 10) {
+ d = $(d);
+ if(obj === -1 || !obj) { this.get_container().children("ul").empty().append(d.children()); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d); obj.removeData("jstree_is_loading"); }
+ if(s.clean_node) { this.clean_node(obj); }
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }
+ }, this));
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "xml"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ },
+ parse_xml : function (xml, callback) {
+ var s = this._get_settings().xml_data;
+ $.vakata.xslt(xml, xsl[s.xsl], callback);
+ },
+ get_xml : function (tp, obj, li_attr, a_attr, is_callback) {
+ var result = "",
+ s = this._get_settings(),
+ _this = this,
+ tmp1, tmp2, li, a, lang;
+ if(!tp) { tp = "flat"; }
+ if(!is_callback) { is_callback = 0; }
+ obj = this._get_node(obj);
+ if(!obj || obj === -1) { obj = this.get_container().find("> ul > li"); }
+ li_attr = $.isArray(li_attr) ? li_attr : [ "id", "class" ];
+ if(!is_callback && this.data.types && $.inArray(s.types.type_attr, li_attr) === -1) { li_attr.push(s.types.type_attr); }
+
+ a_attr = $.isArray(a_attr) ? a_attr : [ ];
+
+ if(!is_callback) {
+ if(s.xml_data.get_include_preamble) {
+ result += '<' + '?xml version="1.0" encoding="UTF-8"?' + '>';
+ }
+ result += "<root>";
+ }
+ obj.each(function () {
+ result += "<item";
+ li = $(this);
+ $.each(li_attr, function (i, v) {
+ var t = li.attr(v);
+ if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+ result += " " + v + "=\"" + escape_xml((" " + (t || "")).replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+ }
+ });
+ if(li.hasClass("jstree-open")) { result += " state=\"open\""; }
+ if(li.hasClass("jstree-closed")) { result += " state=\"closed\""; }
+ if(tp === "flat") { result += " parent_id=\"" + escape_xml(is_callback) + "\""; }
+ result += ">";
+ result += "<content>";
+ a = li.children("a");
+ a.each(function () {
+ tmp1 = $(this);
+ lang = false;
+ result += "<name";
+ if($.inArray("languages", s.plugins) !== -1) {
+ $.each(s.languages, function (k, z) {
+ if(tmp1.hasClass(z)) { result += " lang=\"" + escape_xml(z) + "\""; lang = z; return false; }
+ });
+ }
+ if(a_attr.length) {
+ $.each(a_attr, function (k, z) {
+ var t = tmp1.attr(z);
+ if(!s.xml_data.get_skip_empty || typeof t !== "undefined") {
+ result += " " + z + "=\"" + escape_xml((" " + t || "").replace(/ jstree[^ ]*/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + "\"";
+ }
+ });
+ }
+ if(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/^\s+$/ig,"").length) {
+ result += ' icon="' + escape_xml(tmp1.children("ins").get(0).className.replace(/jstree[^ ]*|$/ig,'').replace(/\s+$/ig," ").replace(/^ /,"").replace(/ $/,"")) + '"';
+ }
+ if(tmp1.children("ins").get(0).style.backgroundImage.length) {
+ result += ' icon="' + escape_xml(tmp1.children("ins").get(0).style.backgroundImage.replace("url(","").replace(")","").replace(/'/ig,"").replace(/"/ig,"")) + '"';
+ }
+ result += ">";
+ result += "<![CDATA[" + _this.get_text(tmp1, lang) + "]]>";
+ result += "</name>";
+ });
+ result += "</content>";
+ tmp2 = li[0].id || true;
+ li = li.find("> ul > li");
+ if(li.length) { tmp2 = _this.get_xml(tp, li, li_attr, a_attr, tmp2); }
+ else { tmp2 = ""; }
+ if(tp == "nest") { result += tmp2; }
+ result += "</item>";
+ if(tp == "flat") { result += tmp2; }
+ });
+ if(!is_callback) { result += "</root>"; }
+ return result;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree search plugin
+ * Enables both sync and async search on the tree
+ * DOES NOT WORK WITH JSON PROGRESSIVE RENDER
+ */
+(function ($) {
+ $.expr[':'].jstree_contains = function(a,i,m){
+ return (a.textContent || a.innerText || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+ };
+ $.expr[':'].jstree_title_contains = function(a,i,m) {
+ return (a.getAttribute("title") || "").toLowerCase().indexOf(m[3].toLowerCase())>=0;
+ };
+ $.jstree.plugin("search", {
+ __init : function () {
+ this.data.search.str = "";
+ this.data.search.result = $();
+ if(this._get_settings().search.show_only_matches) {
+ this.get_container()
+ .bind("search.jstree", function (e, data) {
+ $(this).children("ul").find("li").hide().removeClass("jstree-last");
+ data.rslt.nodes.parentsUntil(".jstree").andSelf().show()
+ .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); });
+ })
+ .bind("clear_search.jstree", function () {
+ $(this).children("ul").find("li").css("display","").end().end().jstree("clean_node", -1);
+ });
+ }
+ },
+ defaults : {
+ ajax : false,
+ search_method : "jstree_contains", // for case insensitive - jstree_contains
+ show_only_matches : false
+ },
+ _fn : {
+ search : function (str, skip_async) {
+ if($.trim(str) === "") { this.clear_search(); return; }
+ var s = this.get_settings().search,
+ t = this,
+ error_func = function () { },
+ success_func = function () { };
+ this.data.search.str = str;
+
+ if(!skip_async && s.ajax !== false && this.get_container_ul().find("li.jstree-closed:not(:has(ul)):eq(0)").length > 0) {
+ this.search.supress_callback = true;
+ error_func = function () { };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().search.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ this.data.search.to_open = d;
+ this._search_open();
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, str); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, str); }
+ if(!s.ajax.data) { s.ajax.data = { "search_string" : str }; }
+ if(!s.ajax.dataType || /^json/.exec(s.ajax.dataType)) { s.ajax.dataType = "json"; }
+ $.ajax(s.ajax);
+ return;
+ }
+ if(this.data.search.result.length) { this.clear_search(); }
+ this.data.search.result = this.get_container().find("a" + (this.data.languages ? "." + this.get_lang() : "" ) + ":" + (s.search_method) + "(" + this.data.search.str + ")");
+ this.data.search.result.addClass("jstree-search").parent().parents(".jstree-closed").each(function () {
+ t.open_node(this, false, true);
+ });
+ this.__callback({ nodes : this.data.search.result, str : str });
+ },
+ clear_search : function (str) {
+ this.data.search.result.removeClass("jstree-search");
+ this.__callback(this.data.search.result);
+ this.data.search.result = $();
+ },
+ _search_open : function (is_callback) {
+ var _this = this,
+ done = true,
+ current = [],
+ remaining = [];
+ if(this.data.search.to_open.length) {
+ $.each(this.data.search.to_open, function (i, val) {
+ if(val == "#") { return true; }
+ if($(val).length && $(val).is(".jstree-closed")) { current.push(val); }
+ else { remaining.push(val); }
+ });
+ if(current.length) {
+ this.data.search.to_open = remaining;
+ $.each(current, function (i, val) {
+ _this.open_node(val, function () { _this._search_open(true); });
+ });
+ done = false;
+ }
+ }
+ if(done) { this.search(this.data.search.str, true); }
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree contextmenu plugin
+ */
+(function ($) {
+ $.vakata.context = {
+ hide_on_mouseleave : false,
+
+ cnt : $("<div id='vakata-contextmenu' />"),
+ vis : false,
+ tgt : false,
+ par : false,
+ func : false,
+ data : false,
+ rtl : false,
+ show : function (s, t, x, y, d, p, rtl) {
+ $.vakata.context.rtl = !!rtl;
+ var html = $.vakata.context.parse(s), h, w;
+ if(!html) { return; }
+ $.vakata.context.vis = true;
+ $.vakata.context.tgt = t;
+ $.vakata.context.par = p || t || null;
+ $.vakata.context.data = d || null;
+ $.vakata.context.cnt
+ .html(html)
+ .css({ "visibility" : "hidden", "display" : "block", "left" : 0, "top" : 0 });
+
+ if($.vakata.context.hide_on_mouseleave) {
+ $.vakata.context.cnt
+ .one("mouseleave", function(e) { $.vakata.context.hide(); });
+ }
+
+ h = $.vakata.context.cnt.height();
+ w = $.vakata.context.cnt.width();
+ if(x + w > $(document).width()) {
+ x = $(document).width() - (w + 5);
+ $.vakata.context.cnt.find("li > ul").addClass("right");
+ }
+ if(y + h > $(document).height()) {
+ y = y - (h + t[0].offsetHeight);
+ $.vakata.context.cnt.find("li > ul").addClass("bottom");
+ }
+
+ $.vakata.context.cnt
+ .css({ "left" : x, "top" : y })
+ .find("li:has(ul)")
+ .bind("mouseenter", function (e) {
+ var w = $(document).width(),
+ h = $(document).height(),
+ ul = $(this).children("ul").show();
+ if(w !== $(document).width()) { ul.toggleClass("right"); }
+ if(h !== $(document).height()) { ul.toggleClass("bottom"); }
+ })
+ .bind("mouseleave", function (e) {
+ $(this).children("ul").hide();
+ })
+ .end()
+ .css({ "visibility" : "visible" })
+ .show();
+ $(document).triggerHandler("context_show.vakata");
+ },
+ hide : function () {
+ $.vakata.context.vis = false;
+ $.vakata.context.cnt.attr("class","").css({ "visibility" : "hidden" });
+ $(document).triggerHandler("context_hide.vakata");
+ },
+ parse : function (s, is_callback) {
+ if(!s) { return false; }
+ var str = "",
+ tmp = false,
+ was_sep = true;
+ if(!is_callback) { $.vakata.context.func = {}; }
+ str += "<ul>";
+ $.each(s, function (i, val) {
+ if(!val) { return true; }
+ $.vakata.context.func[i] = val.action;
+ if(!was_sep && val.separator_before) {
+ str += "<li class='vakata-separator vakata-separator-before'></li>";
+ }
+ was_sep = false;
+ str += "<li class='" + (val._class || "") + (val._disabled ? " jstree-contextmenu-disabled " : "") + "'><ins ";
+ if(val.icon && val.icon.indexOf("/") === -1) { str += " class='" + val.icon + "' "; }
+ if(val.icon && val.icon.indexOf("/") !== -1) { str += " style='background:url(" + val.icon + ") center center no-repeat;' "; }
+ str += "> </ins><a href='#' rel='" + i + "'>";
+ if(val.submenu) {
+ str += "<span style='float:" + ($.vakata.context.rtl ? "left" : "right") + ";'>»</span>";
+ }
+ str += val.label + "</a>";
+ if(val.submenu) {
+ tmp = $.vakata.context.parse(val.submenu, true);
+ if(tmp) { str += tmp; }
+ }
+ str += "</li>";
+ if(val.separator_after) {
+ str += "<li class='vakata-separator vakata-separator-after'></li>";
+ was_sep = true;
+ }
+ });
+ str = str.replace(/<li class\='vakata-separator vakata-separator-after'\><\/li\>$/,"");
+ str += "</ul>";
+ $(document).triggerHandler("context_parse.vakata");
+ return str.length > 10 ? str : false;
+ },
+ exec : function (i) {
+ if($.isFunction($.vakata.context.func[i])) {
+ // if is string - eval and call it!
+ $.vakata.context.func[i].call($.vakata.context.data, $.vakata.context.par);
+ return true;
+ }
+ else { return false; }
+ }
+ };
+ $(function () {
+ var css_string = '' +
+ '#vakata-contextmenu { display:block; visibility:hidden; left:0; top:-200px; position:absolute; margin:0; padding:0; min-width:180px; background:#ebebeb; border:1px solid silver; z-index:10000; *width:180px; } ' +
+ '#vakata-contextmenu ul { min-width:180px; *width:180px; } ' +
+ '#vakata-contextmenu ul, #vakata-contextmenu li { margin:0; padding:0; list-style-type:none; display:block; } ' +
+ '#vakata-contextmenu li { line-height:20px; min-height:20px; position:relative; padding:0px; } ' +
+ '#vakata-contextmenu li a { padding:1px 6px; line-height:17px; display:block; text-decoration:none; margin:1px 1px 0 1px; } ' +
+ '#vakata-contextmenu li ins { float:left; width:16px; height:16px; text-decoration:none; margin-right:2px; } ' +
+ '#vakata-contextmenu li a:hover, #vakata-contextmenu li.vakata-hover > a { background:gray; color:white; } ' +
+ '#vakata-contextmenu li ul { display:none; position:absolute; top:-2px; left:100%; background:#ebebeb; border:1px solid gray; } ' +
+ '#vakata-contextmenu .right { right:100%; left:auto; } ' +
+ '#vakata-contextmenu .bottom { bottom:-1px; top:auto; } ' +
+ '#vakata-contextmenu li.vakata-separator { min-height:0; height:1px; line-height:1px; font-size:1px; overflow:hidden; margin:0 2px; background:silver; /* border-top:1px solid #fefefe; */ padding:0; } ';
+ $.vakata.css.add_sheet({ str : css_string, title : "vakata" });
+ $.vakata.context.cnt
+ .delegate("a","click", function (e) { e.preventDefault(); })
+ .delegate("a","mouseup", function (e) {
+ if(!$(this).parent().hasClass("jstree-contextmenu-disabled") && $.vakata.context.exec($(this).attr("rel"))) {
+ $.vakata.context.hide();
+ }
+ else { $(this).blur(); }
+ })
+ .delegate("a","mouseover", function () {
+ $.vakata.context.cnt.find(".vakata-hover").removeClass("vakata-hover");
+ })
+ .appendTo("body");
+ $(document).bind("mousedown", function (e) { if($.vakata.context.vis && !$.contains($.vakata.context.cnt[0], e.target)) { $.vakata.context.hide(); } });
+ if(typeof $.hotkeys !== "undefined") {
+ $(document)
+ .bind("keydown", "up", function (e) {
+ if($.vakata.context.vis) {
+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").prevAll("li:not(.vakata-separator)").first();
+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").last(); }
+ o.addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "down", function (e) {
+ if($.vakata.context.vis) {
+ var o = $.vakata.context.cnt.find("ul:visible").last().children(".vakata-hover").removeClass("vakata-hover").nextAll("li:not(.vakata-separator)").first();
+ if(!o.length) { o = $.vakata.context.cnt.find("ul:visible").last().children("li:not(.vakata-separator)").first(); }
+ o.addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "right", function (e) {
+ if($.vakata.context.vis) {
+ $.vakata.context.cnt.find(".vakata-hover").children("ul").show().children("li:not(.vakata-separator)").removeClass("vakata-hover").first().addClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "left", function (e) {
+ if($.vakata.context.vis) {
+ $.vakata.context.cnt.find(".vakata-hover").children("ul").hide().children(".vakata-separator").removeClass("vakata-hover");
+ e.stopImmediatePropagation();
+ e.preventDefault();
+ }
+ })
+ .bind("keydown", "esc", function (e) {
+ $.vakata.context.hide();
+ e.preventDefault();
+ })
+ .bind("keydown", "space", function (e) {
+ $.vakata.context.cnt.find(".vakata-hover").last().children("a").click();
+ e.preventDefault();
+ });
+ }
+ });
+
+ $.jstree.plugin("contextmenu", {
+ __init : function () {
+ this.get_container()
+ .delegate("a", "contextmenu.jstree", $.proxy(function (e) {
+ e.preventDefault();
+ if(!$(e.currentTarget).hasClass("jstree-loading")) {
+ this.show_contextmenu(e.currentTarget, e.pageX, e.pageY);
+ }
+ }, this))
+ .delegate("a", "click.jstree", $.proxy(function (e) {
+ if(this.data.contextmenu) {
+ $.vakata.context.hide();
+ }
+ }, this))
+ .bind("destroy.jstree", $.proxy(function () {
+ // TODO: move this to descruct method
+ if(this.data.contextmenu) {
+ $.vakata.context.hide();
+ }
+ }, this));
+ $(document).bind("context_hide.vakata", $.proxy(function () { this.data.contextmenu = false; }, this));
+ },
+ defaults : {
+ select_node : false, // requires UI plugin
+ show_at_node : true,
+ items : { // Could be a function that should return an object like this one
+ "create" : {
+ "separator_before" : false,
+ "separator_after" : true,
+ "label" : "Create",
+ "action" : function (obj) { this.create(obj); }
+ },
+ "rename" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Rename",
+ "action" : function (obj) { this.rename(obj); }
+ },
+ "remove" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Delete",
+ "action" : function (obj) { if(this.is_selected(obj)) { this.remove(); } else { this.remove(obj); } }
+ },
+ "ccp" : {
+ "separator_before" : true,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Edit",
+ "action" : false,
+ "submenu" : {
+ "cut" : {
+ "separator_before" : false,
+ "separator_after" : false,
+ "label" : "Cut",
+ "action" : function (obj) { this.cut(obj); }
+ },
+ "copy" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Copy",
+ "action" : function (obj) { this.copy(obj); }
+ },
+ "paste" : {
+ "separator_before" : false,
+ "icon" : false,
+ "separator_after" : false,
+ "label" : "Paste",
+ "action" : function (obj) { this.paste(obj); }
+ }
+ }
+ }
+ }
+ },
+ _fn : {
+ show_contextmenu : function (obj, x, y) {
+ obj = this._get_node(obj);
+ var s = this.get_settings().contextmenu,
+ a = obj.children("a:visible:eq(0)"),
+ o = false,
+ i = false;
+ if(s.select_node && this.data.ui && !this.is_selected(obj)) {
+ this.deselect_all();
+ this.select_node(obj, true);
+ }
+ if(s.show_at_node || typeof x === "undefined" || typeof y === "undefined") {
+ o = a.offset();
+ x = o.left;
+ y = o.top + this.data.core.li_height;
+ }
+ i = obj.data("jstree") && obj.data("jstree").contextmenu ? obj.data("jstree").contextmenu : s.items;
+ if($.isFunction(i)) { i = i.call(this, obj); }
+ this.data.contextmenu = true;
+ $.vakata.context.show(i, a, x, y, this, obj, this._get_settings().core.rtl);
+ if(this.data.themes) { $.vakata.context.cnt.attr("class", "jstree-" + this.data.themes.theme + "-context"); }
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree types plugin
+ * Adds support types of nodes
+ * You can set an attribute on each li node, that represents its type.
+ * According to the type setting the node may get custom icon/validation rules
+ */
+(function ($) {
+ $.jstree.plugin("types", {
+ __init : function () {
+ var s = this._get_settings().types;
+ this.data.types.attach_to = [];
+ this.get_container()
+ .bind("init.jstree", $.proxy(function () {
+ var types = s.types,
+ attr = s.type_attr,
+ icons_css = "",
+ _this = this;
+
+ $.each(types, function (i, tp) {
+ $.each(tp, function (k, v) {
+ if(!/^(max_depth|max_children|icon|valid_children)$/.test(k)) { _this.data.types.attach_to.push(k); }
+ });
+ if(!tp.icon) { return true; }
+ if( tp.icon.image || tp.icon.position) {
+ if(i == "default") { icons_css += '.jstree-' + _this.get_index() + ' a > .jstree-icon { '; }
+ else { icons_css += '.jstree-' + _this.get_index() + ' li[' + attr + '="' + i + '"] > a > .jstree-icon { '; }
+ if(tp.icon.image) { icons_css += ' background-image:url(' + tp.icon.image + '); '; }
+ if(tp.icon.position){ icons_css += ' background-position:' + tp.icon.position + '; '; }
+ else { icons_css += ' background-position:0 0; '; }
+ icons_css += '} ';
+ }
+ });
+ if(icons_css !== "") { $.vakata.css.add_sheet({ 'str' : icons_css, title : "jstree-types" }); }
+ }, this))
+ .bind("before.jstree", $.proxy(function (e, data) {
+ var s, t,
+ o = this._get_settings().types.use_data ? this._get_node(data.args[0]) : false,
+ d = o && o !== -1 && o.length ? o.data("jstree") : false;
+ if(d && d.types && d.types[data.func] === false) { e.stopImmediatePropagation(); return false; }
+ if($.inArray(data.func, this.data.types.attach_to) !== -1) {
+ if(!data.args[0] || (!data.args[0].tagName && !data.args[0].jquery)) { return; }
+ s = this._get_settings().types.types;
+ t = this._get_type(data.args[0]);
+ if(
+ (
+ (s[t] && typeof s[t][data.func] !== "undefined") ||
+ (s["default"] && typeof s["default"][data.func] !== "undefined")
+ ) && this._check(data.func, data.args[0]) === false
+ ) {
+ e.stopImmediatePropagation();
+ return false;
+ }
+ }
+ }, this));
+ if(is_ie6) {
+ this.get_container()
+ .bind("load_node.jstree set_type.jstree", $.proxy(function (e, data) {
+ var r = data && data.rslt && data.rslt.obj && data.rslt.obj !== -1 ? this._get_node(data.rslt.obj).parent() : this.get_container_ul(),
+ c = false,
+ s = this._get_settings().types;
+ $.each(s.types, function (i, tp) {
+ if(tp.icon && (tp.icon.image || tp.icon.position)) {
+ c = i === "default" ? r.find("li > a > .jstree-icon") : r.find("li[" + s.type_attr + "='" + i + "'] > a > .jstree-icon");
+ if(tp.icon.image) { c.css("backgroundImage","url(" + tp.icon.image + ")"); }
+ c.css("backgroundPosition", tp.icon.position || "0 0");
+ }
+ });
+ }, this));
+ }
+ },
+ defaults : {
+ // defines maximum number of root nodes (-1 means unlimited, -2 means disable max_children checking)
+ max_children : -1,
+ // defines the maximum depth of the tree (-1 means unlimited, -2 means disable max_depth checking)
+ max_depth : -1,
+ // defines valid node types for the root nodes
+ valid_children : "all",
+
+ // whether to use $.data
+ use_data : false,
+ // where is the type stores (the rel attribute of the LI element)
+ type_attr : "rel",
+ // a list of types
+ types : {
+ // the default type
+ "default" : {
+ "max_children" : -1,
+ "max_depth" : -1,
+ "valid_children": "all"
+
+ // Bound functions - you can bind any other function here (using boolean or function)
+ //"select_node" : true
+ }
+ }
+ },
+ _fn : {
+ _types_notify : function (n, data) {
+ if(data.type && this._get_settings().types.use_data) {
+ this.set_type(data.type, n);
+ }
+ },
+ _get_type : function (obj) {
+ obj = this._get_node(obj);
+ return (!obj || !obj.length) ? false : obj.attr(this._get_settings().types.type_attr) || "default";
+ },
+ set_type : function (str, obj) {
+ obj = this._get_node(obj);
+ var ret = (!obj.length || !str) ? false : obj.attr(this._get_settings().types.type_attr, str);
+ if(ret) { this.__callback({ obj : obj, type : str}); }
+ return ret;
+ },
+ _check : function (rule, obj, opts) {
+ obj = this._get_node(obj);
+ var v = false, t = this._get_type(obj), d = 0, _this = this, s = this._get_settings().types, data = false;
+ if(obj === -1) {
+ if(!!s[rule]) { v = s[rule]; }
+ else { return; }
+ }
+ else {
+ if(t === false) { return; }
+ data = s.use_data ? obj.data("jstree") : false;
+ if(data && data.types && typeof data.types[rule] !== "undefined") { v = data.types[rule]; }
+ else if(!!s.types[t] && typeof s.types[t][rule] !== "undefined") { v = s.types[t][rule]; }
+ else if(!!s.types["default"] && typeof s.types["default"][rule] !== "undefined") { v = s.types["default"][rule]; }
+ }
+ if($.isFunction(v)) { v = v.call(this, obj); }
+ if(rule === "max_depth" && obj !== -1 && opts !== false && s.max_depth !== -2 && v !== 0) {
+ // also include the node itself - otherwise if root node it is not checked
+ obj.children("a:eq(0)").parentsUntil(".jstree","li").each(function (i) {
+ // check if current depth already exceeds global tree depth
+ if(s.max_depth !== -1 && s.max_depth - (i + 1) <= 0) { v = 0; return false; }
+ d = (i === 0) ? v : _this._check(rule, this, false);
+ // check if current node max depth is already matched or exceeded
+ if(d !== -1 && d - (i + 1) <= 0) { v = 0; return false; }
+ // otherwise - set the max depth to the current value minus current depth
+ if(d >= 0 && (d - (i + 1) < v || v < 0) ) { v = d - (i + 1); }
+ // if the global tree depth exists and it minus the nodes calculated so far is less than `v` or `v` is unlimited
+ if(s.max_depth >= 0 && (s.max_depth - (i + 1) < v || v < 0) ) { v = s.max_depth - (i + 1); }
+ });
+ }
+ return v;
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var m = this._get_move(),
+ s = m.rt._get_settings().types,
+ mc = m.rt._check("max_children", m.cr),
+ md = m.rt._check("max_depth", m.cr),
+ vc = m.rt._check("valid_children", m.cr),
+ ch = 0, d = 1, t;
+
+ if(vc === "none") { return false; }
+ if($.isArray(vc) && m.ot && m.ot._get_type) {
+ m.o.each(function () {
+ if($.inArray(m.ot._get_type(this), vc) === -1) { d = false; return false; }
+ });
+ if(d === false) { return false; }
+ }
+ if(s.max_children !== -2 && mc !== -1) {
+ ch = m.cr === -1 ? this.get_container().find("> ul > li").not(m.o).length : m.cr.find("> ul > li").not(m.o).length;
+ if(ch + m.o.length > mc) { return false; }
+ }
+ if(s.max_depth !== -2 && md !== -1) {
+ d = 0;
+ if(md === 0) { return false; }
+ if(typeof m.o.d === "undefined") {
+ // TODO: deal with progressive rendering and async when checking max_depth (how to know the depth of the moved node)
+ t = m.o;
+ while(t.length > 0) {
+ t = t.find("> ul > li");
+ d ++;
+ }
+ m.o.d = d;
+ }
+ if(md - m.o.d < 0) { return false; }
+ }
+ return true;
+ },
+ create_node : function (obj, position, js, callback, is_loaded, skip_check) {
+ if(!skip_check && (is_loaded || this._is_loaded(obj))) {
+ var p = (typeof position == "string" && position.match(/^before|after$/i) && obj !== -1) ? this._get_parent(obj) : this._get_node(obj),
+ s = this._get_settings().types,
+ mc = this._check("max_children", p),
+ md = this._check("max_depth", p),
+ vc = this._check("valid_children", p),
+ ch;
+ if(typeof js === "string") { js = { data : js }; }
+ if(!js) { js = {}; }
+ if(vc === "none") { return false; }
+ if($.isArray(vc)) {
+ if(!js.attr || !js.attr[s.type_attr]) {
+ if(!js.attr) { js.attr = {}; }
+ js.attr[s.type_attr] = vc[0];
+ }
+ else {
+ if($.inArray(js.attr[s.type_attr], vc) === -1) { return false; }
+ }
+ }
+ if(s.max_children !== -2 && mc !== -1) {
+ ch = p === -1 ? this.get_container().find("> ul > li").length : p.find("> ul > li").length;
+ if(ch + 1 > mc) { return false; }
+ }
+ if(s.max_depth !== -2 && md !== -1 && (md - 1) < 0) { return false; }
+ }
+ return this.__call_old(true, obj, position, js, callback, is_loaded, skip_check);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree HTML plugin
+ * The HTML data store. Datastores are build by replacing the `load_node` and `_is_loaded` functions.
+ */
+(function ($) {
+ $.jstree.plugin("html_data", {
+ __init : function () {
+ // this used to use html() and clean the whitespace, but this way any attached data was lost
+ this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true);
+ // remove white space from LI node - otherwise nodes appear a bit to the right
+ this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove();
+ },
+ defaults : {
+ data : false,
+ ajax : false,
+ correct_state : true
+ },
+ _fn : {
+ load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
+ _is_loaded : function (obj) {
+ obj = this._get_node(obj);
+ return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
+ },
+ load_node_html : function (obj, s_call, e_call) {
+ var d,
+ s = this.get_settings().html_data,
+ error_func = function () {},
+ success_func = function () {};
+ obj = this._get_node(obj);
+ if(obj && obj !== -1) {
+ if(obj.data("jstree_is_loading")) { return; }
+ else { obj.data("jstree_is_loading",true); }
+ }
+ switch(!0) {
+ case ($.isFunction(s.data)):
+ s.data.call(this, obj, $.proxy(function (d) {
+ if(d && d !== "" && d.toString && d.toString().replace(/^[\s\n]+$/,"") !== "") {
+ d = $(d);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ }, this));
+ break;
+ case (!s.data && !s.ajax):
+ if(!obj || obj == -1) {
+ this.get_container()
+ .children("ul").empty()
+ .append(this.data.html_data.original_container_html)
+ .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+ this.clean_node();
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!!s.data && !s.ajax) || (!!s.data && !!s.ajax && (!obj || obj === -1)):
+ if(!obj || obj == -1) {
+ d = $(s.data);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ this.get_container()
+ .children("ul").empty().append(d.children())
+ .find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end()
+ .filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon");
+ this.clean_node();
+ }
+ if(s_call) { s_call.call(this); }
+ break;
+ case (!s.data && !!s.ajax) || (!!s.data && !!s.ajax && obj && obj !== -1):
+ obj = this._get_node(obj);
+ error_func = function (x, t, e) {
+ var ef = this.get_settings().html_data.ajax.error;
+ if(ef) { ef.call(this, x, t, e); }
+ if(obj != -1 && obj.length) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(t === "success" && s.correct_state) { this.correct_state(obj); }
+ }
+ else {
+ if(t === "success" && s.correct_state) { this.get_container().children("ul").empty(); }
+ }
+ if(e_call) { e_call.call(this); }
+ };
+ success_func = function (d, t, x) {
+ var sf = this.get_settings().html_data.ajax.success;
+ if(sf) { d = sf.call(this,d,t,x) || d; }
+ if(d === "" || (d && d.toString && d.toString().replace(/^[\s\n]+$/,"") === "")) {
+ return error_func.call(this, x, t, "");
+ }
+ if(d) {
+ d = $(d);
+ if(!d.is("ul")) { d = $("<ul />").append(d); }
+ if(obj == -1 || !obj) { this.get_container().children("ul").empty().append(d.children()).find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); }
+ else { obj.children("a.jstree-loading").removeClass("jstree-loading"); obj.append(d).children("ul").find("li, a").filter(function () { return !this.firstChild || !this.firstChild.tagName || this.firstChild.tagName !== "INS"; }).prepend("<ins class='jstree-icon'> </ins>").end().filter("a").children("ins:first-child").not(".jstree-icon").addClass("jstree-icon"); obj.removeData("jstree_is_loading"); }
+ this.clean_node(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ else {
+ if(obj && obj !== -1) {
+ obj.children("a.jstree-loading").removeClass("jstree-loading");
+ obj.removeData("jstree_is_loading");
+ if(s.correct_state) {
+ this.correct_state(obj);
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ else {
+ if(s.correct_state) {
+ this.get_container().children("ul").empty();
+ if(s_call) { s_call.call(this); }
+ }
+ }
+ }
+ };
+ s.ajax.context = this;
+ s.ajax.error = error_func;
+ s.ajax.success = success_func;
+ if(!s.ajax.dataType) { s.ajax.dataType = "html"; }
+ if($.isFunction(s.ajax.url)) { s.ajax.url = s.ajax.url.call(this, obj); }
+ if($.isFunction(s.ajax.data)) { s.ajax.data = s.ajax.data.call(this, obj); }
+ $.ajax(s.ajax);
+ break;
+ }
+ }
+ }
+ });
+ // include the HTML data plugin by default
+ $.jstree.defaults.plugins.push("html_data");
+})(jQuery);
+//*/
+
+/*
+ * jsTree themeroller plugin
+ * Adds support for jQuery UI themes. Include this at the end of your plugins list, also make sure "themes" is not included.
+ */
+(function ($) {
+ $.jstree.plugin("themeroller", {
+ __init : function () {
+ var s = this._get_settings().themeroller;
+ this.get_container()
+ .addClass("ui-widget-content")
+ .addClass("jstree-themeroller")
+ .delegate("a","mouseenter.jstree", function (e) {
+ if(!$(e.currentTarget).hasClass("jstree-loading")) {
+ $(this).addClass(s.item_h);
+ }
+ })
+ .delegate("a","mouseleave.jstree", function () {
+ $(this).removeClass(s.item_h);
+ })
+ .bind("init.jstree", $.proxy(function (e, data) {
+ data.inst.get_container().find("> ul > li > .jstree-loading > ins").addClass("ui-icon-refresh");
+ this._themeroller(data.inst.get_container().find("> ul > li"));
+ }, this))
+ .bind("open_node.jstree create_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.obj);
+ }, this))
+ .bind("loaded.jstree refresh.jstree", $.proxy(function (e) {
+ this._themeroller();
+ }, this))
+ .bind("close_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.obj);
+ }, this))
+ .bind("delete_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.parent);
+ }, this))
+ .bind("correct_state.jstree", $.proxy(function (e, data) {
+ data.rslt.obj
+ .children("ins.jstree-icon").removeClass(s.opened + " " + s.closed + " ui-icon").end()
+ .find("> a > ins.ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_open + " " + s.item_clsd).addClass(s.item_leaf || "jstree-no-icon");
+ }, this))
+ .bind("select_node.jstree", $.proxy(function (e, data) {
+ data.rslt.obj.children("a").addClass(s.item_a);
+ }, this))
+ .bind("deselect_node.jstree deselect_all.jstree", $.proxy(function (e, data) {
+ this.get_container()
+ .find("a." + s.item_a).removeClass(s.item_a).end()
+ .find("a.jstree-clicked").addClass(s.item_a);
+ }, this))
+ .bind("dehover_node.jstree", $.proxy(function (e, data) {
+ data.rslt.obj.children("a").removeClass(s.item_h);
+ }, this))
+ .bind("hover_node.jstree", $.proxy(function (e, data) {
+ this.get_container()
+ .find("a." + s.item_h).not(data.rslt.obj).removeClass(s.item_h);
+ data.rslt.obj.children("a").addClass(s.item_h);
+ }, this))
+ .bind("move_node.jstree", $.proxy(function (e, data) {
+ this._themeroller(data.rslt.o);
+ this._themeroller(data.rslt.op);
+ }, this));
+ },
+ __destroy : function () {
+ var s = this._get_settings().themeroller,
+ c = [ "ui-icon" ];
+ $.each(s, function (i, v) {
+ v = v.split(" ");
+ if(v.length) { c = c.concat(v); }
+ });
+ this.get_container()
+ .removeClass("ui-widget-content")
+ .find("." + c.join(", .")).removeClass(c.join(" "));
+ },
+ _fn : {
+ _themeroller : function (obj) {
+ var s = this._get_settings().themeroller;
+ obj = !obj || obj == -1 ? this.get_container_ul() : this._get_node(obj).parent();
+ obj
+ .find("li.jstree-closed")
+ .children("ins.jstree-icon").removeClass(s.opened).addClass("ui-icon " + s.closed).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_leaf + " " + s.item_open).addClass(s.item_clsd || "jstree-no-icon")
+ .end()
+ .end()
+ .end()
+ .end()
+ .find("li.jstree-open")
+ .children("ins.jstree-icon").removeClass(s.closed).addClass("ui-icon " + s.opened).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_leaf + " " + s.item_clsd).addClass(s.item_open || "jstree-no-icon")
+ .end()
+ .end()
+ .end()
+ .end()
+ .find("li.jstree-leaf")
+ .children("ins.jstree-icon").removeClass(s.closed + " ui-icon " + s.opened).end()
+ .children("a").addClass(s.item)
+ .children("ins.jstree-icon").addClass("ui-icon")
+ .filter(function() {
+ return this.className.toString()
+ .replace(s.item_clsd,"").replace(s.item_open,"").replace(s.item_leaf,"")
+ .indexOf("ui-icon-") === -1;
+ }).removeClass(s.item_clsd + " " + s.item_open).addClass(s.item_leaf || "jstree-no-icon");
+ }
+ },
+ defaults : {
+ "opened" : "ui-icon-triangle-1-se",
+ "closed" : "ui-icon-triangle-1-e",
+ "item" : "ui-state-default",
+ "item_h" : "ui-state-hover",
+ "item_a" : "ui-state-active",
+ "item_open" : "ui-icon-folder-open",
+ "item_clsd" : "ui-icon-folder-collapsed",
+ "item_leaf" : "ui-icon-document"
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '.jstree-themeroller .ui-icon { overflow:visible; } ' +
+ '.jstree-themeroller a { padding:0 2px; } ' +
+ '.jstree-themeroller .jstree-no-icon { display:none; }';
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree unique plugin
+ * Forces different names amongst siblings (still a bit experimental)
+ * NOTE: does not check language versions (it will not be possible to have nodes with the same title, even in different languages)
+ */
+(function ($) {
+ $.jstree.plugin("unique", {
+ __init : function () {
+ this.get_container()
+ .bind("before.jstree", $.proxy(function (e, data) {
+ var nms = [], res = true, p, t;
+ if(data.func == "move_node") {
+ // obj, ref, position, is_copy, is_prepared, skip_check
+ if(data.args[4] === true) {
+ if(data.args[0].o && data.args[0].o.length) {
+ data.args[0].o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+ res = this._check_unique(nms, data.args[0].np.find("> ul > li").not(data.args[0].o), "move_node");
+ }
+ }
+ }
+ if(data.func == "create_node") {
+ // obj, position, js, callback, is_loaded
+ if(data.args[4] || this._is_loaded(data.args[0])) {
+ p = this._get_node(data.args[0]);
+ if(data.args[1] && (data.args[1] === "before" || data.args[1] === "after")) {
+ p = this._get_parent(data.args[0]);
+ if(!p || p === -1) { p = this.get_container(); }
+ }
+ if(typeof data.args[2] === "string") { nms.push(data.args[2]); }
+ else if(!data.args[2] || !data.args[2].data) { nms.push(this._get_string("new_node")); }
+ else { nms.push(data.args[2].data); }
+ res = this._check_unique(nms, p.find("> ul > li"), "create_node");
+ }
+ }
+ if(data.func == "rename_node") {
+ // obj, val
+ nms.push(data.args[1]);
+ t = this._get_node(data.args[0]);
+ p = this._get_parent(t);
+ if(!p || p === -1) { p = this.get_container(); }
+ res = this._check_unique(nms, p.find("> ul > li").not(t), "rename_node");
+ }
+ if(!res) {
+ e.stopPropagation();
+ return false;
+ }
+ }, this));
+ },
+ defaults : {
+ error_callback : $.noop
+ },
+ _fn : {
+ _check_unique : function (nms, p, func) {
+ var cnms = [];
+ p.children("a").each(function () { cnms.push($(this).text().replace(/^\s+/g,"")); });
+ if(!cnms.length || !nms.length) { return true; }
+ cnms = cnms.sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",");
+ if((cnms.length + nms.length) != cnms.concat(nms).sort().join(",,").replace(/(,|^)([^,]+)(,,\2)+(,|$)/g,"$1$2$4").replace(/,,+/g,",").replace(/,$/,"").split(",").length) {
+ this._get_settings().unique.error_callback.call(null, nms, p, func);
+ return false;
+ }
+ return true;
+ },
+ check_move : function () {
+ if(!this.__call_old()) { return false; }
+ var p = this._get_move(), nms = [];
+ if(p.o && p.o.length) {
+ p.o.children("a").each(function () { nms.push($(this).text().replace(/^\s+/g,"")); });
+ return this._check_unique(nms, p.np.find("> ul > li").not(p.o), "check_move");
+ }
+ return true;
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+/*
+ * jsTree wholerow plugin
+ * Makes select and hover work on the entire width of the node
+ * MAY BE HEAVY IN LARGE DOM
+ */
+(function ($) {
+ $.jstree.plugin("wholerow", {
+ __init : function () {
+ if(!this.data.ui) { throw "jsTree wholerow: jsTree UI plugin not included."; }
+ this.data.wholerow.html = false;
+ this.data.wholerow.to = false;
+ this.get_container()
+ .bind("init.jstree", $.proxy(function (e, data) {
+ this._get_settings().core.animation = 0;
+ }, this))
+ .bind("open_node.jstree create_node.jstree clean_node.jstree loaded.jstree", $.proxy(function (e, data) {
+ this._prepare_wholerow_span( data && data.rslt && data.rslt.obj ? data.rslt.obj : -1 );
+ }, this))
+ .bind("search.jstree clear_search.jstree reopen.jstree after_open.jstree after_close.jstree create_node.jstree delete_node.jstree clean_node.jstree", $.proxy(function (e, data) {
+ if(this.data.to) { clearTimeout(this.data.to); }
+ this.data.to = setTimeout( (function (t, o) { return function() { t._prepare_wholerow_ul(o); }; })(this, data && data.rslt && data.rslt.obj ? data.rslt.obj : -1), 0);
+ }, this))
+ .bind("deselect_all.jstree", $.proxy(function (e, data) {
+ this.get_container().find(" > .jstree-wholerow .jstree-clicked").removeClass("jstree-clicked " + (this.data.themeroller ? this._get_settings().themeroller.item_a : "" ));
+ }, this))
+ .bind("select_node.jstree deselect_node.jstree ", $.proxy(function (e, data) {
+ data.rslt.obj.each(function () {
+ var ref = data.inst.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt((($(this).offset().top - data.inst.get_container().offset().top + data.inst.get_container()[0].scrollTop) / data.inst.data.core.li_height),10)) + ")");
+ // ref.children("a")[e.type === "select_node" ? "addClass" : "removeClass"]("jstree-clicked");
+ ref.children("a").attr("class",data.rslt.obj.children("a").attr("class"));
+ });
+ }, this))
+ .bind("hover_node.jstree dehover_node.jstree", $.proxy(function (e, data) {
+ this.get_container().find(" > .jstree-wholerow .jstree-hovered").removeClass("jstree-hovered " + (this.data.themeroller ? this._get_settings().themeroller.item_h : "" ));
+ if(e.type === "hover_node") {
+ var ref = this.get_container().find(" > .jstree-wholerow li:visible:eq(" + ( parseInt(((data.rslt.obj.offset().top - this.get_container().offset().top + this.get_container()[0].scrollTop) / this.data.core.li_height),10)) + ")");
+ // ref.children("a").addClass("jstree-hovered");
+ ref.children("a").attr("class",data.rslt.obj.children(".jstree-hovered").attr("class"));
+ }
+ }, this))
+ .delegate(".jstree-wholerow-span, ins.jstree-icon, li", "click.jstree", function (e) {
+ var n = $(e.currentTarget);
+ if(e.target.tagName === "A" || (e.target.tagName === "INS" && n.closest("li").is(".jstree-open, .jstree-closed"))) { return; }
+ n.closest("li").children("a:visible:eq(0)").click();
+ e.stopImmediatePropagation();
+ })
+ .delegate("li", "mouseover.jstree", $.proxy(function (e) {
+ e.stopImmediatePropagation();
+ if($(e.currentTarget).children(".jstree-hovered, .jstree-clicked").length) { return false; }
+ this.hover_node(e.currentTarget);
+ return false;
+ }, this))
+ .delegate("li", "mouseleave.jstree", $.proxy(function (e) {
+ if($(e.currentTarget).children("a").hasClass("jstree-hovered").length) { return; }
+ this.dehover_node(e.currentTarget);
+ }, this));
+ if(is_ie7 || is_ie6) {
+ $.vakata.css.add_sheet({ str : ".jstree-" + this.get_index() + " { position:relative; } ", title : "jstree" });
+ }
+ },
+ defaults : {
+ },
+ __destroy : function () {
+ this.get_container().children(".jstree-wholerow").remove();
+ this.get_container().find(".jstree-wholerow-span").remove();
+ },
+ _fn : {
+ _prepare_wholerow_span : function (obj) {
+ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj);
+ if(obj === false) { return; } // added for removing root nodes
+ obj.each(function () {
+ $(this).find("li").andSelf().each(function () {
+ var $t = $(this);
+ if($t.children(".jstree-wholerow-span").length) { return true; }
+ $t.prepend("<span class='jstree-wholerow-span' style='width:" + ($t.parentsUntil(".jstree","li").length * 18) + "px;'> </span>");
+ });
+ });
+ },
+ _prepare_wholerow_ul : function () {
+ var o = this.get_container().children("ul").eq(0), h = o.html();
+ o.addClass("jstree-wholerow-real");
+ if(this.data.wholerow.last_html !== h) {
+ this.data.wholerow.last_html = h;
+ this.get_container().children(".jstree-wholerow").remove();
+ this.get_container().append(
+ o.clone().removeClass("jstree-wholerow-real")
+ .wrapAll("<div class='jstree-wholerow' />").parent()
+ .width(o.parent()[0].scrollWidth)
+ .css("top", (o.height() + ( is_ie7 ? 5 : 0)) * -1 )
+ .find("li[id]").each(function () { this.removeAttribute("id"); }).end()
+ );
+ }
+ }
+ }
+ });
+ $(function() {
+ var css_string = '' +
+ '.jstree .jstree-wholerow-real { position:relative; z-index:1; } ' +
+ '.jstree .jstree-wholerow-real li { cursor:pointer; } ' +
+ '.jstree .jstree-wholerow-real a { border-left-color:transparent !important; border-right-color:transparent !important; } ' +
+ '.jstree .jstree-wholerow { position:relative; z-index:0; height:0; } ' +
+ '.jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { width:100%; } ' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li, .jstree .jstree-wholerow a { margin:0 !important; padding:0 !important; } ' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow li { background:transparent !important; }' +
+ '.jstree .jstree-wholerow ins, .jstree .jstree-wholerow span, .jstree .jstree-wholerow input { display:none !important; }' +
+ '.jstree .jstree-wholerow a, .jstree .jstree-wholerow a:hover { text-indent:-9999px; !important; width:100%; padding:0 !important; border-right-width:0px !important; border-left-width:0px !important; } ' +
+ '.jstree .jstree-wholerow-span { position:absolute; left:0; margin:0px; padding:0; height:18px; border-width:0; padding:0; z-index:0; }';
+ if(is_ff2) {
+ css_string += '' +
+ '.jstree .jstree-wholerow a { display:block; height:18px; margin:0; padding:0; border:0; } ' +
+ '.jstree .jstree-wholerow-real a { border-color:transparent !important; } ';
+ }
+ if(is_ie7 || is_ie6) {
+ css_string += '' +
+ '.jstree .jstree-wholerow, .jstree .jstree-wholerow li, .jstree .jstree-wholerow ul, .jstree .jstree-wholerow a { margin:0; padding:0; line-height:18px; } ' +
+ '.jstree .jstree-wholerow a { display:block; height:18px; line-height:18px; overflow:hidden; } ';
+ }
+ $.vakata.css.add_sheet({ str : css_string, title : "jstree" });
+ });
+})(jQuery);
+//*/
+
+/*
+* jsTree model plugin
+* This plugin gets jstree to use a class model to retrieve data, creating great dynamism
+*/
+(function ($) {
+ var nodeInterface = ["getChildren","getChildrenCount","getAttr","getName","getProps"],
+ validateInterface = function(obj, inter) {
+ var valid = true;
+ obj = obj || {};
+ inter = [].concat(inter);
+ $.each(inter, function (i, v) {
+ if(!$.isFunction(obj[v])) { valid = false; return false; }
+ });
+ return valid;
+ };
+ $.jstree.plugin("model", {
+ __init : function () {
+ if(!this.data.json_data) { throw "jsTree model: jsTree json_data plugin not included."; }
+ this._get_settings().json_data.data = function (n, b) {
+ var obj = (n == -1) ? this._get_settings().model.object : n.data("jstree_model");
+ if(!validateInterface(obj, nodeInterface)) { return b.call(null, false); }
+ if(this._get_settings().model.async) {
+ obj.getChildren($.proxy(function (data) {
+ this.model_done(data, b);
+ }, this));
+ }
+ else {
+ this.model_done(obj.getChildren(), b);
+ }
+ };
+ },
+ defaults : {
+ object : false,
+ id_prefix : false,
+ async : false
+ },
+ _fn : {
+ model_done : function (data, callback) {
+ var ret = [],
+ s = this._get_settings(),
+ _this = this;
+
+ if(!$.isArray(data)) { data = [data]; }
+ $.each(data, function (i, nd) {
+ var r = nd.getProps() || {};
+ r.attr = nd.getAttr() || {};
+ if(nd.getChildrenCount()) { r.state = "closed"; }
+ r.data = nd.getName();
+ if(!$.isArray(r.data)) { r.data = [r.data]; }
+ if(_this.data.types && $.isFunction(nd.getType)) {
+ r.attr[s.types.type_attr] = nd.getType();
+ }
+ if(r.attr.id && s.model.id_prefix) { r.attr.id = s.model.id_prefix + r.attr.id; }
+ if(!r.metadata) { r.metadata = { }; }
+ r.metadata.jstree_model = nd;
+ ret.push(r);
+ });
+ callback.call(null, ret);
+ }
+ }
+ });
+})(jQuery);
+//*/
+
+})();
\ No newline at end of file
--- /dev/null
+/*
+ * jsTree classic theme 1.0
+ * Supported features: dots/no-dots, icons/no-icons, focused, loading
+ * Supported plugins: ui (hovered, clicked), checkbox, contextmenu, search
+ */
+
+.jstree-classic li,
+.jstree-classic ins { background-image:url("d.png"); background-repeat:no-repeat; background-color:transparent; }
+.jstree-classic li { background-position:-90px 0; background-repeat:repeat-y; }
+.jstree-classic li.jstree-last { background:transparent; }
+.jstree-classic .jstree-open > ins { background-position:-72px 0; }
+.jstree-classic .jstree-closed > ins { background-position:-54px 0; }
+.jstree-classic .jstree-leaf > ins { background-position:-36px 0; }
+
+.jstree-classic .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
+.jstree-classic .jstree-clicked { background:navy; border:1px solid navy; padding:0 2px 0 1px; color:white; }
+.jstree-classic a .jstree-icon { background-position:-56px -19px; }
+.jstree-classic .jstree-open > a .jstree-icon { background-position:-56px -36px; }
+.jstree-classic a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
+
+.jstree-classic.jstree-focused { background:white; }
+
+.jstree-classic .jstree-no-dots li,
+.jstree-classic .jstree-no-dots .jstree-leaf > ins { background:transparent; }
+.jstree-classic .jstree-no-dots .jstree-open > ins { background-position:-18px 0; }
+.jstree-classic .jstree-no-dots .jstree-closed > ins { background-position:0 0; }
+
+.jstree-classic .jstree-no-icons a .jstree-icon { display:none; }
+
+.jstree-classic .jstree-search { font-style:italic; }
+
+.jstree-classic .jstree-no-icons .jstree-checkbox { display:inline-block; }
+.jstree-classic .jstree-no-checkboxes .jstree-checkbox { display:none !important; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox { background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox { background-position:-2px -19px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox { background-position:-20px -19px; }
+.jstree-classic .jstree-checked > a > .jstree-checkbox:hover { background-position:-38px -37px; }
+.jstree-classic .jstree-unchecked > a > .jstree-checkbox:hover { background-position:-2px -37px; }
+.jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; }
+
+#vakata-dragged.jstree-classic ins { background:transparent !important; }
+#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; }
+#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; }
+#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; }
+
+.jstree-classic a.jstree-search { color:aqua; }
+.jstree-classic .jstree-locked a { color:silver; cursor:default; }
+
+#vakata-contextmenu.jstree-classic-context,
+#vakata-contextmenu.jstree-classic-context li ul { background:#f0f0f0; border:1px solid #979797; -moz-box-shadow: 1px 1px 2px #999; -webkit-box-shadow: 1px 1px 2px #999; box-shadow: 1px 1px 2px #999; }
+#vakata-contextmenu.jstree-classic-context li { }
+#vakata-contextmenu.jstree-classic-context a { color:black; }
+#vakata-contextmenu.jstree-classic-context a:hover,
+#vakata-contextmenu.jstree-classic-context .vakata-hover > a { padding:0 5px; background:#e8eff7; border:1px solid #aecff7; color:black; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; }
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a,
+#vakata-contextmenu.jstree-classic-context li.jstree-contextmenu-disabled a:hover { color:silver; background:transparent; border:0; padding:1px 4px; }
+#vakata-contextmenu.jstree-classic-context li.vakata-separator { background:white; border-top:1px solid #e0e0e0; margin:0; }
+#vakata-contextmenu.jstree-classic-context li ul { margin-left:-4px; }
+
+/* IE6 BEGIN */
+.jstree-classic li,
+.jstree-classic ins,
+#vakata-dragged.jstree-classic .jstree-invalid,
+#vakata-dragged.jstree-classic .jstree-ok,
+#jstree-marker.jstree-classic { _background-image:url("d.gif"); }
+.jstree-classic .jstree-open ins { _background-position:-72px 0; }
+.jstree-classic .jstree-closed ins { _background-position:-54px 0; }
+.jstree-classic .jstree-leaf ins { _background-position:-36px 0; }
+.jstree-classic .jstree-open a ins.jstree-icon { _background-position:-56px -36px; }
+.jstree-classic .jstree-closed a ins.jstree-icon { _background-position:-56px -19px; }
+.jstree-classic .jstree-leaf a ins.jstree-icon { _background-position:-56px -19px; }
+#vakata-contextmenu.jstree-classic-context ins { _display:none; }
+#vakata-contextmenu.jstree-classic-context li { _zoom:1; }
+.jstree-classic .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
+.jstree-classic .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
+.jstree-classic .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
+/* IE6 END */
\ No newline at end of file
display: none;
background-color:#F3F3F3;
padding-bottom:10px;
+ z-index: 100;
}
display: inline-block;
}
+.authlink {
+ padding-left: 0.25em;
+}
+#hierarchies a {
+ font-weight: normal;
+ text-decoration: underline;
+ color: #069;
+}
+
+#hierarchies a:hover {
+ color: #990033;
+}
+
/* jQuery UI Datepicker */
.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; }
.contents .r {
display: inline;
}
+
+body#opac-main #opacmainuserblockmobile {
+ display: none;
+}
+
+.mobile_only {
+ display : none;
+}
+
+/* different sizes for different tags in opac-tags.tt */
+.tagweight0 {
+ font-size: 12px;
+}
+
+.tagweight1 {
+ font-size: 14px;
+}
+
+.tagweight2 {
+ font-size: 16px;
+}
+
+.tagweight3 {
+ font-size: 18px;
+}
+
+.tagweight4 {
+ font-size: 20px;
+}
+
+.tagweight5 {
+ font-size: 22px;
+}
+
+.tagweight6 {
+ font-size: 24px;
+}
+
+.tagweight7 {
+ font-size: 26px;
+}
+
+.tagweight8 {
+ font-size: 28px;
+}
+
+.tagweight9 {
+ font-size: 30px;
+}
.dialog input.back {
- background : #FFF url(../../famfamfam/silk/arrow_left.png) no-repeat 4px center;
+ background : #FFF url(/opac-tmpl/lib/famfamfam/silk/arrow_left.png) no-repeat 4px center;
padding : .4em .4em .4em 25px;
}
.dialog input.return {
- background : #FFF url(../../famfamfam/silk/book_previous.png) no-repeat 4px center;
+ background : #FFF url(/opac-tmpl/lib/famfamfam/silk/book_previous.png) no-repeat 4px center;
padding : .4em .4em .4em 25px;
}
.dialog input.renew {
- background : #FFF url(../../famfamfam/silk/arrow_refresh.png) no-repeat 4px center;
+ background : #FFF url(/opac-tmpl/lib/famfamfam/silk/arrow_refresh.png) no-repeat 4px center;
padding : .4em .4em .4em 25px;
}
.dialog input.cancel {
- background : #FFF url(../../famfamfam/silk/cancel.png) no-repeat 4px center;
+ background : #FFF url(/opac-tmpl/lib/famfamfam/silk/cancel.png) no-repeat 4px center;
padding : .4em .4em .4em 25px;
}
input.finish {
- background : #dbe7ff url(../../famfamfam/silk/stop.png) no-repeat 4px center;
+ background : #dbe7ff url(/opac-tmpl/lib/famfamfam/silk/stop.png) no-repeat 4px center;
border : 1px outset #666;
padding : .2em .2em .2em 25px;
}
border : 2px inset #336699;
}
#checkouthelp {
- background : #FFF url("../../famfamfam/silk/help.png") no-repeat 4px center;
+ background : #FFF url("/opac-tmpl/lib/famfamfam/silk/help.png") no-repeat 4px center;
padding : 3px 3px 3px 26px;
position : absolute;
top : 0;
div.button a:visited,
div.button a:hover,
div.button a:active {
- background : #FFF url(../../famfamfam/silk/book_previous.png) no-repeat 4px center;
+ background : #FFF url(/opac-tmpl/lib/famfamfam/silk/book_previous.png) no-repeat 4px center;
border : 1px outset #666;
color : #000;
padding : .4em .4em .4em 25px;
div.ft {
clear : both;
-}
\ No newline at end of file
+}
[% CASE 'broader' %](Broader heading)
[% CASE 'narrower' %](Narrower heading)
[% CASE 'parent' %](Immediate parent body)
- [% CASE %]([% type | html %])
+ [% CASE %][% IF type %]([% type | html %])[% END %]
[% END %]</span>[% END %]
[% END %]
[% END %]
<meta name="generator" content="Koha [% Version %]" /> <!-- leave this for stats -->
<link rel="shortcut icon" href="[% IF ( OpacFavicon ) %][% OpacFavicon %][% ELSE %][% themelang %]/includes/favicon.ico[% END %]" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="[% themelang %]/lib/jquery/jquery-ui.css" />
-<link rel="stylesheet" type="text/css" href="[% yuipath %]/reset-fonts-grids.css" />
-<link rel="stylesheet" type="text/css" href="[% yuipath %]/skin.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/reset-fonts-grids.css" />
+<link rel="stylesheet" type="text/css" href="/opac-tmpl/lib/yui/skin.css" />
[% SET opaclayoutstylesheet='opac.css' UNLESS opaclayoutstylesheet %]
[% IF (opaclayoutstylesheet.match('^https?:|^\/')) %]
<link rel="stylesheet" type="text/css" href="[% opaclayoutstylesheet %]" />
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/[% opac_css_override %]" />
[% END %]
<link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" />
+[% IF ( OPACMobileUserCSS ) %]<style type="text/css" media="screen and (max-width:700px)">[% OPACMobileUserCSS %]</style>[% END %]
[% IF ( OPACUserCSS ) %]<style type="text/css">[% OPACUserCSS %]</style>[% END %]
<!-- yui js -->
<script type="text/javascript" src="[% yuipath %]/utilities/utilities.js"></script>
+[% USE KohaAuthorisedValues %]
+
[% IF ( item.datedue ) %]
[% IF ( OPACShowCheckoutName ) %]
Checked out to [% item.cardnumber %] [% item.firstname %] [% item.surname %]
[% ELSIF ( item.wthdrawn ) %]
Item withdrawn
[% ELSIF ( item.itemlost ) %]
- [% IF ( item.lostimageurl ) %]
- <img src="[% item.lostimageurl %]" alt="[% item.lostimagelabel %]" title="[% item.lostimagelabel %]">
+ [% av_lib_include = KohaAuthorisedValues.GetByCode( 'LOST', item.itemlost, 1 ) %]
+ [% IF ( av_lib_include ) %]
+ [% av_lib_include %]
[% ELSE %]
- Item lost
+ [% IF ( item.lostimageurl ) %]
+ <img src="[% item.lostimageurl %]" alt="[% item.lostimagelabel %]" title="[% item.lostimagelabel %]">
+ [% ELSE %]
+ Item lost
+ [% END %]
[% END %]
[% ELSIF ( item.itemnotforloan ) %]
[% IF ( item.notforloanvalue ) %]
[% ELSIF ( item.notforloan_per_itemtype ) %]
Not for loan [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
[% ELSIF ( item.damaged ) %]
- Item damaged
+ [% av_lib_include = KohaAuthorisedValues.GetByCode( 'DAMAGED', item.damaged, 1 ) %]
+ [% IF av_lib_include %]
+ [% av_lib_include %]
+ [% ELSE %]
+ Item damaged
+ [% END %]
[% ELSE %]
Available [% IF ( item.restrictedopac ) %]<span class="restricted">([% item.restrictedopac %])</span>[% END %]
[% END %]
--- /dev/null
+[% BLOCK showhierarchy %]
+ [% FOREACH tree IN trees %]
+ [% PROCESS showtree tree = tree %]
+ [% END %]
+[% END %]
+[% BLOCK showtree %]
+ <ul class="hierarchy">
+ [% FOREACH node IN tree %]
+ <li id="hier[% node.authid %]" class="[% node.class %] authnode">
+ [% IF ( node.current_value ) %]
+ <span class='currentauth'>[% node.value | html %]</span>
+ [% ELSE %]
+ <a href="opac-authoritiesdetail.pl?authid=[% node.authid %]" title="Term">[% node.value | html %]</a>
+ [% END %]
+ [% IF ( node.children && node.children.size > 0 ) %]
+ [% PROCESS showtree tree = node.children %]
+ [% END %]
+ </li>
+ [% END %]
+ </ul>
+[% END %]
+
+[% 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 %]
<div id="search-facets">
<h4>Refine your search</h4>
<ul>
- <li>Availability<ul><li>[% IF ( available ) %]Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %]">Show all items</a>[% ELSE %]Limit to <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %]&limit=available">currently available items.</a>[% END %]</li></ul>
+ <li>Availability<ul><li>[% IF ( available ) %]Showing only <strong>available</strong> items. <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi_not_availablity %][% IF ( sort_by ) %]&sort_by=[% sort_by |html%][% END %]">Show all items</a>[% ELSE %]Limit to <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |html%][% END %]&limit=available">currently available items.</a>[% END %]</li></ul>
[% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search %][% END %])</li>[% END %]
</li>
[% UNLESS ( singleBranchMode ) %]
[% IF ( facets_loo.type_label_Libraries ) %]Libraries[% END %]
[% END %]
+[% IF ( facets_loo.type_label_Location ) %]Locations[% END %]
<ul>
- [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %]&limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
- <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %][% IF ( offset ) %]&offset=[% offset %][% END %]&expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
+ [% FOREACH facet IN facets_loo.facets %]<li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]&limit=[% facet.type_link_value %]:[% facet.facet_link_value %]" title="[% facet.facet_title_value |html %]">[% facet.facet_label_value %]</a> [% IF ( displayFacetCount ) %]([% facet.facet_count %])[% END %]</li>[% END %][% IF ( facets_loo.expandable ) %]
+ <li class="showmore"><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %][% IF ( offset ) %]&offset=[% offset %][% END %]&expand=[% facets_loo.expand %]#[% facets_loo.type_id %]">Show more</a></li>
[% END %]
</ul></li>
[% END %]
[% IF ( PAGE_NUMBERS ) %]<div class="pages">
<!-- Row of numbers corresponding to search result pages -->
- [% IF ( previous_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% previous_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %]"><< Previous</a>[% END %]
- [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<span class="current">[% PAGE_NUMBER.pg %]</span>[% ELSE %] <a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %]">[% PAGE_NUMBER.pg %]</a>[% END %]
+ [% IF ( previous_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% previous_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]"><< Previous</a>[% END %]
+ [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<span class="current">[% PAGE_NUMBER.pg %]</span>[% ELSE %] <a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html%][% END %]">[% PAGE_NUMBER.pg %]</a>[% END %]
[% END %]
- [% IF ( next_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% next_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by %][% END %]">Next >></a>[% END %]
-</div>[% END %]
+ [% IF ( next_page_offset ) %]<a class="nav" href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% next_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">Next >></a>[% END %] </div>[% END %]
showOn: "both",
changeMonth: true,
changeYear: true,
- buttonImage: '/opac-tmpl/prog/famfamfam/silk/calendar.png',
+ buttonImage: '/opac-tmpl/lib/famfamfam/silk/calendar.png',
buttonImageOnly: true,
showButtonPanel: true
});
* http://docs.jquery.com/UI/Menu#theming
*/
.ui-menu {
- list-style:none;
- padding: 2px;
- margin: 0;
- display:block;
- float: left;
+ list-style:none;
+ padding: 2px;
+ margin: 0;
+ display:block;
+ float: left;
}
.ui-menu .ui-menu {
- margin-top: -3px;
+ margin-top: -3px;
}
.ui-menu .ui-menu-item {
- margin:0;
- padding: 0;
- zoom: 1;
- float: left;
- clear: left;
- width: 100%;
+ margin:0;
+ padding: 0;
+ zoom: 1;
+ float: left;
+ clear: left;
+ width: 100%;
}
.ui-menu .ui-menu-item a {
- text-decoration:none;
- display:block;
- padding:.2em .4em;
- line-height:1.5;
- zoom:1;
+ text-decoration:none;
+ display:block;
+ padding:.2em .4em;
+ line-height:1.5;
+ zoom:1;
}
.ui-menu .ui-menu-item a.ui-state-hover,
.ui-menu .ui-menu-item a.ui-state-active {
- font-weight: normal;
- margin: -1px;
+ font-weight: normal;
+ margin: -1px;
}
/*!
* jQuery UI Slider 1.8.23
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(a,b){a.ui=a.ui||{};var c=/left|center|right/,d=/top|center|bottom/,e="center",f={},g=a.fn.position,h=a.fn.offset;a.fn.position=function(b){if(!b||!b.of)return g.apply(this,arguments);b=a.extend({},b);var h=a(b.of),i=h[0],j=(b.collision||"flip").split(" "),k=b.offset?b.offset.split(" "):[0,0],l,m,n;return i.nodeType===9?(l=h.width(),m=h.height(),n={top:0,left:0}):i.setTimeout?(l=h.width(),m=h.height(),n={top:h.scrollTop(),left:h.scrollLeft()}):i.preventDefault?(b.at="left top",l=m=0,n={top:b.of.pageY,left:b.of.pageX}):(l=h.outerWidth(),m=h.outerHeight(),n=h.offset()),a.each(["my","at"],function(){var a=(b[this]||"").split(" ");a.length===1&&(a=c.test(a[0])?a.concat([e]):d.test(a[0])?[e].concat(a):[e,e]),a[0]=c.test(a[0])?a[0]:e,a[1]=d.test(a[1])?a[1]:e,b[this]=a}),j.length===1&&(j[1]=j[0]),k[0]=parseInt(k[0],10)||0,k.length===1&&(k[1]=k[0]),k[1]=parseInt(k[1],10)||0,b.at[0]==="right"?n.left+=l:b.at[0]===e&&(n.left+=l/2),b.at[1]==="bottom"?n.top+=m:b.at[1]===e&&(n.top+=m/2),n.left+=k[0],n.top+=k[1],this.each(function(){var c=a(this),d=c.outerWidth(),g=c.outerHeight(),h=parseInt(a.curCSS(this,"marginLeft",!0))||0,i=parseInt(a.curCSS(this,"marginTop",!0))||0,o=d+h+(parseInt(a.curCSS(this,"marginRight",!0))||0),p=g+i+(parseInt(a.curCSS(this,"marginBottom",!0))||0),q=a.extend({},n),r;b.my[0]==="right"?q.left-=d:b.my[0]===e&&(q.left-=d/2),b.my[1]==="bottom"?q.top-=g:b.my[1]===e&&(q.top-=g/2),f.fractions||(q.left=Math.round(q.left),q.top=Math.round(q.top)),r={left:q.left-h,top:q.top-i},a.each(["left","top"],function(c,e){a.ui.position[j[c]]&&a.ui.position[j[c]][e](q,{targetWidth:l,targetHeight:m,elemWidth:d,elemHeight:g,collisionPosition:r,collisionWidth:o,collisionHeight:p,offset:k,my:b.my,at:b.at})}),a.fn.bgiframe&&c.bgiframe(),c.offset(a.extend(q,{using:b.using}))})},a.ui.position={fit:{left:function(b,c){var d=a(window),e=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft();b.left=e>0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),a.curCSS||(a.curCSS=a.css),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
* https://github.com/jquery/jquery-ui
+* Includes: jquery.ui.sortable.js
+* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
+(function(a,b){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity?this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed:b.pageY-this.overflowOffset.top<c.scrollSensitivity&&(this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity?this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed:b.pageX-this.overflowOffset.left<c.scrollSensitivity&&(this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed)):(b.pageY-a(document).scrollTop()<c.scrollSensitivity?d=a(document).scrollTop(a(document).scrollTop()-c.scrollSpeed):a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity&&(d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed)),b.pageX-a(document).scrollLeft()<c.scrollSensitivity?d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed):a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity&&(d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed))),d!==!1&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(var e=this.items.length-1;e>=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+j<i&&b+k>f&&b+k<g;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>a[this.floating?"width":"height"]?l:f<b+this.helperProportions.width/2&&c-this.helperProportions.width/2<g&&h<d+this.helperProportions.height/2&&e-this.helperProportions.height/2<i},_intersectsWithPointer:function(b){var c=this.options.axis==="x"||a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height),d=this.options.axis==="y"||a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width),e=c&&d,f=this._getDragVerticalDirection(),g=this._getDragHorizontalDirection();return e?this.floating?g&&g=="right"||f=="down"?2:1:f&&(f=="down"?2:1):!1},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height),d=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width),e=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&d||f=="left"&&!d:e&&(e=="down"&&c||e=="up"&&!c)},_getDragVerticalDirection:function(){var a=this.positionAbs.top-this.lastPositionAbs.top;return a!=0&&(a>0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b<this.items.length;b++)for(var c=0;c<a.length;c++)a[c]==this.items[b].item[0]&&this.items.splice(b,1)},_refreshItems:function(b){this.items=[],this.containers=[this];var c=this.items,d=this,e=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,this.element),this]],f=this._connectWith();if(f&&this.ready)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i<m;i++){var n=a(l[i]);n.data(this.widgetName+"-item",k),c.push({item:n,instance:k,width:0,height:0,left:0,top:0})}}},refreshPositions:function(b){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)<f&&(f=Math.abs(j-h),g=this.items[i],this.direction=j-h>0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.left<this.containment[0]&&(f=this.containment[0]+this.offset.click.left),b.pageY-this.offset.click.top<this.containment[1]&&(g=this.containment[1]+this.offset.click.top),b.pageX-this.offset.click.left>this.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.top<this.containment[1]||h-this.offset.click.top>this.containment[3]?h-this.offset.click.top<this.containment[1]?h+c.grid[1]:h-c.grid[1]:h:h;var i=this.originalPageX+Math.round((f-this.originalPageX)/c.grid[0])*c.grid[0];f=this.containment?i-this.offset.click.left<this.containment[0]||i-this.offset.click.left>this.containment[2]?i-this.offset.click.left<this.containment[0]?i+c.grid[0]:i-c.grid[0]:i:i}}return{top:g-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():e?0:d.scrollTop()),left:f-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():e?0:d.scrollLeft())}},_rearrange:function(a,b,c,d){c?c[0].appendChild(this.placeholder[0]):b.item[0].parentNode.insertBefore(this.placeholder[0],this.direction=="down"?b.item[0]:b.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var e=this,f=this.counter;window.setTimeout(function(){f==e.counter&&e.refreshPositions(!d)},0)},_clear:function(b,c){this.reverting=!1;var d=[],e=this;!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(a){this._trigger("receive",a,this._uiHash(this.fromOutside))}),(this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c&&d.push(function(a){this._trigger("update",a,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(a){this._trigger("remove",a,this._uiHash())});for(var f=this.containers.length-1;f>=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!1}c||this._trigger("beforeStop",b,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!=this.currentItem[0]&&this.helper.remove(),this.helper=null;if(!c){for(var f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}}),a.extend(a.ui.sortable,{version:"1.8.23"})})(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
+* https://github.com/jquery/jquery-ui
* Includes: jquery.ui.autocomplete.js
* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
(function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("<ul></ul>").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length<this.options.minLength)return this.close(b);clearTimeout(this.closing);if(this._trigger("search",b)===!1)return;return this._search(a)},_search:function(a){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.source({term:a},this._response())},_response:function(){var a=this,b=++c;return function(d){b===c&&a.__response(d),a.pending--,a.pending||a.element.removeClass("ui-autocomplete-loading")}},__response:function(a){!this.options.disabled&&a&&a.length?(a=this._normalize(a),this._suggest(a),this._trigger("open")):this.close()},close:function(a){clearTimeout(this.closing),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.deactivate(),this._trigger("close",a))},_change:function(a){this.previous!==this.element.val()&&this._trigger("change",a,{item:this.selectedItem})},_normalize:function(b){return b.length&&b[0].label&&b[0].value?b:a.map(b,function(b){return typeof b=="string"?{label:b,value:b}:a.extend({label:b.label||b.value,value:b.value||b.label},b)})},_suggest:function(b){var c=this.menu.element.empty().zIndex(this.element.zIndex()+1);this._renderMenu(c,b),this.menu.deactivate(),this.menu.refresh(),c.show(),this._resizeMenu(),c.position(a.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(new a.Event("mouseover"))},_resizeMenu:function(){var a=this.menu.element;a.outerWidth(Math.max(a.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(b,c){var d=this;a.each(c,function(a,c){d._renderItem(b,c)})},_renderItem:function(b,c){return a("<li></li>").data("item.autocomplete",c).append(a("<a></a>").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})})(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[a.fn.prop?"prop":"attr"]("scrollHeight")},select:function(a){this._trigger("selected",a,{item:this.active})}})}(jQuery);;/*! jQuery UI - v1.8.23 - 2012-08-15
<select name="idx">
<option value="kw">Keyword</option>
<option value="su,wrdl">Subject</option>
-[% IF ( search_boxes_loo.expanded_options ) %]
+[% IF ( expanded_options ) %]
<option value="su,phr"> Subject phrase</option>
+ <option value="su-br"> Subject and broader terms</option>
+ <option value="su-na"> Subject and narrower terms</option>
+ <option value="su-rl"> Subject and related terms</option>
[% END %]
<option value="ti">Title</option>
[% IF ( expanded_options ) %]
<!-- AVAILABILITY LIMITS -->
[% UNLESS ( singleBranchMode ) %]
<div id="location" class="container"><fieldset><legend>Location and availability: </legend>
-
+
+ <label for="branchloop">Library:</label>
<select name="limit" id="branchloop">
<option value="">All libraries</option>
[% FOREACH BranchesLoo IN BranchesLoop %]
</div>
<div class="yui-u">
<!-- RANK LIMITS -->
- <div id="sortby" class="container"><fieldset><legend>Sort by: </legend>
- <select id="sort_by" name="sort_by">
+ <div id="sortby" class="container"><fieldset><legend>Sorting: </legend>
+ <label for="sort_by">Sort by:</label> <select id="sort_by" name="sort_by">
[% INCLUDE 'resort_form.inc' %]
</select></fieldset></div>
<!-- RANK LIMITS -->
+[% PROCESS 'opac-authorities.inc' %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Entry
[% INCLUDE 'doc-head-close.inc' %]
-[% IF ( displayhierarchy ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css">
-<script language="JavaScript" type="text/javascript">
-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";
- }
- }
-}
+<script language="javascript" type="text/javascript" src="/opac-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
+<script language="javascript" type="text/javascript">
+//<![CDATA[
+$(document).ready(function() {
+ [% IF ( displayhierarchy ) %]
+ var current_nodes = [];
+ $('.currentauth').each(function() {
+ current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
+ });
+ $('#hierarchies').jstree({
+ "plugins": [ "themes", "html_data"],
+ "themes": { "theme": "classic",
+ "icons": false },
+ "core": { "initially_open": current_nodes }
+ });
+ [% END %]
+});
+//]]>
</script>
-[% END %]
</head>
<body id="opac-authoritiesdetail">
<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">
-[% 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 id="hierarchies">
+[% PROCESS showhierarchy trees = loophierarchies %]
</div>
[% END %]
+
<h1>Entry [% authtypetext %]</h1>
<p>Used in <a href="opac-search.pl?type=opac&q=[% authid %]&idx=an,phr">[% count %] records</a></p>
[% FOREACH Tag0X IN Tab0XX %]
-[% 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 %]
+[% PROCESS 'opac-authorities.inc' %]
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Entry
[% INCLUDE 'doc-head-close.inc' %]
[% IF ( displayhierarchy ) %]
-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/hierarchy.css">
+<script language="javascript" type="text/javascript" src="/opac-tmpl/lib/jquery/plugins/jquery.jstree.js"></script>
[% END %]
-<script language="JavaScript" type="text/javascript">
+<script language="javascript" type="text/javascript">
+//<![CDATA[
$(document).ready(function() {
$('#authdescriptions').tabs();
+ [% IF ( displayhierarchy ) %]
+ var current_nodes = [];
+ $('.currentauth').each(function() {
+ current_nodes.push('#' + $(this).parent().parents('li:first').attr('id'));
+ });
+ $('#hierarchies').jstree({
+ "plugins": [ "themes", "html_data"],
+ "themes": { "theme": "classic",
+ "icons": false },
+ "core": { "initially_open": current_nodes }
+ });
+ [% END %]
});
-
-[% 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="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 id="hierarchies">
+[% PROCESS showhierarchy trees = loophierarchies %]
</div>
[% END %]
+
<h1>[% summary.mainentry %][% IF authtypetext %]([% authtypetext %])[% END %]</h1>
<div class="usedin">Used in <a href="opac-search.pl?type=opac&q=[% authid %]&idx=an,phr">[% count %] records</a></div>
<div class="authstanza">
@import url([% themelang %]/css/print.css);
</style>
[% ELSE %][% INCLUDE 'doc-head-close.inc' %]
- <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
- <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
- <script type="text/javascript">
- //<![CDATA[
+ <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
+ <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+ <script type="text/javascript">
+ //<![CDATA[
var MSG_NO_RECORD_SELECTED = _("Please select one or more items");
+
+$.tablesorter.addParser({
+ // set a unique id
+ id: 'links',
+ is: function(s)
+ {
+ // return false so this parser is not auto detected
+ return false;
+ },
+ format: function(s)
+ {
+ // format your data for normalization
+ return s.replace(new RegExp(/<.*?>/),"");
+ },
+ // set type, either numeric or text
+ type: 'text'
+});
+
$(document).ready(function()
{
$("#itemst").tablesorter({
- headers: { 0: { sorter: false },4:{sorter:false}}
+ headers: { 0: { sorter: false }, 1: {sorter: 'links'}, 4:{sorter:false}}
});
$(".cb").click(function(){
enableCheckboxActions();
return false;
}
[% END %][% END %][% END %]
- $(document).ready(function(){
- $("#CheckAll").click(function(){
- var checked = [];
- $(".checkboxed").checkCheckboxes("*", true).each(
- function() {
- selRecord(this.value,true);
- }
- );
- enableCheckboxActions();
- return false;
- });
- $("#CheckNone").click(function(){
- var checked = [];
- $(".checkboxed").unCheckCheckboxes("*",true).each(
- function() {
- selRecord(this.value,false);
- }
- );
+ $(document).ready(function(){
+ $("#CheckAll").click(function(){
+ var checked = [];
+ $(".checkboxed").checkCheckboxes("*", true).each(
+ function() {
+ selRecord(this.value,true);
+ }
+ );
+ enableCheckboxActions();
+ return false;
+ });
+ $("#CheckNone").click(function(){
+ var checked = [];
+ $(".checkboxed").unCheckCheckboxes("*",true).each(
+ function() {
+ selRecord(this.value,false);
+ }
+ );
enableCheckboxActions();
- return false;
- });
+ return false;
+ });
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]
$("#tagsel_button").click(function(){
return false;
});
[% END %][% END %][% END %]
- });
+ });
[% IF ( opacuserlogin ) %][% IF ( RequestOnOpac ) %]
function holdSel() {
var items = document.getElementById('records').value;
$("#selections-toolbar .links a").addClass("disabled");
}
}
- //]]>
- </script>
- [% END %]
+ //]]>
+ </script>
+ [% END %]
</head>
<body id="basket">
<div id="toolbar">
<ul>
<li>[% IF ( verbose ) %]<a href="opac-basket.pl" class="brief" onclick="showLess(); return false;">Brief display</a>[% ELSE %]<a href="opac-basket.pl" class="detail" onclick="showMore(); return false;">More details</a>[% END %]</li>
- [% IF ( opacuserlogin ) %]<li><a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a></li>[% END %]
- <li><a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a></li>
- <li><a class="print" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a></li>
+ [% IF ( opacuserlogin ) %]<li><a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a></li>[% END %]
+ <li><a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a></li>
+ <li><a class="print" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a></li>
<li><a class="empty" href="opac-basket.pl" onclick="delBasket(); return false;">Empty and close</a></li>
<li><a class="hide close" href="opac-basket.pl">Hide window</a></li>
</ul>
[% END %]
[% IF ( verbose ) %]
- [% UNLESS ( print_basket ) %]<div id="selections-toolbar"><a id="CheckAll" href="#">Select all</a> <a id="CheckNone" href="#">Clear all</a> <span class="sep">|</span> <span class="links"><span id="selections">Select titles to: </span>
+ [% UNLESS ( print_basket ) %]<div id="selections-toolbar"><a id="CheckAll" href="#">Select all</a> <a id="CheckNone" href="#">Clear all</a> <span class="sep">|</span> <span class="links"><span id="selections">Select titles to: </span>
<span id="tag_hides">
<a href="#" class="deleteshelf disabled" onclick="delSelRecords(); return false;">Remove</a>
[% IF ( opacuserlogin ) %]
[% IF ( BIBLIO_RESULT.author ) %] [% BIBLIO_RESULT.author |html %][% END %]
[% END %]
</h3>
- <!-- COinS / Openurl -->
+ <!-- COinS / Openurl -->
<span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.au=[% BIBLIO_RESULT.author %]&rft.btitle=[% BIBLIO_RESULT.title |url %]&rft.date=[% BIBLIO_RESULT.publicationyear %]&rft.tpages=[% BIBLIO_RESULT.size %]&rft.isbn=[% BIBLIO_RESULT.isbn |url %]&rft.aucorp=&rft.place=[% BIBLIO_RESULT.place %]&rft.pub=[% BIBLIO_RESULT.publisher |url %]&rft.edition=[% BIBLIO_RESULT.edition %]&rft.series=[% BIBLIO_RESULT.series %]&rft.genre="></span>
<table>
[% IF ( BIBLIO_RESULT.isbn ) %]
</p>
[% END %]
[% END %]
- </td>
+ </td>
</tr>
[% END %]
<tr>
<th scope="row">URL(s)</th>
<td>
- [% FOREACH MARCurl IN BIBLIO_RESULT.MARCurlS %]
- <p>[% IF ( MARCurl.part ) %][% MARCurl.part %]
- <br />[% END %]
+ [% FOREACH MARCurl IN BIBLIO_RESULT.MARCurlS %]
+ <p>
+ [% IF ( MARCurl.part ) %][% MARCurl.part %]
+ <br />
+ [% END %]
- [% MARCurl.MARCurl %]
- [% IF ( MARCurl.notes ) %][% FOREACH note IN MARCurl.notes %][% note.note %]<br />[% END %][% END %]
- [% END %]</p></td>
+ [% MARCurl.MARCurl %]
+ [% IF ( MARCurl.notes ) %][% FOREACH note IN MARCurl.notes %][% note.note %]<br />[% END %][% END %]
+ [% END %]
+ </p>
+ </td>
</tr>[% END %]
<tr>
<th scope="row">Location(s) (Status)</th>
<td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
<li>
- <strong>[% ITEM_RESULT.homebranch %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
+ <strong>[% ITEM_RESULT.branchname %]</strong>[% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
[% IF ( ITEM_RESULT.itemcallnumber ) %]
([% ITEM_RESULT.itemcallnumber %])
[% END %]
</div>
[% END %]
<table id="itemst">
- <thead><tr>
- [% UNLESS ( print_basket ) %]<th> </th>[% END %]
- <th>Title</th>
- <th>Author</th>
- <th>Year</th>
- <th>Location (Status)</th>
- </tr></thead>
+ <thead>
+ <tr>
+ [% UNLESS ( print_basket ) %]<th> </th>[% END %]
+ <th>Title</th>
+ <th>Author</th>
+ <th>Year</th>
+ <th>Location (Status)</th>
+ </tr>
+ </thead>
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
[% IF ( BIBLIO_RESULT.even ) %]
</td> [% END %]
<td>
- <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">
- [% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]
- </a>
+ <a href="#" onclick="openBiblio('[% BIBLIO_RESULT.dest %]',[% BIBLIO_RESULT.biblionumber %])">[% BIBLIO_RESULT.title |html %][% IF ( BIBLIO_RESULT.subtitle ) %] [% FOREACH subtitl IN BIBLIO_RESULT.subtitle %][% subtitl.subfield |html %][% END %][% END %]</a>
<!-- COinS / Openurl -->
- <span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.au=[% BIBLIO_RESULT.author %]&rft.btitle=[% BIBLIO_RESULT.title |url %]&rft.date=[% BIBLIO_RESULT.publicationyear %]&rft.tpages=[% BIBLIO_RESULT.size %]&rft.isbn=[% BIBLIO_RESULT.isbn |url %]&rft.aucorp=&rft.place=[% BIBLIO_RESULT.place %]&rft.pub=[% BIBLIO_RESULT.publisher |url %]&rft.edition=[% BIBLIO_RESULT.edition %]&rft.series=[% BIBLIO_RESULT.series %]&rft.genre="></span>
- [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<div id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>[% END %][% END %][% END %]
- </td>
- <td>[% BIBLIO_RESULT.author %]</td>
- <td>
- [% IF ( BIBLIO_RESULT.publicationyear ) %]
- [% BIBLIO_RESULT.publicationyear %]
+ <span class="Z3988" title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.au=[% BIBLIO_RESULT.author %]&rft.btitle=[% BIBLIO_RESULT.title |url %]&rft.date=[% BIBLIO_RESULT.publicationyear %]&rft.tpages=[% BIBLIO_RESULT.size %]&rft.isbn=[% BIBLIO_RESULT.isbn |url %]&rft.aucorp=&rft.place=[% BIBLIO_RESULT.place %]&rft.pub=[% BIBLIO_RESULT.publisher |url %]&rft.edition=[% BIBLIO_RESULT.edition %]&rft.series=[% BIBLIO_RESULT.series %]&rft.genre="></span>
+ [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<div id="newtag[% BIBLIO_RESULT.biblionumber %]_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>[% END %][% END %][% END %]
+ </td>
+ <td>[% BIBLIO_RESULT.author %]</td>
+ <td>
+ [% IF ( BIBLIO_RESULT.publicationyear ) %]
+ [% BIBLIO_RESULT.publicationyear %]
[% ELSE %]
- [% BIBLIO_RESULT.copyrightdate %]
+ [% BIBLIO_RESULT.copyrightdate %]
[% END %]
- </td>
- <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
- <li>
- [% ITEM_RESULT.homebranch %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
- [% IF ( ITEM_RESULT.itemcallnumber ) %]
- ([% ITEM_RESULT.itemcallnumber %])
- [% END %]
- ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
- </li>
- [% END %]</ul>[% ELSE %]This record has no items.[% END %]</td>
- </tr>
+ </td>
+ <td>[% IF ( BIBLIO_RESULT.ITEM_RESULTS ) %]<ul>[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]
+ <li>
+ [% ITEM_RESULT.branchname %][% IF ( ITEM_RESULT.location_opac ) %], [% ITEM_RESULT.location_opac %][% END %]
+ [% IF ( ITEM_RESULT.itemcallnumber ) %]
+ ([% ITEM_RESULT.itemcallnumber %])
+ [% END %]
+ ([% INCLUDE 'item-status.inc' item = ITEM_RESULT %])
+ </li>
+ [% END %]</ul>[% ELSE %]This record has no items.[% END %]
+ </td>
+ </tr>
[% END %]
</table></form>
[% END %]
</span>
[% IF ( MARCAUTHORS ) %]
- <span class="results_summary"><span class="label">Authors:</span>
- [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
- [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %][% MARCAUTHOR_SUBFIELDS_LOO.separator %]<a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a>[% END %]
- [% UNLESS ( loop.last ) %]|
-[% END %]
- [% END %]
+ <span class="results_summary"><span class="label">Additional authors:</span>
+ [% FOREACH MARCAUTHOR IN MARCAUTHORS %]
+ [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
+ [% MARCAUTHOR_SUBFIELDS_LOO.separator %]
+ <a title="‡[% MARCAUTHOR_SUBFIELDS_LOO.code %] [% MARCAUTHOR_SUBFIELDS_LOO.value %]"
+ href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCAUTHOR_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCAUTHOR_SUBFIELDS_LOO.value %]</a>
+ [% END %]
+ [% IF (MARCAUTHOR.authoritylink) %]
+ <a class='authlink' href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCAUTHOR.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"></a>
+ [% END %]
+ [% UNLESS ( loop.last ) %]|[% END %]
+ [% END %]
</span>
[% END %]
[% END %]
[% IF ( MARCSUBJCTS ) %]
- <span class="results_summary"><span class="label">Subject(s):</span>
- [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
- [% FOREACH MARCSUBJECT_SUBFIELDS_LOO IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
- [% MARCSUBJECT_SUBFIELDS_LOO.separator %]<a title="$[% MARCSUBJECT_SUBFIELDS_LOO.code %] [% MARCSUBJECT_SUBFIELDS_LOO.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN MARCSUBJECT_SUBFIELDS_LOO.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]">[% MARCSUBJECT_SUBFIELDS_LOO.value %]</a>[% END %]
- [% IF ( loop.last ) %][% ELSE %]|[% END %]
- [% END %]</span>
+ <span class="results_summary">
+ <span class="label">Subject(s):</span>
+ [% FOREACH MARCSUBJCT IN MARCSUBJCTS %]
+ [% subjectsloop = loop %]
+ [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %]
+ [% SUBFIELD.separator %]
+ <a title="$[% SUBFIELD.code %] [% SUBFIELD.value %]" href="/cgi-bin/koha/opac-search.pl?q=[% FOREACH link_loo IN SUBFIELD.link_loop %][% link_loo.operator |url %][% link_loo.limit |url %]:[% link_loo.link |url %][% END %]" onclick="showSubjects(this, [% subjectsloop.count %], [% loop.count %]); return false;">[% SUBFIELD.value %]</a>
+ [% END %]
+ [% IF (MARCSUBJCT.authoritylink) %]
+ <a class="authlink" href="/cgi-bin/koha/opac-authoritiesdetail.pl?authid=[% MARCSUBJCT.authoritylink %]"><img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png" /></a>
+ [% END %]
+ [% UNLESS ( loop.last ) %] | [% END %]
+ [% END %]
+ </span>
[% ELSE %]
[% IF ( subjects ) %]<span class="results_summary"><span class="label">Subject(s):</span> [% FOREACH subject IN subjects %]<a href="/cgi-bin/koha/opac-search.pl?q=su:[% subject.subject |url %]">[% subject.subject %]</a> | [% END %]</span>[% END %]
[% END %]
<table id="serialcollectiont">
<thead>
<tr>
- <th id="serial_library">Library</th>
- <th id="seral_collection">Serial collection</th>
+ <th id="serial_library">Library</th>
+ <th id="serial_collection">Serial collection</th>
+ <th id="serial_itemcallnumber">Item callnumber</th>
</tr>
</thead>
<tbody>
<tr>
<td>[% serialcollection.branch %]</td>
<td>[% serialcollection.text %]</td>
+ <td>[% serialcollection.itemcallnumber %]</td>
</tr>
[% END %]
</tbody>
[% END %]
</tr></thead>
<tbody>[% FOREACH ITEM_RESULT IN ITEM_RESULTS %]
- <tr>[% IF ( item_level_itypes ) %]<td>[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
- <td>
+ <tr>[% IF ( item_level_itypes ) %]<td class="itype">[% UNLESS ( noItemTypeImages ) %][% IF ( ITEM_RESULT.imageurl ) %]<img src="[% ITEM_RESULT.imageurl %]" title="[% ITEM_RESULT.description %]" alt="[% ITEM_RESULT.description %]" />[% END %][% END %] [% ITEM_RESULT.description %]</td>[% END %]
+ <td class="location">
[% UNLESS ( singleBranchMode ) %]
<span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
[% IF ( ITEM_RESULT.branchurl ) %]
[% END %]
<span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
</td>
- [% IF ( itemdata_ccode ) %]<td>[% ITEM_RESULT.ccode %]</td>[% END %]
- <td>[% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#shelfbrowser">Browse shelf</a>)[% END %][% END %]</td>
- [% IF ( itemdata_enumchron ) %]<td>[% ITEM_RESULT.enumchron %]</td>[% END %]
- [% IF ( itemdata_uri ) %]<td><a href="[% ITEM_RESULT.uri %]">[% ITEM_RESULT.uri %]</a></td>[% END %]
- [% IF ( itemdata_copynumber ) %]<td>[% ITEM_RESULT.copynumber %]</td>[% END %]
- <td>[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
- [% IF ( itemdata_itemnotes ) %]<td>[% ITEM_RESULT.itemnotes %]</td>[% END %]
- <td>[% ITEM_RESULT.datedue | $KohaDates %]</td>
- [% IF ( OPACShowBarcode ) %]<td>[% ITEM_RESULT.barcode %]</td>[% END %]
+ [% IF ( itemdata_ccode ) %]<td class="collection">[% ITEM_RESULT.ccode %]</td>[% END %]
+ <td class="call_no">[% IF ( ITEM_RESULT.itemcallnumber ) %] [% ITEM_RESULT.itemcallnumber %][% IF ( OPACShelfBrowser ) %] (<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ITEM_RESULT.biblionumber %]&shelfbrowse_itemnumber=[% ITEM_RESULT.itemnumber %]#shelfbrowser">Browse shelf</a>)[% END %][% END %]</td>
+ [% IF ( itemdata_enumchron ) %]<td class="vol_info">[% ITEM_RESULT.enumchron %]</td>[% END %]
+ [% IF ( itemdata_uri ) %]<td class="url"><a href="[% ITEM_RESULT.uri %]">[% ITEM_RESULT.uri %]</a></td>[% END %]
+ [% IF ( itemdata_copynumber ) %]<td class="copynumber">[% ITEM_RESULT.copynumber %]</td>[% END %]
+ <td class="status">[% INCLUDE 'item-status.inc' item = ITEM_RESULT %]</td>
+ [% IF ( itemdata_itemnotes ) %]<td class="notes">[% ITEM_RESULT.itemnotes %]</td>[% END %]
+ <td class="date_due">[% ITEM_RESULT.datedue | $KohaDates %]</td>
+ [% IF ( OPACShowBarcode ) %]<td class="barcode">[% ITEM_RESULT.barcode %]</td>[% END %]
[% IF holds_count.defined || show_priority %]
- <td>
+ <td class="holds_count">
[% IF holds_count.defined %] [% ITEM_RESULT.holds_count %] [% END %]
[% IF ITEM_RESULT.priority %]
[% IF holds_count.defined %]
[% END %]
[% IF ( OpacMainUserBlock ) %]<div id="opacmainuserblock" class="container">[% OpacMainUserBlock %]</div>[% END %]
+ [% IF ( OpacMainUserBlockMobile ) %]<div id="opacmainuserblockmobile" class="container">[% OpacMainUserBlockMobile %]</div>[% END %]
</div>
<channel>
<title><![CDATA[[% LibraryName |html %] Search [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %]]]></title>
<link>[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&format=rss2</link>
- <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&sort_by=[% sort_by |html %]&format=rss2"/>
+ <atom:link rel="self" type="application/rss+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&sort_by=[% sort_by |html %]&format=rss2"/>
<description><![CDATA[ Search results [% IF ( query_desc ) %]for '[% query_desc |html %]'[% END %][% IF ( limit_desc ) %] with limit(s): '[% limit_desc |html %]'[% END %] at [% LibraryName |html %]]]></description>
<opensearch:totalResults>[% total %]</opensearch:totalResults>
<opensearch:startIndex>[% offset %]</opensearch:startIndex>
<opensearch:itemsPerPage>20</opensearch:itemsPerPage>
[% END %]
[% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
- <atom:link rel="search" type="application/opensearchdescription+xml" href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi |html %][% SEARCH_RESULT.limit_cgi |html %]&sort_by=[% SEARCH_RESULT.sort_by |html %]&format=opensearchdescription"/>
+ <atom:link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% SEARCH_RESULT.query_cgi |html %][% SEARCH_RESULT.limit_cgi |html %]&sort_by=[% SEARCH_RESULT.sort_by |html %]&format=opensearchdescription"/>
<opensearch:Query role="request" searchTerms="[% SEARCH_RESULT.query_desc |url %][% SEARCH_RESULT.limit_desc |url %]" startPage="[% SEARCH_RESULT.page %]" />
<item>
<title>[% SEARCH_RESULT.title |html %] [% FOREACH subtitl IN SEARCH_RESULT.subtitle %], [% subtitl.subfield |html %][% END %]</title>
[% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size |html %]. [% END %]
[% IF ( SEARCH_RESULT.isbn ) %] [% SEARCH_RESULT.isbn |html %][% END %] </p><p>
[% IF ( RequestOnOpac ) %]
-<a href="[% SEARCH_RESULT.OPACBaseurl %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold on <i>[% SEARCH_RESULT.title %]</i></a></p>
+<a href="[% OPACBaseURL %]/cgi-bin/koha/opac-reserve.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">Place Hold on <i>[% SEARCH_RESULT.title %]</i></a></p>
[% END %]
]]></description>
<guid>[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]</guid>
<opensearch:itemsPerPage>20</opensearch:itemsPerPage>
[% END %]
<opensearch:Query role="request" searchTerms="[% query_desc |html %] [% limit_desc |html %]" startPage="[% page |html %]" />
- <link rel="alternate" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=[% page %]&format=atom" type="application/atom+xml"/>
+ <link rel="alternate" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=[% page %]&format=atom" type="application/atom+xml"/>
<link rel="self" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]&format=atom" type="application/atom+xml"/>
<link rel="first" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=1&format=atom" type="application/atom+xml"/>
<link rel="previous" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=2&format=atom" type="application/atom+xml"/>
<link rel="next" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=4&format=atom" type="application/atom+xml"/>
- <link rel="last" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=42299&format=atom" type="application/atom+xml"/>
+ <link rel="last" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi %][% limit_cgi %]pw=42299&format=atom" type="application/atom+xml"/>
<link rel="search" type="application/opensearchdescription+xml" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?format=opensearchdescription"/>
[% FOREACH SEARCH_RESULT IN SEARCH_RESULTS %]
<!--CONTENT-->
<h3><a href="/cgi-bin/koha/opac-user.pl">[% firstname %] [% surname %]'s account</a> ⇢ Checkout history</h3>
-[% UNLESS ( count ) %]
+[% IF READING_RECORD.size() == 0 %]
You have never borrowed anything from this library.
[% ELSE %]
<div id="opac-user-readingrec" class="statictabs">
[% END %]
</tr>
-[% FOREACH READING_RECOR IN READING_RECORD %]
+[% FOREACH issue IN READING_RECORD %]
-[% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
+[% IF loop.even %]<tr class="highlight">[% ELSE %]<tr>[% END %]
<td>
-[% 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 OPACAmazonCoverImages %]
+ [% IF issue.normalized_isbn %]
+ <a href="http://www.amazon.com/gp/reader/[% issue.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="http://images.amazon.com/images/P/[% issue.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 %]
+[% IF GoogleJackets %]
+ [% IF issue.normalized_isbn %]
+ <div style="block" title="[% issue.biblionumber |url %]" class="[% issue.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
+ [% ELSE %]
+ <span class="no-image">No cover image available</span>
+ [% END %]
+[% END %]
- [% IF ( BakerTaylorEnabled ) %][% IF ( READING_RECOR.normalized_isbn ) %]<a href="https://[% BakerTaylorBookstoreURL |html %][% READING_RECOR.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% READING_RECOR.normalized_isbn %]" /></a>[% ELSE %]<span class="no-image">No cover image available</span>[% END %][% END %]
+[% IF BakerTaylorEnabled %]
+ [% IF issue.normalized_isbn %]
+ <a href="https://[% BakerTaylorBookstoreURL |html %][% issue.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% issue.normalized_isbn %]" /></a>
+ [% 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=[% READING_RECOR.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% READING_RECOR.normalized_upc %]&oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" />
- [% ELSE %]
- <img src="http://www.syndetics.com/index.aspx?isbn=[% READING_RECOR.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% READING_RECOR.normalized_upc %]&oclc=[% READING_RECOR.normalized_oclc %]" alt="" class="thumbnail" />[% END %][% END %][% END %]
+[% IF SyndeticsEnabled %]
+ [% IF SyndeticsCoverImages %]
+ [% IF using_https %]
+<img src="https://secure.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% issue.normalized_upc %]&oclc=[% issue.normalized_oclc %]" alt="" class="thumbnail" />
+ [% ELSE %]
+<img src="http://www.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% issue.normalized_upc %]&oclc=[% issue.normalized_oclc %]" alt="" class="thumbnail" />
+ [% END %]
+ [% END %]
+[% END %]
</td>
-<td>[% IF ( READING_RECOR.BiblioDefaultViewmarc ) %]<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% ELSE %]
-[% IF ( READING_RECOR.BiblioDefaultViewisbd ) %]<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% ELSE %]
-<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% READING_RECOR.biblionumber |url %]">[% READING_RECOR.title |html %] [% IF ( READING_RECOR.subtitle ) %][% FOREACH subtitl IN READING_RECOR.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% END %][% END %]
+<td>
+[% IF issue.BiblioDefaultViewmarc %]
+ <a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
+[% ELSIF issue.BiblioDefaultViewisbd %]
+ <a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
+[% ELSE %]
+ <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
+[% END %]
<span class="item-details">
- [% READING_RECOR.author %]
+ [% issue.author %]
</span></td>
-<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>
+<td>
+[% UNLESS ( noItemTypeImages ) %][% IF ( issue.imageurl ) %]<img src="[% issue.imageurl %]" alt="" />[% END %][% END %] [% issue.description %]</td>
+<td>[% issue.itemcallnumber %]</td>
+<td>
+[% IF issue.returndate %]
+ [% issue.returndate | $KohaDates %]
+[% ELSE %]
+ <em>(Checked out)</em>
+[% END %]
+</td>
+[% IF OPACMySummaryHTML %]
+ <td>[% issue.MySummaryHTML %]</td>
[% END %]
</tr>
[% FOREACH bibitemloo IN bibitemloop %]
<tr>
[% IF ( bibitemloo.holdable ) %]
- <td>
+ <td class="hold">
<input class="reserve_mode" name="reserve_mode" type="hidden" value="single"/>
<input class="single_bib" name="single_bib" type="hidden" value="[% bibitemloo.biblionumber %]"/>
<span class="confirmjs_hold" title="[% bibitemloo.biblionumber %]"></span>
</span>
</td>
[% ELSE %]
- [% UNLESS ( none_available ) %]<td> </td>[% END %]
+ [% UNLESS ( none_available ) %]<td class="hold"> </td>[% END %]
[% END %]
- [% IF ( bibitemloo.holdable ) %]<td>[% ELSE %]<td colspan="5">[% END %]
+ [% IF ( bibitemloo.holdable ) %]<td class="title">[% ELSE %]<td class="title" colspan="5">[% END %]
<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">[% bibitemloo.title |html %][% IF ( bibitemloo.subtitle ) %] [% FOREACH subtitl IN bibitemloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
[% IF ( bibitemloo.author ) %], by [% bibitemloo.author %][% END %]
[% IF ( bibitemloo.holdable ) %]
<!-- HOLDABLE -->
[% UNLESS ( item_level_itypes ) %]
- <td>
+ <td class="itype">
[% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %]
[% bibitemloo.description %]
</td>
[% END %]
[% IF showholds || showpriority %]
- <td>
+ <td class="priority">
[% IF showpriority %] [% bibitemloo.rank %] [% END %]
[% IF showholds && showpriority %] out of [% END %]
[% IF showholds %] [% bibitemloo.reservecount %] [% END %]
</td>
[% END %]
[% IF ( reserve_in_future ) %]
- <td>
+ <td class="reserve_date">
<input name="reserve_date_[% bibitemloo.biblionumber %]" id="from" size="10" class="datepickerfrom"/>
<script language="JavaScript" type="text/javascript">
//<![CDATA[
</td>[% END %]
[% END %]
- [% IF ( bibitemloo.holdable ) %]<td>
+ [% IF ( bibitemloo.holdable ) %]<td class="expiration_date">
<input name="expiration_date_[% bibitemloo.biblionumber %]" id="to" size="10" readonly="readonly" class="datepickerto" />
<p style="margin:.3em 2em;">
<a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear date</a></p>
[% UNLESS ( singleBranchMode ) %]
[% IF ( bibitemloo.holdable ) %]
[% IF ( choose_branch ) %]
- <td>
+ <td class="branch">
[% UNLESS ( bibitemloo.holdable ) %]
<select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
[% FOREACH branchChoicesLoo IN bibitemloo.branchChoicesLoop %]
[% FOREACH itemLoo IN bibitemloo.itemLoop %]
<tr class="[% itemLoo.backgroundcolor %]">
- <td>
+ <td class="copy">
[% IF ( itemLoo.available ) %]
<input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber %]" name="checkitem_[% bibitemloo.biblionumber %]"
value="[% itemLoo.itemnumber %]" />
[% ELSE %]
<input disabled="disabled" type="radio" class="checkitem" name="checkitem" value="[% itemLoo.itemnumber %]" />
- <img src="/opac-tmpl/[% theme %]/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
+ <img src="/opac-tmpl/lib/famfamfam/silk/cross.png" alt="Cannot be put on hold" title="Cannot be put on hold" />
[% END %] [% IF ( itemLoo.copynumber ) %][% itemLoo.copynumber %][% END %]
</td>
[% IF ( item_level_itypes ) %]
- <td>
+ <td class="itype">
[% UNLESS ( noItemTypeImages ) %]
[% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
[% END %]
[% itemLoo.description %]
</td>
[% END %]
- <td>[% itemLoo.barcode %]</td>
+ <td class="barcode">[% itemLoo.barcode %]</td>
[% UNLESS ( singleBranchMode ) %]
- <td>[% itemLoo.homeBranchName %]</td>
- <td>[% itemLoo.holdingBranchName %]</td>
+ <td class="homebranch">[% itemLoo.homeBranchName %]</td>
+ <td class="holdingbranch">[% itemLoo.holdingBranchName %]</td>
[% END %]
- <td>[% itemLoo.callNumber %]</td>
+ <td class="call_no">[% itemLoo.callNumber %]</td>
[% IF ( itemLoo.itemdata_enumchron ) %]<!-- test -->
- <td>[% itemLoo.enumchron %]</td>
+ <td class="vol_info">[% itemLoo.enumchron %]</td>
[% END %]
- <td>
+ <td class="information">
[% IF ( itemLoo.dateDue ) %]
<span class="checkedout">Due [% itemLoo.dateDue %]</span>
[% ELSIF ( itemLoo.transfertwhen ) %]
You did not specify any search criteria.
[% END %]
[% INCLUDE 'doc-head-close.inc' %]
-<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" />
+<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" />
[% IF ( OpacStarRatings == 'all' ) %]<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 %]
<div id="yui-main">
<div class="yui-b">
<div id="userresults" class="container">
- [% IF ( DidYouMeanFromAuthorities ) %]
+ [% IF ( DidYouMean ) %]
<div id='didyoumean'>Not what you expected? Check for <a href='/cgi-bin/koha/svc/suggestion?render=standalone&q=[% querystring | uri %]'>suggestions</a></div>
[% END %]
+ [% INCLUDE 'page-numbers.inc' %]<br />
+ [% IF ( koha_spsuggest ) %]
+ Did you mean:
+ <ul style="list-style: none;">
+ [% FOREACH SPELL_SUGGES IN SPELL_SUGGEST %]
+ <li>
+ <a href="/cgi-bin/koha/opac-search.pl?q=[% SPELL_SUGGES.spsuggestion %]">[% SPELL_SUGGES.spsuggestion %]</a>
+ </li>
+ [% END %]
+ </ul>
+[% END %]
[% IF ( query_error ) %]
<div class="dialog alert">
<span class="results_summary">
<span class="label">Availability:</span>
- [% IF ( SEARCH_RESULT.available_items_loop.0 ) %]
+ [% IF ( SEARCH_RESULT.available_items_loop.size() ) %]
<span class="available"><strong>Copies available:</strong>
[% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %]
- [% UNLESS ( available_items_loo.hideatopac ) %]
[% IF ( singleBranchMode ) %]
[% available_items_loo.location %]
[% ELSE %]
[% END %]
([% available_items_loo.count %]),
[% END %]
- [% END %]
</span>
[% ELSE %]
[% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %]
[% IF ( cgi_debug ) %]alert(_('injecting OLD comment: ')+comment);[% END %]
parent.opener.$('#c[% reviewid %] p').prev("small").prev("h5").html(_("Your edited comment (preview, pending approval)"));
parent.opener.$('#c[% reviewid %] p').html(comment);
- parent.opener.$('#c[% reviewid %] p').append("<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber | uri %]&reviewid=[% reviewid | uri%]\');\">Edit<\/a>");
+ parent.opener.$('#c[% reviewid %] p').append(" <a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber | uri %]&reviewid=[% reviewid | uri%]\');\">"+_("Edit")+"<\/a>");
[% END %]
return 1;
};
parent.opener.$('#newcomment').html(
"<h5>" + _("Your comment (preview, pending approval)") + "<\/h5>" +
"<p>"+comment+"<\/p>" +
- "<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber |uri%]\');\">Edit<\/a><\/p>"
+ "<a href=\"#comment\" onclick=\"Dopop(\'/cgi-bin/koha/opac-review.pl?biblionumber=[% biblionumber |uri%]\');\">"+_("Edit")+"<\/a><\/p>"
);
parent.opener.$("#addcomment").prev("p").remove();
parent.opener.$("#addcomment").remove();
window.close();
[% END %]
[% END %]
- // $('#reviewf').submit(function() {});
});
//]]>
</script>
[% END %]
<form id="reviewf" action="/cgi-bin/koha/opac-review.pl[% IF ( cgi_debug ) %]?debug=1[% END %]" method="post">
<input type="hidden" name="biblionumber" value="[% biblionumber | html%]" />
+ [% IF ( reviewid ) %]<input type="hidden" name="reviewid" value="[% reviewid | html%]" />[% END %]
<fieldset class="brief">
<legend>Comments on <i>[% title |html %] [% subtitle %]</i>[% IF ( author ) %]by [% author %][% END %]</legend>
<ol><li><textarea id="review" name="review" cols="60" rows="8">[% review %]</textarea></li></ol>
</div>
[% END %]
[% IF ( paramsloo.nopermission ) %]
- <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission %].</div>
+ <div class="dialog alert">ERROR: You do not have adequate permission for that action on list [% paramsloo.nopermission |html%].</div>
[% END %]
[% IF ( paramsloo.failgetitem ) %]
<div class="dialog alert">ERROR: No item found with barcode [% paramsloo.failgetitem %].</div>
</style>
<script type="text/javascript">
//<![CDATA[
- var fontsizes = new Array (12,14,16,18,20,22,24,26,28,30);
- var fontcount = fontsizes.length;
- var maxcloudweight = 1;
- $(document).ready(function() {
- // $('#tagcloud').css('background-color','lightgrey');
- // $('#tagcloud .tag').css('border','1px solid black');
- $('#tagcloud .tag').each(function() {
- if (maxcloudweight < this.title) { maxcloudweight = this.title; }
- // have to run through the set of tags once to get the max: cannot be combined w/ 2nd pass
- });
- $('#tagcloud .tag').each(function(i) {
- var pos = this.id;
- var weight = this.title; // "cloudweight"
- weight = (! weight) ? 1 : (weight > maxcloudweight) ? maxcloudweight : weight ;
- var index = Math.round(fontcount * weight/maxcloudweight) - 1;
- index = (! index ) ? 0 : ( index > fontcount ) ? fontcount : index ;
- var newsize = fontsizes[index];
- // alert(pos+ " (" +i+ ") weight = " +weight+ " of " +maxcloudweight+ ", fontsize[" +index+ " of " +fontcount+ "] = " +newsize);
- $('#' + pos).css({"font-size":(newsize + 'px'), display:"inline"});
- });
$("#mytagst").tablesorter({[% IF ( dateformat == 'metric' ) %]
dateFormat: 'uk',[% END %]
widgets : ['zebra'],
headers: { 3: { sorter: false }},
sortList: [[2,0]]
});
- });
//]]>
</script>
</head>
[% IF ( TAGLOOP ) %]
<div id="tagcloud">
[% FOREACH TAGLOO IN TAGLOOP %]
- <span class="tag" id="tag[% loop.count %]">
+ <span class="tag tagweight[% TAGLOO.stratum %]" id="tag[% loop.count %]" style="display:inline;">
<a href="/cgi-bin/koha/opac-search.pl?tag=[% TAGLOO.term |url %]&q=[% TAGLOO.term |url %]">
[% TAGLOO.term |html %]</a>
<span class="tagweight">[% TAGLOO.weight_total %]</span>
</td>[% END %]
- <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber %]">[% ISSUE.title |html %]</a><span class="item-details">
+ <td class="title"><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% ISSUE.biblionumber %]">[% ISSUE.title |html %]</a><span class="item-details">
[% ISSUE.author %]
</span></td>
[% IF ( ISSUE.overdue ) %]
- <td class="overdue">[% ISSUE.date_due | $KohaDates %]</td>
+ <td class="date_due overdue">[% ISSUE.date_due | $KohaDates %]</td>
[% ELSE %]
- <td>[% ISSUE.date_due | $KohaDates %]</td>
+ <td class="date_due">[% ISSUE.date_due | $KohaDates %]</td>
[% END %]
- [% UNLESS ( item_level_itypes ) %]<td>[% IF ( ISSUE.imageurl ) %]<img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />[% END %] [% ISSUE.description %]</td>[% END %]
- [% IF ( show_barcode ) %]<td>[% ISSUE.barcode %]</td>[% END %]
- <td>[% ISSUE.itemcallnumber %]</td>
+ [% UNLESS ( item_level_itypes ) %]<td class="itype">[% IF ( ISSUE.imageurl ) %]<img src="[% ISSUE.imageurl %]" title="[% ISSUE.description %]" alt="[% ISSUE.description %]" />[% END %] [% ISSUE.description %]</td>[% END %]
+ [% IF ( show_barcode ) %]<td class="barcode">[% ISSUE.barcode %]</td>[% END %]
+ <td class="call_no">[% ISSUE.itemcallnumber %]</td>
[% IF ( OpacRenewalAllowed ) %]
- <td>[% IF ( ISSUE.status ) %][% IF ( canrenew ) %]<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=[% ISSUE.itemnumber %]&borrowernumber=[% ISSUE.borrowernumber %]">Renew</a>[% END %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
+ <td class="renew">[% IF ( ISSUE.status ) %][% IF ( canrenew ) %]<input type="checkbox" name="item" value="[% ISSUE.itemnumber %]"/> <a href="/cgi-bin/koha/opac-renew.pl?from=opac_user&item=[% ISSUE.itemnumber %]&borrowernumber=[% ISSUE.borrowernumber %]">Renew</a>[% END %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>
[% ELSE %]
Not renewable[% IF ( ISSUE.too_many ) %] <span class="renewals">([% ISSUE.renewsleft %] of [% ISSUE.renewsallowed %] renewals remaining)</span>[% ELSE %][% IF ( ISSUE.on_reserve ) %] <span class="renewals">(On hold)</span>[% END %][% END %]
[% END %]</td>
[% END %]
[% IF ( OPACFinesTab ) %]
- <td>[% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]</td>
+ <td class="fines">[% IF ( ISSUE.charges ) %]Yes[% ELSE %]No[% END %]</td>
[% END %]
[% IF ( OPACMySummaryHTML ) %]
- <td>[% ISSUE.MySummaryHTML %]</td>
+ <td class="links">[% ISSUE.MySummaryHTML %]</td>
[% END %]
</tr>
[% END %]</tbody>
[% ELSE %]
<tr>
[% END %]
- <td><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">[% RESERVE.reserves_title %]</a>
+ <td class="title"><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">[% RESERVE.reserves_title %]</a>
[% RESERVE.author %]
</td>
- <td>[% RESERVE.reservedate | $KohaDates %]</td>
- <td>[% IF ( RESERVE.expirationdate ) %][% RESERVE.expirationdate | $KohaDates %][% ELSE %]Never expires[% END %]</td>
- <td>[% RESERVE.branch %]</td>
+ <td class="reservedate">[% RESERVE.reservedate | $KohaDates %]</td>
+ <td class="expirationdate">[% IF ( RESERVE.expirationdate ) %][% RESERVE.expirationdate | $KohaDates %][% ELSE %]Never expires[% END %]</td>
+ <td class="branch">[% RESERVE.branch %]</td>
[% IF ( showpriority ) %]
- <td>[% RESERVE.priority %] </td>
+ <td class="priority">[% RESERVE.priority %] </td>
[% END %]
- <td>
+ <td class="status">
[% IF ( RESERVE.wait ) %]
[% IF ( RESERVE.atdestination ) %]
[% IF ( RESERVE.found ) %]
[% END %]
[% END %]
</td>
- <td>
+ <td class="modify">
[% IF ( RESERVE.cancelable ) %]
<form action="/cgi-bin/koha/opac-modrequest.pl" method="post">
<input type="hidden" name="biblionumber" value="[% RESERVE.biblionumber %]" />
You did not specify any search criteria.
[% END %]
[% INCLUDE 'doc-head-close.inc' %]
-<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseurl %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" />
+<link rel="alternate" type="application/rss+xml" title="[% LibraryName |html %] Search RSS Feed" href="[% OPACBaseURL %]/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&count=[% countrss |html %]&sort_by=acqdate_dsc&format=rss2" />
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/jquery/jquery.js"></script>
<link rel="stylesheet" type="text/css" href="/opac-tmpl/prog/en/css/jquery.rating.css" />
--- /dev/null
+[%- SWITCH index -%]
+[%- CASE 'su-na' -%]
+Search also for narrower subjects
+[%- CASE 'su-br' -%]
+Search also for broader subjects
+[%- CASE 'su-rl' -%]
+Search also for related subjects
+[%- END -%]
<xsl:if test="$DisplayOPACiconsXSLT!='0'">
<xsl:if test="$materialTypeCode!=''">
<span class="results_summary type"><span class="label">Type: </span>
- <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element>
+ <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/lib/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt">materialTypeLabel</xsl:attribute><xsl:attribute name="class">materialtype</xsl:attribute></xsl:element>
<xsl:value-of select="$materialTypeLabel"/>
</span>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
</a>
+ <xsl:if test="marc:subfield[@code=9]">
+ <a class='authlink'>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
+ </a>
+ </xsl:if>
<xsl:choose>
<xsl:when test="position()=last()"></xsl:when>
<xsl:otherwise> | </xsl:otherwise>
<xsl:text>]</xsl:text>
</xsl:if>
</a>
+ <xsl:if test="marc:subfield[@code=9]">
+ <a class='authlink'>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
+ </a>
+ </xsl:if>
</xsl:for-each>
<xsl:text>.</xsl:text>
</xsl:template>
chip cartridge
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='c']">
- <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="computer optical disc cartridge" title="computer optical disc cartridge" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/cd.png" alt="computer optical disc cartridge" title="computer optical disc cartridge" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='j']">
magnetic disc
magneto-optical disc
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='o']">
- <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="optical disc" title="optical disc" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/cd.png" alt="optical disc" title="optical disc" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='r']">
available online
- <img src="/opac-tmpl/prog/famfamfam/silk/drive_web.png" alt="remote" title="remote" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/drive_web.png" alt="remote" title="remote" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='c'][substring(text(),2,1)='a']">
tape cartridge
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='a']">
- <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="celestial globe" title="celestial globe" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="celestial globe" title="celestial globe" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='e']">
- <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="earth moon globe" title="earth moon globe" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="earth moon globe" title="earth moon globe" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='b']">
- <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="planetary or lunar globe" title="planetary or lunar globe" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="planetary or lunar globe" title="planetary or lunar globe" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='d'][substring(text(),2,1)='c']">
- <img src="/opac-tmpl/prog/famfamfam/silk/world.png" alt="terrestrial globe" title="terrestrial globe" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/world.png" alt="terrestrial globe" title="terrestrial globe" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='o'][substring(text(),2,1)='o']">
film reel
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='n']">
- <img src="/opac-tmpl/prog/famfamfam/silk/chart_curve.png" alt="chart" title="chart" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/chart_curve.png" alt="chart" title="chart" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='c']">
collage
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='d']">
- <img src="/opac-tmpl/prog/famfamfam/silk/pencil.png" alt="drawing" title="drawing" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/pencil.png" alt="drawing" title="drawing" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='o']">
- <img src="/opac-tmpl/prog/famfamfam/silk/note.png" alt="flash card" title="flash card" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/note.png" alt="flash card" title="flash card" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='e']">
- <img src="/opac-tmpl/prog/famfamfam/silk/paintbrush.png" alt="painting" title="painting" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/paintbrush.png" alt="painting" title="painting" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='f']">
photomechanical print
photoprint
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='i']">
- <img src="/opac-tmpl/prog/famfamfam/silk/picture.png" alt="picture" title="picture" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/picture.png" alt="picture" title="picture" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='k'][substring(text(),2,1)='j']">
print
technical drawing
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='q'][substring(text(),2,1)='q']">
- <img src="/opac-tmpl/prog/famfamfam/silk/script.png" alt="notated music" title="notated music" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/script.png" alt="notated music" title="notated music" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='d']">
filmslip
other filmstrip type
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='s']">
- <img src="/opac-tmpl/prog/famfamfam/silk/pictures.png" alt="slide" title="slide" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/pictures.png" alt="slide" title="slide" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='g'][substring(text(),2,1)='t']">
transparency
sound cassette
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='d']">
- <img src="/opac-tmpl/prog/famfamfam/silk/cd.png" alt="sound disc" title="sound disc" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/cd.png" alt="sound disc" title="sound disc" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='s'][substring(text(),2,1)='t']">
sound-tape reel
braille
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='b']">
- <img src="/opac-tmpl/prog/famfamfam/silk/magnifier.png" alt="large print" title="large print" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/magnifier.png" alt="large print" title="large print" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='t'][substring(text(),2,1)='a']">
regular print
videocassette
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='d']">
- <img src="/opac-tmpl/prog/famfamfam/silk/dvd.png" alt="videodisc" title="videodisc" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/dvd.png" alt="videodisc" title="videodisc" class="format"/>
</xsl:if>
<xsl:if test="marc:controlfield[@tag=007][substring(text(),1,1)='v'][substring(text(),2,1)='r']">
videoreel
<xsl:if test="$typeOf008!=''">
<span class="label">Type: </span>
<xsl:choose>
- <xsl:when test="$leader19='a'"><img src="/opac-tmpl/prog/famfamfam/silk/book_link.png" alt="book" title="book" class="materialtype"/> Set</xsl:when>
+ <xsl:when test="$leader19='a'"><img src="/opac-tmpl/lib/famfamfam/silk/book_link.png" alt="book" title="book" class="materialtype"/> Set</xsl:when>
<xsl:when test="$leader6='a'">
<xsl:choose>
- <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
- <xsl:when test="$leader7='i' or $leader7='s'"><img src="/opac-tmpl/prog/famfamfam/silk/newspaper.png" alt="serial" title="serial" class="materialtype"/> Continuing Resource</xsl:when>
- <xsl:when test="$leader7='a' or $leader7='b'"><img src="/opac-tmpl/prog/famfamfam/silk/book_open.png" alt="article" title="article" class="materialtype"/> Article</xsl:when>
+ <xsl:when test="$leader7='c' or $leader7='d' or $leader7='m'"><img src="/opac-tmpl/lib/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
+ <xsl:when test="$leader7='i' or $leader7='s'"><img src="/opac-tmpl/lib/famfamfam/silk/newspaper.png" alt="serial" title="serial" class="materialtype"/> Continuing Resource</xsl:when>
+ <xsl:when test="$leader7='a' or $leader7='b'"><img src="/opac-tmpl/lib/famfamfam/silk/book_open.png" alt="article" title="article" class="materialtype"/> Article</xsl:when>
</xsl:choose>
</xsl:when>
- <xsl:when test="$leader6='t'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
- <xsl:when test="$leader6='o'"><img src="/opac-tmpl/prog/famfamfam/silk/report_disk.png" alt="kit" title="kit" class="materialtype"/> Kit</xsl:when>
- <xsl:when test="$leader6='p'"><img src="/opac-tmpl/prog/famfamfam/silk/report_disk.png" alt="mixed materials" title="mixed materials" class="materialtype"/>Mixed Materials</xsl:when>
- <xsl:when test="$leader6='m'"><img src="/opac-tmpl/prog/famfamfam/silk/computer_link.png" alt="computer file" title="computer file" class="materialtype"/> Computer File</xsl:when>
- <xsl:when test="$leader6='e' or $leader6='f'"><img src="/opac-tmpl/prog/famfamfam/silk/map.png" alt="map" title="map" class="materialtype"/> Map</xsl:when>
- <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'"><img src="/opac-tmpl/prog/famfamfam/silk/film.png" alt="visual material" title="visual material" class="materialtype"/> Visual Material</xsl:when>
- <xsl:when test="$leader6='c' or $leader6='d'"><img src="/opac-tmpl/prog/famfamfam/silk/music.png" alt="score" title="score" class="materialtype"/> Score</xsl:when>
- <xsl:when test="$leader6='i'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="sound" title="sound" class="materialtype"/> Sound</xsl:when>
- <xsl:when test="$leader6='j'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="music" title="music" class="materialtype"/> Music</xsl:when>
+ <xsl:when test="$leader6='t'"><img src="/opac-tmpl/lib/famfamfam/silk/book.png" alt="book" title="book" class="materialtype"/> Book</xsl:when>
+ <xsl:when test="$leader6='o'"><img src="/opac-tmpl/lib/famfamfam/silk/report_disk.png" alt="kit" title="kit" class="materialtype"/> Kit</xsl:when>
+ <xsl:when test="$leader6='p'"><img src="/opac-tmpl/lib/famfamfam/silk/report_disk.png" alt="mixed materials" title="mixed materials" class="materialtype"/>Mixed Materials</xsl:when>
+ <xsl:when test="$leader6='m'"><img src="/opac-tmpl/lib/famfamfam/silk/computer_link.png" alt="computer file" title="computer file" class="materialtype"/> Computer File</xsl:when>
+ <xsl:when test="$leader6='e' or $leader6='f'"><img src="/opac-tmpl/lib/famfamfam/silk/map.png" alt="map" title="map" class="materialtype"/> Map</xsl:when>
+ <xsl:when test="$leader6='g' or $leader6='k' or $leader6='r'"><img src="/opac-tmpl/lib/famfamfam/silk/film.png" alt="visual material" title="visual material" class="materialtype"/> Visual Material</xsl:when>
+ <xsl:when test="$leader6='c' or $leader6='d'"><img src="/opac-tmpl/lib/famfamfam/silk/music.png" alt="score" title="score" class="materialtype"/> Score</xsl:when>
+ <xsl:when test="$leader6='i'"><img src="/opac-tmpl/lib/famfamfam/silk/sound.png" alt="sound" title="sound" class="materialtype"/> Sound</xsl:when>
+ <xsl:when test="$leader6='j'"><img src="/opac-tmpl/lib/famfamfam/silk/sound.png" alt="music" title="music" class="materialtype"/> Music</xsl:when>
</xsl:choose>
</xsl:if>
<xsl:if test="string-length(normalize-space($physicalDescription))">
</xsl:if>
<xsl:choose>
<xsl:when test="$controlField008-21='d'">
- <img src="/opac-tmpl/prog/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
</xsl:when>
<xsl:when test="$controlField008-21='l'">
loose-leaf
periodical
</xsl:when>
<xsl:when test="$controlField008-21='w'">
- <img src="/opac-tmpl/prog/famfamfam/silk/world_link.png" alt="web site" title="web site" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/world_link.png" alt="web site" title="web site" class="format"/>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:when>
<xsl:when test="contains($controlField008-24,'b')">
bibliography
- <img src="/opac-tmpl/prog/famfamfam/silk/text_list_bullets.png" alt="bibliography" title="bibliography" class="natureofcontents"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/text_list_bullets.png" alt="bibliography" title="bibliography" class="natureofcontents"/>
</xsl:when>
<xsl:when test="contains($controlField008-24,'c')">
catalog
statistics
</xsl:when>
<xsl:when test="contains($controlField008-24,'t')">
- <img src="/opac-tmpl/prog/famfamfam/silk/report.png" alt="technical report" title="technical report" class="natureofcontents"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/report.png" alt="technical report" title="technical report" class="natureofcontents"/>
</xsl:when>
<xsl:when test="contains($controlField008-24,'v')">
legal case and case notes
numeric data
</xsl:when>
<xsl:when test="$controlField008-26='e'">
- <img src="/opac-tmpl/prog/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/database.png" alt="database" title="database" class="format"/>
</xsl:when>
<xsl:when test="$controlField008-26='f'">
- <img src="/opac-tmpl/prog/famfamfam/silk/font.png" alt="font" title="font" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/font.png" alt="font" title="font" class="format"/>
</xsl:when>
<xsl:when test="$controlField008-26='g'">
- <img src="/opac-tmpl/prog/famfamfam/silk/controller.png" alt="game" title="game" class="format"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/controller.png" alt="game" title="game" class="format"/>
</xsl:when>
</xsl:choose>
</xsl:if>
festschrift
</xsl:if>
<xsl:if test="$controlField008-34='a' or $controlField008-34='b' or $controlField008-34='c' or $controlField008-34='d'">
- <img src="/opac-tmpl/prog/famfamfam/silk/user.png" alt="biography" title="biography" class="natureofcontents"/>
+ <img src="/opac-tmpl/lib/famfamfam/silk/user.png" alt="biography" title="biography" class="natureofcontents"/>
</xsl:if>
<xsl:if test="$controlField008-33 and $controlField008-33!='|' and $controlField008-33!='u' and $controlField008-33!=' '">
<xsl:variable name="leader7" select="substring($leader,8,1)"/>
<xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
<xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
- <xsl:variable name="materialTypeCode">
+ <xsl:variable name="typeOf008">
+ <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
<xsl:choose>
<xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
<xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
</xsl:when>
</xsl:choose>
</xsl:variable>
- <xsl:variable name="materialTypeLabel">
- <xsl:choose>
- <xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Bok</xsl:when>
- <xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">Film og video</xsl:when>
- <xsl:when test="$field019b='c' or $field019b='d' or contains($field019b,'da') or contains($field019b,'db') or contains($field019b,'dc') or contains($field019b,'dd') or contains($field019b,'dg') or contains($field019b,'dh') or contains($field019b,'di') or contains($field019b,'dj') or contains($field019b,'dk') or $leader6='c' or $leader6='d' or $leader6='i' or $leader6='j'">Musikalier</xsl:when>
- <xsl:when test="$field019b='a' or contains($field019b,'ab') or contains($field019b,'aj') or $leader6='e' or $leader6='f'">Kart</xsl:when>
- <xsl:when test="$field019b='f' or $field019b='i' or contains($field019b,'ib') or contains($field019b,'ic') or contains($field019b,'fd') or contains($field019b,'ff') or contains($field019b,'fi') or $leader6='k'">Grafisk materiale</xsl:when>
- <xsl:when test="$field019b='g' or contains($field019b,'gb') or contains($field019b,'gd') or contains($field019b,'ge') or $leader6='m'">Fil</xsl:when>
- <xsl:when test="$leader6='o'">Kombidokument</xsl:when>
- <xsl:when test="$field019b='h' or $leader6='r'">Tredimensjonal gjenstand</xsl:when>
- <xsl:when test="$field019b='j' or $leader6='a'">
- <xsl:choose>
- <xsl:when test="$leader7='a' or $leader7='c' or $leader7='m' or $leader7='p'">Bok</xsl:when>
- <xsl:when test="$field019b='j' or $leader7='b' or $leader7='s'">Periodikum</xsl:when>
- </xsl:choose>
- </xsl:when>
- </xsl:choose>
-
- </xsl:variable>
<!-- Tittel og ansvarsopplysninger -->
<xsl:if test="marc:datafield[@tag=245]">
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="nameABCDQ"/></a>
+ <xsl:if test="marc:subfield[@code=9]">
+ <a class='authlink'>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
+ </a>
+ </xsl:if>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="nameABCDN"/></a>
+ <xsl:if test="marc:subfield[@code=9]">
+ <a class='authlink'>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
+ </a>
+ </xsl:if>
<xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="nameACDEQ"/></a>
+ <xsl:if test="marc:subfield[@code=9]">
+ <a class='authlink'>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
+ </a>
+ </xsl:if>
<xsl:choose><xsl:when test="position()=last()"><xsl:text>.</xsl:text></xsl:when><xsl:otherwise><xsl:text>; </xsl:text></xsl:otherwise></xsl:choose>
</xsl:for-each>
</xsl:choose>
<xsl:if test="$DisplayOPACiconsXSLT!='0'">
- <xsl:if test="$materialTypeCode!=''">
- <span class="results_summary"><span class="label">Materialtype: </span>
- <xsl:element name="img"><xsl:attribute name="src">/opac-tmpl/prog/famfamfam/<xsl:value-of select="$materialTypeCode"/>.png</xsl:attribute><xsl:attribute name="alt"></xsl:attribute></xsl:element>
- <xsl:value-of select="$materialTypeLabel"/>
+ <xsl:if test="$typeOf008!=''">
+ <span class="results_summary">
+ <span class="label">Materialtype: </span>
+ <xsl:choose>
+ <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+ <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/lib/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+ <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/lib/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+ <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/lib/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+ <xsl:when test="$typeOf008='FV'"><img src="/opac-tmpl/lib/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+ <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+ <xsl:when test="$typeOf008='gra'"><img src="/opac-tmpl/lib/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+ <xsl:when test="$typeOf008='kom'"><img src="/opac-tmpl/lib/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+ <xsl:when test="$typeOf008='trd'"><img src="/opac-tmpl/lib/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
+ </xsl:choose>
</span>
</xsl:if>
</xsl:if>
</xsl:with-param>
</xsl:call-template>
</a>
+ <xsl:if test="marc:subfield[@code=9]">
+ <a class='authlink'>
+ <xsl:attribute name="href">/cgi-bin/koha/opac-authoritiesdetail.pl?authid=<xsl:value-of select="marc:subfield[@code=9]"/></xsl:attribute>
+ <img style="vertical-align:middle" height="15" width="15" src="/opac-tmpl/prog/images/filefind.png"/>
+ </a>
+ </xsl:if>
<xsl:choose>
<xsl:when test="position()=last()"></xsl:when>
<xsl:otherwise> | </xsl:otherwise>
<xsl:variable name="controlField008" select="marc:controlfield[@tag=008]"/>
<xsl:variable name="field019b" select="marc:datafield[@tag=019]/marc:subfield[@code='b']"/>
<xsl:variable name="typeOf008">
- <!-- Codes with upper case first letter below are from the NORMARC standard, lower case first letter are made up. -->
+ <!-- The logic here should be exactly the same for NORMARCslim2intranetDetail.xsl, NORMARCslim2intranetResults.xsl, NORMARCslim2OPACDetail.xsl and NORMARCslim2OPACResults.xsl -->
<xsl:choose>
<xsl:when test="$field019b='b' or $field019b='k' or $field019b='l' or $leader6='b'">Mon</xsl:when>
<xsl:when test="$field019b='e' or contains($field019b,'ec') or contains($field019b,'ed') or contains($field019b,'ee') or contains($field019b,'ef') or $leader6='g'">FV</xsl:when>
<xsl:if test="$DisplayOPACiconsXSLT!='0'">
<span class="results_summary">
<xsl:if test="$typeOf008!=''">
- <span class="label">Type: </span>
-
- <xsl:choose>
- <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/prog/famfamfam/silk/book.png" alt="Bok" title="Bok"/> Bok</xsl:when>
- <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/prog/famfamfam/silk/newspaper.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
- <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/prog/famfamfam/silk/computer_link.png" alt="Fil" title="Fil"/> Fil</xsl:when>
- <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/prog/famfamfam/silk/map.png" alt="Kart" title="Kart"/> Kart</xsl:when>
- <xsl:when test="$typeOf008='FV'"><img src="/opac-tmpl/prog/famfamfam/silk/film.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
- <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/prog/famfamfam/silk/sound.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
- <xsl:when test="$typeOf008='gra'"> Grafisk materiale</xsl:when>
- <xsl:when test="$typeOf008='kom'"> Kombidokumenter</xsl:when>
- <xsl:when test="$typeOf008='trd'"> Tre-dimensjonale gjenstander</xsl:when>
- </xsl:choose>
+ <span class="label">Materialtype: </span>
+ <xsl:choose>
+ <xsl:when test="$typeOf008='Mon'"><img src="/opac-tmpl/lib/famfamfam/BK.png" alt="Bok" title="Bok"/> Bok</xsl:when>
+ <xsl:when test="$typeOf008='Per'"><img src="/opac-tmpl/lib/famfamfam/AR.png" alt="Periodika" title="Periodika"/> Periodika</xsl:when>
+ <xsl:when test="$typeOf008='Fil'"><img src="/opac-tmpl/lib/famfamfam/CF.png" alt="Fil" title="Fil"/> Fil</xsl:when>
+ <xsl:when test="$typeOf008='Kar'"><img src="/opac-tmpl/lib/famfamfam/MP.png" alt="Kart" title="Kart"/> Kart</xsl:when>
+ <xsl:when test="$typeOf008='FV'"><img src="/opac-tmpl/lib/famfamfam/VM.png" alt="Film og video" title="Film og video"/> Film og video</xsl:when>
+ <xsl:when test="$typeOf008='Mus'"><img src="/opac-tmpl/lib/famfamfam/PR.png" alt="Musikktrykk og lydopptak" title="Musikktrykk og lydopptak"/> Musikk</xsl:when>
+ <xsl:when test="$typeOf008='gra'"><img src="/opac-tmpl/lib/famfamfam/GR.png" alt="Grafisk materiale" title="Grafisk materiale"/> Grafisk materiale</xsl:when>
+ <xsl:when test="$typeOf008='kom'"><img src="/opac-tmpl/lib/famfamfam/MX.png" alt="Kombidokumenter" title="Kombidokumenter"/> Kombidokumenter</xsl:when>
+ <xsl:when test="$typeOf008='trd'"><img src="/opac-tmpl/lib/famfamfam/TD.png" alt="Tre-dimensjonale gjenstander" title="Tre-dimensjonale gjenstander"/> Tre-dimensjonale gjenstander</xsl:when>
+ </xsl:choose>
</xsl:if>
<xsl:if test="string-length(normalize-space($physicalDescription))">
<span class="label">; Format: </span><xsl:copy-of select="$physicalDescription"></xsl:copy-of>
<xsl:variable name="start" select="position()"/>
<xsl:variable name="ends">
<xsl:for-each select="../marc:subfield[position() > $start]">
- <xsl:if test="@code=3 or @code=9 or @code=2">
+ <xsl:if test="@code=9">
<xsl:variable name="end" select="position() + $start"/>
<xsl:value-of select="$end"/>
<xsl:text>,</xsl:text>
</xsl:choose>
</xsl:variable>
<xsl:variable name="display">
- <xsl:for-each select="../marc:subfield[position() > $start and position() < $end]">
+ <xsl:for-each select="../marc:subfield[position() > $start and position() < $end and @code!=2 and @code!=3]">
<xsl:value-of select="."/>
<xsl:if test="not(position()=last())">
<xsl:text>, </xsl:text>
+++ /dev/null
-mini icons - famfamfam.com\r
-Contact: mjames@gmail.com
\ No newline at end of file
+++ /dev/null
-mini icons - famfamfam.com\r
-Contact: mjames@gmail.com
\ No newline at end of file
use strict;
sub kohaversion {
- our $VERSION = '3.09.00.042';
+ our $VERSION = '3.09.00.061';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
my $data=GetMember('borrowernumber' => $borrowernumber);
if ( $action eq 'reverse' ) {
- ReversePayment( $borrowernumber, $input->param('accountno') );
+ ReversePayment( $input->param('accountlines_id') );
}
if ( $data->{'category_type'} eq 'C') {
use CGI;
use C4::Auth;
+use C4::Branch;
use C4::Output;
use C4::Members;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Debug;
use Koha::DateUtils;
}
$template->param(
+ categoryname => $data->{'description'},
+ branchname => GetBranchName($data->{'branchcode'}),
+ );
+
+ if (C4::Context->preference('ExtendedPatronAttributes')) {
+ my $attributes = GetBorrowerAttributes($borrowernumber);
+ $template->param(
+ ExtendedPatronAttributes => 1,
+ extendedattributes => $attributes
+ );
+ }
+
+ my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
+ $template->param( picture => 1 ) if $picture;
+
+ $template->param(
files => Koha::Borrower::Files->new( borrowernumber => $borrowernumber )
->GetFilesInfo(),
issues => $issue,
odissue => "$od/$issue",
fines => sprintf("%.2f",$fines),
+ branchname => $branches->{$borrower->{branchcode}}->{branchname},
);
push(@resultsdata, \%row);
}
if ( $op eq "duplicate" ) {
$template->param( updtype => 'I' );
$template->param( step_1 => 1, step_2 => 1, step_3 => 1, step_4 => 1, step_5 => 1, step_6 => 1 ) unless $step;
+ $data{'cardnumber'} = "";
}
-$data{'cardnumber'}=fixup_cardnumber($data{'cardnumber'}) if $op eq 'add';
+$data{'cardnumber'}=fixup_cardnumber($data{'cardnumber'}) if ( ( $op eq 'add' ) or ( $op eq 'duplicate' ) );
if(!defined($data{'sex'})){
$template->param( none => 1);
} elsif($data{'sex'} eq 'F'){
use C4::Members::Attributes qw(GetBorrowerAttributes);
our $input = CGI->new;
+our $writeoff_sth;
+our $add_writeoff_sth;
our ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => 'members/pay.tmpl',
if ($writeoff_all) {
writeoff_all(@names);
} elsif ($writeoff_item) {
- my $accountno = $input->param('accountno');
+ my $accountlines_id = $input->param('accountlines_id');
my $itemno = $input->param('itemnumber');
my $account_type = $input->param('accounttype');
my $amount = $input->param('amountoutstanding');
- WriteOffFee( $borrowernumber, $accountno, $itemno, $account_type, $amount, $branch );
+ WriteOffFee( $borrowernumber, $accountlines_id, $itemno, $account_type, $amount, $branch );
}
for (@names) {
output_html_with_http_headers $input, $cookie, $template->output;
+sub writeoff {
+ my ( $accountlines_id, $itemnum, $accounttype, $amount ) = @_;
+ my $manager_id = 0;
+ $manager_id = C4::Context->userenv->{'number'} if C4::Context->userenv;
+
+ # if no item is attached to fine, make sure to store it as a NULL
+ $itemnum ||= undef;
+ get_writeoff_sth();
+ $writeoff_sth->execute( $accountlines_id );
+
+ my $acct = getnextacctno($borrowernumber);
+ $add_writeoff_sth->execute( $borrowernumber, $acct, $itemnum, $amount, $manager_id );
+
+ UpdateStats( $branch, 'writeoff', $amount, q{}, q{}, q{}, $borrowernumber );
+
+ return;
+}
sub add_accounts_to_template {
$redirect .= get_for_redirect( 'itemnumber', "itemnumber$line_no", 0 );
$redirect .= get_for_redirect( 'notify_id', "notify_id$line_no", 0 );
$redirect .= get_for_redirect( 'notify_level', "notify_level$line_no", 0 );
+ $redirect .= get_for_redirect( 'accountlines_id', "accountlines_id$line_no", 0 );
$redirect .= '&remote_user=';
$redirect .= $user;
return print $input->redirect($redirect);
my $itemno = $input->param("itemnumber$value");
my $amount = $input->param("amountoutstanding$value");
my $accountno = $input->param("accountno$value");
- WriteOffFee( $borrowernumber, $accountno, $itemno, $accounttype, $amount, $branch );
+ my $accountlines_id = $input->param("accountlines_id$value");
+ WriteOffFee( $borrowernumber, $accountlines_id, $itemno, $accounttype, $amount, $branch );
}
}
print $input->redirect($redirect);
return;
}
+
+sub get_writeoff_sth {
+
+ # lets prepare these statement handles only once
+ if ($writeoff_sth) {
+ return;
+ } else {
+ my $dbh = C4::Context->dbh;
+
+ # Do we need to validate accounttype
+ my $sql = 'Update accountlines set amountoutstanding=0 '
+ . 'WHERE accountlines_id=?';
+ $writeoff_sth = $dbh->prepare($sql);
+ my $insert =
+q{insert into accountlines (borrowernumber,accountno,itemnumber,date,amount,description,accounttype,manager_id)}
+ . q{values (?,?,?,now(),?,'Writeoff','W',?)};
+ $add_writeoff_sth = $dbh->prepare($insert);
+ }
+ return;
+}
my $select_lines = $input->param('selected');
my $select = $input->param('selected_accts');
my $accountno;
-
+my $accountlines_id;
if ( $individual || $writeoff ) {
if ($individual) {
$template->param( pay_individual => 1 );
$template->param( writeoff_individual => 1 );
}
my $accounttype = $input->param('accounttype');
+ $accountlines_id = $input->param('accountlines_id');
my $amount = $input->param('amount');
my $amountoutstanding = $input->param('amountoutstanding');
$accountno = $input->param('accountno');
$total_due = $amountoutstanding;
$template->param(
accounttype => $accounttype,
+ accountlines_id => $accountlines_id,
accountno => $accountno,
amount => $amount,
amountoutstanding => $amountoutstanding,
} else {
if ($individual) {
if ( $total_paid == $total_due ) {
- makepayment( $borrowernumber, $accountno, $total_paid, $user,
+ makepayment( $accountlines_id, $borrowernumber, $accountno, $total_paid, $user,
$branch );
} else {
- makepartialpayment( $borrowernumber, $accountno, $total_paid,
+ makepartialpayment( $accountlines_id, $borrowernumber, $accountno, $total_paid,
$user, $branch );
}
print $input->redirect(
my $borrowernumber=$input->param('borrowernumber');
my $action = $input->param('action') || '';
my $accountno = $input->param('accountno');
+my $accountlines_id = $input->param('accountlines_id');
#get borrower details
my $data=GetMember('borrowernumber' => $borrowernumber);
use C4::Auth;
use C4::Output;
use C4::Members;
-use C4::Branch;
+use C4::Branch qw(GetBranches);
use List::MoreUtils qw/any uniq/;
use Koha::DateUtils;
my $order = 'date_due desc';
my $limit = 0;
-my ( $issues ) = GetAllIssues($borrowernumber,$order,$limit);
-
-my @loop_reading;
-my @barcodes;
-my $today = C4::Dates->new();
-$today = $today->output("iso");
-
-foreach my $issue (@{$issues}){
- my %line;
- $line{issuestimestamp} = format_date($issue->{'issuestimestamp'});
- $line{biblionumber} = $issue->{'biblionumber'};
- $line{title} = $issue->{'title'};
- $line{author} = $issue->{'author'};
- $line{classification} = $issue->{'classification'} || $issue->{'itemcallnumber'};
- $line{date_due} = format_sqldatetime($issue->{date_due});
- $line{returndate} = format_sqldatetime($issue->{returndate});
- $line{issuedate} = format_sqldatetime($issue->{issuedate});
- $line{issuingbranch} = GetBranchName($issue->{'branchcode'});
- $line{renewals} = $issue->{'renewals'};
- $line{barcode} = $issue->{'barcode'};
- $line{volumeddesc} = $issue->{'volumeddesc'};
- push(@loop_reading,\%line);
- my $return_dt = Koha::DateUtils::dt_from_string($issue->{'returndate'}, 'iso');
- if ( ( $input->param('op') eq 'export_barcodes' ) and ( $today eq $return_dt->ymd() ) ) {
- push( @barcodes, $issue->{'barcode'} );
- }
+my $issues = GetAllIssues($borrowernumber,$order,$limit);
+
+my $branches = GetBranches();
+foreach my $issue ( @{$issues} ) {
+ $issue->{issuingbranch} = $branches->{ $issue->{branchcode} }->{branchname};
}
-if ($input->param('op') eq 'export_barcodes') {
- my $borrowercardnumber = GetMember( borrowernumber => $borrowernumber )->{'cardnumber'} ;
+# barcode export
+if ( $input->param('op') eq 'export_barcodes' ) {
+ my $today = C4::Dates->new();
+ $today = $today->output('iso');
+ my @barcodes =
+ map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues};
+ my $borrowercardnumber =
+ GetMember( borrowernumber => $borrowernumber )->{'cardnumber'};
my $delimiter = "\n";
- binmode( STDOUT, ":encoding(UTF-8)");
+ binmode( STDOUT, ":encoding(UTF-8)" );
print $input->header(
-type => 'application/octet-stream',
-charset => 'utf-8',
-attachment => "$today-$borrowercardnumber-checkinexport.txt"
);
- my $content = join($delimiter, uniq(@barcodes));
+ my $content = join $delimiter, uniq(@barcodes);
print $content;
exit;
}
$limit = 'full';
}
+
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'});
$template->param( picture => 1 ) if $picture;
}
$template->param(
- readingrecordview => 1,
- biblionumber => $data->{'biblionumber'},
- title => $data->{'title'},
- initials => $data->{'initials'},
- surname => $data->{'surname'},
- othernames => $data->{'othernames'},
- borrowernumber => $borrowernumber,
- limit => $limit,
- firstname => $data->{'firstname'},
- cardnumber => $data->{'cardnumber'},
- categorycode => $data->{'categorycode'},
- category_type => $data->{'category_type'},
- # category_description => $data->{'description'},
- categoryname => $data->{'description'},
- address => $data->{'address'},
- address2 => $data->{'address2'},
- city => $data->{'city'},
- state => $data->{'state'},
- zipcode => $data->{'zipcode'},
- country => $data->{'country'},
- phone => $data->{'phone'},
- email => $data->{'email'},
- branchcode => $data->{'branchcode'},
- is_child => ($data->{'category_type'} eq 'C'),
- branchname => GetBranchName($data->{'branchcode'}),
- showfulllink => (scalar @loop_reading > 50),
- loop_reading => \@loop_reading,
- activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
+ readingrecordview => 1,
+ title => $data->{title},
+ initials => $data->{initials},
+ surname => $data->{surname},
+ othernames => $data->{othernames},
+ borrowernumber => $borrowernumber,
+ firstname => $data->{firstname},
+ cardnumber => $data->{cardnumber},
+ categorycode => $data->{categorycode},
+ category_type => $data->{category_type},
+ categoryname => $data->{description},
+ address => $data->{address},
+ address2 => $data->{address2},
+ city => $data->{city},
+ state => $data->{state},
+ zipcode => $data->{zipcode},
+ country => $data->{country},
+ phone => $data->{phone},
+ email => $data->{email},
+ branchcode => $data->{branchcode},
+ is_child => ( $data->{category_type} eq 'C' ),
+ branchname => $branches->{ $data->{branchcode} }->{branchname},
+ loop_reading => $issues,
+ activeBorrowerRelationship =>
+ ( C4::Context->preference('borrowerRelationship') ne '' ),
);
output_html_with_http_headers $input, $cookie, $template->output;
-
-
use C4::Context;
use C4::Members;
use C4::Members::Statistics;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
use C4::Output;
my $input = new CGI;
foreach my $key ( keys %$borrower ) {
$template->param( $key => $borrower->{$key} );
}
-
+$template->param(
+ categoryname => $borrower->{'description'},
+ branchname => GetBranchName($borrower->{'branchcode'}),
+);
# Construct column names
my $fields = C4::Members::Statistics::get_fields();
our @statistic_column_names = split '\|', $fields;
my $count_total_issues_returned = $total->{count_total_issues_returned_today} || 0;
my $count_total_actual_state = ($count_total_precedent_state - $count_total_issues_returned + $count_total_issues);
+if (C4::Context->preference('ExtendedPatronAttributes')) {
+ my $attributes = GetBorrowerAttributes($borrowernumber);
+ $template->param(
+ ExtendedPatronAttributes => 1,
+ extendedattributes => $attributes
+ );
+}
+
+my ($picture, $dberror) = GetPatronImage($borrower->{'cardnumber'});
+$template->param( picture => 1 ) if $picture;
+
$template->param(
statisticsview => 1,
datas => $datas,
--- /dev/null
+#!/usr/bin/perl
+
+use Modern::Perl;
+use Getopt::Long;
+use Pod::Usage;
+use IO::File;
+
+use C4::Biblio;
+
+my ($help, $files);
+GetOptions(
+ 'h|help' => \$help,
+);
+
+pod2usage(1) if $help or not @ARGV;
+
+for my $file ( @ARGV ) {
+ say "Find biblionumber in file $file";
+ my $fh;
+ open($fh, '<', $file) or say "Error: '$file' $!" and next;
+
+ while ( <$fh> ) {
+ my $biblionumber = $_;
+ $biblionumber =~ s/$1/\n/g if $biblionumber =~ m/(\r\n?|\n\r?)/;
+ chomp $biblionumber;
+ my $dbh = C4::Context->dbh;
+ next if not $biblionumber =~ /^\d*$/;
+ print "Delete biblionumber $biblionumber ";
+ my $error;
+ eval {
+ $error = DelBiblio $biblionumber;
+ };
+ if ( $@ or $error) {
+ say "KO $@ ($! | $error)";
+ } else {
+ say "OK";
+ }
+ }
+}
+
+exit(0);
+
+__END__
+
+=head1 NAME
+
+batchdeletebiblios.pl
+
+=head1 SYNOPSIS
+
+./batchdeletebiblio.pl file1 [file2 ... filen]
+
+This script batch deletes biblios which contain a biblionumber present in file passed in parameter.
+If one biblio has items, it is not deleted.
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<-h|--help>
+
+prints this help message
+
+=back
+
+=head1 AUTHOR
+
+Jonathan Druart <jonathan.druart@biblibre.com>
+
+=head1 COPYRIGHT
+
+Copyright 2012 BibLibre
+
+=head1 LICENSE
+
+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.
+
+You should have received a copy of the GNU General Public License along
+with Koha; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+=head1 DISCLAIMER OF WARRANTY
+
+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.
+
+=cut
--- /dev/null
+#!/bin/sh
+#
+# This script changes selinux file labels for cgi scripts.
+# It may be useful for Linux installations with SELinux (like CentOS, Fedora,
+# RedHat among others) and having it enabled (enforcing mode).
+#
+# Copyright 2012 Rijksmuseum
+#
+# 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.
+
+usage() {
+ echo "Usage: set-selinux-labels [-h] [-u] [-r] [-s] [-v]"
+ echo " -h prints help information."
+ echo " -u updates the selinux label for scripts in Koha installation."
+ echo " Note: you should be in the root directory of a Koha install."
+ echo " -r uses restorecon on scripts to restore default label."
+ echo " -s shows all files (incl. scripts), not having default label."
+ echo " -v provides (verbose) diagnostics per file (for update/restore)."
+ echo
+ echo "The output of -s may be confusing, but it does not reset any labels. It only prints informational messages from restorecon with -n flag."
+}
+
+updatelabel() {
+ #Now set perl scripts to httpd_sys_script_exec_t
+ #We skip scripts in: misc docs t xt and atomicupdate
+ find -name "*.pl" -and ! -path "./docs/*" -and ! -path "./misc/*" -and ! -path "./t/*" -and ! -path "./xt/*" -and ! -path "./installer/data/mysql/atomicupdate/*" | xargs chcon $verbose -t httpd_sys_script_exec_t
+
+ #Handle exceptions to the rule: scripts without .pl
+ chcon $verbose -t httpd_sys_script_exec_t opac/unapi
+ find opac/svc -type f | xargs chcon $verbose -t httpd_sys_script_exec_t
+ find svc -type f | xargs chcon $verbose -t httpd_sys_script_exec_t
+}
+
+restorelabel() {
+ find -name "*.pl" -and ! -path "./docs/*" -and ! -path "./misc/*" -and ! -path "./t/*" -and ! -path "./xt/*" -and ! -path "./installer/data/mysql/atomicupdate/*" | xargs restorecon $verbose
+ restorecon $verbose opac/unapi
+ find opac/svc -type f | xargs restorecon $verbose
+ find svc -type f | xargs restorecon $verbose
+}
+
+showlabel() {
+ restorecon -r -n -v *
+}
+
+#First: check on chcon xargs restorecon
+chcon --help >/dev/null 2>&1
+retval=$?
+if [ $retval -ne 0 ]; then
+ echo "Chcon command not found. Exiting script now.";
+ exit;
+fi
+xargs --help >/dev/null 2>&1
+retval=$?
+if [ $retval -ne 0 ]; then
+ echo "Xargs command not found. Exiting script now.";
+ exit;
+fi
+restorecon -n >/dev/null 2>&1
+retval=$?
+if [ $retval -ne 0 ]; then
+ echo "Restorecon command not found. Exiting script now.";
+ exit;
+fi
+
+#No arguments?
+if [ $# -eq 0 ]; then
+ usage
+ exit
+fi
+
+#Check command line options
+restore=0
+show=0
+update=0
+verbose=
+while getopts "hrsuv" option; do
+ case $option in
+ h)
+ usage
+ exit;;
+ r)
+ restore=1;;
+ s)
+ show=1;;
+ u)
+ update=1;;
+ v)
+ verbose="-v";;
+ esac
+done
+
+#Check if you are on root level of Koha installation
+if [ ! -e kohaversion.pl ]; then
+ echo "You are not in root directory of Koha install. Cannot continue. Bye.";
+ exit;
+fi
+
+#Cannot update and restore together
+if [ $update -eq 1 ] && [ $restore -eq 1 ]; then
+ echo "You cannot run update and restore at the same time."
+ exit;
+fi
+
+#Now run the job or print usage
+if [ $update -eq 1 ]; then updatelabel; exit; fi
+if [ $restore -eq 1 ]; then restorelabel; exit; fi
+if [ $show -eq 1 ]; then showlabel; exit; fi
+usage
+++ /dev/null
-#!/usr/bin/perl
-
-use strict;
-#use warnings; FIXME - Bug 2505
-BEGIN {
- # find Koha's Perl modules
- # test carefully before changing this
- use FindBin;
- eval { require "$FindBin::Bin/kohalib.pl" };
-}
-
-use C4::Context;
-use C4::ImportBatch;
-use Getopt::Long;
-
-$| = 1;
-
-# command-line parameters
-my $batch_number = "";
-my $list_batches = 0;
-my $want_help = 0;
-
-my $result = GetOptions(
- 'batch-number:s' => \$batch_number,
- 'list-batches' => \$list_batches,
- 'h|help' => \$want_help
-);
-
-if ($want_help or (not $batch_number and not $list_batches)) {
- print_usage();
- exit 0;
-}
-
-if ($list_batches) {
- list_batches();
- exit 0;
-}
-
-# FIXME dummy user so that logging won't fail
-# in future, probably should tie to a real user account
-C4::Context->set_userenv(0, 'batch', 0, 'batch', 'batch', 'batch', 'batch', 'batch');
-
-my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
-if ($batch_number =~ /^\d+$/ and $batch_number > 0) {
- my $batch = GetImportBatch($batch_number);
- die "$0: import batch $batch_number does not exist in database\n" unless defined $batch;
- die "$0: import batch $batch_number status is '" . $batch->{'import_status'} . "', and therefore cannot be imported\n"
- unless $batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted";
- process_batch($batch_number);
- $dbh->commit();
-} else {
- die "$0: please specify a numeric batch ID\n";
-}
-
-exit 0;
-
-sub list_batches {
- my $results = GetAllImportBatches();
- print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n", "#", "File name", "Batch comments", "Status");
- print '-' x 5, ' ' , '-' x 25, ' ', '-' x 25, ' ', '-' x 10, "\n" ;
- foreach my $batch (@{ $results}) {
- if ($batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted") {
- print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n",
- $batch->{'import_batch_id'},
- $batch->{'file_name'},
- $batch->{'comments'},
- $batch->{'import_status'});
- }
- }
-}
-
-sub process_batch {
- my ($import_batch_id) = @_;
-
- print "... importing MARC records -- please wait\n";
- my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) =
- BatchCommitBibRecords($import_batch_id, '', 100, \&print_progress_and_commit);
- print "... finished importing MARC records\n";
-
- print <<_SUMMARY_;
-
-MARC record import report
-----------------------------------------
-Batch number: $import_batch_id
-Number of new bibs added: $num_added
-Number of bibs replaced: $num_updated
-Number of bibs ignored: $num_ignored
-Number of items added: $num_items_added
-Number of items ignored: $num_items_errored
-
-Note: an item is ignored if its barcode is a
-duplicate of one already in the database.
-_SUMMARY_
-}
-
-sub print_progress_and_commit {
- my $recs = shift;
- print "... processed $recs records\n";
- $dbh->commit();
-}
-
-sub print_usage {
- print <<_USAGE_;
-$0: import a batch of staged MARC records into database.
-
-Use this batch job to complete the import of a batch of
-MARC records that was staged either by the batch job
-stage_biblios_file.pl or by the Koha Tools option
-"Stage MARC Records for Import".
-
-Parameters:
- --batch-number <#> number of the record batch
- to import
- --list-batches print a list of record batches
- available to commit
- --help or -h show this message.
-_USAGE_
-}
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+BEGIN {
+ # find Koha's Perl modules
+ # test carefully before changing this
+ use FindBin;
+ eval { require "$FindBin::Bin/kohalib.pl" };
+}
+
+use C4::Context;
+use C4::ImportBatch;
+use Getopt::Long;
+
+$| = 1;
+
+# command-line parameters
+my $batch_number = "";
+my $list_batches = 0;
+my $revert = 0;
+my $want_help = 0;
+
+my $result = GetOptions(
+ 'batch-number:s' => \$batch_number,
+ 'list-batches' => \$list_batches,
+ 'revert' => \$revert,
+ 'h|help' => \$want_help
+);
+
+if ($want_help or (not $batch_number and not $list_batches)) {
+ print_usage();
+ exit 0;
+}
+
+if ($list_batches) {
+ list_batches();
+ exit 0;
+}
+
+# FIXME dummy user so that logging won't fail
+# in future, probably should tie to a real user account
+C4::Context->set_userenv(0, 'batch', 0, 'batch', 'batch', 'batch', 'batch', 'batch');
+
+my $dbh = C4::Context->dbh;
+$dbh->{AutoCommit} = 0;
+if ($batch_number =~ /^\d+$/ and $batch_number > 0) {
+ my $batch = GetImportBatch($batch_number);
+ die "$0: import batch $batch_number does not exist in database\n" unless defined $batch;
+ if ($revert) {
+ die "$0: import batch $batch_number status is '" . $batch->{'import_status'} . "', and therefore cannot be imported\n"
+ unless $batch->{'import_status'} eq "imported";
+ revert_batch($batch_number);
+ } else {
+ die "$0: import batch $batch_number status is '" . $batch->{'import_status'} . "', and therefore cannot be imported\n"
+ unless $batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted";
+ process_batch($batch_number);
+ }
+ $dbh->commit();
+} else {
+ die "$0: please specify a numeric batch ID\n";
+}
+
+exit 0;
+
+sub list_batches {
+ my $results = GetAllImportBatches();
+ print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n", "#", "File name", "Batch comments", "Status");
+ print '-' x 5, ' ' , '-' x 25, ' ', '-' x 25, ' ', '-' x 10, "\n" ;
+ foreach my $batch (@{ $results}) {
+ if ($batch->{'import_status'} eq "staged" or $batch->{'import_status'} eq "reverted") {
+ print sprintf("%5.5s %-25.25s %-25.25s %-10.10s\n",
+ $batch->{'import_batch_id'},
+ $batch->{'file_name'},
+ $batch->{'comments'},
+ $batch->{'import_status'});
+ }
+ }
+}
+
+sub process_batch {
+ my ($import_batch_id) = @_;
+
+ print "... importing MARC records -- please wait\n";
+ my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) =
+ BatchCommitRecords($import_batch_id, '', 100, \&print_progress_and_commit);
+ print "... finished importing MARC records\n";
+
+ print <<_SUMMARY_;
+
+MARC record import report
+----------------------------------------
+Batch number: $import_batch_id
+Number of new records added: $num_added
+Number of records replaced: $num_updated
+Number of records ignored: $num_ignored
+Number of items added: $num_items_added
+Number of items ignored: $num_items_errored
+
+Note: an item is ignored if its barcode is a
+duplicate of one already in the database.
+_SUMMARY_
+}
+
+sub revert_batch {
+ my ($import_batch_id) = @_;
+
+ print "... reverting batch -- please wait\n";
+ my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored) =
+ BatchRevertRecords($import_batch_id, 100, \&print_progress_and_commit);
+ print "... finished reverting batch\n";
+
+ print <<_SUMMARY_;
+
+MARC record import report
+----------------------------------------
+Batch number: $import_batch_id
+Number of records deleted: $num_deleted
+Number of errors: $num_errors
+Number of records reverted: $num_reverted
+Number of records ignored: $num_ignored
+Number of items added: $num_items_deleted
+
+_SUMMARY_
+}
+
+
+sub print_progress_and_commit {
+ my $recs = shift;
+ print "... processed $recs records\n";
+ $dbh->commit();
+}
+
+sub print_usage {
+ print <<_USAGE_;
+$0: import a batch of staged MARC records into database.
+
+Use this batch job to complete the import of a batch of
+MARC records that was staged either by the batch job
+stage_file.pl or by the Koha Tools option
+"Stage MARC Records for Import".
+
+Parameters:
+ --batch-number <#> number of the record batch
+ to import
+ --list-batches print a list of record batches
+ available to commit
+ --revert revert a batch instead of importing it
+ --help or -h show this message.
+_USAGE_
+}
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright 2012 Tamil s.a.r.l.
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use Modern::Perl;
+use Pod::Usage;
+use Getopt::Long;
+use C4::Context;
+use C4::Biblio;
+eval { require AnyEvent } or die "This script requires AnyEvent perl library. Use check-url.pl if you can't install AnyEvent" ;
+eval { require AnyEvent::HTTP } or die "This script requires AnyEvent::HTTP perl library. Use check-url.pl if you can't install AnyEvent::HTTP" ;
+
+my ( $verbose, $help, $html ) = ( 0, 0, 0 );
+my ( $host, $host_intranet ) = ( '', '' );
+my ( $timeout, $maxconn ) = ( 10, 200 );
+my @tags;
+my $uriedit = "/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=";
+my $user_agent = 'Mozilla/5.0 (compatible; U; Koha checkurl)';
+GetOptions(
+ 'verbose' => \$verbose,
+ 'html' => \$html,
+ 'h|help' => \$help,
+ 'host=s' => \$host,
+ 'host-intranet=s' => \$host_intranet,
+ 'timeout=i' => \$timeout,
+ 'maxconn=i' => \$maxconn,
+ 'tags=s{,}' => \@tags,
+);
+
+# Validate tags to check
+{
+ my %h = map { $_ => undef } @tags;
+ @tags = sort keys %h;
+ my @invalids;
+ for (@tags) {
+ push @invalids, $_ unless /^\d{3}$/;
+ }
+ if (@invalids) {
+ say "Invalid tag(s): ", join( ' ', @invalids );
+ exit;
+ }
+ push @tags, '856' unless @tags;
+}
+
+sub usage {
+ pod2usage( -verbose => 2 );
+ exit;
+}
+
+sub report {
+ my ( $hdr, $biblionumber, $url ) = @_;
+ print $html
+ ? "<tr>\n <td><a href=\""
+ . $host_intranet
+ . $uriedit
+ . $biblionumber
+ . "\">$biblionumber</a>"
+ . "</td>\n <td>$url</td>\n <td>"
+ . "$hdr->{Status} $hdr->{Reason}</td>\n</tr>\n"
+ : "$biblionumber\t$url\t" . "$hdr->{Status} $hdr->{Reason}\n";
+}
+
+# Check all URLs from all current Koha biblio records
+
+sub check_all_url {
+ my $sth = C4::Context->dbh->prepare(
+ "SELECT biblionumber FROM biblioitems ORDER BY biblionumber");
+ $sth->execute;
+
+ my $count = 0; # Number of requested URL
+ my $cv = AnyEvent->condvar;
+ say "<html>\n<body>\n<div id=\"checkurl\">\n<table>" if $html;
+ my $idle = AnyEvent->timer(
+ interval => .3,
+ cb => sub {
+ return if $count > $maxconn;
+ while ( my ($biblionumber) = $sth->fetchrow ) {
+ my $record = GetMarcBiblio($biblionumber);
+ for my $tag (@tags) {
+ foreach my $field ( $record->field($tag) ) {
+ my $url = $field->subfield('u');
+ next unless $url;
+ $url = "$host/$url" unless $url =~ /^http/i;
+ $count++;
+ http_request(
+ HEAD => $url,
+ headers => { 'user-agent' => $user_agent },
+ timeout => $timeout,
+ sub {
+ my ( undef, $hdr ) = @_;
+ $count--;
+ report( $hdr, $biblionumber, $url )
+ if $hdr->{Status} !~ /^2/ || $verbose;
+ },
+ );
+ }
+ }
+ return if $count > $maxconn;
+ }
+ $cv->send;
+ }
+ );
+ $cv->recv;
+ $idle = undef;
+
+ # Few more time for pending requests
+ $cv = AnyEvent->condvar;
+ my $timer = AnyEvent->timer(
+ after => $timeout,
+ interval => $timeout,
+ cb => sub { $cv->send if $count == 0; }
+ );
+ $cv->recv;
+ say "</table>\n</div>\n</body>\n</html>" if $html;
+}
+
+usage() if $help;
+
+if ( $html && !$host_intranet ) {
+ if ($host) {
+ $host_intranet = $host;
+ }
+ else {
+ say
+"Error: host-intranet parameter or host must be provided in html mode";
+ exit;
+ }
+}
+
+check_all_url();
+
+=head1 NAME
+
+check-url-quick.pl - Check URLs from biblio records
+
+=head1 USAGE
+
+=over
+
+=item check-url-quick [--verbose|--help|--html] [--tags 310 856] [--host=http://default.tld]
+[--host-intranet]
+
+Scan all URLs found by default in 856$u of bib records and display if resources
+are available or not. HTTP requests are sent in parallel for efficiency, and
+speed. This script replaces check-url.pl script.
+
+=back
+
+=head1 PARAMETERS
+
+=over
+
+=item B<--host=http://default.tld>
+
+Server host used when URL doesn't have one, ie doesn't begin with 'http:'.
+For example, if --host=http://www.mylib.com, then when 856$u contains
+'img/image.jpg', the url checked is: http://www.mylib.com/image.jpg'.
+
+=item B<--tags>
+
+Tags containing URLs in $u subfields. If not provided, 856 tag is checked. Multiple tags can be specified, for example:
+
+ check-url-quick.pl --tags 310 410 856
+
+=item B<--verbose|-v>
+
+Outputs both successful and failed URLs.
+
+=item B<--html>
+
+Formats output in HTML. The result can be redirected to a file
+accessible by http. This way, it's possible to link directly to biblio
+record in edit mode. With this parameter B<--host-intranet> is required.
+
+=item B<--host-intranet=http://koha-pro.tld>
+
+Server host used to link to biblio record editing page in Koha intranet
+interface.
+
+=item B<--timeout=10>
+
+Timeout for fetching URLs. By default 10 seconds.
+
+=item B<--maxconn=1000>
+
+Number of simulaneous HTTP requests. By default 200 connexions.
+
+=item B<--help|-h>
+
+Print this help page.
+
+=back
+
+=cut
Scan all URLs found in 856$u of bib records
and display if resources are available or not.
+This script is deprecated. You should rather use check-url-quick.pl.
=back
# by manipulating those variables in the command.
#
# For example, on the same codebase:
-# */10 * * * * KOHA_CONF=/etc/koha/koha-conf.xml /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
+# */10 * * * * __KOHA_USER__ KOHA_CONF=/etc/koha/koha-conf.xml /usr/share/koha/bin/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
#
# For example, on a separate codebase:
-# */10 * * * * KOHA_CONF=/etc/koha/koha-conf.xml PERL5LIB=/home/koha/kohaclone /home/koha/kohaclone/misc/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
+# */10 * * * * __KOHA_USER__ KOHA_CONF=/etc/koha/koha-conf.xml PERL5LIB=/home/koha/kohaclone /home/koha/kohaclone/misc/migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
#
# ADDITIONAL INFO:
# See the perldoc of individual scripts to determine what other options
# Cron/crontab will choke without it.
#
# SCHEDULED JOBS:
-# m h dom mon dow command
+# m h dom mon dow user command
# OVERDUE NOTICES
-0 1 * * * $KOHA_CRON_PATH/overdue_notices.pl -t
+0 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/overdue_notices.pl -t
# FINES
-5 1 * * * $KOHA_CRON_PATH/fines.pl
+5 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/fines.pl
# ADVANCE NOTICES
-10 1 * * * $KOHA_CRON_PATH/advance_notices.pl -c
+10 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/advance_notices.pl -c
# PROCESS LONG OVERDUES
# updates item status from available to longoverdue for items long overdue
-# 19 1 * * * $KOHA_CRON_PATH/longoverdue.pl --lost 90=1 --confirm
+# 19 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/longoverdue.pl --lost 90=1 --confirm
# SEND EMAILS
-15 * * * * $KOHA_CRON_PATH/process_message_queue.pl
+15 * * * * __KOHA_USER__ $KOHA_CRON_PATH/process_message_queue.pl
# Hourly holds queue updated
-52 * * * * $KOHA_CRON_PATH/holds/build_holds_queue.pl >/dev/null 2>&1
+52 * * * * __KOHA_USER__ $KOHA_CRON_PATH/holds/build_holds_queue.pl >/dev/null 2>&1
# Cancel expired holds
-0 1 * * * $KOHA_CRON_PATH/holds/cancel_expired_holds.pl >/dev/null 2>&1
+0 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/holds/cancel_expired_holds.pl >/dev/null 2>&1
# Update popularity counts for biblio records
-0 2 * * * $KOHA_CRON_PATH/update_totalissues.pl --commit=1000 --use-stats --incremental --interval=1d >/dev/null 2>&1
+0 2 * * * __KOHA_USER__ $KOHA_CRON_PATH/update_totalissues.pl --commit=1000 --use-stats --incremental --interval=1d >/dev/null 2>&1
# ZEBRA INDEX UPDATES with -z option, incremental index updates throughout the day
# for both authorities and bibs
-*/10 * * * * $KOHA_CRON_PATH/../migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
+*/10 * * * * __KOHA_USER__ $KOHA_CRON_PATH/../migration_tools/rebuild_zebra.pl -b -a -z >/dev/null
# services_throttle -- resets the xISBN service
-59 23 * * * $KOHA_CRON_PATH/services_throttle.pl > /dev/null 2>&1
+59 23 * * * __KOHA_USER__ $KOHA_CRON_PATH/services_throttle.pl > /dev/null 2>&1
# clean up databases nightly. Be sure not to run this with --sessions during a time when the system is in use!
-16 1 * * * $KOHA_CRON_PATH/cleanup_database.pl --sessions --zebraqueue 10
+16 1 * * * __KOHA_USER__ $KOHA_CRON_PATH/cleanup_database.pl --sessions --zebraqueue 10
# delete old purchase suggestions weekly. Replace XX with a number to define the age of suggestions to delete.
-@weekly $KOHA_CRON_PATH/purge_suggestions.pl --days XX > /dev/null 2>&1
+@weekly __KOHA_USER__ $KOHA_CRON_PATH/purge_suggestions.pl --days XX > /dev/null 2>&1
my $batch_ids = GetStagedWebserviceBatches() or exit;
$framework ||= '';
-BatchCommitBibRecords($_, $framework) foreach @$batch_ids;
+BatchCommitRecords($_, $framework) foreach @$batch_ids;
next PERIOD;
}
+ my $letter_template = C4::Letters::GetLetter (
+ module => 'circulation',
+ letter_code => $overdue_rules->{"letter$i"},
+ branchcode => $branchcode
+ );
+
# $letter->{'content'} is the text of the mail that is sent.
# this text contains fields that are replaced by their value. Those fields must be written between brackets
# The following fields are available :
my $letter = parse_letter(
{ letter_code => $overdue_rules->{"letter$i"},
+ letter => $letter_template,
borrowernumber => $borrowernumber,
branchcode => $branchcode,
items => \@items,
my $attachment = {
filename => defined $csvfilename ? 'attachment.csv' : 'attachment.txt',
- type => 'text/plain',
+ type => 'text/plain; charset="utf-8"',
content => $content,
};
my $letter = {
+ 'content-type' => 'text/plain; charset="utf-8"',
title => 'Overdue Notices',
content => 'These messages were not sent directly to the patrons.',
};
my $currency_format;
if ($params->{'letter'}->{'content'} =~ m/<fine>(.*)<\/fine>/o) { # process any fine tags...
$currency_format = $1;
- $params->{'letter'}->{'content'} =~ s/<fine>.*<\/fine>/<<item.fine>>/o;
+ $params->{'letter'}->{'content'} =~ s/<fine>.*<\/fine>/<<items.fine>>/o;
}
my @item_tables;
}
}
- return C4::Letters::GetPreparedLetter (
+ return C4::Letters::GetProcessedLetter (
module => 'circulation',
letter_code => $params->{'letter_code'},
+ letter => $params->{'letter'},
branchcode => $params->{'branchcode'},
tables => \%tables,
substitute => $substitute,
- repeat => { item => \@item_tables },
+ repeat => { item => \@item_tables }
);
}
($verbose) and print scalar(@ARGV), " argument(s) after options: " . join(" ", @ARGV) . "\n";
-foreach my $report (@ARGV) {
- my ($sql, $type) = get_saved_report($report);
- unless ($sql) {
- carp "ERROR: No saved report $report found";
+foreach my $report_id (@ARGV) {
+ my $report = get_saved_report($report_id);
+ unless ($report) {
+ warn "ERROR: No saved report $report_id found";
next;
}
+ my $sql => $report->{savedsql};
+ my $report_name => $report->{report_name};
+ my $type => $report->{type};
+
$verbose and print "SQL: $sql\n\n";
- # my $results = execute_query($sql, undef, 0, 99999, $format, $report);
+ if (defined($report_name) and $report_name ne "")
+ {
+ $subject = $report_name ;
+ }
+ else
+ {
+ $subject = 'Koha Saved Report';
+ }
+ # my $results = execute_query($sql, undef, 0, 99999, $format, $report_id);
my ($sth) = execute_query($sql);
# execute_query(sql, , 0, 20, , )
my $count = scalar($sth->rows);
use C4::Debug; # supplying $debug and $cgi_debug
use Getopt::Long;
use List::MoreUtils qw/none/;
+use Koha::DateUtils;
my $help = 0;
my $verbose = 0;
"Delimiter: '$delim'\n";
}
$debug and (defined $borrowernumberlimit) and print "--borrower limitation: borrower $borrowernumberlimit\n";
-my $data = (defined $borrowernumberlimit) ? checkoverdues($borrowernumberlimit) : Getoverdues();
+my ($numOverdueItems, $data);
+if (defined $borrowernumberlimit) {
+ ($numOverdueItems, $data) = checkoverdues($borrowernumberlimit);
+} else {
+ $data = Getoverdues();
+ $numOverdueItems = scalar @$data;
+}
my $overdueItemsCounted = 0;
my %calendars = ();
$today = C4::Dates->new();
$today_iso = $today->output('iso');
-$today_days = Date_to_Days( split( /-/, $today_iso ) );
+my ($tyear, $tmonth, $tday) = split( /-/, $today_iso );
+$today_days = Date_to_Days( $tyear, $tmonth, $tday );
for ( my $i = 0 ; $i < scalar(@$data) ; $i++ ) {
my $datedue;
$calendars{$branchcode} = C4::Calendar->new( branchcode => $branchcode );
}
$calendar = $calendars{$branchcode};
- my $isHoliday = $calendar->isHoliday( split '/', $today->output('metric') );
+ my $isHoliday = $calendar->isHoliday( $tday, $tmonth, $tyear );
# Reassing datedue_days if -delay specified in commandline
$bigdebug and warn "Using commandline supplied delay : $delay" if ($delay);
( $datedue_days <= $today_days ) or next; # or it's not overdue, right?
$overdueItemsCounted++;
- my ( $amount, $type, $unitcounttotal, $unitcount ) = CalcFine( $data->[$i], $borrower->{'categorycode'}, $branchcode, undef, undef, $datedue, $today );
+ my ( $amount, $type, $unitcounttotal, $unitcount ) = CalcFine(
+ $data->[$i],
+ $borrower->{'categorycode'},
+ $branchcode,
+ dt_from_string($datedue->output('iso')),
+ dt_from_string($today->output('iso')),
+ );
# Reassign fine's amount if specified in command-line
$amount = $catamounts{$borrower->{'categorycode'}} if (defined $catamounts{$borrower->{'categorycode'}});
}
}
-my $numOverdueItems = scalar(@$data);
if ($verbose) {
print <<EOM;
Fines assessment -- $today_iso
my $date = C4::Dates->new( $issues->{'date_due'}, 'iso' );
my $due_date = $date->output('metric');
- # gets the placeholder message, and enqueues the letter
- my $letter = getletter( $module, $code );
- die "No letter found for type $type!... dying\n" unless $letter;
+ my $letter = C4::Letters::GetPreparedLetter(
+ module => $module,
+ letter_code => $code,
+ tables => {
+ borrowers => $issues->{'borrowernumber'},
+ biblio => $issues->{'biblionumber'},
+ biblioitems => $issues->{'biblionumber'}
+ },
+ );
- # covers basic variable parsing in letter
- $letter =
- C4::Letters::parseletter( $letter, 'borrowers',
- $issues->{'borrowernumber'} );
- $letter =
- C4::Letters::parseletter( $letter, 'biblio',
- $issues->{'biblionumber'} );
- $letter =
- C4::Letters::parseletter( $letter, 'biblioitems',
- $issues->{'biblionumber'} );
+ die "No letter found for type $type!... dying\n" unless $letter;
my $message_id = 0;
if ($outfile) {
use Data::Dumper;
use Time::HiRes qw/time/;
use POSIX qw/strftime ceil/;
+use Module::Load::Conditional qw(can_load);
sub usage {
pod2usage( -verbose => 2 );
my $linker_module =
"C4::Linker::" . ( C4::Context->preference("LinkerModule") || 'Default' );
-eval { eval "require $linker_module"; };
-if ($@) {
+unless ( can_load( modules => { $linker_module => undef } ) ) {
$linker_module = 'C4::Linker::Default';
- eval "require $linker_module";
-}
-if ($@) {
- die "Unable to load linker module. Aborting.";
+ unless ( can_load( modules => { $linker_module => undef } ) ) {
+ die "Unable to load linker module. Aborting.";
+ }
}
my $linker = $linker_module->new(
cat <<EOF
$scriptname
-Index Koha records by chunks. It is useful when some record causes errors and
-stop the indexation process. With this script, if indexation of one chunk fails,
-chunk is splitted in two or more chunks, and indexation continue on these chunks.
+Index Koha records by chunks. It is useful when a record causes errors and
+stops the indexing process. With this script, if indexing of one chunk fails,
+that chunk is split into two or more chunks, and indexing continues on these chunks.
rebuild_zebra.pl is called only once to export records. Splitting and indexing
is handled by this script (using yaz-marcdump and zebraidx).
+++ /dev/null
-#!/usr/bin/perl
-
-# This file is part of Koha.
-#
-# Copyright (C) 2007 LibLime
-# Parts Copyright BSZ 2011
-#
-# 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 this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-use strict;
-use warnings;
-BEGIN {
- # find Koha's Perl modules
- # test carefully before changing this
- use FindBin;
- eval { require "$FindBin::Bin/kohalib.pl" };
-}
-
-use C4::Context;
-use C4::ImportBatch;
-use C4::Matcher;
-use Getopt::Long;
-
-$| = 1;
-
-# command-line parameters
-my $encoding = "";
-my $match_bibs = 0;
-my $add_items = 0;
-my $input_file = "";
-my $batch_comment = "";
-my $want_help = 0;
-my $no_replace ;
-
-my $result = GetOptions(
- 'encoding:s' => \$encoding,
- 'file:s' => \$input_file,
- 'match-bibs:s' => \$match_bibs,
- 'add-items' => \$add_items,
- 'no-replace' => \$no_replace,
- 'comment:s' => \$batch_comment,
- 'h|help' => \$want_help
-);
-
-if ($encoding eq "") {
- $encoding = "utf8";
-}
-
-if (not $result or $input_file eq "" or $want_help) {
- print_usage();
- exit 0;
-}
-
-unless (-r $input_file) {
- die "$0: cannot open input file $input_file: $!\n";
-}
-
-my $dbh = C4::Context->dbh;
-$dbh->{AutoCommit} = 0;
-process_batch($input_file, $match_bibs, $add_items, $batch_comment);
-$dbh->commit();
-
-exit 0;
-
-sub process_batch {
- my ($input_file, $match_bibs, $add_items, $batch_comment) = @_;
-
- open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
- my $marc_records = "";
- $/ = "\035";
- my $num_input_records = 0;
- while (<IN>) {
- s/^\s+//;
- s/\s+$//;
- next unless $_; # skip if record has only whitespace, as might occur
- # if file includes newlines between each MARC record
- $marc_records .= $_; # FIXME - this sort of string concatenation
- # is probably rather inefficient
- $num_input_records++;
- }
- close IN;
-
- print "... staging MARC records -- please wait\n";
- my ($batch_id, $num_valid, $num_items, @import_errors) =
- BatchStageMarcRecords($encoding, $marc_records, $input_file, $batch_comment, '', $add_items, 0,
- 100, \&print_progress_and_commit);
- print "... finished staging MARC records\n";
-
- my $num_with_matches = 0;
- if ($match_bibs) {
- my $matcher = C4::Matcher->fetch($match_bibs) ;
- if (! defined $matcher) {
- $matcher = C4::Matcher->new('biblio');
- $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, '');
- $matcher->add_simple_required_check('245', 'a', -1, 0, '',
- '245', 'a', -1, 0, '');
- } else {
- SetImportBatchMatcher($batch_id, $match_bibs);
- }
- # set default record overlay behavior
- SetImportBatchOverlayAction($batch_id, ($no_replace) ? 'ignore' : 'replace');
- SetImportBatchNoMatchAction($batch_id, 'create_new');
- SetImportBatchItemAction($batch_id, 'always_add');
- print "... looking for matches with records already in database\n";
- $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher, 10, 100, \&print_progress_and_commit);
- print "... finished looking for matches\n";
- }
-
- my $num_invalid_bibs = scalar(@import_errors);
- print <<_SUMMARY_;
-
-MARC record staging report
-------------------------------------
-Input file: $input_file
-Number of input bibs: $num_input_records
-Number of valid bibs: $num_valid
-Number of invalid bibs: $num_invalid_bibs
-_SUMMARY_
- if ($match_bibs) {
- print "Number of bibs matched: $num_with_matches\n";
- } else {
- print "Incoming bibs not matched against existing bibs (--match-bibs option not supplied)\n";
- }
- if ($add_items) {
- print "Number of items parsed: $num_items\n";
- } else {
- print "No items parsed (--add-items option not supplied)\n";
- }
-
- print "\n";
- print "Batch number assigned: $batch_id\n";
- print "\n";
-}
-
-sub print_progress_and_commit {
- my $recs = shift;
- $dbh->commit();
- print "... processed $recs records\n";
-}
-
-sub print_usage {
- print <<_USAGE_;
-$0: stage MARC bib file into reservoir.
-
-Use this batch job to load a file of MARC bibliographic records
-(with optional item information) into the Koha reservoir.
-
-After running this program to stage your file, you can use
-either the batch job commit_biblios_file.pl or the Koha
-Tools option "Manage Staged MARC Records" to load the
-records into the main Koha database.
-
-Parameters:
- --file <file_name> name of input MARC bib file
- --encoding <encoding> encoding of MARC records, default is utf8.
- Other possible options are: MARC-8,
- ISO_5426, ISO_6937, ISO_8859-1, EUC-KR
- --match-bibs <match_id> use this option to match bibs
- in the file with bibs already in
- the database for future overlay.
- If <match_id> isn't defined, a default
- MARC21 ISBN & title match rule will be applied.
- --add-items use this option to specify that
- item data is embedded in the MARC
- bibs and should be parsed.
- --no-replace overlay action for bib record: default is to
- replace extant bib with the imported record.
- --comment <comment> optional comment to describe
- the record batch; if the comment
- has spaces in it, surround the
- comment with quotation marks.
- --help or -h show this message.
-_USAGE_
-}
--- /dev/null
+#!/usr/bin/perl
+
+# This file is part of Koha.
+#
+# Copyright (C) 2007 LibLime
+# Parts Copyright BSZ 2011
+# Parts Copyright C & P Bibliography Services 2012
+#
+# 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 this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+use strict;
+use warnings;
+BEGIN {
+ # find Koha's Perl modules
+ # test carefully before changing this
+ use FindBin;
+ eval { require "$FindBin::Bin/kohalib.pl" };
+}
+
+use C4::Context;
+use C4::ImportBatch;
+use C4::Matcher;
+use Getopt::Long;
+
+$| = 1;
+
+# command-line parameters
+my $record_type = "biblio";
+my $encoding = "";
+my $authorities = 0;
+my $match = 0;
+my $add_items = 0;
+my $input_file = "";
+my $batch_comment = "";
+my $want_help = 0;
+my $no_replace ;
+
+my $result = GetOptions(
+ 'encoding:s' => \$encoding,
+ 'file:s' => \$input_file,
+ 'match|match-bibs:s' => \$match,
+ 'add-items' => \$add_items,
+ 'no-replace' => \$no_replace,
+ 'comment:s' => \$batch_comment,
+ 'authorities' => \$authorities,
+ 'h|help' => \$want_help
+);
+
+$record_type = 'auth' if ($authorities);
+
+if ($encoding eq "") {
+ $encoding = "utf8";
+}
+
+if (not $result or $input_file eq "" or $want_help) {
+ print_usage();
+ exit 0;
+}
+
+unless (-r $input_file) {
+ die "$0: cannot open input file $input_file: $!\n";
+}
+
+my $dbh = C4::Context->dbh;
+$dbh->{AutoCommit} = 0;
+process_batch($input_file, $record_type, $match, $add_items, $batch_comment);
+$dbh->commit();
+
+exit 0;
+
+sub process_batch {
+ my ($input_file, $record_type, $match, $add_items, $batch_comment) = @_;
+
+ open IN, "<$input_file" or die "$0: cannot open input file $input_file: $!\n";
+ my $marc_records = "";
+ $/ = "\035";
+ my $num_input_records = 0;
+ while (<IN>) {
+ s/^\s+//;
+ s/\s+$//;
+ next unless $_; # skip if record has only whitespace, as might occur
+ # if file includes newlines between each MARC record
+ $marc_records .= $_; # FIXME - this sort of string concatenation
+ # is probably rather inefficient
+ $num_input_records++;
+ }
+ close IN;
+
+ print "... staging MARC records -- please wait\n";
+ my ($batch_id, $num_valid_records, $num_items, @import_errors) =
+ BatchStageMarcRecords($record_type, $encoding, $marc_records, $input_file, $batch_comment, '', $add_items, 0,
+ 100, \&print_progress_and_commit);
+ print "... finished staging MARC records\n";
+
+ my $num_with_matches = 0;
+ if ($match) {
+ my $matcher = C4::Matcher->fetch($match) ;
+ if (defined $matcher) {
+ SetImportBatchMatcher($batch_id, $match);
+ } elsif ($record_type eq 'biblio') {
+ $matcher = C4::Matcher->new($record_type);
+ $matcher->add_simple_matchpoint('isbn', 1000, '020', 'a', -1, 0, '');
+ $matcher->add_simple_required_check('245', 'a', -1, 0, '',
+ '245', 'a', -1, 0, '');
+ }
+ # set default record overlay behavior
+ SetImportBatchOverlayAction($batch_id, ($no_replace) ? 'ignore' : 'replace');
+ SetImportBatchNoMatchAction($batch_id, 'create_new');
+ SetImportBatchItemAction($batch_id, 'always_add');
+ print "... looking for matches with records already in database\n";
+ $num_with_matches = BatchFindDuplicates($batch_id, $matcher, 10, 100, \&print_progress_and_commit);
+ print "... finished looking for matches\n";
+ }
+
+ my $num_invalid_records = scalar(@import_errors);
+ print <<_SUMMARY_;
+
+MARC record staging report
+------------------------------------
+Input file: $input_file
+Record type: $record_type
+Number of input records: $num_input_records
+Number of valid records: $num_valid_records
+Number of invalid records: $num_invalid_records
+_SUMMARY_
+ if ($match) {
+ print "Number of records matched: $num_with_matches\n";
+ } else {
+ print "Incoming records not matched against existing records (--match option not supplied)\n";
+ }
+ if ($record_type eq 'biblio') {
+ if ($add_items) {
+ print "Number of items parsed: $num_items\n";
+ } else {
+ print "No items parsed (--add-items option not supplied)\n";
+ }
+ }
+
+ print "\n";
+ print "Batch number assigned: $batch_id\n";
+ print "\n";
+}
+
+sub print_progress_and_commit {
+ my $recs = shift;
+ $dbh->commit();
+ print "... processed $recs records\n";
+}
+
+sub print_usage {
+ print <<_USAGE_;
+$0: stage MARC file into reservoir.
+
+Use this batch job to load a file of MARC bibliographic
+(with optional item information) or authority records into
+the Koha reservoir.
+
+After running this program to stage your file, you can use
+either the batch job commit_file.pl or the Koha
+Tools option "Manage Staged MARC Records" to load the
+records into the main Koha database.
+
+Parameters:
+ --file <file_name> name of input MARC bib file
+ --authorities stage authority records instead of bibs
+ --encoding <encoding> encoding of MARC records, default is utf8.
+ Other possible options are: MARC-8,
+ ISO_5426, ISO_6937, ISO_8859-1, EUC-KR
+ --match <match_id> use this option to match records
+ in the file with records already in
+ the database for future overlay.
+ If <match_id> isn't defined, a default
+ MARC21 ISBN & title match rule will be applied
+ for bib imports.
+ --add-items use this option to specify that
+ item data is embedded in the MARC
+ bibs and should be parsed.
+ --no-replace overlay action for record: default is to
+ replace extant with the imported record.
+ --comment <comment> optional comment to describe
+ the record batch; if the comment
+ has spaces in it, surround the
+ comment with quotation marks.
+ --help or -h show this message.
+_USAGE_
+}
# 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 Modern::Perl;
use C4::Context;
# WARNING: Any other tested YAML library fails to work properly in this
$YAML::Syck::ImplicitTyping = 1;
+
sub set_lang {
my ($self, $lang) = @_;
# Get all available language codes
opendir $fh, $self->{path_po};
my @langs = map { ($_) =~ /(.*)-i-opac/ }
- grep { $_ =~ /.*-opac-/ } readdir($fh);
+ grep { $_ =~ /.*-opac-t-prog/ } readdir($fh);
closedir $fh;
$self->{langs} = \@langs;
# Map for both interfaces opac/intranet
- $self->{interface} = {
- opac => {
- dir => $context->config('opachtdocs') . '/prog',
+ my $opachtdocs = $context->config('opachtdocs');
+ $self->{interface} = [
+ {
+ name => 'OPAC prog',
+ dir => "$opachtdocs/prog",
suffix => '-i-opac-t-prog-v-3006000.po',
},
- intranet => {
+ {
+ name => 'Intranet prog',
dir => $context->config('intrahtdocs') . '/prog',
suffix => '-i-staff-t-prog-v-3006000.po',
- }
- };
+ },
+ ];
+
+ # Alternate opac themes
+ opendir $fh, $context->config('opachtdocs');
+ for ( grep { not /^\.|\.\.|prog|lib$/ } readdir($fh) ) {
+ push @{$self->{interface}}, {
+ name => "OPAC $_",
+ dir => "$opachtdocs/$_",
+ suffix => "-opac-$_.po",
+ };
+ }
bless $self, $class;
}
my $self = shift;
# Write .po entries into a file put in Koha standard po directory
Locale::PO->save_file_fromhash( $self->po_filename, $self->{po} );
- print "Saved in file: ", $self->po_filename, "\n" if $self->{verbose};
+ say "Saved in file: ", $self->po_filename if $self->{verbose};
}
sub install_tmpl {
my $self = shift;
- print "Install templates\n" if $self->{verbose};
- while ( my ($interface, $tmpl) = each %{$self->{interface}} ) {
+ say "Install templates" if $self->{verbose};
+ for my $trans ( @{$self->{interface}} ) {
print
- " Install templates '$interface\n",
- " From: $tmpl->{dir}/en/\n",
- " To : $tmpl->{dir}/$self->{lang}\n",
- " With: $self->{path_po}/$self->{lang}$tmpl->{suffix}\n"
+ " Install templates '$trans->{name}'\n",
+ " From: $trans->{dir}/en/\n",
+ " To : $trans->{dir}/$self->{lang}\n",
+ " With: $self->{path_po}/$self->{lang}$trans->{suffix}\n"
if $self->{verbose};
- my $lang_dir = "$tmpl->{dir}/$self->{lang}";
+ my $lang_dir = "$trans->{dir}/$self->{lang}";
mkdir $lang_dir unless -d $lang_dir;
system
"$self->{process} install " .
- "-i $tmpl->{dir}/en/ " .
- "-o $tmpl->{dir}/$self->{lang} ".
- "-s $self->{path_po}/$self->{lang}$tmpl->{suffix} -r"
+ "-i $trans->{dir}/en/ " .
+ "-o $trans->{dir}/$self->{lang} ".
+ "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r"
}
}
sub update_tmpl {
my $self = shift;
- print "Update templates\n" if $self->{verbose};
- while ( my ($interface, $tmpl) = each %{$self->{interface}} ) {
+ say "Update templates" if $self->{verbose};
+ for my $trans ( @{$self->{interface}} ) {
print
- " Update templates '$interface'\n",
- " From: $tmpl->{dir}/en/\n",
- " To : $self->{path_po}/$self->{lang}$tmpl->{suffix}\n"
+ " Update templates '$trans->{name}'\n",
+ " From: $trans->{dir}/en/\n",
+ " To : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
if $self->{verbose};
- my $lang_dir = "$tmpl->{dir}/$self->{lang}";
+ my $lang_dir = "$trans->{dir}/$self->{lang}";
mkdir $lang_dir unless -d $lang_dir;
system
"$self->{process} update " .
- "-i $tmpl->{dir}/en/ " .
- "-s $self->{path_po}/$self->{lang}$tmpl->{suffix} -r"
+ "-i $trans->{dir}/en/ " .
+ "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r"
}
}
sub create_prefs {
my $self = shift;
+ if ( -e $self->po_filename ) {
+ say "Preferences .po file already exists. Delete it if you want to recreate it.";
+ return;
+ }
$self->get_po_from_prefs();
$self->save_po();
}
sub create_tmpl {
my $self = shift;
- print "Create templates\n" if $self->{verbose};
- while ( my ($interface, $tmpl) = each %{$self->{interface}} ) {
+ say "Create templates\n" if $self->{verbose};
+ for my $trans ( @{$self->{interface}} ) {
print
- " Create templates .po files for '$interface'\n",
- " From: $tmpl->{dir}/en/\n",
- " To : $self->{path_po}/$self->{lang}$tmpl->{suffix}\n"
+ " Create templates .po files for '$trans->{name}'\n",
+ " From: $trans->{dir}/en/\n",
+ " To : $self->{path_po}/$self->{lang}$trans->{suffix}\n"
if $self->{verbose};
system
"$self->{process} create " .
- "-i $tmpl->{dir}/en/ " .
- "-s $self->{path_po}/$self->{lang}$tmpl->{suffix} -r"
+ "-i $trans->{dir}/en/ " .
+ "-s $self->{path_po}/$self->{lang}$trans->{suffix} -r"
}
}
}
);
-my $authid = $query->param('authid');
+my $authid = $query->param('authid');
my $record = GetAuthority( $authid );
if ( ! $record ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
my $authtypecode = &GetAuthTypeCode( $authid );
if ($display_hierarchy){
- my $trees=BuildUnimarcHierarchies($authid);
- my @trees = split /;/,$trees ;
- push @trees,$trees unless (@trees);
- my @loophierarchies;
- foreach my $tree (@trees){
- my @tree=split /,/,$tree;
- push @tree,$tree unless (@tree);
- my $cnt=0;
- my @loophierarchy;
- foreach my $element (@tree){
- my $cell;
- my $elementdata = GetAuthority($element);
- push @loophierarchy, BuildUnimarcHierarchy($elementdata,"child".$cnt, $authid);
- $cnt++;
- }
- push @loophierarchies, { 'loopelement' =>\@loophierarchy};
- }
- $template->param(
- 'displayhierarchy' => $display_hierarchy,
- 'loophierarchies' =>\@loophierarchies,
- );
+ $template->{VARS}->{'displayhierarchy'} = $display_hierarchy;
+ $template->{VARS}->{'loophierarchies'} = GenerateHierarchy($authid);
}
+
my $count = CountUsage($authid);
# loop through each subfield
for my $i ( 0 .. $#subf ) {
- $subf[$i][0] = "@" unless $subf[$i][0];
+ $subf[$i][0] = "@" unless defined $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/;
}
output_html_with_http_headers $query, $cookie, $template->output;
-
# Serial Collection
my @sc_fields = $record->field(955);
+my @lc_fields = $marcflavour eq 'UNIMARC'
+ ? $record->field(930)
+ : $record->field(852);
my @serialcollections = ();
foreach my $sc_field (@sc_fields) {
$row_data{text} = $sc_field->subfield('r');
$row_data{branch} = $sc_field->subfield('9');
+ foreach my $lc_field (@lc_fields) {
+ $row_data{itemcallnumber} = $marcflavour eq 'UNIMARC'
+ ? $lc_field->subfield('a') # 930$a
+ : $lc_field->subfield('h') # 852$h
+ if ($sc_field->subfield('5') eq $lc_field->subfield('5'));
+ }
if ($row_data{text} && $row_data{branch}) {
- push (@serialcollections, \%row_data);
+ push (@serialcollections, \%row_data);
}
}
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
my $imagenumber = $query->param('imagenumber');
-my ( $count, $biblio ) = GetBiblio($biblionumber);
+my $biblio = GetBiblio($biblionumber);
if ( C4::Context->preference("OPACLocalCoverImages") ) {
my @images = ListImagesForBiblio($biblionumber);
use C4::Circulation;
use C4::Members;
use Koha::DateUtils;
+use MARC::Record;
use C4::Output;
+use C4::Charset qw(StripNonXmlChars);
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my $itemtypes = GetItemTypes();
# get the record
-my $order = $query->param('order') || '';
-if ( $order eq '' ) {
- $order = "date_due desc";
- $template->param( orderbydate => 1 );
-}
-
+my $order = $query->param('order') || '';
if ( $order eq 'title' ) {
$template->param( orderbytitle => 1 );
}
-
-if ( $order eq 'author' ) {
+elsif ( $order eq 'author' ) {
$template->param( orderbyauthor => 1 );
}
-
-my $limit = $query->param('limit') || 50;
-if ( $limit eq 'full' ) {
- $limit = 0;
-}
else {
- $limit = 50;
+ $order = "date_due desc";
+ $template->param( orderbydate => 1 );
}
-my ( $issues ) = GetAllIssues( $borrowernumber, $order, $limit );
-
-
-my @loop_reading;
-
-foreach my $issue (@{$issues} ) {
- my %line;
-
- my $record = GetMarcBiblio($issue->{'biblionumber'});
-
- # XISBN Stuff
- my $isbn = GetNormalizedISBN($issue->{'isbn'});
- $line{normalized_isbn} = $isbn;
- $line{biblionumber} = $issue->{'biblionumber'};
- $line{title} = $issue->{'title'};
- $line{author} = $issue->{'author'};
- $line{itemcallnumber} = $issue->{'itemcallnumber'};
- $line{date_due} = $issue->{'date_due'};
- $line{returndate} = $issue->{'returndate'};
- $line{volumeddesc} = $issue->{'volumeddesc'};
- $issue->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $issue->{'itype'} : $issue->{'itemtype'};
- if($issue->{'itemtype'}) {
- $line{'description'} = $itemtypes->{ $issue->{'itemtype'} }->{'description'};
- $line{imageurl} = getitemtypeimagelocation( 'opac', $itemtypes->{ $issue->{'itemtype'} }->{'imageurl'} );
+
+my $limit = $query->param('limit');
+$limit = ( $limit eq 'full' ) ? 0 : 50;
+
+my $issues = GetAllIssues( $borrowernumber, $order, $limit );
+
+my $itype_attribute =
+ ( C4::Context->preference('item-level_itypes') ) ? 'itype' : 'itemtype';
+
+my $opac_summary_html = C4::Context->preference('OPACMySummaryHTML');
+foreach my $issue ( @{$issues} ) {
+ $issue->{normalized_isbn} = GetNormalizedISBN( $issue->{isbn} );
+ if ( $issue->{$itype_attribute} ) {
+ $issue->{description} =
+ $itemtypes->{ $issue->{$itype_attribute} }->{description};
+ $issue->{imageurl} =
+ getitemtypeimagelocation( 'opac',
+ $itemtypes->{ $issue->{$itype_attribute} }->{imageurl} );
+ }
+ if ( $issue->{marcxml} ) {
+ my $marcxml = StripNonXmlChars( $issue->{marcxml} );
+ my $marc_rec =
+ MARC::Record::new_from_xml( $marcxml, 'utf8',
+ C4::Context->preference('marcflavour') );
+ $issue->{subtitle} =
+ GetRecordValue( 'subtitle', $marc_rec, $issue->{frameworkcode} );
}
# 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;
+ if ($opac_summary_html) {
+ my $my_summary_html = $opac_summary_html;
+ $issue->{author}
+ ? $my_summary_html =~ s/{AUTHOR}/$issue->{author}/g
+ : $my_summary_html =~ s/{AUTHOR}//g;
+ my $title = $issue->{title};
+ $title =~ s/\/+$//; # remove trailing slash
+ $title =~ s/\s+$//; # remove trailing space
+ $title
+ ? $my_summary_html =~ s/{TITLE}/$title/g
+ : $my_summary_html =~ s/{TITLE}//g;
+ $issue->{normalized_isbn}
+ ? $my_summary_html =~ s/{ISBN}/$issue->{normalized_isbn}/g
+ : $my_summary_html =~ s/{ISBN}//g;
+ $issue->{biblionumber}
+ ? $my_summary_html =~ s/{BIBLIONUMBER}/$issue->{biblionumber}/g
+ : $my_summary_html =~ s/{BIBLIONUMBER}//g;
+ $issue->{MySummaryHTML} = $my_summary_html;
}
- push( @loop_reading, \%line );
- $line{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($issue->{'biblionumber'}));
}
if (C4::Context->preference('BakerTaylorEnabled')) {
}
$template->param(
- READING_RECORD => \@loop_reading,
+ READING_RECORD => $issues,
limit => $limit,
showfulllink => 1,
- readingrecview => 1,
- count => scalar @loop_reading,
- OPACMySummaryHTML => (C4::Context->preference("OPACMySummaryHTML")) ? 1 : 0,
+ readingrecview => 1,
+ OPACMySummaryHTML => $opac_summary_html ? 1 : 0,
);
output_html_with_http_headers $query, $cookie, $template->output;
#
if ( $query->param('place_reserve') ) {
my $notes = $query->param('notes');
- my $canreserve=0;
+ my $reserve_cnt = 0;
+ if ($MAXIMUM_NUMBER_OF_RESERVES) {
+ $reserve_cnt = GetReservesFromBorrowernumber( $borrowernumber );
+ }
# List is composed of alternating biblio/item/branch
my $selectedItems = $query->param('selecteditems');
while (@selectedItems) {
my $biblioNum = shift(@selectedItems);
my $itemNum = shift(@selectedItems);
- my $branch = shift(@selectedItems); # i.e., branch code, not name
+ my $branch = shift(@selectedItems); # i.e., branch code, not name
+
+ my $canreserve = 0;
my $singleBranchMode = C4::Context->preference("singleBranchMode");
- if ($singleBranchMode || ! $OPACChooseBranch) { # single branch mode or disabled user choosing
+ if ( $singleBranchMode || !$OPACChooseBranch )
+ { # single branch mode or disabled user choosing
$branch = $borr->{'branchcode'};
}
- #item may belong to a host biblio, if yes change biblioNum to hosts bilbionumber
- if ($itemNum ne '') {
- my $hostbiblioNum = GetBiblionumberFromItemnumber($itemNum);
- if ($hostbiblioNum ne $biblioNum) {
- $biblioNum = $hostbiblioNum;
- }
- }
+#item may belong to a host biblio, if yes change biblioNum to hosts bilbionumber
+ if ( $itemNum ne '' ) {
+ my $hostbiblioNum = GetBiblionumberFromItemnumber($itemNum);
+ if ( $hostbiblioNum ne $biblioNum ) {
+ $biblioNum = $hostbiblioNum;
+ }
+ }
my $biblioData = $biblioDataHash{$biblioNum};
my $found;
- # Check for user supplied reserve date
- my $startdate;
- if (
- C4::Context->preference( 'AllowHoldDateInFuture' ) &&
- C4::Context->preference( 'OPACAllowHoldDateInFuture' )
- ) {
- $startdate = $query->param("reserve_date_$biblioNum");
- }
-
- my $expiration_date = $query->param("expiration_date_$biblioNum");
+ # Check for user supplied reserve date
+ my $startdate;
+ if ( C4::Context->preference('AllowHoldDateInFuture')
+ && C4::Context->preference('OPACAllowHoldDateInFuture') )
+ {
+ $startdate = $query->param("reserve_date_$biblioNum");
+ }
+
+ my $expiration_date = $query->param("expiration_date_$biblioNum");
- # If a specific item was selected and the pickup branch is the same as the
- # holdingbranch, force the value $rank and $found.
+ # If a specific item was selected and the pickup branch is the same as the
+ # holdingbranch, force the value $rank and $found.
my $rank = $biblioData->{rank};
- if ($itemNum ne ''){
- $canreserve = 1 if CanItemBeReserved($borrowernumber,$itemNum);
+ if ( $itemNum ne '' ) {
+ $canreserve = 1 if CanItemBeReserved( $borrowernumber, $itemNum );
$rank = '0' unless C4::Context->preference('ReservesNeedReturns');
my $item = GetItem($itemNum);
- if ( $item->{'holdingbranch'} eq $branch ){
- $found = 'W' unless C4::Context->preference('ReservesNeedReturns');
+ if ( $item->{'holdingbranch'} eq $branch ) {
+ $found = 'W'
+ unless C4::Context->preference('ReservesNeedReturns');
}
}
else {
- $canreserve = 1 if CanBookBeReserved($borrowernumber,$biblioNum);
+ $canreserve = 1 if CanBookBeReserved( $borrowernumber, $biblioNum );
+
# Inserts a null into the 'itemnumber' field of 'reserves' table.
$itemNum = undef;
}
+ if ( $MAXIMUM_NUMBER_OF_RESERVES
+ && $reserve_cnt >= $MAXIMUM_NUMBER_OF_RESERVES )
+ {
+ $canreserve = 0;
+ }
+
# Here we actually do the reserveration. Stage 3.
- AddReserve($branch, $borrowernumber, $biblioNum, 'a', [$biblioNum], $rank, $startdate, $expiration_date, $notes,
- $biblioData->{'title'}, $itemNum, $found) if ($canreserve);
+ if ($canreserve) {
+ AddReserve(
+ $branch, $borrowernumber,
+ $biblioNum, 'a',
+ [$biblioNum], $rank,
+ $startdate, $expiration_date,
+ $notes, $biblioData->{title},
+ $itemNum, $found
+ );
+ ++$reserve_cnt;
+ }
}
print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds");
$noreserves = 1;
$template->param( too_much_oweing => $amount );
}
-if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} eq 1) ) {
+if ( $borr->{gonenoaddress} && ($borr->{gonenoaddress} == 1) ) {
$noreserves = 1;
$template->param(
message => 1,
GNA => 1
);
}
-if ( $borr->{lost} && ($borr->{lost} eq 1) ) {
+if ( $borr->{lost} && ($borr->{lost} == 1) ) {
$noreserves = 1;
$template->param(
message => 1,
my $pasarParams = '';
my $j = 0;
for (keys %$params) {
- my @pasarParam = split("\0", $params->{$_});
+ my @pasarParam = $cgi->param($_);
for my $paramValue(@pasarParam) {
$pasarParams .= '&' if ($j > 0);
$pasarParams .= $_ . '=' . $paramValue;
}
my @allowed_sortby = qw /acqdate_asc acqdate_dsc author_az author_za call_number_asc call_number_dsc popularity_asc popularity_dsc pubdate_asc pubdate_dsc relevance title_az title_za/;
-@sort_by = split("\0",$params->{'sort_by'}) if $params->{'sort_by'};
+@sort_by = $cgi->param('sort_by');
$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
foreach my $sort (@sort_by) {
if ( $sort ~~ @allowed_sortby ) {
$template->param('sort_by' => $sort_by[0]);
# Use the servers defined, or just search our local catalog(default)
-my @servers;
-@servers = split("\0",$params->{'server'}) if $params->{'server'};
+my @servers = $cgi->param('server');
unless (@servers) {
#FIXME: this should be handled using Context.pm
@servers = ("biblioserver");
# operators include boolean and proximity operators and are used
# to evaluate multiple operands
-my @operators;
-@operators = split("\0",$params->{'op'}) if $params->{'op'};
+my @operators = $cgi->param('op');
# indexes are query qualifiers, like 'title', 'author', etc. They
# can be single or multiple parameters separated by comma: kw,right-Truncation
-my @indexes;
-@indexes = split("\0",$params->{'idx'}) if $params->{'idx'};
+my @indexes = $cgi->param('idx');
# if a simple index (only one) display the index used in the top search box
if ($indexes[0] && !$indexes[1]) {
$template->param("ms_".$indexes[0] => 1);
}
# an operand can be a single term, a phrase, or a complete ccl query
-my @operands;
-@operands = split("\0",$params->{'q'}) if $params->{'q'};
+my @operands = $cgi->param('q');
$template->{VARS}->{querystring} = join(' ', @operands);
}
# limits are use to limit to results to a pre-defined category such as branch or language
-my @limits;
-@limits = split("\0",$params->{'limit'}) if $params->{'limit'};
+my @limits = $cgi->param('limit');
if($params->{'multibranchlimit'}) {
push @limits, '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
$pasarParams .= '&simple_query=' . $simple_query;
$pasarParams .= '&query_type=' . $query_type if ($query_type);
eval {
- ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan);
+ ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1);
};
}
# This sorts the facets into alphabetical order
$hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
$template->param(
SEARCH_RESULTS => \@newresults,
- OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay") eq "itemdetails"?1:0),
+ OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
suppress_result_number => $hide,
);
if (C4::Context->preference("OPACLocalCoverImages")){
$template->param('GoogleIndicTransliteration' => 1);
}
-$template->{VARS}->{DidYouMeanFromAuthorities} = C4::Context->preference('DidYouMeanFromAuthorities');
+$template->{VARS}->{DidYouMean} = C4::Context->preference('OPACdidyoumean') =~ m/enable/;
$template->param( borrowernumber => $borrowernumber);
output_with_http_headers $cgi, $cookie, $template->output, $content_type;
use C4::Output qw(:html :ajax pagination_bar);
use C4::Scrubber;
use C4::Biblio;
-use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag);
+use C4::Tags qw(add_tag get_approval_rows get_tag_rows remove_tag stratify_tags);
use Data::Dumper;
$arghash->{biblionumber} = $arg;
}
$results = get_approval_rows($arghash);
-
+ stratify_tags(10, $results); # work out the differents sizes for things
my $count = scalar @$results;
$template->param(TAGLOOP_COUNT => $count, mine => $mine);
- # Here we make a halfhearted attempt to separate the tags into "strata" based on weight_total
- # FIXME: code4lib probably has a better algorithm, iirc
- # FIXME: when we get a better algorithm, move to C4
- my $maxstrata = 5;
- my $strata = 1;
- my $previous = 0;
- my $chunk = ($count/$maxstrata)/2;
- my $total = 0;
- my %cloud;
- foreach (reverse @$results) {
- my $current = $_->{weight_total};
- $total++;
- $cloud{$strata}++;
- if ($current == $previous) {
- $_->{cloudweight} = $strata;
- next;
- }
- if ($strata < $maxstrata and
- ($cloud{$strata} > $chunk or
- $count-$total <= $maxstrata-$strata)) {
- $strata++;
- }
- $_->{cloudweight} = $strata;
- $previous = $current;
- }
}
(scalar @errors ) and $template->param(ERRORS => \@errors);
my @orderedresult = sort { uc($a->{'term'}) cmp uc($b->{'term'}) } @$results;
my $report_id = $query->param('id');
my $report_name = $query->param('name');
-my $cache;
-my $sql;
-my $type;
-my $notes;
-my $cache_expiry;
-my $public;
+my $report_rec = get_saved_report( $report_name ? { 'name' => $report_name } : { 'id' => $report_id } );
+die "Sorry this report is not public\n" unless $report_rec->{public};
-( $sql, $type, $report_name, $notes, $cache_expiry, $public, $report_id ) =
- get_saved_report($report_name ? { 'name' => $report_name } : { 'id' => $report_id } );
-die "Sorry this report is not public\n" unless $public;
-if (Koha::Cache->is_cache_active) {
- $cache = Koha::Cache->new(
- );
- my $page = $cache->get_from_cache("opac:report:$report_id");
- if ($page) {
- print $query->header;
- print $page;
- exit;
- }
+my $cache_active = Koha::Cache->is_cache_active;
+my ($cache_key, $cache, $json_text);
+if ($cache_active) {
+ $cache_key = "opac:report:".($report_name ? "name:$report_name" : "id:$report_id");
+ $cache = Koha::Cache->new();
+ $json_text = $cache->get_from_cache($cache_key);
}
-print $query->header;
-if ($sql) {
+unless ($json_text) {
my $offset = 0;
my $limit = C4::Context->preference("SvcMaxReportRows") || 10;
- my ( $sth, $errors ) = execute_query( $sql, $offset, $limit );
- my $lines = $sth->fetchall_arrayref;
- my $json_text = to_json($lines);
- print $json_text;
+ my ( $sth, $errors ) = execute_query( $report_rec->{savedsql}, $offset, $limit );
+ if ($sth) {
+ my $lines = $sth->fetchall_arrayref;
+ $json_text = to_json($lines);
- if (Koha::Cache->is_cache_active) {
- $cache->set_in_cache( "opac:report:$report_id", $json_text, $cache_expiry );
+ if ($cache_active) {
+ $cache->set_in_cache( $cache_key, $json_text, $report_rec->{cache_expiry} );
+ }
+ }
+ else {
+ $json_text = to_json($errors);
}
}
+
+print $query->header;
+print $json_text;
}
);
-unless ( C4::Context->preference('DidYouMeanFromAuthorities') ) {
+my @plugins = ();
+
+my $pluginsconfig = from_json(C4::Context->preference('OPACdidyoumean') || '[]');
+
+foreach my $plugin (@$pluginsconfig) {
+ push @plugins, $plugin->{name} if ($plugin->{enabled});
+}
+
+unless ( @plugins ) {
print $query->header;
exit;
}
-my $suggestor = Koha::SuggestionEngine->new( { plugins => ('AuthorityFile') } );
+my $suggestor = Koha::SuggestionEngine->new( { plugins => \@plugins } );
my $suggestions =
$suggestor->get_suggestions( { search => $search, count => $count } );
my $referer = $input->referer();
my $phase = $input->param('phase') || 'View Dictionary';
-my $area = $input->param('areas') || '';
-my $no_html = 0; # this will be set if we dont want to print out an html::template
-my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
- {
- template_name => "reports/dictionary.tmpl",
+my $definition_name = $input->param('definition_name');
+my $definition_description = $input->param('definition_description');
+my $area = $input->param('area') || '';
+my $no_html = 0; # this will be set if we dont want to print out an html::template
+my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+ { template_name => "reports/dictionary.tmpl",
query => $input,
type => "intranet",
authnotrequired => 0,
);
if ($phase eq 'View Dictionary'){
- # view the dictionary we use to set up abstract variables such as all borrowers over fifty who live in a certain town
- my $areas = get_report_areas();
- foreach (@{ $areas }) {
- $_->{selected} = 1 if $_->{id} eq $area; # mark active area
- }
- my $definitions = get_from_dictionary($area);
- $template->param( 'areas' => $areas ,
- 'start_dictionary' => 1,
- 'definitions' => $definitions,
- );
-}
-elsif ($phase eq 'Add New Definition'){
- # display form allowing them to add a new definition
- $template->param( 'new_dictionary' => 1,
- );
+ # view the dictionary we use to set up abstract variables such as all borrowers over fifty who live in a certain town
+ my $definitions = get_from_dictionary($area);
+ $template->param(
+ 'areas'=> areas(),
+ 'start_dictionary' => 1,
+ 'definitions' => $definitions,
+ );
+} elsif ( $phase eq 'Add New Definition' ) {
+
+ # display form allowing them to add a new definition
+ $template->param( 'new_dictionary' => 1, );
}
-elsif ($phase eq 'New Term step 2'){
- # Choosing the area
- my $areas = C4::Reports::Guided::get_report_areas();
- my $definition_name=$input->param('definition_name');
- my $definition_description=$input->param('definition_description');
- $template->param( 'step_2' => 1,
- 'areas' => $areas,
- 'definition_name' => $definition_name,
- 'definition_description' => $definition_description,
- );
+elsif ( $phase eq 'New Term step 2' ) {
+
+ # Choosing the area
+ $template->param(
+ 'step_2' => 1,
+ 'areas' => areas(),
+ 'definition_name' => $definition_name,
+ 'definition_description' => $definition_description,
+ );
}
-elsif ($phase eq 'New Term step 3'){
- # Choosing the columns
- my $area = $input->param('areas');
- my $columns = get_columns($area,$input);
- my $definition_name=$input->param('definition_name');
- my $definition_description=$input->param('definition_description');
- $template->param( 'step_3' => 1,
- 'area' => $area,
- 'columns' => $columns,
- 'definition_name' => $definition_name,
- 'definition_description' => $definition_description,
- );
+elsif ( $phase eq 'New Term step 3' ) {
+
+ # Choosing the columns
+ my $columns = get_columns( $area, $input );
+ $template->param(
+ 'step_3' => 1,
+ 'area' => $area,
+ 'columns' => $columns,
+ 'definition_name' => $definition_name,
+ 'definition_description' => $definition_description,
+ );
}
-elsif ($phase eq 'New Term step 4'){
- # Choosing the values
- my $area=$input->param('area');
- my $definition_name=$input->param('definition_name');
- my $definition_description=$input->param('definition_description');
- my @columns = $input->param('columns');
- my $columnstring = join (',',@columns);
- my @column_loop;
- foreach my $column (@columns){
- my %tmp_hash;
- $tmp_hash{'name'}=$column;
- my $type =get_column_type($column);
- if ($type eq 'distinct'){
- my $values = get_distinct_values($column);
- $tmp_hash{'values'} = $values;
- $tmp_hash{'distinct'} = 1;
-
- }
- if ($type eq 'DATE' || $type eq 'DATETIME'){
- $tmp_hash{'date'}=1;
- }
- if ($type eq 'TEXT' || $type eq 'MEDIUMTEXT'){
- $tmp_hash{'text'}=1;
- }
-# else {
-# warn $type;#
-# }
- push @column_loop,\%tmp_hash;
- }
+elsif ( $phase eq 'New Term step 4' ) {
+
+ # Choosing the values
+ my @columns = $input->param('columns');
+ my $columnstring = join( ',', @columns );
+ my @column_loop;
+ foreach my $column (@columns) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = $column;
+ my $type = get_column_type($column);
+ if ( $type eq 'distinct' ) {
+ my $values = get_distinct_values($column);
+ $tmp_hash{'values'} = $values;
+ $tmp_hash{'distinct'} = 1;
+
+ }
+ if ( $type eq 'DATE' || $type eq 'DATETIME' ) {
+ $tmp_hash{'date'} = 1;
+ }
+ if ( $type eq 'TEXT' ) {
+ $tmp_hash{'text'} = 1;
+ }
+
+ # else {
+ # warn $type;#
+ # }
+ push @column_loop, \%tmp_hash;
+ }
$template->param( 'step_4' => 1,
'area' => $area,
);
}
-elsif ($phase eq 'New Term step 5'){
- # Confirmation screen
- my $areas = C4::Reports::Guided::get_report_areas();
- my $area = $input->param('area');
- my $areaname = $areas->[$area - 1]->{'name'};
- my $columnstring = $input->param('columnstring');
- my $definition_name=$input->param('definition_name');
- my $definition_description=$input->param('definition_description');
- my @criteria = $input->param('criteria_column');
- my $query_criteria;
- my @criteria_loop;
- foreach my $crit (@criteria) {
- my $value = $input->param( $crit . "_value" );
- if ($value) {
- my %tmp_hash;
- $tmp_hash{'name'}=$crit;
- $tmp_hash{'value'} = $value;
- push @criteria_loop,\%tmp_hash;
- if ($value =~ C4::Dates->regexp(C4::Context->preference('dateformat'))) {
- my $date = C4::Dates->new($value);
- $value = $date->output("iso");
- }
- $query_criteria .= " AND $crit='$value'";
- }
- $value = $input->param( $crit . "_start_value" );
- if ($value) {
- my %tmp_hash;
- $tmp_hash{'name'}="$crit Start";
- $tmp_hash{'value'} = $value;
- push @criteria_loop,\%tmp_hash;
- if ($value =~ C4::Dates->regexp(C4::Context->preference('dateformat'))) {
- my $date = C4::Dates->new($value);
- $value = $date->output("iso");
- }
- $query_criteria .= " AND $crit >= '$value'";
- }
- $value = $input->param( $crit . "_end_value" );
- if ($value) {
- my %tmp_hash;
- $tmp_hash{'name'}="$crit End";
- $tmp_hash{'value'} = $value;
- push @criteria_loop,\%tmp_hash;
- if ($value =~ C4::Dates->regexp(C4::Context->preference('dateformat'))) {
- my $date = C4::Dates->new($value);
- $value = $date->output("iso");
- }
- $query_criteria .= " AND $crit <= '$value'";
- }
- }
- $template->param( 'step_5' => 1,
- 'area' => $area,
- 'areaname' => $areaname,
- 'definition_name' => $definition_name,
- 'definition_description' => $definition_description,
- 'query' => $query_criteria,
- 'columnstring' => $columnstring,
- 'criteria_loop' => \@criteria_loop,
- );
+elsif ( $phase eq 'New Term step 5' ) {
+ # Confirmation screen
+ my $columnstring = $input->param('columnstring');
+ my @criteria = $input->param('criteria_column');
+ my $query_criteria;
+ my @criteria_loop;
+
+ foreach my $crit (@criteria) {
+ my $value = $input->param( $crit . "_value" );
+ if ($value) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = $crit;
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
+ my $date = C4::Dates->new($value);
+ $value = $date->output("iso");
+ }
+ $query_criteria .= " AND $crit='$value'";
+ }
+ $value = $input->param( $crit . "_start_value" );
+ if ($value) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = "$crit Start";
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
+ my $date = C4::Dates->new($value);
+ $value = $date->output("iso");
+ }
+ $query_criteria .= " AND $crit >= '$value'";
+ }
+ $value = $input->param( $crit . "_end_value" );
+ if ($value) {
+ my %tmp_hash;
+ $tmp_hash{'name'} = "$crit End";
+ $tmp_hash{'value'} = $value;
+ push @criteria_loop, \%tmp_hash;
+ if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
+ my $date = C4::Dates->new($value);
+ $value = $date->output("iso");
+ }
+ $query_criteria .= " AND $crit <= '$value'";
+ }
+ }
+ my %report_areas = map @$_, get_report_areas();
+ $template->param(
+ 'step_5' => 1,
+ 'area' => $area,
+ 'areaname' => $report_areas{$area},
+ 'definition_name' => $definition_name,
+ 'definition_description' => $definition_description,
+ 'query' => $query_criteria,
+ 'columnstring' => $columnstring,
+ 'criteria_loop' => \@criteria_loop,
+ );
}
-elsif ($phase eq 'New Term step 6'){
- # Saving
- my $area = $input->param('area');
- my $definition_name=$input->param('definition_name');
- my $definition_description=$input->param('definition_description');
- my $sql=$input->param('sql');
- save_dictionary($definition_name,$definition_description,$sql,$area);
- $no_html=1;
- print $input->redirect("/cgi-bin/koha/reports/dictionary.pl?phase=View%20Dictionary");
-
+elsif ( $phase eq 'New Term step 6' ) {
+ # Saving
+ my $area = $input->param('area');
+ my $sql = $input->param('sql');
+ save_dictionary( $definition_name, $definition_description, $sql, $area );
+ $no_html = 1;
+ print $input->redirect("/cgi-bin/koha/reports/dictionary.pl?phase=View%20Dictionary");
+
+} elsif ( $phase eq 'Delete Definition' ) {
+ $no_html = 1;
+ my $id = $input->param('id');
+ delete_definition($id);
+ print $input->redirect("/cgi-bin/koha/reports/dictionary.pl?phase=View%20Dictionary");
}
-elsif ($phase eq 'Delete Definition'){
- $no_html=1;
- my $id = $input->param('id');
- delete_definition($id);
- print $input->redirect("/cgi-bin/koha/reports/dictionary.pl?phase=View%20Dictionary");
- }
$template->param( 'referer' => $referer );
if (!$no_html){
output_html_with_http_headers $input, $cookie, $template->output;
}
+
+sub areas {
+ my $areas = get_report_areas();
+ my @a;
+ foreach (@$areas) {
+ push @a, {
+ id => $_->[0],
+ name => $_->[1],
+ selected => ($_->[0] eq $area),
+ };
+ }
+ return \@a;
+}
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
+
use CGI;
use Text::CSV;
use URI::Escape;
use C4::Reports::Guided;
use C4::Auth qw/:DEFAULT get_session/;
use C4::Output;
-use C4::Dates;
+use C4::Dates qw/format_date/;
use C4::Debug;
use C4::Branch; # XXX subfield_is_koha_internal_p
my $filter;
if ( $input->param("filter_set") ) {
$filter = {};
- $filter->{$_} = $input->param("filter_$_") foreach qw/date author keyword/;
+ $filter->{$_} = $input->param("filter_$_") foreach qw/date author keyword group subgroup/;
$session->param('report_filter', $filter) if $session;
$template->param( 'filter_set' => 1 );
}
elsif ( $phase eq 'Build new' ) {
# build a new report
$template->param( 'build1' => 1 );
- $template->param( 'areas' => get_report_areas(), 'usecache' => $usecache, 'cache_expiry' => 300, 'public' => '0' );
-}
-elsif ( $phase eq 'Use saved' ) {
+ my $areas = get_report_areas();
+ $template->param(
+ 'areas' => [map { id => $_->[0], name => $_->[1] }, @$areas],
+ 'usecache' => $usecache,
+ 'cache_expiry' => 300,
+ 'public' => '0',
+ );
+} elsif ( $phase eq 'Use saved' ) {
+
# use a saved report
# get list of reports and display them
+ my $group = $input->param('group');
+ my $subgroup = $input->param('subgroup');
+ $filter->{group} = $group;
+ $filter->{subgroup} = $subgroup;
$template->param(
'saved1' => 1,
'savedreports' => get_saved_reports($filter),
'usecache' => $usecache,
+ 'groups_with_subgroups'=> groups_with_subgroups($group, $subgroup),
);
- if ($filter) {
- while ( my ($k, $v) = each %$filter ) {
- $template->param( "filter_$k" => $v ) if $v;
- }
- }
}
elsif ( $phase eq 'Delete Saved') {
elsif ( $phase eq 'Show SQL'){
- my $id = $input->param('reports');
- my ($sql,$type,$reportname,$notes) = get_saved_report($id);
- $template->param(
+ my $id = $input->param('reports');
+ my $report = get_saved_report($id);
+ $template->param(
'id' => $id,
- 'reportname' => $reportname,
- 'notes' => $notes,
- 'sql' => $sql,
- 'showsql' => 1,
+ 'reportname' => $report->{report_name},
+ 'notes' => $report->{notes},
+ 'sql' => $report->{savedsql},
+ 'showsql' => 1,
);
}
elsif ( $phase eq 'Edit SQL'){
my $id = $input->param('reports');
- my ($sql,$type,$reportname,$notes, $cache_expiry, $public) = get_saved_report($id);
+ my $report = get_saved_report($id);
+ my $group = $report->{report_group};
+ my $subgroup = $report->{report_subgroup};
$template->param(
- 'sql' => $sql,
- 'reportname' => $reportname,
- 'notes' => $notes,
+ 'sql' => $report->{savedsql},
+ 'reportname' => $report->{report_name},
+ 'groups_with_subgroups' => groups_with_subgroups($group, $subgroup),
+ 'notes' => $report->{notes},
'id' => $id,
- 'cache_expiry' => $cache_expiry,
- 'public' => $public,
+ 'cache_expiry' => $report->{cache_expiry},
+ 'public' => $report->{public},
'usecache' => $usecache,
- 'editsql' => 1,
+ 'editsql' => 1,
);
}
my $id = $input->param('id');
my $sql = $input->param('sql');
my $reportname = $input->param('reportname');
+ my $group = $input->param('group');
+ my $subgroup = $input->param('subgroup');
my $notes = $input->param('notes');
my $cache_expiry = $input->param('cache_expiry');
my $cache_expiry_units = $input->param('cache_expiry_units');
'errors' => \@errors,
'sql' => $sql,
);
- }
- else {
- update_sql( $id, $sql, $reportname, $notes, $cache_expiry, $public );
+ } else {
+ update_sql( $id, {
+ sql => $sql,
+ name => $reportname,
+ group => $group,
+ subgroup => $subgroup,
+ notes => $notes,
+ cache_expiry => $cache_expiry,
+ public => $public,
+ } );
$template->param(
'save_successful' => 1,
'reportname' => $reportname,
'id' => $id,
);
}
-
}
elsif ($phase eq 'retrieve results') {
# they have choosen a new report and the area to report on
$template->param(
'build2' => 1,
- 'area' => $input->param('areas'),
+ 'area' => $input->param('area'),
'types' => get_report_types(),
'cache_expiry' => $cache_expiry,
'public' => $input->param('public'),
my $area = $input->param('area');
my $type = $input->param('type');
my $column = $input->param('column');
- my @definitions = $input->param('definition');
- my $definition = join (',',@definitions);
+ my @definitions = $input->param('definition');
+ my $definition = join (',',@definitions);
my @criteria = $input->param('criteria_column');
- my $query_criteria;
+ my $query_criteria;
foreach my $crit (@criteria) {
my $value = $input->param( $crit . "_value" );
-
- # If value is not defined, then it may be range values
- if (!defined $value) {
-
- my $fromvalue = $input->param( "from_" . $crit . "_value" );
- my $tovalue = $input->param( "to_" . $crit . "_value" );
-
- # If the range values are dates
- if ($fromvalue =~ C4::Dates->regexp('syspref') && $tovalue =~ C4::Dates->regexp('syspref')) {
- $fromvalue = C4::Dates->new($fromvalue)->output("iso");
- $tovalue = C4::Dates->new($tovalue)->output("iso");
- }
-
- if ($fromvalue && $tovalue) {
- $query_criteria .= " AND $crit >= '$fromvalue' AND $crit <= '$tovalue'";
- }
-
- } else {
-
- # If value is a date
- if ($value =~ C4::Dates->regexp('syspref')) {
- $value = C4::Dates->new($value)->output("iso");
- }
- # don't escape runtime parameters, they'll be at runtime
- if ($value =~ /<<.*>>/) {
- $query_criteria .= " AND $crit=$value";
+
+ # If value is not defined, then it may be range values
+ if (!defined $value) {
+
+ my $fromvalue = $input->param( "from_" . $crit . "_value" );
+ my $tovalue = $input->param( "to_" . $crit . "_value" );
+
+ # If the range values are dates
+ if ($fromvalue =~ C4::Dates->regexp('syspref') && $tovalue =~ C4::Dates->regexp('syspref')) {
+ $fromvalue = C4::Dates->new($fromvalue)->output("iso");
+ $tovalue = C4::Dates->new($tovalue)->output("iso");
+ }
+
+ if ($fromvalue && $tovalue) {
+ $query_criteria .= " AND $crit >= '$fromvalue' AND $crit <= '$tovalue'";
+ }
+
} else {
- $query_criteria .= " AND $crit='$value'";
+
+ # If value is a date
+ if ($value =~ C4::Dates->regexp('syspref')) {
+ $value = C4::Dates->new($value)->output("iso");
+ }
+ # don't escape runtime parameters, they'll be at runtime
+ if ($value =~ /<<.*>>/) {
+ $query_criteria .= " AND $crit=$value";
+ } else {
+ $query_criteria .= " AND $crit='$value'";
+ }
}
- }
}
$template->param(
'build5' => 1,
build_query( \@columns, $query_criteria, $query_orderby, $area, $totals, $definition );
$template->param(
'showreport' => 1,
+ 'area' => $area,
'sql' => $sql,
'type' => $type,
'cache_expiry' => $input->param('cache_expiry'),
}
elsif ( $phase eq 'Save' ) {
- # Save the report that has just been built
+ # Save the report that has just been built
+ my $area = $input->param('area');
my $sql = $input->param('sql');
my $type = $input->param('type');
$template->param(
'save' => 1,
+ 'area' => $area,
'sql' => $sql,
'type' => $type,
'cache_expiry' => $input->param('cache_expiry'),
'public' => $input->param('public'),
+ 'groups_with_subgroups' => groups_with_subgroups($area), # in case we have a report group that matches area
);
}
elsif ( $phase eq 'Save Report' ) {
- # save the sql pasted in by a user
- my $sql = $input->param('sql');
- my $name = $input->param('reportname');
- my $type = $input->param('types');
+ # save the sql pasted in by a user
+ my $area = $input->param('area');
+ my $group = $input->param('group');
+ my $subgroup = $input->param('subgroup');
+ my $sql = $input->param('sql');
+ my $name = $input->param('reportname');
+ my $type = $input->param('types');
my $notes = $input->param('notes');
my $cache_expiry = $input->param('cache_expiry');
my $cache_expiry_units = $input->param('cache_expiry_units');
}
}
# check $cache_expiry isnt too large, Memcached::set requires it to be less than 30 days or it will be treated as if it were an absolute time stamp
- if( $cache_expiry >= 2592000 ){
+ if( $cache_expiry && $cache_expiry >= 2592000 ){
push @errors, {cache_expiry => $cache_expiry};
}
## FIXME this is AFTER entering a name to save the report under
push @errors, {sqlerr => $1};
}
elsif ($sql !~ /^(SELECT)/i) {
- push @errors, {queryerr => 1};
+ push @errors, {queryerr => "No SELECT"};
}
if (@errors) {
$template->param(
);
}
else {
- my $id = save_report( $borrowernumber, $sql, $name, $type, $notes, $cache_expiry, $public );
+ my $id = save_report( {
+ borrowernumber => $borrowernumber,
+ sql => $sql,
+ name => $name,
+ area => $area,
+ group => $group,
+ subgroup => $subgroup,
+ type => $type,
+ notes => $notes,
+ cache_expiry => $cache_expiry,
+ public => $public,
+ } );
$template->param(
- 'save_successful' => 1,
- 'reportname' => $name,
- 'id' => $id,
+ 'save_successful' => 1,
+ 'reportname' => $name,
+ 'id' => $id,
);
}
}
elsif ($phase eq 'Run this report'){
# execute a saved report
- my $limit = 20; # page size. # TODO: move to DB or syspref?
- my $offset = 0;
- my $report = $input->param('reports');
+ my $limit = 20; # page size. # TODO: move to DB or syspref?
+ my $offset = 0;
+ my $report_id = $input->param('reports');
my @sql_params = $input->param('sql_params');
# offset algorithm
if ($input->param('page')) {
$offset = ($input->param('page') - 1) * $limit;
}
- my ($sql,$type,$name,$notes) = get_saved_report($report);
- unless ($sql) {
- push @errors, {no_sql_for_id=>$report};
- }
- my @rows = ();
- # if we have at least 1 parameter, and it's not filled, then don't execute but ask for parameters
- if ($sql =~ /<</ && !@sql_params) {
- # split on ??. Each odd (2,4,6,...) entry should be a parameter to fill
- my @split = split /<<|>>/,$sql;
- my @tmpl_parameters;
- 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';
- }
- elsif ($authorised_value) {
- my $dbh=C4::Context->dbh;
- my @authorised_values;
- my %authorised_lib;
- # builds list, depending on authorised value...
- if ( $authorised_value eq "branches" ) {
- my $branches = GetBranchesLoop();
- foreach my $thisbranch (@$branches) {
- push @authorised_values, $thisbranch->{value};
- $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
- }
+
+ my ( $sql, $type, $name, $notes );
+ if (my $report = get_saved_report($report_id)) {
+ $sql = $report->{savedsql};
+ $name = $report->{report_name};
+ $notes = $report->{notes};
+
+ my @rows = ();
+ # if we have at least 1 parameter, and it's not filled, then don't execute but ask for parameters
+ if ($sql =~ /<</ && !@sql_params) {
+ # split on ??. Each odd (2,4,6,...) entry should be a parameter to fill
+ my @split = split /<<|>>/,$sql;
+ my @tmpl_parameters;
+ 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';
}
- elsif ( $authorised_value eq "itemtypes" ) {
- my $sth = $dbh->prepare("SELECT itemtype,description FROM itemtypes ORDER BY description");
- $sth->execute;
- while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) {
- push @authorised_values, $itemtype;
- $authorised_lib{$itemtype} = $description;
+ elsif ($authorised_value) {
+ my $dbh=C4::Context->dbh;
+ my @authorised_values;
+ my %authorised_lib;
+ # builds list, depending on authorised value...
+ if ( $authorised_value eq "branches" ) {
+ my $branches = GetBranchesLoop();
+ foreach my $thisbranch (@$branches) {
+ push @authorised_values, $thisbranch->{value};
+ $authorised_lib{$thisbranch->{value}} = $thisbranch->{branchname};
+ }
}
- }
- elsif ( $authorised_value eq "cn_source" ) {
- my $class_sources = GetClassSources();
- my $default_source = C4::Context->preference("DefaultClassificationSource");
- foreach my $class_source (sort keys %$class_sources) {
- next unless $class_sources->{$class_source}->{'used'} or
- ($class_source eq $default_source);
- push @authorised_values, $class_source;
- $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
+ elsif ( $authorised_value eq "itemtypes" ) {
+ my $sth = $dbh->prepare("SELECT itemtype,description FROM itemtypes ORDER BY description");
+ $sth->execute;
+ while ( my ( $itemtype, $description ) = $sth->fetchrow_array ) {
+ push @authorised_values, $itemtype;
+ $authorised_lib{$itemtype} = $description;
+ }
}
- }
- elsif ( $authorised_value eq "categorycode" ) {
- my $sth = $dbh->prepare("SELECT categorycode, description FROM categories ORDER BY description");
- $sth->execute;
- while ( my ( $categorycode, $description ) = $sth->fetchrow_array ) {
- push @authorised_values, $categorycode;
- $authorised_lib{$categorycode} = $description;
+ elsif ( $authorised_value eq "cn_source" ) {
+ my $class_sources = GetClassSources();
+ my $default_source = C4::Context->preference("DefaultClassificationSource");
+ foreach my $class_source (sort keys %$class_sources) {
+ next unless $class_sources->{$class_source}->{'used'} or
+ ($class_source eq $default_source);
+ push @authorised_values, $class_source;
+ $authorised_lib{$class_source} = $class_sources->{$class_source}->{'description'};
+ }
}
+ elsif ( $authorised_value eq "categorycode" ) {
+ my $sth = $dbh->prepare("SELECT categorycode, description FROM categories ORDER BY description");
+ $sth->execute;
+ while ( my ( $categorycode, $description ) = $sth->fetchrow_array ) {
+ push @authorised_values, $categorycode;
+ $authorised_lib{$categorycode} = $description;
+ }
+
+ #---- "true" authorised value
+ }
+ else {
+ my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
- #---- "true" authorised value
- }
- else {
- my $authorised_values_sth = $dbh->prepare("SELECT authorised_value,lib FROM authorised_values WHERE category=? ORDER BY lib");
-
- $authorised_values_sth->execute( $authorised_value);
+ $authorised_values_sth->execute( $authorised_value);
- while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
- push @authorised_values, $value;
- $authorised_lib{$value} = $lib;
- # For item location, we show the code and the libelle
- $authorised_lib{$value} = $lib;
+ while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) {
+ push @authorised_values, $value;
+ $authorised_lib{$value} = $lib;
+ # For item location, we show the code and the libelle
+ $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,
+ $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,
- -override => 1,
- -size => 1,
- -multiple => 0,
- -tabindex => 1,
- );
-
- } else {
- $input = "text";
+ -labels => \%authorised_lib,
+ -override => 1,
+ -size => 1,
+ -multiple => 0,
+ -tabindex => 1,
+ );
+ } else {
+ $input = "text";
+ }
+ push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid };
}
- push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid };
- }
- $template->param('sql' => $sql,
- 'name' => $name,
- 'sql_params' => \@tmpl_parameters,
- 'enter_params' => 1,
- 'reports' => $report,
- );
- } else {
- # OK, we have parameters, or there are none, we run the report
- # if there were parameters, replace before running
- # split on ??. Each odd (2,4,6,...) entry should be a parameter to fill
- my @split = split /<<|>>/,$sql;
- my @tmpl_parameters;
- for(my $i=0;$i<$#split/2;$i++) {
- my $quoted = C4::Context->dbh->quote($sql_params[$i]);
- # if there are special regexp chars, we must \ them
- $split[$i*2+1] =~ s/(\||\?|\.|\*|\(|\)|\%)/\\$1/g;
- $sql =~ s/<<$split[$i*2+1]>>/$quoted/;
- }
- my ($sth, $errors) = execute_query($sql, $offset, $limit);
- my $total = nb_rows($sql) || 0;
- unless ($sth) {
- die "execute_query failed to return sth for report $report: $sql";
+ $template->param('sql' => $sql,
+ 'name' => $name,
+ 'sql_params' => \@tmpl_parameters,
+ 'enter_params' => 1,
+ 'reports' => $report_id,
+ );
} else {
- my $headref = $sth->{NAME} || [];
- my @headers = map { +{ cell => $_ } } @$headref;
- $template->param(header_row => \@headers);
- while (my $row = $sth->fetchrow_arrayref()) {
- my @cells = map { +{ cell => $_ } } @$row;
- push @rows, { cells => \@cells };
+ # OK, we have parameters, or there are none, we run the report
+ # if there were parameters, replace before running
+ # split on ??. Each odd (2,4,6,...) entry should be a parameter to fill
+ my @split = split /<<|>>/,$sql;
+ my @tmpl_parameters;
+ for(my $i=0;$i<$#split/2;$i++) {
+ my $quoted = C4::Context->dbh->quote($sql_params[$i]);
+ # if there are special regexp chars, we must \ them
+ $split[$i*2+1] =~ s/(\||\?|\.|\*|\(|\)|\%)/\\$1/g;
+ $sql =~ s/<<$split[$i*2+1]>>/$quoted/;
+ }
+ my ($sth, $errors) = execute_query($sql, $offset, $limit);
+ my $total = nb_rows($sql) || 0;
+ unless ($sth) {
+ die "execute_query failed to return sth for report $report_id: $sql";
+ } else {
+ my $headref = $sth->{NAME} || [];
+ my @headers = map { +{ cell => $_ } } @$headref;
+ $template->param(header_row => \@headers);
+ while (my $row = $sth->fetchrow_arrayref()) {
+ my @cells = map { +{ cell => $_ } } @$row;
+ push @rows, { cells => \@cells };
+ }
}
- }
- my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0);
- my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report&phase=Run%20this%20report";
- if (@sql_params) {
- $url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params);
+ my $totpages = int($total/$limit) + (($total % $limit) > 0 ? 1 : 0);
+ my $url = "/cgi-bin/koha/reports/guided_reports.pl?reports=$report_id&phase=Run%20this%20report";
+ if (@sql_params) {
+ $url = join('&sql_params=', $url, map { URI::Escape::uri_escape($_) } @sql_params);
+ }
+ $template->param(
+ 'results' => \@rows,
+ 'sql' => $sql,
+ 'id' => $report_id,
+ 'execute' => 1,
+ 'name' => $name,
+ 'notes' => $notes,
+ 'errors' => $errors,
+ 'pagination_bar' => pagination_bar($url, $totpages, $input->param('page')),
+ 'unlimited_total' => $total,
+ );
}
- $template->param(
- 'results' => \@rows,
- 'sql' => $sql,
- 'id' => $report,
- 'execute' => 1,
- 'name' => $name,
- 'notes' => $notes,
- 'errors' => $errors,
- 'pagination_bar' => pagination_bar($url, $totpages, $input->param('page')),
- 'unlimited_total' => $total,
- );
+ }
+ else {
+ push @errors, { no_sql_for_id => $report_id };
}
}
);
}
-elsif ($phase eq 'Create report from SQL') {
- # allow the user to paste in sql
- if ($input->param('sql')) {
+elsif ( $phase eq 'Create report from SQL' ) {
+
+ my ($group, $subgroup);
+ # allow the user to paste in sql
+ if ( $input->param('sql') ) {
+ $group = $input->param('report_group');
+ $subgroup = $input->param('report_subgroup');
$template->param(
'sql' => $input->param('sql'),
'reportname' => $input->param('reportname'),
'notes' => $input->param('notes'),
);
}
- $template->param('create' => 1, 'public' => '0', 'cache_expiry' => 300, 'usecache' => $usecache);
+ $template->param(
+ 'create' => 1,
+ 'groups_with_subgroups' => groups_with_subgroups($group, $subgroup),
+ 'public' => '0',
+ 'cache_expiry' => 300,
+ 'usecache' => $usecache,
+ );
}
elsif ($phase eq 'Create Compound Report'){
);
output_html_with_http_headers $input, $cookie, $template->output;
+
+sub groups_with_subgroups {
+ my ($group, $subgroup) = @_;
+
+ my $groups_with_subgroups = get_report_groups();
+ my @g_sg;
+ while (my ($g_id, $v) = each %$groups_with_subgroups) {
+ my @subgroups;
+ if (my $sg = $v->{subgroups}) {
+ while (my ($sg_id, $n) = each %$sg) {
+ push @subgroups, {
+ id => $sg_id,
+ name => $n,
+ selected => ($group && $g_id eq $group && $subgroup && $sg_id eq $subgroup ),
+ };
+ }
+ }
+ push @g_sg, {
+ id => $g_id,
+ name => $v->{name},
+ selected => ($group && $g_id eq $group),
+ subgroups => \@subgroups,
+ };
+ }
+ return \@g_sg;
+}
my $query = new CGI;
my $op = $query->param('op') || q{};
+my $nbissues=$query->param('nbissues');
my $dbh = C4::Context->dbh;
my ($template, $loggedinuser, $cookie);
if($op eq 'gennext' && @subscriptionid){
my $subscriptionid = $subscriptionid[0];
- my $subscription = GetSubscription($subscriptionid);
-
- my $sth = $dbh->prepare("SELECT publisheddate, serialid, serialseq, planneddate
+ my $sth = $dbh->prepare("SELECT publisheddate, serialid, serialseq, planneddate
FROM serial WHERE status = 1 AND subscriptionid = ?");
+ my $status = defined( $nbissues ) ? 2 : 3;
+ $nbissues ||= 1;
+ for ( my $i = 0; $i < $nbissues; $i++ ){
$sth->execute($subscriptionid);
-
# modify actual expected issue, to generate the next
if ( my $issue = $sth->fetchrow_hashref ) {
ModSerialStatus( $issue->{serialid}, $issue->{serialseq},
$issue->{planneddate}, $issue->{publisheddate},
- 3, "" );
+ $status, "" );
}else{
- my $expected = GetNextExpected($subscriptionid);
+ my $subscription = GetSubscription($subscriptionid);
+ my $expected = GetNextExpected($subscriptionid);
my (
$newserialseq, $newlastvalue1, $newlastvalue2, $newlastvalue3,
$newinnerloop1, $newinnerloop2, $newinnerloop3
## Updating the subscription seq status
my $squery = "UPDATE subscription SET lastvalue1=?, lastvalue2=?, lastvalue3=?, innerloop1=?, innerloop2=?, innerloop3=?
WHERE subscriptionid = ?";
- $sth = $dbh->prepare($squery);
- $sth->execute(
+ my $seqsth = $dbh->prepare($squery);
+ $seqsth->execute(
$newlastvalue1, $newlastvalue2, $newlastvalue3, $newinnerloop1,
$newinnerloop2, $newinnerloop3, $subscriptionid
);
}
-
+ last if $nbissues == 1;
+ last if HasSubscriptionExpired($subscriptionid) > 0;
+ }
print $query->redirect('/cgi-bin/koha/serials/serials-collection.pl?subscriptionid='.$subscriptionid);
}
routing => C4::Context->preference("RoutingSerials"),
subscr=>$query->param('subscriptionid'),
subscriptioncount => $subscriptioncount,
- location => $locationlib,
- callnumber => $callnumber,
- uc(C4::Context->preference("marcflavour")) => 1
+ location => $locationlib,
+ callnumber => $callnumber,
+ uc(C4::Context->preference("marcflavour")) => 1,
+ serialsadditems => $subscriptiondescs->[0]{'serialsadditems'},
);
output_html_with_http_headers $query, $cookie, $template->output;
$template->param(
serialsadditems => $serialdatalist[0]->{'serialsadditems'},
callnumber => $serialdatalist[0]->{'callnumber'},
+ internalnotes => $serialdatalist[0]->{'internalnotes'},
bibliotitle => $biblio->{'title'},
biblionumber => $serialdatalist[0]->{'biblionumber'},
serialslist => \@serialdatalist,
this script is the main page for serials/
-=head1 PARAMETERS
-
-=over 4
-
-=item title
-
-=item ISSN
-
-=item biblionumber
-
-=back
-
=cut
-use strict;
-use warnings;
+use Modern::Perl;
use CGI;
use C4::Auth;
-use C4::Serials;
-use C4::Output;
-use C4::Context;
use C4::Branch;
+use C4::Context;
+use C4::Output;
+use C4::Serials;
-my $query = new CGI;
-my $title = $query->param('title_filter');
-my $ISSN = $query->param('ISSN_filter');
-my $EAN = $query->param('EAN_filter');
-my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials");
-my $searched = $query->param('searched');
-my $biblionumber = $query->param('biblionumber');
-
-my @serialseqs = $query->param('serialseq');
-my @planneddates = $query->param('planneddate');
-my @publisheddates = $query->param('publisheddate');
-my @status = $query->param('status');
-my @notes = $query->param('notes');
+my $query = new CGI;
+my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials");
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
}
);
-if (@serialseqs){
- my @information;
- my $index;
- foreach my $seq (@serialseqs){
- if ($seq){
- ### FIXME This limitation that a serial must be given a title may not be very efficient for some library who do not update serials titles.
- push @information,
- { serialseq=>$seq,
- publisheddate=>$publisheddates[$index],
- planneddate=>$planneddates[$index],
- notes=>$notes[$index],
- status=>$status[$index]
- }
- }
- $index++;
- }
- $template->param('information'=>\@information);
-}
-my @subscriptions;
-if ($searched) {
- @subscriptions = GetSubscriptions( $title, $ISSN, $EAN, $biblionumber );
-}
-
-# to toggle between create or edit routing list options
-if ($routing) {
- for my $subscription ( @subscriptions) {
- $subscription->{routingedit} = check_routing( $subscription->{subscriptionid} );
- $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} );
- }
-}
-
$template->param(
- subscriptions => \@subscriptions,
- title_filter => $title,
- ISSN_filter => $ISSN,
- done_searched => $searched,
routing => $routing,
(uc(C4::Context->preference("marcflavour"))) => 1
);
--- /dev/null
+#!/usr/bin/perl
+
+# Copyright 2012 Koha 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.
+
+
+=head1 NAME
+
+serials-search.pl
+
+=head1 DESCRIPTION
+
+this script is the search page for serials
+
+=cut
+
+use Modern::Perl;
+use CGI;
+use C4::Auth;
+use C4::Branch;
+use C4::Context;
+use C4::Output;
+use C4::Serials;
+
+my $query = new CGI;
+my $title = $query->param('title_filter') || '';
+my $ISSN = $query->param('ISSN_filter') || '';
+my $EAN = $query->param('EAN_filter') || '';
+my $publisher = $query->param('publisher_filter') || '';
+my $bookseller = $query->param('bookseller_filter') || '';
+my $biblionumber = $query->param('biblionumber') || '';
+my $branch = $query->param('branch_filter') || '';
+my $routing = $query->param('routing') || C4::Context->preference("RoutingSerials");
+my $searched = $query->param('searched') || 0;
+
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ {
+ template_name => "serials/serials-search.tmpl",
+ query => $query,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => { serials => '*' },
+ debug => 1,
+ }
+);
+
+my @subscriptions;
+if ($searched){
+ @subscriptions = SearchSubscriptions(
+ {
+ biblionumber => $biblionumber,
+ title => $title,
+ issn => $ISSN,
+ ean => $EAN,
+ publisher => $publisher,
+ bookseller => $bookseller,
+ branch => $branch,
+ }
+ );
+}
+
+# to toggle between create or edit routing list options
+if ($routing) {
+ for my $subscription ( @subscriptions) {
+ $subscription->{routingedit} = check_routing( $subscription->{subscriptionid} );
+ $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} );
+ }
+}
+
+my $branches = GetBranches();
+my @branches_loop;
+foreach (sort keys %$branches){
+ my $selected = 0;
+ $selected = 1 if( $branch eq $_ );
+ push @branches_loop, {
+ branchcode => $_,
+ branchname => $branches->{$_}->{'branchname'},
+ selected => $selected,
+ };
+}
+
+$template->param(
+ subscriptions => \@subscriptions,
+ title_filter => $title,
+ ISSN_filter => $ISSN,
+ EAN_filter => $EAN,
+ publisher_filter => $publisher,
+ bookseller_filter => $bookseller,
+ branch_filter => $branch,
+ branches_loop => \@branches_loop,
+ done_searched => $searched,
+ routing => $routing,
+ marcflavour => (uc(C4::Context->preference("marcflavour")))
+);
+
+output_html_with_http_headers $query, $cookie, $template->output;
# COMMENT hdl : IMHO, we should think about passing more and more data hash to template->param rather than duplicating code a new coding Guideline ?
-for my $date qw(startdate enddate firstacquidate histstartdate histenddate){
+for my $date ( qw(startdate enddate firstacquidate histstartdate histenddate) ) {
$$subs{$date} = format_date($$subs{$date}) if $date && $$subs{$date};
}
$subs->{location} = GetKohaAuthorisedValueLib("LOC",$subs->{location});
$subs->{periodicity} = '0';
}
my $default_bib_view = get_default_view();
+
+my ( $order, $bookseller, $tmpl_infos );
+# FIXME = see http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=5335#c52
+#if ( defined $subscriptionid ) {
+# my $lastOrderNotReceived = GetLastOrderNotReceivedFromSubscriptionid $subscriptionid;
+# my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid;
+# if ( defined $lastOrderNotReceived ) {
+# my $basket = GetBasket $lastOrderNotReceived->{basketno};
+# my $bookseller = GetBookSellerFromId $basket->{booksellerid};
+# ( $tmpl_infos->{valuegsti_ordered}, $tmpl_infos->{valuegste_ordered} ) = get_value_with_gst_params ( $lastOrderNotReceived->{ecost}, $lastOrderNotReceived->{gstrate}, $bookseller );
+# $tmpl_infos->{valuegsti_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegsti_ordered} );
+# $tmpl_infos->{valuegste_ordered} = sprintf( "%.2f", $tmpl_infos->{valuegste_ordered} );
+# $tmpl_infos->{budget_name_ordered} = GetBudgetName $lastOrderNotReceived->{budget_id};
+# $tmpl_infos->{basketno} = $lastOrderNotReceived->{basketno};
+# $tmpl_infos->{ordered_exists} = 1;
+# }
+# if ( defined $lastOrderReceived ) {
+# my $basket = GetBasket $lastOrderReceived->{basketno};
+# my $bookseller = GetBookSellerFromId $basket->{booksellerid};
+# ( $tmpl_infos->{valuegsti_spent}, $tmpl_infos->{valuegste_spent} ) = get_value_with_gst_params ( $lastOrderReceived->{unitprice}, $lastOrderReceived->{gstrate}, $bookseller );
+# $tmpl_infos->{valuegsti_spent} = sprintf( "%.2f", $tmpl_infos->{valuegsti_spent} );
+# $tmpl_infos->{valuegste_spent} = sprintf( "%.2f", $tmpl_infos->{valuegste_spent} );
+# $tmpl_infos->{budget_name_spent} = GetBudgetName $lastOrderReceived->{budget_id};
+# $tmpl_infos->{invoicenumber} = $lastOrderReceived->{booksellerinvoicenumber};
+# $tmpl_infos->{spent_exists} = 1;
+# }
+#}
+
$template->param(
subscriptionid => $subscriptionid,
serialslist => \@serialslist,
intranetcolorstylesheet => C4::Context->preference('intranetcolorstylesheet'),
irregular_issues => scalar @irregular_issues,
default_bib_view => $default_bib_view,
- (uc(C4::Context->preference("marcflavour"))) => 1
+ (uc(C4::Context->preference("marcflavour"))) => 1,
+ show_acquisition_details => defined $tmpl_infos->{ordered_exists} || defined $tmpl_infos->{spent_exists} ? 1 : 0,
);
output_html_with_http_headers $query, $cookie, $template->output;
my $number_of_matches = BatchFindBibDuplicates($batch_id, $matcher);
# XXX we are ignoring the result of this;
- BatchCommitBibRecords($batch_id, $framework) if lc($import_mode) eq 'direct';
+ BatchCommitRecords($batch_id, $framework) if lc($import_mode) eq 'direct';
my $dbh = C4::Context->dbh();
my $sth = $dbh->prepare("SELECT matched_biblionumber FROM import_biblios WHERE import_record_id =?");
my $report_id = $query->param('id');
my $report_name = $query->param('name');
-my $cache;
-my $sql;
-my $type;
-my $notes;
-my $cache_expiry;
-my $public;
-
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => "intranet-main.tmpl",
}
);
-if (Koha::Cache->is_cache_active) {
- if ($report_name) { # When retrieving by name, we have to hit the
- # database to get the ID before we can check
- # the cache. Yuck.
- ( $sql, $type, $report_name, $notes, $cache_expiry, $public, $report_id ) =
- get_saved_report( { 'name' => $report_name } );
- }
-
+my $cache_active = Koha::Cache->is_cache_active;
+my ($cache_key, $cache, $json_text);
+if ($cache_active) {
+ $cache_key = "intranet:report:".($report_name ? "name:$report_name" : "id:$report_id");
$cache = Koha::Cache->new();
- my $page = $cache->get_from_cache("intranet:report:$report_id");
- if ($page) {
- print $query->header;
- print $page;
- exit;
- }
+ $json_text = $cache->get_from_cache($cache_key);
}
-print $query->header;
-
-# $public isnt used for intranet
-unless ($sql) {
- ( $sql, $type, $report_name, $notes, $cache_expiry, $public, $report_id ) =
- get_saved_report($report_name ? { 'name' => $report_name } : { 'id' => $report_id } );
-}
-if ($sql) {
+unless ($json_text) {
+ my $report_rec = get_saved_report($report_name ? { 'name' => $report_name } : { 'id' => $report_id });
my $offset = 0;
my $limit = C4::Context->preference("SvcMaxReportRows") || 10;
- my ( $sth, $errors ) = execute_query( $sql, $offset, $limit );
- my $lines = $sth->fetchall_arrayref;
- my $json_text = to_json($lines);
- print $json_text;
+ my ( $sth, $errors ) = execute_query( $report_rec->{savedsql}, $offset, $limit );
+ if ($sth) {
+ my $lines = $sth->fetchall_arrayref;
+ $json_text = to_json($lines);
- if (Koha::Cache->is_cache_active) {
- $cache->set_in_cache( "intranet:report:$report_id", $json_text, $cache_expiry );
+ if ($cache_active) {
+ $cache->set_in_cache( $cache_key, $json_text, $report_rec->{cache_expiry} );
+ }
+ }
+ else {
+ $json_text = to_json($errors);
}
}
+
+print $query->header;
+print $json_text;
--- /dev/null
+#!/usr/bin/perl
+
+use Modern::Perl;
+use C4::Context;
+
+use Test::More tests => 47;
+use Test::MockModule;
+
+use_ok('C4::Acquisition');
+
+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;
+});
+
+my $dbh = C4::Context->dbh;
+
+# We need to add a resultset to avoid DBI fail
+# ("DBI bind_columns: invalid number of arguments...")
+my $rs = [
+ [qw(one two three four)],
+ [1, 2, 3, 4]
+];
+
+$dbh->{mock_add_resultset} = $rs;
+my @invoices = C4::Acquisition::GetInvoices(
+ supplierid => "supplierid",
+ invoicenumber => "invoicenumber",
+ suppliername => "suppliername",
+ shipmentdatefrom => "shipmentdatefrom",
+ shipmentdateto => "shipmentdateto",
+ billingdatefrom => "billingdatefrom",
+ billingdateto => "billingdateto",
+ isbneanissn => "isbneanissn",
+ title => "title",
+ author => "author",
+ publisher => "publisher",
+ publicationyear => "publicationyear",
+ branchcode => "branchcode",
+);
+my $history = $dbh->{mock_all_history};
+
+is(scalar(@$history), 1);
+my @bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 15);
+is($bound_params[0], 'supplierid');
+is($bound_params[1], '%invoicenumber%');
+is($bound_params[2], '%suppliername%');
+is($bound_params[3], 'shipmentdatefrom');
+is($bound_params[4], 'shipmentdateto');
+is($bound_params[5], 'billingdatefrom');
+is($bound_params[6], 'billingdateto');
+is($bound_params[7], 'isbneanissn');
+is($bound_params[8], 'isbneanissn');
+is($bound_params[9], 'isbneanissn');
+is($bound_params[10], 'title');
+is($bound_params[11], 'author');
+is($bound_params[12], 'publisher');
+is($bound_params[13], 'publicationyear');
+is($bound_params[14], 'branchcode');
+
+$dbh->{mock_clear_history} = 1;
+$dbh->{mock_add_resultset} = $rs;
+GetInvoice(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+
+$dbh->{mock_clear_history} = 1;
+$dbh->{mock_add_resultset} = $rs;
+$dbh->{mock_add_resultset} = $rs;
+my $invoice = GetInvoiceDetails(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 2);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+@bound_params = @{ $history->[1]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+ok(exists $invoice->{orders});
+
+$dbh->{mock_clear_history} = 1;
+is(AddInvoice(booksellerid => 1), undef); # Fails because of a missing parameter
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 0);
+
+$dbh->{mock_clear_history} = 1;
+AddInvoice(invoicenumber => 'invoice', booksellerid => 1, unknown => "unknown");
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 2);
+ok(grep /^1$/, @bound_params);
+ok(grep /^invoice$/, @bound_params);
+ok(not grep /unknown/, @bound_params);
+
+$dbh->{mock_clear_history} = 1;
+is(ModInvoice(booksellerid => 1), undef); # Fails because of a missing parameter
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 0);
+
+$dbh->{mock_clear_history} = 1;
+ModInvoice(invoiceid => 3, invoicenumber => 'invoice', unknown => "unknown");
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 2);
+ok(grep /^3$/, @bound_params);
+ok(grep /^invoice$/, @bound_params);
+ok(not grep /unknown/, @bound_params);
+
+$dbh->{mock_clear_history} = 1;
+CloseInvoice(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
+
+$dbh->{mock_clear_history} = 1;
+ReopenInvoice(42);
+$history = $dbh->{mock_all_history};
+is(scalar(@$history), 1);
+@bound_params = @{ $history->[0]->{bound_params} };
+is(scalar(@bound_params), 1);
+is($bound_params[0], 42);
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More tests => 5;
+use Test::MockModule;
+use MARC::Record;
BEGIN {
use_ok('C4::AuthoritiesMarc');
}
+# We are now going to be testing the authorities hierarchy code, and
+# therefore need to pretend that we have consistent data in our database
+my $module = new Test::MockModule('C4::AuthoritiesMarc');
+$module->mock('GetHeaderAuthority', sub {
+ return {'authtrees' => ''};
+});
+$module->mock('AddAuthorityTrees', sub {
+ return;
+});
+$module->mock('GetAuthority', sub {
+ my ($authid) = @_;
+ my $record = MARC::Record->new();
+ if ($authid eq '1') {
+ $record->add_fields(
+ [ '001', '1' ],
+ [ '151', ' ', ' ', a => 'United States' ]
+ );
+ } elsif ($authid eq '2') {
+ $record->add_fields(
+ [ '001', '2' ],
+ [ '151', ' ', ' ', a => 'New York (State)' ],
+ [ '551', ' ', ' ', a => 'United States', w => 'g', 9 => '1' ]
+ );
+ } elsif ($authid eq '3') {
+ $record->add_fields(
+ [ '001', '3' ],
+ [ '151', ' ', ' ', a => 'New York (City)' ],
+ [ '551', ' ', ' ', a => 'New York (State)', w => 'g', 9 => '2' ]
+ );
+ } elsif ($authid eq '4') {
+ $record->add_fields(
+ [ '001', '4' ],
+ [ '151', ' ', ' ', a => 'New York (City)' ],
+ [ '551', ' ', ' ', a => 'New York (State)', w => 'g' ]
+ );
+ } else {
+ undef $record;
+ }
+ return $record;
+});
+
+is(BuildAuthHierarchies(3, 1), '1,2,3', "Built linked authtrees hierarchy string");
+
+my $expectedhierarchy = [ [ {
+ 'authid' => '1',
+ 'value' => 'United States',
+ 'class' => 'child0',
+ 'children' => [ {
+ 'authid' => '2',
+ 'value' => 'New York (State)',
+ 'class' => 'child1',
+ 'children' => [ {
+ 'authid' => '3',
+ 'current_value' => 1,
+ 'value' => 'New York (City)',
+ 'class' => 'child2',
+ 'children' => [],
+ 'parents' => [ {
+ 'authid' => '2',
+ 'value' => 'New York (State)'
+ } ]
+ } ],
+ 'parents' => [ {
+ 'authid' => '1',
+ 'value' => 'United States'
+ } ]
+ } ],
+ 'parents' => []
+} ] ];
+
+is_deeply(GenerateHierarchy(3), $expectedhierarchy, "Generated hierarchy data structure for linked hierarchy");
+
+is(BuildAuthHierarchies(4, 1), '4', "Built unlinked authtrees hierarchy string");
+$expectedhierarchy = [ [ {
+ 'authid' => '4',
+ 'current_value' => 1,
+ 'value' => 'New York (City)',
+ 'class' => 'child0',
+ 'children' => [],
+ 'parents' => []
+} ] ];
+is_deeply(GenerateHierarchy(4), $expectedhierarchy, "Generated hierarchy data structure for unlinked hierarchy");
use DateTime::TimeZone;
use C4::Context;
-use Test::More tests => 25;
+use Test::More tests => 28;
BEGIN { use_ok('Koha::DateUtils'); }
my $date_string = output_pref( $dt, 'iso' );
cmp_ok $date_string, 'eq', '2011-06-16 12:00', 'iso output';
+my $date_string = output_pref( $dt, 'iso',1 );
+cmp_ok $date_string, 'eq', '2011-06-16', 'iso output (date only)';
+
$date_string = output_pref( $dt, 'us' );
cmp_ok $date_string, 'eq', '06/16/2011 12:00', 'us output';
+$date_string = output_pref( $dt, 'us', 1 );
+cmp_ok $date_string, 'eq', '06/16/2011', 'us output (date only)';
+
# metric should return the French Revolutionary Calendar Really
$date_string = output_pref( $dt, 'metric' );
cmp_ok $date_string, 'eq', '16/06/2011 12:00', 'metric output';
+$date_string = output_pref( $dt, 'metric',1 );
+cmp_ok $date_string, 'eq', '16/06/2011', 'metric output (date only)';
+
$date_string = output_pref_due( $dt, 'metric' );
cmp_ok $date_string, 'eq', '16/06/2011 12:00',
'output_pref_due preserves non midnight HH:SS';
#!/usr/bin/perl
#
-# This Koha test module is a stub!
# Add more tests here!!!
use strict;
[ 'CD', 'CDRom', 0, 0, '', '' ]
];
+my $itemtypes_empty = [
+ [
+ 'itemtype', 'description', 'rentalcharge', 'notforloan',
+ 'imageurl', 'summary'
+ ],
+];
+
my $dbh = C4::Context->dbh();
+$dbh->{mock_add_resultset} = $itemtypes_empty;
my @itemtypes = C4::ItemType->all();
is( @itemtypes, 0, 'Testing all itemtypes is empty' );
ok(grep($plugin, @available_plugins), "Found plugin $plugin");
}
-my $suggestor = Koha::SuggestionEngine->new( { plugins => ( 'ABCD::EFGH::IJKL' ) } );
+my $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'ABCD::EFGH::IJKL' ] } );
is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine with invalid plugin');
is(scalar @{ $suggestor->get_suggestions({ 'search' => 'books' }) }, 0 , 'Request suggestions with empty suggestor');
-$suggestor = Koha::SuggestionEngine->new( { plugins => ( 'Null' ) } );
+$suggestor = Koha::SuggestionEngine->new( { plugins => [ 'Null' ] } );
is(ref($suggestor->plugins->[0]), 'Koha::SuggestionEngine::Plugin::Null', 'Created record suggestor with implicitly scoped Null filter');
-$suggestor = Koha::SuggestionEngine->new( { plugins => ( 'Koha::SuggestionEngine::Plugin::Null' ) } );
+$suggestor = Koha::SuggestionEngine->new( { plugins => [ 'Koha::SuggestionEngine::Plugin::Null' ] } );
is(ref($suggestor->plugins->[0]), 'Koha::SuggestionEngine::Plugin::Null', 'Created record suggestor with explicitly scoped Null filter');
my $suggestions = $suggestor->get_suggestions({ 'search' => 'books' });
$suggestions = $suggestor->get_suggestions({ 'search' => 'silliness' });
eval {
- $suggestor = Koha::SuggestionEngine->new( { plugins => ( 'Koha::SuggestionEngine::Plugin::Null' ) } );
+ $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'Koha::SuggestionEngine::Plugin::Null' ] } );
undef $suggestor;
};
ok(!$@, 'Destroyed suggestor successfully');
'reported_tag' => undef,
'even' => 0,
'summary' => {
- 'authorized' => [ 'Cooking' ],
+ 'authorized' => [ { 'heading' => 'Cooking' } ],
'otherscript' => [],
'seefrom' => [ 'Cookery' ],
'notes' => [ 'Your quintessential poor heading selection' ],
} ], 1
});
-my $suggestor = Koha::SuggestionEngine->new( { plugins => ( 'AuthorityFile' ) } );
+my $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'AuthorityFile' ] } );
is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine');
my $result = $suggestor->get_suggestions({search => 'Cookery'});
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+ use_ok('Koha::SuggestionEngine');
+}
+
+my $suggestor = Koha::SuggestionEngine->new( { plugins => [ 'ExplodedTerms' ] } );
+is(ref($suggestor), 'Koha::SuggestionEngine', 'Created suggestion engine');
+
+my $result = $suggestor->get_suggestions({search => 'Cookery'});
+
+ok((grep { $_->{'search'} eq 'su-na=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-br=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-rl=Cookery' } @$result), "Suggested correct alternatives for keyword search 'Cookery'");
+
+$result = $suggestor->get_suggestions({search => 'su:Cookery'});
+
+ok((grep { $_->{'search'} eq 'su-na=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-br=Cookery' } @$result) && (grep { $_->{'search'} eq 'su-rl=Cookery' } @$result), "Suggested correct alternatives for subject search 'Cookery'");
+
+$result = $suggestor->get_suggestions({search => 'nt:Cookery'});
+
+is(scalar @$result, 0, "No suggestions for fielded search");
+
+$result = $suggestor->get_suggestions({search => 'ccl=su:Cookery'});
+
+is(scalar @$result, 0, "No suggestions for CCL search");
+
+done_testing();
my @expectedfields = qw( basketno
biblioitemnumber
biblionumber
- booksellerinvoicenumber
+ invoiceid
budgetdate
cancelledby
closedate
entrydate
firstname
freight
- gst
+ gstrate
listprice
notes
ordernumber
--- /dev/null
+use strict;
+use warnings;
+use 5.010;
+use DateTime;
+use DateTime::TimeZone;
+
+use C4::Context;
+use Test::More tests => 8;
+
+BEGIN { use_ok('Koha::Calendar'); }
+BEGIN { use_ok('C4::Calendar'); }
+
+my $branchcode = 'MPL';
+
+my $koha_calendar = Koha::Calendar->new( branchcode => $branchcode );
+my $c4_calendar = C4::Calendar->new( branchcode => $branchcode );
+
+isa_ok( $koha_calendar, 'Koha::Calendar', 'Koha::Calendar class returned' );
+isa_ok( $c4_calendar, 'C4::Calendar', 'C4::Calendar class returned' );
+
+my $sunday = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 26,
+);
+my $monday = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 27,
+);
+my $christmas = DateTime->new(
+ year => 2032,
+ month => 12,
+ day => 25,
+);
+my $newyear = DateTime->new(
+ year => 2035,
+ month => 1,
+ day => 1,
+);
+
+is( $koha_calendar->is_holiday($sunday), 1, 'Sunday is a closed day' );
+is( $koha_calendar->is_holiday($monday), 0, 'Monday is not a closed day' );
+is( $koha_calendar->is_holiday($christmas), 1, 'Christmas is a closed day' );
+is( $koha_calendar->is_holiday($newyear), 1, 'New Years day is a closed day' );
use C4::Branch;
use Test::More tests => 4;
+use MARC::Record;
+use C4::Biblio;
+use C4::Items;
BEGIN {
use FindBin;
use_ok('C4::Reserves');
}
+# Setup Test------------------------
+# Helper biblio.
+diag("\nCreating biblio instance for testing.");
+my ($bibnum, $title, $bibitemnum) = create_helper_biblio();
+
+# Helper item for that biblio.
+diag("Creating item instance for testing.");
+my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum);
+
+# Modify item; setting barcode.
+my $testbarcode = '97531';
+ModItem({ barcode => $testbarcode }, $bibnum, $itemnumber);
+
+# Get a borrower
my $dbh = C4::Context->dbh;
my $query = qq/SELECT borrowernumber
FROM borrowers
$sth->execute;
my $borrower = $sth->fetchrow_hashref;
-$query = qq/SELECT biblionumber, title, itemnumber, barcode
- FROM biblio
- LEFT JOIN items USING (biblionumber)
- WHERE barcode <> ""
- AND barcode IS NOT NULL
- LIMIT 1/;
-$sth = $dbh->prepare($query);
-$sth->execute;
-my $biblio = $sth->fetchrow_hashref;
-
-
my $borrowernumber = $borrower->{'borrowernumber'};
-my $biblionumber = $biblio->{'biblionumber'};
-my $itemnumber = $biblio->{'itemnumber'};
-my $barcode = $biblio->{'barcode'};
+my $biblionumber = $bibnum;
+my $barcode = $testbarcode;
my $constraint = 'a';
my $bibitems = '';
my $priority = '1';
+my $resdate = undef;
+my $expdate = undef;
my $notes = '';
-my $title = $biblio->{'title'};
my $checkitem = undef;
my $found = undef;
my $branch = $branches[0][0]{value};
AddReserve($branch, $borrowernumber, $biblionumber,
- $constraint, $bibitems, $priority, $notes,
+ $constraint, $bibitems, $priority, $resdate, $expdate, $notes,
$title, $checkitem, $found);
my ($status, $reserve, $all_reserves) = CheckReserves($itemnumber, $barcode);
($status, $reserve, $all_reserves) = CheckReserves(undef, $barcode);
ok($status eq "Reserved", "CheckReserves Test 3");
+
+# Teardown Test---------------------
+# Delete item.
+diag("Deleting item testing instance.");
+DelItem($dbh, $bibnum, $itemnumber);
+
+# Delete helper Biblio.
+diag("Deleting biblio testing instance.");
+DelBiblio($bibnum);
+
+# Helper method to set up a Biblio.
+sub create_helper_biblio {
+ my $bib = MARC::Record->new();
+ my $title = 'Silence in the library';
+ $bib->append_fields(
+ MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'),
+ MARC::Field->new('245', ' ', ' ', a => $title),
+ );
+ return ($bibnum, $title, $bibitemnum) = AddBiblio($bib, '');
+}
use C4::Debug;
require C4::Context;
-use Test::More tests => 57;
+use Test::More tests => 78;
use Test::MockModule;
use MARC::Record;
use File::Spec;
}
}
+# Testing exploding indexes
+my $term;
+my $searchmodule = new Test::MockModule('C4::Search');
+$searchmodule->mock('SimpleSearch', sub {
+ my $query = shift;
+
+ is($query, "Heading,wrdl=$term", "Searching for expected term '$term' for exploding") or return '', [], 0;
+
+ my $record = MARC::Record->new;
+ if ($query =~ m/Arizona/) {
+ $record->add_fields(
+ [ '001', '1234' ],
+ [ '151', ' ', ' ', a => 'Arizona' ],
+ [ '551', ' ', ' ', a => 'United States', w => 'g' ],
+ [ '551', ' ', ' ', a => 'Maricopa County', w => 'h' ],
+ [ '551', ' ', ' ', a => 'Navajo County', w => 'h' ],
+ [ '551', ' ', ' ', a => 'Pima County', w => 'h' ],
+ [ '551', ' ', ' ', a => 'New Mexico' ],
+ );
+ }
+ return '', [ $record->as_usmarc() ], 1;
+});
+
+$term = 'Arizona';
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ $term ], [ 'su-br' ], [ ], [], 0, 'en');
+matchesExplodedTerms("Advanced search for broader subjects", $query, 'Arizona', 'United States');
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ $term ], [ 'su-na' ], [ ], [], 0, 'en');
+matchesExplodedTerms("Advanced search for narrower subjects", $query, 'Arizona', 'Maricopa County', 'Navajo County', 'Pima County');
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ $term ], [ 'su-rl' ], [ ], [], 0, 'en');
+matchesExplodedTerms("Advanced search for related subjects", $query, 'Arizona', 'United States', 'Maricopa County', 'Navajo County', 'Pima County');
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ "$term", 'history' ], [ 'su-rl', 'kw' ], [ ], [], 0, 'en');
+matchesExplodedTerms("Advanced search for related subjects and keyword 'history' searches related subjects", $query, 'Arizona', 'United States', 'Maricopa County', 'Navajo County', 'Pima County');
+like($query, qr/history/, "Advanced search for related subjects and keyword 'history' searches for 'history'");
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ 'history', "$term" ], [ 'kw', 'su-rl' ], [ ], [], 0, 'en');
+matchesExplodedTerms("Order of terms doesn't matter for advanced search", $query, 'Arizona', 'United States', 'Maricopa County', 'Navajo County', 'Pima County');
+like($query, qr/history/, "Order of terms doesn't matter for advanced search");
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ "su-br:$term" ], [ ], [ ], [], 0, 'en');
+matchesExplodedTerms("Simple search for broader subjects", $query, 'Arizona', 'United States');
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ "su-na:$term" ], [ ], [ ], [], 0, 'en');
+matchesExplodedTerms("Simple search for narrower subjects", $query, 'Arizona', 'Maricopa County', 'Navajo County', 'Pima County');
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ "su-rl:$term" ], [ ], [ ], [], 0, 'en');
+matchesExplodedTerms("Simple search for related subjects", $query, 'Arizona', 'United States', 'Maricopa County', 'Navajo County', 'Pima County');
+
+( $error, $query, $simple_query, $query_cgi,
+$query_desc, $limit, $limit_cgi, $limit_desc,
+$stopwords_removed, $query_type ) = buildQuery([], [ "history and su-rl:$term" ], [ ], [ ], [], 0, 'en');
+matchesExplodedTerms("Simple search for related subjects and keyword 'history' searches related subjects", $query, 'Arizona', 'United States', 'Maricopa County', 'Navajo County', 'Pima County');
+like($query, qr/history/, "Simple search for related subjects and keyword 'history' searches for 'history'");
+
+sub matchesExplodedTerms {
+ my ($message, $query, @terms) = @_;
+ my $match = "(( or )?\\((" . join ('|', map { "su=\"$_\"" } @terms) . ")\\)){" . scalar(@terms) . "}";
+ like($query, qr/$match/, $message);
+}
+
1;
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More tests => 30;
BEGIN {
use_ok('C4::Tags');
}
+# Simple 'sequential 5' test
+my $tags = make_tags(1,2,3,4,5);
+my @strata = (0,1,2,3,4);
+my ($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'Sequential 5');
+is($min, 0, 'Sequential 5 min');
+is($max, 4, 'Sequential 5 max');
+
+# Reverse test - should have the same results as previous
+$tags = make_tags(5,4,3,2,1);
+@strata = (4,3,2,1,0);
+($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'Reverse Sequential 5');
+is($min, 0, 'Sequential 5 min');
+is($max, 4, 'Sequential 5 max');
+
+# All the same test - should all have the same results
+$tags = make_tags(4,4,4,4,4);
+@strata = (0,0,0,0,0);
+($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'All The Same');
+is($min, 0, 'Sequential 5 min');
+is($max, 0, 'Sequential 5 max');
+
+# Some the same, some different
+$tags = make_tags(1,2,2,3,3,8);
+@strata = (0,0,0,1,1,4);
+($min, $max) = C4::Tags::stratify_tags(5, $tags);
+check_tag_strata($tags, \@strata, 'All The Same');
+is($min, 0, 'Sequential 5 min');
+is($max, 7, 'Sequential 5 max');
+
+# Runs tests against the results
+sub check_tag_strata {
+ my ($tags, $expected, $name) = @_;
+
+ foreach my $t (@$tags) {
+ my $w = $t->{weight_total};
+ my $s = $t->{stratum};
+ is($s, shift @$expected, $name . " - $w ($s)");
+ }
+}
+
+# Makes some tags with just enough info to test
+sub make_tags {
+ my @res;
+ while (@_) {
+ push @res, { weight_total => shift @_ };
+ }
+ return \@res;
+}
undef, # $quantrec,
undef, # $user,
undef, # $cost,
+ undef, # $ecost,
$invoice, # $invoiceno,
undef, # $freight,
undef, # $rrp,
undef, # $quantrec,
undef, # $user,
undef, # $cost,
+ undef, # $ecost,
$param{'invoice'}, # $invoiceno,
undef, # $freight,
undef, # $rrp,
if (!defined $op) {
$template_name = "tools/batchMod.tmpl";
$template_flag = { tools => '*' };
+ $op = q{};
} else {
$template_name = ($del) ? "tools/batchMod-del.tmpl" : "tools/batchMod-edit.tmpl";
$template_flag = ($del) ? { tools => 'items_batchdel' } : { tools => 'items_batchmod' };
$template->param(%$items_display_hashref) if $items_display_hashref;
$template->param(
op => $nextop,
- $op => 1,
);
+$template->param( $op => 1 ) if $op;
if ($op eq "action") {
}
foreach my $error (@errors) {
- $template->param($error => 1);
+ $template->param($error => 1) if $error;
}
$template->param(src => $src);
+$template->param(biblionumber => $biblionumber);
output_html_with_http_headers $input, $cookie, $template->output;
exit;
use C4::Auth;
use C4::Output;
-
+use DateTime;
use C4::Calendar;
my $day = $input->param('showDay');
my $month = $input->param('showMonth');
my $year = $input->param('showYear');
+my $day1;
+my $month1;
+my $year1;
my $title = $input->param('showTitle');
my $description = $input->param('showDescription');
my $holidaytype = $input->param('showHolidayType');
-
+my $datecancelrange = $input->param('datecancelrange');
my $calendardate = sprintf("%04d-%02d-%02d", $year, $month, $day);
my $isodate = C4::Dates->new($calendardate, 'iso');
$calendardate = $isodate->output('syspref');
$description = '';
}
+# We format the date
+my @dateend = split(/[\/-]/, $datecancelrange);
+if (C4::Context->preference("dateformat") eq "metric") {
+ $day1 = $dateend[0];
+ $month1 = $dateend[1];
+ $year1 = $dateend[2];
+}elsif (C4::Context->preference("dateformat") eq "us") {
+ $month1 = $dateend[0];
+ $day1 = $dateend[1];
+ $year1 = $dateend[2];
+} else {
+ $year1 = $dateend[0];
+ $month1 = $dateend[1];
+ $day1 = $dateend[2];
+}
+
+# We make an array with holiday's days
+my @holiday_list;
+if ($year1 && $month1 && $day1){
+ my $first_dt = DateTime->new(year => $year, month => $month, day => $day);
+ my $end_dt = DateTime->new(year => $year1, month => $month1, day => $day1);
+
+ for (my $dt = $first_dt->clone();
+ $dt <= $end_dt;
+ $dt->add(days => 1) )
+ {
+ push @holiday_list, $dt->clone();
+ }
+}
if ($input->param('showOperation') eq 'exception') {
$calendar->insert_exception_holiday(day => $day,
month => $month,
year => $year,
title => $title,
description => $description);
+} elsif ($input->param('showOperation') eq 'exceptionrange' ) {
+ if (@holiday_list){
+ foreach my $date (@holiday_list){
+ $calendar->insert_exception_holiday(
+ day => $date->{local_c}->{day},
+ month => $date->{local_c}->{month},
+ year => $date->{local_c}->{year},
+ title => $title,
+ description => $description
+ );
+ }
+ }
} elsif ($input->param('showOperation') eq 'edit') {
if($holidaytype eq 'weekday') {
$calendar->ModWeekdayholiday(weekday => $weekday,
day => $day,
month => $month,
year => $year);
+}elsif ($input->param('showOperation') eq 'deleterange') {
+ if (@holiday_list){
+ foreach my $date (@holiday_list){
+ $calendar->delete_holiday_range(weekday => $weekday,
+ day => $date->{local_c}->{day},
+ month => $date->{local_c}->{month},
+ year => $date->{local_c}->{year});
+ }
+ }
+}elsif ($input->param('showOperation') eq 'deleterangerepeat') {
+ if (@holiday_list){
+ foreach my $date (@holiday_list){
+ $calendar->delete_holiday_range_repeatable(weekday => $weekday,
+ day => $date->{local_c}->{day},
+ month => $date->{local_c}->{month});
+ }
+ }
+}elsif ($input->param('showOperation') eq 'deleterangerepeatexcept') {
+ if (@holiday_list){
+ foreach my $date (@holiday_list){
+ $calendar->delete_exception_holiday_range(weekday => $weekday,
+ day => $date->{local_c}->{day},
+ month => $date->{local_c}->{month},
+ year => $date->{local_c}->{year});
+ }
+ }
}
print $input->redirect("/cgi-bin/koha/tools/holidays.pl?branch=$branchcode&calendardate=$calendardate");
}
if ($start_callnumber) {
- $sql_query .= " AND itemcallnumber <= ? ";
+ $sql_query .= " AND itemcallnumber >= ? ";
push @sql_params, $start_callnumber;
}
if ($end_callnumber) {
- $sql_query .= " AND itemcallnumber >= ? ";
+ $sql_query .= " AND itemcallnumber <= ? ";
push @sql_params, $end_callnumber;
}
if ($start_accession) {
use C4::Context;
use C4::Koha;
use C4::Auth;
+use C4::AuthoritiesMarc;
use C4::Output;
use C4::Biblio;
use C4::ImportBatch;
});
my %cookies = parse CGI::Cookie($cookie);
-my $sessionID = $cookies{'CGISESSID'}->value;
+our $sessionID = $cookies{'CGISESSID'}->value;
our $dbh = C4::Context->dbh;
# Frameworks selection loop
if ($import_batch_id eq '') {
import_batches_list($template, $offset, $results_per_page);
} else {
- import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+ import_records_list($template, $import_batch_id, $offset, $results_per_page);
}
} elsif ($op eq "commit-batch") {
if ($completedJobID) {
my $framework = $input->param('framework');
commit_batch($template, $import_batch_id, $framework);
}
- import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+ import_records_list($template, $import_batch_id, $offset, $results_per_page);
} elsif ($op eq "revert-batch") {
if ($completedJobID) {
add_saved_job_results_to_template($template, $completedJobID);
} else {
revert_batch($template, $import_batch_id);
}
- import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+ import_records_list($template, $import_batch_id, $offset, $results_per_page);
} elsif ($op eq "clean-batch") {
CleanBatch($import_batch_id);
import_batches_list($template, $offset, $results_per_page);
my $item_action = $input->param('item_action');
redo_matching($template, $import_batch_id, $new_matcher_id, $current_matcher_id,
$overlay_action, $nomatch_action, $item_action);
- import_biblios_list($template, $import_batch_id, $offset, $results_per_page);
+ import_records_list($template, $import_batch_id, $offset, $results_per_page);
}
output_html_with_http_headers $input, $cookie, $template->output;
$template->param('changed_item_action' => 1);
}
- if ($new_matcher_id eq $current_matcher_id) {
- return;
- }
-
my $num_with_matches = 0;
if (defined $new_matcher_id and $new_matcher_id ne "") {
my $matcher = C4::Matcher->fetch($new_matcher_id);
if (defined $matcher) {
- $num_with_matches = BatchFindBibDuplicates($import_batch_id, $matcher);
+ $num_with_matches = BatchFindDuplicates($import_batch_id, $matcher);
SetImportBatchMatcher($import_batch_id, $new_matcher_id);
} else {
$rematch_failed = 1;
}
} else {
- $num_with_matches = BatchFindBibDuplicates($import_batch_id, undef);
+ $num_with_matches = BatchFindDuplicates($import_batch_id, undef);
SetImportBatchMatcher($import_batch_id, undef);
SetImportBatchOverlayAction('create_new');
}
foreach my $batch (@$batches) {
push @list, {
import_batch_id => $batch->{'import_batch_id'},
- num_biblios => $batch->{'num_biblios'},
+ num_records => $batch->{'num_records'},
num_items => $batch->{'num_items'},
upload_timestamp => $batch->{'upload_timestamp'},
import_status => $batch->{'import_status'},
file_name => $batch->{'file_name'} || "($batch->{'batch_type'})",
comments => $batch->{'comments'},
can_clean => ($batch->{'import_status'} ne 'cleaned') ? 1 : 0,
+ record_type => $batch->{'record_type'},
};
}
$template->param(batch_list => \@list);
$callback = progress_callback($job, $dbh);
}
my ($num_added, $num_updated, $num_items_added, $num_items_errored, $num_ignored) =
- BatchCommitBibRecords($import_batch_id, $framework, 50, $callback);
+ BatchCommitRecords($import_batch_id, $framework, 50, $callback);
$dbh->commit();
my $results = {
$callback = progress_callback($job, $dbh);
}
my ($num_deleted, $num_errors, $num_reverted, $num_items_deleted, $num_ignored) =
- BatchRevertBibRecords($import_batch_id, 50, $callback);
+ BatchRevertRecords($import_batch_id, 50, $callback);
$dbh->commit();
my $results = {
my $import_batch_id = shift;
my $batch = GetImportBatch($import_batch_id);
- my $job = C4::BackgroundJob->new($sessionID, $batch->{'file_name'}, $ENV{'SCRIPT_NAME'}, $batch->{'num_biblios'});
+ my $job = C4::BackgroundJob->new($sessionID, $batch->{'file_name'}, $ENV{'SCRIPT_NAME'}, $batch->{'num_records'});
my $jobID = $job->id();
# fork off
add_results_to_template($template, $results);
}
-sub import_biblios_list {
+sub import_records_list {
my ($template, $import_batch_id, $offset, $results_per_page) = @_;
my $batch = GetImportBatch($import_batch_id);
- my $biblios = GetImportBibliosRange($import_batch_id, $offset, $results_per_page);
+ my $records = GetImportRecordsRange($import_batch_id, $offset, $results_per_page);
my @list = ();
- foreach my $biblio (@$biblios) {
- my $citation = $biblio->{'title'};
- $citation .= " $biblio->{'author'}" if $biblio->{'author'};
- $citation .= " (" if $biblio->{'issn'} or $biblio->{'isbn'};
- $citation .= $biblio->{'isbn'} if $biblio->{'isbn'};
- $citation .= ", " if $biblio->{'issn'} and $biblio->{'isbn'};
- $citation .= $biblio->{'issn'} if $biblio->{'issn'};
- $citation .= ")" if $biblio->{'issn'} or $biblio->{'isbn'};
-
- my $match = GetImportRecordMatches($biblio->{'import_record_id'}, 1);
+ foreach my $record (@$records) {
+ my $citation = $record->{'title'} || $record->{'authorized_heading'};
+ $citation .= " $record->{'author'}" if $record->{'author'};
+ $citation .= " (" if $record->{'issn'} or $record->{'isbn'};
+ $citation .= $record->{'isbn'} if $record->{'isbn'};
+ $citation .= ", " if $record->{'issn'} and $record->{'isbn'};
+ $citation .= $record->{'issn'} if $record->{'issn'};
+ $citation .= ")" if $record->{'issn'} or $record->{'isbn'};
+
+ my $match = GetImportRecordMatches($record->{'import_record_id'}, 1);
my $match_citation = '';
if ($#$match > -1) {
- $match_citation .= $match->[0]->{'title'} if defined($match->[0]->{'title'});
- $match_citation .= ' ' . $match->[0]->{'author'} if defined($match->[0]->{'author'});
+ if ($match->[0]->{'record_type'} eq 'biblio') {
+ $match_citation .= $match->[0]->{'title'} if defined($match->[0]->{'title'});
+ $match_citation .= ' ' . $match->[0]->{'author'} if defined($match->[0]->{'author'});
+ } elsif ($match->[0]->{'record_type'} eq 'auth') {
+ $match_citation .= $match->[0]->{'authorized_heading'} if defined($match->[0]->{'authorized_heading'});
+ }
}
push @list,
- { import_record_id => $biblio->{'import_record_id'},
- final_match_biblionumber => $biblio->{'matched_biblionumber'},
+ { import_record_id => $record->{'import_record_id'},
+ final_match_id => $record->{'matched_biblionumber'} || $record->{'matched_authid'},
citation => $citation,
- status => $biblio->{'status'},
- record_sequence => $biblio->{'record_sequence'},
- overlay_status => $biblio->{'overlay_status'},
- match_biblionumber => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
+ status => $record->{'status'},
+ record_sequence => $record->{'record_sequence'},
+ overlay_status => $record->{'overlay_status'},
+ # Sorry about the match_id being from the "biblionumber" field;
+ # as it turns out, any match id will go in biblionumber
+ match_id => $#$match > -1 ? $match->[0]->{'biblionumber'} : 0,
match_citation => $match_citation,
match_score => $#$match > -1 ? $match->[0]->{'score'} : 0,
+ record_type => $record->{'record_type'},
};
}
- my $num_biblios = $batch->{'num_biblios'};
- $template->param(biblio_list => \@list);
- add_page_numbers($template, $offset, $results_per_page, $num_biblios);
+ my $num_records = $batch->{'num_records'};
+ $template->param(record_list => \@list);
+ add_page_numbers($template, $offset, $results_per_page, $num_records);
$template->param(offset => $offset);
$template->param(range_top => $offset + $results_per_page - 1);
- $template->param(num_results => $num_biblios);
+ $template->param(num_results => $num_records);
$template->param(results_per_page => $results_per_page);
$template->param(import_batch_id => $import_batch_id);
my $overlay_action = GetImportBatchOverlayAction($import_batch_id);
$template->param(comments => $batch->{'comments'});
$template->param(import_status => $batch->{'import_status'});
$template->param(upload_timestamp => $batch->{'upload_timestamp'});
- $template->param(num_biblios => $batch->{'num_biblios'});
- $template->param(num_items => $batch->{'num_biblios'});
+ $template->{VARS}->{'record_type'} = $batch->{'record_type'};
+ $template->param(num_records => $batch->{'num_records'});
+ $template->param(num_items => $batch->{'num_items'});
if ($batch->{'import_status'} ne 'cleaned') {
$template->param(can_clean => 1);
}
- if ($batch->{'num_biblios'} > 0) {
+ if ($batch->{'num_records'} > 0) {
if ($batch->{'import_status'} eq 'staged' or $batch->{'import_status'} eq 'reverted') {
$template->param(can_commit => 1);
}
$description = '';
}
+# We make an array with holiday's days
+my @holiday_list;
+if ($year1 && $month1 && $day1){
+ my $first_dt = DateTime->new(year => $year, month => $month, day => $day);
+ my $end_dt = DateTime->new(year => $year1, month => $month1, day => $day1);
+
+ for (my $dt = $first_dt->clone();
+ $dt <= $end_dt;
+ $dt->add(days => 1) )
+ {
+ push @holiday_list, $dt->clone();
+ }
+}
+
if($allbranches) {
my $branch;
my @branchcodes = split(/\|/, $input->param('branchCodes'));
}
} elsif ( $newoperation eq 'holidayrange' ) {
- #Make an array with holiday's days
- my $first_dt = DateTime->new(year => $year, month => $month, day => $day);
- my $end_dt = DateTime->new(year => $year1, month => $month1, day => $day1);
- my @holiday_list = ();
-
- for (my $dt = $first_dt->clone();
- $dt <= $end_dt;
- $dt->add(days => 1) )
- {
- push @holiday_list, $dt->clone();
- }
-
- foreach my $date (@holiday_list){
- unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
- $calendar->insert_single_holiday(
- day => $date->{local_c}->{day},
- month => $date->{local_c}->{month},
- year => $date->{local_c}->{year},
- title => $title,
- description => $description
- );
+ if (@holiday_list){
+ foreach my $date (@holiday_list){
+ unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
+ $calendar->insert_single_holiday(
+ day => $date->{local_c}->{day},
+ month => $date->{local_c}->{month},
+ year => $date->{local_c}->{year},
+ title => $title,
+ description => $description
+ );
+ }
}
}
} elsif ( $newoperation eq 'holidayrangerepeat' ) {
- #Make an array with holiday's days
- my $first_dt = DateTime->new(year => $year, month => $month, day => $day);
- my $end_dt = DateTime->new(year => $year1, month => $month1, day => $day1);
- my @holiday_list = ();
-
- for (my $dt = $first_dt->clone();
- $dt <= $end_dt;
- $dt->add(days => 1) )
- {
- push @holiday_list, $dt->clone();
- }
-
- foreach my $date (@holiday_list){
- unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
- $calendar->insert_day_month_holiday(
- day => $date->{local_c}->{day},
- month => $date->{local_c}->{month},
- title => $title,
- description => $description
- );
+ if (@holiday_list){
+ foreach my $date (@holiday_list){
+ unless ( $calendar->isHoliday( $date->{local_c}->{day}, $date->{local_c}->{month}, $date->{local_c}->{year} ) ) {
+ $calendar->insert_day_month_holiday(
+ day => $date->{local_c}->{day},
+ month => $date->{local_c}->{month},
+ title => $title,
+ description => $description
+ );
+ }
}
}
}
$debug and warn "dirname = $dirname";
my $filesuffix;
if ( $uploadfilename =~ m/(\..+)$/i ) {
- my $filesuffix = $1;
+ $filesuffix = $1;
}
( $tfh, $tempfile ) = File::Temp::tempfile( SUFFIX => $filesuffix, UNLINK => 1 );
$debug and warn "tempfile = $tempfile";
my $parse_items = $input->param('parse_items');
my $item_action = $input->param('item_action');
my $comments = $input->param('comments');
+my $record_type = $input->param('record_type');
my $encoding = $input->param('encoding');
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "tools/stage-marc-import.tmpl",
# close STDOUT to signal to Apache that
# we're now running in the background
close STDOUT;
- close STDERR;
+ # close STDERR; # there is no good reason to close STDERR
} else {
# fork failed, so exit immediately
warn "fork failed while attempting to run $ENV{'SCRIPT_NAME'} as a background job";
}
# FIXME branch code
- my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($encoding, $marcrecord, $filename, $comments, '', $parse_items, 0, 50, staging_progress_callback($job, $dbh));
+ my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($record_type, $encoding, $marcrecord, $filename, $comments, '', $parse_items, 0, 50, staging_progress_callback($job, $dbh));
$dbh->commit();
if (defined $matcher) {
$checked_matches = 1;
$matcher_code = $matcher->code();
- $num_with_matches = BatchFindBibDuplicates($batch_id, $matcher,
+ $num_with_matches = BatchFindDuplicates($batch_id, $matcher,
10, 50, matching_progress_callback($job, $dbh));
SetImportBatchMatcher($batch_id, $matcher_id);
SetImportBatchOverlayAction($batch_id, $overlay_action);