diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index 0da31291160..aa5709bdf14 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -248,12 +248,11 @@ if (empty($reshook)) {
$result = $object->fetch($id, null, $mode);
$piece_num = (int) $object->piece_num;
-
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'create';
- } else {
+ } elseif ($result > 0) {
$result = $object->delete($user, 0, $mode);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
@@ -980,7 +979,7 @@ if ($action == 'create') {
print '';
}
} else {
- print load_fiche_titre($langs->trans("NoRecords"));
+ print $langs->trans("NoRecordFound");
}
}
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index a108c040353..b133e0399e4 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -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 '
'.$langs->trans("AccountingCredit")." ";
print "\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 '';
+ print '';
print '';
// Date
print "".$date." ";
// Ref
- print "".dol_escape_htmltag($ref)." ";
+ print ''.dol_escape_htmltag($ref)." ";
// Ledger account
$accounttoshow = length_accountg($k);
@@ -1299,7 +1306,7 @@ if (empty($action) || $action == 'view') {
print "";
// Label operation
- print '';
+ print ' ';
print $reflabel; // This is already html escaped content
print " ";
@@ -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 '';
+ print '';
print ' ';
// Date
print "".$date." ";
- // Ref
- print "".dol_escape_htmltag($ref)." ";
+ // Ref / Piece
+ print ''.dol_escape_htmltag($ref)." ";
// Ledger account
@@ -1405,9 +1412,11 @@ if (empty($action) || $action == 'view') {
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
//print ''.$langs->trans("ThirdpartyAccountNotDefined").' ';
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 = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").' ';
+ } elseif (in_array($tabtype[$key], array('payment_salary'))) {
+ $accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored2").' ';
} else {
$accounttoshowsubledger = ''.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknown", $tabcompany[$key]['code_compta']).' ';
}
@@ -1419,11 +1428,14 @@ if (empty($action) || $action == 'view') {
$accounttoshowsubledger = '';
}
}
- print '';
+ print ' ';
print $accounttoshowsubledger; // This is a html string
print " ";
- print "".$reflabel." ";
+ // Label operation
+ print '';
+ print $reflabel; // This is a html string
+ print " ";
print ''.$val["type_payment"]." ";
@@ -1441,7 +1453,7 @@ if (empty($action) || $action == 'view') {
if ($mt) {
$reflabel = '';
if (!empty($val['lib'])) {
- $reflabel .= $val['lib']." - ";
+ $reflabel .= $val['lib']." / ";
}
$reflabel .= 'WaitingAccount';
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 360488a2410..320d8ca9e82 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -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 ' ';
if (!empty($tabcond[$i])) {
$tabnamenoprefix = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabname[$i]);
- print '';
+ print ' country_id;
+ }
+ print '">';
if (!empty($tabcomplete[$tabnamenoprefix]['picto'])) {
print img_picto('', $tabcomplete[$tabnamenoprefix]['picto'], 'class="pictofixedwidth paddingrightonly"');
}
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 25995dd5ffb..8ebdb007055 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -1662,7 +1662,7 @@ if (!empty($arrayfields['c.ref']['checked'])) {
// Ref ext
if (!empty($arrayfields['c.ref_ext']['checked'])) {
print ' ';
- print ' ';
+ print ' ';
print ' ';
}
// Ref customer
diff --git a/htdocs/compta/bank/annuel.php b/htdocs/compta/bank/annuel.php
index 28ad1b8081d..3da2f8f3671 100644
--- a/htdocs/compta/bank/annuel.php
+++ b/htdocs/compta/bank/annuel.php
@@ -76,8 +76,6 @@ if (!$year_start) {
*/
$error = 0;
-$form = new Form($db);
-
// Get account information
$object = new Account($db);
if ($id > 0 && !preg_match('/,/', $id)) { // if for a particular account and not a list
@@ -153,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');
@@ -186,7 +184,7 @@ if (!empty($id)) {
print dol_get_fiche_end();
$head = bank_report_prepare_head($object);
-print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), 0);
+print dol_get_fiche_head($head, 'annual', $langs->trans("FinancialAccount"), -1);
// Affiche tableau
print load_fiche_titre('', $link, '');
@@ -194,16 +192,16 @@ print load_fiche_titre('', $link, '');
print ''; // You can use div-table-responsive-no-min if you don't need reserved height for your table
print '
';
-print ''.$langs->trans("Month").' ';
+print ''.$langs->trans("Month").' ';
for ($annee = $year_start; $annee <= $year_end; $annee++) {
- print ''.$annee.' ';
+ print ''.$annee.' ';
}
print ' ';
print '';
-print ' ';
+print ' ';
for ($annee = $year_start; $annee <= $year_end; $annee++) {
- print ''.$langs->trans("Debit").' '.$langs->trans("Credit").' ';
+ print ''.$langs->trans("Debit").' '.$langs->trans("Credit").' ';
}
print ' ';
@@ -214,7 +212,7 @@ for ($annee = $year_start; $annee <= $year_end; $annee++) {
for ($mois = 1; $mois < 13; $mois++) {
print '';
- print "".dol_print_date(dol_mktime(1, 1, 1, $mois, 1, 2000), "%B")." ";
+ print ''.dol_print_date(dol_mktime(1, 1, 1, $mois, 1, 2000), "%B")." ";
for ($annee = $year_start; $annee <= $year_end; $annee++) {
$case = sprintf("%04d-%02d", $annee, $mois);
@@ -237,10 +235,10 @@ for ($mois = 1; $mois < 13; $mois++) {
}
// Total debit-credit
-print ' '.$langs->trans("Total")." ";
+print ''.$langs->trans("Total")." ";
for ($annee = $year_start; $annee <= $year_end; $annee++) {
- print ''. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .' ';
- print ''. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .' ';
+ print ''. (isset($totsorties[$annee]) ? price($totsorties[$annee]) : '') .' ';
+ print ''. (isset($totentrees[$annee]) ? price($totentrees[$annee]) : '') .' ';
}
print " \n";
@@ -322,7 +320,7 @@ if ($result < 0) {
$tblyear[2] = array();
for ($annee = 0; $annee < 3; $annee++) {
- $sql = "SELECT date_format(b.datev,'%m')";
+ $sql = "SELECT date_format(b.datev, '%m')";
$sql .= ", SUM(b.amount)";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
@@ -334,7 +332,7 @@ if ($result < 0) {
if ($id && GETPOST("option") != 'all') {
$sql .= " AND b.fk_account IN (".$db->sanitize($id).")";
}
- $sql .= " GROUP BY date_format(b.datev,'%m');";
+ $sql .= " GROUP BY date_format(b.datev, '%m');";
$resql = $db->query($sql);
if ($resql) {
@@ -371,12 +369,12 @@ if ($result < 0) {
$title = $langs->transnoentities("Credit").' - '.$langs->transnoentities("Year").': '.($year - 2).' - '.($year - 1)." - ".$year;
$graph_datas = array();
for ($i = 0; $i < 12; $i++) {
- $graph_datas[$i] = array($labels[$i], $data_year_0[$i], $data_year_1[$i], $data_year_2[$i]);
+ $graph_datas[$i] = array($labels[$i], $data_year_2[$i], $data_year_1[$i], $data_year_0[$i]);
}
$px1 = new DolGraph();
$px1->SetData($graph_datas);
- $px1->SetLegend(array(($year), ($year - 1), ($year - 2)));
+ $px1->SetLegend(array(($year - 2), ($year - 1), $year));
$px1->SetLegendWidthMin(180);
$px1->SetMaxValue($px1->GetCeilMaxValue() < 0 ? 0 : $px1->GetCeilMaxValue());
$px1->SetMinValue($px1->GetFloorMinValue() > 0 ? 0 : $px1->GetFloorMinValue());
@@ -405,7 +403,7 @@ if ($result < 0) {
$tblyear[2] = array();
for ($annee = 0; $annee < 3; $annee++) {
- $sql = "SELECT date_format(b.datev,'%m')";
+ $sql = "SELECT date_format(b.datev, '%m')";
$sql .= ", SUM(b.amount)";
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
$sql .= ", ".MAIN_DB_PREFIX."bank_account as ba";
@@ -417,7 +415,7 @@ if ($result < 0) {
if ($id && GETPOST("option") != 'all') {
$sql .= " AND b.fk_account IN (".$db->sanitize($id).")";
}
- $sql .= " GROUP BY date_format(b.datev,'%m');";
+ $sql .= " GROUP BY date_format(b.datev, '%m');";
$resql = $db->query($sql);
if ($resql) {
@@ -433,6 +431,7 @@ if ($result < 0) {
dol_print_error($db);
}
}
+
// Chargement de labels et data_xxx pour tableau 4 Movements
$labels = array();
$data_year_0 = array();
@@ -452,12 +451,12 @@ if ($result < 0) {
$title = $langs->transnoentities("Debit").' - '.$langs->transnoentities("Year").': '.($year - 2).' - '.($year - 1)." - ".$year;
$graph_datas = array();
for ($i = 0; $i < 12; $i++) {
- $graph_datas[$i] = array($labels[$i], $data_year_0[$i], $data_year_1[$i], $data_year_2[$i]);
+ $graph_datas[$i] = array($labels[$i], $data_year_2[$i], $data_year_1[$i], $data_year_0[$i]);
}
$px2 = new DolGraph();
$px2->SetData($graph_datas);
- $px2->SetLegend(array(($year), ($year - 1), ($year - 2)));
+ $px2->SetLegend(array(($year - 2), ($year - 1), $year));
$px2->SetLegendWidthMin(180);
$px2->SetMaxValue($px2->GetCeilMaxValue() < 0 ? 0 : $px2->GetCeilMaxValue());
$px2->SetMinValue($px2->GetFloorMinValue() > 0 ? 0 : $px2->GetFloorMinValue());
@@ -480,9 +479,9 @@ if ($result < 0) {
unset($tblyear[2]);
print ''; // do not use class="center" here, it will have no effect for the js graph inside.
- print $show1;
+ print $show2; // debit
print '
'; // do not use class="center" here, it will have no effect for the js graph inside.
- print $show2;
+ print $show1; // credit
print '
';
print '
';
}
diff --git a/htdocs/compta/sociales/card.php b/htdocs/compta/sociales/card.php
index d33cb0e1be6..123f3c0bf4b 100644
--- a/htdocs/compta/sociales/card.php
+++ b/htdocs/compta/sociales/card.php
@@ -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 ' ('.$langs->trans("AccountancyCode").': '.(empty($object->type_accountancy_code) ? $langs->trans("Unknown") : length_accountg($object->type_accountancy_code)).')';
+ }
}
print "";
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index f6ca5ff79dc..97ac741e52e 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -679,8 +679,9 @@ class ChargeSociales extends CommonObject
}
if (!empty($this->type_label)) {
$label .= ''.$langs->trans('Type').': '.$this->type_label;
- if (!empty($this->type_accountancy_code)) {
- $label .= ' ('.$langs->trans('AccountancyCode').': '.$this->type_accountancy_code.') ';
+ if (isModEnabled('accounting') || !empty($this->type_accountancy_code)) {
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
+ $label .= ' ('.$langs->trans('AccountancyCode').': '.(empty($this->type_accountancy_code) ? $langs->trans("Unknown") : length_accountg($this->type_accountancy_code)).') ';
}
}
diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php
index 82a25fd2678..266bae09fc0 100644
--- a/htdocs/core/actions_massactions.inc.php
+++ b/htdocs/core/actions_massactions.inc.php
@@ -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");
diff --git a/htdocs/core/class/doleditor.class.php b/htdocs/core/class/doleditor.class.php
index 31297131479..9a5e139d361 100644
--- a/htdocs/core/class/doleditor.class.php
+++ b/htdocs/core/class/doleditor.class.php
@@ -26,7 +26,7 @@
/**
* Class to manage a WYSIWYG editor.
- * Usage: $doleditor=new DolEditor('body',$message,320,'toolbar_mailing');
+ * Usage: $doleditor = new DolEditor('body', $message, 320, 'toolbar_mailing');
* $doleditor->Create();
*/
class DolEditor
@@ -188,23 +188,31 @@ class DolEditor
* Output edit area inside the HTML stream.
* Output depends on this->tool (fckeditor, ckeditor, textarea, ...)
*
- * @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 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
+ * @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|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.= '