WIP to show event per hours
This commit is contained in:
parent
1a5cc4e516
commit
f800d50fec
@ -1236,8 +1236,12 @@ class ActionComm extends CommonObject
|
|||||||
|
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
// Set label of typ
|
// Set label of type
|
||||||
|
$labeltype = '';
|
||||||
|
if ($this->type_code)
|
||||||
|
{
|
||||||
$labeltype = ($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label;
|
$labeltype = ($langs->transnoentities("Action".$this->type_code) != "Action".$this->type_code)?$langs->transnoentities("Action".$this->type_code):$this->type_label;
|
||||||
|
}
|
||||||
if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
if (empty($conf->global->AGENDA_USE_EVENT_TYPE))
|
||||||
{
|
{
|
||||||
if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL');
|
if ($this->type_code != 'AC_OTH_AUTO') $labeltype = $langs->trans('ActionAC_MANUAL');
|
||||||
@ -1289,7 +1293,7 @@ class ActionComm extends CommonObject
|
|||||||
$linkstart.=$linkclose.'>';
|
$linkstart.=$linkclose.'>';
|
||||||
$linkend='</a>';
|
$linkend='</a>';
|
||||||
|
|
||||||
//print 'rrr'.$this->libelle.'-'.$withpicto;
|
//print 'rrr'.$this->libelle.'rrr'.$this->label.'rrr'.$withpicto;
|
||||||
|
|
||||||
if ($withpicto == 2)
|
if ($withpicto == 2)
|
||||||
{
|
{
|
||||||
@ -1309,7 +1313,10 @@ class ActionComm extends CommonObject
|
|||||||
{
|
{
|
||||||
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) // Add code into ()
|
if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) // Add code into ()
|
||||||
{
|
{
|
||||||
$libelle.=(($this->type_code && $libelle!=$langs->transnoentities("Action".$this->type_code) && $langs->transnoentities("Action".$this->type_code)!="Action".$this->type_code)?' ('.$langs->transnoentities("Action".$this->type_code).')':'');
|
if ($labeltype)
|
||||||
|
{
|
||||||
|
$libelle.=(preg_match('/'.preg_quote($labeltype,'/').'/', $libelle)?'':' ('.$langs->transnoentities("Action".$this->type_code).')');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -589,6 +589,7 @@ if ($resql)
|
|||||||
$event->type_color=$obj->type_color;
|
$event->type_color=$obj->type_color;
|
||||||
|
|
||||||
$event->libelle=$obj->label;
|
$event->libelle=$obj->label;
|
||||||
|
$event->label=$obj->label;
|
||||||
$event->percentage=$obj->percent;
|
$event->percentage=$obj->percent;
|
||||||
$event->authorid=$obj->fk_user_author; // user id of creator
|
$event->authorid=$obj->fk_user_author; // user id of creator
|
||||||
$event->userownerid=$obj->fk_user_action; // user id of owner
|
$event->userownerid=$obj->fk_user_action; // user id of owner
|
||||||
@ -601,7 +602,9 @@ if ($resql)
|
|||||||
$event->elementtype=$obj->elementtype;
|
$event->elementtype=$obj->elementtype;
|
||||||
|
|
||||||
$event->societe->id=$obj->fk_soc;
|
$event->societe->id=$obj->fk_soc;
|
||||||
|
$event->thirdparty_id=$obj->fk_soc;
|
||||||
$event->contact->id=$obj->fk_contact;
|
$event->contact->id=$obj->fk_contact;
|
||||||
|
$event->contact_id=$obj->fk_contact;
|
||||||
|
|
||||||
// Defined date_start_in_calendar and date_end_in_calendar property
|
// Defined date_start_in_calendar and date_end_in_calendar property
|
||||||
// They are date start and end of action but modified to not be outside calendar view.
|
// They are date start and end of action but modified to not be outside calendar view.
|
||||||
@ -1176,19 +1179,72 @@ else // View by day
|
|||||||
$timestamp=dol_mktime(12,0,0,$month,$day,$year);
|
$timestamp=dol_mktime(12,0,0,$month,$day,$year);
|
||||||
$arraytimestamp=dol_getdate($timestamp);
|
$arraytimestamp=dol_getdate($timestamp);
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
//echo '<table class="tagtable centpercent noborder nocellnopadd cal_pannel cal_month">';
|
||||||
echo '<table width="100%" class="noborder nocellnopadd cal_pannel cal_month">';
|
echo '<table class="tagtable centpercent noborder nocellnopadd cal_pannel cal_month noborderbottom" style="margin-bottom: 5px !important;">';
|
||||||
echo ' <tr class="liste_titre">';
|
|
||||||
echo ' <td align="center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
|
echo ' <tr class="tagtr liste_titre">';
|
||||||
echo " </tr>\n";
|
echo ' <td class="tagtd width100"></td>';
|
||||||
echo " <tr>\n";
|
echo ' <td class="tagtd center">'.$langs->trans("Day".$arraytimestamp['wday'])."</td>\n";
|
||||||
echo ' <td class="'.$style.'" width="14%" valign="top">';
|
echo " </td>\n";
|
||||||
$maxnbofchar=80;
|
|
||||||
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300);
|
/*
|
||||||
echo "</td>\n";
|
echo ' <div class="tagtr">';
|
||||||
echo " </tr>\n";
|
echo ' <div class="tagtd width100"></div>';
|
||||||
|
echo ' <div class="tagtd center">';
|
||||||
|
echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1);
|
||||||
|
echo ' </div>'."\n";
|
||||||
|
echo " </div>\n";
|
||||||
|
*/
|
||||||
|
|
||||||
echo '</table>';
|
echo '</table>';
|
||||||
|
|
||||||
|
/* WIP View per hour */
|
||||||
|
$useviewhour = 0;
|
||||||
|
if ($useviewhour)
|
||||||
|
{
|
||||||
|
print '<div class="div-table-responsive-no-min borderbottom">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
|
|
||||||
|
$maxheightwin=(isset($_SESSION["dol_screenheight"]) && $_SESSION["dol_screenheight"] > 500)?($_SESSION["dol_screenheight"]-200):660; // Also into index.php file
|
||||||
|
|
||||||
|
echo '<div style="max-height: '.$maxheightwin.'px;">';
|
||||||
|
echo '<div class="tagtable centpercent calendarviewcontainer">';
|
||||||
|
|
||||||
|
$maxnbofchar=80;
|
||||||
|
|
||||||
|
$tmp = explode('-', $conf->global->MAIN_DEFAULT_WORKING_HOURS);
|
||||||
|
$minhour = round($tmp[0],0);
|
||||||
|
$maxhour = round($tmp[1],0);
|
||||||
|
if ($minhour > 23) $minhour = 23;
|
||||||
|
if ($maxhour < 1) $maxhour = 1;
|
||||||
|
if ($maxhour <= $minhour) { $maxhour = $minhour + 1; }
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
$j = 0;
|
||||||
|
while ($i < 24)
|
||||||
|
{
|
||||||
|
echo ' <div class="tagtr calendarviewcontainertr">'."\n";
|
||||||
|
echo ' <div class="tagtd width100 tdtop">'.dol_print_date($i*3600, 'hour', 'gmt').'</div>';
|
||||||
|
echo ' <div class="tagtd '.$style.' tdtop">';
|
||||||
|
echo " </div>\n";
|
||||||
|
echo " </div>\n";
|
||||||
|
$i++;
|
||||||
|
$j++;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '</div></div>';
|
||||||
|
|
||||||
|
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 1);
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<div class="div-table-responsive-no-min">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
||||||
|
|
||||||
|
show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, 0);
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print "\n".'</form>';
|
print "\n".'</form>';
|
||||||
@ -1213,9 +1269,10 @@ $db->close();
|
|||||||
* @param string $newparam Parameters on current URL
|
* @param string $newparam Parameters on current URL
|
||||||
* @param int $showinfo Add extended information (used by day and week view)
|
* @param int $showinfo Add extended information (used by day and week view)
|
||||||
* @param int $minheight Minimum height for each event. 60px by default.
|
* @param int $minheight Minimum height for each event. 60px by default.
|
||||||
|
* @param string $nonew 0=Add "new entry button", 1=No "new entry button", -1=Only "new entry button"
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60)
|
function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventarray, $maxprint=0, $maxnbofchar=16, $newparam='', $showinfo=0, $minheight=60, $nonew=0)
|
||||||
{
|
{
|
||||||
global $user, $conf, $langs;
|
global $user, $conf, $langs;
|
||||||
global $action, $filter, $filtert, $status, $actioncode; // Filters used into search form
|
global $action, $filter, $filtert, $status, $actioncode; // Filters used into search form
|
||||||
@ -1230,6 +1287,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
||||||
print '<div id="dayevent_'.$dateint.'" class="dayevent tagtable centpercent nobordernopadding">'."\n";
|
print '<div id="dayevent_'.$dateint.'" class="dayevent tagtable centpercent nobordernopadding">'."\n";
|
||||||
|
|
||||||
|
if ($nonew <= 0)
|
||||||
|
{
|
||||||
print '<div class="tagtr"><div class="nowrap float">';
|
print '<div class="tagtr"><div class="nowrap float">';
|
||||||
print '<a style="color: #666" href="'.DOL_URL_ROOT.'/comm/action/index.php?';
|
print '<a style="color: #666" href="'.DOL_URL_ROOT.'/comm/action/index.php?';
|
||||||
print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
|
print 'action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
|
||||||
@ -1250,6 +1309,13 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</div></div>'."\n";
|
print '</div></div>'."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($nonew < 0)
|
||||||
|
{
|
||||||
|
print '</div>';
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Line with td contains all div of each events
|
// Line with td contains all div of each events
|
||||||
print '<div class="tagtr">';
|
print '<div class="tagtr">';
|
||||||
@ -1390,6 +1456,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
//print ' position: absolute; top: 40px; width: 50%;';
|
//print ' position: absolute; top: 40px; width: 50%;';
|
||||||
//print '"';
|
//print '"';
|
||||||
print '>';
|
print '>';
|
||||||
|
|
||||||
//var_dump($event->userassigned);
|
//var_dump($event->userassigned);
|
||||||
//var_dump($event->transparency);
|
//var_dump($event->transparency);
|
||||||
print '<table class="centpercent cal_event'.(empty($event->transparency)?' cal_event_notbusy':' cal_event_busy').'" style="'.$h;
|
print '<table class="centpercent cal_event'.(empty($event->transparency)?' cal_event_notbusy':' cal_event_busy').'" style="'.$h;
|
||||||
@ -1475,9 +1542,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
if ($event->type_code == 'ICALEVENT') print $titletoshow;
|
if ($event->type_code == 'ICALEVENT') print $titletoshow;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$savlabel=$event->libelle;
|
$savlabel=$event->label?$event->label:$event->libelle;
|
||||||
|
$event->label=$titletoshow;
|
||||||
$event->libelle=$titletoshow;
|
$event->libelle=$titletoshow;
|
||||||
print $event->getNomUrl(0,$maxnbofchar,'cal_event','',0,1);
|
print $event->getNomUrl(0,$maxnbofchar,'cal_event','',0,1);
|
||||||
|
$event->label=$savlabel;
|
||||||
$event->libelle=$savlabel;
|
$event->libelle=$savlabel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3768,13 +3768,16 @@ table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px
|
|||||||
table.cal_event td { border: none; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 2px; padding-top: 0px; padding-bottom: 0px; }
|
table.cal_event td { border: none; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 2px; padding-top: 0px; padding-bottom: 0px; }
|
||||||
table.cal_event td.cal_event { padding: 4px 4px !important; }
|
table.cal_event td.cal_event { padding: 4px 4px !important; }
|
||||||
table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
||||||
.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event { font-size: 1em; }
|
||||||
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event a:link { color: #111111; font-weight: normal !important; }
|
||||||
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event a:visited { color: #111111; font-weight: normal !important; }
|
||||||
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
.cal_event a:active { color: #111111; font-weight: normal !important; }
|
||||||
|
.cal_event_busy a:hover { color: #111111; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||||
.cal_event_busy { }
|
.cal_event_busy { }
|
||||||
.cal_peruserviewname { max-width: 140px; height: 22px; }
|
.cal_peruserviewname { max-width: 140px; height: 22px; }
|
||||||
|
|
||||||
|
.calendarviewcontainertr { height: 100px; }
|
||||||
|
|
||||||
|
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
/* Ajax - Liste deroulante de l'autocompletion */
|
/* Ajax - Liste deroulante de l'autocompletion */
|
||||||
|
|||||||
@ -3734,10 +3734,11 @@ table.cal_event { border: none; border-collapse: collapse; margin-bottom: 1px
|
|||||||
table.cal_event td { border: none; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 2px; padding-top: 0px; padding-bottom: 0px; }
|
table.cal_event td { border: none; padding-<?php print $left; ?>: 2px; padding-<?php print $right; ?>: 2px; padding-top: 0px; padding-bottom: 0px; }
|
||||||
table.cal_event td.cal_event { padding: 4px 4px !important; }
|
table.cal_event td.cal_event { padding: 4px 4px !important; }
|
||||||
table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
||||||
.cal_event a:link { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event { font-size: 1em; }
|
||||||
.cal_event a:visited { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event a:link { color: #111111; font-weight: normal !important; }
|
||||||
.cal_event a:active { color: #111111; font-size: 11px; font-weight: normal !important; }
|
.cal_event a:visited { color: #111111; font-weight: normal !important; }
|
||||||
.cal_event_busy a:hover { color: #111111; font-size: 11px; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
.cal_event a:active { color: #111111; font-weight: normal !important; }
|
||||||
|
.cal_event_busy a:hover { color: #111111; font-weight: normal !important; color:rgba(255,255,255,.75); }
|
||||||
.cal_event_busy { }
|
.cal_event_busy { }
|
||||||
.cal_peruserviewname { max-width: 140px; height: 22px; }
|
.cal_peruserviewname { max-width: 140px; height: 22px; }
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user