diff options
| author | Patrick Seeger <pseeger@ccwn.org> | 2014-06-20 14:56:18 +0200 |
|---|---|---|
| committer | Patrick Seeger <pseeger@ccwn.org> | 2014-06-20 14:56:18 +0200 |
| commit | b53f83a45b9ce727a45b374a01fa9022307a2e9f (patch) | |
| tree | d2e8a7d2a02e5cfe99d3b0b52d8158ceef03b540 | |
| parent | 39a15dfd7ab12e5e74dce97a5d10c254647d5dbd (diff) | |
Anzeige von Bühnen um Hinweis auf Folgetag optimiert.
| -rw-r--r-- | protected/components/Format.php | 10 | ||||
| -rw-r--r-- | protected/views/veranstaltung/stage.php | 15 |
2 files changed, 22 insertions, 3 deletions
diff --git a/protected/components/Format.php b/protected/components/Format.php index 8a80768..91ac90e 100644 --- a/protected/components/Format.php +++ b/protected/components/Format.php @@ -33,4 +33,14 @@ class Format { } return null; } + + public static function displayDateForLists($value) { + if(Yii::app()->dateFormatter->format('HH',$value->startzeit) < 4) + { + return "<strong>".Yii::app()->dateFormatter->format('EEEE',$value->startzeit)."</strong><br />". + Yii::app()->dateFormatter->format('HH:mm',$value->startzeit)." Uhr"; + } else{ + return Yii::app()->dateFormatter->format('HH:mm',$value->startzeit)." Uhr"; + } + } } diff --git a/protected/views/veranstaltung/stage.php b/protected/views/veranstaltung/stage.php index 02e811f..80744ab 100644 --- a/protected/views/veranstaltung/stage.php +++ b/protected/views/veranstaltung/stage.php @@ -12,11 +12,16 @@ $this->menu=array( $buehnen = new CActiveDataProvider('Standort', array( 'criteria'=>array( 'condition'=>"type='Bühne'", + 'with'=>'vereine' ), )); $mymenu = array(); foreach ($buehnen->getData() as $buehne) { + $hasVerein = false; + foreach ($buehne->vereine as $verein) { + if ($verein->published) { $hasVerein=true;} + } $mymenu = array_merge( $mymenu , array(array('label' => 'Bühnenprogramm '.$buehne->name, 'url'=>array('stage','id'=>$buehne->id)))); } $this->menu = array_merge($this->menu, $mymenu); @@ -43,14 +48,16 @@ $sonntag=new CActiveDataProvider('Veranstaltung', array( <h5>Freitag</h5> <?php $veranstaltung = new Veranstaltung(); + $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$veranstaltung->published()->thisYear()->freitag()->parentStage($model->id)->sorted()->search(), 'columns'=>array( array( // display 'create_time' using an expression 'name'=>'Startzeit', - 'value'=>'Yii::app()->dateFormatter->format(\'HH:mm\',$data->startzeit)." Uhr"', + 'value'=>'Format::displayDateForLists($data)', 'htmlOptions' => array('style'=>"width:20%;"), + 'type' => 'html', ), array( 'name'=> 'Titel', @@ -77,8 +84,9 @@ $this->widget('zii.widgets.grid.CGridView', array( 'columns'=>array( array( // display 'create_time' using an expression 'name'=>'Startzeit', - 'value'=>'Yii::app()->dateFormatter->format(\'HH:mm\',$data->startzeit)." Uhr"', + 'value'=>'Format::displayDateForLists($data)', 'htmlOptions' => array('style'=>"width:20%;"), + 'type' => 'html', ), array( 'name'=> 'Titel', @@ -103,8 +111,9 @@ $this->widget('zii.widgets.grid.CGridView', array( 'columns'=>array( array( // display 'create_time' using an expression 'name'=>'Startzeit', - 'value'=>'Yii::app()->dateFormatter->format(\'HH:mm\',$data->startzeit)." Uhr"', + 'value'=>'Format::displayDateForLists($data)', 'htmlOptions' => array('style'=>"width:20%;"), + 'type' => 'html', ), array( 'name'=> 'Titel', |
