Work on Email and other major consistency work
This commit is contained in:
@@ -127,46 +127,12 @@ class Controller_Admin_Service extends Controller_Service {
|
||||
if (isset($_POST['plugin']) AND $_POST['plugin']) {
|
||||
$p = $so->plugin();
|
||||
|
||||
if ($p->values($_POST['plugin'])->changed() AND $p->check()) {
|
||||
try {
|
||||
$p->values($_POST['plugin'])->save();
|
||||
SystemMessage::factory()
|
||||
->title('Record PLUGIN updated')
|
||||
->type('success')
|
||||
->body(_('Your Charge record has been recorded/updated.'));
|
||||
|
||||
} catch (ORM_Validation_Exception $e) {
|
||||
$errors = $e->errors('models');
|
||||
|
||||
SystemMessage::factory()
|
||||
->title('Record PLUGIN NOT updated')
|
||||
->type('error')
|
||||
->body(join('<br/>',array_values($errors)));
|
||||
|
||||
$so->reload();
|
||||
}
|
||||
}
|
||||
if ($p->values($_POST['plugin'])->changed() AND ! $this->save($p))
|
||||
$p->reload();
|
||||
}
|
||||
|
||||
if ($so->values($_POST)->changed() AND $so->check()) {
|
||||
try {
|
||||
$so->values($_POST)->save();
|
||||
SystemMessage::factory()
|
||||
->title('Record updated')
|
||||
->type('success')
|
||||
->body(_('Your Charge record has been recorded/updated.'));
|
||||
|
||||
} catch (ORM_Validation_Exception $e) {
|
||||
$errors = $e->errors('models');
|
||||
|
||||
SystemMessage::factory()
|
||||
->title('Record NOT updated')
|
||||
->type('error')
|
||||
->body(join('<br/>',array_values($errors)));
|
||||
|
||||
$so->reload();
|
||||
}
|
||||
}
|
||||
if ($so->values($_POST)->changed() AND ! $this->save($so))
|
||||
$so->reload();
|
||||
}
|
||||
|
||||
Script::factory()
|
||||
@@ -211,10 +177,8 @@ $(document).ready(function() {
|
||||
|
||||
$so = ORM::factory('Service',$id);
|
||||
|
||||
if (! $so->loaded() OR ! Auth::instance()->authorised($so->account)) {
|
||||
$this->template->content = 'Unauthorised or doesnt exist?';
|
||||
return FALSE;
|
||||
}
|
||||
if (! $so->loaded() OR ! Auth::instance()->authorised($so->account))
|
||||
throw HTTP_Exception::factory(403,'Service either doesnt exist, or you are not authorised to see it');
|
||||
|
||||
$doutput = $loutput = '';
|
||||
|
||||
|
@@ -91,6 +91,12 @@ class Model_Service extends ORM_OSB {
|
||||
return $format ? Currency::display($total) : $total;
|
||||
}
|
||||
|
||||
public function email() {
|
||||
return ORM::factory('Email_Log')
|
||||
->where('module_id','=',$this->mid())
|
||||
->where('module_data','=',$this);
|
||||
}
|
||||
|
||||
/**
|
||||
* When does this service expire
|
||||
*/
|
||||
|
Reference in New Issue
Block a user