\n";
if ($action == '') {
if ($user->rights->produit->creer || $user->rights->service->creer) {
- print '
'.$langs->trans('Add').'';
+ print '
'.$langs->trans('Add').'';
if ($cnt_trans > 0) {
- print '
'.$langs->trans('Update').'';
+ print '
'.$langs->trans('Update').'';
}
}
}
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 8a10b39826f..e56a2e89fcf 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1688,7 +1688,7 @@ if ($id > 0) {
print img_picto('', 'project', 'class="paddingrightonly"');
$numprojet = $formproject->select_projects(($object->socid > 0 ? $object->socid : -1), $object->fk_project, 'projectid', 0, 0, 1, 0, 0, 0, 0, '', 0, 0, 'maxwidth500');
if ($numprojet == 0) {
- print '
id.'&action=edit').'">';
+ print '
id.'&action=edit').'">';
}
print '';
}
@@ -2168,7 +2168,7 @@ if ($id > 0) {
if ($action != 'edit') {
if ($user->rights->agenda->allactions->create ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
- print '
';
+ print '
';
} else {
print '
';
}
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 79fb13a8717..4a7128fa865 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -865,6 +865,7 @@ class ActionComm extends CommonObject
$this->fetchResources();
}
}
+
$this->db->free($resql);
} else {
$this->error = $this->db->lasterror();
@@ -1245,7 +1246,6 @@ class ActionComm extends CommonObject
* Load all objects with filters.
* @todo WARNING: This make a fetch on all records instead of making one request with a join.
*
- * @param DoliDb $db Not used
* @param int $socid Filter by thirdparty
* @param int $fk_element Id of element action is linked to
* @param string $elementtype Type of element action is linked to
@@ -1255,7 +1255,7 @@ class ActionComm extends CommonObject
* @param string $limit Limit number of answers
* @return array|string Error string if KO, array with actions if OK
*/
- public static function getActions($db, $socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
+ public function getActions($socid = 0, $fk_element = 0, $elementtype = '', $filter = '', $sortfield = 'a.datep', $sortorder = 'DESC', $limit = 0)
{
global $conf, $langs;
@@ -1277,33 +1277,33 @@ class ActionComm extends CommonObject
$sql .= " (SELECT fk_actioncomm FROM ".MAIN_DB_PREFIX."actioncomm_resources WHERE";
$sql .= " element_type = 'socpeople' AND fk_element = ".((int) $fk_element).')';
} else {
- $sql .= " AND a.fk_element = ".((int) $fk_element)." AND a.elementtype = '".$db->escape($elementtype)."'";
+ $sql .= " AND a.fk_element = ".((int) $fk_element)." AND a.elementtype = '".$this->db->escape($elementtype)."'";
}
}
if (!empty($filter)) {
$sql .= $filter;
}
if ($sortorder && $sortfield) {
- $sql .= $db->order($sortfield, $sortorder);
+ $sql .= $this->db->order($sortfield, $sortorder);
}
- $sql .= $db->plimit($limit, 0);
+ $sql .= $this->db->plimit($limit, 0);
- $resql = $db->query($sql);
+ $resql = $this->db->query($sql);
if ($resql) {
- $num = $db->num_rows($resql);
+ $num = $this->db->num_rows($resql);
if ($num) {
for ($i = 0; $i < $num; $i++) {
- $obj = $db->fetch_object($resql);
- $actioncommstatic = new ActionComm($db);
+ $obj = $this->db->fetch_object($resql);
+ $actioncommstatic = new ActionComm($this->db);
$actioncommstatic->fetch($obj->id);
$resarray[$i] = $actioncommstatic;
}
}
- $db->free($resql);
+ $this->db->free($resql);
return $resarray;
} else {
- return $db->lasterror();
+ return $this->db->lasterror();
}
}
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index f891bf722cc..c8ec0621394 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -351,7 +351,7 @@ if ($object->id > 0) {
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
$tmpcheck = $object->check_codeclient();
if ($tmpcheck != 0 && $tmpcheck != -5) {
- print '
('.$langs->trans("WrongCustomerCode").')';
+ print '
('.$langs->trans("WrongCustomerCode").')';
}
print '';
@@ -406,7 +406,7 @@ if ($object->id > 0) {
print $langs->trans('PaymentConditions');
print '
';
if (($action != 'editconditions') && $user->rights->societe->creer) {
- print ' | id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
}
print '';
print '
';
@@ -424,7 +424,7 @@ if ($object->id > 0) {
print $langs->trans('PaymentMode');
print ' | ';
if (($action != 'editmode') && $user->rights->societe->creer) {
- print ' | id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
}
print '';
print '
';
@@ -443,7 +443,7 @@ if ($object->id > 0) {
print $langs->trans('PaymentBankAccount');
print ' | ';
if (($action != 'editbankaccount') && $user->rights->societe->creer) {
- print ' | id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
}
print '';
print '
';
@@ -569,7 +569,7 @@ if ($object->id > 0) {
print $langs->trans('SendingMethod');
print ' | ';
if (($action != 'editshipping') && $user->rights->societe->creer) {
- print ' | id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
}
print '';
print '
';
@@ -589,7 +589,7 @@ if ($object->id > 0) {
print $langs->trans('IntracommReportTransportMode');
print ' | ';
if (($action != 'edittransportmode') && $user->rights->societe->creer) {
- print ' | id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
}
print '';
print '
';
@@ -652,7 +652,7 @@ if ($object->id > 0) {
print $langs->trans('ProspectLevel');
print ' | ';
if ($action != 'editlevel' && $user->rights->societe->creer) {
- print ' | id.'">'.img_edit($langs->trans('Modify'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('Modify'), 1).' | ';
}
print '';
print '
';
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 2ed56683c02..614bedb8268 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -912,7 +912,7 @@ if ($action == 'create') {
}
}
if (empty($nbemail)) {
- $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").'';
+ $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").'';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
@@ -1161,7 +1161,7 @@ if ($action == 'create') {
}
}
if (empty($nbemail)) {
- $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").'';
+ $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").'';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 3283957f8a2..340ac1dfc8c 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -284,7 +284,7 @@ if ($object->fetch($id) >= 0) {
}
}
if (empty($nbemail)) {
- $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").'';
+ $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").'';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
@@ -378,7 +378,7 @@ if ($object->fetch($id) >= 0) {
$var = !$var;
if ($allowaddtarget) {
- print ' | ';
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
}
print '';
print '
';
@@ -2120,7 +2120,7 @@ if ($action == 'create') {
print $langs->trans('DateEndPropal');
print ' | ';
if ($action != 'editecheance' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
}
print '';
print '
';
@@ -2150,7 +2150,7 @@ if ($action == 'create') {
print $langs->trans('PaymentConditionsShort');
print ' | ';
if ($action != 'editconditions' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetConditions'), 1).' | ';
}
print '';
print '
';
@@ -2169,7 +2169,7 @@ if ($action == 'create') {
print $langs->trans('PaymentMode');
print ' | ';
if ($action != 'editmode' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMode'), 1).' | ';
}
print '';
print '
';
@@ -2198,7 +2198,7 @@ if ($action == 'create') {
}
print ' | ';
if ($action != 'editavailability' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetAvailability'), 1).' | ';
}
print '';
print '
';
@@ -2218,7 +2218,7 @@ if ($action == 'create') {
print $langs->trans('SendingMethod');
print ' | ';
if ($action != 'editshippingmethod' && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetShippingMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetShippingMode'), 1).' | ';
}
print '';
print '
';
@@ -2255,7 +2255,7 @@ if ($action == 'create') {
print $langs->trans('Source');
print ' | ';
if ($action != 'editdemandreason' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetDemandReason'), 1).' | ';
}
print '';
print '
';
@@ -2276,7 +2276,7 @@ if ($action == 'create') {
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
print ' | ';
if ($action != 'editmulticurrencycode' && $object->statut == $object::STATUS_DRAFT && $usercancreate) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
}
print '';
print '
';
@@ -2296,7 +2296,7 @@ if ($action == 'create') {
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
print ' | ';
if ($action != 'editmulticurrencyrate' && $object->statut == $object::STATUS_DRAFT && $object->multicurrency_code && $object->multicurrency_code != $conf->currency && $usercancreate) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
}
print '';
print '
';
@@ -2337,7 +2337,7 @@ if ($action == 'create') {
print $langs->trans('BankAccount');
print ' | ';
if ($action != 'editbankaccount' && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
}
print '';
print '
';
@@ -2373,7 +2373,7 @@ if ($action == 'create') {
print $langs->trans('IncotermLabel');
print ' | | ';
if ($usercancreate) {
- print ''.img_edit().'';
+ print ''.img_edit().'';
} else {
print ' ';
}
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index da651bfdcd3..269cf9cfd91 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -13,9 +13,9 @@
* Copyright (C) 2016-2021 Ferran Marcet
* Copyright (C) 2017-2018 Charlene Benke
* Copyright (C) 2018 Nicolas ZABOURI
- * Copyright (C) 2019 Alexandre Spangaro
+ * Copyright (C) 2019-2021 Alexandre Spangaro
* Copyright (C) 2021 Anthony Berton
- * Copyright (C) 2021 Frédéric France
+ * Copyright (C) 2021 Frédéric France
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -88,12 +88,30 @@ $search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state");
$search_country = GETPOST("search_country", 'int');
$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
-$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
-$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
-$search_dateend_start = dol_mktime(0, 0, 0, GETPOST('search_dateend_startmonth', 'int'), GETPOST('search_dateend_startday', 'int'), GETPOST('search_dateend_startyear', 'int'));
-$search_dateend_end = dol_mktime(23, 59, 59, GETPOST('search_dateend_endmonth', 'int'), GETPOST('search_dateend_endday', 'int'), GETPOST('search_dateend_endyear', 'int'));
-$search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
-$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
+$search_date_startday = GETPOST('search_date_startday', 'int');
+$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
+$search_date_startyear = GETPOST('search_date_startyear', 'int');
+$search_date_endday = GETPOST('search_date_endday', 'int');
+$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
+$search_date_endyear = GETPOST('search_date_endyear', 'int');
+$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
+$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
+$search_date_end_startday = GETPOST('search_date_end_startday', 'int');
+$search_date_end_startmonth = GETPOST('search_date_end_startmonth', 'int');
+$search_date_end_startyear = GETPOST('search_date_end_startyear', 'int');
+$search_date_end_endday = GETPOST('search_date_end_endday', 'int');
+$search_date_end_endmonth = GETPOST('search_date_end_endmonth', 'int');
+$search_date_end_endyear = GETPOST('search_date_end_endyear', 'int');
+$search_date_end_start = dol_mktime(0, 0, 0, $search_date_end_startmonth, $search_date_end_startday, $search_date_end_startyear); // Use tzserver
+$search_date_end_end = dol_mktime(23, 59, 59, $search_date_end_endmonth, $search_date_end_endday, $search_date_end_endyear);
+$search_date_delivery_startday = GETPOST('search_date_delivery_startday', 'int');
+$search_date_delivery_startmonth = GETPOST('search_date_delivery_startmonth', 'int');
+$search_date_delivery_startyear = GETPOST('search_date_delivery_startyear', 'int');
+$search_date_delivery_endday = GETPOST('search_date_delivery_endday', 'int');
+$search_date_delivery_endmonth = GETPOST('search_date_delivery_endmonth', 'int');
+$search_date_delivery_endyear = GETPOST('search_date_delivery_endyear', 'int');
+$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
+$search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
$search_availability = GETPOST('search_availability', 'int');
$search_categ_cus = GETPOST("search_categ_cus", 'int');
$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'int');
@@ -278,12 +296,30 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x'
$search_type = '';
$search_country = '';
$search_type_thirdparty = '';
+ $search_date_startday = '';
+ $search_date_startmonth = '';
+ $search_date_startyear = '';
+ $search_date_endday = '';
+ $search_date_endmonth = '';
+ $search_date_endyear = '';
$search_date_start = '';
$search_date_end = '';
- $search_dateend_start = '';
- $search_dateend_end = '';
- $search_datedelivery_start = '';
- $search_datedelivery_end = '';
+ $search_date_end_startday = '';
+ $search_date_end_startmonth = '';
+ $search_date_end_startyear = '';
+ $search_date_end_endday = '';
+ $search_date_end_endmonth = '';
+ $search_date_end_endyear = '';
+ $search_date_end_start = '';
+ $search_date_end_end = '';
+ $search_date_delivery_startday = '';
+ $search_date_delivery_startmonth = '';
+ $search_date_delivery_startyear = '';
+ $search_date_delivery_endday = '';
+ $search_date_delivery_endmonth = '';
+ $search_date_delivery_endyear = '';
+ $search_date_delivery_start = '';
+ $search_date_delivery_end = '';
$search_availability = '';
$search_status = '';
$object_statut = '';
@@ -472,7 +508,7 @@ $sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date
$sql .= ' p.note_public, p.note_private,';
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
-$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
+$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
if (!$user->rights->societe->client->voir && !$socid) {
$sql .= ", sc.fk_soc, sc.fk_user";
}
@@ -635,17 +671,17 @@ if ($search_date_start) {
if ($search_date_end) {
$sql .= " AND p.datep <= '".$db->idate($search_date_end)."'";
}
-if ($search_dateend_start) {
- $sql .= " AND p.fin_validite >= '".$db->idate($search_dateend_start)."'";
+if ($search_date_end_start) {
+ $sql .= " AND p.fin_validite >= '".$db->idate($search_date_end_start)."'";
}
-if ($search_dateend_end) {
- $sql .= " AND p.fin_validite <= '".$db->idate($search_dateend_end)."'";
+if ($search_date_end_end) {
+ $sql .= " AND p.fin_validite <= '".$db->idate($search_date_end_end)."'";
}
-if ($search_datedelivery_start) {
- $sql .= " AND p.date_livraison >= '".$db->idate($search_datedelivery_start)."'";
+if ($search_date_delivery_start) {
+ $sql .= " AND p.date_livraison >= '".$db->idate($search_date_delivery_start)."'";
}
-if ($search_datedelivery_end) {
- $sql .= " AND p.date_livraison <= '".$db->idate($search_datedelivery_end)."'";
+if ($search_date_delivery_end) {
+ $sql .= " AND p.date_livraison <= '".$db->idate($search_date_delivery_end)."'";
}
if ($search_sale > 0) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
@@ -720,12 +756,60 @@ if ($resql) {
if ($sall) {
$param .= '&sall='.urlencode($sall);
}
- if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y'));
- if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y'));
- if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y'));
- if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y'));
- if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
- if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
+ if ($search_date_startday) {
+ $param .= '&search_date_startday='.urlencode($search_date_startday);
+ }
+ if ($search_date_startmonth) {
+ $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
+ }
+ if ($search_date_startyear) {
+ $param .= '&search_date_startyear='.urlencode($search_date_startyear);
+ }
+ if ($search_date_endday) {
+ $param .= '&search_date_endday='.urlencode($search_date_endday);
+ }
+ if ($search_date_endmonth) {
+ $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
+ }
+ if ($search_date_endyear) {
+ $param .= '&search_date_endyear='.urlencode($search_date_endyear);
+ }
+ if ($search_date_end_startday) {
+ $param .= '&search_date_end_startday='.urlencode($search_date_end_startday);
+ }
+ if ($search_date_end_startmonth) {
+ $param .= '&search_date_end_startmonth='.urlencode($search_date_end_startmonth);
+ }
+ if ($search_date_end_startyear) {
+ $param .= '&search_date_end_startyear='.urlencode($search_date_end_startyear);
+ }
+ if ($search_date_end_endday) {
+ $param .= '&search_date_end_endday='.urlencode($search_date_end_endday);
+ }
+ if ($search_date_end_endmonth) {
+ $param .= '&search_date_end_endmonth='.urlencode($search_date_end_endmonth);
+ }
+ if ($search_date_end_endyear) {
+ $param .= '&search_date_end_endyear='.urlencode($search_date_end_endyear);
+ }
+ if ($search_date_delivery_startday) {
+ $param .= '&search_date_delivery_startday='.urlencode($search_date_delivery_startday);
+ }
+ if ($search_date_delivery_startmonth) {
+ $param .= '&search_date_delivery_startmonth='.urlencode($search_date_delivery_startmonth);
+ }
+ if ($search_date_delivery_startyear) {
+ $param .= '&search_date_delivery_startyear='.urlencode($search_date_delivery_startyear);
+ }
+ if ($search_date_delivery_endday) {
+ $param .= '&search_date_delivery_endday='.urlencode($search_date_delivery_endday);
+ }
+ if ($search_date_delivery_endmonth) {
+ $param .= '&search_date_delivery_endmonth='.urlencode($search_date_delivery_endmonth);
+ }
+ if ($search_date_delivery_endyear) {
+ $param .= '&search_date_delivery_endyear='.urlencode($search_date_delivery_endyear);
+ }
if ($search_ref) {
$param .= '&search_ref='.urlencode($search_ref);
}
@@ -1025,10 +1109,10 @@ if ($resql) {
if (!empty($arrayfields['p.fin_validite']['checked'])) {
print '| ';
print ' ';
- print $form->selectDate($search_dateend_start ? $search_dateend_start : -1, 'search_dateend_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print $form->selectDate($search_date_end_start ? $search_date_end_start : -1, 'search_date_end_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print ' ';
print '';
- print $form->selectDate($search_dateend_end ? $search_dateend_end : -1, 'search_dateend_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
+ print $form->selectDate($search_date_end_end ? $search_date_end_end : -1, 'search_date_end_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
print ' ';
print ' | ';
}
@@ -1036,10 +1120,10 @@ if ($resql) {
if (!empty($arrayfields['p.date_livraison']['checked'])) {
print '';
print ' ';
- print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1, 'search_datedelivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print $form->selectDate($search_date_delivery_start ? $search_date_delivery_start : -1, 'search_date_delivery_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print ' ';
print '';
- print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1, 'search_datedelivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
+ print $form->selectDate($search_date_delivery_end ? $search_date_delivery_end : -1, 'search_date_delivery_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
print ' ';
print ' | ';
}
@@ -1716,8 +1800,8 @@ if ($resql) {
$userstatic->login = $obj->login;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
- $userstatic->email = $obj->email;
- $userstatic->statut = $obj->statut;
+ $userstatic->email = $obj->user_email;
+ $userstatic->statut = $obj->user_statut;
$userstatic->entity = $obj->user_entity;
$userstatic->photo = $obj->photo;
$userstatic->office_phone = $obj->office_phone;
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 5fce8a81a30..e3675129198 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -299,13 +299,9 @@ class Commande extends CommonOrder
'ref_client' =>array('type'=>'varchar(255)', 'label'=>'RefCustomer', 'enabled'=>1, 'visible'=>-1, 'position'=>28),
'fk_soc' =>array('type'=>'integer:Societe:societe/class/societe.class.php', 'label'=>'ThirdParty', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>20),
'fk_projet' =>array('type'=>'integer:Project:projet/class/project.class.php:1:fk_statut=1', 'label'=>'Project', 'enabled'=>1, 'visible'=>-1, 'position'=>25),
- 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>55),
- 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>56),
- 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>60),
+ 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>1, 'position'=>60),
+ 'date_valid' =>array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>62),
'date_cloture' =>array('type'=>'datetime', 'label'=>'DateClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>65),
- 'date_commande' =>array('type'=>'date', 'label'=>'Date', 'enabled'=>1, 'visible'=>-1, 'position'=>70),
- 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>75),
- 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>80),
'fk_user_valid' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>85),
'fk_user_cloture' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserClosing', 'enabled'=>1, 'visible'=>-1, 'position'=>90),
'source' =>array('type'=>'smallint(6)', 'label'=>'Source', 'enabled'=>1, 'visible'=>-1, 'position'=>95),
@@ -344,6 +340,10 @@ class Commande extends CommonOrder
'last_main_doc' =>array('type'=>'varchar(255)', 'label'=>'LastMainDoc', 'enabled'=>1, 'visible'=>-1, 'position'=>270),
'module_source' =>array('type'=>'varchar(32)', 'label'=>'POSModule', 'enabled'=>1, 'visible'=>-1, 'position'=>275),
'pos_source' =>array('type'=>'varchar(32)', 'label'=>'POSTerminal', 'enabled'=>1, 'visible'=>-1, 'position'=>280),
+ 'fk_user_author' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserAuthor', 'enabled'=>1, 'visible'=>-1, 'position'=>300),
+ 'fk_user_modif' =>array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'enabled'=>1, 'visible'=>-2, 'notnull'=>-1, 'position'=>302),
+ 'date_creation' =>array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-1, 'position'=>304),
+ 'tms' =>array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-1, 'notnull'=>1, 'position'=>306),
'import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>400),
'fk_statut' =>array('type'=>'smallint(6)', 'label'=>'Status', 'enabled'=>1, 'visible'=>-1, 'position'=>500),
);
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 22b24c048a2..4e8a18821ff 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -428,7 +428,7 @@ $sql .= ' c.fk_multicurrency, c.multicurrency_code, c.multicurrency_tx, c.multic
$sql .= ' c.date_valid, c.date_commande, c.note_public, c.note_private, c.date_livraison as date_delivery, c.fk_statut, c.facture as billed,';
$sql .= ' c.date_creation as date_creation, c.tms as date_update, c.date_cloture as date_cloture,';
$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,';
-$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,';
+$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender,';
$sql .= ' c.fk_cond_reglement,c.fk_mode_reglement,c.fk_shipping_method,';
$sql .= ' c.fk_input_reason';
if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
@@ -553,7 +553,7 @@ if ($search_state) {
if ($search_country) {
$sql .= " AND s.fk_pays IN (".$db->sanitize($search_country).')';
}
-if ($search_type_thirdparty) {
+if ($search_type_thirdparty && $search_type_thirdparty != '-1') {
$sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')';
}
if ($search_company) {
@@ -795,7 +795,7 @@ if ($resql) {
if ($search_country != '') {
$param .= '&search_country='.urlencode($search_country);
}
- if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
+ if ($search_type_thirdparty && $search_type_thirdparty != '-1') {
$param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
}
if ($search_product_category != '') {
@@ -1697,8 +1697,8 @@ if ($resql) {
$userstatic->login = $obj->login;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
- $userstatic->email = $obj->email;
- $userstatic->statut = $obj->statut;
+ $userstatic->email = $obj->user_email;
+ $userstatic->statut = $obj->user_statut;
$userstatic->entity = $obj->entity;
$userstatic->photo = $obj->photo;
$userstatic->office_phone = $obj->office_phone;
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index f6a03c1d11d..eabe47e54ca 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -932,10 +932,10 @@ if ($resql) {
$newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.urlencode($search_account).'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)), '', $user->rights->banque->modifier);
} else // If direct entries is not done using miscellaneous payments
{
- $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', $user->rights->banque->modifier);
+ $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&token='.newToken().'&page='.$page.$param, '', $user->rights->banque->modifier);
}
} else {
- $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param, '', -1);
+ $newcardbutton = dolGetButtonTitle($langs->trans('AddBankRecord'), '', 'fa fa-plus-circle', $_SERVER["PHP_SELF"].'?action=addline&token='.newToken().'&page='.$page.$param, '', -1);
}
}
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 9fd88f44d4f..8396979e247 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -1503,7 +1503,7 @@ class Account extends CommonObject
{
$country_code = $this->getCountryCode();
- if (in_array($country_code, array('FR', 'ES', 'GA', 'IT', 'NC'))) {
+ if (in_array($country_code, array('AD', 'FR', 'ES', 'GA', 'IT', 'NC'))) {
return 1; // France, Spain, Gabon, ... - Not valid for CH
}
if (in_array($country_code, array('AU', 'BE', 'CA', 'DE', 'DK', 'GR', 'GB', 'ID', 'IE', 'IR', 'KR', 'NL', 'NZ', 'UK', 'US'))) {
@@ -1696,21 +1696,21 @@ class Account extends CommonObject
/**
* Function used to replace a thirdparty id with another one.
*
- * @param DoliDB $db Database handler
+ * @param DoliDB $dbs Database handler
* @param int $origin_id Old thirdparty id
* @param int $dest_id New thirdparty id
- * @return bool
+ * @return bool True=SQL success, False=SQL error
*/
- public static function replaceThirdparty($db, $origin_id, $dest_id)
+ public static function replaceThirdparty($dbs, $origin_id, $dest_id)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."bank_url SET url_id = ".((int) $dest_id)." WHERE url_id = ".((int) $origin_id)." AND type='company'";
- if (!$db->query($sql)) {
- //if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B.
- //$this->errors = $db->lasterror();
- return false;
- } else {
+ if ($dbs->query($sql)) {
return true;
+ } else {
+ //if ($ignoreerrors) return true; // TODO Not enough. If there is A-B on kept thirdarty and B-C on old one, we must get A-B-C after merge. Not A-B.
+ //$this->errors = $dbs->lasterror();
+ return false;
}
}
}
diff --git a/htdocs/compta/bank/releve.php b/htdocs/compta/bank/releve.php
index 97184c1b8eb..af0b388cb7a 100644
--- a/htdocs/compta/bank/releve.php
+++ b/htdocs/compta/bank/releve.php
@@ -364,7 +364,7 @@ if (empty($numref)) {
print '';
if ($user->rights->banque->consolidate && $action != 'editbankreceipt') {
- print 'id.($page > 0 ? '&page='.$page : '').'&action=editbankreceipt&brref='.$objp->numr.'">'.img_edit().'';
+ print 'id.($page > 0 ? '&page='.$page : '').'&action=editbankreceipt&token='.newToken().'&brref='.urlencode($objp->numr).'">'.img_edit().'';
}
print ' | ';
diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php
index 77db777c077..33b453cd0b4 100644
--- a/htdocs/compta/deplacement/card.php
+++ b/htdocs/compta/deplacement/card.php
@@ -469,7 +469,7 @@ if ($action == 'create') {
if ($object->statut < Deplacement::STATUS_REFUNDED) { // if not refunded
if ($user->rights->deplacement->creer) {
- print ''.$langs->trans('Modify').'';
+ print ''.$langs->trans('Modify').'';
} else {
print ''.$langs->trans('Modify').'';
}
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 153bd58114d..28143d0340a 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -1269,7 +1269,7 @@ if ($action == 'create') {
print $langs->trans('PaymentConditionsShort');
print ' | ';
if ($action != 'editconditions' && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
}
print '';
print '
';
@@ -1290,7 +1290,7 @@ if ($action == 'create') {
print $langs->trans('PaymentMode');
print ' | ';
if ($action != 'editmode' && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
}
print '';
print '
';
@@ -1310,7 +1310,7 @@ if ($action == 'create') {
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
print ' | ';
if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
}
print '';
print '
';
@@ -1326,7 +1326,7 @@ if ($action == 'create') {
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
print ' | ';
if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
}
print '';
print '
';
@@ -1398,7 +1398,7 @@ if ($action == 'create') {
print $langs->trans('BankAccount');
print ' | ';
if (($action != 'editbankaccount') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) {
- print ' | id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
}
print '';
print '
';
@@ -1416,7 +1416,7 @@ if ($action == 'create') {
print $langs->trans('Model');
print ' | ';
if (($action != 'editmodelpdf') && $user->rights->facture->creer && $object->statut == FactureRec::STATUS_DRAFT) {
- print ' | id.'">'.img_edit($langs->trans('SetModel'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetModel'), 1).' | ';
}
print '';
print '
';
@@ -1463,7 +1463,7 @@ if ($action == 'create') {
print $langs->trans('Frequency');
print ' | ';
if ($action != 'editfrequency' && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('Edit'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('Edit'), 1).' | ';
}
print '';
print '
';
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 7ddb90cd4da..764af7a232a 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4336,7 +4336,7 @@ if ($action == 'create') {
print $langs->trans('DateInvoice');
print ' | ';
if ($action != 'editinvoicedate' && !empty($object->brouillon) && $usercancreate && empty($conf->global->FAC_FORCE_DATE_VALIDATION)) {
- print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
}
print '';
print '
';
@@ -4356,7 +4356,7 @@ if ($action == 'create') {
print '';
print ' | ';
if ($action == 'editdate_pointoftax') {
@@ -4373,7 +4373,7 @@ if ($action == 'create') {
print $langs->trans('PaymentConditionsShort');
print ' | ';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editconditions' && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
}
print '';
print '
';
@@ -4394,7 +4394,7 @@ if ($action == 'create') {
print $langs->trans('DateMaxPayment');
print ' | ';
if ($object->type != Facture::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
}
print '';
print '
';
@@ -4418,7 +4418,7 @@ if ($action == 'create') {
print $langs->trans('PaymentMode');
print ' | ';
if ($action != 'editmode' && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
}
print '';
print '
';
@@ -4438,7 +4438,7 @@ if ($action == 'create') {
print $form->editfieldkey('Currency', 'multicurrency_code', '', $object, 0);
print ' | ';
if ($usercancreate && $action != 'editmulticurrencycode' && !empty($object->brouillon)) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
}
print '';
print '
';
@@ -4454,7 +4454,7 @@ if ($action == 'create') {
print $form->editfieldkey('CurrencyRate', 'multicurrency_tx', '', $object, 0);
print ' | ';
if ($usercancreate && $action != 'editmulticurrencyrate' && !empty($object->brouillon) && $object->multicurrency_code && $object->multicurrency_code != $conf->currency) {
- print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->transnoentitiesnoconv('SetMultiCurrencyCode'), 1).' | ';
}
print '';
print '
';
@@ -4482,7 +4482,7 @@ if ($action == 'create') {
print $langs->trans('BankAccount');
print ' | ';
if (($action != 'editbankaccount') && $usercancreate) {
- print ' | id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
}
print '';
print '
';
@@ -4502,7 +4502,7 @@ if ($action == 'create') {
print $langs->trans('IncotermLabel');
print ' | | ';
if ($usercancreate) {
- print ''.img_edit().'';
+ print ''.img_edit().'';
} else {
print ' ';
}
@@ -4532,7 +4532,7 @@ if ($action == 'create') {
print $langs->trans('RetainedWarranty');
print ' | ';
if ($action != 'editretainedwarranty' && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('setretainedwarranty'), 1).' | ';
}
print '';
@@ -4555,7 +4555,7 @@ if ($action == 'create') {
print $langs->trans('PaymentConditionsShortRetainedWarranty');
print '';
if ($action != 'editretainedwarrantypaymentterms' && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('setPaymentConditionsShortRetainedWarranty'), 1).' | ';
}
print '';
@@ -4590,7 +4590,7 @@ if ($action == 'create') {
print $langs->trans('RetainedWarrantyDateLimit');
print '';
if ($action != 'editretainedwarrantydatelimit' && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('setretainedwarrantyDateLimit'), 1).' | ';
}
print '';
@@ -4676,7 +4676,7 @@ if ($action == 'create') {
print $langs->trans('RevenueStamp');
print '';
if ($action != 'editrevenuestamp' && !empty($object->brouillon) && $usercancreate) {
- print '
id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).' | ';
}
print '';
print '
';
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 22cd946275c..4b49c88f8ca 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -5783,7 +5783,7 @@ class FactureLigne extends CommonInvoiceLine
return 0;
}
- $sql = 'SELECT situation_percent FROM '.MAIN_DB_PREFIX.'facturedet WHERE rowid='.((int) $this->fk_prev_id);
+ $sql = "SELECT situation_percent FROM ".MAIN_DB_PREFIX."facturedet WHERE rowid = ".((int) $this->fk_prev_id);
$resql = $this->db->query($sql);
if ($resql && $resql->num_rows > 0) {
$res = $this->db->fetch_array($resql);
@@ -5793,9 +5793,9 @@ class FactureLigne extends CommonInvoiceLine
if ($include_credit_note) {
$sql = 'SELECT fd.situation_percent FROM '.MAIN_DB_PREFIX.'facturedet fd';
$sql .= ' JOIN '.MAIN_DB_PREFIX.'facture f ON (f.rowid = fd.fk_facture) ';
- $sql .= ' WHERE fd.fk_prev_id = '.((int) $this->fk_prev_id);
- $sql .= ' AND f.situation_cycle_ref = '.((int) $invoicecache[$invoiceid]->situation_cycle_ref); // Prevent cycle outed
- $sql .= ' AND f.type = '.Facture::TYPE_CREDIT_NOTE;
+ $sql .= " WHERE fd.fk_prev_id = ".((int) $this->fk_prev_id);
+ $sql .= " AND f.situation_cycle_ref = ".((int) $invoicecache[$invoiceid]->situation_cycle_ref); // Prevent cycle outed
+ $sql .= " AND f.type = ".Facture::TYPE_CREDIT_NOTE;
$res = $this->db->query($sql);
if ($res) {
diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php
index d3d3a33acb5..790b9d334c3 100644
--- a/htdocs/compta/facture/index.php
+++ b/htdocs/compta/facture/index.php
@@ -16,7 +16,7 @@
*/
/**
- * \file htdocs/compat/facture/index.php
+ * \file htdocs/compta/facture/index.php
* \ingroup facture
* \brief Home page of customer invoices area
*/
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index e6a49cf6077..852589dbd1a 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -549,7 +549,7 @@ $sql .= ' typent.code as typent_code,';
$sql .= ' state.code_departement as state_code, state.nom as state_name,';
$sql .= ' country.code as country_code,';
$sql .= ' p.rowid as project_id, p.ref as project_ref, p.title as project_label,';
-$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
+$sql .= ' u.login, u.lastname, u.firstname, u.email as user_email, u.statut as user_statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
// We need dynamount_payed to be able to sort on status (value is surely wrong because we can count several lines several times due to other left join or link with contacts. But what we need is just 0 or > 0)
// TODO Better solution to be able to sort on already payed or remain to pay is to store amount_payed in a denormalized field.
if (!$sall) {
@@ -572,7 +572,7 @@ $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
-if (!empty($search_categ_cus) && $search_categ_cus!=-1) {
+if (!empty($search_categ_cus) && $search_categ_cus != '-1') {
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
}
@@ -1846,8 +1846,8 @@ if ($resql) {
}
// Alias
if (!empty($arrayfields['s.name_alias']['checked'])) {
- print ' | ';
- print $obj->name_alias;
+ print ' | ';
+ print dol_escape_htmltag($obj->name_alias);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -1855,8 +1855,8 @@ if ($resql) {
}
// Town
if (!empty($arrayfields['s.town']['checked'])) {
- print '
';
- print $obj->town;
+ print ' | ';
+ print dol_escape_htmltag($obj->town);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -1865,7 +1865,7 @@ if ($resql) {
// Zip
if (!empty($arrayfields['s.zip']['checked'])) {
print '
';
- print $obj->zip;
+ print dol_escape_htmltag($obj->zip);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -1873,7 +1873,7 @@ if ($resql) {
}
// State
if (!empty($arrayfields['state.nom']['checked'])) {
- print "
".$obj->state_name." | \n";
+ print "
".dol_escape_htmltag($obj->state_name)." | \n";
if (!$i) {
$totalarray['nbfield']++;
}
@@ -1936,7 +1936,7 @@ if ($resql) {
// Module Source
if (!empty($arrayfields['f.module_source']['checked'])) {
print '
';
- print $obj->module_source;
+ print dol_escape_htmltag($obj->module_source);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -1946,7 +1946,7 @@ if ($resql) {
// POS Terminal
if (!empty($arrayfields['f.pos_source']['checked'])) {
print '
';
- print $obj->pos_source;
+ print dol_escape_htmltag($obj->pos_source);
print ' | ';
if (!$i) {
$totalarray['nbfield']++;
@@ -2013,8 +2013,8 @@ if ($resql) {
$userstatic->login = $obj->login;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
- $userstatic->email = $obj->email;
- $userstatic->statut = $obj->statut;
+ $userstatic->email = $obj->user_email;
+ $userstatic->statut = $obj->user_statut;
$userstatic->entity = $obj->entity;
$userstatic->photo = $obj->photo;
$userstatic->office_phone = $obj->office_phone;
diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php
index e94fd6f5e1b..7e5a7047060 100644
--- a/htdocs/compta/facture/prelevement.php
+++ b/htdocs/compta/facture/prelevement.php
@@ -363,7 +363,7 @@ if ($object->id > 0) {
print $langs->trans('DateInvoice');
print '';
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editinvoicedate' && !empty($object->brouillon) && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
}
print '';
print '
';
@@ -386,7 +386,7 @@ if ($object->id > 0) {
print $langs->trans('PaymentConditionsShort');
print ' | ';
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editconditions' && !empty($object->brouillon) && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetConditions'), 1).' | ';
}
print '';
print '
';
@@ -407,7 +407,7 @@ if ($object->id > 0) {
print $langs->trans('DateMaxPayment');
print ' | ';
if ($object->type != $object::TYPE_CREDIT_NOTE && $action != 'editpaymentterm' && !empty($object->brouillon) && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
}
print '';
print '
';
@@ -436,7 +436,7 @@ if ($object->id > 0) {
print $langs->trans('PaymentMode');
print ' | ';
if ($action != 'editmode' && !empty($object->brouillon) && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetMode'), 1).' | ';
}
print '';
print '
';
@@ -453,7 +453,7 @@ if ($object->id > 0) {
print $langs->trans('BankAccount');
print ' | ';
if (($action != 'editbankaccount') && $user->rights->commande->creer && !empty($object->brouillon)) {
- print ' | id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetBankAccount'), 1).' | ';
}
print '';
print '
';
@@ -537,7 +537,7 @@ if ($object->id > 0) {
print $langs->trans('RevenueStamp');
print ' | ';
if ($action != 'editrevenuestamp' && !empty($object->brouillon) && $user->rights->facture->creer) {
- print '
id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).' | ';
+ print '
id.'">'.img_edit($langs->trans('SetRevenuStamp'), 1).' | ';
}
print '';
print '
';
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index ca7cd08a6fe..b0109d69fe5 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -206,6 +206,7 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
print ' | ';
print '';
+
print '| ';
print $tmpinvoice->getNomUrl(1, '');
print ' | ';
@@ -222,15 +223,19 @@ if (!empty($conf->facture->enabled) && !empty($user->rights->facture->lire)) {
print ' ';
print ' | ';
- print '
';
+
+ print ' | ';
print $thirdpartystatic->getNomUrl(1, 'customer', 44);
print ' | ';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
print '
'.price($obj->total_ht).' | ';
}
print '
'.price($obj->total_ttc).' | ';
+
print '
'.dol_print_date($db->jdate($obj->tms), 'day').' | ';
+
print '
'.$tmpinvoice->getLibStatut(3, $obj->am).' | ';
+
print '';
$total_ttc += $obj->total_ttc;
@@ -706,7 +711,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
print "\n";
}
- print '
| '.$langs->trans("Total").' ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') | ';
+ print '
| '.$langs->trans("Total").' ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') | ';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
print ''.price($tot_ht).' | ';
}
diff --git a/htdocs/compta/paiement/cheque/card.php b/htdocs/compta/paiement/cheque/card.php
index 61d295a29b0..9b235926421 100644
--- a/htdocs/compta/paiement/cheque/card.php
+++ b/htdocs/compta/paiement/cheque/card.php
@@ -529,7 +529,7 @@ if ($action == 'new') {
print $langs->trans('Date');
print '';
if ($action != 'editdate') {
- print 'id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
+ print 'id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
}
print '
';
print '
';
@@ -554,7 +554,7 @@ if ($action == 'new') {
print '';
print ' | ';
if ($action == 'editrefext')
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index 3e1dc59a52e..aab54e4ef81 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -304,8 +304,8 @@ class Paiement extends CommonObject
$facid = $key;
if (is_numeric($amount) && $amount <> 0) {
$amount = price2num($amount);
- $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'paiement_facture (fk_facture, fk_paiement, amount, multicurrency_amount)';
- $sql .= ' VALUES ('.((int) $facid).', '.((int) $this->id).", ".((float) $amount).", ".((float) $this->multicurrency_amounts[$key]).')';
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."paiement_facture (fk_facture, fk_paiement, amount, multicurrency_amount)";
+ $sql .= " VALUES (".((int) $facid).", ".((int) $this->id).", ".((float) $amount).", ".((float) $this->multicurrency_amounts[$key]).")";
dol_syslog(get_class($this).'::create Amount line '.$key.' insert paiement_facture', LOG_DEBUG);
$resql = $this->db->query($sql);
diff --git a/htdocs/compta/paymentbybanktransfer/index.php b/htdocs/compta/paymentbybanktransfer/index.php
index 25763dd8339..009f99fccf1 100644
--- a/htdocs/compta/paymentbybanktransfer/index.php
+++ b/htdocs/compta/paymentbybanktransfer/index.php
@@ -48,7 +48,7 @@ $result = restrictedArea($user, 'paymentbybanktransfer', '', '');
* Actions
*/
-
+// None
/*
@@ -166,7 +166,7 @@ if ($resql) {
$i++;
}
} else {
- print ' | | '.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).' |
';
+ print '
| '.$langs->trans("NoSupplierInvoiceToWithdraw", $langs->transnoentitiesnoconv("BankTransfer")).' |
';
}
print "