From 1a0134e78d3f80f745225dfc0602c8a2e49da30c Mon Sep 17 00:00:00 2001 From: janw Date: Wed, 15 Jun 2005 13:31:18 +0000 Subject: [PATCH] Fixed some errors. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@723 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/include/calendar.js | 61 ++++++++++--------- plugins/personal/generic/generic.tpl | 3 +- plugins/personal/posix/class_posixAccount.inc | 6 +- 3 files changed, 38 insertions(+), 32 deletions(-) diff --git a/html/include/calendar.js b/html/include/calendar.js index b6f7296c0..830deb078 100644 --- a/html/include/calendar.js +++ b/html/include/calendar.js @@ -1,34 +1,37 @@ function populate(objForm,resultForm) { - yearSel=objForm.year.options[objForm.year.selectedIndex].text; - monthIx=objForm.month.selectedIndex; - nextMonthIx=0; - if(monthIx!=11) - nextMonthIx=monthIx+1; - - nextMonthSel=objForm.month.options[nextMonthIx].value; - monthSel=objForm.month.options[monthIx].value; - - daySel=1; - if(objForm.day.selectedIndex!=-1) - daySel=objForm.day.options[objForm.day.selectedIndex].value; - - timeOfDayOne = new Date(yearSel, nextMonthSel, 1); - timeDifference = timeOfDayOne - 86400000; - timeOfLastDay = new Date(timeDifference); - - var daysInMonth = timeOfLastDay.getDate(); - - if(daySel>daysInMonth) daySel=daysInMonth; - - selectedDate= new Date(yearSel,monthSel,daySel); - for (var i = 0; i < objForm.day.length; i++) { - objForm.day.options[0] = null; - } - for (var i = 0; i < daysInMonth; i++) { - objForm.day.options[i] = new Option(i+1); + if(objForm.year) { + yearSel=objForm.year.options[objForm.year.selectedIndex].text; + + monthIx=objForm.month.selectedIndex; + nextMonthIx=0; + if(monthIx!=11) + nextMonthIx=monthIx+1; + + nextMonthSel=objForm.month.options[nextMonthIx].value; + monthSel=objForm.month.options[monthIx].value; + + daySel=1; + if(objForm.day.selectedIndex!=-1) + daySel=objForm.day.options[objForm.day.selectedIndex].value; + + timeOfDayOne = new Date(yearSel, nextMonthSel, 1); + timeDifference = timeOfDayOne - 86400000; + timeOfLastDay = new Date(timeDifference); + + var daysInMonth = timeOfLastDay.getDate(); + + if(daySel>daysInMonth) daySel=daysInMonth; + + selectedDate= new Date(yearSel,monthSel,daySel); + for (var i = 0; i < objForm.day.length; i++) { + objForm.day.options[0] = null; + } + for (var i = 0; i < daysInMonth; i++) { + objForm.day.options[i] = new Option(i+1); + } + objForm.day.selectedIndex=daySel-1; + saveResult(selectedDate,resultForm); } - objForm.day.selectedIndex=daySel-1; - saveResult(selectedDate,resultForm); } function createResult(objForm,resultForm){ diff --git a/plugins/personal/generic/generic.tpl b/plugins/personal/generic/generic.tpl index fde78d252..69ffecd4d 100644 --- a/plugins/personal/generic/generic.tpl +++ b/plugins/personal/generic/generic.tpl @@ -394,7 +394,8 @@ diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc index 55e8e9626..f4755d3da 100644 --- a/plugins/personal/posix/class_posixAccount.inc +++ b/plugins/personal/posix/class_posixAccount.inc @@ -488,8 +488,11 @@ class posixAccount extends plugin /* Checkboxes */ if ($this->force_ids == 1){ $smarty->assign("force_ids", "checked"); + if ($_SESSION['js']){ + $smarty->assign("forceMode", ""); + } } else { - if ($_SESSION["js"]){ + if ($_SESSION['js']){ $smarty->assign("forceMode", "disabled"); } $smarty->assign("force_ids", ""); @@ -876,7 +879,6 @@ class posixAccount extends plugin $message[]= _("Value specified as 'GID' is too small."); } } - } /* Check shadow settings, well I like spaghetties... */ -- 2.30.2