diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php index b3d57116ddb..fec3c6b97bd 100644 --- a/htdocs/bookmarks/card.php +++ b/htdocs/bookmarks/card.php @@ -1,8 +1,8 @@ - * Copyright (C) 2005-2022 Laurent Destailleur - * Copyright (C) 2014 Marcos García - * Copyright (C) 2024 Frédéric France +/* Copyright (C) 2001-2003 Rodolphe Quiedeville + * Copyright (C) 2005-2022 Laurent Destailleur + * Copyright (C) 2014 Marcos García + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -251,7 +251,7 @@ if ($id > 0 && !preg_match('/^add/i', $action)) { print ''; if ($action == 'edit') { - print 'title).'">'; + print 'title).'">'; } else { print dol_escape_htmltag($object->title); } diff --git a/htdocs/bookmarks/class/bookmark.class.php b/htdocs/bookmarks/class/bookmark.class.php index a356a06e216..f109e67531a 100644 --- a/htdocs/bookmarks/class/bookmark.class.php +++ b/htdocs/bookmarks/class/bookmark.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2015 Marcos García +/* Copyright (C) 2005 Laurent Destailleur + * Copyright (C) 2015 Marcos García * Copyright (C) 2024 Frédéric France * * This program is free software; you can redistribute it and/or modify diff --git a/htdocs/compta/localtax/card.php b/htdocs/compta/localtax/card.php index 5a4077091d5..a0038878946 100644 --- a/htdocs/compta/localtax/card.php +++ b/htdocs/compta/localtax/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2015 Marcos García - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify @@ -188,7 +188,7 @@ if ($action == 'create') { print ''; // Label - print ''.$langs->trans("Label").'transcountry(($lttype == 2 ? "LT2Payment" : "LT1Payment"), $mysoc->country_code)).'">'; + print ''.$langs->trans("Label").'transcountry(($lttype == 2 ? "LT2Payment" : "LT1Payment"), $mysoc->country_code)).'">'; // Amount print ''.$langs->trans("Amount").''; diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index b0d5a88a902..cafcc04e377 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2015-2023 Alexandre Spangaro - * Copyright (C) 2018-2024 Frédéric France + * Copyright (C) 2018-2025 Frédéric France * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024-2025 MDW * @@ -470,7 +470,7 @@ if ($action == 'create') { } else { $label = $langs->trans("VATPayment"); } - print ''.$langs->trans("Label").''; + print ''.$langs->trans("Label").''; print ''.$form->textwithpicto($langs->trans("PeriodEndDate"), $langs->trans("LastDayTaxIsRelatedTo")).''; print $form->selectDate((GETPOSTINT("datevmonth") ? $datev : -1), "datev", 0, 0, 0, 'add', 1, 1); diff --git a/htdocs/contrat/class/api_contracts.class.php b/htdocs/contrat/class/api_contracts.class.php index 9c60002fefa..8a1ef37975f 100644 --- a/htdocs/contrat/class/api_contracts.class.php +++ b/htdocs/contrat/class/api_contracts.class.php @@ -233,7 +233,6 @@ class Contracts extends DolibarrApi public function post($request_data = null) { global $conf; - if (!DolibarrApiAccess::$user->hasRight('contrat', 'creer')) { throw new RestException(403, "Insufficient rights"); } @@ -249,8 +248,8 @@ class Contracts extends DolibarrApi if ($field == 'id') { throw new RestException(400, 'Creating with id field is forbidden'); } - if ($field == 'entity' && $value != $conf->entity) { - throw new RestException(403, 'Creating entity not the same as your API user is forbidden'); + if ($field == 'entity' && ((int) $value) != ((int) $conf->entity)) { + throw new RestException(403, 'Creating with entity='.((int) $value).' MUST be the same entity='.((int) $conf->entity).' as your API user/key belongs to'); } if ($field == 'socid') { diff --git a/htdocs/cron/info.php b/htdocs/cron/info.php index 189ea0ada30..8e5be2a7d3c 100644 --- a/htdocs/cron/info.php +++ b/htdocs/cron/info.php @@ -78,7 +78,10 @@ print '
'; print '
'; dol_print_object_info($object); -print '
'; +print ''; +print ''.$langs->trans('CronLastResult').' : '.dolPrintHTML($object->lastresult).''; +print ''.$langs->trans('CronLastOutput').' : '.dolPrintHTML($object->lastoutput).''; +print ''; print ''; llxFooter(); diff --git a/htdocs/install/mysql/data/llx_c_currencies.sql b/htdocs/install/mysql/data/llx_c_currencies.sql index a7446e0ff17..35792d6735d 100644 --- a/htdocs/install/mysql/data/llx_c_currencies.sql +++ b/htdocs/install/mysql/data/llx_c_currencies.sql @@ -66,6 +66,7 @@ INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'KYD' INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CLP', '[36]', 1, 'Chile Peso'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CNY', '[165]', 1, 'China Yuan Renminbi'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'COP', '[36]', 1, 'Colombia Peso'); +INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CDF', '[70,67]', 1, 'Congolese Franc'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CRC', '[8353]', 1, 'Costa Rica Colon'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'HRK', '[107,110]', 1, 'Croatia Kuna'); INSERT INTO llx_c_currencies ( code_iso, unicode, active, label ) VALUES ( 'CUP', '[8369]', 1, 'Cuba Peso'); diff --git a/test/hurl/api/contracts/10_contracts.hurl b/test/hurl/api/contracts/10_contracts.hurl index 26ad1f5b626..3cb824f0359 100644 --- a/test/hurl/api/contracts/10_contracts.hurl +++ b/test/hurl/api/contracts/10_contracts.hurl @@ -110,3 +110,16 @@ GET http://{{hostnport}}/api/index.php/contracts?limit=1 HTTP 200 [Captures] contract_id: jsonpath "$[0]['id']" + +# POST socid 0 +POST http://{{hostnport}}/api/index.php/contracts +{ +"entity" : "1", +"socid": "0", +"date_contrat": 1759738652, +"commercial_signature_id": 1, +"commercial_suivi_id": 1, +"note_public": "TEST 22.0.2" +} +HTTP 404 +{"error":{"code":404,"message":"Not Found: Thirdparty with id=0 not found"}}