[Fusionforge-commits] r10656 - trunk/src/www/pm

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Thu Sep 23 17:43:52 CEST 2010


Author: nerville
Date: 2010-09-23 17:43:52 +0200 (Thu, 23 Sep 2010)
New Revision: 10656

Modified:
   trunk/src/www/pm/add_task.php
   trunk/src/www/pm/detail_task.php
   trunk/src/www/pm/mod_task.php
   trunk/src/www/pm/task.php
Log:
add preliminary support of fckeditor in tasks

Modified: trunk/src/www/pm/add_task.php
===================================================================
--- trunk/src/www/pm/add_task.php	2010-09-23 15:38:51 UTC (rev 10655)
+++ trunk/src/www/pm/add_task.php	2010-09-23 15:43:52 UTC (rev 10656)
@@ -76,7 +76,20 @@
 	<tr>
 		<td colspan="2">
 		<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>
+<?php
+$GLOBALS['editor_was_set_up']=false;
+$params = array() ;
+$params['name'] = 'details';
+$params['width'] = "800";
+$params['height'] = "500";
+$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>
 
 	<tr>

Modified: trunk/src/www/pm/detail_task.php
===================================================================
--- trunk/src/www/pm/detail_task.php	2010-09-23 15:38:51 UTC (rev 10655)
+++ trunk/src/www/pm/detail_task.php	2010-09-23 15:43:52 UTC (rev 10656)
@@ -94,7 +94,15 @@
 	<tr>
 		<td colspan="2">
 		<strong><?php echo _('Original Comment') ?>:</strong><br />
-		<?php echo nl2br($pt->getDetails()); ?>
+		<?php 
+             $sanitizer = new TextSanitizer();
+             $body = $sanitizer->SanitizeHtml($pt->getDetails());
+             if (strpos($body,'<') === false) {
+                 echo nl2br($pt->getDetails());
+             } else {
+                 echo $body;
+             }
+        ?>
 		</td>
 	</tr>
 

Modified: trunk/src/www/pm/mod_task.php
===================================================================
--- trunk/src/www/pm/mod_task.php	2010-09-23 15:38:51 UTC (rev 10655)
+++ trunk/src/www/pm/mod_task.php	2010-09-23 15:43:52 UTC (rev 10656)
@@ -104,7 +104,16 @@
 	<tr>
 		<td colspan="3">
 		<strong><?php echo _('Original Comment') ?>:</strong><br />
-		<?php echo nl2br( $pt->getDetails() ); ?>
+		<?php 
+			$sanitizer = new TextSanitizer();
+        	$body = $sanitizer->SanitizeHtml($pt->getDetails());
+
+			if (strpos($body,'<') === false) {
+				echo nl2br($pt->getDetails());
+			} else {
+				echo $body;
+			}
+		?>
 		<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>

Modified: trunk/src/www/pm/task.php
===================================================================
--- trunk/src/www/pm/task.php	2010-09-23 15:38:51 UTC (rev 10655)
+++ trunk/src/www/pm/task.php	2010-09-23 15:43:52 UTC (rev 10656)
@@ -140,6 +140,9 @@
 		$end_date=mktime($end_hour,$end_minute,0,$end_month,$end_day,$end_year);
 		
 		
+		$sanitizer = new TextSanitizer();
+		$details = $sanitizer->purify($details);
+
 		if (!$pt->create($summary,$details,$priority,$hours,$start_date,$end_date,$category_id,$percent_complete,$assigned_to,$pt->convertDependentOn($dependent_on),$duration,$parent_id)) {
 			exit_error($pt->getErrorMessage(),'pm');
 		} else {




More information about the Fusionforge-commits mailing list