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

@@ -19,34 +19,8 @@ class Controller_User_Account extends Controller_Account {
* Enable User to Edit their Account Details
*/
public function action_edit() {
// Store our new values
$this->ao->values($_POST);
// Run validation and save
if ($this->ao->changed())
if ($this->ao->check()) {
SystemMessage::factory()
->title('Record updated')
->type('success')
->body(_('Your account record has been updated.'));
$this->ao->save();
} else {
$output = '';
// @todo Need to check that this still works with the new bootstrap theming
foreach ($this->ao->validation()->errors('forms/login') as $field => $error)
$output .= sprintf('<li><b>%s</b> %s</li>',$field,$error);
if ($output)
$output = sprintf('<ul>%s</ul>',$output);
SystemMessage::factory()
->title(_('Record NOT updated'))
->type('error')
->body(_('Your updates didnt pass validation.').'<br/>'.$output);
}
if ($_POST AND $this->ao->values($_POST)->changed() AND (! $this->save($this->ao)))
$this->ao->reload();
Block::factory()
->title(sprintf('Account: %s',$this->ao->accnum()))
@@ -70,7 +44,7 @@ class Controller_User_Account extends Controller_Account {
->title(_('Record NOT updated'))
->type('error')
->body(_('Your password didnt pass validation.'));
// Run validation and save
elseif ($this->ao->changed())
if ($this->ao->save()) {