diff --git a/.editorconfig b/.editorconfig index 3c4bd7d679d..3e3bd16bb34 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,7 +1,8 @@ -# EditorConfig is awesome: http://EditorConfig.org +# EditorConfig is awesome: https://editorconfig.org # top-most EditorConfig file root = true + # Unix-style newlines with a newline ending every file [*] charset = utf-8 @@ -11,9 +12,10 @@ insert_final_newline = true # PHP PSR-2 Coding Standards # http://www.php-fig.org/psr/psr-2/ [*.php] -indent_style = space +indent_style = tab indent_size = 4 trim_trailing_whitespace = true +insert_final_newline = true [*.js] indent_style = tab [*.css] diff --git a/COPYRIGHT b/COPYRIGHT index 510bf5d3b4f..7cebde7c362 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -19,7 +19,7 @@ PHPDebugBar 1.15.0 MIT License Yes Used only by EvalMath 1.0 BSD Yes Safe math expressions evaluation Escpos-php ? MIT License Yes Thermal receipt printer library, for use with ESC/POS compatible printers GeoIP 1.4 LGPL-2.1+ Yes Sample code to make geoip convert (not into deb package) -Mobiledetect 2.8.17 MIT License Yes Detect mobile devices browsers +Mobiledetect 2.8.83 MIT License Yes Detect mobile devices browsers NuSoap 0.9.5 LGPL 2.1+ Yes Library to develop SOAP Web services (not into rpm and deb package) PEAR Mail_MIME 1.8.9 BSD Yes NuSoap dependency odtPHP 1.0.1 GPL-2+ Yes Library to build/edit ODT files diff --git a/ChangeLog b/ChangeLog index 355d9baa561..70ae8ff8b5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,21 +6,160 @@ English Dolibarr ChangeLog ***** ChangeLog for 10.0.0 compared to 9.0.0 ***** For Users: NEW: Module "Ticket" is available as a stable module. -NEW: module "Email Collector" is available as a stable module. -NEW: module "TakePOS" is available as a stable module. +NEW: Module "Email Collector" is available as a stable module. +NEW: Module "TakePOS" is available as a stable module. NEW: Experimental module "Vendor receptions". NEW: Experimental module "BOM". -FIX: Disallow line start date if after end date. +NEW: Accounting - Add default accounting account for member subcriptions. +NEW: Accounting - More comprehensive menu. +NEW: Agenda/event - add description column available in list (hidden by default). +NEW: Add accounting account for result. +NEW: Add accounting code for EEC sales and export sales on products. +NEW: Add a security permission to edit php dynamic content on the WebSite module. +NEW: Attached document on bank account are now visible in automatic ECM. +NEW: Add Autofill Remainder Amount picto on the Expense Report Payment Page. +NEW: Add contact status in category export +NEW: Add Default Warehouse to user record (if module stock is on) +NEW: Add employee/user to subledger account list +NEW: Add gender in member card +NEW: Add getFormatedCustomerRef and getFormatedSupplierRef methods +NEW: Add history to view and print previous sales on TakePos. +NEW: Add import of accounting account for intra/export selling on product card +NEW: Adding code to show update date of supplier price shown +NEW: Add line total on list of payments +NEW: Add LinkedIn field in social network module +NEW: Add more complete error messages in log on stripe payments +NEW: Add no_email field in contact list +NEW: Add notes are show in tooltips +NEW: Add option DONATION_USE_THIRDPARTIES in admin of membership module +NEW: Add option STOCK_SHOW_VIRTUAL_STOCK_IN_PRODUCTS_COMBO +NEW: add page to setup opening hours of the company +NEW: add payments table to pdf of expense report +NEW: add payment terms to invoices list +NEW: Add picto of deletion on mass action combo lists +NEW: add product extrafields available into shipping export +NEW: add ref supplier on supplier invoice +NEW: Add stats on entries & movements by fiscal year +NEW: Add subledger in various payment module +NEW: Add tag for ODT generation for localtax rates +NEW: Add the now link when creating expense report +NEW: Ask date of invoice when using the Clone feature. +NEW: auto event msg +NEW: Automatically binding for intra/export accountancy code in customer list +NEW: automatic / manual selector form +NEW: Better explanation for setup of WebDav module +NEW: Can add more lines on situation invoices at end of project when there is extra to add. +NEW: Can change the customer account of an instance +NEW: Can choose the root category to show products for TakePOS module +NEW: Can edit supplier on draft order supplier +NEW: Can enter price with or without tax when entering expense repor line +NEW: Can filter on the date of period for social contributions +NEW: Can generate invoices from the timespent entered on a project +NEW: Can update product supplier price ref +NEW: Can upload files from the edit page of expense report +NEW: Color for hover and for checked line is on by default +NEW: Column of parent company is available in list of third parties +NEW: conditionnal add member button by statut +NEW: constant KEEP_DISCOUNT_LINES_FROM_ORIGIN +NEW: Contact related items tab +NEW: Can create of supplier invoice from a reception +NEW: Ensure External RSS Links Open in New Window +NEW: Export available for reception module +NEW: Extend import option to Order's card and Propal's card +NEW: filter by thirdparty on report CA by prod/serv +NEW: Save space by moving the meteo on the title line +NEW: Get the list of groups of a user with the REST API. +NEW: Hidden option MAIN_CAN_EDIT_SUPPLIER_ON_SUPPLIER_ORDER to edit supplier on draft supplier order +NEW: Improve Displaying Shortcut Access Keys in Navigation. +NEW: Improve Expensereport, Inverse Receiver. +NEW: Improve pdf description item visibitity. +NEW: Introduce a config parameter $dolibarr_main_instance_unique_id +NEW: Introduce css "nobottomiftotal" +NEW: Introduce PhpSpreadsheet for export (need php5.6+) +NEW: Invoice creation from the timesheet +NEW: Can list remote stripe's payout in a dedicated page. +NEW: Manage account sell_intra & sell_export in page accoutancy admin default product +NEW: Manage loan schedule. +NEW: Manage status of member types. +NEW: Mass action "create bills" for validated reception +NEW: Measuring unit are now defined into an editable dictionary. Add product size/unit into product import. +NEW: Template pdf 'canelle_reception' displays linked reception lines. +NEW: Moral/physic status can be defined at member type level +NEW: Pagination into list of time spent. +NEW: Performance enhancement (Replace dirname(__FILE__) with __DIR__) +NEW: POS support in order (ex: online cart). +NEW: Preview of images into the filemanager component. +NEW: Resource module can be used in products/services (in a dedicated tab) +NEW: Retrieve invoice infos from order when billing shipment +NEW: Save and display type of membership in subscription table for more explicit historic +NEW: Setup default thirdparty type (customer or prospect/customer) +NEW: Add shipping "set draft" button and can update lines. +NEW: show in blod, the invoice amount where we came from, when making payment +NEW: Show product dimensions in product tooltips. +NEW: Show the latest date of subscription in member statistics reports. +NEW: Sort list of templates alphabetically +NEW: Stripe Payment Intent (need option to use this new Stripe api method) +NEW: Can support barcode on supplier price references. +NEW: Support tag {ccc} on payment ref +NEW: The preview of PDF files generates only 1 png file, even if several pages. +NEW: Can select a Thirdparty object in donation module if option ON. +NEW: Tooltip with VAT amount and price incl tax on lines of objects. +NEW: Unsubscribed emails are now stored in a dedicated table. +NEW: Update working chkbxlst filter for lists. +NEW: Use ajax switch into setup of donation.php and multi-currency module. +NEW: use recipient language when generating the fullname for emails. +NEW: When you create product or service, sell accountancy account by default is suggested. +NEW: Widget birthdays of the month. +NEW: Option in workflow module to set a reception billed on validate supplier bill. +NEW: Autocompletion on lists should be available on mobile applications. For Developers: NEW: Module "DebugBar" is available as a stable module. +NEW: Add API REST for donations +NEW: Add a script 'purge-data.php' to purge data older than a defined creation date +NEW: Add constant XFRAMEOPTIONS_ALLOWALL +NEW: Add function isValidVATID() +NEW: ADD document's product support in APIs +NEW: REST API: get the list of objects in a category. +NEW: Update Stripe library to 6.34.3 +NEW: Upgrade jquery lib to 3.3.1 +NEW: Add hook 'addHtmlHeader()' +NEW: Add hook 'createRecurringInvoices()' +NEW: Add hook 'afterSelectContactOptions' +NEW: Add hook support in accountancy index +NEW: Add hook support in list of template invoices +NEW: Add parameter 'replaceambiguouschars' on getRandomPassword function +NEW: Add property 'noteditable' in modulebuilder +NEW: Add the current modulepart into the Conf class object +NEW: Add trigger FICHINTER_UNVALIDATE +NEW: Add visibility with value 4 in framework to define fields to show +NEW: More option to tune initialization of a new module with modulebuilder. +NEW: API to list currencies +NEW: API Proposal, Orders, Invoices: Add contact details +NEW: hidden option to change concat desc order +NEW: Enhance management of webhooks +NEW: Generation of doc by modulebuilder can include README and CHANGELOG +NEW: massfilesarea feature for external modules +NEW: Show enabled modules in dol_print_error() +NEW: Simplification of CSS styles of default themes. +NEW: Clean code of a lot of deprecated code. +NEW: Add hidden option to set a search entry to the top +NEW: add hidden option DISPLAY_DISCOUNTED_SUPPLIER_PRICE +NEW: add hidden option MAIN_DEFAULT_LANGUAGE_FILTER +NEW: add hidden option NO_CONCAT_DESCRIPTION +NEW: Add hidden option for ACCOUNTANCY_COMBO_FOR_AUX +NEW: Add hidden option 'ADD_UNSPLASH_LOGIN_BACKGROUND' +NEW: Add Hidden option 'OVERRIDE_VAT_FOR_EXPENSE_REPORT' +NEW: add hidden option MAIN_DOC_UPLOAD_NOT_RENAME_BY_DEFAULT +NEW: Hidden conf to improve pdf desc item visibitity +NEW: Look and feel v10 - Add CSS 'tabBarNoTop' WARNING: Following changes may create regressions for some external modules, but were necessary to make Dolibarr better: * PHP 5.4 is no more supported. Minimum PHP is now 5.5+. -* The PHP extension php-intl is not mandatory but should be installed to have new features working correctly. +* The PHP extension php-intl is not mandatory and must be installed to have new features working correctly. * Method GetUrlTrackingStatus were renamed into getUrlTrackingStatus for consistency with naming rules. * API getListOfCivility has been renamed into getListOfCivilities for consistency with naming rules. * Deprecated function img_phone as been removed. You can use img_picto(..., 'call|call_out') instead.; @@ -69,6 +208,7 @@ FIX: Total per day shows 00:00 if the total time spent is equal to 12:00 FIX: Update/delete currency on same languages FIX: Wrong variable name make contact of supplier order not used on PDF. FIX: Add hidden option MAIN_PDF_HIDE_SITUATION to hide situation (quick hack to fix output pb). +FIX: attached files list with link file was broked ***** ChangeLog for 9.0.2 compared to 9.0.1 ***** FIX: #10822 @@ -289,6 +429,90 @@ Following changes may create regressions for some external modules, but were nec * Remove the no more used and deprecated dol_print_graph function +***** ChangeLog for 8.0.5 compared to 8.0.4 ***** +FIX: #10381 +FIX: #10460 compatibility with MariaDB 10.4 +FIX: #11025 +FIX: Accountancy - Add transaction with multicompany use all the time 1st entity +FIX: Accountancy - Format EBP import +FIX: actioncomm export: ORDER BY clause is in wrong export property + event type filter does not work +FIX: actioncomm: sort events by date after external calendars and hook +FIX: action list: add printFieldListSelect and printFieldListWhere hooks +FIX: add fk_unit on addline action +FIX: avoid php warning +FIX: bad sql request +FIX: better method +FIX: better test +FIX: better test on fetch +FIX: broken external authentication module feature and avoid warning +FIX: Can not create contract with numbering module without autogen rule +FIX: can't add lines on invoices +FIX: Can't generate invoice pdf +FIX: Can't insert if there is extrafields mandatory on another entity. +FIX: Can't insert if there is extrafields mandatory on another entity. FIX: Can't set default value of extrafield of type varchar +FIX: Check for old picture name if the new one was not found +FIX: Civility not saved when creating a member. +FIX: $conf->fournisseur->commande->enabled doesn't exist, we must use $conf->fournisseur->enabled +FIX: could not create several superadmin in transversal mode +FIX: credit note can have negative value +FIX: Default value on sales representative on third party creation +FIX: Don't show journal:getNomUrl without data +FIX: Erreur dans le Total +FIX: error messages not displayed +FIX: expedition: reset status on rollback + replace hardcoded status with const +FIX: Fix PHP warning "count(): Parameter must be an array..." +FIX: fk_default_warehouse missing in group by +FIX: function sendEmailsReminder isn't completely developed, then MAIN_FEATURES_LEVEL must be 2 to "use" it +FIX: holidays get natural_search if search params are set only +FIX: if empty error message, we just see "error" displayed +FIX: if(!method_exists(dol_loginfunction)) +FIX: If we build one invoice for several orders, we must put the ref of order on the line to not lose information. +FIX: in fact expensereport must be in $check array +FIX: Interface regression for bind people. Fix option MAIN_OPTIMIZEFORTEXTBROWSER +FIX: line edit template: keep fk_parent_line +FIX: Loan impossible to account +FIX: Mark credit note as available for credit note in other currency +FIX: missing access security checking with multicompany +FIX: missing entity filter and wrong var name +FIX: missing entity filter in function "build_filterField()" (export) +FIX: Missing field in import/export of users +FIX: missing hook completeTabsHead in margins module +FIX: missing $ismultientitymanaged for previous/next ref +FIX: Missing province in export of invoice +FIX: multicompany compatibility +FIX: must fetch member in current entity +FIX: need an order by in case we found other invoice with same number but not same date +FIX: need to round with 2 decimals to avoid movements not correctly balanced +FIX: no need to test anything to display documents tabs on expense report +FIX: positive values creating diff on addline rounding +FIX: problem with multicompany transverse mode +FIX: Product accountancey sell intra code must be visible if main feature level 1 +FIX: project_title for display of getNomUrl() +FIX: quick search for supplier orders +FIX: Remane of project +FIX: same thing here +FIX: Selection of email recipient with option MAIN_OPTIMIZEFORTEXTBROWSER +FIX: several hooks in shipping/delivery cards +FIX: shipping default warehouse if only one warehouse +FIX: SQL injection on rowid of dict.php +FIX: 'statut' is ignored when updating a user with the REST API. +FIX: supplier invoice payment total dont care about deposit or credit +FIX: supplier invoice product stats total ht is line total not invoice total +FIX: The minimum amount filter does not work in the VAT report per customer +FIX: Total per day shows 00:00 if the total time spent is equal to 12:00 +FIX: Update/delete currency on same languages +FIX: [URGENT] broken feature, "$usercancreate" is for Dolibarr 9 +FIX: useless join +FIX: we need to keep originline special_code +FIX: we want to be able to reopen fourn credit note +FIX: when 2 extra fields are mandatory in 2 different entities +FIX: when we add a payment on an invoice which already has payments with credit note or deposit amount, and then we get an excess received, discount amount must be $total_paiements + $total_creditnote_and_deposit - $object->total_ttc; +FIX: when we create deposit with multi tva, we mustn't add line if amount = 0 (example when we have a 100% reduc on one of origin invoice line) +FIX: wrong redirect link on holiday refuse +FIX: wrong test enabled +FIX: Wrong variable name +FIX: XSS + ***** ChangeLog for 8.0.4 compared to 8.0.3 ***** FIX: #10030 better german chart FIX: #10036 diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl index 8f9951ef157..b2aa49927e2 100755 --- a/build/makepack-dolibarr.pl +++ b/build/makepack-dolibarr.pl @@ -357,7 +357,7 @@ if ($nboftargetok) { } else { - print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog. But you can regenerate it with command:'\n"; + print "ChangeLog for $MAJOR.$MINOR\.$BUILD was found into '$SOURCE/ChangeLog'. But you can regenerate it with command:\n"; } if (! $BUILD || $BUILD eq '0-rc') # For a major version { diff --git a/build/phpstan/bootstrap.php b/build/phpstan/bootstrap.php new file mode 100644 index 00000000000..e567b609a2f --- /dev/null +++ b/build/phpstan/bootstrap.php @@ -0,0 +1,14 @@ + $langs->trans('Modelcsv_ebp'), self::$EXPORT_TYPE_COGILOG => $langs->trans('Modelcsv_cogilog'), self::$EXPORT_TYPE_AGIRIS => $langs->trans('Modelcsv_agiris'), + self::$EXPORT_TYPE_OPENCONCERTO => $langs->trans('Modelcsv_openconcerto'), self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'), ); } @@ -126,6 +128,7 @@ class AccountancyExport self::$EXPORT_TYPE_EBP => 'ebp', self::$EXPORT_TYPE_COGILOG => 'cogilog', self::$EXPORT_TYPE_AGIRIS => 'agiris', + self::$EXPORT_TYPE_OPENCONCERTO => 'openconcerto', self::$EXPORT_TYPE_FEC => 'fec', ); @@ -187,6 +190,10 @@ class AccountancyExport 'label' => $langs->trans('Modelcsv_FEC'), 'ACCOUNTING_EXPORT_FORMAT' => 'txt', ), + self::$EXPORT_TYPE_OPENCONCERTO => array( + 'label' => $langs->trans('Modelcsv_openconcerto'), + 'ACCOUNTING_EXPORT_FORMAT' => 'csv', + ), ), 'cr'=> array ( '1' => $langs->trans("Unix"), @@ -248,6 +255,9 @@ class AccountancyExport case self::$EXPORT_TYPE_AGIRIS : $this->exportAgiris($TData); break; + case self::$EXPORT_TYPE_OPENCONCERTO : + $this->exportOpenConcerto($TData); + break; case self::$EXPORT_TYPE_FEC : $this->exportFEC($TData); break; @@ -588,6 +598,39 @@ class AccountancyExport } } + /** + * Export format : OpenConcerto + * + * @param array $objectLines data + * + * @return void + */ + public function exportOpenConcerto($objectLines) + { + + $separator = ';'; + $end_line = "\n"; + + foreach ($objectLines as $line) { + + $date = dol_print_date($line->doc_date, '%d/%m/%Y'); + + print $date . $separator; + print $line->code_journal; + if (empty($line->subledger_account)) { + print length_accountg($line->numero_compte) . $separator; + } else { + print length_accounta($line->subledger_account) . $separator; + } + print $line->doc_ref . $separator; + print $line->label_operation . $separator; + print price($line->debit) . $separator; + print price($line->credit) . $separator; + + print $end_line; + } + } + /** * Export format : Configurable * diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 878a1081b40..54f3a4cbb73 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -271,7 +271,7 @@ if ($action == 'addthumb') // Regenerate thumbs $error++; $langs->load("errors"); setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); - dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_WARNING); + dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO); } } else @@ -412,9 +412,9 @@ if ($action == 'edit' || $action == 'updateedit') } // Logo - print '
| '; - print ''; + print ''; print ' | '; if (! empty($mysoc->logo_mini)) { print ''.img_delete($langs->trans("Delete")).''; @@ -798,9 +798,9 @@ else print ' |
| '.$langs->trans("Gencod").' | ' . $conf->global->MAIN_INFO_SOCIETE_GENCOD . ' | ';
if ($obj->project_id > 0) {
print $projectstatic->title;
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 35cb8335232..38a38d45b12 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -499,7 +499,7 @@ class Commande extends CommonOrder
return -1;
}
- dol_syslog(get_class($this)."::set_draft", LOG_DEBUG);
+ dol_syslog(__METHOD__, LOG_DEBUG);
$this->db->begin();
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 4ff7fe364bd..ad3fd777a5c 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -430,11 +430,10 @@ if ($resql)
// List of mass actions available
$arrayofmassactions = array(
- 'generate_doc'=>$langs->trans("Generate"),
- 'presend'=>$langs->trans("SendByMail"),
+ 'generate_doc'=>$langs->trans("ReGeneratePDF"),
'builddoc'=>$langs->trans("PDFMerge"),
'cancelorders'=>$langs->trans("Cancel"),
-
+ 'presend'=>$langs->trans("SendByMail"),
);
if($user->rights->facture->creer) $arrayofmassactions['createbills']=$langs->trans("CreateInvoiceForThisCustomer");
if ($user->rights->commande->supprimer) $arrayofmassactions['predelete']=''.$langs->trans("Delete");
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index fe017a6b1aa..0d0b202a8c3 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -1,6 +1,6 @@
- * Copyright (C) 2004-2013 Laurent Destailleur '.$companystatic->getNomUrl(1, 'customer').''; } + print '';
print ' ';
+print ' ';
// EMail support
print ' ';
+print ' ';
// Other support
diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php
index 7085d904891..66a8a90f528 100644
--- a/htdocs/takepos/admin/terminal.php
+++ b/htdocs/takepos/admin/terminal.php
@@ -58,7 +58,6 @@ if($resql){
}
$terminaltouse = $terminal;
-if ($terminaltouse == '1') $terminaltouse = '';
/*
diff --git a/htdocs/takepos/floors.php b/htdocs/takepos/floors.php
index 9401d61b9a0..a2a0f0bc4c0 100644
--- a/htdocs/takepos/floors.php
+++ b/htdocs/takepos/floors.php
@@ -43,7 +43,6 @@ $left = GETPOST('left', 'alpha');
$top = GETPOST('top', 'alpha');
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
-$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
$newname = GETPOST('newname', 'alpha');
$mode = GETPOST('mode', 'alpha');
diff --git a/htdocs/takepos/freezone.php b/htdocs/takepos/freezone.php
index 64c21a30304..b47d7114528 100644
--- a/htdocs/takepos/freezone.php
+++ b/htdocs/takepos/freezone.php
@@ -36,7 +36,6 @@ require '../main.inc.php'; // Load $user and permissions
$langs->loadLangs(array("bills", "cashdesk"));
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
-$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
$idline = GETPOST('idline', 'int');
$action = GETPOST('action', 'alpha');
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 7645ef176c5..510b949b92b 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -43,7 +43,6 @@ $id = GETPOST('id', 'int');
$action = GETPOST('action', 'alpha');
$idproduct = GETPOST('idproduct', 'int');
$place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant
-$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS
/**
* Abort invoice creationg with a given error message
@@ -90,7 +89,7 @@ if ($invoiceid > 0)
}
else
{
- $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takepostermvar"].'-'.$place.')');
+ $ret = $invoice->fetch('', '(PROV-POS'.$_SESSION["takeposterminal"].'-'.$place.')');
}
if ($ret > 0)
{
@@ -104,12 +103,12 @@ if ($ret > 0)
if ($action == 'valid' && $user->rights->facture->creer)
{
- if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takepostermvar"]}; // For backward compatibility
- elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takepostermvar"]}; // For backward compatibility
- elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takepostermvar"]}; // For backward compatibility
+ if ($pay == "cash") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
+ elseif ($pay == "card") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
+ elseif ($pay == "cheque") $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
else
{
- $accountname="CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takepostermvar"];
+ $accountname="CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
$bankaccount=$conf->global->$accountname;
}
$now=dol_now();
@@ -137,9 +136,9 @@ if ($action == 'valid' && $user->rights->facture->creer)
$invoice->update($user);
}
- if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takepostermvar"]} != "1")
+ if (! empty($conf->stock->enabled) && $conf->global->{'CASHDESK_NO_DECREASE_STOCK'.$_SESSION["takeposterminal"]} != "1")
{
- $invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takepostermvar"]});
+ $invoice->validate($user, '', $conf->global->{'CASHDESK_ID_WAREHOUSE'.$_SESSION["takeposterminal"]});
}
else
{
@@ -180,13 +179,13 @@ if ($action == 'history')
if (($action=="addline" || $action=="freezone") && $placeid == 0)
{
- $invoice->socid = $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takepostermvar"]};
+ $invoice->socid = $conf->global->{'CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"]};
$invoice->date = dol_now();
$invoice->module_source = 'takepos';
- $invoice->pos_source = (string) $posnb;
+ $invoice->pos_source = $_SESSION["takeposterminal"];
$placeid = $invoice->create($user);
- $sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")' where rowid=".$placeid;
+ $sql="UPDATE ".MAIN_DB_PREFIX."facture set ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")' where rowid=".$placeid;
$db->query($sql);
}
@@ -559,11 +558,11 @@ else { // No invoice generated yet
print ' |
'; print $langs->trans("Customer").': '.$soc->name; print '
'; diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php index 74af8f62ae9..37676f1b1e1 100644 --- a/htdocs/takepos/pay.php +++ b/htdocs/takepos/pay.php @@ -35,7 +35,6 @@ require '../main.inc.php'; // Load $user and permissions require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant -$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS $invoiceid = GETPOST('invoiceid', 'int'); @@ -51,7 +50,7 @@ if ($invoiceid > 0) } else { - $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'"; + $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); if ($obj) diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index c80b3b5b932..5905592607c 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -31,7 +31,6 @@ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; $langs->loadLangs(array("main", "cashdesk")); $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant -$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS $facid=GETPOST('facid', 'int'); @@ -44,7 +43,7 @@ top_httphead('text/html'); if ($place > 0) { - $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takepostermvar"]."-".$place.")'"; + $sql="SELECT rowid FROM ".MAIN_DB_PREFIX."facture where ref='(PROV-POS".$_SESSION["takeposterminal"]."-".$place.")'"; $resql = $db->query($sql); $obj = $db->fetch_object($resql); if ($obj) diff --git a/htdocs/takepos/takepos.php b/htdocs/takepos/takepos.php index f5de960223d..9601c6d0f36 100644 --- a/htdocs/takepos/takepos.php +++ b/htdocs/takepos/takepos.php @@ -39,15 +39,12 @@ require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $place = (GETPOST('place', 'int') > 0 ? GETPOST('place', 'int') : 0); // $place is id of table for Ba or Restaurant -$posnb = (GETPOST('posnb', 'int') > 0 ? GETPOST('posnb', 'int') : 0); // $posnb is id of POS $action = GETPOST('action', 'alpha'); $setterminal = GETPOST('setterminal', 'int'); if ($setterminal>0) { $_SESSION["takeposterminal"]=$setterminal; - if ($setterminal==1) $_SESSION["takepostermvar"]=""; - else $_SESSION["takepostermvar"]=$setterminal; } $langs->loadLangs(array("bills","orders","commercial","cashdesk","receiptprinter")); diff --git a/htdocs/theme/eldy/global.inc.php b/htdocs/theme/eldy/global.inc.php index b797ec69b9e..c07fad24dab 100644 --- a/htdocs/theme/eldy/global.inc.php +++ b/htdocs/theme/eldy/global.inc.php @@ -266,6 +266,10 @@ input#onlinepaymenturl, input#directdownloadlink { opacity: 0.7; } +div#moretabsListaction { + z-index: 5; +} + hr { border: 0; border-top: 1px solid #ccc; } .tabBar hr { margin-top: 20px; margin-bottom: 17px; } @@ -857,7 +861,7 @@ select.selectarrowonleft option { input, input[type=text], input[type=password], select, textarea { min-width: 20px; } - input[type=text], input[type=password] { + .trinputlogin input[type=text], input[type=password] { max-width: 180px; } .vmenu .searchform input { @@ -2251,8 +2255,8 @@ div.popuptabset { border: 1px solid #888; } div.popuptab { - padding-top: 3px; - padding-bottom: 3px; + padding-top: 5px; + padding-bottom: 5px; padding-left: 5px; padding-right: 5px; } diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 2906da3729c..3aea173df6c 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -492,6 +492,10 @@ input[name=surface] { margin-right: 4px; } fieldset { border: 1px solid #AAAAAA !important; } .legendforfieldsetstep { padding-bottom: 10px; } +div#moretabsListaction { + z-index: 5; +} + hr { border: 0; border-top: 1px solid #ccc; } .button, .buttonDelete, input[name="sbmtConnexion"] { @@ -2405,8 +2409,8 @@ div.popuptabset { border: 1px solid #888; } div.popuptab { - padding-top: 3px; - padding-bottom: 3px; + padding-top: 5px; + padding-bottom: 5px; padding-left: 5px; padding-right: 5px; } diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 26fec804370..475c9f5beae 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -283,8 +283,8 @@ if (GETPOST('update') && GETPOST('id') && $user->rights->ticket->write) { if (!$error) { $db->begin(); - $object->label = GETPOST("label"); - $object->description = GETPOST("description"); + $object->label = GETPOST("label", 'alphanohtml'); + $object->description = GETPOST("description", 'none'); //... $ret = $object->update($user); @@ -302,6 +302,7 @@ if (GETPOST('update') && GETPOST('id') && $user->rights->ticket->write) { } } +// Mark as Read if ($action == "mark_ticket_read" && $user->rights->ticket->write) { $object->fetch('', '', GETPOST("track_id", 'alpha')); @@ -317,6 +318,7 @@ if ($action == "mark_ticket_read" && $user->rights->ticket->write) { $action = 'view'; } +// Assign to someone if ($action == "assign_user" && GETPOST('btn_assign_user', 'aplha') && $user->rights->ticket->write) { $object->fetch('', '', GETPOST("track_id", 'alpha')); $useroriginassign = $object->fk_user_assign; diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index c049712d623..5430932f53d 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -1370,7 +1370,7 @@ class Ticket extends CommonObject $this->db->begin(); $sql = "UPDATE " . MAIN_DB_PREFIX . "ticket"; - $sql .= " SET fk_statut = 1, date_read='" . $this->db->idate(dol_now()) . "'"; + $sql .= " SET fk_statut = ".Ticket::STATUS_READ.", date_read='" . $this->db->idate(dol_now()) . "'"; $sql .= " WHERE rowid = " . $this->id; dol_syslog(get_class($this) . "::markAsRead"); @@ -1388,7 +1388,6 @@ class Ticket extends CommonObject // End call triggers } - if (!$error) { $this->db->commit(); return 1; @@ -1421,20 +1420,23 @@ class Ticket extends CommonObject $this->db->begin(); + $this->oldcopy = dol_clone($this); + $sql = "UPDATE " . MAIN_DB_PREFIX . "ticket"; if ($id_assign_user > 0) { - $sql .= " SET fk_user_assign=".$id_assign_user.", fk_statut=4"; + $sql .= " SET fk_user_assign=".$id_assign_user.", fk_statut = ".Ticket::STATUS_ASSIGNED; } else { - $sql .= " SET fk_user_assign=null, fk_statut=1"; + $sql .= " SET fk_user_assign=null, fk_statut = ".Ticket::STATUS_READ; } $sql .= " WHERE rowid = " . $this->id; dol_syslog(get_class($this) . "::assignUser sql=" . $sql); $resql = $this->db->query($sql); - if ($resql) { + if ($resql) + { $this->fk_user_assign = $id_assign_user; // May be used by trigger if (! $notrigger) { @@ -1710,11 +1712,11 @@ class Ticket extends CommonObject { global $conf, $langs; - if ($this->fk_statut != 9) { // not closed + if ($this->fk_statut != Ticket::STATUS_CLOSED) { // not closed $this->db->begin(); $sql = "UPDATE " . MAIN_DB_PREFIX . "ticket"; - $sql .= " SET fk_statut=8, progress=100, date_close='" . $this->db->idate(dol_now()) . "'"; + $sql .= " SET fk_statut=".Ticket::STATUS_CLOSED.", progress=100, date_close='" . $this->db->idate(dol_now()) . "'"; $sql .= " WHERE rowid = " . $this->id; dol_syslog(get_class($this) . "::close sql=" . $sql); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 479604ddc36..926cb50836e 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -423,8 +423,20 @@ if (empty($reshook)) { if (GETPOST('deletephoto')) { $object->photo = ''; } - if (!empty($_FILES['photo']['name'])) { - $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); + if (!empty($_FILES['photo']['name'])) + { + $isimage=image_format_supported($_FILES['photo']['name']); + if ($isimage > 0) + { + $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); + } + else + { + $error++; + $langs->load("errors"); + setEventMessages($langs->trans("ErrorBadImageFormat"), null, 'errors'); + dol_syslog($langs->transnoentities("ErrorBadImageFormat"), LOG_INFO); + } } if (!$error) { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 3409a9599d0..13ae44463d6 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2513,6 +2513,7 @@ class User extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -2534,6 +2535,7 @@ class User extends CommonObject } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Initialize the info array (array of LDAP values) that will be used to call LDAP functions * diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index 721ef661cc2..c3fe000292c 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -925,6 +925,7 @@ class UserGroup extends CommonObject } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Retourne chaine DN complete dans l'annuaire LDAP pour l'objet * @@ -947,6 +948,7 @@ class UserGroup extends CommonObject // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Initialize the info array (array of LDAP values) that will be used to call LDAP functions * diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index e1551310a43..992de6850db 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -272,7 +272,7 @@ if (($caneditperms && empty($objMod->rights_admin_allowed)) || empty($object->ad { print '