Browse Source

update the payload to more closely match the sharepoint schema

9.x-3.0
Paul Pound 1 month ago
parent
commit
7f33504b02
  1. 19
      includes/sharepoint.inc

19
includes/sharepoint.inc

@ -86,15 +86,9 @@ class SharePointRequestHandler
// Build notes — pack all extra info that doesn't have its own schema field.
$notes_parts = [];
if (!empty($genre)) {
$notes_parts[] = 'Format: ' . $genre;
}
if (!empty($biblio['ArticleTitle'])) {
$notes_parts[] = 'Article/Chapter: ' . $biblio['ArticleTitle'];
}
if (!empty($biblio['Date'])) {
$notes_parts[] = 'Year: ' . $biblio['Date'];
}
if (!empty($biblio['Volume'])) {
$notes_parts[] = 'Vol: ' . $biblio['Volume'];
}
@ -107,9 +101,6 @@ class SharePointRequestHandler
if (!empty($patron['patron_type'])) {
$notes_parts[] = 'Patron Type: ' . $patron['patron_type'];
}
if (!empty($patron['campus_id'])) {
$notes_parts[] = 'Campus ID: ' . $patron['campus_id'];
}
if (!empty($patron['Department'])) {
$notes_parts[] = 'Dept: ' . $patron['Department'];
}
@ -122,12 +113,12 @@ class SharePointRequestHandler
return [
'title' => (string)($biblio['Title'] ?? ''),
'author' => (string)$author,
'year' => (string)($biblio['Date'] ?? ''),
'doi_isbn' => (string)$doi_isbn,
'callNumber' => (string)($patron['campus_id'] ?? ''),
'year' => '2023',
'instName' => (string)$patron_name,
'instEmail' => (string)($patron['DeliveryAddress'] ?? ''),
'shippingAddr' => (string)($patron['Department'] ?? ''),
'format' => (string)$genre,
'patronName' => (string)$patron_name,
'patronEmail' => (string)($patron['DeliveryAddress'] ?? ''),
'patronBarcode' => (string)($patron['campus_id'] ?? ''),
'notes' => (string)implode(' | ', $notes_parts),
'submittedAt' => (string)gmdate('Y-m-d\TH:i:s') . '.000Z',
];

Loading…
Cancel
Save