summaryrefslogtreecommitdiff
path: root/protected/models
diff options
context:
space:
mode:
Diffstat (limited to 'protected/models')
-rw-r--r--protected/models/Angebot.php2
-rw-r--r--protected/models/Kategorie.php2
-rw-r--r--protected/models/LoginForm.php2
-rw-r--r--protected/models/Standort.php2
-rw-r--r--protected/models/User.php2
-rw-r--r--protected/models/Veranstaltung.php18
-rw-r--r--protected/models/Verein.php2
7 files changed, 21 insertions, 9 deletions
diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php
index 8a16fd8..d6ae02a 100644
--- a/protected/models/Angebot.php
+++ b/protected/models/Angebot.php
@@ -27,7 +27,7 @@ class Angebot extends CActiveRecord
*/
public function tableName()
{
- return 'angebot';
+ return 'angebote';
}
/**
diff --git a/protected/models/Kategorie.php b/protected/models/Kategorie.php
index a9d8db6..93c799d 100644
--- a/protected/models/Kategorie.php
+++ b/protected/models/Kategorie.php
@@ -28,7 +28,7 @@ class Kategorie extends CActiveRecord
*/
public function tableName()
{
- return 'kategorie';
+ return 'kategorien';
}
/**
diff --git a/protected/models/LoginForm.php b/protected/models/LoginForm.php
index eb36e4a..3904698 100644
--- a/protected/models/LoginForm.php
+++ b/protected/models/LoginForm.php
@@ -67,7 +67,7 @@ class LoginForm extends CFormModel
}
if($this->_identity->errorCode===UserIdentity::ERROR_NONE)
{
- $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days
+ $duration=$this->rememberMe ? 3600*24*1 : 0; // 1 days
Yii::app()->user->login($this->_identity,$duration);
return true;
}
diff --git a/protected/models/Standort.php b/protected/models/Standort.php
index 8d71707..f64ea51 100644
--- a/protected/models/Standort.php
+++ b/protected/models/Standort.php
@@ -33,7 +33,7 @@ class Standort extends CActiveRecord
*/
public function tableName()
{
- return 'standort';
+ return 'standorte';
}
/**
diff --git a/protected/models/User.php b/protected/models/User.php
index f3a2163..b6a1609 100644
--- a/protected/models/User.php
+++ b/protected/models/User.php
@@ -31,7 +31,7 @@ class User extends CActiveRecord
*/
public function tableName()
{
- return 'astaf_user';
+ return 'benutzer';
}
/**
diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php
index fedd79f..64c7854 100644
--- a/protected/models/Veranstaltung.php
+++ b/protected/models/Veranstaltung.php
@@ -34,7 +34,7 @@ class Veranstaltung extends CActiveRecord
*/
public function tableName()
{
- return 'termin';
+ return 'veranstaltungen';
}
/**
@@ -45,10 +45,13 @@ class Veranstaltung extends CActiveRecord
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
+ array('verein_id, standort_id, titel, startzeit, endzeit', 'required'),
array('verein_id, standort_id, published', 'numerical', 'integerOnly'=>true),
array('titel', 'length', 'max'=>100),
array('startzeit, endzeit, beschreibung', 'safe'),
- array('verein_id, standort_id, titel, startzeit, endzeit', 'required'),
+ array('startzeit, endzeit', 'date', 'format'=>'dd.MM.yyyy HH:mm'),
+ array('startzeit, endzeit', 'DateRangeValidator', 'minDate'=>Yii::app()->params['start_date'].' '.Yii::app()->params['start_time'], 'maxDate'=>Yii::app()->params['end_date'].' '.Yii::app()->params['end_time']),
+ array('startzeit', 'DateCompareValidator', 'compareAttribute'=>'endzeit', 'operator'=>'<'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, verein_id, titel, startzeit, endzeit, beschreibung, standort_id, published', 'safe', 'on'=>'search'),
@@ -81,7 +84,7 @@ class Veranstaltung extends CActiveRecord
'endzeit' => 'Endzeit',
'beschreibung' => 'Beschreibung',
'standort_id' => 'Standort',
- 'published' => 'Published',
+ 'published' => 'Öffentlich',
);
}
@@ -110,6 +113,15 @@ class Veranstaltung extends CActiveRecord
));
}
+ public function beforeSave() {
+ $isValid = parent::beforeSave();
+ if ($isValid) {
+ $this->startzeit = Format::dbDateTime($this->startzeit);
+ $this->endzeit = Format::dbDateTime($this->endzeit);
+ }
+ return $isValid;
+ }
+
public function behaviors() {
return array(
'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
diff --git a/protected/models/Verein.php b/protected/models/Verein.php
index c40404c..83fc21f 100644
--- a/protected/models/Verein.php
+++ b/protected/models/Verein.php
@@ -33,7 +33,7 @@ class Verein extends CActiveRecord
*/
public function tableName()
{
- return 'verein';
+ return 'vereine';
}
/**