Code

Updated styles
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Nov 2007 16:54:01 +0000 (16:54 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 29 Nov 2007 16:54:01 +0000 (16:54 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7945 594d385d-05f5-0310-b6e9-bd551577e9d8

html/themes/default/style.css
ihtml/themes/default/headers.tpl
plugins/personal/generic/class_user.inc
plugins/personal/generic/generic.tpl

index 7de1f548333c273549ba3fe8add52d3cd81ec7d7..772f0e8ea4136b0a0f0b8e40d19906a7b5a9d753 100644 (file)
@@ -696,10 +696,12 @@ input:focus {
 
 select {
        font-size:12px;
+       border:1px solid #AAA;
 }
 
 textarea {
        font-size:12px;
+       border:1px solid #AAA;
 }
 
 textarea:focus {
@@ -1533,3 +1535,20 @@ td.container_:hover,div.container_:hover {
     line-height: 0;
 }
 
+/* Dojo override */
+.tundra .dijitTextBox,
+.tundra .dijitComboBox,
+.tundra .dijitSpinner,
+.tundra .dijitInlineEditor input,
+.tundra .dijitTextArea {
+       background: #fff;
+}
+
+.tundra .dijitTextBoxError,
+.tundra .dijitComboBoxError,
+.tundra .dijitSpinnerError {
+        border:1px solid #f3d118;
+        background-color:#f9f7ba;
+        background-image:none;
+}
+
index ddefbb27c4712dd519b30f85c5b02f2a31745d66..9619a3f7ddcbf6add7b40adf10c10d5ebfa329f2 100644 (file)
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 
   <style type="text/css">
-       @import url('themes/default/style.css');
        {if $dojo}
        @import url('include/dojo/dijit/themes/tundra/tundra.css');
        @import url('include/dojo/dojo/resources/dojo.css');
        {/if}
+       @import url('themes/default/style.css');
   </style>
   <link rel="shortcut icon" href="favicon.ico">
 
   <script type="text/javascript">
        dojo.require("dojo.parser");
        dojo.require("dijit.form.TextBox");
+       dojo.require("dijit.form.DateTextBox");
        dojo.require("dijit.form.ValidationTextBox");
+       dojo.require("dijit.form.ComboBox");
+       dojo.require("dijit.form.FilteringSelect");
   </script>
   {/if}
 
index bc67f37b3501e21cc4d8eac5ede2d1a0f7c4604d..cb0d10f7f0df8f0ddd1528770155d5e06494a9d8 100644 (file)
@@ -203,14 +203,16 @@ class user extends plugin
     }
 
     /* Generate dateOfBirth entry */
-    if (isset ($this->attrs['dateOfBirth'])){
-      /* This entry is ISO 8601 conform */
-      list($year, $month, $day)= split("-", $this->attrs['dateOfBirth'][0], 3);
-    
-      $this->dateOfBirth=array( 'mon'=> $month,"mday"=> $day,"year"=> $year);
-      $this->use_dob= "1";
-    } else {
-      $this->use_dob= "0";
+    if (!$_SESSION['DOJO']){
+      if (isset ($this->attrs['dateOfBirth'])){
+        /* This entry is ISO 8601 conform */
+        list($year, $month, $day)= split("-", $this->attrs['dateOfBirth'][0], 3);
+      
+        $this->dateOfBirth=array( 'mon'=> $month,"mday"=> $day,"year"=> $year);
+        $this->use_dob= "1";
+      } else {
+        $this->use_dob= "0";
+      }
     }
 
     /* Put gender attribute to upper case */
@@ -242,48 +244,52 @@ class user extends plugin
     $smarty= get_smarty();
 
     /* Fill calendar */
-    if ($this->dateOfBirth == "0"){
-      $date= getdate();
+    if ($_SESSION['DOJO']){
+      $smarty->assign('dateOfBirth', $this->dateOfBirth);
     } else {
-      if(is_array($this->dateOfBirth)){
-        $date = $this->dateOfBirth;
-  
-        // Trigger on dates like 1985-04-01, getdate only understands timestamps
-      } else if (!empty($this->dateOfBirth) && !is_numeric($this->dateOfBirth)){
-        $date= getdate(strtotime($this->dateOfBirth));
-
+      if ($this->dateOfBirth == "0"){
+        $date= getdate();
       } else {
-        $date = getdate($this->dateOfBirth);
+        if(is_array($this->dateOfBirth)){
+          $date = $this->dateOfBirth;
+    
+          // Trigger on dates like 1985-04-01, getdate only understands timestamps
+        } else if (!empty($this->dateOfBirth) && !is_numeric($this->dateOfBirth)){
+          $date= getdate(strtotime($this->dateOfBirth));
+
+        } else {
+          $date = getdate($this->dateOfBirth);
+        }
       }
-    }
 
-    $days= array();
-    for($d= 1; $d<32; $d++){
-      $days[$d]= $d;
-    }
-    $years= array();
+      $days= array();
+      for($d= 1; $d<32; $d++){
+        $days[$d]= $d;
+      }
+      $years= array();
 
-    if(($date['year']-100)<1901){
-      $start = 1901;
-    }else{
-      $start = $date['year']-100;
-    }
+      if(($date['year']-100)<1901){
+        $start = 1901;
+      }else{
+        $start = $date['year']-100;
+      }
 
-    $end = $start +100;
-    
-    for($y= $start; $y<=$end; $y++){
-      $years[]= $y;
-    }
-    $years['-']= "-&nbsp;";
-    $months= array(_("January"), _("February"), _("March"), _("April"),
-        _("May"), _("June"), _("July"), _("August"), _("September"),
-        _("October"), _("November"), _("December"), '-' => '-&nbsp;');
-    $smarty->assign("day", $date["mday"]);
-    $smarty->assign("days", $days);
-    $smarty->assign("months", $months);
-    $smarty->assign("month", $date["mon"]-1);
-    $smarty->assign("years", $years);
-    $smarty->assign("year", $date["year"]);
+      $end = $start +100;
+      
+      for($y= $start; $y<=$end; $y++){
+        $years[]= $y;
+      }
+      $years['-']= "-&nbsp;";
+      $months= array(_("January"), _("February"), _("March"), _("April"),
+          _("May"), _("June"), _("July"), _("August"), _("September"),
+          _("October"), _("November"), _("December"), '-' => '-&nbsp;');
+      $smarty->assign("day", $date["mday"]);
+      $smarty->assign("days", $days);
+      $smarty->assign("months", $months);
+      $smarty->assign("month", $date["mon"]-1);
+      $smarty->assign("years", $years);
+      $smarty->assign("year", $date["year"]);
+    }
 
     /* Assign uid regex for dojo */
     $smarty->assign("uid_regex", get_uid_regexp());
@@ -755,10 +761,12 @@ class user extends plugin
     /* First use parents methods to do some basic fillup in $this->attrs */
     plugin::save ();
 
-    if ($this->use_dob == "1"){
-      /* If it is an array, the generic page has never been loaded - so there's no difference. Using an array would cause an error btw. */
-      if(!is_array($this->attrs['dateOfBirth'])) {
-        $this->attrs['dateOfBirth'] = date("Y-m-d", $this->dateOfBirth);
+    if (!$_SESSION['DOJO']){
+      if ($this->use_dob == "1"){
+        /* If it is an array, the generic page has never been loaded - so there's no difference. Using an array would cause an error btw. */
+        if(!is_array($this->attrs['dateOfBirth'])) {
+          $this->attrs['dateOfBirth'] = date("Y-m-d", $this->dateOfBirth);
+        }
       }
     }
 
@@ -820,12 +828,14 @@ class user extends plugin
       $remove_userCertificate= true;
     }
 
-    /* Special handling for dateOfBirth value */
-    if ($this->use_dob != "1"){
-      if ($this->is_new) {
-        unset($this->attrs["dateOfBirth"]);
-      } else {
-        $this->attrs["dateOfBirth"]= array();
+    if (!$_SESSION['DOJO']){
+      /* Special handling for dateOfBirth value */
+      if ($this->use_dob != "1"){
+        if ($this->is_new) {
+          unset($this->attrs["dateOfBirth"]);
+        } else {
+          $this->attrs["dateOfBirth"]= array();
+        }
       }
     }
     if (!$this->gender){
@@ -1058,6 +1068,13 @@ class user extends plugin
       }
     }
 
+    /* Date in dojo mode... */
+    if ($_SESSION['DOJO']){
+      if (!preg_match('/^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$/', $_POST['dateOfBirth'])){
+        $message[]= _("Please provide a valid date of birth.");
+      }
+    }
+
     /* Set the new acl base */
     if($this->dn == "new") {
       $this->set_acl_base($this->base);
index ed1be101b233e73572ab1050f20fb711b3ec41f3..cfc8406f902d351e506edf29e941055fa9fb0066 100644 (file)
@@ -63,7 +63,7 @@
     </tr>
     <tr>
      <td><label for="uid">{t}Login{/t}{$must}</label></td>
-     <td>{render acl=$uidACL}<input id="uid" name="uid" size="25" maxLength="60"  value="{$uid}" dojoType="dijit.form.ValidationTextBox" propercase="false" trim="true" required="true" invalidMessage="{$uid_invalid_message}" regExp="{$uid_regex}">{/render}</td>
+     <td>{render acl=$uidACL}<input id="uid" name="uid" size="25" maxLength="60"  value="{$uid}" dojoType="dijit.form.ValidationTextBox" propercase="false" trim="true" required="true" promptMessage="{t}This field is required{/t}" invalidMessage="{$uid_invalid_message}" regExp="{$uid_regex}">{/render}</td>
     </tr>
     {/if}
       
@@ -75,7 +75,7 @@
      <td>
       <div style="height:10px;"></div>
        {render acl=$personalTitleACL}
-               <input id="personalTitle" name="personalTitle" size=25 maxlength=60 value="{$personalTitle}">
+               <input id="personalTitle" name="personalTitle" dojoType="dijit.form.TextBox" size=25 maxLength=60 value="{$personalTitle}">
        {/render}
      </td>
     </tr>
@@ -83,7 +83,7 @@
      <td><label for="academicTitle">{t}Academic title{/t}</label></td>
      <td>
        {render acl=$academicTitleACL}
-             <input id="academicTitle" name="academicTitle" size=25 maxlength=60 value="{$academicTitle}">
+             <input id="academicTitle" name="academicTitle" size=25 dojoType="dijit.form.TextBox" maxLength=60 value="{$academicTitle}">
        {/render}
      </td>
     </tr>
@@ -95,6 +95,9 @@
      <td>
       <div style="height:10px;"></div>
        {render acl=$dateOfBirthACL}
+       {if $dojo}
+             <input id="dateOfBirth" name="dateOfBirth" size=11 dojoType="dijit.form.DateTextBox" maxLength=11 value="{$dateOfBirth}">
+       {else}
              {if $use_dob eq 1}
              <select id="day" name=day onChange="createResult(this.form,this.form.dateOfBirth);"> 
               {html_options values=$days output=$days selected=$day}
              {else}
              <input type="submit" name="set_dob" value="{t}Set{/t}" >
              {/if}
+       {/if}
        {/render}
      </td>
     </tr>