summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Geiger2011-10-18 11:37:02 +0200
committerBjörn Geiger2011-10-18 11:37:02 +0200
commit20febccd573074ab3384fa69da40504abadb172b (patch)
treefd22890c3ea2273eaa01b78fee9cb9a35bdab3bc
parentminor (diff)
downloadpoolctrl-20febccd573074ab3384fa69da40504abadb172b.tar.gz
poolctrl-20febccd573074ab3384fa69da40504abadb172b.tar.xz
poolctrl-20febccd573074ab3384fa69da40504abadb172b.zip
weitere Korrektur
-rwxr-xr-xapplication/views/scripts/event/add.phtml59
-rwxr-xr-xpublic/media/js/script.js18
2 files changed, 43 insertions, 34 deletions
diff --git a/application/views/scripts/event/add.phtml b/application/views/scripts/event/add.phtml
index 11ac271..f42597f 100755
--- a/application/views/scripts/event/add.phtml
+++ b/application/views/scripts/event/add.phtml
@@ -1,4 +1,5 @@
<h1>Add Event</h1>
+<script type="text/javascript">
<?php
$this->addForm->setAction($this->url());
$this->bootoslist = $this->addForm->getBootoslist();
@@ -10,34 +11,38 @@ if(isset($this->bootoslist)) {
}
}
}
-echo "<script type=\"text/javascript\">";
-$ids = implode(", ", $bootosIDs);
-echo "var bootosIDs = new Array(" . $ids . ");\n";
-echo "</script>";
-echo $this->addForm;
-echo "<script type=\"text/javascript\">\n";
+$bootosIDs = implode(", ", $bootosIDs);
+echo "\tvar bootosIDs = new Array(" . $bootosIDs . ");\n";
+?>
+</script>
+<?php
+echo $this->addForm . "\n";
+?>
+<script type="text/javascript">
+<?php
if(isset($this->params['add'])) {
- echo "addeventcategoryfieldChanged('category', bootosIDs, '" . $this->params['add'] . "');\n";
+ echo "\taddeventcategoryfieldChanged('category', bootosIDs, '" . $this->params['add'] . "');\n";
+ echo "\timmediateChanged('immediate', bootosIDs, '" . $this->params['add'] . "');\n";
} else {
- echo "addeventcategoryfieldChanged('category', bootosIDs);\n";
+ echo "\taddeventcategoryfieldChanged('category', bootosIDs);\n";
+ echo "\timmediateChanged('immediate', bootosIDs);\n";
}
-echo 'immediateChanged("immediate", bootosIDs);
- $(function() {
- $("#start").datetimepicker({
- dateFormat: "mm/dd/yy",
- timeFormat: "hh:mm tt",
- ampm: true
- });
- $("#end").datetimepicker({
- dateFormat: "mm/dd/yy",
- timeFormat: "hh:mm tt",
- ampm: true
- });
- $("#repeatdate").datetimepicker({
- dateFormat: "mm/dd/yy",
- timeFormat: "hh:mm tt",
- ampm: true
- });
+?>
+ $(function() {
+ $("#start").datetimepicker({
+ dateFormat: "mm/dd/yy",
+ timeFormat: "hh:mm tt",
+ ampm: true
+ });
+ $("#end").datetimepicker({
+ dateFormat: "mm/dd/yy",
+ timeFormat: "hh:mm tt",
+ ampm: true
+ });
+ $("#repeatdate").datetimepicker({
+ dateFormat: "mm/dd/yy",
+ timeFormat: "hh:mm tt",
+ ampm: true
});
- </script>';
-?> \ No newline at end of file
+ });
+</script> \ No newline at end of file
diff --git a/public/media/js/script.js b/public/media/js/script.js
index 9e00e6c..6e75665 100755
--- a/public/media/js/script.js
+++ b/public/media/js/script.js
@@ -123,7 +123,7 @@ function repeatChanged(name) {
}
}
-function immediateChanged(name, bootosIDs) {
+function immediateChanged(name, bootosIDs, add) {
if (getElementAttribute(name, 'checked')) {
setElementInvisible("start-label");
setElementInvisible("start-element");
@@ -169,11 +169,15 @@ function immediateChanged(name, bootosIDs) {
enableElement('repeat');
enableElement('note');
enableElement('participants');
- addeventcategoryfieldChanged('category', bootosIDs);
+ if(!add) {
+ addeventcategoryfieldChanged('category', bootosIDs);
+ } else {
+ addeventcategoryfieldChanged('category', bootosIDs, add);
+ }
}
}
-function addeventcategoryfieldChanged(name, bootosIDs, save) {
+function addeventcategoryfieldChanged(name, bootosIDs, add) {
option = $('#' + name + ' option[value="' + getElementValue(name) + '"]');
label = option.attr('label');
startLabel = $('#start-label');
@@ -187,7 +191,7 @@ function addeventcategoryfieldChanged(name, bootosIDs, save) {
enableElement('immediate');
enableElement('pbs_bootosID');
disableElement('end');
- if(!save) {
+ if(!add) {
removeElementAttribute('repeat', 'checked');
}
startLabel.children().text('Date:');
@@ -202,7 +206,7 @@ function addeventcategoryfieldChanged(name, bootosIDs, save) {
enableElement('immediate');
disableElement('end');
disableElement('pbs_bootosID');
- if(!save) {
+ if(!add) {
removeElementAttribute('repeat', 'checked');
}
startLabel.children().text('Date:');
@@ -222,7 +226,7 @@ function addeventcategoryfieldChanged(name, bootosIDs, save) {
enableElement('end');
enableElement('pbs_bootosID');
disableElement('immediate');
- if(!save) {
+ if(!add) {
setElementAttribute('repeat', 'checked', 'checked');
}
startLabel.children().text('Start:');
@@ -237,7 +241,7 @@ function addeventcategoryfieldChanged(name, bootosIDs, save) {
enableElement('end');
enableElement('pbs_bootosID');
disableElement('immediate');
- if(!save) {
+ if(!add) {
removeElementAttribute('repeat', 'checked');
}
startLabel.children().text('Start:');