diff options
Diffstat (limited to 'protected/views/myAngebot/_form.php')
| -rw-r--r-- | protected/views/myAngebot/_form.php | 76 |
1 files changed, 72 insertions, 4 deletions
diff --git a/protected/views/myAngebot/_form.php b/protected/views/myAngebot/_form.php index f48ecc9..0ee91d5 100644 --- a/protected/views/myAngebot/_form.php +++ b/protected/views/myAngebot/_form.php @@ -1,3 +1,5 @@ +<?php Html::registerJavascript("angebotverein.js"); ?> + <div class="form"> <?php $form=$this->beginWidget('CActiveForm', array( @@ -11,17 +13,24 @@ <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'=>(null != $model->angebot) ? $model->angebot->name : '', // additional javascript options for the autocomplete plugin 'options'=>array( 'minLength'=>'2', + 'select'=>'js:function(event, ui) { + return selectAngebot(ui.item); + }', + 'change'=>'js:changeAngebot', ), 'htmlOptions'=>array( - 'style'=>'height:20px;' + 'style'=>'height:20px;', + 'size'=>'60' ), )); ?> + <?php echo $form->hiddenField($model, 'angebot_id'); ?> <?php echo $form->error($model, 'angebot_id'); ?> </div> @@ -32,6 +41,19 @@ </div> <div class="row"> + <?php echo $form->labelEx($model,'einheit'); ?> + <?php + if ($einheiten !== null && '' != $einheiten) { + echo Html::einheitenDropDownList($model, 'einheit', $einheiten); + } else { + ?><select id="AngebotVerein_einheit" style="display:none;"></select><?php + } + ?> + <span id="emptyEinheitenTxt" style="display: <?php echo ($einheiten !== null && '' != $einheiten) ? "none" : "inline"?>">Bitte zuerst das Angebot eingeben.</span> + <?php echo $form->error($model,'einheit'); ?> + </div> + + <div class="row"> <?php echo $form->labelEx($model,'preis'); ?> <?php echo $form->textField($model,'preis',array('size'=>60,'maxlength'=>80)); ?> <?php echo $form->error($model,'preis'); ?> @@ -49,3 +71,49 @@ <?php $this->endWidget(); ?> </div> + +<?php +/* + * The create angebot form + */ +?> + +<?php +$this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog + 'id'=>'angebotDialog', + 'options'=>array( + 'title'=>'Neues Angebot erstellen', + 'autoOpen'=>false, + 'modal'=>true, + 'width'=>550, + 'height'=>505, + ), +));?> +<div class="divForForm"></div> + +<?php $this->endWidget();?> + +<script type="text/javascript"> +function openAngebotDialog() { + <?php echo CHtml::ajax(array( + 'url'=>array('myAngebot/createAngebot'), + 'data'=>'js:$("#angebot_name").serialize()', + 'type'=>'post', + 'dataType'=>'json', + 'success'=>'angebotVereinDialog', + )); ?> + $('#angebotDialog').dialog('open'); // Open Angebot dialog + return false; +} + +function createAngebot() { + <?php echo CHtml::ajax(array( + 'url'=>array('myAngebot/createAngebot'), + 'data'=>'js:$(this).serialize()', + 'type'=>'post', + 'dataType'=>'json', + 'success'=>'angebotVereinDialog', + )); ?> + return false; +} +</script>
\ No newline at end of file |
