Code

Disable prototype by default, add datepicker for later use
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Sep 2009 11:22:11 +0000 (11:22 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 28 Sep 2009 11:22:11 +0000 (11:22 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14369 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/html/images/date_active.gif [new file with mode: 0644]
gosa-core/html/images/datepicker.gif [new file with mode: 0644]
gosa-core/html/images/datepicker_ro.gif [new file with mode: 0644]
gosa-core/html/include/datepicker.init.js [new file with mode: 0644]
gosa-core/html/include/datepicker.js [new file with mode: 0644]
gosa-core/html/index.php
gosa-core/html/logout.php
gosa-core/html/main.php
gosa-core/html/themes/default/style.css
gosa-core/ihtml/themes/default/headers.tpl
gosa-core/include/class_listing.inc

diff --git a/gosa-core/html/images/date_active.gif b/gosa-core/html/images/date_active.gif
new file mode 100644 (file)
index 0000000..132a364
Binary files /dev/null and b/gosa-core/html/images/date_active.gif differ
diff --git a/gosa-core/html/images/datepicker.gif b/gosa-core/html/images/datepicker.gif
new file mode 100644 (file)
index 0000000..7b4d6bf
Binary files /dev/null and b/gosa-core/html/images/datepicker.gif differ
diff --git a/gosa-core/html/images/datepicker_ro.gif b/gosa-core/html/images/datepicker_ro.gif
new file mode 100644 (file)
index 0000000..a6caa10
Binary files /dev/null and b/gosa-core/html/images/datepicker_ro.gif differ
diff --git a/gosa-core/html/include/datepicker.init.js b/gosa-core/html/include/datepicker.init.js
new file mode 100644 (file)
index 0000000..77457be
--- /dev/null
@@ -0,0 +1,16 @@
+function initDatepickers() {\r
+       $$("*").findAll(function(node) {\r
+               return Element.hasClassName(node,'date');\r
+       }).each(function(node) {\r
+               datepickers[node.id] = new DatePicker({\r
+                       relative                        : node.id,\r
+                       language                        : 'de',\r
+                       enableCloseEffect : false,\r
+                       enableShowEffect        : true,\r
+                       closeEffect                     : 'squish',\r
+                       showEffect                      : 'appear'\r
+               });\r
+               datepickers[node.id].setDateFormat([ "dd", "mm", "yyyy" ], ".");\r
+       });\r
+}\r
+Event.observe(window, 'load', initDatepickers, false);\r
diff --git a/gosa-core/html/include/datepicker.js b/gosa-core/html/include/datepicker.js
new file mode 100644 (file)
index 0000000..aee1ea5
--- /dev/null
@@ -0,0 +1,794 @@
+/**
+ * DatePicker widget using Prototype and Scriptaculous.
+ * (c) 2007 Mathieu Jondet <mathieu@eulerian.com>
+ * Eulerian Technologies
+ *
+ * DatePicker is freely distributable under the same terms as Prototype.
+ *
+ *     Modified 10.06.2008
+ * by Manu <manu@bytefresser.de>
+ *
+ */
+
+/**
+ * DatePickerFormatter class for matching and stringifying dates.
+ *
+ * By Arturas Slajus <x11@arturaz.net>.
+ */
+var DatePickerFormatter = Class.create();
+
+DatePickerFormatter.prototype = {
+       /**
+        * Create a DatePickerFormatter.
+        *
+        * format: specify a format by passing 3 value array consisting of
+        *   "yyyy", "mm", "dd". Default: ["yyyy", "mm", "dd"].
+        *
+        * separator: string for splitting the values. Default: "-".
+        *
+        * Use it like this:
+        *   var df = new DatePickerFormatter(["dd", "mm", "yyyy"], "/");
+        *   df.current_date();
+        *   df.match("7/7/2007");
+        */
+       initialize: function(format, separator) {
+               
+               if (Object.isUndefined(format))
+                       format = ["yyyy", "mm", "dd"];
+               if (Object.isUndefined(separator))
+                       separator = "-";
+               
+               this._format                            = format;
+               this.separator                          = separator;
+                   
+               this._format_year_index = format.indexOf("yyyy");
+               this._format_month_index= format.indexOf("mm");
+               this._format_day_index  = format.indexOf("dd");
+                   
+               this._year_regexp                       = /^\d{4}$/;
+               this._month_regexp              = /^0\d|1[012]|\d$/;
+               this._day_regexp                        = /^0\d|[12]\d|3[01]|\d$/;
+       },
+    
+       /**
+       * Match a string against date format.
+       * Returns: [year, month, day]
+       */
+       match: function(str) {
+       
+               var d = str.split(this.separator);
+               
+               if (d.length < 3) {
+                       return false;
+               }
+               
+               var year = d[this._format_year_index].match(this._year_regexp);
+               if (year) {
+                       year = year[0]
+               } else {
+                       return false
+               }
+               var month = d[this._format_month_index].match(this._month_regexp);
+               if (month) {
+                       month = month[0]
+               } else {
+                       return false
+               }
+               var day = d[this._format_day_index].match(this._day_regexp);
+               if (day) {
+                       day = day[0]
+               } else {
+                       return false
+               }
+               
+               return [year, month, day];
+       },
+    
+       /**
+        * Return current date according to format.
+        */
+       current_date: function() {
+               var d = new Date;
+               return this.date_to_string (
+                       d.getFullYear(),
+                       d.getMonth() + 1,
+                       d.getDate()
+               );
+       },
+
+       /**
+        * Return a stringified date accordint to format.
+        */
+       date_to_string: function(year, month, day, separator) {
+               
+               if (Object.isUndefined(separator))
+                       separator = this.separator;
+       
+               var a = [0, 0, 0];
+               a[this._format_year_index]      = year;
+               a[this._format_month_index]= month.toPaddedString(2);
+               a[this._format_day_index]       = day.toPaddedString(2);
+               
+               return a.join(separator);
+       }
+}; 
+
+/**
+ * DatePicker
+ */
+var datepickers = $H();
+
+var DatePicker = Class.create();
+
+DatePicker.prototype   = {
+       
+       Version                         : '0.9.4',
+       _relative                       : null,
+       _div                                    : null,
+       _zindex                         : 1,
+       _keepFieldEmpty : false,
+       _daysInMonth            : [31,28,31,30,31,30,31,31,30,31,30,31],
+       _dateFormat                     : [ ["dd", "mm", "yyyy"], "." ],
+       
+       /* language */
+       _language                       : 'de',
+       _language_month : $H({
+               'fr'    : [ 'Janvier', 'F&#233;vrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Aout', 'Septembre', 'Octobre', 'Novembre', 'D&#233;cembre' ],
+               'en'    : [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ],
+               'es'    : [ 'Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo', 'Junio', 'Julio', 'Agosto', 'Septiembre', 'Octubre', 'Noviembre', 'Diciembre' ],
+               'it'    : [ 'Gennaio', 'Febbraio', 'Marzo', 'Aprile', 'Maggio', 'Giugno', 'Luglio', 'Agosto', 'Settembre', 'Ottobre', 'Novembre', 'Dicembre' ],
+               'de'    : [ 'Januar', 'Februar', 'M&#228;rz', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' ],
+               'pt'    : [ 'Janeiro', 'Fevereiro', 'Mar&#231;o', 'Abril', 'Maio', 'Junho', 'Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ],
+               'hu'    : [ 'Janu&#225;r', 'Febru&#225;r', 'M&#225;rcius', '&#193;prilis', 'M&#225;jus', 'J&#250;nius', 'J&#250;lius', 'Augusztus', 'Szeptember', 'Okt&#243;ber', 'November', 'December' ],
+               'lt'  : [ 'Sausis', 'Vasaris', 'Kovas', 'Balandis', 'Gegu&#382;&#279;', 'Bir&#382;elis', 'Liepa', 'Rugj&#363;tis', 'Rus&#279;jis', 'Spalis', 'Lapkritis', 'Gruodis' ],
+               'nl'    : [ 'januari', 'februari', 'maart', 'april', 'mei', 'juni', 'juli', 'augustus', 'september', 'oktober', 'november', 'december' ],
+               'dk'    : [ 'Januar', 'Februar', 'Marts', 'April', 'Maj', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'December' ],
+               'no'    : [ 'Januar', 'Februar', 'Mars', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Desember' ],
+               'lv'    : [ 'Janv&#257;ris', 'Febru&#257;ris', 'Marts', 'Apr&#299;lis', 'Maijs', 'J&#363;nijs', 'J&#363;lijs', 'Augusts', 'Septembris', 'Oktobris', 'Novembris', 'Decemberis' ],
+               'ja'    : [ '1&#26376;', '2&#26376;', '3&#26376;', '4&#26376;', '5&#26376;', '6&#26376;', '7&#26376;', '8&#26376;', '9&#26376;', '10&#26376;', '11&#26376;', '12&#26376;' ],
+               'fi'    : [ 'Tammikuu', 'Helmikuu', 'Maaliskuu', 'Huhtikuu', 'Toukokuu', 'Kes&#228;kuu', 'Hein&#228;kuu', 'Elokuu', 'Syyskuu', 'Lokakuu', 'Marraskuu', 'Joulukuu' ],
+               'ro'    : [ 'Ianuarie', 'Februarie', 'Martie', 'Aprilie', 'Mai', 'Junie', 'Julie', 'August', 'Septembrie', 'Octombrie', 'Noiembrie', 'Decembrie' ],
+               'zh'    : [ '1&#32;&#26376;', '2&#32;&#26376;', '3&#32;&#26376;', '4&#32;&#26376;', '5&#32;&#26376;', '6&#32;&#26376;', '7&#32;&#26376;', '8&#32;&#26376;', '9&#32;&#26376;', '10&#26376;', '11&#26376;', '12&#26376;'],
+               'sv'    : [ 'Januari', 'Februari', 'Mars', 'April', 'Maj', 'Juni', 'Juli', 'Augusti', 'September', 'Oktober', 'November', 'December' ]
+       }),
+       _language_day   : $H({
+               'fr'    : [ 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam', 'Dim' ],
+               'en'    : [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ],
+               'es'    : [ 'Lun', 'Mar', 'Mie', 'Jue', 'Vie', 'S&#224;b', 'Dom' ],
+               'it'    : [ 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab', 'Dom' ],
+               'de'    : [ 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So' ],
+               'pt'    : [ 'Seg', 'Ter', 'Qua', 'Qui', 'Sex', 'S&#225;', 'Dom' ],
+               'hu'    : [ 'H&#233;', 'Ke', 'Sze', 'Cs&#252;', 'P&#233;', 'Szo', 'Vas' ],
+               'lt'  : [ 'Pir', 'Ant', 'Tre', 'Ket', 'Pen', '&Scaron;e&scaron;', 'Sek' ],
+               'nl'    : [ 'ma', 'di', 'wo', 'do', 'vr', 'za', 'zo' ],
+               'dk'    : [ 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'L&#248;r', 'S&#248;n' ],
+               'no'    : [ 'Man', 'Tir', 'Ons', 'Tor', 'Fre', 'L&#248;r', 'Sun' ],
+               'lv'    : [ 'P', 'O', 'T', 'C', 'Pk', 'S', 'Sv' ],
+               'ja'    : [ '&#26376;', '&#28779;', '&#27700;', '&#26408;', '&#37329;', '&#22303;', '&#26085;' ],
+               'fi'    : [ 'Ma', 'Ti', 'Ke', 'To', 'Pe', 'La', 'Su' ],
+               'ro'    : [ 'Lun', 'Mar', 'Mie', 'Joi', 'Vin', 'Sam', 'Dum' ],
+               'zh'    : [ '&#21608;&#19968;', '&#21608;&#20108;', '&#21608;&#19977;', '&#21608;&#22235;', '&#21608;&#20116;', '&#21608;&#20845;', '&#21608;&#26085;' ],
+               'sv'    : [ 'M&#229;n', 'Tis', 'Ons', 'Tor', 'Fre', 'L&#246;r', 'S&#246;n' ]
+       }),
+       _language_close : $H({
+               'fr'    : 'fermer',
+               'en'    : 'close',
+               'es'    : 'cierre',
+               'it'    : 'fine',
+               'de'    : 'schliessen',
+               'pt'    : 'fim',
+               'hu'    : 'bez&#225;r',
+               'lt'  : 'udaryti',
+               'nl'    : 'sluiten',
+               'dk'    : 'luk',
+               'no'    : 'lukk',
+               'lv'    : 'aizv&#275;rt',
+               'ja'    : '&#38281;&#12376;&#12427;',
+               'fi'    : 'sulje',
+               'ro'    : 'inchide',
+               'zh'    : '&#20851;&#32;&#38381',
+               'sv'    : 'st&#228;ng'
+       }),
+       
+       /* date manipulation */
+       _todayDate                              : new Date(),
+       _current_date                   : null,
+       _clickCallback                  : Prototype.emptyFunction,
+       _cellCallback                   : Prototype.emptyFunction,
+       _id_datepicker                  : null,
+       _disablePastDate                : false,
+       _disableFutureDate      : false,
+       _oneDayInMs                             : 24 * 3600 * 1000,
+       
+       /* positionning */
+       _topOffset                              : 20,
+       _leftOffset                             : 0,
+       _isPositionned                  : false,
+       _relativePosition       : true,
+       _setPositionTop                 : 0,
+       _setPositionLeft                : 0,
+       _bodyAppend                             : false,
+       
+       /* Effects Adjustment */
+       _showEffect                             : "appear", 
+       _showDuration                   : 1,
+       _enableShowEffect       : true,
+       _closeEffect                    : "fade", 
+       _closeEffectDuration    : 0.3,
+       _enableCloseEffect      : true,
+       _closeTimer                             : null,
+       _enableCloseOnBlur      : false,
+       
+       /* afterClose                   : called when the close function is executed */
+       _afterClose                             : Prototype.emptyFunction,
+       
+       /* return the name of current month in appropriate language */
+       getMonthLocale                  : function ( month ) {
+               return this._language_month.get(this._language)[month];
+       },
+       getLocaleClose                  : function () {
+               return this._language_close.get(this._language);
+       },
+       _initCurrentDate : function () {
+               
+               /* Create the DateFormatter */
+               this._df = new DatePickerFormatter(this._dateFormat[0], this._dateFormat[1]);
+               
+               /* check if value in field is proper, if not set to today */
+               this._current_date = $F(this._relative);
+               
+               if (! this._df.match(this._current_date)) {
+                       
+                       this._current_date = this._df.current_date();
+                       
+                       /* set the field value ? */
+                       if (!this._keepFieldEmpty)
+                               $(this._relative).value = this._current_date;
+               }
+               var a_date = this._df.match(this._current_date);
+               this._current_year      = Number(a_date[0]);
+               this._current_mon               = Number(a_date[1]) - 1;
+               this._current_day               = Number(a_date[2]);
+       },
+       /* init */
+       initialize      : function ( h_p ) {
+
+               /* arguments */
+               this._relative= h_p["relative"];
+               if (h_p["language"])
+                       this._language = h_p["language"];
+               this._zindex = ( h_p["zindex"] ) ? parseInt(Number(h_p["zindex"])) : 999;
+               if (!Object.isUndefined(h_p["keepFieldEmpty"]))
+                       this._keepFieldEmpty    = h_p["keepFieldEmpty"];
+               if (Object.isFunction(h_p["clickCallback"])) 
+                       this._clickCallback = h_p["clickCallback"];
+               if (!Object.isUndefined(h_p["leftOffset"]))
+                       this._leftOffset = parseInt(h_p["leftOffset"]);
+               if (!Object.isUndefined(h_p["topOffset"]))
+                       this._topOffset = parseInt(h_p["topOffset"]);
+               if (!Object.isUndefined(h_p["relativePosition"]))
+                       this._relativePosition = h_p["relativePosition"];
+               if (!Object.isUndefined(h_p["showEffect"]))
+                       this._showEffect = h_p["showEffect"];
+               if (!Object.isUndefined(h_p["enableShowEffect"]))
+                       this._enableShowEffect = h_p["enableShowEffect"];
+               if (!Object.isUndefined(h_p["showDuration"]))
+                       this._showDuration = h_p["showDuration"];
+               if (!Object.isUndefined(h_p["closeEffect"]))
+                       this._closeEffect = h_p["closeEffect"];
+               if (!Object.isUndefined(h_p["enableCloseEffect"]))
+                       this._enableCloseEffect = h_p["enableCloseEffect"];
+               if (!Object.isUndefined(h_p["closeEffectDuration"]))
+                       this._closeEffectDuration = h_p["closeEffectDuration"];
+               if (Object.isFunction(h_p["afterClose"]))
+                       this._afterClose = h_p["afterClose"];
+               if (!Object.isUndefined(h_p["externalControl"]))
+                       this._externalControl = h_p["externalControl"];
+               if (!Object.isUndefined(h_p["dateFormat"])) 
+                       this._dateFormat = h_p["dateFormat"];
+               if (Object.isFunction(h_p["cellCallback"]))
+                       this._cellCallback = h_p["cellCallback"];
+               this._setPositionTop    = ( h_p["setPositionTop"] ) ? parseInt(Number(h_p["setPositionTop"])) : 0;
+               this._setPositionLeft = ( h_p["setPositionLeft"] ) ? parseInt(Number(h_p["setPositionLeft"])) : 0;
+               if (!Object.isUndefined(h_p["enableCloseOnBlur"]) && h_p["enableCloseOnBlur"])
+                       this._enableCloseOnBlur = true;
+               if (!Object.isUndefined(h_p["disablePastDate"]) && h_p["disablePastDate"])
+                       this._disablePastDate = true;
+               if (!Object.isUndefined(h_p["disableFutureDate"]) && !h_p["disableFutureDate"])
+                       this._disableFutureDate = false;
+                       
+               this._id_datepicker                             = 'datepicker-'+ this._relative;
+               this._id_datepicker_prev                = this._id_datepicker +'-prev';
+               this._id_datepicker_prev_year   = this._id_datepicker +'-prev-year';
+               this._id_datepicker_next                = this._id_datepicker +'-next';
+               this._id_datepicker_next_year   = this._id_datepicker +'-next-year';
+               this._id_datepicker_hdr                 = this._id_datepicker +'-header';
+               this._id_datepicker_ftr                 = this._id_datepicker +'-footer';
+
+               /* build up calendar skel */
+               this._div = new Element('div', { 
+                       id                      : this._id_datepicker,
+                       className       : 'datepicker',
+                       style           : 'display: none; z-index:'+ this._zindex });
+   
+//             this._div.innerHTML = '<table><thead><tr><th width="10px" id="'+ this._id_datepicker_prev +'" style="cursor: pointer;">&nbsp;&lt;&lt;&nbsp;</th><th id="'+ this._id_datepicker_hdr +'" colspan="5"></th><th width="10px" id="'+ this._id_datepicker_next +'" style="cursor: pointer;">&nbsp;&gt;&gt;&nbsp;</th></tr></thead><tbody id="'+ this._id_datepicker +'-tbody"></tbody><tfoot><td colspan="7" id="'+ this._id_datepicker_ftr +'"></td></tfoot></table>';
+               this._div.innerHTML = '<div class="datepicker-header"><table class="header" cellspacing="0"><tr><td id="'+ this._id_datepicker_prev_year +'" class="prev_year"> << </td><td id="'+ this._id_datepicker_prev +'" class="prev"> < </td><td id="'+ this._id_datepicker_hdr +'" class="header"></td><td id="'+ this._id_datepicker_next +'" class="next"> > </td><td id="'+ this._id_datepicker_next_year +'" class="next_year"> >> </td></tr></table></div><div class="datepicker-calendar"><table class="body"><tbody id="'+ this._id_datepicker +'-tbody"></tbody></table></div><div id="'+ this._id_datepicker_ftr +'" class="datepicker-footer"></div>';
+               
+               /* Build the datepicker icon */
+               var datepickeropener = Builder.node('table',{className : "datepicker-opener-table"});
+
+               var con = Builder.node('tr',{},[
+                   Builder.node('td',{className : "datepicker-opener", id : "datepicker-opener-"+ this._relative})
+               ]);
+               // insert into TBODY
+               if (datepickeropener.childNodes[0] != undefined) {
+                       datepickeropener.childNodes[0].appendChild(con);
+               } else {
+                       datepickeropener.appendChild(con);
+               }
+       
+               Event.observe(datepickeropener,'click', this.click.bindAsEventListener(this), false);
+       
+               this.insertAfter($(this._relative).parentNode,datepickeropener,$(this._relative));
+               /* End Build the datepicker icon */
+       
+               /* finally declare the event listener on input field */
+               //Event.observe(this._relative, 'click', this.click.bindAsEventListener(this), false);
+               
+               /* need to append on body when doc is loaded for IE */
+               document.observe('dom:loaded', this.load.bindAsEventListener(this), false);
+  
+               /* automatically close when blur event is triggered */
+               if ( this._enableCloseOnBlur ) {
+                       Event.observe(this._relative, 'blur', function (e) { 
+                               this._closeTimer = this.close.bind(this).delay(1); 
+                       }.bindAsEventListener(this));
+                       Event.observe(this._div, 'click', function (e) { 
+                               if (this._closeTimer) { 
+                                       window.clearTimeout(this._closeTimer); 
+                                       this._closeTimer = null; 
+                               } 
+                       });
+               }
+       },
+       
+       /**
+        * load : called when document is fully-loaded to append datepicker
+        *                to main object.
+        */
+       load : function () {
+  
+               /* if externalControl defined set the observer on it */
+               if (this._externalControl) 
+                       Event.observe(this._externalControl, 'click', this.click.bindAsEventListener(this), false);
+               
+               /* append to page */
+               if (this._relativeAppend) {
+               
+                       /* append to parent node */
+                       if ($(this._relative).parentNode) {
+                               this._div.innerHTML = this._wrap_in_iframe(this._div.innerHTML);
+                               $(this._relative).parentNode.appendChild( this._div );
+                       }
+               } else {
+                       
+                       /* append to body */
+                       var body        = document.getElementsByTagName("body").item(0);
+                       if (body) {
+                               this._div.innerHTML = this._wrap_in_iframe(this._div.innerHTML);
+                               body.appendChild(this._div);
+                       }
+                       if ( this._relativePosition ) {
+                               var a_pos = Element.cumulativeOffset($(this._relative));
+                               this.setPosition(a_pos[1], a_pos[0]);
+                       } else {
+                               if (this._setPositionTop || this._setPositionLeft)
+                                       this.setPosition(this._setPositionTop, this._setPositionLeft);
+                       }
+               }
+               /* init the date in field if needed */
+               this._initCurrentDate();
+               
+               /* set the close locale content */
+               $(this._id_datepicker_ftr).innerHTML = this.getLocaleClose();
+  
+               /* declare the observers for UI control */
+               Event.observe($(this._id_datepicker_prev),              'click', this.prevMonth.bindAsEventListener(this), false);
+               Event.observe($(this._id_datepicker_prev_year), 'click', this.prevYear.bindAsEventListener(this),       false);
+               Event.observe($(this._id_datepicker_next),              'click', this.nextMonth.bindAsEventListener(this), false);
+               Event.observe($(this._id_datepicker_next_year), 'click', this.nextYear.bindAsEventListener(this),       false);
+               Event.observe($(this._id_datepicker_ftr),                       'click', this.close.bindAsEventListener(this),          false);
+               
+       },
+       
+       insertAfter : function(parent, node, referenceNode) {
+               parent.insertBefore(node, referenceNode.nextSibling);
+       },
+       
+       /* hack for buggy form elements layering in IE */
+       _wrap_in_iframe : function ( content ) {
+               return  ( Prototype.Browser.IE ) ? "<div style='height:167px;width:185px;background-color:white;align:left'><iframe width='100%' height='100%' marginwidth='0' marginheight='0' frameborder='0' src='about:blank' style='filter:alpha(Opacity=50);'></iframe><div style='position:absolute;background-color:white;top:2px;left:2px;width:180px'>" + content + "</div></div>" : content;
+       },
+       
+       /**
+        * visible      : return the visibility status of the datepicker.
+        */
+       visible : function () {
+               return $(this._id_datepicker).visible();
+       },
+       
+       /**
+        * click        : called when input element is clicked
+        */
+       click   : function () {
+       
+               /* init the datepicker if it doesn't exists */
+               if ( $(this._id_datepicker) == null ) this.load();
+               if (!this._isPositionned && this._relativePosition) {
+                       /* position the datepicker relatively to element */
+                       var a_lt = Element.positionedOffset($(this._relative));
+                       $(this._id_datepicker).setStyle({
+                               'left'  : Number(a_lt[0]+this._leftOffset)+'px',
+                               'top'   : Number(a_lt[1]+this._topOffset)+'px'
+                       });
+                       this._isPositionned     = true;
+               }
+               if (!this.visible()) {
+                       this._initCurrentDate();
+                       this._redrawCalendar();
+               }
+  
+               /* eval the clickCallback function */
+               eval(this._clickCallback());
+               
+               /* Effect toggle to fade-in / fade-out the datepicker */
+               if ( this._enableShowEffect ) {
+                       new Effect.toggle(this._id_datepicker, this._showEffect, { duration: this._showDuration });
+               } else {
+                       $(this._id_datepicker).show();
+               }
+       },
+       /**
+        * close        : called when the datepicker is closed
+        */
+       close           : function () {
+               if ( this._enableCloseEffect ) {
+                       switch(this._closeEffect) {
+                               case 'puff': 
+                                       new Effect.Puff(this._id_datepicker, { duration : this._closeEffectDuration });
+                               break;
+                               case 'blindUp': 
+                                       new Effect.BlindUp(this._id_datepicker, { duration : this._closeEffectDuration });
+                               break;
+                               case 'dropOut': 
+                                       new Effect.DropOut(this._id_datepicker, { duration : this._closeEffectDuration }); 
+                               break;
+                               case 'switchOff': 
+                                       new Effect.SwitchOff(this._id_datepicker, { duration : this._closeEffectDuration }); 
+                               break;
+                               case 'squish': 
+                                       new Effect.Squish(this._id_datepicker, { duration : this._closeEffectDuration });
+                               break;
+                               case 'fold': 
+                                       new Effect.Fold(this._id_datepicker, { duration : this._closeEffectDuration });
+                               break;
+                               case 'shrink': 
+                                       new Effect.Shrink(this._id_datepicker, { duration : this._closeEffectDuration });
+                               break;
+                               default: 
+                                       new Effect.Fade(this._id_datepicker, {  duration : this._closeEffectDuration });
+                               break;
+                       };
+               } else {
+                       $(this._id_datepicker).hide();
+               }
+               eval(this._afterClose());
+       },
+       
+       /**
+        * setDateFormat
+        */
+       setDateFormat : function ( format, separator ) {
+               if (Object.isUndefined(format))
+                       format = this._dateFormat[0];
+               if (Object.isUndefined(separator))
+                       separator = this._dateFormat[1];
+               this._dateFormat = [ format, separator ];
+       },
+       
+       /**
+        * setPosition  : set the position of the datepicker.
+        *  param : t=top | l=left
+        */
+       setPosition     : function ( t, l ) {
+               var h_pos = { 'top' : '0px', 'left' : '0px' };
+               if (!Object.isUndefined(t))
+                       h_pos['top'] = Number(t) + this._topOffset +'px';
+               if (!Object.isUndefined(l))
+                       h_pos['left']= Number(l) + this._leftOffset +'px';
+               $(this._id_datepicker).setStyle(h_pos);
+               this._isPositionned = true;
+       },
+       
+       /**
+        * _getMonthDays : given the year and month find the number of days.
+        */
+       _getMonthDays : function ( year, month ) {
+               if (((0 == (year%4)) && ((0 != (year%100)) || (0 == (year%400)))) && (month == 1))
+                       return 29;
+               return this._daysInMonth[month];
+       },
+       
+       /**
+        * _buildCalendar       : draw the days array for current date
+        */
+       _buildCalendar : function () {
+               
+               var _self = this;
+               var tbody = $(this._id_datepicker +'-tbody');
+               try {
+                       while ( tbody.hasChildNodes() )
+                       tbody.removeChild(tbody.childNodes[0]);
+               } catch ( e ) {};
+
+               /* generate day headers */
+               var trDay = new Element('tr');
+               this._language_day.get(this._language).each( function ( item ) {
+                       var td = new Element('td');
+                       td.innerHTML = item;
+                       td.className = 'wday';
+                       trDay.appendChild( td );
+               });
+               tbody.appendChild( trDay );
+       
+               /* generate the content of days */
+       
+               /* build-up days matrix */
+               var a_d = [
+                       [ 0, 0, 0, 0, 0, 0, 0 ],
+                       [ 0, 0, 0, 0, 0, 0, 0 ],
+                       [ 0, 0, 0, 0, 0, 0, 0 ],
+                       [ 0, 0, 0, 0, 0, 0, 0 ],
+                       [ 0, 0, 0, 0, 0, 0, 0 ],
+                       [ 0, 0, 0, 0, 0, 0, 0 ]
+               ];
+               
+               /* set date at beginning of month to display */
+               var d   = new Date(this._current_year, this._current_mon, 1, 12);
+               
+               /* start the day list on monday */
+               var startIndex  = ( !d.getDay() ) ? 6 : d.getDay() - 1;
+               var nbDaysInMonth       = this._getMonthDays(
+               this._current_year, this._current_mon);
+               var daysIndex = 1;
+               
+               for ( var j = startIndex; j < 7; j++ ) {
+                       a_d[0][j] = { 
+                               d : daysIndex,
+                               m : this._current_mon,
+                               y : this._current_year 
+                       };
+                       daysIndex++;
+               }
+               
+               var a_prevMY = this._prevMonthYear();
+               var nbDaysInMonthPrev = this._getMonthDays(a_prevMY[1], a_prevMY[0]);
+               for ( var j = 0; j < startIndex; j++ ) {
+                       a_d[0][j] = { 
+                               d : Number(nbDaysInMonthPrev - startIndex + j + 1),
+                               m : Number(a_prevMY[0]),
+                               y : a_prevMY[1],
+                               c : 'outbound'
+                       };
+               }
+               var switchNextMonth = false;
+               var currentMonth = this._current_mon;
+               var currentYear = this._current_year;
+               for ( var i = 1; i < 6; i++ ) {
+                       for ( var j = 0; j < 7; j++ ) {
+                               a_d[i][j] = { 
+                                       d : daysIndex,
+                                       m : currentMonth,
+                                       y : currentYear,
+                                       c : ( switchNextMonth ) ? 'outbound' : (((daysIndex == this._todayDate.getDate()) && (this._current_mon  == this._todayDate.getMonth()) && (this._current_year == this._todayDate.getFullYear())) ? 'today' : null)
+                               };
+                               daysIndex++;
+                               
+                               /* if at the end of the month : reset counter */
+                               if (daysIndex > nbDaysInMonth ) {
+                                       daysIndex = 1;
+                                       switchNextMonth = true;
+                                       if (this._current_mon + 1 > 11 ) {
+                                               currentMonth = 0;
+                                               currentYear += 1;
+                                       } else {
+                                               currentMonth += 1;
+                                       }
+                               }
+                       }
+               }
+               
+               /* generate days for current date */
+               for ( var i = 0; i < 6; i++ ) {
+                       var tr = new Element('tr');
+                       for ( var j = 0; j < 7; j++ ) {
+                               var h_ij        = a_d[i][j];
+                               var td = new Element('td');
+                               
+                               /* id is : datepicker-day-mon-year or depending on language other way */
+                               /* don't forget to add 1 on month for proper formmatting */
+                               var id = $A([
+                                       this._relative,
+                                       this._df.date_to_string(h_ij["y"], h_ij["m"]+1, h_ij["d"], '-')
+                               ]).join('-');
+                               
+                               /* set id and classname for cell if exists */
+                               td.setAttribute('id', id);
+                               if (h_ij["c"])
+                                       td.className    = h_ij["c"];
+                                       
+                               /* on onclick : rebuild date value from id of current cell */
+                               var _curDate = new Date();
+                               
+                               _curDate.setFullYear(h_ij["y"], h_ij["m"], h_ij["d"]);
+                               if ( this._disablePastDate || this._disableFutureDate ) {
+                                       if ( this._disablePastDate ) {
+                                               var _res        = ( _curDate >= this._todayDate ) ? true : false;
+                                               this._bindCellOnClick( td, true, _res, h_ij["c"] );
+                                       }
+                                       if ( this._disableFutureDate ) {
+                                               var _res        = ( this._todayDate.getTime() + this._oneDayInMs > _curDate.getTime() ) ? true : false;
+                                               this._bindCellOnClick( td, true, _res,  h_ij["c"] );
+                                       }
+                               } else {
+                                       this._bindCellOnClick( td, false );
+                               }
+                               td.innerHTML= h_ij["d"];
+                               tr.appendChild( td );
+                       }
+                       tbody.appendChild( tr );
+               }
+               return  tbody;
+       },
+
+       /**
+        * _bindCellOnClick     : bind the cell onclick depending on status.
+        */
+       _bindCellOnClick : function ( td, wcompare, compareresult, h_ij_c ) {
+               var doBind      = false;
+               if ( wcompare ) {
+                       if ( compareresult ) {
+                               doBind  = true;
+                       } else {
+                               td.className= ( h_ij_c ) ? 'nclick_outbound' : 'nclick';
+                       }
+               } else {
+                       doBind = true;
+               }
+               if ( doBind ) {
+                       var _self = this;
+                       td.onclick = function () { 
+                       $(_self._relative).value = String($(this).readAttribute('id')).replace(_self._relative+'-','').replace(/-/g, _self._df.separator);
+       
+                       /* if we have a cellCallback defined call it and pass it the cell */
+                       if (_self._cellCallback)
+                               _self._cellCallback(this);
+                       _self.close(); 
+                       };
+               }
+       },
+       /**
+        * nextMonth    : redraw the calendar content for next month.
+        */
+       _nextMonthYear  : function () {
+               var c_mon       = this._current_mon;
+               var c_year      = this._current_year;
+               if (c_mon + 1 > 11) {
+                       c_mon   = 0;
+                       c_year  += 1;
+               } else {
+                       c_mon   += 1;
+               }
+               return [ c_mon, c_year ];
+       },
+       nextMonth : function () {
+               var a_next              = this._nextMonthYear();
+               var _nextMon    = a_next[0];
+               var _nextYear   = a_next[1];
+               var _curDate    = new Date();
+               _curDate.setFullYear(_nextYear, _nextMon, 1);
+               var _res        = ( this._todayDate.getTime() + this._oneDayInMs > _curDate.getTime() ) ? true : false;
+               if ( this._disableFutureDate && !_res )
+                       return;
+               this._current_mon       = _nextMon;
+               this._current_year = _nextYear;
+               this._redrawCalendar();
+       },
+       
+       _nextYear : function () {
+               var c_mon       = this._current_mon;
+               var c_year      = this._current_year;
+               c_year  += 1;
+               return [ c_mon, c_year ];
+       },
+       
+       nextYear        : function () {
+               var a_next = this._nextYear();
+               this._current_mon       = a_next[0];
+               this._current_year = a_next[1];
+               this._redrawCalendar();
+       },
+
+       /**
+       * prevMonth     : redraw the calendar content for previous month.
+       */
+       _prevMonthYear  : function () {
+               var c_mon       = this._current_mon;
+               var c_year      = this._current_year;
+               if (c_mon - 1 < 0) {
+                       c_mon   = 11;
+                       c_year  -= 1;
+               } else {
+                       c_mon   -= 1;
+               }
+               return [ c_mon, c_year ];
+       },
+       prevMonth : function () {
+               var a_prev              = this._prevMonthYear();
+               var _prevMon    = a_prev[0];
+               var _prevYear   = a_prev[1];
+               var _curDate    = new Date();
+               _curDate.setFullYear(_prevYear, _prevMon, 1);
+               var _res        = ( _curDate >= this._todayDate ) ? true : false;
+               if ( this._disablePastDate && !_res )
+                       return;
+               this._current_mon       = _prevMon;
+               this._current_year = _prevYear;
+               this._redrawCalendar();
+       },
+       
+       _prevYear : function () {
+               var c_mon       = this._current_mon;
+               var c_year      = this._current_year;
+               c_year  -= 1;
+               return [ c_mon, c_year ];
+       },
+
+       prevYear        : function () {
+               var a_prev = this._prevYear();
+               this._current_mon       = a_prev[0];
+               this._current_year = a_prev[1];
+               this._redrawCalendar();
+       },
+       
+       _redrawCalendar : function () {
+               this._setLocaleHdr();
+               this._buildCalendar();
+       },
+       
+       _setLocaleHdr : function () {
+               
+               /* prev year link */
+               var a_prevy = this._prevYear();
+               $(this._id_datepicker_prev_year).setAttribute('title', this.getMonthLocale(a_prevy[0]) +' '+ a_prevy[1]);
+               
+               /* prev link */
+               var a_prev = this._prevMonthYear();
+               $(this._id_datepicker_prev).setAttribute('title', this.getMonthLocale(a_prev[0]) +' '+ a_prev[1]);
+               
+               /* next link */
+               var a_next = this._nextMonthYear();
+               $(this._id_datepicker_next).setAttribute('title', this.getMonthLocale(a_next[0]) +' '+ a_next[1]);
+               
+               /* next year link */
+               var a_nexty = this._nextYear();
+               $(this._id_datepicker_next_year).setAttribute('title', this.getMonthLocale(a_nexty[0]) +' '+ a_nexty[1]);
+               
+               /* header */
+               $(this._id_datepicker_hdr).update('&nbsp;&nbsp;&nbsp;'+ this.getMonthLocale(this._current_mon) +'&nbsp;'+ this._current_year +'&nbsp;&nbsp;&nbsp;');
+       }
+};
index 18f3564b2a2a4f115587e570b8ac0737fb894a6a..34e0279d4cdb58a3aa42935a8ec9512510850e06 100644 (file)
@@ -91,6 +91,7 @@ function displayLogin()
   }
   $smarty->assign("msg_dialogs", msg_dialog::get_dialogs());
   $smarty->assign("iePngWorkaround", $config->get_cfg_value("iePngWorkaround","false" ) == "true");
+  $smarty->assign("usePrototype", "false");
   $smarty->display (get_template_path('headers.tpl'));
   $smarty->assign("version",get_gosa_version());
   $smarty->display(get_template_path('login.tpl'));
index d5ef67d4af9902a5d05488eed40293c94df3ec84..a29726d59babb7ad83e91a7c6978333066f6f633 100644 (file)
@@ -81,6 +81,7 @@ if (isset($_GET['request'])){
 
     /* Else notice that the user has to close the browser... */
     $smarty->assign("iePngWorkaround", FALSE);
+    $smarty->assign("usePrototype", "false");
     $smarty->display (get_template_path('headers.tpl'));
     $smarty->display (get_template_path('logout-close.tpl'));
     exit;
@@ -91,6 +92,7 @@ if (isset($_GET['request'])){
 
 }else{  // The logout wasn't forced, so the session is invalid 
   
+  $smarty->assign("usePrototype", "false");
   $smarty->display (get_template_path('headers.tpl'));
   $smarty->display (get_template_path('logout.tpl'));
   exit;
index e002b9339366c0fd87b78639a721e8d7419c41d2..66e16eb94ba5775cce4ad8a1e94a07fb620b522c 100644 (file)
@@ -304,6 +304,7 @@ $smarty->assign ("menu", $plist->menu);
 $smarty->assign ("plug", "$plug");
 
 $smarty->assign("iePngWorkaround", $config->get_cfg_value("iePngWorkaround","false" ) == "true");
+$smarty->assign("usePrototype", "false");
 $header= "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
 
 /* React on clicks */
index 5a1242346a8baab2243846a94a92039221a89c3e..03f5cc2786ec85debe3fcb8a423b7e624d53db6b 100644 (file)
@@ -638,7 +638,7 @@ p.gosaLoginHeader {
        font-size:14px;
        font-weight:bold;
        margin-bottom:15px;
-} 
+}
 
 p.gosaLoginWarning {
        text-align:center;
@@ -668,7 +668,7 @@ p.gosaAccountExpiredHeader {
   font-size:14px;
   font-weight:bold;
   margin-bottom:15px;
-} 
+}
 
 table.framework {
        height:100%;
@@ -826,7 +826,7 @@ div.setup_plug_header_container {
 }
 
 /* Setup content container */
-div.setup_contents_container { 
+div.setup_contents_container {
 }
 
 /* Setup footer */
@@ -953,7 +953,7 @@ div.navigation_info {
 
 
 /*
-       Setup step 2 styles 
+       Setup step 2 styles
 */
 
 /* used to hide display info div */
@@ -967,19 +967,19 @@ div.solution_visible {
 h2.step2_container_title {
        background-color:#F0F0F0;
        border: solid 1px #CCCCCC;
-       width:100%; 
+       width:100%;
        padding:3px;
 }
 
 /* Container for name and status */
-div.step2_entry_container { 
+div.step2_entry_container {
        padding:3px;
-       width:99%; 
+       width:99%;
        cursor:default;
 }
 
 /* Container for name and status, when status is failed */
-div.step2_entry_container_info { 
+div.step2_entry_container_info {
        padding:3px;
        border: 1px solid #AAAAAA;
        width:99%;
@@ -1020,19 +1020,19 @@ div.step2_successful {
 
 /* Text used in info div. */
 div.step2_failed_text {
-       background-repeat: no-repeat;     
+       background-repeat: no-repeat;
        padding-left: 25px;
 }
 
 /* Text used in info div. On warnings */
 div.step2_warning_text{
-       background-repeat: no-repeat;     
+       background-repeat: no-repeat;
        padding-left: 25px;
 }
 
 
 /*
-       Setup step 4 styles 
+       Setup step 4 styles
 */
 
 li.step4_name, div.step4_name {
@@ -1056,13 +1056,13 @@ ul.step4_container, div.step4_container {
 
 
 /************************
- * Sieve 
- *  The following styles are 
- *  used to display the sieve 
- *  management user interface  
+ * Sieve
+ *  The following styles are
+ *  used to display the sieve
+ *  management user interface
  ************************/
 
-/* Editing dialog styles 
+/* Editing dialog styles
  */
 
 table.sieve_default_table {
@@ -1089,18 +1089,18 @@ td.editing_surface_menu {
 
 /* Editing surface content */
 td.editing_surface_content {
-       background-color: #FFFFFF; 
+       background-color: #FFFFFF;
        margin: 0px;
        padding:0px;
 }
 
 /* Error message will be displayed as follows */
-div.sieve_error_msgs { 
+div.sieve_error_msgs {
        background-color: #ff8d00;
        color: #000000;
        padding:5px;
-       background-image: url("images/warning.png"); 
-       background-repeat: no-repeat;     
+       background-image: url(images/warning.png);
+       background-repeat: no-repeat;
        font-weight: bold;
 }
 
@@ -1112,11 +1112,11 @@ textarea.editing_source {
 
 
 /*************
- * Object container  
+ * Object container
  *************/
 
 /* The container itself */
-table.object_container_container { 
+table.object_container_container {
        width:100%;
        border-spacing: 0px ;
        background-color: #F8F8F8;
@@ -1125,29 +1125,29 @@ table.object_container_container {
 
 /* Container cell top left */
 td.object_container_cell_top_left {
-       background-color: #EEE; 
-       text-align:center; 
+       background-color: #EEE;
+       text-align:center;
 }
 
 /* Container cell top right */
 td.object_container_cell_top_right {
-       background-color: #EEE; 
-       text-align:left; 
-       padding:2px;  
+       background-color: #EEE;
+       text-align:left;
+       padding:2px;
        border-bottom: solid 1px #AAAAAA;
 }
 
 /* Container cell bottom left */
 td.object_container_cell_bottom_left {
-       width:5px; 
-       background-color: #EEE; 
-       text-align:center; 
+       width:5px;
+       background-color: #EEE;
+       text-align:center;
        border-right: solid 1px #AAAAAA;
 }
 
 
 /*************
- * Sieve comment 
+ * Sieve comment
  *************/
 
 /* Container */
@@ -1167,7 +1167,7 @@ textarea.sieve_comment_area {
 
 
 /*************
- * Sieve require 
+ * Sieve require
  *************/
 
 /* Container */
@@ -1187,7 +1187,7 @@ input.sieve_require_input {
 
 
 /*************
- * Sieve fileinto 
+ * Sieve fileinto
  *************/
 
 /* Container */
@@ -1209,7 +1209,7 @@ select.sieve_fileinto_input {
 
 
 /*************
- * Sieve keep 
+ * Sieve keep
  *************/
 
 /* Container */
@@ -1228,7 +1228,7 @@ td.sieve_keep_input {
 
 
 /*************
- * Sieve discard 
+ * Sieve discard
  *************/
 
 /* Container */
@@ -1247,7 +1247,7 @@ td.sieve_discard_input {
 
 
 /*************
- * Sieve redirect 
+ * Sieve redirect
  *************/
 
 /* Container */
@@ -1264,7 +1264,7 @@ td.sieve_redirect_input {
        padding-left:20px;
 }
 textarea.sieve_redirect_input {
-       width:100%; 
+       width:100%;
        height:30px;
 }
 
@@ -1287,13 +1287,13 @@ td.sieve_reject_input {
        padding-left:20px;
 }
 textarea.sieve_reject_input {
-       width:100%; 
+       width:100%;
        height:55px;
 }
 
 
 /*************
- * Sieve end 
+ * Sieve end
  *************/
 
 /* Container */
@@ -1312,7 +1312,7 @@ td.sieve_stop_input {
 
 
 /*************
- * Sieve vacation 
+ * Sieve vacation
  *************/
 
 /* Container */
@@ -1337,7 +1337,7 @@ textarea.sieve_vacation_input {
 
 
 /*************
- * Sieve allof 
+ * Sieve allof
  *************/
 
 table.sieve_allof_container {
@@ -1359,11 +1359,11 @@ td.sieve_allof_left {
 
 /* Container */
 td.sieve_allof_right {
-       background-color:#BDBDBD ; 
+       background-color:#BDBDBD ;
 }
 
 /*************
- * Sieve anyof 
+ * Sieve anyof
  *************/
 
 table.sieve_anyof_container {
@@ -1385,12 +1385,12 @@ td.sieve_anyof_left {
 
 /* Container */
 td.sieve_anyof_right {
-       background-color:#BDBDBD ; 
+       background-color:#BDBDBD ;
        border: solid 1px #AAAAAA;
 }
 
 /*************
- * Sieve Test Cases  
+ * Sieve Test Cases
  *************/
 
 table.sieve_test_container {
@@ -1539,12 +1539,12 @@ td.container_:hover,div.container_:hover {
 }
 
 div.errorMsgTitle {
-       width:100%; 
+       width:100%;
        font-size: 1.4em;
        padding-bottom:0.3em;
        padding-top:0.3em;
        font-weight:bold;
-       background-color: #F0F0F0; 
+       background-color: #F0F0F0;
 }
 
 div.errorMsgDialog {
@@ -1595,47 +1595,47 @@ div.autocomplete li:hover{
 
 div.autocomplete ul li.selected { background-color: #F0F0F0;}
 
-#pulldown {                                                                                                                    
-        background: #FFFFFF;                                                                                                   
-        height: 23px;                                                                                                          
-        border-top: 1px #D0D0D0 solid;                                                                                         
-        border-left: 1px #D0D0D0 solid;                                                                                        
-        border-bottom: 1px #808080 solid;                                                                                      
-        border-right: 1px #808080 solid;                                                                                       
-}                                                                                                                              
+#pulldown {
+        background: #FFFFFF;
+        height: 23px;
+        border-top: 1px #D0D0D0 solid;
+        border-left: 1px #D0D0D0 solid;
+        border-bottom: 1px #808080 solid;
+        border-right: 1px #808080 solid;
+}
 
 #pulldown  ul {
         display: block;
-        margin: 0;     
-        padding: 0;    
+        margin: 0;
+        padding: 0;
         line-height: 1em;
         list-style: none;
-        z-index: 90      
-}                        
+        z-index: 90
+}
 
 #pulldown  ul li {
         float: left;
         margin: 0 3px 0 0;
-        padding: 0;       
-        font-size: 12px;  
+        padding: 0;
+        font-size: 12px;
         line-height: 1, 5em;
         list-style-type: none;
-}                             
+}
 
 #pulldown ul li a {
         float: left;
         display: block;
-        width: auto;   
+        width: auto;
         font-weight: normal;
         background: transparent;
-        text-decoration: none;  
-        margin: 0;              
+        text-decoration: none;
+        margin: 0;
         padding: 5px 5px 5px 5px;
-}                                
+}
 
 #pulldown  ul li a:hover {
         text-decoration: none;
-}                             
+}
 
 #pulldown  ul li.sep {
         color: #AAA;
@@ -1677,3 +1677,175 @@ div.autocomplete ul li.selected { background-color: #F0F0F0;}
         background-color: #418DD4;
         background-image: none;
 }
+
+div.datepicker {
+        position:absolute;
+        text-align:center;
+        border: 1px #C4D5E3 solid;
+        font-family:arial;
+        background:#FFF;
+        font-size:10px;
+        padding:0;
+}
+div.datepicker-calendar table {
+        font-size:10px;
+        border:1px solid #FFF;
+        margin:0;
+        padding:0;
+        text-align:center;
+}
+div.datepicker div.datepicker-header {
+        font-size:11px;
+        font-weight:bold;
+        background:#E9F5FF;
+        border-bottom:1px solid #CCE9FF;
+        padding:2px;
+        text-align:center;
+}
+div.datepicker table.header {
+        width:175px;
+        border:0;
+        padding:0;
+        text-align:center;
+}
+td.prev,
+td.prev_year,
+td.next,
+td.next_year {
+        width:8%;
+        color:#F7B72E;
+        cursor:pointer;
+        font-weight:bold;
+        line-height:16px;
+}
+td.prev:hover,
+td.prev_year:hover,
+td.next:hover,
+td.next_year:hover {
+        color:#FF6600;
+}
+td.header {
+        text-align:center;
+        width:68%;
+        font-weight:bold;
+        line-height:16px;
+}
+div.datepicker-header {
+        height:16px;
+}
+div.datepicker-calendar table tbody tr {
+        border:1px solid #FFF;
+        margin:0;
+        padding:0;
+}
+div.datepicker-calendar table tbody tr td {
+        border:1px #EAEAEA solid;
+        margin:0;
+        padding:0;
+        text-align:center;
+        height:16px;
+        line-height:16px;
+        width:21px;
+        cursor:pointer;
+}
+div.datepicker-calendar table tbody tr td:hover,
+div.datepicker-calendar table tbody tr td.outbound:hover,
+div.datepicker-calendar table tbody tr td.today:hover {
+        border:1px #CCE9FF solid;
+        background:#E9F5FF;
+        cursor:pointer;
+}
+div.datepicker-calendar table tbody tr td.wday {
+        border:1px #CCE8FE solid;
+        background:#E9F5FF;
+        cursor:text;
+        width:21px;
+        height:16px;
+        line-height:16px;
+        font-weight:bold;
+}
+div.datepicker-calendar table tbody tr td.outbound {
+        background:#F4F3F3;
+}
+div.datepicker-calendar table tbody tr td.today {
+        border:1px #CCE9FF solid;
+        background:#E9F5FF;
+        background-image:url(images/date_active.gif);
+        background-repeat:no-repeat;
+        position:top left;
+        width:21px;
+        height:16px;
+        line-height:16px;
+}
+div.datepicker-calendar table tbody tr td.today:hover {
+        border:1px #CCE9FF solid;
+        background:#E9F5FF;
+        background-image:url(images/date_active.gif);
+        background-repeat:no-repeat;
+        position:top left;
+}
+div.datepicker-calendar table tbody tr td.nclick,
+div.datepicker-calendar table tbody tr td.nclick_outbound {
+        cursor:default;
+        color:#aaa;
+        width:21px;
+        height:16px;
+        line-height:16px;
+}
+div.datepicker-calendar table tbody tr td.nclick_outbound {
+        background:#E8E4E4;
+        width:21px;
+        height:16px;
+        line-height:16px;
+}
+div.datepicker-calendar table tbody tr td.nclick:hover,
+div.datepicker-calendar table tbody tr td.nclick_outbound:hover {
+        border:1px #EAEAEA solid;
+        background:#FFF;
+}
+div.datepicker-calendar table tbody tr td.nclick_outbound:hover {
+        background:#E8E4E4;
+}
+div.datepicker div.datepicker-footer {
+        font-size:10px;
+        background:#E9F5FF;
+        border-top:1px solid #CCE9FF;
+        cursor:pointer;
+        text-align:center;
+        padding:2px;
+}
+
+.date {
+        float:left;
+        border:1px solid #CCE9FF;
+        font-size:11px;
+        font-family:arial;
+        padding:1px;
+}
+.datepicker-opener-table {
+        border:none;
+        padding:0;
+        border-spacing:0;
+        margin:0 0 0 3px;
+        background:transparent url(images/datepicker.gif) no-repeat 0 0;
+        width:16px;
+        height:16px;
+        cursor:pointer;
+}
+.Opera .datepicker-opener-table {
+        float:right;
+}
+.IE7 .datepicker-opener-table {
+        position:relative;
+        top:0;
+        left:3px;
+}
+.datepicker-opener-table:hover {
+        background:transparent url(images/gfx/datepicker_ro.gif) no-repeat 0 0;
+}
+.datepicker-opener {
+        width:16px;
+        height:16px;
+        margin:0 0 0 3px;
+        cursor:pointer;
+}
index c446ae927ddb46bb0213b9eefe2d636a0e23b215..49dbbbd08cc020b9aa6ef7b1aa29021370f9af20 100644 (file)
   <script language="javascript" src="include/layersmenu-browser_detection.js" type="text/javascript"></script>
   <script language="javascript" src="include/layersmenu-library.js" type="text/javascript"></script>
   <script language="javascript" src="include/layersmenu.js" type="text/javascript"></script>
+{if $usePrototype == 'true'}
   <script language="javascript" src="include/prototype.js" type="text/javascript"></script>
   <script language="javascript" src="include/scriptaculous.js" type="text/javascript"></script>
   <script language="javascript" src="include/effects.js" type="text/javascript"></script>
   <script language="javascript" src="include/controls.js" type="text/javascript"></script>
   <script language="javascript" src="include/pulldown.js" type="text/javascript"></script>
+  <script language="javascript" src="include/datepicker.js" type="text/javascript"></script>
+{/if}
 </head>
 
index 8139214dfb19efb0e0a962a14f7ed576f2568f2a..c2c0207488580a2194fbda192ca38537f2ada145 100644 (file)
@@ -408,6 +408,7 @@ class listing {
     $result.= "</table></div>";
 
     $smarty= get_smarty();
+    $smarty->assign("usePrototype", "true");
     $smarty->assign("FILTER", $this->filter->render());
     $smarty->assign("SIZELIMIT", print_sizelimit_warning());
     $smarty->assign("LIST", $result);