';
- print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
+ $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
+ $label = $langs->trans($key);
+ if ($key == 'DAV_RESTICT_ON_IP') $label = $langs->trans("RESTRICT_ON_IP");
+ print $form->textwithpicto($label, $tooltiphelp);
print ' ';
if ($key == 'DAV_ALLOW_PRIVATE_DIR')
{
@@ -112,12 +117,13 @@ if ($action == 'edit')
else
{
print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
foreach($arrayofparameters as $key => $val)
{
print '';
- print $form->textwithpicto($langs->trans($key), $langs->trans($key.'Tooltip'));
+ $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
+ print $form->textwithpicto($langs->trans($key), $tooltiphelp);
print ' ';
if ($key == 'DAV_ALLOW_PRIVATE_DIR')
{
@@ -177,6 +183,13 @@ if (! empty($conf->global->DAV_ALLOW_PUBLIC_DIR))
}
print $message;
+print ' ';
+
+require_once DOL_DOCUMENT_ROOT.'/includes/sabre/autoload.php';
+$version = Sabre\DAV\Version::VERSION;
+print ''.$langs->trans("BaseOnSabeDavVersion").' : '.$version.' ';
+
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/delais.php b/htdocs/admin/delais.php
index 91e34e66d94..1fe8b2285c3 100644
--- a/htdocs/admin/delais.php
+++ b/htdocs/admin/delais.php
@@ -262,7 +262,7 @@ else
print ' ';
// Show logo for weather
-print $langs->trans("DescWeather").' ';
+print ''.$langs->trans("DescWeather").' ';
if($action == 'edit') {
@@ -319,7 +319,7 @@ if ($action == 'edit') {
print ' ';
+ print '<= %';
print '';
print img_weather($text, 1, $options);
print '<= %';
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index f68864fcc3d..ee90a0638fb 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -39,7 +39,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
-if (! empty($conf->accounting->enabled)) require_once DOL_DOCUMENT_ROOT . '/core/class/html.formaccounting.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
// Load translation files required by the page
$langs->loadLangs(array("errors","admin","main","companies","resource","holiday","accountancy","hrm","orders","contracts","projects","propal","bills","interventions"));
@@ -1782,7 +1782,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
$formadmin = new FormAdmin($db);
$formcompany = new FormCompany($db);
- if (! empty($conf->accounting->enabled)) $formaccounting = new FormAccounting($db);
+ $formaccounting = new FormAccounting($db);
$withentity='';
@@ -1890,6 +1890,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
elseif (in_array($fieldlist[$field], array('libelle_facture'))) {
print '
';
$transfound=0;
+ $transkey='';
// Special case for labels
if ($tabname == MAIN_DB_PREFIX.'c_payment_term')
{
diff --git a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
index a12d1cc3ed4..c6262e84a79 100644
--- a/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
+++ b/htdocs/admin/dolistore/class/PSWebServiceLibrary.class.php
@@ -254,6 +254,7 @@ class PrestaShopWebservice
public function add($options)
{
$xml = '';
+ $url = '';
if (isset($options['resource'], $options['postXml']) || isset($options['url'], $options['postXml']))
{
@@ -265,7 +266,9 @@ class PrestaShopWebservice
$url .= '&id_group_shop='.$options['id_group_shop'];
}
else
+ {
throw new PrestaShopWebserviceException('Bad parameters given');
+ }
$request = self::executeRequest($url, array(CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => $xml));
self::checkStatusCode($request['status_code']);
diff --git a/htdocs/admin/geoipmaxmind.php b/htdocs/admin/geoipmaxmind.php
index fc55b27d7e1..8f8cbf98607 100644
--- a/htdocs/admin/geoipmaxmind.php
+++ b/htdocs/admin/geoipmaxmind.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2009-2019 Laurent Destailleur
* Copyright (C) 2011-2013 Juanjo Menent
*
* This program is free software; you can redistribute it and/or modify
@@ -36,9 +36,11 @@ $langs->loadLangs(array("admin","errors"));
$action = GETPOST('action', 'aZ09');
+
/*
* Actions
*/
+
if ($action == 'set')
{
$error=0;
@@ -53,8 +55,11 @@ if ($action == 'set')
if (! $error)
{
- $res = dolibarr_set_const($db, "GEOIPMAXMIND_COUNTRY_DATAFILE", $gimcdf, 'chaine', 0, '', $conf->entity);
- if (! $res > 0) $error++;
+ $res1 = dolibarr_set_const($db, "GEOIP_VERSION", GETPOST('geoipversion', 'aZ09'), 'chaine', 0, '', $conf->entity);
+ if (! $res1 > 0) $error++;
+
+ $res2 = dolibarr_set_const($db, "GEOIPMAXMIND_COUNTRY_DATAFILE", $gimcdf, 'chaine', 0, '', $conf->entity);
+ if (! $res2 > 0) $error++;
if (! $error)
{
@@ -67,6 +72,8 @@ if ($action == 'set')
}
}
+if (! isset($conf->global->GEOIP_VERSION)) $conf->global->GEOIP_VERSION = '2';
+
/*
* View
@@ -85,13 +92,6 @@ $geoip='';
if (! empty($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE))
{
$geoip=new DolGeoIP('country', $conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE);
- //if ($geoip->error) print dol_htmloutput_errors($geoip->errorlabel,'',1);
- if ($geoip->gi == 'NOGI') $geointernal=true;
- else $geointernal=false;
-}
-else
-{
- if (function_exists('geoip_country_code_by_name')) $geointernal=true;
}
// Mode
@@ -105,16 +105,30 @@ print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
print " \n";
-print ''.$langs->trans("PathToGeoIPMaxmindCountryDataFile").' ';
+// Lib version
+print ''.$langs->trans("GeoIPLibVersion").' ';
+print '';
+$arrayofvalues = array('php' => 'Native PHP functions', '1' => 'Embedded GeoIP v1', '2' => 'Embedded GeoIP v2');
+print $form->selectarray('geoipversion', $arrayofvalues, (isset($conf->global->GEOIP_VERSION) ? $conf->global->GEOIP_VERSION : '2'));
+if ($conf->global->GEOIP_VERSION == 'php')
+{
+ if ($geoip) $version=$geoip->getVersion();
+ if ($version)
+ {
+ print ' '.$langs->trans("Version").': '.$version;
+ }
+}
+print ' ';
+
+// Path to database file
+print ''.$langs->trans("PathToGeoIPMaxmindCountryDataFile").' ';
print '';
-if ($geointernal) print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).' ';
-print ' ';
-if ($geoip) $version=$geoip->getVersion();
-if ($version)
+if ($conf->global->GEOIP_VERSION == 'php')
{
- print ' '.$langs->trans("Version").': '.$version;
+ print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).' or /pathtodatafile/GeoLite2-Country.mmdb ';
}
+print ' ';
print ' ';
print '
';
@@ -144,6 +158,13 @@ if ($geoip)
if ($result) print $result;
else print $langs->trans("Error");
+ $ip='2a01:e0a:7e:4a60:429a:23ff:f7b8:dc8a'; // should be France
+ print ' '.$ip.' -> ';
+ $result=dol_print_ip($ip, 1);
+ if ($result) print $result;
+ else print $langs->trans("Error");
+
+
/* We disable this test because dol_print_ip need an ip as input
$ip='www.google.com';
print ' '.$ip.' -> ';
diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php
index 931d1168238..7abf8247a71 100644
--- a/htdocs/admin/mails_senderprofile_list.php
+++ b/htdocs/admin/mails_senderprofile_list.php
@@ -98,14 +98,16 @@ foreach($object->fields as $key => $val)
if (! empty($val['visible'])) $arrayfields['t.'.$key]=array('label'=>$val['label'], 'checked'=>(($val['visible']<0)?0:1), 'enabled'=>$val['enabled']);
}
// Extra fields
-if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
+if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0)
{
- foreach($extrafields->attribute_label as $key => $val)
+ foreach($extrafields->attributes[$object->table_element]['label'] as $key => $val)
{
- if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
+ if (! empty($extrafields->attributes[$object->table_element]['list'][$key]))
+ $arrayfields["ef.".$key]=array('label'=>$extrafields->attributes[$object->table_element]['label'][$key], 'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key]<0)?0:1), 'position'=>$extrafields->attributes[$object->table_element]['pos'][$key], 'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key])!=3 && $extrafields->attributes[$object->table_element]['perms'][$key]));
}
}
-
+$object->fields = dol_sort_array($object->fields, 'position');
+$arrayfields = dol_sort_array($arrayfields, 'position');
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index 5fd40fb032a..162d5290a36 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -130,13 +130,13 @@ if ($action=='install')
}
else
{
- if (! preg_match('/\.zip$/i', $original_file))
+ if (! $error && ! preg_match('/\.zip$/i', $original_file))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFileMustBeADolibarrPackage", $original_file), null, 'errors');
$error++;
}
- if (! preg_match('/module_.*\-[\d]+\.[\d]+.*$/i', $original_file))
+ if (! $error && ! preg_match('/^(module[a-zA-Z0-9]*|theme)_.*\-([0-9][0-9\.]*)\.zip$/i', $original_file))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFilenameDosNotMatchDolibarrPackageRules", $original_file, 'module_*-x.y*.zip'), null, 'errors');
@@ -180,13 +180,13 @@ if ($action=='install')
{
// Now we move the dir of the module
$modulename=preg_replace('/module_/', '', $original_file);
- $modulename=preg_replace('/\-[\d]+\.[\d]+.*$/', '', $modulename);
+ $modulename=preg_replace('/\-([0-9][0-9\.]*)\.zip$/i', '', $modulename);
// Search dir $modulename
- $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename;
+ $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/'.$modulename; // Example .../mymodule
//var_dump($modulenamedir);
if (! dol_is_dir($modulenamedir))
{
- $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename;
+ $modulenamedir=$conf->admin->dir_temp.'/'.$tmpdir.'/htdocs/'.$modulename; // Example .../htdocs/mymodule
//var_dump($modulenamedir);
if (! dol_is_dir($modulenamedir))
{
@@ -195,10 +195,16 @@ if ($action=='install')
}
}
+ if (! $error)
+ {
+ // TODO Make more test
+ }
+
+ // Now we install the module
if (! $error)
{
//var_dump($dirins);
- @dol_delete_dir_recursive($dirins.'/'.$modulename);
+ @dol_delete_dir_recursive($dirins.'/'.$modulename); // delete the zip file
dol_syslog("Uncompress of module file is a success. We copy it from ".$modulenamedir." into target dir ".$dirins.'/'.$modulename);
$result=dolCopyDir($modulenamedir, $dirins.'/'.$modulename, '0444', 1);
if ($result <= 0)
@@ -653,8 +659,8 @@ if ($mode == 'common')
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
if (! empty($objMod->picto))
{
- if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, ' width="14px"', 1);
- else print img_object($alttext, $objMod->picto, 'class="valignmiddle" width="14px"');
+ if (preg_match('/^\//i', $objMod->picto)) print img_picto($alttext, $objMod->picto, 'class="valignmiddle pictomodule"', 1);
+ else print img_object($alttext, $objMod->picto, 'class="valignmiddle pictomodule"');
}
else
{
diff --git a/htdocs/admin/oauthlogintokens.php b/htdocs/admin/oauthlogintokens.php
index e284d4b4834..0be3330bec4 100644
--- a/htdocs/admin/oauthlogintokens.php
+++ b/htdocs/admin/oauthlogintokens.php
@@ -115,7 +115,7 @@ llxHeader('', $langs->trans("PrintingSetup"));
$linkback=''.$langs->trans("BackToModuleList").' ';
print load_fiche_titre($langs->trans('ConfigOAuth'), $linkback, 'title_setup');
-$head=oauthadmin_prepare_head($mode);
+$head = oauthadmin_prepare_head();
dol_fiche_head($head, 'tokengeneration', '', -1, 'technic');
diff --git a/htdocs/admin/system/filecheck.php b/htdocs/admin/system/filecheck.php
index 9d7d10b932a..2a3bb1d752d 100644
--- a/htdocs/admin/system/filecheck.php
+++ b/htdocs/admin/system/filecheck.php
@@ -219,7 +219,7 @@ if (! $error && $xml)
$scanfiles = dol_dir_list(DOL_DOCUMENT_ROOT, 'files', 1, $regextoinclude, $regextoexclude);
// Fill file_list with files in signature, new files, modified files
- $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat, $scanfiles); // Fill array $file_list
+ $ret = getFilesUpdated($file_list, $xml->dolibarr_htdocs_dir[0], '', DOL_DOCUMENT_ROOT, $checksumconcat); // Fill array $file_list
// Complete with list of new files
foreach ($scanfiles as $keyfile => $valfile)
{
diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php
index fbf6fa3bb14..e17756391f1 100644
--- a/htdocs/admin/system/perf.php
+++ b/htdocs/admin/system/perf.php
@@ -522,9 +522,9 @@ if ($resql)
$nb=$obj->nb;
if ($nb > $limitforoptim)
{
- if (empty($conf->global->THIRDPARTY_DONOTSEARCH_ANYWHERE))
+ if (empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE))
{
- print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'THIRDPARTY_DONOTSEARCH_ANYWHERE');
+ print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
}
else
{
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index c06314daa9a..e07e7999414 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -50,14 +50,23 @@ if (! $user->admin)
if ($action == 'delete')
{
- $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha'));
- $ret=dol_delete_file($file, 1);
- if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
- else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
- $action='';
+ if (preg_match('/^backup\//', GETPOST('urlfile', 'alpha')))
+ {
+ $file=$conf->admin->dir_output.'/backup/'.basename(GETPOST('urlfile', 'alpha'));
+ $ret=dol_delete_file($file, 1);
+ if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
+ else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
+ }
+ else
+ {
+ $file=$conf->admin->dir_output.'/documents/'.basename(GETPOST('urlfile', 'alpha'));
+ $ret=dol_delete_file($file, 1);
+ if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
+ else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
+ }
+ $action='';
}
-
/*
* View
*/
diff --git a/htdocs/admin/tools/eaccelerator.php b/htdocs/admin/tools/eaccelerator.php
index 61ae6bcf17f..b37e10ca2e7 100644
--- a/htdocs/admin/tools/eaccelerator.php
+++ b/htdocs/admin/tools/eaccelerator.php
@@ -118,14 +118,14 @@ function create_script_table($list)
{
global $sortby,$langs;
- if (GETPOT('order') == "asc" || GETPOST('order') =="desc") {
- $order = GETPOST('order');
+ if (GETPOT('order', 'alpha') == "asc" || GETPOST('order', 'alpha') == "desc") {
+ $order = GETPOST('order', 'alpha');
} else {
$order = "asc";
}
- if (GETPOST('order')) {
- switch (GETPOST('order')) {
+ if (GETPOST('order', 'alpha')) {
+ switch (GETPOST('order', 'alpha')) {
case "mtime":
case "size":
case "reloads":
diff --git a/htdocs/admin/website.php b/htdocs/admin/website.php
index 5096563ad76..8bcc6cc5417 100644
--- a/htdocs/admin/website.php
+++ b/htdocs/admin/website.php
@@ -618,14 +618,14 @@ if ($id)
// Active
print ' ';
- print ''.$actl[($obj->status?1:0)].' ';
+ print ''.$actl[($obj->status?1:0)].' ';
print " ";
// Modify link
print ''.img_edit().' ';
// Delete link
- if ($iserasable) print ''.img_delete().' ';
+ if ($iserasable) print ''.img_delete().' ';
else print ''.img_delete($langs->trans("DisableSiteFirst"), 'class="opacitymedium"').' ';
print " \n";
diff --git a/htdocs/api/admin/index.php b/htdocs/api/admin/index.php
index 0ca6786b9b2..cbf18f92222 100644
--- a/htdocs/api/admin/index.php
+++ b/htdocs/api/admin/index.php
@@ -80,7 +80,7 @@ if ($action == 'setproductionmode')
if ($action == 'save')
{
- dolibarr_set_const($db, 'API_RESTICT_ON_IP', GETPOST('API_RESTICT_ON_IP', 'alpha'));
+ dolibarr_set_const($db, 'API_RESTRICT_ON_IP', GETPOST('API_RESTRICT_ON_IP', 'alpha'));
}
@@ -130,8 +130,8 @@ print '';
// EMail
print '';
- print ' ';
+ print ' ';
print ' ';
// Name
print '';
- print ' ';
+ print ' ';
print ' ';
// Firstname
print '';
- print ' ';
+ print ' ';
print ' ';
// Other
print '';
@@ -494,10 +495,16 @@ if ($object->fetch($id) >= 0)
print ' ';
print ' ';
+ // Date last update
+ print '';
+ print ' ';
+ print ' ';
+
// Date sending
print '';
print ' ';
print ' ';
+
//Statut
print '';
print $formmailing->selectDestinariesStatus($search_dest_status, 'search_dest_status', 1);
@@ -515,14 +522,10 @@ if ($object->fetch($id) >= 0)
print_liste_field_titre("Firstname", $_SERVER["PHP_SELF"], "mc.firstname", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("OtherInformations", $_SERVER["PHP_SELF"], "", $param, "", "", $sortfield, $sortorder);
print_liste_field_titre("Source", $_SERVER["PHP_SELF"], "", $param, "", 'align="center"', $sortfield, $sortorder);
+ // Date last update
+ print_liste_field_titre("DateLastModification", $_SERVER["PHP_SELF"], "mc.tms", $param, "", 'align="center"', $sortfield, $sortorder);
// Date sending
- if ($object->statut < 2) {
- print_liste_field_titre('');
- }
- else
- {
- print_liste_field_titre("DateSending", $_SERVER["PHP_SELF"], "mc.date_envoi", $param, '', 'align="center"', $sortfield, $sortorder);
- }
+ print_liste_field_titre("DateSending", $_SERVER["PHP_SELF"], "mc.date_envoi", $param, '', 'align="center"', $sortfield, $sortorder);
print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "mc.statut", $param, '', 'class="right"', $sortfield, $sortorder);
print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
print ' ';
@@ -583,16 +586,25 @@ if ($object->fetch($id) >= 0)
}
print '';
+ // Date last update
+ print '