@@ -, +, @@ adding to patron toolbar Ensuring messages save on every page Fill branch Ensure predefined notes appear Form redirects to where it was submitted from, or just the circulation page. --- circ/add_message.pl | 4 +- .../prog/en/includes/.member-add-message.inc.swp | Bin 0 -> 12288 bytes .../prog/en/includes/member-add-message.inc | 33 +++++++++++++ .../prog/en/includes/members-toolbar.inc | 14 ++++++ .../prog/en/modules/circ/circulation.tt | 51 +++++--------------- members/boraccount.pl | 8 +++ members/files.pl | 8 +++ members/mancredit.pl | 8 +++ members/maninvoice.pl | 8 +++ members/member-flags.pl | 8 +++ members/member-password.pl | 8 +++ members/moremember.pl | 5 ++ members/notices.pl | 8 +++ members/pay.pl | 6 +++ members/paycollect.pl | 5 ++ members/readingrec.pl | 7 +++ members/routing-lists.pl | 4 ++ members/statistics.pl | 8 +++ 18 files changed, 153 insertions(+), 40 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/.member-add-message.inc.swp create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc --- a/circ/add_message.pl +++ a/circ/add_message.pl @@ -51,5 +51,5 @@ Koha::Patron::Message->new( } )->store; -print $input->redirect( - "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"); +my $url = $input->referer() // "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"; +print $input->redirect($url); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/member-add-message.inc @@ -0,0 +1,33 @@ +[% USE Koha %] +[% USE Branches %] +[% USE AuthorisedValues %] + +
+
+ Leave a message +
    +
  1. + + +
  2. + [% IF ( canned_bor_notes_loop ) %] +
  3. + + +
  4. + [% END %] +
  5. + +
  6. +
+ + +
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -170,6 +170,8 @@ function searchToHold(){ Search to hold [% END %] + Add message +
+ + +
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -45,7 +45,6 @@ var relatives_borrowernumbers = new Array(); relatives_borrowernumbers.push("[% b %]"); [% END %] -var MSG_ADD_MESSAGE = _("Add a new message"); var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'circulation', 'issues-table', 'json' ) %] @@ -158,43 +157,6 @@ $(document).ready(function() { [% END %] - - [% IF ( was_renewed ) %]
Patron's account has been renewed until [% expiry | $KohaDates %]
[% END %] [% IF additional_materials %] @@ -855,6 +817,19 @@ No patron matched [% message %] [% END %] [% END %] + Add a new message + + + --- a/members/boraccount.pl +++ a/members/boraccount.pl @@ -33,6 +33,7 @@ use C4::Branch; use C4::Accounts; use C4::Members::Attributes qw(GetBorrowerAttributes); use Koha::Patron::Images; +use C4::Koha; my $input=new CGI; @@ -105,9 +106,16 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { ); } +my $branch = C4::Context->userenv->{'branch'}; + +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param(%$data); $template->param( + canned_bor_notes_loop => $canned_notes, + branch => $branch, finesview => 1, borrowernumber => $borrowernumber, branchname => GetBranchName($data->{'branchcode'}), --- a/members/files.pl +++ a/members/files.pl @@ -28,6 +28,7 @@ use C4::Output; use C4::Members; use C4::Members::Attributes qw(GetBorrowerAttributes); use C4::Debug; +use C4::Koha; use Koha::DateUtils; use Koha::Patron::Files; @@ -119,7 +120,14 @@ else { my $patron_image = Koha::Patron::Images->find($data->{borrowernumber}); $template->param( picture => 1 ) if $patron_image; + my $branch = C4::Context->userenv->{'branch'}; + + # get authorised values with type of BOR_NOTES + my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param( + branch => $branch, + canned_bor_notes_loop => $canned_notes, files => Koha::Patron::Files->new( borrowernumber => $borrowernumber ) ->GetFilesInfo(), --- a/members/mancredit.pl +++ a/members/mancredit.pl @@ -35,6 +35,7 @@ use C4::Accounts; use C4::Items; use C4::Members::Attributes qw(GetBorrowerAttributes); use Koha::Patron::Images; +use C4::Koha; my $input=new CGI; my $flagsrequired = { borrowers => 1, updatecharges => 1 }; @@ -92,9 +93,16 @@ if ($add){ ); } + my $branch = C4::Context->userenv->{'branch'}; + + # get authorised values with type of BOR_NOTES + my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param(%$data); $template->param( + branch => $branch, + canned_bor_notes_loop => $canned_notes, finesview => 1, borrowernumber => $borrowernumber, categoryname => $data->{'description'}, --- a/members/maninvoice.pl +++ a/members/maninvoice.pl @@ -34,6 +34,7 @@ use C4::Items; use C4::Branch; use C4::Members::Attributes qw(GetBorrowerAttributes); use Koha::Patron::Images; +use C4::Koha; my $input=new CGI; my $flagsrequired = { borrowers => 1 }; @@ -118,8 +119,15 @@ if ($add){ ); } + my $branch = C4::Context->userenv->{'branch'}; + + # get authorised values with type of BOR_NOTES + my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param(%$data); $template->param( + canned_bor_notes_loop => $canned_notes, + branch => $branch, finesview => 1, borrowernumber => $borrowernumber, categoryname => $data->{'description'}, --- a/members/member-flags.pl +++ a/members/member-flags.pl @@ -18,6 +18,7 @@ use C4::Members::Attributes qw(GetBorrowerAttributes); use C4::Output; use Koha::Patron::Images; +use C4::Koha; my $input = new CGI; @@ -169,7 +170,14 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { ); } +my $branch = C4::Context->userenv->{'branch'}; + +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param( + branch => $branch, + canned_bor_notes_loop => $canned_notes, borrowernumber => $bor->{'borrowernumber'}, cardnumber => $bor->{'cardnumber'}, surname => $bor->{'surname'}, --- a/members/member-password.pl +++ a/members/member-password.pl @@ -17,6 +17,7 @@ use C4::Circulation; use CGI qw ( -utf8 ); use C4::Members::Attributes qw(GetBorrowerAttributes); use Koha::Patron::Images; +use C4::Koha; use Digest::MD5 qw(md5_base64); @@ -112,7 +113,14 @@ if ( C4::Context->preference('ExtendedPatronAttributes') ) { ); } +my $branch = C4::Context->userenv->{'branch'}; + +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param( + branch => $branch, + canned_bor_notes_loop => $canned_notes, othernames => $bor->{'othernames'}, surname => $bor->{'surname'}, firstname => $bor->{'firstname'}, --- a/members/moremember.pl +++ a/members/moremember.pl @@ -310,9 +310,14 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification")); } +# get authorised values with type of BOR_NOTES + +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + # in template => instutitional (A for Adult, C for children) $template->param( $data->{'categorycode'} => 1 ); $template->param( + canned_bor_notes_loop => $canned_notes, detailview => 1, borrowernumber => $borrowernumber, othernames => $data->{'othernames'}, --- a/members/notices.pl +++ a/members/notices.pl @@ -29,6 +29,7 @@ use C4::Branch; use C4::Letters; use C4::Members::Attributes qw(GetBorrowerAttributes); use Koha::Patron::Images; +use C4::Koha; my $input=new CGI; @@ -73,9 +74,16 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { ); } +my $branch = C4::Context->userenv->{'branch'}; + +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param(%$borrower); $template->param( + canned_bor_notes_loop => $canned_notes, + branch => $branch, QUEUED_MESSAGES => $queued_messages, borrowernumber => $borrowernumber, sentnotices => 1, --- a/members/pay.pl +++ a/members/pay.pl @@ -103,7 +103,13 @@ for (@names) { } } +# get authorised values with type of BOR_NOTES + +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param( + branch => $branch, + canned_bor_notes_loop => $canned_notes, finesview => 1, activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), RoutingSerials => C4::Context->preference('RoutingSerials'), --- a/members/paycollect.pl +++ a/members/paycollect.pl @@ -143,9 +143,14 @@ if ( $total_paid and $total_paid ne '0.00' ) { borrower_add_additional_fields($borrower, $template); +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param(%$borrower); $template->param( + canned_bor_notes_loop => $canned_notes, + branch => $branch, borrowernumber => $borrowernumber, # some templates require global borrower => $borrower, total => $total_due, --- a/members/readingrec.pl +++ a/members/readingrec.pl @@ -33,6 +33,7 @@ use List::MoreUtils qw/any uniq/; use Koha::DateUtils; use C4::Members::Attributes qw(GetBorrowerAttributes); use Koha::Patron::Images; +use C4::Koha; my $input = CGI->new; @@ -119,11 +120,17 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { ); } +my $branch = C4::Context->userenv->{'branch'}; + +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); $template->param(%$data); $template->param( + canned_bor_notes_loop => $canned_notes, readingrecordview => 1, + branch => $branch, borrowernumber => $borrowernumber, privacy => $data->{'privacy'}, categoryname => $data->{description}, --- a/members/routing-lists.pl +++ a/members/routing-lists.pl @@ -29,6 +29,7 @@ use C4::Context; use C4::Serials; use Koha::Patron::Images; use CGI::Session; +use C4::Koha; my $query = new CGI; @@ -101,10 +102,13 @@ if ($borrowernumber) { ################################################################################## +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); $template->param(%$borrower); $template->param( + canned_bor_notes_loop => $canned_notes, findborrower => $findborrower, borrower => $borrower, borrowernumber => $borrowernumber, --- a/members/statistics.pl +++ a/members/statistics.pl @@ -33,6 +33,7 @@ use C4::Members::Statistics; use C4::Members::Attributes qw(GetBorrowerAttributes); use C4::Output; use Koha::Patron::Images; +use C4::Koha; my $input = new CGI; @@ -97,9 +98,16 @@ if (C4::Context->preference('ExtendedPatronAttributes')) { my $patron_image = Koha::Patron::Images->find($borrower->{borrowernumber}); $template->param( picture => 1 ) if $patron_image; +my $branch = C4::Context->userenv->{'branch'}; + +# get authorised values with type of BOR_NOTES +my $canned_notes = GetAuthorisedValues("BOR_NOTES"); + $template->param(%$borrower); $template->param( + canned_bor_notes_loop => $canned_notes, + branch => $branch, statisticsview => 1, datas => $datas, column_names => \@statistic_column_names, --