From 0567da9fd246e495345df1bdf8fc947d5fbe695d Mon Sep 17 00:00:00 2001
From: Tristan Zur <tzur@ccwn.org>
Date: Fri, 18 May 2012 19:03:16 +0200
Subject: =?UTF-8?q?-=20Speis=20&=20Trank=20(Vereine):=20Bedienung=20verein?=
 =?UTF-8?q?facht,=20Implementierung=20zur=20Erstellung=20neuer=20Angebote?=
 =?UTF-8?q?=20ges=C3=A4ubert=20-=20SiteController:=20Schreibfehler=20in=20?=
 =?UTF-8?q?URL=20korrigiert=20-=20Html=20component:=20Wrapper=20zum=20regi?=
 =?UTF-8?q?strieren=20von=20JS-Dateien=20hinzugef=C3=BCgt=20-=20main=20lay?=
 =?UTF-8?q?out:=20Javascript-String=20Funktionen=20JS-Datei=20registriert?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 js/angebotverein.js                           | 92 ++++++++++++++++++++++++++
 protected/components/Html.php                 |  8 ++-
 protected/controllers/MyAngebotController.php |  6 +-
 protected/controllers/SiteController.php      |  2 +-
 protected/runtime/application.log             | 74 +++++++++++++++++++++
 protected/views/layouts/main.php              |  2 +
 protected/views/myAngebot/_angebot_form.php   | 12 +---
 protected/views/myAngebot/_form.php           | 95 +++++----------------------
 8 files changed, 200 insertions(+), 91 deletions(-)
 create mode 100644 js/angebotverein.js

diff --git a/js/angebotverein.js b/js/angebotverein.js
new file mode 100644
index 0000000..f10bd09
--- /dev/null
+++ b/js/angebotverein.js
@@ -0,0 +1,92 @@
+function angebotVereinDialog(data) {
+    if (data.status == 'failure') {
+        $('#angebotDialog div.divForForm').html(data.div);
+        // Submit the form via function createAngebot
+        $('#angebotDialog div.divForForm form').submit(createAngebot);
+    } else {
+        $('#angebotDialog div.divForForm').html(data.div);
+        setTimeout("$('#angebotDialog').dialog('close')", 3000);
+        selectAngebot(data);
+    }
+}
+
+function selectAngebot(angebot) {
+	$("#AngebotVerein_angebot_id").val(angebot.value);
+	$("#angebot_name").val(angebot.label);
+	var newSelectObj = clearSelectBox("#AngebotVerein_einheit");
+    $("#emptyEinheitenTxt")[0].style.display = "none";
+	
+	var count = 0;
+	var einheiten = angebot.einheiten.split(",");
+	for (i in einheiten) {
+		var einheit = einheiten[i].trim();
+		newSelectObj.options[count++] = new Option(einheit, einheit);
+	}
+	newSelectObj.style.display = "inline";
+	return false;
+}
+
+function changeAngebot(event) {
+	var autocomplete = $(this).data("autocomplete");
+    if (autocomplete.selectedItem) {
+        return;
+    }
+    var userEnteredValue = $(this).val();
+    if (null != userEnteredValue && !userEnteredValue.isEmpty()) { // User has entered at list one non-whitespace character
+        var escapedValue = $.ui.autocomplete.escapeRegex(userEnteredValue);
+        // Matcher to check if the user entered value is in element list
+        var fullMatcher = new RegExp("^" + escapedValue + "$", "i");
+        // Matcher to check if an element exists that starts with the user entered value
+        var partMatcher = new RegExp("^" + escapedValue, "i");
+        var items = autocomplete.widget().children(".ui-menu-item");
+        if (1 == items.length) {
+        	items.each(function() {
+                // The current item in iteration
+                var item = $(this).data("item.autocomplete");
+                if (null != item.label && !item.label.isEmpty()) { // Check only if current item has a label
+                    if (fullMatcher.test(item.label)) { // The label is identical with the user value
+                        autocomplete.selectedItem = item; // Set the selected item to the current item
+                        return false; // Return -> item already found
+                    } else if (partMatcher.test(item.label)) { // The label starts with the user value
+                        var conf = confirm("Meinten Sie \""+item.label+"\"?"); // Ask the user if the item is the one to choose
+                        if (conf) { // The item is the one to choose
+                            autocomplete.selectedItem = item; // Set the selected item to the current item
+                            return false; // Return -> item already found
+                        }
+                    }
+                }
+            });
+        }
+
+        if (autocomplete.selectedItem) {
+            autocomplete._trigger("select", event, { item: autocomplete.selectedItem });
+        } else {
+            resetEinheiten();
+            // Ask the user to create the non-existing Angebot
+        	var conf = confirm("Das eingegebene Angebot existiert noch nicht. Wollen Sie dieses Angebot neu erstellen?");
+            if (conf) { // The Angebot should be created
+            	openAngebotDialog(); // initialize and open Angebot dialog
+            }
+        }
+    } else { // User has not entered anything or only entered whitespace characters
+        $("#AngebotVerein_angebot_id").val("");
+        resetEinheiten();
+    }
+}
+
+function resetEinheiten() {
+	clearSelectBox("#AngebotVerein_einheit");
+    $("#emptyEinheitenTxt")[0].style.display = "inline";
+}
+
+function clearSelectBox(id) {
+	var selectObj = $(id)[0];
+	if (null != selectObj) {
+		selectObj.style.display = "none";
+		var selectParentNode = selectObj.parentNode;
+		var newSelectObj = selectObj.cloneNode(false); // Make a shallow copy
+		selectParentNode.replaceChild(newSelectObj, selectObj);
+		return newSelectObj;
+	}
+	return null;
+}
\ No newline at end of file
diff --git a/protected/components/Html.php b/protected/components/Html.php
index 38128d5..5d1e3e5 100644
--- a/protected/components/Html.php
+++ b/protected/components/Html.php
@@ -15,8 +15,12 @@ class Html extends CHtml {
 	/**
 	 * Makes the given URL relative to the /js directory
 	 */
-	public static function jsUrl($url) {
-		return Yii::app()->baseUrl.'/js/'.$url;
+	public static function jsUrl($filename) {
+		return Yii::app()->baseUrl.'/js/'.$filename;
+	}
+	
+	public static function registerJavascript($filename) {
+	    Yii::app()->getClientScript()->registerScriptFile(self::jsUrl($filename));
 	}
 
 	public static function enumItem($model, $attribute) {
diff --git a/protected/controllers/MyAngebotController.php b/protected/controllers/MyAngebotController.php
index 0072e61..b85846e 100644
--- a/protected/controllers/MyAngebotController.php
+++ b/protected/controllers/MyAngebotController.php
@@ -105,7 +105,9 @@ class MyAngebotController extends Controller
 	    $model->published = true;
 	    
 	    if (Yii::app()->request->isAjaxRequest) {
-	        if(isset($_POST['Angebot'])) {
+	        if (isset($_POST['angebot_name'])) {
+	            $model->name = $_POST['angebot_name'];
+	        } else if (isset($_POST['Angebot'])) {
 	            $model->attributes = $_POST['Angebot'];
 	            if ($model->save()) {
 	                echo CJSON::encode(array(
@@ -117,6 +119,8 @@ class MyAngebotController extends Controller
     	            ));
     	            exit;
 	            }
+	        } else {
+                throw new CHttpException(400);
 	        }
 	        
 	        $kategorien = Kategorie::model()->findAll(array("condition"=>"published=1"));
diff --git a/protected/controllers/SiteController.php b/protected/controllers/SiteController.php
index 2ee57b9..cfb6c3c 100644
--- a/protected/controllers/SiteController.php
+++ b/protected/controllers/SiteController.php
@@ -30,7 +30,7 @@ class SiteController extends Controller
 		if (!Yii::app()->user->isGuest && Yii::app()->user->isAdmin) {
 			$this->redirect(array("/verein/index"));
 		}
-		$this->redirect(array("/myverein/"));
+		$this->redirect(array("/myVerein/"));
 	}
 
 	/**
diff --git a/protected/runtime/application.log b/protected/runtime/application.log
index 7e750aa..11a2fc4 100644
--- a/protected/runtime/application.log
+++ b/protected/runtime/application.log
@@ -6612,3 +6612,77 @@ REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/createAngebot
 in D:\Projects\Astaf\workspace\admin.astaf.de\protected\views\myAngebot\_angebot_form.php (14)
 in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php (120)
 in D:\Projects\Astaf\workspace\admin.astaf.de\index.php (13)
+2012/05/18 15:00:33 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Ihre Anfrage ist ungültig.' in D:\Projects\Astaf\workspace\yii\framework\web\CController.php:337
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(310): CController->invalidActionParams(Object(CInlineAction))
+#1 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction))
+#2 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
+#3 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain))
+#4 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
+#5 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain))
+#6 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#7 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array)
+#8 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('createAngebot')
+#9 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/creat...')
+#10 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#11 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#12 {main}
+REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/createAngebot
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/create
+---
+2012/05/18 15:01:53 [error] [exception.CHttpException.400] exception 'CHttpException' with message 'Ihre Anfrage ist ungültig.' in D:\Projects\Astaf\workspace\yii\framework\web\CController.php:337
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(310): CController->invalidActionParams(Object(CInlineAction))
+#1 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction))
+#2 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
+#3 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain))
+#4 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
+#5 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain))
+#6 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#7 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array)
+#8 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('createAngebot')
+#9 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/creat...')
+#10 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#11 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#12 {main}
+REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/createAngebot
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/create
+---
+2012/05/18 15:07:36 [error] [exception.CHttpException.400] exception 'CHttpException' in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php:131
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionCreateAngebot()
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array)
+#2 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction))
+#3 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
+#4 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain))
+#5 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
+#6 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain))
+#7 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array)
+#9 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('createAngebot')
+#10 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/creat...')
+#11 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#12 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#13 {main}
+REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/createAngebot
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/create
+---
+2012/05/18 15:08:02 [error] [exception.CHttpException.400] exception 'CHttpException' in D:\Projects\Astaf\workspace\admin.astaf.de\protected\controllers\MyAngebotController.php:131
+Stack trace:
+#0 D:\Projects\Astaf\workspace\yii\framework\web\actions\CInlineAction.php(50): MyAngebotController->actionCreateAngebot()
+#1 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(309): CInlineAction->runWithParams(Array)
+#2 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(134): CController->runAction(Object(CInlineAction))
+#3 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilter.php(41): CFilterChain->run()
+#4 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(1146): CFilter->filter(Object(CFilterChain))
+#5 D:\Projects\Astaf\workspace\yii\framework\web\filters\CInlineFilter.php(59): CController->filterAccessControl(Object(CFilterChain))
+#6 D:\Projects\Astaf\workspace\yii\framework\web\filters\CFilterChain.php(131): CInlineFilter->filter(Object(CFilterChain))
+#7 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(292): CFilterChain->run()
+#8 D:\Projects\Astaf\workspace\yii\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array)
+#9 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(276): CController->run('createAngebot')
+#10 D:\Projects\Astaf\workspace\yii\framework\web\CWebApplication.php(135): CWebApplication->runController('myAngebot/creat...')
+#11 D:\Projects\Astaf\workspace\yii\framework\base\CApplication.php(162): CWebApplication->processRequest()
+#12 D:\Projects\Astaf\workspace\admin.astaf.de\index.php(13): CApplication->run()
+#13 {main}
+REQUEST_URI=/admin.astaf.de/index.php?r=myAngebot/createAngebot
+HTTP_REFERER=http://dev.astaf.de:90/admin.astaf.de/index.php?r=myAngebot/create
+---
diff --git a/protected/views/layouts/main.php b/protected/views/layouts/main.php
index 0f37cf2..7a9f52e 100644
--- a/protected/views/layouts/main.php
+++ b/protected/views/layouts/main.php
@@ -12,6 +12,8 @@
 
 	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
 	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
+	
+	<?php Html::registerJavascript("string.js"); ?>
 
 	<title><?php echo CHtml::encode($this->pageTitle); ?></title>
 </head>
diff --git a/protected/views/myAngebot/_angebot_form.php b/protected/views/myAngebot/_angebot_form.php
index ca1ba6f..2ec84e7 100644
--- a/protected/views/myAngebot/_angebot_form.php
+++ b/protected/views/myAngebot/_angebot_form.php
@@ -1,14 +1,12 @@
 <div class="form">
 
 <?php $form=$this->beginWidget('CActiveForm', array(
-	'id'=>'angebot-form',
-	'enableAjaxValidation'=>false,
+	'id'=>'angebot-dialog-form',
+	'enableAjaxValidation'=>true,
 )); ?>
 
 	<?php $this->renderPartial('/common/_required_fields_text'); ?>
 
-	<?php echo $form->errorSummary($model); ?>
-
 	<div class="row">
 		<?php echo $form->labelEx($model,'kategorie_id'); ?>
 		<?php echo $form->dropDownList($model, "kategorie_id", CHtml::listData($kategorien, "id", "name"), array('empty' => '-- Bitte Kategorie wählen --')); ?>
@@ -37,12 +35,6 @@
 		<?php echo $form->error($model,'beschreibung'); ?>
 	</div>
 
-	<div class="row">
-		<?php echo $form->labelEx($model,'published'); ?>
-		<?php echo $form->checkbox($model,'published'); ?>
-		<?php echo $form->error($model,'published'); ?>
-	</div>
-
 	<div class="row buttons">
 		<?php echo CHtml::submitButton($model->isNewRecord ? 'Erstellen' : 'Speichern'); ?>
 	</div>
diff --git a/protected/views/myAngebot/_form.php b/protected/views/myAngebot/_form.php
index 2abd64d..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(
@@ -21,38 +23,7 @@
     	'select'=>'js:function(event, ui) {
     				return selectAngebot(ui.item);
 				}',
-        'change'=>'js:function( event ) {
-                    var autocomplete = $( this ).data( "autocomplete" );
-                    if (autocomplete.selectedItem ) { return; }
-                    var fullMatcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ) + "$", "i" );
-                    var partMatcher = new RegExp( "^" + $.ui.autocomplete.escapeRegex( $(this).val() ), "i" );
-                    autocomplete.widget().children( ".ui-menu-item" ).each(function() {
-                        var item = $(this).data("item.autocomplete");
-                        if (fullMatcher.test( item.label)) {
-                            autocomplete.selectedItem = item;
-                            return false;
-                        } else if (partMatcher.test(item.label)) {
-                            var conf = confirm("Meinten Sie \""+item.label+"\"?");
-                            if (conf) {
-                                autocomplete.selectedItem = item;
-                                return false;
-                            }
-                        }
-                    });
-                    if (autocomplete.selectedItem) {
-                        autocomplete._trigger("select", event, { item: autocomplete.selectedItem } );
-                    } else {
-                        var selectObj = $("#AngebotVerein_einheit")[0];
-                        selectObj.style.display = "none";
-                        $("#emptyEinheitenTxt")[0].style.display = "inline";
-                        $("#createNewMasterAngebot")[0].style.display = "inline";
-    					var selectParentNode = selectObj.parentNode;
-    					var newSelectObj = selectObj.cloneNode(false); // Make a shallow copy
-    					selectParentNode.replaceChild(newSelectObj, selectObj);
-                    
-                        $("#AngebotVerein_angebot_id").val("");
-                    }
-                }',
+        'change'=>'js:changeAngebot',
     ),
     'htmlOptions'=>array(
         'style'=>'height:20px;',
@@ -63,8 +34,6 @@
 		<?php echo $form->error($model, 'angebot_id'); ?>
 	</div>
 	
-	<span id="createNewMasterAngebot" style="display:none">CREATE</span>
-	
 	<div class="row">
 		<?php echo $form->labelEx($model,'menge'); ?>
 		<?php echo $form->textField($model,'menge',array('size'=>60,'maxlength'=>80)); ?>
@@ -108,11 +77,6 @@
  * The create angebot form
  */
 ?>
-
-<?php echo CHtml::link('Neues Angebot erstellen', "",  // the link for open the dialog
-    array(
-        'style'=>'cursor: pointer; text-decoration: underline;',
-        'onclick'=>"{addAngebot(); $('#angebotDialog').dialog('open');}"));?>
  
 <?php
 $this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog
@@ -122,7 +86,7 @@ $this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog
         'autoOpen'=>false,
         'modal'=>true,
         'width'=>550,
-        'height'=>470,
+        'height'=>505,
     ),
 ));?>
 <div class="divForForm"></div>
@@ -130,49 +94,26 @@ $this->beginWidget('zii.widgets.jui.CJuiDialog', array( // the dialog
 <?php $this->endWidget();?>
  
 <script type="text/javascript">
-function addAngebot() {
+function openAngebotDialog() {
     <?php echo CHtml::ajax(array(
             'url'=>array('myAngebot/createAngebot'),
-            'data'=> "js:$(this).serialize()",
+            'data'=>'js:$("#angebot_name").serialize()',
             'type'=>'post',
             'dataType'=>'json',
-            'success'=>"function(data) {
-                if (data.status == 'failure') {
-                    $('#angebotDialog div.divForForm').html(data.div);
-                          // Here is the trick: on submit-> once again this function!
-                    $('#angebotDialog div.divForForm form').submit(addAngebot);
-                } else {
-                    $('#angebotDialog div.divForForm').html(data.div);
-                    setTimeout(\"$('#angebotDialog').dialog('close') \",3000);
-                    selectAngebot(data);
-                }
-            }",
-            ))?>;
+            'success'=>'angebotVereinDialog',
+            )); ?>
+    $('#angebotDialog').dialog('open'); // Open Angebot dialog
     return false;
 }
 
-function selectAngebot(angebot) {
-	$("#AngebotVerein_angebot_id").val(angebot.value);
-	$("#angebot_name").val(angebot.label);
-	var selectObj = $("#AngebotVerein_einheit")[0];
-    selectObj.style.display = "inline";
-    $("#emptyEinheitenTxt")[0].style.display = "none";
-    $("#createNewMasterAngebot")[0].style.display = "none";
-	var selectParentNode = selectObj.parentNode;
-	var newSelectObj = selectObj.cloneNode(false); // Make a shallow copy
-	selectParentNode.replaceChild(newSelectObj, selectObj);
-	var count = 0;
-	var einheiten = angebot.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;
+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
-- 
cgit v1.0-28-g1787

