From 6b415d25fd106d42ada013bff376e9bcd5d07f8b Mon Sep 17 00:00:00 2001
From: ccwn <tzur@ccwn.org>
Date: Sun, 15 Apr 2012 17:03:33 +0200
Subject: =?UTF-8?q?Speis=20&=20Trank=20hinzugef=C3=BCgt?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 protected/config/main.php                      |   4 +-
 protected/controllers/SpeisTrankController.php | 167 +++++++++++++++
 protected/models/Angebot.php                   |   4 +-
 protected/runtime/application.log              | 270 +++++++++++++++++++++++++
 protected/views/layouts/main.php               |   4 +-
 protected/views/speisTrank/_form.php           |  52 +++++
 protected/views/speisTrank/_search.php         |  39 ++++
 protected/views/speisTrank/create.php          |  14 ++
 protected/views/speisTrank/index.php           |  57 ++++++
 protected/views/speisTrank/update.php          |  17 ++
 protected/views/speisTrank/view.php            |  24 +++
 protected/views/verein/_form.php               |   2 +-
 12 files changed, 648 insertions(+), 6 deletions(-)
 create mode 100644 protected/controllers/SpeisTrankController.php
 create mode 100644 protected/views/speisTrank/_form.php
 create mode 100644 protected/views/speisTrank/_search.php
 create mode 100644 protected/views/speisTrank/create.php
 create mode 100644 protected/views/speisTrank/index.php
 create mode 100644 protected/views/speisTrank/update.php
 create mode 100644 protected/views/speisTrank/view.php

diff --git a/protected/config/main.php b/protected/config/main.php
index 83f49d4..540759b 100644
--- a/protected/config/main.php
+++ b/protected/config/main.php
@@ -36,7 +36,7 @@ return array(
 		),
 		// uncomment the following to enable URLs in path-format
 		
-		'urlManager'=>array(
+		/*'urlManager'=>array(
 			'urlFormat'=>'path',
 			//"showScriptName"=>false,
 			'rules'=>array(
@@ -44,7 +44,7 @@ return array(
 				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
 				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
 			),
-		),
+		),*/
 		/*'db'=>array(
 			'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db',
 		),*/
diff --git a/protected/controllers/SpeisTrankController.php b/protected/controllers/SpeisTrankController.php
new file mode 100644
index 0000000..6f0931e
--- /dev/null
+++ b/protected/controllers/SpeisTrankController.php
@@ -0,0 +1,167 @@
+<?php
+
+class SpeisTrankController extends Controller
+{
+	/**
+	 * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
+	 * using two-column layout. See 'protected/views/layouts/column2.php'.
+	 */
+	public $layout='//layouts/column2';
+
+	/**
+	 * @return array action filters
+	 */
+	public function filters()
+	{
+		return array(
+			'accessControl', // perform access control for CRUD operations
+		);
+	}
+
+	/**
+	 * Specifies the access control rules.
+	 * This method is used by the 'accessControl' filter.
+	 * @return array access control rules
+	 */
+	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'),
+				'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 Angebot;
+
+		// Uncomment the following line if AJAX validation is needed
+		// $this->performAjaxValidation($model);
+
+		if(isset($_POST['Angebot']))
+		{
+			$model->attributes=$_POST['Angebot'];
+			if($model->save())
+				$this->redirect(array('view','id'=>$model->id));
+		}
+		
+		$kategorien = Kategorie::model()->findAll(array("condition"=>"published=1"));
+
+		$this->render('create',array(
+			'model'=>$model,
+			'kategorien'=>$kategorien
+		));
+	}
+
+	/**
+	 * 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['Angebot']))
+		{
+			$model->attributes=$_POST['Angebot'];
+			if($model->save())
+				$this->redirect(array('view','id'=>$model->id));
+		}
+		
+		$kategorien = Kategorie::model()->findAll(array("condition"=>"published=1"));
+
+		$this->render('update',array(
+			'model'=>$model,
+			'kategorien'=>$kategorien
+		));
+	}
+
+	/**
+	 * 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 Angebot('search');
+		$model->unsetAttributes();  // clear any default values
+		if(isset($_GET['Angebot']))
+			$model->attributes=$_GET['Angebot'];
+
+		$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=Angebot::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']==='angebot-form')
+		{
+			echo CActiveForm::validate($model);
+			Yii::app()->end();
+		}
+	}
+}
diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php
index 03b5496..baa31b8 100644
--- a/protected/models/Angebot.php
+++ b/protected/models/Angebot.php
@@ -55,6 +55,7 @@ class Angebot extends CActiveRecord
 		// NOTE: you may need to adjust the relation name and the related
 		// class name for the relations automatically generated below.
 		return array(
+				"kategorie"=>array(self::HAS_ONE, "Kategorie", array('id'=>'kategorie_id'))
 		);
 	}
 
@@ -66,9 +67,10 @@ class Angebot extends CActiveRecord
 		return array(
 			'id' => 'ID',
 			'kategorie_id' => 'Kategorie',
+			'kategorie' => 'Kategorie',
 			'name' => 'Name',
 			'beschreibung' => 'Beschreibung',
-			'published' => 'Published',
+			'published' => 'Öffentlich',
 		);
 	}
 
diff --git a/protected/runtime/application.log b/protected/runtime/application.log
index 302363f..63e782c 100644
--- a/protected/runtime/application.log
+++ b/protected/runtime/application.log
@@ -2078,3 +2078,273 @@ Stack trace:
 #5 {main}
 REQUEST_URI=/admin.astaf.de/index.php/kategorie/images/ok.png
 ---
+2012/04/15 16:06:23 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('kategorie/image...')
+#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/kategorie/images/ok.png
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/kategorie/index
+---
+2012/04/15 16:06:24 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "images/uploaded/1334304302CCWN.jpg".' in D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php:280
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('images/uploaded...')
+#1 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#2 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#3 {main}
+REQUEST_URI=/admin.astaf.de/index.php/images/uploaded/1334304302CCWN.jpg
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/verein
+---
+2012/04/15 16:06:24 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "images/uploaded/1334304302CCWN.jpg".' in D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php:280
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('images/uploaded...')
+#1 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#2 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#3 {main}
+REQUEST_URI=/admin.astaf.de/index.php/images/uploaded/1334304302CCWN.jpg
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/verein
+---
+2012/04/15 16:31:25 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('kategorie/image...')
+#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/kategorie/images/ok.png
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/kategorie/index
+---
+2012/04/15 16:31:44 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('kategorie/image...')
+#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/kategorie/images/ok.png
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/kategorie/index
+---
+2012/04/15 16:31:45 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('kategorie/image...')
+#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/kategorie/images/ok.png
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/kategorie/index
+---
+2012/04/15 16:31:45 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "speise/index".' in D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php:280
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speise/index')
+#1 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#2 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#3 {main}
+REQUEST_URI=/admin.astaf.de/index.php/speise/index
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/kategorie/index
+---
+2012/04/15 16:34:41 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "speise/index".' in D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php:280
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speise/index')
+#1 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#2 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#3 {main}
+REQUEST_URI=/admin.astaf.de/index.php/speise/index
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/speise/index
+---
+2012/04/15 16:34:56 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "angebot/index".' in D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php:280
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('angebot/index')
+#1 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#2 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#3 {main}
+REQUEST_URI=/admin.astaf.de/index.php/angebot/index
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/speise/index
+---
+2012/04/15 16:34:57 [error] [exception.CException] exception 'CException' with message 'SpeisTrankController cannot find the requested view "index".' in D:\Projects\Astaf\workspace\yii\framework\web\CController.php:879
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): CController->renderPartial('index', Array, true)
+#1 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(133): CController->render('index', Array)
+#2 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): SpeisTrankController->actionIndex()
+#3 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array)
+#4 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction))
+#5 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
+#6 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain))
+#7 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
+#8 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain))
+#9 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#10 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array)
+#11 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('index')
+#12 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speisTrank/inde...')
+#13 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#14 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#15 {main}
+REQUEST_URI=/admin.astaf.de/index.php/speisTrank/index
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/angebot/index
+---
+2012/04/15 16:39:10 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('kategorie/image...')
+#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/kategorie/images/ok.png
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/kategorie/index
+---
+2012/04/15 16:39:12 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "veranstaltung/index".' in D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php:280
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('veranstaltung/i...')
+#1 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#2 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#3 {main}
+REQUEST_URI=/admin.astaf.de/index.php/veranstaltung/index
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/speisTrank/index
+---
+2012/04/15 16:39:15 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('verein/images/u...')
+#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/verein/images/uploaded/1334304302CCWN.jpg
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/verein/index
+---
+2012/04/15 16:39:15 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('verein/images/u...')
+#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/verein/images/uploaded/1334304302CCWN.jpg
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/verein/index
+---
+2012/04/15 16:40:49 [error] [php] htmlspecialchars() expects parameter 1 to be string, object given (D:\Projects\Astaf\workspace\yii\framework\web\helpers\CHtml.php:85)
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\utils\CFormatter.php(104): CFormatter->formatText()
+#1 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CDataColumn.php(142): CFormatter->format()
+#2 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridColumn.php(138): CDataColumn->renderDataCellContent()
+#3 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(517): CDataColumn->renderDataCell()
+#4 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(490): CGridView->renderTableRow()
+#5 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(400): CGridView->renderTableBody()
+#6 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(158): CGridView->renderItems()
+#7 unknown(0): CGridView->renderSection()
+#8 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(141): preg_replace_callback()
+#9 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(126): CGridView->renderContent()
+#10 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(174): CGridView->run()
+#11 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\index.php(58): SpeisTrankController->widget()
+#12 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require()
+#13 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): SpeisTrankController->renderInternal()
+#14 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): SpeisTrankController->renderFile()
+#15 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): SpeisTrankController->renderPartial()
+#16 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(133): SpeisTrankController->render()
+#17 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): SpeisTrankController->actionIndex()
+#18 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams()
+#19 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): SpeisTrankController->runAction()
+#20 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
+#21 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CAccessControlFilter->filter()
+#22 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): SpeisTrankController->filterAccessControl()
+#23 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter()
+#24 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#25 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): SpeisTrankController->runActionWithFilters()
+#26 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): SpeisTrankController->run()
+#27 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController()
+#28 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#29 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CWebApplication->run()
+REQUEST_URI=/admin.astaf.de/index.php/speisTrank/index
+in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\index.php (58)
+in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php (133)
+in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13)
+2012/04/15 16:42:10 [error] [php] Undefined variable: model (D:\Projects\Astaf\workspace\yii\framework\base\CComponent.php(607) : eval()'d code:1)
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridColumn.php(138): CDataColumn->renderDataCellContent()
+#1 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(517): CDataColumn->renderDataCell()
+#2 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(490): CGridView->renderTableRow()
+#3 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\grid\CGridView.php(400): CGridView->renderTableBody()
+#4 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(158): CGridView->renderItems()
+#5 unknown(0): CGridView->renderSection()
+#6 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(141): preg_replace_callback()
+#7 D:\Projects\Astaf\workspace\yii\framework\zii\widgets\CBaseListView.php(126): CGridView->renderContent()
+#8 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(174): CGridView->run()
+#9 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\index.php(58): SpeisTrankController->widget()
+#10 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require()
+#11 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): SpeisTrankController->renderInternal()
+#12 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): SpeisTrankController->renderFile()
+#13 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): SpeisTrankController->renderPartial()
+#14 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(133): SpeisTrankController->render()
+#15 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): SpeisTrankController->actionIndex()
+#16 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams()
+#17 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): SpeisTrankController->runAction()
+#18 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
+#19 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CAccessControlFilter->filter()
+#20 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): SpeisTrankController->filterAccessControl()
+#21 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter()
+#22 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#23 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): SpeisTrankController->runActionWithFilters()
+#24 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): SpeisTrankController->run()
+#25 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController()
+#26 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#27 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CWebApplication->run()
+REQUEST_URI=/admin.astaf.de/index.php/speisTrank/index
+in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\index.php (58)
+in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php (133)
+in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13)
+2012/04/15 16:43:09 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'The system is unable to find the requested action "images".' 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('images')
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('images')
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('speisTrank/imag...')
+#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/speisTrank/images/ok.png
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php/speisTrank/index
+---
+2012/04/15 16:55:09 [error] [php] Undefined variable: kategorien (D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\_form.php:14)
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): SpeisTrankController->renderFile()
+#1 D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\update.php(18): SpeisTrankController->renderPartial()
+#2 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(127): require()
+#3 D:\Projects\Astaf\workspace\yii\framework\web\CBaseController.php(96): SpeisTrankController->renderInternal()
+#4 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(870): SpeisTrankController->renderFile()
+#5 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(783): SpeisTrankController->renderPartial()
+#6 D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php(101): SpeisTrankController->render()
+#7 unknown(0): SpeisTrankController->actionUpdate()
+#8 D:\Projects\Astaf\workspace\yii\framework\web\actions\CAction.php(107): ReflectionMethod->invokeArgs()
+#9 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(48): CInlineAction->runWithParamsInternal()
+#10 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams()
+#11 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): SpeisTrankController->runAction()
+#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): CAccessControlFilter->filter()
+#14 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): SpeisTrankController->filterAccessControl()
+#15 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter()
+#16 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#17 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): SpeisTrankController->runActionWithFilters()
+#18 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): SpeisTrankController->run()
+#19 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController()
+#20 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#21 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CWebApplication->run()
+REQUEST_URI=/admin.astaf.de/index.php?r=speisTrank/update&id=9
+in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\_form.php (14)
+in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\speisTrank\update.php (18)
+in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\SpeisTrankController.php (101)
+2012/04/15 17:02:07 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Unable to resolve the request "veranstaltung/index".' in D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php:280
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('veranstaltung/i...')
+#1 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#2 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#3 {main}
+REQUEST_URI=/admin.astaf.de/index.php?r=veranstaltung/index
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=speisTrank/index
+---
diff --git a/protected/views/layouts/main.php b/protected/views/layouts/main.php
index a76418c..6f00be2 100644
--- a/protected/views/layouts/main.php
+++ b/protected/views/layouts/main.php
@@ -35,8 +35,8 @@
 						"visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "standort"),
 				array("label"=>"Kategorien", "url"=>array("/kategorie/index"),
 						"visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "kategorie"),
-				array("label"=>"Speisen", "url"=>array("/speise/index"),
-						"visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "speise"),
+				array("label"=>"Speis & Trank", "url"=>array("/speisTrank/index"),
+						"visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "speisTrank"),
 				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/speisTrank/_form.php b/protected/views/speisTrank/_form.php
new file mode 100644
index 0000000..c67215b
--- /dev/null
+++ b/protected/views/speisTrank/_form.php
@@ -0,0 +1,52 @@
+<div class="form">
+
+<?php $form=$this->beginWidget('CActiveForm', array(
+	'id'=>'angebot-form',
+	'enableAjaxValidation'=>false,
+)); ?>
+
+	<p class="note">Mit <span class="required">*</span> gekennzeichnete Felder sind Pflichtfelder.</p>
+
+	<?php echo $form->errorSummary($model); ?>
+
+	<div class="row">
+		<?php echo $form->labelEx($model,'kategorie_id'); ?>
+		<?php echo $form->dropDownList($model, "kategorie_id", CHtml::listData($kategorien, "id", "name"), array('empty' => '-- Bitte Kategorie wählen --')); ?>
+		<?php echo $form->error($model,'kategorie_id'); ?>
+	</div>
+
+	<div class="row">
+		<?php echo $form->labelEx($model,'name'); ?>
+		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>80)); ?>
+		<?php echo $form->error($model,'name'); ?>
+	</div>
+
+	<div class="row">
+		<?php echo $form->labelEx($model,'beschreibung'); ?>
+		<?php $this->widget('application.extensions.tinymce.ETinyMce',
+                array(
+                    'name'=>'beschreibung',
+                	"value"=>$model->beschreibung,
+                    'useSwitch' => false,
+                    'editorTemplate'=>'simple',
+                	"language"=>"de",
+                	"height"=>"200px",
+                    )
+                );
+		?>
+		<?php echo $form->error($model,'beschreibung'); ?>
+	</div>
+
+	<div class="row">
+		<?php echo $form->labelEx($model,'published'); ?>
+		<?php echo $form->checkbox($model,'published'); ?>
+		<?php echo $form->error($model,'published'); ?>
+	</div>
+
+	<div class="row buttons">
+		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
+	</div>
+
+<?php $this->endWidget(); ?>
+
+</div><!-- form -->
\ No newline at end of file
diff --git a/protected/views/speisTrank/_search.php b/protected/views/speisTrank/_search.php
new file mode 100644
index 0000000..4300232
--- /dev/null
+++ b/protected/views/speisTrank/_search.php
@@ -0,0 +1,39 @@
+<div class="wide form">
+
+<?php $form=$this->beginWidget('CActiveForm', array(
+	'action'=>Yii::app()->createUrl($this->route),
+	'method'=>'get',
+)); ?>
+
+	<div class="row">
+		<?php echo $form->label($model,'id'); ?>
+		<?php echo $form->textField($model,'id'); ?>
+	</div>
+
+	<div class="row">
+		<?php echo $form->label($model,'kategorie_id'); ?>
+		<?php echo $form->textField($model,'kategorie_id'); ?>
+	</div>
+
+	<div class="row">
+		<?php echo $form->label($model,'name'); ?>
+		<?php echo $form->textField($model,'name',array('size'=>60,'maxlength'=>80)); ?>
+	</div>
+
+	<div class="row">
+		<?php echo $form->label($model,'beschreibung'); ?>
+		<?php echo $form->textArea($model,'beschreibung',array('rows'=>6, 'cols'=>50)); ?>
+	</div>
+
+	<div class="row">
+		<?php echo $form->label($model,'published'); ?>
+		<?php echo $form->textField($model,'published'); ?>
+	</div>
+
+	<div class="row buttons">
+		<?php echo CHtml::submitButton('Search'); ?>
+	</div>
+
+<?php $this->endWidget(); ?>
+
+</div><!-- search-form -->
\ No newline at end of file
diff --git a/protected/views/speisTrank/create.php b/protected/views/speisTrank/create.php
new file mode 100644
index 0000000..2bb32c3
--- /dev/null
+++ b/protected/views/speisTrank/create.php
@@ -0,0 +1,14 @@
+<?php
+$this->breadcrumbs=array(
+	'Speis & Trank'=>array('index'),
+	'Kulinarisches Angebot erstellen',
+);
+
+$this->menu=array(
+	array('label'=>'Speis & Trank', 'url'=>array('index')),
+);
+?>
+
+<h1>Kulinarisches Angebot erstellen</h1>
+
+<?php echo $this->renderPartial('_form', array('model'=>$model, 'kategorien'=>$kategorien)); ?>
\ No newline at end of file
diff --git a/protected/views/speisTrank/index.php b/protected/views/speisTrank/index.php
new file mode 100644
index 0000000..a5936d0
--- /dev/null
+++ b/protected/views/speisTrank/index.php
@@ -0,0 +1,57 @@
+<?php
+$this->breadcrumbs=array(
+	'Speis & Trank',
+);
+
+$this->menu=array(
+	array('label'=>'Kulinarisches Angebot 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('angebot-grid', {
+		data: $(this).serialize()
+	});
+	return false;
+});
+");
+?>
+
+<h1>Speis &amp; Trank</h1>
+
+<p>
+Die optionale Eingabe von Vergleichsoperatoren (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
+or <b>=</b>) zu Beginn eines Suchwertes dient der Spezifikation, wie der Vergleich erfolgen soll.
+</p>
+
+<?php echo CHtml::link('Erweiterte Suche','#',array('class'=>'search-button')); ?>
+<div class="search-form" style="display:none">
+<?php $this->renderPartial('_search',array(
+	'model'=>$model,
+)); ?>
+</div><!-- search-form -->
+
+<?php $this->widget('zii.widgets.grid.CGridView', array(
+	'id'=>'angebot-grid',
+	'dataProvider'=>$model->search(),
+	'filter'=>$model,
+	'columns'=>array(
+		array('header'=>'Kategorie', 'value'=>'($data->kategorie) ? $data->kategorie->name : "-"'),
+		'name',
+		'beschreibung:html',
+		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',
+			"buttons"=>array(
+				"delete"=>array("label"=>"Löschen"),
+				"update"=>array("label"=>"Bearbeiten"),
+				"view"=>array("label"=>"Anzeigen")
+				)
+		),
+	),
+)); ?>
diff --git a/protected/views/speisTrank/update.php b/protected/views/speisTrank/update.php
new file mode 100644
index 0000000..e3bc87a
--- /dev/null
+++ b/protected/views/speisTrank/update.php
@@ -0,0 +1,17 @@
+<?php
+$this->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)),
+);
+?>
+
+<h1><?php echo $model->name; ?> bearbeiten</h1>
+
+<?php echo $this->renderPartial('_form', array('model'=>$model, 'kategorien'=>$kategorien)); ?>
\ No newline at end of file
diff --git a/protected/views/speisTrank/view.php b/protected/views/speisTrank/view.php
new file mode 100644
index 0000000..65968ae
--- /dev/null
+++ b/protected/views/speisTrank/view.php
@@ -0,0 +1,24 @@
+<?php
+$this->breadcrumbs=array(
+	'Speis & Trank'=>array('index'),
+	$model->name,
+);
+
+$this->menu=array(
+	array('label'=>'Speis & Trank', 'url'=>array('index')),
+	array('label'=>'Kulinarisches Angebot erstellen', 'url'=>array('create')),
+	array('label'=>$model->name.' bearbeiten', 'url'=>array('update', 'id'=>$model->id)),
+	array('label'=>$model->name.' löschen', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
+);
+?>
+
+<h1><?php echo $model->name; ?></h1>
+
+<?php $this->widget('zii.widgets.CDetailView', array(
+	'data'=>$model,
+	'attributes'=>array(
+		array('label'=>'Kategorie', 'value'=>($model->kategorie) ? $model->kategorie->name : "-"),
+		'beschreibung:html',
+		array('label'=>'Öffentlich', 'value'=>CHtml::image($model->published ? "images/ok.png" : "images/nok.png", $model->published ? "ok.png" : "nok.png"), 'type'=>'raw'),
+	),
+)); ?>
diff --git a/protected/views/verein/_form.php b/protected/views/verein/_form.php
index d91e3eb..9950421 100644
--- a/protected/views/verein/_form.php
+++ b/protected/views/verein/_form.php
@@ -76,7 +76,7 @@
                 	"height"=>"200px",
                     )
                 );
-		?> 
+		?>
 		<?php /*echo $form->textArea($model,'beschreibung',array('rows'=>6, 'cols'=>50)); */?>
 		<?php echo $form->error($model,'beschreibung'); ?>
 	</div>
-- 
cgit v1.0-28-g1787

