From d7f557c7edce2d342a61fbbd0e381c104f375100 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Jul 2016 18:34:50 +0200 Subject: [PATCH 01/14] Remove warning --- build/debian/source/lintian-overrides | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/debian/source/lintian-overrides b/build/debian/source/lintian-overrides index a6c41886810..603c27ef4cd 100644 --- a/build/debian/source/lintian-overrides +++ b/build/debian/source/lintian-overrides @@ -1,3 +1,5 @@ # Remove warning, we want to keep both standard and minified sources. dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jsgantt/* -dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jquery/* \ No newline at end of file +dolibarr: source-contains-prebuilt-javascript-object htdocs/includes/jquery/* +# This is a textual data file +source-is-missing htdocs/includes/mobiledetect/mobiledetectlib/Mobile_Detect.json \ No newline at end of file From 07d0f457b464272273e24cec4018b94c78111589 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 12:44:28 +0200 Subject: [PATCH 02/14] Fix: files generated by mass action could not be loaded --- htdocs/core/lib/files.lib.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7ce5b18456b..e8cb4545507 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1990,8 +1990,7 @@ function dol_check_secure_access_document($modulepart,$original_file,$entity,$fu $original_file=$conf->facture->dir_output.'/'.$original_file; $sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."facture WHERE ref='".$db->escape($refname)."' AND entity=".$conf->entity; } - - else if ($modulepart == 'massfilesarea') + else if ($modulepart == 'massfilesarea_facture') { if ($fuser->rights->facture->lire || preg_match('/^specimen/i',$original_file)) { From b085ce69163ffe5d69313cf1913f2e416ed526d3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 13:01:42 +0200 Subject: [PATCH 03/14] Fix lost translation keys --- dev/translation/sanity_check_en_langfiles.php | 2 ++ htdocs/langs/et_EE/install.lang | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/dev/translation/sanity_check_en_langfiles.php b/dev/translation/sanity_check_en_langfiles.php index 66da0eebb41..d947dc846c9 100755 --- a/dev/translation/sanity_check_en_langfiles.php +++ b/dev/translation/sanity_check_en_langfiles.php @@ -297,6 +297,8 @@ if ((! empty($_REQUEST['unused']) && $_REQUEST['unused'] == 'true') || (isset($a // boxes.lang if (preg_match('/^BoxTitleLast/', $value)) $qualifiedforclean=0; if (preg_match('/^BoxTitleLatest/', $value)) $qualifiedforclean=0; + // install.lang + if (preg_match('/^KeepDefaultValues/', $value)) $qualifiedforclean=0; // main.lang if (preg_match('/^Duration/', $value)) $qualifiedforclean=0; if (preg_match('/^FormatDate/', $value)) $qualifiedforclean=0; diff --git a/htdocs/langs/et_EE/install.lang b/htdocs/langs/et_EE/install.lang index 817f47c770b..0fc0a7228a4 100644 --- a/htdocs/langs/et_EE/install.lang +++ b/htdocs/langs/et_EE/install.lang @@ -132,6 +132,10 @@ ActivateModule=Aktiveeri moodul %s ShowEditTechnicalParameters=Klõpsa siia lisaparameetrite näitamiseks/muutmiseks (spetsialisti režiim) WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40/41/42/43), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process... ErrorDatabaseVersionForbiddenForMigration=Sinu andmebaasi versioon on %s. Selles versioonis on tõsine puuk, mis põhjustab andmebaasi struktuuri muutmisel andmekadu, nagu seda teeb migratsiooni protsess. Seega ei ole migratsioon lubatud seni, kuni uuendad oma andmebaasi parandustega versioonile (teadaolevate vigaste versioonide nimekiri: %s) +KeepDefaultValuesWamp=You use the Dolibarr setup wizard from DoliWamp, so values proposed here are already optimized. Change them only if you know what you do. +KeepDefaultValuesDeb=You use the Dolibarr setup wizard from a Linux package (Ubuntu, Debian, Fedora...), so values proposed here are already optimized. Only the password of the database owner to create must be completed. Change other parameters only if you know what you do. +KeepDefaultValuesMamp=You use the Dolibarr setup wizard from DoliMamp, so values proposed here are already optimized. Change them only if you know what you do. +KeepDefaultValuesProxmox=You use the Dolibarr setup wizard from a Proxmox virtual appliance, so values proposed here are already optimized. Change them only if you know what you do. ######### # upgrade From 1b9b4395b92ca3b7c55cf8b7c901b27fe6a16547 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 13:07:34 +0200 Subject: [PATCH 04/14] Fix lost translation keys --- htdocs/langs/en_US/install.lang | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/langs/en_US/install.lang b/htdocs/langs/en_US/install.lang index f9d1d1338c6..e417479758d 100644 --- a/htdocs/langs/en_US/install.lang +++ b/htdocs/langs/en_US/install.lang @@ -132,6 +132,10 @@ ActivateModule=Activate module %s ShowEditTechnicalParameters=Click here to show/edit advanced parameters (expert mode) WarningUpgrade=Warning:\nDid your run a database backup first ?\nThis is highly recommanded: for example, due to some bugs into databases systems (for example mysql version 5.5.40/41/42/43), some data or tables may be lost during this process, so it is highly recommanded to have a complete dump of your database before starting migration.\n\nClick OK to start migration process... ErrorDatabaseVersionForbiddenForMigration=Your database version is %s. It has a critical bug making data loss if you make structure change on your database, like it is required by the migration process. For his reason, migration will not be allowed until you upgrade your database to a higher fixed version (list of known bugged version: %s) +KeepDefaultValuesWamp=You use the Dolibarr setup wizard from DoliWamp, so values proposed here are already optimized. Change them only if you know what you do. +KeepDefaultValuesDeb=You use the Dolibarr setup wizard from a Linux package (Ubuntu, Debian, Fedora...), so values proposed here are already optimized. Only the password of the database owner to create must be completed. Change other parameters only if you know what you do. +KeepDefaultValuesMamp=You use the Dolibarr setup wizard from DoliMamp, so values proposed here are already optimized. Change them only if you know what you do. +KeepDefaultValuesProxmox=You use the Dolibarr setup wizard from a Proxmox virtual appliance, so values proposed here are already optimized. Change them only if you know what you do. ######### # upgrade From 867a0072e39cbf25650d31d5b61a75d0c1872f9c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 13:20:34 +0200 Subject: [PATCH 05/14] Fix forcing on module setup was not working --- htdocs/admin/modules.php | 2 +- htdocs/index.php | 6 +++++- htdocs/langs/en_US/admin.lang | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 1151ef4abb9..91ab445654f 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -304,7 +304,7 @@ $h++; print "
\n"; -dol_fiche_head($head, $mode, $langs->trans("Modules")); +dol_fiche_head($head, $mode, ''); $var=true; diff --git a/htdocs/index.php b/htdocs/index.php index 2a524d56078..faa2eb9dcee 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -47,7 +47,11 @@ if (!isset($conf->global->MAIN_INFO_SOCIETE_NOM) || empty($conf->global->MAIN_IN header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete"); exit; } - +if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)?1:$conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) // If only user module enabled +{ + header("Location: ".DOL_URL_ROOT."/admin/index.php?mainmenu=home&leftmenu=setup&mesg=setupnotcomplete"); + exit; +} if (GETPOST('addbox')) // Add box (when submit is done from a form when ajax disabled) { require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php'; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 8b2d46aedb3..fa5ec94d067 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -950,7 +950,7 @@ LogEventDesc=You can enable here the logging for Dolibarr security events. Admin AreaForAdminOnly=Those features can be used by administrator users only. SystemInfoDesc=System information is miscellaneous technical information you get in read only mode and visible for administrators only. SystemAreaForAdminOnly=This area is available for administrator users only. None of the Dolibarr permissions can reduce this limit. -CompanyFundationDesc=Edit on this page all known information of the company or foundation you need to manage (For this, click on "Modify" button at bottom of page) +CompanyFundationDesc=Edit on this page all known information of the company or foundation you need to manage (For this, click on "Modify" or "Save" button at bottom of page) DisplayDesc=You can choose each parameter related to the Dolibarr look and feel here AvailableModules=Available modules ToActivateModule=To activate modules, go on setup Area (Home->Setup->Modules). From 343561be7ad7956d54ef836fe6f637a58db896c6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 13:37:17 +0200 Subject: [PATCH 06/14] Fix colspan --- htdocs/admin/modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index 91ab445654f..113d12570cb 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -443,11 +443,11 @@ if ($mode != 'marketplace') if ($familykey!=$oldfamily) { print ''."\n"; - print ''; + print ''; $familytext=empty($familyinfo[$familykey]['label'])?$familykey:$familyinfo[$familykey]['label']; print $familytext; print "\n"; - print ''.$langs->trans("SetupShort").''."\n"; + print ''.$langs->trans("SetupShort").''."\n"; print "\n"; $atleastoneforfamily=0; //print "yy".$oldfamily."-".$familykey."-".$atleastoneforfamily."
"; From 59e9d7f397a93e94c3bb190369e7e9061189d969 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 13:41:06 +0200 Subject: [PATCH 07/14] Fix the repositioning works better with new system class="reposition" compared to old system (#tag) --- htdocs/admin/perms.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 2e0ba0873bf..8ce7e046186 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -200,13 +200,13 @@ if ($result) { print img_picto($langs->trans("Active"),'tick'); print ''; - print ''.img_edit_remove().''; + print ''.img_edit_remove().''; } else { print ' '; print ''; - print ''.img_edit_add().''; + print ''.img_edit_add().''; } print ''; From 60c71d88f756ca4276b97829c7278333b20e2555 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 14:30:48 +0200 Subject: [PATCH 08/14] Fix missing loading admin langs --- htdocs/api/admin/explorer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/api/admin/explorer.php b/htdocs/api/admin/explorer.php index 53ff102e89b..3f1394d3866 100644 --- a/htdocs/api/admin/explorer.php +++ b/htdocs/api/admin/explorer.php @@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/api/class/api.class.php'; require_once DOL_DOCUMENT_ROOT.'/api/class/api_access.class.php'; +$langs->load("admin"); + /* * View @@ -36,7 +38,6 @@ require_once DOL_DOCUMENT_ROOT.'/api/class/api_access.class.php'; // Enable and test if module Api is enabled if (empty($conf->global->MAIN_MODULE_API)) { - $langs->load("admin"); dol_syslog("Call Dolibarr API interfaces with module REST disabled"); print $langs->trans("WarningModuleNotActive",'Api').'.

'; print $langs->trans("ToActivateModule"); From 50f76cbb9c9998d7204d847d97a64bf1c61ad2b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Jul 2016 21:50:04 +0200 Subject: [PATCH 09/14] Fix bad css --- htdocs/contrat/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 5a87d3b3d51..49f8130c5b4 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1513,7 +1513,7 @@ else // Remise if ($objp->remise_percent > 0) { - print ''.$objp->remise_percent."%\n"; + print ''.$objp->remise_percent."%\n"; } else { From 9661f08b38f82643b1020b47c667a5023e1e3e6b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Jul 2016 22:17:12 +0200 Subject: [PATCH 10/14] Fix filter on dates of services --- htdocs/contrat/services.php | 120 +++++++++++++++++++++++++++--------- 1 file changed, 92 insertions(+), 28 deletions(-) diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php index d0962ad757e..d2de41391de 100644 --- a/htdocs/contrat/services.php +++ b/htdocs/contrat/services.php @@ -52,15 +52,26 @@ $search_status=GETPOST("search_status","alpha"); $statut=GETPOST('statut')?GETPOST('statut'):1; $socid=GETPOST('socid','int'); +$opouvertureprevuemonth=GETPOST('opouvertureprevuemonth'); +$opouvertureprevueday=GETPOST('opouvertureprevueday'); +$opouvertureprevueyear=GETPOST('opouvertureprevueyear'); +$filter_opouvertureprevue=GETPOST('filter_opouvertureprevue'); + $op1month=GETPOST('op1month'); $op1day=GETPOST('op1day'); $op1year=GETPOST('op1year'); $filter_op1=GETPOST('filter_op1'); + $op2month=GETPOST('op2month'); $op2day=GETPOST('op2day'); $op2year=GETPOST('op2year'); $filter_op2=GETPOST('filter_op2'); +$opcloturemonth=GETPOST('opcloturemonth'); +$opclotureday=GETPOST('opclotureday'); +$opclotureyear=GETPOST('opclotureyear'); +$filter_opcloture=GETPOST('filter_opcloture'); + // Security check $contratid = GETPOST('id','int'); if (! empty($user->societe_id)) $socid=$user->societe_id; @@ -88,12 +99,20 @@ $staticcontrat=new Contrat($db); $staticcontratligne=new ContratLigne($db); $companystatic=new Societe($db); -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +/* + * Actions + */ + +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $search_name=""; $search_contract=""; $search_service=""; $search_status=-1; + $opouvertureprevuemonth=""; + $opouvertureprevueday=""; + $opouvertureprevueyear=""; + $filter_opouvertureprevue=""; $op1month=""; $op1day=""; $op1year=""; @@ -102,6 +121,10 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both $op2day=""; $op2year=""; $filter_op2=""; + $opcloturemonth=""; + $opclotureday=""; + $opclotureyear=""; + $filter_opcloture=""; $mode=''; $filter=''; } @@ -143,10 +166,14 @@ if ($search_name) $sql.= " AND s.nom LIKE '%".$db->escape($search_name)."%'" if ($search_contract) $sql.= " AND c.rowid = '".$db->escape($search_contract)."'"; if ($search_service) $sql.= " AND (p.ref LIKE '%".$db->escape($search_service)."%' OR p.description LIKE '%".$db->escape($search_service)."%' OR cd.description LIKE '%".$db->escape($search_service)."%')"; if ($socid > 0) $sql.= " AND s.rowid = ".$socid; +$filter_dateouvertureprevue=dol_mktime(0,0,0,$opouvertureprevuemonth,$opouvertureprevueday,$opouvertureprevueyear); $filter_date1=dol_mktime(0,0,0,$op1month,$op1day,$op1year); $filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year); -if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND date_ouverture_prevue ".$filter_op1." '".$db->idate($filter_date1)."'"; -if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'"; +$filter_datecloture=dol_mktime(0,0,0,$opcloturemonth,$opclotureday,$opclotureyear); +if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1 && $filter_dateouvertureprevue != '') $sql.= " AND cd.date_ouverture_prevue ".$filter_opouvertureprevue." '".$db->idate($filter_dateouvertureprevue)."'"; +if (! empty($filter_op1) && $filter_op1 != -1 && $filter_date1 != '') $sql.= " AND cd.date_ouverture ".$filter_op1." '".$db->idate($filter_date1)."'"; +if (! empty($filter_op2) && $filter_op2 != -1 && $filter_date2 != '') $sql.= " AND cd.date_fin_validite ".$filter_op2." '".$db->idate($filter_date2)."'"; +if (! empty($filter_opcloture) && $filter_opcloture != -1 && $filter_datecloture != '') $sql.= " AND cd.date_cloture ".$filter_opcloture." '".$db->idate($filter_datecloture)."'"; $totalnboflines=0; $result=$db->query($sql); if ($result) @@ -170,11 +197,15 @@ if ($resql) if ($search_service) $param.='&search_service='.urlencode($search_service); if ($mode) $param.='&mode='.$mode; if ($filter) $param.='&filter='.$filter; + if (! empty($filter_opouvertureprevue) && $filter_opouvertureprevue != -1) $param.='&filter_opouvertureprevue='.urlencode($filter_opouvertureprevue); if (! empty($filter_op1) && $filter_op1 != -1) $param.='&filter_op1='.urlencode($filter_op1); if (! empty($filter_op2) && $filter_op2 != -1) $param.='&filter_op2='.urlencode($filter_op2); + if (! empty($filter_opcloture) && $filter_opcloture != -1) $param.='&filter_opcloture='.urlencode($filter_opcloture); + if ($filter_dateouvertureprevue != '') $param.='&opouvertureprevueday='.$opouvertureprevueday.'&opouvertureprevuemonth='.$opouvertureprevuemonth.'&opouvertureprevueyear='.$opouvertureprevueyear; if ($filter_date1 != '') $param.='&op1day='.$op1day.'&op1month='.$op1month.'&op1year='.$op1year; if ($filter_date2 != '') $param.='&op2day='.$op2day.'&op2month='.$op2month.'&op2year='.$op2year; - + if ($filter_datecloture != '') $param.='&opclotureday='.$op2day.'&opcloturemonth='.$op2month.'&opclotureyear='.$op2year; + $title=$langs->trans("ListOfServices"); if ($mode == "0") $title=$langs->trans("ListOfInactiveServices"); // Must use == "0" if ($mode == "4" && $filter != "expired") $title=$langs->trans("ListOfRunningServices"); @@ -191,11 +222,11 @@ if ($resql) print_liste_field_titre($langs->trans("Service"),$_SERVER["PHP_SELF"], "p.description",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"], "s.nom",$param,"","",$sortfield,$sortorder); // Date debut - if ($mode == "0") print_liste_field_titre($langs->trans("DateStartPlannedShort"),$_SERVER["PHP_SELF"], "cd.date_ouverture_prevue",$param,'',' align="center"',$sortfield,$sortorder); - if ($mode == "" || $mode > 0) print_liste_field_titre($langs->trans("DateStartRealShort"),$_SERVER["PHP_SELF"], "cd.date_ouverture",$param,'',' align="center"',$sortfield,$sortorder); + if (($mode == "" || $mode == -1) || $mode == "0") print_liste_field_titre($langs->trans("DateStartPlannedShort"),$_SERVER["PHP_SELF"], "cd.date_ouverture_prevue",$param,'',' align="center"',$sortfield,$sortorder); + if (($mode == "" || $mode == -1) || $mode > 0) print_liste_field_titre($langs->trans("DateStartRealShort"),$_SERVER["PHP_SELF"], "cd.date_ouverture",$param,'',' align="center"',$sortfield,$sortorder); // Date fin - if ($mode == "" || $mode < 5) print_liste_field_titre($langs->trans("DateEndPlannedShort"),$_SERVER["PHP_SELF"], "cd.date_fin_validite",$param,'',' align="center"',$sortfield,$sortorder); - else print_liste_field_titre($langs->trans("DateEndRealShort"),$_SERVER["PHP_SELF"], "cd.date_cloture",$param,'',' align="center"',$sortfield,$sortorder); + if (($mode == "" || $mode == -1) || $mode < 5) print_liste_field_titre($langs->trans("DateEndPlannedShort"),$_SERVER["PHP_SELF"], "cd.date_fin_validite",$param,'',' align="center"',$sortfield,$sortorder); + if (($mode == "" || $mode == -1) || $mode >= 5) print_liste_field_titre($langs->trans("DateEndRealShort"),$_SERVER["PHP_SELF"], "cd.date_cloture",$param,'',' align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"], "cd.statut,c.statut",$param,"","align=\"right\"",$sortfield,$sortorder); print_liste_field_titre('',$_SERVER["PHP_SELF"],"",'','','',$sortfield,$sortorder,'maxwidthsearch '); print "\n"; @@ -214,20 +245,46 @@ if ($resql) print ''; print ''; print ''; - print ''; - $arrayofoperators=array('<'=>'<','>'=>'>'); - print $form->selectarray('filter_op1',$arrayofoperators,$filter_op1,1); - print ' '; - $filter_date1=dol_mktime(0,0,0,$op1month,$op1day,$op1year); - print $form->select_date($filter_date1,'op1',0,0,1,'',1,0,1); - print ''; - print ''; - $arrayofoperators=array('<'=>'<','>'=>'>'); - print $form->selectarray('filter_op2',$arrayofoperators,$filter_op2,1); - print ' '; - $filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year); - print $form->select_date($filter_date2,'op2',0,0,1,'',1,0,1); - print ''; + if (($mode == "" || $mode == -1) || $mode == "0") + { + print ''; + $arrayofoperators=array('<'=>'<','>'=>'>'); + print $form->selectarray('filter_opouvertureprevue',$arrayofoperators,$filter_opouvertureprevue,1); + print ' '; + $filter_dateouvertureprevue=dol_mktime(0,0,0,$opouvertureprevuemonth,$opouvertureprevueday,$opouvertureprevueyear); + print $form->select_date($filter_dateouvertureprevue,'opouvertureprevue',0,0,1,'',1,0,1); + print ''; + } + if (($mode == "" || $mode == -1) || $mode > 0) + { + print ''; + $arrayofoperators=array('<'=>'<','>'=>'>'); + print $form->selectarray('filter_op1',$arrayofoperators,$filter_op1,1); + print ' '; + $filter_date1=dol_mktime(0,0,0,$op1month,$op1day,$op1year); + print $form->select_date($filter_date1,'op1',0,0,1,'',1,0,1); + print ''; + } + if (($mode == "" || $mode == -1) || $mode < 5) + { + print ''; + $arrayofoperators=array('<'=>'<','>'=>'>'); + print $form->selectarray('filter_op2',$arrayofoperators,$filter_op2,1); + print ' '; + $filter_date2=dol_mktime(0,0,0,$op2month,$op2day,$op2year); + print $form->select_date($filter_date2,'op2',0,0,1,'',1,0,1); + print ''; + } + if (($mode == "" || $mode == -1) || $mode >= 5) + { + print ''; + $arrayofoperators=array('<'=>'<','>'=>'>'); + print $form->selectarray('filter_opcloture',$arrayofoperators,$filter_opcloture,1); + print ' '; + $filter_date_cloture=dol_mktime(0,0,0,$opcloturemonth,$opclotureday,$opclotureyear); + print $form->select_date($filter_date_cloture,'opcloture',0,0,1,'',1,0,1); + print ''; + } print ''; $arrayofstatus=array( '0'=>$langs->trans("ServiceStatusInitial"), @@ -287,7 +344,8 @@ if ($resql) print ''; // Start date - if ($mode == "0") { + if (($mode == "" || $mode == -1) || $mode == "0") + { print ''; print ($obj->date_ouverture_prevue?dol_print_date($db->jdate($obj->date_ouverture_prevue)):' '); if ($db->jdate($obj->date_ouverture_prevue) && ($db->jdate($obj->date_ouverture_prevue) < ($now - $conf->contrat->services->inactifs->warning_delay))) @@ -295,13 +353,19 @@ if ($resql) else print '    '; print ''; } - if ($mode == "" || $mode > 0) print ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').''; + if (($mode == "" || $mode == -1) || $mode > 0) + { + print ''.($obj->date_ouverture?dol_print_date($db->jdate($obj->date_ouverture)):' ').''; + } // Date fin - if ($mode == "" || $mode < 5) print ''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' '); - else print ''.dol_print_date($db->jdate($obj->date_cloture)); + if (($mode == "" || $mode == -1) || $mode < 5) + { + print ''.($obj->date_fin_validite?dol_print_date($db->jdate($obj->date_fin_validite)):' '); + if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late")); + else print '    '; + } + if (($mode == "" || $mode == -1) || $mode >= 5) print ''.dol_print_date($db->jdate($obj->date_cloture)); // Icone warning - if ($obj->date_fin_validite && $db->jdate($obj->date_fin_validite) < ($now - $conf->contrat->services->expires->warning_delay) && $obj->statut < 5) print img_warning($langs->trans("Late")); - else print '    '; print ''; print ''; if ($obj->cstatut == 0) // If contract is draft, we say line is also draft From 23753d849c6c421688d828005495698c85e0f7ec Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 23 Jul 2016 11:10:08 +0200 Subject: [PATCH 11/14] FIX Data not lost when error during creation of leave request. Conflicts: htdocs/holiday/define_holiday.php --- htdocs/holiday/card.php | 35 +++++++++++-------- htdocs/holiday/define_holiday.php | 58 ------------------------------- 2 files changed, 20 insertions(+), 73 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 81b9dbca14b..9b3494c762f 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -95,36 +95,41 @@ if ($action == 'create') // If no start date if (empty($date_debut)) { - header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=nodatedebut'); - exit; + setEventMessages($langs->trans("NoDateDebut"), null, 'errors'); + $error++; + $action='create'; } // If no end date if (empty($date_fin)) { - header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=nodatefin'); - exit; + setEventMessages($langs->trans("NoDateFin"), null, 'errors'); + $error++; + $action='create'; } // If start date after end date if ($date_debut > $date_fin) { - header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=datefin'); - exit; + setEventMessages($langs->trans("ErrorEndDateCP"), null, 'errors'); + $error++; + $action='create'; } // Check if there is already holiday for this period $verifCP = $cp->verifDateHolidayCP($userID, $date_debut, $date_fin, $halfday); if (! $verifCP) { - header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=alreadyCP'); - exit; + setEventMessages($langs->trans("alreadyCPexist"), null, 'errors'); + $error++; + $action='create'; } // If there is no Business Days within request $nbopenedday=num_open_day($date_debut_gmt, $date_fin_gmt, 0, 1, $halfday); if($nbopenedday < 0.5) { - header('Location: '.$_SERVER["PHP_SELF"].'?action=request&error=DureeHoliday'); - exit; + setEventMessages($langs->trans("ErrorDureeCP"), null, 'errors'); + $error++; + $action='create'; } // If no validator designated @@ -823,10 +828,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print ''; // Si la demande ne vient pas de l'agenda if (! GETPOST('date_debut_')) { - $form->select_date(-1,'date_debut_'); + $form->select_date(-1, 'date_debut_', 0, 0, 0, '', 1, 1); } else { $tmpdate = dol_mktime(0, 0, 0, GETPOST('date_debut_month'), GETPOST('date_debut_day'), GETPOST('date_debut_year')); - $form->select_date($tmpdate,'date_debut_'); + $form->select_date($tmpdate, 'date_debut_', 0, 0, 0, '', 1, 1); } print '     '; print $form->selectarray('starthalfday', $listhalfday, (GETPOST('starthalfday')?GETPOST('starthalfday'):'morning')); @@ -839,10 +844,10 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print ''; // Si la demande ne vient pas de l'agenda if (! GETPOST('date_fin_')) { - $form->select_date(-1,'date_fin_'); + $form->select_date(-1,'date_fin_', 0, 0, 0, '', 1, 1); } else { $tmpdate = dol_mktime(0, 0, 0, GETPOST('date_fin_month'), GETPOST('date_fin_day'), GETPOST('date_fin_year')); - $form->select_date($tmpdate,'date_fin_'); + $form->select_date($tmpdate,'date_fin_', 0, 0, 0, '', 1, 1); } print '     '; print $form->selectarray('endhalfday', $listhalfday, (GETPOST('endhalfday')?GETPOST('endhalfday'):'afternoon')); @@ -861,7 +866,7 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print ''; print ''.$langs->trans("DescCP").''; print ''; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 7a94e686173..92a93a0d357 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -106,46 +106,6 @@ if ($action == 'update' && isset($_POST['update_cp'])) if (! $error) setEventMessages('UpdateConfCPOK', '', 'mesgs'); } -elseif($action == 'add_event') -{ - $error = 0; - - $typeleaves=$holiday->getTypes(1,1); - - if(!empty($_POST['list_event']) && $_POST['list_event'] > 0) { - $event = $_POST['list_event']; - } else { $error++; - } - - if(!empty($_POST['userCP']) && $_POST['userCP'] > 0) { - $userCP = $_POST['userCP']; - } else { $erro++; - } - - if ($error) - { - setEventMessages('ErrorAddEventToUserCP', '', 'errors'); - } - else - { - $nb_holiday = $holiday->getCPforUser($userCP); - $add_holiday = $holiday->getValueEventCp($event); - $new_holiday = $nb_holiday + $add_holiday; - - // add event to existing types of vacation - foreach ($typeleaves as $key => $leave) - { - $vacationTypeID = $leave['rowid']; - - // On ajoute la modification dans le LOG - $holiday->addLogCP($user->id,$userCP, $holiday->getNameEventCp($event),$new_holiday, $vacationTypeID); - - $holiday->updateSoldeCP($userCP,$new_holiday, $vacationTypeID); - } - - setEventMessages('AddEventToUserOkCP', '', 'mesgs'); - } -} /* @@ -186,24 +146,6 @@ if (is_numeric($listUsers) && $listUsers < 0) $var=true; $i = 0; -$cp_events = $holiday->fetchEventsCP(); -if ($cp_events == 1) -{ - print '
'."\n"; - print ''; - - print load_fiche_titre($langs->trans('DefineEventUserCP'),'',''); - - print $langs->trans('MotifCP').' : '; - print $holiday->selectEventCP(); - print '   '.$langs->trans('UserCP').' : '; - print $form->select_dolusers('', 'userCP', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300'); - print ' '; - - print '

'; -} - - $typeleaves=$holiday->getTypes(1,1); if (count($typeleaves) == 0) From 4448c5e86fef08ec4a396f3b9f639bc5cc0a4270 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Jul 2016 20:50:46 +0200 Subject: [PATCH 12/14] Removed "small" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3a542b194e..cbb3da345b4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Dolibarr ERP & CRM is a modern software to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...). -It's an Open Source software (wrote in PHP language) designed for small and medium companies, foundation and freelances. +It's an Open Source software (wrote in PHP language) designed for companies, foundations and freelances. You can freely use, study, modify or distribute it according to its Free Software licence. From efe1cde388bab583a1d8c72e8999dd6dc8de4e81 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 21 Jul 2016 20:51:17 +0200 Subject: [PATCH 13/14] More keywords in desc --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cbb3da345b4..cb5f7e61c70 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Dolibarr ERP & CRM is a modern software to manage your organization's activity (contacts, suppliers, invoices, orders, stocks, agenda, ...). -It's an Open Source software (wrote in PHP language) designed for companies, foundations and freelances. +It's an Open Source software (wrote in PHP language) designed for small, medium or large companies, foundations and freelances. You can freely use, study, modify or distribute it according to its Free Software licence. From 834356b61eac54c685089c9ebc0cec9deb453fc2 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 24 Jul 2016 22:24:18 +0200 Subject: [PATCH 14/14] Fix missing opacity css --- htdocs/contrat/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php index 250f1c98199..86f7c00e566 100644 --- a/htdocs/contrat/index.php +++ b/htdocs/contrat/index.php @@ -273,7 +273,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire) } else { - print ''.$langs->trans("NoContracts").''; + print ''.$langs->trans("NoContracts").''; } print "
"; $db->free($resql);