FIX Description of tags was mandatory in edit mode but not in create
mode. Should not be mandatory.
This commit is contained in:
parent
f2e2edbc64
commit
fe6af7d8eb
@ -82,20 +82,16 @@ if ($action == 'update' && $user->rights->categorie->creer)
|
|||||||
|
|
||||||
if (empty($categorie->label))
|
if (empty($categorie->label))
|
||||||
{
|
{
|
||||||
$action = 'create';
|
$error++;
|
||||||
|
$action = 'edit';
|
||||||
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("Label")), 'errors');
|
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))
|
if (empty($categorie->error))
|
||||||
{
|
{
|
||||||
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
|
$ret = $extrafields->setOptionalsFromPost($extralabels,$categorie);
|
||||||
if ($ret < 0) $error++;
|
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);
|
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$categorie->id.'&type='.$type);
|
||||||
exit;
|
exit;
|
||||||
@ -138,14 +134,14 @@ dol_fiche_head('');
|
|||||||
print '<table class="border" width="100%">';
|
print '<table class="border" width="100%">';
|
||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldrequired">';
|
print '<tr><td class="fieldrequired" width="25%">';
|
||||||
print $langs->trans("Ref").'</td>';
|
print $langs->trans("Ref").'</td>';
|
||||||
print '<td><input type="text" size="25" id="label" name ="label" value="'.$object->label.'" />';
|
print '<td><input type="text" size="25" id="label" name ="label" value="'.$object->label.'" />';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
print '<td class="fieldrequired" width="25%">'.$langs->trans("Description").'</td>';
|
print '<td>'.$langs->trans("Description").'</td>';
|
||||||
print '<td >';
|
print '<td >';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
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);
|
$doleditor=new DolEditor('description',$object->description,'',200,'dolibarr_notes','',false,true,$conf->fckeditor->enabled,ROWS_6,50);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user