Fix date of extrafields
This commit is contained in:
parent
1128b66b30
commit
8d20473ffd
@ -1198,6 +1198,11 @@ class Contrat extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Clean parameters
|
||||
if (empty($this->fk_commercial_signature) && $this->commercial_signature_id > 0) $this->fk_commercial_signature = $this->commercial_signature_id;
|
||||
if (empty($this->fk_commercial_suivi) && $this->commercial_suivi_id > 0) $this->fk_commercial_suivi = $this->commercial_suivi_id;
|
||||
if (empty($this->fk_soc) && $this->socid > 0) $this->fk_soc = $this->socid;
|
||||
if (empty($this->fk_project) && $this->projet > 0) $this->fk_project = $this->projet;
|
||||
|
||||
if (isset($this->ref)) $this->ref=trim($this->ref);
|
||||
if (isset($this->ref_customer)) $this->ref_customer=trim($this->ref_customer);
|
||||
if (isset($this->ref_supplier)) $this->ref_supplier=trim($this->ref_supplier);
|
||||
@ -1205,7 +1210,7 @@ class Contrat extends CommonObject
|
||||
if (isset($this->entity)) $this->entity=trim($this->entity);
|
||||
if (isset($this->statut)) $this->statut=(int) $this->statut;
|
||||
if (isset($this->fk_soc)) $this->fk_soc=trim($this->fk_soc);
|
||||
if (isset($this->fk_projet)) $this->fk_projet=trim($this->fk_projet);
|
||||
if (isset($this->fk_project)) $this->fk_project=trim($this->fk_project);
|
||||
if (isset($this->fk_commercial_signature)) $this->fk_commercial_signature=trim($this->fk_commercial_signature);
|
||||
if (isset($this->fk_commercial_suivi)) $this->fk_commercial_suivi=trim($this->fk_commercial_suivi);
|
||||
if (isset($this->fk_user_mise_en_service)) $this->fk_user_mise_en_service=trim($this->fk_user_mise_en_service);
|
||||
@ -1231,7 +1236,7 @@ class Contrat extends CommonObject
|
||||
$sql.= " fin_validite=".(dol_strlen($this->fin_validite)!=0 ? "'".$this->db->idate($this->fin_validite)."'" : 'null').",";
|
||||
$sql.= " date_cloture=".(dol_strlen($this->date_cloture)!=0 ? "'".$this->db->idate($this->date_cloture)."'" : 'null').",";
|
||||
$sql.= " fk_soc=".(isset($this->fk_soc)?$this->fk_soc:"null").",";
|
||||
$sql.= " fk_projet=".(isset($this->fk_projet)?$this->fk_projet:"null").",";
|
||||
$sql.= " fk_projet=".(isset($this->fk_project)?$this->fk_project:"null").",";
|
||||
$sql.= " fk_commercial_signature=".(isset($this->fk_commercial_signature)?$this->fk_commercial_signature:"null").",";
|
||||
$sql.= " fk_commercial_suivi=".(isset($this->fk_commercial_suivi)?$this->fk_commercial_suivi:"null").",";
|
||||
$sql.= " fk_user_mise_en_service=".(isset($this->fk_user_mise_en_service)?$this->fk_user_mise_en_service:"null").",";
|
||||
|
||||
@ -714,7 +714,7 @@ if ($resql)
|
||||
// Date
|
||||
if (! empty($arrayfields['c.date_contrat']['checked']))
|
||||
{
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day').'</td>';
|
||||
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzuser').'</td>';
|
||||
}
|
||||
// Extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
|
||||
@ -742,7 +742,7 @@ if ($resql)
|
||||
if (! empty($arrayfields['lower_planned_end_date']['checked']))
|
||||
{
|
||||
print '<td align="center" class="nowrap">';
|
||||
print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day');
|
||||
print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -145,7 +145,7 @@ class ExtraFields
|
||||
* @param string $computed Computed value
|
||||
* @param string $entity Entity of extrafields
|
||||
* @param string $langfile Language file
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
* @return int <=0 if KO, >0 if OK
|
||||
*/
|
||||
function addExtraField($attrname, $label, $type, $pos, $size, $elementtype, $unique=0, $required=0, $default_value='', $param='', $alwayseditable=0, $perms='', $list=-1, $ishidden=0, $computed='', $entity='', $langfile='')
|
||||
{
|
||||
@ -234,6 +234,7 @@ class ExtraFields
|
||||
} else {
|
||||
$typedb=$type;
|
||||
$lengthdb=$length;
|
||||
if ($type == 'varchar' && empty($lengthdb)) $lengthdb='255';
|
||||
}
|
||||
$field_desc = array(
|
||||
'type'=>$typedb,
|
||||
@ -1362,12 +1363,12 @@ class ExtraFields
|
||||
if ($type == 'date')
|
||||
{
|
||||
$showsize=10;
|
||||
$value=dol_print_date($value,'day');
|
||||
$value=dol_print_date($value, 'day', 'tzuser');
|
||||
}
|
||||
elseif ($type == 'datetime')
|
||||
{
|
||||
$showsize=19;
|
||||
$value=dol_print_date($value,'dayhour');
|
||||
$value=dol_print_date($value, 'dayhour', 'tzuser');
|
||||
}
|
||||
elseif ($type == 'int')
|
||||
{
|
||||
@ -1389,7 +1390,7 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'mail')
|
||||
{
|
||||
$value=dol_print_email($value,0,0,0,64,1,1);
|
||||
$value=dol_print_email($value, 0, 0, 0, 64, 1, 1);
|
||||
}
|
||||
elseif ($type == 'url')
|
||||
{
|
||||
@ -1401,7 +1402,7 @@ class ExtraFields
|
||||
}
|
||||
elseif ($type == 'price')
|
||||
{
|
||||
$value=price($value,0,$langs,0,0,-1,$conf->currency);
|
||||
$value=price($value, 0, $langs, 0, 0, -1, $conf->currency);
|
||||
}
|
||||
elseif ($type == 'select')
|
||||
{
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to show all columns of extrafields from $obj, $extrafields and $db
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
@ -10,7 +11,15 @@ if (is_array($extrafields->attribute_label) && count($extrafields->attribute_lab
|
||||
if ($align) print ' align="'.$align.'"';
|
||||
print '>';
|
||||
$tmpkey='options_'.$key;
|
||||
print $extrafields->showOutputField($key, $obj->$tmpkey, '');
|
||||
if (in_array($extrafields->attribute_type[$key], array('date', 'datetime', 'timestamp')))
|
||||
{
|
||||
$value = $db->jdate($obj->$tmpkey);
|
||||
}
|
||||
else
|
||||
{
|
||||
$value = $obj->$tmpkey;
|
||||
}
|
||||
print $extrafields->showOutputField($key, $value, '');
|
||||
print '</td>';
|
||||
if (! $i) $totalarray['nbfield']++;
|
||||
if (! empty($val['isameasure']))
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to show all columns of extrafields for the search title line
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to complete $param for extrafields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
$crit=$val;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to complete the sql search criterias from extrafields
|
||||
foreach ($search_array_options as $key => $val)
|
||||
{
|
||||
$crit=$val;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
// Loop to show all columns of extrafields for the title line
|
||||
if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
|
||||
{
|
||||
foreach($extrafields->attribute_label as $key => $val)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user