Merge remote-tracking branch 'upstream/develop' into actioncomm_category

This commit is contained in:
Frédéric FRANCE
2019-11-27 22:54:05 +01:00
43 changed files with 439 additions and 173 deletions

179
ChangeLog
View File

@@ -6,9 +6,184 @@ English Dolibarr ChangeLog
***** ChangeLog for 11.0.0 compared to 10.0.0 ***** ***** ChangeLog for 11.0.0 compared to 10.0.0 *****
For Users: 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: 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" * 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. * 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 ***** ***** 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. 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. The unit were not saved correctly in database making calculation on shipments wrong.

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2012 Mikael Carlavan <contact@mika-carl.fr> /* Copyright (C) 2012 Mikael Carlavan <contact@mika-carl.fr>
* Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr> * Copyright (C) 2017 ATM Consulting <contact@atm-consulting.fr>
* Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr> * Copyright (C) 2017 Pierre-Henry Favre <phf@atm-consulting.fr>
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr> * Copyright (C) 2018-2019 Frédéric France <frederic.france@netlogic.fr>
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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'); $id = GETPOST('id', 'int');
$apply_to = GETPOST('apply_to'); $apply_to = GETPOST('apply_to');
$fk_user = GETPOST('fk_user'); $fk_user = GETPOST('fk_user', 'int');
$fk_usergroup = GETPOST('fk_usergroup'); $fk_usergroup = GETPOST('fk_usergroup', 'int');
$fk_c_type_fees = GETPOST('fk_c_type_fees'); $fk_c_type_fees = GETPOST('fk_c_type_fees');
$code_expense_rules_type = GETPOST('code_expense_rules_type'); $code_expense_rules_type = GETPOST('code_expense_rules_type');
@@ -97,11 +97,11 @@ if ($action == 'save')
$object->setValues($_POST); $object->setValues($_POST);
if($apply_to=='U'){ if($apply_to=='U'){
$object->fk_user=$fk_user; $object->fk_user = (int) $fk_user;
$object->fk_usergroup=0; $object->fk_usergroup=0;
$object->is_for_all=0; $object->is_for_all=0;
}elseif($apply_to=='G'){ }elseif($apply_to=='G'){
$object->fk_usergroup=$fk_usergroup; $object->fk_usergroup = (int) $fk_usergroup;
$object->fk_user=0; $object->fk_user=0;
$object->is_for_all=0; $object->is_for_all=0;
}elseif($apply_to=='A'){ }elseif($apply_to=='A'){

View File

@@ -42,11 +42,11 @@ print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$lan
print "\n"; print "\n";
// Recupere l'OS au sens PHP // Recupere l'OS au sens PHP
print "<tr $bc[0]><td width=\"240\">".$langs->trans("PHP_OS")."</td><td>".PHP_OS."</td></tr>\n"; print '<tr class="oddeven"><td>'.$langs->trans("PHP_OS")."</td><td>".PHP_OS."</td></tr>\n";
// Recupere la version de l'OS // Recupere la version de l'OS
$osversion=version_os(); $osversion=version_os();
print "<tr $bc[1]><td width=\"240\">".$langs->trans("Version")."</td><td>".$osversion."</td></tr>\n"; print '<tr class="oddeven"><td>'.$langs->trans("Version")."</td><td>".$osversion."</td></tr>\n";
print '</table>'; print '</table>';
// End of page // End of page

View File

@@ -167,7 +167,7 @@ if ($object->id)
print "</table>\n"; print "</table>\n";
print '</div>'; print '</div>';
print dol_fiche_end(); dol_fiche_end();

View File

@@ -628,7 +628,7 @@ if ($resql)
if (!empty($arrayfields['ava.rowid']['checked'])) if (!empty($arrayfields['ava.rowid']['checked']))
{ {
print '<td class="liste_titre maxwidthonsmartphone" align="center">'; print '<td class="liste_titre maxwidthonsmartphone" align="center">';
print $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1); $form->selectAvailabilityDelay($search_availability, 'search_availability', '', 1);
print ajax_combobox('search_availability'); print ajax_combobox('search_availability');
print '</td>'; print '</td>';
} }

View File

@@ -174,7 +174,7 @@ if ($id > 0 || !empty($ref))
print "</div>\n"; print "</div>\n";
print dol_fiche_end(); dol_fiche_end();
$modulepart = 'commande'; $modulepart = 'commande';
$permission = $user->rights->commande->creer; $permission = $user->rights->commande->creer;

View File

@@ -107,7 +107,7 @@ else
{ {
dol_print_error($db); 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; $log="graph.php: min=".$min." max=".$max;
dol_syslog($log); dol_syslog($log);

View File

@@ -231,7 +231,7 @@ else
print '</div>'; print '</div>';
print dol_fiche_end(); dol_fiche_end();
// Actions buttons // Actions buttons

View File

@@ -56,7 +56,7 @@ class box_task extends ModeleBoxes
*/ */
public function __construct($db, $param = '') public function __construct($db, $param = '')
{ {
global $user, $langs; global $conf, $user, $langs;
// Load translation files required by the page // Load translation files required by the page
$langs->loadLangs(array('boxes', 'projects')); $langs->loadLangs(array('boxes', 'projects'));
@@ -64,7 +64,7 @@ class box_task extends ModeleBoxes
$this->boxlabel = "Tasks"; $this->boxlabel = "Tasks";
$this->db = $db; $this->db = $db;
$this->hidden = !($user->rights->projet->lire); $this->hidden = (!empty($conf->global->PROJECT_HIDE_TASKS) || !($user->rights->projet->lire));
} }
/** /**

View File

@@ -7029,7 +7029,7 @@ abstract class CommonObject
if ($nbbyrow > 0) if ($nbbyrow > 0)
{ {
if ($nbphoto == 1) $return .= '<table class="valigntop center centpercent" style="border: 0; padding: 2; border-spacing: 2px; border-collapse: separate;">'; if ($nbphoto == 1) $return .= '<table class="valigntop center centpercent" style="border: 0; padding: 2px; border-spacing: 2px; border-collapse: separate;">';
if ($nbphoto % $nbbyrow == 1) $return .= '<tr class="center valignmiddle" style="border: 1px">'; if ($nbphoto % $nbbyrow == 1) $return .= '<tr class="center valignmiddle" style="border: 1px">';
$return .= '<td style="width: '.ceil(100 / $nbbyrow).'%" class="photo">'; $return .= '<td style="width: '.ceil(100 / $nbbyrow).'%" class="photo">';

View File

@@ -53,7 +53,14 @@ class Events // extends CommonObject
*/ */
public $error=''; public $error='';
/**
* @var int timestamp
*/
public $tms; public $tms;
/**
* @var string Type
*/
public $type; public $type;
/** /**
@@ -63,8 +70,14 @@ class Events // extends CommonObject
public $dateevent; public $dateevent;
/**
* @var string IP
*/
public $ip; public $ip;
/**
* @var string User agent
*/
public $user_agent; public $user_agent;
/** /**
@@ -179,7 +192,7 @@ class Events // extends CommonObject
public function update($user = null, $notrigger = 0) public function update($user = null, $notrigger = 0)
{ {
// Clean parameters // Clean parameters
$this->id=trim($this->id); $this->id = (int) $this->id;
$this->type=trim($this->type); $this->type=trim($this->type);
$this->description=trim($this->description); $this->description=trim($this->description);

View File

@@ -557,7 +557,7 @@ class ExtraFields
} }
else else
{ {
print dol_print_error($this->db); dol_print_error($this->db);
return -1; return -1;
} }
} }
@@ -813,7 +813,7 @@ class ExtraFields
else else
{ {
$this->db->rollback(); $this->db->rollback();
print dol_print_error($this->db); dol_print_error($this->db);
return -1; return -1;
} }
} }

View File

@@ -64,6 +64,7 @@ class FormCron extends Form
global $langs; global $langs;
$langs->load('cron@cron'); $langs->load('cron@cron');
$out = '';
if (!empty($readonly)) { if (!empty($readonly)) {
if ($selected=='command') { if ($selected=='command') {
$out= $langs->trans('CronType_command'); $out= $langs->trans('CronType_command');

View File

@@ -421,14 +421,13 @@ class FormTicket
if ($withdolfichehead) dol_fiche_end(); if ($withdolfichehead) dol_fiche_end();
print '<br><center>'; print '<div class="center">';
print '<input class="button" type="submit" name="add" value="'.$langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")).'" />'; print '<input class="button" type="submit" name="add" value="'.$langs->trans(($this->withthreadid > 0 ? "SendResponse" : "NewTicket")).'" />';
if ($this->withcancel) { if ($this->withcancel) {
print " &nbsp; &nbsp; "; print " &nbsp; &nbsp; &nbsp;";
print "<input class=\"button\" type=\"submit\" name=\"cancel\" value=\"".$langs->trans("Cancel")."\">"; print "<input class=\"button\" type=\"submit\" name=\"cancel\" value=\"".$langs->trans("Cancel")."\">";
} }
print "</center>\n"; print '</div>';
print "</form>\n"; print "</form>\n";
print "<!-- End form TICKET -->\n"; print "<!-- End form TICKET -->\n";

View File

@@ -326,7 +326,7 @@ function ajax_multiautocompleter($htmlname, $fields, $url, $option = '', $minLen
* @param string $message Message of dialog box * @param string $message Message of dialog box
* @param int $w Width of dialog box * @param int $w Width of dialog box
* @param int $h height of dialog box * @param int $h height of dialog box
* @return void * @return string
*/ */
function ajax_dialog($title, $message, $w = 350, $h = 150) function ajax_dialog($title, $message, $w = 350, $h = 150)
{ {

View File

@@ -5956,16 +5956,18 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
$substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__'; $substitutionarray['__THIRDPARTY_EMAIL__'] = '__THIRDPARTY_EMAIL__';
$substitutionarray['__THIRDPARTY_PHONE__'] = '__THIRDPARTY_PHONE__'; $substitutionarray['__THIRDPARTY_PHONE__'] = '__THIRDPARTY_PHONE__';
$substitutionarray['__THIRDPARTY_FAX__'] = '__THIRDPARTY_FAX__'; $substitutionarray['__THIRDPARTY_FAX__'] = '__THIRDPARTY_FAX__';
$substitutionarray['__THIRDPARTY_ADRESS__'] = '__THIRDPARTY_ADRESS__'; $substitutionarray['__THIRDPARTY_ADDRESS__'] = '__THIRDPARTY_ADDRESS__';
$substitutionarray['__THIRDPARTY_ZIP__'] = '__THIRDPARTY_ZIP__'; $substitutionarray['__THIRDPARTY_ZIP__'] = '__THIRDPARTY_ZIP__';
$substitutionarray['__THIRDPARTY_TOWN__'] = '__THIRDPARTY_TOWN__'; $substitutionarray['__THIRDPARTY_TOWN__'] = '__THIRDPARTY_TOWN__';
$substitutionarray['__THIRDPARTY_SIREN__'] = '__THIRDPARTY_SIREN__'; $substitutionarray['__THIRDPARTY_IDPROF1__'] = '__THIRDPARTY_IDPROF1__';
$substitutionarray['__THIRDPARTY_SIRET__'] = '__THIRDPARTY_SIRET__'; $substitutionarray['__THIRDPARTY_IDPROF2__'] = '__THIRDPARTY_IDPROF2__';
$substitutionarray['__THIRDPARTY_APE__'] = '__THIRDPARTY_APE__'; $substitutionarray['__THIRDPARTY_IDPROF3__'] = '__THIRDPARTY_IDPROF3__';
$substitutionarray['__THIRDPARTY_RCSRM__'] = '__THIRDPARTY_RCSRM__'; $substitutionarray['__THIRDPARTY_IDPROF4__'] = '__THIRDPARTY_IDPROF4__';
$substitutionarray['__THIRDPARTY_IDPROF5__'] = '__THIRDPARTY_IDPROF5__';
$substitutionarray['__THIRDPARTY_IDPROF6__'] = '__THIRDPARTY_IDPROF6__';
$substitutionarray['__THIRDPARTY_TVAINTRA__'] = '__THIRDPARTY_TVAINTRA__'; $substitutionarray['__THIRDPARTY_TVAINTRA__'] = '__THIRDPARTY_TVAINTRA__';
/*$substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__'; $substitutionarray['__THIRDPARTY_NOTE_PUBLIC__'] = '__THIRDPARTY_NOTE_PUBLIC__';
$substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';*/ $substitutionarray['__THIRDPARTY_NOTE_PRIVATE__'] = '__THIRDPARTY_NOTE_PRIVATE__';
} }
if (!empty($conf->adherent->enabled)) if (!empty($conf->adherent->enabled))
{ {
@@ -6059,41 +6061,49 @@ function getCommonSubstitutionArray($outputlangs, $onlykey = 0, $exclude = null,
if (is_object($object) && $object->element == 'societe') if (is_object($object) && $object->element == 'societe')
{ {
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object) ? $object->id : ''); $substitutionarray['__THIRDPARTY_ID__'] = (is_object($object)?$object->id:'');
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object) ? $object->name : ''); $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object)?$object->name:'');
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object) ? $object->name_alias : ''); $substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object)?$object->name_alias:'');
$substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object) ? $object->code_client : ''); $substitutionarray['__THIRDPARTY_CODE_CLIENT__'] = (is_object($object)?$object->code_client:'');
$substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object) ? $object->code_fournisseur : ''); $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object)?$object->code_fournisseur:'');
$substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object) ? $object->email : ''); $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object)?$object->email:'');
$substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object) ? $object->phone : ''); $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object)?$object->phone:'');
$substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object) ? $object->name_fax : ''); $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object)?$object->fax:'');
$substitutionarray['__THIRDPARTY_ADRESS__'] = (is_object($object) ? $object->address : ''); $substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object)?$object->address:'');
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object) ? $object->zip : ''); $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object)?$object->zip:'');
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object) ? $object->town : ''); $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object)?$object->town:'');
$substitutionarray['__THIRDPARTY_SIREN__'] = (is_object($object) ? $object->idprof1 : ''); $substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object)?$object->idprof1:'');
$substitutionarray['__THIRDPARTY_SIRET__'] = (is_object($object) ? $object->idprof2 : ''); $substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object)?$object->idprof2:'');
$substitutionarray['__THIRDPARTY_APE__'] = (is_object($object) ? $object->idprof3 : ''); $substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object)?$object->idprof3:'');
$substitutionarray['__THIRDPARTY_RCSRM__'] = (is_object($object) ? $object->idprof4 : ''); $substitutionarray['__THIRDPARTY_IDPROF4__'] = (is_object($object)?$object->idprof4:'');
$substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object) ? $object->tva_intra : ''); $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) elseif (is_object($object->thirdparty) && $object->thirdparty->id > 0)
{ {
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty) ? $object->thirdparty->id : ''); $substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:'');
$substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty) ? $object->thirdparty->name : ''); $substitutionarray['__THIRDPARTY_NAME__'] = (is_object($object->thirdparty)?$object->thirdparty->name:'');
$substitutionarray['__THIRDPARTY_NAME_ALIAS__'] = (is_object($object->thirdparty) ? $object->thirdparty->name_alias : ''); $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_CLIENT__'] = (is_object($object->thirdparty)?$object->thirdparty->code_client:'');
$substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty) ? $object->thirdparty->code_fournisseur : ''); $substitutionarray['__THIRDPARTY_CODE_FOURNISSEUR__'] = (is_object($object->thirdparty)?$object->thirdparty->code_fournisseur:'');
$substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty) ? $object->thirdparty->email : ''); $substitutionarray['__THIRDPARTY_EMAIL__'] = (is_object($object->thirdparty)?$object->thirdparty->email:'');
$substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object->thirdparty) ? $object->phone : ''); $substitutionarray['__THIRDPARTY_PHONE__'] = (is_object($object->thirdparty)?$object->thirdparty->phone:'');
$substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object->thirdparty) ? $object->name_fax : ''); $substitutionarray['__THIRDPARTY_FAX__'] = (is_object($object->thirdparty)?$object->thirdparty->fax:'');
$substitutionarray['__THIRDPARTY_ADRESS__'] = (is_object($object->thirdparty) ? $object->address : ''); $substitutionarray['__THIRDPARTY_ADDRESS__'] = (is_object($object->thirdparty)?$object->thirdparty->address:'');
$substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty) ? $object->zip : ''); $substitutionarray['__THIRDPARTY_ZIP__'] = (is_object($object->thirdparty)?$object->thirdparty->zip:'');
$substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty) ? $object->town : ''); $substitutionarray['__THIRDPARTY_TOWN__'] = (is_object($object->thirdparty)?$object->thirdparty->town:'');
$substitutionarray['__THIRDPARTY_SIREN__'] = (is_object($object->thirdparty) ? $object->idprof1 : ''); $substitutionarray['__THIRDPARTY_IDPROF1__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof1:'');
$substitutionarray['__THIRDPARTY_SIRET__'] = (is_object($object->thirdparty) ? $object->idprof2 : ''); $substitutionarray['__THIRDPARTY_IDPROF2__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof2:'');
$substitutionarray['__THIRDPARTY_APE__'] = (is_object($object->thirdparty) ? $object->idprof3 : ''); $substitutionarray['__THIRDPARTY_IDPROF3__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof3:'');
$substitutionarray['__THIRDPARTY_RCSRM__'] = (is_object($object->thirdparty) ? $object->idprof4 : ''); $substitutionarray['__THIRDPARTY_IDPROF4__'] = (is_object($object->thirdparty)?$object->thirdparty->idprof4:'');
$substitutionarray['__THIRDPARTY_TVAINTRA__'] = (is_object($object->thirdparty) ? $object->tva_intra : ''); $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) if (is_object($object->project) && $object->project->id > 0)

View File

@@ -1564,11 +1564,13 @@ function dol_print_reduction($reduction, $langs)
* Return OS version. * Return OS version.
* Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarly OS PHP runs on. * Note that PHP_OS returns only OS (not version) and OS PHP was built on, not necessarly OS PHP runs on.
* *
* @param string $option Option string
* @return string OS version * @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; return $osversion;
} }

View File

@@ -1990,11 +1990,11 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
} }
/** /**
* @param task $task Task the task object * @param Task $task the task object
* @param label $label bool|string true = auto, false = dont display, string = replace output * @param bool|string $label true = auto, false = dont display, string = replace output
* @param progressNumber $progressNumber bool|string true = auto, false = dont display, string = replace output * @param bool|string $progressNumber true = auto, false = dont display, string = replace output
* @param hideOnProgressNull $hideOnProgressNull bool hide if progress is null * @param bool $hideOnProgressNull hide if progress is null
* @param spaced $spaced bool used to add space at bottom (made by css) * @param bool $spaced used to add space at bottom (made by css)
* @return string * @return string
* @see getTaskProgressBadge() * @see getTaskProgressBadge()
*/ */
@@ -2113,9 +2113,9 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
return $out; return $out;
} }
/** /**
* @param task $task Task the task object * @param Task $task the task object
* @param label $label string empty = auto (progress), string = replace output * @param string $label empty = auto (progress), string = replace output
* @param tooltip $tooltip string empty = auto , string = replace output * @param string $tooltip empty = auto , string = replace output
* @return string * @return string
* @see getTaskProgressView() * @see getTaskProgressView()
*/ */

View File

@@ -38,6 +38,14 @@ function takepos_prepare_head()
$head[$h][2] = 'setup'; $head[$h][2] = 'setup';
$h++; $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); $numterminals = max(1, $conf->global->TAKEPOS_NUM_TERMINALS);
for ($i = 1; $i <= $numterminals; $i++) for ($i = 1; $i <= $numterminals; $i++)
{ {

View File

@@ -302,11 +302,12 @@ class modHoliday extends DolibarrModules
return 0; return 0;
} }
} }
*/
$sql = array( $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, // "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.")" // "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); return $this->_init($sql, $options);
} }

View File

@@ -1136,7 +1136,8 @@ class EmailCollector extends CommonObject
$elements = imap_mime_header_decode($overview[0]->subject); $elements = imap_mime_header_decode($overview[0]->subject);
$newstring = ''; $newstring = '';
if (! empty($elements)) { if (! empty($elements)) {
for ($i = 0; $i < count($elements); $i++) { $num = count($elements);
for ($i = 0; $i < $num; $i++) {
$newstring .= ($newstring ? ' ' : '').$elements[$i]->text; $newstring .= ($newstring ? ' ' : '').$elements[$i]->text;
} }
$overview[0]->subject = $newstring; $overview[0]->subject = $newstring;

View File

@@ -168,7 +168,7 @@ if ($id > 0 || !empty($ref)) {
print "</div>\n"; print "</div>\n";
print dol_fiche_end(); dol_fiche_end();
$modulepart = 'expedition'; $modulepart = 'expedition';
$permission = $user->rights->expedition->creer; $permission = $user->rights->expedition->creer;

View File

@@ -630,7 +630,7 @@ if (($action != 'create' && $action != 'add') && !$error) {
$db->free($resql); $db->free($resql);
} else { } else {
print dol_print_error($db); dol_print_error($db);
} }
} }

View File

@@ -267,6 +267,7 @@ class Holiday extends CommonObject
// Insert request // Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."holiday(";
$sql .= "ref,";
$sql .= "fk_user,"; $sql .= "fk_user,";
$sql .= "date_create,"; $sql .= "date_create,";
$sql .= "description,"; $sql .= "description,";
@@ -279,6 +280,7 @@ class Holiday extends CommonObject
$sql .= "fk_user_create,"; $sql .= "fk_user_create,";
$sql .= "entity"; $sql .= "entity";
$sql .= ") VALUES ("; $sql .= ") VALUES (";
$sql .= "'(PROV)',";
$sql .= "'".$this->db->escape($this->fk_user)."',"; $sql .= "'".$this->db->escape($this->fk_user)."',";
$sql .= " '".$this->db->idate($now)."',"; $sql .= " '".$this->db->idate($now)."',";
$sql .= " '".$this->db->escape($this->description)."',"; $sql .= " '".$this->db->escape($this->description)."',";

View File

@@ -59,6 +59,10 @@ ALTER TABLE llx_emailcollector_emailcollectoraction ADD COLUMN position integer
-- For v11 -- 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; 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); insert into llx_c_type_container (code,label,module,active) values ('menu', 'Menu', 'system', 1);

View File

@@ -19,7 +19,7 @@
CREATE TABLE llx_holiday CREATE TABLE llx_holiday
( (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
ref varchar(30) NULL, -- number ref varchar(30) NOT NULL,
ref_ext varchar(255), ref_ext varchar(255),
entity integer DEFAULT 1 NOT NULL, -- Multi company id entity integer DEFAULT 1 NOT NULL, -- Multi company id
fk_user integer NOT NULL, fk_user integer NOT NULL,

View File

@@ -625,7 +625,7 @@ Module5000Desc=Allows you to manage multiple companies
Module6000Name=Workflow Module6000Name=Workflow
Module6000Desc=Workflow management (automatic creation of object and/or automatic status change) Module6000Desc=Workflow management (automatic creation of object and/or automatic status change)
Module10000Name=Websites 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 Module20000Name=Leave Request Management
Module20000Desc=Define and track employee leave requests Module20000Desc=Define and track employee leave requests
Module39000Name=Product Lots Module39000Name=Product Lots

View File

@@ -847,6 +847,7 @@ Progress=Progress
ProgressShort=Progr. ProgressShort=Progr.
FrontOffice=Front office FrontOffice=Front office
BackOffice=Back office BackOffice=Back office
Submit=Submit
View=View View=View
Export=Export Export=Export
Exports=Exports Exports=Exports

View File

@@ -33,6 +33,7 @@ TicketDictSeverity=Ticket - Severities
TicketTypeShortBUGSOFT=Dysfonctionnement logiciel TicketTypeShortBUGSOFT=Dysfonctionnement logiciel
TicketTypeShortBUGHARD=Dysfonctionnement matériel TicketTypeShortBUGHARD=Dysfonctionnement matériel
TicketTypeShortCOM=Commercial question TicketTypeShortCOM=Commercial question
TicketTypeShortHELP=Request for functionnal help TicketTypeShortHELP=Request for functionnal help
TicketTypeShortISSUE=Issue, bug or problem TicketTypeShortISSUE=Issue, bug or problem
TicketTypeShortREQUEST=Change or enhancement request TicketTypeShortREQUEST=Change or enhancement request

View File

@@ -2551,6 +2551,7 @@ if (!function_exists("llxFooter"))
print '<div id="dialogforpopup" style="display: none;"></div>'."\n"; print '<div id="dialogforpopup" style="display: none;"></div>'."\n";
// Add code for the asynchronous anonymous first ping (for telemetry) // 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')) if (($_SERVER["PHP_SELF"] == DOL_URL_ROOT.'/index.php') || GETPOST('forceping', 'alpha'))
{ {
//print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'; //print '<!-- instance_unique_id='.$conf->file->instance_unique_id.' MAIN_FIRST_PING_OK_ID='.$conf->global->MAIN_FIRST_PING_OK_ID.' -->';
@@ -2560,6 +2561,8 @@ if (!function_exists("llxFooter"))
{ {
if (empty($_COOKIE['DOLINSTALLNOPING_'.md5($conf->file->instance_unique_id)])) if (empty($_COOKIE['DOLINSTALLNOPING_'.md5($conf->file->instance_unique_id)]))
{ {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
print "\n".'<!-- Includes JS for Ping of Dolibarr MAIN_FIRST_PING_OK_DATE = '.$conf->global->MAIN_FIRST_PING_OK_DATE.' MAIN_FIRST_PING_OK_ID = '.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'."\n"; print "\n".'<!-- Includes JS for Ping of Dolibarr MAIN_FIRST_PING_OK_DATE = '.$conf->global->MAIN_FIRST_PING_OK_DATE.' MAIN_FIRST_PING_OK_ID = '.$conf->global->MAIN_FIRST_PING_OK_ID.' -->'."\n";
print "\n<!-- JS CODE TO ENABLE the anonymous Ontime Ping -->\n"; print "\n<!-- JS CODE TO ENABLE the anonymous Ontime Ping -->\n";
$hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id); $hash_unique_id = md5('dolibarr'.$conf->file->instance_unique_id);
@@ -2580,7 +2583,8 @@ if (!function_exists("llxFooter"))
entity: "<?php echo (int) $conf->entity; ?>", entity: "<?php echo (int) $conf->entity; ?>",
dbtype: "<?php echo dol_escape_js($db->type); ?>", dbtype: "<?php echo dol_escape_js($db->type); ?>",
country_code: "<?php echo dol_escape_js($mysoc->country_code); ?>", country_code: "<?php echo dol_escape_js($mysoc->country_code); ?>",
php_version: "<?php echo phpversion(); ?>" php_version: "<?php echo phpversion(); ?>",
os_version: "<?php echo version_os('smr'); ?>"
}, },
success: function (data, status, xhr) { // success callback function (data contains body of response) success: function (data, status, xhr) { // success callback function (data contains body of response)
console.log("Ping ok"); console.log("Ping ok");

View File

@@ -966,7 +966,7 @@ class Products extends DolibarrApi
* Delete attributes by id. * Delete attributes by id.
* *
* @param int $id ID of Attribute * @param int $id ID of Attribute
* @return int * @return int Result of deletion
* *
* @throws RestException * @throws RestException
* @throws 401 * @throws 401
@@ -981,14 +981,15 @@ class Products extends DolibarrApi
$prodattr = new ProductAttribute($this->db); $prodattr = new ProductAttribute($this->db);
$prodattr->id = (int) $id; $prodattr->id = (int) $id;
$result = $prodattr->delete(); $result = $prodattr->delete(DolibarrApiAccess::$user);
if ($result > 0) { if ($result <= 0) {
return 1;
}
throw new RestException(500, "Error deleting attribute"); throw new RestException(500, "Error deleting attribute");
} }
return $result;
}
/** /**
* Get attribute value by id. * Get attribute value by id.
* *
@@ -1486,7 +1487,7 @@ class Products extends DolibarrApi
* Delete product variants. * Delete product variants.
* *
* @param int $id ID of Variant * @param int $id ID of Variant
* @return int * @return int Result of deletion
* *
* @throws RestException * @throws RestException
* @throws 401 * @throws 401
@@ -1502,13 +1503,12 @@ class Products extends DolibarrApi
$prodcomb = new ProductCombination($this->db); $prodcomb = new ProductCombination($this->db);
$prodcomb->id = (int) $id; $prodcomb->id = (int) $id;
$result = $prodcomb->delete(DolibarrApiAccess::$user); $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 // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/** /**

View File

@@ -729,7 +729,7 @@ dol_fiche_end();
// Save // Save
print '<div class="center">'; print '<div class="center">';
print '<input type="submit" value="'.$langs->trans("Save").'" id="submitsave" class="button">'; print '<input type="submit" value="'.$langs->trans("Submit").'" id="submitsave" class="button">';
if (!empty($backtopage)) if (!empty($backtopage))
{ {
print ' &nbsp; &nbsp; <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button">'; print ' &nbsp; &nbsp; <input type="submit" value="'.$langs->trans("Cancel").'" id="submitcancel" class="button">';

View File

@@ -53,7 +53,6 @@ $extrafields = new ExtraFields($db);
$extrafields->fetch_name_optionals_label($object->table_element); $extrafields->fetch_name_optionals_label($object->table_element);
/* /*
* Actions * Actions
*/ */
@@ -358,7 +357,7 @@ if ($action != "infos_success") {
$formticket->withfile = 2; $formticket->withfile = 2;
$formticket->action = 'create_ticket'; $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)) { if (empty($defaultref)) {
$defaultref = ''; $defaultref = '';

View File

@@ -781,7 +781,7 @@ if ($resql)
print $reception->getNomUrl(1); print $reception->getNomUrl(1);
$filename = dol_sanitizeFileName($reception->ref); $filename = dol_sanitizeFileName($reception->ref);
$filedir = $conf->reception->dir_output.'/'.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 $formfile->getDocumentsLink($reception->element, $filename, $filedir);
print "</td>\n"; print "</td>\n";

View File

@@ -111,11 +111,15 @@ if ($action == 'setvalue' && $user->admin)
// Payment token for URL // Payment token for URL
$result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity); $result = dolibarr_set_const($db, "PAYMENT_SECURITY_TOKEN", GETPOST('PAYMENT_SECURITY_TOKEN', 'alpha'), 'chaine', 0, '', $conf->entity);
if (!$result > 0) if (!$result > 0) {
$error++; $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); $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++; $error++;
}
}
if (!$error) { if (!$error) {
$db->commit(); $db->commit();
@@ -452,7 +456,7 @@ print '</table>';
dol_fiche_end(); dol_fiche_end();
print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></div>'; print '<div class="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></div>';
print '</form>'; print '</form>';

View File

@@ -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_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_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); $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) if ($conf->global->TAKEPOS_ORDER_NOTES == 1)
{ {
$extrafields = new ExtraFields($db); $extrafields = new ExtraFields($db);
@@ -241,6 +244,20 @@ print '<td colspan="2">';
print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1); print $form->selectyesno("TAKEPOS_DIRECT_PAYMENT", $conf->global->TAKEPOS_DIRECT_PAYMENT, 1);
print "</td></tr>\n"; print "</td></tr>\n";
// Sumup options
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
print '<tr class="oddeven"><td>';
print $langs->trans("SumupAffiliate");
print '<td colspan="2">';
print '<input type="text" name="TAKEPOS_SUMUP_AFFILIATE" value="' . $conf->global->TAKEPOS_SUMUP_AFFILIATE . '"></input>';
print "</td></tr>\n";
print '<tr class="oddeven"><td>';
print $langs->trans("SumupAppId");
print '<td colspan="2">';
print '<input type="text" name="TAKEPOS_SUMUP_APPID" value="' . $conf->global->TAKEPOS_SUMUP_APPID . '"></input>';
print "</td></tr>\n";
}
// Custom Receipt // Custom Receipt
print '<tr class="oddeven"><td>'; print '<tr class="oddeven"><td>';
print $langs->trans('CustomReceipt'); print $langs->trans('CustomReceipt');

View File

@@ -74,6 +74,9 @@ 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_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_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); $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);
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) { foreach($paiements as $modep) {
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue;
$name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse; $name="CASHDESK_ID_BANKACCOUNT_".$modep->code.$terminaltouse;
@@ -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); $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++; if (! empty($conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$terminaltouse})) $atleastonefound++;
print '</td></tr>'; print '</td></tr>';
if ($conf->global->TAKEPOS_ENABLE_SUMUP) {
print '<tr class="oddeven"><td>' . $langs->trans("CashDeskBankAccountForSumup") . '</td>';
print '<td>';
$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 '</td></tr>';
}
foreach($paiements as $modep) { foreach($paiements as $modep) {
if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; // Already managed before if (in_array($modep->code, array('LIQ', 'CB', 'CHQ'))) continue; // Already managed before

View File

@@ -1,60 +0,0 @@
<?php
/* Copyright (C) 2018 SuperAdmin
*
* 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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* \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;
}

View File

@@ -176,6 +176,35 @@ else print "var received=0;";
else location.reload(); else location.reload();
}); });
} }
function ValidateSumup() {
<?php $_SESSION['SMP_CURRENT_PAYMENT'] = "NEW" ?>
var invoiceid = <?php echo($invoiceid > 0 ? $invoiceid : 0); ?>;
var amountpayed = $("#change1").val();
if (amountpayed > <?php echo $invoice->total_ttc; ?>) {
amountpayed = <?php echo $invoice->total_ttc; ?>;
}
// Starting sumup app
window.open('sumupmerchant://pay/1.0?affiliate-key=<?php echo dolibarr_get_const($db, "TAKEPOS_SUMUP_AFFILIATE")?>&app-id=<?php echo dolibarr_get_const($db, "TAKEPOS_SUMUP_APPID")?>&total=' + amountpayed + '&currency=EUR&title=' + invoiceid + '&callback=<?php echo DOL_MAIN_URL_ROOT ?>/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=<?php echo $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);
}
</script> </script>
<div style="position:absolute; top:2%; left:5%; height:30%; width:91%;"> <div style="position:absolute; top:2%; left:5%; height:30%; width:91%;">
@@ -269,6 +298,13 @@ while($i < count($paiements)){
<?php <?php
$i=$i+1; $i=$i+1;
} }
if($conf->global->TAKEPOS_ENABLE_SUMUP && !empty(dolibarr_get_const($db, "CASHDESK_ID_BANKACCOUNT_SUMUP".$_SESSION["takeposterminal"]))) {
?>
<button type="button" class="calcbutton2" onclick="ValidateSumup();">Sumup</button>
<?php
}
$class=($i==3)?"calcbutton3":"calcbutton2"; $class=($i==3)?"calcbutton3":"calcbutton2";
foreach($action_buttons as $button){ foreach($action_buttons as $button){
$newclass = $class.($button["class"]?" ".$button["class"]:""); $newclass = $class.($button["class"]?" ".$button["class"]:"");

35
htdocs/takepos/smpcb.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
require '../main.inc.php';
if(isset($_GET['status'])) {
die(strtoupper($_SESSION['SMP_CURRENT_PAYMENT']));
}
if($_GET['smp-status']) {
print '<html lang="en">
<head>
<meta charset="utf-8">
<title>The HTML5 Herald</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="SitePoint">
<link rel="stylesheet" href="css/styles.css?v=1.0">
</head>
<body>';
$_SESSION['SMP_CURRENT_PAYMENT'] = $_GET['smp-status'];
print '<script type="application/javascript">
window.onload = function() {
window.close();
};
</script>';
print "Transaction status registered, you can close this";
die('</body></html>');
}
print 'NOOP';

View File

@@ -2127,7 +2127,7 @@ form#login {
border-radius: 4px; border-radius: 4px;
border:solid 1px rgba(80,80,80,.4); 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{ .login_table input#username, .login_table input#password, .login_table input#securitycode{
border: none; border: none;

View File

@@ -174,9 +174,10 @@ class ProductAttribute
/** /**
* Deletes a product attribute * Deletes a product attribute
* *
* @param User $user Object user
* @return int <0 KO, >0 OK * @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; $sql = "DELETE FROM ".MAIN_DB_PREFIX."product_attribute WHERE rowid = ".(int) $this->id;

View File

@@ -394,7 +394,7 @@ if (! empty($id) || ! empty($ref))
} }
} }
$listofvariantselected .= '</div>'; $listofvariantselected .= '</div>';
//print dol_fiche_end(); //dol_fiche_end();
} else { } else {
$title = $langs->trans('EditProductCombination'); $title = $langs->trans('EditProductCombination');
} }
@@ -602,7 +602,7 @@ if (! empty($id) || ! empty($ref))
print '</table>'; print '</table>';
} }
print dol_fiche_end(); dol_fiche_end();
?> ?>
<div style="text-align: center"> <div style="text-align: center">