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

Commit

Permalink
Moving on ...
Browse files Browse the repository at this point in the history
  • Loading branch information
fbergkemper committed Jan 15, 2014
1 parent 7a0da5d commit 4d7d85c
Show file tree
Hide file tree
Showing 24 changed files with 471 additions and 77 deletions.
13 changes: 6 additions & 7 deletions module/Application/view/layout/layout.phtml
Expand Up @@ -28,12 +28,12 @@
->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-default navbar-fixed-top" role="navigation">-->
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<!-- <div class="container"> -->

<div class="navbar-header">
Expand All @@ -44,8 +44,7 @@
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo $this->url('dashboard') ?>">
<!--<img src="<?php echo $this->basePath('img/bareos.png') ?>" alt="Bareos"/>&nbsp;-->
<!--<?php echo $this->translate('Bareos') ?>-->
<?php echo $this->translate('Bareos') ?>
</a>
</div>

Expand All @@ -56,7 +55,7 @@
->menu()
->setMinDepth(0)
->setMaxDepth(0)
->setUlClass('nav nav-tabs navbar-fixed-top');
->setUlClass('nav navbar-nav');
?>
<!--
<ul class="nav navbar-nav">
Expand All @@ -68,7 +67,7 @@
<!--</div>-->

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


Expand All @@ -89,7 +88,7 @@
<hr />

<footer>
<p class="text-muted">&copy; 2013 - <?php echo date('Y') ?> Bareos GmbH, <?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
22 changes: 17 additions & 5 deletions module/Client/view/client/client/index.phtml
Expand Up @@ -8,8 +8,6 @@ $this->headTitle($title);
<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>
4 changes: 3 additions & 1 deletion module/Dashboard/view/dashboard/dashboard/index.phtml
Expand Up @@ -8,6 +8,8 @@ $this->headTitle($title);
<h3 class="text-muted"><?php echo $this->translate($title); ?></h3>
<hr />



<?php

$flash = $this->flashMessenger();
Expand Down Expand Up @@ -259,7 +261,7 @@ $flash->setMessageOpenFormat('
</h3>
</div>

<div class="panel-body panel-collapse collapse in" id="collapseSuccessful">
<div class="panel-body panel-collapse collapse out" id="collapseSuccessful">

<table class="table table-striped table-hover" style="font-size: 9pt;">

Expand Down
10 changes: 5 additions & 5 deletions module/Fileset/src/Fileset/Controller/FilesetController.php
Expand Up @@ -13,11 +13,11 @@ class FilesetController extends AbstractActionController

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

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

public function detailsAction()
Expand Down
20 changes: 19 additions & 1 deletion module/Fileset/src/Fileset/Model/FilesetTable.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 FilesetTable
{
Expand All @@ -17,10 +18,27 @@ public function __construct(TableGateway $tableGateway)
$this->tableGateway = $tableGateway;
}

public function fetchAll()
public function fetchAll($paginated=false)
{

$select = new Select();
$select->from('fileset');

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

$resultSet = $this->tableGateway->select();
return $resultSet;

}

public function getFileset($id)
Expand Down
16 changes: 14 additions & 2 deletions module/Fileset/view/fileset/fileset/index.phtml
Expand Up @@ -24,14 +24,14 @@ $this->headTitle($title);
<th>Modified</th>
</tr>

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

<tr>

<td><a href="<?php echo $this->url('fileset', array('action'=>'details', 'id' => $fileset->filesetid)); ?>"><?php echo $this->escapeHtml($fileset->filesetid); ?></a></td>
<td><?php echo $this->escapeHtml($fileset->fileset); ?></td>
<td><?php echo $this->escapeHtml($fileset->md5); ?></td>
<td><?php echo $this->escapeHtml($fileset->createtime); ?></td>
<td><?php echo $this->printDate($fileset->createtime); ?></td>

</tr>

Expand All @@ -41,6 +41,18 @@ $this->headTitle($title);

</div>
</div>

<?php

echo $this->paginationControl(
$this->paginator,
'Elastic',
array('partial/paginator.phtml', 'Fileset'),
array('route' => 'fileset')
);

?>

</div>

</div>
14 changes: 14 additions & 0 deletions module/Job/src/Job/Controller/JobController.php
Expand Up @@ -47,6 +47,20 @@ public function runningAction()
);
}

public function waitingAction()
{
$paginator = $this->getJobTable()->getWaitingJobs(true);
$paginator->setCurrentPageNumber( (int) $this->params()->fromQuery('page', 1) );
$paginator->setItemCountPerPage(10);

return new ViewModel(
array(
'paginator' => $paginator,
'waitingJobs' => $this->getJobTable()->getWaitingJobs()
)
);
}

public function problemAction()
{
$paginator = $this->getJobTable()->getLast24HoursUnsuccessfulJobs(true);
Expand Down
29 changes: 21 additions & 8 deletions module/Job/src/Job/Model/JobTable.php
Expand Up @@ -19,11 +19,12 @@ public function __construct(TableGateway $tableGateway)

public function fetchAll($paginated=false)
{
$select = new Select();
$select->from('job');
$select->join('client', 'job.clientid = client.clientid', array('clientname' => 'name'));
$select->order('job.jobid DESC');

if($paginated) {
$select = new Select();
$select->from('job');
$select->join('client', 'job.clientid = client.clientid', array('clientname' => 'name'));
$select->order('job.jobid DESC');
$resultSetPrototype = new ResultSet();
$resultSetPrototype->setArrayObjectPrototype(new Job());
$paginatorAdapter = new DbSelect(
Expand Down Expand Up @@ -81,7 +82,7 @@ public function getRunningJobs($paginated=false)
}
}

public function getWaitingJobs()
public function getWaitingJobs($paginated=false)
{
$select = new Select();
$select->from('job');
Expand All @@ -99,9 +100,21 @@ public function getWaitingJobs()
jobstatus = 'p' OR
jobstatus = 'C'");

$resultSet = $this->tableGateway->selectWith($select);

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

public function getLast24HoursSuccessfulJobs()
Expand Down
19 changes: 17 additions & 2 deletions module/Job/view/job/job/details.phtml
Expand Up @@ -48,7 +48,7 @@ $this->headTitle($title);
<div class="panel panel-default">

<div class="panel-heading">
<h3 class="panel-title">Log</h3>
<h3 class="panel-title">Placeholder</h3>
</div>

<div class="panel-body">
Expand All @@ -61,6 +61,21 @@ $this->headTitle($title);

</div>


</div>

<div class="row">

<div class="col-md-12">
<div class="panel panel-default">

<div class="panel-heading">
<h3 class="panel-title">Log</h3>
</div>

<div class="panel-body">
</div>

</div>
</div>

</div>
1 change: 1 addition & 0 deletions module/Job/view/job/job/index.phtml
Expand Up @@ -11,6 +11,7 @@ $this->headTitle($title);
<ul class="nav nav-tabs">
<li class="active"><a href="<?php echo $this->url('job', array('action'=>'index')); ?>"><?php echo $this->translate('Job history'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'running')); ?>"><?php echo $this->translate('Running jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'problem')); ?>"><?php echo $this->translate('Unsuccessful jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Job timeline'); ?></a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions module/Job/view/job/job/problem.phtml
Expand Up @@ -30,6 +30,7 @@ $flash->setMessageOpenFormat('
<ul class="nav nav-tabs">
<li><a href="<?php echo $this->url('job', array('action'=>'index')); ?>"><?php echo $this->translate('Job history'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'running')); ?>"><?php echo $this->translate('Running jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting jobs'); ?></a></li>
<li class="active"><a href="<?php echo $this->url('job', array('action'=>'problem')); ?>"><?php echo $this->translate('Unsuccessful jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Job timeline'); ?></a></li>
</ul>
Expand All @@ -54,6 +55,7 @@ $flash->setMessageOpenFormat('
<th><?php echo $this->translate("Type"); ?></th>
<th><?php echo $this->translate("Level"); ?></th>
<th><?php echo $this->translate("Start"); ?></th>
<th><?php echo $this->translate("End"); ?></th>
<th><?php echo $this->translate("Status"); ?></th>
<th><?php echo $this->translate("Log"); ?></th>

Expand Down
1 change: 1 addition & 0 deletions module/Job/view/job/job/running.phtml
Expand Up @@ -30,6 +30,7 @@ $flash->setMessageOpenFormat('
<ul class="nav nav-tabs">
<li><a href="<?php echo $this->url('job', array('action'=>'index')); ?>"><?php echo $this->translate('Job history'); ?></a></li>
<li class="active"><a href="<?php echo $this->url('job', array('action'=>'running')); ?>"><?php echo $this->translate('Running jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'waiting')); ?>"><?php echo $this->translate('Waiting jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'problem')); ?>"><?php echo $this->translate('Unsuccessful jobs'); ?></a></li>
<li><a href="<?php echo $this->url('job', array('action'=>'timeline')); ?>"><?php echo $this->translate('Job timeline'); ?></a></li>
</ul>
Expand Down

0 comments on commit 4d7d85c

Please sign in to comment.