diff --git a/ChangeLog b/ChangeLog index 8e94283923e..ddd3c6f33b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,15 +5,16 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.7 compared to 3.6.* ***** For users: -New: [ task #867 ] Remove ESAEB external module code from core. -New: Can create proposal from an intervention. -New: Can filter events on a group of users. +- New: [ task #867 ] Remove ESAEB external module code from core. +- New: Can create proposal from an intervention. +- New: Can filter events on a group of users. +- New: Add thirdparty to filter on events. For translators: - Update language files. For developers: -- +- New: Add hook "searchAgendaFrom". ***** ChangeLog for 3.6 compared to 3.5.* ***** diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index da5b7f95137..ef5bf1c68bf 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -56,9 +56,10 @@ if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="a.datec"; // Security check -$socid = GETPOST("socid","int",1); +$socid = GETPOST("socid","int"); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); +if ($socid < 0) $socid=''; $canedit=1; if (! $user->rights->agenda->myactions->read) accessforbidden(); @@ -102,6 +103,8 @@ $langs->load("agenda"); $langs->load("other"); $langs->load("commercial"); +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('agenda')); /* @@ -993,7 +996,7 @@ else // View by day $timestamp=dol_mktime(12,0,0,$month,$day,$year); $arraytimestamp=dol_getdate($timestamp); - echo ''; + echo '
'; echo ' '; echo ' \n"; echo " \n"; diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php index d98c84e7bae..51fa2dfeec2 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -78,6 +78,7 @@ if (! $sortfield) $socid = GETPOST("socid",'int'); if ($user->societe_id) $socid=$user->societe_id; $result = restrictedArea($user, 'agenda', 0, '', 'myactions'); +if ($socid < 0) $socid=''; $canedit=1; if (! $user->rights->agenda->myactions->read) accessforbidden(); @@ -89,6 +90,8 @@ if (! $user->rights->agenda->allactions->read || $filter=='mine') // If no permi $filterd=$user->id; } +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('agendalist')); /* @@ -192,7 +195,7 @@ if ($resql) if ($status == 'done') $title=$langs->trans("DoneActions"); if ($status == 'todo') $title=$langs->trans("ToDoActions"); - if ($socid) + /*if ($socid) { $societe = new Societe($db); $societe->fetch($socid); @@ -201,8 +204,8 @@ if ($resql) else { $newtitle=$langs->trans($title); - } - + }*/ + $newtitle=$langs->trans($title); $tabactive=''; if ($action == 'show_month') $tabactive='cardmonth'; @@ -210,10 +213,10 @@ if ($resql) if ($action == 'show_day') $tabactive='cardday'; if ($action == 'show_list') $tabactive='cardlist'; - $head = calendars_prepare_head(''); + $head = calendars_prepare_head($param); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); - print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,''); + print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$filtera,$filtert,$filterd,$pid,$socid,-1,'',0); dol_fiche_end(); // Add link to show birthdays diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0adb10c1d22..bff13cf2781 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -671,7 +671,7 @@ class Form * Return HTML code to select a company. * * @param int $selected Preselected products - * @param string $htmlname Name of HTML seletc field (must be unique in page) + * @param string $htmlname Name of HTML select field (must be unique in page) * @param int $filter Filter on thirdparty * @param int $limit Limit on number of returned lines * @param array $ajaxoptions Options for ajax_autocompleter diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 9e41b0e5c1d..5ae51bf0eaa 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -46,7 +46,7 @@ */ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals=array(), $actioncode='', $usergroupid='') { - global $conf, $user, $langs, $db; + global $conf, $user, $langs, $db, $hookmanager; // Filters print ''; @@ -59,10 +59,8 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print '
'; - print '
'; - - //print '
'.$langs->trans("Day".$arraytimestamp['wday'])."
'; - //print '
'; + if (! empty($conf->browser->phone)) print '
'; + else print ''; - print ''; + if (! empty($conf->browser->phone)) print ''; + else print ''; - - // Buttons - /*print '';*/ - - //print '
'; print ''; @@ -110,6 +108,16 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; } + if (! empty($conf->societe->enabled) && $user->rights->societe->lire) + { + print ''; + print ''; + } + if (! empty($conf->projet->enabled) && $user->rights->projet->lire) { require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; @@ -123,37 +131,29 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; } + // Hooks + $parameters = array('canedit'=>$canedit, 'pid'=>$pid, 'socid'=>$socid); + $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been + print '
'; + print $langs->trans("Thirdpary").'   '; + print ''; + print $form->select_thirdparty($socid, 'socid'); + print '
'; - //print '
'; - print img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone"') . ' '; - print '
'; - print img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone"') . ' '; - print '
'; - print img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone"') . ' '; - print '
'; - print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' '; - print '
'; - print '
'; + if (! empty($conf->browser->phone)) print '
'; + else print '
'; print ''; - print '
'; print '
'; print ''; print '
'; print '
'; - print ''; + if (! empty($conf->browser->phone)) print ''; + else print '
'; - print '
'; + print ''; // Close fichecenter print '
'; print ''; @@ -471,6 +471,10 @@ function calendars_prepare_head($param) $head[$h][2] = 'cardlist'; $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/peruser.php'.($param?'?'.$param:''); + $head[$h][1] = $langs->trans("ViewPerUser"); + $head[$h][2] = 'cardperuser'; + $h++; $object=new stdClass(); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 6f17fd17e2e..fcee3d669cf 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -33,6 +33,7 @@ ViewList=List view ViewCal=Month view ViewDay=Day view ViewWeek=Week view +ViewPerUser=Per user ViewWithPredefinedFilters= View with predefined filters AutoActions= Automatic filling AgendaAutoActionDesc= Define here events for which you want Dolibarr to create automatically an event in agenda. If nothing is checked (by default), only manual actions will be included in agenda. diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index b5324b65a0b..78457f899d2 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2271,7 +2271,7 @@ li.cal_event { border: none; list-style-type: none; } /* Ajax - Liste deroulante de l'autocompletion */ /* ============================================================================== */ -.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff; } +.ui-widget-content { border: solid 1px rgba(0,0,0,.3); background: #fff !important; } .ui-autocomplete-loading { background: white url() right center no-repeat; } .ui-autocomplete {