[Fusionforge-commits] r12172 - in trunk/src: common/pm common/tracker www/pm www/pm/include www/tracker www/tracker/include

Roland Mas lolando at libremir.placard.fr.eu.org
Mon Feb 7 11:25:22 CET 2011


Author: lolando
Date: 2011-02-07 11:25:22 +0100 (Mon, 07 Feb 2011)
New Revision: 12172

Modified:
   trunk/src/common/pm/ProjectTask.class.php
   trunk/src/common/tracker/Artifact.class.php
   trunk/src/www/pm/detail_task.php
   trunk/src/www/pm/include/ProjectTaskHTML.class.php
   trunk/src/www/pm/mod_task.php
   trunk/src/www/tracker/detail.php
   trunk/src/www/tracker/include/ArtifactHtml.class.php
   trunk/src/www/tracker/mod-limited.php
   trunk/src/www/tracker/mod.php
Log:
Make displayed order of followups configurable in trackers and tasks

Modified: trunk/src/common/pm/ProjectTask.class.php
===================================================================
--- trunk/src/common/pm/ProjectTask.class.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/common/pm/ProjectTask.class.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -613,11 +613,11 @@
 	 *
 	 *  @return database result set.
 	 */
-	function getMessages() {
+	function getMessages($asc=false) {
 		return db_query_params ('SELECT * 
 		FROM project_message_user_vw 
 		WHERE project_task_id=$1
-		ORDER BY postdate DESC',
+		ORDER BY postdate ' . ($asc ? 'ASC' : 'DESC'),
 					array ($this->getID())) ;
 	}
 

Modified: trunk/src/common/tracker/Artifact.class.php
===================================================================
--- trunk/src/common/tracker/Artifact.class.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/common/tracker/Artifact.class.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -667,8 +667,8 @@
 	 *
 	 *	@return database result set.
 	 */
-	function getMessages() {
-		return db_query_params ('SELECT * FROM artifact_message_user_vw WHERE artifact_id=$1 ORDER BY adddate DESC',
+	function getMessages($asc=false) {
+		return db_query_params ('SELECT * FROM artifact_message_user_vw WHERE artifact_id=$1 ORDER BY adddate ' . ($asc ? 'ASC' : 'DESC'),
 					array ($this->getID())) ;
 	}
 

Modified: trunk/src/www/pm/detail_task.php
===================================================================
--- trunk/src/www/pm/detail_task.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/www/pm/detail_task.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -24,6 +24,12 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
 pm_header(array('title'=>_('Task Detail'),'group_project_id'=>$group_project_id));
 
 ?>
@@ -163,7 +169,7 @@
 
 	<tr>
 		<td colspan="2">
-			<?php echo $pt->showMessages(); ?>
+			<?php echo $pt->showMessages($sort_comments_chronologically, "/pm/task.php?func=detailtask&project_task_id=$project_task_id&group_id=$group_id&group_project_id=$group_project_id"); ?>
 		</td>
 	</tr>
 	<?php

Modified: trunk/src/www/pm/include/ProjectTaskHTML.class.php
===================================================================
--- trunk/src/www/pm/include/ProjectTaskHTML.class.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/www/pm/include/ProjectTaskHTML.class.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -131,16 +131,27 @@
 		}
 	}
 
-	function showMessages() {
+	function showMessages($asc=true,$whereto='/') {
 		/*
 			Show the details rows from task_history
 		*/
-		$result=$this->getMessages();
+		$result=$this->getMessages($asc);
 		$rows=db_numrows($result);
 
 		if ($rows > 0) {
-			echo '<h3>'._('Followups').'</h3>';
+			echo '<h3>'._('Followups: ');
 
+			if ($asc) {
+				echo '<a href="' .
+					util_make_url($whereto . '&commentsort=anti') .
+					'">' . _('Sort comments antichronologically') . '</a>';
+			} else {
+				echo '<a href="' .
+					util_make_url($whereto . '&commentsort=chrono') .
+					'">' . _('Sort comments chronologically') . '</a>';
+			}
+			echo "</h3>\n";
+
 			$title_arr=array();
 			$title_arr[]=_('Comment');
 			$title_arr[]=_('Date');

Modified: trunk/src/www/pm/mod_task.php
===================================================================
--- trunk/src/www/pm/mod_task.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/www/pm/mod_task.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -29,6 +29,12 @@
 require_once $gfcommon.'reporting/report_utils.php';
 require_once $gfcommon.'reporting/Report.class.php';
 
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
 pm_header(array('title'=>_('Modify Task'),'pagename'=>'pm_modtask','group_project_id'=>$group_project_id));
 
 echo notepad_func();
@@ -230,7 +236,7 @@
 
 	<tr>
 		<td colspan="3">
-			<?php echo $pt->showMessages(); ?>
+			<?php echo $pt->showMessages($sort_comments_chronologically, "/pm/task.php?func=detailtask&project_task_id=$project_task_id&group_id=$group_id&group_project_id=$group_project_id"); ?>
 		</td>
 	</tr>
 	<?php

Modified: trunk/src/www/tracker/detail.php
===================================================================
--- trunk/src/www/tracker/detail.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/www/tracker/detail.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -25,6 +25,12 @@
 
 use_javascript('/tabber/tabber.js');
 
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
 $ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
 
 echo notepad_func();
@@ -111,9 +117,19 @@
 			<?php } ?>
 		</td></tr>
 		<tr><td colspan="2">
-		<h2><?php echo _('Followup') ?></h2>
-		<?php
-		echo $ah->showMessages();
+		<h2><?php echo _('Followups: ') 
+		if ($sort_comments_chronologically) {
+			echo '<a href="' .
+			util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
+			'">' . _('Sort comments antichronologically') . '</a>';
+		} else {
+			echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
+				'">' . _('Sort comments chronologically') . '</a>';
+		}
+		echo '</h2>';
+
+		echo $ah->showMessages($sort_comments_chronologically);
 		?>
 		</td></tr>
 </table>

Modified: trunk/src/www/tracker/include/ArtifactHtml.class.php
===================================================================
--- trunk/src/www/tracker/include/ArtifactHtml.class.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/www/tracker/include/ArtifactHtml.class.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -56,8 +56,8 @@
 	}
 
 
-	function showMessages() {
-		$result= $this->getMessages();
+	function showMessages($asc=true) {
+		$result= $this->getMessages($asc);
 		$rows=db_numrows($result);
 
 		if ($rows > 0) {

Modified: trunk/src/www/tracker/mod-limited.php
===================================================================
--- trunk/src/www/tracker/mod-limited.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/www/tracker/mod-limited.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -24,6 +24,12 @@
  */
 use_javascript('/tabber/tabber.js');
 
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
 $ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
 
 echo notepad_func();
@@ -149,9 +155,18 @@
 		<br /><strong><?php echo _('OR Attach A Comment') ?>: <?php echo notepad_button('document.forms.trackermodlimitedform.details') ?></strong><br />
 		<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo html_get_tooltip_description('comment') ?>"></textarea>
 		<p>
-		<h2><?php echo _('Followup') ?>:</h2>
-		<?php
-			echo $ah->showMessages();
+		<h2><?php echo _('Followups: ') 
+			if ($sort_comments_chronologically) {
+				echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
+				'">' . _('Sort comments antichronologically') . '</a>';
+			} else {
+				echo '<a href="' .
+					util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
+					'">' . _('Sort comments chronologically') . '</a>';
+			}
+echo '</h2>';
+echo $ah->showMessages($sort_comments_chronologically);
 		?>
 	</td></tr>
 </table>

Modified: trunk/src/www/tracker/mod.php
===================================================================
--- trunk/src/www/tracker/mod.php	2011-02-07 09:47:07 UTC (rev 12171)
+++ trunk/src/www/tracker/mod.php	2011-02-07 10:25:22 UTC (rev 12172)
@@ -25,6 +25,12 @@
  */
 use_javascript('/tabber/tabber.js');
 
+if (getStringFromRequest('commentsort') == 'anti') {
+       $sort_comments_chronologically = false;
+} else {
+       $sort_comments_chronologically = true;
+}
+
 $ath->header(array ('title'=>'[#'. $ah->getID(). '] ' . $ah->getSummary(), 'atid'=>$ath->getID()));
 
 echo notepad_func();
@@ -194,9 +200,18 @@
 		<p>
 		<strong><?php echo _('OR Attach A Comment') ?>:<?php echo notepad_button('document.forms.trackermodform.details') ?></strong><br />
 		<textarea id="tracker-comment" name="details" rows="7" cols="60" title="<?php echo html_get_tooltip_description('comment') ?>"></textarea></p>
-		<h2><?php echo _('Followup') ?>:</h2>
-		<?php
-			echo $ah->showMessages(); 
+		<h2><?php echo _('Followups: ') 
+			if ($sort_comments_chronologically) {
+				echo '<a href="' .
+				util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=anti') .
+				'">' . _('Sort comments antichronologically') . '</a>';
+			} else {
+				echo '<a href="' .
+					util_make_url('/tracker/index.php?func=detail&aid=' . $aid . '&group_id=' . $group_id . '&atid=' . $ath->getID() . '&commentsort=chrono') .
+					'">' . _('Sort comments chronologically') . '</a>';
+			}
+echo '</h2>';
+echo $ah->showMessages($sort_comments_chronologically);
 		?>
 	</td></tr>
 </table>




More information about the Fusionforge-commits mailing list