diff --git a/.travis.yml b/.travis.yml index dd3322e5cf7..613d2fa2420 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ # For syntax, see http://about.travis-ci.org/docs/user/languages/php/ # We use dist: xenial to have php 5.6+ available +os: linux dist: xenial sudo: required @@ -43,7 +44,7 @@ env: global: # Set to true for very verbose output - DEBUG=false - matrix: + jobs: # MariaDB overrides MySQL installation so it's not possible to test both yet #- DB=mariadb - DB=mysql @@ -53,7 +54,7 @@ env: # See https://github.com/DracoBlue/travis-ci-nginx-php-fpm-test #- WS=nginx -matrix: +jobs: fast_finish: true allow_failures: - php: nightly diff --git a/htdocs/admin/clicktodial.php b/htdocs/admin/clicktodial.php index 9149896988d..03c4eeb66cf 100644 --- a/htdocs/admin/clicktodial.php +++ b/htdocs/admin/clicktodial.php @@ -66,7 +66,7 @@ llxHeader('', $langs->trans("ClickToDialSetup"), $wikihelp); $linkback=''.$langs->trans("BackToModuleList").''; print load_fiche_titre($langs->trans("ClickToDialSetup"), $linkback, 'title_setup'); -print $langs->trans("ClickToDialDesc")."
\n"; +print ''.$langs->trans("ClickToDialDesc")."
\n"; print '
'; print '
'; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b269e83fc80..b5ec2969f39 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -414,7 +414,7 @@ print ''; print ''."\n"; // Name -print ''."\n"; // Address @@ -478,36 +478,36 @@ if (!empty($conf->barcode->enabled)) { // Logo print ''; // Logo (squarred) print ''; // Note diff --git a/htdocs/compta/tva/document.php b/htdocs/compta/tva/document.php index 7f860491a8d..2f15044f808 100644 --- a/htdocs/compta/tva/document.php +++ b/htdocs/compta/tva/document.php @@ -70,8 +70,8 @@ if (!$sortfield) $sortfield = "name"; $object = new Tva($db); if ($id > 0) $object->fetch($id); -$upload_dir = $conf->tax->dir_output.'/'.dol_sanitizeFileName($object->ref); -$modulepart = 'tax'; +$upload_dir = $conf->tax->dir_output.'/vat/'.dol_sanitizeFileName($object->ref); +$modulepart = 'tax-vat'; /* @@ -144,7 +144,6 @@ if ($object->id) dol_fiche_end(); - $modulepart = 'tax'; $permission = $user->rights->tax->charges->creer; $permtoedit = $user->rights->fournisseur->facture->creer; $param = '&id='.$object->id; diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 2a538aa3b47..69858876fef 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -455,9 +455,10 @@ class FormCompany extends Form * @param int $country_codeid 0=list for all countries, otherwise list only country requested * @param string $filter Add a SQL filter on list * @param string $htmlname HTML name of select + * @param string $morecss More CSS * @return string String with HTML select */ - public function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code') + public function select_juridicalstatus($selected = '', $country_codeid = 0, $filter = '', $htmlname = 'forme_juridique_code', $morecss = '') { // phpcs:enable global $conf, $langs, $user; @@ -479,7 +480,7 @@ class FormCompany extends Form if ($resql) { $out .= '
'; - $out .= ''; if ($country_codeid) $out .= ''; // When country_codeid is set, we force to add an empty line because it does not appears from select. When not set, we already get the empty line from select. $num = $this->db->num_rows($resql); diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 9d27bc0421a..111605d38b7 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -1099,7 +1099,7 @@ class FormFile if ($disablecrop == -1) { $disablecrop = 1; - if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'mrp', 'project', 'product', 'produit', 'propal', 'service', 'societe', 'tax', 'ticket', 'user'))) $disablecrop = 0; + if (in_array($modulepart, array('bank', 'bom', 'expensereport', 'holiday', 'member', 'mrp', 'project', 'product', 'produit', 'propal', 'service', 'societe', 'tax', 'tax-vat', 'ticket', 'user'))) $disablecrop = 0; } // Define relative path used to store the file @@ -1121,6 +1121,8 @@ class FormFile $relativedir = preg_replace('/^'.preg_quote(DOL_DATA_ROOT, '/').'/', '', $upload_dir); $relativedir = preg_replace('/^[\\/]/', '', $relativedir); } + // For example here $upload_dir = '/pathtodocuments/commande/SO2001-123/' + // For example here $upload_dir = '/pathtodocuments/tax/vat/1' $hookmanager->initHooks(array('formfile')); $parameters = array( diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 38264ac9029..1cd80af55ed 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2401,10 +2401,11 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, $original_file = (!empty($conf->product->multidir_temp[$entity]) ? $conf->product->multidir_temp[$entity] : $conf->service->multidir_temp[$entity]).'/'.$original_file; } // Wrapping for taxes - elseif ($modulepart == 'tax' && !empty($conf->tax->dir_output)) + elseif (in_array($modulepart, array('tax', 'tax-vat')) && !empty($conf->tax->dir_output)) { if ($fuser->rights->tax->charges->{$lire}) $accessallowed = 1; - $original_file = $conf->tax->dir_output.'/'.$original_file; + $modulepartsuffix = str_replace('tax-', '', $modulepart); + $original_file = $conf->tax->dir_output.'/'.($modulepartsuffix != 'tax' ? $modulepartsuffix.'/' : '').$original_file; } // Wrapping for events elseif ($modulepart == 'actions' && !empty($conf->agenda->dir_output)) diff --git a/htdocs/core/lib/vat.lib.php b/htdocs/core/lib/vat.lib.php index f8c7b579c18..1649e686ec2 100644 --- a/htdocs/core/lib/vat.lib.php +++ b/htdocs/core/lib/vat.lib.php @@ -49,7 +49,7 @@ function vat_prepare_head($object) require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php'; - $upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref); + $upload_dir = $conf->tax->dir_output . "/vat/" . dol_sanitizeFileName($object->ref); $nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$')); $nbLinks=Link::count($db, $object->element, $object->id); $head[$tab][0] = DOL_URL_ROOT.'/compta/tva/document.php?id='.$object->id; diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index 2a3d703d16f..1b5cb242391 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -72,6 +72,7 @@ if ($action == 'delete') $formfile=new FormFile($db); + // We define var to enable the feature to add prefix of uploaded files. // Caller of this include can make // $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__'; @@ -93,6 +94,7 @@ if (!isset($savingdocmask) || !empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_ 'project_task', 'expensereport', 'tax', + 'tax-vat', 'produit', 'product_batch', 'bom', diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index af0c6a7a579..ea81b0c1e6e 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1858,43 +1858,49 @@ function top_menu_user($hideloginname = 0, $urllogout = '') } else $appli .= " ".DOL_VERSION; - $btnUser = ' - '; if (!defined('JS_JQUERY_DISABLE_DROPDOWN') && !empty($conf->use_javascript_ajax)) // This may be set by some pages that use different jquery version to avoid errors {
'.$langs->trans("CompanyInfo").''.$langs->trans("Value").'
'; +print '
'; print 'global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'>
'; -print '
'; +print '
'; print ''; -print '
'; +print '
'; if (!empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { - print '   '; + print '
'; print ''; } } else { print ''; } -print '
'; +print ''; print '
'; -print '
'; +print '
'; print ''; -print '
'; +print '
'; if (!empty($mysoc->logo_squarred_mini)) { print ''.img_delete($langs->trans("Delete")).''; if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) { - print '   '; + print '
'; print ''; } } else { print ''; } -print '
'; +print ''; print '