From 5759435f4da8ec800ba9af0fbbf7d6691e9ed56c Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Tue, 15 May 2012 21:30:11 +0200 Subject: diverse Layoutings --- .buildpath | 3 +- .settings/org.eclipse.php.core.prefs | 2 +- images/map/marker_green_32.png | Bin 0 -> 4444 bytes images/map/marker_red_32.png | Bin 0 -> 4428 bytes protected/components/Html.php | 38 +++++++++++++ protected/components/Map.php | 50 +++++++++++++++++ protected/config/main.php | 24 +++++--- protected/controllers/SearchController.php | 4 +- protected/controllers/StandortController.php | 5 +- protected/controllers/VeranstaltungController.php | 17 +++++- protected/models/Standort.php | 1 + protected/models/Veranstaltung.php | 24 +++++++- protected/views/search/results.php | 14 ++--- protected/views/sitecontent/_short.php | 9 +++ protected/views/standort/_buehne.php | 18 ++++++ protected/views/standort/_standort.php | 18 ++++++ protected/views/standort/index.php | 65 ++++++---------------- protected/views/standort/view.php | 31 ++++------- protected/views/veranstaltung/_search.php | 54 ++++++++++++++++++ protected/views/veranstaltung/_short.php | 2 + protected/views/veranstaltung/_view.php | 38 +++++++++++++ protected/views/veranstaltung/index.php | 35 ++++++++++++ protected/views/veranstaltung/now.php | 18 ++++++ protected/views/veranstaltung/view.php | 21 +++++++ protected/views/verein/_short.php | 2 +- protected/views/verein/_shortangebotverein.php | 9 +-- protected/views/verein/view.php | 32 +++++++---- 27 files changed, 417 insertions(+), 117 deletions(-) create mode 100644 images/map/marker_green_32.png create mode 100644 images/map/marker_red_32.png create mode 100644 protected/components/Html.php create mode 100644 protected/components/Map.php create mode 100644 protected/views/sitecontent/_short.php create mode 100644 protected/views/standort/_buehne.php create mode 100644 protected/views/standort/_standort.php create mode 100644 protected/views/veranstaltung/_search.php create mode 100644 protected/views/veranstaltung/_short.php create mode 100644 protected/views/veranstaltung/_view.php create mode 100644 protected/views/veranstaltung/index.php create mode 100644 protected/views/veranstaltung/now.php create mode 100644 protected/views/veranstaltung/view.php diff --git a/.buildpath b/.buildpath index 8bcb4b5..43c39c3 100644 --- a/.buildpath +++ b/.buildpath @@ -1,5 +1,6 @@ - + + diff --git a/.settings/org.eclipse.php.core.prefs b/.settings/org.eclipse.php.core.prefs index 9309083..f5f8323 100644 --- a/.settings/org.eclipse.php.core.prefs +++ b/.settings/org.eclipse.php.core.prefs @@ -1,2 +1,2 @@ eclipse.preferences.version=1 -include_path=0;/www.astaf.de +include_path=0;/www.astaf.de\u00052;/yii-framework diff --git a/images/map/marker_green_32.png b/images/map/marker_green_32.png new file mode 100644 index 0000000..3b98b1f Binary files /dev/null and b/images/map/marker_green_32.png differ diff --git a/images/map/marker_red_32.png b/images/map/marker_red_32.png new file mode 100644 index 0000000..6a19e8c Binary files /dev/null and b/images/map/marker_red_32.png differ diff --git a/protected/components/Html.php b/protected/components/Html.php new file mode 100644 index 0000000..6c7df3c --- /dev/null +++ b/protected/components/Html.php @@ -0,0 +1,38 @@ +baseUrl.'/images/'.$url; + } + /** + * Makes the given URL relative to the /css directory + */ + public static function cssUrl($url) { + return Yii::app()->baseUrl.'/css/'.$url; + } + /** + * Makes the given URL relative to the /js directory + */ + public static function jsUrl($url) { + return Yii::app()->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/components/Map.php b/protected/components/Map.php new file mode 100644 index 0000000..614bbc3 --- /dev/null +++ b/protected/components/Map.php @@ -0,0 +1,50 @@ +POS_LAT = Yii::app()->params["pos_lat"]; + $this->POS_LONG = Yii::app()->params["pos_long"]; + $this->gMap = new EGMap(); + $this->gMap->setAPIKey(Yii::app()->params["map_api_domain"], Yii::app()->params["map_api_key"]); + $this->gMap->setWidth("100%"); + $this->gMap->setHeight(550); + $this->gMap->zoom = 18; + $mapTypeControlOptions = array( + 'position' => EGMapControlPosition::RIGHT_TOP, + 'style' => EGMap::MAPTYPECONTROL_STYLE_HORIZONTAL_BAR + ); + + $this->gMap->mapTypeId = EGMap::TYPE_HYBRID; + $this->gMap->mapTypeControlOptions = $mapTypeControlOptions; + $this->gMap->zoom = 18; + $this->gMap->setCenter($this->POS_LAT, $this->POS_LONG); + + // Green icon for published standorte for marker. + $this->publishedIcon = new EGMapMarkerImage(Html::imageUrl("map/marker_green_32.png")); + $this->publishedIcon->setSize(32, 37); + $this->publishedIcon->setAnchor(16, 16.5); + $this->publishedIcon->setOrigin(0, 0); + // Red icon for non-published standorte for marker. + $this->notPublishedIcon = new EGMapMarkerImage(Html::imageUrl("map/marker_red_32.png")); + $this->notPublishedIcon->setSize(32, 37); + $this->notPublishedIcon->setAnchor(16, 16.5); + $this->notPublishedIcon->setOrigin(0, 0); + } + + public function addMarker(EGMapMarker $marker, $published) { + $options = $marker->getOptions(); + $newOptions = array_merge($options, array("icon"=>(($published) ? $this->publishedIcon : $this->notPublishedIcon))); + $marker->setOptions($newOptions); + $this->gMap->addMarker($marker); + } + + public function render() { + $this->gMap->renderMap(array(), Yii::app()->language); + } +} \ No newline at end of file diff --git a/protected/config/main.php b/protected/config/main.php index 87cdf0a..653a119 100644 --- a/protected/config/main.php +++ b/protected/config/main.php @@ -64,9 +64,9 @@ return array( ), ), */ - 'db'=>array( - 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', - ), +// 'db'=>array( +// 'connectionString' => 'sqlite:'.dirname(__FILE__).'/../data/testdrive.db', +// ), // uncomment the following to use a MySQL database 'db'=>array( @@ -87,13 +87,13 @@ return array( 'routes'=>array( array( 'class'=>'CFileLogRoute', - 'levels'=>'error, warning', + 'levels'=>'error, warning, debug,trace', ), // uncomment the following to show log messages on web pages - array( - 'class'=>'CWebLogRoute', - ), +// array( +// 'class'=>'CWebLogRoute', +// ), ), ), @@ -103,6 +103,14 @@ return array( // using Yii::app()->params['paramName'] 'params'=>array( // this is used in contact page - 'adminEmail'=>'webmaster@example.com', + 'adminEmail'=>'webmaster@astaf.de', + 'pos_lat'=>48.8323934983, + 'pos_long'=>9.31750059128, + 'map_api_key'=>'ABQIAAAAzwMJRVnIOel5nqTjdUcPrRTSNOUR83EeIVShY4aBvXxHJx0DexSUFNGH3KQhtFhfSNHxkECqL5rQBA', + '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/SearchController.php b/protected/controllers/SearchController.php index 2cf87df..1dd2414 100644 --- a/protected/controllers/SearchController.php +++ b/protected/controllers/SearchController.php @@ -2,7 +2,7 @@ class SearchController extends Controller { - public static $Searchables = array('Verein' => array('beschreibung'),'Sitecontent'=>array('content')); + public static $Searchables = array('Verein' => array('beschreibung'),'Sitecontent'=>array('content','title')); public function actionIndex() { $this->render('index'); @@ -14,7 +14,7 @@ class SearchController extends Controller foreach (SearchController::$Searchables as $searchable => $columns) { $q = new CDbCriteria(); foreach ($columns as $col) { - $q->addSearchCondition($col,$_POST['search']); + $q->addSearchCondition($col,$_POST['search'],true,'OR'); } $results[$searchable]=CActiveRecord::model($searchable)->findAll($q); } diff --git a/protected/controllers/StandortController.php b/protected/controllers/StandortController.php index 3fa11df..59e0ca5 100644 --- a/protected/controllers/StandortController.php +++ b/protected/controllers/StandortController.php @@ -27,10 +27,11 @@ class StandortController extends Controller { return array( array('allow', // allow admin user to perform 'admin' and 'delete' actions - 'actions'=>array('delete','create','update','index','view','ajaxupdate','ajaxcreate','savecoords'), - 'users'=>array('admin'), + 'actions'=>array('index','view'), + 'users'=>array('*'), ), array('deny', // deny all users + 'actions'=>array('delete','create','update','ajaxupdate','ajaxcreate','savecoords'), 'users'=>array('*'), ), ); diff --git a/protected/controllers/VeranstaltungController.php b/protected/controllers/VeranstaltungController.php index 49ec10a..0e88513 100644 --- a/protected/controllers/VeranstaltungController.php +++ b/protected/controllers/VeranstaltungController.php @@ -27,8 +27,8 @@ class VeranstaltungController extends Controller { return array( array('allow', // allow admin user to perform 'admin' and 'delete' actions - 'actions'=>array('create','update','index','view','delete'), - 'users'=>array('admin'), + 'actions'=>array('index','view','now'), + 'users'=>array('*'), ), array('deny', // deny all users 'users'=>array('*'), @@ -141,6 +141,19 @@ class VeranstaltungController extends Controller )); } + public function actionNow() + { + $model=new Veranstaltung('now'); + $model->unsetAttributes(); // clear any default values + if(isset($_GET['Veranstaltung'])) + $model->attributes=$_GET['Veranstaltung']; + + $this->render('now',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. diff --git a/protected/models/Standort.php b/protected/models/Standort.php index 6052e1a..cfae1f2 100644 --- a/protected/models/Standort.php +++ b/protected/models/Standort.php @@ -63,6 +63,7 @@ class Standort extends CActiveRecord // NOTE: you may need to adjust the relation name and the related // class name for the relations automatically generated below. return array( + "vereine"=>array(self::HAS_MANY, "Verein", array('standort_id'=>'id')), ); } diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php index 0e4d9b8..2b03df1 100644 --- a/protected/models/Veranstaltung.php +++ b/protected/models/Veranstaltung.php @@ -50,8 +50,8 @@ class Veranstaltung extends CActiveRecord array('titel', 'length', 'max'=>100), array('startzeit, endzeit, beschreibung', 'safe'), array('startzeit, endzeit', 'date', 'format'=>'dd.MM.yyyy HH:mm'), - array('startzeit, endzeit', 'DateRangeValidator', 'minDate'=>Yii::app()->params['start_date'].' '.Yii::app()->params['start_time'], 'maxDate'=>Yii::app()->params['end_date'].' '.Yii::app()->params['end_time']), - array('startzeit', 'DateCompareValidator', 'compareAttribute'=>'endzeit', 'operator'=>'<'), + // array('startzeit, endzeit', 'DateRangeValidator', 'minDate'=>Yii::app()->params['start_date'].' '.Yii::app()->params['start_time'], 'maxDate'=>Yii::app()->params['end_date'].' '.Yii::app()->params['end_time']), + // array('startzeit', 'DateCompareValidator', 'compareAttribute'=>'endzeit', 'operator'=>'<'), // The following rule is used by search(). // Please remove those attributes that should not be searched. array('id, verein_id, titel, startzeit, endzeit, beschreibung, standort_id, published', 'safe', 'on'=>'search'), @@ -106,13 +106,31 @@ class Veranstaltung extends CActiveRecord $criteria->compare('endzeit',$this->endzeit,true); $criteria->compare('beschreibung',$this->beschreibung,true); $criteria->compare('standort_id',$this->standort_id); - $criteria->compare('published',$this->published); + $criteria->compare('published',true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); } + public function now() + { + + $criteria=new CDbCriteria; + + $nowMin = new CDbExpression('SUBDATE(NOW(),INTERVAL 1 HOUR)'); + $nowPlus= new CDbExpression('ADDDATE(NOW(),INTERVAL 1 HOUR)'); + $now = new CDbExpression("NOW()"); + //$criteria->compare('startzeit','> '.$nowMin); + //$criteria->compare('startzeit','< '.$nowPlus); + //$criteria->compare("endzeit"," <= ".$now,'AND'); + $criteria->condition = '(startzeit between SUBDATE(NOW(),INTERVAL 1 HOUR) and ADDDATE(NOW(),INTERVAL 1 HOUR) OR startzeit < NOW() and endzeit > NOW() ) and endzeit > NOW() and published = 1 order by startzeit asc'; + Yii::trace(print_r($criteria,true)); + return new CActiveDataProvider($this, array( + 'criteria'=>$criteria, + )); + } + public function beforeSave() { $isValid = parent::beforeSave(); if ($isValid) { diff --git a/protected/views/search/results.php b/protected/views/search/results.php index c1d80e2..05d2b57 100644 --- a/protected/views/search/results.php +++ b/protected/views/search/results.php @@ -3,20 +3,14 @@ $this->breadcrumbs=array( 'Search'=>array('/search'), 'Results', );?> -

id . '/' . $this->action->id; ?>

+

Suchergebnisse für ""

$res) {?> -
+
widget('zii.widgets.CListView', array( 'dataProvider'=>$dataProvider, - 'itemView'=>'/cms/'.lcfirst($mod).'/_short', // refers to the partial view named '_post' - 'sortableAttributes'=>array( - 'name', - /*'create_time'=>'Post Time',*/ - ), + 'itemView'=>'/'.lcfirst($mod).'/_short', // refers to the partial view named '_post' + ));?> -

-

-

diff --git a/protected/views/sitecontent/_short.php b/protected/views/sitecontent/_short.php new file mode 100644 index 0000000..bff61cf --- /dev/null +++ b/protected/views/sitecontent/_short.php @@ -0,0 +1,9 @@ + +content))>300) { + $tmp = str_split(strip_tags($data->content),297); + $myBeschreibung = $tmp[0]."..."; +} else { + $myBeschreibung = strip_tags($data->content); +}?> +".$data->title."

".$myBeschreibung."

" ,array("/cms/sitecontent/view","id"=>$data->id)); ?> \ No newline at end of file diff --git a/protected/views/standort/_buehne.php b/protected/views/standort/_buehne.php new file mode 100644 index 0000000..bfaa34a --- /dev/null +++ b/protected/views/standort/_buehne.php @@ -0,0 +1,18 @@ +
Folgende Veranstaltungen finden name?> statt
+array( + 'condition'=>'standort_id='.$data->id." and published=1", + ), + 'pagination'=>array( + 'pageSize'=>20, + ), + +)); +$this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'/veranstaltung/_short', + 'sortableAttributes'=>array( + 'name' + ) + ));?> \ No newline at end of file diff --git a/protected/views/standort/_standort.php b/protected/views/standort/_standort.php new file mode 100644 index 0000000..9c12fbe --- /dev/null +++ b/protected/views/standort/_standort.php @@ -0,0 +1,18 @@ +
Folgende Vereine finden sich name?>
+array( + 'condition'=>'standort_id='.$data->id, + ), + 'pagination'=>array( + 'pageSize'=>20, + ), + +)); +$this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'/verein/_short', + 'sortableAttributes'=>array( + 'name' + ) + ));?> \ No newline at end of file diff --git a/protected/views/standort/index.php b/protected/views/standort/index.php index 9a88a74..ca84d35 100644 --- a/protected/views/standort/index.php +++ b/protected/views/standort/index.php @@ -8,70 +8,37 @@ $this->menu=array( ); ?> -

Standorte

- -renderPartial('/common/_comparison_text'); ?> - -renderPartial('/common/_advanced_search',array( - 'model'=>$model, -)); ?> - +

Standorte

+

Mit einem Click auf den Standortmarker erhalten Sie eine Übersicht der Vereine am Standort

+

".$standort->name."
".CHtml::link("Bearbeiten", array("standort/update", "id"=>$standort->id), array("update"=>"#edit")).""); - $dragendfunction = "function (event) { - var save = confirm('Neue Koordinaten wirklich speichern?'); - if (save) { - $.ajax({ - 'type':'POST', - 'url':'".$this->createUrl('standort/savecoords', array('id'=>$standort->id))."', - 'data':({'lat': event.latLng.lat(), 'lng': event.latLng.lng()}), - 'cache':false, - 'statusCode': { - 404: function() { - alert('Der Standort existiert nicht.'); - }, - 500: function() { - alert('Fehler beim Speichern.'); - }, - 400: function() { - alert('Fehlende Parameter'); - }, - 200: function() { - alert('Neue Koordinaten erfolgreich gespeichert'); - } - } - }); + $infostring = "

".$standort->name."
"; + foreach ($standort->vereine as $verein) { + $infostring .=CHtml::link($verein->name,array("verein/view","id"=>$verein->id))."
"; } - console.info(event) - } - "; + $infostring .="
"; + $infoWindow = new EGMapInfoWindow($infostring); // Saving coordinates after user dragged our marker. - $dragevent = new EGMapEvent('dragend', $dragendfunction, false, EGMapEvent::TYPE_EVENT_DEFAULT); - $marker = new EGMapMarker($standort->pos_lat, $standort->pos_long, array('title' => $model->name, 'draggable'=>true), 'marker', array('dragevent'=>$dragevent)); + $marker = new EGMapMarker($standort->pos_lat, $standort->pos_long, array('title' => $model->name, 'draggable'=>false), 'marker'); $marker->addHtmlInfoWindow($infoWindow); $map->addMarker($marker, $standort->published); } $map->render(); ?> -widget('zii.widgets.grid.CGridView', array( +widget('zii.widgets.grid.CGridView', array( 'id'=>'standort-grid', 'dataProvider'=>$model->search(), - 'filter'=>$model, + 'columns'=>array( 'type', 'name', - 'pos_lat', - 'pos_long', - 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', - 'template'=>'{update} {delete}' - ), + ), -)); ?> - +));*/ ?> +

diff --git a/protected/views/standort/view.php b/protected/views/standort/view.php index 0674ce9..53d5440 100644 --- a/protected/views/standort/view.php +++ b/protected/views/standort/view.php @@ -12,7 +12,7 @@ $this->menu=array( ); ?> -

Standort "name ?>"

+

type == "Bühne") ? "Bühne": "Standort" ?> "name ?>"

enableMarkerClusterer(new EGMapMarkerClusterer()); $gMap->renderMap(); ?>

-
Folgende Vereine finden sich name?>
-array( - 'condition'=>'standort_id='.$model->id, - ), - 'pagination'=>array( - 'pageSize'=>20, - ), - -)); -$this->widget('zii.widgets.CListView', array( - 'dataProvider'=>$dataProvider, - 'itemView'=>'/verein/_short', - 'sortableAttributes'=>array( - 'name' - ) - ));?> +type) { + $this->renderPartial('_standort',array( + 'data'=>$model, + )); +} elseif ("Bühne" == $model->type) { + $this->renderPartial('_buehne',array( + 'data'=>$model, + )); +} +?> diff --git a/protected/views/veranstaltung/_search.php b/protected/views/veranstaltung/_search.php new file mode 100644 index 0000000..099603c --- /dev/null +++ b/protected/views/veranstaltung/_search.php @@ -0,0 +1,54 @@ +
+ +beginWidget('CActiveForm', array( + 'action'=>Yii::app()->createUrl($this->route), + 'method'=>'get', +)); ?> + +
+ label($model,'id'); ?> + textField($model,'id'); ?> +
+ +
+ label($model,'verein_id'); ?> + dropDownList($model, 'verein_id', CHtml::listData(Verein::model()->findAll(), 'id', 'name'), array("empty"=>"")); ?> +
+ +
+ label($model,'titel'); ?> + textField($model,'titel',array('size'=>60,'maxlength'=>100)); ?> +
+ +
+ label($model,'startzeit'); ?> + textField($model,'startzeit'); ?> +
+ +
+ label($model,'endzeit'); ?> + textField($model,'endzeit'); ?> +
+ +
+ label($model,'beschreibung'); ?> + textArea($model,'beschreibung',array('rows'=>6, 'cols'=>50)); ?> +
+ +
+ label($model,'standort_id'); ?> + dropDownList($model, 'standort_id', CHtml::listData(Standort::model()->findAll(array('condition'=>'type="Bühne"')), 'id', 'name'), array("empty"=>"")); ?> +
+ +
+ label($model,'published'); ?> + checkbox($model,'published'); ?> +
+ +
+ +
+ +endWidget(); ?> + +
\ No newline at end of file diff --git a/protected/views/veranstaltung/_short.php b/protected/views/veranstaltung/_short.php new file mode 100644 index 0000000..56c474b --- /dev/null +++ b/protected/views/veranstaltung/_short.php @@ -0,0 +1,2 @@ +".$data->titel." ".Yii::app()->dateFormatter->format('EEEE hh:mm',$data->startzeit)." Uhr bis ".Yii::app()->dateFormatter->format('EEEE hh:mm',$data->endzeit),array("veranstaltung/view","id"=>$data->id)); ?>
\ No newline at end of file diff --git a/protected/views/veranstaltung/_view.php b/protected/views/veranstaltung/_view.php new file mode 100644 index 0000000..daa818a --- /dev/null +++ b/protected/views/veranstaltung/_view.php @@ -0,0 +1,38 @@ +
+ + getAttributeLabel('id')); ?>: + id), array('view', 'id'=>$data->id)); ?> +
+ + getAttributeLabel('verein_id')); ?>: + verein_id); ?> +
+ + getAttributeLabel('titel')); ?>: + titel); ?> +
+ + getAttributeLabel('startzeit')); ?>: + startzeit); ?> +
+ + getAttributeLabel('endzeit')); ?>: + endzeit); ?> +
+ + getAttributeLabel('beschreibung')); ?>: + beschreibung); ?> +
+ + getAttributeLabel('standort_id')); ?>: + standort_id); ?> +
+ + getAttributeLabel('published')); ?>: + published); ?> +
+ + */ ?> + +
\ No newline at end of file diff --git a/protected/views/veranstaltung/index.php b/protected/views/veranstaltung/index.php new file mode 100644 index 0000000..13f1dcf --- /dev/null +++ b/protected/views/veranstaltung/index.php @@ -0,0 +1,35 @@ +breadcrumbs=array( + 'Veranstaltungen', +); + +$this->menu=array( + array('label'=>'Veranstaltung erstellen', 'url'=>array('create')), +);?> + +

Veranstaltungen

+ + +widget('zii.widgets.grid.CGridView', array( + 'id'=>'veranstaltung-grid', + 'dataProvider'=>$model->search(), + 'filter'=>$model, + 'columns'=>array( + array('header'=>'Verein', + 'name'=>'verein_id', + 'filter'=>CHtml::listData(Verein::model()->findAll(), 'id', 'name'), + 'value'=>'$data->verein->name'), + 'titel', + array('header'=>'Startzeit', 'value'=>'Format::displayDateTime($data->startzeit)'), + array('header'=>'Endzeit', 'value'=>'Format::displayDateTime($data->endzeit)'), + array('header'=>'Standort', + 'name'=>'standort_id', + 'filter'=>CHtml::listData(Standort::model()->findAll(array('condition'=>'type="Bühne"')), 'id', 'name'), + 'value'=>'($data->standort) ? $data->standort->name : "Kein Standort"'), + 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', + ), + ), +)); ?> diff --git a/protected/views/veranstaltung/now.php b/protected/views/veranstaltung/now.php new file mode 100644 index 0000000..ca5e5dc --- /dev/null +++ b/protected/views/veranstaltung/now.php @@ -0,0 +1,18 @@ +breadcrumbs=array( + 'Veranstaltungen'=>array('index'),'Jetzt' +); + +$this->menu=array( + array('label'=>'Veranstaltung erstellen', 'url'=>array('create')), +);?> + +

Veranstaltungen heute um

+ + +widget('zii.widgets.grid.CGridView', array( + 'id'=>'veranstaltung-grid', + 'dataProvider'=>$model->now() + + +)); ?> diff --git a/protected/views/veranstaltung/view.php b/protected/views/veranstaltung/view.php new file mode 100644 index 0000000..55dbff8 --- /dev/null +++ b/protected/views/veranstaltung/view.php @@ -0,0 +1,21 @@ +breadcrumbs=array( + 'Veranstaltungen'=>array('index'), + $model->titel, +); + +$this->menu=array( + array('label'=>'Veranstaltungen', 'url'=>array('index')), + ); +?> + +

titel; ?>

+

von dateFormatter->format('EEEE hh:mm',$model->startzeit)." Uhr"?> bis dateFormatter->format('EEEE hh:mm',$model->endzeit)." Uhr"?> +auf der Bühne standort->name,array("standort/view","id"=>$model->standort_id))?>

+

+beschreibung; +?> +

+

Veranstalter ist der Verein verein->name,array("verein/view","id"=>$model->verein_id))?>

verein->kontaktdaten?>
\ No newline at end of file diff --git a/protected/views/verein/_short.php b/protected/views/verein/_short.php index 0ff6284..c6e42de 100644 --- a/protected/views/verein/_short.php +++ b/protected/views/verein/_short.php @@ -11,4 +11,4 @@ if(strlen(strip_tags($data->beschreibung))>300) { $data->id)); ?>

*/?> -".$data->name."

".$myBeschreibung."

" ,array("verein/view","id"=>$data->id)); ?> \ No newline at end of file +".$data->name." (".$data->standort->name.")

".$myBeschreibung."

" ,array("verein/view","id"=>$data->id)); ?> \ No newline at end of file diff --git a/protected/views/verein/_shortangebotverein.php b/protected/views/verein/_shortangebotverein.php index e49580e..bc845ca 100644 --- a/protected/views/verein/_shortangebotverein.php +++ b/protected/views/verein/_shortangebotverein.php @@ -1,8 +1,3 @@ angebot->beschreibung))>80) { - $tmp = str_split(strip_tags($data->angebot->beschreibung),77); - $myBeschreibung = $tmp[0]."..."; -} else { - $myBeschreibung = strip_tags($data->angebot->beschreibung); -} -echo CHTML::link("".$data->angebot->name." (".$data->menge." ".$data->einheit.") für ".$data->preis."€ ".$myBeschreibung ,array("speisTrank/view","id"=>$data->angebot_id)); ?>
\ No newline at end of file + +echo CHTML::link("".$data->angebot->name." (".$data->menge." ".$data->einheit.") für ".Format::currency($data->preis) ,array("speisTrank/view","id"=>$data->angebot_id)); ?>
\ No newline at end of file diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php index 95e1cf2..188238a 100644 --- a/protected/views/verein/view.php +++ b/protected/views/verein/view.php @@ -20,12 +20,11 @@ $this->menu=array(
kontaktdaten ?>

beschreibung?>

-
widget('zii.widgets.CListView', array( 'dataProvider'=>new CArrayDataProvider($model->angebote, array()), 'itemView'=>'_shortangebot', // refers to the partial view named '_post' ));*/?> - +

Kulinarische Angebote

array( @@ -41,16 +40,25 @@ $this->widget('zii.widgets.CListView', array( 'itemView'=>'_shortangebotverein', 'sortableAttributes'=>array( 'preis','menge', - ), // refers to the partial view named '_post' + ), + ));?> +

Veranstaltungen

+array( + 'condition'=>'verein_id='.$model->id." and published=1", + ), + 'pagination'=>array( + 'pageSize'=>20, + ), +)); +$this->widget('zii.widgets.CListView', array( + 'dataProvider'=>$dataProvider, + 'itemView'=>'/veranstaltung/_short', + 'sortableAttributes'=>array( + 'titel','startzeit','endzeit', + ), + 'htmlOptions' => array('style' => 'width:100%'), ));?> - - -
-- cgit v1.0-28-g1787