Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Merge pull request #33 from fbergkemper/master
Browse files Browse the repository at this point in the history
bugfix

- Errors in View Helper HumanReadableTimeperiod.php fixed.
- Missing job states added into the View Helper.
- Errors and missing job states in Job Model fixed.
- Copyright typo fixed and Bareos branding now build in the header menu navbar.
  • Loading branch information
frabdev committed Aug 26, 2014
2 parents 0a9e0e2 + bd1e94c commit 2f23f1e
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
Expand Up @@ -45,7 +45,7 @@ class HumanReadableTimeperiod extends AbstractHelper
public function __invoke($time, $format="short")
{

if(empty($time)) {
if($time == "0000-00-00 00:00:00" || empty($time)) {
return $this->result = "never";
}
else {
Expand Down Expand Up @@ -116,7 +116,7 @@ public function __invoke($time, $format="short")
$this->result = "about " . $interval . " month ago";
}
elseif($interval > 365) {
$interval = round($interval / 12, 1, PHP_ROUND_HALF_UP);
$interval = round($interval / 365, 1, PHP_ROUND_HALF_UP);
$this->result = "about " . $interval . " year(s) ago";
}

Expand Down
15 changes: 15 additions & 0 deletions module/Application/src/Application/View/Helper/JobStatus.php
Expand Up @@ -96,6 +96,21 @@ public function __invoke($jobStatus)
case 'i':
$output = '<span class="label label-info">Doing batch insert file records</span>';
break;
case 'I':
$output = '<span class="label label-primary">Incomplete</span>';
break;
case 'L':
$output = '<span class="label label-info">Committing data</span>';
break;
case 'W':
$output = '<span class="label label-warning">Terminated with warnings</span>';
break;
case 'l':
$output = '<span class="label label-info">Doing data despooling</span>';
break;
case 'q':
$output = '<span class="label label-default">Queued waiting for device</span>';
break;
default:
$output = '<span class="label label-primary">' . $jobStatus . '</span>';
break;
Expand Down
12 changes: 4 additions & 8 deletions module/Application/view/layout/layout.phtml
Expand Up @@ -67,18 +67,15 @@ echo $this->doctype();

<!-- Navigation start -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container">

<!-- <div class="container"> -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo $this->url('dashboard') ?>">
<?php echo $this->escapeHtml('Bareos') ?>
</a>
<img src="<?php echo $this->basePath('img/bareos-logo-small.png') ?>" alt="Bareos" />&nbsp;
</div>

<!-- TODO -->
Expand All @@ -102,8 +99,7 @@ echo $this->doctype();
-->
</div>
<!--</div>-->

</div>
<!--</div>-->
</nav>
<!-- Navigation end -->

Expand All @@ -126,7 +122,7 @@ echo $this->doctype();
<hr />

<footer>
<p class="text-muted">&copy; 2013 - <?php echo date('Y') ?> Bareos GmbH, GNU Affero General Public License Version 3</p>
<p class="text-muted">&copy; 2013 - <?php echo date('Y') ?> Bareos GmbH &amp; Co. KG, GNU Affero General Public License Version 3</p>
</footer>

</div> <!-- /container -->
Expand Down
14 changes: 11 additions & 3 deletions module/Job/src/Job/Model/JobTable.php
Expand Up @@ -120,7 +120,10 @@ public function getRunningJobs($paginated=false)
array($bsqlch->strdbcompat("ClientName") => $bsqlch->strdbcompat("Name"))
);
$select->order($bsqlch->strdbcompat("Job.JobId") . " DESC");
$select->where($bsqlch->strdbcompat("JobStatus") . " = 'R'");
$select->where(
$bsqlch->strdbcompat("JobStatus") . " = 'R' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'l'"
);

if($paginated) {
$resultSetPrototype = new ResultSet();
Expand Down Expand Up @@ -161,6 +164,7 @@ public function getWaitingJobs($paginated=false)
$bsqlch->strdbcompat("JobStatus") . " = 'd' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 't' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'p' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'q' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'C'"
);

Expand Down Expand Up @@ -196,7 +200,8 @@ public function getLast24HoursSuccessfulJobs($paginated=false)
);
$select->order($bsqlch->strdbcompat("Job.JobId") . " DESC");
$select->where(
$bsqlch->strdbcompat("JobStatus") . " = 'T' AND " .
$bsqlch->strdbcompat("JobStatus") . " = 'T' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'W' AND " .
$bsqlch->strdbcompat("StartTime") . " >= '" . $back24h_time . "' AND " .
$bsqlch->strdbcompat("EndTime") . " >= '" . $back24h_time . "'"
);
Expand Down Expand Up @@ -233,7 +238,10 @@ public function getLast24HoursUnsuccessfulJobs($paginated=false)
);
$select->order($bsqlch->strdbcompat("Job.JobId") . " DESC");
$select->where(
$bsqlch->strdbcompat("JobStatus") . " != 'T' AND " .
$bsqlch->strdbcompat("JobStatus") . " = 'A' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'E' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'e' OR " .
$bsqlch->strdbcompat("JobStatus") . " = 'f' AND " .
$bsqlch->strdbcompat("StartTime") . " >= '" . $back24h_time . "' AND " .
$bsqlch->strdbcompat("EndTime") . " >= '" . $back24h_time . "'"
);
Expand Down
Binary file removed public/img/bareo-xl.png
Binary file not shown.
Binary file added public/img/bareos-logo-small.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f23f1e

Please sign in to comment.