bug #2780356 [calendar] Null checkbox not unchecked when date is chosen

This commit is contained in:
Marc Delisle
2009-04-29 17:26:27 +00:00
parent 7cafb834fa
commit 302c517763
4 changed files with 14 additions and 4 deletions

View File

@@ -62,6 +62,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
- patch #2739001 [export] XML does not allow spaces in element names,
thanks to Derek Schaefer - drummingds1
- bug #2780722 [import] Incorrect maximum file size
- bug #2780356 [calendar] Null checkbox not unchecked when date is chosen
3.1.4.0 (2009-04-25)
+ patch #1808339 [doc] Apache SSLOptions and StdEnvVars FAQ,

View File

@@ -90,13 +90,17 @@ var clock_set = 0;
*
* @param string calendar.php parameters
* @param string form name
* @param string field name
* @param string id of field name
* @param string edit type - date/timestamp
* @param string id of the corresponding checkbox for NULL
*/
function openCalendar(params, form, field, type) {
function openCalendar(params, form, field, type, fieldNull) {
window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
dateField = eval("document." + form + "." + field);
dateType = type;
if (fieldNull != '') {
dateFieldNull = eval("document." + form + "." + fieldNull);
}
}
/**
@@ -345,5 +349,8 @@ function returnDate(d) {
}
window.opener.dateField.value = txt;
if (typeof(window.opener.dateFieldNull) != 'undefined') {
window.opener.dateFieldNull.checked = false;
}
window.close();
}

View File

@@ -1051,11 +1051,13 @@ foreach ($rows as $row_id => $vrow) {
<?php
}
if ($field['pma_type'] == 'date' || $field['pma_type'] == 'datetime' || substr($field['pma_type'], 0, 9) == 'timestamp') {
// the _3 suffix points to the date field
// the _2 suffix points to the corresponding NULL checkbox
?>
<script type="text/javascript">
//<![CDATA[
document.write('<a title="<?php echo $strCalendar;?>"');
document.write(' href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($idindex); ?>_3\', \'<?php echo (substr($field['pma_type'], 0, 9) == 'timestamp') ? 'datetime' : substr($field['pma_type'], 0, 9); ?>\')">');
document.write(' href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($idindex); ?>_3\', \'<?php echo (substr($field['pma_type'], 0, 9) == 'timestamp') ? 'datetime' : substr($field['pma_type'], 0, 9); ?>\', \'field_<?php echo ($idindex); ?>_2\')">');
document.write('<img class="calendar"');
document.write(' src="<?php echo $pmaThemeImage; ?>b_calendar.png"');
document.write(' alt="<?php echo $strCalendar; ?>"/></a>');

View File

@@ -233,7 +233,7 @@ while (list($operator) = each($GLOBALS['cfg']['UnaryOperators'])) {
?>
<script type="text/javascript">
//<![CDATA[
document.write('<a title="<?php echo $strCalendar;?>" href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($i); ?>\', \'<?php echo (substr($type, 0, 9) == 'timestamp') ? 'datetime' : substr($type, 0, 9); ?>\')"><img class="calendar" src="<?php echo $pmaThemeImage; ?>b_calendar.png" alt="<?php echo $strCalendar; ?>"/></a>');
document.write('<a title="<?php echo $strCalendar;?>" href="javascript:openCalendar(\'<?php echo PMA_generate_common_url();?>\', \'insertForm\', \'field_<?php echo ($i); ?>\', \'<?php echo (substr($type, 0, 9) == 'timestamp') ? 'datetime' : substr($type, 0, 9); ?>\', \'\')"><img class="calendar" src="<?php echo $pmaThemeImage; ?>b_calendar.png" alt="<?php echo $strCalendar; ?>"/></a>');
//]]>
</script>
<?php