Skip to content

Commit

Permalink
Merge branch 'master' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
Alanaktion committed Sep 25, 2015
2 parents 10972ad + 7a41c25 commit 910783a
Show file tree
Hide file tree
Showing 21 changed files with 861 additions and 179 deletions.
24 changes: 18 additions & 6 deletions app/controller/issues.php
Expand Up @@ -77,7 +77,7 @@ protected function _buildFilter() {
// Build SQL ORDER BY string
$orderby = !empty($args['orderby']) ? $args['orderby'] : "priority";
$filter["orderby"] = $orderby;
$ascdesc = !empty($args['ascdesc']) && $args['ascdesc'] == 'asc' ? "ASC" : "DESC";
$ascdesc = !empty($args['ascdesc']) && strtolower($args['ascdesc']) == 'asc' ? "ASC" : "DESC";
$filter["ascdesc"] = $ascdesc;
switch($orderby) {
case "id":
Expand Down Expand Up @@ -1031,31 +1031,43 @@ public function project_overview($f3, $params) {
}

/**
* Helper function to get a percentage of completed issues across the entire tree
* Helper function to get a percentage of completed issues and some totals across the entire tree
* @param Issue $issue
* @var callable $completeCount This function, required for recursive calls
* @return array
*/
$completeCount = function(\Model\Issue &$issue) use(&$completeCount) {
$projectStats = function(\Model\Issue &$issue) use(&$projectStats) {
$total = 0;
$complete = 0;
$hoursSpent = 0;
$hoursTotal = 0;
if($issue->id) {
$total ++;
if($issue->closed_date) {
$complete ++;
}
if($issue->hours_spent > 0) {
$hoursSpent += $issue->hours_spent;
}
if($issue->hours_total > 0) {
$hoursTotal += $issue->hours_total;
}
foreach($issue->getChildren() as $child) {
$result = $completeCount($child);
$result = $projectStats($child);
$total += $result["total"];
$complete += $result["complete"];
$hoursSpent += $result["hours_spent"];
$hoursTotal += $result["hours_total"];
}
}
return array(
"total" => $total,
"complete" => $complete
"complete" => $complete,
"hours_spent" => $hoursSpent,
"hours_total" => $hoursTotal,
);
};
$f3->set("stats", $completeCount($project));
$f3->set("stats", $projectStats($project));

/**
* Helper function for recursive tree rendering
Expand Down
5 changes: 4 additions & 1 deletion app/controller/user.php
Expand Up @@ -17,6 +17,9 @@ public function __construct() {
"pt" => \ISO::LC_pt . " (Português)",
"ru" => \ISO::LC_ru . " (Pу́сский)",
"nl" => \ISO::LC_nl . " (Nederlands)",
"de" => \ISO::LC_de . " (Deutsche)",
"cs" => \ISO::LC_cs . " (Češka)",
"zh" => \ISO::LC_zh . " (中国)",
);
}

Expand Down Expand Up @@ -100,7 +103,7 @@ private function _loadThemes() {
$f3 = \Base::instance();

// Get theme list
$hidden_themes = array("backlog", "style", "taskboard", "datepicker", "jquery-ui-1.10.3", "bootstrap-tagsinput", "emote");
$hidden_themes = array("backlog", "style", "taskboard", "datepicker", "jquery-ui-1.10.3", "bootstrap-tagsinput", "emote", "fontawesome");
$themes = array();
foreach (glob("css/*.css") as $file) {
$name = pathinfo($file, PATHINFO_FILENAME);
Expand Down

0 comments on commit 910783a

Please sign in to comment.