Minor improvements to blobs

This commit is contained in:
Deon George
2012-01-01 20:41:42 +11:00
parent 6672913460
commit 407eed04c9
6 changed files with 30 additions and 38 deletions

View File

@@ -153,7 +153,6 @@ class Email_Template {
if ($result) {
// Store our email log.
$data = gzcompress(serialize($this->email_data['variables']));
$elo = ORM::factory('email_log');
foreach ($sa as $id) {
@@ -162,7 +161,7 @@ class Email_Template {
$elo->account_id = $id;
$elo->email = implode(',',array_keys($this->to));
$elo->email_template_translate_id = $this->etto->id;
$elo->data = $data;
$elo->data = $this->email_data['variables'];
$elo->save();
}
}

View File

@@ -11,6 +11,9 @@
* @license http://dev.osbill.net/license.html
*/
class Model_Email_Log extends ORMOSB {
// Email Log doesnt use the update column
protected $_updated_column = FALSE;
protected $_belongs_to = array(
'account'=>array('far_key'=>'id'),
'email_template_translate'=>array('far_key'=>'id'),
@@ -27,10 +30,10 @@ class Model_Email_Log extends ORMOSB {
);
public function translate_resolve($column) {
if (! $this->data OR ! ($r = $this->email_template_translate->variables($column)))
if (! $this->data OR ! ($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);
return $this->email_template_translate->resolve($this->data,$column);
}
}
?>