Browse Source

coder fixes after updating coder and intellij

9.x-1.0
Paul Pound 7 years ago
parent
commit
86e46f4dd9
  1. 30
      includes/admin.form.inc
  2. 9
      includes/db.inc
  3. 36
      includes/doi.inc
  4. 271
      includes/form.inc
  5. 49
      includes/relais.inc
  6. 37
      includes/utilities.inc
  7. 106
      upei_roblib_ill.install
  8. 487
      upei_roblib_ill.module

30
includes/admin.form.inc

@ -6,8 +6,8 @@
function upei_roblib_ill_admin_form($form, &$form_state) { function upei_roblib_ill_admin_form($form, &$form_state) {
$form = array(); $form = [];
$form['upei_roblib_ill_add_url'] = array( $form['upei_roblib_ill_add_url'] = [
'#required' => TRUE, '#required' => TRUE,
'#type' => 'textfield', '#type' => 'textfield',
'#size' => 200, '#size' => 200,
@ -15,8 +15,8 @@ function upei_roblib_ill_admin_form($form, &$form_state) {
'#description' => t('The URL for the Relais ILL server AddRequest service, the default is '#description' => t('The URL for the Relais ILL server AddRequest service, the default is
https://caul-cbua.relais-host.com/portal-service/request/add'), https://caul-cbua.relais-host.com/portal-service/request/add'),
'#default_value' => variable_get('upei_roblib_ill_add_url', 'https://caul-cbua.relais-host.com/portal-service/request/add'), '#default_value' => variable_get('upei_roblib_ill_add_url', 'https://caul-cbua.relais-host.com/portal-service/request/add'),
); ];
$form['upei_roblib_ill_auth_url'] = array( $form['upei_roblib_ill_auth_url'] = [
'#required' => TRUE, '#required' => TRUE,
'#type' => 'textfield', '#type' => 'textfield',
'#size' => 200, '#size' => 200,
@ -24,48 +24,48 @@ function upei_roblib_ill_admin_form($form, &$form_state) {
'#description' => t('The URL for the Relais ILL server Auth service (retrieve the aid), the default is '#description' => t('The URL for the Relais ILL server Auth service (retrieve the aid), the default is
https://caul-cbua.relais-host.com/portal-service/user/authentication'), https://caul-cbua.relais-host.com/portal-service/user/authentication'),
'#default_value' => variable_get('upei_roblib_ill_auth_url', 'https://caul-cbua.relais-host.com/portal-service/user/authentication'), '#default_value' => variable_get('upei_roblib_ill_auth_url', 'https://caul-cbua.relais-host.com/portal-service/user/authentication'),
); ];
$form['upei_roblib_ill_library_symbol'] = array( $form['upei_roblib_ill_library_symbol'] = [
'#required' => TRUE, '#required' => TRUE,
'#type' => 'textfield', '#type' => 'textfield',
'#size' => 200, '#size' => 200,
'#title' => t('Your Relais Library Symbol'), '#title' => t('Your Relais Library Symbol'),
'#description' => t('Your Relais Library Symbol'), '#description' => t('Your Relais Library Symbol'),
'#default_value' => variable_get('upei_roblib_ill_library_symbol'), '#default_value' => variable_get('upei_roblib_ill_library_symbol'),
); ];
$form['upei_roblib_ill_relais_key'] = array( $form['upei_roblib_ill_relais_key'] = [
'#required' => TRUE, '#required' => TRUE,
'#type' => 'textfield', '#type' => 'textfield',
'#size' => 200, '#size' => 200,
'#title' => t('The Relais API key'), '#title' => t('The Relais API key'),
'#description' => t('The API key used to communicate with the Relais API, Contact Relais International to get your key'), '#description' => t('The API key used to communicate with the Relais API, Contact Relais International to get your key'),
'#default_value' => variable_get('upei_roblib_ill_relais_key'), '#default_value' => variable_get('upei_roblib_ill_relais_key'),
); ];
$form['upei_roblib_ill_doi_openurl_pid'] = array( $form['upei_roblib_ill_doi_openurl_pid'] = [
'#required' => TRUE, '#required' => TRUE,
'#type' => 'textfield', '#type' => 'textfield',
'#size' => 200, '#size' => 200,
'#title' => t('OpenURL PID'), '#title' => t('OpenURL PID'),
'#description' => t('An identifier to call yourself, for the OpenURL endpoint. To use this service you first need to register for an account here: http://www.crossref.org/requestaccount/'), '#description' => t('An identifier to call yourself, for the OpenURL endpoint. To use this service you first need to register for an account here: http://www.crossref.org/requestaccount/'),
'#default_value' => variable_get('upei_roblib_ill_doi_openurl_pid'), '#default_value' => variable_get('upei_roblib_ill_doi_openurl_pid'),
); ];
$form['upei_roblib_ill_contact_email'] = array( $form['upei_roblib_ill_contact_email'] = [
'#required' => TRUE, '#required' => TRUE,
'#type' => 'textfield', '#type' => 'textfield',
'#size' => 200, '#size' => 200,
'#title' => t('Contact Email'), '#title' => t('Contact Email'),
'#description' => t('The email address we want to show after a user has submitted an ILL request'), '#description' => t('The email address we want to show after a user has submitted an ILL request'),
'#default_value' => variable_get('upei_roblib_ill_contact_email', 'ill@upei.ca'), '#default_value' => variable_get('upei_roblib_ill_contact_email', 'ill@upei.ca'),
); ];
$form['upei_roblib_ill_contact_phone'] = array( $form['upei_roblib_ill_contact_phone'] = [
'#required' => TRUE, '#required' => TRUE,
'#type' => 'textfield', '#type' => 'textfield',
'#size' => 200, '#size' => 200,
'#title' => t('Contact Phone Number'), '#title' => t('Contact Phone Number'),
'#description' => t('The phone number we want to show to the user after a user has submitted an ILL request'), '#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'), '#default_value' => variable_get('upei_roblib_ill_contact_phone', '902-566-0445'),
); ];
return system_settings_form($form); return system_settings_form($form);

9
includes/db.inc

@ -7,6 +7,7 @@
/** /**
* Log an ILL request * Log an ILL request
*
* @param array $request * @param array $request
* The request sent to Relais as an array (before it is encoded as JSON) * The request sent to Relais as an array (before it is encoded as JSON)
* @param array $response * @param array $response
@ -17,7 +18,7 @@ function upei_roblib_ill_log_request($request, $response) {
$relais_message = isset($response['ConfirmMessage']) ? $response['ConfirmMessage'] : $response['Problem']['Message']; $relais_message = isset($response['ConfirmMessage']) ? $response['ConfirmMessage'] : $response['Problem']['Message'];
try { try {
db_insert('upei_roblib_ill_request') db_insert('upei_roblib_ill_request')
->fields(array( ->fields([
'patron_id' => $request['DeliveryAddress']['campus_id'], 'patron_id' => $request['DeliveryAddress']['campus_id'],
'patron_firstname' => $request['DeliveryAddress']['FirstName'], 'patron_firstname' => $request['DeliveryAddress']['FirstName'],
'patron_lastname' => $request['DeliveryAddress']['Surname'], 'patron_lastname' => $request['DeliveryAddress']['Surname'],
@ -40,8 +41,8 @@ function upei_roblib_ill_log_request($request, $response) {
'time_submitted' => strtotime($time_submitted), 'time_submitted' => strtotime($time_submitted),
'relais_request_id' => isset($response['RequestNumber']) ? $response['RequestNumber'] : '-1', 'relais_request_id' => isset($response['RequestNumber']) ? $response['RequestNumber'] : '-1',
'relais_message' => $relais_message, 'relais_message' => $relais_message,
))->execute(); ])->execute();
} catch(Exception $e) { } catch (Exception $e) {
watchdog_exception('upei_roblib_ill', $e, 'Error logging ILL request.', array(), WATCHDOG_ERROR); watchdog_exception('upei_roblib_ill', $e, 'Error logging ILL request.', [], WATCHDOG_ERROR);
} }
} }

36
includes/doi.inc

@ -7,11 +7,14 @@
*/ */
/** /**
* Gets the XML as crossref associated with the supplied DOI. Updates the drupal form with the data. * Gets the XML as crossref associated with the supplied DOI. Updates the
* drupal form with the data.
*
* @param array $form * @param array $form
* The Drupal form * The Drupal form
* @param string $doi * @param string $doi
* The DOI * The DOI
*
* @return array * @return array
* A Drupal form with updated values. * A Drupal form with updated values.
*/ */
@ -39,36 +42,43 @@ function upei_roblib_ill_doi_get_data($form, $doi) {
} }
} }
else { else {
drupal_set_message(t('Error retrieve data using DOI of @doi', array('@doi' => $doi)), 'error'); drupal_set_message(t('Error retrieve data using DOI of @doi', ['@doi' => $doi]), 'error');
return $form; return $form;
} }
} }
/** /**
* A convenience function for retrieving individual nodes from the Crossref XML without throwing notices. * A convenience function for retrieving individual nodes from the Crossref XML
* without throwing notices.
* *
* @param DomDocument $crossref_xml * @param DomDocument $crossref_xml
* The Crossref XML * The Crossref XML
* @param string $node_name * @param string $node_name
* The node we want a value for, we are assuming the xml only has one node with the given name. * The node we want a value for, we are assuming the xml only has one node
* with the given name.
* @param int $index * @param int $index
* If there are more than one element we can ask for the value of each element * If there are more than one element we can ask for the value of each
* element
*
* @return string * @return string
* Returns the value of the element * Returns the value of the element
*/ */
function upei_roblib_ill_get_xml_node($crossref_xml, $node_name, $index = 0) { function upei_roblib_ill_get_xml_node($crossref_xml, $node_name, $index = 0) {
// TODO rewrite this function to use full xpath // TODO rewrite this function to use full xpath
return empty($crossref_xml->getElementsbyTagName($node_name)->item($index)) ? '' : return empty($crossref_xml->getElementsbyTagName($node_name)
->item($index)) ? '' :
$crossref_xml->getElementsbyTagName($node_name)->item($index)->nodeValue; $crossref_xml->getElementsbyTagName($node_name)->item($index)->nodeValue;
} }
/** /**
* Parse the response from Crossref and populate the request form * Parse the response from Crossref and populate the request form
*
* @param DomDocument $crossref_xml * @param DomDocument $crossref_xml
* The crossref xml * The crossref xml
* @param array $form * @param array $form
* Drupal form * Drupal form
*
* @return mixed * @return mixed
* An updated Drupal form * An updated Drupal form
*/ */
@ -80,11 +90,11 @@ function upei_roblib_ill_populate_form_doi($crossref_xml, $form) {
$form['ArticleTitle']['#value'] = upei_roblib_ill_get_xml_node($crossref_xml, 'title'); $form['ArticleTitle']['#value'] = upei_roblib_ill_get_xml_node($crossref_xml, 'title');
if (empty($full_title)) { if (empty($full_title)) {
$form['Genre']['#value'] = 'book'; $form['Genre']['#value'] = 'book';
$form['ArticleTitle']['#value'] = upei_roblib_ill_get_xml_node($crossref_xml, 'title',1); $form['ArticleTitle']['#value'] = upei_roblib_ill_get_xml_node($crossref_xml, 'title', 1);
if(isset($form['ArticleTitle']['#value'])) { if (isset($form['ArticleTitle']['#value'])) {
$form['Genre']['#value'] = 'chapter'; $form['Genre']['#value'] = 'chapter';
} }
$full_title = upei_roblib_ill_get_xml_node($crossref_xml, 'title' , 0); $full_title = upei_roblib_ill_get_xml_node($crossref_xml, 'title', 0);
} }
$form['Title']['#value'] = $full_title; $form['Title']['#value'] = $full_title;
$form['ISSN']['#value'] = upei_roblib_ill_get_xml_node($crossref_xml, 'issn'); $form['ISSN']['#value'] = upei_roblib_ill_get_xml_node($crossref_xml, 'issn');
@ -151,14 +161,14 @@ function upei_roblib_ill_doi_load($doi, $parse = TRUE) {
$id = $parse ? upei_roblib_ill_doi_name_from_url($doi) : $doi; $id = $parse ? upei_roblib_ill_doi_name_from_url($doi) : $doi;
$openurl = variable_get('upei_roblib_ill_doi_openurl', 'http://www.crossref.org/openurl'); $openurl = variable_get('upei_roblib_ill_doi_openurl', 'http://www.crossref.org/openurl');
$openurl_pid = variable_get('upei_roblib_ill_doi_openurl_pid', 'user@example.com'); $openurl_pid = variable_get('upei_roblib_ill_doi_openurl_pid', 'user@example.com');
$url = url($openurl, array( $url = url($openurl, [
'query' => array( 'query' => [
'noredirect' => 'true', 'noredirect' => 'true',
'pid' => $openurl_pid, 'pid' => $openurl_pid,
'format' => 'unixref', 'format' => 'unixref',
'id' => ((strpos($id, 'doi:') === 0) ? $id : 'doi:' . $id), 'id' => ((strpos($id, 'doi:') === 0) ? $id : 'doi:' . $id),
), ],
)); ]);
return drupal_http_request($url); return drupal_http_request($url);
} }

271
includes/form.inc

@ -88,62 +88,65 @@ function upei_roblib_ill_form_submit($form, &$form_state) {
$response = upei_roblib_ill_add_request($form_state, $form_state['storage']['aid']); $response = upei_roblib_ill_add_request($form_state, $form_state['storage']['aid']);
$error = isset($response['RequestNumber']) ? 'FALSE' : 'TRUE'; $error = isset($response['RequestNumber']) ? 'FALSE' : 'TRUE';
$form_state['redirect'] = array( $form_state['redirect'] = [
'/upei/roblib/ill/finished', '/upei/roblib/ill/finished',
array( [
'query' => array( 'query' => [
'message' => $response['ConfirmMessage'], 'message' => $response['ConfirmMessage'],
'email' => $form_state['values']['DeliveryAddress'], 'email' => $form_state['values']['DeliveryAddress'],
'error' => $error, 'error' => $error,
), ],
), ],
); ];
} }
} }
/** /**
* After submitting an ILL request patrons will be redirected to the content returned from this function. * After submitting an ILL request patrons will be redirected to the content
* returned from this function.
*
* @return string * @return string
* a string of HTML to display including the results of the ILL request and some boilerplate text. * a string of HTML to display including the results of the ILL request and
* some boilerplate text.
*/ */
function upei_roblib_ill_form_redirect() { function upei_roblib_ill_form_redirect() {
$contact_email = variable_get('upei_roblib_ill_contact_email', 'ill@upei.ca'); $contact_email = variable_get('upei_roblib_ill_contact_email', 'ill@upei.ca');
$contact_phone_number = variable_get('upei_roblib_ill_contact_phone', '902-566-0445'); $contact_phone_number = variable_get('upei_roblib_ill_contact_phone', '902-566-0445');
$librarian_link = l(t('subject-specific'), 'http://library.upei.ca/librarians', array('html' => TRUE)); $librarian_link = l(t('subject-specific'), 'http://library.upei.ca/librarians', ['html' => TRUE]);
$help_message = t("We can help! Please contact your !librarian_link librarian if you'd like help finding more resources relating to your topic.", $help_message = t("We can help! Please contact your !librarian_link librarian if you'd like help finding more resources relating to your topic.",
array('!librarian_link' => $librarian_link)); ['!librarian_link' => $librarian_link]);
$standard_message = t("To contact the department about this request, you can send a message to @email or $standard_message = t("To contact the department about this request, you can send a message to @email or
call @phone.", array('@phone' => $contact_phone_number, '@email' => $contact_email)); call @phone.", ['@phone' => $contact_phone_number, '@email' => $contact_email]);
if (isset($_GET['error']) && $_GET['error'] === 'FALSE') { if (isset($_GET['error']) && $_GET['error'] === 'FALSE') {
$standard_message = t("A message including the Request ID has been sent to @email. ", array( $standard_message = t("A message including the Request ID has been sent to @email.", [
'@email' => $_GET['email'], '@email' => $_GET['email'],
)) . $standard_message; ]) . $standard_message;
} }
$output = array( $output = [
'#prefix' => '<div upei-roblib-ill-content>', '#prefix' => '<div upei-roblib-ill-content>',
'#suffix' => '</div>', '#suffix' => '</div>',
'dynamic_message' => array( 'dynamic_message' => [
'#type' => 'markup', '#type' => 'markup',
'#markup' => $_GET['message'], '#markup' => $_GET['message'],
'#prefix' => '<div class="upei-roblib-ill-message">', '#prefix' => '<div class="upei-roblib-ill-message">',
'#suffix' => '</div>', '#suffix' => '</div>',
), ],
'standard_message' => array( 'standard_message' => [
'#type' => 'markup', '#type' => 'markup',
'#markup' => $standard_message, '#markup' => $standard_message,
'#prefix' => '<div class="upei-roblib-ill-email">', '#prefix' => '<div class="upei-roblib-ill-email">',
'#suffix' => '</div>', '#suffix' => '</div>',
), ],
'help_message' => array( 'help_message' => [
'#type' => 'markup', '#type' => 'markup',
'#markup' => $help_message, '#markup' => $help_message,
'#allowed_tags' => ['a', 'source'], '#allowed_tags' => ['a', 'source'],
'#prefix' => '<div class="upei-roblib-ill-help">', '#prefix' => '<div class="upei-roblib-ill-help">',
'#suffix' => '</div>', '#suffix' => '</div>',
), ],
); ];
return drupal_render($output); return drupal_render($output);
} }
@ -165,25 +168,25 @@ function upei_roblib_ill_auth_form($form, &$form_state) {
module_load_include('inc', 'upei_roblib_ill', 'includes/utilities'); module_load_include('inc', 'upei_roblib_ill', 'includes/utilities');
$form['#prefix'] = upei_roblib_format_biblio_info($form_state); $form['#prefix'] = upei_roblib_format_biblio_info($form_state);
$form['FirstName'] = array( $form['FirstName'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Your First Name'), '#title' => t('Your First Name'),
'#size' => 50, '#size' => 50,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['Surname'] = array( $form['Surname'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Your Last Name'), '#title' => t('Your Last Name'),
'#size' => 50, '#size' => 50,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['campus_id'] = array( $form['campus_id'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Your Campus ID'), '#title' => t('Your Campus ID'),
'#size' => 50, '#size' => 50,
'#required' => TRUE, '#required' => TRUE,
); ];
$patron_types = array( $patron_types = [
'None' => t('None'), 'None' => t('None'),
'UPEI Faculty/Staff' => t('UPEI Faculty/Staff'), 'UPEI Faculty/Staff' => t('UPEI Faculty/Staff'),
'UPEI Graduate Student' => t('UPEI Graduate Student'), 'UPEI Graduate Student' => t('UPEI Graduate Student'),
@ -192,8 +195,8 @@ function upei_roblib_ill_auth_form($form, &$form_state) {
'UPEI Alumni Premiere member' => t('UPEI Alumni Premiere member'), 'UPEI Alumni Premiere member' => t('UPEI Alumni Premiere member'),
'UPEI Alumni member' => t('UPEI Alumni member'), 'UPEI Alumni member' => t('UPEI Alumni member'),
'Public Borrower' => t('Public Borrower'), 'Public Borrower' => t('Public Borrower'),
); ];
$departments = array( $departments = [
'Applied Human Sciences' => t('Applied Human Sciences'), 'Applied Human Sciences' => t('Applied Human Sciences'),
'AVC - Biomedical Sciences' => t('AVC - Biomedical Sciences'), 'AVC - Biomedical Sciences' => t('AVC - Biomedical Sciences'),
'AVC - Companion Animals' => t('AVC - Companion Animals'), 'AVC - Companion Animals' => t('AVC - Companion Animals'),
@ -227,56 +230,56 @@ function upei_roblib_ill_auth_form($form, &$form_state) {
'Religious Studies' => t('Religious Studies'), 'Religious Studies' => t('Religious Studies'),
'Sociology/Anthropology' => t('Sociology/Anthropology'), 'Sociology/Anthropology' => t('Sociology/Anthropology'),
'Other' => t('Other (Please add to the Notes field)'), 'Other' => t('Other (Please add to the Notes field)'),
); ];
$form['patron_type'] = array( $form['patron_type'] = [
'#type' => 'select', '#type' => 'select',
'#title' => t('Your Patron Type'), '#title' => t('Your Patron Type'),
'#options' => $patron_types, '#options' => $patron_types,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['Department'] = array( $form['Department'] = [
'#type' => 'select', '#type' => 'select',
'#title' => t('Your Department'), '#title' => t('Your Department'),
'#options' => $departments, '#options' => $departments,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['DeliveryAddress'] = array( $form['DeliveryAddress'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Your Email'), '#title' => t('Your Email'),
'#size' => 50, '#size' => 50,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['InstitutionName'] = array( $form['InstitutionName'] = [
'#type' => 'hidden', '#type' => 'hidden',
'#title' => t('Name of Institution'), '#title' => t('Name of Institution'),
'#size' => 50, '#size' => 50,
'#default_value' => 'University of Prince Edward Island', '#default_value' => 'University of Prince Edward Island',
'#required' => TRUE, '#required' => TRUE,
); ];
$form['LibraryName'] = array( $form['LibraryName'] = [
'#type' => 'hidden', '#type' => 'hidden',
'#title' => t('Name of Library'), '#title' => t('Name of Library'),
'#size' => 50, '#size' => 50,
'#default_value' => 'Robertson Library', '#default_value' => 'Robertson Library',
'#required' => TRUE, '#required' => TRUE,
); ];
$form['notes'] = array( $form['notes'] = [
'#type' => 'textarea', '#type' => 'textarea',
'#title' => t('Notes'), '#title' => t('Notes'),
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['certify'] = array( $form['certify'] = [
'#title' => t('I certify'), '#title' => t('I certify'),
'#type' => 'checkbox', '#type' => 'checkbox',
'#description' => 'I hereby certify that this item is being sought for a fair dealing purpose and any copying will be in accordance with the Copyright Act. ', '#description' => 'I hereby certify that this item is being sought for a fair dealing purpose and any copying will be in accordance with the Copyright Act. ',
'#size' => 50, '#size' => 50,
'#required' => TRUE, '#required' => TRUE,
); ];
$form['submit'] = array( $form['submit'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => 'Submit', '#value' => 'Submit',
); ];
return $form; return $form;
@ -299,47 +302,47 @@ function upei_roblib_ill_request_form($form, &$form_state) {
$form['#prefix'] = '<div id="upei-roblib-ill-request-form">'; $form['#prefix'] = '<div id="upei-roblib-ill-request-form">';
$form['#suffix'] = '</div>'; $form['#suffix'] = '</div>';
$genre = empty(upei_roblib_ill_get_request_variable('genre')) ? 'article' : upei_roblib_ill_get_request_variable('genre'); $genre = empty(upei_roblib_ill_get_request_variable('genre')) ? 'article' : upei_roblib_ill_get_request_variable('genre');
$form['Genre'] = array( $form['Genre'] = [
'#type' => 'select', '#type' => 'select',
'#title' => t('Genre'), '#title' => t('Genre'),
'#default_value' => $genre, '#default_value' => $genre,
'#options' => array( '#options' => [
'article' => t('Journal Article'), 'article' => t('Journal Article'),
'book' => t('Book'), 'book' => t('Book'),
'chapter' => t('Book Chapter'), 'chapter' => t('Book Chapter'),
), ],
'#required' => TRUE, '#required' => TRUE,
); ];
$form['doi'] = array( $form['doi'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('DOI'), '#title' => t('DOI'),
'#default_value' => upei_roblib_ill_get_doi_from_request(), '#default_value' => upei_roblib_ill_get_doi_from_request(),
'#description' => 'DOI, if you provide a DOI we will attempt to lookup the record for you', '#description' => 'DOI, if you provide a DOI we will attempt to lookup the record for you',
'#size' => 50, '#size' => 50,
'#states' => array( '#states' => [
'visible' => array( 'visible' => [
':input[name="Genre"]' => array('value' => 'article'), ':input[name="Genre"]' => ['value' => 'article'],
), ],
), ],
'#required' => FALSE, '#required' => FALSE,
); ];
$form['doi_button'] = array( $form['doi_button'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => 'lookup DOI', '#value' => 'lookup DOI',
'#ajax' => array( '#ajax' => [
'callback' => 'upei_roblib_ill_doi_callback', 'callback' => 'upei_roblib_ill_doi_callback',
'method' => 'replace', 'method' => 'replace',
'wrapper' => 'upei-roblib-ill-request-form', 'wrapper' => 'upei-roblib-ill-request-form',
'effect' => 'fade', 'effect' => 'fade',
), ],
'#states' => array( '#states' => [
'visible' => array( 'visible' => [
':input[name="Genre"]' => array('value' => 'article'), ':input[name="Genre"]' => ['value' => 'article'],
), ],
), ],
'#required' => FALSE, '#required' => FALSE,
); ];
$form['Title'] = array( $form['Title'] = [
'#type' => 'textarea', '#type' => 'textarea',
'#rows' => 2, '#rows' => 2,
'#title' => t('Source Title'), '#title' => t('Source Title'),
@ -347,136 +350,136 @@ function upei_roblib_ill_request_form($form, &$form_state) {
'#description' => 'Journal or Book Title (Required)', '#description' => 'Journal or Book Title (Required)',
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['ArticleTitle'] = array( $form['ArticleTitle'] = [
'#type' => 'textarea', '#type' => 'textarea',
'#rows' => 2, '#rows' => 2,
'#title' => t('Title'), '#title' => t('Title'),
'#default_value' => upei_roblib_ill_get_request_variable('atitle'), '#default_value' => upei_roblib_ill_get_request_variable('atitle'),
'#description' => 'Article or Chapter Title', '#description' => 'Article or Chapter Title',
'#size' => 50, '#size' => 50,
'#states' => array( '#states' => [
'invisible' => array( 'invisible' => [
':input[name="Genre"]' => array('value' => 'book'), ':input[name="Genre"]' => ['value' => 'book'],
), ],
), ],
'#required' => FALSE, '#required' => FALSE,
); ];
$form['ISSN'] = array( $form['ISSN'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('ISSN'), '#title' => t('ISSN'),
'#default_value' => upei_roblib_ill_get_request_variable('issn'), '#default_value' => upei_roblib_ill_get_request_variable('issn'),
'#size' => 50, '#size' => 50,
'#states' => array( '#states' => [
'visible' => array( 'visible' => [
':input[name="Genre"]' => array('value' => 'article'), ':input[name="Genre"]' => ['value' => 'article'],
), ],
), ],
'#required' => FALSE, '#required' => FALSE,
); ];
$article_author = ($genre == 'book') ? '' : upei_roblib_ill_get_request_variable('author'); $article_author = ($genre == 'book') ? '' : upei_roblib_ill_get_request_variable('author');
$form['ArticleAuthor'] = array( $form['ArticleAuthor'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Author'), '#title' => t('Author'),
'#default_value' => $article_author, '#default_value' => $article_author,
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
'#description' => 'Article or Chapter Author', '#description' => 'Article or Chapter Author',
'#states' => array( '#states' => [
'invisible' => array( 'invisible' => [
':input[name="Genre"]' => array('value' => 'book'), ':input[name="Genre"]' => ['value' => 'book'],
), ],
), ],
); ];
$author = ($genre == 'book') ? upei_roblib_ill_get_request_variable('author') : ''; $author = ($genre == 'book') ? upei_roblib_ill_get_request_variable('author') : '';
$form['Author'] = array( $form['Author'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Book Author'), '#title' => t('Book Author'),
'#default_value' => $author, '#default_value' => $author,
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
'#states' => array( '#states' => [
'invisible' => array( 'invisible' => [
':input[name="Genre"]' => array('value' => t('article')), ':input[name="Genre"]' => ['value' => t('article')],
), ],
), ],
); ];
$form['ISBN'] = array( $form['ISBN'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('ISBN'), '#title' => t('ISBN'),
'#default_value' => upei_roblib_ill_get_request_variable('isbn'), '#default_value' => upei_roblib_ill_get_request_variable('isbn'),
'#size' => 50, '#size' => 50,
'#states' => array( '#states' => [
'invisible' => array( 'invisible' => [
':input[name="Genre"]' => array('value' => 'article'), ':input[name="Genre"]' => ['value' => 'article'],
), ],
), ],
'#required' => FALSE, '#required' => FALSE,
); ];
$form['SubTitle'] = array( $form['SubTitle'] = [
'#type' => 'hidden', '#type' => 'hidden',
'#title' => t('Sub Title'), '#title' => t('Sub Title'),
'#default_value' => upei_roblib_ill_get_request_variable('ubtitle'), '#default_value' => upei_roblib_ill_get_request_variable('ubtitle'),
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['SeriesTitle'] = array( $form['SeriesTitle'] = [
'#type' => 'hidden', '#type' => 'hidden',
'#title' => t('Series Title'), '#title' => t('Series Title'),
'#default_value' => upei_roblib_ill_get_request_variable('stitle'), '#default_value' => upei_roblib_ill_get_request_variable('stitle'),
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['Volume'] = array( $form['Volume'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Volume'), '#title' => t('Volume'),
'#default_value' => upei_roblib_ill_get_request_variable('volume'), '#default_value' => upei_roblib_ill_get_request_variable('volume'),
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
'#states' => array( '#states' => [
'visible' => array( 'visible' => [
':input[name="Genre"]' => array('value' => 'article'), ':input[name="Genre"]' => ['value' => 'article'],
), ],
), ],
); ];
$form['Issue'] = array( $form['Issue'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Issue'), '#title' => t('Issue'),
'#default_value' => upei_roblib_ill_get_request_variable('issue'), '#default_value' => upei_roblib_ill_get_request_variable('issue'),
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
'#states' => array( '#states' => [
'visible' => array( 'visible' => [
':input[name="Genre"]' => array('value' => 'article'), ':input[name="Genre"]' => ['value' => 'article'],
), ],
), ],
); ];
$form['PagesRequested'] = array( $form['PagesRequested'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Pages'), '#title' => t('Pages'),
'#default_value' => upei_roblib_ill_get_request_variable('pages'), '#default_value' => upei_roblib_ill_get_request_variable('pages'),
'#description' => 'Pages requested (startpage-endpage)', '#description' => 'Pages requested (startpage-endpage)',
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
'#states' => array( '#states' => [
'invisible' => array( 'invisible' => [
':input[name="Genre"]' => array('value' => 'book'), ':input[name="Genre"]' => ['value' => 'book'],
), ],
), ],
); ];
$form['Date'] = array( $form['Date'] = [
'#type' => 'textfield', '#type' => 'textfield',
'#title' => t('Date'), '#title' => t('Date'),
'#default_value' => upei_roblib_ill_get_request_variable('date'), '#default_value' => upei_roblib_ill_get_request_variable('date'),
'#size' => 50, '#size' => 50,
'#required' => FALSE, '#required' => FALSE,
); ];
$form['next'] = array( $form['next'] = [
'#type' => 'submit', '#type' => 'submit',
'#value' => t('Next') '#value' => t('Next'),
); ];
return $form; return $form;
} }

49
includes/relais.inc

@ -22,6 +22,7 @@ function upei_roblib_ill_get_pub_type($genre) {
* A drupal form_state array * A drupal form_state array
* @param string $aid * @param string $aid
* A relais authentication id (token) * A relais authentication id (token)
*
* @return array|mixed * @return array|mixed
*/ */
function upei_roblib_ill_add_request($form_state, $aid) { function upei_roblib_ill_add_request($form_state, $aid) {
@ -30,21 +31,21 @@ function upei_roblib_ill_add_request($form_state, $aid) {
$url = variable_get('upei_roblib_ill_add_url', 'https://caul-cbua.relais-host.com/portal-service/request/add'); $url = variable_get('upei_roblib_ill_add_url', 'https://caul-cbua.relais-host.com/portal-service/request/add');
$relais_arr = upei_roblib_ill_build_relais_arr($form_state); $relais_arr = upei_roblib_ill_build_relais_arr($form_state);
$relais_json = json_encode($relais_arr); $relais_json = json_encode($relais_arr);
$options = array( $options = [
'method' => 'POST', 'method' => 'POST',
'data' => $relais_json, 'data' => $relais_json,
'timeout' => 15, 'timeout' => 15,
'headers' => array('Content-Type' => 'application/json'), 'headers' => ['Content-Type' => 'application/json'],
); ];
if(!isset($aid) || is_array($aid)) { if (!isset($aid) || is_array($aid)) {
upei_roblib_ill_log_request($relais_arr, $aid); upei_roblib_ill_log_request($relais_arr, $aid);
drupal_set_message(t('Error retrieving authentication token, @message', array('@message' => $aid['Problem']['Message'])), 'error'); drupal_set_message(t('Error retrieving authentication token, @message', ['@message' => $aid['Problem']['Message']]), 'error');
return array('ConfirmMessage' => t('There was an error processing your request, @msg', array('@msg' => $aid['Problem']['Message']))); return ['ConfirmMessage' => t('There was an error processing your request, @msg', ['@msg' => $aid['Problem']['Message']])];
} }
$result = drupal_http_request($url . '?aid=' . $aid, $options); $result = drupal_http_request($url . '?aid=' . $aid, $options);
module_load_include('inc', 'upei_roblib_ill', 'includes/db'); module_load_include('inc', 'upei_roblib_ill', 'includes/db');
if(!isset($result->data)) { if (!isset($result->data)) {
return array('ConfirmMessage' => 'Error Communicating with Relais, no data returned.'); return ['ConfirmMessage' => 'Error Communicating with Relais, no data returned.'];
} }
$response_json = $result->data; $response_json = $result->data;
$response_arr = json_decode($response_json, TRUE); $response_arr = json_decode($response_json, TRUE);
@ -55,17 +56,18 @@ function upei_roblib_ill_add_request($form_state, $aid) {
/** /**
* @param $form_state * @param $form_state
*
* @return array * @return array
*/ */
function upei_roblib_ill_build_relais_arr($form_state) { function upei_roblib_ill_build_relais_arr($form_state) {
module_load_include('inc', 'upei_roblib_ill', 'includes/utilities'); module_load_include('inc', 'upei_roblib_ill', 'includes/utilities');
$relais_arr = array( $relais_arr = [
"SupplyingLibrarySymbol" => variable_get('upei_roblib_ill_library_symbol','PCU'), "SupplyingLibrarySymbol" => variable_get('upei_roblib_ill_library_symbol', 'PCU'),
); ];
$pub_type = upei_roblib_ill_get_pub_type($form_state['storage']['upei_roblib_ill_request_form']['Genre']); $pub_type = upei_roblib_ill_get_pub_type($form_state['storage']['upei_roblib_ill_request_form']['Genre']);
$relais_arr['BibliographicInfo'] = upei_roblib_ill_clean_array($form_state['storage']['upei_roblib_ill_request_form']); $relais_arr['BibliographicInfo'] = upei_roblib_ill_clean_array($form_state['storage']['upei_roblib_ill_request_form']);
$relais_arr['DeliveryAddress'] = upei_roblib_ill_clean_array($form_state['storage']['upei_roblib_ill_auth_form']); $relais_arr['DeliveryAddress'] = upei_roblib_ill_clean_array($form_state['storage']['upei_roblib_ill_auth_form']);
if($pub_type != 'B') { if ($pub_type != 'B') {
// this is not a book but is a journal or chapter we will send electronically and as copy // this is not a book but is a journal or chapter we will send electronically and as copy
$relais_arr['ElectronicDelivery']['DeliveryAddress'] = $relais_arr['ElectronicDelivery']['MessagingAddress'] = $relais_arr['ElectronicDelivery']['DeliveryAddress'] = $relais_arr['ElectronicDelivery']['MessagingAddress'] =
$relais_arr['DeliveryAddress']['DeliveryAddress']; $relais_arr['DeliveryAddress']['DeliveryAddress'];
@ -80,27 +82,31 @@ function upei_roblib_ill_build_relais_arr($form_state) {
/** /**
* Request an aid from Relais. * Request an aid from Relais.
*
* @param string $barcode * @param string $barcode
* A patron_id, campus_id or barcode to identify a user * A patron_id, campus_id or barcode to identify a user
*
* @return string/array * @return string/array
* Returns a Relais authentication id (token) or an array containing the Relais response error which should include the error message if authentication fails * Returns a Relais authentication id (token) or an array containing the
* Relais response error which should include the error message if
* authentication fails
*/ */
function upei_roblib_ill_authenticate($barcode, $surname) { function upei_roblib_ill_authenticate($barcode, $surname) {
$url = variable_get('upei_roblib_ill_auth_url', 'https://caul-cbua.relais-host.com/portal-service/user/authentication'); $url = variable_get('upei_roblib_ill_auth_url', 'https://caul-cbua.relais-host.com/portal-service/user/authentication');
$json_arr = array(); $json_arr = [];
$json_arr['ApiKey'] = variable_get('upei_roblib_ill_relais_key'); $json_arr['ApiKey'] = variable_get('upei_roblib_ill_relais_key');
$json_arr['UserGroup'] = 'patron'; $json_arr['UserGroup'] = 'patron';
$json_arr['LibrarySymbol'] = variable_get('upei_roblib_ill_library_symbol'); $json_arr['LibrarySymbol'] = variable_get('upei_roblib_ill_library_symbol');
$json_arr['PatronId'] = $barcode; $json_arr['PatronId'] = $barcode;
$request_json = json_encode($json_arr); $request_json = json_encode($json_arr);
$options = array( $options = [
'method' => 'POST', 'method' => 'POST',
'data' => $request_json, 'data' => $request_json,
'timeout' => 15, 'timeout' => 15,
'headers' => array('Content-Type' => 'application/json'), 'headers' => ['Content-Type' => 'application/json'],
); ];
$result = drupal_http_request($url, $options); $result = drupal_http_request($url, $options);
if($result->code != '200') { if ($result->code != '200') {
$response_data['Problem']['Message'] = $result->error; $response_data['Problem']['Message'] = $result->error;
return $response_data; return $response_data;
} }
@ -124,6 +130,11 @@ function upei_roblib_ill_build_err_msg($msg_from_server) {
return t('Oops. Something went wrong.<br />Check the "Your Last Name" and "Your Campus ID" fields - those two need to match what is on file return t('Oops. Something went wrong.<br />Check the "Your Last Name" and "Your Campus ID" fields - those two need to match what is on file
. (Your !campus_id appears as the NUMBER near the middle of your campus card). If you do not have a !campus_id, please contact the Robertson Library Service Desk, or, . (Your !campus_id appears as the NUMBER near the middle of your campus card). If you do not have a !campus_id, please contact the Robertson Library Service Desk, or,
call !phone. Note: if you are a student taking online courses only, please email !ill_email.<br />@msg_from_server', call !phone. Note: if you are a student taking online courses only, please email !ill_email.<br />@msg_from_server',
array('!campus_id' => $campus_id, '!ill_email' => $ill_email, '!phone' => $phone, '@msg_from_server' => $server_response)); [
'!campus_id' => $campus_id,
'!ill_email' => $ill_email,
'!phone' => $phone,
'@msg_from_server' => $server_response,
]);
} }

37
includes/utilities.inc

@ -11,9 +11,10 @@
* @param $key * @param $key
*/ */
function upei_roblib_ill_check_arr_item(&$value, $key) { function upei_roblib_ill_check_arr_item(&$value, $key) {
if(is_array($value)) { if (is_array($value)) {
array_walk($value, 'upei_roblib_ill_check_arr_item'); array_walk($value, 'upei_roblib_ill_check_arr_item');
} else { }
else {
$value = filter_xss($value); $value = filter_xss($value);
} }
} }
@ -23,6 +24,7 @@ function upei_roblib_ill_check_arr_item(&$value, $key) {
* *
* @param $values * @param $values
* A drupal form_state['values] array * A drupal form_state['values] array
*
* @return array * @return array
* An array where the keys in the array that have empty values are removed and * An array where the keys in the array that have empty values are removed and
* drupal specific elements are removed. * drupal specific elements are removed.
@ -30,10 +32,10 @@ function upei_roblib_ill_check_arr_item(&$value, $key) {
function upei_roblib_ill_clean_array($values) { function upei_roblib_ill_clean_array($values) {
$arr = array_filter($values); $arr = array_filter($values);
if (isset($arr['ISSN'])) { if (isset($arr['ISSN'])) {
$arr['ISSN'] = array($arr['ISSN']); $arr['ISSN'] = [$arr['ISSN']];
} }
if (isset($arr['ISBN'])) { if (isset($arr['ISBN'])) {
$arr['ISBN'] = array($arr['ISBN']); $arr['ISBN'] = [$arr['ISBN']];
} }
// The below checks are due to ebscos habit of sending sending the same info in both atitle and title etc. // The below checks are due to ebscos habit of sending sending the same info in both atitle and title etc.
if (isset($arr['Genre']) && $arr['Genre'] == 'article' && isset($arr['Author'])) { if (isset($arr['Genre']) && $arr['Genre'] == 'article' && isset($arr['Author'])) {
@ -66,10 +68,12 @@ function upei_roblib_ill_clean_array($values) {
} }
/** /**
* Allows us to ask for _REQUEST variables that may or may not exist without generating a php warning. * Allows us to ask for _REQUEST variables that may or may not exist without
* Also does some formatting for certain variables. * generating a php warning. Also does some formatting for certain variables.
*
* @param string $variable * @param string $variable
* The name of the $_REQUEST variable to check * The name of the $_REQUEST variable to check
*
* @return string * @return string
* The value of the $_REQUEST variable or an empty string. * The value of the $_REQUEST variable or an empty string.
*/ */
@ -85,7 +89,7 @@ function upei_roblib_ill_get_request_variable($variable) {
return preg_match('/^\d{4}-?\d{3}[\dxX]$/', $_REQUEST[$variable]) ? $_REQUEST[$variable] : ''; return preg_match('/^\d{4}-?\d{3}[\dxX]$/', $_REQUEST[$variable]) ? $_REQUEST[$variable] : '';
} }
// ebsco sometimes returns bookitem we only understand chapter // ebsco sometimes returns bookitem we only understand chapter
if(($variable == 'genre' && !empty($_REQUEST[$variable])) && $_REQUEST[$variable] == 'bookitem') { if (($variable == 'genre' && !empty($_REQUEST[$variable])) && $_REQUEST[$variable] == 'bookitem') {
return 'chapter'; return 'chapter';
} }
return isset($_REQUEST[$variable]) ? $_REQUEST[$variable] : ''; return isset($_REQUEST[$variable]) ? $_REQUEST[$variable] : '';
@ -96,7 +100,7 @@ function upei_roblib_ill_get_doi_from_request() {
} }
function upei_roblib_ill_get_doi_from_id() { function upei_roblib_ill_get_doi_from_id() {
if(!empty($_REQUEST['ID'])) { if (!empty($_REQUEST['ID'])) {
return (strpos($_REQUEST['ID'], 'doi:') !== 0) ? '' : $_REQUEST['ID']; return (strpos($_REQUEST['ID'], 'doi:') !== 0) ? '' : $_REQUEST['ID'];
} }
return ''; return '';
@ -104,13 +108,15 @@ function upei_roblib_ill_get_doi_from_id() {
/** /**
* Populates the requestInfo portion of a Relais request * Populates the requestInfo portion of a Relais request
*
* @param array $values * @param array $values
* an array containing a 'Genre' element. * an array containing a 'Genre' element.
*
* @return array * @return array
* The requestInfo portion of a Relais request * The requestInfo portion of a Relais request
*/ */
function upei_roblib_ill_request_info_array($values, $notes) { function upei_roblib_ill_request_info_array($values, $notes) {
$requestInfo = array(); $requestInfo = [];
$genre = $values['Genre']; $genre = $values['Genre'];
$requestInfo['DateSubmitted'] = date('Y-m-d H:i:s'); $requestInfo['DateSubmitted'] = date('Y-m-d H:i:s');
$requestInfo['Notes'] = $notes; $requestInfo['Notes'] = $notes;
@ -128,25 +134,28 @@ function upei_roblib_ill_request_info_array($values, $notes) {
} }
/** /**
* Creates a summary Table based on the biblio information in the form_state array for display * Creates a summary Table based on the biblio information in the form_state
* array for display
*
* @param $form_state * @param $form_state
*
* @return string * @return string
*/ */
function upei_roblib_format_biblio_info($form_state) { function upei_roblib_format_biblio_info($form_state) {
$data = upei_roblib_ill_clean_array($form_state['storage']['upei_roblib_ill_request_form']); $data = upei_roblib_ill_clean_array($form_state['storage']['upei_roblib_ill_request_form']);
$rows = array(); $rows = [];
foreach ($data as $key => $value) { foreach ($data as $key => $value) {
if ($key == 'ISSN' || $key == 'ISBN') { if ($key == 'ISSN' || $key == 'ISBN') {
$value = reset($value); $value = reset($value);
} }
array_push($rows, array($key, $value)); array_push($rows, [$key, $value]);
} }
$output = array( $output = [
'#theme' => 'table', '#theme' => 'table',
'#rows' => $rows, '#rows' => $rows,
'#prefix' => '<div class=upei-roblib-ill-biblio-info>', '#prefix' => '<div class=upei-roblib-ill-biblio-info>',
'#suffix' => '</div>', '#suffix' => '</div>',
); ];
$html_output = drupal_render($output); $html_output = drupal_render($output);
return $html_output; return $html_output;
} }

106
upei_roblib_ill.install

@ -9,14 +9,14 @@
* Implements hook_uninstall(). * Implements hook_uninstall().
*/ */
function upei_roblib_ill_uninstall() { function upei_roblib_ill_uninstall() {
$variables = array( $variables = [
'upei_roblib_ill_add_url', 'upei_roblib_ill_add_url',
'upei_roblib_ill_auth_url', 'upei_roblib_ill_auth_url',
'upei_roblib_ill_relais_key', 'upei_roblib_ill_relais_key',
'upei_roblib_ill_library_symbol', 'upei_roblib_ill_library_symbol',
'upei_roblib_ill_contact_email', 'upei_roblib_ill_contact_email',
'upei_roblib_ill_contact_phonel', 'upei_roblib_ill_contact_phonel',
); ];
array_walk($variables, 'variable_del'); array_walk($variables, 'variable_del');
} }
@ -24,149 +24,149 @@ function upei_roblib_ill_uninstall() {
* Implements hook_schema(). * Implements hook_schema().
*/ */
function upei_roblib_ill_schema() { function upei_roblib_ill_schema() {
$schema['upei_roblib_ill_request'] = array( $schema['upei_roblib_ill_request'] = [
'description' => 'Log table for ILL requests', 'description' => 'Log table for ILL requests',
'fields' => array( 'fields' => [
'id' => array( 'id' => [
'description' => 'primary key', 'description' => 'primary key',
'type' => 'serial', 'type' => 'serial',
'size' => 'big', 'size' => 'big',
'not null' => TRUE, 'not null' => TRUE,
), ],
'patron_id' => array( 'patron_id' => [
'description' => 'The id of the user that submitted the request', 'description' => 'The id of the user that submitted the request',
'type' => 'varchar', 'type' => 'varchar',
'length' => '255', 'length' => '255',
'not null' => TRUE, 'not null' => TRUE,
), ],
'patron_email' => array( 'patron_email' => [
'description' => 'The email address of the user that submitted the request', 'description' => 'The email address of the user that submitted the request',
'type' => 'varchar', 'type' => 'varchar',
'length' => '255', 'length' => '255',
'not null' => FALSE, 'not null' => FALSE,
), ],
'patron_lastname' => array( 'patron_lastname' => [
'description' => 'Lastname of the user that submitted the request', 'description' => 'Lastname of the user that submitted the request',
'type' => 'varchar', 'type' => 'varchar',
'length' => '60', 'length' => '60',
'not null' => TRUE, 'not null' => TRUE,
), ],
'patron_firstname' => array( 'patron_firstname' => [
'description' => 'Firstname of the user that submitted the request', 'description' => 'Firstname of the user that submitted the request',
'type' => 'varchar', 'type' => 'varchar',
'length' => '60', 'length' => '60',
'not null' => TRUE, 'not null' => TRUE,
), ],
'patron_department' => array( 'patron_department' => [
'description' => 'The department the user that submitted the request belongs', 'description' => 'The department the user that submitted the request belongs',
'type' => 'varchar', 'type' => 'varchar',
'length' => '128', 'length' => '128',
'not null' => TRUE, 'not null' => TRUE,
), ],
'patron_type' => array( 'patron_type' => [
'description' => 'The type of patron ', 'description' => 'The type of patron ',
'type' => 'varchar', 'type' => 'varchar',
'length' => '128', 'length' => '128',
'not null' => FALSE, 'not null' => FALSE,
), ],
'author' => array( 'author' => [
'description' => 'authors name', 'description' => 'authors name',
'type' => 'varchar', 'type' => 'varchar',
'length' => '128', 'length' => '128',
'not null' => FALSE, 'not null' => FALSE,
), ],
'title' => array( 'title' => [
'description' => 'book or journal title', 'description' => 'book or journal title',
'type' => 'varchar', 'type' => 'varchar',
'length' => '512', 'length' => '512',
'not null' => FALSE, 'not null' => FALSE,
), ],
'atitle' => array( 'atitle' => [
'description' => 'article or chapter title', 'description' => 'article or chapter title',
'type' => 'varchar', 'type' => 'varchar',
'length' => '512', 'length' => '512',
'not null' => FALSE, 'not null' => FALSE,
), ],
'issn' => array( 'issn' => [
'description' => 'Article issn', 'description' => 'Article issn',
'type' => 'varchar', 'type' => 'varchar',
'length' => '18', 'length' => '18',
'not null' => FALSE, 'not null' => FALSE,
), ],
'isbn' => array( 'isbn' => [
'description' => 'book isbn', 'description' => 'book isbn',
'type' => 'varchar', 'type' => 'varchar',
'length' => '8', 'length' => '8',
'not null' => FALSE, 'not null' => FALSE,
), ],
'article_author' => array( 'article_author' => [
'description' => 'Article author', 'description' => 'Article author',
'type' => 'varchar', 'type' => 'varchar',
'length' => '128', 'length' => '128',
'not null' => FALSE, 'not null' => FALSE,
), ],
'citation_date' => array( 'citation_date' => [
'description' => 'Date and time of the request', 'description' => 'Date and time of the request',
'type' => 'varchar', 'type' => 'varchar',
'length' => '30', 'length' => '30',
'not null' => TRUE, 'not null' => TRUE,
), ],
'pages_requested' => array( 'pages_requested' => [
'description' => 'pages requested', 'description' => 'pages requested',
'type' => 'varchar', 'type' => 'varchar',
'length' => '30', 'length' => '30',
'not null' => FALSE, 'not null' => FALSE,
), ],
'volume' => array( 'volume' => [
'description' => 'Volume', 'description' => 'Volume',
'type' => 'varchar', 'type' => 'varchar',
'length' => '30', 'length' => '30',
'not null' => FALSE, 'not null' => FALSE,
), ],
'issue' => array( 'issue' => [
'description' => 'Issue', 'description' => 'Issue',
'type' => 'varchar', 'type' => 'varchar',
'length' => '50', 'length' => '50',
'not null' => FALSE, 'not null' => FALSE,
), ],
'genre' => array( 'genre' => [
'description' => 'type of material requested (article, book, book chapter)', 'description' => 'type of material requested (article, book, book chapter)',
'type' => 'varchar', 'type' => 'varchar',
'length' => '30', 'length' => '30',
'not null' => TRUE, 'not null' => TRUE,
), ],
'doi' => array( 'doi' => [
'description' => 'The DOI', 'description' => 'The DOI',
'type' => 'varchar', 'type' => 'varchar',
'length' => '255', 'length' => '255',
'not null' => FALSE, 'not null' => FALSE,
), ],
'relais_request_id' => array( 'relais_request_id' => [
'description' => 'The request id stored in the Relais datbabase', 'description' => 'The request id stored in the Relais datbabase',
'type' => 'varchar', 'type' => 'varchar',
'length' => '30', 'length' => '30',
'not null' => FALSE, 'not null' => FALSE,
), ],
'relais_message' => array( 'relais_message' => [
'description' => 'If the ILL request failed we will store a reason.', 'description' => 'If the ILL request failed we will store a reason.',
'type' => 'varchar', 'type' => 'varchar',
'length' => '255', 'length' => '255',
'not null' => FALSE, 'not null' => FALSE,
), ],
'time_submitted' => array( 'time_submitted' => [
'description' => 'The time the request was submitted', 'description' => 'The time the request was submitted',
'type' => 'int', 'type' => 'int',
'not null' => FALSE, 'not null' => FALSE,
), ],
'notes' => array( 'notes' => [
'description' => 'Notes', 'description' => 'Notes',
'type' => 'varchar', 'type' => 'varchar',
'length' => '512', 'length' => '512',
'not null' => FALSE, 'not null' => FALSE,
), ],
), ],
'primary key' => array('id'), 'primary key' => ['id'],
); ];
return $schema; return $schema;
} }

487
upei_roblib_ill.module

@ -5,34 +5,34 @@
*/ */
function upei_roblib_ill_menu() { function upei_roblib_ill_menu() {
$items = array(); $items = [];
$items['admin/settings/roblibill'] = array( $items['admin/settings/roblibill'] = [
'title' => 'UPEI Roblib ILL settings', 'title' => 'UPEI Roblib ILL settings',
'description' => 'Conifiguration for the UPEI ILL forms', 'description' => 'Conifiguration for the UPEI ILL forms',
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('upei_roblib_ill_admin_form'), 'page arguments' => ['upei_roblib_ill_admin_form'],
'access arguments' => array('access administration pages'), 'access arguments' => ['access administration pages'],
'file' => 'includes/admin.form.inc', 'file' => 'includes/admin.form.inc',
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
); ];
$items['upei/roblib/ill'] = array( $items['upei/roblib/ill'] = [
'title' => 'UPEI ILL Form', 'title' => 'UPEI ILL Form',
'description' => 'The entry point for the UPEI ILL forms', 'description' => 'The entry point for the UPEI ILL forms',
'page callback' => 'drupal_get_form', 'page callback' => 'drupal_get_form',
'page arguments' => array('upei_roblib_ill_form'), 'page arguments' => ['upei_roblib_ill_form'],
'access arguments' => array('access content'), 'access arguments' => ['access content'],
'file' => 'includes/form.inc', 'file' => 'includes/form.inc',
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
); ];
$items['upei/roblib/ill/finished'] = array( $items['upei/roblib/ill/finished'] = [
'title' => 'UPEI ILL Request', 'title' => 'UPEI ILL Request',
'description' => 'Redirect to this page after form is submitted', 'description' => 'Redirect to this page after form is submitted',
'page callback' => 'upei_roblib_ill_form_redirect', 'page callback' => 'upei_roblib_ill_form_redirect',
'access arguments' => array('access content'), 'access arguments' => ['access content'],
'file' => 'includes/form.inc', 'file' => 'includes/form.inc',
'type' => MENU_NORMAL_ITEM, 'type' => MENU_NORMAL_ITEM,
); ];
return $items; return $items;
} }
@ -41,6 +41,7 @@ function upei_roblib_ill_menu() {
* *
* @param $form * @param $form
* @param $form_state * @param $form_state
*
* @return array * @return array
*/ */
function upei_roblib_ill_doi_callback($form, &$form_state) { function upei_roblib_ill_doi_callback($form, &$form_state) {
@ -53,10 +54,10 @@ function upei_roblib_ill_doi_callback($form, &$form_state) {
* Implements hook_views_api(). * Implements hook_views_api().
*/ */
function upei_roblib_ill_views_api() { function upei_roblib_ill_views_api() {
return array( return [
'api' => 3, 'api' => 3,
'path' => drupal_get_path('module', 'upei_roblib_ill') . '/views', 'path' => drupal_get_path('module', 'upei_roblib_ill') . '/views',
); ];
} }
/** /**
@ -64,402 +65,402 @@ function upei_roblib_ill_views_api() {
*/ */
function upei_roblib_ill_views_data() { function upei_roblib_ill_views_data() {
$data['upei_roblib_ill_request']['table']['group'] = t('UPEI Roblib ILL'); $data['upei_roblib_ill_request']['table']['group'] = t('UPEI Roblib ILL');
$data['upei_roblib_ill_request']['table']['base'] = array( $data['upei_roblib_ill_request']['table']['base'] = [
'field' => 'id', 'field' => 'id',
'title' => t('UPEI Roblib ILL Request'), 'title' => t('UPEI Roblib ILL Request'),
'help' => t('Table for logging ILL Request'), 'help' => t('Table for logging ILL Request'),
'weight' => -10, 'weight' => -10,
); ];
$data['upei_roblib_ill_request']['patron_id'] = array( $data['upei_roblib_ill_request']['patron_id'] = [
'title' => t('Patron or Campus ID'), 'title' => t('Patron or Campus ID'),
'help' => t('Patron or Campus ID.'), 'help' => t('Patron or Campus ID.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['id'] = array( $data['upei_roblib_ill_request']['id'] = [
'title' => t('Unique ID for an ILL request'), 'title' => t('Unique ID for an ILL request'),
'help' => t('Unique ID for an ILL request.'), 'help' => t('Unique ID for an ILL request.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field_numeric', 'handler' => 'views_handler_field_numeric',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_numeric', 'handler' => 'views_handler_filter_numeric',
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
); ];
$data['upei_roblib_ill_request']['patron_email'] = array( $data['upei_roblib_ill_request']['patron_email'] = [
'title' => t('Patron Email Address'), 'title' => t('Patron Email Address'),
'help' => t('Patron Email Address.'), 'help' => t('Patron Email Address.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['patron_lastname'] = array( $data['upei_roblib_ill_request']['patron_lastname'] = [
'title' => t('Patron Lastname'), 'title' => t('Patron Lastname'),
'help' => t('Patron Lastname.'), 'help' => t('Patron Lastname.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['patron_firstname'] = array( $data['upei_roblib_ill_request']['patron_firstname'] = [
'title' => t('Patron Firstame'), 'title' => t('Patron Firstame'),
'help' => t('Patron Firstname.'), 'help' => t('Patron Firstname.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['patron_department'] = array( $data['upei_roblib_ill_request']['patron_department'] = [
'title' => t('Patron Department'), 'title' => t('Patron Department'),
'help' => t('Patron Department.'), 'help' => t('Patron Department.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['patron_type'] = array( $data['upei_roblib_ill_request']['patron_type'] = [
'title' => t('Patron Type'), 'title' => t('Patron Type'),
'help' => t('Patron Type.'), 'help' => t('Patron Type.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['author'] = array( $data['upei_roblib_ill_request']['author'] = [
'title' => t('Authors name'), 'title' => t('Authors name'),
'help' => t('Authors Fullname.'), 'help' => t('Authors Fullname.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['title'] = array( $data['upei_roblib_ill_request']['title'] = [
'title' => t('Book or Journal Title'), 'title' => t('Book or Journal Title'),
'help' => t('Book or Patron Title.'), 'help' => t('Book or Patron Title.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['atitle'] = array( $data['upei_roblib_ill_request']['atitle'] = [
'title' => t('Article or Chapter Title'), 'title' => t('Article or Chapter Title'),
'help' => t('Article or Chapter Title.'), 'help' => t('Article or Chapter Title.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['issn'] = array( $data['upei_roblib_ill_request']['issn'] = [
'title' => t('ISSN'), 'title' => t('ISSN'),
'help' => t('ISSN.'), 'help' => t('ISSN.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['isbn'] = array( $data['upei_roblib_ill_request']['isbn'] = [
'title' => t('ISBN'), 'title' => t('ISBN'),
'help' => t('ISBN.'), 'help' => t('ISBN.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['article_author'] = array( $data['upei_roblib_ill_request']['article_author'] = [
'title' => t('Article or Chapter author'), 'title' => t('Article or Chapter author'),
'help' => t('Article or Chapter author.'), 'help' => t('Article or Chapter author.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['citation_date'] = array( $data['upei_roblib_ill_request']['citation_date'] = [
'title' => t('The date of the article'), 'title' => t('The date of the article'),
'help' => t('Article Date.'), 'help' => t('Article Date.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['pages_requested'] = array( $data['upei_roblib_ill_request']['pages_requested'] = [
'title' => t('The pages requested'), 'title' => t('The pages requested'),
'help' => t('The pages requested.'), 'help' => t('The pages requested.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['volume'] = array( $data['upei_roblib_ill_request']['volume'] = [
'title' => t('Volume'), 'title' => t('Volume'),
'help' => t('Volume.'), 'help' => t('Volume.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['issue'] = array( $data['upei_roblib_ill_request']['issue'] = [
'title' => t('Issue'), 'title' => t('Issue'),
'help' => t('Issue.'), 'help' => t('Issue.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['genre'] = array( $data['upei_roblib_ill_request']['genre'] = [
'title' => t('Article or Chapter author'), 'title' => t('Article or Chapter author'),
'help' => t('Article or Chapter author.'), 'help' => t('Article or Chapter author.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['doi'] = array( $data['upei_roblib_ill_request']['doi'] = [
'title' => t('DOI'), 'title' => t('DOI'),
'help' => t('DOI.'), 'help' => t('DOI.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['relais_request_id'] = array( $data['upei_roblib_ill_request']['relais_request_id'] = [
'title' => t('The Relais request id'), 'title' => t('The Relais request id'),
'help' => t('The Relais request id.'), 'help' => t('The Relais request id.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['relais_message'] = array( $data['upei_roblib_ill_request']['relais_message'] = [
'title' => t('The reason a request failed. '), 'title' => t('The reason a request failed.'),
'help' => t('The reason a request failed.'), 'help' => t('The reason a request failed.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['notes'] = array( $data['upei_roblib_ill_request']['notes'] = [
'title' => t('The notes related to this request'), 'title' => t('The notes related to this request'),
'help' => t('The notes related to this request.'), 'help' => t('The notes related to this request.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field', 'handler' => 'views_handler_field',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort', 'handler' => 'views_handler_sort',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_string', 'handler' => 'views_handler_filter_string',
), ],
'argument' => array( 'argument' => [
'handler' => 'views_handler_argument_string', 'handler' => 'views_handler_argument_string',
), ],
); ];
$data['upei_roblib_ill_request']['time_submitted'] = array( $data['upei_roblib_ill_request']['time_submitted'] = [
'title' => t('The Date and Time a request was submitted'), 'title' => t('The Date and Time a request was submitted'),
'help' => t('The Date and Time a request was submitted.'), 'help' => t('The Date and Time a request was submitted.'),
'field' => array( 'field' => [
'handler' => 'views_handler_field_date', 'handler' => 'views_handler_field_date',
'click sortable' => TRUE, 'click sortable' => TRUE,
), ],
'sort' => array( 'sort' => [
'handler' => 'views_handler_sort_date', 'handler' => 'views_handler_sort_date',
), ],
'filter' => array( 'filter' => [
'handler' => 'views_handler_filter_date', 'handler' => 'views_handler_filter_date',
), ],
); ];
return $data; return $data;
} }

Loading…
Cancel
Save