Merge branch '4.0' of git@github.com:Dolibarr/dolibarr.git into 4.0

This commit is contained in:
Laurent Destailleur 2016-11-13 17:57:55 +01:00
commit 7d27e011a5
10 changed files with 135 additions and 106 deletions

View File

@ -402,7 +402,7 @@ class AccountancyExport
print length_accountg($line->numero_compte) . $this->separator; print length_accountg($line->numero_compte) . $this->separator;
print substr(length_accountg($line->numero_compte),0,2) . $this->separator; print substr(length_accountg($line->numero_compte),0,2) . $this->separator;
print '"'.dol_trunc($line->label_compte,40,'right','UTF-8',1).'"' . $this->separator; print '"'.dol_trunc($line->label_compte,40,'right','UTF-8',1).'"' . $this->separator;
print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1)."'".$this->separator; print '"'.dol_trunc($line->piece_num,15,'right','UTF-8',1).'"'.$this->separator;
print price2num($line->montant).$this->separator; print price2num($line->montant).$this->separator;
print $line->sens.$this->separator; print $line->sens.$this->separator;
print $date . $this->separator; print $date . $this->separator;

View File

@ -2804,20 +2804,33 @@ class Propal extends CommonObject
*/ */
function getNomUrl($withpicto=0,$option='', $get_params='') function getNomUrl($withpicto=0,$option='', $get_params='')
{ {
global $langs, $conf; global $langs, $conf, $user;
$result=''; $result='';
$label = '<u>' . $langs->trans("ShowPropal") . '</u>'; $label = '';
if (! empty($this->ref))
$label.= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref; if ($user->rights->propal->lire) {
if (! empty($this->ref_client)) $label .= '<u>'.$langs->trans("ShowPropal").'</u>';
$label.= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client; if (!empty($this->ref)) {
if (! empty($this->total_ht)) $label .= '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); }
if (! empty($this->total_tva)) if (!empty($this->ref_client)) {
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label .= '<br><b>'.$langs->trans('RefCustomer').':</b> '.$this->ref_client;
if (! empty($this->total_ttc)) }
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); if (!empty($this->total_ht)) {
$label .= '<br><b>'.$langs->trans('AmountHT').':</b> '.price($this->total_ht, 0, $langs, 0, -1, -1,
$conf->currency);
}
if (!empty($this->total_tva)) {
$label .= '<br><b>'.$langs->trans('VAT').':</b> '.price($this->total_tva, 0, $langs, 0, -1, -1,
$conf->currency);
}
if (!empty($this->total_ttc)) {
$label .= '<br><b>'.$langs->trans('AmountTTC').':</b> '.price($this->total_ttc, 0, $langs, 0, -1, -1,
$conf->currency);
}
}
$linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">'; $linkclose = '" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
if ($option == '') { if ($option == '') {
$link = '<a href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params .$linkclose; $link = '<a href="'.DOL_URL_ROOT.'/comm/propal/card.php?id='.$this->id. $get_params .$linkclose;

View File

@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
$langs->load('bills'); $langs->load('bills');
$langs->load('compta'); $langs->load('compta');
$langs->load('admin');
// Security check // Security check
$id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int')); $id=(GETPOST('facid','int')?GETPOST('facid','int'):GETPOST('id','int'));

View File

@ -108,7 +108,7 @@ class DolEditor
// Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart. // Dolibarr utilise toujours liens avec modulepart='fckeditor' quelque soit modulepart.
// Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ? // Ou se trouve donc cette valeur /viewimage.php?modulepart=fckeditor&file=' ?
$modulepart='fckeditor'; $modulepart='fckeditor';
$this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&file='; $this->editor->Config['UserFilesPath'] = '/viewimage.php?modulepart='.$modulepart.'&entity='.$conf->entity.'&file=';
$this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ; $this->editor->Config['UserFilesAbsolutePath'] = DOL_DATA_ROOT.'/'.$modulepart.'/' ;
$this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false'); $this->editor->Config['LinkBrowser']=($uselocalbrowser?'true':'false');

View File

@ -45,10 +45,12 @@ $Config['Enabled'] = true ;
// Path to user files relative to the document root. // Path to user files relative to the document root.
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&file=' ; $extEntity=(empty($entity) ? 1 : $entity); // For multicompany with external access
$Config['UserFilesPath'] = DOL_URL_ROOT.'/viewimage.php?modulepart=medias'.(empty($website)?'':'_'.$website).'&entity='.$extEntity.'&file=' ;
$Config['UserFilesAbsolutePathRelative'] = (empty($website) ? ((!empty($entity) ? '/' . $entity : '') . '/medias/') : ('/websites/'.$website)); $Config['UserFilesAbsolutePathRelative'] = (empty($website) ? ((!empty($entity) ? '/' . $entity : '') . '/medias/') : ('/websites/'.$website));
// Fill the following value it you prefer to specify the absolute path for the // Fill the following value it you prefer to specify the absolute path for the
// user files directory. Useful if you are using a virtual directory, symbolic // user files directory. Useful if you are using a virtual directory, symbolic
// link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'. // link or alias. Examples: 'C:\\MySite\\userfiles\\' or '/root/mysite/userfiles/'.

View File

@ -356,9 +356,10 @@ function ajax_dialog($title,$message,$w=350,$h=150)
* @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled'))) * @param array $events More events option. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete * @param int $minLengthToAutocomplete Minimum length of input string to start autocomplete
* @param int $forcefocus Force focus on field * @param int $forcefocus Force focus on field
* @param string $widthTypeOfAutocomplete 'resolve' or 'off'
* @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason. * @return string Return html string to convert a select field into a combo, or '' if feature has been disabled for some reason.
*/ */
function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0) function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve')
{ {
global $conf; global $conf;
@ -375,7 +376,7 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $
$(document).ready(function () { $(document).ready(function () {
$(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({ $(\''.(preg_match('/^\./',$htmlname)?$htmlname:'#'.$htmlname).'\').'.$tmpplugin.'({
dir: \'ltr\', dir: \'ltr\',
width: \'resolve\', /* off or resolve */ width: \''.$widthTypeOfAutocomplete.'\', /* off or resolve */
minimumInputLength: '.$minLengthToAutocomplete.' minimumInputLength: '.$minLengthToAutocomplete.'
})'; })';
if ($forcefocus) $msg.= '.select2(\'focus\')'; if ($forcefocus) $msg.= '.select2(\'focus\')';

View File

@ -322,7 +322,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt
{ {
$result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[1]=round($result[1]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[2]=round($result[2]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[2]=round($result[2]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[0]=price2num($result[2]-$result[0], 'MT'); $result[0]=price2num($result[2]-$result[1], 'MT');
$result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[9]=round($result[9]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
$result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT; $result[10]=round($result[10]/$conf->global->MAIN_ROUNDING_RULE_TOT, 0)*$conf->global->MAIN_ROUNDING_RULE_TOT;
} }

View File

@ -505,7 +505,7 @@ class CommentParser
$data = explode('|', $data); $data = explode('|', $data);
$r['type'] = count($data) == 1 ? $data[0] : $data; $r['type'] = count($data) == 1 ? $data[0] : $data;
} }
if (isset($r['type']) && Text::endsWith($r['type'], '[]')) { if (isset($r['type']) && is_string($r['type']) && Text::endsWith($r['type'], '[]')) {
$r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2); $r[static::$embeddedDataName]['type'] = substr($r['type'], 0, -2);
$r['type'] = 'array'; $r['type'] = 'array';
} }

View File

@ -170,6 +170,12 @@ ProfId3FR=Id. prof. 3 (NAF-APE)
ProfId4FR=Id. prof. 4 (RCS/RM) ProfId4FR=Id. prof. 4 (RCS/RM)
ProfId5FR=- ProfId5FR=-
ProfId6FR=- ProfId6FR=-
ProfId1GA=Id. prof. 1 (NIF)
ProfId2GA=Id. prof. 2 (RCCM)
ProfId3GA=Id. prof. 3 (CAE)
ProfId4GA=Id. prof. 4
ProfId5GA=-
ProfId6GA=-
ProfId1GB=Numéro d'enregistrement ProfId1GB=Numéro d'enregistrement
ProfId2GB=- ProfId2GB=-
ProfId3GB=SIC ProfId3GB=SIC

View File

@ -36,7 +36,13 @@ if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks if (! defined('NOREQUIREHOOK')) define('NOREQUIREHOOK','1'); // Disable "main.inc.php" hooks
// Some value of modulepart can be used to get resources that are public so no login are required. // Some value of modulepart can be used to get resources that are public so no login are required.
if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'companylogo') && ! defined("NOLOGIN")) define("NOLOGIN",'1');
if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN")) define("NOLOGIN",'1'); if ((isset($_GET["modulepart"]) && $_GET["modulepart"] == 'medias') && ! defined("NOLOGIN"))
{
define("NOLOGIN",'1');
// For multicompany
$entity=(! empty($_GET['entity']) ? (int) $_GET['entity'] : (! empty($_POST['entity']) ? (int) $_POST['entity'] : 1));
if (is_numeric($entity)) define("DOLENTITY", $entity);
}
/** /**
* Header empty * Header empty