|
Lines 100-106
BEGIN {
Link Here
|
| 100 |
&GetUpcomingMembershipExpires |
100 |
&GetUpcomingMembershipExpires |
| 101 |
|
101 |
|
| 102 |
&GetMessages |
102 |
&GetMessages |
| 103 |
&GetMessagesCount |
|
|
| 104 |
|
103 |
|
| 105 |
&IssueSlip |
104 |
&IssueSlip |
| 106 |
GetBorrowersWithEmail |
105 |
GetBorrowersWithEmail |
|
Lines 2231-2267
sub GetMessages {
Link Here
|
| 2231 |
|
2230 |
|
| 2232 |
} |
2231 |
} |
| 2233 |
|
2232 |
|
| 2234 |
=head2 GetMessages |
|
|
| 2235 |
|
| 2236 |
GetMessagesCount( $borrowernumber, $type ); |
| 2237 |
|
| 2238 |
$type is message type, B for borrower, or L for Librarian. |
| 2239 |
Empty type returns all messages of any type. |
| 2240 |
|
| 2241 |
Returns the number of messages for the given borrowernumber |
| 2242 |
|
| 2243 |
=cut |
| 2244 |
|
| 2245 |
sub GetMessagesCount { |
| 2246 |
my ( $borrowernumber, $type, $branchcode ) = @_; |
| 2247 |
|
| 2248 |
if ( ! $type ) { |
| 2249 |
$type = '%'; |
| 2250 |
} |
| 2251 |
|
| 2252 |
my $dbh = C4::Context->dbh; |
| 2253 |
|
| 2254 |
my $query = "SELECT COUNT(*) as MsgCount FROM messages WHERE borrowernumber = ? AND message_type LIKE ?"; |
| 2255 |
my $sth = $dbh->prepare($query); |
| 2256 |
$sth->execute( $borrowernumber, $type ) ; |
| 2257 |
my @results; |
| 2258 |
|
| 2259 |
my $data = $sth->fetchrow_hashref; |
| 2260 |
my $count = $data->{'MsgCount'}; |
| 2261 |
|
| 2262 |
return $count; |
| 2263 |
} |
| 2264 |
|
| 2265 |
=head2 IssueSlip |
2233 |
=head2 IssueSlip |
| 2266 |
|
2234 |
|
| 2267 |
IssueSlip($branchcode, $borrowernumber, $quickslip) |
2235 |
IssueSlip($branchcode, $borrowernumber, $quickslip) |