diff --git a/ChangeLog b/ChangeLog index 1b4c4aacec882..afb30c7d89980 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,72 +2,6 @@ English Dolibarr ChangeLog -------------------------------------------------------------- -***** ChangeLog for 18.0.5 compared to 18.0.4 ***** -FIX: 17.0: deprecated field should only be a fallback -FIX: 17.0 - php8 warnings: test for $field existence before checking if it is null or empty -FIX: #24185: v18: display of the merged pdf lists -FIX: #26416 BOM_SUB_BOM blank page -FIX: #27166 -FIX: #27262 Recurrent invoice - user to string conversion -FIX: #27970 #26283 #27970 -FIX: Accountancy - Level 3 of binding not working on supplier side (#27462) -FIX: Accounting files export - Use th instead of td on all title columns (#28003) -FIX: add action update_extras to don card -FIX: Adding hooks init -FIX: Adding the $encode parameter to recursive _replaceHtmlWithOdtTag() utilisation -FIX: add new hook context for mo production card (#28037) -FIX: avoid from re-initializing result on nested hook getEntity (#27799) -FIX: avoid sql error (issue #26342) -FIX: bad accountancy code autoselection for supplier ventilation -FIX: Bad visible status of proposal after reopen -FIX: Barcode header cell not well displayed -FIX: BarCode Header not well displayed -FIX: Bar code verification should be done by entity because generation does (#28087) -FIX: can edit reminders on past events -FIX: check parameter socid before cloning a customer proposal (#28085) -FIX: crabe PDF is generating in conf->entity instead of object->entity -FIX: CVE-2024-23817 (#28089) -FIX: disable pointer events on jQuery-UI tooltips to prevent a glitch (fast-blinking tooltip) -FIX: Error on emailreminder not reported -FIX: Fatal error converting object of class User to string (php8) -FIX: filter by entity on contact is missing -FIX: Fix supplier invoice security check -FIX: format of color in manifest is wrong when using a custom color -FIX: #GHSA-7947-48q7-cp5m -FIX: HTML injection vulnerability in Dolibarr Application Home Page -FIX: invoice add line save devise -FIX: Keep a link to enable a 'always_enabled' module to solve pb. -FIX: label -FIX: line special_code never saved (#28051) -FIX: link to print when there is a search on multiselect fields -FIX: Menu Create of project no working on smartphone with no top menu. -FIX: missing $search_sale var (backport from v19) -FIX: Missing begin transaction when updating supplier recurring invoice -FIX: missing entity filter for check if period exists -FIX: more correctly parse the select part to be replaced in sql queries -FIX: MouvementStock::origin is not an object -FIX: notification information on intervention validated confirmation message (v17+) -FIX: not load all contacts by default when creating an event -FIX: port in Docker MailDev -FIX: propal use devise changes -FIX: public user photo not visible if $dolibarr_main_instance_unique_id -FIX: remove DISTINCT (backport from v19) -FIX: remove specific name from v19 -FIX: Retours PR -FIX: Return a better error message when token is not valid -FIX: search by ref & rowid in don list -FIX: search by thirdparty in don list -FIX: several names for one const THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT -FIX: SQL concatenation error -FIX: [TAKEPOS] display prices with or without taxes depending on setup (TAKEPOS_CHANGE_PRICE_HT) -FIX: Ternary operator condition is always true/false -FIX: too long output -FIX: Undefined property: Task::$fk_parent -FIX: uniformization to use "intervention" -FIX: Update loan.class.php (#27971) -FIX: update price extrafield on propal card -FIX: user filter in per user view of event list (#28049) -FIX: use the currency for propal signature page ***** ChangeLog for 19.0.0 compared to 18.0.0 ***** @@ -319,6 +253,73 @@ The following changes may create regressions for some external modules, but were * The load of hook context productdao has been removed before calling loadvirtualstock. Modules must use the context of main parent page or 'all' for all cases. +***** ChangeLog for 18.0.5 compared to 18.0.4 ***** +FIX: 17.0: deprecated field should only be a fallback +FIX: 17.0 - php8 warnings: test for $field existence before checking if it is null or empty +FIX: #24185: v18: display of the merged pdf lists +FIX: #26416 BOM_SUB_BOM blank page +FIX: #27166 +FIX: #27262 Recurrent invoice - user to string conversion +FIX: #27970 #26283 #27970 +FIX: Accountancy - Level 3 of binding not working on supplier side (#27462) +FIX: Accounting files export - Use th instead of td on all title columns (#28003) +FIX: add action update_extras to don card +FIX: Adding hooks init +FIX: Adding the $encode parameter to recursive _replaceHtmlWithOdtTag() utilisation +FIX: add new hook context for mo production card (#28037) +FIX: avoid from re-initializing result on nested hook getEntity (#27799) +FIX: avoid sql error (issue #26342) +FIX: bad accountancy code autoselection for supplier ventilation +FIX: Bad visible status of proposal after reopen +FIX: Barcode header cell not well displayed +FIX: BarCode Header not well displayed +FIX: Bar code verification should be done by entity because generation does (#28087) +FIX: can edit reminders on past events +FIX: check parameter socid before cloning a customer proposal (#28085) +FIX: crabe PDF is generating in conf->entity instead of object->entity +FIX: CVE-2024-23817 (#28089) +FIX: disable pointer events on jQuery-UI tooltips to prevent a glitch (fast-blinking tooltip) +FIX: Error on emailreminder not reported +FIX: Fatal error converting object of class User to string (php8) +FIX: filter by entity on contact is missing +FIX: Fix supplier invoice security check +FIX: format of color in manifest is wrong when using a custom color +FIX: #GHSA-7947-48q7-cp5m +FIX: HTML injection vulnerability in Dolibarr Application Home Page +FIX: invoice add line save devise +FIX: Keep a link to enable a 'always_enabled' module to solve pb. +FIX: label +FIX: line special_code never saved (#28051) +FIX: link to print when there is a search on multiselect fields +FIX: Menu Create of project no working on smartphone with no top menu. +FIX: missing $search_sale var (backport from v19) +FIX: Missing begin transaction when updating supplier recurring invoice +FIX: missing entity filter for check if period exists +FIX: more correctly parse the select part to be replaced in sql queries +FIX: MouvementStock::origin is not an object +FIX: notification information on intervention validated confirmation message (v17+) +FIX: not load all contacts by default when creating an event +FIX: port in Docker MailDev +FIX: propal use devise changes +FIX: public user photo not visible if $dolibarr_main_instance_unique_id +FIX: remove DISTINCT (backport from v19) +FIX: remove specific name from v19 +FIX: Retours PR +FIX: Return a better error message when token is not valid +FIX: search by ref & rowid in don list +FIX: search by thirdparty in don list +FIX: several names for one const THIRDPARTY_CAN_HAVE_CUSTOMER_CATEGORY_EVEN_IF_NOT_CUSTOMER_PROSPECT +FIX: SQL concatenation error +FIX: [TAKEPOS] display prices with or without taxes depending on setup (TAKEPOS_CHANGE_PRICE_HT) +FIX: Ternary operator condition is always true/false +FIX: too long output +FIX: Undefined property: Task::$fk_parent +FIX: uniformization to use "intervention" +FIX: Update loan.class.php (#27971) +FIX: update price extrafield on propal card +FIX: user filter in per user view of event list (#28049) +FIX: use the currency for propal signature page + ***** ChangeLog for 18.0.4 compared to 18.0.3 ***** FIX: $this->newref already exists and could have been modified by trigger but we still use a local variable for the filesystem-based renaming FIX: 16.0 only, backport fix for SQL error on global search product diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index be739ba02fb02..09236110b0e1d 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -290,7 +290,7 @@ print $boxlist; print ''; -} elseif (isModEnabled('compta')) { +} elseif (isModEnabled('comptabilite')) { print load_fiche_titre($langs->trans("AccountancyArea"), '', 'accountancy'); print ''.$langs->trans("Module10Desc")."\n"; diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 11c00917743d7..15eed8aa70556 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -246,7 +246,7 @@ $lineisasale = 1; } } - //var_dump($obj->type_payment); var_dump($obj->type_payment_supplier); + //var_dump($obj->type_payment); //var_dump($obj->type_payment_supplier); //var_dump($lineisapurchase); //var_dump($lineisasale); // Set accountancy code for bank diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 058c12b377f30..94fad45138da7 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -418,7 +418,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/asset/class/assetmodel.class.php b/htdocs/asset/class/assetmodel.class.php index b8eead4838413..3b557456e77b8 100644 --- a/htdocs/asset/class/assetmodel.class.php +++ b/htdocs/asset/class/assetmodel.class.php @@ -358,7 +358,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index 3e8a0c4dab240..040a06e62ca19 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -413,7 +413,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/bookcal/class/calendar.class.php b/htdocs/bookcal/class/calendar.class.php index 4490852b2a8bc..a7bde4a774647 100644 --- a/htdocs/bookcal/class/calendar.class.php +++ b/htdocs/bookcal/class/calendar.class.php @@ -370,7 +370,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php index dfe4b572fea17..2d2470ea4c1b7 100644 --- a/htdocs/compta/bank/card.php +++ b/htdocs/compta/bank/card.php @@ -139,10 +139,10 @@ $object->cle_rib = trim(GETPOST("cle_rib")); $object->bic = trim(GETPOST("bic")); $object->iban = trim(GETPOST("iban")); - $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); + $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); $object->owner_address = trim(GETPOST("owner_address", 'alphanohtml')); $object->owner_zip = trim(GETPOST("owner_zip", 'alphanohtml')); $object->owner_town = trim(GETPOST("owner_town", 'alphanohtml')); @@ -252,7 +252,6 @@ $object->cle_rib = trim(GETPOST("cle_rib")); $object->bic = trim(GETPOST("bic")); $object->iban = trim(GETPOST("iban")); - $object->domiciliation = trim(GETPOST("domiciliation", "alphanohtml")); $object->pti_in_ctti = empty(GETPOST("pti_in_ctti")) ? 0 : 1; $object->proprio = trim(GETPOST("proprio", 'alphanohtml')); @@ -279,8 +278,9 @@ $object->currency_code = trim(GETPOST("account_currency_code")); - $object->state_id = GETPOST("account_state_id", 'int'); - $object->country_id = GETPOST("account_country_id", 'int'); + $object->address = trim(GETPOST("account_address", "alphanohtml")); + $object->state_id = GETPOSTINT("account_state_id"); + $object->country_id = GETPOSTINT("account_country_id"); $object->min_allowed = GETPOST("account_min_allowed", 'int'); $object->min_desired = GETPOST("account_min_desired", 'int'); @@ -462,8 +462,8 @@ $type = (GETPOSTISSET("type") ? GETPOST('type', 'int') : Account::TYPE_CURRENT); // add default value if ($type == Account::TYPE_SAVINGS || $type == Account::TYPE_CURRENT) { print ''.$langs->trans("BankAccountDomiciliation").''; - print '"; } @@ -681,7 +681,6 @@ $morehtmlref = ''; dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref); - print '
'; print '
'; print '
'; @@ -848,7 +847,7 @@ } print ''.$langs->trans("BankAccountOwner").''; - print $object->proprio; + print dol_escape_htmltag($object->proprio); print "\n"; print ''.$langs->trans("BankAccountOwnerAddress").''; @@ -856,11 +855,11 @@ print "\n"; print ''.$langs->trans("BankAccountOwnerZip").''; - print ''.$object->owner_zip; + print ''.dol_escape_htmltag($object->owner_zip); print ''; print ''.$langs->trans("BankAccountOwnerTown").''; - print ''.$object->owner_town; + print ''.dol_escape_htmltag($object->owner_town); print ''; print ''.$langs->trans("BankAccountOwnerCountry").''; @@ -1003,8 +1002,8 @@ $type = (GETPOSTISSET('type') ? GETPOST('type', 'int') : $object->type); // add default current value if ($type == Account::TYPE_SAVINGS || $type == Account::TYPE_CURRENT) { print ''.$langs->trans("BankAccountDomiciliation").''; - print '"; } @@ -1183,16 +1182,17 @@ } } - print ''.$langs->trans("BankAccountOwner").''; - print ''; - print ''; - print ''; + print '
'; print ''; - print ''; + print ''; + print ''; + + print '"; diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index ff7293f0de4da..8ddf50e1c03a9 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -184,6 +184,7 @@ class Account extends CommonObject public $state_id; public $state_code; public $state; + public $country_id; /** * Variable containing all account types with their respective translated label. @@ -1633,6 +1634,40 @@ public function getCountryCode() return ''; } + /** + * Return full address for banner + * + * @param string $htmlkey HTML id to make banner content unique + * @param Object $object Object (thirdparty, thirdparty of contact for contact, null for a member) + * @return string Full address string + */ + public function getBannerAddress($htmlkey, $object) + { + global $conf, $langs; + + $out = ''; + + $outdone = 0; + $coords = $this->getFullAddress(1, ', ', getDolGlobalInt('MAIN_SHOW_REGION_IN_STATE_SELECT')); + if ($coords) { + if (!empty($conf->use_javascript_ajax)) { + // hideonsmatphone because copyToClipboard call jquery dialog that does not work with jmobile + $out .= ''; + $out .= img_picto($langs->trans("Address"), 'map-marker-alt'); + $out .= ' '; + } + $address = dol_print_address($coords, 'address_'.$htmlkey.'_'.$this->id, $this->element, $this->id, 1, ', '); + if ($address) { + $out .= $address; + $outdone++; + } + $outdone++; + } + + return $out; + } + + /** * Return if a bank account is defined with detailed information (bank code, desk code, number and key). * More information on codes used by countries on page http://en.wikipedia.org/wiki/Bank_code @@ -2569,12 +2604,15 @@ public function info($id) */ public function getNomUrl($withpicto = 0, $maxlen = 0, $option = '', $notooltip = 0) { - global $langs; + global $conf, $langs; $result = ''; $label = img_picto('', $this->picto).' '.$langs->trans("BankTransactionLine").':
'; $label .= ''.$langs->trans("Ref").': '.$this->ref; + if ($this->amount) { + $label .= '
'.$langs->trans("Amount").': '.price($this->amount, 0, $langs, 1, -1, -1, $conf->currency); + } $linkstart = ''; $linkend = ''; @@ -2586,6 +2624,7 @@ public function getNomUrl($withpicto = 0, $maxlen = 0, $option = '', $notooltip if ($withpicto != 2) { $result .= ($this->ref ? $this->ref : $this->id); } + $result .= $linkend; if ($option == 'showall' || $option == 'showconciliated' || $option == 'showconciliatedandaccounted') { @@ -2684,7 +2723,6 @@ public function LibStatut($status, $mode = 0) return ''; } - /** * Return if a bank line was dispatched into bookkeeping * diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php index f56c6f7382bd2..3e6c34df3f576 100644 --- a/htdocs/compta/paiement/list.php +++ b/htdocs/compta/paiement/list.php @@ -180,6 +180,8 @@ $sql = "SELECT p.rowid, p.ref, p.datep, p.amount, p.statut, p.num_paiement as num_payment,"; $sql .= " c.code as paiement_code"; + $sqlfields = $sql; // $sql fields to remove for count total + // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook @@ -194,10 +196,13 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; } else { - $sql = "SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.amount, p.statut, p.num_paiement as num_payment"; + $sql = "SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement as num_payment, p.amount"; $sql .= ", c.code as paiement_code"; $sql .= ", ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.fk_accountancy_journal as accountancy_journal"; $sql .= ", s.rowid as socid, s.nom as name, s.email"; + // We need an aggregate because we added a left join to get the thirdparty. In real world, it should be the same thirdparty if payment is same (but not in database structure) + // so SUM(pf.amount) should be equal to p.amount but if we filter on $socid, it may differ + $sql .= ", SUM(pf.amount) as totalamount, COUNT(f.rowid) as nbinvoices"; // Add fields from hooks $parameters = array(); @@ -210,18 +215,21 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON p.rowid = pf.fk_paiement"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON pf.fk_facture = f.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; + $sql .= " WHERE p.entity IN (".getEntity('invoice').")"; if ($socid > 0) { - $sql .= " AND f.fk_soc = ".((int) $socid); + $sql .= " AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."paiement_facture as pf"; + $sql .= " WHERE p.rowid = pf.fk_paiement AND pf.fk_facture = f.rowid AND f.fk_soc = ".((int) $socid).")"; } if ($userid) { if ($userid == -1) { - $sql .= " AND f.fk_user_author IS NULL"; + $sql .= " AND p.fk_user_creat IS NULL"; } else { - $sql .= " AND f.fk_user_author = ".((int) $userid); + $sql .= " AND p.fk_user_creat = ".((int) $userid); } } @@ -245,7 +253,10 @@ $sql .= natural_search('p.num_paiement', $search_payment_num); } if ($search_amount) { - $sql .= natural_search('p.amount', $search_amount, 1); + $sql .= " AND (".natural_search('p.amount', $search_amount, 1, 1); + $sql .= " OR "; + $sql .= natural_search('pf.amount', $search_amount, 1, 1); + $sql .= ")"; } if ($search_company) { $sql .= natural_search('s.nom', $search_company); @@ -267,13 +278,18 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint; + + $sql .= " GROUP BY p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement, p.amount"; + $sql .= ", c.code"; + $sql .= ", ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.fk_accountancy_journal"; + $sql .= ", s.rowid, s.nom, s.email"; } // Count total nb of records $nbtotalofrecords = ''; if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { /* The fast and low memory method to get and count full list converts the sql into a sql count */ - $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(DISTINCT p.rowid) as nbtotalofrecords', $sql); $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); $resql = $db->query($sqlforcount); if ($resql) { @@ -295,6 +311,7 @@ if ($limit) { $sql .= $db->plimit($limit + 1, $offset); } +//print $sql; $resql = $db->query($sql); if (!$resql) { @@ -578,6 +595,8 @@ $object->id = $objp->rowid; $object->ref = ($objp->ref ? $objp->ref : $objp->rowid); + $object->date = $db->jdate($objp->datep); + $object->amount = $objp->amount; $companystatic->id = $objp->socid; $companystatic->name = $objp->name; @@ -713,7 +732,12 @@ // Amount if (!empty($arrayfields['p.amount']['checked'])) { - print ''; + print ''; if (!$i) { $totalarray['nbfield']++; $totalarray['pos'][$totalarray['nbfield']] = 'amount'; diff --git a/htdocs/compta/resultat/result.php b/htdocs/compta/resultat/result.php index 310230c6e306a..5b70e2e2f7c9f 100644 --- a/htdocs/compta/resultat/result.php +++ b/htdocs/compta/resultat/result.php @@ -259,7 +259,7 @@ print ''; print ''; foreach ($months as $k => $v) { - if (($k + 1) >= $date_startmonth) { + if (($k + 1) >= $date_startmonth && $k < $date_endmonth) { print ''; } } @@ -392,7 +392,7 @@ // Detail by month foreach ($months as $k => $v) { - if (($k + 1) >= $date_startmonth) { + if (($k + 1) >= $date_startmonth && $k < $date_endmonth) { foreach ($sommes as $code => $det) { $vars[$code] = empty($det['M'][$k]) ? 0 : $det['M'][$k]; } @@ -591,7 +591,7 @@ // Each month foreach ($totCat['M'] as $k => $v) { - if (($k + 1) >= $date_startmonth) { + if (($k + 1) >= $date_startmonth && $k < $date_endmonth) { print ''; } } @@ -632,7 +632,7 @@ // Make one call for each month foreach ($months as $k => $v) { - if (($k + 1) >= $date_startmonth) { + if (($k + 1) >= $date_startmonth && $k < $date_endmonth) { if (isset($cpt['account_number'])) { $resultM = $totPerAccount[$cpt['account_number']]['M'][$k]; } else { diff --git a/htdocs/core/class/commonpeople.class.php b/htdocs/core/class/commonpeople.class.php index 2b1145edb7f02..7d1042e1401c2 100644 --- a/htdocs/core/class/commonpeople.class.php +++ b/htdocs/core/class/commonpeople.class.php @@ -235,11 +235,14 @@ public function getBannerAddress($htmlkey, $object) } $outdone = 0; if (!empty($this->email)) { - $out .= dol_print_email($this->email, $this->id, $object->id, 'AC_EMAIL', 0, 0, 1); + $out .= dol_print_email($this->email, $this->id, $object->id, 1, 0, 0, 1); $outdone++; } if (!empty($this->url)) { //$out.=dol_print_url($this->url,'_goout',0,1);//steve changed to blank + if (!empty($this->email)) { + $out .= ' '; + } $out .= dol_print_url($this->url, '_blank', 0, 1); $outdone++; } diff --git a/htdocs/core/class/defaultvalues.class.php b/htdocs/core/class/defaultvalues.class.php index 059f9a2f3938d..734d78202a924 100644 --- a/htdocs/core/class/defaultvalues.class.php +++ b/htdocs/core/class/defaultvalues.class.php @@ -269,7 +269,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid' || ($key == 't.entity' && !is_array($value)) || ($key == 't.user_id' && !is_array($value))) { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 't.page' || $key == 't.param' || $key == 't.type') { $sqlwhere[] = $key." = '".$this->db->escape($value)."'"; diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index 9484c0e3f58e7..cd0b1a655a204 100644 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -352,7 +352,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/core/customreports.php b/htdocs/core/customreports.php index ff288424d3740..e937a4059186f 100644 --- a/htdocs/core/customreports.php +++ b/htdocs/core/customreports.php @@ -94,7 +94,7 @@ // Objects available by default $arrayoftype = array( 'thirdparty' => array('langs'=>'companies', 'label' => 'ThirdParties', 'picto'=>'company', 'ObjectClassName' => 'Societe', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/societe/class/societe.class.php"), - 'contact' => array('label' => 'Contacts', 'picto'=>'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societ'), 'ClassPath' => "/contact/class/contact.class.php"), + 'contact' => array('label' => 'Contacts', 'picto'=>'contact', 'ObjectClassName' => 'Contact', 'enabled' => isModEnabled('societe'), 'ClassPath' => "/contact/class/contact.class.php"), 'proposal' => array('label' => 'Proposals', 'picto'=>'proposal', 'ObjectClassName' => 'Propal', 'enabled' => isModEnabled('propal'), 'ClassPath' => "/comm/propal/class/propal.class.php"), 'order' => array('label' => 'Orders', 'picto'=>'order', 'ObjectClassName' => 'Commande', 'enabled' => isModEnabled('commande'), 'ClassPath' => "/commande/class/commande.class.php"), 'invoice' => array('langs'=>'facture', 'label' => 'Invoices', 'picto'=>'bill', 'ObjectClassName' => 'Facture', 'enabled' => isModEnabled('facture'), 'ClassPath' => "/compta/facture/class/facture.class.php"), diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 7b0ac3e6a7879..7152e2778bb4d 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -2564,7 +2564,7 @@ function dol_most_recent_file($dir, $regexfilter = '', $excludefilter = array('( * @param string $original_file Relative path with filename, relative to modulepart. * @param string $entity Restrict onto entity (0=no restriction) * @param User|null $fuser User object (forced) - * @param string $refname Ref of object to check permission for external users (autodetect if not provided) or for hierarchy + * @param string $refname Ref of object to check permission for external users (autodetect if not provided by taking the dirname of $original_file) or for hierarchy * @param string $mode Check permission for 'read' or 'write' * @return mixed Array with access information : 'accessallowed' & 'sqlprotectagainstexternals' & 'original_file' (as a full path name) * @see restrictedArea() @@ -2612,7 +2612,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity, // Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10' if (empty($refname)) { $refname = basename(dirname($original_file)."/"); - if ($refname == 'thumbs') { + if ($refname == 'thumbs' || $refname == 'temp') { // If we get the thumbs directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10' $refname = basename(dirname(dirname($original_file))."/"); } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 76b8ee3387d61..8b109dbee3be8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2579,7 +2579,7 @@ function dol_banner_tab($object, $paramid, $morehtml = '', $shownav = 1, $fieldi // Show address and email if (method_exists($object, 'getBannerAddress') && !in_array($object->element, array('product', 'bookmark', 'ecm_directories', 'ecm_files'))) { - $moreaddress = $object->getBannerAddress('refaddress', $object); + $moreaddress = $object->getBannerAddress('refaddress', $object); // address, email, url, social networks if ($moreaddress) { $morehtmlref .= '
'; $morehtmlref .= $moreaddress; @@ -3281,9 +3281,9 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor $linkend = ''; if ($morecss == 'float') { // deprecated - return '
'.($withpicto ? img_picto($langs->trans("Url"), 'globe').' ' : '').$link.'
'; + return '
'.($withpicto ? img_picto($langs->trans("Url"), 'globe', 'class="paddingrightonly"') : '').$link.'
'; } else { - return $linkstart.''.($withpicto ? img_picto('', 'globe').' ' : '').$link.''.$linkend; + return $linkstart.''.($withpicto ? img_picto('', 'globe', 'class="paddingrightonly"') : '').$link.''.$linkend; } } @@ -3301,7 +3301,10 @@ function dol_print_url($url, $target = '_blank', $max = 32, $withpicto = 0, $mor */ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, $showinvalid = 1, $withpicto = 0) { - global $conf, $user, $langs, $hookmanager; + global $user, $langs, $hookmanager; + + //global $conf; $conf->global->AGENDA_ADDACTIONFOREMAIL = 1; + //$showinvalid = 1; $email = 'rrrrr'; $newemail = dol_escape_htmltag($email); @@ -3314,30 +3317,35 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } if (!empty($addlink)) { - $newemail = ''; + + $newemail .= ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : ''); + $newemail .= dol_trunc($email, $max); $newemail .= ''; if ($showinvalid && !isValidEmail($email)) { $langs->load("errors"); - $newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); + $newemail .= img_warning($langs->trans("ErrorBadEMail", $email), '', 'paddingrightonly'); } if (($cid || $socid) && isModEnabled('agenda') && $user->hasRight("agenda", "myactions", "create")) { $type = 'AC_EMAIL'; - $link = ''; + $linktoaddaction = ''; if (getDolGlobalString('AGENDA_ADDACTIONFOREMAIL')) { - $link = ''.img_object($langs->trans("AddAction"), "calendar").''; + $linktoaddaction = ''.img_object($langs->trans("AddAction"), "calendar").''; } - if ($link) { - $newemail = '
'.$newemail.' '.$link.'
'; + if ($linktoaddaction) { + $newemail = '
'.$newemail.' '.$linktoaddaction.'
'; } } } else { + $newemail = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : '').$newemail; + if ($showinvalid && !isValidEmail($email)) { $langs->load("errors"); $newemail .= img_warning($langs->trans("ErrorBadEMail", $email)); @@ -3345,8 +3353,10 @@ function dol_print_email($email, $cid = 0, $socid = 0, $addlink = 0, $max = 64, } //$rep = '
'; - $rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto)).' ' : '').$newemail; + //$rep = ($withpicto ? img_picto($langs->trans("EMail").' : '.$email, (is_numeric($withpicto) ? 'email' : $withpicto), 'class="paddingrightonly"') : '').$newemail; //$rep .= '
'; + $rep = $newemail; + if ($hookmanager) { $parameters = array('cid' => $cid, 'socid' => $socid, 'addlink' => $addlink, 'picto' => $withpicto); diff --git a/htdocs/core/lib/website.lib.php b/htdocs/core/lib/website.lib.php index 912247eb0ff7f..4583852526a0e 100644 --- a/htdocs/core/lib/website.lib.php +++ b/htdocs/core/lib/website.lib.php @@ -676,13 +676,13 @@ function getStructuredData($type, $data = array()) $ret .= '{ "@context": "https://schema.org", "@type": "Organization", - "name": "'.dol_escape_json($data['name'] ? $data['name'] : $companyname).'", - "url": "'.dol_escape_json($data['url'] ? $data['url'] : $url).'", + "name": "'.dol_escape_json(!empty($data['name']) ? $data['name'] : $companyname).'", + "url": "'.dol_escape_json(!empty($data['url']) ? $data['url'] : $url).'", "logo": "'.($data['logo'] ? dol_escape_json($data['logo']) : '/wrapper.php?modulepart=mycompany&file=logos%2F'.urlencode($mysoc->logo)).'", "contactPoint": { "@type": "ContactPoint", "contactType": "Contact", - "email": "'.dol_escape_json($data['email'] ? $data['email'] : $mysoc->email).'" + "email": "'.dol_escape_json(!empty($data['email']) ? $data['email'] : $mysoc->email).'" }'."\n"; if (is_array($mysoc->socialnetworks) && count($mysoc->socialnetworks) > 0) { $ret .= ",\n"; diff --git a/htdocs/core/lib/xcal.lib.php b/htdocs/core/lib/xcal.lib.php index 4ea8fffb327dc..bfca11682e40f 100644 --- a/htdocs/core/lib/xcal.lib.php +++ b/htdocs/core/lib/xcal.lib.php @@ -401,8 +401,8 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt $startdate = $event["startdate"]; $summary = $event["summary"]; $url = $event["url"]; - $author = $event["author"]; - $category = $event["category"]; + $author = $event["author"]; + $category = empty($event["category"]) ? null : $event["category"]; if (!empty($event["image"])) { $image = $event["image"]; } @@ -419,9 +419,10 @@ function build_rssfile($format, $title, $desc, $events_array, $outputfile, $filt fwrite($fichier, "<![CDATA[".$summary."]]>\n"); fwrite($fichier, "\n"); fwrite($fichier, "\n"); - fwrite($fichier, "\n"); + if (!empty($category)) { + fwrite($fichier, "\n"); + } fwrite($fichier, "

'); } diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 6b5d192a349ab..fee1bdc4b2c92 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -415,7 +415,6 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk"))', __HANDLER__, 'left', 6100__+MAX_llx_menu__, 'bank', 'cashcontrol', 14__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_list.php?mainmenu=bank&action=list', 'CashControl', 0, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '(isModEnabled("takepos") || isModEnabled("cashdesk") && $leftmenu=="cashcontrol")', __HANDLER__, 'left', 6101__+MAX_llx_menu__, 'bank', 'cashcontrol', 6100__+MAX_llx_menu__, '/compta/cashcontrol/cashcontrol_card.php?mainmenu=bank&action=create', 'NewCashFence', 1, 'cashdesk', '$user->hasRight("cashdesk", "run")|| $user->hasRight("takepos", "run")', '', 2, 6, __ENTITY__); - -- Project insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3600__+MAX_llx_menu__, 'project', 'projects', 7__+MAX_llx_menu__, '/projet/index.php?mainmenu=project&leftmenu=projects', 'LeadsOrProjects', 0, 'projects', '$user->hasRight("projet","lire")', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', 'isModEnabled("project")', __HANDLER__, 'left', 3601__+MAX_llx_menu__, 'project', '', 3600__+MAX_llx_menu__, '/projet/card.php?mainmenu=project&leftmenu=projects&action=create', 'New', 1, 'projects', '$user->hasRight("projet","creer")', '', 2, 1, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 5b62e9edcc9ca..1cf504a30fde4 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -299,7 +299,7 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout = isModEnabled('salaries') || isModEnabled('supplier_invoice') || isModEnabled('loan') || - isModEnabled('margins') + isModEnabled('margin') ) ? 1 : 0, 'perms'=>($user->hasRight('facture', 'lire') || $user->hasRight('don', 'contact', 'lire') || $user->hasRight('tax', 'charges', 'lire') || $user->hasRight('salaries', 'read') @@ -2093,7 +2093,7 @@ function get_left_menu_products($mainmenu, &$newmenu, $usemenuhider = 1, $leftme $newmenu->add("/product/card.php?leftmenu=service&action=create&type=1", $langs->trans("NewService"), 1, $user->hasRight('service', 'creer')); $newmenu->add("/product/list.php?leftmenu=service&type=1", $langs->trans("List"), 1, $user->hasRight('service', 'read')); - if (isModEnabled('Stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { + if (isModEnabled('stock') && getDolGlobalString('STOCK_SUPPORTS_SERVICES')) { $newmenu->add("/product/reassort.php?type=1", $langs->trans("MenuStocks"), 1, $user->hasRight('service', 'read') && $user->hasRight('stock', 'lire')); } if (isModEnabled('variants')) { diff --git a/htdocs/core/modules/modStockTransfer.class.php b/htdocs/core/modules/modStockTransfer.class.php index d2f4b0b5bb705..ecb103946cba7 100644 --- a/htdocs/core/modules/modStockTransfer.class.php +++ b/htdocs/core/modules/modStockTransfer.class.php @@ -435,26 +435,26 @@ public function init($options = '') $sql = array(); - // Rôles - $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "internal"'); + // Roles + $resql = $this->db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE code = 'STDEST' AND element = 'stocktransfer' AND source = 'internal'"); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "internal", "STRESP", "Responsable du transfert de stocks", 1, NULL, 0)'); + $this->db->query("INSERT INTO ".MAIN_DB_PREFIX."c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(".((int) $nextid).", 'stocktransfer', 'internal', 'STRESP', 'Responsible for stock transfers', 1, NULL, 0)"); } - $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STFROM" AND element = "StockTransfer" AND source = "external"'); + $resql = $this->db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE code = 'STFROM' AND element = 'stocktransfer' AND source = 'external'"); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STFROM", "Contact expéditeur transfert de stocks", 1, NULL, 0)'); + $this->db->query("INSERT INTO ".MAIN_DB_PREFIX."c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(".((int) $nextid).", 'stocktransfer', 'external', 'STFROM', 'Contact sending the stock transfer', 1, NULL, 0)"); } - $resql = $this->db->query('SELECT rowid FROM '.MAIN_DB_PREFIX.'c_type_contact WHERE code = "STDEST" AND element = "StockTransfer" AND source = "external"'); + $resql = $this->db->query("SELECT rowid FROM ".MAIN_DB_PREFIX."c_type_contact WHERE code = 'STDEST' AND element = 'stocktransfer' AND source = 'external'"); $res = $this->db->fetch_object($resql); $nextid=$this->getNextId(); if (empty($res)) { - $this->db->query('INSERT INTO '.MAIN_DB_PREFIX.'c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES('.((int) $nextid).', "StockTransfer", "external", "STDEST", "Contact destinataire transfert de stocks", 1, NULL, 0)'); + $this->db->query("INSERT INTO ".MAIN_DB_PREFIX."c_type_contact(rowid, element, source, code, libelle, active, module, position) VALUES(".((int) $nextid).", 'stocktransfer', 'external', 'STDEST', 'Contact receiving the stock transfer', 1, NULL, 0)"); } return $this->_init($sql, $options); diff --git a/htdocs/core/website.inc.php b/htdocs/core/website.inc.php index 9be644e0c1648..9a340050d22e4 100644 --- a/htdocs/core/website.inc.php +++ b/htdocs/core/website.inc.php @@ -67,7 +67,7 @@ if (!is_object($pagelangs)) { $pagelangs = new Translate('', $conf); } -if ($pageid > 0) { +if (!empty($pageid) && $pageid > 0) { $websitepage->fetch($pageid); $weblangs->setDefaultLang(GETPOSTISSET('lang') ? GETPOST('lang', 'aZ09') : (empty($_COOKIE['weblangs-shortcode']) ? 'auto' : preg_replace('/[^a-zA-Z0-9_\-]/', '', $_COOKIE['weblangs-shortcode']))); diff --git a/htdocs/document.php b/htdocs/document.php index f1d3c187ce149..957a3f2656323 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -209,20 +209,17 @@ function llxFooter() $original_file = str_replace('..\\', '/', $original_file); -// Find the subdirectory name as the reference -$refname = basename(dirname($original_file)."/"); - // Security check if (empty($modulepart)) { accessforbidden('Bad value for parameter modulepart'); } // Check security and set return info with full path of file -$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, $refname); +$check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, $user, ''); $accessallowed = $check_access['accessallowed']; $sqlprotectagainstexternals = $check_access['sqlprotectagainstexternals']; $fullpath_original_file = $check_access['original_file']; // $fullpath_original_file is now a full path name -//var_dump($fullpath_original_file.' '.$original_file.' '.$refname.' '.$accessallowed);exit; +//var_dump($fullpath_original_file.' '.$original_file.' '.$accessallowed);exit; if (!empty($hashp)) { $accessallowed = 1; // When using hashp, link is public so we force $accessallowed @@ -282,7 +279,7 @@ function llxFooter() // Hooks $hookmanager->initHooks(array('document')); $parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'original_file' => $original_file, - 'entity' => $entity, 'refname' => $refname, 'fullpath_original_file' => $fullpath_original_file, + 'entity' => $entity, 'fullpath_original_file' => $fullpath_original_file, 'filename' => $filename, 'fullpath_original_file_osencoded' => $fullpath_original_file_osencoded); $object = new stdClass(); $reshook = $hookmanager->executeHooks('downloadDocument', $parameters, $object, $action); // Note that $action and $object may have been @@ -293,6 +290,7 @@ function llxFooter() exit; } + // Permissions are ok and file found, so we return it top_httphead($type); header('Content-Description: File Transfer'); @@ -300,6 +298,7 @@ function llxFooter() header('Content-Encoding: '.$encoding); } // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open) + if ($attachment) { header('Content-Disposition: attachment; filename="'.$filename.'"'); } else { diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index df07651e7afa9..8a74a5a434a26 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -136,7 +136,7 @@ class EmailCollector extends CommonObject 'login' => array('type'=>'varchar(128)', 'label'=>'Login', 'visible'=>-1, 'enabled'=>1, 'position'=>102, 'notnull'=>-1, 'index'=>1, 'comment'=>"IMAP login", 'help'=>'Example: myaccount@gmail.com'), 'password' => array('type'=>'password', 'label'=>'Password', 'visible'=>-1, 'enabled'=>"1", 'position'=>103, 'notnull'=>-1, 'comment'=>"IMAP password", 'help'=>'WithGMailYouCanCreateADedicatedPassword'), 'oauth_service' => array('type'=>'varchar(128)', 'label'=>'oauthService', 'visible'=>-1, 'enabled'=>"getDolGlobalInt('MAIN_IMAP_USE_PHPIMAP')", 'position'=>104, 'notnull'=>0, 'index'=>1, 'comment'=>"IMAP login oauthService", 'arrayofkeyval'=>array(), 'help'=>'TokenMustHaveBeenCreated'), - 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>104, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), + 'source_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxSourceDirectory', 'visible'=>-1, 'enabled'=>1, 'position'=>109, 'notnull'=>1, 'default' => 'Inbox', 'help'=>'Example: INBOX, [Gmail]/Spam, [Gmail]/Draft, [Gmail]/Brouillons, [Gmail]/Sent Mail, [Gmail]/Messages envoyés, ...'), 'target_directory' => array('type'=>'varchar(255)', 'label'=>'MailboxTargetDirectory', 'visible'=>1, 'enabled'=>1, 'position'=>110, 'notnull'=>0, 'help'=>"EmailCollectorTargetDir"), 'maxemailpercollect' => array('type'=>'integer', 'label'=>'MaxEmailCollectPerCollect', 'visible'=>-1, 'enabled'=>1, 'position'=>111, 'default'=>50), 'datelastresult' => array('type'=>'datetime', 'label'=>'DateLastCollectResult', 'visible'=>1, 'enabled'=>'$action != "create" && $action != "edit"', 'position'=>121, 'notnull'=>-1, 'csslist'=>'nowraponall'), @@ -152,7 +152,7 @@ class EmailCollector extends CommonObject 'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,), //'fk_user_valid' =>array('type'=>'integer', 'label'=>'UserValidation', 'enabled'=>1, 'visible'=>-1, 'position'=>512), 'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,), - 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) + 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'default'=>'0', 'index'=>1, 'arrayofkeyval'=>array('0'=>'Inactive', '1'=>'Active')) ); diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php index 7dd88929a4872..60b8114dd80e9 100644 --- a/htdocs/eventorganization/class/conferenceorbooth.class.php +++ b/htdocs/eventorganization/class/conferenceorbooth.class.php @@ -304,7 +304,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.id' || $key == 't.fk_project' || $key == 't.fk_soc' || $key == 't.fk_action') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 126f2e66941aa..426ed9eaefc0a 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -433,7 +433,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid' || $key == 't.fk_soc' || $key == 't.fk_project' || $key == 't.fk_actioncomm') { $sqlwhere[] = $key.'='.((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index b8a077904268c..e498c5028d32a 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -135,9 +135,9 @@ 'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), - 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), - 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), - 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"') + 'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'position'=>1010, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), + 'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'position'=>1020, 'checked'=>1, 'enabled'=>(getDolGlobalInt('MAIN_SUBMODULE_DELIVERY') ? 1 : 0)), + 'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1100, 'enabled'=>'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"') ); // Extra fields diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index 1e58eb2754f1e..9be0b9e2c5662 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -603,7 +603,8 @@ public function setValid($user, $notrigger = 0) $sql .= ", date_valid = '".$this->db->idate($now)."'"; $sql .= ", fk_user_valid = ".($user->id > 0 ? (int) $user->id : "null"); $sql .= " WHERE rowid = ".((int) $this->id); - $sql .= " AND entity = ".((int) $conf->entity); + $sql .= " AND entity = ".((int) $this->entity); + $sql .= " AND fk_statut = 0"; dol_syslog(get_class($this)."::setValid", LOG_DEBUG); @@ -631,7 +632,7 @@ public function setValid($user, $notrigger = 0) // Now we rename also files into index $sql = 'UPDATE '.MAIN_DB_PREFIX."ecm_files set filename = CONCAT('".$this->db->escape($this->newref)."', SUBSTR(filename, ".(strlen($this->ref) + 1).")), filepath = 'ficheinter/".$this->db->escape($this->newref)."'"; - $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".$conf->entity; + $sql .= " WHERE filename LIKE '".$this->db->escape($this->ref)."%' AND filepath = 'ficheinter/".$this->db->escape($this->ref)."' and entity = ".((int) $this->entity); $resql = $this->db->query($sql); if (!$resql) { $error++; diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 0d7bdce4acc12..544ded32a6fad 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3858,7 +3858,7 @@ function setRadioForTypeOfInvoice() { print '
'; // Remainder to pay Multicurrency - if (isModEnabled('multicurreny') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + if (isModEnabled('multicurrency') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { print ''; // Remainder to pay back Multicurrency - if (isModEnabled('multicurreny') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { + if (isModEnabled('multicurrency') && $object->multicurrency_code != $conf->currency || $object->multicurrency_tx != 1) { print ''; + print ''; if (!$i) { $totalarray['nbfield']++; $totalarray['pos'][$totalarray['nbfield']] = 'amount'; } if (empty($totalarray['val']['amount'])) { - $totalarray['val']['amount'] = $objp->pamount; + $totalarray['val']['amount'] = $objp->amount; } else { - $totalarray['val']['amount'] += $objp->pamount; + $totalarray['val']['amount'] += $objp->amount; } } diff --git a/htdocs/hrm/class/evaluation.class.php b/htdocs/hrm/class/evaluation.class.php index 5e8cd595229a8..7689312ec396f 100644 --- a/htdocs/hrm/class/evaluation.class.php +++ b/htdocs/hrm/class/evaluation.class.php @@ -416,7 +416,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/evaluationdet.class.php b/htdocs/hrm/class/evaluationdet.class.php index 2778ac9e76ca0..da18ecd8a6e4b 100644 --- a/htdocs/hrm/class/evaluationdet.class.php +++ b/htdocs/hrm/class/evaluationdet.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key.' IN ('.$this->db->sanitize($this->db->escape($value)).')'; diff --git a/htdocs/hrm/class/job.class.php b/htdocs/hrm/class/job.class.php index 2a306d5b8be99..ec0c67a0ad19d 100644 --- a/htdocs/hrm/class/job.class.php +++ b/htdocs/hrm/class/job.class.php @@ -385,7 +385,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/position.class.php b/htdocs/hrm/class/position.class.php index ab6db1911f299..f1127f67e5a20 100644 --- a/htdocs/hrm/class/position.class.php +++ b/htdocs/hrm/class/position.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key . '=' . $value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key . ' = \'' . $this->db->idate($value) . '\''; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key . ' IN (' . $this->db->sanitize($this->db->escape($value)) . ')'; diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index bc9998adf8264..01861a6b185ec 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -454,7 +454,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key.'='.$value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key.' = \''.$this->db->idate($value).'\''; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/hrm/class/skilldet.class.php b/htdocs/hrm/class/skilldet.class.php index e658e75b26525..b9df29a9dafd2 100644 --- a/htdocs/hrm/class/skilldet.class.php +++ b/htdocs/hrm/class/skilldet.class.php @@ -378,7 +378,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = $sqlwhere[] = $key.'='.$value; } elseif ($key == 'customsql') { $sqlwhere[] = $value; - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif (strpos($value, '%') === false) { $sqlwhere[] = $key." IN (".$this->db->sanitize($this->db->escape($value)).")"; diff --git a/htdocs/hrm/class/skillrank.class.php b/htdocs/hrm/class/skillrank.class.php index dffb5600e4688..2dcc3373f5e7c 100644 --- a/htdocs/hrm/class/skillrank.class.php +++ b/htdocs/hrm/class/skillrank.class.php @@ -425,7 +425,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif ($key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && $key != 'customsql' && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql index 9510ca261a5ab..db959613bbb95 100644 --- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql +++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql @@ -569,3 +569,6 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('HRM_EVALUATION_DELETE', 'HR Evaluation deleted', 'Executed when an evaluation is dleted', 'hrm', 4005); UPDATE llx_menu SET url = '/fourn/paiement/list.php?mainmenu=billing&leftmenu=suppliers_bills_payment' WHERE leftmenu = 'suppliers_bills_payment'; + +UPDATE llx_paiement SET ref = rowid WHERE ref IS NULL OR ref = ''; + diff --git a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql index c0c984332b209..f528d39bdc62f 100644 --- a/htdocs/install/mysql/migration/18.0.0-19.0.0.sql +++ b/htdocs/install/mysql/migration/18.0.0-19.0.0.sql @@ -40,6 +40,8 @@ ALTER TABLE llx_product_perentity ADD COLUMN pmp double(24,8); ALTER TABLE llx_projet_task ADD COLUMN fk_user_modif integer after fk_user_creat; +UPDATE llx_paiement SET ref = rowid WHERE ref IS NULL OR ref = ''; + -- v19 @@ -209,3 +211,5 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle) VALUES (1,'66','Soci ALTER TABLE llx_prelevement_lignes ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; ALTER TABLE llx_bom_bomline ADD COLUMN tms timestamp DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP; + +UPDATE llx_c_type_contact SET element = 'stocktransfer' WHERE element = 'StockTransfer'; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 390ccf22287bf..370c29f1dce9b 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index dc17cd6302031..ef6634e523ec5 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -653,3 +653,4 @@ InvoiceSubtype=Invoice Subtype SalaryInvoice=Salary BillsAndSalaries=Bills & Salaries CreateCreditNoteWhenClientInvoiceExists=This option is enabled only when validated invoice(s) exist for a customer or when constant INVOICE_CREDIT_NOTE_STANDALONE is used(useful for some countries) +PaymentMadeForSeveralInvoices=Payment made for several invoices diff --git a/htdocs/langs/fi_FI/blockedlog.lang b/htdocs/langs/fi_FI/blockedlog.lang index 44b8923cc8121..e422036e04c67 100644 --- a/htdocs/langs/fi_FI/blockedlog.lang +++ b/htdocs/langs/fi_FI/blockedlog.lang @@ -20,7 +20,7 @@ Fingerprint=Sormenjälki DownloadLogCSV=Vie arkistoidut lokit (CSV) DataOfArchivedEvent=Täydelliset tiedot arkistoidusta tapahtumasta ImpossibleToReloadObject=Alkuperäistä objektia (tyyppi %s, tunnus %s) ei ole linkitetty (katso "Täydelliset tiedot" -sarake saadaksesi muuttumattomia tallennettuja tietoja) -BlockedLogAreRequiredByYourCountryLegislation=Maasi lainsäädäntö saattaa edellyttää muuttumattomien lokien moduulia. Tämän moduulin poistaminen käytöstä voi tehdä tulevista tapahtumista mitättömiä ja laillisten ohjelmistojen käytön kannalta, koska niitä ei voi vahvistaa vero<. /span> tarkastus. +BlockedLogAreRequiredByYourCountryLegislation=Maasi lainsäädäntö saattaa edellyttää muuttumattomien lokien moduulia. Tämän moduulin poistaminen käytöstä voi tehdä tulevista tapahtumista mitättömiä ja laillisten ohjelmistojen käytön kannalta, koska niitä ei voi vahvistaa vero tarkastus. BlockedLogActivatedBecauseRequiredByYourCountryLegislation=Muuttamattomat lokit -moduuli otettiin käyttöön maasi lainsäädännön vuoksi. Tämän moduulin poistaminen käytöstä voi tehdä tulevista tapahtumista mitättömiä ja laillisten ohjelmistojen käytön kannalta, koska niitä ei voi vahvistaa vero. span> tarkastus. BlockedLogDisableNotAllowedForCountry=Luettelo maista, joissa tämän moduulin käyttö on pakollista (että moduulia ei voida poistaa käytöstä virheellisesti, jos maasi on tässä luettelossa, moduulin poistaminen käytöstä ei ole mahdollista muokkaamatta ensin tätä luetteloa. Huomaa myös, että tämän moduulin käyttöönotto/poistaminen käytöstä seurata muuttumatonta Loki). OnlyNonValid=Ei kelvollinen diff --git a/htdocs/langs/fi_FI/errors.lang b/htdocs/langs/fi_FI/errors.lang index a5dc4cb57fb71..82f16e6c10b46 100644 --- a/htdocs/langs/fi_FI/errors.lang +++ b/htdocs/langs/fi_FI/errors.lang @@ -308,7 +308,7 @@ ErrorTableNotFound=Taulukkoa %s ei löydy ErrorRefNotFound=Viite %s ei löydy ErrorValueForTooLow=Arvo %s on liian pieni ErrorValueCantBeNull=Arvo %s ei voi olla tyhjä -ErrorDateOfMovementLowerThanDateOfFileTransmission=Pankkitapahtuman päiväys ei voi olla pienempi kuin päiväys tiedosto<. /span> lähetys +ErrorDateOfMovementLowerThanDateOfFileTransmission=Pankkitapahtuman päiväys ei voi olla pienempi kuin päiväys tiedosto lähetys ErrorTooMuchFileInForm=Liikaa tiedostoja muodossa, enimmäismäärä on %s tiedosto(s) ErrorSessionInvalidatedAfterPasswordChange=Istunto mitätöitiin salasanan, sähköpostiosoitteen, tilan tai päivämäärät voimassaolon muutoksen vuoksi. Ole hyvä ja kirjaudu uudelleen. ErrorExistingPermission = Lupa %s objektille %s on jo olemassa diff --git a/htdocs/langs/fi_FI/install.lang b/htdocs/langs/fi_FI/install.lang index b29587db107f5..87cf15d38a7bb 100644 --- a/htdocs/langs/fi_FI/install.lang +++ b/htdocs/langs/fi_FI/install.lang @@ -132,7 +132,7 @@ MigrationFinished=Muuttoliike valmis LastStepDesc=Viimeinen vaihe: Määritä tähän kirjautumissalasana, ja käytä yhteyden muodostamiseen Dolibarriin. Älä hukkaa tätä, sillä se on päätili kaikkien muiden/lisäkäyttäjätilien hallinnassa. ActivateModule=Aktivoi moduuli %s ShowEditTechnicalParameters=Klikkaa tästä näyttääksesi/muuttaaksesi edistyneemmät parametrit (asiantuntija tila) -WarningUpgrade=Varoitus:\nTeitkö tietokanta varmuuskopion ensin?\nTämä on erittäin suositeltavaa. Tietojen katoaminen (esimerkiksi mysql-version 5.5.40/41/42/43 virheiden vuoksi) voi olla mahdollista tämän prosessin aikana, joten on tärkeää tehdä täydellinen vedos tietokanta<. /span> ennen kuin aloitat siirron.\n\nNapsauta OK aloittaaksesi siirtoprosessin... +WarningUpgrade=Varoitus:\nTeitkö tietokanta varmuuskopion ensin?\nTämä on erittäin suositeltavaa. Tietojen katoaminen (esimerkiksi mysql-version 5.5.40/41/42/43 virheiden vuoksi) voi olla mahdollista tämän prosessin aikana, joten on tärkeää tehdä täydellinen vedos tietokanta ennen kuin aloitat siirron.\n\nNapsauta OK aloittaaksesi siirtoprosessin... ErrorDatabaseVersionForbiddenForMigration=Versiosi tietokanta on %s. Siinä on kriittinen virhe, joka mahdollistaa tietojen menetyksen, jos teet siirtoprosessin edellyttämiä rakenteellisia muutoksia tietokanta. Tästä syystä siirtoa ei sallita, ennen kuin päivität tietokanta-laitteesi tasoversioksi (korjattu) (luettelo tunnetuista bugiisista versioista: %s) KeepDefaultValuesWamp=Käytit DoliWampin Dolibarrin ohjattua asennustoimintoa, joten tässä ehdotetut arvot on jo optimoitu. Muuta niitä vain, jos tiedät mitä olet tekemässä. KeepDefaultValuesDeb=Käytit Dolibarrin ohjattua asennustoimintoa Linux-paketista (Ubuntu, Debian, Fedora...), joten tässä ehdotetut arvot on jo optimoitu. Vain tietokanta omistajan salasana luo on annettava. Muuta muita parametreja vain, jos tiedät mitä olet tekemässä. diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 4fd68649ef667..24fef99e5b879 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -798,7 +798,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 3f8e6b176d897..c4e3c0fd3b8fa 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -452,7 +452,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/partnership/class/partnership_type.class.php b/htdocs/partnership/class/partnership_type.class.php index aba40325cfdd7..e3f7457919f4b 100644 --- a/htdocs/partnership/class/partnership_type.class.php +++ b/htdocs/partnership/class/partnership_type.class.php @@ -180,7 +180,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 119adf48a0338..76d1863a4c6ff 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -1500,7 +1500,7 @@ print ''; } - if ($type != 1 && isModEnabled('stock')) { + if (($type != 1 || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) { // Default warehouse print ''; print ''; @@ -1913,6 +1914,7 @@ $parameters = array(); // Note that $action and $object may be modified by hook $reshook = $hookmanager->executeHooks('tabContentEditProduct', $parameters, $object, $action); + if (empty($reshook)) { print '
'.$langs->trans("BankAccountOwnerAddress").''; + print '
'.$langs->trans("BankAccountOwner").'
'.$langs->trans("BankAccountOwnerAddress").''; print '
'.price($objp->amount).''; + if ($objp->nbinvoices > 1 || ($objp->totalamount && $objp->amount != $objp->totalamount)) { + print $form->textwithpicto('', $langs->trans("PaymentMadeForSeveralInvoices")); + } + print ''.price($objp->amount).''; + print ''.$langs->trans("PreviousPeriod").''.$langs->trans("SelectedPeriod").''.$langs->trans('MonthShort'.sprintf("%02s", ($k + 1))).''.price($v).''.price($resteapayeraffiche).' 
'; print ''; print $langs->trans('RemainderToPayMulticurrency'); @@ -3892,7 +3892,7 @@ function setRadioForTypeOfInvoice() { print ''.price($sign * $resteapayeraffiche).' 
'; print ''; print $langs->trans('RemainderToPayBackMulticurrency'); diff --git a/htdocs/fourn/paiement/list.php b/htdocs/fourn/paiement/list.php index cd42464d2f37f..2c7009c8d4230 100644 --- a/htdocs/fourn/paiement/list.php +++ b/htdocs/fourn/paiement/list.php @@ -181,26 +181,32 @@ $companystatic = new Societe($db); $paymentfournstatic = new PaiementFourn($db); -$sql = 'SELECT p.rowid, p.ref, p.datep, p.amount as pamount, p.num_paiement as num_payment,'; -$sql .= ' s.rowid as socid, s.nom as name, s.email,'; -$sql .= ' c.code as paiement_type, c.libelle as paiement_libelle,'; -$sql .= ' ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.fk_accountancy_journal as accountancy_journal,'; -$sql .= ' SUM(pf.amount)'; +$sql = 'SELECT p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement as num_payment, p.amount'; +$sql .= ', c.code as paiement_type, c.libelle as paiement_libelle'; +$sql .= ', ba.rowid as bid, ba.ref as bref, ba.label as blabel, ba.number, ba.account_number as account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.fk_accountancy_journal as accountancy_journal'; +$sql .= ', s.rowid as socid, s.nom as name, s.email'; +// We need an aggregate because we added a left join to get the thirdparty. In real world, it should be the same thirdparty if payment is same (but not in database structure) +// so SUM(pf.amount) should be equal to p.amount but if we filter on $socid, it may differ +$sql .= ", SUM(pf.amount) as totalamount, COUNT(f.rowid) as nbinvoices"; + +$sqlfields = $sql; // $sql fields to remove for count total + $sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn AS p'; -$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn AS pf ON p.rowid = pf.fk_paiementfourn'; -$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid = pf.fk_facturefourn'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_paiement AS c ON p.fk_paiement = c.id'; -$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank as b ON p.fk_bank = b.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'bank_account as ba ON b.fk_account = ba.rowid'; -if (!$user->hasRight("societe", "client", "voir")) { - $sql .= ', '.MAIN_DB_PREFIX.'societe_commerciaux as sc'; -} -$sql .= ' WHERE f.entity = '.((int) $conf->entity); +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn AS pf ON p.rowid = pf.fk_paiementfourn'; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn AS f ON f.rowid = pf.fk_facturefourn'; +$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe AS s ON s.rowid = f.fk_soc'; + +$sql .= ' WHERE f.entity IN ('.getEntity('supplier_invoice').')'; // TODO We should use p.entity that does not exists yet in this table if ($socid > 0) { - $sql .= ' AND f.fk_soc = '.((int) $socid); + $sql .= " AND EXISTS (SELECT f.fk_soc FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; + $sql .= " WHERE p.rowid = pf.fk_paiementfourn AND pf.fk_facturefourn = f.rowid AND f.fk_soc = ".((int) $socid).")"; } + +// Search criteria if ($search_ref) { $sql .= natural_search('p.ref', $search_ref); } @@ -215,13 +221,16 @@ $sql .= natural_search('s.nom', $search_company); } if ($search_payment_type != '') { - $sql .= " AND c.code='".$db->escape($search_payment_type)."'"; + $sql .= " AND c.code = '".$db->escape($search_payment_type)."'"; } if ($search_cheque_num != '') { $sql .= natural_search('p.num_paiement', $search_cheque_num); } if ($search_amount) { - $sql .= natural_search('p.amount', $search_amount, 1); + $sql .= " AND (".natural_search('p.amount', $search_amount, 1, 1); + $sql .= " OR "; + $sql .= natural_search('pf.amount', $search_amount, 1, 1); + $sql .= ")"; } if ($search_bank_account > 0) { $sql .= ' AND b.fk_account = '.((int) $search_bank_account); @@ -241,22 +250,36 @@ // Add where from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php'; -$sql .= ' GROUP BY p.rowid, p.ref, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, s.email, c.code, c.libelle,'; +$sql .= ' GROUP BY p.rowid, p.ref, p.datep, p.fk_bank, p.statut, p.num_paiement, p.amount, s.rowid, s.nom, s.email, c.code, c.libelle,'; $sql .= ' ba.rowid, ba.ref, ba.label, ba.number, ba.account_number, ba.iban_prefix, ba.bic, ba.currency_code, ba.fk_accountancy_journal'; -$sql .= $db->order($sortfield, $sortorder); - +// Count total nb of records $nbtotalofrecords = ''; if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) { - $result = $db->query($sql); - $nbtotalofrecords = $db->num_rows($result); - if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 + /* The fast and low memory method to get and count full list converts the sql into a sql count */ + $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(DISTINCT p.rowid) as nbtotalofrecords', $sql); + $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount); + $resql = $db->query($sqlforcount); + if ($resql) { + $objforcount = $db->fetch_object($resql); + $nbtotalofrecords = $objforcount->nbtotalofrecords; + } else { + dol_print_error($db); + } + + if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0 $page = 0; $offset = 0; } + $db->free($resql); } -$sql .= $db->plimit($limit + 1, $offset); +// Complete request and execute it with limit +$sql .= $db->order($sortfield, $sortorder); +if ($limit) { + $sql .= $db->plimit($limit + 1, $offset); +} +//print $sql; $resql = $db->query($sql); if (!$resql) { @@ -534,6 +557,7 @@ $paymentfournstatic->id = $objp->rowid; $paymentfournstatic->ref = $objp->ref; $paymentfournstatic->datepaye = $db->jdate($objp->datep); + $paymentfournstatic->amount = $objp->amount; $companystatic->id = $objp->socid; $companystatic->name = $objp->name; @@ -660,15 +684,20 @@ // Amount if (!empty($arrayfields['p.amount']['checked'])) { - print ''.price($objp->pamount).''; + if ($objp->nbinvoices > 1 || ($objp->totalamount && $objp->amount != $objp->totalamount)) { + print $form->textwithpicto('', $langs->trans("PaymentMadeForSeveralInvoices")); + } + print ''.price($objp->amount).''; + print '
'.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); @@ -1508,6 +1508,7 @@ print ' '; print ''; print ''; + print '
'; @@ -2111,7 +2113,7 @@ } // Stock - if ($object->isProduct() && isModEnabled('stock')) { + if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) { // Default warehouse print ''; // To order - print ''; + $tobuy = ((getDolGlobalString('STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE') && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy); + print ''; // Supplier print ''; // Fields from hook - $parameters = array('objp'=>$objp); + $parameters = array('objp'=>$objp, 'i'=>$i, 'tobuy'=>$tobuy); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php index d632c7d30f399..d7f1db2a5649d 100644 --- a/htdocs/recruitment/class/recruitmentcandidature.class.php +++ b/htdocs/recruitment/class/recruitmentcandidature.class.php @@ -384,7 +384,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/recruitment/class/recruitmentjobposition.class.php b/htdocs/recruitment/class/recruitmentjobposition.class.php index feb94f13bd933..b3c9f92e12f98 100644 --- a/htdocs/recruitment/class/recruitmentjobposition.class.php +++ b/htdocs/recruitment/class/recruitmentjobposition.class.php @@ -399,7 +399,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 601cc4c223415..b9027ac3ba441 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -319,7 +319,7 @@ } $object->entity = (GETPOSTISSET('entity') ? GETPOST('entity', 'int') : $conf->entity); $object->name_alias = GETPOST('name_alias', 'alphanohtml'); - $object->parent = GETPOST('parent_company_id', 'int'); + $object->parent = GETPOSTISSET('parent_company_id') ? GETPOST('parent_company_id', 'int') : $object->parent; $object->address = GETPOST('address', 'alphanohtml'); $object->zip = GETPOST('zipcode', 'alphanohtml'); $object->town = GETPOST('town', 'alphanohtml'); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ff26e87bc29c3..304e2ae8cc956 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -4727,7 +4727,7 @@ public function LibProspLevel($fk_prospectlevel) $lib = $langs->getLabelFromKey($this->db, $fk_prospectlevel, 'c_prospectlevel', 'code', 'label'); } } - return $lib; + return $lib ?? ''; } /** diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index 93ecd74b48197..667e22a69744b 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -2761,6 +2761,9 @@ button.ui-button.ui-corner-all.ui-widget:focus { outline: none; } +.tmenuimage { + color: var(--colortextbackhmenu); +} /* For mainmenu, we always load the img */ diff --git a/htdocs/ticket/class/cticketcategory.class.php b/htdocs/ticket/class/cticketcategory.class.php index 9033587e2df36..19b1572e2beaa 100644 --- a/htdocs/ticket/class/cticketcategory.class.php +++ b/htdocs/ticket/class/cticketcategory.class.php @@ -392,7 +392,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a0eed471a0b16..8f438adc5e4eb 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -4052,7 +4052,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && isset($this->fields[$key]['type']) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index e30e7f19f4f18..987c88d7c682f 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -591,18 +591,18 @@ // Permission and tick (2 columns) if (!empty($object->admin) && !empty($objMod->rights_admin_allowed)) { // Permission granted because admin + print ''; if ($caneditperms) { print ''; } else { - print ''; - } - print ''; } + print ''; } elseif (in_array($obj->id, $permsuser)) { // Permission granted by user + print ''; if ($caneditperms) { print ''; } else { - print ''; - } - print ''; } + print ''; } elseif (isset($permsgroupbyentitypluszero) && is_array($permsgroupbyentitypluszero)) { + print ''; if (in_array($obj->id, $permsgroupbyentitypluszero)) { // Permission granted by group print ''; - if ($caneditperms) { - print ''; - } else { - print ''; - } + print ''; } else { // Do not own permission if ($caneditperms) { - print ''; } else { - print ''; } - print ''; + print ''; } } else { // Do not own permission + print ''; if ($caneditperms) { print ''; } else { - print ''; } diff --git a/htdocs/webhook/class/target.class.php b/htdocs/webhook/class/target.class.php index 3030617098bcf..d8f2a14a86130 100644 --- a/htdocs/webhook/class/target.class.php +++ b/htdocs/webhook/class/target.class.php @@ -394,7 +394,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index 543ded86b6c54..8e650fa9f3f9f 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -397,7 +397,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value;
'.$langs->trans("DefaultWarehouse").''; print img_picto($langs->trans("DefaultWarehouse"), 'stock', 'class="pictofixedwidth"'); @@ -2130,7 +2132,7 @@ */ } - if ($object->isService() && $conf->workstation->enabled) { + if ($object->isService() && isModEnabled('workstation')) { // Default workstation print '
'.$langs->trans("DefaultWorkstation").''; print img_picto($langs->trans("DefaultWorkstation"), 'workstation', 'class="pictofixedwidth"'); @@ -2620,7 +2622,7 @@ } // Default warehouse - if ($object->isProduct() && isModEnabled('stock')) { + if (($object->isProduct() || getDolGlobalInt('STOCK_SUPPORTS_SERVICES')) && isModEnabled('stock')) { $warehouse = new Entrepot($db); $warehouse->fetch($object->fk_default_warehouse); diff --git a/htdocs/product/class/productfournisseurprice.class.php b/htdocs/product/class/productfournisseurprice.class.php index a8b2f56c55361..f037762b01fbf 100644 --- a/htdocs/product/class/productfournisseurprice.class.php +++ b/htdocs/product/class/productfournisseurprice.class.php @@ -348,7 +348,7 @@ public function fetchAll($sortorder = '', $sortfield = '', $limit = 0, $offset = foreach ($filter as $key => $value) { if ($key == 't.rowid') { $sqlwhere[] = $key." = ".((int) $value); - } elseif (in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { + } elseif (array_key_exists($key, $this->fields) && in_array($this->fields[$key]['type'], array('date', 'datetime', 'timestamp'))) { $sqlwhere[] = $key." = '".$this->db->idate($value)."'"; } elseif ($key == 'customsql') { $sqlwhere[] = $value; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index d347290c92c58..5cc5ec30b91da 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -947,7 +947,8 @@ print ''.$ordered.' '.$picto.''; @@ -955,7 +956,7 @@ print ''.img_picto($langs->trans("AdministratorDesc"), 'star').' '; - if (!$caneditperms) { + print ''; print img_picto($langs->trans("Active"), 'switch_on', '', false, 0, 0, '', 'opacitymedium'); - //print img_picto($langs->trans("Active"), 'tick'); + print ''; print ''; print 'id.'&confirm=yes&updatedmodulename='.$obj->module.'">'; @@ -610,44 +610,41 @@ print img_picto($langs->trans("Remove"), 'switch_on'); print ' '; - if (!$caneditperms) { + print ''; print img_picto($langs->trans("Active"), 'switch_on', '', false, 0, 0, '', 'opacitymedium'); - //print img_picto($langs->trans("Active"), 'tick'); + print ''; print ''; print img_picto($langs->trans("Active"), 'switch_on', '', false, 0, 0, '', 'opacitymedium'); //print img_picto($langs->trans("Active"), 'tick'); print ''; - print $form->textwithtooltip($langs->trans("Inherited"), $langs->trans("PermissionInheritedFromAGroup")); - print ''; + print $form->textwithtooltip($langs->trans("Inherited"), $langs->trans("PermissionInheritedFromAGroup")); + print ''; + print ''; print 'id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">'; //print img_edit_add($langs->trans("Add")); print img_picto($langs->trans("Add"), 'switch_off'); print ''; - print ' '; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', 'opacitymedium'); print ' '; + print ''; print 'id.'&confirm=yes&token='.newToken().'&updatedmodulename='.$obj->module.'">'; @@ -655,7 +652,7 @@ print img_picto($langs->trans("Add"), 'switch_off'); print 'aa'; + print ''; print img_picto($langs->trans("Disabled"), 'switch_off', '', false, 0, 0, '', 'opacitymedium'); print '