From be63eb8cef9b1f37f98cf0adb09af638f957c1b8 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 1 Sep 2017 07:34:01 +0200 Subject: [PATCH 1/4] Fix : missing language key "Events" everywhere --- htdocs/langs/en_US/main.lang | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index b8544ee3eda..d5cbd14c11d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -794,6 +794,7 @@ TitleSetToDraft=Go back to draft ConfirmSetToDraft=Are you sure you want to go back to Draft status ? ImportId=Import id Websites=Web sites +Events=Events # Week day Monday=Monday Tuesday=Tuesday From d9008cd3021cce01ab8ad4ac012bf9731f225740 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Sep 2017 08:20:33 +0200 Subject: [PATCH 2/4] Fix: missing $dolibarrdataroot value --- htdocs/admin/modules.php | 184 +++++++++++++++++++-------------------- 1 file changed, 90 insertions(+), 94 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index a59d6fca3bb..6b290ab8f07 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -843,115 +843,111 @@ if ($mode == 'marketplace') if ($mode == 'deploy') { - dol_fiche_head($head, $mode, '', -1); + dol_fiche_head($head, $mode, '', -1); + $dolibarrdataroot=preg_replace('/([\\/]+)$/i','',DOL_DATA_ROOT); + $allowonlineinstall=true; + $allowfromweb=1; + if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false; - $allowonlineinstall=true; - $allowfromweb=1; - if (dol_is_file($dolibarrdataroot.'/installmodules.lock')) $allowonlineinstall=false; + $fullurl=''.$urldolibarrmodules.''; + $message=''; + if (! empty($allowonlineinstall)) + { + if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) + { + $message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); + $allowfromweb=-1; + } + else + { + if ($dirins_ok) + { + if (! is_writable(dol_osencode($dirins))) + { + $langs->load("errors"); + $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); + $allowfromweb=0; + } + } + else + { + $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); + $allowfromweb=0; + } + } + } + else + { + $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); + $allowfromweb=0; + } - $fullurl=''.$urldolibarrmodules.''; - $message=''; - if (! empty($allowonlineinstall)) - { - if (! in_array('/custom',explode(',',$dolibarr_main_url_root_alt))) - { - $message=info_admin($langs->trans("ConfFileMustContainCustom", DOL_DOCUMENT_ROOT.'/custom', DOL_DOCUMENT_ROOT)); - $allowfromweb=-1; - } - else - { - if ($dirins_ok) - { - if (! is_writable(dol_osencode($dirins))) - { - $langs->load("errors"); - $message=info_admin($langs->trans("ErrorFailedToWriteInDir",$dirins)); - $allowfromweb=0; - } - } - else - { + if ($allowfromweb < 1) + { + print $langs->trans("SomethingMakeInstallFromWebNotPossible"); + print $message; + //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); + print '
'; + } - $message=info_admin($langs->trans("NotExistsDirect",$dirins).$langs->trans("InfDirAlt").$langs->trans("InfDirExample")); - $allowfromweb=0; - } - } - } - else - { - $message=info_admin($langs->trans("InstallModuleFromWebHasBeenDisabledByFile",$dolibarrdataroot.'/installmodules.lock')); - $allowfromweb=0; - } + print '
'; - if ($allowfromweb < 1) - { - print $langs->trans("SomethingMakeInstallFromWebNotPossible"); - print $message; - //print $langs->trans("SomethingMakeInstallFromWebNotPossible2"); - print '
'; - } + if ($allowfromweb >= 0) + { + if ($allowfromweb == 1) + { + //print $langs->trans("ThisIsProcessToFollow").'
'; + } + else + { + print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; + print ''.$langs->trans("StepNb",1).': '; + print $langs->trans("FindPackageFromWebSite",$fullurl).'
'; + print ''.$langs->trans("StepNb",2).': '; + print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
'; + print ''.$langs->trans("StepNb",3).': '; + } - print '
'; + if ($allowfromweb == 1) + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; - if ($allowfromweb >= 0) - { - if ($allowfromweb == 1) - { - //print $langs->trans("ThisIsProcessToFollow").'
'; - } - else - { - print $langs->trans("ThisIsAlternativeProcessToFollow").'
'; - print ''.$langs->trans("StepNb",1).': '; - print $langs->trans("FindPackageFromWebSite",$fullurl).'
'; - print ''.$langs->trans("StepNb",2).': '; - print $langs->trans("DownloadPackageFromWebSite",$fullurl).'
'; - print ''.$langs->trans("StepNb",3).': '; - } + print '
'; - if ($allowfromweb == 1) - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; + print '
'; + print ''; + print ''; + print $langs->trans("YouCanSubmitFile").' '; + print ''; + print '
'; - print '
'; + print '
'; + print '
'; - print '
'; - print ''; - print ''; - print $langs->trans("YouCanSubmitFile").' '; - print ''; - print '
'; + print '
'; + } + else + { + print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; + print ''.$langs->trans("StepNb",4).': '; + print $langs->trans("SetupIsReadyForUse").'
'; + } + } - print '
'; - print '
'; + if (! empty($result['return'])) + { + print '
'; - print '
'; - } - else - { - print $langs->trans("UnpackPackageInModulesRoot",$dirins).'
'; - print ''.$langs->trans("StepNb",4).': '; - print $langs->trans("SetupIsReadyForUse").'
'; - } - } + foreach($result['return'] as $value) + { + echo $value.'
'; + } + } - - if (! empty($result['return'])) - { - print '
'; - - foreach($result['return'] as $value) - { - echo $value.'
'; - } - } - - dol_fiche_end(); + dol_fiche_end(); } - - llxFooter(); $db->close(); From 0fc8a0f84063bfa911a6f1103a238861852f6543 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 1 Sep 2017 16:54:06 +0200 Subject: [PATCH 3/4] Fix: avoid warning "non-numeric value encountered" --- htdocs/projet/tasks.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 204b393cc6d..c00e93e239f 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -1,7 +1,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -70,7 +70,9 @@ $hookmanager->initHooks(array('projecttaskcard','globalcard')); $progress=GETPOST('progress', 'int'); $label=GETPOST('label', 'alpha'); $description=GETPOST('description'); -$planned_workload=GETPOST('planned_workloadhour')*3600+GETPOST('planned_workloadmin')*60; +$planned_workloadhour=(GETPOST('planned_workloadhour','int')?GETPOST('planned_workloadhour','int'):0); +$planned_workloadmin=(GETPOST('planned_workloadmin','int')?GETPOST('planned_workloadmin','int'):0); +$planned_workload=$planned_workloadhour*3600+$planned_workloadmin*60; $userAccess=0; From 7c722def0fad9e5b4d7d4fff491a04adcef53652 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 2 Sep 2017 01:28:19 +0200 Subject: [PATCH 4/4] FIX #7312 --- htdocs/margin/customerMargins.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php index 85f13a881ab..c83ca406347 100644 --- a/htdocs/margin/customerMargins.php +++ b/htdocs/margin/customerMargins.php @@ -180,26 +180,27 @@ $sql = "SELECT"; $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,"; if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,"; $sql.= " sum(d.total_ht) as selling_price,"; -// Note: qty and buy_price_ht is always positive (if not your database may be corrupted, you can update this) +// Note: qty and buy_price_ht is always positive (if not, your database may be corrupted, you can update this) $sql.= " sum(".$db->ifsql('d.total_ht < 0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,"; $sql.= " sum(".$db->ifsql('d.total_ht < 0','-1 * (abs(d.total_ht) - (d.buy_price_ht * d.qty))','d.total_ht - (d.buy_price_ht * d.qty)').") as marge"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."facture as f"; $sql.= ", ".MAIN_DB_PREFIX."facturedet as d"; +if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE f.fk_soc = s.rowid"; +if ($socid > 0) $sql.= ' AND s.rowid = '.$socid; +if (!$user->rights->societe->client->voir && ! $socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; $sql.= " AND f.fk_statut > 0"; $sql.= ' AND s.entity IN ('.getEntity('societe').')'; $sql.= " AND d.fk_facture = f.rowid"; $sql.= " AND (d.product_type = 0 OR d.product_type = 1)"; -if ($client) - $sql.= " AND f.fk_soc = ".$socid; if (!empty($startdate)) - $sql.= " AND f.datef >= '".$db->idate($startdate)."'"; +$sql.= " AND f.datef >= '".$db->idate($startdate)."'"; if (!empty($enddate)) - $sql.= " AND f.datef <= '".$db->idate($enddate)."'"; +$sql.= " AND f.datef <= '".$db->idate($enddate)."'"; $sql .= " AND d.buy_price_ht IS NOT NULL"; if (isset($conf->global->ForceBuyingPriceIfNull) && $conf->global->ForceBuyingPriceIfNull == 1) - $sql .= " AND d.buy_price_ht <> 0"; +$sql .= " AND d.buy_price_ht <> 0"; if ($client) $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client, f.rowid, f.facnumber, f.total, f.datef, f.paye, f.fk_statut"; else $sql.= " GROUP BY s.rowid, s.nom, s.code_client, s.client"; $sql.=$db->order($sortfield,$sortorder);