From c98745edd2c7b2f48bc3493c4dd9a061376c4720 Mon Sep 17 00:00:00 2001 From: ccwn Date: Tue, 24 Apr 2012 18:49:57 +0200 Subject: - Database setup - Database schema - Database dev data - config for new database setup - Update in AngebotVerein - Update in Speis&Trank - Update in Verein - Update in Kategorie --- protected/components/Format.php | 18 + protected/components/Html.php | 21 +- protected/config/maincfg.php | 6 +- protected/controllers/MyAngebotController.php | 73 ++++ protected/controllers/SiteController.php | 2 +- protected/controllers/SpeisTrankController.php | 6 +- protected/controllers/VereinController.php | 4 +- protected/data/create_database.mysql.sql | 5 + protected/data/devdata.astaf.mysql.sql | 56 +++ protected/data/schema.astaf.mysql.sql | 62 +-- protected/models/Angebot.php | 1 + protected/models/AngebotVerein.php | 18 +- protected/models/Standort.php | 8 +- protected/models/Verein.php | 4 +- protected/runtime/application.log | 539 ++++++++++++++++++++++++ protected/runtime/gii-1.1.10/ControllerCode.php | 6 + protected/views/kategorie/_form.php | 2 +- protected/views/kategorie/index.php | 27 +- protected/views/kategorie/update.php | 7 +- protected/views/layouts/main.php | 2 + protected/views/myAngebot/_form.php | 51 +++ protected/views/myAngebot/_search.php | 29 ++ protected/views/myAngebot/create.php | 14 + protected/views/myAngebot/index.php | 30 ++ protected/views/myAngebot/update.php | 17 + protected/views/speisTrank/_angebot_vereine.php | 20 +- protected/views/speisTrank/_form.php | 2 +- protected/views/standort/_form.php | 6 + protected/views/user/_form.php | 2 +- protected/views/verein/_form.php | 2 +- protected/views/verein/index.php | 28 +- protected/views/verein/update.php | 3 +- 32 files changed, 953 insertions(+), 118 deletions(-) create mode 100644 protected/components/Format.php create mode 100644 protected/controllers/MyAngebotController.php create mode 100644 protected/data/create_database.mysql.sql create mode 100644 protected/runtime/gii-1.1.10/ControllerCode.php create mode 100644 protected/views/myAngebot/_form.php create mode 100644 protected/views/myAngebot/_search.php create mode 100644 protected/views/myAngebot/create.php create mode 100644 protected/views/myAngebot/index.php create mode 100644 protected/views/myAngebot/update.php diff --git a/protected/components/Format.php b/protected/components/Format.php new file mode 100644 index 0000000..129a292 --- /dev/null +++ b/protected/components/Format.php @@ -0,0 +1,18 @@ +locale->numberFormatter->formatCurrency($value, $currency); + } + + public static function number($value, $einheit = '') { + return Yii::app()->locale->numberFormatter->formatDecimal($value).' '.$einheit; + } + + public static function decimal($value) { + return Yii::app()->locale->numberFormatter->formatDecimal($value); + } + + public static function percentage($value) { + return Yii::app()->locale->numberFormatter->formatPercentage($value); + } +} \ No newline at end of file diff --git a/protected/components/Html.php b/protected/components/Html.php index c4a246c..08fc6d9 100644 --- a/protected/components/Html.php +++ b/protected/components/Html.php @@ -1,6 +1,5 @@ baseUrl.'/js/'.$url; } + + public static function enumItem($model, $attribute) { + $attr = $attribute; + self::resolveName($model, $attr); + preg_match('/\((.*)\)/', $model->tableSchema->columns[$attr]->dbType, $matches); + foreach (explode(',', $matches[1]) as $value) { + $value = str_replace("'", null, $value); + $values[$value] = Yii::t('enumItem', $value); + } + + return $values; + } + + public static function enumDropDownList($model, $attribute, $htmlOptions = array()) { + return CHtml::activeDropDownList($model, $attribute, Html::enumItem($model, $attribute), $htmlOptions); + } + + } ?> \ No newline at end of file diff --git a/protected/config/maincfg.php b/protected/config/maincfg.php index 8b37493..78c3c6a 100644 --- a/protected/config/maincfg.php +++ b/protected/config/maincfg.php @@ -51,10 +51,10 @@ return array( ),*/ // uncomment the following to use a MySQL database 'db'=>array( - 'connectionString' => 'mysql:host=localhost;dbname=astaf_yii_dev', + 'connectionString' => 'mysql:host=localhost;dbname=astaf', 'emulatePrepare' => true, - 'username' => 'root', - 'password' => '', + 'username' => 'astaf', + 'password' => 'AsTaF4', 'charset' => 'utf8', ), 'errorHandler'=>array( diff --git a/protected/controllers/MyAngebotController.php b/protected/controllers/MyAngebotController.php new file mode 100644 index 0000000..c53da98 --- /dev/null +++ b/protected/controllers/MyAngebotController.php @@ -0,0 +1,73 @@ +array('create','index','delete','update','view'), + 'users'=>array('@'), + ), + array('deny', // deny all users + 'users'=>array('*'), + ), + ); + } + public function actionIndex() + { + $model=new AngebotVerein('search'); + $model->unsetAttributes(); // clear any default values + if (isset($_GET['AngebotVerein'])) { + $model->attributes = $_GET['AngebotVerein']; + } + $model->verein_id = Yii::app()->user->vereinId; + + $this->render('index',array( + 'model'=>$model, + )); + } + + // Uncomment the following methods and override them if needed + /* + public function filters() + { + // return the filter configuration for this controller, e.g.: + return array( + 'inlineFilterName', + array( + 'class'=>'path.to.FilterClass', + 'propertyName'=>'propertyValue', + ), + ); + } + + public function actions() + { + // return external action classes, e.g.: + return array( + 'action1'=>'path.to.ActionClass', + 'action2'=>array( + 'class'=>'path.to.AnotherActionClass', + 'propertyName'=>'propertyValue', + ), + ); + } + */ +} \ No newline at end of file diff --git a/protected/controllers/SiteController.php b/protected/controllers/SiteController.php index 961a968..2ee57b9 100644 --- a/protected/controllers/SiteController.php +++ b/protected/controllers/SiteController.php @@ -28,7 +28,7 @@ class SiteController extends Controller public function actionIndex() { if (!Yii::app()->user->isGuest && Yii::app()->user->isAdmin) { - $this->redirect(array("/verein/")); + $this->redirect(array("/verein/index")); } $this->redirect(array("/myverein/")); } diff --git a/protected/controllers/SpeisTrankController.php b/protected/controllers/SpeisTrankController.php index 6f0931e..1da7883 100644 --- a/protected/controllers/SpeisTrankController.php +++ b/protected/controllers/SpeisTrankController.php @@ -26,12 +26,8 @@ class SpeisTrankController extends Controller public function accessRules() { return array( - array('allow', // allow authenticated user to perform 'create' and 'update' actions - 'actions'=>array('update','view'), - 'users'=>array('@'), - ), array('allow', // allow admin user to perform 'admin' and 'delete' actions - 'actions'=>array('create','index','delete'), + 'actions'=>array('create','index','delete','update','view'), 'users'=>array('admin'), ), array('deny', // deny all users diff --git a/protected/controllers/VereinController.php b/protected/controllers/VereinController.php index 30c05bc..7648a3e 100644 --- a/protected/controllers/VereinController.php +++ b/protected/controllers/VereinController.php @@ -65,7 +65,7 @@ class VereinController extends Controller $this->redirect(array('view','id'=>$model->id)); } - $standorte = Standort::model()->findAll(array("condition"=>"published=1")); + $standorte = Standort::model()->findAll(array("condition"=>"published=1 and type='Stand'")); $this->render('create',array( 'model'=>$model, 'standorte'=>$standorte @@ -91,7 +91,7 @@ class VereinController extends Controller $this->redirect(array('view','id'=>$model->id)); } - $standorte = Standort::model()->findAll(array("condition"=>"published=1")); + $standorte = Standort::model()->findAll(array("condition"=>"published=1 and type='Stand'")); $this->render('update',array( 'model'=>$model, 'standorte'=>$standorte diff --git a/protected/data/create_database.mysql.sql b/protected/data/create_database.mysql.sql new file mode 100644 index 0000000..38103fb --- /dev/null +++ b/protected/data/create_database.mysql.sql @@ -0,0 +1,5 @@ +DROP DATABASE IF EXISTS `astaf`; +CREATE DATABASE `astaf`; +GRANT ALL ON `astaf`.* TO 'astaf'@'localhost' IDENTIFIED BY 'AsTaF4'; +FLUSH PRIVILEGES; +USE `astaf`; \ No newline at end of file diff --git a/protected/data/devdata.astaf.mysql.sql b/protected/data/devdata.astaf.mysql.sql index e69de29..dffc759 100644 --- a/protected/data/devdata.astaf.mysql.sql +++ b/protected/data/devdata.astaf.mysql.sql @@ -0,0 +1,56 @@ +-- User + +INSERT INTO `astaf_user` (`id`, `username`, `algorithm`, `salt`, `password`, `created_at`, `last_login`, `is_active`, `is_super_admin`) VALUES +(1, 'admin', 'sha1', '8b01941a7d381938bc91d9db7aba03e7', 'c5d9e312d79f800fee5a29e5d574fa167d92b126', '2008-04-21 18:16:39', '2010-06-24 08:29:42', 1, 1), +(2, 'CCWN', 'sha1', '0e41841b83ec522ea110d87a7933c4a2', 'b08fb3bc63fef35eadfecd561fd34d18f39efd63', '2008-06-03 21:39:23', '2010-06-15 13:26:48', 1, 0); + +-- Kategorien +INSERT INTO `kategorie` (`id`, `name`, `einheiten`, `default_menge`, `default_einheit`, `published`) VALUES +(1, 'Alkoholfreie Getränke', 'Milliliter, Liter, Flasche, Glas', 0.5, 'Liter', 1), +(2, 'Essen', 'Portion, Teller', 1, 'Portion', 1), +(3, 'Alkoholische Getränke', 'Milliliter, Liter, Flasche, Glas', 0.5, 'Liter', 1), +(4, 'Spezialitäten', 'Portion, Glas, Teller', 1, 'Portion', 1), +(5, 'Testkategorie', 'Test,as', NULL, '456', 0); + +-- Standorte +INSERT INTO `standort` (`id`, `type`, `name`, `pos_lat`, `pos_long`, `published`) VALUES +(1, 'Stand', 'vor dem Hochwachturm', 48.8317358074, 9.31517913938, 1), +(2, 'Stand', 'in den Brühlwiesen beim Bürgerzentrum', 48.8313765015, 9.31986093521, 1), +(3, 'Stand', 'auf dem Platz nördlich vom Beinsteiner Torturm', 48.8336744259, 9.31851580739, 1), +(4, 'Stand', 'auf dem Parkplatz Foto Saur, Bürgermühlenweg', 48.8308212055, 9.31567803025, 1), +(5, 'Stand', 'auf dem Rathausplatz und Platz neben der Nikolauskirche', 48.8319997676, 9.31680858135, 1), +(6, 'Stand', 'auf dem Rathausplatz', 48.8320474392, 9.31663155556, 1), +(7, 'Stand', 'unter den Arkaden des Alten Rathauses', 48.8322734373, 9.31635260582, 1), +(8, 'Stand', 'am Marktplatz und Martkbrunnen', 48.8324076231, 9.31626677513, 1), +(9, 'Stand', 'im Schlosskeller unter dem Rathaus', 48.8323228742, 9.31676030159, 1), +(10, 'Stand', 'auf dem Platz vor der Scheuerngasse 2', 48.8321948678, 9.31608840823, 1); + +-- Vereine +INSERT INTO `verein` (`id`, `name`, `url`, `bild`, `email`, `slug`, `kontaktdaten`, `beschreibung`, `standort_id`, `published`) VALUES +(1, 'Computerclub Waiblingen e.V.', 'http://ccwn.org', 'images/uploaded/1334304302CCWN.jpg', 'vorstand@ccwn.org', 'CCWN', '

Computerclub Waiblingen e.V.
Postfach 1169
71301 Waiblingen
vorstand@ccwn.org

http://www.ccwn.org

', '

Der Computerclub Waiblingen ist ein seit 1984 existierender Verein mit Sitz in Waiblingen. Wir treffen uns regelmäßig Dienstags ab 19:30 Uhr in Waiblingen Neustadt in der Gaststätte Söhrenberg.

Wir sind seit vielen Jahren am Altstadtfest vertreten und verkaufen hauptsächlich Andechser Spezialitätenbiere. Auch bei Fragen und Anregungen zum Internetangebot des Altstadtfestes sind Sie bei uns an der richtigen Adresse. 

', 25, 1); + +-- Termine +INSERT INTO `termin` (`id`, `verein_id`, `titel`, `startzeit`, `endzeit`, `beschreibung`, `published`) VALUES +(1, 1, 'Freibierverlosung', '2010-06-25 19:00:00', '2010-06-27 22:00:00', 'Wir verlosen Freibier auf http://www.astaf.de. Die Gutscheine können während des gesamten Altstadtfestes an unserem Stand eingelöst werden.', 1); + +-- Angebote +INSERT INTO `angebot` (`id`, `kategorie_id`, `name`, `beschreibung`, `published`) VALUES +(1, 4, 'Andechser Doppelbock', 'Stark und süffig. Aus dunklen bayerischen Malzen, im traditionellen Dreimaischverfahren eingebraut. Mit 7% Alkohol und 18,5% Stammwürze - und das nicht nur zur Starkbierzeit. Der ganz besonderer Genuß für Leib und Seele.', 1), +(2, 1, 'Fanta Orange', 'Erfrischende Orangenlimonade', 1), +(3, 3, 'Cluss Kellerpils', 'Bierspezialität aus Heilbronn', 1), +(4, 3, 'Radler', 'Biermixgetränkt aus süßem Sprudel und Bier', 1), +(5, 3, 'Wein rot/weiss/rosé', 'Verschiedene lokale Weine', 1), +(6, 3, 'Weinschorle', 'Mischung aus saurem Sprudel und Wein', 1), +(7, 3, 'Sekt', ' ', 1), +(8, 3, 'Sekt Orange', 'Sekt mit Orangensaft', 1); + +-- Angebot -> Verein +INSERT INTO `angebot_verein` (`angebot_id`, `verein_id`, `menge`, `einheit`, `preis`, `published`) VALUES +(1, 1, 500, '', 3.5, 1), +(2, 1, 250, '', 1, 1), +(3, 1, 330, '', 1.5, 1), +(4, 1, 200, '', 1.5, 1), +(5, 1, 330, '', 1.5, 1), +(6, 1, 0, '', 1.5, 1), +(7, 1, 330, '', 1.5, 1), +(8, 1, 0, '', 0, 1); diff --git a/protected/data/schema.astaf.mysql.sql b/protected/data/schema.astaf.mysql.sql index 8fc9eb3..56138ef 100644 --- a/protected/data/schema.astaf.mysql.sql +++ b/protected/data/schema.astaf.mysql.sql @@ -3,7 +3,7 @@ -- http://www.phpmyadmin.net -- -- Host: localhost --- Erstellungszeit: 15. Apr 2012 um 16:09 +-- Erstellungszeit: 24. Apr 2012 um 18:40 -- Server Version: 5.5.16 -- PHP-Version: 5.3.8 @@ -11,9 +11,10 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- --- Datenbank: `astaf_yii_dev` +-- Datenbank: `astaf` -- + -- -------------------------------------------------------- -- @@ -24,12 +25,12 @@ DROP TABLE IF EXISTS `angebot`; CREATE TABLE IF NOT EXISTS `angebot` ( `id` int(11) NOT NULL AUTO_INCREMENT, `kategorie_id` int(11) DEFAULT NULL, - `name` varchar(80) DEFAULT NULL, - `beschreibung` text, + `name` varchar(80) CHARACTER SET latin1 DEFAULT NULL, + `beschreibung` text CHARACTER SET latin1, `published` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `angebot_FI_1` (`kategorie_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=247 ; -- -------------------------------------------------------- @@ -42,12 +43,12 @@ CREATE TABLE IF NOT EXISTS `angebot_verein` ( `angebot_id` int(11) NOT NULL, `verein_id` int(11) NOT NULL, `menge` double NOT NULL, - `einheit` varchar(20) CHARACTER SET utf8 NOT NULL, - `preis` float DEFAULT NULL, - `published` int(11) DEFAULT NULL, + `einheit` varchar(20) NOT NULL, + `preis` float NOT NULL, + `published` tinyint(1) DEFAULT NULL, PRIMARY KEY (`angebot_id`,`verein_id`,`menge`,`einheit`), KEY `angebot_verein_FI_2` (`verein_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -------------------------------------------------------- @@ -58,17 +59,17 @@ CREATE TABLE IF NOT EXISTS `angebot_verein` ( DROP TABLE IF EXISTS `astaf_user`; CREATE TABLE IF NOT EXISTS `astaf_user` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `username` varchar(128) NOT NULL, - `algorithm` varchar(128) NOT NULL DEFAULT 'sha1', - `salt` varchar(128) NOT NULL, - `password` varchar(128) NOT NULL, + `username` varchar(128) CHARACTER SET latin1 NOT NULL, + `algorithm` varchar(128) CHARACTER SET latin1 NOT NULL DEFAULT 'sha1', + `salt` varchar(128) CHARACTER SET latin1 NOT NULL, + `password` varchar(128) CHARACTER SET latin1 NOT NULL, `created_at` datetime DEFAULT NULL, `last_login` datetime DEFAULT NULL, `is_active` int(11) NOT NULL DEFAULT '1', `is_super_admin` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `sf_guard_user_username_unique` (`username`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=56 ; -- -------------------------------------------------------- @@ -79,13 +80,13 @@ CREATE TABLE IF NOT EXISTS `astaf_user` ( DROP TABLE IF EXISTS `kategorie`; CREATE TABLE IF NOT EXISTS `kategorie` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(100) CHARACTER SET utf8 NOT NULL, - `einheiten` varchar(100) CHARACTER SET utf8 NOT NULL, + `name` varchar(100) NOT NULL, + `einheiten` varchar(100) NOT NULL, `default_menge` double DEFAULT NULL, - `default_einheit` varchar(20) CHARACTER SET utf8 NOT NULL, + `default_einheit` varchar(20) NOT NULL, `published` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ; -- -------------------------------------------------------- @@ -96,12 +97,13 @@ CREATE TABLE IF NOT EXISTS `kategorie` ( DROP TABLE IF EXISTS `standort`; CREATE TABLE IF NOT EXISTS `standort` ( `id` int(11) NOT NULL AUTO_INCREMENT, + `type` enum('Bühne','Stand') NOT NULL DEFAULT 'Stand', `name` varchar(80) DEFAULT NULL, `pos_lat` double DEFAULT NULL, `pos_long` double DEFAULT NULL, `published` int(11) DEFAULT NULL, PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=56 ; -- -------------------------------------------------------- @@ -113,14 +115,14 @@ DROP TABLE IF EXISTS `termin`; CREATE TABLE IF NOT EXISTS `termin` ( `id` int(11) NOT NULL AUTO_INCREMENT, `verein_id` int(11) DEFAULT NULL, - `titel` varchar(100) DEFAULT NULL, + `titel` varchar(100) CHARACTER SET latin1 DEFAULT NULL, `startzeit` datetime DEFAULT NULL, `endzeit` datetime DEFAULT NULL, - `beschreibung` text, + `beschreibung` text CHARACTER SET latin1, `published` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `termin_FI_1` (`verein_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=222 ; -- -------------------------------------------------------- @@ -131,15 +133,15 @@ CREATE TABLE IF NOT EXISTS `termin` ( DROP TABLE IF EXISTS `verein`; CREATE TABLE IF NOT EXISTS `verein` ( `id` int(11) NOT NULL AUTO_INCREMENT, - `name` varchar(255) CHARACTER SET utf8 DEFAULT NULL, - `url` varchar(255) DEFAULT NULL, - `bild` varchar(100) DEFAULT NULL, - `email` varchar(100) DEFAULT NULL, - `slug` varchar(100) DEFAULT NULL, - `kontaktdaten` text, - `beschreibung` text, + `name` varchar(255) DEFAULT NULL, + `url` varchar(255) CHARACTER SET latin1 DEFAULT NULL, + `bild` varchar(100) CHARACTER SET latin1 DEFAULT NULL, + `email` varchar(100) CHARACTER SET latin1 DEFAULT NULL, + `slug` varchar(100) CHARACTER SET latin1 DEFAULT NULL, + `kontaktdaten` text CHARACTER SET latin1, + `beschreibung` text CHARACTER SET latin1, `standort_id` int(11) DEFAULT NULL, `published` int(11) DEFAULT NULL, PRIMARY KEY (`id`), KEY `verein_FI_1` (`standort_id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; +) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=57 ; diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php index 7791bcb..9561687 100644 --- a/protected/models/Angebot.php +++ b/protected/models/Angebot.php @@ -38,6 +38,7 @@ class Angebot extends CActiveRecord // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( + array('name, kategorie_id', 'required'), array('kategorie_id, published', 'numerical', 'integerOnly'=>true), array('name', 'length', 'max'=>80), array('beschreibung', 'safe'), diff --git a/protected/models/AngebotVerein.php b/protected/models/AngebotVerein.php index 54cb734..65339ed 100644 --- a/protected/models/AngebotVerein.php +++ b/protected/models/AngebotVerein.php @@ -6,7 +6,8 @@ * The followings are the available columns in table 'angebot_verein': * @property integer $angebot_id * @property integer $verein_id - * @property integer $menge + * @property double $menge + * @property string $einheit * @property double $preis * @property integer $published */ @@ -38,12 +39,13 @@ class AngebotVerein extends CActiveRecord // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('angebot_id, verein_id, menge', 'required'), - array('angebot_id, verein_id, menge, published', 'numerical', 'integerOnly'=>true), - array('preis', 'numerical'), + array('angebot_id, verein_id, menge, einheit, preis', 'required'), + array('angebot_id, verein_id, published', 'numerical', 'integerOnly'=>true), + array('menge, preis', 'numerical'), + array('einheit', 'length', 'max'=>20), // The following rule is used by search(). // Please remove those attributes that should not be searched. - array('angebot_id, verein_id, menge, preis, published', 'safe', 'on'=>'search'), + array('angebot_id, verein_id, menge, einheit, preis, published', 'safe', 'on'=>'search'), ); } @@ -55,6 +57,8 @@ class AngebotVerein extends CActiveRecord // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( + "angebot"=>array(self::HAS_ONE, "Angebot", array('id'=>'angebot_id')), + "verein"=>array(self::HAS_ONE, "Verein", array('id'=>'verein_id')) ); } @@ -67,8 +71,9 @@ class AngebotVerein extends CActiveRecord 'angebot_id' => 'Angebot', 'verein_id' => 'Verein', 'menge' => 'Menge', + 'einheit' => 'Einheit', 'preis' => 'Preis', - 'published' => 'Published', + 'published' => 'Öffentlich', ); } @@ -86,6 +91,7 @@ class AngebotVerein extends CActiveRecord $criteria->compare('angebot_id',$this->angebot_id); $criteria->compare('verein_id',$this->verein_id); $criteria->compare('menge',$this->menge); + $criteria->compare('einheit',$this->einheit,true); $criteria->compare('preis',$this->preis); $criteria->compare('published',$this->published); diff --git a/protected/models/Standort.php b/protected/models/Standort.php index 48493f6..b7eddcf 100644 --- a/protected/models/Standort.php +++ b/protected/models/Standort.php @@ -5,6 +5,7 @@ * * The followings are the available columns in table 'standort': * @property integer $id + * @property string $type * @property string $name * @property double $pos_lat * @property double $pos_long @@ -43,13 +44,14 @@ class Standort extends CActiveRecord // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('name, pos_lat, pos_long', 'required'), + array('name, pos_lat, pos_long, type', 'required'), array('published', 'numerical', 'integerOnly'=>true), array('pos_lat, pos_long', 'numerical'), + array('type', 'length', 'max'=>6), array('name', 'length', 'max'=>80), // The following rule is used by search(). // Please remove those attributes that should not be searched. - array('id, name, pos_lat, pos_long, published', 'safe', 'on'=>'search'), + array('id, type, name, pos_lat, pos_long, published', 'safe', 'on'=>'search'), ); } @@ -71,6 +73,7 @@ class Standort extends CActiveRecord { return array( 'id' => 'ID', + 'type' => 'Type', 'name' => 'Name', 'pos_lat' => 'Pos Lat', 'pos_long' => 'Pos Long', @@ -90,6 +93,7 @@ class Standort extends CActiveRecord $criteria=new CDbCriteria; $criteria->compare('id',$this->id); + $criteria->compare('type',$this->type,true); $criteria->compare('name',$this->name,true); $criteria->compare('pos_lat',$this->pos_lat); $criteria->compare('pos_long',$this->pos_long); diff --git a/protected/models/Verein.php b/protected/models/Verein.php index dba05db..d740c8a 100644 --- a/protected/models/Verein.php +++ b/protected/models/Verein.php @@ -48,8 +48,8 @@ class Verein extends CActiveRecord array('standort_id, published', 'numerical', 'integerOnly'=>true), array('name, url', 'length', 'max'=>255), array('bild, email, slug', 'length', 'max'=>100), - array("url", "url", "allowEmpty"=>true, "message"=>"Die eingebene URL ist ung�ltig."), - array("email", "email", "message"=>"Die eingebene eMail-Adresse ist ung�ltig."), + array("url", "url", "allowEmpty"=>true, "message"=>"Die eingebene URL ist ungültig."), + array("email", "email", "message"=>"Die eingebene eMail-Adresse ist ungültig."), array("uploadedImage", "file", "types"=>"jpg, gif, png", "allowEmpty"=>true, "wrongType"=>'Die Datei "{file}" konnte nicht hochgeladen werden. Es sind nur Dateien mit den folgenden Endungen erlaubt: {extensions}.'), array('kontaktdaten, beschreibung', 'safe'), // The following rule is used by search(). diff --git a/protected/runtime/application.log b/protected/runtime/application.log index 587f0b9..b25ea6a 100644 --- a/protected/runtime/application.log +++ b/protected/runtime/application.log @@ -3743,3 +3743,542 @@ Stack trace: REQUEST_URI=/admin.astaf.de/index.php?r=standort/view&id=54 HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=standort/create --- +2012/04/22 11:39:28 [error] [php] include(ZHtml.php) [function.include]: failed to open stream: No such file or directory (D:\Projects\Astaf\workspace\yii\framework\YiiBase.php:418) +Stack trace: +#0 D:\Projects\Astaf\workspace\admin.astaf.de\protected\components\Html.php(36): spl_autoload_call() +#1 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\standort\_form.php(20): enumDropDownList() +#2 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require() +#3 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): StandortController->renderInternal() +#4 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): StandortController->renderFile() +#5 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\standort\create.php(14): StandortController->renderPartial() +#6 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require() +#7 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): StandortController->renderInternal() +#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): StandortController->renderFile() +#9 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): StandortController->renderPartial() +#10 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\StandortController.php(70): StandortController->render() +#11 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): StandortController->actionCreate() +#12 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams() +#13 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): StandortController->runAction() +#14 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#15 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CAccessControlFilter->filter() +#16 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): StandortController->filterAccessControl() +#17 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter() +#18 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#19 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): StandortController->runActionWithFilters() +#20 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): StandortController->run() +#21 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController() +#22 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#23 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CWebApplication->run() +REQUEST_URI=/admin.astaf.de/index.php?r=standort/create +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\components\Html.php (36) +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\standort\_form.php (20) +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\standort\create.php (14) +2012/04/22 12:23:14 [error] [exception.CDbException] exception 'CDbException' with message 'ActiveRecord-Klasse "Angebot" hat eine ungültige Konfiguration für die Relation "angebot_vereine". Relations-Typ, verknüpftes ActiveRecord und Fremdschlüssel müssen angegeben werden.' in D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php:2312 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(2291): CActiveRecordMetaData->addRelation('angebot_vereine', Array) +#1 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(379): CActiveRecordMetaData->__construct(Object(Angebot)) +#2 D:\Projects\Astaf\workspace\admin.astaf.de\protected\models\Angebot.php(22): CActiveRecord::model('Angebot') +#3 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(149): Angebot::model() +#4 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(87): SpeisTrankController->loadModel('9') +#5 [internal function]: SpeisTrankController->actionUpdate('9') +#6 D:\Projects\Astaf\workspace\yii\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(SpeisTrankController), Array) +#7 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(SpeisTrankController), Object(ReflectionMethod), Array) +#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#9 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#10 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#11 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#12 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#13 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#14 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#15 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#16 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('update') +#17 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speisTrank/upda...') +#18 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#19 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#20 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=speisTrank/update&id=9 +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=speisTrank/index +--- +2012/04/22 19:21:47 [error] [php] Missing argument 1 for CActiveDataProvider::__construct(), called in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\_angebot_vereine.php on line 2 and defined (D:\Projects\Astaf\workspace\yii\framework\web\CActiveDataProvider.php:70) +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): SpeisTrankController->renderInternal() +#1 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): SpeisTrankController->renderFile() +#2 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\view.php(28): SpeisTrankController->renderPartial() +#3 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require() +#4 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): SpeisTrankController->renderInternal() +#5 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): SpeisTrankController->renderFile() +#6 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): SpeisTrankController->renderPartial() +#7 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(51): SpeisTrankController->render() +#8 unknown(0): SpeisTrankController->actionView() +#9 D:\Projects\Astaf\workspace\yii\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs() +#10 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(48): CInlineAction->runWithParamsInternal() +#11 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams() +#12 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): SpeisTrankController->runAction() +#13 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#14 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CAccessControlFilter->filter() +#15 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): SpeisTrankController->filterAccessControl() +#16 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter() +#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#18 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): SpeisTrankController->runActionWithFilters() +#19 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): SpeisTrankController->run() +#20 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController() +#21 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#22 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CWebApplication->run() +REQUEST_URI=/admin.astaf.de/index.php?r=speisTrank/view&id=9 +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\_angebot_vereine.php (2) +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\view.php (28) +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php (51) +2012/04/22 19:21:59 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "AngebotVerein.kategorie ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('kategorie') +#1 D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php(607) : eval()'d code(1): CActiveRecord->__get('kategorie') +#2 D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php(607): eval() +#3 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CDataColumn.php(139): CComponent->evaluateExpression('($data->kategor...', Array) +#4 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridColumn.php(138): CDataColumn->renderDataCellContent(0, Object(AngebotVerein)) +#5 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(517): CGridColumn->renderDataCell(0) +#6 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(490): CGridView->renderTableRow(0) +#7 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(400): CGridView->renderTableBody() +#8 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(158): CGridView->renderItems() +#9 [internal function]: CBaseListView->renderSection(Array) +#10 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(141): preg_replace_callback('/{(\w+)}/', Array, '{summary}?{item...') +#11 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(126): CBaseListView->renderContent() +#12 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(174): CBaseListView->run() +#13 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\_angebot_vereine.php(13): CBaseController->widget('zii.widgets.gri...', Array) +#14 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#15 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#16 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#17 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\view.php(28): CController->renderPartial('_angebot_verein...', Array) +#18 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#19 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#20 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#21 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('view', Array, true) +#22 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(51): CController->render('view', Array) +#23 [internal function]: SpeisTrankController->actionView('9') +#24 D:\Projects\Astaf\workspace\yii\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(SpeisTrankController), Array) +#25 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(SpeisTrankController), Object(ReflectionMethod), Array) +#26 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#27 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#28 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#29 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#30 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#31 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#32 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#33 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#34 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('view') +#35 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speisTrank/view') +#36 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#37 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#38 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=speisTrank/view&id=9 +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=speisTrank/update&id=9 +--- +2012/04/22 19:24:42 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "AngebotVerein.id ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('id') +#1 D:\Projects\Astaf\workspace\yii\framework\web\CArrayDataProvider.php(102): CActiveRecord->__get('id') +#2 D:\Projects\Astaf\workspace\yii\framework\web\CDataProvider.php(159): CArrayDataProvider->fetchKeys() +#3 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(186): CDataProvider->getKeys() +#4 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(127): CBaseListView->renderKeys() +#5 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(174): CBaseListView->run() +#6 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\_angebot_vereine.php(11): CBaseController->widget('zii.widgets.gri...', Array) +#7 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#8 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#9 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#10 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\view.php(28): CController->renderPartial('_angebot_verein...', Array) +#11 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#12 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#13 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#14 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('view', Array, true) +#15 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(51): CController->render('view', Array) +#16 [internal function]: SpeisTrankController->actionView('9') +#17 D:\Projects\Astaf\workspace\yii\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(SpeisTrankController), Array) +#18 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(SpeisTrankController), Object(ReflectionMethod), Array) +#19 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#20 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#21 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#22 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#23 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#24 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#25 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#26 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#27 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('view') +#28 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speisTrank/view') +#29 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#30 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#31 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=speisTrank/view&id=9 +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=speisTrank/update&id=9 +--- +2012/04/22 19:24:44 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "AngebotVerein.id ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('id') +#1 D:\Projects\Astaf\workspace\yii\framework\web\CArrayDataProvider.php(102): CActiveRecord->__get('id') +#2 D:\Projects\Astaf\workspace\yii\framework\web\CDataProvider.php(159): CArrayDataProvider->fetchKeys() +#3 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(186): CDataProvider->getKeys() +#4 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(127): CBaseListView->renderKeys() +#5 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(174): CBaseListView->run() +#6 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\_angebot_vereine.php(11): CBaseController->widget('zii.widgets.gri...', Array) +#7 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#8 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#9 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#10 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\view.php(28): CController->renderPartial('_angebot_verein...', Array) +#11 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#12 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#13 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#14 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('view', Array, true) +#15 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(51): CController->render('view', Array) +#16 [internal function]: SpeisTrankController->actionView('9') +#17 D:\Projects\Astaf\workspace\yii\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs(Object(SpeisTrankController), Array) +#18 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(48): CAction->runWithParamsInternal(Object(SpeisTrankController), Object(ReflectionMethod), Array) +#19 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#20 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#21 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#22 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#23 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#24 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#25 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#26 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#27 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('view') +#28 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speisTrank/view') +#29 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#30 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#31 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=speisTrank/view&id=9 +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=speisTrank/update&id=9 +--- +2012/04/22 19:55:14 [error] [exception.CException] exception 'CException' with message 'MyAngebotController kann den angeforderten View "_search" nicht finden.' in D:\Projects\Astaf\workspace\yii\framework\web\CController.php:879 +Stack trace: +#0 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\common\_advanced_search.php(19): CController->renderPartial('_search', Array) +#1 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#2 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#3 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#4 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\index.php(13): CController->renderPartial('/common/_advanc...', Array) +#5 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#6 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#7 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('index', Array, true) +#9 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php(42): CController->render('index', Array) +#10 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionIndex() +#11 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#12 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#13 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#14 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#15 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#16 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#18 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#19 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('index') +#20 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/index') +#21 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#22 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#23 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/index +--- +2012/04/22 19:55:25 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "AngebotVerein.id ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('id') +#1 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(2044): CActiveRecord->__get('id') +#2 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1774): CHtml::resolveValue(Object(AngebotVerein), 'id') +#3 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1205): CHtml::activeInputField('text', Object(AngebotVerein), 'id', Array) +#4 D:\Projects\Astaf\workspace\yii\framework\web\widgets\CActiveForm.php(575): CHtml::activeTextField(Object(AngebotVerein), 'id', Array) +#5 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\_search.php(10): CActiveForm->textField(Object(AngebotVerein), 'id') +#6 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#7 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#9 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\common\_advanced_search.php(19): CController->renderPartial('_search', Array) +#10 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#11 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#12 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#13 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\index.php(13): CController->renderPartial('/common/_advanc...', Array) +#14 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#15 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#16 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('index', Array, true) +#18 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php(42): CController->render('index', Array) +#19 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionIndex() +#20 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#21 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#22 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#23 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#24 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#25 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#26 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#27 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#28 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('index') +#29 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/index') +#30 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#31 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#32 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/index +--- +2012/04/22 19:57:10 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "AngebotVerein.kategorie_id ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('kategorie_id') +#1 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(2044): CActiveRecord->__get('kategorie_id') +#2 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1774): CHtml::resolveValue(Object(AngebotVerein), 'kategorie_id') +#3 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1205): CHtml::activeInputField('text', Object(AngebotVerein), 'kategorie_id', Array) +#4 D:\Projects\Astaf\workspace\yii\framework\web\widgets\CActiveForm.php(575): CHtml::activeTextField(Object(AngebotVerein), 'kategorie_id', Array) +#5 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\_search.php(10): CActiveForm->textField(Object(AngebotVerein), 'kategorie_id') +#6 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#7 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#9 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\common\_advanced_search.php(19): CController->renderPartial('_search', Array) +#10 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#11 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#12 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#13 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\index.php(13): CController->renderPartial('/common/_advanc...', Array) +#14 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#15 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#16 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('index', Array, true) +#18 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php(42): CController->render('index', Array) +#19 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionIndex() +#20 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#21 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#22 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#23 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#24 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#25 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#26 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#27 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#28 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('index') +#29 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/index') +#30 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#31 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#32 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/index +--- +2012/04/22 19:57:15 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "AngebotVerein.name ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('name') +#1 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(2044): CActiveRecord->__get('name') +#2 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1774): CHtml::resolveValue(Object(AngebotVerein), 'name') +#3 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1205): CHtml::activeInputField('text', Object(AngebotVerein), 'name', Array) +#4 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CDataColumn.php(105): CHtml::activeTextField(Object(AngebotVerein), 'name', Array) +#5 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridColumn.php(106): CDataColumn->renderFilterCellContent() +#6 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(450): CGridColumn->renderFilterCell() +#7 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(428): CGridView->renderFilter() +#8 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(398): CGridView->renderTableHeader() +#9 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(158): CGridView->renderItems() +#10 [internal function]: CBaseListView->renderSection(Array) +#11 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(141): preg_replace_callback('/{(\w+)}/', Array, '{summary}?{item...') +#12 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(126): CBaseListView->renderContent() +#13 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(174): CBaseListView->run() +#14 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\index.php(29): CBaseController->widget('zii.widgets.gri...', Array) +#15 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#16 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#18 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('index', Array, true) +#19 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php(42): CController->render('index', Array) +#20 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionIndex() +#21 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#22 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#23 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#24 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#25 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#26 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#27 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#28 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#29 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('index') +#30 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/index') +#31 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#32 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#33 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/index +--- +2012/04/22 19:58:16 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "AngebotVerein.kategorie ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('kategorie') +#1 D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php(607) : eval()'d code(1): CActiveRecord->__get('kategorie') +#2 D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php(607): eval() +#3 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CDataColumn.php(139): CComponent->evaluateExpression('($data->kategor...', Array) +#4 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridColumn.php(138): CDataColumn->renderDataCellContent(0, Object(AngebotVerein)) +#5 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(517): CGridColumn->renderDataCell(0) +#6 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(490): CGridView->renderTableRow(0) +#7 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(400): CGridView->renderTableBody() +#8 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(158): CGridView->renderItems() +#9 [internal function]: CBaseListView->renderSection(Array) +#10 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(141): preg_replace_callback('/{(\w+)}/', Array, '{summary}?{item...') +#11 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(126): CBaseListView->renderContent() +#12 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(174): CBaseListView->run() +#13 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\index.php(32): CBaseController->widget('zii.widgets.gri...', Array) +#14 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#15 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#16 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('index', Array, true) +#18 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php(42): CController->render('index', Array) +#19 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionIndex() +#20 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#21 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#22 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#23 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#24 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#25 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#26 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#27 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#28 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('index') +#29 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/index') +#30 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#31 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#32 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/index +--- +2012/04/22 20:04:32 [error] [php] Indirect modification of overloaded property AngebotVerein::$attributes has no effect (D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php:40) +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): MyAngebotController->runAction() +#1 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#2 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CAccessControlFilter->filter() +#3 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): MyAngebotController->filterAccessControl() +#4 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter() +#5 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#6 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): MyAngebotController->runActionWithFilters() +#7 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): MyAngebotController->run() +#8 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController() +#9 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#10 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CWebApplication->run() +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:05 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:05 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:08 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:08 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:28 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:28 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:30 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:05:30 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:00 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:00 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:18 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:18 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:19 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:19 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:20 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:20 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:48 [warning] [application] Ungesichertes Attribut "0" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:06:48 [warning] [application] Ungesichertes Attribut "1" konnte nicht gesetzt werden. +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (40) +in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13) +2012/04/22 20:23:39 [error] [php] Trying to get property of non-object (D:\Projects\Astaf\workspace\admin.astaf.de\protected\models\AngebotVerein.php:91) +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): MyAngebotController->renderInternal() +#1 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): MyAngebotController->renderFile() +#2 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): MyAngebotController->renderPartial() +#3 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php(44): MyAngebotController->render() +#4 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionIndex() +#5 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams() +#6 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): MyAngebotController->runAction() +#7 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CAccessControlFilter->filter() +#9 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): MyAngebotController->filterAccessControl() +#10 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter() +#11 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#12 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): MyAngebotController->runActionWithFilters() +#13 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): MyAngebotController->run() +#14 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController() +#15 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#16 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CWebApplication->run() +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\models\AngebotVerein.php (91) +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\index.php (17) +in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (44) +2012/04/22 20:31:45 [error] [exception.CException] exception 'CException' with message 'Eigenschaft "Angebot.angebot_id ist nicht definiert.' in D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php:131 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\db\ar\CActiveRecord.php(144): CComponent->__get('angebot_id') +#1 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1696): CActiveRecord->__get('angebot_id') +#2 D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php(1659): CHtml::value(Object(Angebot), 'angebot_id') +#3 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\index.php(20): CHtml::listData(Array, 'angebot_id', 'name') +#4 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require('D:\Projects\Ast...') +#5 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): CBaseController->renderInternal('D:\Projects\Ast...', Array, true) +#6 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): CBaseController->renderFile('D:\Projects\Ast...', Array, true) +#7 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('index', Array, true) +#8 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php(44): CController->render('index', Array) +#9 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionIndex() +#10 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array) +#11 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction)) +#12 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run() +#13 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain)) +#14 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain)) +#15 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain)) +#16 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run() +#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array) +#18 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('index') +#19 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/index') +#20 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#21 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#22 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/index +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/index +--- +2012/04/24 18:45:06 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "admin".' in D:\Projects\Astaf\workspace\yii\framework\web\CController.php:484 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(271): CController->missingAction('admin') +#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('admin') +#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('verein/admin') +#3 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#4 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#5 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=verein/admin +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=site/login +--- +2012/04/24 18:45:44 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "admin".' in D:\Projects\Astaf\workspace\yii\framework\web\CController.php:484 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(271): CController->missingAction('admin') +#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('admin') +#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('verein/admin') +#3 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#4 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#5 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=verein/admin +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=site/login +--- +2012/04/24 18:46:02 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "admin".' in D:\Projects\Astaf\workspace\yii\framework\web\CController.php:484 +Stack trace: +#0 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(271): CController->missingAction('admin') +#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('admin') +#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('verein/admin') +#3 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest() +#4 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run() +#5 {main} +REQUEST_URI=/admin.astaf.de/index.php?r=verein/admin +HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=site/login +--- diff --git a/protected/runtime/gii-1.1.10/ControllerCode.php b/protected/runtime/gii-1.1.10/ControllerCode.php new file mode 100644 index 0000000..80bf100 --- /dev/null +++ b/protected/runtime/gii-1.1.10/ControllerCode.php @@ -0,0 +1,6 @@ + 'default', + 'baseClass' => 'Controller', + 'actions' => 'index', +); diff --git a/protected/views/kategorie/_form.php b/protected/views/kategorie/_form.php index 156fdd1..a6b9971 100644 --- a/protected/views/kategorie/_form.php +++ b/protected/views/kategorie/_form.php @@ -6,7 +6,7 @@ $form=$this->beginWidget('CActiveForm', array( 'enableAjaxValidation'=>false, )); ?> -

Mit * gekennzeichnete Felder sind Pflichtfelder.

+ renderPartial('/common/_required_fields_text'); ?> errorSummary($model); ?> diff --git a/protected/views/kategorie/index.php b/protected/views/kategorie/index.php index 3629458..2afd66f 100644 --- a/protected/views/kategorie/index.php +++ b/protected/views/kategorie/index.php @@ -1,39 +1,20 @@ breadcrumbs=array( - 'Kategorien verwalten', + 'Kategorien', ); $this->menu=array( array('label'=>'Kategorie erstellen', 'url'=>array('create')), ); - -Yii::app()->clientScript->registerScript('search', " -$('.search-button').click(function(){ - $('.search-form').toggle(); - return false; -}); -$('.search-form form').submit(function(){ - $.fn.yiiGridView.update('kategorie-grid', { - data: $(this).serialize() - }); - return false; -}); -"); ?> -

Kategorien verwalten

+

Kategorien

-

-Die optionale Eingabe von Vergleichsoperatoren (<, <=, >, >=, <> -or =) zu Beginn eines Suchwertes dient der Spezifikation, wie der Vergleich erfolgen soll. -

+renderPartial('/common/_comparison_text'); ?> -'search-button')); ?> - widget('zii.widgets.grid.CGridView', array( 'id'=>'kategorie-grid', diff --git a/protected/views/kategorie/update.php b/protected/views/kategorie/update.php index e8a09e6..b090579 100644 --- a/protected/views/kategorie/update.php +++ b/protected/views/kategorie/update.php @@ -1,12 +1,11 @@ breadcrumbs=array( - 'Kategories'=>array('index'), - $model->name=>array('view','id'=>$model->id), - 'Kategorie bearbeiten', + 'Kategorien'=>array('index'), + '"'.$model->name.'" bearbeiten', ); $this->menu=array( - array('label'=>'Kategorien verwalten', 'url'=>array('index')), + array('label'=>'Kategorien', 'url'=>array('index')), array('label'=>'Kategorie erstellen', 'url'=>array('create')), array('label'=>'Kategorie anzeigen', 'url'=>array('view', 'id'=>$model->id)), ); diff --git a/protected/views/layouts/main.php b/protected/views/layouts/main.php index 6f00be2..85ee278 100644 --- a/protected/views/layouts/main.php +++ b/protected/views/layouts/main.php @@ -37,6 +37,8 @@ "visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "kategorie"), array("label"=>"Speis & Trank", "url"=>array("/speisTrank/index"), "visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "speisTrank"), + array("label"=>"Speis & Trank", "url"=>array("/myAngebot/index"), + "visible"=>!Yii::app()->user->isGuest && Yii::app()->user->vereinId, "active"=>$this->id == "myAngebot"), array("label"=>"Veranstaltungen", "url"=>array("/veranstaltung/index"), "visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "veranstaltung"), array("label"=>"Benutzer", "url"=>array("/user/admin"), diff --git a/protected/views/myAngebot/_form.php b/protected/views/myAngebot/_form.php new file mode 100644 index 0000000..f48ecc9 --- /dev/null +++ b/protected/views/myAngebot/_form.php @@ -0,0 +1,51 @@ +
+ +beginWidget('CActiveForm', array( + 'id'=>'angebot-form', + 'enableAjaxValidation'=>false, +)); ?> + + renderPartial('/common/_required_fields_text'); ?> + + errorSummary($model); ?> + +
+ labelEx($model, 'angebot_id'); ?> + widget('zii.widgets.jui.CJuiAutoComplete', array( + 'name'=>'city', + 'source'=>array('ac1', 'ac2', 'ac3'), + // additional javascript options for the autocomplete plugin + 'options'=>array( + 'minLength'=>'2', + ), + 'htmlOptions'=>array( + 'style'=>'height:20px;' + ), +)); ?> + error($model, 'angebot_id'); ?> +
+ +
+ labelEx($model,'menge'); ?> + textField($model,'menge',array('size'=>60,'maxlength'=>80)); ?> + error($model,'menge'); ?> +
+ +
+ labelEx($model,'preis'); ?> + textField($model,'preis',array('size'=>60,'maxlength'=>80)); ?> + error($model,'preis'); ?> +
+ +
+ labelEx($model,'published'); ?> + checkbox($model,'published'); ?> + error($model,'published'); ?> +
+ +
+ isNewRecord ? 'Erstellen' : 'Speichern'); ?> +
+ +endWidget(); ?> +
\ No newline at end of file diff --git a/protected/views/myAngebot/_search.php b/protected/views/myAngebot/_search.php new file mode 100644 index 0000000..790eae1 --- /dev/null +++ b/protected/views/myAngebot/_search.php @@ -0,0 +1,29 @@ +
+ +beginWidget('CActiveForm', array( + 'action'=>Yii::app()->createUrl($this->route), + 'method'=>'get', +)); ?> + +
+ label($model,'published'); ?> + checkbox($model,'published'); ?> +
+ +
+ label($model,'menge'); ?> + textField($model,'menge'); ?> +
+ +
+ label($model,'preis'); ?> + textField($model,'preis'); ?> +
+ +
+ +
+ +endWidget(); ?> + +
\ No newline at end of file diff --git a/protected/views/myAngebot/create.php b/protected/views/myAngebot/create.php new file mode 100644 index 0000000..1a6bf5a --- /dev/null +++ b/protected/views/myAngebot/create.php @@ -0,0 +1,14 @@ +breadcrumbs=array( + 'Speis & Trank'=>array('index'), + 'Kulinarisches Angebot erstellen', +); + +$this->menu=array( + array('label'=>'Speis & Trank', 'url'=>array('index')), +); +?> + +

Kulinarisches Angebot erstellen

+ +renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file diff --git a/protected/views/myAngebot/index.php b/protected/views/myAngebot/index.php new file mode 100644 index 0000000..0c7fc43 --- /dev/null +++ b/protected/views/myAngebot/index.php @@ -0,0 +1,30 @@ +breadcrumbs=array( + 'Speis & Trank', +);?> + + +

Meine Angebote

+ +renderPartial('/common/_comparison_text'); ?> + +renderPartial('/common/_advanced_search',array( + 'model'=>$model, +)); ?> + +widget('zii.widgets.grid.CGridView', array( + 'id'=>'angebot-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + array('header'=>'Angebot', 'value'=>'$data->angebot->name', 'name'=>'angebot_id', 'filter'=>CHtml::listData(Angebot::model()->findAll(), 'id', 'name')), + array('header'=>'Verein', 'value'=>'$data->verein->name'), + array('header'=>'Menge', 'value'=>'Format::number($data->menge, $data->einheit)'), + array('header'=>'Preis', 'value'=>'Format::currency($data->preis)'), + array('header'=>'Öffentlich', + 'value'=>'CHtml::image($data->published ? "images/ok.png" : "images/nok.png", $data->published ? "ok.png" : "nok.png")', 'type'=>'raw'), + array( + 'class'=>'CButtonColumn' + ), + ), +)); ?> \ No newline at end of file diff --git a/protected/views/myAngebot/update.php b/protected/views/myAngebot/update.php new file mode 100644 index 0000000..e3bc87a --- /dev/null +++ b/protected/views/myAngebot/update.php @@ -0,0 +1,17 @@ +breadcrumbs=array( + 'Speis & Trank'=>array('index'), + $model->name.' bearbeiten', + +); + +$this->menu=array( + array('label'=>'Speis & Trank', 'url'=>array('index')), + array('label'=>'Kulinarisches Angebot erstellen', 'url'=>array('create')), + array('label'=>$model->name.' anzeigen', 'url'=>array('view', 'id'=>$model->id)), +); +?> + +

name; ?> bearbeiten

+ +renderPartial('_form', array('model'=>$model, 'kategorien'=>$kategorien)); ?> \ No newline at end of file diff --git a/protected/views/speisTrank/_angebot_vereine.php b/protected/views/speisTrank/_angebot_vereine.php index 93c1ebd..2d65d35 100644 --- a/protected/views/speisTrank/_angebot_vereine.php +++ b/protected/views/speisTrank/_angebot_vereine.php @@ -1,8 +1,12 @@ - \ No newline at end of file +keyField = false; +$this->widget('zii.widgets.grid.CGridView', array( + 'id'=>'angebot-vereine-grid', + 'dataProvider'=>$dataProvider, + 'columns'=>array( + array('header'=>'Verein', 'value'=>'CHtml::link(Verein::model()->findByPk($data->verein_id)->name, array("/verein/view", "id"=>$data->verein_id))', 'type'=>'raw'), + array('header'=>'Menge', 'value'=>'Format::number($data->menge, $data->einheit)'), + array('header'=>'Preis', 'value'=>'Format::currency($data->preis)') + ), +)); ?> \ No newline at end of file diff --git a/protected/views/speisTrank/_form.php b/protected/views/speisTrank/_form.php index 27349a4..ca1ba6f 100644 --- a/protected/views/speisTrank/_form.php +++ b/protected/views/speisTrank/_form.php @@ -44,7 +44,7 @@
- isNewRecord ? 'Create' : 'Save'); ?> + isNewRecord ? 'Erstellen' : 'Speichern'); ?>
endWidget(); ?> diff --git a/protected/views/standort/_form.php b/protected/views/standort/_form.php index fb17125..f37dc3d 100644 --- a/protected/views/standort/_form.php +++ b/protected/views/standort/_form.php @@ -15,6 +15,12 @@ error($model,'name'); ?> +
+ labelEx($model,'type'); ?> + + error($model,'type'); ?> +
+
labelEx($model,'pos_lat'); ?> textField($model,'pos_lat'); ?> diff --git a/protected/views/user/_form.php b/protected/views/user/_form.php index dda3df4..163e11c 100644 --- a/protected/views/user/_form.php +++ b/protected/views/user/_form.php @@ -5,7 +5,7 @@ 'enableAjaxValidation'=>false, )); ?> -

Fields with * are required.

+ renderPartial('/common/_required_fields_text'); ?> errorSummary($model); ?> diff --git a/protected/views/verein/_form.php b/protected/views/verein/_form.php index 9950421..9aab04d 100644 --- a/protected/views/verein/_form.php +++ b/protected/views/verein/_form.php @@ -6,7 +6,7 @@ "htmlOptions"=>array('enctype'=>'multipart/form-data'), )); ?> -

Mit * gekennzeichnete Felder sind Pflichtfelder.

+ renderPartial('/common/_required_fields_text'); ?> errorSummary($model); ?> diff --git a/protected/views/verein/index.php b/protected/views/verein/index.php index a396dbb..ca98727 100644 --- a/protected/views/verein/index.php +++ b/protected/views/verein/index.php @@ -1,40 +1,20 @@ breadcrumbs=array( - 'Vereine'=>array('index'), - 'Verwalten', + 'Vereine', ); $this->menu=array( array('label'=>'Verein erstellen', 'url'=>array('create')), ); - -Yii::app()->clientScript->registerScript('search', " -$('.search-button').click(function(){ - $('.search-form').toggle(); - return false; -}); -$('.search-form form').submit(function(){ - $.fn.yiiGridView.update('verein-grid', { - data: $(this).serialize() - }); - return false; -}); -"); ?> -

Vereine verwalten

+

Vereine

-

-Die optionale Eingabe von Vergleichsoperatoren (<, <=, >, >=, <> -or =) zu Beginn eines Suchwertes dient der Spezifikation, wie der Vergleich erfolgen soll. -

+renderPartial('/common/_comparison_text'); ?> -'search-button')); ?> - widget('zii.widgets.grid.CGridView', array( 'id'=>'verein-grid', diff --git a/protected/views/verein/update.php b/protected/views/verein/update.php index 2ce51a8..0d37b80 100644 --- a/protected/views/verein/update.php +++ b/protected/views/verein/update.php @@ -1,8 +1,7 @@ breadcrumbs=array( 'Vereine'=>array('index'), - $model->name=>array('view','id'=>$model->id), - 'Bearbeiten', + '"'.$model->name.'" bearbeiten', ); $this->menu=array( -- cgit v1.0-28-g1787 From 2d4bddcbf7b816f86db6f308a4d11bc9787c1f99 Mon Sep 17 00:00:00 2001 From: Tristan Zur Date: Sat, 28 Apr 2012 13:42:41 +0200 Subject: =?UTF-8?q?-=20Veranstaltungen=20CRUD=20Basisimplementierung=20-?= =?UTF-8?q?=20Extension=20"CJuiDateTimePicker"=20hinzugef=C3=BCgt=20-=20Mo?= =?UTF-8?q?dul=20"AuditTrail"=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 8 + protected/components/Html.php | 2 - protected/config/console.php | 8 +- protected/config/maincfg.php | 14 +- protected/controllers/VeranstaltungController.php | 167 ++++ protected/data/testdrive.db | Bin 0 -> 14336 bytes .../CJuiDateTimePicker/CJuiDateTimePicker.php | 62 ++ .../assets/jquery-ui-timepicker-addon.css | 5 + .../assets/jquery-ui-timepicker-addon.js | 981 +++++++++++++++++++++ protected/models/Angebot.php | 6 + protected/models/AngebotVerein.php | 6 + protected/models/Kategorie.php | 6 + protected/models/Standort.php | 6 + protected/models/Veranstaltung.php | 118 +++ protected/models/Verein.php | 6 + protected/modules/auditTrail/.DS_Store | Bin 0 -> 12292 bytes protected/modules/auditTrail/AuditTrailModule.php | 74 ++ protected/modules/auditTrail/README.txt | 19 + .../auditTrail/behaviors/LoggableBehavior.php | 133 +++ .../auditTrail/controllers/AdminController.php | 19 + .../auditTrail/controllers/DefaultController.php | 9 + .../m110517_155003_create_tables_audit_trail.php | 66 ++ protected/modules/auditTrail/models/.DS_Store | Bin 0 -> 6148 bytes protected/modules/auditTrail/models/AuditTrail.php | 125 +++ protected/modules/auditTrail/views/.DS_Store | Bin 0 -> 6148 bytes .../modules/auditTrail/views/admin/_search.php | 59 ++ protected/modules/auditTrail/views/admin/admin.php | 58 ++ .../modules/auditTrail/views/default/.DS_Store | Bin 0 -> 6148 bytes .../modules/auditTrail/views/default/index.php | 95 ++ protected/modules/auditTrail/widgets/.DS_Store | Bin 0 -> 6148 bytes .../modules/auditTrail/widgets/portlets/.DS_Store | Bin 0 -> 6148 bytes .../auditTrail/widgets/portlets/ShowAuditTrail.php | 157 ++++ protected/runtime/application.log | 226 +++++ protected/tests/functional/SiteTest.php | 6 +- protected/views/veranstaltung/_form.php | 98 ++ protected/views/veranstaltung/_search.php | 54 ++ protected/views/veranstaltung/_view.php | 38 + protected/views/veranstaltung/create.php | 16 + protected/views/veranstaltung/index.php | 35 + protected/views/veranstaltung/update.php | 18 + protected/views/veranstaltung/view.php | 28 + 41 files changed, 2715 insertions(+), 13 deletions(-) create mode 100644 .gitignore create mode 100644 protected/controllers/VeranstaltungController.php create mode 100644 protected/data/testdrive.db create mode 100644 protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php create mode 100644 protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.css create mode 100644 protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.js create mode 100644 protected/models/Veranstaltung.php create mode 100644 protected/modules/auditTrail/.DS_Store create mode 100644 protected/modules/auditTrail/AuditTrailModule.php create mode 100644 protected/modules/auditTrail/README.txt create mode 100644 protected/modules/auditTrail/behaviors/LoggableBehavior.php create mode 100644 protected/modules/auditTrail/controllers/AdminController.php create mode 100644 protected/modules/auditTrail/controllers/DefaultController.php create mode 100644 protected/modules/auditTrail/migrations/m110517_155003_create_tables_audit_trail.php create mode 100644 protected/modules/auditTrail/models/.DS_Store create mode 100644 protected/modules/auditTrail/models/AuditTrail.php create mode 100644 protected/modules/auditTrail/views/.DS_Store create mode 100644 protected/modules/auditTrail/views/admin/_search.php create mode 100644 protected/modules/auditTrail/views/admin/admin.php create mode 100644 protected/modules/auditTrail/views/default/.DS_Store create mode 100644 protected/modules/auditTrail/views/default/index.php create mode 100644 protected/modules/auditTrail/widgets/.DS_Store create mode 100644 protected/modules/auditTrail/widgets/portlets/.DS_Store create mode 100644 protected/modules/auditTrail/widgets/portlets/ShowAuditTrail.php create mode 100644 protected/views/veranstaltung/_form.php create mode 100644 protected/views/veranstaltung/_search.php create mode 100644 protected/views/veranstaltung/_view.php create mode 100644 protected/views/veranstaltung/create.php create mode 100644 protected/views/veranstaltung/index.php create mode 100644 protected/views/veranstaltung/update.php create mode 100644 protected/views/veranstaltung/view.php diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fddbf02 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ + +/assets/17a1de59 +/assets/3940d2b +/assets/505bb103 +/assets/b6d35603 +/assets/e5f37766 +/assets/e7e1ddad +/assets/fc6ef99b \ No newline at end of file diff --git a/protected/components/Html.php b/protected/components/Html.php index 08fc6d9..6c7df3c 100644 --- a/protected/components/Html.php +++ b/protected/components/Html.php @@ -34,7 +34,5 @@ class Html extends CHtml { public static function enumDropDownList($model, $attribute, $htmlOptions = array()) { return CHtml::activeDropDownList($model, $attribute, Html::enumItem($model, $attribute), $htmlOptions); } - - } ?> \ No newline at end of file diff --git a/protected/config/console.php b/protected/config/console.php index 15c9353..2df2b24 100644 --- a/protected/config/console.php +++ b/protected/config/console.php @@ -7,18 +7,16 @@ return array( 'name'=>'My Console Application', // application components 'components'=>array( - 'db'=>array( + /*'db'=>array( 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', - ), + ),*/ // uncomment the following to use a MySQL database - /* 'db'=>array( - 'connectionString' => 'mysql:host=localhost;dbname=testdrive', + 'connectionString' => 'mysql:host=localhost;dbname=astaf', 'emulatePrepare' => true, 'username' => 'root', 'password' => '', 'charset' => 'utf8', ), - */ ), ); \ No newline at end of file diff --git a/protected/config/maincfg.php b/protected/config/maincfg.php index 78c3c6a..c1443ba 100644 --- a/protected/config/maincfg.php +++ b/protected/config/maincfg.php @@ -16,7 +16,8 @@ return array( 'import'=>array( 'application.models.*', 'application.components.*', - 'application.extensions.egmap.*' + 'application.extensions.egmap.*', + 'application.modules.auditTrail.models.AuditTrail', ), 'modules'=>array( @@ -27,6 +28,11 @@ return array( // If removed, Gii defaults to localhost only. Edit carefully to taste. 'ipFilters'=>array('127.0.0.1','::1'), ), + 'auditTrail'=>array( + 'userClass' => 'User', // the class name for the user object + 'userIdColumn' => 'id', // the column name of the primary key for the user + 'userNameColumn' => 'username', // the column name of the primary key for the user + ), ), // application components @@ -86,6 +92,10 @@ return array( 'pos_lat'=>48.8323934983, 'pos_long'=>9.31750059128, 'map_api_key'=>'ABQIAAAAzwMJRVnIOel5nqTjdUcPrRTSNOUR83EeIVShY4aBvXxHJx0DexSUFNGH3KQhtFhfSNHxkECqL5rQBA', - 'map_api_domain'=>'www.astaf.de' + 'map_api_domain'=>'www.astaf.de', + 'start_date'=>'01.07.2012', + 'end_date'=>'03.07.2012', + 'start_time'=>'19:00', + 'end_time'=>'23:00', ), ); \ No newline at end of file diff --git a/protected/controllers/VeranstaltungController.php b/protected/controllers/VeranstaltungController.php new file mode 100644 index 0000000..d4471b7 --- /dev/null +++ b/protected/controllers/VeranstaltungController.php @@ -0,0 +1,167 @@ +array('create','update','index','view','delete'), + 'users'=>array('admin'), + ), + array('deny', // deny all users + 'users'=>array('*'), + ), + ); + } + + /** + * Displays a particular model. + * @param integer $id the ID of the model to be displayed + */ + public function actionView($id) + { + $this->render('view',array( + 'model'=>$this->loadModel($id), + )); + } + + /** + * Creates a new model. + * If creation is successful, the browser will be redirected to the 'view' page. + */ + public function actionCreate() + { + $model=new Veranstaltung; + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['Veranstaltung'])) + { + $model->attributes=$_POST['Veranstaltung']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $standorte = Standort::model()->findAll(array("condition"=>"published=1 and type='Bühne'")); + $vereine = Verein::model()->findAll(array("condition"=>"published=1")); + + $this->render('create',array( + 'model'=>$model, + 'vereine'=>$vereine, + 'standorte'=>$standorte + )); + } + + /** + * Updates a particular model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id the ID of the model to be updated + */ + public function actionUpdate($id) + { + $model=$this->loadModel($id); + + // Uncomment the following line if AJAX validation is needed + // $this->performAjaxValidation($model); + + if(isset($_POST['Veranstaltung'])) + { + $model->attributes=$_POST['Veranstaltung']; + if($model->save()) + $this->redirect(array('view','id'=>$model->id)); + } + + $standorte = Standort::model()->findAll(array("condition"=>"published=1 and type='Bühne'")); + $vereine = Verein::model()->findAll(array("condition"=>"published=1")); + + $this->render('update',array( + 'model'=>$model, + 'vereine'=>$vereine, + 'standorte'=>$standorte + )); + } + + /** + * Deletes a particular model. + * If deletion is successful, the browser will be redirected to the 'admin' page. + * @param integer $id the ID of the model to be deleted + */ + public function actionDelete($id) + { + if(Yii::app()->request->isPostRequest) + { + // we only allow deletion via POST request + $this->loadModel($id)->delete(); + + // if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser + if(!isset($_GET['ajax'])) + $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin')); + } + else + throw new CHttpException(400,'Invalid request. Please do not repeat this request again.'); + } + + /** + * Lists all models. + */ + public function actionIndex() + { + $model=new Veranstaltung('search'); + $model->unsetAttributes(); // clear any default values + if(isset($_GET['Veranstaltung'])) + $model->attributes=$_GET['Veranstaltung']; + + $this->render('index',array( + 'model'=>$model, + )); + } + + /** + * Returns the data model based on the primary key given in the GET variable. + * If the data model is not found, an HTTP exception will be raised. + * @param integer the ID of the model to be loaded + */ + public function loadModel($id) + { + $model=Veranstaltung::model()->findByPk($id); + if($model===null) + throw new CHttpException(404,'The requested page does not exist.'); + return $model; + } + + /** + * Performs the AJAX validation. + * @param CModel the model to be validated + */ + protected function performAjaxValidation($model) + { + if(isset($_POST['ajax']) && $_POST['ajax']==='veranstaltung-form') + { + echo CActiveForm::validate($model); + Yii::app()->end(); + } + } +} diff --git a/protected/data/testdrive.db b/protected/data/testdrive.db new file mode 100644 index 0000000..e335767 Binary files /dev/null and b/protected/data/testdrive.db differ diff --git a/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php b/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php new file mode 100644 index 0000000..3a73cb6 --- /dev/null +++ b/protected/extensions/CJuiDateTimePicker/CJuiDateTimePicker.php @@ -0,0 +1,62 @@ + + */ + +Yii::import('zii.widgets.jui.CJuiDatePicker'); +class CJuiDateTimePicker extends CJuiDatePicker +{ + const ASSETS_NAME='/jquery-ui-timepicker-addon'; + + public $mode='datetime'; + + public function init() + { + if(!in_array($this->mode, array('date','time','datetime'))) + throw new CException('unknow mode "'.$this->mode.'"'); + if(!isset($this->language)) + $this->language=Yii::app()->getLanguage(); + return parent::init(); + } + + public function run() + { + list($name,$id)=$this->resolveNameID(); + + if(isset($this->htmlOptions['id'])) + $id=$this->htmlOptions['id']; + else + $this->htmlOptions['id']=$id; + if(isset($this->htmlOptions['name'])) + $name=$this->htmlOptions['name']; + else + $this->htmlOptions['name']=$name; + + if($this->hasModel()) + echo CHtml::activeTextField($this->model,$this->attribute,$this->htmlOptions); + else + echo CHtml::textField($name,$this->value,$this->htmlOptions); + + + $options=CJavaScript::encode($this->options); + + $js = "jQuery('#{$id}').{$this->mode}picker($options);"; + + if (isset($this->language)){ + $this->registerScriptFile($this->i18nScriptFile); + $js = "jQuery('#{$id}').{$this->mode}picker(jQuery.extend({showMonthAfterYear:false}, jQuery.datepicker.regional['{$this->language}'], {$options}));"; + } + + $cs = Yii::app()->getClientScript(); + + $assets = Yii::app()->getAssetManager()->publish(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'); + $cs->registerCssFile($assets.self::ASSETS_NAME.'.css'); + $cs->registerScriptFile($assets.self::ASSETS_NAME.'.js',CClientScript::POS_END); + + $cs->registerScript(__CLASS__, $this->defaultOptions?'jQuery.{$this->mode}picker.setDefaults('.CJavaScript::encode($this->defaultOptions).');':''); + $cs->registerScript(__CLASS__.'#'.$id, $js); + + } +} \ No newline at end of file diff --git a/protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.css b/protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.css new file mode 100644 index 0000000..2cdb20f --- /dev/null +++ b/protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.css @@ -0,0 +1,5 @@ +.ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; } +.ui-timepicker-div dl{ text-align: left; } +.ui-timepicker-div dl dt{ height: 25px; } +.ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; } +.ui-timepicker-div td { font-size: 90%; } \ No newline at end of file diff --git a/protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.js b/protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.js new file mode 100644 index 0000000..215e43a --- /dev/null +++ b/protected/extensions/CJuiDateTimePicker/assets/jquery-ui-timepicker-addon.js @@ -0,0 +1,981 @@ +/* +* jQuery timepicker addon +* By: Trent Richardson [http://trentrichardson.com] +* Version 0.9.4-dev +* Last Modified: 03/02/2011 +* +* Copyright 2011 Trent Richardson +* Dual licensed under the MIT and GPL licenses. +* http://trentrichardson.com/Impromptu/GPL-LICENSE.txt +* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt +* +* HERES THE CSS: +* .ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; } +* .ui-timepicker-div dl{ text-align: left; } +* .ui-timepicker-div dl dt{ height: 25px; } +* .ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; } +* .ui-timepicker-div td { font-size: 90%; } +*/ + +(function($) { + +$.extend($.ui, { timepicker: { version: "0.9.4" } }); + +/* Time picker manager. + Use the singleton instance of this class, $.timepicker, to interact with the time picker. + Settings for (groups of) time pickers are maintained in an instance object, + allowing multiple different settings on the same page. */ + +function Timepicker() { + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + currentText: 'Now', + closeText: 'Done', + ampm: false, + timeFormat: 'hh:mm tt', + timeOnlyTitle: 'Choose Time', + timeText: 'Time', + hourText: 'Hour', + minuteText: 'Minute', + secondText: 'Second', + timezoneText: 'Time Zone' + }; + this._defaults = { // Global defaults for all the datetime picker instances + showButtonPanel: true, + timeOnly: false, + showHour: true, + showMinute: true, + showSecond: false, + showTimezone: false, + showTime: true, + stepHour: 0.05, + stepMinute: 0.05, + stepSecond: 0.05, + hour: 0, + minute: 0, + second: 0, + timezone: '+0000', + hourMin: 0, + minuteMin: 0, + secondMin: 0, + hourMax: 23, + minuteMax: 59, + secondMax: 59, + minDateTime: null, + maxDateTime: null, + hourGrid: 0, + minuteGrid: 0, + secondGrid: 0, + alwaysSetTime: true, + separator: ' ', + altFieldTimeOnly: true, + showTimepicker: true, + timezoneList: ["-1100", "-1000", "-0900", "-0800", "-0700", "-0600", + "-0500", "-0400", "-0300", "-0200", "-0100", "+0000", + "+0100", "+0200", "+0300", "+0400", "+0500", "+0600", + "+0700", "+0800", "+0900", "+1000", "+1100", "+1200"] + }; + $.extend(this._defaults, this.regional['']); +} + +$.extend(Timepicker.prototype, { + $input: null, + $altInput: null, + $timeObj: null, + inst: null, + hour_slider: null, + minute_slider: null, + second_slider: null, + timezone_select: null, + hour: 0, + minute: 0, + second: 0, + timezone: '+0000', + hourMinOriginal: null, + minuteMinOriginal: null, + secondMinOriginal: null, + hourMaxOriginal: null, + minuteMaxOriginal: null, + secondMaxOriginal: null, + ampm: '', + formattedDate: '', + formattedTime: '', + formattedDateTime: '', + timezoneList: ["-1100", "-1000", "-0900", "-0800", "-0700", "-0600", + "-0500", "-0400", "-0300", "-0200", "-0100", "+0000", + "+0100", "+0200", "+0300", "+0400", "+0500", "+0600", + "+0700", "+0800", "+0900", "+1000", "+1100", "+1200"], + + /* Override the default settings for all instances of the time picker. + @param settings object - the new settings to use as defaults (anonymous object) + @return the manager object */ + setDefaults: function(settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + //######################################################################## + // Create a new Timepicker instance + //######################################################################## + _newInst: function($input, o) { + var tp_inst = new Timepicker(), + inlineSettings = {}; + + for (var attrName in this._defaults) { + var attrValue = $input.attr('time:' + attrName); + if (attrValue) { + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, o, { + beforeShow: function(input, dp_inst) { + if ($.isFunction(o.beforeShow)) + o.beforeShow(input, dp_inst, tp_inst); + }, + onChangeMonthYear: function(year, month, dp_inst) { + // Update the time as well : this prevents the time from disappearing from the $input field. + tp_inst._updateDateTime(dp_inst); + if ($.isFunction(o.onChangeMonthYear)) + o.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); + }, + onClose: function(dateText, dp_inst) { + if (tp_inst.timeDefined === true && $input.val() != '') + tp_inst._updateDateTime(dp_inst); + if ($.isFunction(o.onClose)) + o.onClose.call($input[0], dateText, dp_inst, tp_inst); + }, + timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); + }); + + tp_inst.hour = tp_inst._defaults.hour; + tp_inst.minute = tp_inst._defaults.minute; + tp_inst.second = tp_inst._defaults.second; + tp_inst.ampm = ''; + tp_inst.$input = $input; + + if (o.altField) + tp_inst.$altInput = $(o.altField) + .css({ cursor: 'pointer' }) + .focus(function(){ $input.trigger("focus"); }); + + // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. + if(tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) + tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); + if(tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); + if(tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) + tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); + if(tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); + + return tp_inst; + }, + + //######################################################################## + // add our sliders to the calendar + //######################################################################## + _addTimePicker: function(dp_inst) { + var currDT = (this.$altInput && this._defaults.altFieldTimeOnly) ? + this.$input.val() + ' ' + this.$altInput.val() : + this.$input.val(); + + this.timeDefined = this._parseTime(currDT); + this._limitMinMaxDateTime(dp_inst, false); + this._injectTimePicker(); + }, + + //######################################################################## + // parse the time string from input value or _setTime + //######################################################################## + _parseTime: function(timeString, withDate) { + var regstr = this._defaults.timeFormat.toString() + .replace(/h{1,2}/ig, '(\\d?\\d)') + .replace(/m{1,2}/ig, '(\\d?\\d)') + .replace(/s{1,2}/ig, '(\\d?\\d)') + .replace(/t{1,2}/ig, '(am|pm|a|p)?') + .replace(/z{1}/ig, '((\\+|-)\\d\\d\\d\\d)?') + .replace(/\s/g, '\\s?') + '$', + order = this._getFormatPositions(), + treg; + + if (!this.inst) this.inst = $.datepicker._getInst(this.$input[0]); + + if (withDate || !this._defaults.timeOnly) { + // the time should come after x number of characters and a space. + // x = at least the length of text specified by the date format + var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); + // escape special regex characters in the seperator + var specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g"); + regstr = '.{' + dp_dateFormat.length + ',}' + this._defaults.separator.replace(specials, "\\$&") + regstr; + } + + treg = timeString.match(new RegExp(regstr, 'i')); + + if (treg) { + if (order.t !== -1) + this.ampm = ((treg[order.t] === undefined || treg[order.t].length === 0) ? + '' : + (treg[order.t].charAt(0).toUpperCase() == 'A') ? 'AM' : 'PM').toUpperCase(); + + if (order.h !== -1) { + if (this.ampm == 'AM' && treg[order.h] == '12') + this.hour = 0; // 12am = 0 hour + else if (this.ampm == 'PM' && treg[order.h] != '12') + this.hour = (parseFloat(treg[order.h]) + 12).toFixed(0); // 12pm = 12 hour, any other pm = hour + 12 + else this.hour = Number(treg[order.h]); + } + + if (order.m !== -1) this.minute = Number(treg[order.m]); + if (order.s !== -1) this.second = Number(treg[order.s]); + if (order.z !== -1) this.timezone = treg[order.z]; + + return true; + + } + return false; + }, + + //######################################################################## + // figure out position of time elements.. cause js cant do named captures + //######################################################################## + _getFormatPositions: function() { + var finds = this._defaults.timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|t{1,2}|z)/g), + orders = { h: -1, m: -1, s: -1, t: -1, z: -1 }; + + if (finds) + for (var i = 0; i < finds.length; i++) + if (orders[finds[i].toString().charAt(0)] == -1) + orders[finds[i].toString().charAt(0)] = i + 1; + + return orders; + }, + + //######################################################################## + // generate and inject html for timepicker into ui datepicker + //######################################################################## + _injectTimePicker: function() { + var $dp = this.inst.dpDiv, + o = this._defaults, + tp_inst = this, + // Added by Peter Medeiros: + // - Figure out what the hour/minute/second max should be based on the step values. + // - Example: if stepMinute is 15, then minMax is 45. + hourMax = (o.hourMax - (o.hourMax % o.stepHour)).toFixed(0), + minMax = (o.minuteMax - (o.minuteMax % o.stepMinute)).toFixed(0), + secMax = (o.secondMax - (o.secondMax % o.stepSecond)).toFixed(0), + dp_id = this.inst.id.toString().replace(/([^A-Za-z0-9_])/g, ''); + + // Prevent displaying twice + //if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0) { + if ($dp.find("div#ui-timepicker-div-"+ dp_id).length === 0 && o.showTimepicker) { + var noDisplay = ' style="display:none;"', + html = '
' + + '
' + o.timeText + '
' + + '
' + + '
' + o.hourText + '
', + hourGridSize = 0, + minuteGridSize = 0, + secondGridSize = 0, + size; + + if (o.showHour && o.hourGrid > 0) { + html += '
' + + '
' + + '
'; + + for (var h = o.hourMin; h < hourMax; h += o.hourGrid) { + hourGridSize++; + var tmph = (o.ampm && h > 12) ? h-12 : h; + if (tmph < 10) tmph = '0' + tmph; + if (o.ampm) { + if (h == 0) tmph = 12 +'a'; + else if (h < 12) tmph += 'a'; + else tmph += 'p'; + } + html += ''; + } + + html += '
' + tmph + '
' + + '
'; + } else html += '
'; + + html += '
' + o.minuteText + '
'; + + if (o.showMinute && o.minuteGrid > 0) { + html += '
' + + '
' + + '
'; + + for (var m = o.minuteMin; m < minMax; m += o.minuteGrid) { + minuteGridSize++; + html += ''; + } + + html += '
' + ((m < 10) ? '0' : '') + m + '
' + + '
'; + } else html += '
'; + + html += '
' + o.secondText + '
'; + + if (o.showSecond && o.secondGrid > 0) { + html += '
' + + '
' + + '
'; + + for (var s = o.secondMin; s < secMax; s += o.secondGrid) { + secondGridSize++; + html += ''; + } + + html += '
' + ((s < 10) ? '0' : '') + s + '
' + + '
'; + } else html += '
'; + + html += '
' + o.timezoneText + '
'; + html += '
'; + + html += '
'; + $tp = $(html); + + // if we only want time picker... + if (o.timeOnly === true) { + $tp.prepend( + '
' + + '
' + o.timeOnlyTitle + '
' + + '
'); + $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); + } + + this.hour_slider = $tp.find('#ui_tpicker_hour_'+ dp_id).slider({ + orientation: "horizontal", + value: this.hour, + min: o.hourMin, + max: hourMax, + step: o.stepHour, + slide: function(event, ui) { + tp_inst.hour_slider.slider( "option", "value", ui.value); + tp_inst._onTimeChange(); + } + }); + + // Updated by Peter Medeiros: + // - Pass in Event and UI instance into slide function + this.minute_slider = $tp.find('#ui_tpicker_minute_'+ dp_id).slider({ + orientation: "horizontal", + value: this.minute, + min: o.minuteMin, + max: minMax, + step: o.stepMinute, + slide: function(event, ui) { + // update the global minute slider instance value with the current slider value + tp_inst.minute_slider.slider( "option", "value", ui.value); + tp_inst._onTimeChange(); + } + }); + + this.second_slider = $tp.find('#ui_tpicker_second_'+ dp_id).slider({ + orientation: "horizontal", + value: this.second, + min: o.secondMin, + max: secMax, + step: o.stepSecond, + slide: function(event, ui) { + tp_inst.second_slider.slider( "option", "value", ui.value); + tp_inst._onTimeChange(); + } + }); + + + this.timezone_select = $tp.find('#ui_tpicker_timezone_'+ dp_id).append('').find("select"); + $.fn.append.apply(this.timezone_select, + $.map(o.timezoneList, function(val, idx) { + return $("