Browse Source

check for doi in ID variable or doi variable

9.x-1.0
Paul Pound 8 years ago
parent
commit
c4399ffc24
  1. 2
      includes/form.inc
  2. 11
      includes/utilities.inc

2
includes/form.inc

@ -313,7 +313,7 @@ function upei_roblib_ill_request_form($form, &$form_state) {
$form['doi'] = array(
'#type' => 'textfield',
'#title' => t('DOI'),
'#default_value' => upei_roblib_ill_get_request_variable('doi'),
'#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',
'#size' => 50,
'#states' => array(

11
includes/utilities.inc

@ -91,6 +91,17 @@ function upei_roblib_ill_get_request_variable($variable) {
return isset($_REQUEST[$variable]) ? $_REQUEST[$variable] : '';
}
function upei_roblib_ill_get_doi_from_request() {
return (!empty($_REQUEST['doi'])) ? $_REQUEST['doi'] : upei_roblib_ill_get_doi_from_id();
}
function upei_roblib_ill_get_doi_from_id() {
if(!empty($_REQUEST['ID'])) {
return (strpos($_REQUEST['ID'], 'doi:') !== 0) ? '' : $_REQUEST['ID'];
}
return '';
}
/**
* Populates the requestInfo portion of a Relais request
* @param array $values

Loading…
Cancel
Save