diff --git a/includes/form.inc b/includes/form.inc index 8c89dc8..bb6b2c1 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -182,7 +182,7 @@ function upei_roblib_ill_auth_form($form, &$form_state) { ); $form['LibraryName'] = array( '#type' => 'textfield', - '#title' => t('Name of Institution'), + '#title' => t('Name of Library'), '#size' => 50, '#default_value' => 'Robertson Library', '#required' => TRUE, diff --git a/includes/relais.inc b/includes/relais.inc index f357bb1..6d53aef 100644 --- a/includes/relais.inc +++ b/includes/relais.inc @@ -4,6 +4,16 @@ * Contains the functions to send and receive data to/from Relais. */ +function upei_roblib_ill_get_pub_type($genre) { + switch ($genre) { + case 'book' : + return 'B'; + case 'chapter' : + return 'I'; + default : + return 'J'; + } +} /** * Submit an ILL AddRequest to relais. * @param array $form_state @@ -24,6 +34,7 @@ function upei_roblib_ill_add_request($form_state, $aid) { $relais_arr['RequestInfo'] = $request_info; $relais_arr['PublisherInfo']['PublicationDate'] = isset($form_state['storage']['upei_roblib_ill_request_form']['Date']) ? $form_state['storage']['upei_roblib_ill_request_form']['Date'] : ''; + $relais_arr['PublisherInfo']['PublicationType'] = upei_roblib_ill_get_pub_type($form_state['storage']['upei_roblib_ill_request_form']['Genre']); $relais_json = json_encode($relais_arr); $options = array( 'method' => 'POST',