[evolvis-commits] r17572: #1858 Fixed. Bug was caused by bad programming habits. detail form got now an id (tracker_details) and notepad_button function uses getElementById('tracker_details') instead of the hardcoded forms[1] statement.

messer at evolvis.org messer at evolvis.org
Tue Sep 27 19:38:44 CEST 2011


Author: messer
Date: 2011-09-27 19:38:44 +0200 (Tue, 27 Sep 2011)
New Revision: 17572

Modified:
   branches/evolvis-me/www/notepad.php
   branches/evolvis-me/www/tracker/detail.php
   branches/evolvis-me/www/tracker/mod-limited.php
   branches/evolvis-me/www/tracker/mod.php
Log:
#1858 Fixed. Bug was caused by bad programming habits. detail form got now an id (tracker_details) and notepad_button function uses getElementById('tracker_details') instead of the hardcoded forms[1] statement.

Modified: branches/evolvis-me/www/notepad.php
===================================================================
--- branches/evolvis-me/www/notepad.php	2011-09-27 09:56:49 UTC (rev 17571)
+++ branches/evolvis-me/www/notepad.php	2011-09-27 17:38:44 UTC (rev 17572)
@@ -47,7 +47,9 @@
 }
 $pform = '';
 if ($form) {
-        $pform = "opener.".$form;
+        //Remove special charackter \" and replace with "
+        $form = str_replace('\\', '', $form);
+        $pform = "window.opener.".$form;
 }
 ?>
 
@@ -56,12 +58,15 @@
     <title>FusionForge Notepad</title>
    <script language="JavaScript" type="text/javascript">
    <!-- 
+    
     function load_initial_value() {
         try {
             aform = <?php echo $pform ?>;
             document.forms[0].details.value = aform.value;
+            //document.forms[0].details.value = window.opener.document.getElementById('tracker_details').details.value;
        
         } catch (e) {
+            alert(e.toString());
         }
     }
 
@@ -70,6 +75,7 @@
              aform = eval("<?php echo $pform ?>");
              aform.value = document.forms[0].details.value;
          } catch (e) {
+             alert(e.toString());
          }
     }
 

Modified: branches/evolvis-me/www/tracker/detail.php
===================================================================
--- branches/evolvis-me/www/tracker/detail.php	2011-09-27 09:56:49 UTC (rev 17571)
+++ branches/evolvis-me/www/tracker/detail.php	2011-09-27 17:38:44 UTC (rev 17572)
@@ -22,7 +22,7 @@
 ?>
 	<h3>[#<?php echo $ah->getID(); ?>] <?php echo util_html_secure(util_unconvert_htmlspecialchars($ah->getSummary())); ?></h3>
 
-	<form action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>&focus=<?php echo $ah->getID(); ?>" method="post" enctype="multipart/form-data">
+	<form id="tracker_details" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>&focus=<?php echo $ah->getID(); ?>" method="post" enctype="multipart/form-data">
 
 <?php if (session_loggedin()) { ?>
 	<table cellpadding="0" width="100%">
@@ -103,7 +103,7 @@
 			<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>">
 			<p>
 			<strong><?php echo _('Add A Comment') ?>:</strong> 
-			<?php echo notepad_button('document.forms[1].details') ?><br />
+			<?php echo notepad_button('document.getElementById("tracker_details").details') ?><br />
 			<textarea name="details" rows="10" cols="60"></textarea>
 			<?php } ?>
 		</td></tr>

Modified: branches/evolvis-me/www/tracker/mod-limited.php
===================================================================
--- branches/evolvis-me/www/tracker/mod-limited.php	2011-09-27 09:56:49 UTC (rev 17571)
+++ branches/evolvis-me/www/tracker/mod-limited.php	2011-09-27 17:38:44 UTC (rev 17572)
@@ -20,7 +20,7 @@
 ?>
 	<h3>[#<?php echo $ah->getID(); ?>] <?php echo util_html_secure($ah->getSummary()); ?></h3>
 
-	<form action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>&focus=<?php echo $ah->getID(); ?>" METHOD="post" enctype="multipart/form-data">
+	<form id="tracker_details" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>&focus=<?php echo $ah->getID(); ?>" METHOD="post" enctype="multipart/form-data">
 	<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>" />
 	<input type="hidden" name="func" value="postmod" />
 	<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>" />
@@ -141,7 +141,7 @@
 <div class="tabbertab">
 <table border="0" width="80%">
 	<tr><td colspan="2">
-		<br /><strong><?php echo _('OR Attach A Comment') ?>: <?php echo notepad_button('document.forms[1].details') ?> <a href="javascript:help_window('<?php echo util_make_url ('/help/tracker.php?helpname=comment'); ?>')"><strong>(?)</strong></a></strong><br />
+		<br /><strong><?php echo _('OR Attach A Comment') ?>: <?php echo notepad_button('document.getElementById("tracker_details").details') ?> <a href="javascript:help_window('<?php echo util_make_url ('/help/tracker.php?helpname=comment'); ?>')"><strong>(?)</strong></a></strong><br />
 		<textarea name="details" rows="7" cols="60"></textarea>
 		<h3><?php echo _('Followup') ?>: <?php
 			if ($sort_comments_chronologically)

Modified: branches/evolvis-me/www/tracker/mod.php
===================================================================
--- branches/evolvis-me/www/tracker/mod.php	2011-09-27 09:56:49 UTC (rev 17571)
+++ branches/evolvis-me/www/tracker/mod.php	2011-09-27 17:38:44 UTC (rev 17572)
@@ -22,7 +22,7 @@
 ?>
 	<h3>[#<?php echo $ah->getID(); ?>] <?php echo util_html_secure($ah->getSummary()); ?></h3>
 
-	<form action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>&start=<?php echo $start; ?>&selected_tracker=<?php echo $selected_tracker; ?>&search_all=<?php echo $search_all; ?>&focus=<?php echo $ah->getID(); ?>&pNS=<?php echo $prevNextStart; ?>&pNT=<?php echo $prevNextTracker; ?>&total=<?php echo $modTotal; ?>&page_count=<?php echo $page_count; ?>&tracker=<?php echo $tracker_count; ?>&set=<?php echo $set.$filterParams; ?>" enctype="multipart/form-data" method="post">
+	<form id="tracker_details" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&atid=<?php echo $ath->getID(); ?>&start=<?php echo $start; ?>&selected_tracker=<?php echo $selected_tracker; ?>&search_all=<?php echo $search_all; ?>&focus=<?php echo $ah->getID(); ?>&pNS=<?php echo $prevNextStart; ?>&pNT=<?php echo $prevNextTracker; ?>&total=<?php echo $modTotal; ?>&page_count=<?php echo $page_count; ?>&tracker=<?php echo $tracker_count; ?>&set=<?php echo $set.$filterParams; ?>" enctype="multipart/form-data" method="post">
 	<input type="hidden" name="form_key" value="<?php echo form_generate_key(); ?>"/>
 	<input type="hidden" name="func" value="postmod"/>
 	<input type="hidden" name="artifact_id" value="<?php echo $ah->getID(); ?>"/>
@@ -192,7 +192,7 @@
 		echo ' '.util_make_link ('/tracker/admin/?group_id='.$group_id.'&atid='. $ath->getID() .'&add_canned=1','('._('Admin').')');
 		?>
 		<p>
-		<strong><?php echo _('OR Attach A Comment') ?>:<?php echo notepad_button('document.forms[1].details') ?><a href="javascript:help_window('<?php echo util_make_url ('/help/tracker.php?helpname=comment'); ?>')"><strong>(?)</strong></a></strong><br />
+		<strong><?php echo _('OR Attach A Comment') ?>:<?php echo notepad_button('document.getElementById("tracker_details").details') ?><a href="javascript:help_window('<?php echo util_make_url ('/help/tracker.php?helpname=comment'); ?>')"><strong>(?)</strong></a></strong><br />
 		<textarea name="details" rows="7" cols="60"></textarea></p>
 		<div>
 			<!-- duplicate button -->



More information about the evolvis-commits mailing list