diff --git a/controllers/documents_controller.php b/controllers/documents_controller.php index 23b253ab..6985130f 100755 --- a/controllers/documents_controller.php +++ b/controllers/documents_controller.php @@ -30,7 +30,12 @@ class DocumentsController extends AppController { $this->set('document', $document); $this->data = $document; - $this->set('docType',$this->Document->getDocType($document)); + $docType = $this->Document->getDocType($document); + $this->set('docType', $docType); + + $this->set('docTypeFullName', $this->Document->getDocFullName($docType)); + $this->set('users', $this->Document->User->getUsersList()); + $this->set('currency', $this->Document->getCurrency($document)); $this->set('enquiry', $this->Document->getEnquiry($document)); // $this->set('principles', $this->Document->LineItem->Product->Principle->find('list')); @@ -307,10 +312,10 @@ class DocumentsController extends AppController { $document['Document']['pdf_created_at'] = date('Y-m-d H:i:s'); $document['Document']['pdf_created_by_user_id'] = $this->getCurrentUserID(); if($this->Document->save($document)) { - echo "Set pdf_filename attritbute to: ".$filename; + //echo "Set pdf_filename attritbute to: ".$filename; } else { - echo 'Failed to set pdf_filename to: '.$filename; + //echo 'Failed to set pdf_filename to: '.$filename; } @@ -324,7 +329,6 @@ class DocumentsController extends AppController { ); $this->set('colWidths',$colWidths); - } function generateFirstPage($id = null) { diff --git a/views/documents/pdf.ctp b/views/documents/pdf.ctp index a3953a3d..4368b071 100755 --- a/views/documents/pdf.ctp +++ b/views/documents/pdf.ctp @@ -86,14 +86,6 @@ if($debuglevel == 0) { } -if($document['Quote']['revision'] > 0) { - $filename = $enquiry['Enquiry']['title'].'rev'.$document['Quote']['revision'].'.pdf'; -} -else { - $filename = $enquiry['Enquiry']['title'].'.pdf'; -} - - $pdfdoc->Output($output_dir.$filename, 'F'); //echo "
Wrote: ".$output_dir.$filename; @@ -118,6 +110,10 @@ $newpdf->concat(); $newpdf->Output($output_dir.$filename, "F"); //$pdfdoc->Output($output_dir = '/Users/karlcordes/Sites/quotenik/app/webroot/pdf/'.'example_060.pdf', 'F'); -echo $html->link($filename, '/pdf/'.$filename); +//echo $html->link($filename, '/pdf/'.$filename); -?> \ No newline at end of file +?> + + \ No newline at end of file diff --git a/views/documents/view.ctp b/views/documents/view.ctp index 8d595d83..5852c625 100755 --- a/views/documents/view.ctp +++ b/views/documents/view.ctp @@ -4,12 +4,10 @@ echo $javascript->link('ckeditor/adapters/jquery'); echo $javascript->link('document_add_edit'); - switch($docType) { case 'quote': echo $this->element('document_quote_view'); break; - case 'invoice': echo $this->element('document_invoice_view'); break; @@ -54,6 +52,6 @@ switch($docType) { - + \ No newline at end of file diff --git a/views/elements/document_quote_view.ctp b/views/elements/document_quote_view.ctp index 5db830da..21d21a91 100644 --- a/views/elements/document_quote_view.ctp +++ b/views/elements/document_quote_view.ctp @@ -7,7 +7,7 @@ link($enquiry['Customer']['name'], array('controller'=>'customers','action'=>'view',$enquiry['Customer']['id']));?> - +element('pdf_created_message'); ?> create('Document',array('type'=>'post','action'=>'edit', 'default'=>false)); diff --git a/views/elements/pdf_created_message.ctp b/views/elements/pdf_created_message.ctp new file mode 100644 index 00000000..a576eee6 --- /dev/null +++ b/views/elements/pdf_created_message.ctp @@ -0,0 +1,7 @@ + +
+A link('PDF copy of this '.$docTypeFullName, '/pdf/'.$document['Document']['pdf_filename']);?> was created niceShort($document['Document']['pdf_created_at']);?> by + link($users[$document['Document']['pdf_created_by_user_id']], '/users/view/'.$document['Document']['pdf_created_by_user_id']);?> +
+ diff --git a/webroot/css/quotenik.css b/webroot/css/quotenik.css index 5a85c934..7ff24574 100755 --- a/webroot/css/quotenik.css +++ b/webroot/css/quotenik.css @@ -1610,3 +1610,11 @@ table.lineItems tr td.price { } +div.pdfGeneratedMessage { + margin-top: 2em; + margin-bottom: 2em; + padding: 1em; + border: 2px dashed; + width: 50%; + font-size: 140%; +} \ No newline at end of file