diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php
index 0b9ba29da08..7a79b658a76 100644
--- a/htdocs/comm/fiche.php
+++ b/htdocs/comm/fiche.php
@@ -67,12 +67,19 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="nom";
+// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
+$hookmanager->initHooks(array('commcard'));
+
$object = new Societe($db);
/*
* Actions
*/
+$parameters = array('socid' => $id);
+$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
+
+
if ($action == 'setcustomeraccountancycode')
{
$result=$object->fetch($id);
@@ -814,6 +821,11 @@ if ($id > 0)
/*
* Barre d'actions
*/
+
+ $parameters = array();
+ $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
+
+
print '
';
if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 48ba0256ae7..efa0af07843 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1286,7 +1286,7 @@ function getListOfModels($db,$type,$maxfilenamelength=0)
$sql.= " WHERE type = '".$type."'";
$sql.= " AND entity IN (0,".(! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)?"1,":"").$conf->entity.")";
- dol_syslog(get_class($this).'::getListOfModels sql='.$sql, LOG_DEBUG);
+ dol_syslog('/core/lib/function2.lib.php::getListOfModels sql='.$sql, LOG_DEBUG);
$resql = $db->query($sql);
if ($resql)
{
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index e4b9ac53454..4c43c6c9e68 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -465,26 +465,46 @@ class Project extends CommonObject
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
+ if (!$resql)
+ {
+ $this->errors[] = $this->db->lasterror();
+ $error++;
+ }
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_task";
$sql.= " WHERE fk_projet=" . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
+ if (!$resql)
+ {
+ $this->errors[] = $this->db->lasterror();
+ $error++;
+ }
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet";
$sql.= " WHERE rowid=" . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
+ if (!$resql)
+ {
+ $this->errors[] = $this->db->lasterror();
+ $error++;
+ }
$sql = "DELETE FROM " . MAIN_DB_PREFIX . "projet_extrafields";
$sql.= " WHERE fk_object=" . $this->id;
dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
$resql = $this->db->query($sql);
+ if (!$resql)
+ {
+ $this->errors[] = $this->db->lasterror();
+ $error++;
+ }
- if ($resql)
+ if (empty($error))
{
// We remove directory
$projectref = dol_sanitizeFileName($this->ref);
@@ -496,9 +516,8 @@ class Project extends CommonObject
$res = @dol_delete_dir_recursive($dir);
if (!$res)
{
- $this->error = 'ErrorFailToDeleteDir';
- $this->db->rollback();
- return 0;
+ $this->errors[] = 'ErrorFailToDeleteDir';
+ $error++;
}
}
}
@@ -512,18 +531,25 @@ class Project extends CommonObject
if ($result < 0)
{
$error++;
- $this->errors = $interface->errors;
+ foreach ($interface->errors as $errmsg ) {
+ dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
+ $this->errors[] =$errmsg;
+ }
}
// End call triggers
}
+ }
- dol_syslog(get_class($this) . "::delete sql=" . $sql, LOG_DEBUG);
+ if (empty($error)) {
$this->db->commit();
return 1;
}
else
{
- $this->error = $this->db->lasterror();
+ foreach ( $this->errors as $errmsg ) {
+ dol_syslog(get_class($this) . "::delete " . $errmsg, LOG_ERR);
+ $this->error .= ($this->error ? ', ' . $errmsg : $errmsg);
+ }
dol_syslog(get_class($this) . "::delete " . $this->error, LOG_ERR);
$this->db->rollback();
return -1;
diff --git a/htdocs/projet/fiche.php b/htdocs/projet/fiche.php
index f1f360a3f81..d1295ae99b4 100644
--- a/htdocs/projet/fiche.php
+++ b/htdocs/projet/fiche.php
@@ -64,7 +64,7 @@ $result = restrictedArea($user, 'projet', $object->id);
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int'));
-$date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));;
+$date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));
/*