From 6916fdda32c8a652a4ba67adec46b12026847fb5 Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@users.sourceforge.net>
Date: Sat, 20 Aug 2011 13:18:54 +0000
Subject: [PATCH] Fix: Editing action does not change actors

---
 htdocs/comm/action/fiche.php          | 10 +++++-----
 htdocs/core/class/html.form.class.php |  4 +++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php
index a0c713ae308..6845b1fb2d3 100644
--- a/htdocs/comm/action/fiche.php
+++ b/htdocs/comm/action/fiche.php
@@ -23,7 +23,7 @@
  *       \file       htdocs/comm/action/fiche.php
  *       \ingroup    agenda
  *       \brief      Page for event card
- *       \version    $Id: fiche.php,v 1.228 2011/07/31 22:23:20 eldy Exp $
+ *       \version    $Id: fiche.php,v 1.229 2011/08/20 13:18:54 eldy Exp $
  */
 
 require("../../main.inc.php");
@@ -93,7 +93,7 @@ if ($action == 'add_action')
 	$_POST["apmonth"],
 	$_POST["apday"],
 	$_POST["apyear"]);
-	
+
 	$datef=dol_mktime(
 	$fulldayevent?'23':$_POST["p2hour"],
 	$fulldayevent?'59':$_POST["p2min"],
@@ -764,12 +764,12 @@ if ($id)
 
 		// Affected to
 		print '<tr><td nowrap>'.$langs->trans("ActionAffectedTo").'</td><td colspan="3">';
-		$html->select_users($act->usertodo->id,'affectedto',1);
+		print $html->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1);
 		print '</td></tr>';
 
 		// Realised by
 		print '<tr><td nowrap>'.$langs->trans("ActionDoneBy").'</td><td colspan="3">';
-		$html->select_users($act->userdone->id,'doneby',1);
+		print $html->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1);
 		print '</td></tr>';
 
 		print '</table><br>';
@@ -1022,7 +1022,7 @@ if ($id)
 
 $db->close();
 
-llxFooter('$Date: 2011/07/31 22:23:20 $ - $Revision: 1.228 $');
+llxFooter('$Date: 2011/08/20 13:18:54 $ - $Revision: 1.229 $');
 
 
 /**
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 74fbff46ea3..926ba72da11 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -31,7 +31,7 @@
  *	\file       htdocs/core/class/html.form.class.php
  *  \ingroup    core
  *	\brief      File of class with all html predefined components
- *	\version	$Id: html.form.class.php,v 1.200 2011/08/20 09:03:38 hregis Exp $
+ *	\version	$Id: html.form.class.php,v 1.201 2011/08/20 13:18:54 eldy Exp $
  */
 
 
@@ -756,6 +756,7 @@ class Form
 
     /**
      *	Return select list of users
+     *
      *  @param      selected        Id user preselected
      *  @param      htmlname        Field name in form
      *  @param      show_empty      0=liste sans valeur nulle, 1=ajoute valeur inconnue
@@ -772,6 +773,7 @@ class Form
 
     /**
      *	Return select list of users
+     *
      *  @param      selected        User id or user object of user preselected. If -1, we use id of current user.
      *  @param      htmlname        Field name in form
      *  @param      show_empty      0=liste sans valeur nulle, 1=ajoute valeur inconnue
-- 
GitLab