spelling, small cleanups

This commit is contained in:
Gilles Crettenand
2015-06-02 23:14:54 +02:00
parent b587047d17
commit 4f865d1186
8 changed files with 36 additions and 38 deletions

View File

@@ -39,8 +39,6 @@ namespace BSR\Lib\db;
* @property string sql_genre
* @property string genreCode
* @property string sql_genreCode
* @property string coverdisplay
* @property string sql_coverdisplay
* @property string link
* @property string sql_link
* @property string linkTitle
@@ -50,7 +48,7 @@ namespace BSR\Lib\db;
*/
class AudioBook extends DbMapping
{
protected $attributeNames = 'id title author code summary editor media collection isbn reader cover category availabilityDate producerCode producer genre genreCode coverdisplay link linkTitle mediaType';
protected $attributeNames = 'id title author code summary editor media collection isbn reader cover category availabilityDate producerCode producer genre genreCode link linkTitle mediaType';
public static function find($id) {
return self::findBy('NoticeID', $id);
@@ -97,7 +95,7 @@ class AudioBook extends DbMapping
LTRIM(RTRIM(GenreCode.TextFre)) As genre,
LTRIM(RTRIM(GenreCode.Code)) AS genreCode,
CASE
WHEN Notices.coverdisplay = 2 THEN 'http://fichiers.bibliothequesonore.ch:8089/netbiblio/images/covers/Cover' + CAST(Notices.NoticeID AS VARCHAR) + '_Original.jpg'
WHEN Notices.CoverDisplay = 2 THEN 'http://fichiers.bibliothequesonore.ch:8089/netbiblio/images/covers/Cover' + CAST(Notices.NoticeID AS VARCHAR) + '_Original.jpg'
ELSE 'http://ecx.images-amazon.com/images/I/' + Fields.[899a] + '._SL320_.jpg'
END AS cover,
Fields.[856u] AS link,
@@ -105,7 +103,7 @@ class AudioBook extends DbMapping
LTRIM(RTRIM(Notices.[MediaType1Code])) AS mediaType
FROM Notices
INNER JOIN Codes As GenreCode ON Notices.MediaType2Code = GenreCode.Code AND GenreCode.Type = 2
INNER JOIN Codes AS ProducerCode ON Notices.userdefined3code = ProducerCode.Code AND ProducerCode.Type=6
INNER JOIN Codes AS ProducerCode ON Notices.UserDefined3code = ProducerCode.Code AND ProducerCode.Type=6
LEFT OUTER JOIN (
SELECT *
FROM (
@@ -142,7 +140,7 @@ class AudioBook extends DbMapping
OUTER APPLY (
SELECT TOP 1 *
FROM Items
WHERE Notices.NoticeID = NoticeId
WHERE Notices.NoticeID = NoticeID
) AS item1
LEFT JOIN Authorities AS isbn ON isbn.AuthorityID = Fields.[020]
WHERE
@@ -216,24 +214,24 @@ class AudioBook extends DbMapping
}
/**
* Retrieve the list of all books currently lended to readers.
* Retrieve the list of all books currently lent to readers.
*/
public static function inReading()
{
$sql = "SELECT
noticenr, title, author, displayName
FROM notices, items, circulations, useraccounts
NoticeNr, title, author, displayName
FROM notices, items, circulations, UserAccounts
WHERE
mediatype1code='N' and NoticeNr not like '%~%'
AND items.noticeid = notices.noticeid
AND items.ItemID=circulations.ItemID
AND useraccounts.useraccountid=circulations.useraccountid
MediaType1code='N' and NoticeNr not like '%~%'
AND items.NoticeID = notices.NoticeID
AND items.ItemID = circulations.ItemID
AND UserAccounts.UserAccountID = circulations.UserAccountID
ORDER BY author, title;";
$results = Connection::execute($sql);
return array_map(function($row) {
return array(
"noticenr" => $row['noticenr'],
"NoticeNr" => $row['NoticeNr'],
"auteur" => $row['author'],
"titre" => $row['title'],
"lecteur" => $row['displayName']