Code

Fixed some errors.
authorjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Jun 2005 13:31:18 +0000 (13:31 +0000)
committerjanw <janw@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 15 Jun 2005 13:31:18 +0000 (13:31 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@723 594d385d-05f5-0310-b6e9-bd551577e9d8

html/include/calendar.js
plugins/personal/generic/generic.tpl
plugins/personal/posix/class_posixAccount.inc

index b6f7296c0a97ef7c07a03d07c209ac65ed9350c8..830deb078ff93b63c6d001ff7961bde105e02fd7 100644 (file)
@@ -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){
index fde78d2529b6a5d736eac8aa8b81d2f0ab5077e2..69ffecd4d15f0d6122a9218a3c03a04e0fcfbc50 100644 (file)
 <script language="JavaScript" type="text/javascript">
   <!-- // First input field on page
   document.mainform.sn.focus();
-  if (yearSel != "") populate(document.mainform,document.mainform.dob);
+       if (document.mainform.yearSel != "")
+                               populate(document.mainform,document.mainform.dob);
   -->
 </script>
 
index 55e8e9626d53cf76f2b7670ba8301cfe040abf11..f4755d3dadf7f434e0bda29be707d8b1e09c459a 100644 (file)
@@ -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... */