diff --git a/ChangeLog b/ChangeLog index 6fdbcfcd899..6258b36e084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,9 +6,184 @@ English Dolibarr ChangeLog ***** ChangeLog for 11.0.0 compared to 10.0.0 ***** For Users: +NEW: Module BOM is now stable (Module MO - Manufacturing Order is still in development). +NEW: A nicer dashboard for opened elements on Home page. +NEW: Add task widget and add task progress bar +NEW: Accountancy - Can add specific widget in this accountancy area. +NEW: Accountancy - Add export model LDCompta V9 & higher +NEW: Accountancy - Add permission on export, delete operations in ledger +NEW: Add 2 hidden options to set the default sorting (sort and order) on document page. +NEW: add ability to edit price without tax before adding a line of a predefined product. +NEW: Add a tab to setup "Opening hours" of company (information only). +NEW: Add attendee to ical export + cleanup. +NEW: Add bank data of users into the expense report exports. +NEW: add clone customers prices in clone product or service. +NEW: Add column of module source and POS terminal in the invoice list. +NEW: Add column last modification date into the table of targets for emailing. +NEW: Add column VAT rate in product list +NEW: add constant DISPATCH_FORCE_QTY_INPUT +NEW: Add constant MAIN_DISABLE_GLOBAL_WORKBOARD to disable workboard in home page +NEW: add country code in import product model +NEW: Add 'Direct Cash Payment' button in TakePOS +NEW: Add odt support to supplier orders +NEW: Add experimental SumUp payment to TakePOS (need to set a hidden constant) +NEW: Add feature to search a string into website containers +NEW: Add GET and POST /supplierinvoices/payments REST API endpoints. +NEW: Show progress bar for declared progression of tasks. +NEW: Add hidden option to update supplier buying price during receptions. +NEW: Add hidden option PROPOSAL_SHOW_INVOICED_AMOUNT (not reliable if one invoice is done on several order or several proposal) +NEW: Add hidden option SUPPLIER_ORDER_CAN_UPDATE_BUYINGPRICE_DURING_RECEIPT for add possibility to update supplier buying price in the reception on a supplier order +NEW: Add hidden option THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_ORDER to copy extrafields from third party to order. +NEW: Add hidden options to send by email even for object with draft status. +NEW: Add last change date in page "Other setup". Can sort page on name/date. +NEW: Add link to export targets of an emailings into a CSV file. +NEW: Add link to the public interface on the ticket card. +NEW: Add location into event tooltip. Use full day for fullday events +NEW: add MAIN_LANGUAGES_ALLOWED constant to limit languages displayed. +NEW: add MAIN_SHOW_COMPANY_NAME_IN_BANNER_ADDRESS constant. +NEW: add mass actions in shipment list. +NEW: add minimum stock filter in load warehoues for product form. +NEW: add name_alias in fields to search all +NEW: add new rule fetchidfromcodeandlabel for categories import +NEW: add office phone for salespresentatives +NEW: add office phone & job on user tooltips +NEW: Add option MAIN_PDF_FORCE_FONT_SIZE +NEW: Add option MEMBER_CAN_CONVERT_CUSTOMERS_TO_MEMBERS +NEW: Add option multiselect for developers on the selector of language. +NEW: Add option WORKFLOW_CAN_CREATE_PURCHASE_ORDER_FROM_PROPOSAL +NEW: Add pagination on list of object of a category +NEW: add parent category id or label in import category module +NEW: add parent id or ref column in warehouse import +NEW: Can set the Address/Contact by default on third parties. +NEW: Add search into template +NEW: Add shipment widget +NEW: add socialnetworks dictionary +NEW: Add statistics on product into contracts +NEW: Add status of warehouse in tooltip of a warehouse. +NEW: add supplier's product list +NEW: add units fields in buying price tab of product card +NEW: Add units in select products lines +NEW: Add upload document on account statement +NEW: Add widgets for BOMs and MOs +NEW: Amount invoiced column in proposal list +NEW: Ask the new label and new dates in confirm popup when cloning tax +NEW: auto set closing date and user on invoice +NEW: Avoid wrap between picto and text on getNomUrl +NEW: Balance Stripe connect account for supplier +NEW: Bank Add an option for colorize background color of debit or credit movement +NEW: Beautify the select box of warehouses +NEW: birthday widget for member +NEW: Widgets uses fiscal year +NEW: Can change supplier when cloning a Purchase Order +NEW: can choose lines while creating order from origin +NEW: Can crop/resize image attached on a bank record +NEW: Can defined a position of numbering submodules for thirdparties +NEW: Can edit date or RUM mandate. +NEW: Can edit link to the translation page in website module +NEW: Can edit the price of predefined product during adding in documents +NEW: Can enter price tax incl on vendor proposal and purchase orders +NEW: Can filter on description on bank account transaction lists. +NEW: Can filter on label on invoice in accounting vendor binding pages +NEW: Can load multilang translation in same step than fetch_lines +NEW: Can restrict access using DAV module to some host IPs only +NEW: Can restrict API usage to some IP only +NEW: Can select website templates from available default templates with a preview. +NEW: Can set a filter on object linked in modulebuilder. +NEW: Can set a squarred icon on your company setup +NEW: can specify hour start end for selectDate and step for minutes +NEW: Categories/Tags are also available on warehouses +NEW: Check if a resource is in use in an event +NEW: Code for extrafields uses the new array $extrafields->attributes +NEW: Compute column value from others columns in import module +NEW: Copy linked categories on product clone process. +NEW: Default for Stripe is STRIPE_USE_INTENT_WITH_AUTOMATIC_CONFIRMATION +NEW: Digitaria model for numbering accountancy thirdparty +NEW: Display membership in takepos if member linked to the thirdparty +NEW: Display supplier in objectline if defined +NEW: Add default duration of subscriptions on members type +NEW: Email template for Takepos (to send invoice) +NEW: Expense request and holiday validator fields +NEW: Export ledger table in Charlemagne format +NEW: Export livre Charlemagne +NEW: Extend option ORDER_ADD_ORDERS_WITH_PARENT_PROD_IF_INCDEC for all virtual product stats (renamed into PRODUCT_STATS_WITH_PARENT_PROD_IF_INCDEC) +NEW: FCKeditor setup for tickets +NEW: GeoIP v2 support is natively provided -> So IPv6 is supported +NEW: List by closing date on order list and proposal list +NEW: Look and feel v11: Some setup pages are by default direclty in edit mode. +NEW: Management of retained warranty on situation invoices +NEW: Mass email action on invoice list use billing contact if exists +NEW: more living colors for charts and option for "color bind" people +NEW: Supports multiple payments in a TakePOS sale +NEW: multiselect with checkbox in categories/tags search for product list +NEW: Option to allow to create members from third-party +NEW: Platform compliance with Stripe Connect +NEW: print / send email form in TakePOS +NEW: Public holidays are now in a dictionary table (no more hard coded per country) +NEW: Better performance by reducing the $companystatic calls on some pages. +NEW: Replace the "info" tab on contract with the more complete "agenda" tab. +NEW: Save user of last modification in donation record. +NEW: Show html combo list instead input text for extrafields typed as list. +NEW: Show POS application and the terminal used on invoice card. +NEW: Add categories/tags for stocks. +NEW: Support Net Measure in product's card.php +NEW: Extrafields separator can be collapsed or not +NEW: Extrafields support on Leave requests. +NEW: Extrafields support on Salaries. +NEW: Extrafields support in Product supplier prices. +NEW: Add extrafields for warehouses +NEW: Add extrafields in export of expense report (and holiday) +NEW: The integrity checker now show also the expected size of files. +NEW: The order method in purchase order is now mandatory when recording an order. +NEW: update / delete stripe account for supplier +NEW: Use the gender of member for picto in member lists. +NEW: Use the squarre logo as favicon of pages +NEW: VAT list - Add date start & date end in filters +NEW: widget box for supplier orders awaiting reception +NEW: Update translations +NEW: #4301 -For Developers: +For Developers or integrators: +NEW: Add a manifest.json.php file for web app. +NEW: Removed deprecated code that create linked object from ->origin +NEW: experimental zapier for dolibarr +NEW: Accountancy - Add hook bookkeepinglist on general ledger +NEW: Can update product type with the update method. +NEW: add API shipment mode dictionnary +NEW: Add API to get Country by code and iso +NEW: Add API to get objects by ref, ref_ext, ... +NEW: Add anonymous telemetry +NEW: Add a category to a contact in API +NEW: Add fk projet on stock movement +NEW: Add hidden option to set fields for the quick search on products. +NEW: add hook on commongeneratedocument +NEW: Add hook on fileupload.class.php to enable modules to override… +NEW: Add hooks on index pages +NEW: adding 'formObjectOptions' hooks loading at card.php of adherents module +NEW: Add method getStructuredData for website +NEW: Add payments GET and POST REST API endpoints for supplierinvoices. +NEW: Add POST /bankaccounts/transfer REST API endpoint. +NEW: add "printBucktrackInfo" hook, an external module can add info +NEW: Add trigger DIRECT_DEBIT_ORDER_CREATE on widthdraw is missing +NEW: API to post documents for "product" and Delete document +NEW: add new function "setEntity()" and better compatibility with Multicompany +NEW: Can add a button "Create" after combo of object with modulebuilder. +NEW: contacts type dictionnary in api_setup.class.php +NEW: Look and feel v11: Introduce CSS "trforbreak" +NEW: list of measuring units API +NEW: get social networks dictionary by API +NEW: Get thirdparty's salesrepresentatives by API +NEW: get user connected informations in REST API +NEW: mode for list thirdparty API (add easy filter for supplier only) +NEW: purchase_prices API +NEW: Provides more complete demo data +NEW: Module builder can generate CSS of JS file. +NEW: Use a dedicated css for the pencil to edit a field. +NEW: multilangs in fetch_lines +NEW: Add more complete info for triggers actioncom +NEW: add multicurrency rate at currency list API +NEW: Update jquery library to 3.4.1 +NEW: Upgrade ACE editor to v1.4.6 WARNING: @@ -31,6 +206,8 @@ Following changes may create regressions for some external modules, but were nec * Renamed property of thirdparty "statut_commercial" into "status_prospect_label" * The jquery plugin/dependency multiselect has been removed. It was not used by Dolibarr core. + + ***** ChangeLog for 10.0.3 compared to 10.0.2 ***** IMPORTANT : This version fixes a serious bug in saving the units of weight, size, surface and volume on product card. The unit were not saved correctly in database making calculation on shipments wrong. diff --git a/htdocs/admin/expensereport_rules.php b/htdocs/admin/expensereport_rules.php index 610bd875c4f..6a719c25b5f 100644 --- a/htdocs/admin/expensereport_rules.php +++ b/htdocs/admin/expensereport_rules.php @@ -2,7 +2,7 @@ /* Copyright (C) 2012 Mikael Carlavan * Copyright (C) 2017 ATM Consulting * Copyright (C) 2017 Pierre-Henry Favre - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018-2019 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,8 +44,8 @@ $action = GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); $apply_to = GETPOST('apply_to'); -$fk_user = GETPOST('fk_user'); -$fk_usergroup = GETPOST('fk_usergroup'); +$fk_user = GETPOST('fk_user', 'int'); +$fk_usergroup = GETPOST('fk_usergroup', 'int'); $fk_c_type_fees = GETPOST('fk_c_type_fees'); $code_expense_rules_type = GETPOST('code_expense_rules_type'); @@ -97,11 +97,11 @@ if ($action == 'save') $object->setValues($_POST); if($apply_to=='U'){ - $object->fk_user=$fk_user; + $object->fk_user = (int) $fk_user; $object->fk_usergroup=0; $object->is_for_all=0; }elseif($apply_to=='G'){ - $object->fk_usergroup=$fk_usergroup; + $object->fk_usergroup = (int) $fk_usergroup; $object->fk_user=0; $object->is_for_all=0; }elseif($apply_to=='A'){ diff --git a/htdocs/admin/system/os.php b/htdocs/admin/system/os.php index 7399a218e9c..d171fcaa2ec 100644 --- a/htdocs/admin/system/os.php +++ b/htdocs/admin/system/os.php @@ -42,11 +42,11 @@ print ''.$langs->trans("Parameter").''.$lan print "\n"; // Recupere l'OS au sens PHP -print "".$langs->trans("PHP_OS")."".PHP_OS."\n"; +print ''.$langs->trans("PHP_OS")."".PHP_OS."\n"; // Recupere la version de l'OS $osversion=version_os(); -print "".$langs->trans("Version")."".$osversion."\n"; +print ''.$langs->trans("Version")."".$osversion."\n"; print ''; // End of page diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index 2556c2d2084..ed6091e3568 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -167,7 +167,7 @@ if ($object->id) print "\n"; print ''; - print dol_fiche_end(); + dol_fiche_end(); diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 4a38ff4096a..1a44efa45ec 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -628,7 +628,7 @@ if ($resql) if (!empty($arrayfields['ava.rowid']['checked'])) { print ''; - print $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); + $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); print ajax_combobox('search_availability'); print ''; } diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index 8d5afb985a3..6714e25ddeb 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -174,7 +174,7 @@ if ($id > 0 || !empty($ref)) print "\n"; - print dol_fiche_end(); + dol_fiche_end(); $modulepart = 'commande'; $permission = $user->rights->commande->creer; diff --git a/htdocs/compta/bank/graph.php b/htdocs/compta/bank/graph.php index 15f6a1236d5..0f0c3d11386 100644 --- a/htdocs/compta/bank/graph.php +++ b/htdocs/compta/bank/graph.php @@ -107,7 +107,7 @@ else { dol_print_error($db); } - if (empty($min)) $min = dol_now - 3600 * 24; + if (empty($min)) $min = dol_now() - 3600 * 24; $log="graph.php: min=".$min." max=".$max; dol_syslog($log); diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 515e5308903..24d49040c13 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -231,7 +231,7 @@ else print ''; - print dol_fiche_end(); + dol_fiche_end(); // Actions buttons diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php index 193bcdae2d6..0f5a5e35225 100644 --- a/htdocs/core/boxes/box_task.php +++ b/htdocs/core/boxes/box_task.php @@ -56,7 +56,7 @@ class box_task extends ModeleBoxes */ public function __construct($db, $param = '') { - global $user, $langs; + global $conf, $user, $langs; // Load translation files required by the page $langs->loadLangs(array('boxes', 'projects')); @@ -64,7 +64,7 @@ class box_task extends ModeleBoxes $this->boxlabel = "Tasks"; $this->db = $db; - $this->hidden = !($user->rights->projet->lire); + $this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || !($user->rights->projet->lire)); } /** diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index bbd11c8f522..ef34ab5093f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -7029,7 +7029,7 @@ abstract class CommonObject if ($nbbyrow > 0) { - if ($nbphoto == 1) $return .= ''; + if ($nbphoto == 1) $return .= '
'; if ($nbphoto % $nbbyrow == 1) $return .= ''; $return .= '\n"; diff --git a/htdocs/stripe/admin/stripe.php b/htdocs/stripe/admin/stripe.php index 1ccb1631a31..688b71bb68e 100644 --- a/htdocs/stripe/admin/stripe.php +++ b/htdocs/stripe/admin/stripe.php @@ -111,11 +111,15 @@ if ($action == 'setvalue' && $user->admin) // Payment token for URL $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity); - if (!$result > 0) - $error++; - $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); - if (!$result > 0) + if (!$result > 0) { $error++; + } + if (empty($conf->use_javascript_ajax)) { + $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN_UNIQUE", GETPOST('PAYMENT_SECURITY_TOKEN_UNIQUE', 'alpha'), 'chaine', 0, '', $conf->entity); + if (!$result > 0) { + $error++; + } + } if (!$error) { $db->commit(); @@ -452,7 +456,7 @@ print '
'; diff --git a/htdocs/core/class/events.class.php b/htdocs/core/class/events.class.php index 4c728256413..f6537bf6528 100644 --- a/htdocs/core/class/events.class.php +++ b/htdocs/core/class/events.class.php @@ -53,7 +53,14 @@ class Events // extends CommonObject */ public $error=''; + /** + * @var int timestamp + */ public $tms; + + /** + * @var string Type + */ public $type; /** @@ -63,8 +70,14 @@ class Events // extends CommonObject public $dateevent; + /** + * @var string IP + */ public $ip; + /** + * @var string User agent + */ public $user_agent; /** @@ -179,7 +192,7 @@ class Events // extends CommonObject public function update($user = null, $notrigger = 0) { // Clean parameters - $this->id=trim($this->id); + $this->id = (int) $this->id; $this->type=trim($this->type); $this->description=trim($this->description); @@ -234,7 +247,7 @@ class Events // extends CommonObject { $obj = $this->db->fetch_object($resql); - $this->id = $obj->rowid; + $this->id = $obj->rowid; $this->tms = $this->db->jdate($obj->tms); $this->type = $obj->type; $this->entity = $obj->entity; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 889a38efddb..8479db591d9 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -557,7 +557,7 @@ class ExtraFields } else { - print dol_print_error($this->db); + dol_print_error($this->db); return -1; } } @@ -813,7 +813,7 @@ class ExtraFields else { $this->db->rollback(); - print dol_print_error($this->db); + dol_print_error($this->db); return -1; } } diff --git a/htdocs/core/class/html.formcron.class.php b/htdocs/core/class/html.formcron.class.php index 0277630ae78..2a2a6c97078 100644 --- a/htdocs/core/class/html.formcron.class.php +++ b/htdocs/core/class/html.formcron.class.php @@ -64,6 +64,7 @@ class FormCron extends Form global $langs; $langs->load('cron@cron'); + $out = ''; if (!empty($readonly)) { if ($selected=='command') { $out= $langs->trans('CronType_command'); diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index a21f06dacfe..e29b817b0b7 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -421,14 +421,13 @@ class FormTicket if ($withdolfichehead) dol_fiche_end(); - print '
'; + print '
'; print ''; - if ($this->withcancel) { - print "     "; + print "      "; print "trans("Cancel")."\">"; } - print "
\n"; + print ''; print "\n"; print "\n"; diff --git a/htdocs/core/lib/ajax.lib.php b/htdocs/core/lib/ajax.lib.php index 8991e1ad23b..d2626414ba6 100644 --- a/htdocs/core/lib/ajax.lib.php +++ b/htdocs/core/lib/ajax.lib.php @@ -326,7 +326,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option = '', $minLen * @param string $message Message of dialog box * @param int $w Width of dialog box * @param int $h height of dialog box - * @return void + * @return string */ function ajax_dialog($title, $message, $w = 350, $h = 150) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9faa3762111..0d614198d1e 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5956,16 +5956,18 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, $substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__'; $substitutionarray['__THIRDPARTY_PHONE__'] = '__THIRDPARTY_PHONE__'; $substitutionarray['__THIRDPARTY_FAX__'] = '__THIRDPARTY_FAX__'; - $substitutionarray['__THIRDPARTY_ADRESS__'] = '__THIRDPARTY_ADRESS__'; + $substitutionarray['__THIRDPARTY_ADDRESS__'] = '__THIRDPARTY_ADDRESS__'; $substitutionarray['__THIRDPARTY_ZIP__'] = '__THIRDPARTY_ZIP__'; $substitutionarray['__THIRDPARTY_TOWN__'] = '__THIRDPARTY_TOWN__'; - $substitutionarray['__THIRDPARTY_SIREN__'] = '__THIRDPARTY_SIREN__'; - $substitutionarray['__THIRDPARTY_SIRET__'] = '__THIRDPARTY_SIRET__'; - $substitutionarray['__THIRDPARTY_APE__'] = '__THIRDPARTY_APE__'; - $substitutionarray['__THIRDPARTY_RCSRM__'] = '__THIRDPARTY_RCSRM__'; + $substitutionarray['__THIRDPARTY_IDPROF1__'] = '__THIRDPARTY_IDPROF1__'; + $substitutionarray['__THIRDPARTY_IDPROF2__'] = '__THIRDPARTY_IDPROF2__'; + $substitutionarray['__THIRDPARTY_IDPROF3__'] = '__THIRDPARTY_IDPROF3__'; + $substitutionarray['__THIRDPARTY_IDPROF4__'] = '__THIRDPARTY_IDPROF4__'; + $substitutionarray['__THIRDPARTY_IDPROF5__'] = '__THIRDPARTY_IDPROF5__'; + $substitutionarray['__THIRDPARTY_IDPROF6__'] = '__THIRDPARTY_IDPROF6__'; $substitutionarray['__THIRDPARTY_TVAINTRA__'] = '__THIRDPARTY_TVAINTRA__'; - /*$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; - $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';*/ + $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; + $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__'; } if (!empty($conf->adherent->enabled)) { @@ -6059,41 +6061,49 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null, if (is_object($object) && $object->element == 'societe') { - $substitutionarray['__THIRDPARTY_ID__'] = (is_object($object) ? $object->id : ''); - $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object) ? $object->name : ''); - $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object) ? $object->name_alias : ''); - $substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object) ? $object->code_client : ''); - $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object) ? $object->code_fournisseur : ''); - $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object) ? $object->email : ''); - $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object) ? $object->phone : ''); - $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object) ? $object->name_fax : ''); - $substitutionarray['__THIRDPARTY_ADRESS__'] = (is_object($object) ? $object->address : ''); - $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object) ? $object->zip : ''); - $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object) ? $object->town : ''); - $substitutionarray['__THIRDPARTY_SIREN__'] = (is_object($object) ? $object->idprof1 : ''); - $substitutionarray['__THIRDPARTY_SIRET__'] = (is_object($object) ? $object->idprof2 : ''); - $substitutionarray['__THIRDPARTY_APE__'] = (is_object($object) ? $object->idprof3 : ''); - $substitutionarray['__THIRDPARTY_RCSRM__'] = (is_object($object) ? $object->idprof4 : ''); - $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object) ? $object->tva_intra : ''); + $substitutionarray['__THIRDPARTY_ID__'] = (is_object($object)?$object->id:''); + $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object)?$object->name:''); + $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object)?$object->name_alias:''); + $substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object)?$object->code_client:''); + $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object)?$object->code_fournisseur:''); + $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object)?$object->email:''); + $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object)?$object->phone:''); + $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object)?$object->fax:''); + $substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object)?$object->address:''); + $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object)?$object->zip:''); + $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object)?$object->town:''); + $substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object)?$object->idprof1:''); + $substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object)?$object->idprof2:''); + $substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object)?$object->idprof3:''); + $substitutionarray['__THIRDPARTY_IDPROF4__'] = (is_object($object)?$object->idprof4:''); + $substitutionarray['__THIRDPARTY_IDPROF5__'] = (is_object($object)?$object->idprof5:''); + $substitutionarray['__THIRDPARTY_IDPROF6__'] = (is_object($object)?$object->idprof6:''); + $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object)?$object->tva_intra:''); + $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object)?dol_htmlentitiesbr($object->note_public):''); + $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object)?dol_htmlentitiesbr($object->note_private):''); } elseif (is_object($object->thirdparty) && $object->thirdparty->id > 0) { - $substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty) ? $object->thirdparty->id : ''); - $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty) ? $object->thirdparty->name : ''); - $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object->thirdparty) ? $object->thirdparty->name_alias : ''); - $substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object->thirdparty) ? $object->thirdparty->code_client : ''); - $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty) ? $object->thirdparty->code_fournisseur : ''); - $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty) ? $object->thirdparty->email : ''); - $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object->thirdparty) ? $object->phone : ''); - $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object->thirdparty) ? $object->name_fax : ''); - $substitutionarray['__THIRDPARTY_ADRESS__'] = (is_object($object->thirdparty) ? $object->address : ''); - $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty) ? $object->zip : ''); - $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty) ? $object->town : ''); - $substitutionarray['__THIRDPARTY_SIREN__'] = (is_object($object->thirdparty) ? $object->idprof1 : ''); - $substitutionarray['__THIRDPARTY_SIRET__'] = (is_object($object->thirdparty) ? $object->idprof2 : ''); - $substitutionarray['__THIRDPARTY_APE__'] = (is_object($object->thirdparty) ? $object->idprof3 : ''); - $substitutionarray['__THIRDPARTY_RCSRM__'] = (is_object($object->thirdparty) ? $object->idprof4 : ''); - $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object->thirdparty) ? $object->tva_intra : ''); + $substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:''); + $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty)?$object->thirdparty->name:''); + $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object->thirdparty)?$object->thirdparty->name_alias:''); + $substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object->thirdparty)?$object->thirdparty->code_client:''); + $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty)?$object->thirdparty->code_fournisseur:''); + $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty)?$object->thirdparty->email:''); + $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object->thirdparty)?$object->thirdparty->phone:''); + $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object->thirdparty)?$object->thirdparty->fax:''); + $substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object->thirdparty)?$object->thirdparty->address:''); + $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty)?$object->thirdparty->zip:''); + $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty)?$object->thirdparty->town:''); + $substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof1:''); + $substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof2:''); + $substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof3:''); + $substitutionarray['__THIRDPARTY_IDPROF4__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof4:''); + $substitutionarray['__THIRDPARTY_IDPROF5__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof5:''); + $substitutionarray['__THIRDPARTY_IDPROF6__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof6:''); + $substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object->thirdparty)?$object->thirdparty->tva_intra:''); + $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = (is_object($object->thirdparty)?dol_htmlentitiesbr($object->thirdparty->note_public):''); + $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = (is_object($object->thirdparty)?dol_htmlentitiesbr($object->thirdparty->note_private):''); } if (is_object($object->project) && $object->project->id > 0) diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 12d9b06fee6..0356ecc8b23 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -1564,11 +1564,13 @@ function dol_print_reduction($reduction, $langs) * Return OS version. * Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarly OS PHP runs on. * - * @return string OS version + * @param string $option Option string + * @return string OS version */ -function version_os() +function version_os($option = '') { - $osversion = php_uname(); + if ($option == 'smr') $osversion = php_uname('s').' '.php_uname('m').' '.php_uname('r'); + else $osversion = php_uname(); return $osversion; } diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php index 875705cd8c3..58a46aef0ec 100644 --- a/htdocs/core/lib/project.lib.php +++ b/htdocs/core/lib/project.lib.php @@ -1990,11 +1990,11 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks } /** - * @param task $task Task the task object - * @param label $label bool|string true = auto, false = dont display, string = replace output - * @param progressNumber $progressNumber bool|string true = auto, false = dont display, string = replace output - * @param hideOnProgressNull $hideOnProgressNull bool hide if progress is null - * @param spaced $spaced bool used to add space at bottom (made by css) + * @param Task $task the task object + * @param bool|string $label true = auto, false = dont display, string = replace output + * @param bool|string $progressNumber true = auto, false = dont display, string = replace output + * @param bool $hideOnProgressNull hide if progress is null + * @param bool $spaced used to add space at bottom (made by css) * @return string * @see getTaskProgressBadge() */ @@ -2113,10 +2113,10 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide return $out; } /** - * @param task $task Task the task object - * @param label $label string empty = auto (progress), string = replace output - * @param tooltip $tooltip string empty = auto , string = replace output - * @return string + * @param Task $task the task object + * @param string $label empty = auto (progress), string = replace output + * @param string $tooltip empty = auto , string = replace output + * @return string * @see getTaskProgressView() */ function getTaskProgressBadge($task, $label = '', $tooltip = '') diff --git a/htdocs/core/lib/takepos.lib.php b/htdocs/core/lib/takepos.lib.php index e3a80e5d1df..dc86853859e 100644 --- a/htdocs/core/lib/takepos.lib.php +++ b/htdocs/core/lib/takepos.lib.php @@ -38,6 +38,14 @@ function takepos_prepare_head() $head[$h][2] = 'setup'; $h++; + if ($conf->global->TAKEPOS_CUSTOM_RECEIPT) + { + $head[$h][0] = DOL_URL_ROOT.'/takepos/admin/receipt.php'; + $head[$h][1] = $langs->trans("Receipt"); + $head[$h][2] = 'receipt'; + $h++; + } + $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS); for ($i = 1; $i <= $numterminals; $i++) { diff --git a/htdocs/core/modules/modHoliday.class.php b/htdocs/core/modules/modHoliday.class.php index 917da8fec25..642c233c200 100644 --- a/htdocs/core/modules/modHoliday.class.php +++ b/htdocs/core/modules/modHoliday.class.php @@ -302,11 +302,12 @@ class modHoliday extends DolibarrModules return 0; } } + */ $sql = array( - "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'holiday' AND entity = ".$conf->entity, - "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','holiday',".$conf->entity.")" - );*/ + // "DELETE FROM ".MAIN_DB_PREFIX."document_model WHERE nom = '".$this->db->escape($this->const[0][2])."' AND type = 'holiday' AND entity = ".$conf->entity, + // "INSERT INTO ".MAIN_DB_PREFIX."document_model (nom, type, entity) VALUES('".$this->db->escape($this->const[0][2])."','holiday',".$conf->entity.")" + ); return $this->_init($sql, $options); } diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 6556590c076..711249576a1 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1136,7 +1136,8 @@ class EmailCollector extends CommonObject $elements = imap_mime_header_decode($overview[0]->subject); $newstring = ''; if (! empty($elements)) { - for ($i = 0; $i < count($elements); $i++) { + $num = count($elements); + for ($i = 0; $i < $num; $i++) { $newstring .= ($newstring ? ' ' : '').$elements[$i]->text; } $overview[0]->subject = $newstring; diff --git a/htdocs/expedition/document.php b/htdocs/expedition/document.php index c12bd6decf3..e434bc524e2 100644 --- a/htdocs/expedition/document.php +++ b/htdocs/expedition/document.php @@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) { print "\n"; - print dol_fiche_end(); + dol_fiche_end(); $modulepart = 'expedition'; $permission = $user->rights->expedition->creer; diff --git a/htdocs/fourn/commande/orderstoinvoice.php b/htdocs/fourn/commande/orderstoinvoice.php index 098b6b93710..2a1cf24b3b7 100644 --- a/htdocs/fourn/commande/orderstoinvoice.php +++ b/htdocs/fourn/commande/orderstoinvoice.php @@ -630,7 +630,7 @@ if (($action != 'create' && $action != 'add') && !$error) { $db->free($resql); } else { - print dol_print_error($db); + dol_print_error($db); } } diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index e1ba230fe38..4c4a5212abd 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -267,6 +267,7 @@ class Holiday extends CommonObject // Insert request $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; + $sql .= "ref,"; $sql .= "fk_user,"; $sql .= "date_create,"; $sql .= "description,"; @@ -279,6 +280,7 @@ class Holiday extends CommonObject $sql .= "fk_user_create,"; $sql .= "entity"; $sql .= ") VALUES ("; + $sql .= "'(PROV)',"; $sql .= "'".$this->db->escape($this->fk_user)."',"; $sql .= " '".$this->db->idate($now)."',"; $sql .= " '".$this->db->escape($this->description)."',"; diff --git a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql index 04cdf8326f0..d584608546d 100644 --- a/htdocs/install/mysql/migration/10.0.0-11.0.0.sql +++ b/htdocs/install/mysql/migration/10.0.0-11.0.0.sql @@ -59,6 +59,10 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD COLUMN position integer -- For v11 +UPDATE llx_holiday SET ref = rowid WHERE ref IS NULL; +-- VMYSQL4.3 ALTER TABLE llx_holiday MODIFY COLUMN ref varchar(30) NOT NULL; +-- VPGSQL8.2 ALTER TABLE llx_holiday ALTER COLUMN ref SET NOT NULL; + ALTER TABLE llx_c_email_senderprofile MODIFY COLUMN active tinyint DEFAULT 1 NOT NULL; insert into llx_c_type_container (code,label,module,active) values ('menu', 'Menu', 'system', 1); diff --git a/htdocs/install/mysql/tables/llx_holiday.sql b/htdocs/install/mysql/tables/llx_holiday.sql index ce8383fe94d..e8116c477a8 100644 --- a/htdocs/install/mysql/tables/llx_holiday.sql +++ b/htdocs/install/mysql/tables/llx_holiday.sql @@ -19,7 +19,7 @@ CREATE TABLE llx_holiday ( rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, -ref varchar(30) NULL, -- number +ref varchar(30) NOT NULL, ref_ext varchar(255), entity integer DEFAULT 1 NOT NULL, -- Multi company id fk_user integer NOT NULL, diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 096a710bee8..d93b5930fed 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -625,7 +625,7 @@ Module5000Desc=Allows you to manage multiple companies Module6000Name=Workflow Module6000Desc=Workflow management (automatic creation of object and/or automatic status change) Module10000Name=Websites -Module10000Desc=Create websites (public) with a WYSIWYG editor. Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. +Module10000Desc=Create websites (public) with a WYSIWYG editor. This is a webmaster or developer oriented CMS (it is better to know HTML and CSS language). Just setup your web server (Apache, Nginx, ...) to point to the dedicated Dolibarr directory to have it online on the internet with your own domain name. Module20000Name=Leave Request Management Module20000Desc=Define and track employee leave requests Module39000Name=Product Lots diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 6e3ba31d36c..b177abf75fd 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -847,6 +847,7 @@ Progress=Progress ProgressShort=Progr. FrontOffice=Front office BackOffice=Back office +Submit=Submit View=View Export=Export Exports=Exports diff --git a/htdocs/langs/en_US/ticket.lang b/htdocs/langs/en_US/ticket.lang index 53758677770..79c4978b660 100644 --- a/htdocs/langs/en_US/ticket.lang +++ b/htdocs/langs/en_US/ticket.lang @@ -33,6 +33,7 @@ TicketDictSeverity=Ticket - Severities TicketTypeShortBUGSOFT=Dysfonctionnement logiciel TicketTypeShortBUGHARD=Dysfonctionnement matériel TicketTypeShortCOM=Commercial question + TicketTypeShortHELP=Request for functionnal help TicketTypeShortISSUE=Issue, bug or problem TicketTypeShortREQUEST=Change or enhancement request diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 6b17bb6f947..938f4411b57 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2551,6 +2551,7 @@ if (!function_exists("llxFooter")) print ''."\n"; // Add code for the asynchronous anonymous first ping (for telemetry) + // You can use &forceping=1 in parameters to force the ping. if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha')) { //print ''; @@ -2560,6 +2561,8 @@ if (!function_exists("llxFooter")) { if (empty($_COOKIE['DOLINSTALLNOPING_'.md5($conf->file->instance_unique_id)])) { + include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; + print "\n".''."\n"; print "\n\n"; $hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id); @@ -2580,7 +2583,8 @@ if (!function_exists("llxFooter")) entity: "entity; ?>", dbtype: "type); ?>", country_code: "country_code); ?>", - php_version: "" + php_version: "", + os_version: "" }, success: function (data, status, xhr) { // success callback function (data contains body of response) console.log("Ping ok"); diff --git a/htdocs/product/class/api_products.class.php b/htdocs/product/class/api_products.class.php index 37c950e9956..05d5818b3ff 100644 --- a/htdocs/product/class/api_products.class.php +++ b/htdocs/product/class/api_products.class.php @@ -965,8 +965,8 @@ class Products extends DolibarrApi /** * Delete attributes by id. * - * @param int $id ID of Attribute - * @return int + * @param int $id ID of Attribute + * @return int Result of deletion * * @throws RestException * @throws 401 @@ -981,12 +981,13 @@ class Products extends DolibarrApi $prodattr = new ProductAttribute($this->db); $prodattr->id = (int) $id; - $result = $prodattr->delete(); + $result = $prodattr->delete(DolibarrApiAccess::$user); - if ($result > 0) { - return 1; + if ($result <= 0) { + throw new RestException(500, "Error deleting attribute"); } - throw new RestException(500, "Error deleting attribute"); + + return $result; } /** @@ -1485,8 +1486,8 @@ class Products extends DolibarrApi /** * Delete product variants. * - * @param int $id ID of Variant - * @return int + * @param int $id ID of Variant + * @return int Result of deletion * * @throws RestException * @throws 401 @@ -1502,12 +1503,11 @@ class Products extends DolibarrApi $prodcomb = new ProductCombination($this->db); $prodcomb->id = (int) $id; $result = $prodcomb->delete(DolibarrApiAccess::$user); - return $result; - if ($result > 0) + if ($result <= 0) { - return 1; + throw new RestException(500, "Error deleting variant"); } - throw new RestException(500, "Error deleting variant"); + return $result; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 4c1e8b0e62e..a6e06dfb5ff 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -729,7 +729,7 @@ dol_fiche_end(); // Save print '
'; -print ''; +print ''; if (!empty($backtopage)) { print '     '; diff --git a/htdocs/public/ticket/create_ticket.php b/htdocs/public/ticket/create_ticket.php index 0bde25460e3..0601ecf5b1e 100644 --- a/htdocs/public/ticket/create_ticket.php +++ b/htdocs/public/ticket/create_ticket.php @@ -53,7 +53,6 @@ $extrafields = new ExtraFields($db); $extrafields->fetch_name_optionals_label($object->table_element); - /* * Actions */ @@ -358,7 +357,7 @@ if ($action != "infos_success") { $formticket->withfile = 2; $formticket->action = 'create_ticket'; - $formticket->param = array('returnurl' => $_SERVER['PHP_SELF']); + $formticket->param = array('returnurl' => $_SERVER['PHP_SELF'].($conf->entity > 1 ? '?entity='.$conf->entity : '')); if (empty($defaultref)) { $defaultref = ''; diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index beadddc6397..eaf4f14bbe6 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -781,7 +781,7 @@ if ($resql) print $reception->getNomUrl(1); $filename = dol_sanitizeFileName($reception->ref); $filedir = $conf->reception->dir_output.'/'.dol_sanitizeFileName($reception->ref); - $urlsource = $_SERVER['PHP_SELF'].'?id='.$reception->rowid; + $urlsource = $_SERVER['PHP_SELF'].'?id='.$reception->id; print $formfile->getDocumentsLink($reception->element, $filename, $filedir); print "
'; dol_fiche_end(); -print '
'; +print '
'; print ''; diff --git a/htdocs/takepos/admin/setup.php b/htdocs/takepos/admin/setup.php index 5995489184d..b5944e914ae 100644 --- a/htdocs/takepos/admin/setup.php +++ b/htdocs/takepos/admin/setup.php @@ -81,7 +81,10 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_DIRECT_PAYMENT", GETPOST('TAKEPOS_DIRECT_PAYMENT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_CUSTOM_RECEIPT", GETPOST('TAKEPOS_CUSTOM_RECEIPT', 'int'), 'int', 0, '', $conf->entity); $res = dolibarr_set_const($db, "TAKEPOS_EMAIL_TEMPLATE_INVOICE", GETPOST('TAKEPOS_EMAIL_TEMPLATE_INVOICE', 'alpha'), 'chaine', 0, '', $conf->entity); - + if (! empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { + $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_AFFILIATE", GETPOST('TAKEPOS_SUMUP_AFFILIATE', 'alpha'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, "TAKEPOS_SUMUP_APPID", GETPOST('TAKEPOS_SUMUP_APPID', 'alpha'), 'chaine', 0, '', $conf->entity); + } if ($conf->global->TAKEPOS_ORDER_NOTES == 1) { $extrafields = new ExtraFields($db); @@ -241,6 +244,20 @@ print ''; print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1); print "\n"; +// Sumup options +if ($conf->global->TAKEPOS_ENABLE_SUMUP) { + print ''; + print $langs->trans("SumupAffiliate"); + print ''; + print ''; + print "\n"; + print ''; + print $langs->trans("SumupAppId"); + print ''; + print ''; + print "\n"; +} + // Custom Receipt print ''; print $langs->trans('CustomReceipt'); diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 4696426aaf8..e2839901a77 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -74,7 +74,10 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CASH".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CASH'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CHEQUE".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CHEQUE'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_CB".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); - foreach($paiements as $modep) { + if (! empty($conf->global->TAKEPOS_ENABLE_SUMUP)) { + $res = dolibarr_set_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$terminaltouse, (GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') > 0 ? GETPOST('CASHDESK_ID_BANKACCOUNT_SUMUP'.$terminaltouse, 'alpha') : ''), 'chaine', 0, '', $conf->entity); + } + foreach($paiements as $modep) { if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; $name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse; $res = dolibarr_set_const($db, $name, (GETPOST($name, 'alpha') > 0 ? GETPOST($name, 'alpha') : ''), 'chaine', 0, '', $conf->entity); @@ -151,6 +154,13 @@ if (! empty($conf->banque->enabled)) $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse, 0, "courant=1", 1); if (! empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) $atleastonefound++; print ''; + if ($conf->global->TAKEPOS_ENABLE_SUMUP) { + print '' . $langs->trans("CashDeskBankAccountForSumup") . ''; + print ''; + $form->select_comptes($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP' . $terminaltouse}, 'CASHDESK_ID_BANKACCOUNT_SUMUP' . $terminaltouse, 0, "courant=1", 1); + if (!empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_SUMUP' . $terminaltouse})) $atleastonefound++; + print ''; + } foreach($paiements as $modep) { if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; // Already managed before diff --git a/htdocs/takepos/lib/takepos.lib.php b/htdocs/takepos/lib/takepos.lib.php deleted file mode 100644 index af1ea6aa100..00000000000 --- a/htdocs/takepos/lib/takepos.lib.php +++ /dev/null @@ -1,60 +0,0 @@ -. - */ - -/** - * \file takepos/lib/takepos.lib.php - * \ingroup takepos - * \brief Library files with common functions for TakePos - */ - -/** - * Prepare admin pages header - * - * @return array - */ -function takeposAdminPrepareHead() -{ - global $langs, $conf; - - $langs->load("cashdesk"); - - $h = 0; - $head = array(); - - $head[$h][0] = dol_buildpath("/takepos/admin/setup.php", 1); - $head[$h][1] = $langs->trans("Settings"); - $head[$h][2] = 'settings'; - $h++; - $head[$h][0] = dol_buildpath("/takepos/admin/about.php", 1); - $head[$h][1] = $langs->trans("About"); - $head[$h][2] = 'about'; - $h++; - - // Show more tabs from modules - // Entries must be declared in modules descriptor with line - //$this->tabs = array( - // 'entity:+tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' - //); // to add new tab - //$this->tabs = array( - // 'entity:-tabname:Title:@takepos:/takepos/mypage.php?id=__ID__' - //); // to remove a tab - complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos'); - - complete_head_from_modules($conf, $langs, null, $head, $h, 'takepos', 'remove'); - - return $head; -} diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 42ebe2fa85a..5e5a07b3625 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -176,6 +176,35 @@ else print "var received=0;"; else location.reload(); }); } + + function ValidateSumup() { + + var invoiceid = 0 ? $invoiceid : 0); ?>; + var amountpayed = $("#change1").val(); + if (amountpayed > total_ttc; ?>) { + amountpayed = total_ttc; ?>; + } + + // Starting sumup app + window.open('sumupmerchant://pay/1.0?affiliate-key=&app-id=&total=' + amountpayed + '¤cy=EUR&title=' + invoiceid + '&callback=/takepos/smpcb.php'); + + var loop = window.setInterval(function () { + $.ajax('/takepos/smpcb.php?status').done(function (data) { + console.log(data); + if (data === "SUCCESS") { + parent.$("#poslines").load("invoice.php?place=&action=valid&pay=CB&amount=" + amountpayed + "&invoiceid=" + invoiceid, function () { + //parent.$("#poslines").scrollTop(parent.$("#poslines")[0].scrollHeight); + parent.$.colorbox.close(); + //parent.setFocusOnSearchField(); // This does not have effect + }); + clearInterval(loop); + } else if (data === "FAILED") { + parent.$.colorbox.close(); + clearInterval(loop); + } + }); + }, 2500); + }
@@ -269,6 +298,13 @@ while($i < count($paiements)){ global->TAKEPOS_ENABLE_SUMUP && !empty(dolibarr_get_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]))) { + ?> + + + + + + The HTML5 Herald + + + + + + + +'; + $_SESSION['SMP_CURRENT_PAYMENT'] = $_GET['smp-status']; + + print ''; + + print "Transaction status registered, you can close this"; + + die(''); +} + + print 'NOOP'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index d25c106bf39..b4c8ab558eb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -2127,7 +2127,7 @@ form#login { border-radius: 4px; border:solid 1px rgba(80,80,80,.4); - border-top:solid 1px f8f8f8; + border-top:solid 1px #f8f8f8; } .login_table input#username, .login_table input#password, .login_table input#securitycode{ border: none; diff --git a/htdocs/variants/class/ProductAttribute.class.php b/htdocs/variants/class/ProductAttribute.class.php index 1172d08f74d..3ccdb6dbf03 100644 --- a/htdocs/variants/class/ProductAttribute.class.php +++ b/htdocs/variants/class/ProductAttribute.class.php @@ -174,9 +174,10 @@ class ProductAttribute /** * Deletes a product attribute * - * @return int <0 KO, >0 OK + * @param User $user Object user + * @return int <0 KO, >0 OK */ - public function delete() + public function delete($user = null) { $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute WHERE rowid = ".(int) $this->id; diff --git a/htdocs/variants/combinations.php b/htdocs/variants/combinations.php index f8a8b9cc9e5..c3f2b198301 100644 --- a/htdocs/variants/combinations.php +++ b/htdocs/variants/combinations.php @@ -394,7 +394,7 @@ if (! empty($id) || ! empty($ref)) } } $listofvariantselected .= '
'; - //print dol_fiche_end(); + //dol_fiche_end(); } else { $title = $langs->trans('EditProductCombination'); } @@ -602,7 +602,7 @@ if (! empty($id) || ! empty($ref)) print ''; } - print dol_fiche_end(); + dol_fiche_end(); ?>