From: <fxp...@us...> - 2010-04-15 14:54:16
|
Revision: 5969 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=5969&view=rev Author: fxprunayre Date: 2010-04-15 14:54:09 +0000 (Thu, 15 Apr 2010) Log Message: ----------- Fixed #208. Added a calendar XSL template with ref, date and format parameters to be used instead of merging JS calendar setup in XSL. Use this template and call the initCalendar function. Applied to iso19139 and iso19110 editor. Fix encoding issues in some calendar i18n files. Move some CSS from XSL to geonetwork.css for calendar. Modified Paths: -------------- trunk/web/geonetwork/geonetwork.css trunk/web/geonetwork/scripts/calendar/lang/calendar-de.js trunk/web/geonetwork/scripts/calendar/lang/calendar-es.js trunk/web/geonetwork/scripts/calendar/lang/calendar-fr.js trunk/web/geonetwork/scripts/calendar/lang/calendar-ru.js trunk/web/geonetwork/scripts/editor/metadata-editor.js trunk/web/geonetwork/scripts/lib/gn.editor.js trunk/web/geonetwork/xsl/edit.xsl trunk/web/geonetwork/xsl/metadata-controls.xsl trunk/web/geonetwork/xsl/metadata-iso19110.xsl trunk/web/geonetwork/xsl/metadata-iso19139.xsl Modified: trunk/web/geonetwork/geonetwork.css =================================================================== --- trunk/web/geonetwork/geonetwork.css 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/geonetwork.css 2010-04-15 14:54:09 UTC (rev 5969) @@ -708,6 +708,18 @@ { } +img.calendar { + cursor: pointer; + background:none; + vertical-align: middle; + margin-left: 2px; + margin-right: 2px; +} +img.calendar:hover { + background:red; +} + + /* This will fix some redraw problems with gn setting */ .calendar table , .calendar tr , Modified: trunk/web/geonetwork/scripts/calendar/lang/calendar-de.js =================================================================== --- trunk/web/geonetwork/scripts/calendar/lang/calendar-de.js 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/scripts/calendar/lang/calendar-de.js 2010-04-15 14:54:09 UTC (rev 5969) @@ -1 +1,10 @@ -// ** I18N // Calendar DE language // Author: Jack (tR), <ja...@jt...> // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names Calendar._DN = new Array ("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names Calendar._SDN = new Array ("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. Calendar._FD = 0; // full month names Calendar._MN = new Array ("Januar", "Februar", "Marz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"); // short month names Calendar._SMN = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"); // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "Über dieses Kalendarmodul"; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this ;-) "For latest version visit: http://www.dynarch.com/projects/calendar/\n" + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + "\n\n" + "Datum auswählen:\n" + "- Benutzen Sie die \xab, \xbb Buttons um das Jahr zu wählen\n" + "- Benutzen Sie die " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " Buttons um den Monat zu wählen\n" + "- Für eine Schnellauswahl halten Sie die Maustaste über diesen Buttons fest."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Zeit auswählen:\n" + "- Klicken Sie auf die Teile der Uhrzeit, um diese zu erhöhen\n" + "- oder klicken Sie mit festgehaltener Shift-Taste um diese zu verringern\n" + "- oder klicken und festhalten für Schnellauswahl."; Calendar._TT["TOGGLE"] = "Ersten Tag der Woche wählen"; Calendar._TT["PREV_YEAR"] = "Voriges Jahr (Festhalten für Schnellauswahl)"; Calendar._TT["PREV_MONTH"] = "Voriger Monat (Festhalten für Schnellauswahl)"; Calendar._TT["GO_TODAY"] = "Heute ausw\u00e4hlen"; Calendar._TT["NEXT_MONTH"] = "Nächst. Monat (Festhalten für Schnellauswahl)"; Calendar._TT["NEXT_YEAR"] = "Nächst. Jahr (Festhalten für Schnellauswahl)"; Calendar._TT["SEL_DATE"] = "Datum auswählen"; Calendar._TT["DRAG_TO_MOVE"] = "Zum Bewegen festhalten"; Calendar._TT["PART_TODAY"] = " (Heute)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. Calendar._TT["DAY_FIRST"] = "Woche beginnt mit %s "; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Schließen"; Calendar._TT["TODAY"] = "Heute"; Calendar._TT["TIME_PART"] = "(Shift-)Klick oder Festhalten und Ziehen um den Wert zu verändern"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; Calendar._TT["WK"] = "wk"; Calendar._TT["TIME"] = "Zeit:"; \ No newline at end of file +// ** I18N // Calendar DE language // Author: Jack (tR), <ja...@jt...> // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names +Calendar._DN = new Array ("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names +Calendar._SDN = new Array ("So", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. +Calendar._FD = 0; // full month names +Calendar._MN = new Array ("Januar", "Februar", "Marz", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"); // short month names +Calendar._SMN = new Array ("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"); // tooltips +Calendar._TT = {}; Calendar._TT["INFO"] = "Über dieses Kalendarmodul"; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + "For latest version visit: http://www.dynarch.com/projects/calendar/\n" + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + "\n\n" + "Datum auswählen:\n" + "- Benutzen Sie die \xab, \xbb Buttons um das Jahr zu wählen\n" + "- Benutzen Sie die " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " Buttons um den Monat zu wählen\n" + "- Für eine Schnellauswahl halten Sie die Maustaste über diesen Buttons fest."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Zeit auswählen:\n" + "- Klicken Sie auf die Teile der Uhrzeit, um diese zu erhöhen\n" + "- oder klicken Sie mit festgehaltener Shift-Taste um diese zu verringern\n" + "- oder klicken und festhalten für Schnellauswahl."; Calendar._TT["TOGGLE"] = "Ersten Tag der Woche wählen"; Calendar._TT["PREV_YEAR"] = "Voriges Jahr (Festhalten für Schnellauswahl)"; Calendar._TT["PREV_MONTH"] = "Voriger Monat (Festhalten für Schnellauswahl)"; Calendar._TT["GO_TODAY"] = "Heute ausw\u00e4hlen"; Calendar._TT["NEXT_MONTH"] = "Nächst. Monat (Festhalten für Schnellauswahl)"; Calendar._TT["NEXT_YEAR"] = "Nächst. Jahr (Festhalten für Schnellauswahl)"; Calendar._TT["SEL_DATE"] = "Datum auswählen"; Calendar._TT["DRAG_TO_MOVE"] = "Zum Bewegen festhalten"; Calendar._TT["PART_TODAY"] = " (Heute)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. +Calendar._TT["DAY_FIRST"] = "Woche beginnt mit %s "; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. +Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Schließen"; Calendar._TT["TODAY"] = "Heute"; Calendar._TT["TIME_PART"] = "(Shift-)Klick oder Festhalten und Ziehen um den Wert zu verändern"; // date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; Calendar._TT["WK"] = "wk"; Calendar._TT["TIME"] = "Zeit:"; Modified: trunk/web/geonetwork/scripts/calendar/lang/calendar-es.js =================================================================== --- trunk/web/geonetwork/scripts/calendar/lang/calendar-es.js 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/scripts/calendar/lang/calendar-es.js 2010-04-15 14:54:09 UTC (rev 5969) @@ -1 +1,10 @@ -// ** I18N // Calendar ES (spanish) language // Author: Mihai Bazon, <mih...@ya...> // Updater: Servilio Afre Puentes <ser...@ya...> // Updated: 2004-06-03 // Encoding: utf-8 // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names Calendar._DN = new Array ("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names Calendar._SDN = new Array ("Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb", "Dom"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. Calendar._FD = 0; // full month names Calendar._MN = new Array ("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); // short month names Calendar._SMN = new Array ("Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"); // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "Acerca del calendario"; Calendar._TT["ABOUT"] = "Selector DHTML de Fecha/Hora\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) "Para conseguir la última versión visite: http://www.dynarch.com/projects/calendar/\n" + "Distribuido bajo licencia GNU LGPL. Visite http://gnu.org/licenses/lgpl.html para más detalles." + "\n\n" + "Selección de fecha:\n" + "- Use los botones \xab, \xbb para seleccionar el año\n" + "- Use los botones " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para seleccionar el mes\n" + "- Mantenga pulsado el ratón en cualquiera de estos botones para una selección rápida."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Selección de hora:\n" + "- Pulse en cualquiera de las partes de la hora para incrementarla\n" + "- o pulse las mayúsculas mientras hace clic para decrementarla\n" + "- o haga clic y arrastre el ratón para una selección más rápida."; Calendar._TT["PREV_YEAR"] = "Año anterior (mantener para menú)"; Calendar._TT["PREV_MONTH"] = "Mes anterior (mantener para menú)"; Calendar._TT["GO_TODAY"] = "Ir a hoy"; Calendar._TT["NEXT_MONTH"] = "Mes siguiente (mantener para menú)"; Calendar._TT["NEXT_YEAR"] = "Año siguiente (mantener para menú)"; Calendar._TT["SEL_DATE"] = "Seleccionar fecha"; Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar para mover"; Calendar._TT["PART_TODAY"] = " (hoy)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. Calendar._TT["DAY_FIRST"] = "Hacer %s primer día de la semana"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Cerrar"; Calendar._TT["TODAY"] = "Hoy"; Calendar._TT["TIME_PART"] = "(Mayúscula-)Clic o arrastre para cambiar valor"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; Calendar._TT["TT_DATE_FORMAT"] = "%A, %e de %B de %Y"; Calendar._TT["WK"] = "sem"; Calendar._TT["TIME"] = "Hora:"; \ No newline at end of file +// ** I18N // Calendar ES (spanish) language // Author: Mihai Bazon, <mih...@ya...> // Updater: Servilio Afre Puentes <ser...@ya...> // Updated: 2004-06-03 // Encoding: utf-8 // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names +Calendar._DN = new Array ("Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado", "Domingo"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names +Calendar._SDN = new Array ("Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb", "Dom"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. +Calendar._FD = 0; // full month names +Calendar._MN = new Array ("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"); // short month names +Calendar._SMN = new Array ("Ene", "Feb", "Mar", "Abr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dic"); // tooltips +Calendar._TT = {}; Calendar._TT["INFO"] = "Acerca del calendario"; Calendar._TT["ABOUT"] = "Selector DHTML de Fecha/Hora\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + "Para conseguir la última versión visite: http://www.dynarch.com/projects/calendar/\n" + "Distribuido bajo licencia GNU LGPL. Visite http://gnu.org/licenses/lgpl.html para más detalles." + "\n\n" + "Selección de fecha:\n" + "- Use los botones \xab, \xbb para seleccionar el año\n" + "- Use los botones " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " para seleccionar el mes\n" + "- Mantenga pulsado el ratón en cualquiera de estos botones para una selección rápida."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Selección de hora:\n" + "- Pulse en cualquiera de las partes de la hora para incrementarla\n" + "- o pulse las mayúsculas mientras hace clic para decrementarla\n" + "- o haga clic y arrastre el ratón para una selección más rápida."; Calendar._TT["PREV_YEAR"] = "Año anterior (mantener para menú)"; Calendar._TT["PREV_MONTH"] = "Mes anterior (mantener para menú)"; Calendar._TT["GO_TODAY"] = "Ir a hoy"; Calendar._TT["NEXT_MONTH"] = "Mes siguiente (mantener para menú)"; Calendar._TT["NEXT_YEAR"] = "Año siguiente (mantener para menú)"; Calendar._TT["SEL_DATE"] = "Seleccionar fecha"; Calendar._TT["DRAG_TO_MOVE"] = "Arrastrar para mover"; Calendar._TT["PART_TODAY"] = " (hoy)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. +Calendar._TT["DAY_FIRST"] = "Hacer %s primer día de la semana"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. +Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Cerrar"; Calendar._TT["TODAY"] = "Hoy"; Calendar._TT["TIME_PART"] = "(Mayúscula-)Clic o arrastre para cambiar valor"; // date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; Calendar._TT["TT_DATE_FORMAT"] = "%A, %e de %B de %Y"; Calendar._TT["WK"] = "sem"; Calendar._TT["TIME"] = "Hora:"; Modified: trunk/web/geonetwork/scripts/calendar/lang/calendar-fr.js =================================================================== --- trunk/web/geonetwork/scripts/calendar/lang/calendar-fr.js 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/scripts/calendar/lang/calendar-fr.js 2010-04-15 14:54:09 UTC (rev 5969) @@ -1 +1,13 @@ -// ** I18N // Calendar EN language // Author: Mihai Bazon, <mih...@ya...> // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // Translator: David Duret, <pi...@ma...> from previous french version // full day names Calendar._DN = new Array ("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names Calendar._SDN = new Array ("Dim", "Lun", "Mar", "Mar", "Jeu", "Ven", "Sam", "Dim"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. Calendar._FD = 0; // full month names Calendar._MN = new Array ("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"); // short month names Calendar._SMN = new Array ("Jan", "Fev", "Mar", "Avr", "Mai", "Juin", "Juil", "Aout", "Sep", "Oct", "Nov", "Dec"); // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "A propos du calendrier"; Calendar._TT["ABOUT"] = "DHTML Date/Heure Selecteur\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) "Pour la derniere version visitez : http://www.dynarch.com/projects/calendar/\n" + "Distribué par GNU LGPL. Voir http://gnu.org/licenses/lgpl.html pour les details." + "\n\n" + "Selection de la date :\n" + "- Utiliser les bouttons \xab, \xbb pour selectionner l\'annee\n" + "- Utiliser les bouttons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pour selectionner les mois\n" + "- Garder la souris sur n'importe quels boutons pour une selection plus rapide"; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Selection de l\'heure :\n" + "- Cliquer sur heures ou minutes pour incrementer\n" + "- ou Maj-clic pour decrementer\n" + "- ou clic et glisser-deplacer pour une selection plus rapide"; Calendar._TT["PREV_YEAR"] = "Année préc. (maintenir pour menu)"; Calendar._TT["PREV_MONTH"] = "Mois préc. (maintenir pour menu)"; Calendar._TT["GO_TODAY"] = "Atteindre la date du jour"; Calendar._TT["NEXT_MONTH"] = "Mois suiv. (maintenir pour menu)"; Calendar._TT["NEXT_YEAR"] = "Année suiv. (maintenir pour menu)"; Calendar._TT["SEL_DATE"] = "Sélectionner une date"; Calendar._TT["DRAG_TO_MOVE"] = "Déplacer"; Calendar._TT["PART_TODAY"] = " (Aujourd'hui)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. Calendar._TT["DAY_FIRST"] = "Afficher %s en premier"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Fermer"; Calendar._TT["TODAY"] = "Aujourd'hui"; Calendar._TT["TIME_PART"] = "(Maj-)Clic ou glisser pour modifier la valeur"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; Calendar._TT["WK"] = "Sem."; Calendar._TT["TIME"] = "Heure :"; \ No newline at end of file +// Calendar EN language // Author: Mihai Bazon, <mih...@ya...> // Encoding: any // Distributed under the same terms as the calendar itself. + // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // Translator: David Duret, <pi...@ma...> from previous french version + +// full day names +Calendar._DN = new Array ("Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names +Calendar._SDN = new Array ("Dim", "Lun", "Mar", "Mar", "Jeu", "Ven", "Sam", "Dim"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. +Calendar._FD = 0; // full month names +Calendar._MN = new Array ("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"); // short month names +Calendar._SMN = new Array ("Jan", "Fev", "Mar", "Avr", "Mai", "Juin", "Juil", "Aout", "Sep", "Oct", "Nov", "Dec"); // tooltips +Calendar._TT = {}; Calendar._TT["INFO"] = "A propos du calendrier"; Calendar._TT["ABOUT"] = "DHTML Date/Heure Selecteur\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + "Pour la derniere version visitez : http://www.dynarch.com/projects/calendar/\n" + "Distribué par GNU LGPL. Voir http://gnu.org/licenses/lgpl.html pour les details." + "\n\n" + "Selection de la date :\n" + "- Utiliser les bouttons \xab, \xbb pour selectionner l\'annee\n" + "- Utiliser les bouttons " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " pour selectionner les mois\n" + "- Garder la souris sur n'importe quels boutons pour une selection plus rapide"; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Selection de l\'heure :\n" + "- Cliquer sur heures ou minutes pour incrementer\n" + "- ou Maj-clic pour decrementer\n" + "- ou clic et glisser-deplacer pour une selection plus rapide"; Calendar._TT["PREV_YEAR"] = "Année préc. (maintenir pour menu)"; Calendar._TT["PREV_MONTH"] = "Mois préc. (maintenir pour menu)"; Calendar._TT["GO_TODAY"] = "Atteindre la date du jour"; Calendar._TT["NEXT_MONTH"] = "Mois suiv. (maintenir pour menu)"; Calendar._TT["NEXT_YEAR"] = "Année suiv. (maintenir pour menu)"; Calendar._TT["SEL_DATE"] = "Sélectionner une date"; Calendar._TT["DRAG_TO_MOVE"] = "Déplacer"; Calendar._TT["PART_TODAY"] = " (Aujourd'hui)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. +Calendar._TT["DAY_FIRST"] = "Afficher %s en premier"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. +Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Fermer"; Calendar._TT["TODAY"] = "Aujourd'hui"; Calendar._TT["TIME_PART"] = "(Maj-)Clic ou glisser pour modifier la valeur"; // date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%d/%m/%Y"; Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; Calendar._TT["WK"] = "Sem."; Calendar._TT["TIME"] = "Heure :"; Modified: trunk/web/geonetwork/scripts/calendar/lang/calendar-ru.js =================================================================== --- trunk/web/geonetwork/scripts/calendar/lang/calendar-ru.js 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/scripts/calendar/lang/calendar-ru.js 2010-04-15 14:54:09 UTC (rev 5969) @@ -1 +1,10 @@ -// ** I18N // Calendar RU language // Translation: Sly Golovanov, http://golovanov.net, <sl...@go...> // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names Calendar._DN = new Array ("воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота", "воскресенье"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names Calendar._SDN = new Array ("вск", "пон", "втр", "срд", "чет", "пят", "суб", "вск"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. Calendar._FD = 0; // full month names Calendar._MN = new Array ("январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"); // short month names Calendar._SMN = new Array ("янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"); // tooltips Calendar._TT = {}; Calendar._TT["INFO"] = "О календаре..."; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) "For latest version visit: http://www.dynarch.com/projects/calendar/\n" + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + "\n\n" + "Как выбрать дату:\n" + "- При помощи кнопок \xab, \xbb можно выбрать год\n" + "- При помощи кнопок " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " можно выбрать месяц\n" + "- Подержите эти кнопки нажатыми, чтобы появилось меню быстрого выбора."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Как выбрать время:\n" + "- При клике на часах или минутах они увеличиваются\n" + "- при клике с нажатой клавишей Shift они уменьшаются\n" + "- если нажать и двигать мышкой влево/вправо, они будут меняться быстрее."; Calendar._TT["PREV_YEAR"] = "На год назад (удерживать для меню)"; Calendar._TT["PREV_MONTH"] = "На месяц назад (удерживать для меню)"; Calendar._TT["GO_TODAY"] = "Сегодня"; Calendar._TT["NEXT_MONTH"] = "На месяц вперед (удерживать для меню)"; Calendar._TT["NEXT_YEAR"] = "На год вперед (удерживать для меню)"; Calendar._TT["SEL_DATE"] = "Выберите дату"; Calendar._TT["DRAG_TO_MOVE"] = "Перетаскивайте мышкой"; Calendar._TT["PART_TODAY"] = " (сегодня)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. Calendar._TT["DAY_FIRST"] = "Первый день недели будет %s"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Закрыть"; Calendar._TT["TODAY"] = "Сегодня"; Calendar._TT["TIME_PART"] = "(Shift-)клик или нажать и двигать"; // date formats Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; Calendar._TT["TT_DATE_FORMAT"] = "%e %b, %a"; Calendar._TT["WK"] = "нед"; Calendar._TT["TIME"] = "Время:"; \ No newline at end of file +// ** I18N // Calendar RU language // Translation: Sly Golovanov, http://golovanov.net, <sl...@go...> // Encoding: any // Distributed under the same terms as the calendar itself. // For translators: please use UTF-8 if possible. We strongly believe that // Unicode is the answer to a real internationalized world. Also please // include your contact information in the header, as can be seen above. // full day names +Calendar._DN = new Array ("воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота", "воскресенье"); // Please note that the following array of short day names (and the same goes // for short month names, _SMN) isn't absolutely necessary. We give it here // for exemplification on how one can customize the short day names, but if // they are simply the first N letters of the full name you can simply say: // // Calendar._SDN_len = N; // short day name length // Calendar._SMN_len = N; // short month name length // // If N = 3 then this is not needed either since we assume a value of 3 if not // present, to be compatible with translation files that were written before // this feature. // short day names +Calendar._SDN = new Array ("вск", "пон", "втр", "срд", "чет", "пят", "суб", "вск"); // First day of the week. "0" means display Sunday first, "1" means display // Monday first, etc. +Calendar._FD = 0; // full month names +Calendar._MN = new Array ("январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"); // short month names +Calendar._SMN = new Array ("янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"); // tooltips +Calendar._TT = {}; Calendar._TT["INFO"] = "О календаре..."; Calendar._TT["ABOUT"] = "DHTML Date/Time Selector\n" + "(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + "For latest version visit: http://www.dynarch.com/projects/calendar/\n" + "Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + "\n\n" + "Как выбрать дату:\n" + "- При помощи кнопок \xab, \xbb можно выбрать год\n" + "- При помощи кнопок " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " можно выбрать месяц\n" + "- Подержите эти кнопки нажатыми, чтобы появилось меню быстрого выбора."; Calendar._TT["ABOUT_TIME"] = "\n\n" + "Как выбрать время:\n" + "- При клике на часах или минутах они увеличиваются\n" + "- при клике с нажатой клавишей Shift они уменьшаются\n" + "- если нажать и двигать мышкой влево/вправо, они будут меняться быстрее."; Calendar._TT["PREV_YEAR"] = "На год назад (удерживать для меню)"; Calendar._TT["PREV_MONTH"] = "На месяц назад (удерживать для меню)"; Calendar._TT["GO_TODAY"] = "Сегодня"; Calendar._TT["NEXT_MONTH"] = "На месяц вперед (удерживать для меню)"; Calendar._TT["NEXT_YEAR"] = "На год вперед (удерживать для меню)"; Calendar._TT["SEL_DATE"] = "Выберите дату"; Calendar._TT["DRAG_TO_MOVE"] = "Перетаскивайте мышкой"; Calendar._TT["PART_TODAY"] = " (сегодня)"; // the following is to inform that "%s" is to be the first day of week // %s will be replaced with the day name. +Calendar._TT["DAY_FIRST"] = "Первый день недели будет %s"; // This may be locale-dependent. It specifies the week-end days, as an array // of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 // means Monday, etc. +Calendar._TT["WEEKEND"] = "0,6"; Calendar._TT["CLOSE"] = "Закрыть"; Calendar._TT["TODAY"] = "Сегодня"; Calendar._TT["TIME_PART"] = "(Shift-)клик или нажать и двигать"; // date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; Calendar._TT["TT_DATE_FORMAT"] = "%e %b, %a"; Calendar._TT["WK"] = "нед"; Calendar._TT["TIME"] = "Время:"; Modified: trunk/web/geonetwork/scripts/editor/metadata-editor.js =================================================================== --- trunk/web/geonetwork/scripts/editor/metadata-editor.js 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/scripts/editor/metadata-editor.js 2010-04-15 14:54:09 UTC (rev 5969) @@ -395,6 +395,8 @@ if (name == 'gmd:geographicElement' || name == 'gmd:polygon') extentMap.initMapDiv(); + initCalendar(); + // Check elements validateMetadataFields(); @@ -473,6 +475,7 @@ if (document.mainForm.showvalidationerrors.value=='true') getValidationReport(); setBunload(true); // reset warning for window destroy + initCalendar(); validateMetadataFields(); }, onFailure: function(req) { @@ -817,6 +820,32 @@ } /** + * Init all calendar input identified by class "calendar" + * @return + */ +function initCalendar() { + $$('input.calendar').each( function(input) { + var name = input['name']; + var format = $(name + '_format').value; + var showTime = (format.indexOf('T')==-1?false:true); + + // Init calendar for input field and calendar icon + Calendar.setup({ + inputField : name + "_cal", + ifFormat : format, + showsTime : showTime, + button : name + "_trigger" + }); + Calendar.setup({ + inputField : name + "_cal", + ifFormat : format, + showsTime : showTime, + button : name + "_cal" + }); + }); +} + +/** * Property: keywordSelectionWindow * The window in which we can select keywords */ Modified: trunk/web/geonetwork/scripts/lib/gn.editor.js =================================================================== --- trunk/web/geonetwork/scripts/lib/gn.editor.js 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/scripts/lib/gn.editor.js 2010-04-15 14:54:09 UTC (rev 5969) @@ -83,7 +83,7 @@ {var metadataId=document.mainForm.id.value;var pars="&id="+metadataId+"&ref="+ref+"&name="+name;if(child!=null) pars+="&child="+child;var thisElement=$(id);var myAjax=new Ajax.Request(getGNServiceURL(action),{method:'get',parameters:pars,onSuccess:function(req){var html=req.responseText;if(what=='replace'){thisElement.replace(html);}else if(what=='add'||what=='after'){thisElement.insert({'after':html});setAddControls(thisElement.next(),orElement);}else if(what=='before'){thisElement.insert({'before':html});setAddControls(thisElement.previous(),orElement);}else{alert("doNewElementAjax: invalid what: "+what+" should be one of replace, after or before.");} if(name=='gmd:geographicElement'||name=='gmd:polygon') -extentMap.initMapDiv();validateMetadataFields();setBunload(true);},onFailure:function(req){alert(translate("errorAddElement")+name+translate("errorFromDoc") +extentMap.initMapDiv();initCalendar();validateMetadataFields();setBunload(true);},onFailure:function(req){alert(translate("errorAddElement")+name+translate("errorFromDoc") +" / status "+req.status+" text: "+req.statusText+" - "+translate("tryAgain"));setBunload(true);}});} function disableEditForm() {var editorOverlay=new Element("div",{id:"editorOverlay"});$('editFormTable').insert({'top':editorOverlay});$('editorOverlay').setStyle({opacity:"0.65"});} @@ -93,7 +93,7 @@ if(action.include('finish')){var myAjax=new Ajax.Request(getGNServiceURL(action),{method:'post',parameters:$('editForm').serialize(true),onSuccess:function(req){var html=req.responseText;if(divToRestore)divToRestore.removeClassName('editing');if(html.startsWith("<?xml")<0){alert(translate("errorSaveFailed")+html);} setBunload(false);location.replace(getGNServiceURL('metadata.show?id='+metadataId));},onFailure:function(req){alert(translate("errorSaveFailed")+"/ status "+req.status+" text: "+req.statusText+" - "+translate("tryAgain"));$('editorBusy').hide();setBunload(true);}});}else{var w=Ext.getCmp('validationReportBox');if(w) w.destroy();var myAjax=new Ajax.Updater(document.body,getGNServiceURL(action),{method:'post',parameters:$('editForm').serialize(true),evalScripts:true,onComplete:function(req){if(document.mainForm.showvalidationerrors.value=='true') -getValidationReport();setBunload(true);validateMetadataFields();},onFailure:function(req){alert(translate("errorSaveFailed")+"/ status "+req.status+" text: "+req.statusText+" - "+translate("tryAgain"));$('editorBusy').hide();setBunload(true);}});}} +getValidationReport();setBunload(true);initCalendar();validateMetadataFields();},onFailure:function(req){alert(translate("errorSaveFailed")+"/ status "+req.status+" text: "+req.statusText+" - "+translate("tryAgain"));$('editorBusy').hide();setBunload(true);}});}} function doCancelAction(action,message) {if(confirm(message)){doSaveAction(action);return true;} return false;} @@ -148,6 +148,7 @@ function validateMetadataFields(){$$('select.lang_selector').each(function(input){for(i=0;i<input.options.length;i++) if(input.options[i].getAttribute("code").toLowerCase()==Env.lang) input.options[i].selected=true;enableLocalInput(input,false);});$$('input,textarea,select').each(function(input){validateMetadataField(input);});} +function initCalendar(){$$('input.calendar').each(function(input){var name=input['name'];var format=$(name+'_format').value;var showTime=(format.indexOf('T')==-1?false:true);Calendar.setup({inputField:name+"_cal",ifFormat:format,showsTime:showTime,button:name+"_trigger"});Calendar.setup({inputField:name+"_cal",ifFormat:format,showsTime:showTime,button:name+"_cal"});});} var keywordSelectionWindow;function showKeywordSelectionPanel(ref,name){if(!keywordSelectionWindow){var keywordSelectionPanel=new app.KeywordSelectionPanel({listeners:{keywordselected:function(panel,keywords){var id='_X'+this.ref+'_'+name.replace(":","COLON");var xml;var first=true;Ext.each(keywords,function(item,index){keywords[index]=item.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>","").replace(/\"/g,""").replace(/\r\n/g,"");if(first){xml=keywords[index];first=false;}else xml+="&&&"+keywords[index];});var input={tag:'input',type:'hidden',id:id,name:id,value:xml};var dh=Ext.DomHelper;dh.append(Ext.get("hiddenFormElements"),input);doAction('metadata.update');}}});keywordSelectionWindow=new Ext.Window({title:translate('keywordSelectionWindowTitle'),width:620,height:300,layout:'fit',items:keywordSelectionPanel,closeAction:'hide',constrain:true,iconCls:'searchIcon'});};keywordSelectionWindow.items.get(0).setRef(ref);keywordSelectionWindow.show();} var searchKeywordSelectionWindow;function showSearchKeywordSelectionPanel(){if(!searchKeywordSelectionWindow){var searchKeywordSelectionPanel=new app.KeywordSelectionPanel({listeners:{keywordselected:function(panel,keywords){var xml;var first=true;Ext.each(keywords,function(item,index){xml=keywords[index];var doc;if(window.ActiveXObject){var doc=new ActiveXObject("Microsoft.XMLDOM");doc.async="false";doc.loadXML(xml);}else{var doc=new DOMParser().parseFromString(xml,"text/xml");} Modified: trunk/web/geonetwork/xsl/edit.xsl =================================================================== --- trunk/web/geonetwork/xsl/edit.xsl 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/xsl/edit.xsl 2010-04-15 14:54:09 UTC (rev 5969) @@ -21,7 +21,7 @@ </xsl:choose> <xsl:apply-templates mode="script" select="/"/> </head> - <body onload="init();validateMetadataFields();"> + <body onload="init();initCalendar();validateMetadataFields();"> <table width="100%"> <!-- content --> Modified: trunk/web/geonetwork/xsl/metadata-controls.xsl =================================================================== --- trunk/web/geonetwork/xsl/metadata-controls.xsl 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/xsl/metadata-controls.xsl 2010-04-15 14:54:09 UTC (rev 5969) @@ -124,4 +124,29 @@ </span> </xsl:template> + <!-- Template to display a calendar with a clear button --> + <xsl:template name="calendar"> + <xsl:param name="ref"/> + <xsl:param name="date"/> + <xsl:param name="format" select="'%Y-%m-%d'"/> + + <table width="100%"> + <tr> + <td> + <input type="hidden" id="_{$ref}_format" value="{$format}"/> + <input class="md calendar" type="text" name="_{$ref}" id="_{$ref}_cal" value="{$date}" size="30" readonly="1"/> + + <img src="../../scripts/calendar/img.gif" + id="_{$ref}_trigger" + class="calendar" + title="Date selector"/> + + <a onclick="javascript:setBunload(false);" href="javascript:clearRef('{$ref}');"> + <xsl:value-of select="/root/gui/strings/clear"/> + </a> + </td> + </tr> + </table> + </xsl:template> + </xsl:stylesheet> Modified: trunk/web/geonetwork/xsl/metadata-iso19110.xsl =================================================================== --- trunk/web/geonetwork/xsl/metadata-iso19110.xsl 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/xsl/metadata-iso19110.xsl 2010-04-15 14:54:09 UTC (rev 5969) @@ -153,6 +153,29 @@ </xsl:template> + <!-- Element set on save by update-fixed-info. --> + <xsl:template mode="iso19110" match="gfc:versionDate" priority="2"> + <xsl:param name="schema"/> + <xsl:param name="edit"/> + + <xsl:apply-templates mode="simpleElement" select="."> + <xsl:with-param name="schema" select="$schema"/> + <xsl:with-param name="edit" select="false()"/> + <xsl:with-param name="text"> + <xsl:choose> + <xsl:when test="normalize-space(gco:*)=''"> + <span class="info"> + - <xsl:value-of select="/root/gui/strings/setOnSave"/> - + </span> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="gco:*"/> + </xsl:otherwise> + </xsl:choose> + </xsl:with-param> + </xsl:apply-templates> + </xsl:template> + <!-- ============================================================================= --> <!-- date (format = %Y-%m-%d) @@ -163,7 +186,7 @@ <!-- ============================================================================= --> <xsl:template mode="iso19110" - match="gfc:versionDate[gco:DateTime|gco:Date]|gmd:editionDate|gmd:dateOfNextUpdate" + match="gmd:editionDate|gmd:dateOfNextUpdate" priority="2"> <xsl:param name="schema"/> <xsl:param name="edit"/> @@ -176,70 +199,18 @@ <xsl:with-param name="text"> <xsl:variable name="ref" select="gco:Date/geonet:element/@ref|gco:DateTime/geonet:element/@ref"/> - - <table width="100%"> - <tr> - <td> - <xsl:choose> - <xsl:when test="gco:DateTime"> - <input class="md" type="text" name="_{$ref}" - id="_{$ref}_cal" value="{gco:DateTime/text()}" - size="30" readonly="1"/> - </xsl:when> - <xsl:otherwise> - <input class="md" type="text" name="_{$ref}" - id="_{$ref}_cal" value="{gco:Date/text()}" size="30" - readonly="1"/> - </xsl:otherwise> - </xsl:choose> - </td> - <td align="center" width="30" valign="middle"> - <img src="{/root/gui/url}/scripts/calendar/img.gif" - id="_{$ref}_trigger" - style="cursor: pointer; border: 1px solid;" - title="Date selector" - onmouseover="this.style.background='red';" - onmouseout="this.style.background=''"/> - <script type="text/javascript"> - Calendar.setup({ - inputField : "_<xsl:value-of select="$ref"/>_cal", // ID of the input field - <xsl:choose> - <xsl:when test="gco:Date"> - ifFormat : "%Y-%m-%d", - showsTime : false, - </xsl:when> - <xsl:otherwise> - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, // show the time - </xsl:otherwise> - </xsl:choose> - button: "_<xsl:value-of select="$ref"/>_trigger" - }); - Calendar.setup({ - inputField: "_<xsl:value-of select="$ref"/>_cal", - <xsl:choose> - <xsl:when test="gco:Date"> - ifFormat : "%Y-%m-%d", - showsTime : false, - </xsl:when> - <xsl:otherwise> - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, // show the time - </xsl:otherwise> - </xsl:choose> - button: "_<xsl:value-of select="$ref"/>_cal" - }); - </script> - </td> - <td align="left" width="100%"> - <xsl:text> </xsl:text> - <a onclick="javascript:setBunload(false);" - href="javascript:clearRef('{$ref}');"> - <xsl:value-of select="/root/gui/strings/clear"/> - </a> - </td> - </tr> - </table> + <xsl:variable name="format"> + <xsl:choose> + <xsl:when test="gco:Date"><xsl:text>%Y-%m-%d</xsl:text></xsl:when> + <xsl:otherwise><xsl:text>%Y-%m-%dT%H:%M:00</xsl:text></xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:call-template name="calendar"> + <xsl:with-param name="ref" select="$ref"/> + <xsl:with-param name="date" select="gco:DateTime/text()|gco:Date/text()"/> + <xsl:with-param name="format" select="$format"/> + </xsl:call-template> </xsl:with-param> </xsl:apply-templates> </xsl:when> Modified: trunk/web/geonetwork/xsl/metadata-iso19139.xsl =================================================================== --- trunk/web/geonetwork/xsl/metadata-iso19139.xsl 2010-04-15 12:53:26 UTC (rev 5968) +++ trunk/web/geonetwork/xsl/metadata-iso19139.xsl 2010-04-15 14:54:09 UTC (rev 5969) @@ -904,57 +904,19 @@ <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="text"> <xsl:variable name="ref" select="gco:Date/geonet:element/@ref|gco:DateTime/geonet:element/@ref"/> + <xsl:variable name="format"> + <xsl:choose> + <xsl:when test="gco:Date"><xsl:text>%Y-%m-%d</xsl:text></xsl:when> + <xsl:otherwise><xsl:text>%Y-%m-%dT%H:%M:00</xsl:text></xsl:otherwise> + </xsl:choose> + </xsl:variable> - <table width="100%"><tr> - <td> - <input class="md" type="text" name="_{$ref}" id="_{$ref}_cal" value="{gco:DateTime/text()|gco:Date/text()}" size="30" readonly="1"/> - </td> - <td align="center" width="30" valign="middle"> - <img src="{/root/gui/url}/scripts/calendar/img.gif" - id="_{$ref}_trigger" - style="cursor: pointer; border: 1px solid;" - title="Date selector" - onmouseover="this.style.background='red';" - onmouseout="this.style.background=''" /> - <script type="text/javascript"> - Calendar.setup( - { - inputField : "_<xsl:value-of select="$ref"/>_cal", // ID of the input field - <xsl:choose> - <xsl:when test="gco:Date"> - ifFormat : "%Y-%m-%d", - showsTime : false, - </xsl:when> - <xsl:otherwise> - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, // show the time - </xsl:otherwise> - </xsl:choose> - button : "_<xsl:value-of select="$ref"/>_trigger" // ID of the button - } - ); - Calendar.setup( - { - inputField : "_<xsl:value-of select="$ref"/>_cal", // ID of the input field - <xsl:choose> - <xsl:when test="gco:Date"> - ifFormat : "%Y-%m-%d", - showsTime : false, - </xsl:when> - <xsl:otherwise> - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, // show the time - </xsl:otherwise> - </xsl:choose> - button : "_<xsl:value-of select="$ref"/>_cal" // ID of the button - } - ); - </script> - </td> - <td align="left" width="100%"> - <xsl:text> </xsl:text><a onclick="javascript:setBunload(false);" href="javascript:clearRef('{$ref}');"> <xsl:value-of select="/root/gui/strings/clear"/></a> - </td> - </tr></table> + <xsl:call-template name="calendar"> + <xsl:with-param name="ref" select="$ref"/> + <xsl:with-param name="date" select="gco:DateTime/text()|gco:Date/text()"/> + <xsl:with-param name="format" select="$format"/> + </xsl:call-template> + </xsl:with-param> </xsl:apply-templates> </xsl:when> @@ -987,57 +949,19 @@ <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="text"> <xsl:variable name="ref" select="gco:DateTime/geonet:element/@ref|gco:Date/geonet:element/@ref"/> + <xsl:variable name="format"> + <xsl:choose> + <xsl:when test="gco:Date"><xsl:text>%Y-%m-%d</xsl:text></xsl:when> + <xsl:otherwise><xsl:text>%Y-%m-%dT%H:%M:00</xsl:text></xsl:otherwise> + </xsl:choose> + </xsl:variable> - <table width="100%"><tr> - <td> - <input class="md" type="text" name="_{$ref}" id="_{$ref}_cal" value="{gco:DateTime/text()|gco:Date/text()}" size="30" readonly="1"/> - </td> - <td align="center" width="30" valign="middle"> - <img src="{/root/gui/url}/scripts/calendar/img.gif" - id="_{$ref}_trigger" - style="cursor: pointer; border: 1px solid;" - title="Date selector" - onmouseover="this.style.background='red';" - onmouseout="this.style.background=''" /> - <script type="text/javascript"> - Calendar.setup( - { - inputField : "_<xsl:value-of select="$ref"/>_cal", // ID of the input field - <xsl:choose> - <xsl:when test="gco:DateTime"> - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, // Show the time - </xsl:when> - <xsl:otherwise> - ifFormat : "%Y-%m-%d", // the date format - showsTime : false, // Do not show the time - </xsl:otherwise> - </xsl:choose> - button : "_<xsl:value-of select="$ref"/>_trigger" // ID of the button - } - ); - Calendar.setup( - { - inputField : "_<xsl:value-of select="$ref"/>_cal", // ID of the input field - <xsl:choose> - <xsl:when test="gco:DateTime"> - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, // Show the time - </xsl:when> - <xsl:otherwise> - ifFormat : "%Y-%m-%d", // the date format - showsTime : false, // Do not show the time - </xsl:otherwise> - </xsl:choose> - button : "_<xsl:value-of select="$ref"/>_cal" // ID of the button - } - ); - </script> - </td> - <td align="left" width="100%"> - <xsl:text> </xsl:text><a onclick="javascript:setBunload(false);" href="javascript:clearRef('{$ref}');"> <xsl:value-of select="/root/gui/strings/clear"/></a> - </td> - </tr></table> + <xsl:call-template name="calendar"> + <xsl:with-param name="ref" select="$ref"/> + <xsl:with-param name="date" select="gco:DateTime/text()|gco:Date/text()"/> + <xsl:with-param name="format" select="$format"/> + </xsl:call-template> + </xsl:with-param> </xsl:apply-templates> </xsl:when> @@ -1065,42 +989,14 @@ <xsl:with-param name="edit" select="$edit"/> <xsl:with-param name="text"> <xsl:variable name="ref" select="geonet:element/@ref"/> + <xsl:variable name="format"><xsl:text>%Y-%m-%dT%H:%M:00</xsl:text></xsl:variable> - <table width="100%"><tr> - <td> - <input class="md" type="text" name="_{$ref}" id="_{$ref}_cal" value="{text()}" size="30" readonly="1"/> - </td> - <td align="center" width="30" valign="middle"> - <img src="{/root/gui/url}/scripts/calendar/img.gif" - id="_{$ref}_trigger" - style="cursor: pointer; border: 1px solid;" - title="Date selector" - onmouseover="this.style.background='red';" - onmouseout="this.style.background=''" /> - <script type="text/javascript"> - Calendar.setup( - { - inputField : "_<xsl:value-of select="$ref"/>_cal", // ID of the input field - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, - button : "_<xsl:value-of select="$ref"/>_trigger" // ID of the button - } - ); - Calendar.setup( - { - inputField : "_<xsl:value-of select="$ref"/>_cal", // ID of the input field - ifFormat : "%Y-%m-%dT%H:%M:00", // the date format - showsTime : true, - button : "_<xsl:value-of select="$ref"/>_cal" // ID of the button - } - ); - </script> - </td> - <td align="left" width="100%"> - <xsl:text> </xsl:text><a onclick="javascript:setBunload(false);" href="javascript:clearRef('{$ref}');"> <xsl:value-of select="/root/gui/strings/clear"/></a> - </td> - </tr></table> - + <xsl:call-template name="calendar"> + <xsl:with-param name="ref" select="$ref"/> + <xsl:with-param name="date" select="text()"/> + <xsl:with-param name="format" select="$format"/> + </xsl:call-template> + <xsl:if test="@indeterminatePosition"> <xsl:apply-templates mode="simpleElement" select="@indeterminatePosition"> <xsl:with-param name="schema" select="$schema"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ... [truncated message content] |