Added User email viewing
Improved Table::
This commit is contained in:
@@ -11,10 +11,26 @@
|
||||
* @license http://dev.osbill.net/license.html
|
||||
*/
|
||||
class Model_Email_Log extends ORMOSB {
|
||||
protected $_belongs_to = array(
|
||||
'account'=>array('far_key'=>'id'),
|
||||
'email_template_translate'=>array('far_key'=>'id'),
|
||||
);
|
||||
|
||||
protected $_sorting = array(
|
||||
'id'=>'DESC',
|
||||
);
|
||||
|
||||
protected $_display_filters = array(
|
||||
'date_orig'=>array(
|
||||
array('Config::datetime',array(':value')),
|
||||
),
|
||||
);
|
||||
|
||||
public function translate_resolve($column) {
|
||||
if (! $this->data OR ! ($r = $this->email_template_translate->variables($column)))
|
||||
return $this->email_template_translate->display($column);
|
||||
else
|
||||
return $this->email_template_translate->resolve(unserialize(gzuncompress($this->data)),$column);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@@ -28,5 +28,14 @@ class Model_Email_Template_Translate extends ORMOSB {
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
public function resolve($data,$column) {
|
||||
$output = $this->display($column);
|
||||
|
||||
foreach ($this->variables($column) as $k => $v)
|
||||
$output = str_replace('%'.$v.'%',$data[$v],$output);
|
||||
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
Reference in New Issue
Block a user