diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 216702da9ed..a4a270f5227 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -259,10 +259,6 @@ if (empty($reshook)) { } $id = $object->create($user); - if ($id < 0) { - setEventMessages($object->error, $object->errors, 'errors'); - } - if ($id > 0) { dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); @@ -374,6 +370,9 @@ if (empty($reshook)) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } + if ($error) { + $action = 'create'; + } } else { $result = $object->create($user); if ($result > 0) { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 93353f91e07..bd8ab4c22f4 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7915,7 +7915,7 @@ abstract class CommonObject // a first td column was already output (and may be another on before if MAIN_VIEW_LINE_NUMBER set), so this td is the next one $out .= ''; } elseif ($display_type == 'line') { - $out .= '
'; + $out .= '
'; } switch ($mode) { diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index ff45a028d51..5fc162634a8 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1644,15 +1644,18 @@ class ExtraFields } } } else { - require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php'; - $toprint = array(); $obj = $this->db->fetch_object($resql); - $c = new Categorie($this->db); - $c->fetch($obj->rowid); - $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text - foreach ($ways as $way) { - $toprint[] = '
  • color ? ' style="background: #'.$c->color.';"' : ' style="background: #bbb"').'>'.img_object('', 'category').' '.$way.'
  • '; + if ($obj->rowid) { + require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php'; + $c = new Categorie($this->db); + $result = $c->fetch($obj->rowid); + if ($result > 0) { + $ways = $c->print_all_ways(); // $ways[0] = "ccc2 >> ccc2a >> ccc2a1" with html formatted text + foreach ($ways as $way) { + $toprint[] = '
  • color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . img_object('', 'category') . ' ' . $way . '
  • '; + } + } } $value = '
      '.implode(' ', $toprint).'
    '; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e02a601c9cd..ab08d5c04f8 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -390,11 +390,15 @@ if (empty($reshook)) { } } } else { - $mesg = $srcobject->error; + $langs->load("errors"); + setEventMessages($srcobject->error, $srcobject->errors, 'errors'); + $action = 'create'; $error++; } } else { - $mesg = $object->error; + $langs->load("errors"); + setEventMessages($object->error, $object->errors, 'errors'); + $action = 'create'; $error++; } } else { @@ -418,12 +422,14 @@ if (empty($reshook)) { $langs->load("errors"); setEventMessages($object->error, $object->errors, 'errors'); $action = 'create'; + $error++; } } } } else { $mesg = $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")); $action = 'create'; + $error++; } } elseif ($action == 'update' && $user->rights->ficheinter->creer) { $object->socid = $socid; diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 8e773f92788..f163af75cae 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -119,6 +119,8 @@ if ($action == 'update' && !GETPOST("cancel") && $user->rights->projet->creer) { setEventMessages($object->error, $object->errors, 'errors'); $action = 'edit'; } + } else { + $action = 'edit'; } } else { $action = 'edit'; diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index a5837c2557f..56eef9fb632 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -319,8 +319,20 @@ if (empty($reshook)) { if (!$error) { if ($origin && $originid) { - $element = 'supplier_proposal'; - $subelement = 'supplier_proposal'; + $element = $subelement = $origin; + if (preg_match('/^([^_]+)_([^_]+)/i', $origin, $regs)) { + $element = $regs[1]; + $subelement = $regs[2]; + } + + // For compatibility + if ($element == 'order') { + $element = $subelement = 'commande'; + } + if ($element == 'propal') { + $element = 'comm/propal'; + $subelement = 'propal'; + } $object->origin = $origin; $object->origin_id = $originid; @@ -1079,8 +1091,20 @@ if ($action == 'create') { // Load objectsrc if (!empty($origin) && !empty($originid)) { - $element = 'supplier_proposal'; - $subelement = 'supplier_proposal'; + $element = $subelement = GETPOST('origin'); + if (preg_match('/^([^_]+)_([^_]+)/i', GETPOST('origin'), $regs)) { + $element = $regs[1]; + $subelement = $regs[2]; + } + + // For compatibility + if ($element == 'order' || $element == 'commande') { + $element = $subelement = 'commande'; + } + if ($element == 'propal') { + $element = 'comm/propal'; + $subelement = 'propal'; + } dol_include_once('/'.$element.'/class/'.$subelement.'.class.php'); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 156c996d12d..43dfbf67869 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -7448,6 +7448,11 @@ if (!empty($conf->global->THEME_CUSTOM_CSS)) { ?> + div.extra_inline_chkbxlst, + div.extra_inline_checkbox { + min-width:150px; + } + /* Must be at end */ div.flot-text .flot-tick-label .tickLabel, .fa-color-unset { color: unset;