';
+ $out.= '| ';
}
if (! empty($head['text']))
{
diff --git a/htdocs/core/class/comment.class.php b/htdocs/core/class/comment.class.php
index a21057662f2..9aeebd575bf 100644
--- a/htdocs/core/class/comment.class.php
+++ b/htdocs/core/class/comment.class.php
@@ -7,20 +7,22 @@ class Comment extends CommonObject
public $element='comment'; //!< Id that identify managed objects
public $table_element='comment'; //!< Name of table without prefix where object is stored
- var $fk_element;
- var $element_type;
+ public $fk_element;
+ public $element_type;
- var $description;
+ public $description;
- var $tms;
+ public $tms;
- var $datec;
+ public $datec;
- var $fk_user_author;
+ public $fk_user_author;
- var $entity;
+ public $entity;
- var $import_key;
+ public $import_key;
+
+ public $comments = array();
public $oldcopy;
@@ -289,10 +291,10 @@ class Comment extends CommonObject
* @param int $fk_element Id of element
* @return array Comment array
*/
- public static function fetchAllFor($element_type, $fk_element)
+ public function fetchAllFor($element_type, $fk_element)
{
global $db,$conf;
- $TComments = array();
+ $this->comments = array();
if(!empty($element_type) && !empty($fk_element)) {
$sql = "SELECT";
$sql.= " c.rowid";
@@ -302,7 +304,7 @@ class Comment extends CommonObject
$sql.= " AND c.entity = ".$conf->entity;
$sql.= " ORDER BY c.tms DESC";
- dol_syslog("Comment::fetchAllFor", LOG_DEBUG);
+ dol_syslog(get_class($this).'::'.__METHOD__, LOG_DEBUG);
$resql=$db->query($sql);
if ($resql)
{
@@ -313,12 +315,17 @@ class Comment extends CommonObject
{
$comment = new self($db);
$comment->fetch($obj->rowid);
- $TComments[] = $comment;
+ $this->comments[] = $comment;
}
}
$db->free($resql);
+ } else {
+ $error++; $this->errors[]="Error ".$this->db->lasterror();
+ return -1;
}
+
}
- return $TComments;
+
+ return count($this->comments);
}
}
\ No newline at end of file
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7e565e0222f..8abac10fc11 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -6678,8 +6678,14 @@ abstract class CommonObject
require_once DOL_DOCUMENT_ROOT.'/core/class/comment.class.php';
$comment = new Comment($this->db);
- $this->comments = Comment::fetchAllFor($this->element, $this->id);
- return 1;
+ $result=$comment->fetchAllFor($this->element, $this->id);
+ if ($result<0) {
+ $this->errors=array_merge($this->errors,$comment->errors);
+ return -1;
+ } else {
+ $this->comments = $comment->comments;
+ }
+ return count($this->comments);
}
/**
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 7b74fc05850..61d21cec7e8 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -3100,7 +3100,7 @@ class Form
* @param string $morecss Add more CSS on select tag
* @return void
*/
- function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=0, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
+ function select_types_paiements($selected='', $htmlname='paiementtype', $filtertype='', $format=0, $empty=1, $noadmininfo=0, $maxlength=0, $active=1, $morecss='')
{
global $langs,$user;
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index d3990acc9c8..faa548a5d16 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -545,9 +545,10 @@ class FormCompany
* @param array $limitto Disable answers that are not id in this array list
* @param int $forceid This is to force another object id than object->id
* @param string $moreparam String with more param to add into url when noajax search is used.
+ * @param string $morecss More CSS on select component
* @return int The selected third party ID
*/
- function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='')
+ function selectCompaniesForNewContact($object, $var_id, $selected='', $htmlname='newcompany', $limitto='', $forceid=0, $moreparam='', $morecss='')
{
global $conf, $langs;
@@ -649,7 +650,7 @@ class FormCompany
$resql = $this->db->query($sql);
if ($resql)
{
- print ' | ';
print ' ';
@@ -203,6 +232,23 @@ if (! empty($conf->banque->enabled))
print $langs->trans("BankAccount").' | ';
print $form->select_comptes($conf->global->STRIPE_BANK_ACCOUNT_FOR_PAYMENTS, 'STRIPE_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
print ' |
';
+
+ if ($conf->global->MAIN_FEATURES_LEVEL >= 2) // What is this for ?
+ {
+ print '