forked from extern/egroupware
Fix code formatting
This commit is contained in:
parent
418debd53c
commit
541eae19ca
@ -193,11 +193,13 @@ class timesheet_bo extends so_sql_cf
|
|||||||
$map = array(
|
$map = array(
|
||||||
'' => array('substatus' => array())
|
'' => array('substatus' => array())
|
||||||
);
|
);
|
||||||
foreach($this->status_labels_config as $id => &$status) {
|
foreach($this->status_labels_config as $id => &$status)
|
||||||
|
{
|
||||||
$status['substatus'] = array();
|
$status['substatus'] = array();
|
||||||
$map[$id] = &$status;
|
$map[$id] = &$status;
|
||||||
}
|
}
|
||||||
foreach($this->status_labels_config as &$status) {
|
foreach($this->status_labels_config as &$status)
|
||||||
|
{
|
||||||
$map[$status['parent']]['substatus'][] = &$status;
|
$map[$status['parent']]['substatus'][] = &$status;
|
||||||
}
|
}
|
||||||
$tree = $map['']['substatus'];
|
$tree = $map['']['substatus'];
|
||||||
@ -208,7 +210,8 @@ class timesheet_bo extends so_sql_cf
|
|||||||
|
|
||||||
// Sort config based on tree
|
// Sort config based on tree
|
||||||
$sorted = array();
|
$sorted = array();
|
||||||
foreach($this->status_labels as $status_id => $label) {
|
foreach($this->status_labels as $status_id => $label)
|
||||||
|
{
|
||||||
$sorted[$status_id] = $this->status_labels_config[$status_id];
|
$sorted[$status_id] = $this->status_labels_config[$status_id];
|
||||||
//$sorted[$status_id]['name'] = $label;
|
//$sorted[$status_id]['name'] = $label;
|
||||||
unset($sorted[$status_id]['substatus']);
|
unset($sorted[$status_id]['substatus']);
|
||||||
@ -225,11 +228,13 @@ class timesheet_bo extends so_sql_cf
|
|||||||
*
|
*
|
||||||
* @return None, labels are built in labels parameter
|
* @return None, labels are built in labels parameter
|
||||||
*/
|
*/
|
||||||
protected function make_status_labels($statuses, &$labels, $depth=0) {
|
protected function make_status_labels($statuses, &$labels, $depth=0)
|
||||||
foreach($statuses as $status) {
|
{
|
||||||
|
foreach($statuses as $status)
|
||||||
|
{
|
||||||
$labels[$status['id']] = str_pad('',$depth*12, " ",STR_PAD_LEFT).trim(str_replace(' ','',$status['name']));
|
$labels[$status['id']] = str_pad('',$depth*12, " ",STR_PAD_LEFT).trim(str_replace(' ','',$status['name']));
|
||||||
//$labels[$status['id']] = str_pad('',$depth, "+------",STR_PAD_LEFT).$status['name'];
|
if(count($status['substatus']) > 0)
|
||||||
if(count($status['substatus']) > 0) {
|
{
|
||||||
$this->make_status_labels($status['substatus'], $labels, $depth+1);
|
$this->make_status_labels($status['substatus'], $labels, $depth+1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user