From 1605cc08545606471973f6be130afca015bb35fe Mon Sep 17 00:00:00 2001 From: Patrick Seeger Date: Thu, 8 May 2014 14:36:06 +0200 Subject: Ausblenden von alten Veranstaltungen und alte Dinge --- protected/components/Controller.php | 2 ++ protected/controllers/SearchController.php | 2 +- protected/controllers/VeranstaltungController.php | 1 + protected/models/Angebot.php | 8 ++++++++ protected/models/Veranstaltung.php | 6 +++++- protected/views/angebot/_short.php | 11 +++++++++++ protected/views/veranstaltung/index.php | 2 +- protected/views/verein/view.php | 3 +++ themes/astaf/views/layouts/main.php | 2 +- 9 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 protected/views/angebot/_short.php diff --git a/protected/components/Controller.php b/protected/components/Controller.php index 4d27862..c364e50 100644 --- a/protected/components/Controller.php +++ b/protected/components/Controller.php @@ -20,4 +20,6 @@ class Controller extends CController * for more details on how to specify this property. */ public $breadcrumbs=array(); + + public $astafAdditionalStyle =""; } \ No newline at end of file diff --git a/protected/controllers/SearchController.php b/protected/controllers/SearchController.php index acf0aec..275fc6a 100644 --- a/protected/controllers/SearchController.php +++ b/protected/controllers/SearchController.php @@ -2,7 +2,7 @@ class SearchController extends Controller { - public static $Searchables = array('Veranstaltung'=>array('titel','beschreibung'),'Verein' => array('beschreibung','name'),'Sitecontent'=>array('content','title')); + public static $Searchables = array('Veranstaltung'=>array('titel','beschreibung'),'Angebot'=> array('name','beschreibung'),'Verein' => array('beschreibung','name'),'Sitecontent'=>array('content','title')); public function actionIndex() { $this->render('index'); diff --git a/protected/controllers/VeranstaltungController.php b/protected/controllers/VeranstaltungController.php index 619f7fe..1f55d0b 100644 --- a/protected/controllers/VeranstaltungController.php +++ b/protected/controllers/VeranstaltungController.php @@ -63,6 +63,7 @@ class VeranstaltungController extends Controller 'model'=>$model, )); } + public function actionNow() { diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php index 61e4d54..c3abe92 100644 --- a/protected/models/Angebot.php +++ b/protected/models/Angebot.php @@ -103,4 +103,12 @@ class Angebot extends CActiveRecord // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior', ); } + public function scopes() + { + return array( + 'published'=>array( + 'condition'=>'1=1', + ), + ); + } } \ No newline at end of file diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php index 60536cf..843d430 100644 --- a/protected/models/Veranstaltung.php +++ b/protected/models/Veranstaltung.php @@ -115,6 +115,7 @@ class Veranstaltung extends CActiveRecord )); } + public function now() { @@ -155,7 +156,10 @@ class Veranstaltung extends CActiveRecord ), 'sorted'=>array( 'order'=>'startzeit ASC', - + ), + 'thisYear'=>array( + 'condition'=>"startzeit > STR_TO_DATE('".Yii::app()->params['start_date']."',GET_FORMAT(DATE,'EUR'))", + ), ); } diff --git a/protected/views/angebot/_short.php b/protected/views/angebot/_short.php new file mode 100644 index 0000000..ccbb0ff --- /dev/null +++ b/protected/views/angebot/_short.php @@ -0,0 +1,11 @@ +beschreibung))>50) { + $tmp = str_split(strip_tags($data->beschreibung),47); + $myBeschreibung = $tmp[0]."..."; +} else { + $myBeschreibung = strip_tags($data->beschreibung); +} +if(strlen($myBeschreibung)> 0) { + $myBeschreibung=" (Beschreibung:".$myBeschreibung.")"; +} +echo CHTML::link("".$data->name."".$myBeschreibung,array("speisTrank/view","id"=>$data->id)); ?>

\ No newline at end of file diff --git a/protected/views/veranstaltung/index.php b/protected/views/veranstaltung/index.php index c7e1145..4415f85 100644 --- a/protected/views/veranstaltung/index.php +++ b/protected/views/veranstaltung/index.php @@ -13,7 +13,7 @@ $this->menu=array( widget('zii.widgets.CListView', array( - 'dataProvider'=>$model->published()->sorted()->search(), + 'dataProvider'=>$model->published()->thisYear()->sorted()->search(), 'itemView'=>'_short_all', // refers to the partial view named '_post' 'sortableAttributes'=>array( 'startzeit', 'titel' diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php index 937a99b..76ddd88 100644 --- a/protected/views/verein/view.php +++ b/protected/views/verein/view.php @@ -9,6 +9,9 @@ $this->pageTitle = $model->name . ' - ' . Yii::app()->name; array('label'=>'Vereine verwalten', 'url'=>array('index')), );*/ +if ($model->hintergrund && ""!=$model->hintergrund) { + $this->astafAdditionalStyle="background-repeat:no-repeat;background-image: url('".$model->hintergrund."');"; +} ?>

name; ?>

diff --git a/themes/astaf/views/layouts/main.php b/themes/astaf/views/layouts/main.php index 4a517b6..092ff25 100644 --- a/themes/astaf/views/layouts/main.php +++ b/themes/astaf/views/layouts/main.php @@ -128,7 +128,7 @@ */?>
-
+