class Hermes_Api extends Horde_Registry_Api
{
- function getTableMetaData($name, $params)
+ public static function getTableMetaData($name, $params)
{
switch ($name) {
case 'hours':
'title' => _("Employee"),
'type' => $emptype[0],
'params' => $emptype[1]),
- array('name' => 'client',
+ array('name' => '_client_name',
'title' => _("Client"),
'type' => 'enum',
'params' => array($clients)),
}
}
- function getTableData($name, $params)
+ public static function getTableData($name, $params)
{
switch ($name) {
case 'hours':
break;
}
- if (!empty($subtotal_column)) {
- $clients = Hermes::listClients();
- $column = array();
- foreach ($time_data as $key => $row) {
- if (empty($row['client'])) {
- $time_data[$key]['_client_name'] = _("no client");
- } elseif (isset($clients[$row['client']])) {
- $time_data[$key]['_client_name'] = $clients[$row['client']];
- } else {
- $time_data[$key]['_client_name'] = $row['client'];
- }
- $column[$key] = $time_data[$key][$subtotal_column];
+ $clients = Hermes::listClients();
+ $column = array();
+ foreach ($time_data as $key => $row) {
+ if (empty($row['client'])) {
+ $time_data[$key]['_client_name'] = _("no client");
+ } elseif (isset($clients[$row['client']])) {
+ $time_data[$key]['_client_name'] = $clients[$row['client']];
+ } else {
+ $time_data[$key]['_client_name'] = $row['client'];
}
- array_multisort($column, SORT_ASC, $time_data);
+ $column[$key] = $time_data[$key][$subtotal_column];
}
+ array_multisort($column, SORT_ASC, $time_data);
}
$total_hours = 0.0;
if (!empty($subtotal_column) &&
$vals[$subtotal_column] != $subtotal_control) {
- renderSubtotals($result['data'], $subtotal_hours, $subtotal_billable_hours,
+ Hermes_Api::renderSubtotals($result['data'], $subtotal_hours, $subtotal_billable_hours,
$subtotal_column == 'date' ? strftime("%m/%d/%Y", $subtotal_control) :
$subtotal_control);
$subtotal_hours = 0.0;
}
if (!empty($subtotal_column)) {
- renderSubtotals($result['data'], $subtotal_hours, $subtotal_billable_hours,
+ Hermes_Api::renderSubtotals($result['data'], $subtotal_hours, $subtotal_billable_hours,
$subtotal_column == 'date' ? strftime("%m/%d/%Y", $subtotal_control) :
$subtotal_control);
}
return $result;
}
- function renderSubtotals(&$table_data, $hours, $billable_hours, $value)
+ public static function renderSubtotals(&$table_data, $hours, $billable_hours, $value)
{
$billable_pct = ($hours == 0.0) ? 0.0 :
round($billable_hours / $hours * 100.0);
return PEAR::raiseError(_("Invalid entry: check data and retry."));
}
}
-}
\ No newline at end of file
+}