';
print '
';
if ($showinfo) print dol_print_date($curtime, 'daytextshort');
else print dol_print_date($curtime, '%d');
@@ -1630,7 +1630,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$tmpyearend = date('Y', $event->date_end_in_calendar);
$tmpmonthend = date('m', $event->date_end_in_calendar);
$tmpdayend = date('d', $event->date_end_in_calendar);
- if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour)
+ if ($tmpyearend != $annee || $tmpmonthend != $mois || $tmpdayend != $jour)
{
$cssclass .= " unmovable";
}
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 2cb2e3b1029..d50cbbeeb25 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -243,7 +243,7 @@ if (empty($reshook))
elseif ($action == 'add' && $usercancreate)
{
$datecommande = dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
- $datelivraison = dol_mktime(12, 0, 0, GETPOST('liv_month'), GETPOST('liv_day'), GETPOST('liv_year'));
+ $date_delivery = dol_mktime(GETPOST('liv_hour', 'int'), GETPOST('liv_min', 'int'), 0, GETPOST('liv_month', 'int'), GETPOST('liv_day', 'int'), GETPOST('liv_year', 'int'));
$selectedLines = GETPOST('toselect', 'array');
if ($datecommande == '') {
@@ -276,8 +276,8 @@ if (empty($reshook))
$object->fk_account = GETPOST('fk_account', 'int');
$object->availability_id = GETPOST('availability_id');
$object->demand_reason_id = GETPOST('demand_reason_id');
- $object->date_livraison = $datelivraison; // deprecated
- $object->delivery_date = $datelivraison;
+ $object->date_livraison = $date_delivery; // deprecated
+ $object->delivery_date = $date_delivery;
$object->shipping_method_id = GETPOST('shipping_method_id', 'int');
$object->warehouse_id = GETPOST('warehouse_id', 'int');
$object->fk_delivery_address = GETPOST('fk_address');
@@ -1618,7 +1618,7 @@ if ($action == 'create' && $usercancreate)
print ''.$langs->trans("DateDeliveryPlanned").' ';
print '';
$date_delivery = ($date_delivery ? $date_delivery : $object->date_delivery);
- print $form->selectDate($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1);
+ print $form->selectDate($date_delivery ? $date_delivery : -1, 'liv_', 1, 1, 1);
print " \n";
print ' ';
diff --git a/htdocs/compta/bank/various_payment/list.php b/htdocs/compta/bank/various_payment/list.php
index 0790f149da4..3990c968806 100644
--- a/htdocs/compta/bank/various_payment/list.php
+++ b/htdocs/compta/bank/various_payment/list.php
@@ -251,7 +251,7 @@ if ($result)
if ($typeid > 0) $param .= '&typeid='.urlencode($typeid);
if ($search_amount_deb) $param .= '&search_amount_deb='.urlencode($search_amount_deb);
if ($search_amount_cred) $param .= '&search_amount_cred='.urlencode($search_amount_cred);
- if ($search_bank_account > 0) $param .= '&search_amount='.urlencode($search_bank_account);
+ if ($search_bank_account > 0) $param .= '&search_account='.urlencode($search_bank_account);
if ($search_accountancy_account > 0) $param .= '&search_accountancy_account='.urlencode($search_accountancy_account);
if ($search_accountancy_subledger > 0) $param .= '&search_accountancy_subledger='.urlencode($search_accountancy_subledger);
diff --git a/htdocs/compta/cashcontrol/report.php b/htdocs/compta/cashcontrol/report.php
index 04cdea52f7f..caa873cc89b 100644
--- a/htdocs/compta/cashcontrol/report.php
+++ b/htdocs/compta/cashcontrol/report.php
@@ -110,7 +110,7 @@ $sql .= " WHERE pf.fk_facture = f.rowid AND p.rowid = pf.fk_paiement AND cp.id =
$sql .= " AND f.module_source = '".$db->escape($posmodule)."'";
$sql .= " AND f.pos_source = '".$db->escape($terminalid)."'";
$sql .= " AND f.paye = 1";
-$sql .= " AND p.entity IN (".getEntity('facture').")";
+$sql .= " AND p.entity = ".$conf->entity; // Never share entities for features related to accountancy
/*if ($key == 'cash') $sql.=" AND cp.code = 'LIQ'";
elseif ($key == 'cheque') $sql.=" AND cp.code = 'CHQ'";
elseif ($key == 'card') $sql.=" AND cp.code = 'CB'";
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index eb7b8c83b34..393595bc0a8 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -289,11 +289,11 @@ if (empty($reshook))
elseif ($action == 'setref' && $user->rights->facture->creer)
{
//var_dump(GETPOST('ref', 'alpha'));exit;
- $result = $object->setValueFrom('title', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
+ $result = $object->setValueFrom('titre', $ref, '', null, 'text', '', $user, 'BILLREC_MODIFY');
if ($result > 0)
{
- $object->titre = GETPOST('ref', 'alpha'); // deprecated
- $object->title = GETPOST('ref', 'alpha');
+ $object->titre = $ref; // deprecated
+ $object->title = $ref;
$object->ref = $object->title;
} else {
$error++;
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 7565ddc1dee..44097c84f49 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4104,7 +4104,7 @@ if ($action == 'create')
if ($objectidnext > 0) {
$facthatreplace = new Facture($db);
$facthatreplace->fetch($objectidnext);
- print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).') ';
+ print ' ('.str_replace('{s1}', $facthatreplace->getNomUrl(1), $langs->transnoentities("ReplacedByInvoice", '{s1}')).') ';
}
if ($object->type == Facture::TYPE_CREDIT_NOTE || $object->type == Facture::TYPE_DEPOSIT) {
@@ -4112,7 +4112,10 @@ if ($action == 'create')
$result = $discount->fetch(0, $object->id);
if ($result > 0) {
print ' ';
- print $langs->transnoentities("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount'));
+ $s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}');
+ $s = str_replace('{s1}', $object->getLibType(1), $s);
+ $s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s);
+ print $s;
print ' ';
}
}
@@ -4123,7 +4126,9 @@ if ($action == 'create')
$result = $tmptemplate->fetch($object->fk_fac_rec_source);
if ($result > 0) {
print ' ';
- print $langs->transnoentities("GeneratedFromTemplate", ''.dol_escape_htmltag($tmptemplate->ref).' ');
+ $s = $langs->transnoentities("GeneratedFromTemplate", '{s1}');
+ $s = str_replace('{s1}', ''.dol_escape_htmltag($tmptemplate->ref).' ', $s);
+ print $s;
print ' ';
}
}
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 6beb5caa1e2..6f3f8088a63 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -268,7 +268,7 @@ if ($search_status != '' && $search_status >= -1)
if ($search_status == -1) $sql .= ' AND suspended = 1';
}
$sql .= dolSqlDateFilter('f.date_last_gen', $search_day, $search_month, $search_year);
-$sql .= dolSqlDateFilter('f.date_last_gen', $search_day_date_when, $search_month_date_when, $search_year_date_when);
+$sql .= dolSqlDateFilter('f.date_when', $search_day_date_when, $search_month_date_when, $search_year_date_when);
$sql .= $db->order($sortfield, $sortorder);
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index 83393a52cb6..95db83c937b 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -507,19 +507,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print ''.$langs->trans('Numero');
print ' ('.$langs->trans("ChequeOrTransferNumber").') ';
print ' ';
- print ' ';
+ print ' ';
// Check transmitter
print '
'.$langs->trans('CheckTransmitter');
print ' ('.$langs->trans("ChequeMaker").') ';
print ' ';
- print '';
+ print '
';
// Bank name
print '
'.$langs->trans('Bank');
print ' ('.$langs->trans("ChequeBank").') ';
print ' ';
- print '';
+ print '
';
// Comments
print '
'.$langs->trans('Comments').' ';
@@ -577,6 +577,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$i = 0;
//print '';
print ' ';
+
+ print ''; // You can use div-table-responsive-no-min if you dont need reserved height for your table
print '
';
print '';
@@ -785,7 +787,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print " \n";
}
print "
";
- //print "
\n";
+ print "
\n";
}
$db->free($resql);
} else {
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index 374ab19e358..a7fd5476d7f 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -43,12 +43,20 @@ $action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
+$object = new Paiement($db);
+
+// Load object
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+
+$result = restrictedArea($user, $object->element, $object->id, 'paiement', '');
+
// Security check
if ($user->socid) $socid = $user->socid;
-// TODO ajouter regle pour restreindre acces paiement
-//$result = restrictedArea($user, 'facture', $id,'');
-
-$object = new Paiement($db);
+// Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
+// It should be enough because all payments are done on invoices of the same thirdparty.
+if ($socid && $socid != $object->thirdparty->id) {
+ accessforbidden();
+}
/*
@@ -59,7 +67,6 @@ if ($action == 'setnote' && $user->rights->facture->paiement)
{
$db->begin();
- $object->fetch($id);
$result = $object->update_note(GETPOST('note', 'restricthtml'));
if ($result > 0)
{
@@ -75,7 +82,6 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture->
{
$db->begin();
- $object->fetch($id);
$result = $object->delete();
if ($result > 0)
{
@@ -100,7 +106,6 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture
{
$db->begin();
- $object->fetch($id);
if ($object->validate($user) > 0)
{
$db->commit();
@@ -134,7 +139,6 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->facture
if ($action == 'setnum_paiement' && !empty($_POST['num_paiement']))
{
- $object->fetch($id);
$res = $object->update_num($_POST['num_paiement']);
if ($res === 0)
{
@@ -146,7 +150,6 @@ if ($action == 'setnum_paiement' && !empty($_POST['num_paiement']))
if ($action == 'setdatep' && !empty($_POST['datepday']))
{
- $object->fetch($id);
$datepaye = dol_mktime(GETPOST('datephour', 'int'), GETPOST('datepmin', 'int'), GETPOST('datepsec', 'int'), GETPOST('datepmonth', 'int'), GETPOST('datepday', 'int'), GETPOST('datepyear', 'int'));
$res = $object->update_date($datepaye);
if ($res === 0)
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 2c897968320..bf25485dc14 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -1293,7 +1293,8 @@ class Paiement extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
- * Load the third party of object, from id into this->thirdparty
+ * Load the third party of object, from id into this->thirdparty.
+ * For payments, take the thirdparty linked to the first invoice found. This is enough because payments are done on invoices of the same thirdparty.
*
* @param int $force_thirdparty_id Force thirdparty id
* @return int <0 if KO, >0 if OK
@@ -1311,7 +1312,7 @@ class Paiement extends CommonObject
$invoice = new Facture($this->db);
if ($invoice->fetch($billsarray[0]) > 0)
{
- $force_thirdparty_id = $invoice->fk_soc;
+ $force_thirdparty_id = $invoice->socid;
}
}
}
diff --git a/htdocs/compta/paiement/info.php b/htdocs/compta/paiement/info.php
index 208d74a316f..ace21e40f95 100644
--- a/htdocs/compta/paiement/info.php
+++ b/htdocs/compta/paiement/info.php
@@ -36,6 +36,23 @@ $ref = GETPOST('ref', 'alpha');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
+$object = new Paiement($db);
+
+// Load object
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+
+$result = restrictedArea($user, $object->element, $object->id, 'paiement', '');
+
+// Security check
+if ($user->socid) $socid = $user->socid;
+// Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
+// It should be enough because all payments are done on invoices of the same thirdparty.
+if ($socid && $socid != $object->thirdparty->id) {
+ accessforbidden();
+}
+
+
+
/*
* Actions
*/
@@ -49,8 +66,6 @@ $confirm = GETPOST('confirm', 'alpha');
llxHeader('', $langs->trans("Payment"));
-$object = new Paiement($db);
-$object->fetch($id, $ref);
$object->info($object->id);
$head = payment_prepare_head($object);
diff --git a/htdocs/compta/paiement/rapport.php b/htdocs/compta/paiement/rapport.php
index 47bb2ad2582..0af202016df 100644
--- a/htdocs/compta/paiement/rapport.php
+++ b/htdocs/compta/paiement/rapport.php
@@ -30,9 +30,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
-// Security check
-if (!$user->rights->facture->lire) accessforbidden();
-
$action = GETPOST('action', 'aZ09');
$socid = 0;
@@ -48,6 +45,9 @@ if (!$user->rights->societe->client->voir || $socid) $dir .= '/private/'.$user->
$year = GETPOST('year', 'int');
if (!$year) { $year = date("Y"); }
+// Security check
+if (empty($user->rights->facture->lire)) accessforbidden();
+
/*
* Actions
diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php
index f6582a4ffb4..4cf14ad8a5c 100644
--- a/htdocs/compta/paiement/tovalidate.php
+++ b/htdocs/compta/paiement/tovalidate.php
@@ -27,10 +27,6 @@ require '../../main.inc.php';
// Load translation files required by the page
$langs->load("bills");
-// Security check
-if (!$user->rights->facture->lire)
- accessforbidden();
-
$socid = 0;
if ($user->socid > 0)
{
@@ -50,6 +46,9 @@ $pagenext = $page + 1;
if (!$sortorder) $sortorder = "DESC";
if (!$sortfield) $sortfield = "p.rowid";
+// Security check
+if (empty($user->rights->facture->lire)) accessforbidden();
+
/*
* Actions
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index be89fb2d3f6..4e33fb6d308 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -2137,7 +2137,7 @@ if ($action == 'create')
$delallowed = $user->rights->contrat->creer;
- print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object);
+ print $formfile->showdocuments('contract', $filename, $filedir, $urlsource, $genallowed, $delallowed, ($object->model_pdf ? $object->model_pdf : $conf->global->CONTRACT_ADDON_PDF), 1, 0, 0, 28, 0, '', 0, '', $soc->default_lang, '', $object);
// Show links to link elements
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 75a3b036338..f9c537aea2f 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -201,7 +201,7 @@ $socstatic = new Societe($db);
$contracttmp = new Contrat($db);
$sql = 'SELECT';
-$sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity";
+$sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,";
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias, s.email, s.town, s.zip, s.fk_pays as country_id, s.client, s.code_client, s.status as company_status, s.logo as company_logo,';
$sql .= " typent.code as typent_code,";
$sql .= " state.code_departement as state_code, state.nom as state_name,";
diff --git a/htdocs/core/class/discount.class.php b/htdocs/core/class/discount.class.php
index 9f901ed3452..af336c38745 100644
--- a/htdocs/core/class/discount.class.php
+++ b/htdocs/core/class/discount.class.php
@@ -222,6 +222,7 @@ class DiscountAbsolute
if (empty($this->multicurrency_amount_ht)) $this->multicurrency_amount_ht = 0;
if (empty($this->multicurrency_amount_tva)) $this->multicurrency_amount_tva = 0;
if (empty($this->multicurrency_amount_ttc)) $this->multicurrency_amount_ttc = 0;
+ if (empty($this->tva_tx)) $this->tva_tx = 0;
// Check parameters
if (empty($this->description))
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index fc50c21f793..7f8831bec96 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -253,9 +253,9 @@ class Form
if (empty($notabletag)) $ret .= '
';
//else $ret.='
';
- $ret .= ' ';
+ $ret .= ' ';
if (preg_match('/ckeditor|textarea/', $typeofdata) && empty($notabletag)) $ret .= ' '."\n";
- $ret .= ' ';
+ $ret .= ' ';
if (empty($notabletag)) $ret .= ' ';
if (empty($notabletag)) $ret .= ''."\n";
@@ -3044,10 +3044,10 @@ class Form
// Add new entry
- // "key" value of json key array is used by jQuery automatically as selected value
+ // "key" value of json key array is used by jQuery automatically as selected value. Example: 'type' = product or service, 'price_ht' = unit price without tax
// "label" value of json key array is used by jQuery automatically as text for combo box
$out .= $opt;
- array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'up'=>price2num($objp->unitprice, 'MT'), 'discount'=>$outdiscount, 'type'=>$outtype, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit, 'disabled'=>(empty($objp->idprodfournprice) ?true:false)));
+ array_push($outarray, array('key'=>$outkey, 'value'=>$outref, 'label'=>$outval, 'qty'=>$outqty, 'price_ht'=>price2num($objp->unitprice, 'MT'), 'up'=>price2num($objp->unitprice, 'MT'), 'discount'=>$outdiscount, 'type'=>$outtype, 'duration_value'=>$outdurationvalue, 'duration_unit'=>$outdurationunit, 'disabled'=>(empty($objp->idprodfournprice) ?true:false)));
// Exemple of var_dump $outarray
// array(1) {[0]=>array(6) {[key"]=>string(1) "2" ["value"]=>string(3) "ppp"
// ["label"]=>string(76) "ppp (
f ff2) - ppp - 20,00 Euros/1unité (20,00 Euros/unité)"
@@ -5614,6 +5614,9 @@ class Form
if ($h == 3) $shour = '';
if ($m == 3) $smin = '';
+ $nowgmt = dol_now('gmt');
+ //var_dump(dol_print_date($nowgmt, 'dayhourinputnoreduce', 'tzuserrel'));
+
// You can set MAIN_POPUP_CALENDAR to 'eldy' or 'jquery'
$usecalendar = 'combo';
if (!empty($conf->use_javascript_ajax) && (empty($conf->global->MAIN_POPUP_CALENDAR) || $conf->global->MAIN_POPUP_CALENDAR != "none")) {
@@ -5636,13 +5639,13 @@ class Form
// Calendrier popup version eldy
if ($usecalendar == "eldy")
{
- // Zone de saisie manuelle de la date
+ // Input area to enter date manually
$retstring .= '
trans("FormatDateShortJavaInput").'\'); "'; // FormatDateShortInput for dol_print_date / FormatDateShortJavaInput that is same for javascript
$retstring .= '>';
- // Icone calendrier
+ // Icon calendar
if (!$disabled)
{
$retstring .= '
use_javascript_ajax && $adddateof)
{
$tmparray = dol_getdate($adddateof);
if (empty($labeladddateof)) $labeladddateof = $langs->trans("DateInvoice");
- $retstring .= ' - '.$labeladddateof.'';
+ $retstring .= ' - '.$labeladddateof.'';
}
return $retstring;
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 610b8276790..7b38605a6ab 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -20,7 +20,7 @@
/**
* \file htdocs/core/class/html.formactions.class.php
* \ingroup core
- * \brief Fichier de la classe des fonctions predefinie de composants html actions
+ * \brief File of class with predefined functions and HTML components
*/
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index d9d0442e49e..1569ee8af83 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -1022,11 +1022,10 @@ class FormCompany extends Form
public function formThirdpartyType($page, $selected = '', $htmlname = 'socid', $filter = '', $nooutput = 0)
{
// phpcs:enable
- global $langs;
+ global $conf, $langs;
$out = '';
- if ($htmlname != "none")
- {
+ if ($htmlname != "none") {
$out .= '';
} else {
- if ($selected)
- {
+ if ($selected) {
$arr = $this->typent_array(0);
$typent = $arr[$selected];
$out .= $typent;
@@ -1045,7 +1043,10 @@ class FormCompany extends Form
}
}
- if ($nooutput) return $out;
- else print $out;
+ if ($nooutput) {
+ return $out;
+ } else {
+ print $out;
+ }
}
}
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 31681fb072c..e0d96112aec 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -426,7 +426,7 @@ class FormFile
if ($modulepart == 'company')
{
- $showempty = 1;
+ $showempty = 1; // can have no template active
if (is_array($genallowed)) $modellist = $genallowed;
else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php';
@@ -490,6 +490,7 @@ class FormFile
}
} elseif ($modulepart == 'contract')
{
+ $showempty = 1; // can have no template active
if (is_array($genallowed)) $modellist = $genallowed;
else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/contract/modules_contract.php';
@@ -553,6 +554,7 @@ class FormFile
}
} elseif ($modulepart == 'facture_fournisseur' || $modulepart == 'supplier_invoice')
{
+ $showempty = 1; // can have no template active
if (is_array($genallowed)) $modellist = $genallowed;
else {
include_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_invoice/modules_facturefournisseur.php';
diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php
index 382f12840d7..391a5359846 100644
--- a/htdocs/core/js/lib_head.js.php
+++ b/htdocs/core/js/lib_head.js.php
@@ -183,17 +183,18 @@ function getObjectFromID(id){
}
// Called after selection of a date to save details into detailed fields
-function dpChangeDay(dateFieldID,format)
+function dpChangeDay(dateFieldID, format)
{
//showDP.datefieldID=dateFieldID;
- console.log("Call dpChangeDay, we save date into detailed fields.");
+ console.log("Call dpChangeDay, we save date into detailed fields from format = "+format);
var thefield=getObjectFromID(dateFieldID);
var thefieldday=getObjectFromID(dateFieldID+"day");
var thefieldmonth=getObjectFromID(dateFieldID+"month");
var thefieldyear=getObjectFromID(dateFieldID+"year");
- var date=getDateFromFormat(thefield.value,format);
+ var date=getDateFromFormat(thefield.value, format);
+ //console.log(date);
if (date)
{
thefieldday.value=date.getDate();
diff --git a/htdocs/core/lib/asset.lib.php b/htdocs/core/lib/asset.lib.php
index 5fddf4f1c46..96355704c96 100644
--- a/htdocs/core/lib/asset.lib.php
+++ b/htdocs/core/lib/asset.lib.php
@@ -80,7 +80,7 @@ function asset_prepare_head(Asset $object)
$h = 0;
$head = array();
- $head[$h][0] = DOL_URL_ROOT.'/asset/card.php';
+ $head[$h][0] = DOL_URL_ROOT.'/asset/card.php?id='.$object->id;
$head[$h][1] = $langs->trans("Card");
$head[$h][2] = 'card';
$h++;
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 0f3023d100d..14701d57256 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -1192,6 +1192,16 @@ function dol_delete_file($file, $disableglob = 0, $nophperrors = 0, $nohook = 0,
{
if ($nophperrors) $ok = @unlink($filename);
else $ok = unlink($filename);
+
+ // If it fails and it is because of the missing write permission on parent dir
+ if (!$ok && file_exists(dirname($filename)) && !(fileperms(dirname($filename)) & 0200)) {
+ dol_syslog("Error in deletion, but parent directory exists with no permission to write, we try to change permission on parent directory and retry...", LOG_DEBUG);
+ @chmod(dirname($filename), fileperms(dirname($filename)) | 0200);
+ // Now we retry deletion
+ if ($nophperrors) $ok = @unlink($filename);
+ else $ok = unlink($filename);
+ }
+
if ($ok)
{
dol_syslog("Removed file ".$filename, LOG_DEBUG);
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 719992a52f8..92c519c5a66 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1969,7 +1969,7 @@ function dol_strftime($fmt, $ts = false, $is_gmt = false)
* "%d/%m/%Y %H:%M",
* "%d/%m/%Y %H:%M:%S",
* "%B"=Long text of month, "%A"=Long text of day, "%b"=Short text of month, "%a"=Short text of day
- * "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...reduceformat"
+ * "day", "daytext", "dayhour", "dayhourldap", "dayhourtext", "dayrfc", "dayhourrfc", "...inputnoreduce", "...reduceformat"
* @param string $tzoutput true or 'gmt' => string is for Greenwich location
* false or 'tzserver' => output string is for local PHP server TZ usage
* 'tzuser' => output string is for user TZ (current browser TZ with current dst) => In a future, we should have same behaviour than 'tzuserrel'
@@ -2013,13 +2013,17 @@ function dol_print_date($time, $format = '', $tzoutput = 'auto', $outputlangs =
}
if (!is_object($outputlangs)) $outputlangs = $langs;
if (!$format) $format = 'daytextshort';
- $reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0;
+
+ // Do we have to reduce the length of date (year on 2 chars) to save space.
+ // Note: dayinputnoreduce is same than day but no reduction of year length will be done
+ $reduceformat = (!empty($conf->dol_optimize_smallscreen) && in_array($format, array('day', 'dayhour'))) ? 1 : 0; // Test on original $format param.
+ $format = preg_replace('/inputnoreduce/', '', $format); // so format 'dayinputnoreduce' is processed like day
$formatwithoutreduce = preg_replace('/reduceformat/', '', $format);
if ($formatwithoutreduce != $format) { $format = $formatwithoutreduce; $reduceformat = 1; } // so format 'dayreduceformat' is processed like day
// Change predefined format into computer format. If found translation in lang file we use it, otherwise we use default.
// TODO Add format daysmallyear and dayhoursmallyear
- if ($format == 'day') $format = ($outputlangs->trans("FormatDateShort") != "FormatDateShort" ? $outputlangs->trans("FormatDateShort") : $conf->format_date_short);
+ if ($format == 'day') $format = ($outputlangs->trans("FormatDateShort") != "FormatDateShort" ? $outputlangs->trans("FormatDateShort") : $conf->format_date_short);
elseif ($format == 'hour') $format = ($outputlangs->trans("FormatHourShort") != "FormatHourShort" ? $outputlangs->trans("FormatHourShort") : $conf->format_hour_short);
elseif ($format == 'hourduration') $format = ($outputlangs->trans("FormatHourShortDuration") != "FormatHourShortDuration" ? $outputlangs->trans("FormatHourShortDuration") : $conf->format_hour_short_duration);
elseif ($format == 'daytext') $format = ($outputlangs->trans("FormatDateText") != "FormatDateText" ? $outputlangs->trans("FormatDateText") : $conf->format_date_text);
diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php
index 453bc34be8a..eda1a901986 100644
--- a/htdocs/core/lib/invoice.lib.php
+++ b/htdocs/core/lib/invoice.lib.php
@@ -189,7 +189,7 @@ function invoice_rec_prepare_head($object)
$head = array();
$head[$h][0] = DOL_URL_ROOT.'/compta/facture/card-rec.php?id='.$object->id;
- $head[$h][1] = $langs->trans("CardBill");
+ $head[$h][1] = $langs->trans("RepeatableInvoice");
$head[$h][2] = 'card';
$h++;
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index 4602e877bd1..9d18dd1dd85 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -165,6 +165,7 @@ function dol_verifyHash($chain, $hash, $type = '0')
/**
* Check permissions of a user to show a page and an object. Check read permission.
* If GETPOST('action','aZ09') defined, we also check write and delete permission.
+ * This method check permission on module then call checkUserAccessToObject() for permission on object (according to entity and socid of user).
*
* @param User $user User to check
* @param string $features Features to check (it must be module $object->element. Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...)
@@ -175,20 +176,22 @@ function dol_verifyHash($chain, $hash, $type = '0')
* @param string $dbt_select Field name for select if not rowid. Not used if objectid is null (optional)
* @param int $isdraft 1=The object with id=$objectid is a draft
* @return int Always 1, die process if not allowed
- * @see dol_check_secure_access_document()
+ * @see dol_check_secure_access_document(), checkUserAccessToObject()
*/
function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0)
{
global $db, $conf;
global $hookmanager;
- //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename,$feature2,$dbt_socfield,$dbt_select");
+ //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
//print "user_id=".$user->id.", features=".$features.", feature2=".$feature2.", objectid=".$objectid;
//print ", dbtablename=".$dbtablename.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select;
//print ", perm: ".$features."->".$feature2."=".($user->rights->$features->$feature2->lire)." ";
$parentfortableentity = '';
+ // Fix syntax of $features param
+ $originalfeatures = $features;
if ($features == 'facturerec') $features = 'facture';
if ($features == 'mo') $features = 'mrp';
if ($features == 'member') $features = 'adherent';
@@ -198,7 +201,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
if ($features == 'product') $features = 'produit';
// Get more permissions checks from hooks
- $parameters = array('features'=>$features, 'objectid'=>$objectid, 'idtype'=>$dbt_select);
+ $parameters = array('features'=>$features, 'originalfeatures'=>$originalfeatures, 'objectid'=>$objectid, 'dbt_select'=>$dbt_select, 'idtype'=>$dbt_select, 'isdraft'=>$isdraft);
$reshook = $hookmanager->executeHooks('restrictedArea', $parameters);
if (isset($hookmanager->resArray['result'])) {
@@ -218,11 +221,6 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
// More subfeatures to check
if (!empty($feature2)) $feature2 = explode("|", $feature2);
- // More parameters
- $params = explode('&', $tableandshare);
- $dbtablename = (!empty($params[0]) ? $params[0] : '');
- $sharedelement = (!empty($params[1]) ? $params[1] : $dbtablename);
-
$listofmodules = explode(',', $conf->global->MAIN_MODULES_FOR_EXTERNAL);
// Check read permission from module
@@ -247,6 +245,10 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
if (!$user->rights->banque->cheque) { $readok = 0; $nbko++; }
} elseif ($feature == 'projet') {
if (!$user->rights->projet->lire && !$user->rights->projet->all->lire) { $readok = 0; $nbko++; }
+ } elseif ($feature == 'payment') {
+ if (!$user->rights->facture->lire) { $readok = 0; $nbko++; }
+ } elseif ($feature == 'payment_supplier') {
+ if (!$user->rights->fournisseur->facture->lire) { $readok = 0; $nbko++; }
} elseif (!empty($feature2)) { // This is for permissions on 2 levels
$tmpreadok = 1;
foreach ($feature2 as $subfeature) {
@@ -426,6 +428,10 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
{
global $db, $conf;
+ //dol_syslog("functions.lib:restrictedArea $feature, $objectid, $dbtablename, $feature2, $dbt_socfield, $dbt_select, $isdraft");
+ //print "user_id=".$user->id.", features=".join(',', $featuresarray).", feature2=".$feature2.", objectid=".$objectid;
+ //print ", tableandshare=".$tableandshare.", dbt_socfield=".$dbt_keyfield.", dbt_select=".$dbt_select." ";
+
// More parameters
$params = explode('&', $tableandshare);
$dbtablename = (!empty($params[0]) ? $params[0] : '');
@@ -440,13 +446,13 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
if ($feature == 'project') $feature = 'projet';
if ($feature == 'task') $feature = 'projet_task';
- $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'website'); // Test on entity only (Objects with no link to company)
+ $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'website'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object
- $checkother = array('contact', 'agenda'); // Test on entity and link to third party. Allowed if link is empty (Ex: contacts...).
+ $checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet', 'project'); // Test for project object
$checktask = array('projet_task'); // Test for task object
$nocheck = array('barcode', 'stock'); // No test
- //$checkdefault = 'all other not already defined'; // Test on entity and link to third party. Not allowed if link is empty (Ex: invoice, orders...).
+ //$checkdefault = 'all other not already defined'; // Test on entity + link to third party on field $dbt_keyfield. Not allowed if link is empty (Ex: invoice, orders...).
// If dbtablename not defined, we use same name for table than module name
if (empty($dbtablename))
@@ -455,17 +461,14 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sharedelement = (!empty($params[1]) ? $params[1] : $dbtablename); // We change dbtablename, so we set sharedelement too.
}
- // Check permission for object with entity
+ // Check permission for object on entity only
if (in_array($feature, $check))
{
$sql = "SELECT COUNT(dbt.".$dbt_select.") as nb";
$sql .= " FROM ".MAIN_DB_PREFIX.$dbtablename." as dbt";
- if (($feature == 'user' || $feature == 'usergroup') && !empty($conf->multicompany->enabled))
- {
- if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE))
- {
- if ($conf->entity == 1 && $user->admin && !$user->entity)
- {
+ if (($feature == 'user' || $feature == 'usergroup') && !empty($conf->multicompany->enabled)) { // Special for multicompany
+ if (!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
+ if ($conf->entity == 1 && $user->admin && !$user->entity) {
$sql .= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
$sql .= " AND dbt.entity IS NOT NULL";
} else {
@@ -490,15 +493,12 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql .= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
}
}
- } elseif (in_array($feature, $checksoc)) // We check feature = checksoc
- {
- // If external user: Check permission for external users
- if ($user->socid > 0)
- {
+ } elseif (in_array($feature, $checksoc)) { // We check feature = checksoc
+ if ($user->socid > 0) {
+ // If external user: Check permission for external users
if ($user->socid <> $objectid) return false;
- } // If internal user: Check permission for internal users that are restricted on their objects
- elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && !$user->rights->societe->client->voir))
- {
+ } elseif (!empty($conf->societe->enabled) && ($user->rights->societe->lire && !$user->rights->societe->client->voir)) {
+ // If internal user: Check permission for internal users that are restricted on their objects
$sql = "SELECT COUNT(sc.fk_soc) as nb";
$sql .= " FROM (".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql .= ", ".MAIN_DB_PREFIX."societe as s)";
@@ -506,15 +506,14 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
$sql .= " AND sc.fk_user = ".$user->id;
$sql .= " AND sc.fk_soc = s.rowid";
$sql .= " AND s.entity IN (".getEntity($sharedelement, 1).")";
- } // If multicompany and internal users with all permissions, check user is in correct entity
- elseif (!empty($conf->multicompany->enabled))
- {
+ } elseif (!empty($conf->multicompany->enabled)) {
+ // If multicompany and internal users with all permissions, check user is in correct entity
$sql = "SELECT COUNT(s.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE s.rowid IN (".$objectid.")";
$sql .= " AND s.entity IN (".getEntity($sharedelement, 1).")";
}
- } elseif (in_array($feature, $checkother)) // Test on entity and link to societe. Allowed if link is empty (Ex: contacts...).
+ } elseif (in_array($feature, $checkother)) // Test on entity + link to thirdparty. Allowed if link is empty (Ex: contacts...).
{
// If external user: Check permission for external users
if ($user->socid > 0)
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index 46950bdc50c..31d4baa38f1 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -1451,7 +1451,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$newmenu->add("/asset/list.php?leftmenu=asset&mainmenu=accountancy", $langs->trans("MenuListAssets"), 1, $user->rights->asset->read);
$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuTypeAssets"), 1, $user->rights->asset->read, '', $mainmenu, 'asset_type');
if ($usemenuhider || empty($leftmenu) || preg_match('/asset_type/', $leftmenu)) {
- $newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->setup_advance));
+ $newmenu->add("/asset/type.php?leftmenu=asset_type&action=create", $langs->trans("MenuNewTypeAssets"), 2, $user->rights->asset->setup_advance);
$newmenu->add("/asset/type.php?leftmenu=asset_type", $langs->trans("MenuListTypeAssets"), 2, $user->rights->asset->read);
}
}
diff --git a/htdocs/core/modules/import/import_xlsx.modules.php b/htdocs/core/modules/import/import_xlsx.modules.php
index 6c0bcc0f4b1..5b2e339a588 100644
--- a/htdocs/core/modules/import/import_xlsx.modules.php
+++ b/htdocs/core/modules/import/import_xlsx.modules.php
@@ -173,7 +173,7 @@ class ImportXlsx extends ModeleImports
$this->workbook->getActiveSheet()->getStyle('1')->getFont()->setBold(true);
$this->workbook->getActiveSheet()->getStyle('1')->getAlignment()->setHorizontal(Alignment::HORIZONTAL_LEFT);
- $col = 0;
+ $col = 1;
foreach ($headerlinefields as $field) {
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, 1, $outputlangs->transnoentities($field));
// set autowidth
@@ -195,7 +195,7 @@ class ImportXlsx extends ModeleImports
public function write_record_example($outputlangs, $contentlinevalues)
{
// phpcs:enable
- $col = 0;
+ $col = 1;
$row = 2;
foreach ($contentlinevalues as $cell) {
$this->workbook->getActiveSheet()->SetCellValueByColumnAndRow($col, $row, $cell);
@@ -289,7 +289,7 @@ class ImportXlsx extends ModeleImports
$xlsx = new Xlsx();
$info = $xlsx->listWorksheetinfo($this->file);
$countcolumns = $info[0]['totalColumns'];
- for ($col = 0; $col < $countcolumns; $col++) {
+ for ($col = 1; $col <= $countcolumns; $col++) {
$this->headers[$col] = $this->workbook->getActiveSheet()->getCellByColumnAndRow($col, 1)->getValue();
}
return 0;
@@ -314,7 +314,7 @@ class ImportXlsx extends ModeleImports
$xlsx = new Xlsx();
$info = $xlsx->listWorksheetinfo($this->file);
$countcolumns = $info[0]['totalColumns'];
- for ($col = 0; $col < $countcolumns; $col++) {
+ for ($col = 1; $col <= $countcolumns; $col++) {
$val = $this->workbook->getActiveSheet()->getCellByColumnAndRow($col, $this->record)->getValue();
$array[$col]['val'] = $val;
$array[$col]['type'] = (dol_strlen($val) ? 1 : -1); // If empty we consider it null
@@ -372,7 +372,7 @@ class ImportXlsx extends ModeleImports
//var_dump($sort_array_match_file_to_database);
- if (count($arrayrecord) == 0 || (count($arrayrecord) == 1 && empty($arrayrecord[0]['val']))) {
+ if (count($arrayrecord) == 0 || (count($arrayrecord) == 1 && empty($arrayrecord[1]['val']))) {
//print 'W';
$this->warnings[$warning]['lib'] = $langs->trans('EmptyLine');
$this->warnings[$warning]['type'] = 'EMPTY';
@@ -420,7 +420,7 @@ class ImportXlsx extends ModeleImports
if ($key <= $maxfields) {
// Set $newval with value to insert and set $listvalues with sql request part for insert
$newval = '';
- if ($arrayrecord[($key - 1)]['type'] > 0) $newval = $arrayrecord[($key - 1)]['val']; // If type of field into input file is not empty string (so defined into input file), we get value
+ if ($arrayrecord[($key)]['type'] > 0) $newval = $arrayrecord[($key)]['val']; // If type of field into input file is not empty string (so defined into input file), we get value
// Make some tests on $newval
@@ -572,21 +572,21 @@ class ImportXlsx extends ModeleImports
$newval = $this->thirpartyobject->code_client;
//print 'code_client='.$newval;
}
- if (empty($newval)) $arrayrecord[($key - 1)]['type'] = -1; // If we get empty value, we will use "null"
+ if (empty($newval)) $arrayrecord[($key)]['type'] = -1; // If we get empty value, we will use "null"
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getsuppliercodeifauto') {
if (strtolower($newval) == 'auto') {
$newval = $this->thirpartyobject->get_codefournisseur(0, 1);
$newval = $this->thirpartyobject->code_fournisseur;
//print 'code_fournisseur='.$newval;
}
- if (empty($newval)) $arrayrecord[($key - 1)]['type'] = -1; // If we get empty value, we will use "null"
+ if (empty($newval)) $arrayrecord[($key)]['type'] = -1; // If we get empty value, we will use "null"
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getcustomeraccountancycodeifauto') {
if (strtolower($newval) == 'auto') {
$this->thirpartyobject->get_codecompta('customer');
$newval = $this->thirpartyobject->code_compta;
//print 'code_compta='.$newval;
}
- if (empty($newval)) $arrayrecord[($key - 1)]['type'] = -1; // If we get empty value, we will use "null"
+ if (empty($newval)) $arrayrecord[($key)]['type'] = -1; // If we get empty value, we will use "null"
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getsupplieraccountancycodeifauto') {
if (strtolower($newval) == 'auto') {
$this->thirpartyobject->get_codecompta('supplier');
@@ -594,7 +594,7 @@ class ImportXlsx extends ModeleImports
if (empty($newval)) $arrayrecord[($key - 1)]['type'] = -1; // If we get empty value, we will use "null"
//print 'code_compta_fournisseur='.$newval;
}
- if (empty($newval)) $arrayrecord[($key - 1)]['type'] = -1; // If we get empty value, we will use "null"
+ if (empty($newval)) $arrayrecord[($key)]['type'] = -1; // If we get empty value, we will use "null"
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'getrefifauto') {
$defaultref = '';
// TODO provide the $modTask (module of generation of ref) as parameter of import_insert function
@@ -624,7 +624,7 @@ class ImportXlsx extends ModeleImports
$errorforthistable++;
$error++;
} else {
- $newval = $arrayrecord[($key - 1)]['val']; //We get new value computed.
+ $newval = $arrayrecord[($key)]['val']; //We get new value computed.
}
} elseif ($objimport->array_import_convertvalue[0][$val]['rule'] == 'numeric') {
$newval = price2num($newval);
@@ -695,8 +695,8 @@ class ImportXlsx extends ModeleImports
$listfields[] = $fieldname;
// Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert
- if (empty($newval) && $arrayrecord[($key - 1)]['type'] < 0) $listvalues[] = ($newval == '0' ? $newval : "null");
- elseif (empty($newval) && $arrayrecord[($key - 1)]['type'] == 0) $listvalues[] = "''";
+ if (empty($newval) && $arrayrecord[($key)]['type'] < 0) $listvalues[] = ($newval == '0' ? $newval : "null");
+ elseif (empty($newval) && $arrayrecord[($key)]['type'] == 0) $listvalues[] = "''";
else $listvalues[] = "'" . $this->db->escape($newval) . "'";
}
$i++;
diff --git a/htdocs/core/modules/modAsset.class.php b/htdocs/core/modules/modAsset.class.php
index 50fe71ef390..9f20ae44f86 100644
--- a/htdocs/core/modules/modAsset.class.php
+++ b/htdocs/core/modules/modAsset.class.php
@@ -79,7 +79,7 @@ class modAsset extends DolibarrModules
// Data directories to create when module is enabled.
// Example: this->dirs = array("/asset/temp","/asset/subdir");
- $this->dirs = array();
+ $this->dirs = array("/asset/temp");
// Config pages. Put here list of php page, stored into asset/admin directory, to use to setup module.
$this->config_page_url = array("setup.php@asset");
diff --git a/htdocs/core/modules/modProduct.class.php b/htdocs/core/modules/modProduct.class.php
index f92d9b30890..78f638b1821 100644
--- a/htdocs/core/modules/modProduct.class.php
+++ b/htdocs/core/modules/modProduct.class.php
@@ -547,7 +547,7 @@ class modProduct extends DolibarrModules
// field order as per structure of table llx_product
$import_sample = array(
- 'p.ref' => "PREF123456",
+ 'p.ref' => "ref:PREF123456",
'p.datec' => dol_print_date(dol_now(), '%Y-%m-%d'),
'p.label' => "Product name in default language",
'p.description' => "Product description in default language",
@@ -687,7 +687,7 @@ class modProduct extends DolibarrModules
);
$this->import_examplevalues_array[$r] = array(
- 'sp.fk_product' => "PRODUCT_REF or id:123456",
+ 'sp.fk_product' => "ref:PRODUCT_REF or id:123456",
'sp.fk_soc' => "My Supplier",
'sp.ref_fourn' => "XYZ-F123456",
'sp.quantity' => "5",
@@ -749,13 +749,13 @@ class modProduct extends DolibarrModules
$this->import_convertvalue_array[$r] = array(
'pr.fk_product'=>array('rule'=>'fetchidfromref', 'classfile'=>'/product/class/product.class.php', 'class'=>'Product', 'method'=>'fetch', 'element'=>'Product')
);
- $this->import_examplevalues_array[$r] = array('pr.fk_product'=>"PRODUCT_REF or id:123456",
+ $this->import_examplevalues_array[$r] = array('pr.fk_product'=>"ref:PRODUCT_REF or id:123456",
'pr.price_base_type'=>"HT (for excl tax) or TTC (for inc tax)", 'pr.price_level'=>"1",
'pr.price'=>"100", 'pr.price_ttc'=>"110",
'pr.price_min'=>"100", 'pr.price_min_ttc'=>"110",
'pr.tva_tx'=>'20',
'pr.recuperableonly'=>'0',
- 'pr.date_price'=>'2013-04-10');
+ 'pr.date_price'=>'2020-12-31');
}
if (!empty($conf->global->MAIN_MULTILANGS))
diff --git a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php
index d2d77cf3b5c..bbc5ba3370b 100644
--- a/htdocs/core/tpl/extrafields_list_array_fields.tpl.php
+++ b/htdocs/core/tpl/extrafields_list_array_fields.tpl.php
@@ -1,6 +1,6 @@
'."\n";
+// This tpl file is included into the init part of pages, so before action.
+// So no output must be done.
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf))
diff --git a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
index ee576992865..a903ab53b23 100644
--- a/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
+++ b/htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
@@ -47,7 +47,7 @@ class InterfaceContactRoles extends DolibarrTriggers
$this->description = "Triggers of this module auto link contact to company.";
// 'development', 'experimental', 'dolibarr' or version
$this->version = self::VERSION_DOLIBARR;
- $this->picto = 'action';
+ $this->picto = 'company';
}
/**
diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php
index 15e82cd4529..63557b91e05 100644
--- a/htdocs/fourn/facture/card.php
+++ b/htdocs/fourn/facture/card.php
@@ -2513,7 +2513,12 @@ if ($action == 'create')
$discount = new DiscountAbsolute($db);
$result = $discount->fetch(0, 0, $object->id);
if ($result > 0) {
- print ' '.$langs->trans("CreditNoteConvertedIntoDiscount", $object->getLibType(1), $discount->getNomUrl(1, 'discount')).' ';
+ print ' ';
+ $s = $langs->trans("CreditNoteConvertedIntoDiscount", '{s1}', '{s2}');
+ $s = str_replace('{s1}', $object->getLibType(1), $s);
+ $s = str_replace('{s2}', $discount->getNomUrl(1, 'discount'), $s);
+ print $s;
+ print ' ';
}
}
print '';
diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php
index 355b84796f2..a69b450fa84 100644
--- a/htdocs/fourn/paiement/card.php
+++ b/htdocs/fourn/paiement/card.php
@@ -40,10 +40,19 @@ $confirm = GETPOST('confirm', 'alpha');
$object = new PaiementFourn($db);
-// PDF
-$hidedetails = (GETPOST('hidedetails', 'int') ? GETPOST('hidedetails', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DETAILS) ? 1 : 0));
-$hidedesc = (GETPOST('hidedesc', 'int') ? GETPOST('hidedesc', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC) ? 1 : 0));
-$hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0));
+// Load object
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+
+$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', '');
+
+// Security check
+if ($user->socid) $socid = $user->socid;
+// Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
+// It should be enough because all payments are done on invoices of the same thirdparty.
+if ($socid && $socid != $object->thirdparty->id) {
+ accessforbidden();
+}
+
/*
* Actions
@@ -177,41 +186,46 @@ if ($result > 0)
print '';
/*print '';
- print ''.$langs->trans('Ref').' ';
+ print ' '.$langs->trans('Ref').' ';
print $form->showrefnav($object,'id','',1,'rowid','ref');
print ' ';*/
// Date of payment
- print ''.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer).' ';
+ print ' '.$form->editfieldkey("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer).' ';
+ print '';
print $form->editfieldval("Date", 'datep', $object->date, $object, $object->statut == 0 && $user->rights->fournisseur->facture->creer, 'datehourpicker', '', null, $langs->trans('PaymentDateUpdateSucceeded'));
print ' ';
// Payment mode
$labeltype = $langs->trans("PaymentType".$object->type_code) != ("PaymentType".$object->type_code) ? $langs->trans("PaymentType".$object->type_code) : $object->type_label;
- print ''.$langs->trans('PaymentMode').' '.$labeltype;
+ print ' '.$langs->trans('PaymentMode').' ';
+ print ''.$labeltype;
print $object->num_payment ? ' - '.$object->num_payment : '';
print ' ';
// Payment numero
/* TODO Add field num_payment into payment table and save it
- print ''.$form->editfieldkey("Numero",'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).' ';
+ print ' '.$form->editfieldkey("Numero",'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer).' ';
+ print '';
print $form->editfieldval("Numero",'num_paiement',$object->num_paiement,$object,$object->statut == 0 && $user->rights->fournisseur->facture->creer,'string','',null,$langs->trans('PaymentNumberUpdateSucceeded'));
print ' ';
*/
// Amount
- print ''.$langs->trans('Amount').' '.price($object->amount, '', $langs, 0, 0, -1, $conf->currency).' ';
+ print ''.$langs->trans('Amount').' ';
+ print ''.price($object->amount, '', $langs, 0, 0, -1, $conf->currency).' ';
if (!empty($conf->global->BILL_ADD_PAYMENT_VALIDATION))
{
- print ''.$langs->trans('Status').' '.$object->getLibStatut(4).' ';
+ print ''.$langs->trans('Status').' ';
+ print ''.$object->getLibStatut(4).' ';
}
$allow_delete = 1;
// Bank account
if (!empty($conf->banque->enabled))
{
- if ($object->bank_account)
+ if ($object->fk_account)
{
$bankline = new AccountLine($db);
$bankline->fetch($object->bank_line);
@@ -222,8 +236,8 @@ if ($result > 0)
}
print '';
- print ''.$langs->trans('BankAccount').' ';
- print '';
+ print ' '.$langs->trans('BankAccount').' ';
+ print '';
$accountstatic = new Account($db);
$accountstatic->fetch($bankline->fk_account);
print $accountstatic->getNomUrl(1);
@@ -231,8 +245,8 @@ if ($result > 0)
print ' ';
print '';
- print ''.$langs->trans('BankTransactionLine').' ';
- print '';
+ print ' '.$langs->trans('BankTransactionLine').' ';
+ print '';
print $bankline->getNomUrl(1, 0, 'showconciliated');
print ' ';
print ' ';
@@ -240,7 +254,8 @@ if ($result > 0)
}
// Note
- print ''.$form->editfieldkey("Note", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer).' ';
+ print ' '.$form->editfieldkey("Comments", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer).' ';
+ print '';
print $form->editfieldval("Note", 'note', $object->note, $object, $user->rights->fournisseur->facture->creer, 'textarea');
print ' ';
diff --git a/htdocs/fourn/paiement/info.php b/htdocs/fourn/paiement/info.php
index 97ac2343c23..9ff0a86931e 100644
--- a/htdocs/fourn/paiement/info.php
+++ b/htdocs/fourn/paiement/info.php
@@ -33,8 +33,26 @@ $langs->loadLangs(array("bills", "suppliers", "companies"));
$id = GETPOST('id', 'int');
$object = new PaiementFourn($db);
-$object->fetch($id);
-$object->info($id);
+
+// Load object
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+
+$result = restrictedArea($user, $object->element, $object->id, 'paiementfourn', '');
+
+// Security check
+if ($user->socid) $socid = $user->socid;
+// Now check also permission on thirdparty of invoices of payments. Thirdparty were loaded by the fetch_object before based on first invoice.
+// It should be enough because all payments are done on invoices of the same thirdparty.
+if ($socid && $socid != $object->thirdparty->id) {
+ accessforbidden();
+}
+
+
+/*
+ * Actions
+ */
+
+// None
/*
@@ -43,10 +61,14 @@ $object->info($id);
llxHeader();
+$object->info($id);
+
$head = payment_supplier_prepare_head($object);
print dol_get_fiche_head($head, 'info', $langs->trans("SupplierPayment"), 0, 'payment');
+$linkback = ''.$langs->trans("BackToList").' ';
+
dol_banner_tab($object, 'id', $linkback, -1, 'rowid', 'ref');
print dol_get_fiche_end();
diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php
index 3fca286eff0..1bf8984a6ee 100644
--- a/htdocs/fourn/paiement/list.php
+++ b/htdocs/fourn/paiement/list.php
@@ -178,7 +178,7 @@ if ($search_all) $sql .= natural_search(array_keys($fieldstosearchall), $search_
// Add where from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
-$sql .= ' GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label';
+$sql .= ' GROUP BY p.rowid, p.ref, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, s.email, c.code, c.libelle, ba.rowid, ba.label';
if (!$user->rights->societe->client->voir) $sql .= ', sc.fk_soc, sc.fk_user';
$sql .= $db->order($sortfield, $sortorder);
diff --git a/htdocs/install/mysql/data/llx_c_actioncomm.sql b/htdocs/install/mysql/data/llx_c_actioncomm.sql
index 9a0d8c223b6..cb22ee70ce3 100644
--- a/htdocs/install/mysql/data/llx_c_actioncomm.sql
+++ b/htdocs/install/mysql/data/llx_c_actioncomm.sql
@@ -30,7 +30,7 @@
-- Types action comm
--
-delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,10,30,31,40,50);
+delete from llx_c_actioncomm where id in (1,2,3,4,5,6,8,9,10,11,30,31,40,50);
-- Code used from 3.3+ when type of event is used
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 1,'AC_TEL','system','Phone call',NULL, 1, 2);
insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 2,'AC_FAX','system','Send Fax',NULL, 1, 3);
diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
index 4c8adf5282e..a19f8d34279 100644
--- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
+++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql
@@ -576,3 +576,6 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value
-- Removed no more used function
-- VPGSQL8.2 DROP FUNCTION IF EXISTS update_modified_column_date_m CASCADE;
+
+insert into llx_c_actioncomm (id, code, type, libelle, module, active, position) values ( 6,'AC_EMAIL_IN','system','reception Email',NULL, 1, 4);
+
diff --git a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql
index ded61d49e8b..5749acd93d8 100644
--- a/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql
+++ b/htdocs/install/mysql/tables/llx_recruitment_recruitmentcandidature.sql
@@ -37,7 +37,7 @@ CREATE TABLE llx_recruitment_recruitmentcandidature(
date_birth date,
remuneration_requested integer,
remuneration_proposed integer,
- email_msgid varchar(255),
+ email_msgid varchar(175), -- Do not use a too large value, it generates trouble with unique index
fk_recruitment_origin INTEGER NULL
-- END MODULEBUILDER FIELDS
) ENGINE=innodb;
diff --git a/htdocs/langs/en_US/assets.lang b/htdocs/langs/en_US/assets.lang
index ef04723c6c2..afafc98503f 100644
--- a/htdocs/langs/en_US/assets.lang
+++ b/htdocs/langs/en_US/assets.lang
@@ -61,5 +61,7 @@ MenuListTypeAssets = List
#
# Module
#
+Asset=Asset
NewAssetType=New asset type
NewAsset=New asset
+ConfirmDeleteAsset=Are you sure you want to delete this asset ?
diff --git a/htdocs/langs/en_US/cashdesk.lang b/htdocs/langs/en_US/cashdesk.lang
index 88ff8fecdb6..7263b04730a 100644
--- a/htdocs/langs/en_US/cashdesk.lang
+++ b/htdocs/langs/en_US/cashdesk.lang
@@ -56,7 +56,8 @@ Paymentnumpad=Type of Pad to enter payment
Numberspad=Numbers Pad
BillsCoinsPad=Coins and banknotes Pad
DolistorePosCategory=TakePOS modules and other POS solutions for Dolibarr
-TakeposNeedsCategories=TakePOS needs product categories to work
+TakeposNeedsCategories=TakePOS needs at least one product categorie to work
+TakeposNeedsAtLeastOnSubCategoryIntoParentCategory=TakePOS needs at least 1 product category under the category %s to work
OrderNotes=Order Notes
CashDeskBankAccountFor=Default account to use for payments in
NoPaimementModesDefined=No paiment mode defined in TakePOS configuration
diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php
index ef7a6da8d66..78b9f5f7cb9 100644
--- a/htdocs/modulebuilder/template/myobject_card.php
+++ b/htdocs/modulebuilder/template/myobject_card.php
@@ -114,9 +114,9 @@ $upload_dir = $conf->mymodule->multidir_output[isset($object->entity) ? $object-
//if ($user->socid > 0) accessforbidden();
//if ($user->socid > 0) $socid = $user->socid;
//$isdraft = (($object->statut == $object::STATUS_DRAFT) ? 1 : 0);
-//$result = restrictedArea($user, 'mymodule', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
+//$result = restrictedArea($user, $object->element, $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
-//if (!$permissiontoread) accessforbidden();
+//if (empty($permissiontoread)) accessforbidden();
/*
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index d66d7338bfd..51e53cceca8 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -402,7 +402,7 @@ if ($id > 0 || $ref)
print '';
print '
';
- print '
';
+ print '';
// Cost price. Can be used for margin module for option "calculate margin on explicit cost price
print '';
@@ -415,14 +415,14 @@ if ($id > 0 || $ref)
print ' ';
// PMP
- print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).' ';
+ print ''.$form->textwithpicto($langs->trans("AverageUnitPricePMPShort"), $langs->trans("AverageUnitPricePMPDesc")).' ';
print '';
if ($object->pmp > 0) print price($object->pmp).' '.$langs->trans("HT");
print ' ';
print ' ';
// Best buying Price
- print ''.$langs->trans("BuyingPriceMin").' ';
+ print ''.$langs->trans("BuyingPriceMin").' ';
print '';
$product_fourn = new ProductFournisseur($db);
if ($product_fourn->find_min_price_product_fournisseur($object->id) > 0)
@@ -462,7 +462,7 @@ if ($id > 0 || $ref)
print '';
// Supplier
- print ''.$langs->trans("Supplier").' ';
+ print ' '.$langs->trans("Supplier").' ';
if ($rowid)
{
$supplier = new Fournisseur($db);
@@ -729,7 +729,7 @@ END;
// Option to define a transport cost on supplier price
print ' ';
print ''.$langs->trans('BarcodeValue').' ';
- print ' ';
+ print ''.img_picto('', 'barcode', 'class="pictofixedwidth"').' ';
print ' ';
$formbarcode = new FormBarCode($db);
diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php
index f58886c9a3b..c6e9799afa7 100644
--- a/htdocs/projet/class/project.class.php
+++ b/htdocs/projet/class/project.class.php
@@ -241,7 +241,7 @@ class Project extends CommonObject
if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) $this->fields['rowid']['visible'] = 0;
- if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
+ if (empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
$this->fields['fk_opp_status']['enabled'] = 0;
$this->fields['opp_percent']['enabled'] = 0;
$this->fields['opp_amount']['enabled'] = 0;
diff --git a/htdocs/theme/eldy/doc/badges.php b/htdocs/public/test/badges.php
similarity index 97%
rename from htdocs/theme/eldy/doc/badges.php
rename to htdocs/public/test/badges.php
index 52a422a053c..8d5a382af03 100644
--- a/htdocs/theme/eldy/doc/badges.php
+++ b/htdocs/public/test/badges.php
@@ -9,9 +9,13 @@ if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
session_cache_limiter('public');
-require_once '../../../main.inc.php';
+require_once '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
+if ($dolibarr_main_prod) {
+ accessforbidden();
+}
+
?>
@@ -19,13 +23,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
-
-
-
+
-
-
+
+
Badges
Documentation and examples for badges, our small count and labeling component.
@@ -33,7 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
Example
Badges scale to match the size of the immediate parent element by using relative font sizing and em units.
-
+
Example heading New
Example heading New
@@ -42,39 +44,39 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
Example heading New
Example heading New
-
+
-
+
<h1>Example heading <span class="badge badge-secondary">New</span></h1>
<h2>Example heading <span class="badge badge-secondary">New</span></h2>
<h3>Example heading <span class="badge badge-secondary">New</span></h3>
<h4>Example heading <span class="badge badge-secondary">New</span></h4>
<h5>Example heading <span class="badge badge-secondary">New</span></h5>
<h6>Example heading <span class="badge badge-secondary">New</span></h6>
-
+
-
+
Badges can be used as part of links or buttons to provide a counter.
-
+
Notifications 4
-
+
<button type="button" class="button">
Notifications <span class="badge badge-primary">4</span>
</button>
-
-
+
+
Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.
-
+
Unless the context is clear (as with the “Notifications” example, where it is understood that the “4” is the number of notifications), consider including additional context with a visually hidden piece of additional text.
-
+
Remember to use aria-label attribute for accessibility in Dolibarr. Don't forget to use aria-hidden on icons included in badges
@@ -84,26 +86,26 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
unread messages
-
+
-
-
+
+
<button type="button" class="btn btn-primary">
Profile <span class="badge badge-light" aria-label="9 unread messages" >9</span>
<span class="sr-only">unread messages</span>
</button>
-
-
+
+
-
+
Contextual variations
-
+
Add any of the below mentioned modifier classes to change the appearance of a badge.
-
+
-
+
Primary
Secondary
Success
@@ -113,10 +115,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
Light
Dark
-
+
-
+
<span class="badge badge-primary">Primary</span>
<span class="badge badge-secondary">Secondary</span>
<span class="badge badge-success">Success</span>
@@ -125,22 +127,22 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="badge badge-info">Info</span>
<span class="badge badge-light">Light</span>
<span class="badge badge-dark">Dark</span>
-
+
-
+
Conveying meaning to assistive technologies
-
+
Using color to add meaning only provides a visual indication, which will not be conveyed to users of assistive technologies – such as screen readers. Ensure that information denoted by the color is either obvious from the content itself (e.g. the visible text), or is included through alternative means, such as additional text hidden with the .sr-only class.
-
-
+
+
Default status
-
+
Add any of the below mentioned modifier classes to change the appearance of a badge to be linked to a default status.
-
+
status-
@@ -152,14 +154,14 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="badge badge-status" >status</span>
-
-
+
+
Pill badges
-
+
Use the .badge-pill modifier class to make badges more rounded (with a larger border-radius and additional horizontal padding).
-
+
-
+
Primary
Secondary
Success
@@ -168,16 +170,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
Info
Light
Dark
-
+
status
-
+
-
+
-
+
<span class="badge badge-pill badge-primary">Primary</span>
<span class="badge badge-pill badge-secondary">Secondary</span>
<span class="badge badge-pill badge-success">Success</span>
@@ -190,15 +192,15 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="badge badge-pill badge-status" >status</span>
-
-
-
+
+
+
Dot badges
-
+
.dot-pill modifier class to make badges circle.
-
+
-
+
@@ -207,16 +209,16 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
-
+
-
+
-
+
-
+
<span class="badge badge-dot badge-primary"></span>
<span class="badge badge-dot badge-secondary"></span>
<span class="badge badge-dot badge-success"></span>
@@ -229,23 +231,23 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<span class="badge badge-dot badge-status" ></span>
-
-
-
+
+
+
Note that depending on how they are used, badges may be confusing for users of screen readers and similar assistive technologies. While the styling of badges provides a visual cue as to their purpose, these users will simply be presented with the content of the badge. Depending on the specific situation, these badges may seem like random additional words or numbers at the end of a sentence, link, or button.
-
+
Unless the context is clear (as with the “Notifications” example, where it is understood that the “4” is the number of notifications), consider including additional context with a visually hidden piece of additional text.
-
+
Remember to use aria-label attribute for accessibility in Dolibarr. Don't forget to use aria-hidden on icons included in badges
-
-
-
+
+
+
Links
-
+
Using the contextual .badge-* classes on an <a> element quickly provide actionable badges with hover and focus states.
-
+
-
+
<a href="#" class="badge badge-primary">Primary</a>
<a href="#" class="badge badge-secondary">Secondary</a>
@@ -280,12 +282,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
with html ', 'primary') ?>
with html ', 'danger', 'pill') ?>
with html ', 'warning', 'dot') ?>
-
+
<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'danger', 'pill') ?>
<?php print dolGetBadge('your label for accessibility', 'your label <u>with</u> <em>html</em>', 'warning', 'dot') ?>
-
+
Use status helper function
Using the dolGetStatus function provide in core/lib/functions.lib.php. This function is recommended for code uniformisation and easy maintain
with html ', 'status4', 6) ?>
global->MAIN_STATUS_USES_CSS = $saveGlobalConf; ?>
-
-
+
+
<?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4') ?>
<?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',1) ?>
@@ -323,8 +325,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
<?php print dolGetStatus('your label for accessibility', 'your label', 'your label <u>with</u> <em>html</em>', 'status4',6) ?>
-
+
-
+
\ No newline at end of file
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 7c470d880ca..21f4f4e78fb 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -1099,14 +1099,18 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
$("#radiocompany").click(function() {
$(".individualline").hide();
$("#typent_id").val(0);
+ $("#typent_id").change();
$("#effectif_id").val(0);
+ $("#effectif_id").change();
$("#TypeName").html(document.formsoc.ThirdPartyName.value);
document.formsoc.private.value=0;
});
$("#radioprivate").click(function() {
$(".individualline").show();
$("#typent_id").val(id_te_private);
+ $("#typent_id").change();
$("#effectif_id").val(id_ef15);
+ $("#effectif_id").change();
$("#TypeName").html(document.formsoc.LastName.value);
document.formsoc.private.value=1;
});
diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php
index 43077495238..f50d0099263 100644
--- a/htdocs/support/inc.php
+++ b/htdocs/support/inc.php
@@ -133,9 +133,9 @@ define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
if (empty($character_set_client)) $character_set_client = "UTF-8";
$conf->file->character_set_client = strtoupper($character_set_client);
-if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set = ($conf->db->type == 'mysql' ? 'latin1' : ''); // Old installation
+if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set = ($conf->db->type == 'mysqli' ? 'utf8' : ''); // Old installation
$conf->db->character_set = $dolibarr_main_db_character_set;
-if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation = ($conf->db->type == 'mysql' ? 'latin1_swedish_ci' : ''); // Old installation
+if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation = ($conf->db->type == 'mysqli' ? 'utf8_unicode_ci' : ''); // Old installation
$conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation;
if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption = 0;
$conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 8062368d360..172f95c5c3d 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -140,6 +140,7 @@ if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0)
}
}
}
+
$levelofmaincategories = $levelofrootcategory + 1;
$maincategories = array();
@@ -961,7 +962,13 @@ if (empty($paiementsModes)) {
setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
}
if (count($maincategories) == 0) {
- setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors');
+ if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
+ $tmpcategory = new Categorie($db);
+ $tmpcategory->fetch($conf->global->TAKEPOS_ROOT_CATEGORY_ID);
+ setEventMessages($langs->trans("TakeposNeedsAtLeastOnSubCategoryIntoParentCategory", $tmpcategory->label), null, 'errors');
+ } else {
+ setEventMessages($langs->trans("TakeposNeedsCategories"), null, 'errors');
+ }
}
// User menu and external TakePOS modules
$menus = array();
diff --git a/htdocs/theme/eldy/doc/doc.css b/htdocs/theme/eldy/doc/doc.css
deleted file mode 100644
index a8908185d17..00000000000
--- a/htdocs/theme/eldy/doc/doc.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Simple css for Doc page */
-body.docpage{
- background: #fff;
- padding:20px;
-}
\ No newline at end of file
diff --git a/htdocs/theme/eldy/manifest.json.php b/htdocs/theme/eldy/manifest.json.php
index d7f01b3375e..7aa04694b33 100644
--- a/htdocs/theme/eldy/manifest.json.php
+++ b/htdocs/theme/eldy/manifest.json.php
@@ -35,6 +35,7 @@ if (!defined('NOLOGIN')) define('NOLOGIN', '1');
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
+if (!defined('NOSESSION')) define('NOSESSION', '1');
require_once __DIR__.'/../../main.inc.php';
@@ -42,6 +43,15 @@ $appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
top_httphead('text/json');
+// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
+if (empty($dolibarr_nocache)) {
+ header('Cache-Control: max-age=10800, public, must-revalidate');
+ // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
+ header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT');
+}
+else {
+ header('Cache-Control: no-cache');
+}
?>
{
diff --git a/htdocs/theme/md/manifest.json.php b/htdocs/theme/md/manifest.json.php
index 03c5894fdde..6051ff260ef 100644
--- a/htdocs/theme/md/manifest.json.php
+++ b/htdocs/theme/md/manifest.json.php
@@ -35,6 +35,7 @@ if (!defined('NOLOGIN')) define('NOLOGIN', '1');
if (!defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1');
if (!defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1');
if (!defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1');
+if (!defined('NOSESSION')) define('NOSESSION', '1');
require_once __DIR__.'/../../main.inc.php';
@@ -42,6 +43,15 @@ $appli = constant('DOL_APPLICATION_TITLE');
if (!empty($conf->global->MAIN_APPLICATION_TITLE)) $appli = $conf->global->MAIN_APPLICATION_TITLE;
top_httphead('text/json');
+// Important: Following code is to avoid page request by browser and PHP CPU at each Dolibarr page access.
+if (empty($dolibarr_nocache)) {
+ header('Cache-Control: max-age=10800, public, must-revalidate');
+ // For a text/json, we must set an Expires to avoid to have it forced to an expired value by the web server
+ header('Expires: '.gmdate('D, d M Y H:i:s', dol_now('gmt') + 10800) . ' GMT');
+}
+else {
+ header('Cache-Control: no-cache');
+}
?>
{
diff --git a/test/phpunit/ImportTest.php b/test/phpunit/ImportTest.php
index e9bf019740c..32970f6fe1c 100644
--- a/test/phpunit/ImportTest.php
+++ b/test/phpunit/ImportTest.php
@@ -142,6 +142,10 @@ class ImportTest extends PHPUnit\Framework\TestCase
// according to option
$this->assertEquals(0, 0);
+ // TODO Export and compare the file exported with the $file imported.
+
+
+
return true;
}
}