Merge branch '14.0' into 14p23
This commit is contained in:
commit
a129e91198
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2014-2015 Ari Elbaz (elarifr) <github@accedinfo.com>
|
||||
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014 Juanjo Menent <jmenent@2byte.es>
|
||||
@ -260,6 +260,22 @@ $linkback = '';
|
||||
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($title, $linkback, 'accountancy');
|
||||
|
||||
// Show message if accountancy hidden options are activated to help to resolve some problems
|
||||
if (!$user->admin) {
|
||||
if (!empty($conf->global->FACTURE_DEPOSITS_ARE_JUST_PAYMENTS)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "FACTURE_DEPOSITS_ARE_JUST_PAYMENTS") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_COMPANY_PERENTITY_SHARED") . '</div>';
|
||||
}
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
print '<div class="info">' . $langs->trans("ConstantIsOn", "MAIN_PRODUCT_PERENTITY_SHARED") . '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
@ -937,7 +937,6 @@ class BookKeeping extends CommonObject
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
@ -1090,7 +1089,6 @@ class BookKeeping extends CommonObject
|
||||
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
|
||||
$line->date_modification = $this->db->jdate($obj->date_modification);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
@ -1751,7 +1749,6 @@ class BookKeeping extends CommonObject
|
||||
$line->date_creation = $obj->date_creation;
|
||||
$line->date_modification = $obj->date_modification;
|
||||
$line->date_export = $obj->date_export;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesmvt[] = $line;
|
||||
@ -1816,7 +1813,6 @@ class BookKeeping extends CommonObject
|
||||
$line->sens = $obj->sens;
|
||||
$line->code_journal = $obj->code_journal;
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesexport[] = $line;
|
||||
|
||||
@ -228,7 +228,7 @@ print "</td></tr>\n";
|
||||
// Allow members to change type on renewal forms
|
||||
/* To test during next beta
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MemberAllowchangeOfType").'</td><td>';
|
||||
print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
|
||||
print $form->selectyesno('MEMBER_ALLOW_CHANGE_OF_TYPE', (!empty($conf->global->MEMBER_ALLOW_CHANGE_OF_TYPE) ? 0 : 1), 1);
|
||||
print "</td></tr>\n";
|
||||
*/
|
||||
|
||||
|
||||
@ -963,7 +963,7 @@ if ($rowid > 0) {
|
||||
|
||||
if ($adht->subscription) {
|
||||
// Amount
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'.GETPOST('subscription').'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="subscription" size="6" value="'. price(GETPOSTISSET('subscription') ? GETPOST('subscription') : $adht->amount).'"> '.$langs->trans("Currency".$conf->currency) .'</td></tr>';
|
||||
|
||||
// Label
|
||||
print '<tr><td>'.$langs->trans("Label").'</td>';
|
||||
|
||||
@ -220,7 +220,7 @@ $tabsql[21] = "SELECT c.rowid as rowid, c.code, c.label, c.active, c.position FR
|
||||
$tabsql[22] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
|
||||
$tabsql[23] = "SELECT t.rowid as rowid, t.taux, t.revenuestamp_type, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
|
||||
$tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
|
||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
|
||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity = ".getEntity($tabname[25]);
|
||||
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
@ -233,7 +233,7 @@ $tabsql[34] = "SELECT rowid, pos, code, label, c_level, active FROM ".MAIN_DB_PR
|
||||
$tabsql[35] = "SELECT c.rowid, c.label, c.active, c.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_cat c";
|
||||
$tabsql[36] = "SELECT r.rowid, r.fk_c_exp_tax_cat, r.range_ik, r.active, r.entity FROM ".MAIN_DB_PREFIX."c_exp_tax_range r";
|
||||
$tabsql[37] = "SELECT r.rowid, r.code, r.label, r.short_label, r.unit_type, r.scale, r.active FROM ".MAIN_DB_PREFIX."c_units r";
|
||||
$tabsql[38] = "SELECT rowid, entity, code, label, url, icon, active FROM ".MAIN_DB_PREFIX."c_socialnetworks";
|
||||
$tabsql[38] = "SELECT s.rowid, s.entity, s.code, s.label, s.url, s.icon, s.active FROM ".MAIN_DB_PREFIX."c_socialnetworks as s WHERE s.entity = ".getEntity($tabname[38]);
|
||||
$tabsql[39] = "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectcontactlevel";
|
||||
$tabsql[40] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcommcontact";
|
||||
$tabsql[41] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_transport_mode";
|
||||
|
||||
@ -223,7 +223,7 @@ $sql .= $object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
|
||||
@ -64,7 +64,7 @@ if ($cancel && !$id) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action == 'add' && $cancel) {
|
||||
if ($action == 'add' && !$cancel) {
|
||||
$db->begin();
|
||||
|
||||
$datev = dol_mktime(12, 0, 0, GETPOST("datevmonth"), GETPOST("datevday"), GETPOST("datevyear"));
|
||||
|
||||
@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Maxime DEMAREST <maxime@indelog.fr>
|
||||
* Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -33,6 +34,7 @@
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/tva/class/tva.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/sociales/class/chargesociales.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/report.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/tax.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
@ -366,7 +368,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* Factures clients
|
||||
* Customer invoices
|
||||
*/
|
||||
print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("CustomersInvoices").'</td></tr>';
|
||||
|
||||
@ -386,8 +388,8 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
}
|
||||
} elseif ($modecompta == 'RECETTES-DEPENSES') {
|
||||
/*
|
||||
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
|
||||
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
|
||||
* List of payments (old payments are not seen by this query because, on older versions, they were not linked via payment_invoice.
|
||||
* old versions, they were not linked via payment_invoice. They are added later)
|
||||
*/
|
||||
$sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
|
||||
@ -434,7 +436,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
// On ajoute les paiements clients anciennes version, non lie par paiement_facture
|
||||
// We add the old customer payments, not linked by payment_invoice
|
||||
if ($modecompta == 'RECETTES-DEPENSES') {
|
||||
$sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."bank as b";
|
||||
@ -673,7 +675,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
|
||||
|
||||
/*
|
||||
* Charges sociales non deductibles
|
||||
* Social / Fiscal contributions who are not deductible
|
||||
*/
|
||||
|
||||
print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("SocialContributionsNondeductibles").'</td></tr>';
|
||||
@ -760,7 +762,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
|
||||
|
||||
/*
|
||||
* Charges sociales deductibles
|
||||
* Social / Fiscal contributions who are deductible
|
||||
*/
|
||||
|
||||
print '<tr class="trforbreak"><td colspan="4">'.$langs->trans("SocialContributionsDeductibles").'</td></tr>';
|
||||
@ -860,15 +862,27 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
$column = 'p.datep';
|
||||
}
|
||||
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql = "SELECT u.rowid, u.firstname, u.lastname, s.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."salary as s ON s.rowid=p.fk_salary";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=s.fk_user";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, s.fk_user, p.label, dm";
|
||||
|
||||
// For backward compatibility with old module salary
|
||||
$sql .= " UNION ";
|
||||
$sql .= " SELECT u.rowid, u.firstname, u.lastname, p.fk_user as fk_user, p.label as label, date_format($column,'%Y-%m') as dm, sum(p.amount) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
|
||||
$sql .= " WHERE p.entity IN (".getEntity('payment_salary').")";
|
||||
if (!empty($date_start) && !empty($date_end)) {
|
||||
$sql .= " AND $column >= '".$db->idate($date_start)."' AND $column <= '".$db->idate($date_end)."'";
|
||||
}
|
||||
|
||||
$sql .= " GROUP BY u.rowid, u.firstname, u.lastname, p.fk_user, p.label, dm";
|
||||
|
||||
$newsortfield = $sortfield;
|
||||
if ($newsortfield == 's.nom, s.rowid') {
|
||||
$newsortfield = 'u.firstname, u.lastname';
|
||||
@ -900,7 +914,10 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
|
||||
print '<tr class="oddeven"><td> </td>';
|
||||
|
||||
print "<td>".$langs->trans("Salary")." <a href=\"".DOL_URL_ROOT."/salaries/list.php?filtre=s.fk_user=".$obj->fk_user."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
$userstatic = new User($db);
|
||||
$userstatic->fetch($obj->fk_user);
|
||||
|
||||
print "<td>".$langs->trans("Salary")." <a href=\"".DOL_URL_ROOT."/salaries/list.php?search_user=".urlencode($userstatic->getFullName($langs))."\">".$obj->firstname." ".$obj->lastname."</a></td>\n";
|
||||
|
||||
if ($modecompta == 'CREANCES-DETTES') {
|
||||
print '<td class="right"><span class="amount">'.price(-$obj->amount).'</span></td>';
|
||||
@ -931,7 +948,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
|
||||
|
||||
/*
|
||||
* Expense
|
||||
* Expense report
|
||||
*/
|
||||
|
||||
if (!empty($conf->expensereport->enabled)) {
|
||||
@ -1087,7 +1104,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
}
|
||||
|
||||
/*
|
||||
* Payement Loan
|
||||
* Payment Loan
|
||||
*/
|
||||
|
||||
if (!empty($conf->global->ACCOUNTING_REPORTS_INCLUDE_LOAN) && !empty($conf->loan->enabled) && ($modecompta == 'CREANCES-DETTES' || $modecompta == "RECETTES-DEPENSES")) {
|
||||
@ -1208,7 +1225,7 @@ if ($modecompta == 'BOOKKEEPING') {
|
||||
print '<td class="right"><span class="amount">'.price($amount)."</span></td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
// VAT to retreive
|
||||
// VAT to retrieve
|
||||
$amount = 0;
|
||||
$sql = "SELECT date_format(f.datef,'%Y-%m') as dm, sum(f.total_tva) as amount";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
|
||||
@ -205,12 +205,14 @@ if ($type == 'directory') {
|
||||
'product',
|
||||
'tax',
|
||||
'project',
|
||||
'project_task',
|
||||
'fichinter',
|
||||
'user',
|
||||
'expensereport',
|
||||
'holiday',
|
||||
'recruitment-recruitmentcandidature',
|
||||
'banque',
|
||||
'chequereceipt',
|
||||
'mrp-mo'
|
||||
);
|
||||
|
||||
@ -243,6 +245,8 @@ if ($type == 'directory') {
|
||||
$upload_dir = $conf->tax->dir_output;
|
||||
} elseif ($module == 'project') {
|
||||
$upload_dir = $conf->projet->dir_output;
|
||||
} elseif ($module == 'project_task') {
|
||||
$upload_dir = $conf->projet->dir_output;
|
||||
} elseif ($module == 'fichinter') {
|
||||
$upload_dir = $conf->ficheinter->dir_output;
|
||||
} elseif ($module == 'user') {
|
||||
@ -255,8 +259,10 @@ if ($type == 'directory') {
|
||||
$upload_dir = $conf->recruitment->dir_output.'/recruitmentcandidature';
|
||||
} elseif ($module == 'banque') {
|
||||
$upload_dir = $conf->bank->dir_output;
|
||||
} elseif ($module == 'chequereceipt') {
|
||||
$upload_dir = $conf->bank->dir_output.'/checkdeposits';
|
||||
} elseif ($module == 'mrp-mo') {
|
||||
$upload_dir = $conf->mrp->dir_output.'/mo';
|
||||
$upload_dir = $conf->mrp->dir_output;
|
||||
} else {
|
||||
$parameters = array('modulepart'=>$module);
|
||||
$reshook = $hookmanager->executeHooks('addSectionECMAuto', $parameters);
|
||||
|
||||
@ -97,6 +97,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
|
||||
}
|
||||
$sql .= " WHERE c.fk_soc = s.rowid";
|
||||
$sql .= " AND c.entity IN (".getEntity('supplier_order').")";
|
||||
$sql .= " AND c.date_livraison IS NOT NULL";
|
||||
$sql .= " AND c.fk_statut IN (".CommandeFournisseur::STATUS_ORDERSENT.", ".CommandeFournisseur::STATUS_RECEIVED_PARTIALLY.")";
|
||||
if (!$user->rights->societe->client->voir && !$user->socid) {
|
||||
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
|
||||
|
||||
@ -6029,7 +6029,6 @@ abstract class CommonObject
|
||||
}
|
||||
|
||||
$sql .= ")";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$this->error = $this->db->lasterror();
|
||||
@ -6283,6 +6282,11 @@ abstract class CommonObject
|
||||
$this->array_options["options_".$key] = $this->db->idate($this->array_options["options_".$key]);
|
||||
}
|
||||
break;
|
||||
case 'boolean':
|
||||
if (empty($this->array_options["options_".$key])) {
|
||||
$this->array_options["options_".$key] = null;
|
||||
}
|
||||
break;
|
||||
/*
|
||||
case 'link':
|
||||
$param_list = array_keys($attributeParam['options']);
|
||||
|
||||
@ -2220,11 +2220,18 @@ class ExtraFields
|
||||
continue; // Value was not provided, we should not set it.
|
||||
}
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150'
|
||||
if ($keysuffix != 'search_') { // If value is for a search, we must keep complex string like '>100 <=150'
|
||||
$value_key = price2num($value_arr);
|
||||
} else {
|
||||
$value_key = $value_arr;
|
||||
}
|
||||
} elseif (in_array($key_type, array('boolean'))) {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
$value_key = '';
|
||||
} else {
|
||||
$value_arr = GETPOST($keysuffix."options_".$key.$keyprefix);
|
||||
$value_key = $value_arr;
|
||||
}
|
||||
} else {
|
||||
if (!GETPOSTISSET($keysuffix."options_".$key.$keyprefix)) {
|
||||
continue; // Value was not provided, we should not set it.
|
||||
|
||||
@ -1645,6 +1645,9 @@ class FormFile
|
||||
} elseif ($modulepart == 'project') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
$object_instance = new Project($this->db);
|
||||
} elseif ($modulepart == 'project_task') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
||||
$object_instance = new Task($this->db);
|
||||
} elseif ($modulepart == 'fichinter') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
|
||||
$object_instance = new Fichinter($this->db);
|
||||
@ -1663,6 +1666,9 @@ class FormFile
|
||||
} elseif ($modulepart == 'banque') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
||||
$object_instance = new Account($this->db);
|
||||
} elseif ($modulepart == 'chequereceipt') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
|
||||
$object_instance = new RemiseCheque($this->db);
|
||||
} elseif ($modulepart == 'mrp-mo') {
|
||||
include_once DOL_DOCUMENT_ROOT.'/mrp/class/mo.class.php';
|
||||
$object_instance = new Mo($this->db);
|
||||
@ -1717,14 +1723,19 @@ class FormFile
|
||||
$id = (isset($reg[1]) ? $reg[1] : '');
|
||||
} elseif ($modulepart == 'invoice_supplier') {
|
||||
preg_match('/([^\/]+)\/[^\/]+$/', $relativefile, $reg);
|
||||
$ref = (isset($reg[1]) ? $reg[1] : ''); if (is_numeric($ref)) {
|
||||
$ref = (isset($reg[1]) ? $reg[1] : '');
|
||||
if (is_numeric($ref)) {
|
||||
$id = $ref;
|
||||
$ref = '';
|
||||
}
|
||||
} elseif ($modulepart == 'user' || $modulepart == 'holiday') {
|
||||
} elseif ($modulepart == 'user') {
|
||||
// $ref may be also id with old supplier invoices
|
||||
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
|
||||
$id = (isset($reg[1]) ? $reg[1] : '');
|
||||
} elseif ($modulepart == 'project_task') {
|
||||
// $ref of task is the sub-directory of the project
|
||||
$reg = explode("/", $relativefile);
|
||||
$ref = (isset($reg[1]) ? $reg[1] : '');
|
||||
} elseif (in_array($modulepart, array(
|
||||
'invoice',
|
||||
'propal',
|
||||
@ -1734,11 +1745,14 @@ class FormFile
|
||||
'contract',
|
||||
'product',
|
||||
'project',
|
||||
'project_task',
|
||||
'fichinter',
|
||||
'expensereport',
|
||||
'recruitment-recruitmentcandidature',
|
||||
'mrp-mo',
|
||||
'banque'))) {
|
||||
'banque',
|
||||
'chequereceipt',
|
||||
'holiday'))) {
|
||||
preg_match('/(.*)\/[^\/]+$/', $relativefile, $reg);
|
||||
$ref = (isset($reg[1]) ? $reg[1] : '');
|
||||
} else {
|
||||
|
||||
@ -103,7 +103,7 @@ function length_accountg($account)
|
||||
return $account;
|
||||
}
|
||||
|
||||
$g = $conf->global->ACCOUNTING_LENGTH_GACCOUNT;
|
||||
$g = getDolGlobalInt('ACCOUNTING_LENGTH_GACCOUNT');
|
||||
if (!is_empty($g)) {
|
||||
// Clean parameters
|
||||
$i = strlen($account);
|
||||
@ -142,7 +142,7 @@ function length_accounta($accounta)
|
||||
return $accounta;
|
||||
}
|
||||
|
||||
$a = $conf->global->ACCOUNTING_LENGTH_AACCOUNT;
|
||||
$a = getDolGlobalInt('ACCOUNTING_LENGTH_AACCOUNT');
|
||||
if (!is_empty($a)) {
|
||||
// Clean parameters
|
||||
$i = strlen($accounta);
|
||||
|
||||
@ -1101,7 +1101,7 @@ function activateModule($value, $withdeps = 1)
|
||||
|
||||
if (!count($ret['errors'])) {
|
||||
$ret['nbmodules']++;
|
||||
$ret['nbperms'] += count($objMod->rights);
|
||||
$ret['nbperms'] += (is_array($objMod->rights)?count($objMod->rights):0);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
/**
|
||||
* \defgroup propale Module commercial proposals
|
||||
* \brief Module pour gerer la tenue de propositions commerciales
|
||||
* \brief Module to manage commercial proposals
|
||||
* \file htdocs/core/modules/modPropale.class.php
|
||||
* \ingroup propale
|
||||
* \brief Description and activation file for the module customer proposal
|
||||
@ -36,7 +36,6 @@ include_once DOL_DOCUMENT_ROOT.'/core/modules/DolibarrModules.class.php';
|
||||
*/
|
||||
class modPropale extends DolibarrModules
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor. Define names, constants, directories, boxes, permissions
|
||||
*
|
||||
|
||||
@ -114,7 +114,7 @@ if ($action == 'add') {
|
||||
$idl = "idl".$i;
|
||||
$qtytouse = price2num(GETPOST($qty));
|
||||
if ($qtytouse > 0) {
|
||||
$object->addline(GETPOST($idl), price2num($qtytouse));
|
||||
$object->addline(GETPOST($idl), price2num($qtytouse), $arrayoptions);
|
||||
}
|
||||
}
|
||||
|
||||
@ -603,23 +603,26 @@ if ($action == 'create') { // Create. Seems to no be used
|
||||
print "</tr>";
|
||||
|
||||
// Display lines extrafields
|
||||
if (!empty($extrafields)) {
|
||||
//if (!empty($extrafields)) {
|
||||
$colspan = 2;
|
||||
$mode = ($object->statut == 0) ? 'edit' : 'view';
|
||||
|
||||
$object->lines[$i]->fetch_optionals();
|
||||
|
||||
if ($action == 'create_delivery') {
|
||||
$srcLine = new ExpeditionLigne($db);
|
||||
if ($action == 'create_delivery') {
|
||||
$srcLine = new ExpeditionLigne($db);
|
||||
|
||||
$extrafields->fetch_name_optionals_label($srcLine->table_element);
|
||||
$srcLine->id = $expedition->lines[$i]->id;
|
||||
$srcLine->fetch_optionals();
|
||||
|
||||
$object->lines[$i]->array_options = array_merge($object->lines[$i]->array_options, $srcLine->array_options);
|
||||
} else {
|
||||
$srcLine = new DeliveryLine($db);
|
||||
$extrafields->fetch_name_optionals_label($srcLine->table_element);
|
||||
$srcLine->id = $expedition->lines[$i]->id;
|
||||
$srcLine->fetch_optionals();
|
||||
|
||||
$object->lines[$i]->array_options = array_merge($object->lines[$i]->array_options, $srcLine->array_options);
|
||||
}
|
||||
print $object->lines[$i]->showOptionals($extrafields, $mode, array('style' => 'class="oddeven"', 'colspan' => $colspan), $i);
|
||||
}
|
||||
print $object->lines[$i]->showOptionals($extrafields, $mode, array('style' => 'class="oddeven"', 'colspan' => $colspan), '');
|
||||
//}
|
||||
}
|
||||
|
||||
$i++;
|
||||
|
||||
@ -166,11 +166,11 @@ class Delivery extends CommonObject
|
||||
$sql .= ", fk_incoterms, location_incoterms";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= "'(PROV)'";
|
||||
$sql .= ", ".$conf->entity;
|
||||
$sql .= ", ".$this->socid;
|
||||
$sql .= ", ".((int) $conf->entity);
|
||||
$sql .= ", ".((int) $this->socid);
|
||||
$sql .= ", '".$this->db->escape($this->ref_customer)."'";
|
||||
$sql .= ", '".$this->db->idate($now)."'";
|
||||
$sql .= ", ".$user->id;
|
||||
$sql .= ", ".((int) $user->id);
|
||||
$sql .= ", ".($this->date_delivery ? "'".$this->db->idate($this->date_delivery)."'" : "null");
|
||||
$sql .= ", ".($this->fk_delivery_address > 0 ? $this->fk_delivery_address : "null");
|
||||
$sql .= ", ".(!empty($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null");
|
||||
@ -189,7 +189,7 @@ class Delivery extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."delivery ";
|
||||
$sql .= "SET ref = '".$this->db->escape($numref)."'";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog("Delivery::create", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
@ -211,7 +211,7 @@ class Delivery extends CommonObject
|
||||
$origin_id = $this->lines[$i]->commande_ligne_id; // For backward compatibility
|
||||
}
|
||||
|
||||
if (!$this->create_line($origin_id, $this->lines[$i]->qty, $this->lines[$i]->fk_product, $this->lines[$i]->description)) {
|
||||
if (!$this->create_line($origin_id, $this->lines[$i]->qty, $this->lines[$i]->fk_product, $this->lines[$i]->description, $this->lines[$i]->array_options)) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
@ -262,9 +262,10 @@ class Delivery extends CommonObject
|
||||
* @param string $qty Quantity
|
||||
* @param string $fk_product Id of predefined product
|
||||
* @param string $description Description
|
||||
* @param array $array_options Array options
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function create_line($origin_id, $qty, $fk_product, $description)
|
||||
public function create_line($origin_id, $qty, $fk_product, $description, $array_options = null)
|
||||
{
|
||||
// phpcs:enable
|
||||
$error = 0;
|
||||
@ -283,6 +284,15 @@ class Delivery extends CommonObject
|
||||
$error++;
|
||||
}
|
||||
|
||||
$id = $this->db->last_insert_id(MAIN_DB_PREFIX."deliverydet");
|
||||
|
||||
if (is_array($array_options) && count($array_options) > 0) {
|
||||
$line = new DeliveryLine($this->db);
|
||||
$line->id = $id;
|
||||
$line->array_options = $array_options;
|
||||
$result = $line->insertExtraFields();
|
||||
}
|
||||
|
||||
if ($error == 0) {
|
||||
return 1;
|
||||
}
|
||||
@ -385,7 +395,7 @@ class Delivery extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery->creer))
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) {
|
||||
|| (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->expedition->delivery_advance->validate))) {
|
||||
if (!empty($conf->global->DELIVERY_ADDON_NUMBER)) {
|
||||
// Setting the command numbering module name
|
||||
$modName = $conf->global->DELIVERY_ADDON_NUMBER;
|
||||
@ -427,7 +437,7 @@ class Delivery extends CommonObject
|
||||
$sql .= ", fk_statut = 1";
|
||||
$sql .= ", date_valid = '".$this->db->idate($now)."'";
|
||||
$sql .= ", fk_user_valid = ".$user->id;
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
$sql .= " AND fk_statut = 0";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -531,7 +541,9 @@ class Delivery extends CommonObject
|
||||
$line->description = $expedition->lines[$i]->description;
|
||||
$line->qty = $expedition->lines[$i]->qty_shipped;
|
||||
$line->fk_product = $expedition->lines[$i]->fk_product;
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($expedition->lines[$i]->array_options) && count($expedition->lines[$i]->array_options) > 0) { // For avoid conflicts if trigger used
|
||||
$line->array_options = $expedition->lines[$i]->array_options;
|
||||
}
|
||||
$this->lines[$i] = $line;
|
||||
}
|
||||
|
||||
@ -589,18 +601,23 @@ class Delivery extends CommonObject
|
||||
/**
|
||||
* Add line
|
||||
*
|
||||
* @param int $origin_id Origin id
|
||||
* @param int $qty Qty
|
||||
* @param int $origin_id Origin id
|
||||
* @param int $qty Qty
|
||||
* @param array $array_options Array options
|
||||
* @return void
|
||||
*/
|
||||
public function addline($origin_id, $qty)
|
||||
public function addline($origin_id, $qty, $array_options = null)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$num = count($this->lines);
|
||||
$line = new DeliveryLine($this->db);
|
||||
|
||||
$line->origin_id = $origin_id;
|
||||
$line->qty = $qty;
|
||||
|
||||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED) && is_array($array_options) && count($array_options) > 0) { // For avoid conflicts if trigger used
|
||||
$line->array_options = $array_options;
|
||||
}
|
||||
$this->lines[$num] = $line;
|
||||
}
|
||||
|
||||
@ -651,7 +668,7 @@ class Delivery extends CommonObject
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."delivery";
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
if ($this->db->query($sql)) {
|
||||
$this->db->commit();
|
||||
|
||||
@ -719,8 +736,8 @@ class Delivery extends CommonObject
|
||||
|
||||
//if ($option !== 'nolink')
|
||||
//{
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
@ -846,12 +863,12 @@ class Delivery extends CommonObject
|
||||
if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
|
||||
global $langs;
|
||||
//$langs->load("mymodule");
|
||||
$this->labelStatus[-1] = $langs->trans('StatusDeliveryCanceled');
|
||||
$this->labelStatus[0] = $langs->trans('StatusDeliveryDraft');
|
||||
$this->labelStatus[1] = $langs->trans('StatusDeliveryValidated');
|
||||
$this->labelStatusShort[-1] = $langs->trans('StatusDeliveryCanceled');
|
||||
$this->labelStatusShort[0] = $langs->trans('StatusDeliveryDraft');
|
||||
$this->labelStatusShort[1] = $langs->trans('StatusDeliveryValidated');
|
||||
$this->labelStatus[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled');
|
||||
$this->labelStatus[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft');
|
||||
$this->labelStatus[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated');
|
||||
$this->labelStatusShort[-1] = $langs->transnoentitiesnoconv('StatusDeliveryCanceled');
|
||||
$this->labelStatusShort[0] = $langs->transnoentitiesnoconv('StatusDeliveryDraft');
|
||||
$this->labelStatusShort[1] = $langs->transnoentitiesnoconv('StatusDeliveryValidated');
|
||||
}
|
||||
|
||||
$statusType = 'status0';
|
||||
@ -980,7 +997,7 @@ class Delivery extends CommonObject
|
||||
$array[$i]['label'] = $objSourceLine->label ? $objSourceLine->label : $objSourceLine->description;
|
||||
}
|
||||
|
||||
$i++;
|
||||
$i++;
|
||||
}
|
||||
return $array;
|
||||
} else {
|
||||
@ -1001,7 +1018,7 @@ class Delivery extends CommonObject
|
||||
if ($user->rights->expedition->creer) {
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."delivery";
|
||||
$sql .= " SET date_delivery = ".($delivery_date ? "'".$this->db->idate($delivery_date)."'" : 'null');
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".((int) $this->id);
|
||||
|
||||
dol_syslog(get_class($this)."::setDeliveryDate", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -195,9 +195,11 @@ if (!in_array($type, array('text/x-javascript')) && !dolIsAllowedForPreview($ori
|
||||
}
|
||||
|
||||
// Security: Delete string ../ or ..\ into $original_file
|
||||
$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..'
|
||||
$original_file = str_replace('../', '/', $original_file);
|
||||
$original_file = str_replace('..\\', '/', $original_file);
|
||||
|
||||
|
||||
// Find the subdirectory name as the reference
|
||||
$refname = basename(dirname($original_file)."/");
|
||||
|
||||
|
||||
@ -341,6 +341,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
||||
}
|
||||
if (!empty($conf->projet->enabled)) {
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Projects"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Projects")));
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'project_task', 'test'=>$conf->projet->enabled, 'label'=>$langs->trans("Tasks"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Tasks")));
|
||||
}
|
||||
if (!empty($conf->ficheinter->enabled)) {
|
||||
$langs->load("interventions"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'fichinter', 'test'=>$conf->ficheinter->enabled, 'label'=>$langs->trans("Interventions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Interventions")));
|
||||
@ -353,6 +354,7 @@ if (!empty($conf->global->ECM_AUTO_TREE_ENABLED)) {
|
||||
}
|
||||
if (!empty($conf->banque->enabled)) {
|
||||
$langs->load("banks"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'banque', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("BankAccount"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("BankAccount")));
|
||||
$rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'chequereceipt', 'test'=>$conf->banque->enabled, 'label'=>$langs->trans("CheckReceipt"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("CheckReceipt")));
|
||||
}
|
||||
if (!empty($conf->mrp->enabled)) {
|
||||
$langs->load("mrp"); $rowspan++; $sectionauto[] = array('level'=>1, 'module'=>'mrp-mo', 'test'=>$conf->mrp->enabled, 'label'=>$langs->trans("MOs"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("ManufacturingOrders")));
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2015-2017 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -2282,7 +2282,7 @@ if ($action == 'create') {
|
||||
|
||||
// Quantity
|
||||
print '<td class="right">';
|
||||
print '<input type="number" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($line->qty).'" />';
|
||||
print '<input type="text" min="0" class="right maxwidth50" name="qty" value="'.dol_escape_htmltag($line->qty).'" />'; // We must be able to enter decimal qty
|
||||
print '</td>';
|
||||
|
||||
//print '<td class="right">'.$langs->trans('AmountHT').'</td>';
|
||||
|
||||
@ -379,13 +379,13 @@ class Export
|
||||
*/
|
||||
public function conditionDate($Field, $Value, $Sens)
|
||||
{
|
||||
// TODO date_format is forbidden, not performant and not portable. Use instead BETWEEN
|
||||
// TODO date_format is forbidden, not performant and not portable. Use instead $Value to forge the range date.
|
||||
if (strlen($Value) == 4) {
|
||||
$Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$Value."'";
|
||||
$Condition = " date_format(".$Field.",'%Y') ".$Sens." '".$this->db->escape($Value)."'";
|
||||
} elseif (strlen($Value) == 6) {
|
||||
$Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$Value."'";
|
||||
$Condition = " date_format(".$Field.",'%Y%m') ".$Sens." '".$this->db->escape($Value)."'";
|
||||
} else {
|
||||
$Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." ".$Value;
|
||||
$Condition = " date_format(".$Field.",'%Y%m%d') ".$Sens." '".$this->db->escape($Value)."'";
|
||||
}
|
||||
return $Condition;
|
||||
}
|
||||
@ -416,7 +416,7 @@ class Export
|
||||
case 'Duree':
|
||||
case 'Numeric':
|
||||
case 'Number':
|
||||
// Must be a string text to allow to use comparison strings like "<= 999"
|
||||
// Must be a string text to allow to use comparison strings like "<= 99.9"
|
||||
$szFilterField = '<input type="text" size="6" name="'.$NameField.'" value="'.$ValueField.'">';
|
||||
break;
|
||||
case 'Status':
|
||||
|
||||
@ -415,6 +415,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."facture_fourn (";
|
||||
$sql .= "ref";
|
||||
$sql .= ", ref_supplier";
|
||||
$sql .= ", ref_ext";
|
||||
$sql .= ", entity";
|
||||
$sql .= ", type";
|
||||
$sql .= ", libelle";
|
||||
@ -438,6 +439,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$sql .= " VALUES (";
|
||||
$sql .= "'(PROV)'";
|
||||
$sql .= ", '".$this->db->escape($this->ref_supplier)."'";
|
||||
$sql .= ", '".$this->db->escape($this->ref_ext)."'";
|
||||
$sql .= ", ".$conf->entity;
|
||||
$sql .= ", '".$this->db->escape($this->type)."'";
|
||||
$sql .= ", '".$this->db->escape(isset($this->label) ? $this->label : (isset($this->libelle) ? $this->libelle : ''))."'";
|
||||
@ -647,6 +649,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$sql .= " t.rowid,";
|
||||
$sql .= " t.ref,";
|
||||
$sql .= " t.ref_supplier,";
|
||||
$sql .= " t.ref_ext,";
|
||||
$sql .= " t.entity,";
|
||||
$sql .= " t.type,";
|
||||
$sql .= " t.fk_soc,";
|
||||
@ -708,6 +711,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$this->ref = $obj->ref ? $obj->ref : $obj->rowid; // We take rowid if ref is empty for backward compatibility
|
||||
|
||||
$this->ref_supplier = $obj->ref_supplier;
|
||||
$this->ref_ext = $obj->ref_ext;
|
||||
$this->entity = $obj->entity;
|
||||
$this->type = empty($obj->type) ? self::TYPE_STANDARD : $obj->type;
|
||||
$this->fk_soc = $obj->fk_soc;
|
||||
@ -924,6 +928,9 @@ class FactureFournisseur extends CommonInvoice
|
||||
if (isset($this->ref_supplier)) {
|
||||
$this->ref_supplier = trim($this->ref_supplier);
|
||||
}
|
||||
if (isset($this->ref_ext)) {
|
||||
$this->ref_ext = trim($this->ref_ext);
|
||||
}
|
||||
if (isset($this->entity)) {
|
||||
$this->entity = trim($this->entity);
|
||||
}
|
||||
@ -1013,6 +1020,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."facture_fourn SET";
|
||||
$sql .= " ref=".(isset($this->ref) ? "'".$this->db->escape($this->ref)."'" : "null").",";
|
||||
$sql .= " ref_supplier=".(isset($this->ref_supplier) ? "'".$this->db->escape($this->ref_supplier)."'" : "null").",";
|
||||
$sql .= " ref_ext=".(isset($this->ref_ext) ? "'".$this->db->escape($this->ref_ext)."'" : "null").",";
|
||||
$sql .= " entity=".(isset($this->entity) ? $this->entity : "null").",";
|
||||
$sql .= " type=".(isset($this->type) ? $this->type : "null").",";
|
||||
$sql .= " fk_soc=".(isset($this->fk_soc) ? $this->fk_soc : "null").",";
|
||||
|
||||
@ -1219,7 +1219,7 @@ if ($id > 0 || !empty($ref)) {
|
||||
// Qty
|
||||
print '<td class="right">';
|
||||
if ($action == 'editline' && $lineid == $objp->dispatchlineid) {
|
||||
print '<input style="width: 50px;" type="number" min="1" name="qty" value="'.$objp->qty.'" />';
|
||||
print '<input style="width: 50px;" type="text" min="1" name="qty" value="'.$objp->qty.'" />';
|
||||
} else {
|
||||
print $objp->qty;
|
||||
}
|
||||
|
||||
@ -701,6 +701,7 @@ class Holiday extends CommonObject
|
||||
public function validate($user = null, $notrigger = 0)
|
||||
{
|
||||
global $conf, $langs;
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$error = 0;
|
||||
|
||||
// Define new ref
|
||||
@ -740,6 +741,44 @@ class Holiday extends CommonObject
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$this->oldref = $this->ref;
|
||||
|
||||
// Rename directory if dir was a temporary ref
|
||||
if (preg_match('/^[\(]?PROV/i', $this->ref)) {
|
||||
// Now we rename also files into index
|
||||
$sql = 'UPDATE ' . MAIN_DB_PREFIX . "ecm_files set filename = CONCAT('" . $this->db->escape($this->newref) . "', SUBSTR(filename, " . (strlen($this->ref) + 1) . ")), filepath = 'holiday/" . $this->db->escape($this->newref) . "'";
|
||||
$sql .= " WHERE filename LIKE '" . $this->db->escape($this->ref) . "%' AND filepath = 'holiday/" . $this->db->escape($this->ref) . "' and entity = " . ((int) $conf->entity);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror();
|
||||
}
|
||||
|
||||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
$newref = dol_sanitizeFileName($num);
|
||||
$dirsource = $conf->holiday->multidir_output[$this->entity] . '/' . $oldref;
|
||||
$dirdest = $conf->holiday->multidir_output[$this->entity] . '/' . $newref;
|
||||
if (!$error && file_exists($dirsource)) {
|
||||
dol_syslog(get_class($this) . "::validate rename dir " . $dirsource . " into " . $dirdest);
|
||||
if (@rename($dirsource, $dirdest)) {
|
||||
dol_syslog("Rename ok");
|
||||
// Rename docs starting with $oldref with $newref
|
||||
$listoffiles = dol_dir_list($dirdest, 'files', 1, '^' . preg_quote($oldref, '/'));
|
||||
foreach ($listoffiles as $fileentry) {
|
||||
$dirsource = $fileentry['name'];
|
||||
$dirdest = preg_replace('/^' . preg_quote($oldref, '/') . '/', $newref, $dirsource);
|
||||
$dirsource = $fileentry['path'] . '/' . $dirsource;
|
||||
$dirdest = $fileentry['path'] . '/' . $dirdest;
|
||||
@rename($dirsource, $dirdest);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Commit or rollback
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
|
||||
@ -627,3 +627,5 @@ CREATE TABLE llx_onlinesignature
|
||||
|
||||
ALTER TABLE llx_facture_fourn CHANGE COLUMN fk_mode_transport fk_transport_mode integer;
|
||||
|
||||
ALTER TABLE llx_c_socialnetworks DROP INDEX idx_c_socialnetworks_code;
|
||||
ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code_entity (code, entity);
|
||||
|
||||
@ -16,4 +16,4 @@
|
||||
-- ========================================================================
|
||||
|
||||
|
||||
ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code (code);
|
||||
ALTER TABLE llx_c_socialnetworks ADD UNIQUE INDEX idx_c_socialnetworks_code_entity (code, entity);
|
||||
|
||||
@ -570,19 +570,27 @@ dolibarr_install_syslog("Exit ".$ret);
|
||||
|
||||
dolibarr_install_syslog("- step2: end");
|
||||
|
||||
// Force here a value we need after because master.inc.php is not loaded into step2.
|
||||
// This code must be similar with the one into main.inc.php
|
||||
$conf->file->instance_unique_id = (empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id); // Unique id of instance
|
||||
|
||||
$out = '<input type="checkbox" name="dolibarrpingno" id="dolibarrpingno" value="checked" checked="true"> ';
|
||||
$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id);
|
||||
|
||||
$out = '<input type="checkbox" name="dolibarrpingno" id="dolibarrpingno"'.((!empty($conf->global->MAIN_FIRST_PING_OK_ID) && $conf->global->MAIN_FIRST_PING_OK_ID == 'disabled') ? '' : ' value="checked" checked="true"').'> ';
|
||||
$out .= '<label for="dolibarrpingno">'.$langs->trans("MakeAnonymousPing").'</label>';
|
||||
|
||||
$out .= '<!-- Add js script to manage the uncheck of option to not send the ping -->';
|
||||
$out .= '<script type="text/javascript">';
|
||||
$out .= 'jQuery(document).ready(function(){';
|
||||
$out .= ' document.cookie = "DOLINSTALLNOPING_'.md5($dolibarr_main_instance_unique_id).'=0; path=/"'."\n";
|
||||
$out .= ' document.cookie = "DOLINSTALLNOPING_'.$hash_unique_id.'=0; path=/"'."\n";
|
||||
$out .= ' jQuery("#dolibarrpingno").click(function() {';
|
||||
$out .= ' if (! $(this).is(\':checked\')) {';
|
||||
$out .= ' console.log("We uncheck anonymous ping");';
|
||||
$out .= ' document.cookie = "DOLINSTALLNOPING_'.md5($dolibarr_main_instance_unique_id).'=1; path=/"'."\n";
|
||||
$out .= ' }';
|
||||
$out .= ' document.cookie = "DOLINSTALLNOPING_'.$hash_unique_id.'=1; path=/"'."\n";
|
||||
$out .= ' } else {'."\n";
|
||||
$out .= ' console.log("We check anonymous ping");';
|
||||
$out .= ' document.cookie = "DOLINSTALLNOPING_'.$hash_unique_id.'=0; path=/"'."\n";
|
||||
$out .= ' }'."\n";
|
||||
$out .= ' });';
|
||||
$out .= '});';
|
||||
$out .= '</script>';
|
||||
|
||||
@ -530,7 +530,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ
|
||||
|
||||
// Can call a dedicated external upgrade process
|
||||
if (!$error) {
|
||||
$parameters = array('versionfrom'=>$versionfrom, 'versionto='.$versionto);
|
||||
$parameters = array('versionfrom' => $versionfrom, 'versionto' => $versionto);
|
||||
$object = new stdClass();
|
||||
$action = "upgrade";
|
||||
$reshook = $hookmanager->executeHooks('doUpgrade2', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
|
||||
@ -3206,6 +3206,7 @@ if (!function_exists("llxFooter")) {
|
||||
if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || $forceping) {
|
||||
//print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->';
|
||||
$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id);
|
||||
|
||||
if (empty($conf->global->MAIN_FIRST_PING_OK_DATE)
|
||||
|| (!empty($conf->file->instance_unique_id) && ($hash_unique_id != $conf->global->MAIN_FIRST_PING_OK_ID) && ($conf->global->MAIN_FIRST_PING_OK_ID != 'disabled'))
|
||||
|| $forceping) {
|
||||
@ -3214,7 +3215,7 @@ if (!function_exists("llxFooter")) {
|
||||
print "\n<!-- NO JS CODE TO ENABLE the anonymous Ping. It is an alpha version -->\n";
|
||||
} elseif (empty($_COOKIE['DOLINSTALLNOPING_'.$hash_unique_id]) || $forceping) { // Cookie is set when we uncheck the checkbox in the installation wizard.
|
||||
// MAIN_LAST_PING_KO_DATE
|
||||
// Disable ping if MAIN_LAST_PING_KO_DATE is set and is recent
|
||||
// Disable ping if MAIN_LAST_PING_KO_DATE is set and is recent (this month)
|
||||
if (!empty($conf->global->MAIN_LAST_PING_KO_DATE) && substr($conf->global->MAIN_LAST_PING_KO_DATE, 0, 6) == dol_print_date(dol_now(), '%Y%m') && !$forceping) {
|
||||
print "\n<!-- NO JS CODE TO ENABLE the anonymous Ping. An error already occured this month, we will try later. -->\n";
|
||||
} else {
|
||||
|
||||
@ -1295,20 +1295,32 @@ if ($dirins && $action == 'addproperty' && empty($cancel) && !empty($module) &&
|
||||
$error++;
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Type")), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$addfieldentry = array(
|
||||
'name'=>GETPOST('propname', 'aZ09'), 'label'=>GETPOST('proplabel', 'alpha'), 'type'=>GETPOST('proptype', 'alpha'),
|
||||
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
|
||||
'visible'=>GETPOST('propvisible', 'int'), 'enabled'=>GETPOST('propenabled', 'int'),
|
||||
'position'=>GETPOST('propposition', 'int'), 'notnull'=>GETPOST('propnotnull', 'int'), 'index'=>GETPOST('propindex', 'int'), 'searchall'=>GETPOST('propsearchall', 'int'),
|
||||
'isameasure'=>GETPOST('propisameasure', 'int'), 'comment'=>GETPOST('propcomment', 'alpha'), 'help'=>GETPOST('prophelp', 'alpha'),
|
||||
'css'=>GETPOST('propcss', 'aZ09'), 'cssview'=>GETPOST('propcssview', 'aZ09'), 'csslist'=>GETPOST('propcsslist', 'aZ09')
|
||||
);
|
||||
if (!$error) {
|
||||
$addfieldentry = array(
|
||||
'name'=>GETPOST('propname', 'aZ09'),
|
||||
'label'=>GETPOST('proplabel', 'alpha'),
|
||||
'type'=>GETPOST('proptype', 'alpha'),
|
||||
'arrayofkeyval'=>GETPOST('proparrayofkeyval', 'restricthtml'), // Example json string '{"0":"Draft","1":"Active","-1":"Cancel"}'
|
||||
'visible'=>GETPOST('propvisible', 'int'),
|
||||
'enabled'=>GETPOST('propenabled', 'int'),
|
||||
'position'=>GETPOST('propposition', 'int'),
|
||||
'notnull'=>GETPOST('propnotnull', 'int'),
|
||||
'index'=>GETPOST('propindex', 'int'),
|
||||
'searchall'=>GETPOST('propsearchall', 'int'),
|
||||
'isameasure'=>GETPOST('propisameasure', 'int'),
|
||||
'comment'=>GETPOST('propcomment', 'alpha'),
|
||||
'help'=>GETPOST('prophelp', 'alpha'),
|
||||
'css'=>GETPOST('propcss', 'aZ09'),
|
||||
'cssview'=>GETPOST('propcssview', 'aZ09'),
|
||||
'csslist'=>GETPOST('propcsslist', 'aZ09'),
|
||||
'default'=>GETPOST('propdefault', 'restricthtml'),
|
||||
'noteditable'=>intval(GETPOST('propnoteditable', 'int')),
|
||||
);
|
||||
|
||||
if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) {
|
||||
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
||||
}
|
||||
if (!empty($addfieldentry['arrayofkeyval']) && !is_array($addfieldentry['arrayofkeyval'])) {
|
||||
$addfieldentry['arrayofkeyval'] = json_decode($addfieldentry['arrayofkeyval'], true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2800,7 +2812,7 @@ if ($module == 'initmodule') {
|
||||
print '<input class="center" name="propvisible" size="2" value="'.dol_escape_htmltag($propvisible).'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input class="center" name="propnoeditable" size="2" value="'.dol_escape_htmltag($propnoteditable).'">';
|
||||
print '<input class="center" name="propnoteditable" size="2" value="'.dol_escape_htmltag($propnoteditable).'">';
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<input class="center" name="propsearchall" size="2" value="'.dol_escape_htmltag($propsearchall).'">';
|
||||
|
||||
@ -265,7 +265,7 @@ $sql .= $object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
|
||||
@ -643,13 +643,12 @@ class MultiCurrency extends CommonObject
|
||||
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
|
||||
|
||||
$urlendpoint = 'http://apilayer.net/api/live?access_key='.$key;
|
||||
//$urlendpoint.='&format=1';
|
||||
$urlendpoint .= (empty($conf->global->MULTICURRENCY_APP_SOURCE) ? '' : '&source='.$conf->global->MULTICURRENCY_APP_SOURCE);
|
||||
$urlendpoint = 'http://api.currencylayer.com/live?access_key='.$key;
|
||||
$urlendpoint .= '&source=' . (empty($conf->global->MULTICURRENCY_APP_SOURCE) ? 'USD' : $conf->global->MULTICURRENCY_APP_SOURCE);
|
||||
|
||||
dol_syslog("Call url endpoint ".$urlendpoint);
|
||||
|
||||
$resget = getURLContent($urlendpoint, 'GET', '', 1, array(), array('http', 'https'), 1);
|
||||
$resget = getURLContent($urlendpoint);
|
||||
|
||||
if ($resget['content']) {
|
||||
$response = $resget['content'];
|
||||
|
||||
@ -479,7 +479,7 @@ if ($resql) {
|
||||
// var_dump($obj);
|
||||
print ' <td><input class="minwidth200" name="dateinput" value="'. date('Y-m-d', dol_stringtotime($obj->date_sync)) .'" type="date"></td>';
|
||||
print '<td>' . $form->selectMultiCurrency($obj->code, 'multicurrency_code', 1, " code != '".$conf->currency."'", true) . '</td>';
|
||||
print ' <td><input type="number" min ="0" step="any" class="minwidth200" name="rateinput" value="' . dol_escape_htmltag($obj->rate) . '"></td>';
|
||||
print ' <td><input type="text" min ="0" step="any" class="minwidth200" name="rateinput" value="' . dol_escape_htmltag($obj->rate) . '"></td>';
|
||||
|
||||
print '<td class="center nowrap ">';
|
||||
print '<input type="hidden" name="page" value="'.dol_escape_htmltag($page).'">';
|
||||
|
||||
@ -462,7 +462,7 @@ class Products extends DolibarrApi
|
||||
|
||||
$childsArbo = $this->product->getChildsArbo($id, 1);
|
||||
|
||||
$keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec'];
|
||||
$keys = ['rowid', 'qty', 'fk_product_type', 'label', 'incdec', 'ref'];
|
||||
$childs = [];
|
||||
foreach ($childsArbo as $values) {
|
||||
$childs[] = array_combine($keys, $values);
|
||||
@ -1617,7 +1617,7 @@ class Products extends DolibarrApi
|
||||
$combinations[$key]->attributes = $prodc2vp->fetchByFkCombination((int) $combination->id);
|
||||
$combinations[$key] = $this->_cleanObjectDatas($combinations[$key]);
|
||||
|
||||
if ($includestock==1) {
|
||||
if ($includestock==1 && DolibarrApiAccess::$user->rights->stock->lire) {
|
||||
$productModel = new Product($this->db);
|
||||
$productModel->fetch((int) $combination->fk_product_child);
|
||||
$productModel->load_stock();
|
||||
@ -1859,7 +1859,7 @@ class Products extends DolibarrApi
|
||||
public function getStock($id, $selected_warehouse_id = null)
|
||||
{
|
||||
|
||||
if (!DolibarrApiAccess::$user->rights->produit->lire) {
|
||||
if (!DolibarrApiAccess::$user->rights->produit->lire || !DolibarrApiAccess::$user->rights->stock->lire) {
|
||||
throw new RestException(401);
|
||||
}
|
||||
|
||||
@ -1945,6 +1945,10 @@ class Products extends DolibarrApi
|
||||
|
||||
unset($object->supplierprices); // Mut use another API to get them
|
||||
|
||||
if (empty(DolibarrApiAccess::$user->rights->stock->lire)) {
|
||||
unset($object->stock_reel);
|
||||
unset($object->stock_theorique);
|
||||
}
|
||||
|
||||
return $object;
|
||||
}
|
||||
@ -2008,7 +2012,7 @@ class Products extends DolibarrApi
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
if ($includestockdata) {
|
||||
if ($includestockdata && DolibarrApiAccess::$user->rights->stock->lire) {
|
||||
$this->product->load_stock();
|
||||
|
||||
if (is_array($this->product->stock_warehouse)) {
|
||||
|
||||
@ -443,6 +443,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') {
|
||||
*/
|
||||
|
||||
$now = dol_now();
|
||||
$error = 0;
|
||||
|
||||
$form = new Form($db);
|
||||
$formproduct = new FormProduct($db);
|
||||
|
||||
@ -237,13 +237,11 @@ $title = $langs->trans('ListOfCandidatures');
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = 'SELECT ';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$sql .= 't.'.$key.', ';
|
||||
}
|
||||
$sql .= $object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
|
||||
@ -243,10 +243,11 @@ $title = $langs->trans('ListOfPositionsToBeFilled');
|
||||
// --------------------------------------------------------------------
|
||||
$sql = 'SELECT ';
|
||||
$sql .= $object->getFieldList('t');
|
||||
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
|
||||
@ -1151,6 +1151,10 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$("#typent_id").change();
|
||||
$("#effectif_id").val(id_ef15);
|
||||
$("#effectif_id").change();
|
||||
/* Force to recompute the width of a select2 field when it was hidden and then shown programatically */
|
||||
if ($("#civility_id").data("select2")) {
|
||||
$("#civility_id").select2({width: "resolve"});
|
||||
}
|
||||
$("#TypeName").html(document.formsoc.LastName.value);
|
||||
document.formsoc.private.value=1;
|
||||
});
|
||||
@ -2505,7 +2509,6 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
|
||||
print '</td>';
|
||||
$tmpcheck = $object->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
|
||||
|
||||
@ -6821,6 +6821,10 @@ span.clipboardCPValue.hidewithsize {
|
||||
min-width: 30px;
|
||||
}
|
||||
|
||||
div.login_block {
|
||||
border-right: 1px solid rgba(0,0,0,0.3);
|
||||
}
|
||||
|
||||
div.tmenucenter {
|
||||
text-overflow: clip;
|
||||
}
|
||||
|
||||
@ -384,6 +384,9 @@ class User extends CommonObject
|
||||
$this->rights->user = new stdClass();
|
||||
$this->rights->user->user = new stdClass();
|
||||
$this->rights->user->self = new stdClass();
|
||||
$this->rights->user->user_advance = new stdClass();
|
||||
$this->rights->user->self_advance = new stdClass();
|
||||
$this->rights->user->group_advance = new stdClass();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -222,6 +222,7 @@ if (preg_match('/\.noexe$/i', $original_file)) {
|
||||
}
|
||||
|
||||
// Security: Delete string ../ or ..\ into $original_file
|
||||
$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..'
|
||||
$original_file = str_replace('../', '/', $original_file);
|
||||
$original_file = str_replace('..\\', '/', $original_file);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user