From 7f33504b029fe7acc31d23f81c645bda20f9941f Mon Sep 17 00:00:00 2001 From: Paul Pound Date: Fri, 17 Apr 2026 10:50:28 -0300 Subject: [PATCH] update the payload to more closely match the sharepoint schema --- includes/sharepoint.inc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/includes/sharepoint.inc b/includes/sharepoint.inc index c45a5be..4f3ac1d 100644 --- a/includes/sharepoint.inc +++ b/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', ];