summaryrefslogtreecommitdiff
path: root/protected
diff options
context:
space:
mode:
authorPatrick Seeger <pseeger@ccwn.org>2012-05-06 22:45:08 +0200
committerPatrick Seeger <pseeger@ccwn.org>2012-05-06 22:45:08 +0200
commit5b39d6bf7f34ed52059410f3d0af3799aeff2113 (patch)
tree0a0b1abdb0b69f8298410bf439f5d4296276bd69 /protected
parent3d72ad7ce1aac1151f5499ef19fc04999ba685d1 (diff)
vereinsansicht basis
Diffstat (limited to '')
-rw-r--r--protected/controllers/VereinController.php2
-rw-r--r--protected/models/Angebot.php2
-rw-r--r--protected/models/AngebotVerein.php2
-rw-r--r--protected/models/Kategorie.php2
-rw-r--r--protected/models/Standort.php2
-rw-r--r--protected/models/Veranstaltung.php2
-rw-r--r--protected/models/Verein.php4
-rw-r--r--protected/modules/cms/controllers/SitecontentController.php3
-rw-r--r--protected/views/verein/_shortangebot.php10
-rw-r--r--protected/views/verein/index.php1
-rw-r--r--protected/views/verein/view.php37
11 files changed, 45 insertions, 22 deletions
diff --git a/protected/controllers/VereinController.php b/protected/controllers/VereinController.php
index 2be85d6..e0a3e68 100644
--- a/protected/controllers/VereinController.php
+++ b/protected/controllers/VereinController.php
@@ -143,7 +143,7 @@ class VereinController extends Controller
*/
public function loadModel($id)
{
- $model=Verein::model()->findByPk($id);
+ $model=Verein::model()->with('angebote','veranstaltungen')->findByPk($id);
if($model===null)
throw new CHttpException(404,'The requested page does not exist.');
return $model;
diff --git a/protected/models/Angebot.php b/protected/models/Angebot.php
index d6ae02a..61e4d54 100644
--- a/protected/models/Angebot.php
+++ b/protected/models/Angebot.php
@@ -100,7 +100,7 @@ class Angebot extends CActiveRecord
public function behaviors() {
return array(
- 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
+ // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
);
}
} \ No newline at end of file
diff --git a/protected/models/AngebotVerein.php b/protected/models/AngebotVerein.php
index 26c6dab..1031100 100644
--- a/protected/models/AngebotVerein.php
+++ b/protected/models/AngebotVerein.php
@@ -102,7 +102,7 @@ class AngebotVerein extends CActiveRecord
public function behaviors() {
return array(
- 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
+ //'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
);
}
} \ No newline at end of file
diff --git a/protected/models/Kategorie.php b/protected/models/Kategorie.php
index 93c799d..294947f 100644
--- a/protected/models/Kategorie.php
+++ b/protected/models/Kategorie.php
@@ -101,7 +101,7 @@ class Kategorie extends CActiveRecord
public function behaviors() {
return array(
- 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
+ // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
);
}
} \ No newline at end of file
diff --git a/protected/models/Standort.php b/protected/models/Standort.php
index d62a594..6052e1a 100644
--- a/protected/models/Standort.php
+++ b/protected/models/Standort.php
@@ -106,7 +106,7 @@ class Standort extends CActiveRecord
public function behaviors() {
return array(
- 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
+ //'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
);
}
} \ No newline at end of file
diff --git a/protected/models/Veranstaltung.php b/protected/models/Veranstaltung.php
index 64c7854..0e4d9b8 100644
--- a/protected/models/Veranstaltung.php
+++ b/protected/models/Veranstaltung.php
@@ -124,7 +124,7 @@ class Veranstaltung extends CActiveRecord
public function behaviors() {
return array(
- 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
+ // 'LoggableBehavior'=>'application.modules.auditTrail.behaviors.LoggableBehavior',
);
}
} \ No newline at end of file
diff --git a/protected/models/Verein.php b/protected/models/Verein.php
index f0d30dd..6d84c91 100644
--- a/protected/models/Verein.php
+++ b/protected/models/Verein.php
@@ -66,7 +66,9 @@ class Verein extends CActiveRecord
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
return array(
- "standort"=>array(self::HAS_ONE, "Standort", array('id'=>'standort_id'))
+ "standort"=>array(self::HAS_ONE, "Standort", array('id'=>'standort_id')),
+ "angebote"=>array(self::MANY_MANY, "Angebot", "angebot_verein(verein_id,angebot_id)"),
+ "veranstaltungen"=>array(self::HAS_MANY, "Veranstaltung","verein_id"),
);
}
diff --git a/protected/modules/cms/controllers/SitecontentController.php b/protected/modules/cms/controllers/SitecontentController.php
index bb18771..a2a3906 100644
--- a/protected/modules/cms/controllers/SitecontentController.php
+++ b/protected/modules/cms/controllers/SitecontentController.php
@@ -39,8 +39,9 @@ class SitecontentController extends Controller
$model = $this->loadContent();
$this->breadcrumbs = array($model->title);
+ if($model->id > 1) {
$this->menu = CMS::getMenuPoints($model->id);
-
+ }
$this->render('view', array(
'sitecontent' => $model,
));
diff --git a/protected/views/verein/_shortangebot.php b/protected/views/verein/_shortangebot.php
new file mode 100644
index 0000000..e90da5b
--- /dev/null
+++ b/protected/views/verein/_shortangebot.php
@@ -0,0 +1,10 @@
+<?php
+if(strlen(strip_tags($data->beschreibung))>80) {
+ $tmp = str_split(strip_tags($data->beschreibung),77);
+ $myBeschreibung = $tmp[0]."...";
+} else {
+ $myBeschreibung = strip_tags($data->beschreibung);
+}?>
+
+
+<?php echo CHTML::link("<h6>".$data->name."</h6><p>".$myBeschreibung."</p>" ,array("angebot/view","id"=>$data->id)); ?> \ No newline at end of file
diff --git a/protected/views/verein/index.php b/protected/views/verein/index.php
index cfdd6e0..84431e3 100644
--- a/protected/views/verein/index.php
+++ b/protected/views/verein/index.php
@@ -4,6 +4,7 @@ $this->breadcrumbs=array(
);
$this->menu=array(
+ array('label' => 'Verein suchen', 'url' => array('search')),
array('label'=>'Verein erstellen', 'url'=>array('create'),'visible'=>!Yii::app()->user->isGuest),
);
?>
diff --git a/protected/views/verein/view.php b/protected/views/verein/view.php
index 6efb9e7..7c5bb32 100644
--- a/protected/views/verein/view.php
+++ b/protected/views/verein/view.php
@@ -12,19 +12,28 @@ $this->menu=array(
);
?>
-<h1><?php echo $model->name; ?></h1>
-
-<?php $this->widget('zii.widgets.CDetailView', array(
- 'data'=>$model,
- 'attributes'=>array(
- 'slug',
- /*'name',*/
- array('label'=>'Bild', 'value'=>CHtml::image($model->bild), 'type'=>'raw'),
- array('label'=>'Homepage', 'value'=>CHtml::link($model->url, $model->url, array("target"=>"_blank")), 'type'=>'raw'),
- 'email',
- 'kontaktdaten:html',
- 'beschreibung:html',
- array('label'=>'Standort', 'value'=>($model->standort) ? $model->standort->name : "-"),
- array('label'=>'Öffentlich', 'value'=>CHtml::image($model->published ? "images/ok.png" : "images/nok.png", $model->published ? "ok.png" : "nok.png"), 'type'=>'raw'),
+<h3><?php echo $model->name; ?></h3>
+<?php if ($model->bild) {
+ echo CHtml::image($model->bild,'Vereinslogo '.$model->name, array("class" => "float-left bordered"));
+}?>
+<p><?php echo $model->beschreibung?></p>
+<div class="float-left box">
+<?php $this->widget('zii.widgets.CListView', array(
+ 'dataProvider'=>new CArrayDataProvider($model->angebote, array()),
+ 'itemView'=>'_shortangebot', // refers to the partial view named '_post'
+ 'sortableAttributes'=>array(
+ 'name',
+ /*'create_time'=>'Post Time',*/
),
));?>
+
+<ul><?php
+foreach ($model->veranstaltungen as $value) {
+ echo "<li>".CHTML::link($value->titel,array("veranstaltung/view","id"=>$value->id))."</li>";
+}
+
+?>
+</ul>
+</div>
+<div class="box info float-right"><h6>Kontaktdaten</h6><?php echo $model->kontaktdaten?></div>
+