Fixed add enquiry old version.
This commit is contained in:
parent
3eb6ca2367
commit
f5b2ed3c67
|
|
@ -12,7 +12,8 @@ class EmailAttachmentsController extends AppController {
|
||||||
$file = $this->EmailAttachment->findById($id);
|
$file = $this->EmailAttachment->findById($id);
|
||||||
|
|
||||||
$file_path = Configure::read('email_directory');
|
$file_path = Configure::read('email_directory');
|
||||||
|
echo $file_path."/".$file['EmailAttachment']['name'];
|
||||||
|
die();
|
||||||
if(file_exists($file_path."/".$file['EmailAttachment']['name'])) {
|
if(file_exists($file_path."/".$file['EmailAttachment']['name'])) {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,38 @@ class EnquiriesController extends AppController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function add_enquiry() {
|
||||||
|
|
||||||
|
Configure::write('debug', 0);
|
||||||
|
$this->layout = 'ajax';
|
||||||
|
if (!empty($this->data)) {
|
||||||
|
$this->Enquiry->create();
|
||||||
|
$this->Enquiry->set($this->data['Enquiry']);
|
||||||
|
if($this->User->validates()) {
|
||||||
|
if ($this->User->save($this->data)) {
|
||||||
|
$message = __('The User has been saved.', true);
|
||||||
|
$data = $this->data;
|
||||||
|
$this->set('success', compact('message', 'data'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$message = __('The User could not be saved. Please, try again.', true);
|
||||||
|
$User = $this->User->invalidFields();
|
||||||
|
$data = compact('User');
|
||||||
|
$this->set('errors', compact('message', 'data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$this->redirect('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function add() {
|
function add() {
|
||||||
|
|
||||||
|
|
@ -164,7 +196,7 @@ class EnquiriesController extends AppController {
|
||||||
$countries = $this->Enquiry->Country->find('list', array('order'=> 'Country.name asc'));
|
$countries = $this->Enquiry->Country->find('list', array('order'=> 'Country.name asc'));
|
||||||
$principles = $this->Enquiry->Principle->find('list', array('order' => 'Principle.name asc'));
|
$principles = $this->Enquiry->Principle->find('list', array('order' => 'Principle.name asc'));
|
||||||
$statuses = $this->Enquiry->Status->find('list');
|
$statuses = $this->Enquiry->Status->find('list');
|
||||||
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username')));
|
$users = $this->Enquiry->User->find('list', array('fields' => array('User.id', 'User.username'), 'conditions'=>array('User.type'=>'user')));
|
||||||
$this->set(compact('users', 'customers', 'states', 'countries', 'principles', 'statuses', 'contacts', 'customer'));
|
$this->set(compact('users', 'customers', 'states', 'countries', 'principles', 'statuses', 'contacts', 'customer'));
|
||||||
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id'])));
|
$customerAddresses = $this->Enquiry->BillingAddress->find('all', array('conditions'=>array('BillingAddress.customer_id' => $customer['Customer']['id'])));
|
||||||
$this->set('billing_addresses', $customerAddresses);
|
$this->set('billing_addresses', $customerAddresses);
|
||||||
|
|
|
||||||
|
|
@ -100,7 +100,7 @@ class Enquiry extends AppModel {
|
||||||
var $belongsTo = array(
|
var $belongsTo = array(
|
||||||
'User' => array('className' => 'User',
|
'User' => array('className' => 'User',
|
||||||
'foreignKey' => 'user_id',
|
'foreignKey' => 'user_id',
|
||||||
'conditions' => '',
|
'conditions' => array('User.type'=>'user'),
|
||||||
'fields' => '',
|
'fields' => '',
|
||||||
'order' => ''
|
'order' => ''
|
||||||
),
|
),
|
||||||
|
|
|
||||||
4
vendors/shells/vault_two.php
vendored
4
vendors/shells/vault_two.php
vendored
|
|
@ -692,7 +692,7 @@ class VaultTwoShell extends Shell {
|
||||||
* 4.
|
* 4.
|
||||||
*
|
*
|
||||||
* @param <type> $attachments
|
* @param <type> $attachments
|
||||||
*/
|
|
||||||
function moveAttachments($attachments, $email_dir, $unix_time) {
|
function moveAttachments($attachments, $email_dir, $unix_time) {
|
||||||
|
|
||||||
$month_year = date('m-Y');
|
$month_year = date('m-Y');
|
||||||
|
|
@ -708,7 +708,7 @@ class VaultTwoShell extends Shell {
|
||||||
}
|
}
|
||||||
die();
|
die();
|
||||||
|
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@ doesn't appear in the drop down list, click 'New Contact'")); ?>
|
||||||
echo '<div id="contact">';
|
echo '<div id="contact">';
|
||||||
echo $form->input('contact_id', array('div' => false));
|
echo $form->input('contact_id', array('div' => false));
|
||||||
echo '<br>';
|
echo '<br>';
|
||||||
echo $ajax->link('New Contact', array('controller' => 'contacts', 'action' => 'add_one',$customer['Customer']['id']), array('update'=>'contact'));
|
//echo $ajax->link('New Contact', array('controller' => 'contacts', 'action' => 'add_one',$customer['Customer']['id']), array('update'=>'contact'));
|
||||||
echo $html->image('contact-new.png');
|
//echo $html->image('contact-new.png');
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
echo '<span>The Contact will be emailed informing them of the new Enquiry</span>';
|
echo '<span>The Contact will be emailed informing them of the new Enquiry</span>';
|
||||||
echo $form->input('state_id', array('label'=>'State', 'empty' => 'Please Choose A State'));
|
echo $form->input('state_id', array('label'=>'State', 'empty' => 'Please Choose A State'));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue