diff --git a/VERSIONS_WIP/50472 b/VERSIONS_WIP/50472 new file mode 100644 index 0000000000000000000000000000000000000000..19243a030a48a125f16daf21f53e6a4122118209 --- /dev/null +++ b/VERSIONS_WIP/50472 @@ -0,0 +1 @@ +- ticket #50472 : suggestions d'achat Koha/Nanook : ajout d'un sélecteur pour le type de document \ No newline at end of file diff --git a/library/Class/WebService/SIGB/Koha/RestfulService.php b/library/Class/WebService/SIGB/Koha/RestfulService.php index 9c7c68ac8016180e6ccad0912a1ea86625635952..476d9a0c52466fb62bf155ae5c86c5ebf6775e59 100644 --- a/library/Class/WebService/SIGB/Koha/RestfulService.php +++ b/library/Class/WebService/SIGB/Koha/RestfulService.php @@ -100,10 +100,13 @@ class Class_WebService_SIGB_Koha_RestfulService public function suggest($suggestion) { - $doctype_label = Class_TypeDoc::find($suggestion->getDocType())->getLibelle(); + $doc_type = Class_TypeDoc::find($suggestion->getDocType()); + $doctype_label = $doc_type + ? ' [' . $doc_type->getLibelle() . ']' + : ''; $datas = ['suggestedby' => $suggestion->getUser()->getIdSigb(), - 'title' => $suggestion->getTitle() . ' [' . $doctype_label . ']', + 'title' => $suggestion->getTitle() . $doctype_label, 'author' => $suggestion->getAuthor(), 'isbn' => $suggestion->getIsbn(), 'note' => $suggestion->getNote(),