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

@@ -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 = '';