[Fusionforge-commits] r9202 - in branches/Branch_5_0/gforge/www: forum/include news news/admin pm tracker

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Mar 22 09:57:36 CET 2010


Author: lolando
Date: 2010-03-22 09:57:36 +0100 (Mon, 22 Mar 2010)
New Revision: 9202

Modified:
   branches/Branch_5_0/gforge/www/forum/include/ForumHTML.class.php
   branches/Branch_5_0/gforge/www/news/admin/index.php
   branches/Branch_5_0/gforge/www/news/submit.php
   branches/Branch_5_0/gforge/www/pm/add_task.php
   branches/Branch_5_0/gforge/www/pm/mod_task.php
   branches/Branch_5_0/gforge/www/tracker/add.php
   branches/Branch_5_0/gforge/www/tracker/detail.php
   branches/Branch_5_0/gforge/www/tracker/mod-limited.php
   branches/Branch_5_0/gforge/www/tracker/mod.php
Log:
Backport from trunk: made notepad invocations less fragile in case themes add or remove forms

Modified: branches/Branch_5_0/gforge/www/forum/include/ForumHTML.class.php
===================================================================
--- branches/Branch_5_0/gforge/www/forum/include/ForumHTML.class.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/forum/include/ForumHTML.class.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -482,7 +482,7 @@
 			echo notepad_func();
 			?>
 <div align="center">
-	 <form enctype="multipart/form-data" action="<?php echo util_make_url ('/forum/admin/index.php') ?>" method="post">
+	 <form id="ForumEditForm" enctype="multipart/form-data" action="<?php echo util_make_url ('/forum/admin/index.php') ?>" method="post">
 	<?php $objid = $this->Forum->getID();?>
 	<input type="hidden" name="thread_id" value="<?php echo $thread_id; ?>" />
 	<input type="hidden" name="forum_id" value="<?php echo $objid; ?>" />
@@ -501,7 +501,7 @@
 		<strong><?php echo _('Subject:'); ?></strong><?php echo utils_requiredField(); ?><br />
 				<input type="text" name="subject" value="<?php echo $subject; ?>" size="80" maxlength="80" />
 		<br /><br />
-		<strong><?php echo _('Message:'); ?></strong><?php echo notepad_button('document.forms[2].body') ?><?php echo utils_requiredField(); ?><br />
+		<strong><?php echo _('Message:'); ?></strong><?php echo notepad_button('document.forms.ForumEditForm.body') ?><?php echo utils_requiredField(); ?><br />
 		<?php
 		$GLOBALS['editor_was_set_up']=false;
 		$params = array() ;
@@ -552,7 +552,7 @@
 		echo notepad_func();
 		?>
 <div align="center">
-<form enctype="multipart/form-data" action="<?php echo util_make_url ('/forum/forum.php?forum_id='.$this->Forum->getID().'&amp;group_id='.$group_id); ?>" method="post">
+<form id="ForumPostForm" enctype="multipart/form-data" action="<?php echo util_make_url ('/forum/forum.php?forum_id='.$this->Forum->getID().'&amp;group_id='.$group_id); ?>" method="post">
 	<?php $objid = $this->Forum->getID();?>
 	<input type="hidden" name="post_message" value="y" />
 	<input type="hidden" name="thread_id" value="<?php echo $thread_id; ?>" />
@@ -565,7 +565,7 @@
 		<strong><?php echo _('Subject:'); ?></strong><?php echo utils_requiredField(); ?><br />
 				<input type="text" name="subject" value="<?php echo $subject; ?>" size="80" maxlength="80" />
 			<br /><br />
-		<strong><?php echo _('Message:'); ?></strong><?php echo notepad_button('document.forms[2].body') ?><?php echo utils_requiredField(); ?><br />
+		<strong><?php echo _('Message:'); ?></strong><?php echo notepad_button('document.forms.ForumPostForm.body') ?><?php echo utils_requiredField(); ?><br />
 
 		<?php
 		$GLOBALS['editor_was_set_up']=false;

Modified: branches/Branch_5_0/gforge/www/news/admin/index.php
===================================================================
--- branches/Branch_5_0/gforge/www/news/admin/index.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/news/admin/index.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -117,7 +117,7 @@
 		echo '
 		<h3>'.sprintf(_('Approve a NewsByte For Project: %1$s'), $group->getPublicName()).'</h3>
 		<p />
-		<form action="'.getStringFromServer('PHP_SELF').'" method="post">
+		<form id="newsadminform" action="'.getStringFromServer('PHP_SELF').'" method="post">
 		<input type="hidden" name="group_id" value="'.db_result($result,0,'group_id').'" />
 		<input type="hidden" name="id" value="'.db_result($result,0,'id').'" />';
 
@@ -134,7 +134,7 @@
 
 		<strong>'._('Subject').'</strong><br />
 		<input type="text" name="summary" value="'.db_result($result,0,'summary').'" size="30" maxlength="60" /><br />
-		<strong>'._('Details').'</strong>'.notepad_button('document.forms[2].details').'<br />';
+		<strong>'._('Details').'</strong>'.notepad_button('document.forms.newsadminform.details').'<br />';
 		
 		$GLOBALS['editor_was_set_up']=false;
 		$params = array () ;

Modified: branches/Branch_5_0/gforge/www/news/submit.php
===================================================================
--- branches/Branch_5_0/gforge/www/news/submit.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/news/submit.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -132,7 +132,7 @@
 		<p>
 		'. sprintf(_('You can post news about your project if you are an admin on your project. You may also post "help wanted" notes if your project needs help.</p><p>All posts <b>for your project</b> will appear instantly on your project summary page. Posts that are of special interest to the community will have to be approved by a member of the %1$s news team before they will appear on the %1$s home page.</p><p>You may include URLs, but not HTML in your submissions.</p><p>URLs that start with http:// are made clickable.'), $GLOBALS['sys_name']) .'</p>' . $jsfunc . 
 		'
-		<form action="'.getStringFromServer('PHP_SELF').'" method="post">
+		<form id="newssubmitform" action="'.getStringFromServer('PHP_SELF').'" method="post">
 		<input type="hidden" name="group_id" value="'.$group_id.'" />
 		<input type="hidden" name="post_changes" value="y" />
 		<input type="hidden" name="form_key" value="'. form_generate_key() .'" />
@@ -141,7 +141,7 @@
 		<strong>'._('Subject').':</strong>'.utils_requiredField().'<br />
 		<input type="text" name="summary" value="" size="60" maxlength="60" /></p>
 		<p>
-		<strong>'._('Details').':</strong>'.notepad_button('document.forms[2].details').utils_requiredField().'<br />';
+		<strong>'._('Details').':</strong>'.notepad_button('document.forms.newssubmitform.details').utils_requiredField().'</p>';
 	
 	$GLOBALS['editor_was_set_up']=false;
 	$params = array() ;

Modified: branches/Branch_5_0/gforge/www/pm/add_task.php
===================================================================
--- branches/Branch_5_0/gforge/www/pm/add_task.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/pm/add_task.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -24,7 +24,7 @@
 echo notepad_func();
 ?>
 
-<form action="<?php echo getStringFromServer('PHP_SELF')."?group_id=$group_id&amp;group_project_id=$group_project_id"; ?>" method="post">
+<form id="addtaskform" action="<?php echo getStringFromServer('PHP_SELF')."?group_id=$group_id&amp;group_project_id=$group_project_id"; ?>" method="post">
 <input type="hidden" name="func" value="postaddtask" />
 <input type="hidden" name="add_artifact_id[]" value="<?php echo $related_artifact_id; ?>" />
 
@@ -63,7 +63,7 @@
 
 	<tr>
 		<td colspan="2">
-		<strong><?php echo _('Task Details') ?>:</strong><?php echo notepad_button('document.forms[2].details') ?> <?php echo utils_requiredField(); ?><br />
+		<strong><?php echo _('Task Details') ?>:</strong><?php echo notepad_button('document.forms.addtaskform.details') ?> <?php echo utils_requiredField(); ?><br />
 		<textarea name="details" rows="5" cols="80"></textarea></td>
 	</tr>
 

Modified: branches/Branch_5_0/gforge/www/pm/mod_task.php
===================================================================
--- branches/Branch_5_0/gforge/www/pm/mod_task.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/pm/mod_task.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -25,7 +25,7 @@
 
 ?>
 
-<form action="<?php echo getStringFromServer('PHP_SELF')."?group_id=$group_id&amp;group_project_id=$group_project_id"; ?>" method="post">
+<form id="modtaskform" action="<?php echo getStringFromServer('PHP_SELF')."?group_id=$group_id&amp;group_project_id=$group_project_id"; ?>" method="post">
 <input type="hidden" name="func" value="postmodtask" />
 <input type="hidden" name="project_task_id" value="<?php echo $project_task_id; ?>" />
 
@@ -76,7 +76,7 @@
 		<strong><?php echo _('Original Comment') ?>:</strong><br />
 		<?php echo nl2br( $pt->getDetails() ); ?>
 		<p />
-		<strong><?php echo _('Add A Comment') ?>:</strong><?php echo notepad_button('document.forms[2].details') ?><br />
+		<strong><?php echo _('Add A Comment') ?>:</strong><?php echo notepad_button('document.forms.modtaskform.details') ?><br />
 		<textarea name="details" rows="5" cols="80"></textarea>
 		</td>
 	</tr>

Modified: branches/Branch_5_0/gforge/www/tracker/add.php
===================================================================
--- branches/Branch_5_0/gforge/www/tracker/add.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/tracker/add.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -31,7 +31,7 @@
 	echo notepad_func();
 	echo $ath->renderSubmitInstructions();
 
-	echo '<form action="'.getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&amp;atid='.$ath->getID().'" method="post" enctype="multipart/form-data">
+	echo '<form id="trackeraddform" action="'.getStringFromServer('PHP_SELF').'?group_id='.$group_id.'&amp;atid='.$ath->getID().'" method="post" enctype="multipart/form-data">
 	
 	<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
 	<table>';
@@ -78,7 +78,7 @@
 
 	<tr>
 		<td colspan="2">
-		<strong><?php echo _('Detailed description') ?><?php echo utils_requiredField(); ?>:</strong><?php echo notepad_button('document.forms[2].details') ?><br /> 
+		<strong><?php echo _('Detailed description') ?><?php echo utils_requiredField(); ?>:</strong><?php echo notepad_button('document.forms.trackeraddform.details') ?><br /> 
 		<textarea name="details" rows="20" cols="79"></textarea>
 		</td>
 	</tr>

Modified: branches/Branch_5_0/gforge/www/tracker/detail.php
===================================================================
--- branches/Branch_5_0/gforge/www/tracker/detail.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/tracker/detail.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -15,7 +15,7 @@
 ?>
 	<h3>[#<?php echo $ah->getID(); ?>] <?php echo util_unconvert_htmlspecialchars($ah->getSummary()); ?></h3>
 
-	<form action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&amp;atid=<?php echo $ath->getID(); ?>" method="post" enctype="multipart/form-data">
+	<form id="trackerdetailform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&amp;atid=<?php echo $ath->getID(); ?>" method="post" enctype="multipart/form-data">
 
 <?php if (session_loggedin()) { ?>
 	<table cellpadding="0" width="100%">
@@ -89,7 +89,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[2].details') ?><br />
+			<?php echo notepad_button('document.forms.trackerdetailform.details') ?><br />
 			<textarea name="details" rows="10" cols="60"></textarea>
 			</p>
 			<?php } ?>

Modified: branches/Branch_5_0/gforge/www/tracker/mod-limited.php
===================================================================
--- branches/Branch_5_0/gforge/www/tracker/mod-limited.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/tracker/mod-limited.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -14,7 +14,7 @@
 ?>
 	<h3>[#<?php echo $ah->getID(); ?>] <?php echo $ah->getSummary(); ?></h3>
 
-	<form action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&amp;atid=<?php echo $ath->getID(); ?>" enctype="multipart/form-data" method="post">
+	<form id="trackermodlimitedform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&amp;atid=<?php echo $ath->getID(); ?>" 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="MAX_FILE_SIZE" value="10000000" />
@@ -127,7 +127,7 @@
 <div class="tabbertab" title="<?php echo _('Followups');?>">
 <table border="0" width="80%">
 	<tr><td colspan="2">
-		<br /><strong><?php echo _('OR Attach A Comment') ?>: <?php echo notepad_button('document.forms[2].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.forms.trackermodlimitedform.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>
 		<h3><?php echo _('Followup') ?>:</h3>

Modified: branches/Branch_5_0/gforge/www/tracker/mod.php
===================================================================
--- branches/Branch_5_0/gforge/www/tracker/mod.php	2010-03-22 08:40:16 UTC (rev 9201)
+++ branches/Branch_5_0/gforge/www/tracker/mod.php	2010-03-22 08:57:36 UTC (rev 9202)
@@ -15,7 +15,7 @@
 ?>
 	<h1>[#<?php echo $ah->getID(); ?>] <?php echo $ah->getSummary(); ?></h1>
 
-	<form action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&amp;atid=<?php echo $ath->getID(); ?>"  enctype="multipart/form-data" method="post">
+	<form id="trackermodform" action="<?php echo getStringFromServer('PHP_SELF'); ?>?group_id=<?php echo $group_id; ?>&amp;atid=<?php echo $ath->getID(); ?>"  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="MAX_FILE_SIZE" value="10000000" />
@@ -165,7 +165,7 @@
 	</tr>
 	<tr><td colspan="2">
 		<div id="edit" style="display:none;">
-		<strong><?php echo _('Detailed description') ?><?php echo utils_requiredField(); ?>: <?php echo notepad_button('document.forms[2].description') ?> <a href="javascript:help_window('/help/tracker.php?helpname=description')">(?)</a></strong>
+		<strong><?php echo _('Detailed description') ?><?php echo utils_requiredField(); ?>: <?php echo notepad_button('document.forms.trackermodform.description') ?> <a href="javascript:help_window('/help/tracker.php?helpname=description')">(?)</a></strong>
 		<br />
 		<textarea name="description" rows="30" cols="79"><?php echo $ah->getDetails(); ?></textarea>
 		</div>
@@ -187,7 +187,7 @@
 		echo '&nbsp;'.util_make_link ('/tracker/admin/?group_id='.$group_id.'&amp;atid='. $ath->getID() .'&amp;add_canned=1','('._('Admin').')');
 		?>
 		<p>
-		<strong><?php echo _('OR Attach A Comment') ?>:<?php echo notepad_button('document.forms[2].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.forms.trackermodform.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>
 		<h3><?php echo _('Followup') ?>:</h3>
 		<?php




More information about the Fusionforge-commits mailing list