Added job sorting links to index

This commit is contained in:
Karl Cordes 2011-04-13 11:26:38 +10:00
parent acd21f97f2
commit 674876f2e4
3 changed files with 210 additions and 164 deletions

View file

@ -14,9 +14,37 @@ class JobsController extends AppController {
);
function index() {
function index($showUnpaid = null, $showUnsent = null) {
$this->Job->recursive = 1;
$this->set('jobs', $this->paginate());
if(isset($showUnpaid) && isset($showUnsent)) {
$conditions = array(
'Job.all_paid' => 0,
'Job.all_sent' => 0,
);
}
else if(isset($showUnpaid)) {
$conditions = array(
'Job.all_paid' => 0,
);
}
else if(isset($showUnsent)) {
$conditions = array(
'Job.all_sent' => 0,
);
}
else {
$conditions = array();
}
$this->set('jobs', $this->paginate($conditions));
$this->set('customers', $this->Job->Enquiry->Customer->find('list'));
$this->set('currencies', $this->Job->Currency->find('list'));

View file

@ -7,12 +7,14 @@ echo $javascript->link('job_index');
<h2><?php __('Jobs');?></h2>
<? //<iframe src="/jobs/index_grid" id="jobs_grid_iframe"></iframe>
?>
<div class="showActions">
<ul>
<li><?=$html->link('Show all', array('action'=>'index'));?></li>
<li><?=$html->link('Show only Unpaid', array('action'=>'index/1'));?></li>
<li><?=$html->link('Show only Unsent', array('action'=>'index/0/1'));?></li>
<li><?=$html->link('Show only Unpaid & Unsent', array('action'=>'index/1/1'));?></li>
</ul>
</div>
<?php
echo $paginator->counter(array(
@ -27,11 +29,8 @@ echo $paginator->counter(array(
<?php echo $form->create('Job', array('action'=>'/jobs/ajax_edit'));?>
<div id="fixedHeader">
</div>
<table cellpadding="0" cellspacing="0" class="jobsTable">
<div class="scrollHorizontal">
<table cellpadding="0" cellspacing="0" class="jobsTable">
<thead class="jobTableHead">
<tr class="jobTableHeadRow" id="originalHeader">
@ -182,7 +181,9 @@ echo $paginator->counter(array(
<? endforeach;?>
</tbody>
</table>
</table>
</div>
<div class="paging">

View file

@ -1335,7 +1335,24 @@ select.job_status {
}
.showActions ul {
list-style: none;
}
.showActions ul li {
display: inline;
padding-left: 0.2em;
}
.showActions {
padding-bottom: 1em;
}
.scrollHorizontal {
height: 800px;
overflow:scroll;
}
/* CSS for the Job Reporting */