This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  3d31f03c43da55f029bcdaa7cd3f3bb7d62ffb47 (commit)
       via  905943da219f362c8d331681ede604e256ee0ef7 (commit)
      from  4662f6ca241bcd325b62517e9d05a64f5ae211be (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=3d31f03c43da55f029bcdaa7cd3f3bb7d62ffb47

commit 3d31f03c43da55f029bcdaa7cd3f3bb7d62ffb47
Merge: 4662f6c 905943d
Author: Franck Villaume <[email protected]>
Date:   Mon Aug 16 15:29:19 2021 +0200

    Merge remote-tracking branch 'rhabacker/master-957'
    Implement : task details modification


https://scm.fusionforge.org/anonscm/gitweb/?p=fusionforge/fusionforge.git;a=commitdiff;h=905943da219f362c8d331681ede604e256ee0ef7

commit 905943da219f362c8d331681ede604e256ee0ef7
Author: Ralf Habacker <[email protected]>
Date:   Tue Jun 8 12:32:59 2021 +0200

    [#957] Add support to edit task details

diff --git a/src/common/pm/ProjectTask.class.php 
b/src/common/pm/ProjectTask.class.php
index 8cc593d..ccf0001 100644
--- a/src/common/pm/ProjectTask.class.php
+++ b/src/common/pm/ProjectTask.class.php
@@ -1006,15 +1006,12 @@ class ProjectTask extends FFError {
                        $arrChangedAndInNotice['subproject'] = ">";
                }
 
-               if ($details) {
+               if ($details != $this->getDetails()) {
+                       $this->addHistory ('details',$this->getDetails());
                        $has_changes = true;
-                       if($details != "" && $details != null) 
{$arrChangedAndInNotice['details'] = ">";}
-                       //Message vorhanden;
-                       if (!$this->addMessage($details)) {
-                               db_rollback();
-                               return false;
-                       }
+                       $arrChangedAndInNotice['details'] = ">";
                }
+
                if ($this->getStatusID() != $status_id) {
                        $this->addHistory ('status_id',$this->getStatusID());
                        $has_changes = true;
@@ -1104,9 +1101,10 @@ class ProjectTask extends FFError {
                                category_id=$8,
                                group_project_id=$9,
                                duration=$10,
-                               parent_id=$11
-                               WHERE group_project_id=$12
-                               AND project_task_id=$13',
+                               parent_id=$11,
+                               details=$12
+                               WHERE group_project_id=$13
+                               AND project_task_id=$14',
                                                array 
(htmlspecialchars($summary),
                                                       $priority,
                                                       $hours,
@@ -1118,6 +1116,7 @@ class ProjectTask extends FFError {
                                                       $new_group_project_id,
                                                       $duration,
                                                       $parent_id,
+                                                      
htmlspecialchars($details),
                                                       $group_project_id,
                                                       $this->getID())) ;
                        if (!$res || db_affected_rows($res) < 1) {
diff --git a/src/www/pm/mod_task.php b/src/www/pm/mod_task.php
index f8c0699..e1fed86 100644
--- a/src/www/pm/mod_task.php
+++ b/src/www/pm/mod_task.php
@@ -116,34 +116,43 @@ echo $HTML->openForm(array('action' => 
'/pm/task.php?group_id='.$group_id.'&grou
        <tr>
                <td colspan="3">
                <p>
-               <strong><?php echo _('Original Comment') . _(': '); 
?></strong><br />
+               <label for="details"><strong><?php echo _('Original Comment') . 
_(': '); ?></strong></label>
+               <?php echo 
notepad_button('document.forms.modtaskform.details'); ?>
+               </p>
                <?php
                        $sanitizer = new TextSanitizer();
                        $body = $sanitizer->SanitizeHtml($pt->getDetails());
 
-                       if (strpos($body,'<') === false) {
-                               echo nl2br($pt->getDetails());
-                       } else {
-                               echo $body;
+                       $GLOBALS['editor_was_set_up'] = false;
+                       $params = array();
+                       $params['id'] = 'details';
+                       $params['name'] = 'details';
+                       $params['width'] = "800";
+                       $params['height'] = "300";
+                       $params['body'] = $body;
+                       $params['group'] = $group_id;
+                       plugin_hook("text_editor", $params);
+                       if (!$GLOBALS['editor_was_set_up']) {
+                               echo html_e('textarea', array('name' => 
'details', 'rows' => '5', 'cols' => '80'), $body, false);
                        }
+                       unset($GLOBALS['editor_was_set_up']);
                ?>
-               </p>
                <p>
-               <label for="details"><strong><?php echo _('Add A Comment') . 
_(': '); ?></strong></label>
-               <?php echo notepad_button('document.forms.modtaskform.details') 
?>
+               <label for="followup"><strong><?php echo _('Add A Comment') . 
_(': '); ?></strong></label>
+               <?php echo 
notepad_button('document.forms.modtaskform.followup') ?>
                </p>
 <?php
 $GLOBALS['editor_was_set_up']=false;
 $params = array() ;
-$params['id'] = 'details';
-$params['name'] = 'details';
+$params['id'] = 'followup';
+$params['name'] = 'followup';
 $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>';
+       echo html_e('textarea', array('name' => 'followup', 'rows' => '5', 
'cols' => '80'), '', false);
 }
 unset($GLOBALS['editor_was_set_up']);
 ?>
diff --git a/src/www/pm/task.php b/src/www/pm/task.php
index f27c132..41e3041 100644
--- a/src/www/pm/task.php
+++ b/src/www/pm/task.php
@@ -152,6 +152,7 @@ switch (getStringFromRequest('func')) {
                session_require_perm ('pm', $pg->getID(), 'manager') ;
 
                $rem_artifact_id = getIntFromRequest('rem_artifact_id');
+               $followup = getStringFromRequest('followup');
 
                if(!$rem_artifact_id){
                        $rem_artifact_id=array();
@@ -182,6 +183,9 @@ switch (getStringFromRequest('func')) {
                        
$status_id,$category_id,$percent_complete,$assigned_to,$pt->convertDependentOn($dependent_on),$new_group_project_id,$duration,$parent_id))
 {
                        exit_error('update: '.$pt->getErrorMessage(),'pm');
                } else {
+                       if ($followup && !$pt->addMessage($followup)) {
+                               exit_error('update: '.$pt->getErrorMessage(), 
'pm');
+                       }
                        if (count($rem_artifact_id) > 0) {
                                if 
(!$pt->removeRelatedArtifacts($rem_artifact_id)) {
                                        exit_error('removeRelatedArtifacts: 
'.$pt->getErrorMessage(),'pm');

-----------------------------------------------------------------------

Summary of changes:
 src/common/pm/ProjectTask.class.php | 19 +++++++++----------
 src/www/pm/mod_task.php             | 31 ++++++++++++++++++++-----------
 src/www/pm/task.php                 |  4 ++++
 3 files changed, 33 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
FusionForge

_______________________________________________
Fusionforge-commits mailing list
[email protected]
http://lists.fusionforge.org/cgi-bin/mailman/listinfo/fusionforge-commits

Reply via email to