From d9d9b748adb6993af1e9646b9a9230f82cbd54dc Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis.houssin@capnetworks.com>
Date: Mon, 3 Jul 2017 19:27:21 +0200
Subject: [PATCH] Fix: check if action type is different of 'user' (external
 module)

---
 htdocs/admin/dict.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 485c5713636..72888a8deb3 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -1752,8 +1752,9 @@ function fieldList($fieldlist, $obj='', $tabname='', $context='')
 		}
 		elseif ($fieldlist[$field] == 'type' && $tabname == MAIN_DB_PREFIX."c_actioncomm")
 		{
+			$type = (! empty($obj->type)?$obj->type:'user'); // Check if type is different of 'user' (external module)
 			print '<td>';
-			print 'user<input type="hidden" name="type" value="user">';
+			print $type.'<input type="hidden" name="type" value="'.$type.'">';
 			print '</td>';
 		}
 		elseif ($fieldlist[$field] == 'recuperableonly' || $fieldlist[$field] == 'type_cdr' || $fieldlist[$field] == 'deductible' || $fieldlist[$field] == 'category_type') {
-- 
GitLab