diff --git a/application/classes/Model/Client.php b/application/classes/Model/Client.php index 3f8d632..2904410 100644 --- a/application/classes/Model/Client.php +++ b/application/classes/Model/Client.php @@ -1,3 +1,46 @@ array( + array('not_empty'), + array('email'), + array('min_length', array(':value', 5)), + ), + 'name' => array( + array('not_empty'), + array('min_length', array(':value', 5)), + ), + 'token' => array( + array('not_empty'), + array('numeric') + ) + ); + } + + /** + * Array of field labels. + * Used in forms. + **/ + protected $_labels = array( + 'email' => 'Email', + 'name' => 'Name', + 'token' => 'Subscription token' + ); + + } diff --git a/application/classes/Model/Letter.php b/application/classes/Model/Letter.php index 5c3d54d..3542588 100644 --- a/application/classes/Model/Letter.php +++ b/application/classes/Model/Letter.php @@ -1,3 +1,38 @@ array( + array('not_empty'), + array('min_length', array(':value', 20)), + ), + 'order' => array( + array('numeric') + ) + ); + } + + /** + * Array of field labels. + * Used in forms. + **/ + protected $_labels = array( + 'text' => 'Message text', + 'order' => 'Message order' + ); + } diff --git a/application/classes/Model/Subscription.php b/application/classes/Model/Subscription.php index a8341fc..169749e 100644 --- a/application/classes/Model/Subscription.php +++ b/application/classes/Model/Subscription.php @@ -1,3 +1,45 @@ days a client receives a letter from the collection. + * @package Models + * @author Oreolek + **/ class Model_Subscription extends ORM { + + /** + * @return array validation rules + **/ + public function rules() + { + return array( + 'title' => array( + array('not_empty'), + array('min_length', array(':value', 4)), + array('max_length', array(':value', 100)), + ) + 'description' => array( + array('not_empty'), + array('min_length', array(':value', 20)), + ), + 'period' => array( + array('numeric') + ), + 'price' => array( + array('numeric') + ) + ); + } + + /** + * Array of field labels. + * Used in forms. + **/ + protected $_labels = array( + 'title' => 'Title', + 'price' => 'Subscription price', + 'period' => 'Mailing period (in days)', + 'description' => 'Description (for the clients)' + ); } diff --git a/application/classes/Model/Task.php b/application/classes/Model/Task.php index e5519c5..407c0dc 100644 --- a/application/classes/Model/Task.php +++ b/application/classes/Model/Task.php @@ -1,3 +1,43 @@ array( + array('not_empty'), + array('date'), + ), + 'status' => array( + array('numeric') + ) + ); + } + + /** + * Array of field labels. + * Used in forms. + **/ + protected $_labels = array( + 'date' => 'Mailing date', + 'status' => 'Status' + ); } diff --git a/application/i18n/ru.php b/application/i18n/ru.php index 98975e7..d2cccee 100644 --- a/application/i18n/ru.php +++ b/application/i18n/ru.php @@ -4,5 +4,15 @@ return array( 'User login' => 'Вход пользователя', 'Authorization error. Please check user login and password.' => 'Ошибка авторизации. Проверьте правильность имени пользователя и пароля.', 'Username' => 'Имя пользователя', - 'Password' => 'Пароль' + 'Password' => 'Пароль', + 'Message text' => 'Текст сообщения', + 'Message order' => 'Порядок сообщения', + 'Title' => 'Название', + 'Subscription price' => 'Цена подписки', + 'Mailing period (in days)' => 'Период рассылки (в днях)', + 'Description (for the clients)' => 'Описание (для клиентов)', + 'Email' => 'Email', + 'Subscription token' => 'Токен подписки', + 'Mailing date' => 'Дата отправки', + 'Status' => 'Статус' ); diff --git a/model.mwb b/model.mwb index 51fb208..7c1a5ab 100644 Binary files a/model.mwb and b/model.mwb differ