Added Service Add, some internal consistency updates

This commit is contained in:
Deon George
2013-11-27 11:22:20 +11:00
parent c18d5a3881
commit 0ed5e5163d
29 changed files with 372 additions and 179 deletions

View File

@@ -68,7 +68,7 @@ class Config extends Kohana_Config {
* Show a date using a site configured format
*/
public static function date($date) {
return is_null($date) ? '' : date(Company::instance()->date_format(),$date);
return (is_null($date) OR ! $date) ? '' : date(Company::instance()->date_format(),$date);
}
/**

View File

@@ -52,9 +52,7 @@ abstract class Controller_TemplateDefault extends lnApp_Controller_TemplateDefau
protected function save(Model $o) {
try {
$o->save();
return $o->saved();
return $o->save();
} catch (ORM_Validation_Exception $e) {
SystemMessage::factory()

View File

@@ -202,7 +202,6 @@ class Model_Account extends Model_Auth_UserDefault {
->where('company','like','%'.$term.'%')
->or_where('first_name','like','%'.$term.'%')
->or_where('last_name','like','%'.$term.'%')
->or_where('email','like','%'.$term.'%')
->where_close();
}

View File

@@ -26,7 +26,7 @@ class Model_Setup extends ORM_OSB {
// Validation rules
public function rules() {
$r = Arr::merge(parent::rules(), array(
$x = Arr::merge(parent::rules(), array(
'url' => array(
array('not_empty'),
array('min_length', array(':value', 8)),
@@ -36,9 +36,9 @@ class Model_Setup extends ORM_OSB {
));
// This module doesnt use site_id.
unset($r['site_id']);
unset($x['site_id']);
return $r;
return $x;
}
/**