diff --git a/htdocs/comm/action/class/cactioncomm.class.php b/htdocs/comm/action/class/cactioncomm.class.php index 56465d45fdb..5e14b45665b 100644 --- a/htdocs/comm/action/class/cactioncomm.class.php +++ b/htdocs/comm/action/class/cactioncomm.class.php @@ -99,13 +99,14 @@ 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|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 $excludetype Type to exclude - * @param int $onlyautoornot Group list by auto events or not + * @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 + * @param string $morefilter Add more SQL filter * @return mixed Array of all event types if OK, <0 if KO */ - function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0) + function liste_array($active='',$idorcode='id',$excludetype='',$onlyautoornot=0, $morefilter='') { global $langs,$conf; $langs->load("commercial"); @@ -115,8 +116,10 @@ class CActionComm $sql = "SELECT id, code, libelle, module, type, color"; $sql.= " FROM ".MAIN_DB_PREFIX."c_actioncomm"; - if ($active != '') $sql.=" WHERE active=".$active; - if (! empty($excludetype)) $sql.=($active != ''?" AND":" WHERE")." type <> '".$excludetype."'"; + $sql.= " WHERE 1=1"; + if ($active != '') $sql.=" AND active=".$active; + if (! empty($excludetype)) $sql.=" AND type <> '".$excludetype."'"; + if ($morefilter) $sql.=" AND ".$morefilter; $sql.= " ORDER BY module, position"; dol_syslog(get_class($this)."::liste_array", LOG_DEBUG); diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 9b466e3d9b7..2324b6ee799 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -902,7 +902,7 @@ if (count($listofextcals)) $daykey=dol_mktime(0,0,0,$mois,$jour,$annee); $daykeygmt=dol_mktime(0,0,0,$mois,$jour,$annee,true,0); 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; $daykey+=60*60*24; $daykeygmt+=60*60*24; // Add one day @@ -951,7 +951,7 @@ if (empty($action) || $action == 'show_month') // View by month $newparam=preg_replace('/viewcal=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter $newparam.='&viewcal=1'; - echo ''; + echo '
'; echo ' '; $i=0; while ($i < 7) @@ -1028,7 +1028,7 @@ elseif ($action == 'show_week') // View by week $newparam=preg_replace('/viewweek=[0-9]+&?/i','',$newparam); $newparam=preg_replace('/showbirthday_=/i','showbirthday=',$newparam); // Restore correct parameter $newparam.='&viewweek=1'; - echo '
'; + echo '
'; echo ' '; $i=0; while ($i < 7) @@ -1085,7 +1085,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 e762b22bc70..86978967970 100644 --- a/htdocs/comm/action/listactions.php +++ b/htdocs/comm/action/listactions.php @@ -39,17 +39,23 @@ $action=GETPOST('action','alpha'); $year=GETPOST("year",'int'); $month=GETPOST("month",'int'); $day=GETPOST("day",'int'); -$actioncode=GETPOST("actioncode","alpha",3); $pid=GETPOST("projectid",'int',3); $status=GETPOST("status",'alpha'); $type=GETPOST('type'); $optioncss = GETPOST('optioncss','alpha'); -$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); +if (GETPOST('actioncode','array')) +{ + $actioncode=GETPOST('actioncode','array',3); + if (! count($actioncode)) $actioncode='0'; +} +else +{ + $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); +} $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); $datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear')); $dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear')); - -if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); +if (empty($actioncode) && empty($actioncodearray)) $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if (empty($action) && ! isset($_GET['action']) && ! isset($_POST['action'])) $action=(empty($conf->global->AGENDA_DEFAULT_VIEW)?'show_month':$conf->global->AGENDA_DEFAULT_VIEW); @@ -136,7 +142,7 @@ $userstatic=new User($db); $nav=''; $nav.=''; if ($optioncss != '') $nav.= ''; -if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $nav.=''; +if ($actioncode) $nav.=''; if ($status || isset($_GET['status']) || isset($_POST['status'])) $nav.=''; if ($filter) $nav.=''; if ($filtert) $nav.=''; @@ -158,7 +164,7 @@ llxHeader('',$langs->trans("Agenda"),$help_url); $listofextcals=array(); $param=''; -if ($actioncode || isset($_GET['actioncode']) || isset($_POST['actioncode'])) $param.="&actioncode=".$actioncode; +if ($actioncode) $param.="&actioncode=".$actioncode; if ($status || isset($_GET['status']) || isset($_POST['status'])) $param.="&status=".$status; if ($filter) $param.="&filter=".$filter; if ($filtert) $param.="&filtert=".$filtert; @@ -186,7 +192,7 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= " WHERE c.id = a.fk_action"; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; -if ($actioncode) $sql.=" AND c.code='".$db->escape($actioncode)."'"; +if ($actioncode) $sql.=" AND c.code IN ('".$db->escape($actioncode)."')"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 41270d7996e..a0f78608d04 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -278,7 +278,7 @@ $paramnoaction=preg_replace('/action=[a-z_]+/','',$param); $head = calendars_prepare_head($paramnoaction); dol_fiche_head($head, $tabactive, $langs->trans('Agenda'), 0, 'action'); -print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup); +print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, $listofextcals, $actioncode, $usergroup, 'systemauto'); dol_fiche_end(); $showextcals=$listofextcals; diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php index bc662e4b434..88f2f87c1e3 100644 --- a/htdocs/core/class/html.formactions.class.php +++ b/htdocs/core/class/html.formactions.class.php @@ -244,10 +244,10 @@ class FormActions * * @param string $selected Type pre-selected (can be 'manual', 'auto' or 'AC_xxx') * @param string $htmlname Nom champ formulaire - * @param string $excludetype Type to exclude - * @param string $onlyautoornot Group list by auto events or not: We keep only the 2 generic lines (AC_OTH and AC_OTH_AUTO) + * @param string $excludetype A type to exclude ('systemauto', 'system', '') + * @param string $onlyautoornot 1=Group all type AC_XXX into 1 line AC_MANUAL. 0=Keep details of type * @param int $hideinfohelp 1=Do not show info help - * @param int $multiselect 1=Allow multiselect of action type for filter or search + * @param int $multiselect 1=Allow multiselect of action type * @return void */ function select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=0) @@ -270,16 +270,15 @@ class FormActions if (! empty($conf->global->AGENDA_ALWAYS_HIDE_AUTO)) unset($arraylist['AC_OTH_AUTO']); - if ($multiselect==1) + if (! empty($multiselect)) { if(!is_array($selected) && !empty($selected)) $selected = explode(',', $selected); - print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, '', 0, 0); - + print $form->multiselectarray($htmlname, $arraylist, $selected, 0, 0, 'centpercent', 0, 0); } - else { + else + { print $form->selectarray($htmlname, $arraylist, $selected); } - if ($user->admin && empty($onlyautoornot) && empty($hideinfohelp)) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 74815f7bdbd..42244a11718 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -41,11 +41,12 @@ * @param int $socid Third party id * @param string $action Action string * @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend - * @param string $actioncode Preselected value of actioncode for filter on type + * @param string|array $actioncode Preselected value(s) of actioncode for filter on type * @param int $usergroupid Id of group to filter on users + * @param string $excludetype A type to exclude ('systemauto', 'system', '') * @return void */ -function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='') +function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals=array(), $actioncode='', $usergroupid='', $excludetype='') { global $conf, $user, $langs, $db, $hookmanager; global $begin_h, $end_h, $begin_d, $end_d; @@ -87,8 +88,12 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print ''; // Status diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 5587efa2431..f82a4feac45 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -2935,7 +2935,9 @@ td.hidden { /* Module agenda */ /* ============================================================================== */ -table.cal_month { border-spacing: 0px; } +table.cal_month { border-spacing: 0px; } +table.cal_month td:first-child { border-left: 0px; } +table.cal_month td:last-child { border-right: 0px; } .cal_current_month { border-top: 0; border-left: solid 1px #E0E0E0; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month_peruserleft { border-top: 0; border-left: solid 3px #6C7C7B; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month_oneday { border-right: solid 1px #E0E0E0; } diff --git a/htdocs/theme/md/img/menus/cart.png b/htdocs/theme/md/img/menus/cart.png new file mode 100644 index 00000000000..8d8da880f0e Binary files /dev/null and b/htdocs/theme/md/img/menus/cart.png differ diff --git a/htdocs/theme/md/img/menus/graph.png b/htdocs/theme/md/img/menus/graph.png new file mode 100644 index 00000000000..fb04031d47a Binary files /dev/null and b/htdocs/theme/md/img/menus/graph.png differ diff --git a/htdocs/theme/md/img/menus/members.png b/htdocs/theme/md/img/menus/members.png index 9bba632552c..270e4de2e05 100644 Binary files a/htdocs/theme/md/img/menus/members.png and b/htdocs/theme/md/img/menus/members.png differ diff --git a/htdocs/theme/md/img/menus/money.png b/htdocs/theme/md/img/menus/money.png index fb04031d47a..707d1676167 100644 Binary files a/htdocs/theme/md/img/menus/money.png and b/htdocs/theme/md/img/menus/money.png differ diff --git a/htdocs/theme/md/img/menus/shop.png b/htdocs/theme/md/img/menus/shop.png index 8d8da880f0e..16b6cd01fbc 100644 Binary files a/htdocs/theme/md/img/menus/shop.png and b/htdocs/theme/md/img/menus/shop.png differ diff --git a/htdocs/theme/md/img/object_bookmark.png b/htdocs/theme/md/img/object_bookmark.png index bde60c8877c..39109ef5ee6 100644 Binary files a/htdocs/theme/md/img/object_bookmark.png and b/htdocs/theme/md/img/object_bookmark.png differ diff --git a/htdocs/theme/md/img/warning.png b/htdocs/theme/md/img/warning.png index dc168ba9439..9ec45736b05 100644 Binary files a/htdocs/theme/md/img/warning.png and b/htdocs/theme/md/img/warning.png differ diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index a7a191f45bb..b40c0f3d6c1 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2807,6 +2807,8 @@ td.hidden { /* ============================================================================== */ table.cal_month { border-spacing: 0px; } +table.cal_month td:first-child { border-left: 0px; } +table.cal_month td:last-child { border-right: 0px; } .cal_current_month { border-top: 0; border-left: solid 1px #E0E0E0; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month_peruserleft { border-top: 0; border-left: solid 3px #6C7C7B; border-right: 0; border-bottom: solid 1px #E0E0E0; } .cal_current_month_oneday { border-right: solid 1px #E0E0E0; }
'.$langs->trans("Day".$arraytimestamp['wday'])."
'; print $langs->trans("Type"); print '  '; - //select_type_actions($selected='',$htmlname='actioncode',$excludetype='',$onlyautoornot=0, $hideinfohelp=0, $multiselect=true) - print $formactions->select_type_actions($actioncode, "actioncode", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), 0, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?0:1)); + $multiselect=0; + if (! empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) // We use an option here because it adds bugs when used on agenda page "peruser" and "list" + { + $multiselect=(!empty($conf->global->AGENDA_USE_EVENT_TYPE)); + } + print $formactions->select_type_actions($actioncode, "actioncode", $excludetype, (empty($conf->global->AGENDA_USE_EVENT_TYPE)?1:0), 0, $multiselect); print '