2
0
forked from Wavyzz/dolibarr

Debug v18

This commit is contained in:
Laurent Destailleur
2023-03-29 17:57:52 +02:00
parent 758c6a6263
commit c02fc4e177
2 changed files with 42 additions and 7 deletions

View File

@@ -927,6 +927,7 @@ if ($resql) {
} }
//var_dump($eventarray); //var_dump($eventarray);
// BIRTHDATES CALENDAR // BIRTHDATES CALENDAR
// Complete $eventarray with birthdates // Complete $eventarray with birthdates
if ($showbirthday) { if ($showbirthday) {
@@ -972,6 +973,8 @@ if ($showbirthday) {
$event->percentage = 100; $event->percentage = 100;
$event->fulldayevent = 1; $event->fulldayevent = 1;
$event->contact_id = $obj->rowid;
$event->date_start_in_calendar = $db->jdate($event->datep); $event->date_start_in_calendar = $db->jdate($event->datep);
$event->date_end_in_calendar = $db->jdate($event->datef); $event->date_end_in_calendar = $db->jdate($event->datef);
@@ -1800,7 +1803,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$color = ($event->icalcolor ? $event->icalcolor : -1); $color = ($event->icalcolor ? $event->icalcolor : -1);
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other'); $cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
} elseif ($event->type_code == 'BIRTHDAY') { } elseif ($event->type_code == 'BIRTHDAY') {
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday '; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]); $numbirthday++;
$colorindex = 2;
$cssclass = 'family_birthday ';
$color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
} else { } else {
$numother++; $numother++;
$color = ($event->icalcolor ? $event->icalcolor : -1); $color = ($event->icalcolor ? $event->icalcolor : -1);
@@ -1930,9 +1936,31 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$daterange = ''; $daterange = '';
if ($event->type_code == 'BIRTHDAY') { // It's birthday calendar if ($event->type_code == 'BIRTHDAY') {
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact'); // It's birthday calendar
} elseif ($event->type_code == 'HOLIDAY') { // It's holiday calendar $picb = '<i class="fas fa-birthday-cake inline-block"></i>';
//$pice = '<i class="fas fa-briefcase inline-block"></i>';
//$typea = ($objp->typea == 'birth') ? $picb : $pice;
//var_dump($event);
print $picb.' '.$langs->trans("Birthday").'<br>';
//print img_picto($langs->trans("Birthday"), 'birthday-cake').' ';
$tmpid = $event->id;
if (empty($cachecontacts[$tmpid])) {
$newcontact = new Contact($db);
$newcontact->fetch($tmpid);
$cachecontact[$tmpid] = $newcontact;
}
print $cachecontact[$tmpid]->getNomUrl(1);
//$event->picto = 'birthday-cake';
//print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
/*$listofcontacttoshow = '';
$listofcontacttoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valignmiddle');
print $listofcontacttoshow;
*/
} elseif ($event->type_code == 'HOLIDAY') {
// It's holiday calendar
$tmpholiday->fetch($event->id); $tmpholiday->fetch($event->id);
print $tmpholiday->getNomUrl(1); print $tmpholiday->getNomUrl(1);
@@ -1947,8 +1975,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$listofusertoshow = ''; $listofusertoshow = '';
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valignmiddle'); $listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valignmiddle');
print $listofusertoshow; print $listofusertoshow;
} else { // Other calendar } else {
// Picto // Other calendar
if (empty($event->fulldayevent)) { if (empty($event->fulldayevent)) {
//print $event->getNomUrl(2).' '; //print $event->getNomUrl(2).' ';
} }

View File

@@ -4131,7 +4131,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
if (empty($srconly) && in_array($pictowithouttext, array( if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected', '1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'accounting_account', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset', 'accountancy', 'accounting_account', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'asset',
'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'briefcase-medical', 'bug', 'building', 'bank_account', 'barcode', 'bank', 'bell', 'bill', 'billa', 'billr', 'billd', 'birthday-cake', 'bookmark', 'bom', 'briefcase-medical', 'bug', 'building',
'card', 'calendarlist', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype', 'card', 'calendarlist', 'calendar', 'calendarmonth', 'calendarweek', 'calendarday', 'calendarperuser', 'calendarpertype',
'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes', 'cash-register', 'category', 'chart', 'check', 'clock', 'close_title', 'cog', 'collab', 'company', 'contact', 'country', 'contract', 'conversation', 'cron', 'cubes',
'currency', 'multicurrency', 'currency', 'multicurrency',
@@ -11259,6 +11259,11 @@ function getElementProperties($element_type)
$classpath = 'categories/class'; $classpath = 'categories/class';
$module = 'categorie'; $module = 'categorie';
$subelement = 'categorie'; $subelement = 'categorie';
} elseif ($element_type == 'contact') {
$classpath = 'contact/class';
$classfile = 'contact';
$module = 'societe';
$subelement = 'contact';
} elseif ($element_type == 'stock') { } elseif ($element_type == 'stock') {
$classpath = 'product/stock/class'; $classpath = 'product/stock/class';
$classfile = 'entrepot'; $classfile = 'entrepot';
@@ -11377,6 +11382,8 @@ function fetchObjectByElement($element_id, $element_type, $element_ref = '')
$ret = 0; $ret = 0;
$element_prop = getElementProperties($element_type); $element_prop = getElementProperties($element_type);
//var_dump($element_prop);
if (is_array($element_prop) && isModEnabled($element_prop['module'])) { if (is_array($element_prop) && isModEnabled($element_prop['module'])) {
dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php'); dol_include_once('/'.$element_prop['classpath'].'/'.$element_prop['classfile'].'.class.php');