if (!defined('CURRENCY_DEFAULT')) define('CURRENCY_DEFAULT', '$');
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
$cl_team_name = trim($request->getParameter('team_name'));
$cl_currency = trim($request->getParameter('currency'));
if (!$cl_currency) $cl_currency = CURRENCY_DEFAULT;
$form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'manager_email','value'=>$cl_manager_email));
$form->addInput(array('type'=>'submit','name'=>'btn_submit','value'=>$i18n->getKey('button.submit')));
-if ($request->getMethod() == 'POST') {
+if ($request->isPost()) {
// Validate user input.
if (!ttValidString($cl_team_name, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.team_name'));
if (!ttValidString($cl_currency, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.currency'));
$errors->add($i18n->getKey('error.not_equal'), $i18n->getKey('label.password'), $i18n->getKey('label.confirm_password'));
if (!ttValidEmail($cl_manager_email, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.email'));
- if ($errors->isEmpty()) {
+ if ($errors->no()) {
if (!ttUserHelper::getUserByLogin($cl_manager_login)) {
// Create a new team.
$team_id = ttTeamHelper::insert(array('name'=>$cl_team_name,'currency'=>$cl_currency));