From 5cd43d2df0ae9c742f7222c973c12b6ffb5fa23e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Dec 2015 20:51:34 +0100 Subject: [PATCH] Some debug on new features --- .../comm/action/class/cactioncomm.class.php | 15 +++++++------ htdocs/comm/action/index.php | 8 +++---- htdocs/comm/action/listactions.php | 20 ++++++++++++------ htdocs/comm/action/peruser.php | 2 +- htdocs/core/class/html.formactions.class.php | 15 ++++++------- htdocs/core/lib/agenda.lib.php | 13 ++++++++---- htdocs/theme/eldy/style.css.php | 4 +++- htdocs/theme/md/img/menus/cart.png | Bin 0 -> 259 bytes htdocs/theme/md/img/menus/graph.png | Bin 0 -> 179 bytes htdocs/theme/md/img/menus/members.png | Bin 145 -> 210 bytes htdocs/theme/md/img/menus/money.png | Bin 179 -> 256 bytes htdocs/theme/md/img/menus/shop.png | Bin 259 -> 403 bytes htdocs/theme/md/img/object_bookmark.png | Bin 131 -> 201 bytes htdocs/theme/md/img/warning.png | Bin 169 -> 392 bytes htdocs/theme/md/style.css.php | 2 ++ 15 files changed, 48 insertions(+), 31 deletions(-) create mode 100644 htdocs/theme/md/img/menus/cart.png create mode 100644 htdocs/theme/md/img/menus/graph.png 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 0000000000000000000000000000000000000000..8d8da880f0ed080f7cb941c3c0418750a8a19ab2 GIT binary patch literal 259 zcmV+e0sQ`nP)L5zN4myC5pzfdvT9Pn;R$7oy9z5@&ME(Wdb^2b! zpU^P%q#jinDGZ|;eJcwKnO>CBFvp2g%+#Zd5hjsyhhh9q-^#mget1ykKDIem<}9|^H<8&Tb89dDt4}1A4$c;xxeEXQ002ov JPDHLkV1myHXpR5? literal 0 HcmV?d00001 diff --git a/htdocs/theme/md/img/menus/graph.png b/htdocs/theme/md/img/menus/graph.png new file mode 100644 index 0000000000000000000000000000000000000000..fb04031d47a2df76d49938e674ea79ee0082d470 GIT binary patch literal 179 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+iDo+>35R22v2@mdKI;Vst064gn-giR5MyT) z#zrHXkA;OzrW^JRyyd~TF>+&RWo86mZ0_~r-C*OJ6u><6ZcsJ@X8^CEcY~@KIQ99r zl~#S;_vy@wrK!_C|Mv~%E-gG-TYIoDaRy)#IHq)$07*qoM6N<$f>csYK>z>% delta 116 zcmV-)0E_?90g(ZaByCtpL_t(I%VS`m3-}-O|K)!|;MM;?ga*ROLEt4q0}v2&1+tnE ztAQ9mXALy=^eduV^a7zFkci~>;=eymtFd|%pIhmm;lO_fAUr^v2B2a%8>oqa?f?M7 Wp_dQLKwr}U0000M`lT9g!$!fBgn3RF;WVKl=CK+V4 z@(pwiK7hnGA*GCzf$;weS3R~f-Oeuq<-F5->KWeprGN1Zf-k8n9bZ2MtIh!@W@B&& z-rf1Yo5eC%0NX0bs0P<%u!pPM#=%SpY~k5-?&0VOPk6L%&Ru{QNao!F?j4wlK{9OJ znOD$L2Owui?Gk;HA;=l?g3S^*!m-@lV7CNT(ArQ*M(lv4_%!(Rpao4ldf6%9!rHH# ecMRhEE%*jzx;+l;APyz~0000w>lX zBvLt;57B~0`Bijjpq9NjlmjLA<1r1Z1|2-6jRGP)hj0QnaL=nAt zb0`XL)4`S9zQ4QuU}5iX{T#1w{4{DfBH0BR zqL~z!Yt)-BNT14zbo{ z8My+p{9vieIg7|0H~|127(>>x153nhAs;{s0Jx^$2j~I-yT}jFAyams=^F?L{Q)u2 zAo2j@yP*Q+Ipd2CO#*~4@7#ZKNPsZy>_DAl4TNcD2ihcy5T>0S2#r9P6*whX4Pn~Z xfifS&y;DY*c6LBiXb=%mi$AmPhV3PffPX10FMX7kh8h3>002ovPDHLkV1g}9qsIUM literal 259 zcmV+e0sQ`nP)L5zN4myC5pzfdvT9Pn;R$7oy9z5@&ME(Wdb^2b! zpU^P%q#jinDGZ|;eJcwKnO>CBFvp2g%+#Zd5hjsyhhh9q-^#mget1ykKDIem<}9|^H<8&Tb89dDt4}1A4$c;xxeEXQ002ov JPDHLkV1myHXpR5? diff --git a/htdocs/theme/md/img/object_bookmark.png b/htdocs/theme/md/img/object_bookmark.png index bde60c8877c7ac3d47ebc9c0609ba0f7be711c92..39109ef5ee61c102adfab2c4c7378fd83f76c040 100644 GIT binary patch literal 201 zcmeAS@N?(olHy`uVBq!ia0vp^JRr=%3?!FCJ6-`&Ea{HEjtmSN`?>!lvI6;90X`wF z|NsAAyLRo~y?c)xJ2qv?lzaE?egFRb`Sa)3u3g)@b?dov=ia}6zjW!+mX?;D>e*9) zx)@7>{DK)Ap4~_Ta%??a978y+Cnp?Ws{raQk(7{NW!*Z>z@XsGy?xc{%*@$QuQsVD wOqE*7y2wcF97|xPYpO$6;LRHmtjnYs7Mk%eyI5Cl1{%cR>FVdQ&MBb@0LwH@(f|Me literal 131 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+0wn(&ce?|mygXeTLn;`P7cgd|+&Evrz}UEl ztwi-0&;N}M$|0_N5u%m>i!wqk+PCF8{NUfd$e(AjM94uKQ-#;U%aml>V%XwR7!~xz dHM~+87(99#8hq?|z5z{T@O1TaS?83{1OV~(CF%eG diff --git a/htdocs/theme/md/img/warning.png b/htdocs/theme/md/img/warning.png index dc168ba9439b1f04c813c2794c8778dc78b8dcc9..9ec45736b054e87b7c15ec72a3658bc2a6c16040 100644 GIT binary patch delta 376 zcmV-;0f+vn0f+;T8Gi-<0036bj#mHx00v@9M??VM0FeLy4mW`?00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-yu1QHq)(0eDe0003MNklMlFCMu zL4*1PY5b{Dh@?@_MzNSWXq`mu1UrqTHmPHykf#{%2|~aZ(0@h=K0|CKaJ}v|SqpJs z*qO7lhncgx@K>-NCRBnJ}Pw(6TR!pTGI+FxQD!>yk@6f8RufBc&+qK^CIkzKIDFDqB zNyrv}hS%o4qj3sQ&tT^Pvbw*oK_1b41{(pbR6LfV1ayJTZ=;#Y39uf}aLzre=Z2{q ze-YbMmViF67#L%GW39m68?aXE4c`+}Nq{Th;+OyW8n`U_E$jg=u0xC^z&>!xzq3!S WJv3GMxo~Fy0000M(hW|jA z1Z3d=Vhk673cwJ^62-3Q08kPE_hM6G0+mESV@yTq7>d#`71d)Xs>4*&fT5^?c8U}j z9$+YX02DH;^P90028pViBs2vzMs=0000
'.$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 '