Conversation
| function _fbs_set_holdings($res) { | ||
| $holdings = array(); | ||
| $reservation_count = 0; | ||
| $reservation_count += (int) $res['reservation_count']; |
There was a problem hiding this comment.
$reservation_count = 0;
$reservation_count += (int) $res['reservation_count'];
to
$reservation_count = (int) $res['reservation_count'];
| $reservation_count += (int) $res['reservation_count']; | ||
| foreach ($res['holdings'] as $holding) { | ||
| $holdings[] = $holding; | ||
| } |
There was a problem hiding this comment.
why is this needed? just use $res['holdings']
| /** | ||
| * Getting holdings for preprocessing. | ||
| */ | ||
| function _fbs_get_holdings($res, $is_periodical = FALSE) { |
There was a problem hiding this comment.
Describe params and result in phpdoc
|
|
||
| /** | ||
| * Set holdings for all kinds of material except periodicals. | ||
| */ |
There was a problem hiding this comment.
Describe params and result in phpdoc
|
|
||
| /** | ||
| * Set holdings if material is periodical only. | ||
| */ |
There was a problem hiding this comment.
Describe params and result in phpdoc
| /** | ||
| * If the same placement exists several times collect them in one line. | ||
| */ | ||
| function _clean_up_rows($_rows) { |
There was a problem hiding this comment.
Describe params and result in phpdoc
| $row['data']['Copies'] = array('data' => $r_count, 'colspan' => 4); | ||
| $variables['rows'][] = $row; | ||
|
|
||
| return theme_table($variables); |
There was a problem hiding this comment.
pleae use theme('table', options)
| */ | ||
| function _sum_placement($placementsarr) { | ||
| $row = $placementsarr[0]; | ||
| for ($i = 1; $i < count($placementsarr); $i++) { |
There was a problem hiding this comment.
why not foreach statement?
There was a problem hiding this comment.
IMHO "for" statement is more suitable for this increment operation.
| function _get_placements_with_key($_rows, $currkey) { | ||
| $rows = array(); | ||
| foreach ($_rows as $key) { | ||
| if ($key['placement'] == $currkey) { |
There was a problem hiding this comment.
you already looping needed placements, why you dont made actions from _sum_placement here?
There was a problem hiding this comment.
Didn't wanted to mess all things in one place.
| foreach ($h as $key => $data) { | ||
| $row = array(); | ||
|
|
||
| $row['placement'] = implode(' > ', $data['placement']); |
There was a problem hiding this comment.
$placement = implode(' > ', $data['placement']);
$copies = isset($data['total_count']) ? (int) $data['total_count'] : 0;
$home = isset($data['available_count']) ? (int) $data['available_count'] : 0;
$current = array(
'copies' => isset($rows[$placement]['copies']) ? $rows[$placement]['copies'] : 0,
'home' => isset($rows[$placement]['home']) ? $rows[$placement]['home'] : 0,
);
$rows[$placement] = array(
'placement' => $placement,
'copies' => $copies +$current['copies'] ,
'home ' => $home + $current['home'],
);
No description provided.