mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge branch '11.0' of git@github.com:Dolibarr/dolibarr.git into develop
Conflicts: .travis.yml htdocs/admin/company.php htdocs/compta/tva/document.php htdocs/core/lib/files.lib.php htdocs/main.inc.php
This commit is contained in:
commit
a3e56994b6
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ llxHeader('', $langs->trans("ClickToDialSetup"), $wikihelp);
|
|||
$linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("ClickToDialSetup"), $linkback, 'title_setup');
|
||||
|
||||
print $langs->trans("ClickToDialDesc")."<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("ClickToDialDesc")."</span><br>\n";
|
||||
|
||||
print '<br>';
|
||||
print '<form method="post" action="clicktodial.php">';
|
||||
|
|
|
|||
|
|
@ -414,7 +414,7 @@ print '<table class="noborder centpercent">';
|
|||
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
// Name
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_NOM ? $conf->global->MAIN_INFO_SOCIETE_NOM : GETPOST("nom", 'nohtml')).'"'.(empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? '' : ' autofocus="autofocus"').'></td></tr>'."\n";
|
||||
|
||||
// Address
|
||||
|
|
@ -478,36 +478,36 @@ if (!empty($conf->barcode->enabled)) {
|
|||
|
||||
// Logo
|
||||
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print '<div class="centpertent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
|
||||
print '</td><td class="nocellnopadd right" valign="middle">';
|
||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
||||
if (!empty($mysoc->logo_mini)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete")).'</a>';
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
||||
print ' ';
|
||||
print '</div><div class="inline-block valignmiddle">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_mini).'">';
|
||||
}
|
||||
} else {
|
||||
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Logo (squarred)
|
||||
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
|
||||
print '<table width="100%" class="nobordernopadding"><tr class="nocellnopadd"><td valign="middle" class="nocellnopadd">';
|
||||
print '<div class="centpertent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
|
||||
print '</td><td class="nocellnopadd right" valign="middle">';
|
||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
||||
if (!empty($mysoc->logo_squarred_mini)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogosquarred">'.img_delete($langs->trans("Delete")).'</a>';
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_mini)) {
|
||||
print ' ';
|
||||
print '</div><div class="inline-block valignmiddle marginrightonly">';
|
||||
print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_squarred_mini).'">';
|
||||
}
|
||||
} else {
|
||||
print '<img height="30" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
}
|
||||
print '</td></tr></table>';
|
||||
print '</div>';
|
||||
print '</td></tr>';
|
||||
|
||||
// Note
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 .= '<div id="particulier2" class="visible">';
|
||||
$out .= '<select class="flat minwidth200" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
$out .= '<select class="flat minwidth200'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" id="'.$htmlname.'">';
|
||||
if ($country_codeid) $out .= '<option value="0"> </option>'; // 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);
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -1858,43 +1858,49 @@ function top_menu_user($hideloginname = 0, $urllogout = '')
|
|||
}
|
||||
else $appli .= " ".DOL_VERSION;
|
||||
|
||||
$btnUser = '<!-- div for user link -->
|
||||
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">';
|
||||
$btnUser .= $userImage;
|
||||
if (empty($hideloginname)) {
|
||||
$btnUser .= '<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>';
|
||||
if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
|
||||
$btnUser = '<!-- div for user link -->
|
||||
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'" class="dropdown-toggle login-dropdown-a" data-toggle="dropdown">
|
||||
'.$userImage.'
|
||||
<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone paddingleft">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<div class="user-header">
|
||||
'.$userDropDownImage.'
|
||||
<p>
|
||||
'.$profilName.'<br>
|
||||
<small class="classfortooltip" title="'.$langs->trans("PreviousConnexion").'" ><i class="fa fa-user-clock"></i> '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser').'</small><br>
|
||||
<small class="classfortooltip"><i class="fa fa-cog"></i> '.$langs->trans("Version").' '.$appli.'</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Menu Body -->
|
||||
<div class="user-body">'.$dropdownBody.'</div>
|
||||
|
||||
<!-- Menu Footer-->
|
||||
<div class="user-footer">
|
||||
<div class="pull-left">
|
||||
'.$profilLink.'
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
'.$logoutLink.'
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>';
|
||||
} else {
|
||||
$btnUser = '<!-- div for user link -->
|
||||
<div id="topmenu-login-dropdown" class="userimg atoplogin dropdown user user-menu inline-block">
|
||||
<a href="'.DOL_URL_ROOT.'/user/card.php?id='.$user->id.'">
|
||||
'.$userImage.'
|
||||
<span class="hidden-xs maxwidth200 atoploginusername hideonsmartphone">'.dol_trunc($user->firstname ? $user->firstname : $user->login, 10).'</span>
|
||||
</a>
|
||||
</div>';
|
||||
}
|
||||
$btnUser .= '
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
<!-- User image -->
|
||||
<div class="user-header">
|
||||
'.$userDropDownImage.'
|
||||
|
||||
<p>
|
||||
'.$profilName.'<br>
|
||||
<small class="classfortooltip" title="'.$langs->trans("PreviousConnexion").'" ><i class="fa fa-user-clock"></i> '.dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser').'</small><br>
|
||||
<small class="classfortooltip"><i class="fa fa-cog"></i> '.$langs->trans("Version").' '.$appli.'</small>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Menu Body -->
|
||||
<div class="user-body">'.$dropdownBody.'</div>
|
||||
|
||||
<!-- Menu Footer-->
|
||||
<div class="user-footer">
|
||||
<div class="pull-left">
|
||||
'.$profilLink.'
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
'.$logoutLink.'
|
||||
</div>
|
||||
<div style="clear:both;"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
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
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user