@@ -, +, @@ detail pages - View both the checkout and patron details page for patrons in the staff interface, confirming that the information is displayed in the same way, including: - Pending modifications - Pending expiration - Expired - Address in doubt - Card lost - Restricted (indefinite and with expiration) - Outstanding overdues - Outstanding return claims - Patron age incorrect for their category - Outstanding charges - Account credit - Waiting holds (at logged-in library or other library) - Circulation note (from borrowers.borrowernotes) - Messages (added at logged-in library or other library) --- circ/circulation.pl | 8 +- .../intranet-tmpl/prog/css/src/staff-global.scss | 9 +- .../prog/en/includes/borrower_debarments.inc | 2 +- .../prog/en/includes/patron_messages.inc | 190 +++++++++++++++++++++ .../prog/en/modules/circ/circulation.tt | 170 +----------------- .../prog/en/modules/members/moremember.tt | 117 ++----------- koha-tmpl/intranet-tmpl/prog/img/arrow-bullet.gif | Bin 48 -> 0 bytes members/moremember.pl | 75 +++++++- 8 files changed, 284 insertions(+), 287 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc delete mode 100644 koha-tmpl/intranet-tmpl/prog/img/arrow-bullet.gif --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -468,7 +468,7 @@ if ($patron) { if ( $patron ) { my $noissues; if ( $patron->gonenoaddress ) { - $template->param( gna => 1 ); + $template->param( gonenoaddress => 1 ); $noissues = 1; } if ( $patron->lost ) { @@ -476,7 +476,7 @@ if ( $patron ) { $noissues = 1; } if ( $patron->is_debarred ) { - $template->param( dbarred=> 1 ); + $template->param( is_debarred=> 1 ); $noissues = 1; } my $account = $patron->account; @@ -545,7 +545,7 @@ if ( $patron ) { } } -my $messages = Koha::Patron::Messages->search( +my $patron_messages = Koha::Patron::Messages->search( { 'me.borrowernumber' => $borrowernumber, }, @@ -601,7 +601,7 @@ if ($restoreduedatespec || $stickyduedate) { } $template->param( - messages => $messages, + patron_messages => $patron_messages, borrowernumber => $borrowernumber, branch => $branch, was_renewed => scalar $query->param('was_renewed') ? 1 : 0, --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -1702,18 +1702,15 @@ i { } -.blocker { - color: #990000; -} - +.blocker, .inaccurate-item-statuses { color: #990000; } .circmessage { li { - list-style: url("../img/arrow-bullet.gif"); - margin-bottom: .2em; + list-style: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1IiBoZWlnaHQ9IjUiIHZpZXdCb3g9IjAgMCAyNSAyNSI+PHBhdGggZmlsbD0iIzk5OSIgZD0iTTkuNjYuOTVoNC41Nmw5LjIxIDExLjg1LTkuMjEgMTAuNTNIOS42Nmw1LjA4LTEwLjUzeiIvPjwvc3ZnPg=="); + margin-bottom: .4em; } } --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -23,7 +23,7 @@ [% CASE 'MANUAL' %] Manual [% CASE 'OVERDUES' %] - Overdues + Overdues [% CASE 'SUSPENSION' %] Suspension [% CASE 'DISCHARGE' %] --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -0,0 +1,190 @@ +[% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %] +[% SET return_claims = patron.return_claims %] + +[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || charges || charges_guarantors_guarantees || charges_guarantees || credits ) %] +

Attention

+ + +[% END # /F ( has_modifications || warndeparture... %] + +[% IF WaitingHolds.count %] +
+

Holds waiting

+ [% FOREACH w IN WaitingHolds %] + + [% END %] +
+[% END # /IF WaitingHolds.count %] + +[% IF ( patron.borrowernotes ) %] +
+

Notes

+ +
+[% END # /IF patron.borrowernotes %] + +[% IF ( patron_messages ) %] +
+

Messages

+ + Add a new message +
+[% END # /IF patron_messages %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -721,178 +721,10 @@ [% ELSE %]
-

Attention:

[% END %] - - - [% IF WaitingHolds.count %] -
-

Holds waiting:

- [% FOREACH w IN WaitingHolds %] -
    -
  • - [% w.biblio.title | html %] - ([% ItemTypes.GetDescription( w.item.effective_itemtype ) | html %]), - [% IF ( w.biblio.author ) %] by [% w.biblio.author | html %] [% END %] - [% IF ( w.item.itemcallnumber ) %] [[% w.item.itemcallnumber | html %]] [% END %] - Hold placed on [% w.reservedate | $KohaDates %]. - -
    - [% IF ( w.branch.branchcode == Branches.GetLoggedInBranchcode() ) %][% ELSE %][% END %] - [% SET expires_on = w.expirationdate %] - Waiting at [% w.branch.branchname | html %] [% IF expires_on %] until [% expires_on | $KohaDates %] [% END %] - -
  • -
- [% END %] -
- [% END # /IF WaitingHolds.count %] - - [% IF ( notes ) %] -
-

Notes:

-

[% notesmsg | $raw %]

-
- [% END %] - -
-

Messages:

- - Add a new message -
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -2,6 +2,7 @@ [% USE Asset %] [% USE Koha %] [% USE Branches %] +[% USE ItemTypes %] [% USE KohaDates %] [% USE AuthorisedValues %] [% USE TablesSettings %] @@ -83,119 +84,23 @@
+

+ [% UNLESS ( I ) %] + [% patron.title | html %] [% patron.firstname | html %] + [% END %] + [% patron.surname | html %] ([% patron.cardnumber | html %]) +

+ [% IF ( was_renewed ) %]
Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %]
[% END %] - [% IF fines || age_limitations %] -
-
    - [% IF fines %] - [% INCLUDE 'blocked-fines.inc' %] - [% END %] - [% IF age_limitations %] - [% INCLUDE 'category-out-of-age-limit.inc' %] - [% END %] -
-
- [% END %] - - [% IF ( patron_messages ) %] -
-

Messages:

- - Add a new message -
- [% END %] - - [% IF ( patron.borrowernotes ) %] -
-

Notes:

-
  • - - [% patron.borrowernotes | $raw | html_line_break %] - -
-
- [% END %] - - [% IF ( flagged ) %] -
-
    - [% IF ( patron.is_debarred ) %] -
  • Patron's account is restricted - [% IF ( userdebarreddate ) %] - until [% userdebarreddate | $KohaDates %] - [% END %] - - [% IF ( patron.debarredcomment ) %] - with the explanation: - [% IF patron.debarredcomment.search('OVERDUES_PROCESS') %] - Restriction added by overdues process [% patron.debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %] - [% ELSE %] - [% patron.debarredcomment | html_line_break %] - [% END %] - - [% END %] - View restrictions -
  • - [% END %] - [% IF ( patron.gonenoaddress ) %] -
  • Patron's address is in doubt.
  • - [% END %] - [% IF ( patron.lost ) %] -
  • Patron's card has been reported lost.
  • - [% END %] - [% IF ( patron.is_expired ) %] -
  • - Expiration: - [% IF ( patron.dateexpiry ) %] - Patron's card expired on [% patron.dateexpiry | $KohaDates %]. - [% ELSE %] - Patron's card has expired. - [% END %] - Renew or Edit details -
  • - [% ELSIF ( patron.is_going_to_expire ) %] -
  • - Expiration: Patron's card will expire soon. - Patron's card expires on [% patron.dateexpiry | $KohaDates %] - Renew or Edit details -
  • - [% END %] - -
-
- [% END %] +
+ [% INCLUDE 'patron_messages.inc' %] +
-

- [% UNLESS ( I ) %] - [% patron.title | html %] [% patron.firstname | html %] - [% END %] - [% patron.surname | html %] ([% patron.cardnumber | html %]) -

--- a/members/moremember.pl +++ a/members/moremember.pl @@ -34,11 +34,13 @@ use C4::Auth; use C4::Output; use C4::Form::MessagingPreferences; use List::MoreUtils qw/uniq/; +use Scalar::Util qw( looks_like_number ); use Koha::Patron::Attribute::Types; use Koha::Patron::Debarments qw(GetDebarments); use Koha::Patron::Messages; use Koha::DateUtils; use Koha::CsvProfiles; +use Koha::Holds; use Koha::Patrons; use Koha::Patron::Files; use Koha::Token; @@ -89,12 +91,16 @@ for (qw(gonenoaddress lost borrowernotes is_debarred)) { if ( $patron->is_debarred ) { $template->param( - debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), + 'debarments' => scalar GetDebarments({ borrowernumber => $borrowernumber }), + 'userdebarred' => $patron->debarred, + 'debarredcomment' => $patron->debarredcomment, ); + if ( $patron->debarred ne "9999-12-31" ) { $template->param( 'userdebarreddate' => $patron->debarred ); } } + $template->param( flagged => 1 ) if $patron->account_locked; my @relatives; @@ -196,6 +202,71 @@ if ( $patron->is_expired || $patron->is_going_to_expire ) { ); } +my $holds = Koha::Holds->search( { borrowernumber => $borrowernumber } ); # FIXME must be Koha::Patron->holds +my $waiting_holds = $holds->waiting; +$template->param( + holds_count => $holds->count(), + WaitingHolds => $waiting_holds, +); + +my $no_issues_charge_guarantees = C4::Context->preference("NoIssuesChargeGuarantees"); +$no_issues_charge_guarantees = undef unless looks_like_number( $no_issues_charge_guarantees ); +if ( defined $no_issues_charge_guarantees ) { + my $guarantees_non_issues_charges = 0; + my $guarantees = $patron->guarantee_relationships->guarantees; + while ( my $g = $guarantees->next ) { + $guarantees_non_issues_charges += $g->account->non_issues_charges; + } + if ( $guarantees_non_issues_charges > $no_issues_charge_guarantees ) { + $template->param( + charges_guarantees => 1, + chargesamount_guarantees => $guarantees_non_issues_charges, + ); + } +} + +if ( $patron->has_overdues ) { + $template->param( odues => 1 ); +} +my $issues = $patron->checkouts; + +my $balance = 0; +$balance = $patron->account->balance; + +my $account = $patron->account; +if( ( my $owing = $account->non_issues_charges ) > 0 ) { + my $noissuescharge = C4::Context->preference("noissuescharge") || 5; # FIXME If noissuescharge == 0 then 5, why?? + $template->param( + charges => 1, + chargesamount => $owing, + ) +} elsif ( $balance < 0 ) { + $template->param( + credits => 1, + creditsamount => -$balance, + ); +} + +# if the expiry date is before today ie they have expired +if ( $patron->is_expired ) { + #borrowercard expired, no issues + $template->param( + expired => "1", + ); +} +# check for NotifyBorrowerDeparture +elsif ( $patron->is_going_to_expire ) { + # borrower card soon to expire warn librarian + $template->param( "warndeparture" => $patron->dateexpiry , + ); + if (C4::Context->preference('ReturnBeforeExpiry')){ + $template->param("returnbeforeexpiry" => 1); + } +} + + +my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber => $borrowernumber } )->count; + $template->param( patron => $patron, issuecount => $patron->checkouts->count, @@ -210,6 +281,8 @@ $template->param( relatives_borrowernumbers => \@relatives, logged_in_user => $logged_in_user, files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) ->GetFilesInfo(), + #debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }), + has_modifications => $has_modifications, ); output_html_with_http_headers $input, $cookie, $template->output; --