Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into ADD_SUBSTITUTION_DELIVRY_DATE

This commit is contained in:
Anthony Berton
2021-02-19 09:13:37 +01:00
16 changed files with 317 additions and 214 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

View File

@@ -326,7 +326,8 @@ print '</td></tr>';
print '<tr class="oddeven"><td>'.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").'</td><td>';
//if (! empty($conf->global->MAIN_MULTILANGS))
//{
print $formadmin->select_language(GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0), 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
$selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0);
print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1);
//} else {
// print '<span class="opacitymedium">'.$langs->trans("MultiLangNotEnabled").'</span>';
//}

View File

@@ -730,8 +730,8 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate')
{
$error = 0;
$shour = dol_print_date($object->datep, "%H");
$smin = dol_print_date($object->datep, "%M");
$shour = dol_print_date($object->datep, "%H", 'tzuserrel'); // We take the date visible by user $newdate is also date visible by user.
$smin = dol_print_date($object->datep, "%M", 'tzuserrel');
$newdate = GETPOST('newdate', 'alpha');
if (empty($newdate) || strpos($newdate, 'dayevent_') != 0)
@@ -740,7 +740,9 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate')
exit;
}
$datep = dol_mktime($shour, $smin, 0, substr($newdate, 13, 2), substr($newdate, 15, 2), substr($newdate, 9, 4));
$datep = dol_mktime($shour, $smin, 0, substr($newdate, 13, 2), substr($newdate, 15, 2), substr($newdate, 9, 4), 'tzuserrel');
//print dol_print_date($datep, 'dayhour');exit;
if ($datep != $object->datep)
{
if (!empty($object->datef))

View File

@@ -85,6 +85,11 @@ class ActionComm extends CommonObject
*/
public $type_id;
/**
* @var string Calendar of event (Type of type of event). 'system'=Default calendar, 'systemauto'=Auto calendar, 'birthdate', 'holiday', 'module'=Calendar specific to a module
*/
public $type;
/**
* @var string Code into parent table llx_c_actioncomm (used only if option to use type is set). With default setup, should be AC_OTH_AUTO or AC_OTH.
*/
@@ -95,16 +100,16 @@ class ActionComm extends CommonObject
*/
public $type_label;
/**
* @var string Label into parent table llx_c_actioncomm (used only if option to use type is set)
*/
public $type;
/**
* @var string Color into parent table llx_c_actioncomm (used only if option to use type is set)
*/
public $type_color;
/**
* @var string Picto for type of event (used only if option to use type is set)
*/
public $type_picto;
/**
* @var string Free code to identify action. Ie: Agenda trigger add here AC_TRIGGERNAME ('AC_COMPANY_CREATE', 'AC_PROPAL_VALIDATE', ...)
*/
@@ -1376,7 +1381,7 @@ class ActionComm extends CommonObject
* @param int $maxlength Max number of charaters into label. If negative, use the ref as label.
* @param string $classname Force style class on a link
* @param string $option '' = Link to action, 'birthday'= Link to contact, 'holiday' = Link to leave
* @param int $overwritepicto 1 = Overwrite picto
* @param int $overwritepicto 1 = Overwrite picto with this one
* @param int $notooltip 1 = Disable tooltip
* @param int $save_lastsearch_value -1 = Auto, 0 = No save of lastsearch_values when clicking, 1 = Save lastsearch_values whenclicking
* @return string Chaine avec URL
@@ -1426,8 +1431,8 @@ class ActionComm extends CommonObject
if (!empty($this->note_private))
$tooltip .= '<br><b>'.$langs->trans('Note').':</b> '.(dol_textishtml($this->note_private) ? str_replace(array("\r", "\n"), "", $this->note_private) : str_replace(array("\r", "\n"), '<br>', $this->note_private));
$linkclose = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
$linkclose = ' style="background-color:#'.$this->type_color.'"';
//if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color)
// $linkclose = ' style="background-color:#'.$this->type_color.'"';
if (empty($notooltip))
{
@@ -1453,6 +1458,7 @@ class ActionComm extends CommonObject
elseif ($option == 'holiday')
$url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id;
else $url = DOL_URL_ROOT.'/comm/action/card.php?id='.$this->id;
if ($option !== 'nolink')
{
// Add param to save lastsearch_values or not
@@ -1494,7 +1500,7 @@ class ActionComm extends CommonObject
}
$result .= $linkstart;
if ($withpicto) $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$libelle), ($overwritepicto ? $overwritepicto : 'action'), ($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
if ($withpicto) $result .= img_object(($notooltip ? '' : $langs->trans("ShowAction").': '.$libelle), ($overwritepicto ? $overwritepicto : 'action'), (($this->type_color && $overwritepicto) ? 'style="color: #'.$this->type_color.' !important;" ' : '').($notooltip ? 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'"' : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
$result .= $libelleshort;
$result .= $linkend;
@@ -1520,21 +1526,25 @@ class ActionComm extends CommonObject
$imgpicto = '';
if (!empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
$color = '';
if ($this->type_color) {
$color = 'style="color: #'.$this->type_color.' !important;"';
}
if ($this->type_picto) {
$imgpicto = img_picto('', $this->type_picto, 'class="paddingright"');
} else {
if ($this->type_code == 'AC_RDV') $imgpicto = img_picto('', 'meeting', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN') $imgpicto = img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', '', false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_OTH' && $this->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', '', false, 0, 0, '', 'paddingright');
elseif (!preg_match('/_AUTO/', $this->type_code)) $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
else $imgpicto = img_picto('', 'cog', '', false, 0, 0, '', 'paddingright');
if ($this->type_code == 'AC_RDV') $imgpicto = img_picto('', 'meeting', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_TEL') $imgpicto = img_picto('', 'object_phoning', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_FAX') $imgpicto = img_picto('', 'object_phoning_fax', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_EMAIL' || $this->type_code == 'AC_EMAIL_IN') $imgpicto = img_picto('', 'object_email', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_INT') $imgpicto = img_picto('', 'object_intervention', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type_code == 'AC_OTH' && $this->code == 'TICKET_MSG') $imgpicto = img_picto('', 'object_conversation', $color, false, 0, 0, '', 'paddingright');
elseif ($this->type != 'systemauto') $imgpicto = img_picto('', 'user-cog', $color, false, 0, 0, '', 'paddingright');
else $imgpicto = img_picto('', 'cog', $color, false, 0, 0, '', 'paddingright');
}
} else {
// 2 picto: 1 for auto, 1 for manual
if (!preg_match('/_AUTO/', $this->type_code)) $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
if ($this->type != 'systemauto') $imgpicto = img_picto('', 'user-cog', '', false, 0, 0, '', 'paddingright');
else $imgpicto = img_picto('', 'cog', '', false, 0, 0, '', 'paddingright');
}
return $imgpicto;

View File

@@ -142,7 +142,7 @@ class CActionComm
* Return list of event types: array(id=>label) or array(code=>label)
*
* @param string|int $active 1 or 0 to filter on event state active or not ('' by default = no filter)
* @param string $idorcode 'id' or 'code'
* @param string $idorcode 'id' or 'code' or 'all'
* @param string $excludetype Type to exclude ('system' or 'systemauto')
* @param int $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type, -1=Keep details and add a combined line per calendar (Default, Auto, BoothConf, ...)
* @param string $morefilter Add more SQL filter
@@ -157,6 +157,7 @@ class CActionComm
$repid = array();
$repcode = array();
$repall = array();
$sql = "SELECT id, code, libelle as label, module, type, color, picto";
$sql .= " FROM ".MAIN_DB_PREFIX."c_actioncomm";
@@ -175,6 +176,7 @@ class CActionComm
$nump = $this->db->num_rows($resql);
if ($nump)
{
$idforallfornewmodule = 97;
$i = 0;
while ($i < $nump)
{
@@ -220,25 +222,40 @@ class CActionComm
if ($onlyautoornot == -1 && !empty($conf->global->AGENDA_USE_EVENT_TYPE))
{
if ($typecalendar == 'system') {
$label = '&nbsp; '.$label;
$label = '&nbsp;&nbsp; '.$label;
$repid[-99] = $langs->trans("ActionAC_MANUAL");
$repcode['AC_NON_AUTO'] = '-- '.$langs->trans("ActionAC_MANUAL");
}
if ($typecalendar == 'systemauto') {
$label = '&nbsp; '.$label;
$label = '&nbsp;&nbsp; '.$label;
$repid[-98] = $langs->trans("ActionAC_AUTO");
$repcode['AC_ALL_AUTO'] = '-- '.$langs->trans("ActionAC_AUTO");
}
if ($typecalendar == 'module') {
$label = '&nbsp;&nbsp; '.$label;
if (!isset($repcode['AC_ALL_'.strtoupper($obj->module)])) { // If first time for this module
$idforallfornewmodule--;
}
$repid[$idforallfornewmodule] = $langs->trans("ActionAC_ALL_".strtoupper($obj->module));
$repcode['AC_ALL_'.strtoupper($obj->module)] = '-- '.$langs->trans("Module").' '.ucfirst($obj->module);
}
}
$repid[$obj->id] = $label;
$repcode[$obj->code] = $label;
if ($onlyautoornot > 0 && preg_match('/^module/', $obj->type) && $obj->module) $repcode[$obj->code] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
$repall[$obj->code] = array('id' => $label, 'label' => $label, 'type' => $typecalendar, 'color' => $obj->color, 'picto' => $obj->picto);
if ($onlyautoornot > 0 && preg_match('/^module/', $obj->type) && $obj->module) {
$repcode[$obj->code] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
$repall[$obj->code]['label'] .= ' ('.$langs->trans("Module").': '.$obj->module.')';
}
}
$i++;
}
}
if ($idorcode == 'id') $this->liste_array = $repid;
if ($idorcode == 'code') $this->liste_array = $repcode;
elseif ($idorcode == 'code') $this->liste_array = $repcode;
else $this->liste_array = $repall;
return $this->liste_array;
} else {
$this->error = $this->db->lasterror();

View File

@@ -114,8 +114,7 @@ if ($status == '' && !GETPOSTISSET('search_status')) $status = (empty($conf->glo
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
if (empty($action) && !GETPOSTISSET('action')) $action = $defaultview;
if ($action == 'default') // When action is default, we want a calendar view and not the list
{
if ($action == 'default') { // When action is default, we want a calendar view and not the list
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
}
if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
@@ -346,8 +345,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
@@ -357,32 +356,32 @@ $param .= "&maxprint=".urlencode($maxprint);
// Show navigation bar
if (empty($action) || $action == 'show_month')
{
$nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, 1, $year), "%b %Y");
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&month=".$next_month.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth.$param."\">".$langs->trans("Today")."</a> ";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&month=".$nowmonth.$param."\">".$langs->trans("Today")."</a> ";
}
$picto = 'calendar';
}
if ($action == 'show_week')
{
$nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\" title=\"".dol_escape_htmltag($langs->trans("Previous"))."\"></i></a> &nbsp;\n";
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\" title=\"".dol_escape_htmltag($langs->trans("Previous"))."\"></i></a> &nbsp;\n";
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $first_month, $first_day, $first_year), "%Y").", ".$langs->trans("Week")." ".$week;
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\" title=\"".dol_escape_htmltag($langs->trans("Next"))."\"></i></a>\n";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&month=".$nowmonth."&day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
}
$picto = 'calendarweek';
}
if ($action == 'show_day')
{
$nav = "<a href=\"?year=".$prev_year."&amp;month=".$prev_month."&amp;day=".$prev_day.$param."\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav = "<a href=\"?year=".$prev_year."&month=".$prev_month."&day=".$prev_day.$param."aaa\"><i class=\"fa fa-chevron-left\"></i></a> &nbsp;\n";
$nav .= " <span id=\"month_name\">".dol_print_date(dol_mktime(0, 0, 0, $month, $day, $year), "daytextshort");
$nav .= " </span>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&amp;month=".$next_month."&amp;day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
$nav .= " &nbsp; <a href=\"?year=".$next_year."&month=".$next_month."&day=".$next_day.$param."\"><i class=\"fa fa-chevron-right\"></i></a>\n";
if (empty($conf->dol_optimize_smallscreen)) {
$nav .= " &nbsp; <a href=\"?year=".$nowyear."&amp;month=".$nowmonth."&amp;day=".$nowday.$param."\">".$langs->trans("Today")."</a> ";
}
@@ -394,6 +393,7 @@ $nav .= $form->selectDate($dateselect, 'dateselect', 0, 0, 1, '', 1, 0);
$nav .= '<button type="submit" class="liste_titre button_search" name="button_search_x" value="x"><span class="fa fa-search"></span></button>';
// Must be after the nav definition
$paramnodate = $param;
$param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : '');
//print 'x'.$param;
@@ -410,6 +410,7 @@ if ($action == 'show_pertype') $tabactive = 'cardpertype';
*/
$paramnoaction = preg_replace('/action=[a-z_]+/', '', $param);
$paramnoactionodate = preg_replace('/action=[a-z_]+/', '', $paramnodate);
$head = calendars_prepare_head($paramnoaction);
@@ -422,31 +423,31 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
//print dol_get_fiche_end();
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@@ -486,8 +487,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
$s .= "\n".'<!-- Div to calendars selectors -->'."\n";
$s .= '<script type="text/javascript">'."\n";
$s .= 'jQuery(document).ready(function () {'."\n";
$s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthday"); jQuery(".family_birthday").toggle(); });'."\n";
$s .= 'jQuery(".family_birthday").toggle();'."\n";
$s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthdays"); jQuery(".family_birthday").toggle(); });'."\n";
$s .= 'jQuery(".check_holiday").click(function() { console.log("Toggle holidays"); jQuery(".family_holiday").toggle(); });'."\n";
if ($action == "show_week" || $action == "show_month" || empty($action))
{
// Code to enable drag and drop
@@ -509,6 +510,9 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
// Local calendar
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' &nbsp; </div>';
// Holiday calendar
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_holiday" name="check_holiday" class="check_holiday"><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> &nbsp; </div>';
// External calendars
if (is_array($showextcals) && count($showextcals) > 0)
{
@@ -557,10 +561,11 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
}
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
// Load events from database into $eventarray
$eventarray = array();
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
$sql = 'SELECT ';
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= ' a.id, a.label,';
@@ -571,7 +576,7 @@ $sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql .= ' a.fk_soc, a.fk_contact, a.fk_project,';
$sql .= ' a.fk_element, a.elementtype,';
$sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color';
$sql .= ' ca.code as type_code, ca.libelle as type_label, ca.color as type_color, ca.type as type_type, ca.picto as type_picto';
$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table
@@ -689,13 +694,17 @@ if ($resql)
$event->type_code = $obj->type_code;
$event->type_label = $obj->type_label;
$event->type_color = $obj->type_color;
$event->type = $obj->type_type;
$event->type_picto = $obj->type_picto;
$event->libelle = $obj->label; // deprecated
$event->label = $obj->label;
$event->percentage = $obj->percent;
$event->authorid = $obj->fk_user_author; // user id of creator
$event->userownerid = $obj->fk_user_action; // user id of owner
$event->fetch_userassigned(); // This load $event->userassigned
$event->priority = $obj->priority;
$event->fulldayevent = $obj->fulldayevent;
$event->location = $obj->location;
@@ -783,6 +792,7 @@ if ($showbirthday)
while ($i < $num)
{
$obj = $db->fetch_object($resql);
$event = new ActionComm($db);
$event->id = $obj->rowid; // We put contact id in action id for birthdays events
@@ -793,28 +803,39 @@ if ($showbirthday)
$datearray = dol_getdate($datebirth, true);
$event->datep = dol_mktime(0, 0, 0, $datearray['mon'], $datearray['mday'], $year, true); // For full day events, date are also GMT but they wont but converted during output
$event->datef = $event->datep;
$event->type_code = 'BIRTHDAY';
$event->type_label = '';
$event->type_color = '';
$event->type = 'birthdate';
$event->type_picto = 'birthdate';
$event->label = $langs->trans("Birthday").' '.dolGetFirstLastname($obj->firstname, $obj->lastname);
$event->percentage = 100;
$event->fulldayevent = 1;
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
$event->date_start_in_calendar = $db->jdate($event->datep);
$event->date_end_in_calendar = $db->jdate($event->datef);
$event->ponctuel = 0;
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y');
$mois = dol_print_date($daycursor, '%m');
$jour = dol_print_date($daycursor, '%d');
// Add an entry in eventarray for each day
$daycursor = $event->datep;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
$eventarray[$daykey][] = $event;
/*$loop = true;
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
if ($daykey > $event->date_end_in_calendar) $loop = false;
} while ($loop);
*/
$i++;
}
} else {
@@ -822,87 +843,81 @@ if ($showbirthday)
}
}
// HOLIDAYS CALENDAR
if ($conf->global->AGENDA_SHOW_HOLIDAYS)
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = x.fk_user";
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
if ($action == 'show_day') {
// Request only leaves for the current selected day
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date wihout time
} elseif ($action == 'show_week') {
// TODO: Add filter to reduce database request
} elseif ($action == 'show_month') {
// TODO: Add filter to reduce database request
}
$resql = $db->query($sql);
if ($resql)
{
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
$sql .= " WHERE u.rowid = x.fk_user";
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
$num = $db->num_rows($resql);
$i = 0;
if ($action == 'show_day')
while ($i < $num)
{
// Request only leaves for the current selected day
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin";
} elseif ($action == 'show_week')
{
// TODO: Add filter to reduce database request
} elseif ($action == 'show_month')
{
// TODO: Add filter to reduce database request
}
$obj = $db->fetch_object($resql);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
$event = new ActionComm($db);
while ($i < $num)
// Need the id of the leave object for link to it
$event->id = $obj->rowid;
$event->ref = $event->id;
$event->type_code = 'HOLIDAY';
$event->type_label = '';
$event->type_color = '';
$event->type = 'holiday';
$event->type_picto = 'holiday';
$event->datep = $db->jdate($obj->date_start);
$event->datef = $db->jdate($obj->date_end);
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
if ($obj->status == 3)
{
$obj = $db->fetch_object($resql);
$dateStartArray = dol_getdate(dol_stringtotime($obj->date_start, 1), true);
$dateEndArray = dol_getdate(dol_stringtotime($obj->date_end, 1), true);
$event = new ActionComm($db);
// Need the id of the leave object for link to it
$event->id = $obj->rowid;
$event->ref = $event->id;
$event->type_code = 'HOLIDAY';
$event->datep = dol_mktime(0, 0, 0, $dateStartArray['mon'], $dateStartArray['mday'], $dateStartArray['year'], true);
$event->datef = dol_mktime(0, 0, 0, $dateEndArray['mon'], $dateEndArray['mday'], $dateEndArray['year'], true);
$event->date_start_in_calendar = $event->datep;
$event->date_end_in_calendar = $event->datef;
if ($obj->status == 3)
{
// Show no symbol for leave with state "leave approved"
$event->percentage = -1;
} elseif ($obj->status == 2)
{
// Show TO-DO symbol for leave with state "leave wait for approval"
$event->percentage = 0;
}
if ($obj->halfday == 1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
} elseif ($obj->halfday == -1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
} else {
$event->label = $obj->lastname;
}
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y');
$mois = dol_print_date($daycursor, '%m');
$jour = dol_print_date($daycursor, '%d');
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
} while ($daykey <= $event->date_end_in_calendar);
$i++;
// Show no symbol for leave with state "leave approved"
$event->percentage = -1;
} elseif ($obj->status == 2)
{
// Show TO-DO symbol for leave with state "leave wait for approval"
$event->percentage = 0;
}
if ($obj->halfday == 1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
} elseif ($obj->halfday == -1)
{
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
} else {
$event->label = $obj->lastname;
}
$daycursor = $event->date_start_in_calendar;
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
do {
$eventarray[$daykey][] = $event;
$daykey += 60 * 60 * 24;
} while ($daykey <= $event->date_end_in_calendar);
$i++;
}
}
@@ -918,7 +933,7 @@ if (count($listofextcals))
$offsettz = $extcal['offsettz'];
$colorcal = $extcal['color'];
$buggedfile = $extcal['buggedfile'];
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal." buggedfile=".$buggedfile;
$ical = new ICal();
$ical->parse($url);
@@ -1095,9 +1110,12 @@ if (count($listofextcals))
$event->userassigned[$userId] = $userId;
$event->percentage = -1;
}
else {
$event->type_code = "ICALEVENT";
}
$event->type_code = "ICALEVENT";
$event->type_label = $namecal;
$event->type_color = $colorcal;
$event->type = 'icalevent';
$event->type_picto = 'rss';
$event->icalname = $namecal;
$event->icalcolor = $colorcal;
@@ -1156,15 +1174,15 @@ if (count($listofextcals))
// Add an entry in actionarray for each day
$daycursor = $event->date_start_in_calendar;
$annee = date('Y', $daycursor);
$mois = date('m', $daycursor);
$jour = date('d', $daycursor);
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
// Loop on each day covered by action to prepare an index to show on calendar
$loop = true; $j = 0;
// daykey must be date that represent day box in calendar so must be a user time
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, true, 0);
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
do {
//if ($event->fulldayevent) print dol_print_date($daykeygmt,'dayhour','gmt').'-'.dol_print_date($daykey,'dayhour','gmt').'-'.dol_print_date($event->date_end_in_calendar,'dayhour','gmt').' ';
$eventarray[$daykey][] = $event;
@@ -1352,14 +1370,14 @@ if (empty($action) || $action == 'show_month') // View by month
for ($iter_day = 0; $iter_day < 7; $iter_day++) {
// Show days of the current week
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd');
$tmparray = dol_getdate($curtime, true);
$tmpday = $tmparray['mday'];
$tmpmonth = $tmparray['mon'];
$tmpyear = $tmparray['year'];
$curtime = dol_time_plus_duree($firstdaytoshow, $iter_day, 'd'); // $firstdaytoshow is in timezone of server
$tmpday = dol_print_date($curtime, '%d', 'tzuserrel');
$tmpmonth = dol_print_date($curtime, '%m', 'tzuserrel');
$tmpyear = dol_print_date($curtime, '%Y', 'tzuserrel');
$style = 'cal_current_month';
if ($iter_day == 6) $style .= ' cal_other_month_right';
$today = 0;
$todayarray = dol_getdate($now, 'fast');
if ($todayarray['mday'] == $tmpday && $todayarray['mon'] == $tmpmonth && $todayarray['year'] == $tmpyear) $today = 1;
@@ -1495,6 +1513,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
global $theme_datacolor;
global $cachethirdparties, $cachecontacts, $cacheusers, $colorindexused;
if ($conf->use_javascript_ajax) { // Enable the "Show more button..."
$conf->global->MAIN_JS_SWITCH_AGENDA = 1;
}
$dateint = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
print "\n";
@@ -1510,11 +1532,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
// Line with title of day
print '<div id="dayevent_'.$dateint.'" class="cursorpointer dayevent tagtable centpercent nobordernopadding" onclick="window.location=\''.$urltocreate.'\';">'."\n";
print '<div id="dayevent_'.$dateint.'" class="dayevent tagtable centpercent nobordernopadding">'."\n";
if ($nonew <= 0)
{
print '<div class="tagtr"><div class="nowrap tagtd"><div class="left inline-block">';
print '<div class="tagtr cursorpointer" onclick="window.location=\''.$urltocreate.'\';"><div class="nowrap tagtd"><div class="left inline-block">';
print '<a class="dayevent-aday" style="color: #666" href="'.$urltoshow.'">';
if ($showinfo) print dol_print_date($curtime, 'daytextshort');
else print dol_print_date($curtime, '%d');
@@ -1540,13 +1562,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '<div class="tagtd centpercent agendacell sortable">';
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
$i = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array();
$i = 0; $ireallyshown = 0; $itoshow = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array();
$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
$colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
$nextindextouse = is_array($colorindexused) ?count($colorindexused) : 0; // At first run this is 0, so fist user has 0, next 1, ...
//var_dump($colorindexused);
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
$tmpholiday = new Holiday($db);
foreach ($eventarray as $daykey => $notused)
{
$annee = dol_print_date($daykey, '%Y');
@@ -1592,7 +1617,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
} elseif ($event->type_code == 'BIRTHDAY')
{
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unmovable'; $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 {
$numother++;
$color = ($event->icalcolor ? $event->icalcolor : -1);
@@ -1626,20 +1651,22 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
// Define color
$color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
}
$cssclass = $cssclass.' '.$cssclass.'_day_'.$ymd;
$cssclass = $cssclass.' eventday_'.$ymd;
// Defined style to disable drag and drop feature
if ($event->type_code == 'AC_OTH_AUTO')
{
if ($event->type_code == 'AC_OTH_AUTO') {
$cssclass .= " unmovable";
} elseif ($event->type_code == 'ICALEVENT')
{
} elseif ($event->type_code == 'HOLIDAY') {
$cssclass .= " unmovable";
} elseif ($event->type_code == 'BIRTHDAY') {
$cssclass .= " unmovable";
} elseif ($event->type_code == 'ICALEVENT') {
$cssclass .= " unmovable";
} elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
$tmpyearend = date('Y', $event->date_end_in_calendar);
$tmpmonthend = date('m', $event->date_end_in_calendar);
$tmpdayend = date('d', $event->date_end_in_calendar);
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
if ($tmpyearend != $annee || $tmpmonthend != $mois || $tmpdayend != $jour)
{
$cssclass .= " unmovable";
}
@@ -1657,10 +1684,29 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if ($action == 'show_day') { $h = 'height: 100%; '; $nowrapontd = 0; }
if ($action == 'show_week') { $h = 'height: 100%; '; $nowrapontd = 0; }
// Show rect of event
// Show event box
print "\n";
print '<!-- start event '.$i.' -->'."\n";
print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'"';
$morecss = '';
if ($maxprint && $ireallyshown >= $maxprint) {
$morecss = 'showifmore';
}
if ($event->type == 'birthdate' && !GETPOST('check_birthday')) {
$morecss = 'hidden';
}
if ($event->type == 'holiday' && !GETPOST('check_holiday')) {
$morecss = 'hidden';
}
if ($morecss != 'hidden') {
$itoshow++;
}
if ($morecss != 'showifmore' && $morecss != 'hidden') {
$ireallyshown++;
}
//var_dump($event->type.' - '.$morecss.' - '.$cssclass.' - '.$i.' - '.$ireallyshown.' - '.$itoshow);
print '<div id="event_'.$ymd.'_'.$i.'" class="event family_'.$event->type.' '.$cssclass.($morecss ? ' '.$morecss : '').'"';
//print ' style="height: 100px;';
//print ' position: absolute; top: 40px; width: 50%;';
//print '"';
@@ -1695,14 +1741,23 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$daterange = '';
if ($event->type_code == 'BIRTHDAY') // It's a birthday
{
if ($event->type_code == 'BIRTHDAY') { // It's birthday calendar
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
} elseif ($event->type_code == 'HOLIDAY')
{
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'holiday', 'user');
} elseif ($event->type_code != 'BIRTHDAY' && $event->type_code != 'HOLIDAY')
{
} elseif ($event->type_code == 'HOLIDAY') { // It's holiday calendar
$tmpholiday->fetch($event->id);
print $tmpholiday->getNomUrl(1);
$tmpid = $tmpholiday->fk_user;
if (empty($cacheusers[$tmpid])) {
$newuser = new User($db);
$newuser->fetch($tmpid);
$cacheusers[$tmpid] = $newuser;
}
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
print $listofusertoshow;
} else { // Other calendar
// Picto
if (empty($event->fulldayevent))
{
@@ -1746,8 +1801,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel');
}
} else {
if ($showinfo)
{
if ($showinfo) {
print $langs->trans("EventOnFullDay")."<br>\n";
}
}
@@ -1761,7 +1815,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$event->label = $titletoshow;
$event->libelle = $titletoshow;
// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
$titletoshow = $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title', '', 0, 0);
$titletoshow = (($event->type_picto || $event->type_code) ? $event->getTypePicto() : '');
$titletoshow .= $event->getNomUrl(0, $maxnbofchar, 'cal_event cal_event_title', '', 0, 0);
$event->label = $savlabel;
$event->libelle = $savlabel;
}
@@ -1773,8 +1828,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
{
if (!$posuserassigned && $titletoshow) $listofusertoshow .= '<br>';
$posuserassigned++;
if (empty($cacheusers[$tmpid]))
{
if (empty($cacheusers[$tmpid])) {
$newuser = new User($db);
$newuser->fetch($tmpid);
$cacheusers[$tmpid] = $newuser;
@@ -1846,6 +1900,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
else print '&nbsp;';
print '</td></tr></table>';
print '</div><!-- end event '.$i.' -->'."\n";
$i++;
} else {
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
@@ -1868,22 +1923,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '&nbsp;';
}
if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $i > $maxprint && $maxprint)
if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $itoshow > $ireallyshown && $maxprint)
{
print '<div id="more_'.$ymd.'">'.img_picto("all", "1downarrow_selected.png").' +'.$langs->trans("More").'...</div>';
print '<div class="center cursorpointer" id="more_'.$ymd.'">'.img_picto("All", "angle-double-down", 'class="warning"').' +'.($itoshow - $ireallyshown).'</div>';
//print ' +'.(count($eventarray[$daykey])-$maxprint);
print '<script type="text/javascript">'."\n";
print 'jQuery(document).ready(function () {'."\n";
print 'jQuery("#more_'.$ymd.'").click(function() { reinit_day_'.$ymd.'(); });'."\n";
print 'function reinit_day_'.$ymd.'() {'."\n";
print 'var nb=0;'."\n";
// TODO Loop on each element of day $ymd and start to toggle once $maxprint has been reached
print 'jQuery(".family_mytasks_day_'.$ymd.'").toggle();';
print '}'."\n";
print ' var open=0;'."\n";
print ' jQuery("#more_'.$ymd.'").click(function() { console.log("Click on showmore for '.$ymd.'"); reinit_day_'.$ymd.'(); event.stopImmediatePropagation(); });'."\n";
print ' function reinit_day_'.$ymd.'() {'."\n";
print ' jQuery(".eventday_'.$ymd.'.showifmore").toggle();'."\n";
print ' open = open + 1; if (open > 1) { open = 0; }'."\n";
print ' if (open) { ';
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-up", 'class="warning"').'\');'."\n";
print ' } else { ';
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-down", 'class="warning"').' +'.($itoshow - $ireallyshown).'\');'."\n";
print ' }'."\n";
print ' }'."\n";
print '});'."\n";
print '</script>'."\n";
}
@@ -1930,7 +1988,6 @@ function sort_events_by_date($a, $b)
{
return -1;
}
if ($b->type_code === 'HOLIDAY')
{
return 1;

View File

@@ -269,11 +269,11 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($search_status != '' && $search_status > -1) $param .= "&search_status=".urlencode($search_status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($search_id != '') $param .= '&search_title='.urlencode($search_id);
if ($search_title != '') $param .= '&search_title='.urlencode($search_title);
if ($search_note != '') $param .= '&search_note='.$search_note;
@@ -287,6 +287,8 @@ if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
$paramnoactionodate = $param;
// List of mass actions available
$arrayofmassactions = array(
'set_all_events_to_todo' => $langs->trans("SetAllEventsToTodo"),
@@ -308,7 +310,7 @@ $sql .= " a.id, a.code, a.label, a.note, a.datep as dp, a.datep2 as dp2, a.fulld
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= " a.fk_contact, a.note, a.percent as percent,";
$sql .= " a.fk_element, a.elementtype, a.datec, a.tms as datem,";
$sql .= " c.code as type_code, c.libelle as type_label,";
$sql .= " c.code as type_code, c.libelle as type_label, c.color as type_color, c.type as type_type, c.picto as type_picto,";
$sql .= " sp.lastname, sp.firstname, sp.email, sp.phone, sp.address, sp.phone as phone_pro, sp.phone_mobile, sp.phone_perso, sp.fk_pays as country_id";
// Add fields from extrafields
@@ -481,31 +483,31 @@ if ($resql)
}
$viewmode = '';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@@ -657,6 +659,7 @@ if ($resql)
$actionstatic->type_code = $obj->type_code;
$actionstatic->type_label = $obj->type_label;
$actionstatic->type_picto = $obj->type_picto;
$actionstatic->type_color = $obj->type_color;
$actionstatic->label = $obj->label;
$actionstatic->location = $obj->location;
$actionstatic->note_private = dol_htmlentitiesbr($obj->note);

View File

@@ -236,8 +236,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
@@ -248,6 +248,8 @@ if ($begin_d != '') $param .= '&begin_d='.urlencode($begin_d);
if ($end_d != '') $param .= '&end_d='.urlencode($end_d);
$param .= "&maxprint=".urlencode($maxprint);
$paramnoactionodate = $param;
$prev = dol_get_first_day($year, 1);
$prev_year = $year - 1;
$prev_month = $month;
@@ -352,31 +354,31 @@ if ($conf->use_javascript_ajax)
$massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@@ -430,6 +432,8 @@ print '</div>';
// Get event in an array
$eventarray = array();
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
$sql = 'SELECT';
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= ' a.id, a.label,';
@@ -439,7 +443,7 @@ $sql .= ' a.percent,';
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
$sql .= ' ca.code, ca.color';
$sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto';
$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table

View File

@@ -236,8 +236,8 @@ if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
if ($filter) $param .= "&search_filter=".urlencode($filter);
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid) $param .= "&search_socid=".urlencode($socid);
if ($usergroup > 0) $param .= "&search_usergroup=".urlencode($usergroup);
if ($socid > 0) $param .= "&search_socid=".urlencode($socid);
if ($showbirthday) $param .= "&search_showbirthday=1";
if ($pid) $param .= "&search_projectid=".urlencode($pid);
if ($type) $param .= "&search_type=".urlencode($type);
@@ -248,6 +248,7 @@ if ($begin_d != '') $param .= '&begin_d='.urlencode($begin_d);
if ($end_d != '') $param .= '&end_d='.urlencode($end_d);
$param .= "&maxprint=".urlencode($maxprint);
$paramnoactionodate = $param;
$prev = dol_get_first_day_week($day, $month, $year);
//print "day=".$day." month=".$month." year=".$year;
@@ -357,31 +358,31 @@ if ($conf->use_javascript_ajax)
$massactionbutton = '';
$viewmode = '';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/list.php?action=show_list&restore_lastsearch_values=1'.$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("List"), 'object_list-alt', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
//$viewmode .= '</span>';
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').'">';
$viewmode .= '<a class="btnTitle btnTitleSelected reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
//$viewmode .= '</span>';
@@ -435,10 +436,11 @@ print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $show
print '</div>';
// Get event in an array
$eventarray = array();
// DEFAULT CALENDAR + AUTOEVENT CALENDAR + CONFERENCEBOOTH CALENDAR
$sql = 'SELECT';
if ($usergroup > 0) $sql .= " DISTINCT";
$sql .= ' a.id, a.label,';
@@ -448,7 +450,7 @@ $sql .= ' a.percent,';
$sql .= ' a.fk_user_author,a.fk_user_action,';
$sql .= ' a.transparency, a.priority, a.fulldayevent, a.location,';
$sql .= ' a.fk_soc, a.fk_contact, a.fk_element, a.elementtype, a.fk_project,';
$sql .= ' ca.code, ca.color';
$sql .= ' ca.code, ca.libelle as type_label, ca.color, ca.type as type_type, ca.picto as type_picto';
$sql .= ' FROM '.MAIN_DB_PREFIX.'c_actioncomm as ca, '.MAIN_DB_PREFIX."actioncomm as a";
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
// We must filter on resource table

View File

@@ -672,7 +672,7 @@ class Form
// Warning: if you set submit button to disabled, post using 'Enter' will no more work if there is no another input submit. So we add a hidden button
$ret .= '<input type="submit" name="confirmmassactioninvisible" style="display: none" tabindex="-1">'; // Hidden button BEFORE so it is the one used when we submit with ENTER.
$ret .= '<input type="submit" disabled name="confirmmassaction" class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '<input type="submit" disabled name="confirmmassaction"'.(empty($conf->use_javascript_ajax) ? '' : ' style="display: none"').' class="button'.(empty($conf->use_javascript_ajax) ? '' : ' hideobject').' '.$name.' '.$name.'confirmed" value="'.dol_escape_htmltag($langs->trans("Confirm")).'">';
$ret .= '</div>';
if (!empty($conf->use_javascript_ajax))

View File

@@ -355,7 +355,7 @@ class FormActions
if (!is_array($selected) && !empty($selected)) $selected = explode(',', $selected);
$out .= $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0);
} else {
$out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth200'.($morecss ? ' '.$morecss : ''), 1);
$out .= $form->selectarray($htmlname, $arraylist, $selected, 0, 0, 0, '', 0, 0, 0, '', 'minwidth300'.($morecss ? ' '.$morecss : ''), 1);
}
if ($user->admin && empty($onlyautoornot) && $hideinfohelp <= 0)

View File

@@ -77,7 +77,7 @@ class FormAdmin
if ($showempty && !$multiselect)
{
$out .= '<option value="0"';
if ($selected == '') $out .= ' selected';
if ($selected === '') $out .= ' selected';
$out .= '>';
if ($showempty != '1') $out .= $showempty;
else $out .= '&nbsp;';
@@ -86,7 +86,7 @@ class FormAdmin
if ($showauto)
{
$out .= '<option value="auto"';
if ($selected == 'auto') $out .= ' selected';
if ($selected === 'auto') $out .= ' selected';
$out .= '>'.$langs->trans("AutoDetectLang").'</option>';
}
@@ -115,7 +115,7 @@ class FormAdmin
}
$valuetoshow .= ' '.picto_from_langcode($key, 'class="saturatemedium"');
if ($selected == $keytouse) {
if ((string) $selected == (string) $keytouse) {
$out .= '<option value="'.$keytouse.'" selected data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';
} else {
$out .= '<option value="'.$keytouse.'" data-html="'.dol_escape_htmltag($valuetoshow).'">'.$valuetoshow.'</option>';

View File

@@ -3265,7 +3265,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$pictowithouttext = preg_replace('/(\.png|\.gif|\.svg)$/', '', $picto);
if (empty($srconly) && in_array($pictowithouttext, array(
'1downarrow', '1uparrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected',
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
'accountancy', 'account', 'accountline', 'action', 'add', 'address', 'angle-double-down', 'angle-double-up', 'bank_account', 'barcode', 'bank', 'bill', 'billa', 'billr', 'billd', 'bookmark', 'bom', 'building',
'cash-register', 'category', 'check', 'clock', 'close_title', 'cog', 'company', 'contact', 'contract', 'cron', 'cubes',
'delete', 'dolly', 'dollyrevert', 'donation', 'download', 'edit', 'ellipsis-h', 'email', 'eraser', 'external-link-alt', 'external-link-square-alt',
'filter', 'file-code', 'file-export', 'file-import', 'file-upload', 'folder', 'folder-open', 'globe', 'globe-americas', 'grip', 'grip_title', 'group',
@@ -3371,9 +3371,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
$fakey = 'fa-'.$pictowithouttext;
}
if (in_array($pictowithouttext, array('dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) {
if (in_array($pictowithouttext, array('holiday', 'dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) {
$morecss = 'em092';
}
if (in_array($pictowithouttext, array('holiday'))) {
$morecss = 'em088';
}
if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'stock', 'technic'))) {
$morecss = 'em080';
}

View File

@@ -4531,7 +4531,7 @@ div.visible {
display: block;
}
div.hidden, td.hidden, img.hidden, span.hidden {
div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore {
display: none;
}

View File

@@ -203,6 +203,10 @@ div.mainmenu.generic4::before {
font-size: 0.92em;
}
.menu_titre .em088 {
font-size: 0.88em;
}
.menu_titre .em080 {
font-size: 0.80em;
}

View File

@@ -4402,7 +4402,7 @@ div.visible {
display: block;
}
div.hidden, td.hidden, img.hidden, span.hidden {
div.hidden, td.hidden, img.hidden, span.hidden, div.showifmore {
display: none;
}