Progress on Doc Generation. Job Index is cleaner
This commit is contained in:
parent
bf45f7be1e
commit
d06ceef2ae
178
controllers/documents_controller.php
Normal file
178
controllers/documents_controller.php
Normal file
|
|
@ -0,0 +1,178 @@
|
|||
<?php
|
||||
class DocumentsController extends AppController {
|
||||
|
||||
var $name = 'Documents';
|
||||
var $helpers = array('Html', 'Form');
|
||||
|
||||
function index() {
|
||||
$this->Document->recursive = 0;
|
||||
$this->set('documents', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Document.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$document = $this->Document->read(null, $id);
|
||||
$this->set('document', $document);
|
||||
|
||||
|
||||
$this->set('customer', $this->Document->Enquiry->Customer->findById($document['Enquiry']['customer_id']));
|
||||
|
||||
$this->set('currencies', $this->Document->Quote->Currency->find('list'));
|
||||
|
||||
$this->set('principles', $this->Document->Enquiry->Principle->find('list'));
|
||||
|
||||
$pages = $document['Page'];
|
||||
|
||||
|
||||
$this->set('pages', $pages);
|
||||
|
||||
|
||||
$docType = "";
|
||||
|
||||
if(!empty($document['Invoice']['id'])) {
|
||||
$docType = "invoice";
|
||||
}
|
||||
elseif(!empty($document['Quote']['id'])) {
|
||||
$docType = "quote";
|
||||
}
|
||||
elseif(!empty($document['PurchaseOrder']['id'])) {
|
||||
$docType = "purchaseOrder";
|
||||
}
|
||||
$this->set('docType',$docType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Quote, along with its associated Document and the first two pages.
|
||||
* @param int $id - the Enquiry ID that this quote belongs to.
|
||||
*/
|
||||
function newQuote($id = null) {
|
||||
$enquiryid = $id;
|
||||
$this->Document->create();
|
||||
|
||||
$enquiry = $this->Document->Enquiry->findById($id);
|
||||
|
||||
$this->data['Document']['enquiry_id'] = $enquiryid;
|
||||
|
||||
$this->data['Quote']['enquiry_id'] = $enquiryid;
|
||||
$number_of_revisions = $this->Document->Quote->findCount('Quote.enquiry_id ='. $enquiryid);
|
||||
$this->data['Quote']['revision'] = $number_of_revisions;
|
||||
|
||||
$this->data['Document']['customer_id'] = $enquiry['Enquiry']['customer_id'];
|
||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||
$this->data['Document']['contact_id']= $enquiry['Enquiry']['contact_id'];
|
||||
$this->data['Page'][0]['page_number'] = 1;
|
||||
$this->data['Page'][0]['contentPage'] = 1;
|
||||
$this->data['Page'][1]['page_number'] = 2;
|
||||
$this->data['Page'][1]['contentPage'] = 0;
|
||||
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$newid = $this->Document->id;
|
||||
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'view',$newid));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Create a new Quote, along with its associated Document and the first two pages.
|
||||
* @param int $id - the Enquiry ID that this quote belongs to.
|
||||
*/
|
||||
function newInvoice($id = null) {
|
||||
$enquiryid = $id;
|
||||
$this->Document->create();
|
||||
|
||||
$enquiry = $this->Document->Enquiry->findById($id);
|
||||
|
||||
$this->data['Document']['enquiry_id'] = $enquiryid;
|
||||
|
||||
$this->data['Invoice']['enquiry_id'] = $enquiryid;
|
||||
$invoice_number_offset = 4436; //What Invoice number we were up to before the new system.
|
||||
$number_of_invoices = $this->Document->Invoice->findCount();
|
||||
|
||||
$newInvoiceNumber = $invoice_number_offset + $number_of_invoices;
|
||||
|
||||
$this->data['Invoice']['title'] = "CMCIN".$newInvoiceNumber;
|
||||
|
||||
|
||||
$this->data['Document']['customer_id'] = $enquiry['Enquiry']['customer_id'];
|
||||
$this->data['Document']['user_id']= $enquiry['Enquiry']['user_id'];
|
||||
$this->data['Document']['contact_id']= $enquiry['Enquiry']['contact_id'];
|
||||
$this->data['Page'][0]['page_number'] = 1;
|
||||
$this->data['Page'][0]['contentPage'] = 0;
|
||||
|
||||
if ($this->Document->saveAll($this->data)) {
|
||||
$newid = $this->Document->id;
|
||||
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'view',$newid));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/* function add() {
|
||||
if (!empty($this->data)) {
|
||||
$this->Document->create();
|
||||
if ($this->Document->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
$customers = $this->Document->Customer->find('list');
|
||||
$enquiries = $this->Document->Enquiry->find('list');
|
||||
$jobs = $this->Document->Job->find('list');
|
||||
$users = $this->Document->User->find('list');
|
||||
$contacts = $this->Document->Contact->find('list');
|
||||
$this->set(compact('customers', 'enquiries', 'jobs', 'users', 'contacts'));
|
||||
}*/
|
||||
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Document', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
if ($this->Document->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Document has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Document could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->Document->read(null, $id);
|
||||
}
|
||||
$customers = $this->Document->Customer->find('list');
|
||||
$enquiries = $this->Document->Enquiry->find('list');
|
||||
$jobs = $this->Document->Job->find('list');
|
||||
$users = $this->Document->User->find('list');
|
||||
$contacts = $this->Document->Contact->find('list');
|
||||
$this->set(compact('customers','enquiries','jobs','users','contacts'));
|
||||
}
|
||||
|
||||
/*function delete($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid id for Document', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if ($this->Document->del($id)) {
|
||||
$this->Session->setFlash(__('Document deleted', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -44,10 +44,11 @@ class EnquiriesController extends AppController {
|
|||
$this->set('enquiry', $enquiry);
|
||||
|
||||
//$this->set('quotes', $enquiry['Quote']);
|
||||
$this->set('quotes', $this->Enquiry->Quote->find('all', array('recursive' => 0, 'conditions'=>array('Quote.enquiry_id'=>$id), 'order'=>'Quote.revision DESC')));
|
||||
$this->set('quotes', $this->Enquiry->Quote->find('all', array('conditions'=>array('Quote.enquiry_id'=>$id), 'order'=>'Quote.revision DESC')));
|
||||
|
||||
$this->set('invoices', $this->Enquiry->Invoice->find('all', array('conditions' => array('Invoice.enquiry_id' => $id))));
|
||||
|
||||
|
||||
|
||||
$this->pageTitle = "Enquiry: ".$enquiry['Enquiry']['title'];
|
||||
|
||||
|
|
@ -74,6 +75,7 @@ class EnquiriesController extends AppController {
|
|||
$this->set('number_of_emails', $this->Enquiry->Email->find('count', array('conditions'=>array('Email.enquiry_id'=>$id))));
|
||||
*/
|
||||
|
||||
|
||||
$this->set('emails', $this->Enquiry->Email->find('all', array('conditions'=>array('Email.enquiry_id' => $id))));
|
||||
$this->set('number_of_quotes', $this->Enquiry->Quote->find('count', array('conditions'=>array('Quote.enquiry_id'=>$id))));
|
||||
//$this->set('number_of_files', $this->Enquiry->EnquiryFile->find('count', array('conditions' => array('EnquiryFile.enquiry_id'=>$id))));
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ class InvoicesController extends AppController {
|
|||
|
||||
|
||||
var $paginate = array(
|
||||
'limit' => 100,
|
||||
'contain' => array('Customer')
|
||||
'limit' => 100,
|
||||
'contain' => array('Customer')
|
||||
);
|
||||
|
||||
function index() {
|
||||
|
|
@ -25,7 +25,7 @@ class InvoicesController extends AppController {
|
|||
|
||||
|
||||
|
||||
function add() {
|
||||
function add() { //No longer creating invoices directly. Done through the Documents Controller
|
||||
|
||||
if (!empty($this->data)) {
|
||||
$this->Invoice->create();
|
||||
|
|
@ -52,8 +52,8 @@ class InvoicesController extends AppController {
|
|||
if(isset($this->params['named']['enquiryid'])) {
|
||||
$enquiryid = $this->params['named']['enquiryid'];
|
||||
$enquiry = $this->Invoice->Enquiry->findById($enquiryid);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$user = $this->Auth->user();
|
||||
$this->set(compact('enquiry', 'user'));
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ class JobsController extends AppController {
|
|||
var $helpers = array('Html', 'Form');
|
||||
|
||||
function index() {
|
||||
$this->Job->recursive = 0;
|
||||
//$this->Job->recursive = 1;
|
||||
$this->set('jobs', $this->paginate());
|
||||
$this->set('customers', $this->Job->Enquiry->Customer->find('list'));
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
|
|
|
|||
66
controllers/pages_controller.php
Normal file
66
controllers/pages_controller.php
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
<?php
|
||||
class PagesController extends AppController {
|
||||
|
||||
var $name = 'Pages';
|
||||
var $helpers = array('Html', 'Form');
|
||||
|
||||
function index() {
|
||||
$this->Page->recursive = 0;
|
||||
$this->set('pages', $this->paginate());
|
||||
}
|
||||
|
||||
function view($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid Page.', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
$this->set('page', $this->Page->read(null, $id));
|
||||
}
|
||||
|
||||
function add() {
|
||||
if (!empty($this->data)) {
|
||||
$this->Page->create();
|
||||
if ($this->Page->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Page has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Page could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
$documents = $this->Page->Document->find('list');
|
||||
$this->set(compact('documents'));
|
||||
}
|
||||
|
||||
function edit($id = null) {
|
||||
if (!$id && empty($this->data)) {
|
||||
$this->Session->setFlash(__('Invalid Page', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
if ($this->Page->save($this->data)) {
|
||||
$this->Session->setFlash(__('The Page has been saved', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
} else {
|
||||
$this->Session->setFlash(__('The Page could not be saved. Please, try again.', true));
|
||||
}
|
||||
}
|
||||
if (empty($this->data)) {
|
||||
$this->data = $this->Page->read(null, $id);
|
||||
}
|
||||
$documents = $this->Page->Document->find('list');
|
||||
$this->set(compact('documents'));
|
||||
}
|
||||
|
||||
function delete($id = null) {
|
||||
if (!$id) {
|
||||
$this->Session->setFlash(__('Invalid id for Page', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
if ($this->Page->del($id)) {
|
||||
$this->Session->setFlash(__('Page deleted', true));
|
||||
$this->redirect(array('action'=>'index'));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -51,10 +51,7 @@ class QuotesController extends AppController {
|
|||
|
||||
$this->data['Quote']['currency_id'] = 2;
|
||||
|
||||
/**
|
||||
* @todo Fix this hard coded default currency. Currently set to '2' for AUD.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
if ($this->Quote->save($this->data)) {
|
||||
$quoteid = $this->Quote->id;
|
||||
|
|
|
|||
65
models/document.php
Normal file
65
models/document.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
class Document extends AppModel {
|
||||
|
||||
var $name = 'Document';
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
var $belongsTo = array(
|
||||
|
||||
'Enquiry' => array(
|
||||
'className' => 'Enquiry',
|
||||
'foreignKey' => 'enquiry_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'Job' => array(
|
||||
'className' => 'Job',
|
||||
'foreignKey' => 'job_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'User' => array(
|
||||
'className' => 'User',
|
||||
'foreignKey' => 'user_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'Contact' => array(
|
||||
'className' => 'Contact',
|
||||
'foreignKey' => 'contact_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
var $hasMany = array(
|
||||
'Page' => array(
|
||||
'className' => 'Page',
|
||||
'foreignKey' => 'document_id',
|
||||
'dependent' => false
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
var $hasOne = array(
|
||||
'Invoice' => array(
|
||||
'className' => 'Invoice',
|
||||
'foreignKey'=> 'document_id'
|
||||
),
|
||||
'Quote' => array(
|
||||
'className'=>'Quote',
|
||||
'foriegnKey'=>'document_id'
|
||||
),
|
||||
|
||||
'PurchaseOrder' => array(
|
||||
'className'=>'PurchaseOrder',
|
||||
'foreignKey'=>'document_id'
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
|
@ -181,7 +181,11 @@ class Enquiry extends AppModel {
|
|||
'foreignKey'=>'enquiry_id'),
|
||||
|
||||
'Job' => array('className' => 'Job',
|
||||
'foreignKey' =>'enquiry_id')
|
||||
'foreignKey' =>'enquiry_id'),
|
||||
|
||||
|
||||
'Document' => array('className'=>'Document',
|
||||
'foreignKey'=>'enquiry_id')
|
||||
|
||||
|
||||
/* 'EnquiryFile' => array('className' => 'EnquiryFile',
|
||||
|
|
|
|||
|
|
@ -27,21 +27,7 @@ class Job extends AppModel {
|
|||
)
|
||||
);
|
||||
|
||||
/*var $hasMany = array(
|
||||
'JobProduct' => array(
|
||||
'className' => 'JobProduct',
|
||||
'foreignKey' => 'job_id',
|
||||
'dependent' => false,
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'offset' => '',
|
||||
'exclusive' => '',
|
||||
'finderQuery' => '',
|
||||
'counterQuery' => ''
|
||||
)
|
||||
);*/
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -33,7 +33,10 @@ class LineItem extends AppModel {
|
|||
),
|
||||
|
||||
'Principle' => array('className' => 'Principle',
|
||||
'foreignKey' =>'principle_id')
|
||||
'foreignKey' =>'principle_id'),
|
||||
|
||||
'Page' => array('className'=>'Page',
|
||||
'foreignKey'=>'page_id')
|
||||
|
||||
);
|
||||
|
||||
|
|
|
|||
22
models/page.php
Normal file
22
models/page.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
class Page extends AppModel {
|
||||
|
||||
var $name = 'Page';
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
var $belongsTo = array(
|
||||
'Document' => array(
|
||||
'className' => 'Document',
|
||||
'foreignKey' => 'document_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
|
||||
var $order = 'Page.page_number ASC';
|
||||
|
||||
}
|
||||
?>
|
||||
41
models/purchase_order.php
Normal file
41
models/purchase_order.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
class PurchaseOrder extends AppModel {
|
||||
|
||||
var $name = 'PurchaseOrder';
|
||||
|
||||
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||||
var $belongsTo = array(
|
||||
'Principle' => array(
|
||||
'className' => 'Principle',
|
||||
'foreignKey' => 'principle_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
),
|
||||
'Document' => array(
|
||||
'className' => 'Document',
|
||||
'foreignKey' => 'document_id',
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => ''
|
||||
)
|
||||
);
|
||||
|
||||
var $hasMany = array(
|
||||
'Shipment' => array(
|
||||
'className' => 'Shipment',
|
||||
'foreignKey' => 'purchase_order_id',
|
||||
'dependent' => false,
|
||||
'conditions' => '',
|
||||
'fields' => '',
|
||||
'order' => '',
|
||||
'limit' => '',
|
||||
'offset' => '',
|
||||
'exclusive' => '',
|
||||
'finderQuery' => '',
|
||||
'counterQuery' => ''
|
||||
)
|
||||
);
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -20,7 +20,9 @@ class Quote extends AppModel {
|
|||
'order' => ''
|
||||
),
|
||||
|
||||
'Currency' => array('className' => 'Currency', 'foreignKey' => 'currency_id')
|
||||
'Currency' => array('className' => 'Currency', 'foreignKey' => 'currency_id'),
|
||||
|
||||
'Document' => array('className'=>'Document', 'foreignKey'=>'document_id')
|
||||
);
|
||||
|
||||
|
||||
|
|
|
|||
38
views/documents/add.ctp
Normal file
38
views/documents/add.ctp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<div class="documents form">
|
||||
<?php echo $form->create('Document');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Add Document');?></legend>
|
||||
<?php
|
||||
echo $form->input('customer_id');
|
||||
echo $form->input('enquiry_id');
|
||||
echo $form->input('job_id');
|
||||
echo $form->input('user_id');
|
||||
echo $form->input('contact_id');
|
||||
echo $form->input('type');
|
||||
echo $form->input('quote_id');
|
||||
echo $form->input('invoice_id');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('List Documents', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Customers', true), array('controller' => 'customers', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Customer', true), array('controller' => 'customers', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller' => 'enquiries', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller' => 'enquiries', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Contacts', true), array('controller' => 'contacts', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Contact', true), array('controller' => 'contacts', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Invoices', true), array('controller' => 'invoices', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Invoice', true), array('controller' => 'invoices', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Pages', true), array('controller' => 'pages', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Page', true), array('controller' => 'pages', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
40
views/documents/edit.ctp
Normal file
40
views/documents/edit.ctp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<div class="documents form">
|
||||
<?php echo $form->create('Document');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit Document');?></legend>
|
||||
<?php
|
||||
echo $form->input('id');
|
||||
echo $form->input('customer_id');
|
||||
echo $form->input('enquiry_id');
|
||||
echo $form->input('job_id');
|
||||
echo $form->input('user_id');
|
||||
echo $form->input('contact_id');
|
||||
echo $form->input('type');
|
||||
echo $form->input('quote_id');
|
||||
echo $form->input('invoice_id');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('Document.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Document.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List Documents', true), array('action' => 'index'));?></li>
|
||||
<li><?php echo $html->link(__('List Customers', true), array('controller' => 'customers', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Customer', true), array('controller' => 'customers', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller' => 'enquiries', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller' => 'enquiries', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Contacts', true), array('controller' => 'contacts', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Contact', true), array('controller' => 'contacts', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Invoices', true), array('controller' => 'invoices', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Invoice', true), array('controller' => 'invoices', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Pages', true), array('controller' => 'pages', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Page', true), array('controller' => 'pages', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
96
views/documents/index.ctp
Normal file
96
views/documents/index.ctp
Normal file
|
|
@ -0,0 +1,96 @@
|
|||
<div class="documents index">
|
||||
<h2><?php __('Documents');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('id');?></th>
|
||||
<th><?php echo $paginator->sort('created');?></th>
|
||||
<th><?php echo $paginator->sort('customer_id');?></th>
|
||||
<th><?php echo $paginator->sort('enquiry_id');?></th>
|
||||
<th><?php echo $paginator->sort('job_id');?></th>
|
||||
<th><?php echo $paginator->sort('user_id');?></th>
|
||||
<th><?php echo $paginator->sort('contact_id');?></th>
|
||||
<th><?php echo $paginator->sort('type');?></th>
|
||||
<th><?php echo $paginator->sort('quote_id');?></th>
|
||||
<th><?php echo $paginator->sort('invoice_id');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($documents as $document):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td>
|
||||
<?php echo $document['Document']['id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $document['Document']['created']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($document['Customer']['name'], array('controller' => 'customers', 'action' => 'view', $document['Customer']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($document['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $document['Enquiry']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($document['Job']['title'], array('controller' => 'jobs', 'action' => 'view', $document['Job']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($document['User']['username'], array('controller' => 'users', 'action' => 'view', $document['User']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $html->link($document['Contact']['name'], array('controller' => 'contacts', 'action' => 'view', $document['Contact']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $document['Document']['type']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $document['Document']['quote_id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $document['Document']['invoice_id']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $document['Document']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $document['Document']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $document['Document']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $document['Document']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paging">
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Document', true), array('action' => 'add')); ?></li>
|
||||
<li><?php echo $html->link(__('List Customers', true), array('controller' => 'customers', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Customer', true), array('controller' => 'customers', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller' => 'enquiries', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller' => 'enquiries', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Contacts', true), array('controller' => 'contacts', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Contact', true), array('controller' => 'contacts', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Invoices', true), array('controller' => 'invoices', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Invoice', true), array('controller' => 'invoices', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Pages', true), array('controller' => 'pages', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Page', true), array('controller' => 'pages', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
56
views/documents/view.ctp
Normal file
56
views/documents/view.ctp
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
<?php echo $javascript->link('addLineItem'); ?>
|
||||
|
||||
<?php echo $javascript->link('lineItemPriceNoCosting'); ?>
|
||||
|
||||
|
||||
<div class="quotes view">
|
||||
<h2><?php
|
||||
|
||||
$enquirynumber_link = $html->link($document['Enquiry']['title'],
|
||||
array('controller'=>'enquiries', 'action'=>'view', $document['Enquiry']['id']));
|
||||
|
||||
$customer_link = $html->link( $customer['Customer']['name'], array('controller'=>'customers', 'action' => 'view', $customer['Customer']['id']));
|
||||
|
||||
if($docType == 'quote') {
|
||||
|
||||
if($document['Quote']['revision'] == 0) {
|
||||
__('Quote: '.$enquirynumber_link. ' for '. $customer_link);
|
||||
}
|
||||
else {
|
||||
__('Quote: '.$enquirynumber_link.' Revision '.$document['Quote']['revision'].' for '. $customer_link);
|
||||
}
|
||||
}
|
||||
else if($docType == 'invoice') {
|
||||
__('Invoice: '.$document['Invoice']['title']. ' for '. $customer_link);
|
||||
}
|
||||
|
||||
?></h2>
|
||||
|
||||
<?php foreach($pages as $page): ?>
|
||||
<h3 class="pagenumber">Page <?php echo $page['page_number']; ?></h3>
|
||||
|
||||
<? if($page['contentPage'] == 1): ?>
|
||||
<div class="pageview">
|
||||
<?php echo $page['content'];?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
|
||||
<div class="lineitems">
|
||||
|
||||
</div>
|
||||
|
||||
<?php endif;?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div id="mydebug"></div>
|
||||
|
||||
<? //debug($document); ?>
|
||||
|
||||
<?php // debug($pages); ?>
|
||||
|
||||
<?php debug($customer); ?>
|
||||
|
||||
<?php echo "DocType is: ".$docType; ?>
|
||||
253
views/documents/viewDEFAULT.ctp
Normal file
253
views/documents/viewDEFAULT.ctp
Normal file
|
|
@ -0,0 +1,253 @@
|
|||
<div class="documents view">
|
||||
<h2><?php __('Document');?></h2>
|
||||
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Document']['id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Document']['created']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($document['Customer']['name'], array('controller' => 'customers', 'action' => 'view', $document['Customer']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($document['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $document['Enquiry']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Job'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($document['Job']['title'], array('controller' => 'jobs', 'action' => 'view', $document['Job']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('User'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($document['User']['username'], array('controller' => 'users', 'action' => 'view', $document['User']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Contact'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $html->link($document['Contact']['name'], array('controller' => 'contacts', 'action' => 'view', $document['Contact']['id'])); ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Type'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Document']['type']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Quote Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Document']['quote_id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Invoice Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Document']['invoice_id']; ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Document', true), array('action' => 'edit', $document['Document']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete Document', true), array('action' => 'delete', $document['Document']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $document['Document']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('List Documents', true), array('action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Document', true), array('action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Customers', true), array('controller' => 'customers', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Customer', true), array('controller' => 'customers', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Enquiries', true), array('controller' => 'enquiries', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller' => 'enquiries', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Jobs', true), array('controller' => 'jobs', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Job', true), array('controller' => 'jobs', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Users', true), array('controller' => 'users', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New User', true), array('controller' => 'users', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Contacts', true), array('controller' => 'contacts', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Contact', true), array('controller' => 'contacts', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Invoices', true), array('controller' => 'invoices', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Invoice', true), array('controller' => 'invoices', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Quotes', true), array('controller' => 'quotes', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Quote', true), array('controller' => 'quotes', 'action' => 'add')); ?> </li>
|
||||
<li><?php echo $html->link(__('List Pages', true), array('controller' => 'pages', 'action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Page', true), array('controller' => 'pages', 'action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Invoices');?></h3>
|
||||
<?php if (!empty($document['Invoice'])):?>
|
||||
<dl> <?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['created'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Issue Date');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['issue_date'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Due Date');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['due_date'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Title');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['title'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Paid');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['paid'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Payment Received Date');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['payment_received_date'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['enquiry_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Job Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['job_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('User Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['user_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customer Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['customer_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Document Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Invoice']['document_id'];?>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Invoice', true), array('controller' => 'invoices', 'action' => 'edit', $document['Invoice']['id'])); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Quotes');?></h3>
|
||||
<?php if (!empty($document['Quote'])):?>
|
||||
<dl> <?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Created');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['created'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Modified');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['modified'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Enquiry Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['enquiry_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Currency Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['currency_id'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Revision');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['revision'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Delivery Time');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['delivery_time'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Payment Terms');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['payment_terms'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Days Valid');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['days_valid'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Date Issued');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['date_issued'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Valid Until');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['valid_until'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Delivery Point');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['delivery_point'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Exchange Rate');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['exchange_rate'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customs Duty');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['customs_duty'];?>
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Document Id');?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $document['Quote']['document_id'];?>
|
||||
</dd>
|
||||
</dl>
|
||||
<?php endif; ?>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Quote', true), array('controller' => 'quotes', 'action' => 'edit', $document['Quote']['id'])); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="related">
|
||||
<h3><?php __('Related Pages');?></h3>
|
||||
<?php if (!empty($document['Page'])):?>
|
||||
<table cellpadding = "0" cellspacing = "0">
|
||||
<tr>
|
||||
<th><?php __('Id'); ?></th>
|
||||
<th><?php __('Page Number'); ?></th>
|
||||
<th><?php __('ContentPage'); ?></th>
|
||||
<th><?php __('Content'); ?></th>
|
||||
<th><?php __('Document Id'); ?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($document['Page'] as $page):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td><?php echo $page['id'];?></td>
|
||||
<td><?php echo $page['page_number'];?></td>
|
||||
<td><?php echo $page['contentPage'];?></td>
|
||||
<td><?php echo $page['content'];?></td>
|
||||
<td><?php echo $page['document_id'];?></td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('controller' => 'pages', 'action' => 'view', $page['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('controller' => 'pages', 'action' => 'edit', $page['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('controller' => 'pages', 'action' => 'delete', $page['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $page['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Page', true), array('controller' => 'pages', 'action' => 'add'));?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -174,8 +174,7 @@ $class = ' class="altrow"';?>
|
|||
</td>
|
||||
<td>
|
||||
<?php echo $this->element('isEmptyDate',
|
||||
array('date' => $job['Job']['date_order_placed_on_principle']));
|
||||
?>
|
||||
array('date' => $job['Job']['date_order_placed_on_principle'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $this->element('isEmptyDate',
|
||||
|
|
@ -300,8 +299,11 @@ $class = ' class="altrow"';?>
|
|||
|
||||
<div class="related">
|
||||
<h3>
|
||||
<?php __($enquiry['Enquiry']['email_count'].' Emails for this Enquiry');?><?php echo $html->image('internet-mail.png'); ?></h3>
|
||||
<?php //__($enquiry['Enquiry']['email_count'].' Emails for this Enquiry');?><?php //echo $html->image('internet-mail.png'); ?></h3>
|
||||
<?php //echo $this->element('email_table_ajax', $enquiry); ?>
|
||||
<?php echo $this->element('email_table_ajax', $enquiry, array('cache'=>'+1 day')); ?>
|
||||
<?php //echo $this->element('email_table_ajax', $enquiry, array('cache'=>'+1 day')); ?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<?php debug($quotes); ?>
|
||||
|
|
@ -6,13 +6,14 @@
|
|||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<table cellpadding="0" cellspacing="0" class="mer">
|
||||
<tr>
|
||||
|
||||
<th><?php echo $paginator->sort('created');?></th>
|
||||
<th><?php echo $paginator->sort('Job Number');?></th>
|
||||
<th><?php echo $paginator->sort('enquiry_id');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th><?php echo $paginator->sort('Customer');?></th>
|
||||
|
||||
<th><?php echo $paginator->sort('date_order_received');?></th>
|
||||
<th><?php echo $paginator->sort('date_order_placed_on_principle');?></th>
|
||||
<th><?php echo $paginator->sort('date_scheduled_ex_works');?></th>
|
||||
|
|
@ -21,6 +22,7 @@
|
|||
<th><?php echo $paginator->sort('domestic_freight_paid_by');?></th>
|
||||
<th><?php echo $paginator->sort('sale_category');?></th>
|
||||
<th><?php echo $paginator->sort('shipment_category');?></th>
|
||||
<th><?php echo $paginator->sort('comments');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
|
|
@ -33,9 +35,15 @@
|
|||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
|
||||
<td>
|
||||
<?php echo $job['Job']['created']; ?>
|
||||
|
||||
|
||||
<td class="enqdate">
|
||||
<?php
|
||||
/* Change the date from MySQL DATETIME to a D M Y format */
|
||||
echo date('j M Y',$time->toUnix($job['Job']['created'])); ?>
|
||||
</td>
|
||||
|
||||
|
||||
<td>
|
||||
<?php echo $job['Job']['title']; ?>
|
||||
</td>
|
||||
|
|
@ -43,15 +51,14 @@
|
|||
<?php echo $html->link($job['Enquiry']['title'], array('controller' => 'enquiries', 'action' => 'view', $job['Enquiry']['id'])); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $job['Job']['comments']; ?>
|
||||
<?php echo $customers[$job['Enquiry']['customer_id']]; ?>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<?php echo $job['Job']['date_order_received']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo isEmptyDate($job['Job']['date_order_placed_on_principle']);
|
||||
|
||||
?>
|
||||
<?php echo isEmptyDate($job['Job']['date_order_placed_on_principle']); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo isEmptyDate($job['Job']['date_scheduled_ex_works']); ?>
|
||||
|
|
@ -70,11 +77,13 @@
|
|||
</td>
|
||||
<td>
|
||||
<?php echo $job['Job']['shipment_category']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $job['Job']['comments']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $job['Job']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $job['Job']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $job['Job']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $job['Job']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
|
|
@ -96,7 +105,7 @@
|
|||
|
||||
<?php
|
||||
|
||||
function isEmptyDate($date) {
|
||||
function isEmptyDate($date) {
|
||||
if($date == "0000-00-00") {
|
||||
return "-";
|
||||
}
|
||||
|
|
@ -104,4 +113,6 @@
|
|||
return $date;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
<?php debug($customers); ?>
|
||||
18
views/pages/add.ctp
Normal file
18
views/pages/add.ctp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<div class="pages form">
|
||||
<?php echo $form->create('Page');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Add Page');?></legend>
|
||||
<?php
|
||||
echo $form->input('page_number');
|
||||
echo $form->input('contentPage');
|
||||
echo $form->input('content');
|
||||
echo $form->input('document_id');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('List Pages', true), array('action' => 'index'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
20
views/pages/edit.ctp
Normal file
20
views/pages/edit.ctp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<div class="pages form">
|
||||
<?php echo $form->create('Page');?>
|
||||
<fieldset>
|
||||
<legend><?php __('Edit Page');?></legend>
|
||||
<?php
|
||||
echo $form->input('id');
|
||||
echo $form->input('page_number');
|
||||
echo $form->input('contentPage');
|
||||
echo $form->input('content');
|
||||
echo $form->input('document_id');
|
||||
?>
|
||||
</fieldset>
|
||||
<?php echo $form->end('Submit');?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Delete', true), array('action' => 'delete', $form->value('Page.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Page.id'))); ?></li>
|
||||
<li><?php echo $html->link(__('List Pages', true), array('action' => 'index'));?></li>
|
||||
</ul>
|
||||
</div>
|
||||
60
views/pages/index.ctp
Normal file
60
views/pages/index.ctp
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
<div class="pages index">
|
||||
<h2><?php __('Pages');?></h2>
|
||||
<p>
|
||||
<?php
|
||||
echo $paginator->counter(array(
|
||||
'format' => __('Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%', true)
|
||||
));
|
||||
?></p>
|
||||
<table cellpadding="0" cellspacing="0">
|
||||
<tr>
|
||||
<th><?php echo $paginator->sort('id');?></th>
|
||||
<th><?php echo $paginator->sort('page_number');?></th>
|
||||
<th><?php echo $paginator->sort('contentPage');?></th>
|
||||
<th><?php echo $paginator->sort('content');?></th>
|
||||
<th><?php echo $paginator->sort('document_id');?></th>
|
||||
<th class="actions"><?php __('Actions');?></th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach ($pages as $page):
|
||||
$class = null;
|
||||
if ($i++ % 2 == 0) {
|
||||
$class = ' class="altrow"';
|
||||
}
|
||||
?>
|
||||
<tr<?php echo $class;?>>
|
||||
<td>
|
||||
<?php echo $page['Page']['id']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $page['Page']['page_number']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $page['Page']['contentPage']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $page['Page']['content']; ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php echo $page['Page']['document_id']; ?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<?php echo $html->link(__('View', true), array('action' => 'view', $page['Page']['id'])); ?>
|
||||
<?php echo $html->link(__('Edit', true), array('action' => 'edit', $page['Page']['id'])); ?>
|
||||
<?php echo $html->link(__('Delete', true), array('action' => 'delete', $page['Page']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $page['Page']['id'])); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paging">
|
||||
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>
|
||||
| <?php echo $paginator->numbers();?>
|
||||
<?php echo $paginator->next(__('next', true).' >>', array(), null, array('class' => 'disabled'));?>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('New Page', true), array('action' => 'add')); ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
38
views/pages/view.ctp
Normal file
38
views/pages/view.ctp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
<div class="pages view">
|
||||
<h2><?php __('Page');?></h2>
|
||||
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $page['Page']['id']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Page Number'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $page['Page']['page_number']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('ContentPage'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $page['Page']['contentPage']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Content'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $page['Page']['content']; ?>
|
||||
|
||||
</dd>
|
||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Document Id'); ?></dt>
|
||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||
<?php echo $page['Page']['document_id']; ?>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<ul>
|
||||
<li><?php echo $html->link(__('Edit Page', true), array('action' => 'edit', $page['Page']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('Delete Page', true), array('action' => 'delete', $page['Page']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $page['Page']['id'])); ?> </li>
|
||||
<li><?php echo $html->link(__('List Pages', true), array('action' => 'index')); ?> </li>
|
||||
<li><?php echo $html->link(__('New Page', true), array('action' => 'add')); ?> </li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
@ -95,6 +95,12 @@ h3 {
|
|||
h3#logo {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
|
||||
h3.pagenumber {
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
h4 {
|
||||
color: #993;
|
||||
font-weight: normal;
|
||||
|
|
@ -339,10 +345,12 @@ dl#showemail {
|
|||
border: black 1px solid;
|
||||
}
|
||||
|
||||
div.quotepageview {
|
||||
div.pageview {
|
||||
|
||||
overflow: scroll;
|
||||
border: black 1px solid;
|
||||
width: 60%;
|
||||
border: black 2px solid;
|
||||
width: 21cm;
|
||||
margin-bottom: 2em;
|
||||
}
|
||||
|
||||
.addressradio label {
|
||||
|
|
|
|||
Loading…
Reference in a new issue