From c3fbe713d386dd8bf283e0ffbe6c86ff5146b34b Mon Sep 17 00:00:00 2001 From: cajus Date: Thu, 29 Nov 2007 16:54:01 +0000 Subject: [PATCH] Updated styles git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@7945 594d385d-05f5-0310-b6e9-bd551577e9d8 --- html/themes/default/style.css | 19 ++++ ihtml/themes/default/headers.tpl | 5 +- plugins/personal/generic/class_user.inc | 125 ++++++++++++++---------- plugins/personal/generic/generic.tpl | 10 +- 4 files changed, 101 insertions(+), 58 deletions(-) diff --git a/html/themes/default/style.css b/html/themes/default/style.css index 7de1f5483..772f0e8ea 100644 --- a/html/themes/default/style.css +++ b/html/themes/default/style.css @@ -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; +} + diff --git a/ihtml/themes/default/headers.tpl b/ihtml/themes/default/headers.tpl index ddefbb27c..9619a3f7d 100644 --- a/ihtml/themes/default/headers.tpl +++ b/ihtml/themes/default/headers.tpl @@ -17,11 +17,11 @@ @@ -39,7 +39,10 @@ {/if} diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index bc67f37b3..cb0d10f7f 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -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['-']= "- "; - $months= array(_("January"), _("February"), _("March"), _("April"), - _("May"), _("June"), _("July"), _("August"), _("September"), - _("October"), _("November"), _("December"), '-' => '- '); - $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['-']= "- "; + $months= array(_("January"), _("February"), _("March"), _("April"), + _("May"), _("June"), _("July"), _("August"), _("September"), + _("October"), _("November"), _("December"), '-' => '- '); + $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); diff --git a/plugins/personal/generic/generic.tpl b/plugins/personal/generic/generic.tpl index ed1be101b..cfc8406f9 100644 --- a/plugins/personal/generic/generic.tpl +++ b/plugins/personal/generic/generic.tpl @@ -63,7 +63,7 @@ - {render acl=$uidACL}{/render} + {render acl=$uidACL}{/render} {/if} @@ -75,7 +75,7 @@
{render acl=$personalTitleACL} - + {/render} @@ -83,7 +83,7 @@ {render acl=$academicTitleACL} - + {/render} @@ -95,6 +95,9 @@
{render acl=$dateOfBirthACL} + {if $dojo} + + {else} {if $use_dob eq 1} {/if} + {/if} {/render} -- 2.30.2