Added Principle Contacts, Addresses, Product TinyMCE

This commit is contained in:
Karl Cordes 2009-02-27 11:58:33 +11:00
parent 0c0a5e0572
commit 29e67ad98c
31 changed files with 342 additions and 133 deletions

View file

@ -53,12 +53,13 @@ class ContactsController extends AppController {
$this->Session->setFlash(__('The Contact could not be saved. Please try again.', true));
}
}
$contact_categories = $this->Contact->ContactCategory->find('list');
$customer = $this->Contact->Customer->findById($customerid);
$this->set(compact('customer'));
$this->set(compact('customer', 'contact_categories'));
}
function add_another($increment) {
$this->set('contact_categories', $this->Contact->ContactCategory->find('list'));
$this->set('increment', $increment);
}
@ -83,8 +84,10 @@ class ContactsController extends AppController {
if (!empty($this->data)) {
$this->data['Contact']['name'] = $this->data['Contact']['first_name'].' '.$this->data['Contact']['last_name'];
if ($this->Contact->save($this->data)) {
$customerid = $this->data['Contact']['customer_id'];
$this->Session->setFlash(__('The Contact has been saved', true));
$this->redirect(array('action'=>'index'));
$this->redirect(array('controller' => 'Customers', 'action'=>'view/'.$customerid));
} else {
$this->Session->setFlash(__('The Contact could not be saved. Please, try again.', true));
}
@ -93,7 +96,8 @@ class ContactsController extends AppController {
$this->data = $this->Contact->read(null, $id);
}
$customers = $this->Contact->Customer->find('list');
$this->set(compact('customers'));
$contact_categories = $this->Contact->ContactCategory->find('list');
$this->set(compact('customers', 'contact_categories'));
}
function delete($id = null) {

View file

@ -30,7 +30,7 @@ class CustomersController extends AppController {
$this->set('customer', $this->Customer->read(null, $id));
$this->set('addresses', $this->Customer->Address->findAllByCustomerId($id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.customer_id' => $id)));
$this->set('contacts', $this->Customer->Contact->findAllByCustomerId($id));
$statuses = $this->Customer->Enquiry->Status->find('all');
$status_list = array();
foreach ($statuses as $status) {

View file

@ -37,7 +37,7 @@ class EnquiriesController extends AppController {
$this->set('number_of_emails', $this->Enquiry->Email->find('count', 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))));
$this->set('principle_emails', $this->Enquiry->Principle->PrincipleContact->findAllByPrincipleId($enquiry['Enquiry']['principle_id']));
if($enquiry['Enquiry']['billing_address_id'] != 0) {
$this->set('billingaddress', $this->Enquiry->BillingAddress->findById($enquiry['Enquiry']['billing_address_id']));
}
@ -139,6 +139,7 @@ class EnquiriesController extends AppController {
/* Feels like an ugly hack. But it gets the desired effect and it will do for now */
if(isset($customerAddresses[0]['BillingAddress'])) {
$billing_address_list[0] = "No Address Selected";
foreach ($customerAddresses as $address) {
$i = $address['BillingAddress']['id'];
$billing_address_list[$i] = $address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].' '.$address['BillingAddress']['postcode'].'<br>'.up($address['Country']['name']).'<br><br>';
@ -326,6 +327,7 @@ class EnquiriesController extends AppController {
/* Feels like an ugly hack. But it gets the desired effect and it will do for now */
if(isset($customerAddresses[0]['BillingAddress'])) {
$billing_address_list[0] = "No Address Selected";
foreach ($customerAddresses as $address) {
$i = $address['BillingAddress']['id'];
$billing_address_list[$i] = $address['BillingAddress']['address'].'<br>'.$address['BillingAddress']['city'].' '.$address['State']['name'].' '.$address['BillingAddress']['postcode'].'<br>'.up($address['Country']['name']).'<br><br>';

View file

@ -22,6 +22,8 @@ class PrinciplesController extends AppController {
}
$this->set('principle', $this->Principle->read(null, $id));
$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.principle_id' => $id)));
$this->set('addresses', $this->Principle->PrincipleAddress->findAllByPrincipleId($id));
$this->set('principleContacts', $this->Principle->PrincipleContact->findAllByPrincipleId($id));
$statuses = $this->Principle->Enquiry->Status->find('all');
$status_list = array();
foreach ($statuses as $status) {

View file

@ -17,7 +17,7 @@ class ProductOptionsController extends AppController {
$this->set('productOption', $this->ProductOption->read(null, $id));
}
function add() {
function add($productid = null) {
if (!empty($this->data)) {
$this->ProductOption->create();
if ($this->ProductOption->save($this->data)) {
@ -63,4 +63,4 @@ class ProductOptionsController extends AppController {
}
}
?>
?>

View file

@ -35,7 +35,10 @@ class Contact extends AppModel {
'conditions' => '',
'fields' => '',
'order' => ''
)
),
'ContactCategory' => array('className' => 'ContactCategory',
'foreignKey' => 'contact_category_id')
);
var $hasMany = array(

View file

@ -10,3 +10,4 @@ class CustomerCategory extends AppModel {
}
?>

View file

@ -43,7 +43,14 @@ class Principle extends AppModel {
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
),
'PrincipleAddress' => array('className' => 'PrincipleAddress',
'foreignKey' => 'principle_id'
),
'PrincipleContact' => array('className' => 'PrincipleContact',
'foreignKey' => 'principle_id'
),
);
}

View file

@ -23,9 +23,9 @@ class VaultShell extends Shell {
$mbox = imap_open("{saturn:143/novalidate-cert}INBOX", $username, $password) or die("can't connect: " . imap_last_error());
$MC = imap_check($mbox);
$number_of_messages = $MC->Nmsgs;
echo "Number of messages to Process ".$number_of_messages;
/* Loop through the messages and sort them into ones to be processed or discarded */
for ($i=1; $i < $number_of_messages; $i++) {
for ($i=1; $i <= $number_of_messages; $i++) {
$this_header = imap_headerinfo($mbox, $i);
$message = $this->getMessage($mbox, $i, $this_header);
$enquiry = $this->checkIfValidEnquiry($message['subject'], $testing);
@ -196,6 +196,7 @@ function clearEmailAttachmentDirs($email_dir, $filename, $attachments) {
function getMessage($mbox, $msgnumber, $headers) {
$subject = $headers->subject;
$subject = iconv_mime_decode($subject, 0, "ISO-8859-1");
$date = $headers->date;
$recipients = $this->getRecipients($headers);
$message['subject'] = $subject;
@ -257,14 +258,17 @@ function getBody($mbox, $msgnumber) {
}
function checkIfValidEnquiry($subject, $testing) {
$subject = iconv_mime_decode($subject, 0, "ISO-8859-1");
$output = array();
// $decoded_subject = iconv_mime_decode($subject, 2, "ISO-8859-1");
preg_match("/CMC\d+([NVQWSOT]|ACT|NT)E\d+-\d+/", $subject, $output);
preg_match("/CMC\d+([NVQWSO]|ACT|NT)E\d+-\d+/", $subject, $output);
if(isset($output[0])) { //Found a valid-looking Enquiry Number
$fetched_enquirynumber = $output[0];
echo $fetched_enquirynumber."\n";
$enquiry = $this->Enquiry->findByTitle($fetched_enquirynumber);
if($enquiry) {
return $enquiry;

View file

@ -10,6 +10,7 @@
echo $form->input('phone');
echo $form->input('mobile');
echo $form->input('fax');
echo $form->input('contact_category_id');
echo $form->input('notes');
?>
</fieldset>

View file

@ -10,6 +10,7 @@
echo $form->input("Contact.$increment.phone");
echo $form->input("Contact.$increment.mobile");
echo $form->input("Contact.$increment.fax");
echo $form->input("Contact.$increment.contact_category_id", array('options' => $contact_categories, 'label' => 'Contact Department'));
echo $form->input("Contact.$increment.notes");
$next = $increment;

View file

@ -12,6 +12,7 @@
echo $form->input("Contact.phone");
echo $form->input("Contact.mobile");
echo $form->input("Contact.fax");
echo $form->input("Contact.contact_category_id");
echo $form->input("Contact.notes");
echo $form->input("Contact.customer_id", array('type'=>'hidden', 'value' => $customerid));
?>

View file

@ -10,6 +10,7 @@
echo $form->input('phone');
echo $form->input('mobile');
echo $form->input('fax');
echo $form->input('contact_category_id', array('label'=>'Contact Department', 'empty' => 'Please Choose a Department'));
echo $form->input('notes');
?>
</fieldset>

View file

@ -3,7 +3,7 @@
<fieldset>
<legend><?php __('Edit Contact');?></legend>
<?php
echo $form->input('customer_id');
echo $form->input('customer_id', array('type'=>'hidden'));
echo $form->input('id');
echo $form->input('first_name');
echo $form->input('last_name');
@ -11,6 +11,7 @@
echo $form->input('phone');
echo $form->input('mobile');
echo $form->input('fax');
echo $form->input('contact_category_id', array('label' => 'Department', 'empty' => 'Please Choose a Department'));
echo $form->input('notes');
?>
</fieldset>

View file

@ -11,7 +11,7 @@
echo $form->input('notes');
echo '<div class="input select">';
echo $form->label('Customer.customer_category_id', 'Customer Category');
echo $form->select('customer_category_id', $customer_categories, 0, array('label'=>'Customer Category'), false);
echo $form->select('customer_category_id', $customer_categories, $this->data['Customer']['customer_category_id'], array('label'=>'Customer Category'), false);
echo '</div>';
?>
</fieldset>
@ -19,7 +19,6 @@
</div>
<div class="actions">
<ul>
<li><?php echo $html->link(__('Delete', true), array('action'=>'delete', $form->value('Customer.id')), null, sprintf(__('Are you sure you want to delete # %s?', true), $form->value('Customer.id'))); ?></li>
<li><?php echo $html->link(__('List Customers', true), array('action'=>'index'));?></li>
<li><?php echo $html->link(__('List Addresses', true), array('controller'=> 'addresses', 'action'=>'index')); ?> </li>
<li><?php echo $html->link(__('New Address', true), array('controller'=> 'addresses', 'action'=>'add')); ?> </li>

View file

@ -60,28 +60,31 @@
<th><?php __('Email Address'); ?></th>
<th><?php __('Phone Number'); ?></th>
<th><?php __('Fax Number'); ?></th>
<th><?php __('Department'); ?></th>
<th><?php __('Notes'); ?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
$i = 0;
foreach ($customer['Contact'] as $contact):
foreach ($contacts as $contact):
$class = null;
if ($i++ % 2 == 0) {
$class = ' class="altrow"';
}
?>
<tr<?php echo $class;?>>
<td><?php echo $contact['first_name'].' '.$contact['last_name'];?></td>
<td><?php echo $html->link($contact['email'], 'mailto:'.$contact['email']);?></td>
<td><?php echo $contact['phone'];?></td>
<td><?php echo $contact['fax'];?></td>
<td><?php echo $contact['notes'];?></td>
<td><?php echo $contact['Contact']['first_name'].' '.$contact['Contact']['last_name'];?></td>
<td><?php echo $html->link($contact['Contact']['email'], 'mailto:'.$contact['Contact']['email']);?></td>
<td><?php echo $contact['Contact']['phone'];?></td>
<td><?php echo $contact['Contact']['fax'];?></td>
<td><?php echo $contact['ContactCategory']['name']; ?></td>
<td><?php echo $contact['Contact']['notes'];?></td>
<td class="actions">
<?php echo $html->link(__('View', true), array('controller'=> 'contacts', 'action'=>'view', $contact['id'])); ?>
<?php echo $html->link(__('Edit', true), array('controller'=> 'contacts', 'action'=>'edit', $contact['id'])); ?>
<?php echo $html->link(__('View', true), array('controller'=> 'contacts', 'action'=>'view', $contact['Contact']['id'])); ?>
<?php echo $html->link(__('Edit', true), array('controller'=> 'contacts', 'action'=>'edit', $contact['Contact']['id'])); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>

View file

@ -20,31 +20,112 @@ Sincerely, <br /><br />
CMC Technologies<br />
<size=-1>*****************************************************************************************</FONT><BR><FONT
size=2><FONT color=#000099>&nbsp;<B>CMC Technologies Pty Limited</B> </FONT>-
<FONT size=1>ACN: 085 991 224 , ABN: 47 085 991 224</FONT> <BR><FONT
face="Times New Roman TUR">&nbsp;Engineering &amp; Industrial
Instrumentation</FONT> <BR><FONT face="Times New Roman TUR">&nbsp;Unit 19, 77
Bourke Road</FONT> <BR><FONT face="Times New Roman TUR">&nbsp;Alexandria, NSW,
2015</FONT> <BR><FONT face="Times New Roman TUR">&nbsp;AUSTRALIA</FONT>
<BR><FONT face="Times New Roman TUR">&nbsp;phone: +61 2 9669 4000</FONT>
<BR><FONT face="Times New Roman TUR">&nbsp;fax&nbsp;&nbsp;&nbsp; :&nbsp; +61 2
9669 4111</FONT> <BR><FONT face="Times New Roman TUR">&nbsp;web&nbsp;&nbsp; :
<B><U><A
href="http://www.cmctechnologies.com.au">http://www.cmctechnologies.com.au</A></U></B></FONT></FONT>
</P>
<P><FONT size=2><FONT face="Times New Roman TUR">Specialising in <FONT
color=#800000>Fire and Explosion Prevention or Protection, Overpressure
Protection</FONT>, <FONT color=#008080>Vision in the Process,</FONT><BR><FONT
color=#0000ff>Flow Measurement,</FONT> <FONT color=#008000>Pressure -
Differential Pressure, and Temperature - Humidity measurement/logging</FONT>,
<FONT color=#808000>On-Line Analysers.</FONT></FONT><BR></FONT><FONT
face="Times New Roman TUR">*****************************************************************************************</FONT><BR><FONT
face="Times New Roman TUR" size=2>The information in this message is
confidential and may be priveleged. If you are not the intended recipient then
access, disclosure, <br>copying or other dissemination of the contents of this
message is unauthorised and may be priveledged. <br>Please inform the sender
immediately if you are not the intended addressee.<br>All correspondence is subject
to CMC Technologies' Terms and Conditions of Sale - July 1, 2006.</FONT><br>
*****************************************************************************************</P>
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:"Rage Italic";
panose-1:3 7 5 2 4 5 7 7 3 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
{page:Section1;}
-->
</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div>
<div class="MsoNormal"><span style="font-size: 10pt;">
<hr style="color: gray;" align="left" noshade="noshade" size="2"
width="100%"></span></div>
</div>
<p class="MsoNormal"><b><span style="color: rgb(0, 0, 153);">CMC
Technologies Pty Limited</span></b><span style="color: rgb(0, 0, 153);">
</span><span style="font-size: 10pt;">- </span><span
style="font-size: 7.5pt;">ACN: 085 991 224 , ABN: 47 085 991 224</span><span
style="font-size: 10pt;"> <br>
</span><span style="font-size: 10pt;">Engineering &amp; Industrial
Instrumentation</span><span style="font-size: 9pt;"> </span><span
style="font-size: 10pt;"><br>
<br>
</span><o:p></o:p></p>
<p class="MsoNormal">Unit 19, 77 Bourke Road<span
style="font-size: 10pt;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b>Phone:</b>
+61 2 9669 4000<span style="font-size: 10pt;"><br>
</span>Alexandria, NSW, 2015<span style="font-size: 10pt;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span><b>Fax:
</b>+61 2 9669 4111<span style="font-size: 10pt;"><br>
</span>AUSTRALIA&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<b>Web:</b>
<a href="http://www.cmctechnologies.com.au/"><b><span
style="color: blue;">http://www.cmctechnologies.com.au</span></b></a><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size: 10pt;">&nbsp;<o:p></o:p></span></p>
<p class="MsoNormal">Specialising in <span
style="color: rgb(148, 54, 52);">Fire and
Explosion Prevention or Protection, Overpressure Protection</span>, <span
style="color: rgb(49, 132, 155);">Vision in the Process</span><span
style="color: teal;">, </span><span style="color: rgb(54, 95, 145);">Flow
Measurement</span><span style="color: rgb(0, 176, 80);">,
Pressure - Differential Pressure, and Temperature - Humidity
Measurement/logging</span>, <span style="color: rgb(148, 138, 84);">On-Line
Analysers</span><span style="font-size: 10pt;"><o:p></o:p></span></p>
<div>
<div class="MsoNormal"><span style="font-size: 10pt;">
<hr style="color: gray;" align="left" noshade="noshade" size="2"
width="100%"></span></div>
</div>
<p class="MsoNormal" style="margin-top: 6pt;"><span
style="font-size: 10pt;">The
information in this message is confidential and may be priveleged. If
you are
not the intended recipient then access, disclosure, copying or other
dissemination of the contents of this message is unauthorised and may
be
priveledged. Please inform the sender immediately if you are not the
intended
addressee.All correspondence is subject to CMC Technologies' Terms and
Conditions of Sale - July 1, 2006</span><span style="font-size: 8pt;"><o:p></o:p></span></p>
<div>
<div class="MsoNormal"><span style="font-size: 10pt;">
<hr style="color: gray;" align="left" noshade="noshade" size="2"
width="100%"></span></div>
</div>

View file

@ -16,8 +16,7 @@
<th><?php echo $paginator->sort('contact_id');?></th>
<th><?php __('Email'); ?></th>
<th><?php __('Phone No'); ?></th>
<th><?php echo $paginator->sort('state_id');?></th>
<th><?php echo $paginator->sort('country_id');?></th>
<th><?php echo $paginator->sort('status_id');?></th>
<th><?php echo $paginator->sort('comments');?></th>
@ -99,19 +98,14 @@ foreach ($enquiries as $enquiry):
<td>
<?php echo $enquiry['Contact']['phone']; ?>
</td>
<td>
<?php echo $html->link($enquiry['State']['shortform'], array('controller'=> 'states', 'action'=>'view', $enquiry['State']['id'])); ?>
</td>
<td>
<?php echo $html->link($enquiry['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $enquiry['Country']['id'])); ?>
</td>
<td class="status"><div id="statusupdate_<?php echo $i;?>"><?php echo $enquiry['Status']['name']; ?></div>
<?php
echo $ajax->editor("statusupdate_$i", array('controller'=>'Enquiries', 'action'=>'update_status', $enquiry['Enquiry']['id']), array('update' => "statusupdate_$i", 'collection' => $status_list, 'okText'=>'Change Status', 'savingText' => 'Saving..', 'formId' => 'EnquiryStatusId',
'formClassName' => 'MER-inplace-select'));
?>
</td>
<td class = "comments">
<td class="comments">
<?php
$displayedComment = substr($enquiry['Enquiry']['comments'], 0, 260);
@ -130,7 +124,7 @@ foreach ($enquiries as $enquiry):
<?php $i++; ?>
<?php endforeach; ?>
</table>
</div>
<div class="paging">
<?php echo $paginator->prev('<< '.__('previous', true), array(), null, array('class'=>'disabled'));?>

View file

@ -5,7 +5,7 @@ doesn't appear in the drop down list, click 'New Contact'")); ?>
<div class="enquiries form">
<?php echo $form->create('Enquiry', array('action' => 'add/customerid:'.$customer['Customer']['id']));?>
<fieldset>
<legend><?php __("New Enquiry for: ".$customer['Customer']['name']);?></legend>
<legend><?php __("New Enquiry");?></legend>
<?php
echo $form->input('Customer.name', array('readonly'=>'readonly', 'value'=>$customer['Customer']['name']));

View file

@ -9,7 +9,6 @@
echo $form->input('id');
echo $form->input('user_id', array('label'=>'Assigned to User'));
echo $form->input('principle_id');
//echo $form->input('Principle.name', array('label'=>'Principle','readonly'=>'readonly', 'value'=>$principle['Principle']['name']));
echo $form->input('Customer.name', array('label'=>'Customer','readonly'=>'readonly', 'value'=>$customer['Customer']['name']));
echo $form->input('contact_id');
echo $form->input('State.name', array('label'=>'State','readonly'=>'readonly', 'value'=>$state['State']['name']));

View file

@ -1,4 +1,4 @@
<div class="enquiries view">
<div class="enquiries-view">
<h2><?php __("Enquiry: " . $enquiry['Enquiry']['title']);?></h2>
<dl><?php $i = 0; $class = ' class="altrow"';?>
@ -91,12 +91,25 @@
</dd>
</dl>
</div>
<div class="actions">
<div class="enquiry-actions">
<ul>
<li><?php echo $html->link(__('Edit Enquiry', true), array('action'=>'edit', $enquiry['Enquiry']['id'])); ?> </li>
</ul>
</div>
</div>
<div class="principle-emails">
<?php
$boxdata = array();
$boxdata['enquirynumber'] = $enquiry['Enquiry']['title'];
//$boxdata['principle_emails'] = $principle_emails;
?>
<?php echo $this->element('principle_contacts_email_box', array('enquirynumber' => $enquiry['Enquiry']['title'],
'principle_emails' => $principle_emails )); ?>
</div>
<div id="showemail">
</div>

View file

@ -35,10 +35,12 @@
<? echo $html->meta('icon'); ?>
<?php
echo $html->css('quotenik');
echo $scripts_for_layout;
echo $javascript->link('prototype');
echo $javascript->link('scriptaculous');
echo $javascript->link('qtip');
echo $scripts_for_layout;
?>
<script type="text/javascript"><!--//--><![CDATA[//><!--

View file

@ -11,9 +11,6 @@ echo $paginator->counter(array(
<th><?php echo $paginator->sort('id');?></th>
<th><?php echo $paginator->sort('name');?></th>
<th><?php echo $paginator->sort('code');?></th>
<th><?php echo $paginator->sort('address');?></th>
<th><?php echo $paginator->sort('city');?></th>
<th><?php echo $paginator->sort('state');?></th>
<th><?php echo $paginator->sort('country_id');?></th>
<th><?php echo $paginator->sort('currency_id');?></th>
<th class="actions"><?php __('Actions');?></th>
@ -36,15 +33,6 @@ foreach ($principles as $principle):
<td>
<?php echo $principle['Principle']['code']; ?>
</td>
<td>
<?php echo $principle['Principle']['address']; ?>
</td>
<td>
<?php echo $principle['Principle']['city']; ?>
</td>
<td>
<?php echo $principle['Principle']['state']; ?>
</td>
<td>
<?php echo $html->link($principle['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $principle['Country']['id'])); ?>
</td>

View file

@ -1,11 +1,6 @@
<div class="principles view">
<h2><?php __('Principle');?></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 $principle['Principle']['id']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Name'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['name']; ?>
@ -16,21 +11,7 @@
<?php echo $principle['Principle']['code']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Address'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['address']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('City'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['city']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('State'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $principle['Principle']['state']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $html->link($principle['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $principle['Country']['id'])); ?>
@ -46,19 +27,34 @@
<div class="actions">
<ul>
<li><?php echo $html->link(__('Edit Principle', true), array('action'=>'edit', $principle['Principle']['id'])); ?> </li>
<li><?php echo $html->link(__('Delete Principle', true), array('action'=>'delete', $principle['Principle']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $principle['Principle']['id'])); ?> </li>
<li><?php echo $html->link(__('List Principles', true), array('action'=>'index')); ?> </li>
<li><?php echo $html->link(__('New Principle', true), array('action'=>'add')); ?> </li>
<li><?php echo $html->link(__('List Countries', true), array('controller'=> 'countries', 'action'=>'index')); ?> </li>
<li><?php echo $html->link(__('New Country', true), array('controller'=> 'countries', 'action'=>'add')); ?> </li>
<li><?php echo $html->link(__('List Currencies', true), array('controller'=> 'currencies', 'action'=>'index')); ?> </li>
<li><?php echo $html->link(__('New Currency', true), array('controller'=> 'currencies', '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 Products', true), array('controller'=> 'products', 'action'=>'index')); ?> </li>
<li><?php echo $html->link(__('New Product', true), array('controller'=> 'products', 'action'=>'add')); ?> </li>
</ul>
</div>
<div class="related">
<h3><?php __('Principle Contacts');?> <?php echo $html->image('system-users.png'); ?></h3>
<?php if (!empty($principle['PrincipleContact'])):?>
<? echo $this->element('principle_contacts', $principleContacts); ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Contact for this Principle', true), array('controller'=> 'principle_contacts', 'action'=>'add/principleid:'.$principle['Principle']['id']));?><?php echo $html->link($html->image('contact-new.png'), array('controller'=> 'principle_contacts', 'action'=>'add/customerid:'.$principle['Principle']['id']), null, null, false); ?> </li>
</ul>
</div>
</div>
<div class="related">
<h3><?php __('Addresses');?> <?php echo $html->image('x-office-address-book.png'); ?></h3>
<?php if (!empty($principle['PrincipleAddress'])):?>
<? echo $this->element('principle_address_table', $addresses); ?>
<?php endif; ?>
<div class="actions">
<ul>
<li><?php echo $html->link(__('New Address for this Principle', true), array('controller'=> 'principle_addresses', 'action'=>'add/principleid:'.$principle['Principle']['id']));?> </li>
</ul>
</div>
</div>
<div class="related">
<h3><?php __('Related Enquiries');?></h3>
<?php if (!empty($principle['Enquiry'])):?>
@ -131,3 +127,4 @@
</ul>
</div>
</div>
<?pr($principle); ?>

View file

@ -6,13 +6,19 @@
echo $form->input('product_id');
echo $form->input('title');
echo $form->input('description');
echo $form->input('cost_price');
echo $form->input('part_number');
echo $form->input('cost_price_each');
echo $form->input('exchange_rate');
echo $form->input('our_discount');
echo $form->input('packing_each');
echo $form->input('shipping_weight_each');
echo $form->input('shipping_cost_each');
echo $form->input('duty');
echo $form->input('sell_price_each');
echo $form->input('customs');
echo $form->input('finance');
echo $form->input('misc_cost');
echo $form->input('sellprice_each');
echo $form->input('notes');
?>
</fieldset>
<?php echo $form->end('Submit');?>

View file

@ -7,13 +7,19 @@
echo $form->input('product_id');
echo $form->input('title');
echo $form->input('description');
echo $form->input('cost_price');
echo $form->input('part_number');
echo $form->input('cost_price_each');
echo $form->input('exchange_rate');
echo $form->input('our_discount');
echo $form->input('packing_each');
echo $form->input('shipping_weight_each');
echo $form->input('shipping_cost_each');
echo $form->input('duty');
echo $form->input('sell_price_each');
echo $form->input('customs');
echo $form->input('finance');
echo $form->input('misc_cost');
echo $form->input('sellprice_each');
echo $form->input('notes');
?>
</fieldset>
<?php echo $form->end('Submit');?>

View file

@ -12,13 +12,19 @@ echo $paginator->counter(array(
<th><?php echo $paginator->sort('product_id');?></th>
<th><?php echo $paginator->sort('title');?></th>
<th><?php echo $paginator->sort('description');?></th>
<th><?php echo $paginator->sort('cost_price');?></th>
<th><?php echo $paginator->sort('part_number');?></th>
<th><?php echo $paginator->sort('cost_price_each');?></th>
<th><?php echo $paginator->sort('exchange_rate');?></th>
<th><?php echo $paginator->sort('our_discount');?></th>
<th><?php echo $paginator->sort('packing_each');?></th>
<th><?php echo $paginator->sort('shipping_weight_each');?></th>
<th><?php echo $paginator->sort('shipping_cost_each');?></th>
<th><?php echo $paginator->sort('duty');?></th>
<th><?php echo $paginator->sort('sell_price_each');?></th>
<th><?php echo $paginator->sort('customs');?></th>
<th><?php echo $paginator->sort('finance');?></th>
<th><?php echo $paginator->sort('misc_cost');?></th>
<th><?php echo $paginator->sort('sellprice_each');?></th>
<th><?php echo $paginator->sort('notes');?></th>
<th class="actions"><?php __('Actions');?></th>
</tr>
<?php
@ -43,7 +49,13 @@ foreach ($productOptions as $productOption):
<?php echo $productOption['ProductOption']['description']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['cost_price']; ?>
<?php echo $productOption['ProductOption']['part_number']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['cost_price_each']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['exchange_rate']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['our_discount']; ?>
@ -61,7 +73,19 @@ foreach ($productOptions as $productOption):
<?php echo $productOption['ProductOption']['duty']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['sell_price_each']; ?>
<?php echo $productOption['ProductOption']['customs']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['finance']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['misc_cost']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['sellprice_each']; ?>
</td>
<td>
<?php echo $productOption['ProductOption']['notes']; ?>
</td>
<td class="actions">
<?php echo $html->link(__('View', true), array('action'=>'view', $productOption['ProductOption']['id'])); ?>

View file

@ -21,9 +21,19 @@
<?php echo $productOption['ProductOption']['description']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Cost Price'); ?></dt>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Part Number'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['cost_price']; ?>
<?php echo $productOption['ProductOption']['part_number']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Cost Price Each'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['cost_price_each']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Exchange Rate'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['exchange_rate']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Our Discount'); ?></dt>
@ -51,9 +61,29 @@
<?php echo $productOption['ProductOption']['duty']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sell Price Each'); ?></dt>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Customs'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['sell_price_each']; ?>
<?php echo $productOption['ProductOption']['customs']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Finance'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['finance']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Misc Cost'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['misc_cost']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Sellprice Each'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['sellprice_each']; ?>
&nbsp;
</dd>
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Notes'); ?></dt>
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
<?php echo $productOption['ProductOption']['notes']; ?>
&nbsp;
</dd>
</dl>

View file

@ -1,5 +1,6 @@
<?php echo $javascript->link('quotenik/product_buildup.js', false); ?>
<?php echo $javascript->link('tiny_mce/tiny_mce', false); ?>
<?php echo $javascript->link('tiny_mce/tiny_init', false); ?>
<div class="addproduct">
<?php echo $form->create('Product', array('id'=>'productaddform', 'class'=>'addproduct'));?>
<fieldset>

View file

@ -29,7 +29,7 @@ dt.altrow {
background: #E6F0F0;
}
dd {
margin-left: 20em;
margin-left: 10em;
margin-top: -2em;
vertical-align: top;
}

View file

@ -85,6 +85,13 @@ ul, li {
margin: 0 12px;
}
ul.principle-emails {
list-style: none;
margin-left: 0;
}
/* Layout */
#container {
text-align: left;
@ -115,7 +122,6 @@ ul, li {
}
#username {
position: absolute;
right:0;
width: 20%;
@ -221,6 +227,8 @@ a#mailheaders {
}
#printemailbody {
text-align: left;
@ -326,12 +334,15 @@ table.mer {
background: #fff;
border:1px solid #ccc;
border-right:0;
clear: both;
color: #333;
margin-bottom: 10px;
width: 100%;
font-size: 85%;
}
padding-left: 0;
padding-right: 0;
overflow: auto;
}
th.mer {
background: #f2f2f2;
border:1px solid #bbb;
@ -385,11 +396,6 @@ table.mer tr td.posted {
table.mer tr td.notposted {
background: #FFFFFF;
}
table.mer tr td.nowrap {
font-size: small;
text-align: left;
white-space: nowrap;
}
table.mer tr td.comments {
font-size: small;
@ -455,6 +461,16 @@ dt {
dt.altrow {
background: #E6F0F0;
}
dd.mailheaders {
margin-top: -2em;
vertical-align: top;
}
dd.mailheaders-altrow {
margin-top: -2em;
vertical-align: top;
background: #E6F0F0;
}
dd {
margin-left: 20em;
margin-top: -2em;
@ -777,6 +793,23 @@ div.code-coverage-results span.result-good {
color: #0a0;
}
div.principle-emails {
float: right;
background: #E5E5E5;
border: 1px black dashed;
width: auto;
text-align: left;
font-size: 70%;
margin:0;
padding:0;
}
div.enquiries-view {
position: relative;
float: left;
width: 80%;
}
div.auto_complete {
position :relative;
width :500x;
@ -812,6 +845,11 @@ span.warning {
span.highlight {
background-color: #74DD63;
}
span.principle-emails {
color: #000000;
padding-left: 2px;
}
span.tip {