'.$langs->trans("Categories").' ';
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACCOUNT, '', 'parent', 64, 0, 1);
$c = new Categorie($db);
$cats = $c->containing($object->id, Categorie::TYPE_ACCOUNT);
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index e44c0411bea..19a040bf091 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -289,6 +289,12 @@ if (!empty($search_ref_customer)) {
if (!empty($search_ref_supplier)) {
$sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
}
+if ($search_zip) {
+ $sql .= natural_search(array('s.zip'), $search_zip);
+}
+if ($search_town) {
+ $sql .= natural_search(array('s.town'), $search_town);
+}
if ($search_sale > 0) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
}
diff --git a/htdocs/core/boxes/box_accountancy_last_manual_entries.php b/htdocs/core/boxes/box_accountancy_last_manual_entries.php
index 123f9894e1e..b1e4a637046 100644
--- a/htdocs/core/boxes/box_accountancy_last_manual_entries.php
+++ b/htdocs/core/boxes/box_accountancy_last_manual_entries.php
@@ -116,7 +116,7 @@ class box_accountancy_last_manual_entries extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
+ 'td' => 'class="center nowraponall"',
'text' => dol_print_date($date, 'day'),
'asis' => 1,
);
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index e14fdfcb457..45c9d580ad2 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -161,8 +161,8 @@ class box_actions extends ModeleBoxes
);
$this->info_box_contents[$line][2] = array(
- 'td' => 'class="nowrap left"',
- 'text' => dol_print_date($datelimite, "dayhour"),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datelimite, "dayhour", 'tzuserrel'),
'asis' => 1
);
diff --git a/htdocs/core/boxes/box_birthdays.php b/htdocs/core/boxes/box_birthdays.php
index d6e6296a3cc..62cfaa590ab 100644
--- a/htdocs/core/boxes/box_birthdays.php
+++ b/htdocs/core/boxes/box_birthdays.php
@@ -118,8 +118,8 @@ class box_birthdays extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($dateb, "day").' - '.$age.' '.$langs->trans('DurationYears')
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($dateb, "day", 'gmt').' - '.$age.' '.$langs->trans('DurationYears')
);
/*$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_birthdays_members.php b/htdocs/core/boxes/box_birthdays_members.php
index 4d367a223e2..5e772ff3593 100644
--- a/htdocs/core/boxes/box_birthdays_members.php
+++ b/htdocs/core/boxes/box_birthdays_members.php
@@ -115,8 +115,8 @@ class box_birthdays_members extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($dateb, "day").' - '.$age.' '.$langs->trans('DurationYears')
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($dateb, "day", 'gmt').' - '.$age.' '.$langs->trans('DurationYears')
);
/*$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_boms.php b/htdocs/core/boxes/box_boms.php
index d0a169321d0..ae0877c0369 100644
--- a/htdocs/core/boxes/box_boms.php
+++ b/htdocs/core/boxes/box_boms.php
@@ -143,7 +143,7 @@ class box_boms extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datem, 'day'),
+ 'text' => dol_print_date($datem, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php
index 56b8fa089a3..df56b510823 100644
--- a/htdocs/core/boxes/box_clients.php
+++ b/htdocs/core/boxes/box_clients.php
@@ -134,8 +134,8 @@ class box_clients extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, "day")
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, "day", 'tzuserrel')
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index eac431918b2..6583673f8ca 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -180,7 +180,7 @@ class box_commandes extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($date, 'day'),
+ 'text' => dol_print_date($date, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php
index bd69ddc0108..fada6a93bfd 100644
--- a/htdocs/core/boxes/box_contacts.php
+++ b/htdocs/core/boxes/box_contacts.php
@@ -161,7 +161,7 @@ class box_contacts extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datem, "day"),
+ 'text' => dol_print_date($datem, "day", 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php
index ad19184691c..9d7b625db91 100644
--- a/htdocs/core/boxes/box_contracts.php
+++ b/htdocs/core/boxes/box_contracts.php
@@ -156,7 +156,7 @@ class box_contracts extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datec, 'day'),
+ 'text' => dol_print_date($datec, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_external_rss.php b/htdocs/core/boxes/box_external_rss.php
index 7bf8a69ed03..aff48328edb 100644
--- a/htdocs/core/boxes/box_external_rss.php
+++ b/htdocs/core/boxes/box_external_rss.php
@@ -150,7 +150,7 @@ class box_external_rss extends ModeleBoxes
//$item['atom_content']
}
if (is_numeric($date)) {
- $date = dol_print_date($date, "dayhour");
+ $date = dol_print_date($date, "dayhour", 'tzuserrel');
}
$isutf8 = utf8_check($title);
diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php
index 9ef12a9b8f6..2a97d738cd8 100644
--- a/htdocs/core/boxes/box_factures.php
+++ b/htdocs/core/boxes/box_factures.php
@@ -163,7 +163,7 @@ class box_factures extends ModeleBoxes
$late = '';
if ($facturestatic->hasDelay()) {
- $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day')));
+ $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel')));
}
$this->info_box_contents[$line][] = array(
@@ -186,7 +186,7 @@ class box_factures extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($date, 'day'),
+ 'text' => dol_print_date($date, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php
index a2ce199faee..a5d63c7b9c3 100644
--- a/htdocs/core/boxes/box_factures_fourn.php
+++ b/htdocs/core/boxes/box_factures_fourn.php
@@ -159,7 +159,7 @@ class box_factures_fourn extends ModeleBoxes
$late = '';
if ($facturestatic->hasDelay()) {
- $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day')));
+ $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel')));
}
$this->info_box_contents[$line][] = array(
@@ -189,7 +189,7 @@ class box_factures_fourn extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($date, 'day'),
+ 'text' => dol_print_date($date, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php
index aea07802fdf..9c35055011d 100644
--- a/htdocs/core/boxes/box_factures_fourn_imp.php
+++ b/htdocs/core/boxes/box_factures_fourn_imp.php
@@ -150,7 +150,7 @@ class box_factures_fourn_imp extends ModeleBoxes
$late = '';
if ($facturestatic->hasDelay()) {
- $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day')));
+ $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel')));
}
$tooltip = $langs->trans('SupplierInvoice').': '.($objp->ref ? $objp->ref : $objp->facid).' '.$langs->trans('RefSupplier').': '.$objp->ref_supplier;
@@ -175,7 +175,7 @@ class box_factures_fourn_imp extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datelimite, 'day'),
+ 'text' => dol_print_date($datelimite, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php
index 1830dcd5c7a..391fc2e7cd0 100644
--- a/htdocs/core/boxes/box_factures_imp.php
+++ b/htdocs/core/boxes/box_factures_imp.php
@@ -165,7 +165,7 @@ class box_factures_imp extends ModeleBoxes
$late = '';
if ($facturestatic->hasDelay()) {
- $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day')));
+ $late = img_warning(sprintf($l_due_date, dol_print_date($datelimite, 'day', 'tzuserrel')));
}
$this->info_box_contents[$line][] = array(
@@ -188,7 +188,7 @@ class box_factures_imp extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datelimite, 'day'),
+ 'text' => dol_print_date($datelimite, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php
index 94d081483e2..edf4daa5191 100644
--- a/htdocs/core/boxes/box_ficheinter.php
+++ b/htdocs/core/boxes/box_ficheinter.php
@@ -145,7 +145,7 @@ class box_ficheinter extends ModeleBoxes
$this->info_box_contents[$i][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datec, 'day'),
+ 'text' => dol_print_date($datec, 'day', 'tzuserrel'),
);
$this->info_box_contents[$i][] = array(
diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php
index d8b7f30c103..b0d5a0774fc 100644
--- a/htdocs/core/boxes/box_fournisseurs.php
+++ b/htdocs/core/boxes/box_fournisseurs.php
@@ -128,8 +128,8 @@ class box_fournisseurs extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, "day"),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, "day", 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_goodcustomers.php b/htdocs/core/boxes/box_goodcustomers.php
index 3a4f7e63103..aef7cdc9f3d 100644
--- a/htdocs/core/boxes/box_goodcustomers.php
+++ b/htdocs/core/boxes/box_goodcustomers.php
@@ -126,8 +126,8 @@ class box_goodcustomers extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, "day")
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, "day", 'tzuserrel')
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_last_modified_ticket.php b/htdocs/core/boxes/box_last_modified_ticket.php
index 320a23f745b..4d5097e23ba 100644
--- a/htdocs/core/boxes/box_last_modified_ticket.php
+++ b/htdocs/core/boxes/box_last_modified_ticket.php
@@ -162,7 +162,7 @@ class box_last_modified_ticket extends ModeleBoxes
// Date creation
$this->info_box_contents[$i][$r] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datec, 'dayhour')
+ 'text' => dol_print_date($datec, 'dayhour', 'tzuserrel')
);
$r++;
diff --git a/htdocs/core/boxes/box_last_ticket.php b/htdocs/core/boxes/box_last_ticket.php
index 8a0e3822448..e08a54f1c87 100644
--- a/htdocs/core/boxes/box_last_ticket.php
+++ b/htdocs/core/boxes/box_last_ticket.php
@@ -166,7 +166,7 @@ class box_last_ticket extends ModeleBoxes
// Date creation
$this->info_box_contents[$i][$r] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($datec, 'dayhour'),
+ 'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'),
);
$r++;
diff --git a/htdocs/core/boxes/box_lastlogin.php b/htdocs/core/boxes/box_lastlogin.php
index a487ec5bc72..e5e11d9ba8f 100644
--- a/htdocs/core/boxes/box_lastlogin.php
+++ b/htdocs/core/boxes/box_lastlogin.php
@@ -93,7 +93,7 @@ class box_lastlogin extends ModeleBoxes
'text' => $langs->trans("PreviousConnexion"),
);
if ($user->datepreviouslogin) {
- $tmp = dol_print_date($user->datepreviouslogin, "dayhour", 'tzuser');
+ $tmp = dol_print_date($user->datepreviouslogin, "dayhour", 'tzuserrel');
} else {
$tmp = $langs->trans("Unknown");
}
diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php
index acd3773d2f0..5865cba2530 100644
--- a/htdocs/core/boxes/box_members.php
+++ b/htdocs/core/boxes/box_members.php
@@ -145,8 +145,8 @@ class box_members extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, "day"),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, "day", 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_members_last_modified.php b/htdocs/core/boxes/box_members_last_modified.php
index 1315ac9895b..9de6a3af12f 100644
--- a/htdocs/core/boxes/box_members_last_modified.php
+++ b/htdocs/core/boxes/box_members_last_modified.php
@@ -147,8 +147,8 @@ class box_members_last_modified extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, "day"),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, "day", 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_members_last_subscriptions.php b/htdocs/core/boxes/box_members_last_subscriptions.php
index e08bc1073b6..3cea44c2dc3 100644
--- a/htdocs/core/boxes/box_members_last_subscriptions.php
+++ b/htdocs/core/boxes/box_members_last_subscriptions.php
@@ -158,7 +158,7 @@ class box_members_last_subscriptions extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right tdoverflowmax150 maxwidth150onsmartphone"',
- 'text' => dol_print_date($this->db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour'),
+ 'text' => dol_print_date($this->db->jdate($obj->datem ? $obj->datem : $obj->datec), 'dayhour', 'tzuserrel'),
);
$line++;
diff --git a/htdocs/core/boxes/box_members_subscriptions_by_year.php b/htdocs/core/boxes/box_members_subscriptions_by_year.php
index b6c146312bc..be835511c6b 100644
--- a/htdocs/core/boxes/box_members_subscriptions_by_year.php
+++ b/htdocs/core/boxes/box_members_subscriptions_by_year.php
@@ -111,7 +111,7 @@ class box_members_subscriptions_by_year extends ModeleBoxes
$i = 0;
while ($i < $num) {
$objp = $this->db->fetch_object($result);
- $year = dol_print_date($this->db->jdate($objp->dateh), "%Y");
+ $year = dol_print_date($this->db->jdate($objp->dateh), "%Y", 'gmt');
$Total[$year] = (isset($Total[$year]) ? $Total[$year] : 0) + $objp->subscription;
$Number[$year] = (isset($Number[$year]) ? $Number[$year] : 0) + 1;
$tot += $objp->subscription;
diff --git a/htdocs/core/boxes/box_mos.php b/htdocs/core/boxes/box_mos.php
index b12506147bf..43d1cd411e4 100644
--- a/htdocs/core/boxes/box_mos.php
+++ b/htdocs/core/boxes/box_mos.php
@@ -138,8 +138,8 @@ class box_mos extends ModeleBoxes
}
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, 'day'),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php
index 44333683000..dde3b685d25 100644
--- a/htdocs/core/boxes/box_produits.php
+++ b/htdocs/core/boxes/box_produits.php
@@ -190,8 +190,8 @@ class box_produits extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, 'day'),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index d876dad67d0..9c6376351e7 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -165,8 +165,8 @@ class box_propales extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($date, 'day'),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($date, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php
index ea550b9d856..a8959202082 100644
--- a/htdocs/core/boxes/box_prospect.php
+++ b/htdocs/core/boxes/box_prospect.php
@@ -135,8 +135,8 @@ class box_prospect extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
- 'td' => 'class="right"',
- 'text' => dol_print_date($datem, "day"),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, "day", 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_scheduled_jobs.php b/htdocs/core/boxes/box_scheduled_jobs.php
index 04ba2944c75..793b0cc8c79 100644
--- a/htdocs/core/boxes/box_scheduled_jobs.php
+++ b/htdocs/core/boxes/box_scheduled_jobs.php
@@ -156,7 +156,7 @@ class box_scheduled_jobs extends ModeleBoxes
);
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'textnoformat' => (empty($resultarray[$line][2]) ? '' : $form->textwithpicto(dol_print_date($resultarray[$line][2], "dayhoursec"), $langs->trans("CurrentTimeZone")))
+ 'textnoformat' => (empty($resultarray[$line][2]) ? '' : $form->textwithpicto(dol_print_date($resultarray[$line][2], "dayhoursec", 'tzserver'), $langs->trans("CurrentTimeZone")))
);
$this->info_box_contents[$line][] = array(
'td' => 'class="center" ',
diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php
index b6eb51826cc..98e2b82bb37 100644
--- a/htdocs/core/boxes/box_services_contracts.php
+++ b/htdocs/core/boxes/box_services_contracts.php
@@ -200,8 +200,8 @@ class box_services_contracts extends ModeleBoxes
);
$this->info_box_contents[$i][] = array(
- 'td' => '',
- 'text' => dol_print_date($datem, 'day'),
+ 'td' => 'class="center nowraponall"',
+ 'text' => dol_print_date($datem, 'day', 'tzuserrel'),
'text2'=> $late,
);
diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php
index 724eb9baebf..75cc1cde413 100644
--- a/htdocs/core/boxes/box_services_expired.php
+++ b/htdocs/core/boxes/box_services_expired.php
@@ -152,7 +152,7 @@ class box_services_expired extends ModeleBoxes
$this->info_box_contents[$i][] = array(
'td' => 'class="center nowraponall"',
- 'text' => dol_print_date($dateline, 'day'),
+ 'text' => dol_print_date($dateline, 'day', 'tzuserrel'),
'text2'=> $late,
);
diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php
index 235e7a8e72a..0c2b97ce6b5 100644
--- a/htdocs/core/boxes/box_supplier_orders.php
+++ b/htdocs/core/boxes/box_supplier_orders.php
@@ -153,7 +153,7 @@ class box_supplier_orders extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => dol_print_date($date, 'day'),
+ 'text' => dol_print_date($date, 'day', 'tzuserrel'),
);
$this->info_box_contents[$line][] = array(
diff --git a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
index 1a8cec07155..04dabbd0ff3 100644
--- a/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
+++ b/htdocs/core/boxes/box_supplier_orders_awaiting_reception.php
@@ -161,7 +161,7 @@ class box_supplier_orders_awaiting_reception extends ModeleBoxes
$this->info_box_contents[$line][] = array(
'td' => 'class="right"',
- 'text' => $delayIcon.' '.dol_print_date($delivery_date, 'day').' ',
+ 'text' => $delayIcon.' '.dol_print_date($delivery_date, 'day', 'tzuserrel').' ',
'asis' => 1
);
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 57bbbe3a029..ea9692f2864 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -8193,41 +8193,47 @@ class Form
if ($modulepart == 'societe') {
$dir = $conf->societe->multidir_output[$entity];
if (!empty($object->logo)) {
- if ((string) $imagesize == 'mini') {
- $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
- } elseif ((string) $imagesize == 'small') {
- $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
- } else {
- $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
+ if (dolIsAllowedForPreview($object->logo)) {
+ if ((string) $imagesize == 'mini') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_mini'); // getImageFileNameForSize include the thumbs
+ } elseif ((string) $imagesize == 'small') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.getImageFileNameForSize($object->logo, '_small');
+ } else {
+ $file = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
+ }
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
}
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'thirdparty').'logos/'.$object->logo;
}
$email = $object->email;
} elseif ($modulepart == 'contact') {
$dir = $conf->societe->multidir_output[$entity].'/contact';
if (!empty($object->photo)) {
- if ((string) $imagesize == 'mini') {
- $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
- } elseif ((string) $imagesize == 'small') {
- $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
- } else {
- $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
+ if (dolIsAllowedForPreview($object->logo)) {
+ if ((string) $imagesize == 'mini') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_mini');
+ } elseif ((string) $imagesize == 'small') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.getImageFileNameForSize($object->photo, '_small');
+ } else {
+ $file = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
+ }
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
}
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'contact').'photos/'.$object->photo;
}
$email = $object->email;
$capture = 'user';
} elseif ($modulepart == 'userphoto') {
$dir = $conf->user->dir_output;
if (!empty($object->photo)) {
- if ((string) $imagesize == 'mini') {
- $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
- } elseif ((string) $imagesize == 'small') {
- $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
- } else {
- $file = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo;
+ if (dolIsAllowedForPreview($object->logo)) {
+ if ((string) $imagesize == 'mini') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_mini');
+ } elseif ((string) $imagesize == 'small') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'user').getImageFileNameForSize($object->photo, '_small');
+ } else {
+ $file = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo;
+ }
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo;
}
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'user').$object->photo;
}
if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
$altfile = $object->id.".jpg"; // For backward compatibility
@@ -8237,14 +8243,16 @@ class Form
} elseif ($modulepart == 'memberphoto') {
$dir = $conf->adherent->dir_output;
if (!empty($object->photo)) {
- if ((string) $imagesize == 'mini') {
- $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
- } elseif ((string) $imagesize == 'small') {
- $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
- } else {
- $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
+ if (dolIsAllowedForPreview($object->logo)) {
+ if ((string) $imagesize == 'mini') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_mini');
+ } elseif ((string) $imagesize == 'small') {
+ $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.getImageFileNameForSize($object->photo, '_small');
+ } else {
+ $file = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
+ }
+ $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
}
- $originalfile = get_exdir(0, 0, 0, 0, $object, 'member').'photos/'.$object->photo;
}
if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
$altfile = $object->id.".jpg"; // For backward compatibility
@@ -8255,14 +8263,16 @@ class Form
// Generic case to show photos
$dir = $conf->$modulepart->dir_output;
if (!empty($object->photo)) {
- if ((string) $imagesize == 'mini') {
- $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
- } elseif ((string) $imagesize == 'small') {
- $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
- } else {
- $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
+ if (dolIsAllowedForPreview($object->logo)) {
+ if ((string) $imagesize == 'mini') {
+ $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_mini');
+ } elseif ((string) $imagesize == 'small') {
+ $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.getImageFileNameForSize($object->photo, '_small');
+ } else {
+ $file = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
+ }
+ $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
}
- $originalfile = get_exdir($id, 2, 0, 0, $object, $modulepart).'photos/'.$object->photo;
}
if (!empty($conf->global->MAIN_OLD_IMAGE_LINKS)) {
$altfile = $object->id.".jpg"; // For backward compatibility
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 0f046a08fd3..47506d5cbfa 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -1774,11 +1774,16 @@ class FormFile
continue; // We do not show orphelins files
}
- print ''."\n";
+ print ''."\n";
print ' ';
print '';
if ($found > 0 && is_object($this->cache_objects[$modulepart.'_'.$id.'_'.$ref])) {
- print $this->cache_objects[$modulepart.'_'.$id.'_'.$ref]->getNomUrl(1, 'document');
+ $tmpobject = $this->cache_objects[$modulepart.'_'.$id.'_'.$ref];
+ //if (! in_array($tmpobject->element, array('expensereport'))) {
+ print $tmpobject->getNomUrl(1, 'document');
+ //} else {
+ // print $tmpobject->getNomUrl(1);
+ //}
} else {
print $langs->trans("ObjectDeleted", ($id ? $id : $ref));
}
diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php
index 0f97ed878cf..a578f08f3c1 100644
--- a/htdocs/core/class/ldap.class.php
+++ b/htdocs/core/class/ldap.class.php
@@ -932,7 +932,7 @@ class Ldap
* Returns an array containing a details or list of LDAP record(s)
* ldapsearch -LLLx -hlocalhost -Dcn=admin,dc=parinux,dc=org -w password -b "ou=adherents,ou=people,dc=parinux,dc=org" userPassword
*
- * @param string $search Value of fiel to search, '*' for all. Not used if $activefilter is set.
+ * @param string $search Value of field to search, '*' for all. Not used if $activefilter is set.
* @param string $userDn DN (Ex: ou=adherents,ou=people,dc=parinux,dc=org)
* @param string $useridentifier Name of key field (Ex: uid)
* @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword)
diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php
index d2987e8fc63..a4f6bb11706 100644
--- a/htdocs/core/class/utils.class.php
+++ b/htdocs/core/class/utils.class.php
@@ -319,9 +319,9 @@ class Utils
}
if ($dolibarr_main_db_character_set == 'utf8mb4') {
// We save output into utf8mb4 charset
- $param .= " --default-character-set=utf8mb4";
+ $param .= " --default-character-set=utf8mb4 --no-tablespaces";
} else {
- $param .= " --default-character-set=utf8"; // We always save output into utf8 charset
+ $param .= " --default-character-set=utf8 --no-tablespaces"; // We always save output into utf8 charset
}
$paramcrypted = $param;
$paramclear = $param;
diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php
index 303382f285b..ae260171a0b 100644
--- a/htdocs/core/lib/admin.lib.php
+++ b/htdocs/core/lib/admin.lib.php
@@ -1545,6 +1545,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
print ' ';
}
+ print '';
print '
';
print '';
print ''.$langs->trans("Description").' ';
@@ -1715,6 +1716,7 @@ function form_constantes($tableau, $strictw3c = 0, $helptext = '')
}
}
print '
';
+ print '
';
if (!empty($strictw3c) && $strictw3c == 1) {
print '
';
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index ce5e7129bcf..7e34eec5ecd 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -2232,7 +2232,8 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('(
}
/**
- * Security check when accessing to a document (used by document.php, viewimage.php and webservices)
+ * Security check when accessing to a document (used by document.php, viewimage.php and webservices to get documents).
+ * TODO Replace code that set $accesallowed by a call to restrictedArea()
*
* @param string $modulepart Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp')
* @param string $original_file Relative path with filename, relative to modulepart.
@@ -2446,6 +2447,16 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
// Wrapping for events
if ($fuser->rights->agenda->myactions->{$read}) {
$accessallowed = 1;
+ // If we known $id of project, call checkUserAccessToObject to check permission on the given agenda event on properties and assigned users
+ if ($refname && !preg_match('/^specimen/i', $original_file)) {
+ include_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
+ $tmpobject = new ActionComm($db);
+ $tmpobject->fetch((int) $refname);
+ $accessallowed = checkUserAccessToObject($user, array('agenda'), $tmpobject->id, 'actioncomm&societe', 'myactions|allactions', 'fk_soc', 'id', '');
+ if ($user->socid && $tmpobject->socid) {
+ $accessallowed = checkUserAccessToObject($user, array('societe'), $tmpobject->socid);
+ }
+ }
}
$original_file = $conf->agenda->dir_output.'/'.$original_file;
} elseif ($modulepart == 'category' && !empty($conf->categorie->multidir_output[$entity])) {
@@ -2612,12 +2623,26 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
// Wrapping pour les projets
if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
+ // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project
+ if ($refname && !preg_match('/^specimen/i', $original_file)) {
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
+ $tmpproject = new Project($db);
+ $tmpproject->fetch('', $refname);
+ $accessallowed = checkUserAccessToObject($user, array('projet'), $tmpproject->id, 'projet&project', '', '', 'rowid', '');
+ }
}
$original_file = $conf->projet->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
} elseif ($modulepart == 'project_task' && !empty($conf->projet->dir_output)) {
if ($fuser->rights->projet->{$lire} || preg_match('/^specimen/i', $original_file)) {
$accessallowed = 1;
+ // If we known $id of project, call checkUserAccessToObject to check permission on properties and contact of project
+ if ($refname && !preg_match('/^specimen/i', $original_file)) {
+ include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
+ $tmptask = new Task($db);
+ $tmptask->fetch('', $refname);
+ $accessallowed = checkUserAccessToObject($user, array('projet_task'), $tmptask->id, 'projet&project', '', '', 'rowid', '');
+ }
}
$original_file = $conf->projet->dir_output.'/'.$original_file;
$sqlprotectagainstexternals = "SELECT fk_soc as fk_soc FROM ".MAIN_DB_PREFIX."projet WHERE ref='".$db->escape($refname)."' AND entity IN (".getEntity('project').")";
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 48237bbc826..45d1bdca12e 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6879,8 +6879,6 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
// For backward compatibility
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
- $substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : null));
- $substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : null);
$substitutionarray['__SUPPLIER_ORDER_DATE_DELIVERY__'] = (isset($object->date_livraison) ? dol_print_date($object->date_livraison, 'day', 0, $outputlangs) : '');
$substitutionarray['__SUPPLIER_ORDER_DELAY_DELIVERY__'] = (isset($object->availability_code) ? ($outputlangs->transnoentities("AvailabilityType".$object->availability_code) != ('AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities("AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset(isset($object->availability) ? $object->availability : '')) : '');
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index de4d67b1647..598802ea574 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -173,17 +173,21 @@ function dol_verifyHash($chain, $hash, $type = '0')
* 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', ...)
+ * @param string $features Features to check (it must be module $object->element. Can be a 'or' check with 'levela|levelb'.
+ * Examples: 'societe', 'contact', 'produit&service', 'produit|service', ...)
+ * This is used to check permission $user->rights->features->...
* @param int $objectid Object ID if we want to check a particular record (optional) is linked to a owned thirdparty (optional).
* @param string $tableandshare 'TableName&SharedElement' with Tablename is table where object is stored. SharedElement is an optional key to define where to check entity for multicompany module. Param not used if objectid is null (optional).
* @param string $feature2 Feature to check, second level of permission (optional). Can be a 'or' check with 'sublevela|sublevelb'.
+ * This is used to check permission $user->rights->features->feature2...
* @param string $dbt_keyfield Field name for socid foreign key if not fk_soc. Not used if objectid is null (optional)
* @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
+ * @param int $mode Mode (0=default, 1=return with not die)
+ * @return int If mode = 0 (default): Always 1, die process if not allowed. If mode = 1: Return 0 if access not allowed.
* @see dol_check_secure_access_document(), checkUserAccessToObject()
*/
-function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0)
+function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = 'fk_soc', $dbt_select = 'rowid', $isdraft = 0, $mode = 0)
{
global $db, $conf;
global $hookmanager;
@@ -228,7 +232,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
if (isset($hookmanager->resArray['result'])) {
if ($hookmanager->resArray['result'] == 0) {
- accessforbidden(); // Module returns 0, so access forbidden
+ if ($mode) {
+ return 0;
+ } else {
+ accessforbidden(); // Module returns 0, so access forbidden
+ }
}
}
if ($reshook > 0) { // No other test done.
@@ -343,7 +351,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
}
if (!$readok) {
- accessforbidden();
+ if ($mode) {
+ return 0;
+ } else {
+ accessforbidden();
+ }
}
//print "Read access is ok";
@@ -432,7 +444,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
}
if ($wemustcheckpermissionforcreate && !$createok) {
- accessforbidden();
+ if ($mode) {
+ return 0;
+ } else {
+ accessforbidden();
+ }
}
//print "Write access is ok";
}
@@ -445,7 +461,11 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
}
if (!$createuserok) {
- accessforbidden();
+ if ($mode) {
+ return 0;
+ } else {
+ accessforbidden();
+ }
}
//print "Create user access is ok";
}
@@ -520,26 +540,34 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
}
if (!$deleteok && !($isdraft && $createok)) {
- accessforbidden();
+ if ($mode) {
+ return 0;
+ } else {
+ accessforbidden();
+ }
}
//print "Delete access is ok";
}
- // If we have a particular object to check permissions on, we check this object
- // is linked to a company allowed to $user.
+ // If we have a particular object to check permissions on, we check if $user has permission
+ // for this given object (link to company, is contact for project, ...)
if (!empty($objectid) && $objectid > 0) {
$ok = checkUserAccessToObject($user, $featuresarray, $objectid, $tableandshare, $feature2, $dbt_keyfield, $dbt_select, $parentfortableentity);
$params = array('objectid' => $objectid, 'features' => join(',', $featuresarray), 'features2' => $feature2);
//print 'checkUserAccessToObject ok='.$ok;
- return $ok ? 1 : accessforbidden('', 1, 1, 0, $params);
+ if ($mode) {
+ return $ok ? 1 : 0;
+ } else {
+ return $ok ? 1 : accessforbidden('', 1, 1, 0, $params);
+ }
}
return 1;
}
/**
- * Check access by user to object.
- * This function is also called by restrictedArea that check before if module is enabled and permissions of user compared to $action.
+ * Check access by user to object is ok.
+ * This function is also called by restrictedArea that check before if module is enabled and if permission of user for $action is ok.
*
* @param User $user User to check
* @param array $featuresarray Features/modules to check. Example: ('user','service','member','project','task',...)
@@ -552,7 +580,7 @@ function restrictedArea($user, $features, $objectid = 0, $tableandshare = '', $f
* @return bool True if user has access, False otherwise
* @see restrictedArea()
*/
-function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid', $parenttableforentity = '')
+function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $tableandshare = '', $feature2 = '', $dbt_keyfield = '', $dbt_select = 'rowid', $parenttableforentity = '')
{
global $db, $conf;
@@ -686,6 +714,7 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$projectstatic = new Project($db);
$tmps = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1, 0);
+
$tmparray = explode(',', $tmps);
if (!in_array($objectid, $tmparray)) {
return false;
diff --git a/htdocs/core/tpl/card_presend.tpl.php b/htdocs/core/tpl/card_presend.tpl.php
index 9c1387d7d58..731cc580ea1 100644
--- a/htdocs/core/tpl/card_presend.tpl.php
+++ b/htdocs/core/tpl/card_presend.tpl.php
@@ -76,7 +76,7 @@ if ($action == 'presend') {
if (empty($object->ref_client)) {
$topicmail = $outputlangs->trans($defaulttopic, '__REF__');
} elseif (!empty($object->ref_client)) {
- $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REFCLIENT__)');
+ $topicmail = $outputlangs->trans($defaulttopic, '__REF__ (__REF_CLIENT__)');
}
// Build document if it not exists
diff --git a/htdocs/core/tpl/massactions_pre.tpl.php b/htdocs/core/tpl/massactions_pre.tpl.php
index 21150d19936..4b8680e11bb 100644
--- a/htdocs/core/tpl/massactions_pre.tpl.php
+++ b/htdocs/core/tpl/massactions_pre.tpl.php
@@ -149,7 +149,7 @@ if ($massaction == 'presend') {
$formmail->withtofree = empty($liste) ? 1 : 0;
$formmail->withtocc = 1;
$formmail->withtoccc = $conf->global->MAIN_EMAIL_USECCC;
- $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REFCLIENT__');
+ $formmail->withtopic = $langs->transnoentities($topicmail, '__REF__', '__REF_CLIENT__');
$formmail->withfile = 1;
// $formmail->withfile = 2; Not yet supported in mass action
$formmail->withmaindocfile = 1; // Add a checkbox "Attach also main document"
diff --git a/htdocs/ecm/dir_add_card.php b/htdocs/ecm/dir_add_card.php
index 4cf557acde6..1416983e3a3 100644
--- a/htdocs/ecm/dir_add_card.php
+++ b/htdocs/ecm/dir_add_card.php
@@ -188,7 +188,7 @@ if ($action == 'add' && $permtoadd) {
exit;
}
}
-} elseif ($action == 'confirm_deletesection' && $confirm == 'yes') {
+} elseif ($action == 'confirm_deletesection' && $confirm == 'yes' && $permtoadd) {
// Deleting file
$result = $ecmdir->delete($user);
setEventMessages($langs->trans("ECMSectionWasRemoved", $ecmdir->label), null, 'mesgs');
diff --git a/htdocs/ecm/dir_card.php b/htdocs/ecm/dir_card.php
index 4c93e005266..d84a7330e69 100644
--- a/htdocs/ecm/dir_card.php
+++ b/htdocs/ecm/dir_card.php
@@ -88,17 +88,23 @@ if ($module == 'ecm') {
}
// Permissions
+$permtoread = 0;
$permtoadd = 0;
$permtoupload = 0;
if ($module == 'ecm') {
+ $permtoread = $user->rights->ecm->read;
$permtoadd = $user->rights->ecm->setup;
$permtoupload = $user->rights->ecm->upload;
}
if ($module == 'medias') {
+ $permtoread = ($user->rights->mailing->lire || $user->rights->website->read);
$permtoadd = ($user->rights->mailing->creer || $user->rights->website->write);
$permtoupload = ($user->rights->mailing->creer || $user->rights->website->write);
}
+if (!$permtoread) {
+ accessforbidden();
+}
/*
@@ -106,7 +112,7 @@ if ($module == 'medias') {
*/
// Upload file
-if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) {
+if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC) && $permtoupload) {
if (dol_mkdir($upload_dir) >= 0) {
$resupload = dol_move_uploaded_file($_FILES['userfile']['tmp_name'], $upload_dir."/".dol_unescapefile($_FILES['userfile']['name']), 0, 0, $_FILES['userfile']['error']);
if (is_numeric($resupload) && $resupload > 0) {
@@ -131,7 +137,7 @@ if (GETPOST("sendit") && !empty($conf->global->MAIN_UPLOAD_DOC)) {
}
// Remove file
-if ($action == 'confirm_deletefile' && $confirm == 'yes') {
+if ($action == 'confirm_deletefile' && $confirm == 'yes' && $permtoupload) {
$langs->load("other");
$file = $upload_dir."/".GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
$ret = dol_delete_file($file);
@@ -145,7 +151,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') {
}
// Remove dir
-if ($action == 'confirm_deletedir' && $confirm == 'yes') {
+if ($action == 'confirm_deletedir' && $confirm == 'yes' && $permtoupload) {
$backtourl = DOL_URL_ROOT."/ecm/index.php";
if ($module == 'medias') {
$backtourl = DOL_URL_ROOT."/website/index.php?file_manager=1";
@@ -181,7 +187,7 @@ if ($action == 'confirm_deletedir' && $confirm == 'yes') {
}
// Update dirname or description
-if ($action == 'update' && !GETPOST('cancel', 'alpha')) {
+if ($action == 'update' && !GETPOST('cancel', 'alpha') && $permtoadd) {
$error = 0;
if ($module == 'ecm') {
diff --git a/htdocs/ecm/file_card.php b/htdocs/ecm/file_card.php
index 93885c2843a..14bc7e377f0 100644
--- a/htdocs/ecm/file_card.php
+++ b/htdocs/ecm/file_card.php
@@ -36,10 +36,6 @@ $action = GETPOST('action', 'aZ09');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
-if (!$user->rights->ecm->setup) {
- accessforbidden();
-}
-
// Get parameters
$socid = GETPOST("socid", "int");
@@ -105,6 +101,14 @@ if ($result < 0) {
exit;
}
+// Permissions
+$permtoread = $user->rights->ecm->read;
+$permtoadd = $user->rights->ecm->setup;
+$permtoupload = $user->rights->ecm->upload;
+
+if (!$permtoread) {
+ accessforbidden();
+}
/*
@@ -123,7 +127,7 @@ if ($cancel) {
}
// Rename file
-if ($action == 'update') {
+if ($action == 'update' && $permtoadd) {
$error = 0;
$oldlabel = GETPOST('urlfile', 'alpha');
diff --git a/htdocs/ecm/file_note.php b/htdocs/ecm/file_note.php
index d2f3f7b4792..505e432f982 100644
--- a/htdocs/ecm/file_note.php
+++ b/htdocs/ecm/file_note.php
@@ -22,7 +22,7 @@
/**
* \file htdocs/ecm/file_note.php
* \ingroup ecm
- * \brief Fiche de notes sur une ecm file
+ * \brief Tab for notes on an ECM file
*/
require '../main.inc.php';
@@ -39,10 +39,6 @@ $ref = GETPOST('ref', 'alpha');
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
-if (!$user->rights->ecm->setup) {
- accessforbidden();
-}
-
// Get parameters
$socid = GETPOST("socid", "int");
// Security check
@@ -109,6 +105,13 @@ if ($result < 0) {
$permissionnote = $user->rights->ecm->setup; // Used by the include of actions_setnotes.inc.php
+$permtoread = $user->rights->ecm->read;
+
+if (!$permtoread) {
+ accessforbidden();
+}
+
+
/*
* Actions
*/
diff --git a/htdocs/ecm/index.php b/htdocs/ecm/index.php
index 26bf242b0f2..3a8d33343c7 100644
--- a/htdocs/ecm/index.php
+++ b/htdocs/ecm/index.php
@@ -34,12 +34,6 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
// Load translation files required by the page
$langs->loadLangs(array("ecm", "companies", "other", "users", "orders", "propal", "bills", "contracts"));
-// Security check
-if ($user->socid) {
- $socid = $user->socid;
-}
-$result = restrictedArea($user, 'ecm', 0);
-
// Get parameters
$socid = GETPOST('socid', 'int');
$action = GETPOST('action', 'aZ09');
@@ -81,6 +75,12 @@ $userstatic = new User($db);
$error = 0;
+// Security check
+if ($user->socid) {
+ $socid = $user->socid;
+}
+$result = restrictedArea($user, 'ecm', 0);
+
/*
* Actions
diff --git a/htdocs/ecm/index_auto.php b/htdocs/ecm/index_auto.php
index bcfff8aa2da..d54dcf14d1e 100644
--- a/htdocs/ecm/index_auto.php
+++ b/htdocs/ecm/index_auto.php
@@ -440,15 +440,13 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act
continue; // If condition to show is ok
}
- $var = false;
-
print '';
if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_ECM_DISABLE_JS)) {
- print '';
+ print ' ';
print $val['label'];
print ' ';
} else {
- print '';
+ print ' ';
print $val['label'];
print ' ';
}
@@ -456,7 +454,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i', $act
print '';
// Info
$htmltooltip = '
'.$langs->trans("ECMSection").' : '.$val['label'].'
';
- $htmltooltip = '
'.$langs->trans("Type").' : '.$langs->trans("ECMSectionAuto").'
';
+ $htmltooltip .= '
'.$langs->trans("Type").' : '.$langs->trans("ECMSectionAuto").'
';
$htmltooltip .= '
'.$langs->trans("ECMCreationUser").' : '.$langs->trans("ECMTypeAuto").'
';
$htmltooltip .= '
'.$langs->trans("Description").' : '.$val['desc'];
print $form->textwithpicto('', $htmltooltip, 1, 'info');
diff --git a/htdocs/ecm/search.php b/htdocs/ecm/search.php
index 979e1d3a417..aa792e0c9d7 100644
--- a/htdocs/ecm/search.php
+++ b/htdocs/ecm/search.php
@@ -84,6 +84,12 @@ if (!empty($section)) {
}
}
+$permtoread = $user->rights->ecm->read;
+
+if (!$permtoread) {
+ accessforbidden();
+}
+
/*
* Actions
diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php
index be09b670d84..25ee6072a90 100644
--- a/htdocs/expensereport/class/expensereport.class.php
+++ b/htdocs/expensereport/class/expensereport.class.php
@@ -1645,6 +1645,7 @@ class ExpenseReport extends CommonObject
* Return clicable name (with picto eventually)
*
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
+ * @param string $option Where point the link ('', 'document', ..)
* @param int $max Max length of shown ref
* @param int $short 1=Return just URL
* @param string $moretitle Add more text to title tooltip
@@ -1652,7 +1653,7 @@ class ExpenseReport extends CommonObject
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
* @return string String with URL
*/
- public function getNomUrl($withpicto = 0, $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
+ public function getNomUrl($withpicto = 0, $option = '', $max = 0, $short = 0, $moretitle = '', $notooltip = 0, $save_lastsearch_value = -1)
{
global $langs, $conf;
@@ -1684,17 +1685,16 @@ class ExpenseReport extends CommonObject
$label .= ' - '.$moretitle;
}
- //if ($option != 'nolink')
- //{
- // Add param to save lastsearch_values or not
+ if ($option != 'nolink') {
+ // 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;
+ if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
+ $add_save_lastsearch_values = 1;
+ }
+ if ($add_save_lastsearch_values) {
+ $url .= '&save_lastsearch_values=1';
+ }
}
- if ($add_save_lastsearch_values) {
- $url .= '&save_lastsearch_values=1';
- }
- //}
$ref = $this->ref;
if (empty($ref)) {
@@ -1720,7 +1720,7 @@ class ExpenseReport extends CommonObject
$result .= img_object(($notooltip ? '' : $label), $this->picto, ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
}
if ($withpicto != 2) {
- $result .= ($max ?dol_trunc($ref, $max) : $ref);
+ $result .= ($max ? dol_trunc($ref, $max) : $ref);
}
$result .= $linkend;
diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php
index 8586e0fc623..637f29e87b8 100644
--- a/htdocs/fourn/class/fournisseur.facture.class.php
+++ b/htdocs/fourn/class/fournisseur.facture.class.php
@@ -1361,7 +1361,7 @@ class FactureFournisseur extends CommonInvoice
}
$sql .= ', fk_user_closing = '.$user->id;
$sql .= ", date_closing = '".$this->db->idate($now)."'";
- $sql .= ' WHERE rowid = '.$this->id;
+ $sql .= ' WHERE rowid = '.((int) $this->id);
$resql = $this->db->query($sql);
if ($resql) {
@@ -1417,18 +1417,17 @@ class FactureFournisseur extends CommonInvoice
*/
public function setUnpaid($user)
{
- global $conf, $langs;
$error = 0;
$this->db->begin();
$sql = 'UPDATE '.MAIN_DB_PREFIX.'facture_fourn';
- $sql .= ' SET paye=0, fk_statut='.self::STATUS_VALIDATED.', close_code=null, close_note=null';
+ $sql .= ' SET paye=0, fk_statut='.self::STATUS_VALIDATED.', close_code=null, close_note=null,';
$sql .= ' date_closing=null,';
$sql .= ' fk_user_closing=null';
- $sql .= ' WHERE rowid = '.$this->id;
+ $sql .= ' WHERE rowid = '.((int) $this->id);
- dol_syslog("FactureFournisseur::set_unpaid", LOG_DEBUG);
+ dol_syslog(get_class($this)."::set_unpaid", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
// Call trigger
diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php
index 9c201497566..8c4aa1e2a54 100644
--- a/htdocs/fourn/commande/card.php
+++ b/htdocs/fourn/commande/card.php
@@ -1256,6 +1256,8 @@ if (empty($reshook)) {
$tva_tx = get_default_tva($soc, $mysoc, $lines[$i]->fk_product, $product_fourn_price_id);
}
+ $object->special_code = $lines[$i]->special_code;
+
$result = $object->addline(
$desc,
$lines[$i]->subprice,
diff --git a/htdocs/install/mysql/data/llx_00_c_country.sql b/htdocs/install/mysql/data/llx_00_c_country.sql
index bc09a7fd1f6..677447f1af2 100644
--- a/htdocs/install/mysql/data/llx_00_c_country.sql
+++ b/htdocs/install/mysql/data/llx_00_c_country.sql
@@ -194,27 +194,27 @@ INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (40
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (300,'CW','CUW','Curaçao',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (301,'SX','SXM','Sint Maarten',1,0);
--End of antilles nederland
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (165,'NC','NCL','New Caledonia',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (166,'NZ','NZL','New Zealand',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (167,'NI','NIC','Nicaragua',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (168,'NE','NER','Niger',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (169,'NG','NGA','Nigeria',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (170,'NU','NIU','Nioué',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (171,'NF','NFK','Ile Norfolk',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (172,'MP','MNP','Mariannes du Nord',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (173,'NO','NOR','Norvège',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (170,'NU','NIU','Niue',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (171,'NF','NFK','Norfolk Island',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (172,'MP','MNP','Northern Mariana Islands',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (173,'NO','NOR','Norway',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (174,'OM','OMN','Oman',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (175,'PK','PAK','Pakistan',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (176,'PW','PLW','Palaos',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (176,'PW','PLW','Palau',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (177,'PS','PSE','Palestinian territories',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (178,'PA','PAN','Panama',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (179,'PG','PNG','Papua New Guinea',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (180,'PY','PRY','Paraguay',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (181,'PE','PER','Peru',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (182,'PH','PHL','Philippines',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (183,'PN','PCN','Iles Pitcairn',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (183,'PN','PCN','Pitcairn Islands',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (184,'PL','POL','Pologne',1,0);
-INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Porto Rico',1,0);
+INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (185,'PR','PRI','Puerto Rico',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (186,'QA','QAT','Qatar',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (188,'RO','ROU','Roumanie',1,0);
INSERT INTO llx_c_country (rowid,code,code_iso,label,active,favorite) VALUES (189,'RW','RWA','Rwanda',1,0);
diff --git a/htdocs/install/mysql/data/llx_accounting_abc.sql b/htdocs/install/mysql/data/llx_accounting_abc.sql
index 3c178f7c70d..806d084ce85 100644
--- a/htdocs/install/mysql/data/llx_accounting_abc.sql
+++ b/htdocs/install/mysql/data/llx_accounting_abc.sql
@@ -174,10 +174,10 @@ INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUE
INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 15,'SYSCOHADA-TG', 'Plan comptable Ouest-Africain', 1);
-- Description of chart of account USA US-BASE
-INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 11, 'US-BASE', 'USA basic chart of accounts', 1);
+INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 11, 'US-BASE', 'USA basic chart of accounts', 1);
-- Description of chart of account Canada CA-ENG-BASE
-INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1);
+INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1);
-- Description of chart of account Mexico SAT/24-2019
-INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1);
+INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1);
diff --git a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
index b95ea30f8fb..c9736e429c4 100644
--- a/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
+++ b/htdocs/install/mysql/migration/13.0.0-14.0.0.sql
@@ -62,6 +62,11 @@ UPDATE llx_c_country SET eec = 1 WHERE code IN ('AT','BE','BG','CY','CZ','DE','D
ALTER TABLE llx_export_model MODIFY COLUMN type varchar(64);
+INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 11, 'US-BASE', 'USA basic chart of accounts', 1);
+INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 14, 'CA-ENG-BASE', 'Canadian basic chart of accounts - English', 1);
+INSERT INTO llx_accounting_system (fk_country, pcg_version, label, active) VALUES ( 154, 'SAT/24-2019', 'Catalogo y codigo agrupador fiscal del 2019', 1);
+
+
-- For v14
ALTER TABLE llx_product_lot ADD COLUMN eol_date datetime NULL;
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 7b40647ebcb..a42c3c39cd3 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -142,27 +142,23 @@ function testSqlAndScriptInject($val, $type)
}
$inj += preg_match('/base\s+href/si', $val);
$inj += preg_match('/=data:/si', $val);
- // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp
- $inj += preg_match('/onmouse([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like
- $inj += preg_match('/ondrag([a-z]*)\s*=/i', $val); //
- $inj += preg_match('/ontouch([a-z]*)\s*=/i', $val); //
- $inj += preg_match('/on(abort|afterprint|beforeprint|beforeunload|blur|canplay|canplaythrough|change|click|contextmenu|copy|cut)\s*=/i', $val);
- $inj += preg_match('/on(dblclick|drop|durationchange|ended|error|focus|focusin|focusout|hashchange|input|invalid)\s*=/i', $val);
- $inj += preg_match('/on(keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|loadend|offline|online|pagehide|pageshow)\s*=/i', $val);
- $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|resize|reset|scroll|search|seeking|select|show|stalled|start|submit|suspend)\s*=/i', $val);
- $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting)\s*=/i', $val);
+ // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers
+ $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like
+ $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $val);
+ $inj += preg_match('/on(dblclick|drop|durationchange|emptied|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $val);
+ $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $val);
+ $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)\s*=/i', $val);
+ $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $val);
// We refuse html into html because some hacks try to obfuscate evil strings by inserting HTML into HTML. Example:
error=alert(1) to bypass test on onerror
$tmpval = preg_replace('/<[^<]+>/', '', $val);
- // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp
- $inj += preg_match('/onmouse([a-z]*)\s*=/i', $tmpval); // onmousexxx can be set on img or any html tag like
- $inj += preg_match('/ondrag([a-z]*)\s*=/i', $tmpval); //
- $inj += preg_match('/ontouch([a-z]*)\s*=/i', $tmpval); //
- $inj += preg_match('/on(abort|afterprint|beforeprint|beforeunload|blur|canplay|canplaythrough|change|click|contextmenu|copy|cut)\s*=/i', $tmpval);
- $inj += preg_match('/on(dblclick|drop|durationchange|ended|error|focus|focusin|focusout|hashchange|input|invalid)\s*=/i', $tmpval);
- $inj += preg_match('/on(keydown|keypress|keyup|load|loadeddata|loadedmetadata|loadstart|loadend|offline|online|pagehide|pageshow)\s*=/i', $tmpval);
- $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|resize|reset|scroll|search|seeking|select|show|stalled|start|submit|suspend)\s*=/i', $tmpval);
- $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting)\s*=/i', $tmpval);
+ // List of dom events is on https://www.w3schools.com/jsref/dom_obj_event.asp and https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers
+ $inj += preg_match('/on(mouse|drag|key|load|touch|pointer|select|transition)([a-z]*)\s*=/i', $val); // onmousexxx can be set on img or any html tag like
+ $inj += preg_match('/on(abort|afterprint|animation|auxclick|beforeprint|beforeunload|blur|cancel|canplay|canplaythrough|change|click|close|contextmenu|cuechange|copy|cut)\s*=/i', $tmpval);
+ $inj += preg_match('/on(dblclick|drop|durationchange|emptied|ended|error|focus|focusin|focusout|formdata|gotpointercapture|hashchange|input|invalid)\s*=/i', $tmpval);
+ $inj += preg_match('/on(lostpointercapture|offline|online|pagehide|pageshow)\s*=/i', $tmpval);
+ $inj += preg_match('/on(paste|pause|play|playing|progress|ratechange|reset|resize|scroll|search|seeked|seeking|show|stalled|start|submit|suspend)\s*=/i', $tmpval);
+ $inj += preg_match('/on(timeupdate|toggle|unload|volumechange|waiting|wheel)\s*=/i', $tmpval);
//$inj += preg_match('/on[A-Z][a-z]+\*=/', $val); // To lock event handlers onAbort(), ...
$inj += preg_match('/:|:|:/i', $val); // refused string ':' encoded (no reason to have it encoded) to lock 'javascript:...'
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index 4c34e04c54c..6f2337d1baf 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -39,10 +39,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
-if (empty($user->rights->margins->liretous)) {
- accessforbidden();
-}
$object = new Product($db);
@@ -63,6 +59,12 @@ if (!$sortfield) {
$sortfield = "f.datef";
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+if (empty($user->rights->margins->liretous)) {
+ accessforbidden();
+}
+
/*
* View
diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php
index b1c569c0912..505ff9f9f31 100644
--- a/htdocs/margin/tabs/thirdpartyMargins.php
+++ b/htdocs/margin/tabs/thirdpartyMargins.php
@@ -33,8 +33,6 @@ $socid = GETPOST('socid', 'int');
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'societe', '', '');
-
$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -61,6 +59,12 @@ if ($socid > 0) {
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('thirdpartymargins', 'globalcard'));
+$result = restrictedArea($user, 'societe', $object->id, '');
+
+if (empty($user->rights->margins->liretous)) {
+ accessforbidden();
+}
+
/*
* Actions
diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php
index e38ddf9b93c..00cfcf842d5 100644
--- a/htdocs/master.inc.php
+++ b/htdocs/master.inc.php
@@ -230,7 +230,7 @@ if (!defined('NOREQUIREDB') && !defined('NOREQUIRESOC')) {
// Set default language (must be after the setValues setting global $conf->global->MAIN_LANG_DEFAULT. Page main.inc.php will overwrite langs->defaultlang with user value later)
if (!defined('NOREQUIRETRAN')) {
$langcode = (GETPOST('lang', 'aZ09') ? GETPOST('lang', 'aZ09', 1) : (empty($conf->global->MAIN_LANG_DEFAULT) ? 'auto' : $conf->global->MAIN_LANG_DEFAULT));
- if (defined('MAIN_LANG_DEFAULT')) {
+ if (defined('MAIN_LANG_DEFAULT')) { // So a page can force the language whatever is setup and parameters in URL
$langcode = constant('MAIN_LANG_DEFAULT');
}
$langs->setDefaultLang($langcode);
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index 6d12259a39f..1c7a98739d7 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -251,7 +251,40 @@ if (GETPOSTISSET("ajoutercolonne") && $object->format == "D") {
header('Location: results.php?id='.$object->id_sondage);
}
}
-
+ if ($cleinsertion >= 0) {
+ $sql = 'SELECT s.reponses';
+ $sql .= " FROM ".MAIN_DB_PREFIX."opensurvey_user_studs as s";
+ $sql .= " WHERE id_sondage = '".$db->escape($numsondage)."'";
+ $resql = $db->query($sql);
+ if (!$resql) {
+ dol_print_error($db);
+ } else {
+ $num = $db->num_rows($resql);
+ $compteur = 0;
+ while ($compteur < $num) {
+ $obj = $db->fetch_object($resql);
+ $sql = 'UPDATE '.MAIN_DB_PREFIX."opensurvey_user_studs";
+ if ($cleinsertion == 0) {
+ $sql .= " SET reponses = '0".$db->escape($obj->reponses)."'";
+ } else {
+ $reponsesadd = str_split($obj->reponses);
+ $lengthresponses = count($reponsesadd);
+ for ($cpt = $lengthresponses; $cpt > $cleinsertion; $cpt--) {
+ $reponsesadd[$cpt] = $reponsesadd[$cpt-1];
+ }
+ $reponsesadd[$cleinsertion] = '0';
+ $reponsesadd = implode($reponsesadd);
+ $sql .= " SET reponses = '".$db->escape($reponsesadd)."'";
+ }
+ $sql .= " WHERE id_sondage = '".$db->escape($numsondage)."'";
+ $resql = $db->query($sql);
+ if (!$resql) {
+ dol_print_error($db);
+ }
+ $compteur++;
+ }
+ }
+ }
$adresseadmin = $object->mail_admin;
} else {
$erreur_ajout_date = "yes";
diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php
index ea32e47c8a5..815014e259f 100644
--- a/htdocs/product/agenda.php
+++ b/htdocs/product/agenda.php
@@ -73,7 +73,21 @@ if (!$sortorder) {
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('agendathirdparty'));
-$result = restrictedArea($user, 'produit|service', $id, 'product&product');
+$object = new Product($db);
+if ($id > 0 || !empty($ref)) {
+ $object->fetch($id, $ref);
+}
+
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', 0, 'product&product', '', '');
+}
/*
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index c92f847a1e9..61568a5510a 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -152,7 +152,17 @@ if (!empty($canvas)) {
// Security check
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
$fieldtype = (!empty($id) ? 'rowid' : 'ref');
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+}
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productcard', 'globalcard'));
diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php
index 5130db9cd2f..511331e6008 100644
--- a/htdocs/product/class/product.class.php
+++ b/htdocs/product/class/product.class.php
@@ -1645,7 +1645,7 @@ class Product extends CommonObject
$testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
- foreach ($testExit as $field){
+ foreach ($testExit as $field) {
if (!isset($this->$field[$level])) {
return array();
}
diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php
index 442232686d3..c9499bf415b 100644
--- a/htdocs/product/composition/card.php
+++ b/htdocs/product/composition/card.php
@@ -50,7 +50,6 @@ if (!empty($user->socid)) {
}
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$object = new Product($db);
$objectid = 0;
@@ -60,6 +59,19 @@ if ($id > 0 || !empty($ref)) {
$id = $object->id;
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+}
+
/*
* Actions
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index 372e3c19bdc..0b15ad7a85c 100644
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -95,9 +95,19 @@ if ($id > 0 || !empty($ref)) {
}
$modulepart = 'produit';
+
$permissiontoadd = (($object->type == Product::TYPE_PRODUCT && $user->rights->produit->creer) || ($object->type == Product::TYPE_SERVICE && $user->rights->service->creer));
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+}
/*
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index 0d5ea9647f5..8b2a792b872 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -103,17 +103,16 @@ if ($id > 0 || $ref) {
$object->fetch($id, $ref);
}
-$sortfield = GETPOST("sortfield", 'alpha');
-$sortorder = GETPOST("sortorder", 'alpha');
-
-if (!$sortfield) {
- $sortfield = "s.nom";
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
}
-if (!$sortorder) {
- $sortorder = "ASC";
-}
-
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
/*
diff --git a/htdocs/product/note.php b/htdocs/product/note.php
index add915181a2..fad4df3500b 100644
--- a/htdocs/product/note.php
+++ b/htdocs/product/note.php
@@ -51,7 +51,16 @@ if ($id > 0 || !empty($ref)) {
$permissionnote = $user->rights->produit->creer; // Used by the include of actions_setnotes.inc.php
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+}
/*
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index f23b6eae92d..5aa54b0963c 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -60,9 +60,7 @@ $offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-$staticproduct = new Product($db);
-
-$result = restrictedArea($user, 'produit|service', 0, 'product&product');
+restrictedArea($user, 'produit|service', 0, 'product&product', '', '');
/*
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 9548643166a..295a999a778 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -82,7 +82,16 @@ if ((!empty($conf->global->PRODUIT_MULTIPRICES) || !empty($conf->global->PRODUIT
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productpricecard', 'globalcard'));
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+}
/*
diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php
index 053d9d6b1a8..505bc8ed060 100644
--- a/htdocs/product/stats/bom.php
+++ b/htdocs/product/stats/bom.php
@@ -41,7 +41,6 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatscontract'));
@@ -67,6 +66,8 @@ if (!$sortfield) {
$sortfield = "b.date_valid";
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* View
diff --git a/htdocs/product/stats/card.php b/htdocs/product/stats/card.php
index 2dae292884e..d791100ae4a 100644
--- a/htdocs/product/stats/card.php
+++ b/htdocs/product/stats/card.php
@@ -58,7 +58,6 @@ if (!empty($user->socid)) {
// Security check
$fieldvalue = (!empty($id) ? $id : $ref);
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$tmp = dol_getdate(dol_now());
$currentyear = $tmp['year'];
@@ -66,6 +65,8 @@ if (empty($search_year)) {
$search_year = $currentyear;
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* Actions
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index fe8016f362a..9ba4dee7081 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -43,13 +43,10 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatsorder'));
-$mesg = '';
-
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -75,6 +72,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_year = '';
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+
/*
* View
*/
diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php
index bc8346e39b1..6037f608b58 100644
--- a/htdocs/product/stats/commande_fournisseur.php
+++ b/htdocs/product/stats/commande_fournisseur.php
@@ -42,7 +42,6 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatssupplyorder'));
@@ -74,6 +73,8 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_year = '';
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* View
diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php
index e419593208c..f91e74edf50 100644
--- a/htdocs/product/stats/contrat.php
+++ b/htdocs/product/stats/contrat.php
@@ -40,13 +40,10 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatscontract'));
-$mesg = '';
-
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -65,6 +62,8 @@ if (!$sortfield) {
$sortfield = "c.date_contrat";
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* View
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index fa7d4fae24f..0681aa9b5ca 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -44,7 +44,6 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatsinvoice'));
@@ -77,6 +76,7 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_year = '';
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
/*
diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php
index 018f1c28f02..69ef83ae5a7 100644
--- a/htdocs/product/stats/facture_fournisseur.php
+++ b/htdocs/product/stats/facture_fournisseur.php
@@ -44,13 +44,10 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatssupplyinvoice'));
-$mesg = '';
-
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -76,6 +73,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_year = '';
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+
/*
* View
*/
diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php
index 1cabfd9ef85..fefb89592e7 100644
--- a/htdocs/product/stats/mo.php
+++ b/htdocs/product/stats/mo.php
@@ -40,13 +40,10 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatscontract'));
-$mesg = '';
-
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST("sortfield", 'alpha');
@@ -65,6 +62,8 @@ if (!$sortfield) {
$sortfield = "c.date_valid";
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
/*
* View
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index 7dfc8b6d1db..96303ac598d 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -48,8 +48,6 @@ $result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatspropal'));
-$mesg = '';
-
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -76,6 +74,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_year = '';
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+
/*
* View
*/
diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php
index 86689786b2d..1b236ed3999 100644
--- a/htdocs/product/stats/supplier_proposal.php
+++ b/htdocs/product/stats/supplier_proposal.php
@@ -43,13 +43,10 @@ $socid = '';
if (!empty($user->socid)) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('productstatspropal'));
-$mesg = '';
-
// Load variable for pagination
$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -76,6 +73,9 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter',
$search_year = '';
}
+$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+
/*
* View
*/
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index b97e9b6c2d2..883fff49123 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -81,8 +81,6 @@ if (!empty($batchnumber)) {
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit&stock', $id, 'product&product', '', '', $fieldid);
-
$object = new Product($db);
$extrafields = new ExtraFields($db);
@@ -114,6 +112,17 @@ $hookmanager->initHooks(array('stockproductcard', 'globalcard'));
$error = 0;
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $id, 'product&product', '', '', $fieldid);
+}
+
/*
* Actions
diff --git a/htdocs/product/traduction.php b/htdocs/product/traduction.php
index 45b45136410..b2c3b0d0b2f 100644
--- a/htdocs/product/traduction.php
+++ b/htdocs/product/traduction.php
@@ -45,7 +45,22 @@ $fieldtype = (!empty($ref) ? 'ref' : 'rowid');
if ($user->socid) {
$socid = $user->socid;
}
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+
+if ($id > 0 || !empty($ref)) {
+ $object = new Product($db);
+ $object->fetch($id, $ref);
+}
+
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+}
/*
diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php
index 80333f3d9fb..9f81218ba8d 100644
--- a/htdocs/projet/class/task.class.php
+++ b/htdocs/projet/class/task.class.php
@@ -274,7 +274,8 @@ class Task extends CommonObject
}
$sql .= " WHERE ";
if (!empty($ref)) {
- $sql .= "t.ref = '".$this->db->escape($ref)."'";
+ $sql .= "entity IN (".getEntity('project').")";
+ $sql .= " AND t.ref = '".$this->db->escape($ref)."'";
} else {
$sql .= "t.rowid = ".((int) $id);
}
diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php
index d40d75c0acf..2aaeb12de23 100644
--- a/htdocs/public/agenda/agendaexport.php
+++ b/htdocs/public/agenda/agendaexport.php
@@ -96,9 +96,9 @@ if (!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) {
$format = 'ical';
$type = 'event';
if (GETPOST("format", 'alpha')) {
- $format = GETPOST("format", 'apha');
+ $format = GETPOST("format", 'alpha');
}
-if (GETPOST("type", 'apha')) {
+if (GETPOST("type", 'alpha')) {
$type = GETPOST("type", 'alpha');
}
@@ -115,20 +115,20 @@ if (GETPOST("idfrom", 'int')) {
if (GETPOST("idto", 'int')) {
$filters['idto'] = GETPOST("idto", 'int');
}
-if (GETPOST("project", 'apha')) {
- $filters['project'] = GETPOST("project", 'apha');
+if (GETPOST("project", 'alpha')) {
+ $filters['project'] = GETPOST("project", 'alpha');
}
-if (GETPOST("logina", 'apha')) {
- $filters['logina'] = GETPOST("logina", 'apha');
+if (GETPOST("logina", 'alpha')) {
+ $filters['logina'] = GETPOST("logina", 'alpha');
}
-if (GETPOST("logint", 'apha')) {
- $filters['logint'] = GETPOST("logint", 'apha');
+if (GETPOST("logint", 'alpha')) {
+ $filters['logint'] = GETPOST("logint", 'alpha');
}
-if (GETPOST("notactiontype", 'apha')) {
- $filters['notactiontype'] = GETPOST("notactiontype", 'apha');
+if (GETPOST("notactiontype", 'alpha')) {
+ $filters['notactiontype'] = GETPOST("notactiontype", 'alpha');
}
-if (GETPOST("actiontype", 'apha')) {
- $filters['actiontype'] = GETPOST("actiontype", 'apha');
+if (GETPOST("actiontype", 'alpha')) {
+ $filters['actiontype'] = GETPOST("actiontype", 'alpha');
}
if (GETPOST("notolderthan", 'int')) {
$filters['notolderthan'] = GETPOST("notolderthan", "int");
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 3d03a97a59f..1165d6a9fd7 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -852,7 +852,7 @@ if (empty($reshook)) {
// Set parent company
if ($action == 'set_thirdparty' && $user->rights->societe->creer) {
$object->fetch($socid);
- $result = $object->set_parent(GETPOST('parent_id', 'int'));
+ $result = $object->setParent(GETPOST('parent_id', 'int'));
}
// Set sales representatives
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 6def79ac36d..7554ad2fbe2 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -3321,34 +3321,37 @@ class Societe extends CommonObject
}
}
- // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Define parent commany of current company
*
* @param int $id Id of thirdparty to set or '' to remove
* @return int <0 if KO, >0 if OK
*/
- public function set_parent($id)
+ public function setParent($id)
{
- // phpcs:enable
+ dol_syslog(get_class($this).'::setParent', LOG_DEBUG);
+
if ($this->id) {
// Check if the id we want to add as parent has not already one parent that is the current id we try to update
- $sameparent = $this->validateFamilyTree($id, $this->id, 0);
- if ($sameparent < 0) {
- return -1;
- } elseif ($sameparent == 1) {
- setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings');
- return -1;
- } else {
- $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id);
- dol_syslog(get_class($this).'::set_parent', LOG_DEBUG);
- $resql = $this->db->query($sql);
- if ($resql) {
- $this->parent = $id;
- return 1;
- } else {
+ if ($id > 0) {
+ $sameparent = $this->validateFamilyTree($id, $this->id, 0);
+ if ($sameparent < 0) {
return -1;
}
+ if ($sameparent == 1) {
+ setEventMessages('ParentCompanyToAddIsAlreadyAChildOfModifiedCompany', null, 'warnings');
+ return -1;
+ }
+ }
+
+ $sql = 'UPDATE '.MAIN_DB_PREFIX.'societe SET parent = '.($id > 0 ? $id : 'null').' WHERE rowid = '.((int) $this->id);
+
+ $resql = $this->db->query($sql);
+ if ($resql) {
+ $this->parent = $id;
+ return 1;
+ } else {
+ return -1;
}
} else {
return -1;
@@ -3363,15 +3366,15 @@ class Societe extends CommonObject
* @param int $counter Counter to protect against infinite loops
* @return int <0 if KO, 0 if OK or 1 if at some level a parent company was the child to compare to
*/
- public function validateFamilyTree($idparent, $idchild, $counter = 0)
+ public function validateFamilyTree($idparent, $idchild, $counter = 0)
{
if ($counter > 100) {
dol_syslog("Too high level of parent - child for company. May be an infinite loop ?", LOG_WARNING);
}
- $sql = 'SELECT s.parent';
- $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
- $sql .= ' WHERE rowid = '.$idparent;
+ $sql = 'SELECT s.parent';
+ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
+ $sql .= ' WHERE rowid = '.$idparent;
$resql = $this->db->query($sql);
if ($resql) {
$obj = $this->db->fetch_object($resql);
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index 1f9e6c32b2b..d51fd21279e 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -289,6 +289,8 @@ function LoadProducts(position, issubcat) {
if (currentcat==val.fk_parent) {
$("#prodivdesc"+ishow).show();
$("#prodesc"+ishow).text(val.label);
+ $("#probutton"+ishow).text(val.label);
+ $("#probutton"+ishow).show();
$("#proprice"+ishow).attr("class", "hidden");
$("#proprice"+ishow).html("");
$("#proimg"+ishow).attr("src","genimg/index.php?query=cat&id="+val.rowid);
@@ -386,6 +388,8 @@ function MoreProducts(moreorless) {
if (typeof (data[idata]) == "undefined") {
$("#prodivdesc"+ishow).hide();
$("#prodesc"+ishow).text("");
+ $("#probutton"+ishow).text("");
+ $("#probutton"+ishow).hide();
$("#proprice"+ishow).attr("class", "");
$("#proprice"+ishow).html("");
$("#proimg"+ishow).attr("src","genimg/empty.png");
@@ -396,6 +400,8 @@ function MoreProducts(moreorless) {
//Only show products with status=1 (for sell)
$("#prodivdesc"+ishow).show();
$("#prodesc"+ishow).text(data[parseInt(idata)]['label']);
+ $("#probutton"+ishow).text(data[parseInt(idata)]['label']);
+ $("#probutton"+ishow).show();
if (data[parseInt(idata)]['price_formated']) {
$("#proprice"+ishow).attr("class", "productprice");
$("#proprice"+ishow).html(data[parseInt(idata)]['price_formated']);
@@ -544,6 +550,8 @@ function Search2(keyCodeForEnter) {
for (i = 0; i < ; i++) {
if (typeof (data[i]) == "undefined") {
$("#prodesc" + i).text("");
+ $("#probutton" + i).text("");
+ $("#probutton" + i).hide();
$("#proprice" + i).attr("class", "hidden");
$("#proprice" + i).html("");
$("#proimg" + i).attr("src", "genimg/empty.png");
@@ -557,6 +565,8 @@ function Search2(keyCodeForEnter) {
var titlestring = ;
$("#prodesc" + i).text(data[i]['label']);
$("#prodivdesc" + i).show();
+ $("#probutton" + i).text(data[i]['label']);
+ $("#probutton" + i).show();
if (data[i]['price_formated']) {
$("#proprice" + i).attr("class", "productprice");
$("#proprice" + i).html(data[i]['price_formated']);
diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php
index 6c705c62489..4468c36a7da 100644
--- a/htdocs/theme/eldy/global.inc.php
+++ b/htdocs/theme/eldy/global.inc.php
@@ -633,6 +633,9 @@ th .button {
.quatrevingtquinzepercent {
width: 95%;
}
+.quatrevingtpercentminusx {
+ width: calc(80% - 52px);
+}
textarea.centpercent {
width: 96%;
}
diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php
index 407a38ea320..f1fb649f4af 100644
--- a/htdocs/theme/md/style.css.php
+++ b/htdocs/theme/md/style.css.php
@@ -780,6 +780,9 @@ th .button {
textarea.centpercent {
width: 96%;
}
+.quatrevingtpercentminusx {
+ width: calc(80% - 52px);
+}
.small, small {
font-size: 85%;
}
diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php
index 356e23a5de0..0b179653487 100644
--- a/htdocs/user/bank.php
+++ b/htdocs/user/bank.php
@@ -59,6 +59,29 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
$feature2 = (($socid && $user->rights->user->self->creer) ? '' : 'user');
+
+$object = new User($db);
+if ($id > 0 || !empty($ref)) {
+ $result = $object->fetch($id, $ref, '', 1);
+ $object->getrights();
+}
+
+$account = new UserBankAccount($db);
+if (!$bankid) {
+ $account->fetch(0, '', $id);
+} else {
+ $account->fetch($bankid);
+}
+if (empty($account->userid)) {
+ $account->userid = $object->id;
+}
+
+
+// Define value to know what current user can do on users
+$canadduser = (!empty($user->admin) || $user->rights->user->user->creer);
+$canreaduser = (!empty($user->admin) || $user->rights->user->user->lire);
+$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer));
+
// Ok if user->rights->salaries->read or user->rights->hrm->read
//$result = restrictedArea($user, 'salaries|hrm', $id, 'user&user', $feature2);
$ok = false;
@@ -78,30 +101,12 @@ if (!$ok) {
accessforbidden();
}
-$object = new User($db);
-if ($id > 0 || !empty($ref)) {
- $result = $object->fetch($id, $ref, '', 1);
- $object->getrights();
-}
-
-$account = new UserBankAccount($db);
-if (!$bankid) {
- $account->fetch(0, '', $id);
-} else {
- $account->fetch($bankid);
-}
-if (empty($account->userid)) {
- $account->userid = $object->id;
-}
-
-$permissiontoaddbankaccount = (!empty($user->rights->salaries->write) || !empty($user->rights->hrm->employee->write) || !empty($user->rights->user->creer));
-
/*
* Actions
*/
-if ($action == 'add' && !$cancel) {
+if ($action == 'add' && !$cancel && $permissiontoaddbankaccount) {
$account->userid = $object->id;
$account->bank = GETPOST('bank', 'alpha');
@@ -128,7 +133,7 @@ if ($action == 'add' && !$cancel) {
}
}
-if ($action == 'update' && !$cancel) {
+if ($action == 'update' && !$cancel && $permissiontoaddbankaccount) {
$account->userid = $object->id;
/*
@@ -199,7 +204,7 @@ if ($action == 'update' && !$cancel) {
}
// update personal email
-if ($action == 'setpersonal_email') {
+if ($action == 'setpersonal_email' && $canadduser) {
$object->personal_email = (string) GETPOST('personal_email', 'alphanohtml');
$result = $object->update($user);
if ($result < 0) {
@@ -208,7 +213,7 @@ if ($action == 'setpersonal_email') {
}
// update personal mobile
-if ($action == 'setpersonal_mobile') {
+if ($action == 'setpersonal_mobile' && $canadduser) {
$object->personal_mobile = (string) GETPOST('personal_mobile', 'alphanohtml');
$result = $object->update($user);
if ($result < 0) {
@@ -216,25 +221,26 @@ if ($action == 'setpersonal_mobile') {
}
}
-// update default_c_exp_tax_cat
-if ($action == 'setdefault_c_exp_tax_cat') {
- $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat', 'int');
- $result = $object->update($user);
- if ($result < 0) {
- setEventMessages($object->error, $object->errors, 'errors');
+if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) {
+ // update default_c_exp_tax_cat
+ if ($action == 'setdefault_c_exp_tax_cat' && $canadduser) {
+ $object->default_c_exp_tax_cat = GETPOST('default_c_exp_tax_cat', 'int');
+ $result = $object->update($user);
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
+ }
+
+ // update default range
+ if ($action == 'setdefault_range' && $canadduser) {
+ $object->default_range = GETPOST('default_range', 'int');
+ $result = $object->update($user);
+ if ($result < 0) {
+ setEventMessages($object->error, $object->errors, 'errors');
+ }
}
}
-// update default range
-if ($action == 'setdefault_range') {
- $object->default_range = GETPOST('default_range', 'int');
- $result = $object->update($user);
- if ($result < 0) {
- setEventMessages($object->error, $object->errors, 'errors');
- }
-}
-
-
/*
* View
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 7c1cb1b3f7e..073438bda1f 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -615,8 +615,8 @@ if (empty($reshook)) {
}
// Action initialisation donnees depuis record LDAP
- if ($action == 'adduserldap') {
- $selecteduser = $_POST['users'];
+ if ($action == 'adduserldap' && $canadduser) {
+ $selecteduser = GETPOST('users');
$required_fields = array(
$conf->global->LDAP_KEY_USERS,
diff --git a/htdocs/user/list.php b/htdocs/user/list.php
index ed1d2ae3dea..693590ff7d2 100644
--- a/htdocs/user/list.php
+++ b/htdocs/user/list.php
@@ -188,7 +188,7 @@ if ($mode == 'employee') {
accessforbidden();
}
} else {
- if (!$user->rights->user->user->lire && !$user->admin) {
+ if (empty($user->rights->user->user->lire) && empty($user->admin)) {
accessforbidden();
}
}
@@ -931,7 +931,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
$totalarray['nbfield']++;
}
}
-
+
if (!empty($arrayfields['u.office_phone']['checked'])) {
print "
".dol_print_phone($obj->office_phone, $obj->country_code, 0, $obj->rowid, 'AC_TEL', ' ', 'phone')." \n";
if (!$i) {
diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php
index ded3a1bb8b9..a7ad432b3ba 100644
--- a/htdocs/variants/combinations.php
+++ b/htdocs/variants/combinations.php
@@ -51,7 +51,6 @@ $delete_product = GETPOST('delete_product', 'alpha');
// Security check
$fieldvalue = (!empty($id) ? $id : $ref);
$fieldtype = (!empty($ref) ? 'ref' : 'rowid');
-$result = restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
$prodstatic = new Product($db);
$prodattr = new ProductAttribute($db);
@@ -64,8 +63,6 @@ if ($id > 0 || $ref) {
$selectedvariant = $_SESSION['addvariant_'.$object->id];
-$permissiontoread = $user->rights->produit->lire || $user->rights->service->lire;
-
// Security check
if (empty($conf->variants->enabled)) {
accessforbidden('Module not enabled');
@@ -73,8 +70,17 @@ if (empty($conf->variants->enabled)) {
if ($user->socid > 0) { // Protection if external user
accessforbidden();
}
-//$result = restrictedArea($user, 'variant');
-if (!$permissiontoread) accessforbidden();
+
+if ($object->id > 0) {
+ if ($object->type == $object::TYPE_PRODUCT) {
+ restrictedArea($user, 'produit', $object->id, 'product&product', '', '');
+ }
+ if ($object->type == $object::TYPE_SERVICE) {
+ restrictedArea($user, 'service', $object->id, 'product&product', '', '');
+ }
+} else {
+ restrictedArea($user, 'produit|service', $fieldvalue, 'product&product', '', '', $fieldtype);
+}
/*
diff --git a/test/phpunit/SecurityTest.php b/test/phpunit/SecurityTest.php
index bd4d0e9b76d..944d4f4cbe5 100644
--- a/test/phpunit/SecurityTest.php
+++ b/test/phpunit/SecurityTest.php
@@ -302,6 +302,10 @@ class SecurityTest extends PHPUnit\Framework\TestCase
$test="
rror=alert(document.location)";
$result=testSqlAndScriptInject($test, 0);
$this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject kkk');
+
+ $test="
XSS ";
+ $result=testSqlAndScriptInject($test, 0);
+ $this->assertGreaterThanOrEqual($expectedresult, $result, 'Error on testSqlAndScriptInject lll');
}
/**