summaryrefslogtreecommitdiff
path: root/protected/views
diff options
context:
space:
mode:
authorTristan Zur <tzur@ccwn.org>2012-05-15 21:34:54 +0200
committerTristan Zur <tzur@ccwn.org>2012-05-15 21:34:54 +0200
commit1c57e4d02c914cb83d13ef919179f9cb73b5fbbe (patch)
tree2d987f9905432d5fecd918591c581365276c0f85 /protected/views
parent94bb97f7b574ad8557d568a2ef1288dae3b4e9c8 (diff)
- Initiale Verein-Veranstaltungsverwaltung
- components/Html ergänzt für Anzeige der Einheiten-Dropdown Box - Logo-Upload für Admins - AngebotVerein mit Autocomplete und "Einheiten-Tausch"
Diffstat (limited to 'protected/views')
-rw-r--r--protected/views/layouts/main.php2
-rw-r--r--protected/views/myAngebot/_form.php34
-rw-r--r--protected/views/myAngebot/create.php2
-rw-r--r--protected/views/myAngebot/update.php10
-rw-r--r--protected/views/myVeranstaltung/_form.php60
-rw-r--r--protected/views/myVeranstaltung/_search.php54
-rw-r--r--protected/views/myVeranstaltung/_view.php38
-rw-r--r--protected/views/myVeranstaltung/admin.php59
-rw-r--r--protected/views/myVeranstaltung/create.php15
-rw-r--r--protected/views/myVeranstaltung/index.php17
-rw-r--r--protected/views/myVeranstaltung/update.php18
-rw-r--r--protected/views/myVeranstaltung/view.php30
-rw-r--r--protected/views/speisTrank/create.php2
13 files changed, 332 insertions, 9 deletions
diff --git a/protected/views/layouts/main.php b/protected/views/layouts/main.php
index 1e499bc..a1e72c0 100644
--- a/protected/views/layouts/main.php
+++ b/protected/views/layouts/main.php
@@ -41,6 +41,8 @@
"visible"=>!Yii::app()->user->isGuest && Yii::app()->user->vereinId, "active"=>$this->id == "myAngebot"),
array("label"=>"Veranstaltungen", "url"=>array("/veranstaltung/index"),
"visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "veranstaltung"),
+ array("label"=>"Veranstaltungen", "url"=>array("/myVeranstaltung/index"),
+ "visible"=>!Yii::app()->user->isGuest && Yii::app()->user->vereinId, "active"=>$this->id == "myVeranstaltung"),
array("label"=>"Audit", "url"=>array("/auditTrail/admin"),
"visible"=>!Yii::app()->user->isGuest && Yii::app()->user->isAdmin, "active"=>$this->id == "admin"),
array("label"=>"Benutzer", "url"=>array("/user/admin"),
diff --git a/protected/views/myAngebot/_form.php b/protected/views/myAngebot/_form.php
index f48ecc9..b52a5cc 100644
--- a/protected/views/myAngebot/_form.php
+++ b/protected/views/myAngebot/_form.php
@@ -11,12 +11,34 @@
<div class="row">
<?php echo $form->labelEx($model, 'angebot_id'); ?>
- <?php echo $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
- 'name'=>'city',
- 'source'=>array('ac1', 'ac2', 'ac3'),
+ <?php $this->widget('zii.widgets.jui.CJuiAutoComplete', array(
+ 'name'=>'angebot_name',
+ 'source'=>$angebote,
+ 'value'=>$model->angebot->name,
// additional javascript options for the autocomplete plugin
'options'=>array(
'minLength'=>'2',
+ 'select'=>'js:function(event,ui) {
+ $("#AngebotVerein_angebot_id").val(ui.item.value);
+ $("#angebot_name").val(ui.item.label);
+ var selectObj = $("#AngebotVerein_einheit")[0];
+ var selectParentNode = selectObj.parentNode;
+ var newSelectObj = selectObj.cloneNode(false); // Make a shallow copy
+ selectParentNode.replaceChild(newSelectObj, selectObj);
+ var count = 0;
+ var einheiten = ui.item.einheiten.split(",");
+ for (i in einheiten) {
+ var str = einheiten[i].replace(/^\s+/, "");
+ for (var i = str.length - 1; i >= 0; i--) {
+ if (/\S/.test(str.charAt(i))) {
+ str = str.substring(0, i + 1);
+ break;
+ }
+ }
+ newSelectObj.options[count++] = new Option(str, str);
+ }
+ return false;
+ }'
),
'htmlOptions'=>array(
'style'=>'height:20px;'
@@ -38,6 +60,12 @@
</div>
<div class="row">
+ <?php echo $form->labelEx($model,'einheit'); ?>
+ <?php echo Html::einheitenDropDownList($model, 'einheit', $einheiten)?>
+ <?php echo $form->error($model,'einheit'); ?>
+ </div>
+
+ <div class="row">
<?php echo $form->labelEx($model,'published'); ?>
<?php echo $form->checkbox($model,'published'); ?>
<?php echo $form->error($model,'published'); ?>
diff --git a/protected/views/myAngebot/create.php b/protected/views/myAngebot/create.php
index 1a6bf5a..edddd41 100644
--- a/protected/views/myAngebot/create.php
+++ b/protected/views/myAngebot/create.php
@@ -11,4 +11,4 @@ $this->menu=array(
<h1>Kulinarisches Angebot erstellen</h1>
-<?php echo $this->renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file
+<?php echo $this->renderPartial('_form', array('model'=>$model, 'angebote'=>$angebote)); ?> \ No newline at end of file
diff --git a/protected/views/myAngebot/update.php b/protected/views/myAngebot/update.php
index e3bc87a..bf06672 100644
--- a/protected/views/myAngebot/update.php
+++ b/protected/views/myAngebot/update.php
@@ -1,17 +1,19 @@
<?php
$this->breadcrumbs=array(
'Speis & Trank'=>array('index'),
- $model->name.' bearbeiten',
+ $model->angebot->name.' bearbeiten',
);
$this->menu=array(
array('label'=>'Speis & Trank', 'url'=>array('index')),
array('label'=>'Kulinarisches Angebot erstellen', 'url'=>array('create')),
- array('label'=>$model->name.' anzeigen', 'url'=>array('view', 'id'=>$model->id)),
+ array('label'=>$model->angebot->name.' anzeigen', 'url'=>array('view', 'id'=>$model->id)),
);
?>
-<h1><?php echo $model->name; ?> bearbeiten</h1>
+<h1><?php echo $model->angebot->name; ?> bearbeiten</h1>
-<?php echo $this->renderPartial('_form', array('model'=>$model, 'kategorien'=>$kategorien)); ?> \ No newline at end of file
+<?php echo $this->renderPartial('_form', array('model'=>$model, 'angebote'=>$angebote, 'einheiten'=>$einheiten));
+//, 'kategorien'=>$kategorien
+?> \ No newline at end of file
diff --git a/protected/views/myVeranstaltung/_form.php b/protected/views/myVeranstaltung/_form.php
new file mode 100644
index 0000000..588048d
--- /dev/null
+++ b/protected/views/myVeranstaltung/_form.php
@@ -0,0 +1,60 @@
+<div class="form">
+
+<?php $form=$this->beginWidget('CActiveForm', array(
+ 'id'=>'veranstaltung-form',
+ 'enableAjaxValidation'=>false,
+)); ?>
+
+ <p class="note">Fields with <span class="required">*</span> are required.</p>
+
+ <?php echo $form->errorSummary($model); ?>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'verein_id'); ?>
+ <?php echo $form->textField($model,'verein_id'); ?>
+ <?php echo $form->error($model,'verein_id'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'titel'); ?>
+ <?php echo $form->textField($model,'titel',array('size'=>60,'maxlength'=>100)); ?>
+ <?php echo $form->error($model,'titel'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'startzeit'); ?>
+ <?php echo $form->textField($model,'startzeit'); ?>
+ <?php echo $form->error($model,'startzeit'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'endzeit'); ?>
+ <?php echo $form->textField($model,'endzeit'); ?>
+ <?php echo $form->error($model,'endzeit'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'beschreibung'); ?>
+ <?php echo $form->textArea($model,'beschreibung',array('rows'=>6, 'cols'=>50)); ?>
+ <?php echo $form->error($model,'beschreibung'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'standort_id'); ?>
+ <?php echo $form->textField($model,'standort_id'); ?>
+ <?php echo $form->error($model,'standort_id'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->labelEx($model,'published'); ?>
+ <?php echo $form->textField($model,'published'); ?>
+ <?php echo $form->error($model,'published'); ?>
+ </div>
+
+ <div class="row buttons">
+ <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
+ </div>
+
+<?php $this->endWidget(); ?>
+
+</div><!-- form --> \ No newline at end of file
diff --git a/protected/views/myVeranstaltung/_search.php b/protected/views/myVeranstaltung/_search.php
new file mode 100644
index 0000000..b4ec2ed
--- /dev/null
+++ b/protected/views/myVeranstaltung/_search.php
@@ -0,0 +1,54 @@
+<div class="wide form">
+
+<?php $form=$this->beginWidget('CActiveForm', array(
+ 'action'=>Yii::app()->createUrl($this->route),
+ 'method'=>'get',
+)); ?>
+
+ <div class="row">
+ <?php echo $form->label($model,'id'); ?>
+ <?php echo $form->textField($model,'id'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'verein_id'); ?>
+ <?php echo $form->textField($model,'verein_id'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'titel'); ?>
+ <?php echo $form->textField($model,'titel',array('size'=>60,'maxlength'=>100)); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'startzeit'); ?>
+ <?php echo $form->textField($model,'startzeit'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'endzeit'); ?>
+ <?php echo $form->textField($model,'endzeit'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'beschreibung'); ?>
+ <?php echo $form->textArea($model,'beschreibung',array('rows'=>6, 'cols'=>50)); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'standort_id'); ?>
+ <?php echo $form->textField($model,'standort_id'); ?>
+ </div>
+
+ <div class="row">
+ <?php echo $form->label($model,'published'); ?>
+ <?php echo $form->textField($model,'published'); ?>
+ </div>
+
+ <div class="row buttons">
+ <?php echo CHtml::submitButton('Search'); ?>
+ </div>
+
+<?php $this->endWidget(); ?>
+
+</div><!-- search-form --> \ No newline at end of file
diff --git a/protected/views/myVeranstaltung/_view.php b/protected/views/myVeranstaltung/_view.php
new file mode 100644
index 0000000..daa818a
--- /dev/null
+++ b/protected/views/myVeranstaltung/_view.php
@@ -0,0 +1,38 @@
+<div class="view">
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('id')); ?>:</b>
+ <?php echo CHtml::link(CHtml::encode($data->id), array('view', 'id'=>$data->id)); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('verein_id')); ?>:</b>
+ <?php echo CHtml::encode($data->verein_id); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('titel')); ?>:</b>
+ <?php echo CHtml::encode($data->titel); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('startzeit')); ?>:</b>
+ <?php echo CHtml::encode($data->startzeit); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('endzeit')); ?>:</b>
+ <?php echo CHtml::encode($data->endzeit); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('beschreibung')); ?>:</b>
+ <?php echo CHtml::encode($data->beschreibung); ?>
+ <br />
+
+ <b><?php echo CHtml::encode($data->getAttributeLabel('standort_id')); ?>:</b>
+ <?php echo CHtml::encode($data->standort_id); ?>
+ <br />
+
+ <?php /*
+ <b><?php echo CHtml::encode($data->getAttributeLabel('published')); ?>:</b>
+ <?php echo CHtml::encode($data->published); ?>
+ <br />
+
+ */ ?>
+
+</div> \ No newline at end of file
diff --git a/protected/views/myVeranstaltung/admin.php b/protected/views/myVeranstaltung/admin.php
new file mode 100644
index 0000000..6e2a1a3
--- /dev/null
+++ b/protected/views/myVeranstaltung/admin.php
@@ -0,0 +1,59 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungs'=>array('index'),
+ 'Manage',
+);
+
+$this->menu=array(
+ array('label'=>'List Veranstaltung', 'url'=>array('index')),
+ array('label'=>'Create Veranstaltung', 'url'=>array('create')),
+);
+
+Yii::app()->clientScript->registerScript('search', "
+$('.search-button').click(function(){
+ $('.search-form').toggle();
+ return false;
+});
+$('.search-form form').submit(function(){
+ $.fn.yiiGridView.update('veranstaltung-grid', {
+ data: $(this).serialize()
+ });
+ return false;
+});
+");
+?>
+
+<h1>Manage Veranstaltungs</h1>
+
+<p>
+You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
+or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
+</p>
+
+<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
+<div class="search-form" style="display:none">
+<?php $this->renderPartial('_search',array(
+ 'model'=>$model,
+)); ?>
+</div><!-- search-form -->
+
+<?php $this->widget('zii.widgets.grid.CGridView', array(
+ 'id'=>'veranstaltung-grid',
+ 'dataProvider'=>$model->search(),
+ 'filter'=>$model,
+ 'columns'=>array(
+ 'id',
+ 'verein_id',
+ 'titel',
+ 'startzeit',
+ 'endzeit',
+ 'beschreibung',
+ /*
+ 'standort_id',
+ 'published',
+ */
+ array(
+ 'class'=>'CButtonColumn',
+ ),
+ ),
+)); ?>
diff --git a/protected/views/myVeranstaltung/create.php b/protected/views/myVeranstaltung/create.php
new file mode 100644
index 0000000..3c7af00
--- /dev/null
+++ b/protected/views/myVeranstaltung/create.php
@@ -0,0 +1,15 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungs'=>array('index'),
+ 'Create',
+);
+
+$this->menu=array(
+ array('label'=>'List Veranstaltung', 'url'=>array('index')),
+ array('label'=>'Manage Veranstaltung', 'url'=>array('admin')),
+);
+?>
+
+<h1>Create Veranstaltung</h1>
+
+<?php echo $this->renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file
diff --git a/protected/views/myVeranstaltung/index.php b/protected/views/myVeranstaltung/index.php
new file mode 100644
index 0000000..6ff8a23
--- /dev/null
+++ b/protected/views/myVeranstaltung/index.php
@@ -0,0 +1,17 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungs',
+);
+
+$this->menu=array(
+ array('label'=>'Create Veranstaltung', 'url'=>array('create')),
+ array('label'=>'Manage Veranstaltung', 'url'=>array('admin')),
+);
+?>
+
+<h1>Veranstaltungs</h1>
+
+<?php $this->widget('zii.widgets.CListView', array(
+ 'dataProvider'=>$dataProvider,
+ 'itemView'=>'_view',
+)); ?>
diff --git a/protected/views/myVeranstaltung/update.php b/protected/views/myVeranstaltung/update.php
new file mode 100644
index 0000000..cfeb467
--- /dev/null
+++ b/protected/views/myVeranstaltung/update.php
@@ -0,0 +1,18 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungs'=>array('index'),
+ $model->id=>array('view','id'=>$model->id),
+ 'Update',
+);
+
+$this->menu=array(
+ array('label'=>'List Veranstaltung', 'url'=>array('index')),
+ array('label'=>'Create Veranstaltung', 'url'=>array('create')),
+ array('label'=>'View Veranstaltung', 'url'=>array('view', 'id'=>$model->id)),
+ array('label'=>'Manage Veranstaltung', 'url'=>array('admin')),
+);
+?>
+
+<h1>Update Veranstaltung <?php echo $model->id; ?></h1>
+
+<?php echo $this->renderPartial('_form', array('model'=>$model)); ?> \ No newline at end of file
diff --git a/protected/views/myVeranstaltung/view.php b/protected/views/myVeranstaltung/view.php
new file mode 100644
index 0000000..12ac308
--- /dev/null
+++ b/protected/views/myVeranstaltung/view.php
@@ -0,0 +1,30 @@
+<?php
+$this->breadcrumbs=array(
+ 'Veranstaltungs'=>array('index'),
+ $model->id,
+);
+
+$this->menu=array(
+ array('label'=>'List Veranstaltung', 'url'=>array('index')),
+ array('label'=>'Create Veranstaltung', 'url'=>array('create')),
+ array('label'=>'Update Veranstaltung', 'url'=>array('update', 'id'=>$model->id)),
+ array('label'=>'Delete Veranstaltung', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
+ array('label'=>'Manage Veranstaltung', 'url'=>array('admin')),
+);
+?>
+
+<h1>View Veranstaltung #<?php echo $model->id; ?></h1>
+
+<?php $this->widget('zii.widgets.CDetailView', array(
+ 'data'=>$model,
+ 'attributes'=>array(
+ 'id',
+ 'verein_id',
+ 'titel',
+ 'startzeit',
+ 'endzeit',
+ 'beschreibung',
+ 'standort_id',
+ 'published',
+ ),
+)); ?>
diff --git a/protected/views/speisTrank/create.php b/protected/views/speisTrank/create.php
index 2bb32c3..bf77319 100644
--- a/protected/views/speisTrank/create.php
+++ b/protected/views/speisTrank/create.php
@@ -11,4 +11,4 @@ $this->menu=array(
<h1>Kulinarisches Angebot erstellen</h1>
-<?php echo $this->renderPartial('_form', array('model'=>$model, 'kategorien'=>$kategorien)); ?> \ No newline at end of file
+<?php echo $this->renderPartial('_form', array('model'=>$model, 'kategorien'=>$kategorien, 'einheiten'=>$einheiten)); ?> \ No newline at end of file