From 674876f2e40efdac67505e505c36bf853376a26e Mon Sep 17 00:00:00 2001 From: Karl Cordes Date: Wed, 13 Apr 2011 11:26:38 +1000 Subject: [PATCH] Added job sorting links to index --- controllers/jobs_controller.php | 34 +++- views/jobs/index.ctp | 323 ++++++++++++++++---------------- webroot/css/quotenik.css | 17 ++ 3 files changed, 210 insertions(+), 164 deletions(-) diff --git a/controllers/jobs_controller.php b/controllers/jobs_controller.php index c9ceac7e..fdf52be7 100755 --- a/controllers/jobs_controller.php +++ b/controllers/jobs_controller.php @@ -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')); @@ -32,7 +60,7 @@ class JobsController extends AppController { /** Called via AJAX to get an editable row */ function getEditableRow($id) { $this->layout = 'ajax'; - + $job = $this->Job->find('first', array('conditions'=>array('Job.id'=>$id))); $this->set('job', $job); diff --git a/views/jobs/index.ctp b/views/jobs/index.ctp index 3b6c5b14..58d1574d 100644 --- a/views/jobs/index.ctp +++ b/views/jobs/index.ctp @@ -7,12 +7,14 @@ echo $javascript->link('job_index');

- - - -?> - - +
+ +
counter(array( @@ -27,163 +29,162 @@ echo $paginator->counter(array( create('Job', array('action'=>'/jobs/ajax_edit'));?> -
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + create('Job', array('action'=>'ajax_edit', 'class'=>'job_table_form', 'default'=>false)); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Actionssort('Order Received', 'date_order_received');?>sort('All Paid', 'all_paid');?>sort('All Sent', 'all_sent');?>sort('Status', 'job_status');?>sort('Sale Category');?>sort('Job Type', 'job_type');?>sort('Shipment Category','shipment_category');?>sort('Job Number','title');?>Enquiry NumberCMC POsDate Order Placed on Principlesort('Customer','Customer.name');?>Customer Order Nosort('Supplier Ref');?>sort('Scheduled Ex-Works', 'date_scheduled_ex_works');?>sort('Date Sent to Customer', 'date_sent_to_customer');?>sort('Freight Paid By CMC');?>sort('Sale Currency');?>sort('Gross Sales AUD');?>sort('Net Sales AUD');?>sort('Gross Profit AUD');?>sort('Net Export Sales Converted to Or Invoiced in AUD');?>sort('Gross Profit Value Export in AUD');?>sort('GP% Excl Commissions');?>sort('ATO Exchange Rate');?>sort('Gross Australian Sales Foreign Currency');?>sort('Net Australian Sales Foreign Currency');?>sort('Gross Profit value Australian Sales Foreign Currency');?>sort('Gross Export Sales Foreign Currency');?>sort('Net Export Sales Foreign Currency');?>sort('Gross Profit Value After Discount Exports Foreign Currency');?>sort('Gross Commissions');?>sort('Net Commisions');?>
+ element('isEmptyDate', array('date'=>$job['Job']['date_order_received']));?> + element('booleanTick', array('bool'=>$job['Job']['all_paid'])); ?> + + element('booleanTick', array('bool'=>$job['Job']['all_sent'])); ?> + + + + link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?>link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?> + link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']))."
"; + } + ?> +
element('isEmptyDate', array('date'=>$po['issue_date'])); + echo "
"; + } + ?> +
link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?> + + "; + } + ?> + + element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works']));?> + + element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer']));?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - create('Job', array('action'=>'ajax_edit', 'class'=>'job_table_form', 'default'=>false)); - ?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Actionssort('Order Received', 'date_order_received');?>sort('All Paid', 'all_paid');?>sort('All Sent', 'all_sent');?>sort('Status', 'job_status');?>sort('Sale Category');?>sort('Job Type', 'job_type');?>sort('Shipment Category','shipment_category');?>sort('Job Number','title');?>Enquiry NumberCMC POsDate Order Placed on Principlesort('Customer','Customer.name');?>Customer Order Nosort('Supplier Ref');?>sort('Scheduled Ex-Works', 'date_scheduled_ex_works');?>sort('Date Sent to Customer', 'date_sent_to_customer');?>sort('Freight Paid By CMC');?>sort('Sale Currency');?>sort('Gross Sales AUD');?>sort('Net Sales AUD');?>sort('Gross Profit AUD');?>sort('Net Export Sales Converted to Or Invoiced in AUD');?>sort('Gross Profit Value Export in AUD');?>sort('GP% Excl Commissions');?>sort('ATO Exchange Rate');?>sort('Gross Australian Sales Foreign Currency');?>sort('Net Australian Sales Foreign Currency');?>sort('Gross Profit value Australian Sales Foreign Currency');?>sort('Gross Export Sales Foreign Currency');?>sort('Net Export Sales Foreign Currency');?>sort('Gross Profit Value After Discount Exports Foreign Currency');?>sort('Gross Commissions');?>sort('Net Commisions');?>
- element('isEmptyDate', array('date'=>$job['Job']['date_order_received']));?> - element('booleanTick', array('bool'=>$job['Job']['all_paid'])); ?> - - element('booleanTick', array('bool'=>$job['Job']['all_sent'])); ?> - - - - link($job['Job']['title'], array('controller'=>'jobs', 'action'=>'view', $job['Job']['id']));?>link($job['Enquiry']['title'], array('controller'=>'enquiries','action'=>'view', $job['Enquiry']['id']));?> - link($po['title'], array('controller'=>'purchase_orders', 'action'=>'view', $po['id']))."
"; - } - ?> -
element('isEmptyDate', array('date'=>$po['issue_date'])); - echo "
"; - } - ?> -
link($job['Customer']['name'], array('controller'=>'customers','action'=>'view', $job['Customer']['id']));?> - - "; - } - ?> - - element('isEmptyDate', array('date'=>$job['Job']['date_scheduled_ex_works']));?> - - element('isEmptyDate', array('date'=>$job['Job']['date_order_sent_to_customer']));?> - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?> diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css index 0654f6a9..b76bf85b 100755 --- a/webroot/css/quotenik.css +++ b/webroot/css/quotenik.css @@ -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 */