Merge branch '7.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
e621daa61d
@ -63,7 +63,7 @@ if ($action == 'add' && ! empty($permissiontoadd))
|
|||||||
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
|
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
|
||||||
|
|
||||||
$object->$key=$value;
|
$object->$key=$value;
|
||||||
if ($val['notnull'] > 0 && $object->$key == '')
|
if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default']))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors');
|
||||||
@ -118,7 +118,7 @@ if ($action == 'update' && ! empty($permissiontoadd))
|
|||||||
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
|
if (! empty($object->fields[$key]['foreignkey']) && $value == '-1') $value=''; // This is an explicit foreign key field
|
||||||
|
|
||||||
$object->$key=$value;
|
$object->$key=$value;
|
||||||
if ($val['notnull'] > 0 && $object->$key == '')
|
if ($val['notnull'] > 0 && $object->$key == '' && is_null($val['default']))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv($val['label'])), null, 'errors');
|
||||||
|
|||||||
@ -23,8 +23,8 @@
|
|||||||
|
|
||||||
// $mysoc must be defined
|
// $mysoc must be defined
|
||||||
// $id must be defined
|
// $id must be defined
|
||||||
// $paramname must be defined
|
// $paramname may be defined
|
||||||
// $mode must be defined (used to know the automatic BCC to add)
|
// $autocopy may be defined (used to know the automatic BCC to add)
|
||||||
// $trigger_name must be set (can be '')
|
// $trigger_name must be set (can be '')
|
||||||
// $actiontypecode can be set
|
// $actiontypecode can be set
|
||||||
// $object and $uobject may be defined
|
// $object and $uobject may be defined
|
||||||
|
|||||||
@ -5672,11 +5672,19 @@ abstract class CommonObject
|
|||||||
elseif ($key == 'status' && method_exists($this, 'getLibStatut')) $value=$this->getLibStatut(3);
|
elseif ($key == 'status' && method_exists($this, 'getLibStatut')) $value=$this->getLibStatut(3);
|
||||||
elseif ($type == 'date')
|
elseif ($type == 'date')
|
||||||
{
|
{
|
||||||
|
if(! empty($value)) {
|
||||||
$value=dol_print_date($value,'day');
|
$value=dol_print_date($value,'day');
|
||||||
|
} else {
|
||||||
|
$value='';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($type == 'datetime')
|
elseif ($type == 'datetime')
|
||||||
{
|
{
|
||||||
|
if(! empty($value)) {
|
||||||
$value=dol_print_date($value,'dayhour');
|
$value=dol_print_date($value,'dayhour');
|
||||||
|
} else {
|
||||||
|
$value='';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif ($type == 'double')
|
elseif ($type == 'double')
|
||||||
{
|
{
|
||||||
@ -6734,7 +6742,7 @@ abstract class CommonObject
|
|||||||
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]='';
|
if (! empty($this->fields[$key]['foreignkey']) && $values[$key] == '-1') $values[$key]='';
|
||||||
|
|
||||||
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
//var_dump($key.'-'.$values[$key].'-'.($this->fields[$key]['notnull'] == 1));
|
||||||
if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]))
|
if ($this->fields[$key]['notnull'] == 1 && ! isset($values[$key]) && is_null($val['default']))
|
||||||
{
|
{
|
||||||
$error++;
|
$error++;
|
||||||
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
$this->errors[]=$langs->trans("ErrorFieldRequired", $this->fields[$key]['label']);
|
||||||
|
|||||||
@ -347,6 +347,9 @@ class Conf
|
|||||||
$this->fournisseur->facture=new stdClass();
|
$this->fournisseur->facture=new stdClass();
|
||||||
$this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture";
|
$this->fournisseur->facture->dir_output =$rootfordata."/fournisseur/facture";
|
||||||
$this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp";
|
$this->fournisseur->facture->dir_temp =$rootfordata."/fournisseur/facture/temp";
|
||||||
|
$this->supplierproposal=new stdClass();
|
||||||
|
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
|
||||||
|
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
|
||||||
$this->fournisseur->payment=new stdClass();
|
$this->fournisseur->payment=new stdClass();
|
||||||
$this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment";
|
$this->fournisseur->payment->dir_output =$rootfordata."/fournisseur/payment";
|
||||||
$this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp";
|
$this->fournisseur->payment->dir_temp =$rootfordata."/fournisseur/payment/temp";
|
||||||
@ -362,6 +365,9 @@ class Conf
|
|||||||
$this->supplier_invoice->enabled=1;
|
$this->supplier_invoice->enabled=1;
|
||||||
$this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture";
|
$this->supplier_invoice->dir_output=$rootfordata."/fournisseur/facture";
|
||||||
$this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp";
|
$this->supplier_invoice->dir_temp=$rootfordata."/fournisseur/facture/temp";
|
||||||
|
$this->supplierproposal=new stdClass();
|
||||||
|
$this->supplierproposal->dir_output=$rootfordata."/supplier_proposal";
|
||||||
|
$this->supplierproposal->dir_temp=$rootfordata."/supplier_proposal/temp";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user