Skip to content

Commit

Permalink
bug #2780356 [calendar] Null checkbox not unchecked when date is chosen
Browse files Browse the repository at this point in the history
  • Loading branch information
lem9 committed Apr 29, 2009
1 parent 6c61d6c commit 0857205
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,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,
Expand Down
11 changes: 9 additions & 2 deletions js/tbl_change.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down Expand Up @@ -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();
}
4 changes: 3 additions & 1 deletion tbl_change.php
Original file line number Diff line number Diff line change
Expand Up @@ -1045,11 +1045,13 @@ class="textfield" <?php echo $unnullify_trigger; ?>
<?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>');
Expand Down
2 changes: 1 addition & 1 deletion tbl_select.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class="textfield" />
?>
<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
Expand Down

0 comments on commit 0857205

Please sign in to comment.