forked from Wavyzz/dolibarr
Merge branch '21.0' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
@@ -446,9 +446,9 @@ if ($result) {
|
||||
// If we fill it here to, we must concat.
|
||||
if ($userstatic->id > 0) {
|
||||
if ($is_sc) {
|
||||
$tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(1, 'accountancy', 0);
|
||||
$tabpay[$obj->rowid]["soclib"] .= ' '.$userstatic->getNomUrl(-1, 'accountancy', 0);
|
||||
} else {
|
||||
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, 'accountancy', 0);
|
||||
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(-1, 'accountancy', 0);
|
||||
}
|
||||
} else {
|
||||
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
||||
@@ -476,13 +476,10 @@ if ($result) {
|
||||
$chargestatic->label = $links[$key]['label'];
|
||||
}
|
||||
$chargestatic->ref = $chargestatic->label;
|
||||
//$chargestatic->fetch($chargestatic->id);
|
||||
|
||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
||||
|
||||
// Retrieve the accounting code of the social contribution of the payment from link of payment.
|
||||
// Note: We have the social contribution id, it can be faster to get accounting code from social contribution id.
|
||||
/*
|
||||
$sqlmid = "SELECT cchgsoc.accountancy_code";
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."c_chargesociales cchgsoc";
|
||||
$sqlmid .= " INNER JOIN ".MAIN_DB_PREFIX."chargesociales as chgsoc ON chgsoc.fk_type = cchgsoc.id";
|
||||
@@ -495,7 +492,19 @@ if ($result) {
|
||||
if ($resultmid) {
|
||||
$objmid = $db->fetch_object($resultmid);
|
||||
$tabtp[$obj->rowid][$objmid->accountancy_code] = isset($tabtp[$obj->rowid][$objmid->accountancy_code]) ? $tabtp[$obj->rowid][$objmid->accountancy_code] + $amounttouse : $amounttouse;
|
||||
}*/
|
||||
$tmpcharge = new ChargeSociales($db);
|
||||
$resultmid = $tmpcharge->fetch($chargestatic->id);
|
||||
if ($resultmid) {
|
||||
$chargestatic->type_label = $tmpcharge->type_label;
|
||||
$chargestatic->type_code = $tmpcharge->type_code;
|
||||
$chargestatic->type_accountancy_code = $tmpcharge->type_accountancy_code;
|
||||
|
||||
$tabtp[$obj->rowid][$tmpcharge->type_accountancy_code] = isset($tabtp[$obj->rowid][$tmpcharge->type_accountancy_code]) ? $tabtp[$obj->rowid][$tmpcharge->type_accountancy_code] + $amounttouse : $amounttouse;
|
||||
}
|
||||
|
||||
$tabpay[$obj->rowid]["soclib"] = $chargestatic->getNomUrl(1, 30);
|
||||
$tabpay[$obj->rowid]["paymentscid"] = $chargestatic->id;
|
||||
} elseif ($links[$key]['type'] == 'payment_donation') {
|
||||
$paymentdonstatic->id = $links[$key]['url_id'];
|
||||
$paymentdonstatic->ref = (string) $links[$key]['url_id'];
|
||||
@@ -600,7 +609,7 @@ if ($result) {
|
||||
}
|
||||
} elseif ($links[$key]['type'] == 'banktransfert') {
|
||||
$accountLinestatic->fetch($links[$key]['url_id']);
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").'- '.$accountLinestatic ->getNomUrl(1);
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$langs->trans("BankTransfer").' '.$accountLinestatic ->getNomUrl(1);
|
||||
$tabtp[$obj->rowid][$account_transfer] = isset($tabtp[$obj->rowid][$account_transfer]) ? $tabtp[$obj->rowid][$account_transfer] + $amounttouse : $amounttouse;
|
||||
$bankaccountstatic->fetch($tabpay[$obj->rowid]['fk_bank_account']);
|
||||
$tabpay[$obj->rowid]["soclib"] = $bankaccountstatic->getNomUrl(2);
|
||||
@@ -699,11 +708,11 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b
|
||||
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." / ";
|
||||
}
|
||||
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
||||
if (!empty($val['soclib'])) {
|
||||
$reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||
$reflabel .= " / ".dol_string_nohtmltag($val['soclib']);
|
||||
}
|
||||
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
@@ -760,7 +769,7 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b
|
||||
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " / " : "");
|
||||
}
|
||||
if ($tabtype[$key] == 'banktransfert') {
|
||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||
@@ -889,7 +898,7 @@ if (!$error && $action == 'writebookkeeping' && $user->hasRight('accounting', 'b
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." / ";
|
||||
}
|
||||
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
||||
|
||||
@@ -1010,11 +1019,11 @@ if ($action == 'exportcsv' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." / ";
|
||||
}
|
||||
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
||||
if (!empty($val['soclib'])) {
|
||||
$reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||
$reflabel .= " / ".dol_string_nohtmltag($val['soclib']);
|
||||
}
|
||||
|
||||
print '"'.$key.'"'.$sep;
|
||||
@@ -1037,7 +1046,7 @@ if ($action == 'exportcsv' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " / " : "");
|
||||
}
|
||||
if ($tabtype[$key] == 'banktransfert') {
|
||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||
@@ -1076,7 +1085,7 @@ if ($action == 'exportcsv' && $user->hasRight('accounting', 'bind', 'write')) {
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||
$reflabel .= dol_string_nohtmltag($val['lib'])." / ";
|
||||
}
|
||||
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
||||
|
||||
@@ -1250,8 +1259,6 @@ if (empty($action) || $action == 'view') {
|
||||
print '<td class="right">'.$langs->trans("AccountingCredit")."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$r = '';
|
||||
|
||||
foreach ($tabpay as $key => $val) { // $key is rowid in llx_bank
|
||||
$date = dol_print_date($val["date"], 'day');
|
||||
|
||||
@@ -1262,22 +1269,22 @@ if (empty($action) || $action == 'view') {
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= $val['lib']." - ";
|
||||
$reflabel .= $val['lib']." / ";
|
||||
}
|
||||
$reflabel .= $langs->trans("Bank").' '.$val['bank_account_ref'];
|
||||
if (!empty($val['soclib'])) {
|
||||
$reflabel .= " - ".$val['soclib'];
|
||||
$reflabel .= " / ".$val['soclib'];
|
||||
}
|
||||
|
||||
//var_dump($tabpay[$key]);
|
||||
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
||||
print '<!-- Bank bank.rowid='.$key.'=accounting_bookkeeping.fk_doc (accounting_bookkeeping.doc_type=\'bank\') type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].' -->';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Date
|
||||
print "<td>".$date."</td>";
|
||||
|
||||
// Ref
|
||||
print "<td>".dol_escape_htmltag($ref)."</td>";
|
||||
print '<td class="maxwidth300 nopaddingtopimp nopaddingbottomimp">'.dol_escape_htmltag($ref)."</td>";
|
||||
|
||||
// Ledger account
|
||||
$accounttoshow = length_accountg($k);
|
||||
@@ -1299,7 +1306,7 @@ if (empty($action) || $action == 'view') {
|
||||
print "</td>";
|
||||
|
||||
// Label operation
|
||||
print '<td>';
|
||||
print '<td class="maxwidth300 nopaddingtopimp nopaddingbottomimp">';
|
||||
print $reflabel; // This is already html escaped content
|
||||
print "</td>";
|
||||
|
||||
@@ -1318,7 +1325,7 @@ if (empty($action) || $action == 'view') {
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= $val['lib'].(isset($val['soclib']) ? " - " : "");
|
||||
$reflabel .= $val['lib'].(isset($val['soclib']) ? " / " : "");
|
||||
}
|
||||
if ($tabtype[$key] == 'banktransfert') {
|
||||
$reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer;
|
||||
@@ -1326,14 +1333,14 @@ if (empty($action) || $action == 'view') {
|
||||
$reflabel .= isset($val['soclib']) ? $val['soclib'] : "";
|
||||
}
|
||||
|
||||
print '<!-- Thirdparty bank.rowid='.$key.' -->';
|
||||
print '<!-- Thirdparty bank.rowid='.$key.'=accounting_bookkeeping.fk_doc (accounting_bookkeeping.doc_type=\'bank\') type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].' -->';
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Date
|
||||
print "<td>".$date."</td>";
|
||||
|
||||
// Ref
|
||||
print "<td>".dol_escape_htmltag($ref)."</td>";
|
||||
// Ref / Piece
|
||||
print '<td class="nopaddingtopimp nopaddingbottomimp">'.dol_escape_htmltag($ref)."</td>";
|
||||
|
||||
|
||||
// Ledger account
|
||||
@@ -1405,9 +1412,11 @@ if (empty($action) || $action == 'view') {
|
||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
|
||||
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||
if (!empty($tabcompany[$key]['code_compta'])) {
|
||||
if (in_array($tabtype[$key], array('payment_various', 'payment_salary'))) {
|
||||
if (in_array($tabtype[$key], array('payment_various'))) {
|
||||
// For such case, if subledger is not defined, we won't use subledger accounts.
|
||||
$accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||
} elseif (in_array($tabtype[$key], array('payment_salary'))) {
|
||||
$accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored2").'</span>';
|
||||
} else {
|
||||
$accounttoshowsubledger = '<span class="warning small">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).'</span>';
|
||||
}
|
||||
@@ -1419,11 +1428,14 @@ if (empty($action) || $action == 'view') {
|
||||
$accounttoshowsubledger = '';
|
||||
}
|
||||
}
|
||||
print '<td class="maxwidth300">';
|
||||
print '<td class="maxwidth300 nopaddingtopimp nopaddingbottomimp">';
|
||||
print $accounttoshowsubledger; // This is a html string
|
||||
print "</td>";
|
||||
|
||||
print "<td>".$reflabel."</td>";
|
||||
// Label operation
|
||||
print '<td class="nopaddingtopimpo paddingbottomimp">';
|
||||
print $reflabel; // This is a html string
|
||||
print "</td>";
|
||||
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
|
||||
@@ -1441,7 +1453,7 @@ if (empty($action) || $action == 'view') {
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= $val['lib']." - ";
|
||||
$reflabel .= $val['lib']." / ";
|
||||
}
|
||||
$reflabel .= 'WaitingAccount';
|
||||
|
||||
|
||||
@@ -598,7 +598,7 @@ $tabcond[DICT_ASSET_DISPOSAL_TYPE] = isModEnabled('asset');
|
||||
// List of help for fields (no more used, help is defined into tabcomplete)
|
||||
$tabhelp = array();
|
||||
|
||||
// Table to store complete information (will replace all other table). Key is table name.
|
||||
// Table to store complete information (will replace all other tables). Key is table name.
|
||||
$tabcomplete = array(
|
||||
'c_forme_juridique' => array(
|
||||
'picto' => 'company',
|
||||
@@ -2679,7 +2679,11 @@ if ($id > 0) {
|
||||
print '<tr class="oddeven"><td class="minwidth200">';
|
||||
if (!empty($tabcond[$i])) {
|
||||
$tabnamenoprefix = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabname[$i]);
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">';
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i;
|
||||
if ($i == DICT_CHARGESOCIALES) {
|
||||
print '&search_country_id='.$mysoc->country_id;
|
||||
}
|
||||
print '">';
|
||||
if (!empty($tabcomplete[$tabnamenoprefix]['picto'])) {
|
||||
print img_picto('', $tabcomplete[$tabnamenoprefix]['picto'], 'class="pictofixedwidth paddingrightonly"');
|
||||
}
|
||||
|
||||
@@ -1662,7 +1662,7 @@ if (!empty($arrayfields['c.ref']['checked'])) {
|
||||
// Ref ext
|
||||
if (!empty($arrayfields['c.ref_ext']['checked'])) {
|
||||
print '<td class="liste_titre">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref_ext).'">';
|
||||
print '<input class="flat" size="6" type="text" name="search_ref_ext" value="'.dol_escape_htmltag($search_ref_ext).'">';
|
||||
print '</td>';
|
||||
}
|
||||
// Ref customer
|
||||
|
||||
@@ -151,7 +151,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
|
||||
// Onglets
|
||||
// Tabs tab / graph
|
||||
$head = bank_prepare_head($object);
|
||||
print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0, 'account');
|
||||
|
||||
@@ -194,7 +194,7 @@ print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre"><td class="liste_titre borderrightlight">'.$langs->trans("Month").'</td>';
|
||||
for ($annee = $year_start; $annee <= $year_end; $annee++) {
|
||||
print '<td align="center" width="20%" colspan="2" class="liste_titre borderrightlight">'.$annee.'</td>';
|
||||
print '<td width="20%" colspan="2" class="liste_titre borderrightlight center">'.$annee.'</td>';
|
||||
}
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@@ -37,13 +37,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
if (isModEnabled('project')) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
if (isModEnabled('accounting')) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountingjournal.class.php';
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
@@ -351,13 +350,11 @@ if (isModEnabled('project')) {
|
||||
$formproject = new FormProjets($db);
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$title = $langs->trans("SocialContribution").' - '.$langs->trans("Card");
|
||||
$help_url = 'EN:Module_Taxes_and_social_contributions|FR:Module_Taxes_et_charges_spéciales|ES:Módulo Impuestos y cargas sociales (IVA, impuestos)';
|
||||
llxHeader("", $title, $help_url);
|
||||
|
||||
$reseapayer = 0;
|
||||
$resteapayer = 0;
|
||||
|
||||
|
||||
// Form to create a social contribution
|
||||
@@ -603,6 +600,9 @@ if ($id > 0) {
|
||||
$formsocialcontrib->select_type_socialcontrib($actionPostValue ? $actionPostValue : $object->type, 'actioncode', 1);
|
||||
} else {
|
||||
print $object->type_label;
|
||||
if (isModEnabled("accounting")) {
|
||||
print ' <pan class="opacitymedium">('.$langs->trans("AccountancyCode").': '.(empty($object->type_accountancy_code) ? $langs->trans("Unknown") : length_accountg($object->type_accountancy_code)).')</span>';
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
|
||||
@@ -679,8 +679,9 @@ class ChargeSociales extends CommonObject
|
||||
}
|
||||
if (!empty($this->type_label)) {
|
||||
$label .= '<br><b>'.$langs->trans('Type').':</b> '.$this->type_label;
|
||||
if (!empty($this->type_accountancy_code)) {
|
||||
$label .= ' <span class="opacitymedium">('.$langs->trans('AccountancyCode').': '.$this->type_accountancy_code.')</span>';
|
||||
if (isModEnabled('accounting') || !empty($this->type_accountancy_code)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
$label .= ' <span class="opacitymedium">('.$langs->trans('AccountancyCode').': '.(empty($this->type_accountancy_code) ? $langs->trans("Unknown") : length_accountg($this->type_accountancy_code)).')</span>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ if (!empty($permtodelete) && empty($permissiontodelete)) {
|
||||
}
|
||||
|
||||
// Mass actions. Controls on number of lines checked.
|
||||
$maxformassaction = (!getDolGlobalString('MAIN_LIMIT_FOR_MASS_ACTIONS') ? 1000 : $conf->global->MAIN_LIMIT_FOR_MASS_ACTIONS);
|
||||
$maxformassaction = getDolGlobalInt('MAIN_LIMIT_FOR_MASS_ACTIONS', 1000);
|
||||
if ($massaction && is_array($toselect) && count($toselect) < 1) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NoRecordSelected"), null, "warnings");
|
||||
|
||||
@@ -190,21 +190,29 @@ class DolEditor
|
||||
*
|
||||
* @param int $noprint 1=Return HTML string instead of printing it to output
|
||||
* @param string $morejs Add more js. For example: ".on( \'saveSnapshot\', function(e) { alert(\'ee\'); });". Used by CKEditor only.
|
||||
* @param boolean $disallowAnyContent Disallow to use any content. true=restrict to a predefined list of allowed elements. Used by CKEditor only.
|
||||
* @param boolean|string $restrictContent Decide which content is allowed. Used by CKEditor only.
|
||||
* true = restrict allowed content to a predefined list of allowed elements.
|
||||
* false = allow anything
|
||||
* string = true + add values into string
|
||||
* @param string $titlecontent Show title content before editor area. Used by ACE editor only.
|
||||
* @param string $option For ACE editor, set the source language ('html', 'php', 'javascript', 'json', ...)
|
||||
* @param string $moreparam Add extra tags to the textarea
|
||||
* @param string $morecss Add extra css to the textarea
|
||||
* @return void|string
|
||||
*/
|
||||
public function Create($noprint = 0, $morejs = '', $disallowAnyContent = true, $titlecontent = '', $option = '', $moreparam = '', $morecss = '')
|
||||
public function Create($noprint = 0, $morejs = '', $restrictContent = true, $titlecontent = '', $option = '', $moreparam = '', $morecss = '')
|
||||
{
|
||||
// phpcs:enable
|
||||
global $conf, $langs;
|
||||
|
||||
$fullpage = false;
|
||||
|
||||
$extraAllowedContent = 'a[target];section[contenteditable,id];div{float,display}';
|
||||
if (is_string($restrictContent)) {
|
||||
$extraAllowedContent = $restrictContent;
|
||||
}
|
||||
if (isset($conf->global->FCKEDITOR_ALLOW_ANY_CONTENT)) {
|
||||
$disallowAnyContent = !getDolGlobalString('FCKEDITOR_ALLOW_ANY_CONTENT'); // Only predefined list of html tags are allowed or all
|
||||
$restrictContent = !getDolGlobalString('FCKEDITOR_ALLOW_ANY_CONTENT'); // Only predefined list of html tags are allowed or all
|
||||
}
|
||||
|
||||
$found = 0;
|
||||
@@ -214,9 +222,7 @@ class DolEditor
|
||||
|
||||
if (in_array($this->tool, array('textarea', 'ckeditor'))) {
|
||||
$found = 1;
|
||||
//$out.= '<textarea id="'.$this->htmlname.'" name="'.$this->htmlname.'" '.($this->readonly?' disabled':'').' rows="'.$this->rows.'"'.(preg_match('/%/',$this->cols)?' style="margin-top: 5px; width: '.$this->cols.'"':' cols="'.$this->cols.'"').' class="flat">';
|
||||
// TODO We do not put the 'disabled' tag because on a read form, it change style with grey.
|
||||
//print $this->content;
|
||||
// Note: We do not put the attribute 'disabled' tag because on a read form, it change style with grey.
|
||||
$out .= '<textarea id="'.$this->htmlname.'" name="'.$this->htmlname.'"';
|
||||
$out .= ' rows="'.$this->rows.'"';
|
||||
//$out .= ' style="height: 700px; min-height: 700px;"';
|
||||
@@ -259,7 +265,7 @@ class DolEditor
|
||||
|
||||
$htmlencode_force = preg_match('/_encoded$/', $this->toolbarname) ? 'true' : 'false';
|
||||
|
||||
$out .= '<!-- Output ckeditor disallowAnyContent='.dol_escape_htmltag((string) $disallowAnyContent).' toolbarname='.dol_escape_htmltag($this->toolbarname).' -->'."\n";
|
||||
$out .= '<!-- Output ckeditor disallowAnyContent='.dol_escape_htmltag((string) $restrictContent).' toolbarname='.dol_escape_htmltag($this->toolbarname).' -->'."\n";
|
||||
//$out .= '<style>#cke_1_top { height: 34px !important; }</style>';
|
||||
$out .= '<script nonce="'.getNonce().'" type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
@@ -274,8 +280,8 @@ class DolEditor
|
||||
versionCheck: false,
|
||||
readOnly: '.($this->readonly ? 'true' : 'false').',
|
||||
htmlEncodeOutput: '.dol_escape_js($htmlencode_force).',
|
||||
allowedContent: '.($disallowAnyContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is on when allowedContent is false */
|
||||
extraAllowedContent: \'a[target];section[contenteditable,id];div{float,display}\', /* Allow a tag with attribute target, allow seciont tag and allow the style float and display into div to default other allowed tags */
|
||||
allowedContent: '.($restrictContent ? 'false' : 'true').', /* Advanced Content Filter (ACF) is on when allowedContent is false */
|
||||
extraAllowedContent: \''.dol_escape_js($extraAllowedContent).'\', /* Allow a tag with attribute target, allow section tag and allow the style float and display into div to default other allowed tags */
|
||||
disallowedContent: \'\', /* Tags that are not allowed */
|
||||
fullPage: '.($fullpage ? 'true' : 'false').', /* if true, the html, header and body tags are kept */
|
||||
toolbar: \''.dol_escape_js($this->toolbarname).'\',
|
||||
@@ -291,7 +297,7 @@ class DolEditor
|
||||
console.log(\'ckeditor '.dol_escape_js($this->htmlname).' instanceReady\');
|
||||
|
||||
/* If we found the attribute required on source div, we remove it (not compatible with ckeditor) */
|
||||
/* Disabled, because attribute required should never be used on fields for doleditor */
|
||||
/* Disabled, because attribute "required" should never be used on fields for doleditor */
|
||||
/* jQuery("#'.dol_escape_js($this->htmlname).'").attr("required", false); */
|
||||
|
||||
// Output paragraphs as <p>Text</p>.
|
||||
@@ -303,14 +309,6 @@ class DolEditor
|
||||
breakAfterClose : true
|
||||
});
|
||||
},
|
||||
/* This is to remove the tab Link on image popup. Does not work, so commented */
|
||||
/* dialogDefinition: function (event) {
|
||||
var dialogName = event.data.name;
|
||||
var dialogDefinition = event.data.definition;
|
||||
if (dialogName == \'image\') {
|
||||
dialogDefinition.removeContents(\'Link\');
|
||||
}
|
||||
} */
|
||||
},
|
||||
disableNativeSpellChecker: '.(getDolGlobalString('CKEDITOR_NATIVE_SPELLCHECKER') ? 'false' : 'true');
|
||||
|
||||
|
||||
@@ -1317,6 +1317,7 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options
|
||||
case 'restricthtmlnolink':
|
||||
case 'restricthtml': // Recommended for most html textarea
|
||||
case 'restricthtmlallowclass':
|
||||
case 'restricthtmlallowiframe':
|
||||
case 'restricthtmlallowlinkscript': // Allow link and script tag for head section.
|
||||
case 'restricthtmlallowunvalid':
|
||||
$out = dol_htmlwithnojs($out, 1, $check);
|
||||
@@ -8482,7 +8483,7 @@ function dol_nl2br($stringtoencode, $nl2brmode = 0, $forxml = false)
|
||||
*
|
||||
* @param string $stringtoencode String to encode
|
||||
* @param int $nouseofiframesandbox 0=Default, 1=Allow use of option MAIN_SECURITY_USE_SANDBOX_FOR_HTMLWITHNOJS for html sanitizing (not yet working)
|
||||
* @param string $check 'restricthtmlnolink' or 'restricthtml' or 'restricthtmlallowclass' or 'restricthtmlallowlinkscript' or 'restricthtmlallowunvalid'
|
||||
* @param string $check 'restricthtmlnolink' or 'restricthtml' or 'restricthtmlallowclass' or 'restricthtmlallowiframe' or 'restricthtmlallowlinkscript' or 'restricthtmlallowunvalid'
|
||||
* @return string HTML sanitized
|
||||
*/
|
||||
function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = 'restricthtml')
|
||||
@@ -8608,6 +8609,8 @@ function dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox = 0, $check = '
|
||||
$out = dol_string_onlythesehtmltags($out, 0, 1, 0, 0, array(), 1, 1, 1, getDolGlobalInt("UNSECURED_restricthtmlallowlinkscript_ALLOW_PHP"));
|
||||
} elseif ($check == 'restricthtmlallowclass' || $check == 'restricthtmlallowunvalid') {
|
||||
$out = dol_string_onlythesehtmltags($out, 0, 0, 1);
|
||||
} elseif ($check == 'restricthtmlallowiframe') {
|
||||
$out = dol_string_onlythesehtmltags($out, 0, 0, 1, 1);
|
||||
} else {
|
||||
$out = dol_string_onlythesehtmltags($out, 0, 1, 1);
|
||||
}
|
||||
|
||||
@@ -178,6 +178,9 @@ if ($object->id > 0) {
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
$modulepart = 'supplier_payment';
|
||||
// TODO: get the appropriate permission
|
||||
$permissiontoadd = true;
|
||||
|
||||
@@ -61,6 +61,11 @@ ALTER TABLE llx_asset_model ADD COLUMN ref_ext varchar(255) AFTER ref;
|
||||
|
||||
-- V21 migration
|
||||
|
||||
ALTER TABLE llx_product MODIFY COLUMN note_public mediumtext;
|
||||
ALTER TABLE llx_product MODIFY COLUMN note mediumtext;
|
||||
ALTER TABLE llx_product_lang MODIFY COLUMN note mediumtext;
|
||||
|
||||
|
||||
CREATE TABLE llx_categorie_fichinter
|
||||
(
|
||||
fk_categorie integer NOT NULL,
|
||||
|
||||
@@ -36,8 +36,8 @@ create table llx_product
|
||||
|
||||
label varchar(255) NOT NULL,
|
||||
description text,
|
||||
note_public text,
|
||||
note text,
|
||||
note_public mediumtext,
|
||||
note mediumtext,
|
||||
customcode varchar(32), -- Customs|Commodity|HS|TARIC code see https://github.com/Dolibarr/dolibarr/issues/31679
|
||||
fk_country integer DEFAULT NULL, -- Optional id of original country
|
||||
fk_state integer DEFAULT NULL, -- Optional id of original state/province
|
||||
|
||||
@@ -25,6 +25,6 @@ create table llx_product_lang
|
||||
lang varchar(5) DEFAULT 0 NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
description text,
|
||||
note text,
|
||||
note mediumtext,
|
||||
import_key varchar(14) DEFAULT NULL
|
||||
)ENGINE=innodb;
|
||||
|
||||
@@ -262,6 +262,7 @@ UnknownAccountForThirdparty=Unknown third-party account. We will use %s
|
||||
UnknownAccountForThirdpartyBlocking=Unknown third-party account. Blocking error
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknown=Subledger account not defined or third party or user unknown. We will use %s
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored=Third-party unknown and subledger not defined on the payment. We will keep the subledger account value empty.
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored2=Subledger account not defined or third party or user unknown. We will keep the subledger account value empty.
|
||||
ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking=Subledger account not defined or third party or user unknown. Blocking error.
|
||||
UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking=Unknown third-party account and waiting account not defined. Blocking error
|
||||
PaymentsNotLinkedToProduct=Payment not linked to any product / service
|
||||
|
||||
@@ -1872,7 +1872,6 @@ Buy=Buy
|
||||
Sell=Sell
|
||||
InvoiceDateUsed=Invoice date used
|
||||
YourCompanyDoesNotUseVAT=Your company has been defined to not use VAT (Home - Setup - Company/Organization), so there is no VAT options to setup.
|
||||
AccountancyCode=Accounting Code
|
||||
AccountancyCodeSell=Sale account. code
|
||||
AccountancyCodeBuy=Purchase account. code
|
||||
CREATE_NEW_VAT_WITHOUT_AUTO_PAYMENT=Keep the checkbox “Automatically create the payment” empty by default when creating a new tax
|
||||
|
||||
@@ -88,7 +88,7 @@ PaymentCustomerInvoice=Customer invoice payment
|
||||
PaymentSupplierInvoice=vendor invoice payment
|
||||
PaymentSocialContribution=Social/fiscal tax payment
|
||||
PaymentVat=VAT payment
|
||||
AutomaticCreationPayment=Automatically record the payment
|
||||
AutomaticCreationPayment=Also record the payment
|
||||
ListPayment=List of payments
|
||||
ListOfCustomerPayments=List of customer payments
|
||||
ListOfSupplierPayments=List of vendor payments
|
||||
|
||||
@@ -891,6 +891,7 @@ OriginFileName=Original filename
|
||||
SetDemandReason=Set source
|
||||
SetBankAccount=Define Bank Account
|
||||
AccountCurrency=Account currency
|
||||
AccountancyCode=Accounting Code
|
||||
ViewPrivateNote=View notes
|
||||
XMoreLines=%s line(s) hidden
|
||||
ShowMoreLines=Show more/less lines
|
||||
|
||||
@@ -286,6 +286,7 @@ productNameAToZ=Product Name: A to Z
|
||||
productNameZToA=Product Name: Z to A
|
||||
referenceLowestFirst=Reference: Lowest first
|
||||
referenceHighestFirst=Reference: Highest first
|
||||
productPerPage=products per page
|
||||
perPage=per page
|
||||
showAll=Show all
|
||||
showing= Showing
|
||||
|
||||
@@ -3052,8 +3052,9 @@ class Product extends CommonObject
|
||||
$this->stock_reel = $obj->stock;
|
||||
$this->pmp = $obj->pmp;
|
||||
|
||||
$this->date_creation = $obj->datec;
|
||||
$this->date_modification = $obj->tms;
|
||||
$this->date_creation = $this->db->jdate($obj->datec);
|
||||
$this->date_modification = $this->db->jdate($obj->tms);
|
||||
|
||||
$this->import_key = $obj->import_key;
|
||||
$this->entity = $obj->entity;
|
||||
|
||||
|
||||
@@ -265,8 +265,6 @@ class ProductFournisseurPrice extends CommonObject
|
||||
*/
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$this->db = $db;
|
||||
|
||||
$this->ismultientitymanaged = 1;
|
||||
@@ -533,7 +531,7 @@ class ProductFournisseurPrice extends CommonObject
|
||||
*/
|
||||
public function validate($user, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $conf;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
@@ -961,7 +959,7 @@ class ProductFournisseurPrice extends CommonObject
|
||||
*/
|
||||
public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams = null)
|
||||
{
|
||||
global $conf, $langs;
|
||||
global $langs;
|
||||
|
||||
$result = 0;
|
||||
$includedocgeneration = 0;
|
||||
|
||||
@@ -1512,11 +1512,11 @@ class Societe extends CommonObject
|
||||
|
||||
$this->capital = ($this->capital != '') ? (float) price2num(trim((string) $this->capital)) : null;
|
||||
|
||||
$this->effectif_id = (int) trim((string) $this->effectif_id);
|
||||
$this->forme_juridique_code = (int) trim((string) $this->forme_juridique_code);
|
||||
$this->effectif_id = (int) $this->effectif_id;
|
||||
$this->forme_juridique_code = (int) $this->forme_juridique_code;
|
||||
|
||||
//Gencod
|
||||
$this->barcode = trim($this->barcode);
|
||||
$this->barcode = trim((string) $this->barcode);
|
||||
|
||||
// For automatic creation
|
||||
if ($this->code_client == -1 || $this->code_client === 'auto') {
|
||||
@@ -1526,10 +1526,10 @@ class Societe extends CommonObject
|
||||
$this->get_codefournisseur($this, 1);
|
||||
}
|
||||
|
||||
$this->accountancy_code_customer_general = trim($this->accountancy_code_customer_general);
|
||||
$this->code_compta_client = trim($this->code_compta_client);
|
||||
$this->accountancy_code_supplier_general = trim($this->accountancy_code_supplier_general);
|
||||
$this->code_compta_fournisseur = trim($this->code_compta_fournisseur);
|
||||
$this->accountancy_code_customer_general = trim((string) $this->accountancy_code_customer_general);
|
||||
$this->code_compta_client = trim((string) $this->code_compta_client);
|
||||
$this->accountancy_code_supplier_general = trim((string) $this->accountancy_code_supplier_general);
|
||||
$this->code_compta_fournisseur = trim((string) $this->code_compta_fournisseur);
|
||||
|
||||
// Check parameters. More tests are done later in the ->verify()
|
||||
if (!is_numeric($this->client) && !is_numeric($this->fournisseur)) {
|
||||
@@ -1565,15 +1565,15 @@ class Societe extends CommonObject
|
||||
}
|
||||
|
||||
//Web services
|
||||
$this->webservices_url = $this->webservices_url ? clean_url($this->webservices_url, 0) : '';
|
||||
$this->webservices_key = trim($this->webservices_key);
|
||||
$this->webservices_url = empty($this->webservices_url) ? '' : clean_url($this->webservices_url, 0);
|
||||
$this->webservices_key = trim((string) $this->webservices_key);
|
||||
|
||||
$this->accountancy_code_buy = (empty($this->accountancy_code_buy) ? '' : trim($this->accountancy_code_buy));
|
||||
$this->accountancy_code_sell = (empty($this->accountancy_code_sell) ? '' : trim($this->accountancy_code_sell));
|
||||
|
||||
//Incoterms
|
||||
$this->fk_incoterms = (int) $this->fk_incoterms;
|
||||
$this->location_incoterms = trim($this->location_incoterms);
|
||||
$this->location_incoterms = trim((string) $this->location_incoterms);
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
|
||||
@@ -133,6 +133,10 @@ if ($id > 0) {
|
||||
$result = $object->fetch($id);
|
||||
}
|
||||
|
||||
if (!($object->id > 0) && $action == 'view') {
|
||||
recordNotFound();
|
||||
}
|
||||
|
||||
// Security check
|
||||
$id = GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('socid');
|
||||
if ($user->socid) {
|
||||
@@ -186,7 +190,8 @@ if (empty($reshook)) {
|
||||
// Mass actions
|
||||
$objectclass = 'WebsiteAccount';
|
||||
$objectlabel = 'WebsiteAccount';
|
||||
$uploaddir = $conf->societe->multidir_output[$object->entity];
|
||||
$uploaddir = empty($conf->societe->multidir_output[$object->entity]) ? $conf->societe->dir_output : $conf->societe->multidir_output[$object->entity];
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
}
|
||||
|
||||
@@ -196,8 +201,6 @@ if (empty($reshook)) {
|
||||
* View
|
||||
*/
|
||||
|
||||
$contactstatic = new Contact($db);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
@@ -266,6 +266,11 @@ if ($rss) {
|
||||
exit;
|
||||
}
|
||||
|
||||
// For backward compatibility of old thumbs that were created with filename in lower case and with .png extension
|
||||
if (image_format_supported($fullpath_original_file) && !dol_is_file($fullpath_original_file)) {
|
||||
$fullpath_original_file = getImageFileNameForSize($fullpath_original_file, '', '.png');
|
||||
}
|
||||
|
||||
clearstatcache();
|
||||
|
||||
$filename = basename($fullpath_original_file);
|
||||
|
||||
Reference in New Issue
Block a user