Skip to content

Commit

Permalink
Bug 8007: Discharge - Glue
Browse files Browse the repository at this point in the history
This patch adds:
- links to the new pages.
- syspref description
- links on the main page (intranet)
- the DISCHARGE type for debarment

Signed-off-by: Lucie <[email protected]>

Signed-off-by: Kyle M Hall <[email protected]>
Signed-off-by: Tomas Cohen Arazi <[email protected]>
  • Loading branch information
dufour-yohann authored and tomascohen committed Apr 30, 2015
1 parent 58845be commit 45975f4
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 2 deletions.
2 changes: 2 additions & 0 deletions C4/Auth.pm
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ sub get_template_and_user {
EnableBorrowerFiles => C4::Context->preference('EnableBorrowerFiles'),
UseKohaPlugins => C4::Context->preference('UseKohaPlugins'),
UseCourseReserves => C4::Context->preference("UseCourseReserves"),
useDischarge => C4::Context->preference('useDischarge'),
);
}
else {
Expand Down Expand Up @@ -532,6 +533,7 @@ sub get_template_and_user {
OPACLocalCoverImages => C4::Context->preference("OPACLocalCoverImages"),
PatronSelfRegistration => C4::Context->preference("PatronSelfRegistration"),
PatronSelfRegistrationDefaultCategory => C4::Context->preference("PatronSelfRegistrationDefaultCategory"),
useDischarge => C4::Context->preference('useDischarge'),
);

$template->param( OpacPublic => '1' ) if ( $user || C4::Context->preference("OpacPublic") );
Expand Down
2 changes: 1 addition & 1 deletion Koha/Borrower/Debarments.pm
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ sub DelDebarment {
my $success = ModDebarment({
borrower_debarment_id => $borrower_debarment_id,
expiration => $expiration,
type => $type, ## enum('FINES','OVERDUES','MANUAL')
type => $type, ## enum('FINES','OVERDUES','MANUAL','DISCHARGE')
comment => $comment,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
Overdues
[% CASE 'SUSPENSION' %]
Suspension
[% CASE 'DISCHARGE' %]
Discharge
[% END %]
</td>
<td>[% d.comment %]</td>
Expand Down
3 changes: 3 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@
[% IF ( CAN_user_borrowers ) %]
[% IF ( suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% borrowernumber %]">Purchase suggestions</a></li>
[% END %]
[% IF CAN_user_borrowers && useDischarge %]
[% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
[% END %]
</ul></div>
[% END %]

3 changes: 3 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.tt
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ in the global namespace %]
[% IF ( CAN_user_borrowers ) %]
[% IF ( suggestionsview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/purchase-suggestions.pl?borrowernumber=[% borrower.borrowernumber %]">Purchase<br/>suggestions</a></li>
[% END %]
[% IF CAN_user_borrowers && useDischarge %]
[% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
[% END %]
</ul></div>
[% END %]

3 changes: 3 additions & 0 deletions koha-tmpl/intranet-tmpl/prog/en/includes/members-menu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
[% IF EnableBorrowerFiles %]
[% IF ( borrower_files ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/files.pl?borrowernumber=[% borrowernumber %]">Files</a></li>
[% END %]
[% IF CAN_user_borrowers && useDischarge %]
[% IF dischargeview %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/discharge.pl?borrowernumber=[% borrowernumber %]">Discharge</a></li>
[% END %]
</ul>
</div>
[% END %]
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ Patrons:
- pref: CardnumberLength
- "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')."
- "If 'cardnumber' is included in the BorrowerMandatoryField list, the minimum length, if not specified here, defaults to one."
-
- pref: useDischarge
choices:
yes: Allows
no: "Don't allow"
- librarians to discharge borrowers and borrowers to request a discharge.
"Norwegian patron database":
-
- pref: NorwegianPatronDBEnable
Expand Down
11 changes: 10 additions & 1 deletion koha-tmpl/intranet-tmpl/prog/en/modules/intranet-main.tt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@
[% IF ( ( CAN_user_tools_moderate_comments && pendingcomments )
|| ( CAN_user_tools_moderate_tags && pendingtags )
|| ( CAN_user_borrowers && pending_borrower_modifications )
|| ( CAN_user_acquisition && pendingsuggestions ) ) %]
|| ( CAN_user_acquisition && pendingsuggestions )
|| ( CAN_user_borrowers && pending_discharge_requests )
) %]
<div id="area-pending">
[% IF ( CAN_user_acquisition && pendingsuggestions ) %]
<div class="pending-info" id="suggestions_pending">
Expand Down Expand Up @@ -143,6 +145,13 @@
</div>
[% END %]

[% IF CAN_user_borrowers && pending_discharge_requests %]
<div class="pending-info" id="patron_discharges_pending">
<a href="/cgi-bin/koha/members/discharges.pl">Discharge requests pending</a>:
<span class="pending-number-link">[% pending_discharge_requests %]</span>
</div>
[% END %]

</div>

[% END %]
Expand Down
9 changes: 9 additions & 0 deletions koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,15 @@
[% END %]
<a href="/cgi-bin/koha/opac-shelves.pl?display=privateshelves">your lists</a></li>
[% END %]

[% IF Koha.Preference( 'useDischarge' ) == 1 %]
[% IF ( dischargeview ) %]
<li class="active">
[% ELSE %]
<li>
[% END %]
<a href="/cgi-bin/koha/opac-discharge.pl">ask for a discharge</a></li>
[% END %]
</ul>
</div>
[% END %]
3 changes: 3 additions & 0 deletions mainpage.pl
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
use C4::Suggestions qw/CountSuggestion/;
use C4::Tags qw/get_count_by_tag_status/;
use Koha::Borrower::Modifications;
use Koha::Borrower::Discharge;

my $query = new CGI;

Expand Down Expand Up @@ -65,12 +66,14 @@
my $pendingsuggestions = CountSuggestion("ASKED");
my $pending_borrower_modifications =
Koha::Borrower::Modifications->GetPendingModificationsCount( $branch );
my $pending_discharge_requests = Koha::Borrower::Discharge::count({ pending => 1 });

$template->param(
pendingcomments => $pendingcomments,
pendingtags => $pendingtags,
pendingsuggestions => $pendingsuggestions,
pending_borrower_modifications => $pending_borrower_modifications,
pending_discharge_requests => $pending_discharge_requests,
);

#
Expand Down

0 comments on commit 45975f4

Please sign in to comment.