[Fusionforge-commits] r10695 - in trunk/src/www/pm: . include

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Sat Sep 25 18:45:50 CEST 2010


Author: nerville
Date: 2010-09-25 18:45:50 +0200 (Sat, 25 Sep 2010)
New Revision: 10695

Modified:
   trunk/src/www/pm/include/ProjectTaskHTML.class.php
   trunk/src/www/pm/mod_task.php
Log:
enable HTML editor in comments for tasks

Modified: trunk/src/www/pm/include/ProjectTaskHTML.class.php
===================================================================
--- trunk/src/www/pm/include/ProjectTaskHTML.class.php	2010-09-25 16:44:17 UTC (rev 10694)
+++ trunk/src/www/pm/include/ProjectTaskHTML.class.php	2010-09-25 16:45:50 UTC (rev 10695)
@@ -96,7 +96,7 @@
 
 		$rows=db_numrows($res);
 		if ($rows > 0) {
-			if (forge_check_perm ('pm_admin', $this->Group->getID())) {
+			if (forge_check_perm ('pm_admin', $this->ProjectGroup->Group->getID())) {
 				$is_admin=false;
 			} else {
 				$is_admin=true;
@@ -149,7 +149,16 @@
 			for ($i=0; $i < $rows; $i++) {
 				echo '
 				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>
-					<td>'. nl2br(db_result($result, $i, 'body')).'</td>
+				<td>';
+				$sanitizer = new TextSanitizer();
+				$body = $sanitizer->SanitizeHtml(db_result($result, $i, 'body'));
+				if (strpos($body,'<') === false) {
+					echo nl2br(db_result($result, $i, 'body'));
+				} else {
+					echo $body;
+				}
+
+				echo '</td>
 					<td valign="top">'.date(_('Y-m-d H:i'),db_result($result, $i, 'postdate')).'</td>
 					<td valign="top">'.db_result($result, $i, 'user_name').'</td></tr>';
 			}

Modified: trunk/src/www/pm/mod_task.php
===================================================================
--- trunk/src/www/pm/mod_task.php	2010-09-25 16:44:17 UTC (rev 10694)
+++ trunk/src/www/pm/mod_task.php	2010-09-25 16:45:50 UTC (rev 10695)
@@ -116,7 +116,20 @@
 		?>
 		<p />
 		<strong><?php echo _('Add A Comment') ?>:</strong><?php echo notepad_button('document.forms.modtaskform.details') ?><br />
-		<textarea name="details" rows="5" cols="80"></textarea>
+<?php
+$GLOBALS['editor_was_set_up']=false;
+$params = array() ;
+$params['name'] = 'details';
+$params['width'] = "800";
+$params['height'] = "300";
+$params['body'] = "";
+$params['group'] = $group_id;
+plugin_hook("text_editor",$params);
+if (!$GLOBALS['editor_was_set_up']) {
+    echo '<textarea name="details" rows="5" cols="80"></textarea>';
+}
+unset($GLOBALS['editor_was_set_up']);
+?>
 		</td>
 	</tr>
 




More information about the Fusionforge-commits mailing list