diff --git a/htdocs/categories/edit.php b/htdocs/categories/edit.php index 362c2b324a1..98160cf9b6d 100644 --- a/htdocs/categories/edit.php +++ b/htdocs/categories/edit.php @@ -82,20 +82,16 @@ if ($action == 'update' && $user->rights->categorie->creer) if (empty($categorie->label)) { - $action = 'create'; + $error++; + $action = 'edit'; setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors'); } - if (empty($categorie->description)) - { - $action = 'create'; - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Description")), 'errors'); - } if (empty($categorie->error)) { $ret = $extrafields->setOptionalsFromPost($extralabels,$categorie); if ($ret < 0) $error++; - if ($categorie->update($user) > 0) + if (! $error && $categorie->update($user) > 0) { header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type); exit; @@ -138,14 +134,14 @@ dol_fiche_head(''); print '
| '; +print ' | ||
| '; print $langs->trans("Ref").' | '; print ''; print ' | |
| '.$langs->trans("Description").' | '; +print ''.$langs->trans("Description").' | '; print ''; require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('description',$object->description,'',200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50); |