C4::Form::MessagingPreferences - manage messaging preferences form
In script:
use C4::Form::MessagingPreferences; C4::Form::MessagingPreferences::set_form_value({ borrowernumber => 51 }, $template); C4::Form::MessagingPreferences::handle_form_action($input, { categorycode => 'CPL' }, $template);
In HTML template:
<!-- TMPL_INCLUDE NAME="messaging-preference-form.inc" -->
This module manages input and output for the messaging preferences form that is used in the staff patron editor, the staff patron category editor, and the OPAC patron messaging prefereneces form. It in its current form, it essentially serves only to eliminate copy-and-paste code, but suggests at least one approach for reconciling functionality that does mostly the same thing in staff and OPAC.
C4::Form::MessagingPreferences::handle_form_action($input, { categorycode => 'CPL' }, $template, $insert);
Processes CGI parameters and updates the target patron or patron category's preferences.
$input
is the CGI query object.
$target_params
is a hashref containing either a categorycode
key or a borrowernumber
key identifying the patron or patron category whose messaging preferences are to be updated.
$template
is the Template::Toolkit object for the response; this routine adds a settings_updated template variable.
C4::Form::MessagingPreferences::set_form_value({ borrowernumber => 51 }, $template);
Retrieves the messaging preferences for the specified patron or patron category and fills the corresponding template variables.
$target_params
is a hashref containing either a categorycode
key or a borrowernumber
key identifying the patron or patron category.
$template
is the Template::Toolkit object for the response.
C4::Members::Messaging, admin/categories.pl, opac/opac-messaging.pl, members/messaging.pl
Koha Development Team <http://koha-community.org/>
Galen Charlton <galen.charlton@liblime.com> refactoring code by Andrew Moore.