From 5bb37c50aba30fff6ac6121fd88d73690fe3558a Mon Sep 17 00:00:00 2001 From: ppound Date: Fri, 22 Jan 2021 13:31:51 -0400 Subject: [PATCH] made the ILL header/warning message a config textarea --- includes/admin.form.inc | 7 +++++++ includes/form.inc | 9 +++++++-- upei_roblib_ill.install | 1 + 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/includes/admin.form.inc b/includes/admin.form.inc index 00dd56c..e8fc9c0 100644 --- a/includes/admin.form.inc +++ b/includes/admin.form.inc @@ -66,6 +66,13 @@ function upei_roblib_ill_admin_form($form, &$form_state) { '#description' => t('The phone number we want to show to the user after a user has submitted an ILL request'), '#default_value' => variable_get('upei_roblib_ill_contact_phone', '902-566-0445'), ]; + $form['upei_roblib_ill_header_message'] = [ + '#required' => TRUE, + '#type' => 'textarea', + '#title' => t('ILL Header Message'), + '#description' => t('The message that appears at the top of the ILL form, recently used for Covid messages. Leave this blank for no message to appear at the top of the form.'), + '#default_value' => variable_get('upei_roblib_ill_header_message', ''), + ]; return system_settings_form($form); diff --git a/includes/form.inc b/includes/form.inc index a4d1165..6bba836 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -331,8 +331,13 @@ Freedom of Information and Protection of Privacy Act and will be protected */ function upei_roblib_ill_request_form($form, &$form_state) { module_load_include('inc', 'upei_roblib_ill', 'includes/utilities'); - $emergency_message = '
- Due to the current Covid-19 restrictions, many libraries across the country are unable to provide print books or other "returnables." UPEI patrons and other libraries are able to submit requests and we will do our best to locate/provide a print copy, however, there may be delays with staff having limited access to their campuses and the need for books to be quarantined upon arrival. Note that ebooks cannot be "borrowed" through ILL -- not just now but at any time -- due to publisher restrictions. Libraries must purchase ebooks in order to access them. We are able to provide ebook chapters, e-journal articles, etc. Scan on Demand (Scanning from our books or print journals) also resumed as of May 25. Simply choose the appropriate form (Book Chapter or Journal Article) from the drop-down menu associated with "Item Type". The process for retrieving requested journal articles or book chapters has changed as of December 15, 2020.
'; + $header_message = variable_get('upei_roblib_ill_header_message', ''); + $emergency_message = ''; + if(!empty($header_message)) { + $emergency_message = '
'; + $emergency_message .= $header_message; + $emergency_message .= '
'; + } $form['#prefix'] = $emergency_message . '
'; $form['#suffix'] = '
* = Required Field
'; $type = upei_roblib_ill_get_request_variable('genre'); diff --git a/upei_roblib_ill.install b/upei_roblib_ill.install index e9a9899..d270ca9 100644 --- a/upei_roblib_ill.install +++ b/upei_roblib_ill.install @@ -16,6 +16,7 @@ function upei_roblib_ill_uninstall() { 'upei_roblib_ill_library_symbol', 'upei_roblib_ill_contact_email', 'upei_roblib_ill_contact_phonel', + 'upei_roblib_ill_header_message', ]; array_walk($variables, 'variable_del'); }