|
|
|
|
@ -76,7 +76,7 @@ class User extends DbMapping
|
|
|
|
|
REPLACE(UserAccountNr, ' ', '') AS login
|
|
|
|
|
FROM [UserAccounts] AS u
|
|
|
|
|
LEFT JOIN [Addresses] AS a ON a.[AddressID] = u.[ActualAddressID]
|
|
|
|
|
WHERE REPLACE(UserAccountNr, ' ', '') = '%s' AND disabled = 1 %s;",
|
|
|
|
|
WHERE LTRIM(RTRIM(UserAccountNr)) = '%s' AND disabled = 1 %s;",
|
|
|
|
|
$login, $cond);
|
|
|
|
|
|
|
|
|
|
$results = Connection::execute($sql, $raiseError);
|
|
|
|
|
@ -98,11 +98,14 @@ class User extends DbMapping
|
|
|
|
|
|
|
|
|
|
$circulations = $result->to_array();
|
|
|
|
|
$ids = array_map(function($c) { return $c['NoticeID']; }, $circulations);
|
|
|
|
|
$books = BookSearch::GetBooks($ids, 'id');
|
|
|
|
|
$books = count($ids) > 0 ? BookSearch::GetBooks($ids, 'id') : array();
|
|
|
|
|
|
|
|
|
|
foreach($circulations as $c) {
|
|
|
|
|
$books[$c['NoticeID']]['date'] = $c['CheckOutDate'];
|
|
|
|
|
$books[$c['NoticeID']]['itemNr'] = $c['ItemNr'];
|
|
|
|
|
$id = $c['NoticeID'];
|
|
|
|
|
if(isset($books[$id])) {
|
|
|
|
|
$books[$id]['date'] = $c['CheckOutDate'];
|
|
|
|
|
$books[$id]['itemNr'] = $c['ItemNr'];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return $books;
|
|
|
|
|
@ -145,8 +148,8 @@ class User extends DbMapping
|
|
|
|
|
WHERE LTRIM(RTRIM(NoticeNr)) = '%s';",
|
|
|
|
|
$row['WishID'], $this->id, $employee_id, $library_id, $noticeNr);
|
|
|
|
|
|
|
|
|
|
Connection::execute($sql);
|
|
|
|
|
return true;
|
|
|
|
|
$status = Connection::execute($sql);
|
|
|
|
|
return $status && ! $status->is_error() && $status->get_num_rows() > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -176,7 +179,7 @@ class User extends DbMapping
|
|
|
|
|
{
|
|
|
|
|
$sql = sprintf("SELECT TOP $limit
|
|
|
|
|
NoticeID
|
|
|
|
|
FROM Wished
|
|
|
|
|
FROM Wishes
|
|
|
|
|
WHERE UserAccountID = %s
|
|
|
|
|
ORDER BY CreationDate DESC", $this->id);
|
|
|
|
|
|
|
|
|
|
@ -188,6 +191,7 @@ class User extends DbMapping
|
|
|
|
|
/**
|
|
|
|
|
* Remove a book from the wish list
|
|
|
|
|
* @param string $noticeNr
|
|
|
|
|
* @return boolean Was the deletion was successful or not ?
|
|
|
|
|
*/
|
|
|
|
|
public function deleteWish($noticeNr)
|
|
|
|
|
{
|
|
|
|
|
@ -197,6 +201,7 @@ class User extends DbMapping
|
|
|
|
|
WHERE
|
|
|
|
|
LTRIM(RTRIM(n.NoticeNr)) = '%s'
|
|
|
|
|
AND UserAccountID = %s;", $noticeNr, $this->id);
|
|
|
|
|
Connection::execute($sql, true);
|
|
|
|
|
$status = Connection::execute($sql, true);
|
|
|
|
|
return $status && ! $status->is_error() && $status->get_num_rows() > 0;
|
|
|
|
|
}
|
|
|
|
|
}
|