Various little changes. some SQL differences too which arent tracked. stupidly
This commit is contained in:
parent
a6aedb0198
commit
b2bf24913f
|
|
@ -39,6 +39,7 @@ class CustomersController extends AppController {
|
||||||
$status_list[] = array($status['Status']['id'], $status['Status']['name']);
|
$status_list[] = array($status['Status']['id'], $status['Status']['name']);
|
||||||
}
|
}
|
||||||
$this->set('status_list', $status_list);
|
$this->set('status_list', $status_list);
|
||||||
|
$this->set('parent_industry_list', $this->Customer->Industry->find('list', array('conditions' => array('parent_id' => null))));
|
||||||
}
|
}
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ class EnquiriesController extends AppController {
|
||||||
if($enquiry['Enquiry']['shipping_address_id'] != 0) {
|
if($enquiry['Enquiry']['shipping_address_id'] != 0) {
|
||||||
$this->set('shippingaddress', $this->Enquiry->ShippingAddress->findById($enquiry['Enquiry']['shipping_address_id']));
|
$this->set('shippingaddress', $this->Enquiry->ShippingAddress->findById($enquiry['Enquiry']['shipping_address_id']));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,20 @@ class IndustriesController extends AppController {
|
||||||
$this->redirect(array('action'=>'index'));
|
$this->redirect(array('action'=>'index'));
|
||||||
}
|
}
|
||||||
$this->set('industry', $this->Industry->read(null, $id));
|
$this->set('industry', $this->Industry->read(null, $id));
|
||||||
|
$subCustomers = $this->Industry->findAllByParentId($id);
|
||||||
|
$this->set('sub_customers', $subCustomers);
|
||||||
|
|
||||||
|
$catCust = "";
|
||||||
|
foreach ($subCustomers as $indust) {
|
||||||
|
foreach ($indust['Customer'] as $subcust) {
|
||||||
|
$myid = $subcust['id'];
|
||||||
|
$catCust[$myid] = $subcust;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
$this->set('category_customers', $catCust);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
|
|
@ -44,9 +58,10 @@ class IndustriesController extends AppController {
|
||||||
|
|
||||||
if($new_industry['Industry']['parent_id'] == 0) {
|
if($new_industry['Industry']['parent_id'] == 0) {
|
||||||
|
|
||||||
|
$newsub = $this->data['Industry']['sub_category'];
|
||||||
$this->Industry->create();
|
$this->Industry->create();
|
||||||
$this->data['Industry']['parent_id'] = $newid;
|
$this->data['Industry']['parent_id'] = $newid;
|
||||||
$this->data['Industry']['name'] = $new_industry['Industry']['name']." - General";
|
$this->data['Industry']['name'] = $newsub;
|
||||||
$this->Industry->save($this->data);
|
$this->Industry->save($this->data);
|
||||||
}
|
}
|
||||||
$this->Session->setFlash(__('The Industry has been saved', true));
|
$this->Session->setFlash(__('The Industry has been saved', true));
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,10 @@ class Industry extends AppModel {
|
||||||
var $hasAndBelongsToMany = array (
|
var $hasAndBelongsToMany = array (
|
||||||
'Customer' => array(
|
'Customer' => array(
|
||||||
'className' => 'Customer',
|
'className' => 'Customer',
|
||||||
'joinTable' => 'industries_customers',
|
'joinTable' => 'industries_customers'
|
||||||
'unique' => false
|
// 'foreignKey' => 'industry_id',
|
||||||
)
|
// 'associationForeignKey' => 'customer_id'
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,6 +31,9 @@ class Industry extends AppModel {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@
|
||||||
echo $form->input('mobile');
|
echo $form->input('mobile');
|
||||||
echo $form->input('fax');
|
echo $form->input('fax');
|
||||||
echo $form->input('contact_category_id');
|
echo $form->input('contact_category_id');
|
||||||
|
echo $form->input('job_title');
|
||||||
echo $form->input('notes');
|
echo $form->input('notes');
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
echo $form->input("Contact.mobile");
|
echo $form->input("Contact.mobile");
|
||||||
echo $form->input("Contact.fax");
|
echo $form->input("Contact.fax");
|
||||||
echo $form->input("Contact.contact_category_id", array('options' => $contact_categories, 'label' => 'Contact Department'));
|
echo $form->input("Contact.contact_category_id", array('options' => $contact_categories, 'label' => 'Contact Department'));
|
||||||
|
echo $form->input("Contact.job_title");
|
||||||
echo $form->input("Contact.notes");
|
echo $form->input("Contact.notes");
|
||||||
echo $form->input("Contact.customer_id", array('type'=>'hidden', 'value' => $customerid));
|
echo $form->input("Contact.customer_id", array('type'=>'hidden', 'value' => $customerid));
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,10 @@
|
||||||
echo $form->input('mobile');
|
echo $form->input('mobile');
|
||||||
echo $form->input('fax');
|
echo $form->input('fax');
|
||||||
echo $form->input('contact_category_id', array('label'=>'Contact Department', 'empty' => 'Please Choose a Department'));
|
echo $form->input('contact_category_id', array('label'=>'Contact Department', 'empty' => 'Please Choose a Department'));
|
||||||
|
echo $form->input('job_title');
|
||||||
echo $form->input('notes');
|
echo $form->input('notes');
|
||||||
?>
|
|
||||||
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?php echo $form->end('Submit');?>
|
<?php echo $form->end('Submit');?>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
echo $form->input('mobile');
|
echo $form->input('mobile');
|
||||||
echo $form->input('fax');
|
echo $form->input('fax');
|
||||||
echo $form->input('contact_category_id', array('label' => 'Department', 'empty' => 'Please Choose a Department'));
|
echo $form->input('contact_category_id', array('label' => 'Department', 'empty' => 'Please Choose a Department'));
|
||||||
|
echo $form->input('job_title');
|
||||||
echo $form->input('notes');
|
echo $form->input('notes');
|
||||||
?>
|
?>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
||||||
|
|
@ -42,11 +42,19 @@
|
||||||
<?php echo $contact['Contact']['direct_phone']; ?>
|
<?php echo $contact['Contact']['direct_phone']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Fax'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Fax'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $contact['Contact']['fax']; ?>
|
<?php echo $contact['Contact']['fax']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Job Title'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $contact['Contact']['job_title']; ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Notes'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Notes'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $contact['Contact']['notes']; ?>
|
<?php echo $contact['Contact']['notes']; ?>
|
||||||
|
|
|
||||||
|
|
@ -85,3 +85,5 @@ foreach ($customers as $customer):
|
||||||
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add')); ?> </li>
|
<li><?php echo $html->link(__('New Enquiry', true), array('controller'=> 'enquiries', 'action'=>'add')); ?> </li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,22 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="related">
|
||||||
|
<h3><?php __('Industries that this Customer has been tagged in'); ?></h3>
|
||||||
|
<?php if(!empty($customer['Industry'])): ?>
|
||||||
|
<ul id="industrytaglist">
|
||||||
|
<?php foreach ($customer['Industry'] as $industry) {
|
||||||
|
echo "<li>".$html->link(__($industry['name'],true), array('action'=>'view', 'controller'=>'industries', $industry['id']))."</li>";
|
||||||
|
}
|
||||||
|
echo "</ul>";
|
||||||
|
endif;
|
||||||
|
echo "<br>";
|
||||||
|
echo "<div class=\"actions\">".$html->link("Tag Industries for this Customer", array('action'=>'tagindustries',$customer['Customer']['id']))."</div>";
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<h3><?php __('Contacts');?><?php echo $html->image('system-users.png'); ?></h3>
|
<h3><?php __('Contacts');?><?php echo $html->image('system-users.png'); ?></h3>
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
|
|
@ -148,3 +164,5 @@
|
||||||
|
|
||||||
|
|
||||||
<? debug($customer, true); ?>
|
<? debug($customer, true); ?>
|
||||||
|
|
||||||
|
<?php debug($parent_industry_list); ?>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<?
|
<?
|
||||||
echo $form->input('payment_terms', array('options' => array(
|
echo $form->input('payment_terms', array('empty'=>'Select the Terms of Payment', 'options' => array(
|
||||||
'100% Payment with Order' => '100% Payment with Order',
|
'100% Payment with Order' => '100% Payment with Order',
|
||||||
'Net 7 Days for Approved Accounts' => 'Net 7 Days for Approved Accounts',
|
'Net 7 Days for Approved Accounts' => 'Net 7 Days for Approved Accounts',
|
||||||
'Net 14 Days for Approved Accounts' => 'Net 14 Days for Approved Accounts',
|
'Net 14 Days for Approved Accounts' => 'Net 14 Days for Approved Accounts',
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -16,6 +16,7 @@ else {
|
||||||
|
|
||||||
if(!isset($parent)) {
|
if(!isset($parent)) {
|
||||||
echo $form->input('parent_id', array('type'=>'hidden', 'value' => 0));
|
echo $form->input('parent_id', array('type'=>'hidden', 'value' => 0));
|
||||||
|
echo $form->input('sub_category', array('label'=>'Name of the first Sub-Industry to this new Industry'));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo $form->input('parent_id', array('type'=>'hidden', 'value' => $parent['Industry']['id']));
|
echo $form->input('parent_id', array('type'=>'hidden', 'value' => $parent['Industry']['id']));
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,9 @@
|
||||||
|
|
||||||
<div class="related">
|
<div class="related">
|
||||||
<h3><?php __('Customers in this Industry');?></h3>
|
<h3><?php __('Customers in this Industry');?></h3>
|
||||||
<?php if (!empty($industry['Customer'])):?>
|
|
||||||
|
|
||||||
|
<?php if (!empty($industry['Customer'])):?>
|
||||||
<table cellpadding = "0" cellspacing = "0">
|
<table cellpadding = "0" cellspacing = "0">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php __('Name'); ?></th>
|
<th><?php __('Name'); ?></th>
|
||||||
|
|
@ -91,6 +93,42 @@
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
elseif (!empty($category_customers)): ?>
|
||||||
|
|
||||||
|
<table cellpadding = "0" cellspacing = "0">
|
||||||
|
<tr>
|
||||||
|
<th><?php __('Name'); ?></th>
|
||||||
|
<th><?php __('Notes'); ?></th>
|
||||||
|
<th><?php __('Payment Terms'); ?></th>
|
||||||
|
<th class="actions"><?php __('Actions');?></th>
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
$i = 0;
|
||||||
|
foreach ($category_customers as $customer):
|
||||||
|
$class = null;
|
||||||
|
if ($i++ % 2 == 0) {
|
||||||
|
$class = ' class="altrow"';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr<?php echo $class;?>>
|
||||||
|
<td><?php echo $customer['name'];?></td>
|
||||||
|
<td><?php echo $customer['notes'];?></td>
|
||||||
|
<td><?php echo $customer['payment_terms'];?></td>
|
||||||
|
<td class="actions">
|
||||||
|
<?php echo $html->link(__('View', true), array('controller'=> 'customers', 'action'=>'view', $customer['id'])); ?>
|
||||||
|
<?php echo $html->link(__('Edit', true), array('controller'=> 'customers', 'action'=>'edit', $customer['id'])); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php debug($industry); ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
|
||||||
<li><h3><?php echo $html->link('Quotes', '/quotes/index'); ?></h3>
|
<li><h3><?php echo $html->link('Quotes', '/quotes/index'); ?></h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li><?php echo $html->link('Quote Index', '/quotes/index'); ?></li>
|
<li><?php echo $html->link('Quote Index', '/quotes/index'); ?></li>
|
||||||
<li><?php echo $html->link('New Quote', '/quotes/add'); ?></li>
|
|
||||||
<li><?php echo $html->link('Find Quote', '/quotes/find'); ?></li>
|
<li><?php echo $html->link('Find Quote', '/quotes/find'); ?></li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
@ -140,18 +139,6 @@ if (window.attachEvent) window.attachEvent("onload", sfHover);
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="searchbox-appear">
|
|
||||||
<?php echo $form->create('Enquiry', array('id'=>'searchbox', 'action'=>'search'));
|
|
||||||
echo $form->input('Enquiry No', array('label'=>false, 'id'=>'searchbox', 'div'=>false));
|
|
||||||
echo $form->submit('Quick Lookup', array('div'=>false));
|
|
||||||
echo $form->end();
|
|
||||||
?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<?php
|
<?php
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
echo $form->input('name');
|
echo $form->input('name');
|
||||||
echo $form->input('short_name');
|
echo $form->input('short_name');
|
||||||
echo $form->input('code');
|
echo $form->input('code');
|
||||||
|
echo $form->input('url');
|
||||||
echo $form->input('address');
|
echo $form->input('address');
|
||||||
echo $form->input('city');
|
echo $form->input('city');
|
||||||
echo $form->input('state');
|
echo $form->input('state');
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
echo $form->input('name');
|
echo $form->input('name');
|
||||||
echo $form->input('short_name');
|
echo $form->input('short_name');
|
||||||
echo $form->input('code');
|
echo $form->input('code');
|
||||||
|
echo $form->input('url');
|
||||||
echo $form->input('address');
|
echo $form->input('address');
|
||||||
echo $form->input('city');
|
echo $form->input('city');
|
||||||
echo $form->input('state');
|
echo $form->input('state');
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,20 @@
|
||||||
<?php echo $principle['Principle']['short_name']; ?>
|
<?php echo $principle['Principle']['short_name']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Code'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Code'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $principle['Principle']['code']; ?>
|
<?php echo $principle['Principle']['code']; ?>
|
||||||
|
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('URL'); ?></dt>
|
||||||
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
<?php echo $html->link($principle['Principle']['url'], $principle['Principle']['url']); ?>
|
||||||
|
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Country'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
<?php echo $html->link($principle['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $principle['Country']['id'])); ?>
|
<?php echo $html->link($principle['Country']['name'], array('controller'=> 'countries', 'action'=>'view', $principle['Country']['id'])); ?>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,10 @@
|
||||||
<?php
|
<?php
|
||||||
echo $form->input('principle_id');
|
echo $form->input('principle_id');
|
||||||
echo $form->input('title');
|
echo $form->input('title');
|
||||||
echo $fck->fckeditor(array('Product', 'description'), '');
|
echo "<div class=\"input text\">";
|
||||||
|
echo "<label for=\"data[Product][description\">Description</label>";
|
||||||
|
echo $fck->fckeditor(array('Product', 'description'), '');
|
||||||
|
echo "</div>";
|
||||||
//echo $form->input('description');
|
//echo $form->input('description');
|
||||||
echo $form->input('part_number');
|
echo $form->input('part_number');
|
||||||
echo $form->input('product_category_id');
|
echo $form->input('product_category_id');
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue