Bug #4028 Fix model beforeSave bug

The beforeSave() function must be declared inside a model extends CActiveRecord, not in a Controller