Work on Email and other major consistency work

This commit is contained in:
Deon George
2013-11-22 15:36:50 +11:00
parent 89deb9c97b
commit c18d5a3881
55 changed files with 550 additions and 575 deletions

View File

@@ -22,6 +22,9 @@ abstract class ORM extends Kohana_ORM {
// Tables that do not have a site_id column
public static $no_site_id_tables = array('setup','country','currency','language','tax');
// Whether to show a SystemMessage when a record is saved.
protected $_save_message = FALSE;
/**
* Add our OSB site_id to each SELECT query
* @see parent::__build()
@@ -215,6 +218,18 @@ abstract class ORM extends Kohana_ORM {
return $x;
}
public function save(Validation $validation=NULL) {
parent::save();
if ($this->saved() AND $this->_save_message)
SystemMessage::factory()
->title('Record Updated')
->type('success')
->body(sprintf('Record %s:%s Updated',$this->_table_name,$this->id));
return $this;
}
public function where_active() {
return $this->_where_active();
}