View Issue Details

IDProjectCategoryView StatusLast Update
0009923mantisbtbugtrackerpublic2014-11-20 16:54
Reportermthibeault Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version1.2.0a2 
Summary0009923: Calendar position is unrelated to the control it modifies.
Description

The calendar position seems unbound by any controls so it wanders far away from the calling container. In the past, there has been times where I completely lost the calendar on screen.

TagsNo tags attached.
Attached Files
calendar_position.diff (2,724 bytes)   
diff -N -a --unified -r mantisbt/bug_change_status_page.php mantisbt-calendar_position/bug_change_status_page.php
--- mantisbt/bug_change_status_page.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-calendar_position/bug_change_status_page.php	2008-12-01 13:26:09.285884800 -0500
@@ -179,7 +179,7 @@
 	<td>
 	<?php
 	    print "<input ".helper_get_tab_index()." type=\"text\" id=\"due_date\" name=\"due_date\" size=\"20\" maxlength=\"10\" value=\"".$t_date_to_display."\">";
-		date_print_calendar();
+		date_print_calendar( "due_date", "due_date_calendar_trigger" );
 	?>
 	</td>
 </tr>
diff -N -a --unified -r mantisbt/bug_report_advanced_page.php mantisbt-calendar_position/bug_report_advanced_page.php
--- mantisbt/bug_report_advanced_page.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-calendar_position/bug_report_advanced_page.php	2008-12-01 13:26:36.128088600 -0500
@@ -237,7 +237,7 @@
 	<td>
 	<?php
 	    print "<input ".helper_get_tab_index()." type=\"text\" id=\"due_date\" name=\"due_date\" size=\"20\" maxlength=\"10\" value=\"".$t_date_to_display."\">";
-		date_print_calendar();
+		date_print_calendar( "due_date", "due_date_calendar_trigger" );
 	?>
 	</td>
 </tr>
diff -N -a --unified -r mantisbt/core/date_api.php mantisbt-calendar_position/core/date_api.php
--- mantisbt/core/date_api.php	2008-11-30 14:16:41.000000000 -0500
+++ mantisbt-calendar_position/core/date_api.php	2008-12-01 13:27:02.814051400 -0500
@@ -165,8 +165,7 @@
 # prints calendar icon and adds required javascript files.
 # button_name is name of button that will display calendar icon
 # in caste there are more than one calendar on page
-function date_print_calendar( $p_button_name = 'trigger' ) {
-
+function date_print_calendar ( $p_field_name, $p_button_name = 'trigger' ) {
 	# @@@ (thraxisp) this may want a browser check  ( MS IE >= 5.0, Mozilla >= 1.0, Safari >=1.2, ...)
 	if(( ON == config_get( 'dhtml_filters' ) ) && ( ON == config_get( 'use_javascript' ) ) ) {
 		echo "<style type=\"text/css\">@import url(javascript/jscalendar/calendar-blue.css);</style>\n";
@@ -180,7 +179,19 @@
 		$t_format = config_get( 'short_date_format' );
 		$t_new_format = str_replace( '-', '-%', $t_format );
 		$t_format = "%" . $t_new_format;
-		echo "\" onClick=\"return showCalendar ('sel1', '" . $t_format . "', 24, true)\" />";
+		#echo "\" onClick=\"return showCalendar ('sel1', '".$t_format."', 24, true)\" />";
+		echo "\" />";
+		?>
+<script type="text/javascript">
+Calendar.setup(
+	{
+		inputField : "<?php echo $p_field_name; ?>", // ID of the input field
+		ifFormat : "<?php echo $t_format; ?>", // the date format
+		button : "<?php echo $p_button_name; ?>" // ID of the button
+	}
+);
+</script>
+		<?php
 	}
 }
 
calendar_position.diff (2,724 bytes)   

Activities

mthibeault

mthibeault

2008-12-01 13:34

reporter   ~0020176

Patch added. The calendar was called using a method that was really different from the one specified in the calendar control docs. Also, it was not bound to any control at all which would explain the wandering.
Against the latest GIT commit (a09b9e7c3b9c0cce7ade7c6dba57c8a0d84af669).

atrol

atrol

2014-11-07 17:23

developer   ~0041791

This issue is not reproducible with the current version of MantisBT.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem persists, do not hesitate to reopen the issue, with additional relevant information.

[1] http://www.mantisbt.org/download.php