summaryrefslogtreecommitdiff
path: root/protected/controllers/MyAngebotController.php
diff options
context:
space:
mode:
authorTristan Zur <tzur@ccwn.org>2012-05-18 12:05:47 +0200
committerTristan Zur <tzur@ccwn.org>2012-05-18 12:05:47 +0200
commitfdca87325b4f7708a1868419f391fc6a84da1661 (patch)
tree7f0bf6cbcc71c8d3dc6ccc04671304bc9f43c770 /protected/controllers/MyAngebotController.php
parent3b42a2c428cf9faac8656c72b338f0115e7b6bdf (diff)
- Speis & Trank (Vereine) Layout korrigiert
- Schreibfehler in Main-Layout korrigiert
Diffstat (limited to 'protected/controllers/MyAngebotController.php')
-rw-r--r--protected/controllers/MyAngebotController.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/protected/controllers/MyAngebotController.php b/protected/controllers/MyAngebotController.php
index a1b6064..02d9929 100644
--- a/protected/controllers/MyAngebotController.php
+++ b/protected/controllers/MyAngebotController.php
@@ -2,6 +2,11 @@
class MyAngebotController extends Controller
{
+ /**
+ * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
+ * using two-column layout. See 'protected/views/layouts/column2.php'.
+ */
+ public $layout='//layouts/column2';
/**
* @return array action filters
@@ -45,13 +50,25 @@ class MyAngebotController extends Controller
if(isset($_POST['AngebotVerein']))
{
$model->attributes=$_POST['AngebotVerein'];
+ $model->verein_id = Yii::app()->user->vereinId;
if($model->save())
$this->redirect(array('index'));
}
+ $angebot = Angebot::model()->findAll();
+ $angebote = array();
+ foreach ($angebot as $a) {
+ $an = array();
+ $an["label"] = $a->name;
+ $an["value"] = $a->id;
+ $an["einheiten"] = $a->kategorie->einheiten;
+ array_push($angebote, $an);
+ }
+
$this->render('create',array(
'model'=>$model,
- 'angebote'=>Angebot::model()->findAll(),
+ 'angebote'=>$angebote,
+ 'einheiten'=>''
));
}
public function actionIndex()