Merge remote-tracking branch 'upstream/develop' into 13a20
This commit is contained in:
commit
d8cad89dee
@ -61,8 +61,6 @@ $list_binding = array(
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$accounting_mode = empty($conf->global->ACCOUNTING_MODE) ? 'RECETTES-DEPENSES' : $conf->global->ACCOUNTING_MODE;
|
||||
|
||||
if ($action == 'update') {
|
||||
$error = 0;
|
||||
|
||||
@ -227,36 +225,6 @@ print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
// Default mode for calculating turnover (parameter ACCOUNTING_MODE)
|
||||
/*
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>' . $langs->trans('OptionMode') . '</td><td>' . $langs->trans('Description') . '</td>';
|
||||
print "</tr>\n";
|
||||
print '<tr ' . $bc[false] . '><td width="200"><input type="radio" name="accounting_mode" value="RECETTES-DEPENSES"' . ($accounting_mode != 'CREANCES-DETTES' ? ' checked' : '') . '> ' . $langs->trans('OptionModeTrue') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeTrueDesc'));
|
||||
// Write info on way to count VAT
|
||||
// if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
|
||||
// {
|
||||
// // print "<br>\n";
|
||||
// // print nl2br($langs->trans('OptionModeTrueInfoModuleComptabilite'));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // print "<br>\n";
|
||||
// // print nl2br($langs->trans('OptionModeTrueInfoExpert'));
|
||||
// }
|
||||
print "</td></tr>\n";
|
||||
print '<tr ' . $bc[true] . '><td width="200"><input type="radio" name="accounting_mode" value="CREANCES-DETTES"' . ($accounting_mode == 'CREANCES-DETTES' ? ' checked' : '') . '> ' . $langs->trans('OptionModeVirtual') . '</td>';
|
||||
print '<td colspan="2">' . nl2br($langs->trans('OptionModeVirtualDesc')) . "</td></tr>\n";
|
||||
|
||||
print "</table>\n";
|
||||
|
||||
|
||||
print '<br>';
|
||||
*/
|
||||
|
||||
// Params
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
@ -142,7 +142,7 @@ if (empty($reshook))
|
||||
if ($massaction == 'ventil') {
|
||||
$msg = '';
|
||||
|
||||
//print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
||||
if (!empty($mesCasesCochees)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
|
||||
$msg .= '<div class="detail">';
|
||||
@ -157,7 +157,7 @@ if ($massaction == 'ventil') {
|
||||
|
||||
if ($monCompte <= 0)
|
||||
{
|
||||
$msg .= '<div><font color="red">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</font></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("NoAccountSelected").'</span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."facturedet";
|
||||
@ -165,14 +165,14 @@ if ($massaction == 'ventil') {
|
||||
$sql .= " WHERE rowid = ".((int) $monId);
|
||||
|
||||
$accountventilated = new AccountingAccount($db);
|
||||
$accountventilated->fetch($monCompte, '');
|
||||
$accountventilated->fetch($monCompte, '', 1);
|
||||
|
||||
dol_syslog("accountancy/customer/list.php sql=".$sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$msg .= '<div><font color="green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</font></div>';
|
||||
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||
$ok++;
|
||||
} else {
|
||||
$msg .= '<div><font color="red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br> <pre>'.$sql.'</pre></font></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice", $monId).' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
if ($massaction == 'ventil') {
|
||||
$msg = '';
|
||||
//print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
||||
if (!empty($mesCasesCochees)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
|
||||
$msg .= '<div class="detail">';
|
||||
@ -139,7 +139,7 @@ if ($massaction == 'ventil') {
|
||||
|
||||
if ($monCompte <= 0)
|
||||
{
|
||||
$msg .= '<div><font color="red">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</font></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."expensereport_det";
|
||||
@ -147,14 +147,14 @@ if ($massaction == 'ventil') {
|
||||
$sql .= " WHERE rowid = ".$monId;
|
||||
|
||||
$accountventilated = new AccountingAccount($db);
|
||||
$accountventilated->fetch($monCompte, '');
|
||||
$accountventilated->fetch($monCompte, '', 1);
|
||||
|
||||
dol_syslog('accountancy/expensereport/list.php:: sql='.$sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$msg .= '<div><font color="green">'.$langs->trans("LineOfExpenseReport").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</font></div>';
|
||||
$msg .= '<div><span style="color:green">'.$langs->trans("LineOfExpenseReport").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||
$ok++;
|
||||
} else {
|
||||
$msg .= '<div><font color="red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></font></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -93,12 +93,15 @@ $error = 0;
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
if (empty($date_startmonth) || empty($date_endmonth))
|
||||
{
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
}
|
||||
|
||||
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) // We define date_start and date_end, only if we did not submit the form
|
||||
{
|
||||
|
||||
@ -73,12 +73,15 @@ $journal_label = $accountingjournalstatic->label;
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
if (empty($date_startmonth) || empty($date_endmonth))
|
||||
{
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
}
|
||||
|
||||
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) // We define date_start and date_end, only if we did not submit the form
|
||||
{
|
||||
|
||||
@ -78,12 +78,15 @@ $journal_label = $accountingjournalstatic->label;
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
if (empty($date_startmonth) || empty($date_endmonth))
|
||||
{
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
}
|
||||
|
||||
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) // We define date_start and date_end, only if we did not submit the form
|
||||
{
|
||||
|
||||
@ -81,12 +81,15 @@ $journal_label = $accountingjournalstatic->label;
|
||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
if (empty($date_startmonth) || empty($date_endmonth))
|
||||
{
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
$date_end = $dates['date_end'];
|
||||
$pastmonthyear = $dates['pastmonthyear'];
|
||||
$pastmonth = $dates['pastmonth'];
|
||||
}
|
||||
|
||||
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) // We define date_start and date_end, only if we did not submit the form
|
||||
{
|
||||
|
||||
@ -146,7 +146,7 @@ if (empty($reshook))
|
||||
if ($massaction == 'ventil') {
|
||||
$msg = '';
|
||||
|
||||
//print '<div><font color="red">' . $langs->trans("Processing") . '...</font></div>';
|
||||
//print '<div><span style="color:red">' . $langs->trans("Processing") . '...</span></div>';
|
||||
if (!empty($mesCasesCochees)) {
|
||||
$msg = '<div>'.$langs->trans("SelectedLines").': '.count($mesCasesCochees).'</div>';
|
||||
$msg .= '<div class="detail">';
|
||||
@ -161,7 +161,7 @@ if ($massaction == 'ventil') {
|
||||
|
||||
if ($monCompte <= 0)
|
||||
{
|
||||
$msg .= '<div><font color="red">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</font></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NoAccountSelected").'</span></div>';
|
||||
$ko++;
|
||||
} else {
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."facture_fourn_det";
|
||||
@ -169,14 +169,14 @@ if ($massaction == 'ventil') {
|
||||
$sql .= " WHERE rowid = ".$monId;
|
||||
|
||||
$accountventilated = new AccountingAccount($db);
|
||||
$accountventilated->fetch($monCompte, '');
|
||||
$accountventilated->fetch($monCompte, '', 1);
|
||||
|
||||
dol_syslog('accountancy/supplier/list.php:: sql='.$sql, LOG_DEBUG);
|
||||
if ($db->query($sql)) {
|
||||
$msg .= '<div><font color="green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</font></div>';
|
||||
$msg .= '<div><span style="color:green">'.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("VentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'</span></div>';
|
||||
$ok++;
|
||||
} else {
|
||||
$msg .= '<div><font color="red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></font></div>';
|
||||
$msg .= '<div><span style="color:red">'.$langs->trans("ErrorDB").' : '.$langs->trans("Lineofinvoice").' '.$monId.' - '.$langs->trans("NotVentilatedinAccount").' : '.length_accountg($accountventilated->account_number).'<br/> <pre>'.$sql.'</pre></span></div>';
|
||||
$ko++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,7 +95,7 @@ print '</td></tr>';
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ExportCsvSeparator").'</td>';
|
||||
print '<td width="60" align="center">'."<input size=\"3\" class=\"flat\" type=\"text\" name=\"EXPORT_CSV_SEPARATOR_TO_USE\" value=\"".(empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE)."\"></td>";
|
||||
print '<td width="60" align="center"><input class="flat width50" maxlength="3" type="text" name="EXPORT_CSV_SEPARATOR_TO_USE" value="'.(empty($conf->global->EXPORT_CSV_SEPARATOR_TO_USE) ? ',' : $conf->global->EXPORT_CSV_SEPARATOR_TO_USE).'"></td>';
|
||||
print '<td class="right"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
@ -317,7 +317,7 @@ print '</tr>';
|
||||
$cats = $object->get_filles();
|
||||
if ($cats < 0)
|
||||
{
|
||||
dol_print_error($db, $cats->error, $cats->errors);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} elseif (count($cats) < 1)
|
||||
{
|
||||
print '<tr class="oddeven">';
|
||||
@ -432,7 +432,7 @@ if ($type == Categorie::TYPE_PRODUCT)
|
||||
$prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($prods < 0)
|
||||
{
|
||||
dol_print_error($db, $prods->error, $prods->errors);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
// Form to add record into a category
|
||||
$showclassifyform = 1;
|
||||
@ -511,7 +511,7 @@ if ($type == Categorie::TYPE_SUPPLIER)
|
||||
$socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($socs < 0)
|
||||
{
|
||||
dol_print_error($db, $socs->error, $socs->errors);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -568,7 +568,7 @@ if ($type == Categorie::TYPE_CUSTOMER)
|
||||
$socs = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($socs < 0)
|
||||
{
|
||||
dol_print_error($db, $socs->error, $socs->errors);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -627,7 +627,7 @@ if ($type == Categorie::TYPE_MEMBER)
|
||||
$prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($prods < 0)
|
||||
{
|
||||
dol_print_error($db, $prods->error, $prods->errors);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -686,7 +686,7 @@ if ($type == Categorie::TYPE_CONTACT)
|
||||
$contacts = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($contacts < 0)
|
||||
{
|
||||
dol_print_error($db, $contacts->error, $contacts->errors);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -748,7 +748,7 @@ if ($type == Categorie::TYPE_ACCOUNT)
|
||||
$accounts = $object->getObjectsInCateg($type, 0, $limit, $offset);
|
||||
if ($accounts < 0)
|
||||
{
|
||||
dol_print_error($db, $accounts->error, $accounts->errors);
|
||||
dol_print_error($db, $object->error, $object->errors);
|
||||
} else {
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -877,12 +877,14 @@ if ($type == Categorie::TYPE_USER)
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
|
||||
print '<br>';
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type; $num = count($objects); $nbtotalofrecords = ''; $newcardbutton = '';
|
||||
|
||||
print_barre_liste($langs->trans("Users"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'user', 0, $newcardbutton, '', $limit);
|
||||
$param = '&limit='.$limit.'&id='.$id.'&type='.$type;
|
||||
$num = count($users);
|
||||
|
||||
print_barre_liste($langs->trans("Users"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, '', 'user', 0, '', '', $limit);
|
||||
|
||||
print "<table class='noborder' width='100%'>\n";
|
||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Users").' <span class="badge">'.count($users).'</span></td></tr>'."\n";
|
||||
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("Users").' <span class="badge">'.$num.'</span></td></tr>'."\n";
|
||||
|
||||
if (count($users) > 0)
|
||||
{
|
||||
@ -916,7 +918,7 @@ if ($type == Categorie::TYPE_USER)
|
||||
}
|
||||
|
||||
|
||||
// List of Project
|
||||
// List of warehouses
|
||||
if ($type == Categorie::TYPE_WAREHOUSE)
|
||||
{
|
||||
$permission = $user->rights->stock->creer;
|
||||
|
||||
@ -333,7 +333,7 @@ if ($action == 'new')
|
||||
if ($action == 'reject_check')
|
||||
{
|
||||
$formquestion = array(
|
||||
array('type' => 'hidden', 'name' => 'bankid', 'value' => GETPOST('lineid')),
|
||||
array('type' => 'hidden', 'name' => 'bankid', 'value' => GETPOST('lineid', 'int')),
|
||||
array('type' => 'date', 'name' => 'rejectdate_', 'label' => $langs->trans("RejectCheckDate"), 'value' => dol_now())
|
||||
);
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans("RejectCheck"), $langs->trans("ConfirmRejectCheck"), 'confirm_reject_check', $formquestion, '', 1);
|
||||
|
||||
@ -2256,7 +2256,7 @@ class Contrat extends CommonObject
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
$this->nb["Contracts"] = $obj->nb;
|
||||
$this->nb["contracts"] = $obj->nb;
|
||||
}
|
||||
$this->db->free($resql);
|
||||
return 1;
|
||||
|
||||
@ -251,7 +251,7 @@ function dol_json_decode($json, $assoc = false)
|
||||
if ($out != '') {
|
||||
try {
|
||||
eval('$array = '.$out.';');
|
||||
} catch(Exception $e) {
|
||||
} catch (Exception $e) {
|
||||
$array = array();
|
||||
}
|
||||
}
|
||||
|
||||
@ -431,6 +431,7 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
|
||||
//TODO Add limit in nb of results
|
||||
$sql .= $db->order($sortfield_new, $sortorder);
|
||||
|
||||
dol_syslog("company.lib::show_actions_done", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
@ -529,6 +530,8 @@ function show_ticket_messaging($conf, $langs, $db, $filterobj, $objcon = '', $no
|
||||
|
||||
$out .= '<div class="filters-container" >';
|
||||
$out .= '<form name="listactionsfilter" class="listactionsfilter" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
$out .= '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
if ($objcon && get_class($objcon) == 'Contact' &&
|
||||
(is_null($filterobj) || get_class($filterobj) == 'Societe'))
|
||||
{
|
||||
|
||||
@ -329,7 +329,6 @@ class ExportCsv extends ModeleExports
|
||||
global $conf;
|
||||
$addquote = 0;
|
||||
|
||||
|
||||
// Rule Dolibarr: No HTML
|
||||
//print $charset.' '.$newvalue."\n";
|
||||
//$newvalue=dol_string_nohtmltag($newvalue,0,$charset);
|
||||
|
||||
@ -258,8 +258,8 @@ class modAccounting extends DolibarrModules
|
||||
$this->export_label[$r] = 'Chartofaccounts';
|
||||
$this->export_icon[$r] = 'accounting';
|
||||
$this->export_permission[$r] = array(array("accounting", "chartofaccount"));
|
||||
$this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'Id', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status');
|
||||
$this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status');
|
||||
$this->export_fields_array[$r] = array('ac.rowid'=>'ChartofaccountsId', 'ac.pcg_version'=>'Chartofaccounts', 'aa.rowid'=>'ID', 'aa.account_number'=>"AccountAccounting", 'aa.label'=>"Label", 'aa.account_parent'=>"Accountparent", 'aa.pcg_type'=>"Pcgtype", 'aa.active'=>'Status');
|
||||
$this->export_TypeFields_array[$r] = array('ac.rowid'=>'List:accounting_system:pcg_version', 'ac.pcg_version'=>'Text', 'aa.rowid'=>'Numeric', 'aa.account_number'=>"Text", 'aa.label'=>"Text", 'aa.account_parent'=>"Text", 'aa.pcg_type'=>'Text', 'aa.active'=>'Status');
|
||||
$this->export_entities_array[$r] = array('ac.rowid'=>"Accounting", 'ac.pcg_version'=>"Accounting", 'aa.rowid'=>'Accounting', 'aa.account_number'=>"Accounting", 'aa.label'=>"Accounting", 'aa.accountparent'=>"Accounting", 'aa.pcg_type'=>"Accounting", 'aa_active'=>"Accounting");
|
||||
|
||||
$this->export_sql_start[$r] = 'SELECT DISTINCT ';
|
||||
|
||||
@ -71,7 +71,7 @@ class modBanque extends DolibarrModules
|
||||
$this->depends = array();
|
||||
$this->requiredby = array("modComptabilite", "modAccounting", "modPrelevement");
|
||||
$this->conflictwith = array();
|
||||
$this->langfiles = array("banks", "compta", "bills", "companies");
|
||||
$this->langfiles = array("banks", "compta", "bills", "companies", "accounting");
|
||||
|
||||
// Constants
|
||||
$this->const = array();
|
||||
@ -202,6 +202,42 @@ class modBanque extends DolibarrModules
|
||||
$this->export_sql_end[$r] .= ' AND p.fk_paiement = 7';
|
||||
$this->export_sql_end[$r] .= ' AND ba.entity IN ('.getEntity('bank_account').')';
|
||||
$this->export_sql_order[$r] = ' ORDER BY b.datev, b.num_releve';
|
||||
|
||||
// Various Payment
|
||||
$r++;
|
||||
$this->export_code[$r] = $this->rights_class.'_'.$r;
|
||||
$this->export_label[$r] = 'VariousPayment';
|
||||
$this->export_permission[$r] = array(array("banque", "export"));
|
||||
$this->export_fields_array[$r] = array(
|
||||
'v.rowid'=>'VariousPaymentId', 'v.label'=>'VariousPaymentLabel', 'v.datev'=>'DateValue', 'v.datep'=>'DateOperation',
|
||||
'v.num_payment'=>'ChequeOrTransferNumber', 'v.amount'=>'Amount', 'v.sens'=>'Sens',
|
||||
'cp.id'=>"PaymentMode",
|
||||
'v.accountancy_code'=>'AccountAccounting', 'v.subledger_account'=>'SubledgerAccount',
|
||||
'v.note'=>'Note', 'v.datec'=>'DateCreation',
|
||||
'p.ref'=>'ProjectRef', 'p.title'=>'ProjectLabel'
|
||||
);
|
||||
$this->export_TypeFields_array[$r] = array(
|
||||
'v.rowid'=>'Text', 'v.label'=>'Text', 'v.datep'=>'Date', 'v.datev'=>'Date',
|
||||
'v.num_payment'=>'Text', 'v.amount'=>'Numeric', 'v.sens'=>'Numeric',
|
||||
'cp.id'=>'List:c_paiement:code:id:code',
|
||||
"v.accountancy_code"=>"Text", "v.subledger_account"=>"Text",
|
||||
"v.note"=>"Text", 'v.datec'=>"Date",
|
||||
"p.ref"=>"Text", "p.title"=>"Text"
|
||||
);
|
||||
$this->export_entities_array[$r] = array(
|
||||
'v.rowid'=>'payment', 'v.label'=>'payment', 'v.datev'=>'payment', 'v.datep'=>'payment',
|
||||
'v.num_payment'=>'payment', 'v.amount'=>'payment', 'v.sens'=>'payment',
|
||||
'cp.id'=>'payment',
|
||||
'v.accountancy_code'=>'payment', 'v.subledger_account'=>"payment",
|
||||
'v.note'=>"payment", 'v.datec'=>"payment",
|
||||
"p.ref"=>"project", "p.title"=>"project"
|
||||
);
|
||||
$this->export_sql_start[$r] = 'SELECT ';
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'payment_various as v';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX."projet as p ON v.fk_projet = p.rowid";
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX."c_paiement as cp ON v.fk_typepayment = cp.id";
|
||||
$this->export_sql_end[$r] .= ' WHERE v.entity IN ('.getEntity('payment_various').')';
|
||||
$this->export_sql_order[$r] = ' ORDER BY v.datep';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1672,8 +1672,10 @@ class EmailCollector extends CommonObject
|
||||
$description = dol_concatdesc($description, $messagetext);
|
||||
|
||||
$descriptionfull = $description;
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, "----- Header");
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, $header);
|
||||
if (empty($conf->global->MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER)) {
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, "----- Header");
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, $header);
|
||||
}
|
||||
|
||||
// Insert record of emails sent
|
||||
$actioncomm->type_code = 'AC_OTH_AUTO'; // Type of event ('AC_OTH', 'AC_OTH_AUTO', 'AC_XXX'...)
|
||||
@ -1760,8 +1762,10 @@ class EmailCollector extends CommonObject
|
||||
$description = dol_concatdesc($description, $messagetext);
|
||||
|
||||
$descriptionfull = $description;
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, "----- Header");
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, $header);
|
||||
if (empty($conf->global->MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER)) {
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, "----- Header");
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, $header);
|
||||
}
|
||||
|
||||
$id_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'rowid');
|
||||
$percent_opp_status = dol_getIdFromCode($this->db, 'PROSP', 'c_lead_status', 'code', 'percent');
|
||||
@ -1874,8 +1878,10 @@ class EmailCollector extends CommonObject
|
||||
$description = dol_concatdesc($description, $messagetext);
|
||||
|
||||
$descriptionfull = $description;
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, "----- Header");
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, $header);
|
||||
if (empty($conf->global->MAIN_EMAILCOLLECTOR_MAIL_WITHOUT_HEADER)) {
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, "----- Header");
|
||||
$descriptionfull = dol_concatdesc($descriptionfull, $header);
|
||||
}
|
||||
|
||||
$tickettocreate->subject = $subject;
|
||||
$tickettocreate->message = $description;
|
||||
|
||||
@ -539,6 +539,7 @@ class Export
|
||||
if (empty($this->array_export_fields) || !is_array($this->array_export_fields))
|
||||
{
|
||||
$this->error = "ErrorBadParameter";
|
||||
dol_syslog($this->error, LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@ -77,8 +77,8 @@ $importmodelid = GETPOST('importmodelid');
|
||||
$excludefirstline = (GETPOST('excludefirstline') ? GETPOST('excludefirstline') : 1);
|
||||
$endatlinenb = (GETPOST('endatlinenb') ? GETPOST('endatlinenb') : '');
|
||||
$updatekeys = (GETPOST('updatekeys', 'array') ? GETPOST('updatekeys', 'array') : array());
|
||||
$separator = (GETPOST('separator') ? GETPOST('separator') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ','));
|
||||
$enclosure = (GETPOST('enclosure') ? GETPOST('enclosure') : '"');
|
||||
$separator = (GETPOST('separator', 'nohtml') ? GETPOST('separator', 'nohtml') : (!empty($conf->global->IMPORT_CSV_SEPARATOR_TO_USE) ? $conf->global->IMPORT_CSV_SEPARATOR_TO_USE : ','));
|
||||
$enclosure = (GETPOST('enclosure', 'nohtml') ? GETPOST('enclosure', 'nohtml') : '"');
|
||||
|
||||
$objimport = new Import($db);
|
||||
$objimport->load_arrays($user, ($step == 1 ? '' : $datatoimport));
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
-- Note: fields with type BLOB/TEXT can't have default value.
|
||||
|
||||
|
||||
-- Missing in v12
|
||||
-- Missing in v12 or lower
|
||||
|
||||
ALTER TABLE llx_prelevement_bons ADD COLUMN type varchar(16) DEFAULT 'debit-order';
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ DefaultForService=Default for service
|
||||
DefaultForProduct=Default for product
|
||||
CantSuggest=Can't suggest
|
||||
AccountancySetupDoneFromAccountancyMenu=Most setup of the accountancy is done from the menu %s
|
||||
ConfigAccountingExpert=Configuration of the module accounting expert
|
||||
ConfigAccountingExpert=Configuration of the module accounting (double entry)
|
||||
Journalization=Journalization
|
||||
Journaux=Journals
|
||||
JournalFinancial=Financial journals
|
||||
|
||||
@ -896,7 +896,7 @@ Permission1185=Approve purchase orders
|
||||
Permission1186=Order purchase orders
|
||||
Permission1187=Acknowledge receipt of purchase orders
|
||||
Permission1188=Delete purchase orders
|
||||
Permission1189=Check/Uncheck a purhcase order reception
|
||||
Permission1189=Check/Uncheck a purchase order reception
|
||||
Permission1190=Approve (second approval) purchase orders
|
||||
Permission1191=Export supplier orders and their attributes
|
||||
Permission1201=Get result of an export
|
||||
|
||||
@ -166,6 +166,8 @@ VariousPayment=Miscellaneous payment
|
||||
VariousPayments=Miscellaneous payments
|
||||
ShowVariousPayment=Show miscellaneous payment
|
||||
AddVariousPayment=Add miscellaneous payment
|
||||
VariousPaymentId=Miscellaneous payment ID
|
||||
VariousPaymentLabel=Miscellaneous payment label
|
||||
SEPAMandate=SEPA mandate
|
||||
YourSEPAMandate=Your SEPA mandate
|
||||
FindYourSEPAMandate=This is your SEPA mandate to authorize our company to make direct debit order to your bank. Return it signed (scan of the signed document) or send it by mail to
|
||||
|
||||
@ -118,7 +118,10 @@ function testSqlAndScriptInject($val, $type)
|
||||
$inj += preg_match('/javascript\s*:/i', $val);
|
||||
$inj += preg_match('/vbscript\s*:/i', $val);
|
||||
// For XSS Injection done by adding javascript closing html tags like with onmousemove, etc... (closing a src or href tag with not cleaned param)
|
||||
if ($type == 1) $inj += preg_match('/"/i', $val); // We refused " in GET parameters value
|
||||
if ($type == 1) {
|
||||
$val = str_replace('enclosure="', 'enclosure=X', $val); // We accept enclosure="
|
||||
$inj += preg_match('/"/i', $val); // We refused " in GET parameters value.
|
||||
}
|
||||
if ($type == 2) $inj += preg_match('/[;"]/', $val); // PHP_SELF is a file system path. It can contains spaces.
|
||||
return $inj;
|
||||
}
|
||||
@ -370,11 +373,11 @@ if ((!defined('NOCSRFCHECK') && empty($dolibarr_nocsrfcheck) && !empty($conf->gl
|
||||
|| defined('CSRFCHECK_WITH_TOKEN')) // Check validity of token, only if option MAIN_SECURITY_CSRF_WITH_TOKEN enabled or if constant CSRFCHECK_WITH_TOKEN is set
|
||||
{
|
||||
// Check all cases that need a token (all POST actions, all actions and mass actions on pages with CSRFCHECK_WITH_TOKEN set, all sensitive GET actions)
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST' || ((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || in_array(GETPOST('action', 'aZ09'), array('add', 'update', 'install', 'delete')))
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST' || ((GETPOSTISSET('action') || GETPOSTISSET('massaction')) && defined('CSRFCHECK_WITH_TOKEN')) || in_array(GETPOST('action', 'aZ09'), array('add', 'addtimespent', 'update', 'install', 'delete', 'deleteprof')))
|
||||
{
|
||||
if (!GETPOSTISSET('token')) {
|
||||
dol_syslog("--- Access to ".$_SERVER["PHP_SELF"]." refused by CSRFCHECK_WITH_TOKEN protection. Token not provided.");
|
||||
print "Access by POST method (or to a page with CSRFCHECK_WITH_TOKEN on) is refused by CSRF protection in main.inc.php. Token not provided.\n";
|
||||
print "Access to this page this way (POST method or page with CSRFCHECK_WITH_TOKEN on or having a sensible value for action parameter) is refused by CSRF protection in main.inc.php. Token not provided.\n";
|
||||
print "If you access your server behind a proxy using url rewriting, you might check that all HTTP header is propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file or MAIN_SECURITY_CSRF_WITH_TOKEN to 0 into setup).\n";
|
||||
die;
|
||||
}
|
||||
|
||||
@ -482,7 +482,7 @@ class Ticket extends CommonObject
|
||||
global $langs;
|
||||
|
||||
// Check parameters
|
||||
if (!$id && !$track_id && !$ref) {
|
||||
if (!$id && !$track_id && !$ref && !$email_msgid) {
|
||||
$this->error = 'ErrorWrongParameters';
|
||||
dol_print_error(get_class($this)."::fetch ".$this->error);
|
||||
return -1;
|
||||
|
||||
@ -141,6 +141,9 @@ class ExportTest extends PHPUnit\Framework\TestCase
|
||||
|
||||
$model='csv';
|
||||
|
||||
$conf->global->EXPORT_CSV_SEPARATOR_TO_USE = ',';
|
||||
print 'EXPORT_CSV_SEPARATOR_TO_USE = '.$conf->global->EXPORT_CSV_SEPARATOR_TO_USE;
|
||||
|
||||
// Creation of class to export using model ExportXXX
|
||||
$dir = DOL_DOCUMENT_ROOT . "/core/modules/export/";
|
||||
$file = "export_".$model.".modules.php";
|
||||
@ -161,7 +164,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, '"A string with , and ; inside"');
|
||||
$this->assertEquals($result, '"A string with , and ; inside"', 'Error in csvClean for '.$file);
|
||||
|
||||
$valtotest='A string with " inside';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
@ -182,7 +185,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
|
||||
$this->assertEquals($result, '"A string with <a href=""aaa""><strong>html<br>content</strong></a> inside"');
|
||||
|
||||
// Same tests with strict mode
|
||||
$conf->global->USE_STRICT_CSV_RULES=1;
|
||||
$conf->global->USE_STRICT_CSV_RULES = 1;
|
||||
|
||||
$valtotest='A simple string';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
@ -245,7 +248,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
|
||||
// Build export file
|
||||
print "Process build_file for model = ".$model."\n";
|
||||
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, array(), $sql);
|
||||
$expectedresult=1;
|
||||
$expectedresult = 1;
|
||||
$this->assertEquals($expectedresult, $result, 'Error in CSV export');
|
||||
|
||||
$model='tsv';
|
||||
@ -360,7 +363,7 @@ class ExportTest extends PHPUnit\Framework\TestCase
|
||||
// Build export file
|
||||
$sql = "";
|
||||
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, array(), $sql);
|
||||
$expectedresult=1;
|
||||
$expectedresult = 1;
|
||||
$this->assertEquals($expectedresult, $result, "Call build_file() to export ".$exportfile.' failed');
|
||||
$result=dol_is_file($exportfile);
|
||||
$this->assertTrue($result, 'File '.$exportfile.' not found');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user