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

Commit

Permalink
Some Bugfixes
Browse files Browse the repository at this point in the history
- Missing strdbcompat usage fixed
- BConsoleConnector wrong config file append fixed
- Dashboard typo fix (Type/Level - Successful jobs)
- Timeline in Job Module disabled until not fully implemented
- Restore in action menu disabled until not fully implemented
- Client Online Status disabled until not fully implemented
- Copyright fix
  • Loading branch information
fbergkemper committed Aug 19, 2014
1 parent d6836c0 commit ceff4b4
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 18 deletions.
6 changes: 3 additions & 3 deletions module/Application/view/layout/layout.phtml
Expand Up @@ -84,7 +84,7 @@ echo $this->doctype();
<!-- TODO -->

<!--<div class="container">-->
<!-- <div class="collapse navbar-collapse"> -->
<div class="collapse navbar-collapse">

<?php
echo $this->navigation('navigation')
Expand All @@ -100,7 +100,7 @@ echo $this->doctype();
<li class="active"><a href="<?php echo $this->url('job') ?>"><?php echo $this->translate('Jobs') ?></a></li>
</ul>
-->
<!-- </div> -->
</div>
<!--</div>-->

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

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

</div> <!-- /container -->
Expand Down
2 changes: 1 addition & 1 deletion module/Client/view/client/client/details.phtml
Expand Up @@ -28,7 +28,7 @@ $this->headTitle($title);
<tr><td><b>Fileretention</b></td><td><?php echo $this->printRetention($client->fileretention) . " days"; ?></td></tr>
<tr><td><b>Jobretention</b></td><td><?php echo $this->printRetention($client->jobretention) . " days"; ?></td></tr>
<tr><td><b>Last successful backup</b></td><td><a href="<?php echo $this->url('job', array('action'=>'details', 'id' => $job->jobid)); ?>" title="<?php echo $job->endtime; ?>"><?php echo $this->printHumanReadableTimeperiod($job->endtime, "fuzzy")?> (Level: <?php echo $this->printJobLevel($job->level); ?>)</a></td></tr>
<tr><td><b>Online status</b></td><td></td></tr>
<!-- <tr><td><b>Online status</b></td><td></td></tr> -->
</table>

</div>
Expand Down
4 changes: 2 additions & 2 deletions module/Client/view/client/client/index.phtml
Expand Up @@ -24,7 +24,7 @@ $this->headTitle($title);
<th>Autoprune</th>
<th>Fileretention</th>
<th>Jobretention</th>
<th>Online status</th>
<!-- <th>Online status</th> -->
</tr>

<?php foreach($this->paginator as $client) : ?>
Expand All @@ -37,7 +37,7 @@ $this->headTitle($title);
<td><?php echo $this->escapeHtml($client->autoprune); ?></td>
<td><?php echo $this->printRetention($client->fileretention) . " days"; ?></td>
<td><?php echo $this->printRetention($client->jobretention) . " days"; ?></td>
<td></td>
<!-- <td></td> -->

</tr>

Expand Down
2 changes: 1 addition & 1 deletion module/Dashboard/view/dashboard/dashboard/index.phtml
Expand Up @@ -345,8 +345,8 @@ $flash->setMessageOpenFormat('
<td><a href="<?php echo $this->url('job', array('action' => 'details', 'id' => $jobSuccess->jobid)); ?>"><?php echo $this->escapeHtml($jobSuccess->jobid); ?></a></td>
<td><?php echo $this->escapeHtml($jobSuccess->jobname); ?></td>
<td><a href="<?php echo $this->url('client', array('action' => 'details', 'id' => $jobSuccess->clientid)); ?>"><?php echo $this->escapeHtml($jobSuccess->clientname); ?></a></td>
<td><?php echo $this->printJobLevel($jobSuccess->level); ?></td>
<td><?php echo $this->printJobType($jobSuccess->type); ?></td>
<td><?php echo $this->printJobLevel($jobSuccess->level); ?></td>
<td><?php echo $this->printDate($jobSuccess->starttime); ?></td>
<td><?php echo $this->printDate($jobSuccess->endtime); ?></td>
<td><?php echo $this->printJobDuration($jobSuccess->starttime, $jobSuccess->endtime); ?></td>
Expand Down
4 changes: 2 additions & 2 deletions module/Job/view/job/job/index.phtml
Expand Up @@ -38,7 +38,7 @@ $this->headTitle($title);
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'unsuccessful')); ?>"><?php echo $this->translate('Unsuccessful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'successful')); ?>"><?php echo $this->translate('Successful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li>
<!-- <li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li> -->
</ul>

<br />
Expand Down Expand Up @@ -97,7 +97,7 @@ $this->headTitle($title);
<li class="divider"></li>
<?php if($job->jobstatus == "T") : ?>
<li><a href="<?php echo $this->url('job', array('action' => 'rerun', 'id' => $job->jobid)); ?>" title="<?php echo $this->translate("Rerun"); ?>"><span class="glyphicon glyphicon-repeat"></span> Re-run job</a></li>
<li><a href="<?php ?>" title="<?php echo $this->translate("Restore"); ?>"><span class="glyphicon glyphicon-import"></span> Restore job</a></li>
<!-- <li><a href="<?php ?>" title="<?php echo $this->translate("Restore"); ?>"><span class="glyphicon glyphicon-import"></span> Restore job</a></li> -->
<?php elseif($job->jobstatus == "E" || $job->jobstatus == "e" || $job->jobstatus == "f" || $job->jobstatus == "A") : ?>
<li><a href="<?php echo $this->url('job', array('action' => 'rerun', 'id' => $job->jobid)); ?>" title="<?php echo $this->translate("Rerun"); ?>"><span class="glyphicon glyphicon-repeat"></span> Re-run job</a></li>
<?php else : ?>
Expand Down
2 changes: 1 addition & 1 deletion module/Job/view/job/job/running.phtml
Expand Up @@ -57,7 +57,7 @@ $flash->setMessageOpenFormat('
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'unsuccessful')); ?>"><?php echo $this->translate('Unsuccessful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'successful')); ?>"><?php echo $this->translate('Successful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li>
<!-- <li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li> -->
</ul>

<br />
Expand Down
4 changes: 2 additions & 2 deletions module/Job/view/job/job/successful.phtml
Expand Up @@ -57,7 +57,7 @@ $flash->setMessageOpenFormat('
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'unsuccessful')); ?>"><?php echo $this->translate('Unsuccessful'); ?></a></li>
<li class="active"><a href="<?php echo $this->url('job', array('action'=>'successful')); ?>"><?php echo $this->translate('Successful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li>
<!-- <li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li> -->
</ul>

<br />
Expand Down Expand Up @@ -112,7 +112,7 @@ $flash->setMessageOpenFormat('
<li><a href="<?php echo $this->url('log', array('action' => 'job', 'id' => $job->jobid)); ?>" title="<?php echo $this->translate("View messages"); ?>"><span class="glyphicon glyphicon-file"></span> View messages</a></li>
<li class="divider"></li>
<li><a href="<?php echo $this->url('job', array('action' => 'rerun', 'id' => $job->jobid)); ?>" title="<?php echo $this->translate("Rerun"); ?>"><span class="glyphicon glyphicon-repeat"></span> Re-run job</a></li>
<li><a href="<?php ?>" title="<?php echo $this->translate("Restore"); ?>"><span class="glyphicon glyphicon-import"></span> Restore job</a></li>
<!-- <li><a href="<?php ?>" title="<?php echo $this->translate("Restore"); ?>"><span class="glyphicon glyphicon-import"></span> Restore job</a></li> -->
</ul>
</div>
</td>
Expand Down
2 changes: 1 addition & 1 deletion module/Job/view/job/job/unsuccessful.phtml
Expand Up @@ -57,7 +57,7 @@ $flash->setMessageOpenFormat('
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting'); ?></a></li>
<li class="active"><a href="<?php echo $this->url('job', array('action'=>'unsuccessful')); ?>"><?php echo $this->translate('Unsuccessful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'successful')); ?>"><?php echo $this->translate('Successful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li>
<!-- <li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li> -->
</ul>

<br />
Expand Down
2 changes: 1 addition & 1 deletion module/Job/view/job/job/waiting.phtml
Expand Up @@ -57,7 +57,7 @@ $flash->setMessageOpenFormat('
<li class="active"><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'unsuccessful')); ?>"><?php echo $this->translate('Unsuccessful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'successful')); ?>"><?php echo $this->translate('Successful'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li>
<!-- <li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Timeline'); ?></a></li> -->
</ul>

<br />
Expand Down
2 changes: 2 additions & 0 deletions module/Storage/src/Storage/Model/Storage.php
Expand Up @@ -34,6 +34,8 @@ class Storage

public function exchangeArray($data)
{
$data = array_change_key_case($data, CASE_LOWER);

$this->storageid = (!empty($data['storageid'])) ? $data['storageid'] : null;
$this->name = (!empty($data['name'])) ? $data['name'] : null;
$this->autochanger = (!empty($data['autochanger'])) ? $data['autochanger'] : null;
Expand Down
23 changes: 21 additions & 2 deletions module/Storage/src/Storage/Model/StorageTable.php
Expand Up @@ -26,17 +26,34 @@
namespace Storage\Model;

use Zend\Db\TableGateway\TableGateway;
use Zend\ServiceManager\ServiceLocatorAwareInterface;
use Zend\ServiceManager\ServiceLocatorInterface;
use Bareos\Db\Sql\BareosSqlCompatHelper;

class StorageTable
class StorageTable implements ServiceLocatorAwareInterface
{

protected $tableGateway;
protected $serviceLocator;

public function __construct(TableGateway $tableGateway)
{
$this->tableGateway = $tableGateway;
}

public function setServiceLocator(ServiceLocatorInterface $serviceLocator) {
$this->serviceLocator = $serviceLocator;
}

public function getServiceLocator() {
return $this->serviceLocator;
}

public function getDbDriverConfig() {
$config = $this->getServiceLocator()->get('Config');
return $config['db']['driver'];
}

public function fetchAll()
{
$resultSet = $this->tableGateway->select();
Expand All @@ -46,7 +63,9 @@ public function fetchAll()
public function getStorage($id)
{
$id = (int) $id;
$rowset = $this->tableGateway->select(array('storageid' => $id));

$bsqlch = new BareosSqlCompatHelper($this->getDbDriverConfig());
$rowset = $this->tableGateway->select(array($bsqlch->strdbcompat("StorageId") => $id));
$row = $rowset->current();
if(!$row) {
throw new \Exception("Could not find row $id");
Expand Down
4 changes: 2 additions & 2 deletions vendor/Bareos/library/Bareos/BConsole/BConsoleConnector.php
Expand Up @@ -47,7 +47,7 @@ public function getBConsoleOutput($cmd)
$env = array('/usr/sbin');

if($this->bconsole_sudo == "true") {
$process = proc_open('sudo ' . $this->bconsole_exec_path, $descriptorspec, $pipes, $cwd, $env);
$process = proc_open('sudo ' . $this->bconsole_exec_path . ' -c ' . $this->bconsole_config_path, $descriptorspec, $pipes, $cwd, $env);
}
else {
$process = proc_open($this->bconsole_exec_path, $descriptorspec, $pipes, $cwd, $env);
Expand All @@ -58,7 +58,7 @@ public function getBConsoleOutput($cmd)

if(is_resource($process))
{
fwrite($pipes[0], $cmd . ' -c ' . $this->bconsole_config_path);
fwrite($pipes[0], $cmd);
fclose($pipes[0]);
while(!feof($pipes[1])) {
array_push($this->bconsole_output, fread($pipes[1],8192));
Expand Down

0 comments on commit ceff4b4

Please sign in to comment.