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

Commit

Permalink
Merge branch 'barbossa-0.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Jan 20, 2014
2 parents 04427cb + 5f8eb76 commit 0a55d85
Show file tree
Hide file tree
Showing 98 changed files with 4,181 additions and 396 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -7,5 +7,5 @@ barbossa

## Requirements

* PHP 5.3 or higher
* Zend Framework 2
* PHP 5.3.3 or later; we recommend using the latest PHP version whenever possible
* Zend Framework 2.x
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified composer.phar
Binary file not shown.
4 changes: 4 additions & 0 deletions config/application.config.php
Expand Up @@ -15,8 +15,12 @@
'Job',
'File',
'Log',
'Restore',
'Statistics',
'Admin',
'User',
);

if($env == 'development') {
$modules[] = 'ZendDeveloperTools';
}
Expand Down
2 changes: 1 addition & 1 deletion module/Admin/view/admin/admin/index.phtml
Expand Up @@ -5,7 +5,7 @@ $this->headTitle($title);

?>

<h2><?php echo $title; ?></h2>
<h3 class="text-muted"><?php echo $title; ?></h3>
<hr />

<ul class="nav nav-tabs">
Expand Down
2 changes: 1 addition & 1 deletion module/Admin/view/admin/admin/roles.phtml
Expand Up @@ -5,7 +5,7 @@ $this->headTitle($title);

?>

<h2><?php echo $title; ?></h2>
<h3 class="text-muted"><?php echo $title; ?></h3>
<hr />

<ul class="nav nav-tabs">
Expand Down
2 changes: 1 addition & 1 deletion module/Admin/view/admin/admin/users.phtml
Expand Up @@ -5,7 +5,7 @@ $this->headTitle($title);

?>

<h2><?php echo $title; ?></h2>
<h3 class="text-muted"><?php echo $title; ?></h3>
<hr />

<ul class="nav nav-tabs">
Expand Down
10 changes: 4 additions & 6 deletions module/Application/config/module.config.php
Expand Up @@ -157,32 +157,30 @@
'label' => 'Job',
'route' => 'job',
),
/*
array(
'label' => 'File',
'route' => 'file',
),
*/
array(
'label' => 'Log',
'route' => 'log',
),
/*
array(
'label' => 'Restore',
'route' => 'restore',
),
*/
array(
'label' => 'Statistics',
'route' => 'statistics',
),
array(
'label' => 'Administration',
'route' => 'admin',
),
/*
array(
'label' => 'User',
'route' => 'user',
),
*/
),
),
);
Expand Down
18 changes: 10 additions & 8 deletions module/Application/view/layout/layout.phtml
Expand Up @@ -3,7 +3,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<?php echo $this->headTitle('barbossa | '. $this->translate('Version 0.0.1'))->setSeparator(' - ')->setAutoEscape(false) ?>
<?php echo $this->headTitle('Bareos Webinterface | '. $this->translate('Version 0.0.1'))->setSeparator(' - ')->setAutoEscape(false) ?>

<?php echo $this->headMeta()
->appendName('viewport', 'width=device-width, initial-scale=1.0')
Expand All @@ -23,31 +23,33 @@
->prependFile($this->basePath() . '/js/bootstrap.min.js')
->prependFile($this->basePath() . '/js/excanvas.min.js')
->prependFile($this->basePath() . '/js/jqplot.pieRenderer.min.js')
->prependFile($this->basePath() . '/js/jqplot.barRenderer.min.js')
->prependFile($this->basePath() . '/js/jqplot.categoryAxisRenderer.min.js')
->prependFile($this->basePath() . '/js/jqplot.pointLabels.min.js')
->prependFile($this->basePath() . '/js/jquery.jqplot.min.js')
->prependFile($this->basePath() . '/js/jquery.min.js')
->prependFile($this->basePath() . '/js/respond.min.js', 'text/javascript', array('conditional' => 'lt IE 9',))
->prependFile($this->basePath() . '/js/html5shiv.js', 'text/javascript', array('conditional' => 'lt IE 9',))
; ?>

</head>
<body>

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

<!-- <div class="navbar-header"> -->
<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') ?>">
<!--<img src="<?php echo $this->basePath('img/zf2-logo.png') ?>" alt="barbossa"/>&nbsp;-->
<?php echo $this->translate('barbossa') ?>
<?php echo $this->translate('Bareos') ?>
</a>
<!-- </div> -->
</div>

<!--<div class="container">-->
<!-- <div class="collapse navbar-collapse"> -->
Expand All @@ -56,7 +58,7 @@
->menu()
->setMinDepth(0)
->setMaxDepth(0)
->setUlClass('nav navbar-nav');
->setUlClass('nav navbar-nav');
?>
<!--
<ul class="nav navbar-nav">
Expand Down Expand Up @@ -89,7 +91,7 @@
<hr />

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

</div> <!-- /container -->
Expand Down
10 changes: 5 additions & 5 deletions module/Client/src/Client/Controller/ClientController.php
Expand Up @@ -13,11 +13,11 @@ class ClientController extends AbstractActionController

public function indexAction()
{
return new ViewModel(
array(
'clients' => $this->getClientTable()->fetchAll(),
)
);
$paginator = $this->getClientTable()->fetchAll(true);
$paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) );
$paginator->setItemCountPerPage(10);

return new ViewModel(array('paginator' => $paginator));
}

public function detailsAction()
Expand Down
18 changes: 17 additions & 1 deletion module/Client/src/Client/Model/ClientTable.php
Expand Up @@ -6,6 +6,7 @@
use Zend\Db\TableGateway\TableGateway;
use Zend\Db\Sql\Select;
use Zend\Paginator\Adapter\DbSelect;
use Zend\Paginator\Paginator;

class ClientTable
{
Expand All @@ -17,8 +18,23 @@ public function __construct(TableGateway $tableGateway)
$this->tableGateway = $tableGateway;
}

public function fetchAll()
public function fetchAll($paginated=false)
{
$select = new Select();
$select->from('client');

if($paginated) {
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Client());
$paginatorAdapter = new DbSelect(
$select,
$this->tableGateway->getAdapter(),
$resultSetPrototype
);
$paginator = new Paginator($paginatorAdapter);
return $paginator;
}

$resultSet = $this->tableGateway->select();
return $resultSet;
}
Expand Down
4 changes: 2 additions & 2 deletions module/Client/view/client/client/details.phtml
Expand Up @@ -5,7 +5,7 @@ $this->headTitle($title);

?>

<h2><?php echo $title; ?></h2>
<h3 class="text-muted"><?php echo $title; ?></h3>
<hr />

<div class="row">
Expand All @@ -27,7 +27,7 @@ $this->headTitle($title);
<tr><td>Autoprune</td><td><?php echo $this->escapeHtml($client->autoprune); ?></td></tr>
<tr><td>Fileretention</td><td><?php echo $this->printRetention($client->fileretention) . " days"; ?></td></tr>
<tr><td>Jobretention</td><td><?php echo $this->printRetention($client->jobretention) . " days"; ?></td></tr>
<tr><td>Last successful backup</td><td><a href="<?php echo $this->url('job', array('action'=>'details', 'id' => $job->jobid)); ?>"><?php echo $this->escapeHtml($job->endtime)?> (Level: <?php echo $this->printJobLevel($job->level); ?>)</a></td></tr>
<tr><td>Last successful backup</td><td><a href="<?php echo $this->url('job', array('action'=>'details', 'id' => $job->jobid)); ?>"><?php echo $this->printDate($job->endtime)?> (Level: <?php echo $this->printJobLevel($job->level); ?>)</a></td></tr>

</table>

Expand Down
24 changes: 18 additions & 6 deletions module/Client/view/client/client/index.phtml
Expand Up @@ -5,11 +5,9 @@ $this->headTitle($title);

?>

<h2><?php echo $title; ?></h2>
<h3 class="text-muted"><?php echo $title; ?></h3>
<hr />

<?php foreach($clients as $client) : ?>

<div class="row">

<div class="col-md-12">
Expand All @@ -27,6 +25,9 @@ $this->headTitle($title);
<th>Fileretention</th>
<th>Jobretention</th>
</tr>

<?php foreach($this->paginator as $client) : ?>

<tr>

<td><a href="<?php echo $this->url('client', array('action'=>'details', 'id' => $client->clientid)); ?>"><?php echo $this->escapeHtml($client->clientid); ?></a></td>
Expand All @@ -38,13 +39,24 @@ $this->headTitle($title);

</tr>

<?php endforeach; ?>

</table>

</div>
</div>
</div>

</div>
<?php

<?php endforeach; ?>
echo $this->paginationControl(
$this->paginator,
'Elastic',
array('partial/paginator.phtml', 'Client'),
array('route' => 'client')
);

?>

</div>

</div>

0 comments on commit 0a55d85

Please sign in to comment.