|
|
|
|
@ -33,7 +33,7 @@ class RoblibIllLoanForm extends FormBase {
|
|
|
|
|
* {@inheritdoc} |
|
|
|
|
*/ |
|
|
|
|
public function validateForm(array &$form, FormStateInterface $form_state) { |
|
|
|
|
module_load_include('inc', 'upei_roblib_ill', 'includes/relais'); |
|
|
|
|
\Drupal::moduleHandler()->loadInclude('upei_roblib_ill', 'inc', 'includes/relais'); |
|
|
|
|
$values = $form_state->getValues(); |
|
|
|
|
if ($form_state->get('step') == 2) { |
|
|
|
|
$is_valid_email = \Drupal::service('email.validator')->isValid($values['DeliveryAddress']); |
|
|
|
|
@ -54,7 +54,7 @@ class RoblibIllLoanForm extends FormBase {
|
|
|
|
|
$form_state->setErrorByName('Surname', $aid['Problem']['Message']); |
|
|
|
|
// Log invalid requests, we need to build the full array here to log it, even though we won't send it yet as auth has failed. |
|
|
|
|
//$form_state->set('upei_roblib_ill_auth_form_storage') = $form_state->getValues(); |
|
|
|
|
module_load_include('inc', 'upei_roblib_ill', 'includes/db'); |
|
|
|
|
\Drupal::moduleHandler()->loadInclude('upei_roblib_ill', 'inc', 'includes/db'); |
|
|
|
|
$arr = upei_roblib_ill_build_relais_arr($form_state); |
|
|
|
|
upei_roblib_ill_log_request($arr, $aid); |
|
|
|
|
} |
|
|
|
|
@ -127,7 +127,7 @@ class RoblibIllLoanForm extends FormBase {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function doiCallback(array &$form, FormStateInterface $form_state) { |
|
|
|
|
module_load_include('inc', 'upei_roblib_ill', 'includes/doi'); |
|
|
|
|
\Drupal::moduleHandler()->loadInclude('upei_roblib_ill', 'inc', 'includes/doi'); |
|
|
|
|
$doi = $form_state->getValue('doi'); |
|
|
|
|
$form = upei_roblib_ill_doi_get_data($form, $doi); |
|
|
|
|
return $form; |
|
|
|
|
@ -145,7 +145,7 @@ class RoblibIllLoanForm extends FormBase {
|
|
|
|
|
* An array representing the bibliographic form. |
|
|
|
|
*/ |
|
|
|
|
function ill_request_form($form, &$form_state) { |
|
|
|
|
module_load_include('inc', 'upei_roblib_ill', 'includes/utilities'); |
|
|
|
|
\Drupal::moduleHandler()->loadInclude('upei_roblib_ill', 'inc', 'includes/utilities'); |
|
|
|
|
$config = \Drupal::config('upei_roblib_ill.settings'); |
|
|
|
|
$form['#prefix'] = '<div id="upei-roblib-ill-request-form">'; |
|
|
|
|
$form['#suffix'] = '<div class="roblib-required">* = Required Field</div></div>'; |
|
|
|
|
@ -359,7 +359,7 @@ class RoblibIllLoanForm extends FormBase {
|
|
|
|
|
* An array representing the bibliographic form. |
|
|
|
|
*/ |
|
|
|
|
function ill_auth_form($form, &$form_state) { |
|
|
|
|
module_load_include('inc', 'upei_roblib_ill', 'includes/utilities'); |
|
|
|
|
\Drupal::moduleHandler()->loadInclude('upei_roblib_ill', 'inc', 'includes/utilities'); |
|
|
|
|
$form['#prefix'] = upei_roblib_format_biblio_info($form_state); |
|
|
|
|
$form['#suffix'] = '<div class="roblib-required">* = Required Field</div> |
|
|
|
|
<div class="roblib-FOIPP"><strong>Protection of Privacy</strong> - The personal information requested |
|
|
|
|
|