Fixed view_user_email query
This commit is contained in:
parent
026be164bf
commit
72ccd205ef
|
|
@ -67,6 +67,7 @@ class EmailsController extends AppController {
|
||||||
return $attachment['id'];
|
return $attachment['id'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//Should do something else here to take a stab at it at least.
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -95,8 +96,12 @@ class EmailsController extends AppController {
|
||||||
else {
|
else {
|
||||||
//$this->set('emails', $this->paginate());
|
//$this->set('emails', $this->paginate());
|
||||||
$fromMailIDs = $this->Email->find('list', array('conditions'=>array('Email.user_id'=>$id)));
|
$fromMailIDs = $this->Email->find('list', array('conditions'=>array('Email.user_id'=>$id)));
|
||||||
$recMailIDs = $this->Email->EmailRecipient->find('list', array('conditions'=>array('EmailRecipient.user_id'=>$id)));
|
$recMailIDs = $this->Email->EmailRecipient->find('list', array('conditions'=>array('EmailRecipient.user_id'=>$id),
|
||||||
|
'fields'=>array('EmailRecipient.email_id', 'EmailRecipient.email_id')));
|
||||||
|
|
||||||
|
// print_r($recMailIDs);
|
||||||
|
|
||||||
|
// print_r($fromMailIDs);
|
||||||
$allIDs = $fromMailIDs + $recMailIDs;
|
$allIDs = $fromMailIDs + $recMailIDs;
|
||||||
|
|
||||||
sort($allIDs);
|
sort($allIDs);
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,10 @@ class UsersController extends AppController {
|
||||||
|
|
||||||
switch($user['User']['type']) {
|
switch($user['User']['type']) {
|
||||||
case 'contact':
|
case 'contact':
|
||||||
|
|
||||||
|
if(isset($user['User']['customer_id'])) {
|
||||||
|
$this->set('customer', $this->User->Customer->find('first',array('conditions'=>array('Customer.id'=>$user['User']['customer_id']), 'recursive'=>0)));
|
||||||
|
}
|
||||||
$this->render('viewContact');
|
$this->render('viewContact');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -111,6 +115,8 @@ class UsersController extends AppController {
|
||||||
//$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.user_id' => $id)));
|
//$this->set('enquiries', $this->paginate('Enquiry', array('Enquiry.user_id' => $id)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->render('viewUser');
|
$this->render('viewUser');
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -25,3 +25,4 @@ User Email<?php echo $html->image('internet-mail.png'); ?>
|
||||||
<?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>
|
</div>
|
||||||
|
|
||||||
|
<?php debug($userMail); ?>
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
|
<?=$javascript->link('view_user_email'); ?>
|
||||||
|
|
||||||
<div class="users view">
|
<div class="users view">
|
||||||
<h2><?php __('Contact: '.$user['User']['username'] );?></h2>
|
<h2><?php __('Contact: '.$user['User']['username'] );?></h2>
|
||||||
<h3>Customer: <?=$html->link($user['Customer']['name'], '/customers/view/'.$user['Customer']['id']);?></h3>
|
|
||||||
|
<? if(isset($customer)):?>
|
||||||
|
<h3>Customer: <?=$html->link($customer['Customer']['name'], '/customers/view/'.$customer['Customer']['id']);?></h3>
|
||||||
|
<? endif;?>
|
||||||
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
<dl><?php $i = 0; $class = ' class="altrow"';?>
|
||||||
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Username'); ?></dt>
|
<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Username'); ?></dt>
|
||||||
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
<dd<?php if ($i++ % 2 == 0) echo $class;?>>
|
||||||
|
|
@ -62,4 +67,17 @@
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="related">
|
||||||
|
<h3>Email Correspondence with this Contact.</h3>
|
||||||
|
<button id="showEmail" class="showHide">Show</button>
|
||||||
|
<button id="hideEmail" class="showHide">Hide</button>
|
||||||
|
|
||||||
|
<div id="ajaxLoadEmail" style="display:none;"><?php echo $html->image('ajax-loader.gif'); ?></div>
|
||||||
|
|
||||||
|
|
||||||
|
<div id="emailTable">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<?php debug($user);?>
|
<?php debug($user);?>
|
||||||
Loading…
Reference in a new issue