diff options
Diffstat (limited to 'protected/views/standort')
| -rw-r--r-- | protected/views/standort/_buehne.php | 18 | ||||
| -rw-r--r-- | protected/views/standort/_standort.php | 18 | ||||
| -rw-r--r-- | protected/views/standort/index.php | 65 | ||||
| -rw-r--r-- | protected/views/standort/view.php | 27 |
4 files changed, 62 insertions, 66 deletions
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 @@ +<h6>Folgende Veranstaltungen finden <?php echo $data->name?> statt</h6> +<?php +$dataProvider=new CActiveDataProvider('Veranstaltung', array( + 'criteria'=>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 @@ +<h6>Folgende Vereine finden sich <?php echo $data->name?></h6> +<?php +$dataProvider=new CActiveDataProvider('Verein', array( + 'criteria'=>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( ); ?> -<h1>Standorte</h1> - -<?php $this->renderPartial('/common/_comparison_text'); ?> - -<?php $this->renderPartial('/common/_advanced_search',array( - 'model'=>$model, -)); ?> - +<h3>Standorte</h3> +<p class="box info">Mit einem Click auf den Standortmarker erhalten Sie eine Übersicht der Vereine am Standort</p> +<p> <?php $map = new Map(); foreach ($standorte as $standort) { - $infoWindow = new EGMapInfoWindow("<div class='gmaps-label' style='color: #000; font-weight:bold'>".$standort->name."<br/>".CHtml::link("Bearbeiten", array("standort/update", "id"=>$standort->id), array("update"=>"#edit"))."</div>"); - $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 = "<div class='gmaps-label' style='color: #000;'><strong>".$standort->name."</strong><br/>"; + foreach ($standort->vereine as $verein) { + $infostring .=CHtml::link($verein->name,array("verein/view","id"=>$verein->id))."<br />"; } - console.info(event) - } - "; + $infostring .="</div>"; + $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(); ?> -<?php $this->widget('zii.widgets.grid.CGridView', array( +<?php /* +Listenanzeige der Standorte, gerade Schwachsinnig +$this->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}' - ), - ), -)); ?> + ), +));*/ ?> +</p> 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( ); ?> -<h3>Standort "<?php echo $model->name ?>"</h3> +<h3><?php echo ($model->type == "Bühne") ? "Bühne": "Standort" ?> "<?php echo $model->name ?>"</h3> <p> <?php Yii::import('ext.egmap.*'); @@ -48,21 +48,14 @@ $gMap->enableMarkerClusterer(new EGMapMarkerClusterer()); $gMap->renderMap(); ?> </p> -<h6>Folgende Vereine finden sich <?php echo $model->name?></h6> <?php -$dataProvider=new CActiveDataProvider('Verein', array( - 'criteria'=>array( - 'condition'=>'standort_id='.$model->id, - ), - 'pagination'=>array( - 'pageSize'=>20, - ), - +if("Stand" == $model->type) { + $this->renderPartial('_standort',array( + 'data'=>$model, + )); +} elseif ("Bühne" == $model->type) { + $this->renderPartial('_buehne',array( + 'data'=>$model, )); -$this->widget('zii.widgets.CListView', array( - 'dataProvider'=>$dataProvider, - 'itemView'=>'/verein/_short', - 'sortableAttributes'=>array( - 'name' - ) - ));?> +} +?> |
