Clean code to debug fulldayevent
This commit is contained in:
parent
266fc808af
commit
d75dd51bb7
@ -280,7 +280,7 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
if (!$error) {
|
if (!$error) {
|
||||||
// Initialisation objet actioncomm
|
// Initialisation objet actioncomm
|
||||||
$object->priority = GETPOSTISSET("priority") ? GETPOST("priority", "int") : 0;
|
$object->priority = GETPOSTISSET("priority") ? GETPOST("priority", "int") : 0;
|
||||||
$object->fulldayevent = (!empty($fulldayevent) ? 1 : 0);
|
$object->fulldayevent = ($fulldayevent ? 1 : 0);
|
||||||
$object->location = GETPOST("location", 'alphanohtml');
|
$object->location = GETPOST("location", 'alphanohtml');
|
||||||
$object->label = GETPOST('label', 'alphanohtml');
|
$object->label = GETPOST('label', 'alphanohtml');
|
||||||
|
|
||||||
@ -1960,7 +1960,7 @@ if ($id > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Full day event
|
// Full day event
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent, 3).'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td>'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';
|
||||||
|
|
||||||
$rowspan = 4;
|
$rowspan = 4;
|
||||||
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
|
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) {
|
||||||
@ -1969,7 +1969,7 @@ if ($id > 0) {
|
|||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td>';
|
||||||
if (!$object->fulldayevent) {
|
if (empty($object->fulldayevent)) {
|
||||||
print dol_print_date($object->datep, 'dayhour', 'tzuser');
|
print dol_print_date($object->datep, 'dayhour', 'tzuser');
|
||||||
} else {
|
} else {
|
||||||
print dol_print_date($object->datep, 'day', 'tzuser');
|
print dol_print_date($object->datep, 'day', 'tzuser');
|
||||||
@ -1982,7 +1982,7 @@ if ($id > 0) {
|
|||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td>';
|
||||||
if (!$object->fulldayevent) {
|
if (empty($object->fulldayevent)) {
|
||||||
print dol_print_date($object->datef, 'dayhour', 'tzuser');
|
print dol_print_date($object->datef, 'dayhour', 'tzuser');
|
||||||
} else {
|
} else {
|
||||||
print dol_print_date($object->datef, 'day', 'tzuser');
|
print dol_print_date($object->datef, 'day', 'tzuser');
|
||||||
|
|||||||
@ -549,7 +549,11 @@ class ActionComm extends CommonObject
|
|||||||
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
|
$sql .= (isset($user->id) && $user->id > 0 ? $user->id : "null").", ";
|
||||||
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
|
$sql .= ($userownerid > 0 ? $userownerid : "null").", ";
|
||||||
$sql .= ($userdoneid > 0 ? $userdoneid : "null").", ";
|
$sql .= ($userdoneid > 0 ? $userdoneid : "null").", ";
|
||||||
$sql .= "'".$this->db->escape($this->label)."','".$this->db->escape($this->percentage)."','".$this->db->escape($this->priority)."','".$this->db->escape($this->fulldayevent)."','".$this->db->escape($this->location)."', ";
|
$sql .= "'".$this->db->escape($this->label)."', ";
|
||||||
|
$sql .= "'".$this->db->escape($this->percentage)."', ";
|
||||||
|
$sql .= "'".$this->db->escape($this->priority)."', ";
|
||||||
|
$sql .= "'".$this->db->escape($this->fulldayevent)."', ";
|
||||||
|
$sql .= "'".$this->db->escape($this->location)."', ";
|
||||||
$sql .= "'".$this->db->escape($this->transparency)."', ";
|
$sql .= "'".$this->db->escape($this->transparency)."', ";
|
||||||
$sql .= (!empty($this->fk_element) ? ((int) $this->fk_element) : "null").", ";
|
$sql .= (!empty($this->fk_element) ? ((int) $this->fk_element) : "null").", ";
|
||||||
$sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", ";
|
$sql .= (!empty($this->elementtype) ? "'".$this->db->escape($this->elementtype)."'" : "null").", ";
|
||||||
|
|||||||
@ -194,11 +194,11 @@ if ($object->id > 0) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Full day event
|
// Full day event
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent ? 1 : 0, 3).'</td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">';
|
||||||
if (!$object->fulldayevent) {
|
if (empty($object->fulldayevent)) {
|
||||||
print dol_print_date($object->datep, 'dayhour', 'tzuser');
|
print dol_print_date($object->datep, 'dayhour', 'tzuser');
|
||||||
} else {
|
} else {
|
||||||
print dol_print_date($object->datep, 'day', 'tzuser');
|
print dol_print_date($object->datep, 'day', 'tzuser');
|
||||||
@ -211,7 +211,7 @@ if ($object->id > 0) {
|
|||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
||||||
if (!$object->fulldayevent) {
|
if (empty($object->fulldayevent)) {
|
||||||
print dol_print_date($object->datef, 'dayhour', 'tzuser');
|
print dol_print_date($object->datef, 'dayhour', 'tzuser');
|
||||||
} else {
|
} else {
|
||||||
print dol_print_date($object->datef, 'day', 'tzuser');
|
print dol_print_date($object->datef, 'day', 'tzuser');
|
||||||
|
|||||||
@ -179,18 +179,11 @@ class modFicheinter extends DolibarrModules
|
|||||||
'fd.rowid'=>'InterLineId',
|
'fd.rowid'=>'InterLineId',
|
||||||
'fd.date'=>"InterLineDate", 'fd.duree'=>"InterLineDuration", 'fd.description'=>"InterLineDesc"
|
'fd.date'=>"InterLineDate", 'fd.duree'=>"InterLineDuration", 'fd.description'=>"InterLineDesc"
|
||||||
);
|
);
|
||||||
//$this->export_TypeFields_array[$r]=array(
|
|
||||||
// 's.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
|
|
||||||
// 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text',
|
|
||||||
// 's.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",
|
|
||||||
// 'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",
|
|
||||||
// 'fd.total_ht'=>"Numeric"
|
|
||||||
//);
|
|
||||||
$this->export_TypeFields_array[$r] = array(
|
$this->export_TypeFields_array[$r] = array(
|
||||||
's.rowid'=>"Numeric", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 's.fk_pays'=>'List:c_country:label', 's.phone'=>'Text', 's.siren'=>'Text',
|
's.rowid'=>"Numeric", 's.nom'=>'Text', 's.address'=>'Text', 's.zip'=>'Text', 's.town'=>'Text', 's.fk_pays'=>'List:c_country:label', 's.phone'=>'Text', 's.siren'=>'Text',
|
||||||
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text',
|
's.siret'=>'Text', 's.ape'=>'Text', 's.idprof4'=>'Text', 's.code_compta'=>'Text', 's.code_compta_fournisseur'=>'Text',
|
||||||
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.datec'=>"Date",
|
'f.rowid'=>'Numeric', 'f.ref'=>"Text", 'f.datec'=>"Date",
|
||||||
'f.duree'=>"Duree", 'f.fk_statut'=>'Numeric', 'f.description'=>"Text", 'f.datee'=>"Date", 'f.dateo'=>"Date", 'f.fulldayevent'=>"Boolean",
|
'f.duree'=>"Duree", 'f.fk_statut'=>'Numeric', 'f.description'=>"Text", 'f.datee'=>"Date", 'f.dateo'=>"Date", 'f.fulldayevent'=>"Text",
|
||||||
'pj.ref'=>'Text', 'pj.title'=>'Text',
|
'pj.ref'=>'Text', 'pj.title'=>'Text',
|
||||||
'fd.rowid'=>"Numeric", 'fd.date'=>"Date", 'fd.duree'=>"Duree", 'fd.description'=>"Text", 'fd.total_ht'=>"Numeric"
|
'fd.rowid'=>"Numeric", 'fd.date'=>"Date", 'fd.duree'=>"Duree", 'fd.description'=>"Text", 'fd.total_ht'=>"Numeric"
|
||||||
);
|
);
|
||||||
|
|||||||
@ -119,7 +119,7 @@ if (empty($reshook)) {
|
|||||||
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element == 'action' && $resource_type == 'dolresource' && intval($busy) == 1) {
|
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $objstat->element == 'action' && $resource_type == 'dolresource' && intval($busy) == 1) {
|
||||||
$eventDateStart = $objstat->datep;
|
$eventDateStart = $objstat->datep;
|
||||||
$eventDateEnd = $objstat->datef;
|
$eventDateEnd = $objstat->datef;
|
||||||
$isFullDayEvent = intval($objstat->fulldayevent);
|
$isFullDayEvent = $objstat->fulldayevent;
|
||||||
if (empty($eventDateEnd)) {
|
if (empty($eventDateEnd)) {
|
||||||
if ($isFullDayEvent) {
|
if ($isFullDayEvent) {
|
||||||
$eventDateStartArr = dol_getdate($eventDateStart);
|
$eventDateStartArr = dol_getdate($eventDateStart);
|
||||||
@ -194,7 +194,7 @@ if (empty($reshook)) {
|
|||||||
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type == 'action' && $object->resource_type == 'dolresource' && intval($object->busy) == 1) {
|
if (!empty($conf->global->RESOURCE_USED_IN_EVENT_CHECK) && $object->element_type == 'action' && $object->resource_type == 'dolresource' && intval($object->busy) == 1) {
|
||||||
$eventDateStart = $object->objelement->datep;
|
$eventDateStart = $object->objelement->datep;
|
||||||
$eventDateEnd = $object->objelement->datef;
|
$eventDateEnd = $object->objelement->datef;
|
||||||
$isFullDayEvent = intval($objstat->fulldayevent);
|
$isFullDayEvent = $objstat->fulldayevent;
|
||||||
if (empty($eventDateEnd)) {
|
if (empty($eventDateEnd)) {
|
||||||
if ($isFullDayEvent) {
|
if ($isFullDayEvent) {
|
||||||
$eventDateStartArr = dol_getdate($eventDateStart);
|
$eventDateStartArr = dol_getdate($eventDateStart);
|
||||||
@ -376,11 +376,11 @@ if (!$ret) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Full day event
|
// Full day event
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent, 3).'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($act->fulldayevent ? 1 : 0, 3).'</td></tr>';
|
||||||
|
|
||||||
// Date start
|
// Date start
|
||||||
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("DateActionStart").'</td><td colspan="3">';
|
||||||
if (!$act->fulldayevent) {
|
if (empty($act->fulldayevent)) {
|
||||||
print dol_print_date($act->datep, 'dayhour', 'tzuser');
|
print dol_print_date($act->datep, 'dayhour', 'tzuser');
|
||||||
} else {
|
} else {
|
||||||
print dol_print_date($act->datep, 'day', 'tzuser');
|
print dol_print_date($act->datep, 'day', 'tzuser');
|
||||||
@ -393,7 +393,7 @@ if (!$ret) {
|
|||||||
|
|
||||||
// Date end
|
// Date end
|
||||||
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
print '<tr><td>'.$langs->trans("DateActionEnd").'</td><td colspan="3">';
|
||||||
if (!$act->fulldayevent) {
|
if (empty($act->fulldayevent)) {
|
||||||
print dol_print_date($act->datef, 'dayhour', 'tzuser');
|
print dol_print_date($act->datef, 'dayhour', 'tzuser');
|
||||||
} else {
|
} else {
|
||||||
print dol_print_date($act->datef, 'day', 'tzuser');
|
print dol_print_date($act->datef, 'day', 'tzuser');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user