# Logout from CAS
sub logout_cas {
my ($query) = @_;
- my $uri = $ENV{'SCRIPT_URI'};
+ my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name();
my $casparam = $query->param('cas');
# FIXME: This should be more generic and handle whatever parameters there might be
$uri .= "?cas=" . $casparam if (defined $casparam);
# Login to CAS
sub login_cas {
my ($query) = @_;
- my $uri = $ENV{'SCRIPT_URI'};
+ my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name();
my $casparam = $query->param('cas');
# FIXME: This should be more generic and handle whatever parameters there might be
$uri .= "?cas=" . $casparam if (defined $casparam);
sub login_cas_url {
my ($query, $key) = @_;
- my $uri = $ENV{'SCRIPT_URI'};
+ my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name();
my $casparam = $query->param('cas');
# FIXME: This should be more generic and handle whatever parameters there might be
$uri .= "?cas=" . $casparam if (defined $casparam);
$debug and warn "checkpw_cas";
my ($dbh, $ticket, $query) = @_;
my $retnumber;
- my $uri = $ENV{'SCRIPT_URI'};
+ my $uri = C4::Context->preference('OPACBaseURL') . $query->script_name();
my $casparam = $query->param('cas');
# FIXME: This should be more generic and handle whatever parameters there might be
$uri .= "?cas=" . $casparam if (defined $casparam);
$debug and warn "check_api_auth_cas";
my ($dbh, $PT, $query) = @_;
my $retnumber;
- my $url = $query->url();
+ my $url = C4::Context->preference('OPACBaseURL') . $query->script_name();
my $casparam = $query->param('cas');
$casparam = $defaultcasserver if (not defined $casparam);
# 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 );
+ 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++;
}
link_loop => \@this_link_loop,
separator => $separator
}
- unless ( $authors_subfield->[0] eq '9' );
+ unless ( $authors_subfield->[0] eq '9' || $authors_subfield->[0] eq '0');
$count_auth++;
}
push @marcauthors, { MARCAUTHOR_SUBFIELDS_LOOP => \@subfields_loop };
(branchcode,branchname,branchaddress1,
branchaddress2,branchaddress3,branchzip,branchcity,branchstate,
branchcountry,branchphone,branchfax,branchemail,
- branchurl,branchip,branchprinter,branchnotes)
- VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
+ branchurl,branchip,branchprinter,branchnotes,opac_info)
+ VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
";
my $sth = $dbh->prepare($query);
$sth->execute(
$data->{'branchphone'}, $data->{'branchfax'},
$data->{'branchemail'}, $data->{'branchurl'},
$data->{'branchip'}, $data->{'branchprinter'},
- $data->{'branchnotes'},
+ $data->{'branchnotes'}, $data->{opac_info},
);
return 1 if $dbh->err;
} else {
branchaddress2=?,branchaddress3=?,branchzip=?,
branchcity=?,branchstate=?,branchcountry=?,branchphone=?,
branchfax=?,branchemail=?,branchurl=?,branchip=?,
- branchprinter=?,branchnotes=?
+ branchprinter=?,branchnotes=?,opac_info=?
WHERE branchcode=?
";
my $sth = $dbh->prepare($query);
$data->{'branchphone'}, $data->{'branchfax'},
$data->{'branchemail'}, $data->{'branchurl'},
$data->{'branchip'}, $data->{'branchprinter'},
- $data->{'branchnotes'},
+ $data->{'branchnotes'}, $data->{opac_info},
$data->{'branchcode'},
);
}
use strict;
#use warnings; FIXME - Bug 2505
+use DateTime;
use C4::Context;
use C4::Stats;
use C4::Reserves;
use C4::Items;
use C4::Members;
use C4::Dates;
-use C4::Calendar;
+use C4::Dates qw(format_date);
use C4::Accounts;
use C4::ItemCirculationAlertPreference;
-use C4::Dates qw(format_date);
use C4::Message;
use C4::Debug;
-use Date::Calc qw(
- Today
- Today_and_Now
- Add_Delta_YM
- Add_Delta_DHMS
- Date_to_Days
- Day_of_Week
- Add_Delta_Days
- check_date
- Delta_Days
-);
-use POSIX qw(strftime);
use C4::Branch; # GetBranches
use C4::Log; # logaction
use Data::Dumper;
+use Koha::DateUtils;
+use Koha::Calendar;
+use Carp;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
my $branch_borrower_circ_rule = GetBranchBorrowerCircRule($branch, $cat_borrower);
if (defined($branch_borrower_circ_rule->{maxissueqty})) {
my @bind_params = ();
- my $branch_count_query = "SELECT COUNT(*) FROM issues
+ my $branch_count_query = "SELECT COUNT(*) FROM issues
JOIN items USING (itemnumber)
WHERE borrowernumber = ? ";
push @bind_params, $borrower->{borrowernumber};
#
# DUE DATE is OK ? -- should already have checked.
#
+ if ($duedate && ref $duedate ne 'DateTime') {
+ $duedate = dt_from_string($duedate);
+ }
+ my $now = DateTime->now( time_zone => C4::Context->tz() );
unless ( $duedate ) {
- my $issuedate = strftime( "%Y-%m-%d", localtime );
+ my $issuedate = $now->clone();
my $branch = _GetCircControlBranch($item,$borrower);
my $itype = ( C4::Context->preference('item-level_itypes') ) ? $item->{'itype'} : $biblioitem->{'itemtype'};
- $duedate = CalcDateDue( C4::Dates->new( $issuedate, 'iso' ), $itype, $branch, $borrower );
+ $duedate = CalcDateDue( $issuedate, $itype, $branch, $borrower );
# Offline circ calls AddIssue directly, doesn't run through here
# So issuingimpossible should be ok.
}
if ($duedate) {
- $needsconfirmation{INVALID_DATE} = $duedate->output('syspref')
- unless $duedate->output('iso') ge C4::Dates->today('iso');
+ my $today = $now->clone();
+ $today->truncate( to => 'minutes');
+ if (DateTime->compare($duedate,$today) == -1 ) { # duedate cannot be before now
+ $needsconfirmation{INVALID_DATE} = output_pref($duedate);
+ }
} else {
- $issuingimpossible{INVALID_DATE} = $duedate->output('syspref');
+ $issuingimpossible{INVALID_DATE} = output_pref($duedate);
}
#
if ( $borrower->{flags}->{'DBARRED'} ) {
$issuingimpossible{DEBARRED} = 1;
}
- if ( $borrower->{'dateexpiry'} eq '0000-00-00') {
+ if ( !defined $borrower->{dateexpiry} || $borrower->{'dateexpiry'} eq '0000-00-00') {
$issuingimpossible{EXPIRED} = 1;
} else {
- my @expirydate= split /-/,$borrower->{'dateexpiry'};
- if($expirydate[0]==0 || $expirydate[1]==0|| $expirydate[2]==0 ||
- Date_to_Days(Today) > Date_to_Days( @expirydate )) {
- $issuingimpossible{EXPIRED} = 1;
+ my ($y, $m, $d) = split /-/,$borrower->{'dateexpiry'};
+ if ($y && $m && $d) { # are we really writing oinvalid dates to borrs
+ my $expiry_dt = DateTime->new(
+ year => $y,
+ month => $m,
+ day => $d,
+ time_zone => C4::Context->tz,
+ );
+ $expiry_dt->truncate( to => 'days');
+ my $today = $now->clone()->truncate(to => 'days');
+ if (DateTime->compare($today, $expiry_dt) == 1) {
+ $issuingimpossible{EXPIRED} = 1;
+ }
+ } else {
+ carp("Invalid expity date in borr");
+ $issuingimpossible{EXPIRED} = 1;
}
}
#
# DEBTS
my ($amount) =
- C4::Members::GetMemberAccountRecords( $borrower->{'borrowernumber'}, '' && $duedate->output('iso') );
+ C4::Members::GetMemberAccountRecords( $borrower->{'borrowernumber'}, '' && $duedate->ymd() );
my $amountlimit = C4::Context->preference("noissuescharge");
my $allowfineoverride = C4::Context->preference("AllowFineOverride");
my $allfinesneedoverride = C4::Context->preference("AllFinesNeedOverride");
#
my ($current_loan_count, $max_loans_allowed) = TooMany( $borrower, $item->{biblionumber}, $item );
# if TooMany max_loans_allowed returns 0 the user doesn't have permission to check out this book
- if ($max_loans_allowed eq 0) {
+ if (defined $max_loans_allowed && $max_loans_allowed == 0) {
$needsconfirmation{PATRON_CANT} = 1;
} else {
if($max_loans_allowed){
my ( $borrower, $barcode, $datedue, $cancelreserve, $issuedate, $sipmode) = @_;
my $dbh = C4::Context->dbh;
my $barcodecheck=CheckValidBarcode($barcode);
+ if ($datedue && ref $datedue ne 'DateTime') {
+ $datedue = dt_from_string($datedue);
+ }
# $issuedate defaults to today.
if ( ! defined $issuedate ) {
- $issuedate = strftime( "%Y-%m-%d", localtime );
- # TODO: for hourly circ, this will need to be a C4::Dates object
- # and all calls to AddIssue including issuedate will need to pass a Dates object.
+ $issuedate = DateTime->now(time_zone => C4::Context->tz());
}
- if ($borrower and $barcode and $barcodecheck ne '0'){
+ else {
+ if ( ref $issuedate ne 'DateTime') {
+ $issuedate = dt_from_string($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 $branch = _GetCircControlBranch($item,$borrower);
# check if we just renew the issue.
#
if ($actualissue->{borrowernumber} eq $borrower->{'borrowernumber'}) {
- $datedue = AddRenewal(
- $borrower->{'borrowernumber'},
- $item->{'itemnumber'},
- $branch,
- $datedue,
- $issuedate, # here interpreted as the renewal date
+ $datedue = AddRenewal(
+ $borrower->{'borrowernumber'},
+ $item->{'itemnumber'},
+ $branch,
+ $datedue,
+ $issuedate, # here interpreted as the renewal date
);
}
else {
}
MoveReserve( $item->{'itemnumber'}, $borrower->{'borrowernumber'}, $cancelreserve );
-
# Starting process for transfer job (checking transfert and validate it if we have one)
my ($datesent) = GetTransfers($item->{'itemnumber'});
if ($datesent) {
# Record in the database the fact that the book was issued.
my $sth =
$dbh->prepare(
- "INSERT INTO issues
+ "INSERT INTO issues
(borrowernumber, itemnumber,issuedate, date_due, branchcode)
VALUES (?,?,?,?,?)"
);
unless ($datedue) {
my $itype = ( C4::Context->preference('item-level_itypes') ) ? $biblio->{'itype'} : $biblio->{'itemtype'};
- $datedue = CalcDateDue( C4::Dates->new( $issuedate, 'iso' ), $itype, $branch, $borrower );
+ $datedue = CalcDateDue( $issuedate, $itype, $branch, $borrower );
}
+ $datedue->truncate( to => 'minutes');
$sth->execute(
$borrower->{'borrowernumber'}, # borrowernumber
$item->{'itemnumber'}, # itemnumber
- $issuedate, # issuedate
- $datedue->output('iso'), # date_due
+ $issuedate->strftime('%Y-%m-%d %H:%M:00'), # issuedate
+ $datedue->strftime('%Y-%m-%d %H:%M:00'), # date_due
C4::Context->userenv->{'branch'} # branchcode
);
- $sth->finish;
if ( C4::Context->preference('ReturnToShelvingCart') ) { ## ReturnToShelvingCart is on, anything issued should be taken off the cart.
CartToShelf( $item->{'itemnumber'} );
}
ModItem({ issues => $item->{'issues'},
holdingbranch => C4::Context->userenv->{'branch'},
itemlost => 0,
- datelastborrowed => C4::Dates->new()->output('iso'),
- onloan => $datedue->output('iso'),
+ datelastborrowed => DateTime->now(time_zone => C4::Context->tz())->ymd(),
+ onloan => $datedue->ymd(),
}, $item->{'biblionumber'}, $item->{'itemnumber'});
ModDateLastSeen( $item->{'itemnumber'} );
my $dbh = C4::Context->dbh;
my $sth =
$dbh->prepare(
-"select issuelength from issuingrules where categorycode=? and itemtype=? and branchcode=? and issuelength is not null"
+'select issuelength, lengthunit from issuingrules where categorycode=? and itemtype=? and branchcode=? and issuelength is not null'
);
# warn "in get loan lenght $borrowertype $itemtype $branchcode ";
# try to find issuelength & return the 1st available.
# check with borrowertype, itemtype and branchcode, then without one of those parameters
$sth->execute( $borrowertype, $itemtype, $branchcode );
my $loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
- $sth->execute( $borrowertype, "*", $branchcode );
+ $sth->execute( $borrowertype, '*', $branchcode );
$loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
- $sth->execute( "*", $itemtype, $branchcode );
+ $sth->execute( '*', $itemtype, $branchcode );
$loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
- $sth->execute( "*", "*", $branchcode );
+ $sth->execute( '*', '*', $branchcode );
$loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
- $sth->execute( $borrowertype, $itemtype, "*" );
+ $sth->execute( $borrowertype, $itemtype, '*' );
$loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
- $sth->execute( $borrowertype, "*", "*" );
+ $sth->execute( $borrowertype, '*', '*' );
$loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
- $sth->execute( "*", $itemtype, "*" );
+ $sth->execute( '*', $itemtype, '*' );
$loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
- $sth->execute( "*", "*", "*" );
+ $sth->execute( '*', '*', '*' );
$loanlength = $sth->fetchrow_hashref;
- return $loanlength->{issuelength}
- if defined($loanlength) && $loanlength->{issuelength} ne 'NULL';
+ return $loanlength
+ if defined($loanlength) && $loanlength->{issuelength};
# if no rule is set => 21 days (hardcoded)
- return 21;
+ return {
+ issuelength => 21,
+ lengthunit => 'days',
+ };
+
}
);
$sth->execute( $borrowertype, $itemtype, $branchcode );
my $results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
$sth->execute( $borrowertype, "*", $branchcode );
$results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
$sth->execute( "*", $itemtype, $branchcode );
$results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
$sth->execute( "*", "*", $branchcode );
$results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
$sth->execute( $borrowertype, $itemtype, "*" );
$results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
$sth->execute( $borrowertype, "*", "*" );
$results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
$sth->execute( "*", $itemtype, "*" );
$results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
$sth->execute( "*", "*", "*" );
$results = $sth->fetchrow_hashref;
- return (C4::Dates->new($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
- if defined($results) && $results->{hardduedate} ne 'NULL';
+ return (dt_from_string($results->{hardduedate}, 'iso'),$results->{hardduedatecompare})
+ if defined($results) && $results->{hardduedate};
# if no rule is set => return undefined
return (undef, undef);
# define circControlBranch only if dropbox mode is set
# don't allow dropbox mode to create an invalid entry in issues (issuedate > today)
# FIXME: check issuedate > returndate, factoring in holidays
- $circControlBranch = _GetCircControlBranch($item,$borrower) unless ( $item->{'issuedate'} eq C4::Dates->today('iso') );;
+ #$circControlBranch = _GetCircControlBranch($item,$borrower) unless ( $item->{'issuedate'} eq C4::Dates->today('iso') );;
+ $circControlBranch = _GetCircControlBranch($item,$borrower);
}
if ($borrowernumber) {
sub MarkIssueReturned {
my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate, $privacy ) = @_;
my $dbh = C4::Context->dbh;
- my $query = "UPDATE issues SET returndate=";
+ my $query = 'UPDATE issues SET returndate=';
my @bind;
if ($dropbox_branch) {
- my $calendar = C4::Calendar->new( branchcode => $dropbox_branch );
- my $dropboxdate = $calendar->addDate( C4::Dates->new(), -1 );
- $query .= " ? ";
- push @bind, $dropboxdate->output('iso');
+ my $calendar = Koha::Calendar->new( branchcode => $dropbox_branch );
+ my $dropboxdate = $calendar->addDate( DateTime->now( time_zone => C4::Context->tz), -1 );
+ $query .= ' ? ';
+ push @bind, $dropboxdate->strftime('%Y-%m-%d %H:%M');
} elsif ($returndate) {
- $query .= " ? ";
+ $query .= ' ? ';
push @bind, $returndate;
} else {
- $query .= " now() ";
+ $query .= ' now() ';
}
- $query .= " WHERE borrowernumber = ? AND itemnumber = ?";
+ $query .= ' WHERE borrowernumber = ? AND itemnumber = ?';
push @bind, $borrowernumber, $itemnumber;
# FIXME transaction
my $sth_upd = $dbh->prepare($query);
$sth_upd->execute(@bind);
- my $sth_copy = $dbh->prepare("INSERT INTO old_issues SELECT * FROM issues
+ my $sth_copy = $dbh->prepare('INSERT INTO old_issues SELECT * FROM issues
WHERE borrowernumber = ?
- AND itemnumber = ?");
+ AND itemnumber = ?');
$sth_copy->execute($borrowernumber, $itemnumber);
# anonymise patron checkout immediately if $privacy set to 2 and AnonymousPatron is set to a valid borrowernumber
if ( $privacy == 2) {
sub _FixFineDaysOnReturn {
my ( $borrower, $item, $datedue ) = @_;
-
- if ($datedue) {
- $datedue = C4::Dates->new( $datedue, "iso" );
- } else {
- return;
- }
+ return unless ($datedue);
+
+ my $dt_due = dt_from_string( $datedue );
+ my $dt_today = DateTime->now( time_zone => C4::Context->tz() );
my $branchcode = _GetCircControlBranch( $item, $borrower );
- my $calendar = C4::Calendar->new( branchcode => $branchcode );
- my $today = C4::Dates->new();
+ my $calendar = Koha::Calendar->new( branchcode => $branchcode );
- my $deltadays = $calendar->daysBetween( $datedue, C4::Dates->new() );
+ # $deltadays is a DateTime::Duration object
+ my $deltadays = $calendar->days_between( $dt_due, $dt_today );
my $circcontrol = C4::Context::preference('CircControl');
my $issuingrule = GetIssuingRule( $borrower->{categorycode}, $item->{itype}, $branchcode );
# exit if no finedays defined
return unless $finedays;
- my $grace = $issuingrule->{firstremind};
-
- if ( $deltadays - $grace > 0 ) {
- my @newdate = Add_Delta_Days( Today(), $deltadays * $finedays );
- my $isonewdate = join( '-', @newdate );
- my ( $deby, $debm, $debd ) = split( /-/, $borrower->{debarred} );
- if ( check_date( $deby, $debm, $debd ) ) {
- my @olddate = split( /-/, $borrower->{debarred} );
-
- if ( Delta_Days( @olddate, @newdate ) > 0 ) {
- C4::Members::DebarMember( $borrower->{borrowernumber}, $isonewdate );
- return $isonewdate;
+ my $grace = DateTime::Duration->new( days => $issuingrule->{firstremind} );
+
+ if ( ( $deltadays - $grace )->is_positive ) { # you can't compare DateTime::Durations with logical operators
+ my $new_debar_dt = $dt_today->clone()->add_duration( $deltadays * $finedays );
+ my $borrower_debar_dt = dt_from_string( $borrower->{debarred} );
+ # check to see if the current debar date is a valid date
+ if ( $borrower->{debarred} && $borrower_debar_dt ) {
+ # if so, is it before the new date? update only if true
+ if ( DateTime->compare( $borrower_debar_dt, $new_debar_dt ) == -1 ) {
+ C4::Members::DebarMember( $borrower->{borrowernumber}, $new_debar_dt->ymd() );
+ return $new_debar_dt->ymd();
}
+ # if the borrower's debar date is not set or valid, debar them
} else {
- C4::Members::DebarMember( $borrower->{borrowernumber}, $isonewdate );
- return $isonewdate;
+ C4::Members::DebarMember( $borrower->{borrowernumber}, $new_debar_dt->ymd() );
+ return $new_debar_dt->ymd();
}
}
}
return unless $itemnumber;
my $sth = C4::Context->dbh->prepare(
"SELECT *
- FROM issues
+ FROM issues
LEFT JOIN items ON issues.itemnumber=items.itemnumber
WHERE issues.itemnumber=?");
$sth->execute($itemnumber);
my $data = $sth->fetchrow_hashref;
return unless $data;
- $data->{'overdue'} = ($data->{'date_due'} lt C4::Dates->today('iso')) ? 1 : 0;
- return ($data);
+ $data->{issuedate} = dt_from_string($data->{issuedate}, 'sql');
+ $data->{issuedate}->truncate(to => 'minutes');
+ $data->{date_due} = dt_from_string($data->{date_due}, 'sql');
+ $data->{date_due}->truncate(to => 'minutes');
+ my $dt = DateTime->now( time_zone => C4::Context->tz)->truncate( to => 'minutes');
+ $data->{'overdue'} = DateTime->compare($data->{'date_due'}, $dt ) == -1 ? 1 : 0;
+ return $data;
}
=head2 GetOpenIssue
sub GetItemIssues {
my ( $itemnumber, $history ) = @_;
- my $today = C4::Dates->today('iso'); # get today date
- my $sql = "SELECT * FROM issues
+ my $today = DateTime->now( time_zome => C4::Context->tz); # get today date
+ $today->truncate( to => 'minutes' );
+ my $sql = "SELECT * FROM issues
JOIN borrowers USING (borrowernumber)
JOIN items USING (itemnumber)
WHERE issues.itemnumber = ? ";
if ($history) {
$sql .= "UNION ALL
- SELECT * FROM old_issues
+ SELECT * FROM old_issues
LEFT JOIN borrowers USING (borrowernumber)
JOIN items USING (itemnumber)
WHERE old_issues.itemnumber = ? ";
}
my $results = $sth->fetchall_arrayref({});
foreach (@$results) {
- $_->{'overdue'} = ($_->{'date_due'} lt $today) ? 1 : 0;
+ my $date_due = dt_from_string($_->{date_due},'sql');
+ $date_due->truncate( to => 'minutes' );
+
+ $_->{overdue} = (DateTime->compare($date_due, $today) == -1) ? 1 : 0;
}
return $results;
}
SELECT
borrowers.categorycode, biblioitems.itemtype, issues.renewals, renewalsallowed, $controlbranch
FROM issuingrules,
- issues
+ issues
LEFT JOIN items USING (itemnumber)
LEFT JOIN borrowers USING (borrowernumber)
LEFT JOIN biblioitems USING (biblioitemnumber)
my $itemnumber = shift or return undef;
my $branch = shift;
my $datedue = shift;
- my $lastreneweddate = shift || C4::Dates->new()->output('iso');
+ 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;
$sth->execute( $borrowernumber, $itemnumber );
my $issuedata = $sth->fetchrow_hashref;
$sth->finish;
- if($datedue && ! $datedue->output('iso')){
- warn "Invalid date passed to AddRenewal.";
- return undef;
+ if(defined $datedue && ref $datedue ne 'DateTime' ) {
+ carp 'Invalid date passed to AddRenewal.';
+ return;
}
# If the due date wasn't specified, calculate it by adding the
# book's loan length to today's date or the current due date
my $itemtype = (C4::Context->preference('item-level_itypes')) ? $biblio->{'itype'} : $biblio->{'itemtype'};
$datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ?
- C4::Dates->new($issuedata->{date_due}, 'iso') :
- C4::Dates->new();
+ $issuedata->{date_due} :
+ DateTime->now( time_zone => C4::Context->tz());
$datedue = CalcDateDue($datedue,$itemtype,$issuedata->{'branchcode'},$borrower);
}
WHERE borrowernumber=?
AND itemnumber=?"
);
- $sth->execute( $datedue->output('iso'), $renews, $lastreneweddate, $borrowernumber, $itemnumber );
+
+ $sth->execute( $datedue->strftime('%Y-%m-%d %H:%M'), $renews, $lastreneweddate, $borrowernumber, $itemnumber );
$sth->finish;
# Update the renewal count on the item, and tell zebra to reindex
$renews = $biblio->{'renewals'} + 1;
- ModItem({ renewals => $renews, onloan => $datedue->output('iso') }, $biblio->{'biblionumber'}, $itemnumber);
+ ModItem({ renewals => $renews, onloan => $datedue->strftime('%Y-%m-%d %H:%M')}, $biblio->{'biblionumber'}, $itemnumber);
# Charge a new rental fee, if applicable?
my ( $charge, $type ) = GetIssuingCharges( $itemnumber, $borrowernumber );
$sth->execute( $borrowernumber, $accountno, $charge, $manager_id,
"Renewal of Rental Item $item->{'title'} $item->{'barcode'}",
'Rent', $charge, $itemnumber );
- $sth->finish;
}
# Log the renewal
UpdateStats( $branch, 'renew', $charge, '', $itemnumber, $item->{itype}, $borrowernumber);
=cut
-sub CalcDateDue {
- my ($startdate,$itemtype,$branch,$borrower) = @_;
- my $datedue;
- my $loanlength = GetLoanLength($borrower->{'categorycode'},$itemtype, $branch);
+sub CalcDateDue {
+ my ( $startdate, $itemtype, $branch, $borrower ) = @_;
- # if globalDueDate ON the datedue is set to that date
- if ( C4::Context->preference('globalDueDate')
- && ( C4::Context->preference('globalDueDate') =~ C4::Dates->regexp('syspref') ) ) {
- $datedue = C4::Dates->new( C4::Context->preference('globalDueDate') );
- } else {
- # otherwise, calculate the datedue as normal
- if(C4::Context->preference('useDaysMode') eq 'Days') { # ignoring calendar
- my $timedue = time + ($loanlength) * 86400;
- #FIXME - assumes now even though we take a startdate
- my @datearr = localtime($timedue);
- $datedue = C4::Dates->new( sprintf("%04d-%02d-%02d", 1900 + $datearr[5], $datearr[4] + 1, $datearr[3]), 'iso');
- } else {
- my $calendar = C4::Calendar->new( branchcode => $branch );
- $datedue = $calendar->addDate($startdate, $loanlength);
- }
- }
+ # loanlength now a href
+ my $loanlength =
+ GetLoanLength( $borrower->{'categorycode'}, $itemtype, $branch );
- # if Hard Due Dates are used, retreive them and apply as necessary
- my ($hardduedate, $hardduedatecompare) = GetHardDueDate($borrower->{'categorycode'},$itemtype, $branch);
- if ( $hardduedate && $hardduedate->output('iso') && $hardduedate->output('iso') ne '0000-00-00') {
- # if the calculated due date is after the 'before' Hard Due Date (ceiling), override
- if ( $datedue->output( 'iso' ) gt $hardduedate->output( 'iso' ) && $hardduedatecompare == -1) {
- $datedue = $hardduedate;
- # if the calculated date is before the 'after' Hard Due Date (floor), override
- } elsif ( $datedue->output( 'iso' ) lt $hardduedate->output( 'iso' ) && $hardduedatecompare == 1) {
- $datedue = $hardduedate;
- # if the hard due date is set to 'exactly', overrride
- } elsif ( $hardduedatecompare == 0) {
- $datedue = $hardduedate;
- }
- # in all other cases, keep the date due as it is
- }
+ my $datedue;
- # if ReturnBeforeExpiry ON the datedue can't be after borrower expirydate
- if ( C4::Context->preference('ReturnBeforeExpiry') && $datedue->output('iso') gt $borrower->{dateexpiry} ) {
- $datedue = C4::Dates->new( $borrower->{dateexpiry}, 'iso' );
- }
-
- return $datedue;
-}
-
-=head2 CheckValidDatedue
-
- $newdatedue = CheckValidDatedue($date_due,$itemnumber,$branchcode);
+ # if globalDueDate ON the datedue is set to that date
+ if (C4::Context->preference('globalDueDate')
+ && ( C4::Context->preference('globalDueDate') =~
+ C4::Dates->regexp('syspref') )
+ ) {
+ $datedue = dt_from_string(
+ C4::Context->preference('globalDueDate'),
+ C4::Context->preference('dateformat')
+ );
+ } else {
-This function does not account for holiday exceptions nor does it handle the 'useDaysMode' syspref .
-To be replaced by CalcDateDue() once C4::Calendar use is tested.
+ # otherwise, calculate the datedue as normal
+ if ( C4::Context->preference('useDaysMode') eq 'Days' )
+ { # ignoring calendar
+ my $dt =
+ DateTime->now( time_zone => C4::Context->tz() )
+ ->truncate( to => 'minute' );
+ if ( $loanlength->{lengthunit} eq 'hours' ) {
+ $dt->add( hours => $loanlength->{issuelength} );
+ return $dt;
+ } else { # days
+ $dt->add( days => $loanlength->{issuelength} );
+ $dt->set_hour(23);
+ $dt->set_minute(59);
+ return $dt;
+ }
+ } else {
+ my $dur;
+ if ($loanlength->{lengthunit} eq 'hours') {
+ $dur = DateTime::Duration->new( hours => $loanlength->{issuelength});
+ }
+ else { # days
+ $dur = DateTime::Duration->new( days => $loanlength->{issuelength});
+ }
+ if (ref $startdate ne 'DateTime' ) {
+ $startdate = dt_from_string($startdate);
+ }
+ my $calendar = Koha::Calendar->new( branchcode => $branch );
+ $datedue = $calendar->addDate( $startdate, $dur, $loanlength->{lengthunit} );
+ if ($loanlength->{lengthunit} eq 'days') {
+ $datedue->set_hour(23);
+ $datedue->set_minute(59);
+ }
+ }
+ }
-this function validates the loan length against the holidays calendar, and adjusts the due date as per the 'useDaysMode' syspref.
-C<$date_due> = returndate calculate with no day check
-C<$itemnumber> = itemnumber
-C<$branchcode> = location of issue (affected by 'CircControl' syspref)
-C<$loanlength> = loan length prior to adjustment
+ # if Hard Due Dates are used, retreive them and apply as necessary
+ my ( $hardduedate, $hardduedatecompare ) =
+ GetHardDueDate( $borrower->{'categorycode'}, $itemtype, $branch );
+ if ($hardduedate) { # hardduedates are currently dates
+ $hardduedate->truncate( to => 'minute' );
+ $hardduedate->set_hour(23);
+ $hardduedate->set_minute(59);
+ my $cmp = DateTime->compare( $hardduedate, $datedue );
+
+# if the calculated due date is after the 'before' Hard Due Date (ceiling), override
+# if the calculated date is before the 'after' Hard Due Date (floor), override
+# if the hard due date is set to 'exactly', overrride
+ if ( $hardduedatecompare == 0 || $hardduedatecompare == $cmp ) {
+ $datedue = $hardduedate->clone;
+ }
-=cut
+ # in all other cases, keep the date due as it is
+ }
-sub CheckValidDatedue {
-my ($date_due,$itemnumber,$branchcode)=@_;
-my @datedue=split('-',$date_due->output('iso'));
-my $years=$datedue[0];
-my $month=$datedue[1];
-my $day=$datedue[2];
-# die "Item# $itemnumber ($branchcode) due: " . ${date_due}->output() . "\n(Y,M,D) = ($years,$month,$day)":
-my $dow;
-for (my $i=0;$i<2;$i++){
- $dow=Day_of_Week($years,$month,$day);
- ($dow=0) if ($dow>6);
- my $result=CheckRepeatableHolidays($itemnumber,$dow,$branchcode);
- my $countspecial=CheckSpecialHolidays($years,$month,$day,$itemnumber,$branchcode);
- my $countspecialrepeatable=CheckRepeatableSpecialHolidays($month,$day,$itemnumber,$branchcode);
- if (($result ne '0') or ($countspecial ne '0') or ($countspecialrepeatable ne '0') ){
- $i=0;
- (($years,$month,$day) = Add_Delta_Days($years,$month,$day, 1))if ($i ne '1');
+ # if ReturnBeforeExpiry ON the datedue can't be after borrower expirydate
+ if ( C4::Context->preference('ReturnBeforeExpiry') ) {
+ my $expiry_dt = dt_from_string( $borrower->{dateexpiry}, 'iso' );
+ if ( DateTime->compare( $datedue, $expiry_dt ) == 1 ) {
+ $datedue = $expiry_dt->clone;
}
}
- my $newdatedue=C4::Dates->new(sprintf("%04d-%02d-%02d",$years,$month,$day),'iso');
-return $newdatedue;
+
+ return $datedue;
}
use C4::Boolean;
use C4::Debug;
use POSIX ();
+use DateTime::TimeZone;
=head1 NAME
$self->{"userenv"} = undef; # User env
$self->{"activeuser"} = undef; # current active user
$self->{"shelves"} = undef;
+ $self->{tz} = undef; # local timezone object
bless $self, $class;
return $self;
}
+=head2 tz
+
+ C4::Context->tz
+
+ Returns a DateTime::TimeZone object for the system timezone
+
+=cut
+
+sub tz {
+ my $self = shift;
+ if (!defined $context->{tz}) {
+ $context->{tz} = DateTime::TimeZone->new(name => 'local');
+ }
+ return $context->{tz};
+}
+
+
+
1;
__END__
use XML::Simple;
use HTML::Entities;
use CGI;
+use DateTime;
=head1 NAME
# Hashref building
my $out;
$out->{'renewals'} = $issue->{'renewals'};
- $out->{'date_due'} = $issue->{'date_due'};
+ $out->{date_due} = $issue->{date_due}->strftime('%Y-%m-%d %H:%S');
$out->{'success'} = $renewal[0];
$out->{'error'} = $renewal[1];
'DateTime' => {
'usage' => 'Core',
'required' => '1',
- 'min_ver' => '0.51'
+ 'min_ver' => '0.58'
+ },
+ 'DateTime::TimeZone' => {
+ 'usage' => 'Core',
+ 'required' => '1',
+ 'min_ver' => '1.26'
+ },
+ 'DateTime::Format::DateParse' => {
+ 'usage' => 'Core',
+ 'required' => '1',
+ 'min_ver' => '0.04'
+ },
+ 'DateTime::Set' => {
+ 'usage' => 'Core',
+ 'required' => '1',
+ 'min_ver' => '0.28'
+ },
+ 'DateTime::Event::ICal' => {
+ 'usage' => 'Core',
+ 'required' => '1',
+ 'min_ver' => '0.08'
+ },
+ 'Readonly' => {
+ 'usage' => 'Core',
+ 'required' => '1',
+ 'min_ver' => '1.03'
+ },
+ 'Readonly::XS' => {
+ 'usage' => 'Core',
+ 'required' => '0',
+ 'min_ver' => '1.02'
},
'Graphics::Magick' => {
'usage' => 'Patron Card Creator Feature',
items.notforloan as itemnotforloan,
itemtypes.description,
itemtypes.notforloan as notforloan_per_itemtype,
- holding.branchurl
+ holding.branchurl,
+ holding.branchname,
+ holding.opac_info as branch_opac_info
FROM items
LEFT JOIN branches AS holding ON items.holdingbranch = holding.branchcode
LEFT JOIN branches AS home ON items.homebranch=home.branchcode
use C4::SQLHelper qw(InsertInTable UpdateInTable SearchInTable);
use C4::Members::Attributes qw(SearchIdMatchingAttribute);
use C4::NewsChannels; #get slip news
+use DateTime;
+use DateTime::Format::DateParse;
+use Koha::DateUtils;
our ($VERSION,@ISA,@EXPORT,@EXPORT_OK,$debug);
"SELECT COUNT(*) as latedocs
FROM issues
WHERE borrowernumber = ?
- AND date_due < curdate()"
+ AND date_due < now()"
);
$sth->execute($borrowernumber);
my $latedocs = $sth->fetchrow_hashref->{'latedocs'};
$sth = $dbh->prepare(
"SELECT COUNT(*) FROM issues
WHERE borrowernumber = ?
- AND date_due < curdate()"
+ AND date_due < now()"
);
$sth->execute($borrowernumber);
my $overdue_count = $sth->fetchrow_arrayref->[0];
my $sth = C4::Context->dbh->prepare($query);
$sth->execute(@borrowernumbers);
my $data = $sth->fetchall_arrayref({});
- my $today = C4::Dates->new->output('iso');
+ my $tz = C4::Context->tz();
+ my $today = DateTime->now( time_zone => $tz);
foreach (@{$data}) {
- if ($_->{date_due} and $_->{date_due} lt $today) {
+ if ($_->{issuedate}) {
+ $_->{issuedate} = dt_from_string($_->{issuedate}, 'sql');
+ }
+ $_->{date_due} or next;
+ $_->{date_due} = DateTime::Format::DateParse->parse_datetime($_->{date_due}, $tz->name());
+ if ( DateTime->compare($_->{date_due}, $today) == -1 ) {
$_->{overdue} = 1;
}
}
sub GetAttributeTypes {
my ($all) = @_;
- my $select = $all ? '*' : 'code, description';
+ my $select = $all ? '*' : 'code, description, class';
my $dbh = C4::Context->dbh;
my $sth = $dbh->prepare("SELECT $select FROM borrower_attribute_types ORDER by code");
$sth->execute();
$self->{'staff_searchable'} = 0;
$self->{'display_checkout'} = 0;
$self->{'authorised_value_category'} = '';
+ $self->{'category_code'} = '';
+ $self->{'category_description'} = '';
+ $self->{'class'} = '';
bless $self, $class;
return $self;
my $self = {};
my $dbh = C4::Context->dbh();
- my $sth = $dbh->prepare_cached("SELECT * FROM borrower_attribute_types WHERE code = ?");
+ my $sth = $dbh->prepare_cached("
+ SELECT borrower_attribute_types.*, categories.description AS category_description
+ FROM borrower_attribute_types
+ LEFT JOIN categories ON borrower_attribute_types.category_code=categories.categorycode
+ WHERE code =?");
$sth->execute($code);
my $row = $sth->fetchrow_hashref;
$sth->finish();
- return undef unless defined $row;
+ return undef unless defined $row;
$self->{'code'} = $row->{'code'};
$self->{'description'} = $row->{'description'};
$self->{'staff_searchable'} = $row->{'staff_searchable'};
$self->{'display_checkout'} = $row->{'display_checkout'};
$self->{'authorised_value_category'} = $row->{'authorised_value_category'};
+ $self->{'category_code'} = $row->{'category_code'};
+ $self->{'category_description'} = $row->{'category_description'};
+ $self->{'class'} = $row->{'class'};
bless $self, $class;
return $self;
password_allowed = ?,
staff_searchable = ?,
authorised_value_category = ?,
- display_checkout = ?
+ display_checkout = ?,
+ category_code = ?,
+ class = ?
WHERE code = ?");
} else {
$sth = $dbh->prepare_cached("INSERT INTO borrower_attribute_types
(description, repeatable, unique_id, opac_display, password_allowed,
- staff_searchable, authorised_value_category, display_checkout, code)
+ staff_searchable, authorised_value_category, display_checkout, category_code, class, code)
VALUES (?, ?, ?, ?, ?,
- ?, ?, ?, ?)");
+ ?, ?, ?, ?, ?, ?)");
}
$sth->bind_param(1, $self->{'description'});
$sth->bind_param(2, $self->{'repeatable'});
$sth->bind_param(6, $self->{'staff_searchable'});
$sth->bind_param(7, $self->{'authorised_value_category'});
$sth->bind_param(8, $self->{'display_checkout'});
- $sth->bind_param(9, $self->{'code'});
+ $sth->bind_param(9, $self->{'category_code'} || undef);
+ $sth->bind_param(10, $self->{'class'});
+ $sth->bind_param(11, $self->{'code'});
$sth->execute;
}
@_ ? $self->{'authorised_value_category'} = shift : $self->{'authorised_value_category'};
}
+=head2 category_code
+
+=over 4
+
+my $category_code = $attr_type->category_code();
+$attr_type->category_code($category_code);
+
+=back
+
+Accessor.
+
+=cut
+
+sub category_code {
+ my $self = shift;
+ @_ ? $self->{'category_code'} = shift : $self->{'category_code'};
+}
+
+=head2 category_description
+
+=over 4
+
+my $category_description = $attr_type->category_description();
+$attr_type->category_description($category_description);
+
+=back
+
+Accessor.
+
+=cut
+
+sub category_description {
+ my $self = shift;
+ @_ ? $self->{'category_description'} = shift : $self->{'category_description'};
+}
+
+=head2 class
+
+=over 4
+
+my $class = $attr_type->class();
+$attr_type->class($class);
+
+=back
+
+Accessor.
+
+=cut
+
+sub class {
+ my $self = shift;
+ @_ ? $self->{'class'} = shift : $self->{'class'};
+}
+
+
=head2 delete
$attr_type->delete();
my $opac_only = @_ ? shift : 0;
my $dbh = C4::Context->dbh();
- my $query = "SELECT code, description, attribute, lib, password, display_checkout
+ my $query = "SELECT code, description, attribute, lib, password, display_checkout, category_code, class
FROM borrower_attributes
JOIN borrower_attribute_types USING (code)
LEFT JOIN authorised_values ON (category = authorised_value_category AND attribute = authorised_value)
value_description => $row->{'lib'},
password => $row->{'password'},
display_checkout => $row->{'display_checkout'},
+ category_code => $row->{'category_code'},
+ class => $row->{'class'},
}
}
return \@results;
SELECT issues.*, items.itype as itemtype, items.homebranch, items.barcode
FROM issues
LEFT JOIN items USING (itemnumber)
- WHERE date_due < CURDATE()
+ WHERE date_due < NOW()
";
} else {
$statement = "
FROM issues
LEFT JOIN items USING (itemnumber)
LEFT JOIN biblioitems USING (biblioitemnumber)
- WHERE date_due < CURDATE()
+ WHERE date_due < NOW()
";
}
LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
LEFT JOIN biblioitems ON items.biblioitemnumber = biblioitems.biblioitemnumber
WHERE issues.borrowernumber = ?
- AND issues.date_due < CURDATE()"
+ AND issues.date_due < NOW()"
);
# FIXME: SELECT * across 4 tables? do we really need the marc AND marcxml blobs??
$sth->execute($borrowernumber);
=head2 CalcFine
- ($amount, $chargename, $daycount, $daycounttotal) = &CalcFine($item,
- $categorycode, $branch, $days_overdue,
- $description, $start_date, $end_date );
+ ($amount, $chargename, $daycounttotal) = &CalcFine($item,
+ $categorycode, $branch,
+ $start_dt, $end_dt );
Calculates the fine for a book.
C<$branchcode> is the library (string) whose issuingrules govern this transaction.
-C<$days_overdue> is the number of days elapsed since the book's due date.
- NOTE: supplying days_overdue is deprecated.
-
-C<$start_date> & C<$end_date> are C4::Dates objects
+C<$start_date> & C<$end_date> are DateTime objects
defining the date range over which to determine the fine.
-Note that if these are defined, we ignore C<$difference> and C<$dues> ,
-but retain these for backwards-comptibility with extant fines scripts.
Fines scripts should just supply the date range over which to calculate the fine.
C<$daycount> is the number of days between start and end dates, Calendar adjusted (where needed),
minus any applicable grace period.
-C<$daycounttotal> is C<$daycount> without consideration of grace period.
-
FIXME - What is chargename supposed to be ?
FIXME: previously attempted to return C<$message> as a text message, either "First Notice", "Second Notice",
=cut
sub CalcFine {
- my ( $item, $bortype, $branchcode, $difference ,$dues , $start_date, $end_date ) = @_;
- $debug and warn sprintf("CalcFine(%s, %s, %s, %s, %s, %s, %s)",
- ($item ? '{item}' : 'UNDEF'),
- ($bortype || 'UNDEF'),
- ($branchcode || 'UNDEF'),
- ($difference || 'UNDEF'),
- ($dues || 'UNDEF'),
- ($start_date ? ($start_date->output('iso') || 'Not a C4::Dates object') : 'UNDEF'),
- ( $end_date ? ( $end_date->output('iso') || 'Not a C4::Dates object') : 'UNDEF')
- );
+ my ( $item, $bortype, $branchcode, $due_dt, $end_date ) = @_;
+ my $start_date = $due_dt->clone();
my $dbh = C4::Context->dbh;
my $amount = 0;
- my $daystocharge;
- # get issuingrules (fines part will be used)
- $debug and warn sprintf("CalcFine calling GetIssuingRule(%s, %s, %s)", $bortype, $item->{'itemtype'}, $branchcode);
- my $data = C4::Circulation::GetIssuingRule($bortype, $item->{'itemtype'}, $branchcode);
- if($difference) {
- # if $difference is supplied, the difference has already been calculated, but we still need to adjust for the calendar.
- # use copy-pasted functions from calendar module. (deprecated -- these functions will be removed from C4::Overdues ).
- my $countspecialday = &GetSpecialHolidays($dues,$item->{itemnumber});
- my $countrepeatableday = &GetRepeatableHolidays($dues,$item->{itemnumber},$difference);
- my $countalldayclosed = $countspecialday + $countrepeatableday;
- $daystocharge = $difference - $countalldayclosed;
- } else {
- # if $difference is not supplied, we have C4::Dates objects giving us the date range, and we use the calendar module.
- if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') {
- my $calendar = C4::Calendar->new( branchcode => $branchcode );
- $daystocharge = $calendar->daysBetween( $start_date, $end_date );
- } else {
- $daystocharge = Date_to_Days(split('-',$end_date->output('iso'))) - Date_to_Days(split('-',$start_date->output('iso')));
- }
- }
- # correct for grace period.
- my $days_minus_grace = $daystocharge - $data->{'firstremind'};
- if ($data->{'chargeperiod'} > 0 && $days_minus_grace > 0 ) {
- $amount = int($daystocharge / $data->{'chargeperiod'}) * $data->{'fine'};
+ my $charge_duration;
+ # get issuingrules (fines part will be used)
+ my $data = C4::Circulation::GetIssuingRule($bortype, $item->{itemtype}, $branchcode);
+ if(C4::Context->preference('finesCalendar') eq 'noFinesWhenClosed') {
+ my $calendar = Koha::Calendar->new( branchcode => $branchcode );
+ $charge_duration = $calendar->days_between( $start_date, $end_date );
+ } else {
+ $charge_duration = $end_date - $start_date;
+ }
+ # correct for grace period.
+ my $fine_unit = $data->{lengthunit};
+ $fine_unit ||= 'days';
+ my $chargeable_units;
+ if ($fine_unit eq 'hours') {
+ $chargeable_units = $charge_duration->hours(); # TODO closed times???
+ }
+ else {
+ $chargeable_units = $charge_duration->days;
+ }
+ my $days_minus_grace = $chargeable_units - $data->{firstremind};
+ if ($data->{'chargeperiod'} && $days_minus_grace ) {
+ $amount = int($chargeable_units / $data->{'chargeperiod'}) * $data->{'fine'};# TODO fine calc should be in cents
} else {
# a zero (or null) chargeperiod means no charge.
}
- $amount = C4::Context->preference('maxFine') if(C4::Context->preference('maxFine') && ( $amount > C4::Context->preference('maxFine')));
- $debug and warn sprintf("CalcFine returning (%s, %s, %s, %s)", $amount, $data->{'chargename'}, $days_minus_grace, $daystocharge);
- return ($amount, $data->{'chargename'}, $days_minus_grace, $daystocharge);
+ if(C4::Context->preference('maxFine') && ( $amount > C4::Context->preference('maxFine'))) {
+ $amount = C4::Context->preference('maxFine');
+ }
+ return ($amount, $data->{chargename}, $days_minus_grace);
# FIXME: chargename is NEVER populated anywhere.
}
WHERE (accountlines.amountoutstanding != '0.000000')
AND (accountlines.accounttype = 'FU' )
AND (issues.branchcode = ? )
- AND (issues.date_due < CURDATE())
+ AND (issues.date_due < NOW())
";
my @getoverdues;
my $i = 0;
use C4::Debug;
use C4::Context;
-# use C4::Dates;
use C4::Koha;
use C4::Members;
use C4::Reserves;
$debug and warn "do_checkout: calling AddIssue(\$borrower,$barcode, undef, 0)\n"
# . "w/ \$borrower: " . Dumper($borrower)
. "w/ C4::Context->userenv: " . Dumper(C4::Context->userenv);
- my $c4due = AddIssue($borrower, $barcode, undef, 0);
- my $due = $c4due->output('iso') || undef;
- $debug and warn "Item due: $due";
- $self->{'due'} = $due;
- $self->{item}->due_date($due);
+ my $due_dt = AddIssue($borrower, $barcode, undef, 0);
+ if ($due_dt) {
+ $self->{due} = $due_dt->clone();
+ } else {
+ $self->{due} = undef;
+ }
+
+ #$self->{item}->due_date($due);
$self->ok(1);
return $self;
}
my $borrower = shift;
my ($renewokay,$renewerror) = CanBookBeRenewed($borrower->{borrowernumber},$self->{item}->{itemnumber});
if ($renewokay){
- my $datedue = AddIssue( $borrower, $self->{item}->id, undef, 0 );
- $self->{due} = $datedue;
+ $self->{due} = AddIssue( $borrower, $self->{item}->id, undef, 0 );
$self->renewal_ok(1);
} else {
$self->screen_msg(($self->screen_msg || '') . " " . $renewerror);
$self->{item} = $item;
$self->do_renew_for($borrower);
if ($self->ok) {
- $item->{due_date} = $self->{due};
- push @{$self->{renewed} }, $item_id;
+ $item->{due_date} = $self->{due}->clone();
+ push @{$self->renewed }, $item_id;
} else {
push @{$self->{unrenewed}}, $item_id;
}
sub timestamp {
my $time = $_[0] || time();
- if ($time=~m/^(\d{4})\-(\d{2})\-(\d{2})/) {
+ if ( ref $time eq 'DateTime') {
+ return $time->strftime(SIP_DATETIME);
+ } elsif ($time=~m/^(\d{4})\-(\d{2})\-(\d{2})/) {
# passing a db returned date as is + bogus time
return sprintf( '%04d%02d%02d 235900', $1, $2, $3);
}
--- /dev/null
+package Koha::Calendar;
+use strict;
+use warnings;
+use 5.010;
+
+use DateTime;
+use DateTime::Set;
+use DateTime::Duration;
+use C4::Context;
+use Carp;
+use Readonly;
+
+sub new {
+ my ( $classname, %options ) = @_;
+ my $self = {};
+ bless $self, $classname;
+ for my $o_name ( keys %options ) {
+ my $o = lc $o_name;
+ $self->{$o} = $options{$o_name};
+ }
+ if ( exists $options{TEST_MODE} ) {
+ $self->_mockinit();
+ return $self;
+ }
+ if ( !defined $self->{branchcode} ) {
+ croak 'No branchcode argument passed to Koha::Calendar->new';
+ }
+ $self->_init();
+ return $self;
+}
+
+sub _init {
+ my $self = shift;
+ my $branch = $self->{branchcode};
+ my $dbh = C4::Context->dbh();
+ my $repeat_sth = $dbh->prepare(
+'SELECT * from repeatable_holidays WHERE branchcode = ? AND ISNULL(weekday) = ?'
+ );
+ $repeat_sth->execute( $branch, 0 );
+ $self->{weekly_closed_days} = [ 0, 0, 0, 0, 0, 0, 0 ];
+ Readonly::Scalar my $sunday => 7;
+ while ( my $tuple = $repeat_sth->fetchrow_hashref ) {
+ $self->{weekly_closed_days}->[ $tuple->{weekday} ] = 1;
+ }
+ $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} } =
+ 1;
+ }
+ my $special = $dbh->prepare(
+'SELECT day, month, year, title, description FROM special_holidays WHERE ( branchcode = ? ) AND (isexception = ?)'
+ );
+ $special->execute( $branch, 1 );
+ my $dates = [];
+ while ( my ( $day, $month, $year, $title, $description ) =
+ $special->fetchrow ) {
+ push @{$dates},
+ DateTime->new(
+ day => $day,
+ month => $month,
+ year => $year,
+ time_zone => C4::Context->tz()
+ )->truncate( to => 'day' );
+ }
+ $self->{exception_holidays} =
+ DateTime::Set->from_datetimes( dates => $dates );
+ $special->execute( $branch, 1 );
+ $dates = [];
+ while ( my ( $day, $month, $year, $title, $description ) =
+ $special->fetchrow ) {
+ push @{$dates},
+ DateTime->new(
+ day => $day,
+ month => $month,
+ year => $year,
+ time_zone => C4::Context->tz()
+ )->truncate( to => 'day' );
+ }
+ $self->{single_holidays} = DateTime::Set->from_datetimes( dates => $dates );
+ $self->{days_mode} = C4::Context->preference('useDaysMode');
+ return;
+}
+
+sub addDate {
+ my ( $self, $startdate, $add_duration, $unit ) = @_;
+ my $base_date = $startdate->clone();
+ if ( ref $add_duration ne 'DateTime::Duration' ) {
+ $add_duration = DateTime::Duration->new( days => $add_duration );
+ }
+ $unit ||= q{}; # default days ?
+ my $days_mode = $self->{days_mode};
+ Readonly::Scalar my $return_by_hour => 10;
+ my $day_dur = DateTime::Duration->new( days => 1 );
+ if ( $add_duration->is_negative() ) {
+ $day_dur->inverse();
+ }
+ if ( $days_mode eq 'Datedue' ) {
+
+ my $dt = $base_date + $add_duration;
+ while ( $self->is_holiday($dt) ) {
+
+ # TODOP if hours set to 10 am
+ $dt->add_duration($day_dur);
+ if ( $unit eq 'hours' ) {
+ $dt->set_hour($return_by_hour); # Staffs specific
+ }
+ }
+ return $dt;
+ } elsif ( $days_mode eq 'Calendar' ) {
+ if ( $unit eq 'hours' ) {
+ $base_date->add_duration($add_duration);
+ while ( $self->is_holiday($base_date) ) {
+ $base_date->add_duration($day_dur);
+
+ }
+
+ } else {
+ my $days = abs $add_duration->in_units('days');
+ while ($days) {
+ $base_date->add_duration($day_dur);
+ if ( $self->is_holiday($base_date) ) {
+ next;
+ } else {
+ --$days;
+ }
+ }
+ }
+ if ( $unit eq 'hours' ) {
+ my $dt = $base_date->clone()->subtract( days => 1 );
+ if ( $self->is_holiday($dt) ) {
+ $base_date->set_hour($return_by_hour); # Staffs specific
+ }
+ }
+ return $base_date;
+ } else { # Days
+ return $base_date + $add_duration;
+ }
+}
+
+sub is_holiday {
+ my ( $self, $dt ) = @_;
+ my $dow = $dt->day_of_week;
+ if ( $dow == 7 ) {
+ $dow = 0;
+ }
+ if ( $self->{weekly_closed_days}->[$dow] == 1 ) {
+ return 1;
+ }
+ $dt->truncate( to => 'days' );
+ my $day = $dt->day;
+ my $month = $dt->month;
+ if ( exists $self->{day_month_closed_days}->{$month}->{$day} ) {
+ return 1;
+ }
+ if ( $self->{exception_holidays}->contains($dt) ) {
+ return 1;
+ }
+ if ( $self->{single_holidays}->contains($dt) ) {
+ return 1;
+ }
+
+ # damn have to go to work after all
+ return 0;
+}
+
+sub days_between {
+ my $self = shift;
+ my $start_dt = shift;
+ my $end_dt = shift;
+ $start_dt->truncate( to => 'hours' );
+ $end_dt->truncate( to => 'hours' );
+
+ # start and end should not be closed days
+ my $duration = $end_dt - $start_dt;
+ $start_dt->truncate( to => 'days' );
+ $end_dt->truncate( to => 'days' );
+ while ( DateTime->compare( $start_dt, $end_dt ) == -1 ) {
+ $start_dt->add( days => 1 );
+ if ( $self->is_holiday($start_dt) ) {
+ $duration->subtract( days => 1 );
+ }
+ }
+ return $duration;
+
+}
+
+sub _mockinit {
+ my $self = shift;
+ $self->{weekly_closed_days} = [ 1, 0, 0, 0, 0, 0, 0 ]; # Sunday only
+ $self->{day_month_closed_days} = { 6 => { 16 => 1, } };
+ my $dates = [];
+ $self->{exception_holidays} =
+ DateTime::Set->from_datetimes( dates => $dates );
+ my $special = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 1,
+ time_zone => 'Europe/London',
+ );
+ push @{$dates}, $special;
+ $self->{single_holidays} = DateTime::Set->from_datetimes( dates => $dates );
+ $self->{days_mode} = 'Calendar';
+ return;
+}
+
+1;
+__END__
+
+=head1 NAME
+
+Koha::Calendar - Object containing a branches calendar
+
+=head1 VERSION
+
+This documentation refers to Koha::Calendar version 0.0.1
+
+=head1 SYNOPSIS
+
+ use Koha::Calendat
+
+ my $c = Koha::Calender->new( branchcode => 'MAIN' );
+ my $dt = DateTime->now();
+
+ # are we open
+ $open = $c->is_holiday($dt);
+ # when will item be due if loan period = $dur (a DateTime::Duration object)
+ $duedate = $c->addDate($dt,$dur,'days');
+
+
+=head1 DESCRIPTION
+
+ Implements those features of C4::Calendar needed for Staffs Rolling Loans
+
+=head1 METHODS
+
+=head2 new : Create a calendar object
+
+my $calendar = Koha::Calendar->new( branchcode => 'MAIN' );
+
+The option branchcode is required
+
+
+=head2 addDate
+
+ my $dt = $calendar->addDate($date, $dur, $unit)
+
+C<$date> is a DateTime object representing the starting date of the interval.
+
+C<$offset> is a DateTime::Duration to add to it
+
+C<$unit> is a string value 'days' or 'hours' toflag granularity of duration
+
+Currently unit is only used to invoke Staffs return Monday at 10 am rule this
+parameter will be removed when issuingrules properly cope with that
+
+
+=head2 is_holiday
+
+$yesno = $calendar->is_holiday($dt);
+
+passed at DateTime object returns 1 if it is a closed day
+0 if not according to the calendar
+
+=head2 days_between
+
+$duration = $calendar->days_between($start_dt, $end_dt);
+
+Passed two dates returns a DateTime::Duration object measuring the length between them
+ignoring closed days
+
+=head1 DIAGNOSTICS
+
+Will croak if not passed a branchcode in new
+
+=head1 BUGS AND LIMITATIONS
+
+This only contains a limited subset of the functionality in C4::Calendar
+Only enough to support Staffs Rolling loans
+
+=head1 AUTHOR
+
+Colin Campbell colin.campbell@ptfs-europe.com
+
+=head1 LICENSE AND COPYRIGHT
+
+Copyright (c) 2011 PTFS-Europe Ltd All rights reserved
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
--- /dev/null
+package Koha::DateUtils;
+
+# Copyright (c) 2011 PTFS-Europe Ltd.
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA 02111-1307 USA
+
+use strict;
+use warnings;
+use 5.010;
+use DateTime;
+use DateTime::Format::DateParse;
+use C4::Context;
+
+use base 'Exporter';
+use version; our $VERSION = qv('1.0.0');
+
+our @EXPORT = (
+ qw( dt_from_string output_pref format_sqldatetime output_pref_due format_sqlduedatetime)
+);
+
+=head1 DateUtils
+
+Koha::DateUtils - Transitional wrappers to ease use of DateTime
+
+=head1 DESCRIPTION
+
+Koha has historically only used dates not datetimes and been content to
+handle these as strings. It also has confused formatting with actual dates
+this is a temporary module for wrappers to hide the complexity of switch to DateTime
+
+=cut
+
+=head2 dt_ftom_string
+
+$dt = dt_from_string($date_string, [$format, $timezone ]);
+
+Passed a date string returns a DateTime object format and timezone default
+to the system preferences. If the date string is empty DateTime->now is returned
+
+=cut
+
+sub dt_from_string {
+ my ( $date_string, $date_format, $tz ) = @_;
+ if ( !$tz ) {
+ $tz = C4::Context->tz;
+ }
+ if ( !$date_format ) {
+ $date_format = C4::Context->preference('dateformat');
+ }
+ if ($date_string) {
+ if ( ref($date_string) eq 'DateTime' ) { # already a dt return it
+ return $date_string;
+ }
+
+ if ( $date_format eq 'metric' ) {
+ $date_string =~ s#-#/#g;
+ $date_string =~ s/^00/01/; # system allows the 0th of the month
+ $date_string =~ s#^(\d{1,2})/(\d{1,2})#$2/$1#;
+ } else {
+ if ( $date_format eq 'iso' ) {
+ $date_string =~ s/-00/-01/;
+ if ( $date_string =~ m/^0000-0/ ) {
+ return; # invalid date in db
+ }
+ } elsif ( $date_format eq 'us' ) {
+ $date_string =~ s#-#/#g;
+ $date_string =~ s[/00/][/01/];
+ } elsif ( $date_format eq 'sql' ) {
+ $date_string =~
+s/(\d{4})(\d{2})(\d{2})\s+(\d{2})(\d{2})(\d{2})/$1-$2-$3T$4:$5:$6/;
+ $date_string =~ s/00T/01T/;
+ }
+ }
+ return DateTime::Format::DateParse->parse_datetime( $date_string,
+ $tz->name() );
+ }
+ return DateTime->now( time_zone => $tz );
+
+}
+
+=head2 output_pref
+
+$date_string = output_pref($dt, [$format] );
+
+Returns a string containing the time & date formatted as per the C4::Context setting
+
+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
+
+=cut
+
+sub output_pref {
+ my $dt = shift;
+ my $force_pref = shift; # if testing we want to override Context
+ my $pref =
+ defined $force_pref ? $force_pref : C4::Context->preference('dateformat');
+ given ($pref) {
+ when (/^iso/) {
+ return $dt->strftime('%Y-%m-%d %H:%M');
+ }
+ when (/^metric/) {
+ return $dt->strftime('%d/%m/%Y %H:%M');
+ }
+ when (/^us/) {
+ return $dt->strftime('%m/%d/%Y %H:%M');
+ }
+ default {
+ return $dt->strftime('%Y-%m-%d %H:%M');
+ }
+
+ }
+ return;
+}
+
+=head2 output_pref_due
+
+$date_string = output_pref_due($dt, [$format] );
+
+Returns a string containing the time & date formatted as per the C4::Context setting
+
+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
+
+This is effectivelyt a wrapper around output_pref for due dates
+the time portion is stripped if it is '23:59'
+
+=cut
+
+sub output_pref_due {
+ my $disp_str = output_pref(@_);
+ $disp_str =~ s/ 23:59//;
+ return $disp_str;
+}
+
+=head2 format_sqldatetime
+
+$string = format_sqldatetime( $string_as_returned_from_db );
+
+a convenience routine for calling dt_from_string and formatting the result
+with output_pref as it is a frequent activity in scripts
+
+=cut
+
+sub format_sqldatetime {
+ my $str = shift;
+ my $force_pref = shift; # if testing we want to override Context
+ if ( defined $str && $str =~ m/^\d{4}-\d{2}-\d{2}/ ) {
+ my $dt = dt_from_string( $str, 'sql' );
+ $dt->truncate( to => 'minutes' );
+ return output_pref( $dt, $force_pref );
+ }
+ return q{};
+}
+
+=head2 format_sqlduedatetime
+
+$string = format_sqldatetime( $string_as_returned_from_db );
+
+a convenience routine for calling dt_from_string and formatting the result
+with output_pref_due as it is a frequent activity in scripts
+
+=cut
+
+sub format_sqlduedatetime {
+ my $str = shift;
+ my $force_pref = shift; # if testing we want to override Context
+ if ( defined $str && $str =~ m/^\d{4}-\d{2}-\d{2}/ ) {
+ my $dt = dt_from_string( $str, 'sql' );
+ $dt->truncate( to => 'minutes' );
+ return output_pref_due( $dt, $force_pref );
+ }
+ return q{};
+}
+
+1;
use C4::Budgets;
use C4::Acquisition;
use C4::Bookseller qw/GetBookSellerFromId/;
-use C4::Dates;
use C4::Suggestions; # GetSuggestion
use C4::Branch; # GetBranches
use C4::Members;
# check if there is at least 1 line still staged
my $stagedList=GetImportBibliosRange($batch->{'import_batch_id'}, undef, undef, 'staged');
if (scalar @$stagedList) {
+ my ($staged_date, $staged_hour) = split (/ /, $batch->{'upload_timestamp'});
push @list, {
import_batch_id => $batch->{'import_batch_id'},
num_biblios => $batch->{'num_biblios'},
num_items => $batch->{'num_items'},
- upload_timestamp => $batch->{'upload_timestamp'},
+ staged_date => $staged_date,
+ staged_hour => $staged_hour,
import_status => $batch->{'import_status'},
file_name => $batch->{'file_name'},
comments => $batch->{'comments'},
my $input=new CGI;
-my ($template, $loggedinuser, $cookie)
+our ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "acqui/basketgroup.tmpl",
query => $input,
type => "intranet",
use C4::Output;
use CGI;
-use C4::Dates qw/format_date/;
use C4::Acquisition qw/ GetBasketsInfosByBookseller /;
use C4::Bookseller qw/ GetBookSellerFromId GetBookSeller /;
use C4::Members qw/GetMember/;
)
)
) {
- for my $date_field (qw( creationdate closedate)) {
- if ( $basket->{$date_field} ) {
- $basket->{$date_field} = format_date( $basket->{$date_field} );
- }
- }
foreach (qw(total_items total_biblios expected_items)) {
$basket->{$_} ||= 0;
}
use C4::Contract qw/GetContract/;
use C4::Biblio;
use C4::Output;
-use C4::Dates qw/format_date /;
use CGI;
use C4::Bookseller qw( GetBookSellerFromId DelBookseller );
my $contracts = GetContract( { booksellerid => $booksellerid } );
- for ( @{$contracts} ) {
- $_->{contractstartdate} = format_date( $_->{contractstartdate} );
- $_->{contractenddate} = format_date( $_->{contractenddate} );
- }
-
$template->param(
booksellerid => $booksellerid,
name => $supplier->{'name'},
my $booksellerid = $input->param('booksellerid');
my $basketno = $input->param('basketno');
my $noconnection;
-my $numberpending;
my $attr = '';
my $term;
my $host;
$random = rand(1000000000);
}
-my $DEBUG = 0; # if set to 1, many debug message are send on syslog.
+my $DEBUG = $ENV{DEBUG} || 0; # if set to 1, many debug message are send on syslog.
# get framework list
my $frameworks = getframeworks;
biblionumber => $biblionumber,
);
output_html_with_http_headers $input, $cookie, $template->output;
+ exit;
}
-else {
+
my @id = $input->param('id');
- if ( not defined @id ) {
+ if ( not @id ) {
# empty server list -> report and exit
$template->param( emptyserverlist => 1 );
output_html_with_http_headers $input, $cookie, $template->output;
# $oResult[$z] = $oConnection[$z]->search_pqf($query);
}
-sub displayresults {
+ warn "# nremaining = $nremaining\n" if $DEBUG;
+
+ while ( $nremaining-- ) {
+
my $k;
my $event;
while ( ( $k = ZOOM::event( \@oConnection ) ) != 0 ) {
if ( $k != 0 ) {
$k--;
- warn $serverhost[$k] if $DEBUG;
+ warn "event from $k server = ",$serverhost[$k] if $DEBUG;
my ( $error, $errmsg, $addinfo, $diagset ) =
$oConnection[$k]->error_x();
if ($error) {
}
else {
my $numresults = $oResult[$k]->size();
+ warn "numresults = $numresults" if $DEBUG;
my $i;
my $result = '';
if ( $numresults > 0 ) {
} #$numresults
}
} # if $k !=0
- $numberpending = $nremaining - 1;
- $template->param(
- breeding_loop => \@breeding_loop,
- server => $servername[$k],
- numberpending => $numberpending,
- errconn => \@errconn
- );
- output_html_with_http_headers $input, $cookie, $template->output if $numberpending == 0;
-
# print $template->output if $firstresult !=1;
$firstresult++;
-}
-displayresults();
-while ( --$nremaining > 0 ) {
- displayresults();
- }
-} ## if op=search
+
+ } # while nremaining
+
+$template->param(
+breeding_loop => \@breeding_loop,
+#server => $servername[$k],
+numberpending => $nremaining > 0 ? $nremaining : 0,
+errconn => \@errconn
+);
+output_html_with_http_headers $input, $cookie, $template->output;
# - branchfax |
# - branchemail /
# - branchurl /
+ # - opac_info (can contain HTML)
# - address-empty-p (1 if no address information, 0 otherwise)
# - categories (containing a static error message)
# - category_list (loop containing "categoryname")
'branchaddress3', 'branchzip',
'branchcity', 'branchstate', 'branchcountry',
'branchphone', 'branchfax',
- 'branchemail', 'branchurl',
+ 'branchemail', 'branchurl', 'opac_info',
'branchip', 'branchprinter', 'branchnotes'
)
{
branchfax => $data->{'branchfax'},
branchemail => $data->{'branchemail'},
branchurl => $data->{'branchurl'},
+ opac_info => $data->{'opac_info'},
branchip => $data->{'branchip'},
branchnotes => $data->{'branchnotes'},
);
use strict;
use warnings;
use CGI;
+use List::MoreUtils qw/uniq/;
+
use C4::Auth;
use C4::Context;
use C4::Output;
use C4::Koha;
+use C4::Members qw/GetBorrowercategoryList/;
use C4::Members::AttributeTypes;
my $script_name = "/cgi-bin/koha/admin/patron-attr-types.pl";
$template->param(
attribute_type_form => 1,
confirm_op => 'add_attribute_type_confirmed',
+ categories => GetBorrowercategoryList,
);
authorised_value_category_list($template);
+ pa_classes($template);
}
sub error_add_attribute_type_form {
$template->param(display_checkout_checked => 'checked="checked"');
}
+ $template->param( category_code => $input->param('category_code') );
+ $template->param( class => $input->param('class') );
+
$template->param(
attribute_type_form => 1,
confirm_op => 'add_attribute_type_confirmed',
$attr_type->password_allowed($password_allowed);
my $display_checkout = $input->param('display_checkout');
$attr_type->display_checkout($display_checkout);
+ $attr_type->category_code($input->param('category_code'));
+ $attr_type->class($input->param('class'));
if ($op eq 'edit') {
$template->param(edited_attribute_type => $attr_type->code());
$template->param(code => $code);
$template->param(description => $attr_type->description());
+ $template->param(class => $attr_type->class());
if ($attr_type->repeatable()) {
$template->param(repeatable_checked => 1);
$template->param(display_checkout_checked => 'checked="checked"');
}
authorised_value_category_list($template, $attr_type->authorised_value_category());
+ pa_classes( $template, $attr_type->class );
+
+ $template->param ( category_code => $attr_type->category_code );
+ $template->param ( category_description => $attr_type->category_description );
$template->param(
attribute_type_form => 1,
edit_attribute_type => 1,
confirm_op => 'edit_attribute_type_confirmed',
+ categories => GetBorrowercategoryList,
);
}
sub patron_attribute_type_list {
my $template = shift;
-
+
my @attr_types = C4::Members::AttributeTypes::GetAttributeTypes();
- $template->param(available_attribute_types => \@attr_types);
+ my @classes = uniq( map {$_->{class}} @attr_types );
+ @classes = sort @classes;
+
+ my @attributes_loop;
+ for my $class (@classes) {
+ my @items;
+ for my $attr (@attr_types) {
+ push @items, $attr if $attr->{class} eq $class
+ }
+ my $lib = GetAuthorisedValueByCode( 'PA_CLASS', $class ) || $class;
+ push @attributes_loop, {
+ class => $class,
+ items => \@items,
+ lib => $lib,
+ };
+ }
+ $template->param(available_attribute_types => \@attributes_loop);
$template->param(display_list => 1);
}
}
$template->param(authorised_value_categories => \@list);
}
+
+sub pa_classes {
+ my $template = shift;
+ my $selected = @_ ? shift : '';
+
+ $template->param(classes_val_loop => GetAuthorisedValues( 'PA_CLASS', $selected ) );
+}
}
# save the values entered
elsif ($op eq 'add') {
- my $sth_search = $dbh->prepare("SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?");
- my $sth_insert = $dbh->prepare("INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
- my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, hardduedate=?, hardduedatecompare=?, rentaldiscount=? WHERE branchcode=? AND categorycode=? AND itemtype=?");
+ my $sth_search = $dbh->prepare('SELECT COUNT(*) AS total FROM issuingrules WHERE branchcode=? AND categorycode=? AND itemtype=?');
+ my $sth_insert = $dbh->prepare('INSERT INTO issuingrules (branchcode, categorycode, itemtype, maxissueqty, renewalsallowed, reservesallowed, issuelength, lengthunit, hardduedate, hardduedatecompare, fine, finedays, firstremind, chargeperiod,rentaldiscount) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)');
+ my $sth_update=$dbh->prepare("UPDATE issuingrules SET fine=?, finedays=?, firstremind=?, chargeperiod=?, maxissueqty=?, renewalsallowed=?, reservesallowed=?, issuelength=?, lengthunit = ?, hardduedate=?, hardduedatecompare=?, rentaldiscount=? WHERE branchcode=? AND categorycode=? AND itemtype=?");
my $br = $branch; # branch
my $bor = $input->param('categorycode'); # borrower category
$maxissueqty =~ s/\s//g;
$maxissueqty = undef if $maxissueqty !~ /^\d+/;
my $issuelength = $input->param('issuelength');
+ my $lengthunit = $input->param('lengthunit');
my $hardduedate = $input->param('hardduedate');
$hardduedate = format_date_in_iso($hardduedate);
my $hardduedatecompare = $input->param('hardduedatecompare');
$sth_search->execute($br,$bor,$cat);
my $res = $sth_search->fetchrow_hashref();
if ($res->{total}) {
- $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat);
+ $sth_update->execute($fine, $finedays,$firstremind, $chargeperiod, $maxissueqty, $renewalsallowed,$reservesallowed, $issuelength,$lengthunit, $hardduedate,$hardduedatecompare,$rentaldiscount, $br,$bor,$cat);
} else {
- $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount);
+ $sth_insert->execute($br,$bor,$cat,$maxissueqty,$renewalsallowed,$reservesallowed,$issuelength,$lengthunit,$hardduedate,$hardduedatecompare,$fine,$finedays,$firstremind,$chargeperiod,$rentaldiscount);
}
}
elsif ($op eq "set-branch-defaults") {
# - we delete the record having primkey=$primkey
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
use CGI;
use C4::Context;
use C4::Auth;
sub StringSearch {
my ($searchstring,$type)=@_;
my $dbh = C4::Context->dbh;
- $searchstring=~ s/\'/\\\'/g;
- my @data=split(' ',$searchstring);
- my $count=@data;
- my $sth=$dbh->prepare("Select host,port,db,userid,password,name,id,checked,rank,syntax,encoding from z3950servers where (name like ?) order by rank,name");
- $sth->execute("$data[0]\%");
+ my @data = ('%');
+ my $count = 1;
+ if ( defined $searchstring ) {
+ $searchstring =~ s/\'/\\\'/g;
+ @data=split(' ',$searchstring);
+ $count=@data;
+ }
+ else {
+ $searchstring = '';
+ }
+
+ my $query = "SELECT host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout";
+ $query .= " FROM z3950servers";
+ if ( $searchstring ne '' ) { $query .= " WHERE (name like ?)" }
+ $query .= " ORDER BY rank,name";
+ my $sth=$dbh->prepare($query);
+
+ if ( $searchstring ne '' ) {
+ $sth->execute("$data[0]\%");
+ }
+ else {
+ $sth->execute;
+ }
+
my @results;
while (my $data=$sth->fetchrow_hashref) {
push(@results,$data);
}
- # $sth->execute;
$sth->finish;
$dbh->disconnect;
return (scalar(@results),\@results);
my $input = new CGI;
my $searchfield=$input->param('searchfield');
-my $offset=$input->param('offset');
+my $offset=$input->param('offset') || 0;
my $script_name="/cgi-bin/koha/admin/z3950servers.pl";
my $pagesize=20;
-my $op = $input->param('op');
+my $op = $input->param('op') || '';
my ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/z3950servers.tmpl",
my $data;
if ($searchfield) {
my $dbh = C4::Context->dbh;
- my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding from z3950servers where (name = ?) order by rank,name");
+ my $sth=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout from z3950servers where (name = ?) order by rank,name");
$sth->execute($searchfield);
$data=$sth->fetchrow_hashref;
$sth->finish;
}
$template->param( $_ => $data->{$_} )
- for ( qw( host port db userid password checked rank ) );
+ for ( qw( host port db userid password checked rank timeout ) );
$template->param( $_ . $data->{$_} => 1)
for ( qw( syntax encoding ) );
# END $OP eq ADD_FORM
$sth->execute($input->param('searchfield'));
my $checked = $input->param('checked') ? 1 : 0;
if ($sth->rows) {
- $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=? where name=?");
+ $sth=$dbh->prepare("update z3950servers set host=?, port=?, db=?, userid=?, password=?, name=?, checked=?, rank=?,syntax=?,encoding=?,timeout=? where name=?");
$sth->execute($input->param('host'),
$input->param('port'),
$input->param('db'),
$input->param('rank'),
$input->param('syntax'),
$input->param('encoding'),
+ $input->param('timeout'),
$input->param('searchfield'),
);
}
else {
$sth=$dbh->prepare(
"INSERT INTO z3950servers " .
- "(host,port,db,userid,password,name,checked,rank,syntax,encoding) " .
- "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" );
+ "(host,port,db,userid,password,name,checked,rank,syntax,encoding,timeout) " .
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)" );
$sth->execute(
$input->param( 'host' ),
$input->param( 'port' ),
$input->param( 'userid' ),
$input->param( 'password' ),
$input->param( 'searchfield' ),
- $input->param( 'checked' ),
+ $checked,
$input->param( 'rank' ),
$input->param( 'syntax' ),
+ $input->param( 'timeout' ),
$input->param( 'encoding' ) );
}
$sth->finish;
$template->param(delete_confirm => 1);
my $dbh = C4::Context->dbh;
- my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding from z3950servers where (name = ?) order by rank,name");
+ my $sth2=$dbh->prepare("select host,port,db,userid,password,name,id,checked,rank,syntax,encoding,timeout from z3950servers where (name = ?) order by rank,name");
$sth2->execute($searchfield);
my $data=$sth2->fetchrow_hashref;
$sth2->finish;
checked => $data->{'checked'},
rank => $data->{'rank'},
syntax => $data->{'syntax'},
+ timeout => $data->{'timeout'},
encoding => $data->{'encoding'} );
# END $OP eq DELETE_CONFIRM
$template->param(else => 1);
my ($count,$results)=StringSearch($searchfield,'web');
my @loop;
+
for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
-
my $urlsearchfield=$results->[$i]{name};
$urlsearchfield=~s/ /%20/g;
my %row = ( name => $results->[$i]{'name'},
checked => $results->[$i]{'checked'},
rank => $results->[$i]{'rank'},
syntax => $results->[$i]{'syntax'},
- encoding => $results->[$i]{'encoding'});
+ encoding => $results->[$i]{'encoding'},
+ timeout => $results->[$i]{'timeout'});
push @loop, \%row;
}
use C4::VirtualShelves;
use C4::XSLT;
use C4::Images;
+use Koha::DateUtils;
# use Smart::Comments;
$item->{imageurl} = defined $item->{itype} ? getitemtypeimagelocation('intranet', $itemtypes->{ $item->{itype} }{imageurl})
: '';
- foreach (qw(datedue datelastseen onloan)) {
+ foreach (qw(datelastseen onloan)) {
$item->{$_} = format_date($item->{$_});
- }
+ }
+ $item->{datedue} = format_sqldatetime($item->{datedue});
# item damaged, lost, withdrawn loops
$item->{itemlostloop} = GetAuthorisedValues($authvalcode_items_itemlost, $item->{itemlost}) if $authvalcode_items_itemlost;
if ($item->{damaged}) {
use C4::Circulation; # GetBiblioIssues
use C4::Biblio; # GetBiblio GetBiblioFromItemNumber
-use C4::Dates qw/format_date/;
use C4::Search; # enabled_staff_search_views
+use Koha::DateUtils;
my $query = new CGI;
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
%{$biblio[0]},
);
}
-foreach (@$issues){
- $_->{date_due} = format_date($_->{date_due});
- $_->{issuedate} = format_date($_->{issuedate});
- $_->{returndate} = format_date($_->{returndate});
- $_->{lastreneweddate} = format_date($_->{lastreneweddate});
+foreach (@{$issues}){
+ $_->{date_due} = format_sqldatetime($_->{date_due});
+ $_->{issuedate} = format_sqldatetime($_->{issuedate});
+ $_->{returndate} = format_sqldatetime($_->{returndate});
+ $_->{lastreneweddate} = format_sqldatetime($_->{lastreneweddate});
}
$template->param(
total => scalar @$issues,
use C4::Members; # to use GetMember
use C4::Search; # enabled_staff_search_views
use C4::Members qw/GetHideLostItemsPreference/;
+use Koha::DateUtils;
my $query=new CGI;
my $today_iso = C4::Dates->today('iso');
-$template->param(today_iso => $today_iso);
-
my $tagslib = &GetMarcStructure(1,$frameworkcode);
my $record = GetMarcBiblio($biblionumber);
my $oldrecord = TransformMarcToKoha($dbh,$record);
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
=head1
// summary += i + ": " + document.f.tag[i].value + " " + document.f.subfield[i].value + ": " + document.f.field_value[i].value + "\\n";
//}
//alert("Got focus, subfieldmanaged: " + subfield_managed + "\\n" + summary);
- set_to_today(id); // defined in additem.pl HEAD
+ set_to_today(id);
return 0;
}
function Clic$function_name(id) {
- set_to_today(id, 1); // defined in additem.pl HEAD
+ set_to_today(id, 1);
return 0;
}
+
+function set_to_today(id, force) {
+ if (! id) { alert(_("Bad id ") + id + _(" sent to set_to_today()")); return 0; }
+ if (\$("#" + id).val() == '' || \$("#" + id).val() == '0000-00-00' || force) {
+ \$("#" + id).val("$date");
+ }
+}
//]]>
</script>
END_OF_JS
$option1->option('user', $server->{userid} ) if $server->{userid};
$option1->option('password', $server->{password}) if $server->{password};
$option1->option('preferredRecordSyntax', $server->{syntax});
+ $option1->option( 'timeout', $server->{timeout} ) if ($server->{timeout});
$oConnection[$s] = create ZOOM::Connection($option1)
|| $DEBUG
&& warn( "" . $oConnection[$s]->errmsg() );
$oConnection[$k]->error_x();
if ($error) {
if ($error =~ m/^(10000|10007)$/ ) {
- push(@errconn, {'server' => $serverhost[$k]});
+ push(@errconn, {'server' => $serverhost[$k], 'error' => $error});
}
$DEBUG and warn "$k $serverhost[$k] error $query: $errmsg ($error) $addinfo\n";
}
use CGI;
use C4::Output;
use C4::Auth;
-use C4::Dates qw/format_date/;
use C4::Overdues; # AddNotifyLine
use C4::Biblio;
use C4::Koha;
use C4::Debug;
use C4::Branch;
+use Data::Dumper;
=head1 branchoverdues.pl
my @overduesloop;
my @getoverdues = GetOverduesForBranch( $default, $location );
-use Data::Dumper;
$debug and warn "HERE : $default / $location" . Dumper(@getoverdues);
# search for location authorised value
my ($tag,$subfield) = GetMarcFromKohaField('items.location','');
if ($record){
$overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
}
- $overdueforbranch{'date_due'} = format_date( $num->{'date_due'} );
+ my $dt = dt_from_string($num->{date_due}, 'sql');
+ $overdueforbranch{'date_due'} = output_pref($dt);
$overdueforbranch{'title'} = $num->{'title'};
$overdueforbranch{'description'} = $num->{'description'};
$overdueforbranch{'barcode'} = $num->{'barcode'};
# initiate the templates for the overdueloop
$template->param(
overduesloop => \@overduesloop,
- show_date => format_date(C4::Dates->today('iso')),
location => $location,
);
# Copyright 2000-2002 Katipo Communications
# copyright 2010 BibLibre
+# Copyright 2011 PTFS-Europe Ltd.
#
# This file is part of Koha.
#
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
-#use warnings; FIXME - Bug 2505
+use warnings;
use CGI;
use C4::Output;
use C4::Auth qw/:DEFAULT get_session/;
use C4::Context;
use CGI::Session;
use C4::Members::Attributes qw(GetBorrowerAttributes);
+use Koha::DateUtils;
use Date::Calc qw(
Today
if($duedatespec_allow){
if ($duedatespec) {
if ($duedatespec =~ C4::Dates->regexp('syspref')) {
- my $tempdate = C4::Dates->new($duedatespec);
-# if ($tempdate and $tempdate->output('iso') gt C4::Dates->new()->output('iso')) {
-# # i.e., it has to be later than today/now
- $datedue = $tempdate;
-# } else {
-# $invalidduedate = 1;
-# $template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
-# }
+ $datedue = dt_from_string($duedatespec);
+ $datedue->set_hour(23);
+ $datedue->set_minute(59);
} else {
$invalidduedate = 1;
$template->param(IMPOSSIBLE=>1, INVALID_DATE=>$duedatespec);
$totalprice += $it->{'replacementprice'};
$it->{'itemtype'} = $itemtypeinfo->{'description'};
$it->{'itemtype_image'} = $itemtypeinfo->{'imageurl'};
- $it->{'dd'} = format_date($it->{'date_due'});
- $it->{'displaydate'} = format_date($it->{'issuedate'});
- $it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
+ $it->{'dd'} = output_pref($it->{'date_due'});
+ $it->{'displaydate'} = output_pref($it->{'issuedate'});
+ #$it->{'od'} = ( $it->{'date_due'} lt $todaysdate ) ? 1 : 0 ;
+ $it->{'od'} = $it->{'overdue'};
($it->{'author'} eq '') and $it->{'author'} = ' ';
$it->{'renew_failed'} = $renew_failed{$it->{'itemnumber'}};
use C4::Branch;
use C4::Debug;
use C4::Dates qw/format_date format_date_in_iso/;
-use Date::Calc qw/Today/;
use Text::CSV_XS;
+use Koha::DateUtils;
+use DateTime;
my $input = new CGI;
my $order = $input->param('order') || '';
my $op = $input->param('op') || '';
my $dateduefrom = format_date_in_iso($input->param( 'dateduefrom' )) || '';
my $datedueto = format_date_in_iso($input->param( 'datedueto' )) || '';
+# FIXME This is a kludge to include times
+if ($datedueto) {
+ $datedueto .= ' 23:59';
+}
+if ($dateduefrom) {
+ $dateduefrom .= ' 00:00';
+}
+# kludge end
my $isfiltered = $op =~ /apply/i && $op =~ /filter/i;
my $noreport = C4::Context->preference('FilterBeforeOverdueReport') && ! $isfiltered && $op ne "csv";
# FIX 2: ensure there are indexes for columns participating in the WHERE clauses, where feasible/reasonable
- my $todaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", Today());
+ my $today_dt = DateTime->now(time_zone => C4::Context->tz);
+ $today_dt->truncate(to => 'minutes');
+ my $todaysdate = $today_dt->strftime('%Y-%m-%d %H:%M');
$bornamefilter =~s/\*/\%/g;
$bornamefilter =~s/\?/\_/g;
my @displayvalues = map { $_->[1] } @{ $pattrs->{$pattr_filter->{code}} }; # grab second value from each subarray
push @patron_attr_value_loop, { value => join(', ', sort { lc $a cmp lc $b } @displayvalues) };
}
+ my $dt = dt_from_string($data->{date_due}, 'sql');
push @overduedata, {
- duedate => format_date($data->{date_due}),
+ duedate => output_pref($dt),
borrowernumber => $data->{borrowernumber},
barcode => $data->{barcode},
itemnum => $data->{itemnumber},
$template->param(
csv_param_string => $csv_param_string,
- todaysdate => format_date($todaysdate),
+ todaysdate => output_pref($today_dt),
overdueloop => \@overduedata,
nnoverdue => scalar(@overduedata),
noverdue_is_plural => scalar(@overduedata) != 1,
# 2006 SAN-OP
# 2007-2010 BibLibre, Paul POULAIN
# 2010 Catalyst IT
+# 2011 PTFS-Europe Ltd.
#
# This file is part of Koha.
#
#use warnings; FIXME - Bug 2505
use CGI;
+use DateTime;
use C4::Context;
use C4::Auth qw/:DEFAULT get_session/;
use C4::Output;
use C4::Circulation;
-use C4::Dates qw/format_date/;
-use Date::Calc qw/Add_Delta_Days/;
-use C4::Calendar;
use C4::Print;
use C4::Reserves;
use C4::Biblio;
use C4::Branch; # GetBranches GetBranchName
use C4::Koha; # FIXME : is it still useful ?
use C4::RotatingCollections;
+use Koha::DateUtils;
+use Koha::Calendar;
my $query = new CGI;
my $dotransfer = $query->param('dotransfer');
my $canceltransfer = $query->param('canceltransfer');
my $dest = $query->param('dest');
-my $calendar = C4::Calendar->new( branchcode => $userenv_branch );
+my $calendar = Koha::Calendar->new( branchcode => $userenv_branch );
#dropbox: get last open day (today - 1)
-my $today = C4::Dates->new();
-my $today_iso = $today->output('iso');
+my $today = DateTime->now( time_zone => C4::Context->tz());
my $dropboxdate = $calendar->addDate($today, -1);
if ($dotransfer){
# An item has been returned to a branch other than the homebranch, and the librarian has chosen to initiate a transfer
);
if ($returned) {
- my $duedate = $issueinformation->{'date_due'};
+ my $time_now = DateTime->now( time_zone => C4::Context->tz )->truncate( to => 'minutes');
+ my $duedate = $issueinformation->{date_due}->strftime('%Y-%m-%d %H:%M');
$returneditems{0} = $barcode;
$riborrowernumber{0} = $borrower->{'borrowernumber'};
$riduedate{0} = $duedate;
$input{borrowernumber} = $borrower->{'borrowernumber'};
$input{duedate} = $duedate;
- $input{return_overdue} = 1 if ($duedate and $duedate lt $today->output('iso'));
+ $input{return_overdue} = 1 if (DateTime->compare($issueinformation->{date_due}, $time_now) == -1);
push( @inputloop, \%input );
if ( C4::Context->preference("FineNotifyAtCheckin") ) {
elsif ( $code eq 'Wrongbranch' ) {
}
elsif ( $code eq 'Debarred' ) {
- $err{debarred} = format_date( $messages->{'Debarred'} );
+ $err{debarred} = $messages->{'Debarred'};
$err{debarcardnumber} = $borrower->{cardnumber};
$err{debarborrowernumber} = $borrower->{borrowernumber};
$err{debarname} = "$borrower->{firstname} $borrower->{surname}";
{
my $biblio = GetBiblioFromItemNumber( $item->{'itemnumber'});
push @itemloop, {
- duedate => format_date($item->{'date_due'}),
+ duedate => format_sqldatetime($item->{date_due}),
biblionum => $biblio->{'biblionumber'},
barcode => $biblio->{'barcode'},
title => $biblio->{'title'},
riborfirstname => $borrower->{'firstname'}
);
}
-
#set up so only the last 8 returned items display (make for faster loading pages)
my $returned_counter = ( C4::Context->preference('numReturnedItemsToShow') ) ? C4::Context->preference('numReturnedItemsToShow') : 8;
my $count = 0;
my %ri;
if ( $count++ < $returned_counter ) {
my $bar_code = $returneditems{$_};
- my $duedate = $riduedate{$_};
- if ($duedate) {
- my @tempdate = split( /-/, $duedate );
- $ri{year} = $tempdate[0];
- $ri{month} = $tempdate[1];
- $ri{day} = $tempdate[2];
- $ri{duedate} = format_date($duedate);
+ if ($riduedate{$_}) {
+ my $duedate = dt_from_string( $riduedate{$_}, 'sql');
+ $ri{year} = $duedate->year();
+ $ri{month} = $duedate->month();
+ $ri{day} = $duedate->day();
+ $ri{hour} = $duedate->hour();
+ $ri{minute} = $duedate->minute();
+ $ri{duedate} = output_pref($duedate);
my ($b) = GetMemberDetails( $riborrowernumber{$_}, 0 );
- $ri{return_overdue} = 1 if ($duedate lt $today->output('iso'));
+ $ri{return_overdue} = 1 if (DateTime->compare($duedate, DateTime->now()) == -1 );
$ri{borrowernumber} = $b->{'borrowernumber'};
$ri{borcnum} = $b->{'cardnumber'};
$ri{borfirstname} = $b->{'firstname'};
}
push @riloop, \%ri;
}
-
$template->param(
riloop => \@riloop,
genbrname => $branches->{$userenv_branch}->{'branchname'},
errmsgloop => \@errmsgloop,
exemptfine => $exemptfine,
dropboxmode => $dropboxmode,
- dropboxdate => $dropboxdate->output(),
+ dropboxdate => output_pref($dropboxdate),
overduecharges => $overduecharges,
soundon => C4::Context->preference("SoundOn"),
);
--- /dev/null
+alter table issuingrules add column lengthunit varchar(10) default 'days' after issuelength;
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use C4::Context;
+
+my $dbh = C4::Context->dbh;
+
+$dbh->do("ALTER TABLE issues CHANGE date_due date_due datetime");
+$dbh->do("ALTER TABLE issues CHANGE returndate returndate datetime");
+$dbh->do("ALTER TABLE issues CHANGE lastreneweddate lastreneweddate datetime");
+$dbh->do("ALTER TABLE issues CHANGE issuedate issuedate datetime");
+$dbh->do("ALTER TABLE old_issues CHANGE date_due date_due datetime");
+$dbh->do("ALTER TABLE old_issues CHANGE returndate returndate datetime");
+$dbh->do("ALTER TABLE old_issues CHANGE lastreneweddate lastreneweddate datetime");
+$dbh->do("ALTER TABLE old_issues CHANGE issuedate issuedate datetime");
+$dbh->do(q{update issues set date_due = addtime(date_due, '0 23:0:0') where hour(date_due) = 0});
INSERT IGNORE INTO `letter`
(module, code, name, title, content)
VALUES
-('circulation','ODUE','Overdue Notice','Item Overdue','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nAccording to our current records, you have items that are overdue.Your library does not charge late fines, but please return or renew them at the branch below as soon as possible.\n\n<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>> <<branches.branchaddress3>>\nPhone: <<branches.branchphone>>\nFax: <<branches.branchfax>>\nEmail: <<branches.branchemail>>\n\nIf you have registered a password with the library, and you have a renewal available, you may renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned.\n\nThe following item(s) is/are currently overdue:\n\n<item>"<<biblio.title>>" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> Fine: <fine>GBP</fine></item>\n\nThank-you for your prompt attention to this matter.\n\n<<branches.branchname>> Staff\n'),
-('claimacquisition','ACQCLAIM','Acquisition Claim','Item Not Received','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\n<order>Ordernumber <<aqorders.ordernumber>> (<<biblio.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) has not been received.</order>'),
-('serial','RLIST','Routing List','Serial is now available','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following issue is now available:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nPlease pick it up at your convenience.'),
-('members','ACCTDETAILS','Account Details Template - DEFAULT','Your new Koha account details.','Hello <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nYour new Koha account details are:\r\n\r\nUser: <<borrowers.userid>>\r\nPassword: <<borrowers.password>>\r\n\r\nIf you have any problems or questions regarding your account, please contact your Koha Administrator.\r\n\r\nThank you,\r\nKoha Administrator\r\nkohaadmin@yoursite.org'),
-('circulation','DUE','Item Due Reminder','Item Due Reminder','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item is now due:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'),
-('circulation','DUEDGST','Item Due Reminder (Digest)','Item Due Reminder','You have <<count>> items due'),
-('circulation','PREDUE','Advance Notice of Item Due','Advance Notice of Item Due','Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nThe following item will be due soon:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'),
-('circulation','PREDUEDGST','Advance Notice of Item Due (Digest)','Advance Notice of Item Due','You have <<count>> items due soon'),
-('reserves', 'HOLD', 'Hold Available for Pickup', 'Hold Available for Pickup at <<branches.branchname>>', 'Dear <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\nLocation: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>'),
-('reserves', 'HOLD_PRINT', 'Hold Available for Pickup (print notice)', 'Hold Available for Pickup at <<branches.branchname>>', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nChange Service Requested\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\n\nYou have a hold available for pickup as of <<reserves.waitingdate>>:\r\n\r\nTitle: <<biblio.title>>\r\nAuthor: <<biblio.author>>\r\nCopy: <<items.copynumber>>\r\n'),
-('circulation','CHECKIN','Item Check-in (Digest)','Check-ins','The following items have been checked in:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you.'),
-('circulation','CHECKOUT','Item Check-out (Digest)','Checkouts','The following items have been checked out:\r\n----\r\n<<biblio.title>>\r\n----\r\nThank you for visiting <<branches.branchname>>.'),
-('reserves', 'HOLDPLACED', 'Hold Placed on Item', 'Hold Placed on Item','A hold has been placed on the following item : <<biblio.title>> (<<biblio.biblionumber>>) by the user <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).'),
-('suggestions','ACCEPTED','Suggestion accepted', 'Purchase suggestion accepted','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your suggestion today. The item will be ordered as soon as possible. You will be notified by mail when the order is completed, and again when the item arrives at the library.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
-('suggestions','AVAILABLE','Suggestion available', 'Suggested purchase available','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested is now part of the collection.\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>'),
-('suggestions','ORDERED','Suggestion ordered', 'Suggested item ordered','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nWe are pleased to inform you that the item you requested has now been ordered. It should arrive soon, at which time it will be processed for addition into the collection.\n\nYou will be notified again when the book is available.\n\nIf you have any questions, please email us at <<branches.branchemail>>\n\nThank you,\n\n<<branches.branchname>>'),
-('suggestions','REJECTED','Suggestion rejected', 'Purchase suggestion declined','Dear <<borrowers.firstname>> <<borrowers.surname>>,\n\nYou have suggested that the library acquire <<suggestions.title>> by <<suggestions.author>>.\n\nThe library has reviewed your request today, and has decided not to accept the suggestion at this time.\n\nThe reason given is: <<suggestions.reason>>\n\nIf you have any questions, please email us at <<branches.branchemail>>.\n\nThank you,\n\n<<branches.branchname>>');
+('circulation','ODUE','Avis de retard','Document en retard','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nSelon nos informations actuelles, vous avez des documents signalés en retard dans votre compte.La Bibliothèque n\'applique pas les pénalités, mais nous vous invitons à retourner ou renouveler ces documents au plus vite dans la Bibliothèque suivante.\n\n<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>> <<branches.branchaddress3>>\nTéléphone: <<branches.branchphone>>\nFax: <<branches.branchfax>>\nCourriel: <<branches.branchemail>>\n\nSi vous possédez un identifiant et un mot de passe pour vous connecter à notre catalogue en ligne,vous pouvez depuis celui-ci prolonger la durée de prêt des documents. Si les documents ont plus de 3à jours de retard, vous ne pourrez plus utiliser votre carte d\'adhérent tant que les documents ne seront pas rendus.\n\nLe(s) document(s) actuellement en retard:\n\n<item>"<<biblio.title>>" de <<biblio.author>>, <<items.itemcallnumber>>, Code barres: <<items.barcode>> Pénalité: <fine>GBP</fine></item>\n\nAvec nos remerciements.\n\n<<branches.branchname>> La banque de prêt\n'),
+('claimacquisition','ACQCLAIM','Réclamation Acquisitions','Document non reçu','<<aqbooksellers.name>>\r\n<<aqbooksellers.address1>>\r\n<<aqbooksellers.address2>>\r\n<<aqbooksellers.address3>>\r\n<<aqbooksellers.address4>>\r\n<<aqbooksellers.phone>>\r\n\r\n<order>Commande <<aqorders.ordernumber>> (<<biblio.title>>) (<<aqorders.quantity>> ordered) ($<<aqorders.listprice>> each) pas encore reçue.</order>'),
+('serial','RLIST','Liste de routage','Fascicule de périodique disponible','<<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nLe numéro suivant est disponible:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)\r\n\r\nVous pouvez venir le retirer quand vous voulez.'),
+('members','ACCTDETAILS','Nouveau compte adhérent','Votre nouveau compte adhérent.','Bonjour <<borrowers.title>> <<borrowers.firstname>> <<borrowers.surname>>.\r\n\r\nLes informations de votre nouveau compte sont:\r\n\r\nIdentifiant: <<borrowers.userid>>\r\nMot de passe: <<borrowers.password>>\r\n\r\nSi vous avez des questions au sujet de votre nouveau compte, merci de prendre contact à l\'acceuil de la Bibliothèque.\r\n\r\nMerci,\r\nLa Bibliothèque\r\nkohaadmin@yoursite.org'),
+('circulation','DUE','Document à rendre ','Document à rendre','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nLe document suivant doit être rendu aujourd\'hui:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'),
+('circulation','DUEDGST','Document à rendre (résumé)','Document à rendre','Vous avez <<count>> document(s) à rendre'),
+('circulation','PREDUE','Document à rendre bientôt','Document à rendre bientôt','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nLa date de retour du doucment suivant est proche:\r\n\r\n<<biblio.title>>, <<biblio.author>> (<<items.barcode>>)'),
+('circulation','PREDUEDGST','Document à rendre bientôt (résumé)','Document à rendre bientôt','Vous avez <<count>> document(s) dont la date de retour est proche'),
+('reserves', 'HOLD', 'Réservation disponible pour retrait', 'Réservation disponible à la banque de retrait du site <<branches.branchname>>', 'Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\r\n\r\nVous avez une réservation disponible pour retrait depuis le <<reserves.waitingdate>>:\r\n\r\nTitre: <<biblio.title>>\r\nAuteur: <<biblio.author>>\r\nNuméro de fascicule: <<items.copynumber>>\r\nSite: <<branches.branchname>>\r\n<<branches.branchaddress1>>\r\n<<branches.branchaddress2>>\r\n<<branches.branchaddress3>>'),
+('reserves', 'HOLD_PRINT', 'Réservation disponible pour retrait (papier)', 'Réservation disponible à la banque de retrait du site <<branches.branchname>>', '<<branches.branchname>>\n<<branches.branchaddress1>>\n<<branches.branchaddress2>>\n\n\nLe service des réservations\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>>\n<<borrowers.address>>\n<<borrowers.city>> <<borrowers.zipcode>>\n\n\n\n\n\n\n\n\n\n\n<<borrowers.firstname>> <<borrowers.surname>> <<borrowers.cardnumber>>\n\nVotre réservation est disponible pour retrait depuis le <<reserves.waitingdate>>:\r\n\r\nTitre: <<biblio.title>>\r\nAuteur: <<biblio.author>>\r\nNuméro de fascicule: <<items.copynumber>>\r\n'),
+('circulation','CHECKIN','Document rendu (résumé)','Retours','Les documents suivants ont été rendus:\r\n----\r\n<<biblio.title>>\r\n----\r\nMerci.'),
+('circulation','CHECKOUT','Document prêté (résumé)','Prêts','Les documents suivants ont été prêtés:\r\n----\r\n<<biblio.title>>\r\n----\r\nMerci de votre visite <<branches.branchname>>.'),
+('reserves', 'HOLDPLACED', 'Demande de réservation', 'Demande de réservation','Une demande de réservation a été placée sur le document : <<biblio.title>> (<<biblio.biblionumber>>) par l\'adhérent <<borrowers.firstname>> <<borrowers.surname>> (<<borrowers.cardnumber>>).'),
+('suggestions','ACCEPTED','Suggestion accceptée', 'Suggestion acceptée','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez crée une suggestion d\'achat au sujet du document <<suggestions.title>> de <<suggestions.author>>.\n\nLa Bibliothèque a reçu votre demande ce jour. Nous donnerons suite à votre demande aussi vite que possible. Vous serez averti par courriel dès que la commande sera envoyée,et quand les documents seront arrivés à la Bibliothèque.\n\nSi vous avez des questions, merci de nous contacter à l\'adresse suivante <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
+('suggestions','AVAILABLE','Suggestion disponible', 'Suggestion d\'achat disponible','cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une suggestion d\'achat pour le docuement <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous aviez demandé est maintenant disponible dans nos collections.\n\nSi vous avez des questions, merci de nous contacter par courriel à l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>'),
+('suggestions','ORDERED','Suggestion commandée', 'Suggestion commandée','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez effectué une demande de suggestion d\'achat sur le docuement <<suggestions.title>> de <<suggestions.author>>.\n\nNous sommes heureux de vous informer que le document que vous avez demandé est maintenant en commande. Le document devrait arriver rapidement dans nos collections.\n\nVous serez averti quand le docuement sera disponible.\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <<branches.branchemail>>\n\nMerci,\n\n<<branches.branchname>>'),
+('suggestions','REJECTED','Suggestion rejetée', 'Suggestion d\'achat rejeté','Cher(e) <<borrowers.firstname>> <<borrowers.surname>>,\n\nVous avez fait la demande du document <<suggestions.title>> de <<suggestions.author>>.\n\nla Bibliothèque a examiné votre demande ce jour, et a décidé de ne pas retenir la suggestion pour l\'instant.\n\nLa raison est la suivante: <<suggestions.reason>>\n\nSi vous avez des questions, merci de nous contacter à l\'adresse <<branches.branchemail>>.\n\nMerci,\n\n<<branches.branchname>>');
-Sample Notices
+Notifications d'exemple
`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) NOT NULL DEFAULT '',-- 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`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
`branchip` varchar(15) default NULL, -- the IP address for your library or branch
`branchprinter` varchar(100) default NULL, -- unused in Koha
`branchnotes` mediumtext, -- notes related to your library or branch
+ opac_info text, -- HTML that displays in OPAC
UNIQUE KEY `branchcode` (`branchcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `issues` ( -- information related to check outs or issues
`borrowernumber` int(11), -- foreign key, linking this to the borrowers table for the patron this item was checked out to
`itemnumber` int(11), -- foreign key, linking this to the items table for the item that was checked out
- `date_due` date default NULL, -- date the item is due (yyyy-mm-dd)
+ `date_due` datetime default NULL, -- datetime the item is due (yyyy-mm-dd hh:mm::ss)
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
`issuingbranch` varchar(18) default NULL,
- `returndate` date default NULL, -- date the item was returned, will be NULL until moved to old_issues
- `lastreneweddate` date default NULL, -- date the item was last renewed
+ `returndate` datetime default NULL, -- date the item was returned, will be NULL until moved to old_issues
+ `lastreneweddate` datetime default NULL, -- date the item was last renewed
`return` varchar(4) default NULL,
`renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
- `issuedate` date default NULL, -- date the item was checked out or issued
+ `issuedate` datetime default NULL, -- date the item was checked out or issued
KEY `issuesborridx` (`borrowernumber`),
KEY `bordate` (`borrowernumber`,`timestamp`),
CONSTRAINT `issues_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE RESTRICT ON UPDATE CASCADE,
CREATE TABLE `old_issues` ( -- lists items that were checked out and have been returned
`borrowernumber` int(11) default NULL, -- foreign key, linking this to the borrowers table for the patron this item was checked out to
`itemnumber` int(11) default NULL, -- foreign key, linking this to the items table for the item that was checked out
- `date_due` date default NULL, -- date the item is due (yyyy-mm-dd)
+ `date_due` datetime default NULL, -- date the item is due (yyyy-mm-dd)
`branchcode` varchar(10) default NULL, -- foreign key, linking to the branches table for the location the item was checked out
`issuingbranch` varchar(18) default NULL,
- `returndate` date default NULL, -- date the item was returned
- `lastreneweddate` date default NULL, -- date the item was last renewed
+ `returndate` datetime default NULL, -- date the item was returned
+ `lastreneweddate` datetime default NULL, -- date the item was last renewed
`return` varchar(4) default NULL,
`renewals` tinyint(4) default NULL, -- lists the number of times the item was renewed
`timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- the date and time this record was last touched
- `issuedate` date default NULL, -- date the item was checked out or issued
+ `issuedate` datetime default NULL, -- date the item was checked out or issued
KEY `old_issuesborridx` (`borrowernumber`),
KEY `old_issuesitemidx` (`itemnumber`),
KEY `old_bordate` (`borrowernumber`,`timestamp`),
`checked` smallint(6) default NULL, -- whether this target is checked by default (1 for yes, 0 for no)
`rank` int(11) default NULL, -- where this target appears in the list of targets
`syntax` varchar(80) default NULL, -- marc format provided by this target
+ `timeout` int(11) NOT NULL DEFAULT '0',
`icon` text, -- unused in Koha
`position` enum('primary','secondary','') NOT NULL default 'primary',
`type` enum('zed','opensearch') NOT NULL default 'zed',
SetVersion($DBversion);
}
-
$DBversion = "3.07.00.029";
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
my $installer = C4::Installer->new();
SetVersion ($DBversion);
}
-$DBversion = "3.07.99.032";
-if ( C4::Context->preference("Version") lt TransformToNum($DBversion) ) {
+$DBversion = "3.07.00.032";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
$dbh->do("ALTER TABLE virtualshelves MODIFY COLUMN owner int"); #should have been int already (fk to borrowers)
$dbh->do("UPDATE virtualshelves vi LEFT JOIN borrowers bo ON bo.borrowernumber=vi.owner SET vi.owner=NULL where bo.borrowernumber IS NULL"); #before adding the constraint on borrowernumber, we need to get rid of deleted owners
$dbh->do("DELETE FROM virtualshelves WHERE owner IS NULL and category=1"); #delete private lists without owner (cascades to shelfcontents)
SetVersion($DBversion);
}
+$DBversion = "3.07.00.033";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE branches ADD opac_info text;");
+ print "Upgrade to $DBversion done add opac_info to branches \n";
+ SetVersion($DBversion);
+}
+
+
+
+
+$DBversion = "3.07.00.034";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN category_code VARCHAR(10) NULL DEFAULT NULL AFTER `display_checkout`");
+ $dbh->do("ALTER TABLE borrower_attribute_types ADD COLUMN class VARCHAR(255) NOT NULL DEFAULT '' AFTER `category_code`");
+ $dbh->do("ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode)");
+ print "Upgrade to $DBversion done (New fields category_code and class in borrower_attribute_types table)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.07.00.035";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do("ALTER TABLE issues CHANGE date_due date_due datetime");
+ $dbh->do("ALTER TABLE issues CHANGE returndate returndate datetime");
+ $dbh->do("ALTER TABLE issues CHANGE lastreneweddate lastreneweddate datetime");
+ $dbh->do("ALTER TABLE issues CHANGE issuedate issuedate datetime");
+ $dbh->do("ALTER TABLE old_issues CHANGE date_due date_due datetime");
+ $dbh->do("ALTER TABLE old_issues CHANGE returndate returndate datetime");
+ $dbh->do("ALTER TABLE old_issues CHANGE lastreneweddate lastreneweddate datetime");
+ $dbh->do("ALTER TABLE old_issues CHANGE issuedate issuedate datetime");
+ $dbh->do("alter table issuingrules add column lengthunit varchar(10) default 'days' after issuelength");
+ print "Upgrade to $DBversion done (Setting up issues tables for hourly loans)\n";
+ SetVersion($DBversion);
+}
+
+$DBversion = "3.07.00.036";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do(qq{
+ ALTER TABLE `z3950servers` ADD `timeout` INT( 11 ) NOT NULL DEFAULT '0' AFTER `syntax`;
+ });
+ print "Upgrade to $DBversion done (New timeout field in z3950servers)\n";
+ SetVersion($DBversion);
+}
+
=head1 FUNCTIONS
=head2 DropAllForeignKeys($table)
-borrowers.borrowernumber Borrower Number
-borrowers.cardnumber Card Number
+borrowers.borrowernumber Borrower number
+borrowers.title Salutation
borrowers.surname Surname
-borrowers.firstname Firstname
-borrowers.title Title
-borrowers.othernames Other Names
-borrowers.initials Initials
-borrowers.streetaddress Street Address
-borrowers.suburb Suburb
-borrowers.city City
-borrowers.phone Phone
-borrowers.emailaddress Email
-borrowers.faxnumber Fax
-borrowers.textmessaging Opac Message
-borrowers.altstreetaddress Alternative Street Address
-borrowers.altsuburb Alternative Suburb
-borrowers.altcity Alternative City
-borrowers.altphone Alternative Phone
-borrowers.dateofbirth Date of Birth
-borrowers.branchcode Branch Code
-borrowers.categorycode Borrowers Category
-borrowers.dateenrolled Date Enrolled
-borrowers.gonenoaddress Address Missing
-borrowers.lost Lost Card
-borrowers.debarred Restricted
-borrowers.studentnumber Student Id number
-borrowers.school School
-borrowers.contactname Contact Name
-borrowers.borrowernotes Circulation Notes
-borrowers.guarantor Guarantor(parent)
-borrowers.area Area
-borrowers.ethnicity Ethnicity
-borrowers.ethnotes Ethnicity Notes
+borrowers.firstname First name
+borrowers.dateofbirth Date of birth
+borrowers.initials Initials
+borrowers.othernames Other name
borrowers.sex Gender
-borrowers.expiry Expiry Date
-borrowers.altnotes Alternative Contact Notes
-borrowers.altrelationship Relationship of Alternative Contact
-borrowers.streetcity Streetcity??
-borrowers.phoneday Work Phone
-borrowers.preferredcont Preferred method of Contact
-borrowers.physstreet Physical Street Address
-borrowers.password Password
-borrowers.flags Warnings
-borrowers.userid Login ID
-borrowers.homezipcode Zip/Post Code
-borrowers.zipcode Zip/Post Code 2?
-borrowers.sort1 Sorting Column
-borrowers.sort2 Sorting Column 2
-borrowers.cellph Cellphone number
-borrowers.borlog
-borrowers.checkhist
-items.itemnumber Item Number (koha internal)
-items.biblionumber Biblio Number (koha internal)
-items.multivolumepart Item one part of a Multi volume set
-items.biblioitemnumber Biblioitem Number (koha internal)
+borrowers.relationship Relationship
+borrowers.guarantorid Guarantor borrower number
+borrowers.streetnumber Street number
+borrowers.streettype Street type
+borrowers.address Address
+borrowers.address2 Address 2
+borrowers.city City
+borrowers.state State
+borrowers.zipcode Zip/postal code
+borrowers.country Country
+borrowers.phone Primary phone
+borrowers.phonepro Secondary phone
+borrowers.mobile Other phone
+borrowers.email Primary email
+borrowers.emailpro Secondary email
+borrowers.fax Fax
+borrowers.B_streetnumber Alternate address: Street number
+borrowers.B_streettype Alternate address: Street type
+borrowers.B_address Alternate address: Address
+borrowers.B_address2 Alternate address: Address 2
+borrowers.B_city Alternate address: City
+borrowers.B_state Alternate address: State
+borrowers.B_zipcode Alternate address: Zip/postal code
+borrowers.B_country Alternate address: Country
+borrowers.B_phone Alternate address: Phone
+borrowers.B_email Alternate address: Email
+borrowers.contactnote Alternate contact: Note
+borrowers.altcontactfirstname Alternate contact: Last name
+borrowers.altcontactsurname Alternate contact: First name
+borrowers.altcontactaddress1 Alternate contact: Address
+borrowers.altcontactaddress2 Alternate contact: Address 2
+borrowers.altcontactaddress3 Alternate contact: City
+borrowers.contactname Alternate contact: Surname
+borrowers.contactfirstname Alternate contact: First name
+borrowers.contacttitle Alternate contact: Title
+borrowers.altcontactstate Alternate contact: State
+borrowers.altcontactzipcode Alternate contact: Zip/postal code
+borrowers.altcontactcountry Alternate contact: Country
+borrowers.altcontactphone Alternate contact: Phone
+borrowers.cardnumber Card number
+borrowers.branchcode Home library
+borrowers.categorycode Category
+borrowers.sort1 Sort 1
+borrowers.sort2 Sort 2
+borrowers.dateenrolled Registration date
+borrowers.dateexpiry Expiry date
+borrowers.opacnote OPAC note
+borrowers.borrowernotes Circulation note
+borrowers.userid Username
+borrowers.password Password
+borrowers.flags System permissions
+borrowers.gonenoaddress Gone no address flag
+borrowers.lost Lost card flag
+borrowers.debarred Restricted [until] flag
+borrowers.debarredcomment Comment
+borrowers.smsalertnumber Mobile phone number
+borrowers.privacy Privacy settings
+items.itemnumber Item number (internal)
+items.biblionumber Biblio number (internal)
+items.biblioitemnumber Biblioitem number (internal)
items.barcode Barcode
-items.dateaccessioned Accession Date
-items.booksellerid Supplier ID
-items.homebranch Home Branch
+items.dateaccessioned Date acquired
+items.booksellerid Source of acquisition
+items.homebranch Permanent library
items.price Price
-items.replacementprice Replacement Price
-items.replacementpricedate Date Replacement Price was set
-items.datelastborrowed Date Item last issued
-items.datelastseen Date Item was last seen by Koha
-items.multivolume Volume Number (if part of a multivolume work)
-items.stack Is the item in the stack?
-items.onloan On loan
-items.notforloan Item Not for loan
-items.itemlost Item Lost
-items.wthdrawn Item Cancelled
-items.itemcallnumber Item Call Number
-items.issues Issues Count
-items.renewals Renewals Count
-items.reserves Reserves Count
-items.restricted Item Restricted
-items.binding Item needs binding
-items.itemnotes Item Notes
-items.holdingbranch Holding Branch
-items.paidfor Has Item been lost and then paid for
+items.replacementprice Replacement price
+items.replacementpricedate Price effective from
+items.datelastborrowed Date last checked out
+items.datelastseen Date last seen
+items.stack Shelving control number
+items.onloan Due date
+items.cn_source Source of classification / shelving scheme
+items.cn_sort Koha normalized classification for sorting
+items.notforloan Not for loan
+items.itemlost Lost status
+items.wthdrawn Withdrawn status
+items.itemcallnumber Call number
+items.issues Total checkouts
+items.renewals Total renewals
+items.reserves Total holds
+items.restricted Use restrictions
+items.itemnotes Public note
+items.holdingbranch Current library
+items.paidfor
items.timestamp Timestamp
-items.location Location
-items.ccode Koha Collection
-items.itype Item-level Item Type
-items.spystatus
-items.spydescr
-items.itemlog
-items.spycopydata
-statistics.datetime Statistics Date and Time
-statistics.branch Branch Code
-statistics.proccode Type of Procedure
+items.location Shelving location
+items.ccode Collection code
+items.itype Koha itemtype
+items.stocknumber Inventory number
+items.damaged Damaged status
+items.materials Materials specified
+items.uri Uniform Resource Identifier
+items.more_subfields_xml Additional subfields (XML)
+items.enumchron Serial enumeraton/chronology
+items.copynumber Copy number
+statistics.datetime Statistics date and time
+statistics.branch Library
+statistics.proccode Type of procedure
statistics.value Value
statistics.type Type
statistics.other
-statistics.usercode User Code
-statistics.itemnumber Item Number
-statistics.itemtype Item Type
-statistics.borrowernumber Borrower Number
-biblio.frameworkcode Framework Code
+statistics.usercode User code
+statistics.itemnumber Item number
+statistics.itemtype Itemtype
+statistics.borrowernumber Borrower number
+biblio.frameworkcode Framework code
biblio.author Author
-biblio.datecreated Creation Date
-biblio.timestamp Modification Date
-biblioitems.biblioitemnumber Biblioitem Number
-biblioitems.biblionumber Biblio Number
-biblioitems.volume Volume Number
+biblio.datecreated Creation date
+biblio.timestamp Modification date
+biblioitems.biblioitemnumber Biblioitem number
+biblioitems.biblionumber Biblio number
+biblioitems.volume Volume number
biblioitems.number Number
biblioitems.classification Classification
-biblioitems.itemtype Biblio-level Item Type
+biblioitems.itemtype Biblio-level item type
biblioitems.isbn ISBN
biblioitems.issn ISSN
-biblioitems.dewey Dewey/Classification
-biblioitems.subclass Sub Classification
-biblioitems.publicationyear Publication Date
+biblioitems.dewey Dewey/classification
+biblioitems.subclass Sub classification
+biblioitems.publicationyear Publication date
biblioitems.publishercode Publisher
-biblioitems.volumedate Volume Date
-biblioitems.volumeddesc Volume Information
+biblioitems.volumedate Volume date
+biblioitems.volumedesc Volume information
biblioitems.timestamp Timestamp
biblioitems.illus Illustrator
-biblioitems.pages Number of Pages
+biblioitems.pages Number of pages
biblioitems.notes Notes
biblioitems.size Size
-biblioitems.place Place of Publication
+biblioitems.place Place of publication
biblioitems.lccn LCCN
-biblioitems.marc MARC Blob
+biblioitems.marcxml MARC blob
biblioitems.url URL
<li><a href="/cgi-bin/koha/tools/import_borrowers.pl">Import patrons</a></li>
[% END %]
[% IF ( CAN_user_tools_edit_notices ) %]
- <li><a href="/cgi-bin/koha/tools/letter.pl">Notices</a></li>
+ <li><a href="/cgi-bin/koha/tools/letter.pl">Notices & Slips</a></li>
[% END %]
[% IF ( CAN_user_tools_edit_notice_status_triggers ) %]
<li><a href="/cgi-bin/koha/tools/overduerules.pl">Overdue notice/status triggers</a></li>
</script>
</head>
-<body>
+<body id="acq_acqui-home" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Acquisitions › Order Staged MARC Records
[% IF ( batch_details ) %]
//]]>
</script>
</head>
-<body>
+<body id="acq_addorderiso2709" class="acq">
[% 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/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> › Add orders from iso2709 file</div>
<td>[% batch_lis.file_name %]</td>
<td>[% batch_lis.comments %]</td>
<td>[% batch_lis.import_status %]</td>
- <td>[% batch_lis.upload_timestamp %]</td>
+ <td>[% batch_lis.staged_date | $KohaDates %] [% batch_lis.staged_hour %]</td>
<td>[% batch_lis.num_biblios %]</td>
<td><a href="[% batch_lis.scriptname %]?import_batch_id=[% batch_lis.import_batch_id %]&basketno=[% basketno %]&booksellerid=[% booksellerid %]">Add orders</a></td>
</tr>
.sortmsg {font-size: 80%;}
</style>
</head>
-<body>
+<body id="acq_basket" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="acq_basketgroup" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
// to check if the data are correctly entered.
function Check(ff) {
var ok=0;
- var _alertString="Form not submitted because of the following problem(s)\n";
- _alertString +="-------------------------------------------------------------------\n\n";
+ var _alertString="Form not submitted because of the following problem(s)";
+ _alertString +="\n-------------------------------------------------------------------\n\n";
if (!(isNotNull(ff.basketname,0))){
ok=1;
_alertString += "- name missing\n";
</style>
</head>
-<body>
+<body id="acq_basketheader" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Search for vendor [% supplier %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</script>
</head>
-<body>
+<body id="acq_booksellers" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
[% basket.authorisedby_firstname %]
[% basket.authorisedby_surname %]
</td>
- <td>[% basket.creationdate %]</td>
+ <td>[% basket.creationdate | $KohaDates %]</td>
<td>
[% IF ( basket.closedate ) %]
- closed on [% basket.closedate %]
+ closed on [% basket.closedate | $KohaDates %]
<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
[% ELSE %]
[% IF ( basket.active ) %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="acq_histsearch" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="acq_lateorders" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
[% INCLUDE 'greybox.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="acq_neworderbiblio" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="acq_neworderempty" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<title>Koha › Acquisitions › Basket [% basketno %] › Duplicate warning</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="acq_neworderempty_duplicate" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<title>Koha › Acquisitions › Add order from a suggestion</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="acq_newordersuggestion" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'suggestions-add-search.inc' %]
<title>Koha › Acquisitions › Ordered</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="acq_ordered" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% themelang %]/js/additem.js"> </script>
</head>
-<body>
+<body id="acq_orderreceive" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
</script>
</head>
-<body>
+<body id="acq_parcel" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="acq_parcels" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<title>Koha › Acquisitions › Spent</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="acq_spent" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Vendor [% bookselname %]</title>
[% INCLUDE 'doc-head-close.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="acq_supplier" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber %]&booksellerid=[% contract.booksellerid %]">[% contract.contractname %]</a>
</td>
<td>[% contract.contractdescription %]</td>
- <td>[% contract.contractstartdate %]</td>
- <td>[% contract.contractenddate %]</td>
+ <td>[% contract.contractstartdate | $KohaDates %]</td>
+ <td>[% contract.contractenddate | $KohaDates %]</td>
<td><a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% contract.contractnumber %]&booksellerid=[% contract.booksellerid %]">Edit</a></td>
<td><a href="/cgi-bin/koha/admin/aqcontract.pl?op=delete_confirm&contractnumber=[% contract.contractnumber %]&booksellerid=[% contract.booksellerid %]">Delete</a></td>
</tr>
//]]>
</script>
</head>
-<body>
+<body id="acq_uncertainprice" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent !important; }
</style>
</head>
-<body>
+<body id="acq_z3950_search" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<title>Koha › Administration</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="admin_admin-home" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</head>
-<body>
+<body id="admin_aqbudget_owner_search" class="admin">
<div id="custom-doc" class="yui-t7">
<div id="bd">
<div class="yui-g">
</head>
-<body>
+<body id="admin_aqbudgetperiods" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'budgets-admin-search.inc' %]
[% END %]
</head>
-<body>
+<body id="admin_aqbudgets" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'budgets-admin-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="acq_aqcontract" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'contracts-admin-search.inc' %]
</script>
<style type="text/css">td.locked { background-image: url('/intranet-tmpl/prog/img/locked.png'); padding-left : 20px; background-repeat: no-repeat; background-position: 4% 50%; } a.control { font-size:85%;text-decoration:none; }</style>
</head>
-<body>
+<body id="admin_aqplan" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'budgets-admin-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="admin_auth_subfields_structure" 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> ›
//]]>
</script>
</head>
-<body>
+<body id="admin_auth_tag_structure" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
</style>
</head>
-<body>
+<body id="admin_authorised_values" 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> › [% IF ( add_form ) %] <a href="/cgi-bin/koha/admin/authorised_values.pl">Authorized Values</a> › [% IF ( action_modify ) %]Modify authorized value[% END %]
//]]>
</script>
</head>
-<body>
+<body id="admin_authtypes" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
</head>
-<body>
+<body id="admin_biblio_framework" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
<style type="text/css">td { text-align: center; }</style>
</head>
-<body>
+<body id="admin_branch_transfer_limits" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.pager.js"></script>
+<script type="text/javascript" src="[% themelang %]/js/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
+<script language="javascript" type="text/javascript">
+tinyMCE.init({
+ mode : "textareas",
+ theme : "advanced",
+ content_css : "[% themelang %]/css/tinymce.css",
+ plugins : "table,save,advhr,advlink,iespell,contextmenu",
+ theme_advanced_buttons1 : "save,|,bold,italic,|,cut,copy,paste,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,|,link,unlink,anchor,cleanup,help,code,advhr,",
+ theme_advanced_buttons2 : "tablecontrols,|,bullist,numlist,|,outdent,indent,|,undo,redo,|,removeformat,|,visualaid,|,sub,sup,|,charmap",
+ theme_advanced_buttons3 : "",
+ theme_advanced_toolbar_location : "top",
+ theme_advanced_toolbar_align : "left",
+ theme_advanced_path_location : "bottom",
+ theme_advanced_resizing : true,
+ apply_source_formatting : true,
+ height : "300",
+ width : "700"
+});
+</script>
</head>
-<body>
+<body id="admin_branches" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<li><label for="branchfax">Fax</label><input type="text" name="branchfax" id="branchfax" value="[% branchfax |html %]" /></li>
<li><label for="branchemail">Email</label><input type="text" name="branchemail" id="branchemail" value="[% branchemail |html %]" /></li>
<li><label for="branchurl">url</label><input type="text" name="branchurl" id="branchurl" value="[% branchurl |html %]" /></li>
+ <li><label for="opac_info">OPAC Info</label><textarea name="opac_info" id="opac_info">[% opac_info |html %]</textarea></li>
<li><label for="branchip">IP</label><input type="text" name="branchip" id="branchip" value="[% branchip |html %]" /> <span class="hint">Can be entered as a single IP, or a subnet such as 192.168.1.*</span></li>
<!--
<li><label for="branchprinter">Library Printer</label>
<br /><a href="mailto:[% branche.branchemail %]">[% branche.branchemail |html %]</a>[% END %]
[% IF ( branche.branchurl ) %]
<br /><a href="[% branche.branchurl %]">[% branche.branchurl |html %]</a>[% END %]
+ [% IF ( branche.opac_info ) %]
+ <br />OPAC Info: <div>[% branche.opac_info %]</div>[% END %]
[% IF ( branche.branchnotes ) %]
<br />Notes: [% branche.branchnotes |html %][% END %]
[% END %]
</script>
<style type="text/css">#enrolmentmessage.hint { display : none; }</style>
</head>
-<body>
+<body id="admin_categorie" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patrons-admin-search.inc' %]
[% IF ( total ) %] :[% total %] errors found[% ELSE %] : Configuration OK![% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="admin_checkmarc" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="admin_cities" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cities-admin-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="admin_classsources" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Administration › Issuing Rules › Clone Issuing Rules</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="admin_clone-rules" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="admin_currency" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'currencies-admin-search.inc' %]
</head>
-<body>
+<body id="admin_fieldmapping" 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> › Keyword to MARC Mapping</div>
}); //]]>
</script>
</head>
-<body>
+<body id="admin_item_circulation_alerts" 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> › Item Circulation Alerts </div>
fieldset.rows .ui-tabs-panel { margin-right : 10px; margin-left : 10px;margin-bottom:10px;}
</style>
</head>
-<body>
+<body id="admin_itemtypes" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="admin_koha2marclinks" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<script type="text/javascript">
//<![CDATA[
- $(document).ready(function() {
- $('#subfieldtabs > ul').tabs();
- $("a.displaymore").click(function(){
- $("#"+$(this).attr("href").replace("#","")).toggle();
- if($(this).html() == "display more constraints"){
- $(this).html("hide constraints");
- } else {
- $(this).html("display more constraints");
- }
- });
- });
+$(document).ready(function() {
+ $('#subfieldtabs > ul').tabs();
+ $("a.displaymore").click(function(){
+ var link = $(this);
+ var constraints = $("#"+$(this).attr("href").replace("#",""));
+ constraints.toggle();
+ if($(constraints).is(':visible')){
+ link.html(_("Hide constraints"));
+ } else {
+ link.html(_("Display more constraints"));
+ }
+ });
+});
/*function displayMoreConstraint(numlayer){
var thisdiv = document.getElementById(numlayer);
//]]>
</script>
</head>
-<body>
+<body id="admin_marc_subfields_structure" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</ol>
</fieldset>
- <a class="displaymore" href="#more[% loo.urisubfieldcode %]">display more constraints</a>
+ <a class="displaymore" href="#more[% loo.urisubfieldcode %]">Display more constraints</a>
<div id="more[% loo.urisubfieldcode %]" style="display:none; clear: both">
<fieldset class="rows" style="float:none;">
<legend>Advanced constraints:</legend>
//]]>
</script>
</head>
-<body>
+<body id="admin_marctagstructure" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
div.matchgroup { border:1px solid #DDD; border-left-width: 15px; padding:.4em; margin-bottom:.6em;}
</style>
</head>
-<body>
+<body id="admin_matching-rules" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
</head>
-<body>
+<body id="admin_oai_set_mappings" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
</head>
-<body>
+<body id="admin_oai_sets" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="admin_patron-attr-types" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
to be chosen from the authorized value list. However, an authorized value list is not
enforced during batch patron import.</span>
</li>
+ <li>
+ <label for="category">Category: </label>
+ <select name="category_code" id="category">
+ <option value=""></option>
+ [% FOREACH cat IN categories %]
+ [% IF ( cat.categorycode == category_code ) %]<option value="[% cat.categorycode %]" selected="selected">[% cat.description %]</option>[% ELSE %]<option value="[% cat.categorycode %]">[% cat.description %]</option>[% END %]
+ [% END %]
+ </select>
+ <span>Please let blank if you want these attributs to be for all types of patron. Else, select one type.</span>
+ </li>
+ <li>
+ <label for="class">Class: </label>
+ <select name="class">
+ <option value="" />
+ [% FOREACH class IN classes_val_loop %]
+ [% IF ( class.selected ) %]
+ <option value="[% class.authorised_value %]" selected="selected">
+ [% class.lib %]
+ </option>
+ [% ELSE %]
+ <option value="[% class.authorised_value %]" >
+ [% class.lib %]
+ </option>
+ [% END %]
+ [% END %]
+ </select>
+ <span>Group attributes types with a block title (based on Authorised values category 'PA_CLASS')</span>
+ </li>
</ol>
</fieldset>
<fieldset class="action">
<div class="dialog message">Could not delete patron attribute type "[% ERROR_delete_not_found %]"
— it was already absent from the database.</div>
[% END %]
-[% IF ( available_attribute_types ) %]<table>
- <tr>
- <th>Code</th>
- <th>Description</th>
- <th>Actions</th>
- </tr>
- [% FOREACH available_attribute_type IN available_attribute_types %]
- <tr>
- <td>[% available_attribute_type.code |html %]</td>
- <td>[% available_attribute_type.description %]</td>
- <td>
- <a href="[% available_attribute_type.script_name %]?op=edit_attribute_type&code=[% available_attribute_type.code |html %]">Edit</a>
- <a href="[% available_attribute_type.script_name %]?op=delete_attribute_type&code=[% available_attribute_type.code |html %]">Delete</a>
- </td>
- </tr>
+[% IF ( available_attribute_types ) %]
+ [% FOREACH attribute IN available_attribute_types %]
+ [% IF attribute.class %]
+ <h4>[% attribute.lib %]</h4>
+ [% END %]
+ <table class="patron_attributes_types">
+ <thead>
+ <tr>
+ <th>Code</th>
+ <th>Description</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH item IN attribute.items %]
+ <tr>
+ <td>[% item.code |html %]</td>
+ <td>[% item.description %]</td>
+ <td>
+ <a href="[% item.script_name %]?op=edit_attribute_type&code=[% item.code |html %]">Edit</a>
+ <a href="[% item.script_name %]?op=delete_attribute_type&code=[% item.code |html %]">Delete</a>
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
[% END %]
-</table>[% ELSE %]<p>There are no saved patron attribute types.</p>[% END %]
+[% ELSE %]
+ <p>There are no saved patron attribute types.</p>
+[% END %]
<div class="pages">[% pagination_bar %]</div>
<script src="[% themelang %]/js/pages/preferences.js" type="text/javascript"></script>
<script src="[% themelang %]/lib/jquery/plugins/jquery.highlight-3.js" type="text/javascript"></script>
</head>
-<body>
+<body id="admin_preferences" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'prefs-admin-search.inc' %]
- Only allow patrons to renew their own books on the OPAC if they have less than
- pref: OPACFineNoRenewals
class: currency
- - '[% local_currency %] in fines (set a large value to always allow renewal).'
+ - '[% local_currency %] in fines (leave blank to disable).'
-
- pref: OPACViewOthersSuggestions
choices:
</script>
[% END %]
</head>
-<body>
+<body id="admin_printers" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'printers-admin-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="admin_roadtype" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'roadtype-admin-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> › [% IF ( add_form ) %]<a href="/cgi-bin/koha/admin/roadtype.pl">Road Types</a> › [% IF ( roadtypeid ) %] Modify Road Type[% ELSE %] New Road Type[% END %][% ELSE %][% IF ( delete_confirm ) %]<a href="/cgi-bin/koha/admin/roadtype.pl">Road Types</a> › Confirm Deletion of Road Type[% ELSE %] Road Type[% END %][% END %]</div>
<script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
<!-- End Calendar system additions -->
</head>
-<body>
+<body id="admin_smart-rules" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<th>Patron category</th>
<th>Item type</th>
<th>Current checkouts allowed</th>
- <th>Loan period (day)</th>
+ <th>Loan period</th>
+ <th>Unit</th>
<th>Hard due date</th>
<th>Fine amount</th>
<th>Fine charging interval</th>
<th>Suspension in days (day)</th>
<th>Renewals allowed (count)</th>
<th>Holds allowed (count)</th>
- <th>Rental discount (%)</th>
+ <th>Rental discount (%)</th>
<th> </th>
</tr>
[% FOREACH rule IN rules %]
[% END %]
</td>
<td>[% rule.issuelength %]</td>
+ <td>
+ [% rule.lengthunit %]
+ </td>
<td>[% IF ( rule.hardduedate ) %]
[% IF ( rule.hardduedatebefore ) %]before [% rule.hardduedate %]</td>
[% ELSE %][% IF ( rule.hardduedateexact ) %]on [% rule.hardduedate %]</td>
</td>
<td><input name="maxissueqty" size="3" /></td>
<td><input name="issuelength" size="3" /> </td>
+ <td>
+ <select name="lengthunit">
+ <option value="days" selected>Days</option>
+ <option value="hours">Hours</option>
+ </select>
+ </td>
<td><select name="hardduedatecompare">
<option value="-1">Before</option>
<option value="0">Exactly on</option>
//]]>
</script>
</head>
-<body>
+<body id="admin_stopwords" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'stopwords-admin-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="admin_systempreferences" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'sysprefs-admin-search.inc' %]
</script>
[% END %]
</head>
-<body>
+<body id="admin_z3950servers" class="admin">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'z3950-admin-search.inc' %]
[% END %]
</select>
</li>
+ <li><label for="timeout">Timeout (0 its like not set): </label>
+ <input type="text" name="timeout" id="timeout" size="4" value="[% timeout %]" onblur="isNum(this)" /> seconds
+ </li>
</ol>
</fieldset>
<li><strong>Rank: </strong>[% rank %]</li>
<li><strong>Syntax: </strong>[% syntax %]</li>
<li><strong>Encoding: </strong>[% encoding %]</li>
+ <li><strong>Timeout: </strong>[% timeout %]</li>
</ul> <form action="[% script_name %]" method="post"><input type="hidden" name="op" value="delete_confirmed" /><input type="hidden" name="searchfield" value="[% searchfield %]" /><input type="submit" value="Delete this Server" /></form> <form action="[% script_name %]" method="post"><input type="submit" value="Do Not Delete" /></form>
You searched for [% searchfield %]
[% END %]
<table id="serverst">
- <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th> <th>Syntax</th><th>Encoding</th><th colspan="2"> </th>
+ <thead><tr><th>Target</th><th>Hostname/Port</th><th>Database</th><th>Userid</th><th>Password</th><th>Checked</th><th>Rank</th> <th>Syntax</th><th>Encoding</th><th>Timeout</th><th colspan="2"> </th>
</tr></thead>
<tbody>[% FOREACH loo IN loop %]
[% UNLESS ( loop.odd ) %]
[% ELSE %]
<tr>
[% END %]
-<td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td> <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&searchfield=[% loo.name |url %]">Delete</a></td> </tr>
+<td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">[% loo.name %]</a></td><td>[% loo.host %]:[% loo.port %]</td><td>[% loo.db %]</td><td>[% loo.userid %]</td><td>[% loo.password %]</td><td>[% IF ( loo.checked ) %]Yes[% ELSE %]No[% END %]</td><td>[% loo.rank %]</td> <td>[% loo.syntax %]</td><td>[% loo.encoding %]</td><td>[% loo.timeout %]</td><td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.name |url %]">Edit</a></td><td><a href="[% loo.script_name %]?op=delete_confirm&searchfield=[% loo.name |url %]">Delete</a></td> </tr>
[% END %]</tbody>
</table>
</head>
-<body>
+<body id="auth_auth_finder" class="auth">
<div id="custom-doc" class="yui-t7">
<div id="bd">
//]]>
</script>
</head>
-<body>
+<body id="auth_authorities_home" class="auth">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'authorities-search.inc' %]
</script>
<link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
</head>
-<body>
+<body id="auth_authorities" class="auth">
<div id="yui-cms-loading">
<div id="yui-cms-float">
Loading, please wait...
//]]>
</script>
</head>
-<body>
+<body id="auth_blinddetail-biblio-search" class="auth">
<div id="doc" class="yui-t7">
<div id="bd">
</script>
[% END %]
</head>
-<body>
+<body id="auth_detail" class="auth">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'authorities-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/authorities/authorities-home.pl">Authorities</a> ›
}
</script>
</head>
-<body>
+<body id="auth_searchresultlist_auth" class="auth">
<div id="custom-doc" class="yui-t7">
<div id="bd">
<td>[% resul.summary %]</td>
<td>[% resul.used %] times</td>
<td>
- [% IF ( resul.repets ) %]
- [% FOREACH repet IN resul.repets %]
- <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=[% resul.authid %]&index=[% repet.index %]&repet=[% repet.repet %]')" title="[% repet.value %]">[% repet.repet %]</a>
- [% END %]
- [% ELSE %]
- <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=[% resul.authid %]&index=[% index %]')">choose</a>
- [% END %]
+ <a href="javascript:jumpfull('blinddetail-biblio-search.pl?authid=[% resul.authid %]&index=[% index %]')">choose</a>
</td>
<td><a href="authorities.pl?authid=[% resul.authid %]">Edit authority</a></td>
</tr>
//]]>
</script>
</head>
-<body>
+<body id="auth_searchresultlist" class="auth">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'authorities-search.inc' %]
</script>
[% END %]
</head>
-[% IF ( print_basket ) %]<body id="basket" onload="print();history.back();">[% ELSE %]<body id="basket">[% END %]
+[% IF ( print_basket ) %]<body id="cart_basket" class="cart" onload="print();history.back();">[% ELSE %]<body id="cart_basket" class="cart">[% END %]
<div id="doc" class="yui-t7">
<div class="container">
<title>Koha › Download cart</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body style="padding:1em;" id="cart_downloadcart" class="cart">
[% IF ( format ) %]
<p>Your download should begin automatically.</p>
[% ELSE %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Sending Your Cart</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding: 1em;" id="sendbasket">
+<body style="padding: 1em;" id="cart_sendbasketform" class="cart">
<div class="container">[% IF ( email_add ) %]
[% IF ( SENT ) %]
<link rel="stylesheet" type="text/css" href="[% stylesheet %]">
[% END %]
</head>
-<body>
+<body id="batch_print-notices" class="batch">
[% FOREACH message IN messages %]
<div class="message">
<pre>[% message.content %]</pre>
</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="catalog_ISBDdetail" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="catalog_MARCdetail" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
});
</script>
</head>
-<body>
+<body id="catalog_advsearch" class="catalog">
[% INCLUDE 'header.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › Advanced Search</div>
</script>
</head>
-<body>
+<body id="catalog_detail" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<link rel="stylesheet" href="[% themelang %]/css/print.css" type="text/css" />
</head>
-<body>
+<body id="catalog_detailprint" class="catalog">
<!-- main site -->
<div id="main">
</style>[% END %]
</head>
-<body>
+<body id="catalog_imageviewer" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Catalog › Checkout History for [% title |html %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="catalog_issuehistory" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
</head>
-<body>
+<body id="catlaog_labeledMARCdetail" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css">h3{padding-top: 1em; border-top: 2px solid #CCCCCC;}</style>
</head>
-<body>
+<body id="catalog_moredetail" class="catalog">
[% USE KohaDates %]
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="catalog_results" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha -- Cataloging: MARC Import</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="catalog_showmarc" class="catalog">
<div id="main">
<pre>[% MARC_FORMATTED %] </pre>
[% INCLUDE 'intranet-bottom.inc' %]
<title>Koha › Catalog › Subject Search Results</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="catalog_subject" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
<link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
</head>
-<body>
+<body id="cat_addbiblio" class="cat">
<div id="yui-cms-loading">
<div id="yui-cms-float">
Loading, please wait...
});
</script>
</head>
-<body>
+<body id="cat_addbooks" class="cat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cataloging-search.inc' %]
function () {$(this).attr("class","" );}
);
});
-
-function set_to_today(id, force) {
- if (! id) { alert(_("Bad id ") + id + _(" sent to set_to_today()")); return 0; }
- if ($("#" + id).val() == '' || $("#" + id).val() == '0000-00-00' || force) {
- $("#" + id).val("[% today_iso %]");
- }
-}
//]]>
</script>
<link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
</head>
-<body>
+<body id="cat_additem" class="cat">
[% INCLUDE 'header.inc' %]
<div id="breadcrumbs">
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
<title>Link to host item</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="catalog_linkitem" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloging/addbooks.pl">Cataloging</a> › Link a host item to <i>[% bibliotitle |html %]</i></div>
//]]>
</script>
</head>
-<body>
+<body id="cat_merge" class="cat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cataloging-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloguing/addbooks.pl">Cataloging</a> › Merging records</div>
<title>Attach an item to [% bibliotitle |html %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="catalog_moveitem" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/cataloging/addbooks.pl">Cataloging</a> › Attach an item to <i>[% bibliotitle |html %][% IF ( itemsloo.subtitle ) %][% itemsloo.subtitle %][% END %]</i></div>
</style>
</head>
-<body style="padding:1em;">
+<body id="cat_labs_theses" class="cat" style="padding:1em;">
<div id="mainbloc">
<h1>Laboratory Search</h1>
</script>
</head>
-<body class="yui-skin-sam" onload="Activate(0);load_macles();" >
+<body id="cat_macles" class="yui-skin-sam cat" onload="Activate(0);load_macles();" >
<h1>Gestion des index MACLES</h1>
<form name="f_pop" action="">
</script>
</head>
-<body style="padding:1em;" onload="loadXmlValues()">
+<body id="cat_marc21_field_006" class="cat" style="padding:1em;" onload="loadXmlValues()">
<h3>006 Fixed-length data elements--Additional material characteristics--General information</h3>
<table border="1">
<title>Koha › Cataloging › 007 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;" onload="RedrawChoices('[% f0 %]');">
+<body id="cat_marc21_field_007" class="cat" style="padding:1em;" onload="RedrawChoices('[% f0 %]');">
<h3>007 Physical description fixed field--General information</h3>
<form id="f_pop" onsubmit="report()" action="">
<input type="hidden" name="plugin_name" value="marc21_field_007.pl" />
</script>
</head>
-<body style="padding:1em;" onload="loadXmlValues()">
+<body id="cat_marc21_field_008" class="cat" style="padding:1em;" onload="loadXmlValues()">
<h3> 008 Fixed-length data elements--Additional material characteristics--General information</h3>
<table border="1">
<title>Koha › Authorities › 008 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_marc21_field_008_authorities" class="cat" style="padding:1em;">
<h3> 008 Fixed-length data elements</h3>
<form name="f_pop" onsubmit="report()" action="">
<input type="hidden" name="plugin_name" value="marc21_field_008_authorities.pl" />
<title>Koha › Cataloging › 000 - Leader builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_marc21_leader" class="cat" style="padding:1em;">
<form name="f_pop" onsubmit="report()" action="">
<input type="hidden" name="plugin_name" value="marc21_leader.pl" />
<h3>000 - Leader</h3>
<title>Koha › Authorities › Leader builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_marc21_leader_authorities" class="cat" style="padding:1em;">
<h3>000 - Leader</h3>
<form name="f_pop" onsubmit="report()" action="">
<input type="hidden" name="plugin_name" value="marc21_leader_authorities.pl" />
<title>Koha › Cataloging › Leader builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_marc21_leader_book" class="cat" style="padding:1em;">
<form name="f_pop" onsubmit="report()" action="">
<input type="hidden" name="plugin_name" value="marc21_leader_book.pl" />
<table>
<title>Koha › Cataloging › Leader builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_marc21_leader_computerfile" class="cat" style="padding:1em;">
<h3>000 - Leader</h3>
<form name="f_pop" onsubmit="report()" action="">
<input type="hidden" name="plugin_name" value="marc21_leader_computerfile.pl" />
<title>Koha › Cataloging › 007 feltbygger</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;" onload="RedrawChoices('[% f0 %]');">
+<body id="cat_normarc_field_007" class="cat" style="padding:1em;" onload="RedrawChoices('[% f0 %]');">
<h3>007 Fysisk beskrivelse av dokumentet</h3>
<form id="f_pop" onsubmit="report()">
<input type="hidden" name="plugin_name" value="normarc_field_007.pl" />
<title>Koha › Katalogisering › Feltbygger for 008</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_normarc_field_008" class="cat" style="padding:1em;">
<h3>008 Informasjonskoder</h3>
<form>
<title>Koha › Cataloging › 000 - Bygging av postens hode</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_normarc_leader" class="cat" style="padding:1em;">
<form name="f_pop" onsubmit="report()">
<input type="hidden" name="plugin_name" value="normarc_leader.pl" />
<h3>000 - Postens hode</h3>
<title>UNIMARC Field 100 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_100" class="cat" style="padding:1em;">
<h3>UNIMARC Field 100 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 105 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_105" class="cat" style="padding:1em;">
<h3>UNIMARC Field 105 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 106 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_106" class="cat" style="padding:1em;">
<h3>UNIMARC Field 106 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 110 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_110" class="cat" style="padding:1em;">
<h3>UNIMARC Field 110 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 115a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_115a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 115a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 115b builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_115b" class="cat" style="padding:1em;">
<h3>UNIMARC Field 115b builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 116 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_116" class="cat" style="padding:1em;">
<h3>UNIMARC Field 116 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 117 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_117" class="cat" style="padding:1em;">
<h3>UNIMARC Field 117 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 120 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_120" class="cat" style="padding:1em;">
<h3>UNIMARC Field 120 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 121a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_121a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 121a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 121b builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_121b" class="cat" style="padding:1em;">
<h3>UNIMARC Field 121b builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 122 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_122" class="cat" style="padding:1em;">
<h3>UNIMARC Field 122 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 123a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_123a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 123a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 123d builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_123d" class="cat" style="padding:1em;">
<h3>UNIMARC Field 123d builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 123e builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_123e" class="cat" style="padding:1em;">
<h3>UNIMARC Field 123e builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 123f builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_123f" class="cat" style="padding:1em;">
<h3>UNIMARC Field 123f builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 123g builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_123g" class="cat" style="padding:1em;">
<h3>UNIMARC Field 123g builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 124a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_124a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 124a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 124b builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_124b" class="cat" style="padding:1em;">
<h3>UNIMARC Field 124b builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 124c builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_124c" class="cat" style="padding:1em;">
<h3>UNIMARC Field 124c builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 124d builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_124d" class="cat" style="padding:1em;">
<h3>UNIMARC Field 124d builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 124e builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_124e" class="cat" style="padding:1em;">
<h3>UNIMARC Field 124e builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 124f builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_124f" class="cat" style="padding:1em;">
<h3>UNIMARC Field 124f builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 124g builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_124g" class="cat" style="padding:1em;">
<h3>UNIMARC Field 124g builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 125a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_125a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 125a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 125b builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="unimarc_field_125b" class="cat" style="padding:1em;">
<h3>UNIMARC Field 125b builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 126a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_126a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 126a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 126b builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_126b" class="cat" style="padding:1em;">
<h3>UNIMARC Field 126b builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 127 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_127" class="cat" style="padding:1em;">
<h3>UNIMARC Field 127 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 128a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_128a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 128a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 128b builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_128b" class="cat" style="padding:1em;">
<h3>UNIMARC Field 128b builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 128c builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_128c" class="cat" style="padding:1em;">
<h3>UNIMARC Field 128c builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 130 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_130" class="cat" style="padding:1em;">
<h3>UNIMARC Field 130 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 135a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_135a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 135a builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 140 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_140" class="cat" style="padding:1em;">
<h3>UNIMARC Field 140 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 141 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_141" class="cat" style="padding:1em;">
<h3>UNIMARC Field 141 builder</h3>
<form name="f_pop" action="">
<table>
<title>UNIMARC Field 210c builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_210c" class="cat" style="padding:1em;">
<h3>UNIMARC Field 210c builder</h3>
<h4>Search for authority type: EDITORS</h4>
<form name="f" method="post" action="plugin_launcher.pl">
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/staff-global.css" />
</head>
-<body>
+<body id="cat_unimarc_field_210c_bis" class="cat">
<div id="header_search">
<script type="text/javascript">
//<![CDATA[
<title>UNIMARC Field 225a builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_225a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 225a builder</h3>
<div id="mainbloc">
<form name="f_pop" onsubmit="report()" action="">
</script>
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_4XX" class="cat" style="padding:1em;">
<h3>UNIMARC Field 4XX builder</h3>
[% ELSE %]
<script type="text/javascript">
#custom-doc { width:51.46em;*width:50.17em;min-width:675px; margin:auto; text-align:left; }
</style>
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_686a" class="cat" style="padding:1em;">
<h3>UNIMARC Field 686a builder</h3>
<div id="custom-doc" class="yui-t7">
<div id="bd">
<title>UNIMARC Field 700-4 builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_field_700-4" class="cat" style="padding:1em;">
<h3>UNIMARC Field 700-4 builder</h3>
<p>Sélectionnez la valeur pour le champ 700 $4. Elle sera automatiquement reportée dans la zone 700 $8 qui suit.</p>
<form name="f_pop" onsubmit="report()" action="">
<title>UNIMARC Leader builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="cat_unimarc_leader" class="cat" style="padding:1em;">
<h3>UNIMARC Leader builder</h3>
<form name="f_pop" action="">
<table>
#custom-doc { width:53em;*width:51.72em;min-width:689px; margin:auto; text-align:left; }
</style>
</head>
-<body>
+<body id="cat_z3950_search" class="cat">
<div id="custom-doc" class="yui-t7">
[% ELSE %]
<div class="dialog alert">
<ul>
[% FOREACH errcon IN errconn %]
- <li>Connection failed to [% errcon.server %]</li>
+ [% IF ( errcon.error == '10000' ) %]<li>Connection failed to [% errcon.server %]</li>
+ [% ELSIF ( errcon.error == '10007' ) %]<li>Connection timeout to [% errcon.server %]</li>[% END %]
[% END %]
</ul>
</div>
<script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
<!-- End of additions -->
</head>
-<body>
+<body id="circ_billing" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
});
</script>
</head>
-<body>
+<body id="circ_bookcount" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<title>Koha › Circulation › Overdues at [% LoginBranchname %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="circ_branchoverdues" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<title>Koha › Circulation › Transfers</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="circ_branchtransfers" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<title>Koha › Circulation</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="circ_circulation-home" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
</script>
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="circ_circulation" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
var attrcode = $("script", clone).attr("x-code");
var newsuffix = parts[1] + appendid;
- create_auto_completion_responder(newsuffix,attrcode);
+ [% IF ( CircAutocompl ) %]
+ create_auto_completion_responder(newsuffix,attrcode);
+ [% END %]
}
parent.parentNode.insertBefore(clone, parent.nextSibling);
var parent = node.parentNode;
parent.parentNode.removeChild(parent);
}
+ [% IF ( CircAutocompl ) %]
function create_auto_completion_responder(uniqueid,attrcode) {
YAHOO.util.Event.onContentReady("pattrodue-getready-"+uniqueid, function() {
new function() {
}
});
}
+ [% END %]
//]]>
</script>
<style type="text/css">
</style>
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="circ_overdue" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<!-- domid cgivalue ismany isclone ordinal code description repeatable authorised_value_category -->
<li>
<label>[% patron_attr_filter_loo.description %]:</label>
- [% IF ( patron_attr_filter_loo.authorised_value_category ) %]
- <script type="text/JavaScript" language="JavaScript" x-code="[% patron_attr_filter_loo.code |html %]">create_auto_completion_responder([% patron_attr_filter_loo.domid %],"[% patron_attr_filter_loo.code |html %]");</script>
+ [% IF ( patron_attr_filter_loo.authorised_value_category AND CircAutocompl) %]
+ <script type="text/JavaScript" language="JavaScript" x-code="[% patron_attr_filter_loo.code |html %]">create_auto_completion_responder([% patron_attr_filter_loo.domid %],"[% patron_attr_filter_loo.code |html %]");</script>
<span id="pattrodue-getready-[% patron_attr_filter_loo.domid %]">
<div class="pattrodue-autocomplete">
<input autocomplete="off" id="pattrodue-input-[% patron_attr_filter_loo.domid %]" name="patron_attr_filter_[% patron_attr_filter_loo.code |html %]" value="[% patron_attr_filter_loo.cgivalue |html %]" class="pattrodue-input" type="text" />
//]]>
</script>
</head>
-<body>
+<body id="circ_pendingreserves" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
}
</script>
</head>
-<body onload="printThenClose();">
+<body id="circ_printslip" class="circ" onload="printThenClose();">
<div id="receipt">
[% IF plain %]
.ratiolimit { color: blue; cursor: pointer; }
</style>
</head>
-<body>
+<body id="circ_reserveratios" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Circulation › Check In [% title |html %]</title>
[% INCLUDE 'doc-head-close.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="circ_returns" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'checkin-search.inc' %]
<p class="problem">Item is withdrawn.</p>
[% 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 %] </p>
+ <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>
[% END %]
[% END %]
[% IF ( soundon ) %]
.noshow {display: none;}
</style>
</head>
-<body>
+<body id="circ_selectbranchprinter" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<title>Koha › Circulation › Statistics</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="circ_stats" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
}
</script>
</head>
-<body onload="printandclose();"><div id="main">
+<body id="circ_transfer-slip" class="circ" onload="printandclose();">
+<div id="main">
<h5>Date: [% pulldate %]</h5>
<h3>Transfer to [% branchname %]</h3>
//]]>
</script>
</head>
-<body>
+<body id="circ_transferstoreceive" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css"> p { margin-top: 0; }</style>
</head>
-<body>
+<body id="circ_view_holdsqueue" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="circ_waitingreserves" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<title>Koha › Error</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="err_400" class="err">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Error 401</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="err_401" class="err">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Error 402</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="err_402" class="err">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Error 403</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="err_403" class="err">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Error 404</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="err_404" class="err">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Error 405</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="err_405" class="err">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Error 500</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="err_500" class="err">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-open.inc' %]Koha › Tools › Labels ›: Search[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="labels_label-bib-search" class="tools labels">
<div id="main-compact">
<h1>Search</h1>
//]]>
</script>
</head>
-<body onload="dofocus();">
+<body id="labels_label-edit-batch" class="tools labels" onload="dofocus();">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
//]]>
</script>
</head>
-<body>
+<body id="labels_label-edit-layout" class="tools labels">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
//]]>
</script>
</head>
-<body>
+<body id="labels_label-edit-profile" class="tools labels">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
//]]>
</script>
</head>
-<body>
+<body id="labels_label-edit-template" class="tools labels">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/label.css" />
</head>
-<body>
+<body id="labels_label-home" class="tools labels">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
//]]>
</script>
</head>
-<body>
+<body id="labels_label-manage" class="tools labels">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
<style type="text/css">#custom-doc {width:47.23em; *width:46.04em; min-width:610px; margin:auto; margin-top:0.4em;}</style>
<style type="text/css">table {border-collapse: separate; border-spacing: 0; border: hidden none;} .header {cursor: auto; background-position: center center; background-repeat: repeat;}</style>
</head>
-<body>
+<body id="labels_label-print" class="tools labels">
<div id="custom-doc" class="yui-t2">
<div id="bd">
[% IF ( batches ) %]
//]]>
</script>
</head>
-<body>
+<body id="labels_result" class="tools labels">
<div id="custom-doc" class="yui-t7">
<div id="bd">
<h1>Search results</h1>
[% INCLUDE 'calendar.inc' %]
<style type="text/css">#custom-doc { width:47.23em;*width:46.04em;min-width:610px; margin:auto;margin-top: .4em; text-align:left; }</style>
</head>
-<body>
+<body id="labels_search" class="tools labels">
<div id="custom-doc" class="yui-t7">
<div id="bd">
[% INCLUDE 'doc-head-open.inc' %]<title>Koha › Tools › Quick spine label creator</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="labels_spinelabel-home" class="tools labels">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</style>
</head>
[% IF ( BarcodeNotFound ) %]
- <body>
+ <body id="labels_spinelabel-print" class="tools labels">
<p>The barcode [% Barcode %] was not found.</p>
<p><a href="spinelabel-home.pl">Return To Spine Label Printer</a></p>
</body>
[% ELSE %]
[% IF ( autoprint ) %]
- <body onLoad="window.print()">
+ <body id="labels_spinelabel-print" class="tools labels" onLoad="window.print()">
[% ELSE %]
<body>
[% END %]
<title>Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="pat_borraccount" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<title>Koha › Can't Delete Patron</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="pat_deletemem" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
// -->
</script>
</head>
-
+<body id="pat_guarantor_search" class="pat">
<div id="custom-doc" class="yui-t7">
<div id="bd">
<div class="yui-g">
//]]>
</script>
</head>
-<body>
+<body id="pat_mancredit" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="pat_maninvoice" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
</script>
</head>
-<body>
+<body id="pat_member-flags" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="pat_member-password" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<title>Koha › Patrons [% IF ( searching ) %]› Search Results[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="pat_member" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
document.form.state.value=RegExp.$3;
document.form.country.value=RegExp.$4;
});
+
+ [% IF categorycode %]
+ update_category_code( "[% categorycode %]" );
+ [% ELSE %]
+ if ( $("#categorycode").length > 0 ){
+ var category_code = $("#categorycode").find("option:selected").val();
+ update_category_code( category_code );
+ }
+ [% END %]
+
});
function clear_entry(node) {
$("select#patron_attr_" + newId, clone).attr('value','');
original.parentNode.insertBefore(clone, original.nextSibling);
}
+
+ function update_category_code(category_code) {
+ if ( $(category_code).is("select") ) {
+ category_code = $("#categorycode").find("option:selected").val();
+ }
+ var mytables = $(".attributes_table>tbody");
+
+ mytables.find("tr").each(function(){
+ $(this).hide()
+ });
+
+ mytables.find("tr[data-category_code="+category_code+"]").each(function(){
+ $(this).show();
+ });
+ mytables.find("tr[data-category_code='']").each(function(){
+ $(this).show();
+ });
+
+ }
+
var MSG_SEPARATOR = _("Separator must be / in field ");
var MSG_INCORRECT_DAY = _("Invalid day entered in field ");
var MSG_INCORRECT_MONTH = _("Invalid month entered in field ");
</script>
<script type="text/javascript" src="[% themelang %]/js/members.js"></script>
</head>
-<body>
+<body id="pat_memberentrygen" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
[% END %]
<li>
<label for="categorycode">Category: </label>
- <select id="categorycode" name="categorycode">
+ <select id="categorycode" name="categorycode" onchange="update_category_code(this);">
[% FOREACH typeloo IN typeloop %]
- [% FOREACH categoryloo IN typeloo.categoryloop %]
- [% IF ( loop.first ) %]
- [% IF ( typeloo.typename_C ) %]<optgroup label="Child">[% END %]
- [% IF ( typeloo.typename_A ) %]<optgroup label="Adult">[% END %]
- [% IF ( typeloo.typename_S ) %]<optgroup label="Staff">[% END %]
- [% IF ( typeloo.typename_I ) %]<optgroup label="Organization">[% END %]
- [% IF ( typeloo.typename_P ) %]<optgroup label="Professional">[% END %]
- [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical">[% END %]
- [% END %]
- [% IF ( categoryloo.categorycodeselected ) %]
- <option value="[% categoryloo.categorycode %]" selected="selected">[% categoryloo.categoryname %]</option>
- [% ELSE %]
-<option value="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]</option>
- [% END %]
- [% IF ( loop.last ) %]
- </optgroup>
- [% END %]
+ [% FOREACH categoryloo IN typeloo.categoryloop %]
+ [% IF ( loop.first ) %]
+ [% IF ( typeloo.typename_C ) %]<optgroup label="Child" value="C">[% END %]
+ [% IF ( typeloo.typename_A ) %]<optgroup label="Adult" value="A">[% END %]
+ [% IF ( typeloo.typename_S ) %]<optgroup label="Staff" value="S">[% END %]
+ [% IF ( typeloo.typename_I ) %]<optgroup label="Organization" value="I">[% END %]
+ [% IF ( typeloo.typename_P ) %]<optgroup label="Professional" value="P">[% END %]
+ [% IF ( typeloo.typename_X ) %]<optgroup label="Statistical" value="X">[% END %]
+ [% END %]
+ [% IF ( categoryloo.categorycodeselected ) %]
+ <option value="[% categoryloo.categorycode %]" selected="selected" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
+ [% ELSE %]
+ <option value="[% categoryloo.categorycode %]" data-typename="[% typeloo.typename %]">[% categoryloo.categoryname %]</option>
+ [% END %]
+ [% IF ( loop.last ) %]
+ </optgroup>
+ [% END %]
[% END %]
[% END %]
</select>
<fieldset class="rows" id="memberentry_patron_attributes">
<input type="hidden" name="setting_extended_patron_attributes" value="1" />
<legend>Additional attributes and identifiers</legend>
- <table>
- <tr>
- <th>Type</th>
- <th colspan="2">Value</th>
- </tr>
- [% FOREACH patron_attribute IN patron_attributes %]
- <tr>
- <td>[% patron_attribute.code %] ([% patron_attribute.description %])
- </td>
- <td>
- <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
- [% IF ( patron_attribute.use_dropdown ) %]
- <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
- <option value="" />
- [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
- [% IF ( auth_val_loo.selected ) %]
- <option value="[% auth_val_loo.authorised_value %]" selected="selected">
- [% auth_val_loo.lib %]
- </option>
+ [% FOREACH pa_loo IN patron_attributes %]
+ [% IF pa_loo.class %]
+ <h4>[% pa_loo.lib %]</h4>
+ <table id=aai_[% pa_loo.class %] class="attributes_table">
+ [% ELSE %]
+ <table id="aai" class="attributes_table">
+ [% END %]
+ <thead>
+ <tr>
+ <th>Type</th>
+ <th colspan="2">Value</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH patron_attribute IN pa_loo.items %]
+ <tr data-category_code="[% patron_attribute.category_code %]">
+ <td>
+ [% patron_attribute.code %] ([% patron_attribute.description %])
+ </td>
+ <td>
+ <input type="hidden" id="[% patron_attribute.form_id %]_code" name="[% patron_attribute.form_id %]_code" value="[% patron_attribute.code |html %]" />
+ [% IF ( patron_attribute.use_dropdown ) %]
+ <select id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]">
+ <option value="" />
+ [% FOREACH auth_val_loo IN patron_attribute.auth_val_loop %]
+ [% IF ( auth_val_loo.selected ) %]
+ <option value="[% auth_val_loo.authorised_value %]" selected="selected">
+ [% auth_val_loo.lib %]
+ </option>
+ [% ELSE %]
+ <option value="[% auth_val_loo.authorised_value %]" >
+ [% auth_val_loo.lib %]
+ </option>
+ [% END %]
+ [% END %]
+ </select>
+ [% ELSE %]
+ [% IF ( opduplicate ) %]
+ <input type="text" maxlength="64" value="[% patron_attribute.value %]"
+ id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" onclick="this.value=''" />
[% ELSE %]
- <option value="[% auth_val_loo.authorised_value %]" >
- [% auth_val_loo.lib %]
- </option>
+ <input type="text" maxlength="64" value="[% patron_attribute.value %]"
+ id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" />
[% END %]
[% END %]
- </select>
- [% ELSE %]
- [% IF ( opduplicate ) %]
- <input type="text" maxlength="64" value="[% patron_attribute.value %]"
- id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" onclick="this.value=''" />
- [% ELSE %]
- <input type="text" maxlength="64" value="[% patron_attribute.value %]"
- id="[% patron_attribute.form_id %]" name="[% patron_attribute.form_id %]" />
- [% END %]
- [% END %]
- [% IF ( patron_attribute.password_allowed ) %]
- (Password: <input type="password" maxlength="64" value="[% patron_attribute.password %]"
- id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
- [% END %]
- </td>
- <td>
- <a href="#" onclick="clear_entry(this); return false;">Clear</a>
- [% IF ( patron_attribute.repeatable ) %]
- <a href="#" onclick="clone_entry(this); return false;">New</a>
- [% END %]
- </td>
- </tr>
- [% END %]
- </table>
+ [% IF ( patron_attribute.password_allowed ) %]
+ (Password: <input type="password" maxlength="64" value="[% patron_attribute.password %]"
+ id="[% patron_attribute.form_id %]_password" name="[% patron_attribute.form_id %]_password" />)
+ [% END %]
+ </td>
+ <td>
+ <a href="#" onclick="clear_entry(this); return false;">Clear</a>
+ [% IF ( patron_attribute.repeatable ) %]
+ <a href="#" onclick="clone_entry(this); return false;">New</a>
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+ [% END %]
</fieldset>
[% END %][% END %][% END %]
#custom-doc { width:44.23em;*width:43.12em;min-width:491px; margin:auto; text-align:left; }
</style>
</head>
-<body style="padding:.5em;">
+<body id="pat_moremember-brief" class="pat" style="padding:.5em;">
<div id="custom-doc" class="yui-t7">
<div id="bd">
<h3>[% UNLESS ( I ) %]
window.close();
}
</script>
-<body onload="printThenClose();">
+<body id="pat_moremember-print" class="pat" onload="printThenClose();">
</head>
<body>
}
</script>
</head>
-<body onload="printThenClose();">
+<body id="pat_moremember-receipt" class="pat" onload="printThenClose();">
<div id="receipt">
</script>
</head>
-<body>
+<body id="pat_moremember" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
[% UNLESS ( no_patron_attribute_types ) %]
<div id="patron-extended-attributes" style="padding-top: 1em;">
<h3>Additional attributes and identifiers</h3>
-<table>
- <tr>
- <th>Type</th>
- <th>Value</th>
- </tr>
- [% FOREACH extendedattribute IN extendedattributes %]
- <tr>
- <td>[% extendedattribute.code %] ([% extendedattribute.description %])</td>
- <td>[% extendedattribute.value %]
- [% IF ( extendedattribute.value_description ) %]
- ([% extendedattribute.value_description %])
- [% END %]
- </td>
- </tr>
+[% FOREACH attribute IN attributes_loop %]
+ [% IF attribute.class %]
+ <h4>[% attribute.lib %]</h4>
+ <table id=aai_[% attribute.class %]>
+ [% ELSE %]
+ <table id="aai">
[% END %]
-</table>
+ <thead>
+ <tr>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Value</th>
+ </tr>
+ </thead>
+ <tbody>
+ [% FOREACH item IN attribute.items %]
+ <tr>
+ <td>[% item.code %]</td>
+ <td>[% item.description %]</td>
+ <td>[% item.value %]
+ [% IF ( item.value_description ) %]
+ ([% item.value_description %])
+ [% END %]
+ </td>
+ </tr>
+ [% END %]
+ </tbody>
+ </table>
+[% END %]
</div>
<div class="action"><a href="memberentry.pl?op=modify&borrowernumber=[% borrowernumber %]&step=4">Edit</a></div>
[% END %]
<div id="finesholdsissues" class="toptabs">
<ul>
- <li><a href="/cgi-bin/koha/members/moremember.pl#checkedout">[% issuecount %] Checkout(s)</a></li>
- [% IF ( relissuecount ) %]
+ <li><a href="/cgi-bin/koha/members/moremember.pl#checkedout">[% issueloop.size %] Checkout(s)</a></li>
+ [% IF relissueloop.size %]
<li><a href="/cgi-bin/koha/members/moremember.pl#relissues">Relatives' Checkouts</a></li>
[% END %]
<li><a href="/cgi-bin/koha/members/moremember.pl#finesandcharges">Fines & Charges</a></li>
</div>
-[% IF ( relissuecount ) %]
+[% IF relissueloop %]
<div id="relissues">
<table id="relissuest">
<thead>
a.message-title { font-weight: bold; display: block; }
</style>
</head>
-<body>
+<body id="pat_notices" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="pat_pay" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="pat_paycollect" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Pay Fines for [% borrower.firstname %] [% borrower.surname %]</a> › [% IF ( pay_individual ) %]Pay an individual fine[% ELSIF ( writeoff_individual ) %]Write off an individual fine[% ELSE %][% IF ( selected_accts ) %]Pay an amount toward selected fines[% ELSE %]Pay an amount toward all fines[% END %][% END %]</div>
}
</script>
</head>
-<body onload="printThenClose();">
+<body id="pat_printfeercpt" class="pat" onload="printThenClose();">
<div id="receipt">
<!-- The table with the account items -->
}
</script>
</head>
-<body onload="printThenClose();">
+<body id="printinvoice" class="pat" onload="printThenClose();">
<div id="receipt">
<!-- The table with the account items -->
});
}); </script>
</head>
-<body>
+<body id="pat_readingrec" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
#custom-doc { width:29em;*width:28.3em;min-width:377px; margin:auto; text-align:left; }
</style>
</head>
-<body>
+<body id="pat_update-child" class="pat">
<div id="custom-doc" class="yui-t7">
<div id="bd">
//]]>
</script>
</head>
-<body>
+<body id="ocirc_list" class="circ ocirc">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
#fileuploadprogress,#jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('/intranet-tmpl/prog/img/progress.png') -300px 0px no-repeat; }
</style>
</head>
-<body>
+<body id="ocirc_process_koc" class="circ ocirc">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<style type="text/css">#custom-doc {width:47.23em; *width:46.04em; min-width:610px; margin:auto; margin-top:0.4em;}</style>
<style type="text/css">table {border-collapse: separate; border-spacing: 0; border: hidden none;} .header {cursor: auto; background-position: center center; background-repeat: repeat;}</style>
</head>
-<body>
+<body id="pcard_card-print" class="tools pcard">
<div id="custom-doc" class="yui-t2">
<div id="bd">
[% IF ( batches ) %]
};
</script>
</head>
-<body>
+<body id="pcard_edit-batch" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
};
</script>
</head>
-<body>
+<body id="pcard_edit-layout" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
};
</script>
</head>
-<body>
+<body id="pcard_edit-profile" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
};
</script>
</head>
-<body>
+<body id="pcard_edit-template" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
[% INCLUDE 'doc-head-close.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/card.css" />
</head>
-<body>
+<body id="pcard_home" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
}
</script>
</head>
-<body>
+<body id="pcard_image-manage" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
};
</script>
</head>
-<body>
+<body id="pcard_manage" class="tools pcard">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
//]]>
</script>
</head>
-<body>
+<body id="pcard_members-search" class="tools pcard">
<div id="custom-doc" class="yui-t7">
<div id="bd">
</script>
<style type="text/css">#custom-doc {width:47.23em; *width:46.04em; min-width:610px; margin:auto; margin-top:0.4em;}</style>
</head>
-<body>
+<body id="pcard_print" class="tools pcard">
<div id="custom-doc" class="yui-t2">
<div id="bd">
[% IF ( batches ) %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="rep_acquisitions_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="rep_bor_issues_top" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="rep_borrowers_out" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
.debug {display:none;}
</style>
</head>
-<body>
+<body id="rep_borrowers_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
[% END %]
</head>
-<body>
+<body id="rep_cat_issues_top" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
.sql {display: none;}
</style>
</head>
-<body>
+<body id="rep_catalogue_out" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Reports [% IF ( do_it ) %]› Catalog statistics › Results[% ELSE %]› Catalog statistics[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="rep_catalogue_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'calendar.inc' %]
<style type="text/css">fieldset.rows table { clear: none; margin: 0;}</style>
</head>
-<body>
+<body id="rep_dictionary" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="rep_guided_reports_start" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<optgroup label="[% column.table %]">
[% ELSE %]
<option value="[% column.name %]">
-[% IF ( column.description ) %][% column.description %]
+[% IF ( column.description ) %][% column.description %] / [% column.name %]
[% ELSE %]
[% column.name %]
[% END %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="rep_issues_avg_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="rep_issues_by_borrower_category" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
.sql {display:none;}
</style>
</head>
-<body>
+<body id="rep_issues_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Reports › Lost Items</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="rep_itemslost" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="rep_itemtypes" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Reports</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="rep_reports-home" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<title>Koha › Hold Report › All Holds</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="rep_reservereport" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
.sql {display:none;}
</style>
</head>
-<body>
+<body id="rep_reserve_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="rep_serials_stats" class="rep">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
-</head>
-<body>
-[% INCLUDE 'header.inc' %]
+</head>
+<body id="rep_stats_screen" class="rep">
+[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/reports/reports-home.pl">Reports</a> › Till Reconciliation
</div>
// ]]>
</script>
</head>
-<body>
+<body id="circ_request" class="catalog">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<title>Koha › Tools › Comments › [% IF ( status ) %] Approved comments[% ELSE %] Comments awaiting moderation[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="tools_reviewswaiting" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Tools › Rotating Collections › Edit Collections</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="rcoll_editCollections" class="tools rcoll">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Tools › Rotating Collections</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="rcoll_rotatingCollections" class="tools rcoll">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Tools › Rotating Collections › Transfer Collection</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="rcoll_transferCollection" class="tools rcoll">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
}
</script>
</head>
-<body>
+<body id="ser_acqui-search-result" class="ser">
<div id="doc" class="yui-t7">
<div id="bd">
//]]>
</script>
</head>
-<body>
+<body id="ser_acqui-search" class="ser">
<div id="doc" class="yui-t7">
<div id="bd">
</script>
<!-- End of additions -->
</head>
-<body>
+<body id="ser_checkexpiration" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
</script>
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="ser_claims" class="ser">
[% INCLUDE 'header.inc' %]
[% UNLESS ( preview ) %]
[% INCLUDE 'serials-search.inc' %]
#custom-doc { width:36.46em;*width:35.53em;min-width:430px; margin:auto; text-align:left; padding: 1em; }
</style>
</head>
-<body>
+<body id="ser_member-search" class="ser">
<div id="custom-doc" class="yui-t7">
<div id="bd">
//]]>
</script>
</head>
-<body>
+<body id="ser_result" class="ser">
<div id="doc" class="yui-t7">
<div id="bd">
.yui-t7, #custom-doc { min-width:0; width:auto; }
</style>
</head>
-<body>
+<body id="ser_routing-preview-slip" class="ser">
<div id="custom-doc" class="yui-t7">
<div id="bd">
//-->
</script>
</head>
-<body>
+<body id="ser_routing-preview" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
//-->
</script>
</head>
-<body>
+<body id="ser_routing" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="ser_serial-issues-full" class="ser">
[% UNLESS ( popup ) %]
[% INCLUDE 'header.inc' %]
<title>Koha › Serials › Subscription information for [% bibliotitle %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="ser_serial-issues" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
//]]>
</script>
</head>
-<body class="yui-skin-sam">
+<body id="ser_serials-collection" class="yui-skin-sam ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
</td>
[% IF ( routing ) %]
<td>
- <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %]'); return false" >Print list</a>
+ <a href="" onclick="print_slip([% serial.subscriptionid |html %], '[% serial.serialseq |html %] ([% serial.planneddate %])'); return false" >Print list</a>
</td>
[% END %]
[% IF ( CAN_user_serials_receive_serials ) %]
width : auto;
}</style>
</head>
-<body>
+<body id="ser_serials-edit" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="ser_serials-home" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
[% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %]
</td>
<td>
- [% IF ( subscription.branchcode ) %][% subscription.branchcode %][% END %]
+ [% IF ( subscription.branchname ) %][% subscription.branchname %][% END %]
[% IF ( subscription.callnumber ) %]([% subscription.callnumber %])[% END %]
</td>
[% IF ( routing && CAN_user_serials_routing ) %]
//]]>
</script>
</head>
-<body>
+<body id="ser_serials-recieve" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="ser_subscription-add" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
<title>Koha › Serials › Catalog search</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="ser_subscription-bib-search" class="ser">
<div id="doc" class="yui-t7">
<div id="bd">
//]]>
</script>
</head>
-<body>
+<body id="ser_subscription-detail" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
#custom-doc { width:39.85em;*width:38.86em;min-width:531px; margin:auto; text-align:left; }
</style>
</head>
-<body>
+<body id="ser_subscription-renew" class="ser">
<div id="custom-doc" class="yui-t7">
[% IF ( renew ) %]
<title>Koha › Serials › Alert subscribers for [% bibliotitle %]</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="ser_viewalerts" class="ser">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'serials-search.inc' %]
<title>Koha › Tools › Send SMS Message</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="sms_sms-home" class="pat">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% END %]
<script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
</head>
-<body>
+<body id="acq_suggestion" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<div id="breadcrumbs">
<style type="text/css">
tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : transparent; }</style>
</head>
-<body>
+<body id="tags_list" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="tags_review" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<style type="text/css">#selections { display: none; }</style>
<![endif]-->
</head>
-<body>
+<body id="tools_batchMod-del" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<![endif]-->
<link type="text/css" rel="stylesheet" href="[% themelang %]/css/addbiblio.css" />
</head>
-<body>
+<body id="tools_batchMod-edit" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="tools_batchMod" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
</head>
-<body>
+<body id="tools_cleanborrowers" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
</head>
-<body>
+<body id="tools_csv-profiles" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-en.js"></script>
<script type="text/javascript" src="[% themelang %]/lib/calendar/calendar-setup.js"></script>
</head>
-<body>
+<body id="tools_export" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
#showHoliday { margin : .5em 0; } h1 select { width: 20em; } div.yui-b fieldset.brief ol { font-size:100%; } div.yui-b fieldset.brief li, div.yui-b fieldset.brief li.radio { padding:0.2em 0; } .help { margin:.3em 0;border:1px solid #EEE;padding:.3em .7em; font-size : 90%; } #holidayweeklyrepeatable, #holidaysyearlyrepeatable, #holidaysunique, #holidayexceptions { font-size : 90%; margin-bottom : 1em;} .calendar td, .calendar th, .calendar .button, .calendar tbody .day { padding : .7em; font-size: 110%; } .calendar { width: auto; border : 0; }
</style>
</head>
-<body>
+<body id="tools_holidays" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
code { background-color: yellow; }
</style>
</head>
-<body>
+<body id="tools_import_borrowers" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="tools_inventory" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
});
</script>
</head>
-<body>
+<body id="tools_koha-news" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="tools_letter" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'letters-search.inc' %]
#jobstatus { margin:.4em; }
#jobprogress{ width:200px;height:10px;border:1px solid #666;background:url('/intranet-tmpl/prog/img/progress.png') -300px 0px no-repeat; } span.change-status { font-style:italic; color:#666; display:none; }</style>
</head>
-<body>
+<body id="tools_manage-marc-import" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
</script>
</head>
-<body>
+<body id="tools_overduerules" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
});
</script>
</head>
-<body>
+<body id="tools_picture-upload" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'patron-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body id="tools_scheduler" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="tools_stage-marc-import" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
<title>Koha › Tools</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body>
+<body id="tools_tools-home" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
//]]>
</script>
</head>
-<body>
+<body id="tools_upload-images" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
-<body>
+<body class="tools_viewlog" class="tools">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
#custom-doc { width:34.62em;*width:33.78em;min-width:450px; margin:auto; margin-top: .4em;text-align:left; }
</style>
</head>
-<body>
+<body id="lists_addbybiblionumber" class="lists">
[% UNLESS (authorized) %]
<p align="center">
<title>Koha › Download shelf</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding:1em;">
+<body id="lists_downloadshelf" class="lists" style="padding:1em;">
[% IF ( format ) %]
<p>Your download should begin automatically.</p>
[% ELSE %]
[% INCLUDE 'doc-head-open.inc' %]<title>Koha › Lists › Sending your list</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
-<body style="padding: 1em;" id="sendbasket">
+<body id="lists_sendshelfform" class="lists" style="padding: 1em;">
<div class="container">[% IF ( email ) %]
[% IF ( SENT ) %]
//]]>
</script>
</head>
-<body>
+<body id="lists_shelves" class="lists">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'cat-search.inc' %]
[% END %]
</table>
[% ELSE %]
- <p>No Private Lists.</p>
+ <p>No private lists.</p>
[% END %]<!-- /shelveslooppriv -->
</div><!-- /privateshelves -->
[% END %]
</table>
[% ELSE %]
- [% IF ( showpublicshelves ) %]No Public Lists.[% END %]
+ [% IF ( showpublicshelves ) %]<p>No public lists.</p>[% END %]
[% END %]<!-- /shelvesloop -->
</div><!-- /publicshelves -->
</div>
//]]>
</script>
</head>
-<body>
+<body id="cat_searchresult" class="cat">
<h2>Z3950 Search Results</h2>
--- /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);
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha Online[% END %] Catalog › Details for: [% title |html %][% FOREACH subtitl IN subtitle %], [% subtitl.subfield |html %][% END %]
[% INCLUDE 'doc-head-close.inc' %]
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
+<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tools.min.js"></script>
<script type="text/JavaScript" language="JavaScript">
//<![CDATA[
[% IF ( busc ) %]
});
[% END %]
+ $(".branch-info-tooltip-trigger").tooltip({delay: 100, position: "top right"});
});
[% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %][% IF ( TagsEnabled ) %]<style type="text/css">
#addtagl { display: none; }
</style>[% END %][% END %][% END %]
+<style type="text/css">
+.branch-info-tooltip {
+ display: none;
+ padding: 20px;
+ background: #fff;
+ border: 1px solid black;
+}
+</style>
</head>
<body id="opac-detail">
</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>[% UNLESS ( singleBranchMode ) %][% IF ( ITEM_RESULT.branchurl ) %]<a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a>[% ELSE %][% ITEM_RESULT.branchname %][% END %][% END %] <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span> </td>
+ <td>
+ [% UNLESS ( singleBranchMode ) %]
+ <span class="[% ITEM_RESULT.branch_opac_info ? 'branch-info-tooltip-trigger' : '' %]">
+ [% IF ( ITEM_RESULT.branchurl ) %]
+ <a href="[% ITEM_RESULT.branchurl %]">[% ITEM_RESULT.branchname %]</a>
+ [% ELSE %]
+ [% ITEM_RESULT.branchname %]
+ [% END %]
+ </span>
+ <div class="branch-info-tooltip">[% ITEM_RESULT.branch_opac_info %]</div>
+ [% END %]
+ <span class="shelvingloc">[% ITEM_RESULT.location_description %]</span>
+ </td>
[% IF ( itemdata_ccode ) %]<td>[% 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 %]
[% END %][% IF ( virtualshelves ) %][% IF ( loggedinusername ) %][% IF ( addbarshelves ) %]
param1 += "<optgroup label=\""+_("Your Lists:")+"\">";[% FOREACH addbarshelvesloo IN addbarshelvesloop %]
param1 += "<option id=\"s[% addbarshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addbarshelvesloo.shelfname |html %]<\/option>";[% END %]
- [% IF ( bartotal ) %]param1 += "<option value=\"morelists\">[ "+_("More lists")+" ]<\/option>";[% END %]
param1 += "<\/optgroup>";[% END %]
- [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public Lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %];[% END %]
- param1 += "<\/optgroup>";
+ [% IF ( addpubshelves ) %]param1 += "<optgroup label=\""+_("Public Lists:")+"\">"[% FOREACH addpubshelvesloo IN addpubshelvesloop %]+"<option id=\"s[% addpubshelvesloo.shelfnumber %]\" value=\"addtolist\">[% addpubshelvesloo.shelfname |html %]<\/option>"[% END %];
+ param1 += "<\/optgroup>";[% END %]
+ [% IF ( addbarshelvesloop.size>9 || addpubshelvesloop.size>9 ) %]
+ param1 += "<option value=\"morelists\">[ "+_("More Lists")+" ]<\/option>";
+ [% END %]
param1 += "<option value=\"newlist\">[ "+_("New List")+" ]<\/option>";
[% END %]
[% END %]
use strict;
sub kohaversion {
- our $VERSION = '3.07.00.032';
+ our $VERSION = '3.07.00.036';
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install
my $op = $cgi->param('op') || $ARGV[0] || '';
my $layout_id = $cgi->param('layout_id') || $cgi->param('element_id') || $ARGV[1] || '';
my $layout_choice = $cgi->param('layout_choice') || '';
-my $layout = '';
+our $layout = '';
sub _set_selected {
my ($type_list, $object, $data_type) = @_;
# external modules
use CGI;
# use Digest::MD5 qw(md5_base64);
+use List::MoreUtils qw/uniq/;
# internal modules
use C4::Auth;
if ($op eq "modify") {
$template->param( updtype => 'M',modify => 1 );
$template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1) unless $step;
+ if ( $step == 4 ) {
+ $template->param( categorycode => $borrower_data->{'categorycode'} );
+ }
}
if ( $op eq "duplicate" ) {
$template->param( updtype => 'I' );
return;
}
my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber);
+ my @classes = uniq( map {$_->{class}} @$attributes );
+ @classes = sort @classes;
# map patron's attributes into a more convenient structure
my %attr_hash = ();
my @attribute_loop = ();
my $i = 0;
+ my %items_by_class;
foreach my $type_code (map { $_->{code} } @types) {
my $attr_type = C4::Members::AttributeTypes->fetch($type_code);
my $entry = {
+ class => $attr_type->class(),
code => $attr_type->code(),
description => $attr_type->description(),
repeatable => $attr_type->repeatable(),
password_allowed => $attr_type->password_allowed(),
category => $attr_type->authorised_value_category(),
+ category_code => $attr_type->category_code(),
password => '',
};
if (exists $attr_hash{$attr_type->code()}) {
}
$i++;
$newentry->{form_id} = "patron_attr_$i";
- #use Data::Dumper; die Dumper($entry) if $entry->{use_dropdown};
- push @attribute_loop, $newentry;
+ push @{$items_by_class{$attr_type->class()}}, $newentry;
}
} else {
$i++;
$newentry->{auth_val_loop} = GetAuthorisedValues($attr_type->authorised_value_category());
}
$newentry->{form_id} = "patron_attr_$i";
- push @attribute_loop, $newentry;
+ push @{$items_by_class{$attr_type->class()}}, $newentry;
+ }
+ }
+ while ( my ($class, @items) = each %items_by_class ) {
+ my $lib = GetAuthorisedValueByCode( 'PA_CLASS', $class ) || $class;
+ push @attribute_loop, {
+ class => $class,
+ items => @items,
+ lib => $lib,
}
}
+
$template->param(patron_attributes => \@attribute_loop);
}
#use Smart::Comments;
#use Data::Dumper;
+use DateTime;
+use Koha::DateUtils;
use vars qw($debug);
my $dbh = C4::Context->dbh;
-my $input = new CGI;
+my $input = CGI->new;
$debug or $debug = $input->param('debug') || 0;
my $print = $input->param('print');
my $override_limit = $input->param("override_limit") || 0;
if ( @borrowernumbers ) {
$relissue = GetPendingIssues(@borrowernumbers);
}
-my $issuecount = @{$issue};
-my $relissuecount = @{$relissue};
my $roaddetails = &GetRoadTypeDetails( $data->{'streettype'} );
-my $today = POSIX::strftime("%Y-%m-%d", localtime); # iso format
-my @issuedata;
+my $today = DateTime->now( time_zone => C4::Context->tz);
+$today->truncate(to => 'days');
my @borrowers_with_issues;
my $overdues_exist = 0;
my $totalprice = 0;
-my @issuedata = build_issue_data($issue, $issuecount);
-my @relissuedata = build_issue_data($relissue, $relissuecount);
-
-sub build_issue_data {
- my $issue = shift;
- my $issuecount = shift;
-
- my $localissue;
-
- for ( my $i = 0 ; $i < $issuecount ; $i++ ) {
- my $datedue = $issue->[$i]{'date_due'};
- my $issuedate = $issue->[$i]{'issuedate'};
- $issue->[$i]{'date_due'} = C4::Dates->new($issue->[$i]{'date_due'}, 'iso')->output('syspref');
- $issue->[$i]{'issuedate'} = C4::Dates->new($issue->[$i]{'issuedate'},'iso')->output('syspref');
- my $biblionumber = $issue->[$i]{'biblionumber'};
- $issue->[$i]{'issuingbranchname'} = GetBranchName($issue->[$i]{'branchcode'});
- my %row = %{ $issue->[$i] };
- $totalprice += $issue->[$i]{'replacementprice'};
- $row{'replacementprice'} = $issue->[$i]{'replacementprice'};
- # item lost, damaged loops
- if ($row{'itemlost'}) {
- my $fw = GetFrameworkCode($issue->[$i]{'biblionumber'});
- my $category = GetAuthValCode('items.itemlost',$fw);
- my $lostdbh = C4::Context->dbh;
- my $sth = $lostdbh->prepare("select lib from authorised_values where category=? and authorised_value =? ");
- $sth->execute($category, $row{'itemlost'});
- my $loststat = $sth->fetchrow;
- if ($loststat) {
- $row{'itemlost'} = $loststat;
- }
- }
- if ($row{'damaged'}) {
- my $fw = GetFrameworkCode($issue->[$i]{'biblionumber'});
- my $category = GetAuthValCode('items.damaged',$fw);
- my $damageddbh = C4::Context->dbh;
- my $sth = $damageddbh->prepare("select lib from authorised_values where category=? and authorised_value =? ");
- $sth->execute($category, $row{'damaged'});
- my $damagedstat = $sth->fetchrow;
- if ($damagedstat) {
- $row{'itemdamaged'} = $damagedstat;
- }
- }
- # end lost, damaged
- if ( $datedue lt $today ) {
- $overdues_exist = 1;
- $row{'red'} = 1;
- }
- if ( $issuedate eq $today ) {
- $row{'today'} = 1;
- }
-
- #find the charge for an item
- my ( $charge, $itemtype ) =
- GetIssuingCharges( $issue->[$i]{'itemnumber'}, $issue->[$i]{'borrowernumber'} );
-
- my $itemtypeinfo = getitemtypeinfo($itemtype);
- $row{'itemtype_description'} = $itemtypeinfo->{description};
- $row{'itemtype_image'} = $itemtypeinfo->{imageurl};
-
- $row{'charge'} = sprintf( "%.2f", $charge );
-
- my ( $renewokay,$renewerror ) = CanBookBeRenewed( $issue->[$i]{'borrowernumber'}, $issue->[$i]{'itemnumber'}, $override_limit );
- $row{'norenew'} = !$renewokay;
- $row{'can_confirm'} = ( !$renewokay && $renewerror ne 'on_reserve' );
- $row{"norenew_reason_$renewerror"} = 1 if $renewerror;
- $row{'renew_failed'} = $renew_failed{ $issue->[$i]{'itemnumber'} };
- $row{'return_failed'} = $return_failed{$issue->[$i]{'barcode'}};
- push( @$localissue, \%row );
- }
- return $localissue;
-}
+my @issuedata = build_issue_data($issue);
+my @relissuedata = build_issue_data($relissue);
### ###############################################################################
$template->param(%$data);
if (C4::Context->preference('ExtendedPatronAttributes')) {
- my $attributes = GetBorrowerAttributes($borrowernumber);
+ my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber);
+ my @classes = uniq( map {$_->{class}} @$attributes );
+ @classes = sort @classes;
+
+ my @attributes_loop;
+ for my $class (@classes) {
+ my @items;
+ for my $attr (@$attributes) {
+ push @items, $attr if $attr->{class} eq $class
+ }
+ my $lib = GetAuthorisedValueByCode( 'PA_CLASS', $class ) || $class;
+ push @attributes_loop, {
+ class => $class,
+ items => \@items,
+ lib => $lib,
+ };
+ }
+
$template->param(
ExtendedPatronAttributes => 1,
- extendedattributes => $attributes
+ attributes_loop => \@attributes_loop
);
+
my @types = C4::Members::AttributeTypes::GetAttributeTypes();
if (scalar(@types) == 0) {
$template->param(no_patron_attribute_types => 1);
totaldue_raw => $total,
issueloop => @issuedata,
relissueloop => @relissuedata,
- issuecount => $issuecount,
- relissuecount => $relissuecount,
overdues_exist => $overdues_exist,
error => $error,
$error => 1,
);
output_html_with_http_headers $input, $cookie, $template->output;
+
+sub build_issue_data {
+ my $issues = shift;
+
+ my $localissue;
+
+ foreach my $issue ( @{$issues} ) {
+
+ # Getting borrower details
+ my $memberdetails = GetMemberDetails( $issue->{borrowernumber} );
+ $issue->{borrowername} =
+ $memberdetails->{firstname} . ' ' . $memberdetails->{surname};
+ $issue->{cardnumber} = $memberdetails->{cardnumber};
+ my $issuedate;
+ if ($issue->{issuedate} ) {
+ $issuedate = $issue->{issuedate}->clone();
+ }
+
+ $issue->{date_due} = output_pref( $issue->{date_due} );
+ $issue->{issuedate} = output_pref( $issue->{issuedate} ) if defined $issue->{issuedate};
+ my $biblionumber = $issue->{biblionumber};
+ my %row = %{$issue};
+ $totalprice += $issue->{replacementprice};
+
+ # item lost, damaged loops
+ if ( $row{'itemlost'} ) {
+ my $fw = GetFrameworkCode( $issue->{biblionumber} );
+ my $category = GetAuthValCode( 'items.itemlost', $fw );
+ my $lostdbh = C4::Context->dbh;
+ my $sth = $lostdbh->prepare(
+"select lib from authorised_values where category=? and authorised_value =? "
+ );
+ $sth->execute( $category, $row{'itemlost'} );
+ my $loststat = $sth->fetchrow;
+ if ($loststat) {
+ $row{'itemlost'} = $loststat;
+ }
+ }
+ if ( $row{'damaged'} ) {
+ my $fw = GetFrameworkCode( $issue->{biblionumber} );
+ my $category = GetAuthValCode( 'items.damaged', $fw );
+ my $damageddbh = C4::Context->dbh;
+ my $sth = $damageddbh->prepare(
+"select lib from authorised_values where category=? and authorised_value =? "
+ );
+ $sth->execute( $category, $row{'damaged'} );
+ my $damagedstat = $sth->fetchrow;
+ if ($damagedstat) {
+ $row{'itemdamaged'} = $damagedstat;
+ }
+ }
+
+ # end lost, damaged
+ if ( $issue->{overdue} ) {
+ $overdues_exist = 1;
+ $row{red} = 1;
+ }
+ if ($issuedate) {
+ $issuedate->truncate( to => 'days' );
+ if ( DateTime->compare( $issuedate, $today ) == 0 ) {
+ $row{today} = 1;
+ }
+ }
+
+ #find the charge for an item
+ my ( $charge, $itemtype ) =
+ GetIssuingCharges( $issue->{itemnumber}, $borrowernumber );
+
+ my $itemtypeinfo = getitemtypeinfo($itemtype);
+ $row{'itemtype_description'} = $itemtypeinfo->{description};
+ $row{'itemtype_image'} = $itemtypeinfo->{imageurl};
+
+ $row{'charge'} = sprintf( "%.2f", $charge );
+
+ my ( $renewokay, $renewerror ) =
+ CanBookBeRenewed( $borrowernumber, $issue->{itemnumber},
+ $override_limit );
+ $row{'norenew'} = !$renewokay;
+ $row{'can_confirm'} = ( !$renewokay && $renewerror ne 'on_reserve' );
+ $row{"norenew_reason_$renewerror"} = 1 if $renewerror;
+ $row{renew_failed} = $renew_failed{ $issue->{itemnumber} };
+ $row{return_failed} = $return_failed{ $issue->{barcode} };
+ push( @{$localissue}, \%row );
+ }
+ return $localissue;
+}
my $input = CGI->new;
-my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+our ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => 'members/pay.tmpl',
query => $input,
type => 'intranet',
use C4::Members;
use C4::Branch;
use List::MoreUtils qw/any uniq/;
+use Koha::DateUtils;
use C4::Dates qw/format_date/;
use C4::Members::Attributes qw(GetBorrowerAttributes);
$line{title} = $issue->{'title'};
$line{author} = $issue->{'author'};
$line{classification} = $issue->{'classification'} || $issue->{'itemcallnumber'};
- $line{date_due} = format_date($issue->{'date_due'});
- $line{returndate} = format_date($issue->{'returndate'});
- $line{issuedate} = format_date($issue->{'issuedate'});
+ $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'};
use C4::Members;
use C4::Members::Messaging;
use C4::Overdues;
-use C4::Dates qw/format_date/;
+use Koha::DateUtils;
# These are defaults for command line options.
);
}
+sub format_date {
+ my $date_string = shift;
+ my $dt=dt_from_string($date_string);
+ return output_pref($dt);
+}
+
1;
__END__
# This script is meant to be run nightly out of cron.
# Copyright 2000-2002 Katipo Communications
+# Copyright 2011 PTFS-Europe Ltd
#
# This file is part of Koha.
#
# with Koha; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-# FIXME: use FinesMode as described or change syspref description
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 Date::Calc qw/Date_to_Days/;
+use warnings;
+use 5.010;
use C4::Context;
-use C4::Circulation;
use C4::Overdues;
-use C4::Calendar qw(); # don't need any exports from Calendar
-use C4::Biblio;
-use C4::Debug; # supplying $debug and $cgi_debug
use Getopt::Long;
+use Carp;
+use File::Spec;
+
+use Koha::Calendar;
+use Koha::DateUtils;
-my $help = 0;
-my $verbose = 0;
+my $help;
+my $verbose;
my $output_dir;
-GetOptions( 'h|help' => \$help,
- 'v|verbose' => \$verbose,
- 'o|out:s' => \$output_dir,
- );
+GetOptions(
+ 'h|help' => \$help,
+ 'v|verbose' => \$verbose,
+ 'o|out:s' => \$output_dir,
+);
my $usage = << 'ENDUSAGE';
This script calculates and charges overdue fines
ENDUSAGE
-die $usage if $help;
-
-use vars qw(@borrower_fields @item_fields @other_fields);
-use vars qw($fldir $libname $control $mode $delim $dbname $today $today_iso $today_days);
-use vars qw($filename);
-
-CHECK {
- @borrower_fields = qw(cardnumber categorycode surname firstname email phone address citystate);
- @item_fields = qw(itemnumber barcode date_due);
- @other_fields = qw(type days_overdue fine);
- $libname = C4::Context->preference('LibraryName');
- $control = C4::Context->preference('CircControl');
- $mode = C4::Context->preference('finesMode');
- $dbname = C4::Context->config('database');
- $delim = "\t"; # ? C4::Context->preference('delimiter') || "\t";
-
+if ($help) {
+ print $usage;
+ exit;
}
-INIT {
- $debug and print "Each line will contain the following fields:\n",
- "From borrowers : ", join(', ', @borrower_fields), "\n",
- "From items : ", join(', ', @item_fields), "\n",
- "Per overdue: ", join(', ', @other_fields), "\n",
- "Delimiter: '$delim'\n";
-}
+my @borrower_fields =
+ qw(cardnumber categorycode surname firstname email phone address citystate);
+my @item_fields = qw(itemnumber barcode date_due);
+my @other_fields = qw(type days_overdue fine);
+my $libname = C4::Context->preference('LibraryName');
+my $control = C4::Context->preference('CircControl');
+my $mode = C4::Context->preference('finesMode');
+my $delim = "\t"; # ? C4::Context->preference('delimiter') || "\t";
+
+my %is_holiday;
+my $today = DateTime->now( time_zone => C4::Context->tz() );
+my $filename = get_filename($output_dir);
+
+open my $fh, '>>', $filename or croak "Cannot write file $filename: $!";
+print {$fh} join $delim, ( @borrower_fields, @item_fields, @other_fields );
+print {$fh} "\n";
+
+my $counted = 0;
+my $overdues = Getoverdues();
+for my $overdue ( @{$overdues} ) {
+ if ( !defined $overdue->{borrowernumber} ) {
+ carp
+"ERROR in Getoverdues : issues.borrowernumber IS NULL. Repair 'issues' table now! Skipping record.\n";
+ next;
+ }
+ my $borrower = BorType( $overdue->{borrowernumber} );
+ my $branchcode =
+ ( $control eq 'ItemHomeLibrary' ) ? $overdue->{homebranch}
+ : ( $control eq 'PatronLibrary' ) ? $borrower->{branchcode}
+ : $overdue->{branchcode};
+
+# In final case, CircControl must be PickupLibrary. (branchcode comes from issues table here).
+ if ( !exists $is_holiday{$branchcode} ) {
+ $is_holiday{$branchcode} = set_holiday( $branchcode, $today );
+ }
-my $data = Getoverdues();
-my $overdueItemsCounted = 0;
-my %calendars = ();
-$today = C4::Dates->new();
-$today_iso = $today->output('iso');
-$today_days = Date_to_Days(split(/-/,$today_iso));
-if($output_dir){
- $fldir = $output_dir if( -d $output_dir );
-} else {
- $fldir = $ENV{TMPDIR} || "/tmp";
-}
-if (!-d $fldir) {
- warn "Could not write to $fldir ... does not exist!";
-}
-$filename = $dbname;
-$filename =~ s/\W//;
-$filename = $fldir . '/'. $filename . '_' . $today_iso . ".log";
-print "writing to $filename\n" if $verbose;
-open (FILE, ">$filename") or die "Cannot write file $filename: $!";
-print FILE join $delim, (@borrower_fields, @item_fields, @other_fields);
-print FILE "\n";
-
-for (my $i=0; $i<scalar(@$data); $i++) {
- my $datedue = C4::Dates->new($data->[$i]->{'date_due'},'iso');
- my $datedue_days = Date_to_Days(split(/-/,$datedue->output('iso')));
- my $due_str = $datedue->output();
- unless (defined $data->[$i]->{'borrowernumber'}) {
- print STDERR "ERROR in Getoverdues line $i: issues.borrowernumber IS NULL. Repair 'issues' table now! Skipping record.\n";
- next; # Note: this doesn't solve everything. After NULL borrowernumber, multiple issues w/ real borrowernumbers can pile up.
+ my $datedue = dt_from_string( $overdue->{date_due} );
+ if ( DateTime->compare( $datedue, $today ) == 1 ) {
+ next; # not overdue
}
- my $borrower = BorType($data->[$i]->{'borrowernumber'});
- my $branchcode = ($control eq 'ItemHomeLibrary') ? $data->[$i]->{homebranch} :
- ($control eq 'PatronLibrary' ) ? $borrower->{branchcode} :
- $data->[$i]->{branchcode} ;
- # In final case, CircControl must be PickupLibrary. (branchcode comes from issues table here).
- my $calendar;
- unless (defined ($calendars{$branchcode})) {
- $calendars{$branchcode} = C4::Calendar->new(branchcode => $branchcode);
+ ++$counted;
+
+ my ( $amount, $type, $daycounttotal ) =
+ CalcFine( $overdue, $borrower->{categorycode},
+ $branchcode, $datedue, $today );
+
+ $type ||= q{};
+
+ # Don't update the fine if today is a holiday.
+ # This ensures that dropbox mode will remove the correct amount of fine.
+ if ( $mode eq 'production' && !$is_holiday{$branchcode} ) {
+ if ( $amount > 0 ) {
+ UpdateFine(
+ $overdue->{itemnumber},
+ $overdue->{borrowernumber},
+ $amount, $type, output_pref($datedue)
+ );
+ }
}
- $calendar = $calendars{$branchcode};
- my $isHoliday = $calendar->isHoliday(split '/', $today->output('metric'));
-
- ($datedue_days <= $today_days) or next; # or it's not overdue, right?
-
- $overdueItemsCounted++;
- my ($amount,$type,$daycounttotal,$daycount)=
- CalcFine($data->[$i], $borrower->{'categorycode'}, $branchcode,undef,undef, $datedue, $today);
- # FIXME: $type NEVER gets populated by anything.
- (defined $type) or $type = '';
- # Don't update the fine if today is a holiday.
- # This ensures that dropbox mode will remove the correct amount of fine.
- if ($mode eq 'production' and ! $isHoliday) {
- UpdateFine($data->[$i]->{'itemnumber'},$data->[$i]->{'borrowernumber'},$amount,$type,$due_str) if( $amount > 0 ) ;
- }
- my @cells = ();
- push @cells, map {$borrower->{$_}} @borrower_fields;
- push @cells, map {$data->[$i]->{$_}} @item_fields;
+ my @cells;
+ push @cells,
+ map { defined $borrower->{$_} ? $borrower->{$_} : q{} } @borrower_fields;
+ push @cells, map { $overdue->{$_} } @item_fields;
push @cells, $type, $daycounttotal, $amount;
- print FILE join($delim, @cells), "\n";
+ say {$fh} join $delim, @cells;
}
+close $fh;
-my $numOverdueItems = scalar(@$data);
if ($verbose) {
- print <<EOM;
-Fines assessment -- $today_iso -- Saved to $filename
+ my $overdue_items = @{$overdues};
+ print <<'EOM';
+Fines assessment -- $today->ymd() -- Saved to $filename
Number of Overdue Items:
- counted $overdueItemsCounted
- reported $numOverdueItems
+ counted $overdue_items
+ reported $counted
EOM
}
-close FILE;
+sub set_holiday {
+ my ( $branch, $dt ) = @_;
+
+ my $calendar = Koha::Calendar->new( branchcode => $branch );
+ return $calendar->is_holiday($dt);
+}
+
+sub get_filename {
+ my $directory = shift;
+ if ( !$directory ) {
+ $directory = File::Spec->tmpdir();
+ }
+ if ( !-d $directory ) {
+ carp "Could not write to $directory ... does not exist!";
+ }
+ my $name = C4::Context->config('database');
+ $name =~ s/\W//;
+ $name .= join q{}, q{_}, $today->ymd(), '.log';
+ $name = File::Spec->catfile( $directory, $name );
+ if ($verbose) {
+ say "writing to $name";
+ }
+ return $name;
+}
# these are the fields that will be substituted into <<item.content>>
my @item_content_fields = split( /,/, $itemscontent );
-binmode STDOUT, ':encoding(UTF-8)';
+binmode( STDOUT, ':encoding(UTF-8)' );
our $csv; # the Text::CSV_XS object
if ( $htmlfilename eq '' ) {
$html_fh = *STDOUT;
} else {
- my $today = C4::Dates->new();
- open $html_fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->output('iso').".html");
+ my $today = DateTime->now(time_zone => C4::Context->tz );
+ open $html_fh, ">",File::Spec->catdir ($htmlfilename,"notices-".$today->ymd().".html");
}
print $html_fh "<html>\n";
use MARC::Field;
use List::MoreUtils qw/any none/;
use C4::Images;
+use Koha::DateUtils;
BEGIN {
if (C4::Context->preference('BakerTaylorEnabled')) {
# I can't actually find any case in which this is defined. --amoore 2008-12-09
$itm->{ $itm->{'publictype'} } = 1;
}
- $itm->{datedue} = format_date($itm->{datedue});
+ $itm->{datedue} = format_sqlduedatetime($itm->{datedue});
$itm->{datelastseen} = format_date($itm->{datelastseen});
# get collection code description, too
use DateTime;
use DateTime::Format::ICal;
use Date::Calc qw (Parse_Date);
+use DateTime;
+use DateTime::Event::ICal;
use C4::Auth;
use C4::Koha;
my $calendar = Data::ICal->new();
# get issued items ....
-my ($issues) = GetPendingIssues($borrowernumber);
+my $issues = GetPendingIssues($borrowernumber);
foreach my $issue ( @$issues ) {
my $vevent = Data::ICal::Entry::Event->new();
use C4::Koha;
use C4::Biblio;
use C4::Circulation;
-use C4::Dates qw/format_date/;
use C4::Members;
+use Koha::DateUtils;
use C4::Output;
$line{title} = $issue->{'title'};
$line{author} = $issue->{'author'};
$line{itemcallnumber} = $issue->{'itemcallnumber'};
- $line{date_due} = format_date( $issue->{'date_due'} );
- $line{returndate} = format_date( $issue->{'returndate'} );
+ $line{date_due} = format_sqlduedatetime( $issue->{date_due} );
+ $line{returndate} = format_sqldatetime( $issue->{returndate} );
$line{volumeddesc} = $issue->{'volumeddesc'};
$issue->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $issue->{'itype'} : $issue->{'itemtype'};
if($issue->{'itemtype'}) {
use C4::Branch; # GetBranches
use C4::Overdues;
use C4::Debug;
+use Koha::DateUtils;
# use Data::Dumper;
my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves");
# change the background color.
my $issues= GetItemIssue($itemNum);
if ( $issues->{'date_due'} ) {
- $itemLoopIter->{dateDue} = format_date($issues->{'date_due'});
+ $itemLoopIter->{dateDue} = format_sqlduedatetime($issues->{date_due});
$itemLoopIter->{backgroundcolor} = 'onloan';
}
use C4::Dates qw/format_date/;
use C4::Letters;
use C4::Branch; # GetBranches
+use Koha::DateUtils;
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
my @overdues;
my @issuedat;
my $itemtypes = GetItemTypes();
-my ($issues) = GetPendingIssues($borrowernumber);
+my $issues = GetPendingIssues($borrowernumber);
if ($issues){
- foreach my $issue ( sort { $b->{'date_due'} cmp $a->{'date_due'} } @$issues ) {
+ foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
# check for reserves
my ( $restype, $res, undef ) = CheckReserves( $issue->{'itemnumber'} );
if ( $restype ) {
$issue->{'imageurl'} = getitemtypeimagelocation( 'opac', $itemtypes->{$itemtype}->{'imageurl'} );
$issue->{'description'} = $itemtypes->{$itemtype}->{'description'};
}
- $issue->{date_due} = format_date($issue->{date_due});
+ $issue->{date_due} = output_pref_due($issue->{date_due});
push @issuedat, $issue;
$count++;
use C4::Circulation;
use C4::Auth;
use URI::Escape;
-use C4::Dates qw/format_date_in_iso/;
+use Koha::DateUtils;
my $input = new CGI;
#Set Up User_env
my $branch=$input->param('branch');
my $datedue;
if ($input->param('newduedate')){
- $datedue=C4::Dates->new($input->param('newduedate'));
+ $datedue = dt_from_string($input->param('newduedate'));
}
# warn "barcodes : @barcodes";
use C4::Dates qw/format_date/;
use C4::Members;
use C4::Search; # enabled_staff_search_views
+use Koha::DateUtils;
my $dbh = C4::Context->dbh;
my $sth;
# change the background color
my $issues= GetItemIssue($itemnumber);
if ( $issues->{'date_due'} ) {
- $item->{date_due} = format_date($issues->{'date_due'});
+ $item->{date_due} = format_sqldatetime($issues->{date_due});
$item->{backgroundcolor} = 'onloan';
}
use C4::Serials;
use C4::Output;
use C4::Context;
+use C4::Branch;
my $query = new CGI;
my $title = $query->param('title_filter');
if ($routing) {
for my $subscription ( @subscriptions) {
$subscription->{routingedit} = check_routing( $subscription->{subscriptionid} );
+ $subscription->{branchname} = GetBranchName ( $subscription->{branchcode} );
}
}
my $suggestedbyme = (defined $input->param('suggestedbyme')? $input->param('suggestedbyme'):1);
my $op = $input->param('op')||'else';
my @editsuggestions = $input->param('edit_field');
-my $branchfilter = $input->param('branchcode');
-my $suggestedby = $input->param('suggestedby');
-my $returnsuggested = $input->param('returnsuggested');
+my $suggestedby = $input->param('suggestedby');
my $returnsuggestedby = $input->param('returnsuggestedby');
-my $managedby = $input->param('managedby');
-my $displayby = $input->param('displayby');
-my $tabcode = $input->param('tabcode');
+my $returnsuggested = $input->param('returnsuggested');
+my $managedby = $input->param('managedby');
+my $displayby = $input->param('displayby') || '';
+my $branchfilter = ($displayby ne "branchcode") ? $input->param('branchcode') : '';
+my $tabcode = $input->param('tabcode');
# filter informations which are not suggestion related.
my $suggestion_ref = $input->Vars;
$op='else';
$displayby||="STATUS";
+ delete $$suggestion_ref{'branchcode'} if($displayby eq "branchcode");
my $criteria_list=GetDistinctValues("suggestions.".$displayby);
my @allsuggestions;
my $reasonsloop = GetAuthorisedValues("SUGGEST");
- foreach my $criteriumvalue (map{$$_{'value'}} @$criteria_list){
+ foreach my $criteriumvalue ( map { $$_{'value'} } @$criteria_list ) {
+ # By default, display suggestions from current working branch
+ if(not defined $branchfilter) {
+ $$suggestion_ref{'branchcode'} = C4::Context->userenv->{'branch'};
+ }
my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne "";
-
- next if ($definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue);
- $$suggestion_ref{$displayby}=$criteriumvalue;
-# warn $$suggestion_ref{$displayby}."=$criteriumvalue; $displayby";
-
+
+ next if ( $definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue );
+ $$suggestion_ref{$displayby} = $criteriumvalue;
+
my $suggestions = &SearchSuggestion($suggestion_ref);
- foreach my $suggestion (@$suggestions){
- if($suggestion->{budgetid}) {
- my $budget = GetBudget($suggestion->{budgetid});
- $suggestion->{budget_name}=$budget->{budget_name} if $budget;
+ foreach my $suggestion (@$suggestions) {
+ $suggestion->{budget_name} = GetBudget( $suggestion->{budgetid} )->{budget_name} if $suggestion->{budgetid};
+ foreach my $date qw(suggesteddate manageddate accepteddate) {
+ if ($suggestion->{$date} and $suggestion->{$date} ne "0000-00-00" && $suggestion->{$date} ne "" ) {
+ $suggestion->{$date} = format_date( $suggestion->{$date} );
+ } else {
+ $suggestion->{$date} = "";
+ }
}
foreach my $date ( qw(suggesteddate manageddate accepteddate) ){
if ($suggestion->{$date} ne "0000-00-00" && $suggestion->{$date} ne "" ){
my %row = (
value => $thisbranch,
branchname => $branches->{$thisbranch}->{'branchname'},
- selected => ($branches->{$thisbranch}->{'branchcode'} eq $branchfilter)
- ||($branches->{$thisbranch}->{'branchcode'} eq $$suggestion_ref{'branchcode'})
+ selected => ($branchfilter and $branches->{$thisbranch}->{'branchcode'} eq $branchfilter ) || ( $$suggestion_ref{'branchcode'} and $branches->{$thisbranch}->{'branchcode'} eq $$suggestion_ref{'branchcode'} )
);
push @branchloop, \%row;
}
branchfilter => $branchfilter);
# the index parameter is different for item-level itemtypes
-my $supportlist=GetSupportList();
-foreach my $support(@$supportlist){
- $$support{'selected'}= $$support{'itemtype'} eq $$suggestion_ref{'itemtype'};
- if ($$support{'imageurl'}){
- $$support{'imageurl'}= getitemtypeimagelocation( 'intranet', $$support{'imageurl'} );
- }
- else {
- delete $$support{'imageurl'}
+my $supportlist = GetSupportList();
+
+foreach my $support (@$supportlist) {
+ $$support{'selected'} = (defined $$suggestion_ref{'itemtype'})
+ ? $$support{'itemtype'} eq $$suggestion_ref{'itemtype'}
+ : 0;
+ if ( $$support{'imageurl'} ) {
+ $$support{'imageurl'} = getitemtypeimagelocation( 'intranet', $$support{'imageurl'} );
+ } else {
+ delete $$support{'imageurl'};
}
}
$template->param(itemtypeloop=>$supportlist);
};
$template->param( budgetsloop => $budgets);
-$template->param( "statusselected_$$suggestion_ref{'STATUS'}" =>1);
+$template->param( "statusselected_$$suggestion_ref{'STATUS'}" =>1) if ($$suggestion_ref{'STATUS'});
# get currencies and rates
my @rates = GetCurrencies();
my %hashlists;
foreach my $field ( qw(managedby acceptedby suggestedby budgetid) ) {
my $values_list;
- $values_list=GetDistinctValues("suggestions.".$field) ;
- my @codes_list = map{
- { 'code'=>$$_{'value'},
- 'desc'=>GetCriteriumDesc($$_{'value'},$field),
- 'selected'=> $$_{'value'} eq $$suggestion_ref{$field}
- }
- } @$values_list;
- $hashlists{lc($field)."_loop"}=\@codes_list;
+ $values_list = GetDistinctValues( "suggestions." . $field );
+ my @codes_list = map {
+ { 'code' => $$_{'value'},
+ 'desc' => GetCriteriumDesc( $$_{'value'}, $field ),
+ 'selected' => ($$suggestion_ref{$field}) ? $$_{'value'} eq $$suggestion_ref{$field} : 0,
+ }
+ } @$values_list;
+ $hashlists{ lc($field) . "_loop" } = \@codes_list;
}
$template->param(%hashlists);
$template->param(DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),);
my @all_koha_dirs = qw( acqui admin authorities basket C4 catalogue cataloguing circ debian errors
labels members misc offline_circ opac patroncards reports reserve reviews rotating_collections
-serials sms suggestion t tags test tools virtualshelves);
+serials sms suggestion t tags test tools virtualshelves Koha);
my @dirs = qw( acqui admin authorities basket catalogue cataloguing circ debian errors labels
- offline_circ reserve reviews rotating_collections serials sms virtualshelves );
+ offline_circ reserve reviews rotating_collections serials sms virtualshelves Koha);
if ( not $ENV{TEST_QA} ) {
my $msg = 'Author test. Set $ENV{TEST_QA} to a true value to run';
--- /dev/null
+use strict;
+use warnings;
+use 5.010;
+use DateTime;
+use DateTime::TimeZone;
+
+use C4::Context;
+use Test::More tests => 25;
+
+BEGIN { use_ok('Koha::DateUtils'); }
+
+my $tz = C4::Context->tz;
+
+isa_ok( $tz, 'DateTime::TimeZone', 'Context returns timezone object' );
+
+my $testdate_iso = '2011-06-16'; # Bloomsday 2011
+my $dt = dt_from_string( $testdate_iso, 'iso' );
+
+isa_ok( $dt, 'DateTime', 'dt_from_string returns a DateTime object' );
+
+cmp_ok( $dt->ymd(), 'eq', $testdate_iso, 'Returned object matches input' );
+
+$dt->set_hour(12);
+$dt->set_minute(0);
+
+my $date_string = output_pref( $dt, 'iso' );
+cmp_ok $date_string, 'eq', '2011-06-16 12:00', 'iso output';
+
+$date_string = output_pref( $dt, 'us' );
+cmp_ok $date_string, 'eq', '06/16/2011 12:00', 'us output';
+
+# 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_due( $dt, 'metric' );
+cmp_ok $date_string, 'eq', '16/06/2011 12:00',
+ 'output_pref_due preserves non midnight HH:SS';
+
+$dt->set_hour(23);
+$dt->set_minute(59);
+$date_string = output_pref_due( $dt, 'metric' );
+cmp_ok $date_string, 'eq', '16/06/2011',
+ 'output_pref_due truncates HH:SS at midnight';
+
+my $dear_dirty_dublin = DateTime::TimeZone->new( name => 'Europe/Dublin' );
+my $new_dt = dt_from_string( '16/06/2011', 'metric', $dear_dirty_dublin );
+isa_ok( $new_dt, 'DateTime', 'Create DateTime with different timezone' );
+cmp_ok( $new_dt->ymd(), 'eq', $testdate_iso,
+ 'Returned Dublin object matches input' );
+
+$new_dt = dt_from_string( '2011-06-16 12:00', 'sql' );
+isa_ok( $new_dt, 'DateTime', 'Create DateTime from (mysql) sql' );
+cmp_ok( $new_dt->ymd(), 'eq', $testdate_iso, 'sql returns correct date' );
+
+$new_dt = dt_from_string( $dt, 'iso' );
+isa_ok( $new_dt, 'DateTime', 'Passed a DateTime dt_from_string returns it' );
+
+# C4::Dates allowed 00th of the month
+
+my $ymd = '2012-01-01';
+my $dt0 = dt_from_string( '00/01/2012', 'metric' );
+isa_ok( $dt0, 'DateTime',
+ 'dt_from_string returns a DateTime object passed a zero metric day' );
+cmp_ok( $dt0->ymd(), 'eq', $ymd, 'Returned object corrects metric day 0' );
+
+$dt0 = dt_from_string( '01/00/2012', 'us' );
+isa_ok( $dt0, 'DateTime',
+ 'dt_from_string returns a DateTime object passed a zero us day' );
+cmp_ok( $dt0->ymd(), 'eq', $ymd, 'Returned object corrects us day 0' );
+
+$dt0 = dt_from_string( '2012-01-00', 'iso' );
+isa_ok( $dt0, 'DateTime',
+ 'dt_from_string returns a DateTime object passed a zero iso day' );
+cmp_ok( $dt0->ymd(), 'eq', $ymd, 'Returned object corrects iso day 0' );
+
+# Return undef if passed mysql 0 dates
+$dt0 = dt_from_string( '0000-00-00', 'iso' );
+is( $dt0, undef, "undefined returned for 0 iso date" );
+
+my $formatted = format_sqldatetime( '2011-06-16 12:00:07', 'metric' );
+cmp_ok( $formatted, 'eq', '16/06/2011 12:00', 'format_sqldatetime conversion' );
+
+$formatted = format_sqldatetime( undef, 'metric' );
+cmp_ok( $formatted, 'eq', q{},
+ 'format_sqldatetime formats undef as empty string' );
+
+$formatted = format_sqlduedatetime( '2011-06-16 12:00:07', 'metric' );
+cmp_ok(
+ $formatted, 'eq',
+ '16/06/2011 12:00',
+ 'format_sqlduedatetime conversion for hourly loans'
+);
+
+$formatted = format_sqlduedatetime( '2011-06-16 23:59:07', 'metric' );
+cmp_ok( $formatted, 'eq', '16/06/2011',
+ 'format_sqlduedatetime conversion for daily loans' );
--- /dev/null
+use strict;
+use warnings;
+use 5.010;
+use DateTime;
+use DateTime::TimeZone;
+
+use C4::Context;
+use Test::More tests => 9;
+
+BEGIN { use_ok('Koha::Calendar'); }
+
+my $cal = Koha::Calendar->new( TEST_MODE => 1 );
+
+isa_ok( $cal, 'Koha::Calendar', 'Calendar class returned' );
+
+my $saturday = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 25,
+ time_zone => 'Europe/London',
+);
+my $sunday = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 26,
+ time_zone => 'Europe/London',
+);
+my $monday = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 27,
+ time_zone => 'Europe/London',
+);
+my $bloomsday = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 16,
+ time_zone => 'Europe/London',
+); # should be a holiday
+my $special = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 1,
+ time_zone => 'Europe/London',
+); # should be a holiday
+my $notspecial = DateTime->new(
+ year => 2011,
+ month => 6,
+ day => 2,
+ time_zone => 'Europe/London',
+); # should NOT be a holiday
+is( $cal->is_holiday($sunday), 1, 'Sunday is a closed day' ); # wee free test;
+is( $cal->is_holiday($monday), 0, 'Monday is not a closed day' ); # alas
+is( $cal->is_holiday($bloomsday), 1, 'month/day closed day test' );
+is( $cal->is_holiday($special), 1, 'special closed day test' );
+is( $cal->is_holiday($notspecial), 0, 'open day test' );
+
+my $dt = $cal->addDate( $saturday, 1, 'days' );
+is( $dt->day_of_week, 1, 'addDate skips closed Sunday' );
+
+$dt = $cal->addDate( $bloomsday, -1 );
+cmp_ok( $dt->ymd(), 'cmp', '2011-06-15', 'Negative call to addDate' );
--- /dev/null
+
+use strict;
+use warnings;
+use 5.010;
+use C4::Context;
+use C4::Circulation;
+use C4::Members;
+
+use Test::More tests => 8;
+C4::Context->_new_userenv(1234567);
+C4::Context->set_userenv(91, 'CLIstaff', '23529001223661', 'CPL',
+ 'CPL', 'CPL', '', 'cc@cscnet.co.uk');
+
+
+my $test_patron = '23529001223651';
+my $test_item_fic = '502326000402';
+my $test_item_24 = '502326000404';
+my $test_item_48 = '502326000403';
+
+for my $item_barcode ( $test_item_fic, $test_item_24, $test_item_48) {
+ my $duedate = try_issue($test_patron, $item_barcode);
+ isa_ok($duedate, 'DateTime');
+ if ($item_barcode eq $test_item_fic) {
+ is($duedate->hour(), 23, "daily loan hours = 23");
+ is($duedate->minute(), 59, "daily loan mins = 59");
+ }
+ my $ret_ok = try_return($item_barcode);
+ is($ret_ok, 1, 'Return succeeded');
+}
+
+
+sub try_issue {
+ my ($cardnumber, $item ) = @_;
+ my $issuedate = '2011-05-16';
+ my $borrower = GetMemberDetails(0, $cardnumber);
+ my ($issuingimpossible,$needsconfirmation) = CanBookBeIssued( $borrower, $item );
+ my $due_date = AddIssue($borrower, $item, undef, 0, $issuedate);
+ return $due_date;
+}
+
+sub try_return {
+ my $barcode = shift;
+ my ($ret, $messages, $iteminformation, $borrower) = AddReturn($barcode);
+ return $ret;
+}
return { map { $_->[0] => 1 } @{$codes} };
}
-my $input = new CGI;
+our $input = new CGI;
my $searchfield = $input->param('searchfield');
my $script_name = '/cgi-bin/koha/tools/letter.pl';
-my $branchcode = $input->param('branchcode');
+our $branchcode = $input->param('branchcode');
my $code = $input->param('code');
my $module = $input->param('module');
my $content = $input->param('content');
my $op = $input->param('op') || '';
my $dbh = C4::Context->dbh;
-my ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
+our ( $template, $borrowernumber, $cookie, $staffflags ) = get_template_and_user(
{
template_name => 'tools/letter.tmpl',
query => $input,
}
);
-my $my_branch = C4::Context->preference("IndependantBranches") && !$staffflags->{'superlibrarian'}
+our $my_branch = C4::Context->preference("IndependantBranches") && !$staffflags->{'superlibrarian'}
? C4::Context->userenv()->{'branch'}
: undef;
# we show only the TMPL_VAR names $op