diff --git a/ChangeLog b/ChangeLog
index 9432bdea4d7..c301ac59b58 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,32 +2,249 @@
English Dolibarr ChangeLog
--------------------------------------------------------------
+
***** ChangeLog for 17.0.0 compared to 16.0.0 *****
For users:
---------------
-NEW Minimal PHP version is now PHP 7.0 instead of PHP 5.6
-
-...
+NEW: Minimal PHP version is now PHP 7.0 instead of PHP 5.6
+NEW: #21780 Add pid field to Cronjob class and store PID on job execution
+NEW: #19680 Add option PRODUCT_ALLOW_EXTERNAL_DOWNLOAD to automatically have uploaded files shared publicly by a link
+NEW: #20650 can move the checkbox column on left (experimental option)
+NEW: #21000 Added columns 'alias_name' on poject, supplier invoice, supplier order, supplier proposals and taks list
+NEW: #21395 Added option for dark theme mode in display - color and theme
+NEW: #21397 added option to auto define barcode numbers for third-parties in barcode module setup
+NEW: #21399
+NEW: #21442 Enhancement of module builder init
+NEW: #21654 add bank account number used on invoices for debit
+NEW: #22048 Added notes to productlot module
+NEW: #22298 Bank - Add salaries & vat in the tab of planned entries of a bank account
+NEW: #22328
+NEW: #22424
+NEW: #22500 member module set up made easier
+NEW: #22527 projects and thirdparties can be viewed as conversation ("Message" view), like events/agenda.
+NEW: #22546 can now set user supervisors using mass action in htdocs/user
+NEW: #22594 can chose if VAT ID is unique or not for third parties
+NEW: #22622 all partneships displayed on tab partnership of a thirdparty and member
+NEW: #22676 massaction for updating product prices
+NEW: #22735 Massaction to affect users on projects
+NEW: #25594 can chose if VAT ID is unique or not for third parties
+NEW: #4482 adding js to hide/show advanced option on the export data page
+NEW: Accountancy - Add a graphic option to enable lettering function - FPC21
+NEW: Accountancy - Add a way to clean some words when you generate thirdparty accounting account
+NEW: Accountancy - Added an option during export to export or not the lettering FPC21
+NEW: Accountancy - Manage supplier deposit with specific account
+NEW: Accountancy - Model Digitaria - Add a way to clean some words when you generate thirdparty accounting account FPC22
+NEW: Add a button "Test collect" in email collector
+NEW: Add a constant to disallow modification of the product reference.
+NEW: Add a method doAutoRenewContracts that can be used as a cron task.
+NEW: Add " as enclosure by default for CSV export. Keep removing CR/LF.
+NEW: add attached file in presend email form of thirdparty card
+NEW: Add a way to enter LICENSE file content in property of website
+NEW: Add badge in admin extrafields setup
+NEW: add constant PROPAL_BYPASS_VALIDATED_STATUS
+NEW: Add date event (!= date project) and location on event organization
+NEW: Add employment anniversary in birthday box
+NEW: Add extrafield type "IP" to store IP addresses
+NEW: Add fail2ban rules examples to limit access to /public pages
+NEW: Add filter "Product subject to lot/Serial" in stock per lot/serial
+NEW: Add free membership amounts at the membership type level
+NEW: Add hidden option MAIN_EMAIL_SUPPORT_ACK to restore Email ack checkbox (feature abandonned by mailers)
+NEW: Add IMAP port setting on email collector module
+NEW: Adding JAPAN Chart-of-Account and regions/departments
+NEW: Adding NIF verification for Algeria
+NEW: Add link to create an element from the category page
+NEW: add margin infos to takepos invoice lines
+NEW: Add max size send for "backup and link to mail" option
+NEW: Add method httponly_accessforbidden()
+NEW: Add more advices into the Setup security page
+NEW: Add new global variable for keeping the previous signature information on proposale (case of reopen a proposale)
+NEW: Add objectLink on expedition
+NEW: Add oldcopy to Ticket so triggers intercepting TICKET_MODIFY have access to old values of the updated properties
+NEW: Add option FICHINTER_ALLOW_EXTERNAL_DOWNLOAD
+NEW: Add option --force on CLI cron_run_jobs.php
+NEW: Add option "Show price on the generated documents for receptions"
+NEW: Add performance index (name for company and contact) and llx_bank_url(url_id)
+NEW: Add picto property on sub-module for paswword generation
+NEW: Add price to product box in TakePOS
+NEW: add redirect on action confirm addconsumedline and addproduceline
+NEW: Add a new advanced permission "read price"
+NEW: Add substitution key __SENDEREMAIL_SIGNATURE__
+NEW: Add the referrer-policy to "same-origin" by default on all public pages.
+NEW: Add the SMTP header References on ticket email created by email
+NEW: Add the thirdparty column to the time list (projet/tasks/time.php)
+NEW: Add trigger to record the event of sending an email from a project #20912
+NEW: Allow download link option in module configuration (propal,invoice,supplier proposal, order)
+NEW: Bank - Add salaries & vat in tab planned entries
+NEW: Bulk action to remove a category in list/search website pages
+NEW: Can copy/paste images into emails sent.
+NEW: Can edit label of an emailing even once sent
+NEW: Can edit property css, cssview, csslist on extrafields
+NEW: Can enter the unit price including the vat
+NEW: Can invoice task time per different services
+NEW: Can join several files by default on email form
+NEW: Can send an email on scheduled job error
+NEW: Can set a commercial discount by entereing amount including VAT
+NEW: Can set a monthly frequency (or multiple) in cron tasks.
+NEW: Can set start and end dates and comment on button "Activate all services"
+NEW: can sort and preselected best supplier price
+NEW: Website Can delete a whole website if disabled
+NEW: Website Can remove a website template
+NEW: Website can set header "Strict-Transport-Security" in web sites.
+NEW: Website Can switch status of website and page from the website toolbar
+NEW: Website Templates of websites are now directories and not zip into core repo
+NEW: Website Add 4 other templates in website module
+NEW: Can use products categories to make inventory
+NEW: Change filter type on tickets list into a multiselect combo
+NEW: conf TIMESPENT_ALWAYS_UPDATE_THM, when it's on we always check current thm of user to update it in task time line
+NEW: constant PROPAL_NEW_AS_SIGNED
+NEW: show date delivery planned on orders linked to company and product
+NEW: default_lang for members
+NEW: Default template of contract is not mandatory
+NEW: Default values in extrafields are not more limited to 255 char.
+NEW: display currency in takepos menu
+NEW: Enable online signature for interventions
+NEW: Encrypt all sensitive constants in llx_const
+NEW: extrafield price with currency
+NEW: filter on reception dates (from / to) in cheque paiement card
+NEW: TakePOS Header Scroll in TakePOS
+NEW: TakePOS Add setup parameters, can setup terminal name
+NEW: TakePOS support of Stripe Terminal with Takepos
+NEW: TakePOS Receipt preview in TakePOS setup
+NEW: TakePOS different product list on smartphone
+NEW: If we select another view list mode, we keep it
+NEW: Init module bookcal
+NEW: Introduce dolEncrypt and dolDecrypt to be able to encrypt data in db
+NEW: Invoice - Add french mention on pdf when vat debit option is on
+NEW: invoice export : add accounting affectation
+NEW: label on products categories filter
+NEW: The link "add to bookmark" is always on top in the bookmark popup
+NEW: MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS const to show category customer filter
+NEW: Make module WebservicesClient deprecated. Use module WebHook instead
+NEW: manage no email with thirdparties (better for GDPR)
+NEW: Manage Position (Rank) on Contract Lines
+NEW: Manage VAT on all lines on purchases cycle
+NEW: manage virtual stock at a future date
+NEW: On a bank reconciled line, we can modify the bank receipt
+NEW: On a form to send an email, we show all emails of all contacts of object
+NEW: Option PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT showing wh on PDF
+NEW: Option PRODUIT_DESC_IN_FORM accept (desktop only or +smartphone)
+NEW: Page for mass stock transfer can be used with no source stock
+NEW: parent company column and filter in invoice and order list
+NEW: Add show "Sales rep" option for PDF
+NEW: Picto for shared link is clicable
+NEW: possibility to select scopes with checkbox for Oauth tokens
+NEW: private and public note on user, thirdparty and contact list
+NEW: product categories filter on inventory list
+NEW: Product supplier price: autofill default supplier VAT
+NEW: Project - Add author on list
+NEW: Public counters feature
+NEW: Reception - Add a from/to on search on date field
+NEW: Start a simple support of recurrent events on agenda
+NEW: Resize parent company column in order list
+NEW: Saved token of OAUTH module are now encrypted into llx_oauth_token
+NEW: Save one click to select on delivery ack, on emails.
+NEW: scheduled job to send unpaid invoice reminder can now use the cc and bcc from email template
+NEW: set thirdparty type with company modify trigger
+NEW: Show also shceduled task never finished in scheduled task widget
+NEW: show badge with number of extrafields in setup
+NEW: show category tree in sellist and chkbxlst for common object
+NEW: Show picto and color into combo for selection of tags
+NEW: show product label on inventory
+NEW: show sell-by and eat-by dates only if not empty
+NEW: show SellBy/EatBy dates for each batch product in shipment card
+NEW: skip accept/refuse process for proposals (option PROPAL_SKIP_ACCEPT_REFUSE)
+NEW: SMTP using oauth2 authentication
+NEW: can substitue project title in mail template
+NEW: Supplier order list - Add column private and public note
+NEW: Support IP type in extrafields
+NEW: Table of membership types
+NEW: The purge of files can purge only if older than a number of seconds
+NEW: Update ActionComm type_code on email message ticket
+NEW: VAT - Admin - Add information on deadline day for submission of VAT declaration
+NEW: expand/collapse permissions on user permission page
+NEW: Show delivery mode on PDF for proposals
For developers or integrators:
------------------------------
-NEW Minimal PHP version is now PHP 7.0 instead of PHP 5.6
-
-...
+NEW: ModuleBuilder can generate code of class from an existing SQL table
+NEW: #22370 Modulebuilder supports 'alwayseditable' (like extrafields)
+NEW: #20912 Add trigger to record the event of sending an email from a project
+NEW: #21750 Added "Get lines and Post lines from BOM" at the REST Service
+NEW: Removed completely the need for the library adodbtime
+NEW: hook on agenda pages
+NEW: hook to complete payment in TakePOS
+NEW: hook "changeHelpURL" to modify target of the help button
+NEW: hook formConfirm on action comm card
+NEW: hook to modify supplier product html select
+NEW: Add new hook for show virtual stock details on product stock card
+NEW: Add new hooks for actioncomm
+NEW: conf->global->SYSLOG_FILE_ONEPERSESSION accept a string
+NEW: translate for contact type API, setup/ticket API, shipping method API
+NEW: All ajax pages have now a top_httphead()
+NEW: support multilang in Civilities API
+NEW: Add API for the partnership module
+NEW: Add "Get lines and Post lines from BOM" in the API
+NEW: Replace fk_categories_product with categories_product in inventory
+NEW: Rewrite of SQL request. Removed the join on category (for filter on categ), replaced with a EXISTS/NOT
WARNING:
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
+* Minimal PHP version is now PHP 7.0 instead of PHP 5.6
* The signature of method getNomUrl() of class ProductFournisseur has been modified to match the signature of method Product
* Trigger ORDER_SUPPLIER_DISPATCH is removed, use ORDER_SUPPLIER_RECEIVE and/or LINEORDER_SUPPLIER_DISPATCH instead.
-* All functions fetch_all() are deprecated for naming consitency, use fetchAll() instead
-* Code standardization: $user->rights->propale is now $user->rights->propal everywhere.
+* All functions fetch_all() have been set to deprecated for naming consitency, use fetchAll() instead.
+* Code standardization: '$user->rights->propale' is now '$user->rights->propal' everywhere.
* Deprecated method set_billed() on shipment and reception class has been removed. Use setBilled() instead.
+* Tables llx_prelevement_facture and llx_prelevement_facture_demande have been renamed into llx_prelevement and llx_prelevement_demande.
+* Rename MAIN_LIST_ALLOW_NOTES into MAIN_LIST_HIDE_NOTES and rename MAIN_LIST_ALLOW_PRIVATE_NOTES into MAIN_LIST_HIDE_PRIVATE_NOTES
+* Rename the substitution for project label instead of project title in substitution variables
+
+
+***** ChangeLog for 16.0.2 compared to 16.0.1 *****
+
+FIX: 16.0 - computed extrafields are not displayed if the object has no other extrafields
+FIX: #22538
+FIX: Accountancy - Review of Winfic - eWinfic - Winsis compta export format
+FIX: add loadRoleMode on getlinearray
+FIX: Autosearch on takepos was broken
+FIX: avoid access forbidden with numeric ref
+FIX: avoid error, check of product fetch is already check before
+FIX: avoid error, fetch of product is mandatory (by id or by ref)
+FIX: avoid unnecessary multiple calculation (#22637)
+FIX: bug on selected value for select_bom() function
+FIX: can not set prospect status "Do not contact"
+FIX: change in the communication status of the prospect
+FIX: check $id, already checked before
+FIX: closed warehouse for shipping
+FIX: extrafields_add tpl for stock movement
+FIX: the request SQL for transversal user, the join on usergroup table must be with getEntity('usergroup')
+FIX: Import of contact when there is duplicate thirdparties
+FIX: Import of socialnetwork field
+FIX: input selector is wrong with PRODUCT_LOAD_EXTRAFIELD_INTO_OBJECTLINES usage
+FIX: install wizard error management
+FIX: just add integer
+FIX: Missing $object for online signature link build
+FIX: missing quote
+FIX: only modify hidden checkbox/multislected extrafields on update if they are provided in request
+FIX: php doc
+FIX: private message ticket become public if edit action
+FIX: remove > 0 and -1
+FIX: remove db object to avoid error with postgresql
+FIX: Search ambigous field on MO list
+FIX: Search on social networks
+FIX: Subscription must be stopped when max of attendees reached.
+FIX: supplier price update: missing error reporting
+FIX: travis & stickler feedbacks
+FIX: we must be able to select only bom of a specific product + several fixes on select_bom() function
+FIX: wrong perm check
+FIX: wrong typo, remove quote
+FIX: wrong var typo
***** ChangeLog for 16.0.1 compared to 16.0.0 *****
diff --git a/build/makepack-dolibarr.pl b/build/makepack-dolibarr.pl
index abf16cee764..b2381db6ba3 100755
--- a/build/makepack-dolibarr.pl
+++ b/build/makepack-dolibarr.pl
@@ -621,7 +621,6 @@ if ($nboftargetok) {
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
- $ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/php-iban/docs`;
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
diff --git a/build/rpm/dolibarr_fedora.spec b/build/rpm/dolibarr_fedora.spec
index c94863e8919..8d162573f05 100755
--- a/build/rpm/dolibarr_fedora.spec
+++ b/build/rpm/dolibarr_fedora.spec
@@ -164,6 +164,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
+%_datadir/dolibarr/htdocs/bookcal
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
diff --git a/build/rpm/dolibarr_generic.spec b/build/rpm/dolibarr_generic.spec
index 8e71713146e..9cb8b71984d 100755
--- a/build/rpm/dolibarr_generic.spec
+++ b/build/rpm/dolibarr_generic.spec
@@ -245,6 +245,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
+%_datadir/dolibarr/htdocs/bookcal
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
diff --git a/build/rpm/dolibarr_mandriva.spec b/build/rpm/dolibarr_mandriva.spec
index 5c8a8e39aae..11c4fead2db 100755
--- a/build/rpm/dolibarr_mandriva.spec
+++ b/build/rpm/dolibarr_mandriva.spec
@@ -162,6 +162,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
+%_datadir/dolibarr/htdocs/bookcal
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec
index ea79a50af58..912aa28f8e8 100755
--- a/build/rpm/dolibarr_opensuse.spec
+++ b/build/rpm/dolibarr_opensuse.spec
@@ -67,7 +67,7 @@ Programmo web, progettato per poter fornire solo ciò di
cui hai bisogno ed essere facile da usare.
-#---- prep
+#---- prepo
%prep
%setup -q
%patch0 -p0 -b .patch
@@ -172,6 +172,7 @@ done >>%{name}.lang
%_datadir/dolibarr/htdocs/barcode
%_datadir/dolibarr/htdocs/blockedlog
%_datadir/dolibarr/htdocs/bookmarks
+%_datadir/dolibarr/htdocs/bookcal
%_datadir/dolibarr/htdocs/bom
%_datadir/dolibarr/htdocs/categories
%_datadir/dolibarr/htdocs/collab
diff --git a/dev/setup/apache/virtualhost b/dev/setup/apache/virtualhost
index 8c7682fe3d9..7508bbca171 100644
--- a/dev/setup/apache/virtualhost
+++ b/dev/setup/apache/virtualhost
@@ -3,7 +3,14 @@
#php_admin_value mail.force_extra_parameters "-f postmaster@mydomain.com"
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f postmaster@mydomain.com"
php_admin_value open_basedir /tmp/:/home/.../htdocs:/home/.../dolibarr_documents:
+
+ # Add this to use a custom apparmor profile when using apache php handler
+
| '.$langs->trans('Options').' '.$langs->trans('Lettering').' | '; +print "||
| '.$langs->trans("ACCOUNTING_ENABLE_LETTERING").' | '; +if (!empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on'); + print ' | '; +} else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ' | '; +} +print '
| '; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ' | '; +} // Movement number if (!empty($arrayfields['t.piece_num']['checked'])) { print ''; @@ -1113,13 +1147,18 @@ if (!empty($arrayfields['t.import_key']['checked'])) { print ''; } // Action column -print ' | '; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ' | '; +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print ' | '; +} print "||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ' | '; + } // Piece number if (!empty($arrayfields['t.piece_num']['checked'])) { @@ -1428,15 +1481,17 @@ while ($i < min($num, $limit)) { } // Action column - print ''; - if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($line->id, $arrayofselected)) { - $selected = 1; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ' | '; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; + print ' | '; } - print ''; if (!$i) { $totalarray['nbfield']++; diff --git a/htdocs/accountancy/bookkeeping/listbyaccount.php b/htdocs/accountancy/bookkeeping/listbyaccount.php index 7ab6666d4c4..34e8b18c52c 100644 --- a/htdocs/accountancy/bookkeeping/listbyaccount.php +++ b/htdocs/accountancy/bookkeeping/listbyaccount.php @@ -686,7 +686,7 @@ if ($massaction == 'preunletteringauto') { include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php'; $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage; -$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields +$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields if ($massactionbutton && $contextpage != 'poslist') { $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); } @@ -740,7 +740,13 @@ print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ' | '; +} // Movement number if (!empty($arrayfields['t.piece_num']['checked'])) { print ''; @@ -819,13 +825,18 @@ $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // N print $hookmanager->resPrint; // Action column -print ' | '; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ' | '; +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print ' | '; +} print "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ' | '; + } // Piece number if (!empty($arrayfields['t.piece_num']['checked'])) { print ''; @@ -1149,15 +1173,17 @@ while ($i < min($num, $limit)) { print $hookmanager->resPrint; // Action column - print ' | '; - if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($line->id, $arrayofselected)) { - $selected = 1; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ' | '; + if (($massactionbutton || $massaction) && $contextpage != 'poslist') { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($line->id, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; + print ' | '; } - print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 390aaa9ed4a..3c45315ffa9 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -718,9 +718,12 @@ class AccountancyExport /** * Export format : WinFic - eWinfic - WinSis Compta + * Last review for this format : 2022-11-01 Alexandre Spangaro (aspangaro@open-dsi.fr) * + * Help : https://wiki.gestan.fr/lib/exe/fetch.php?media=wiki:v15:compta:accountancy-format_winfic-ewinfic-winsiscompta.pdf * * @param array $TData data + * * @return void */ public function exportWinfic(&$TData) @@ -728,10 +731,14 @@ class AccountancyExport global $conf; $end_line = "\r\n"; + $index = 1; //We should use dol_now function not time however this is wrong date to transfert in accounting //$date_ecriture = dol_print_date(dol_now(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy //$date_ecriture = dol_print_date(time(), $conf->global->ACCOUNTING_EXPORT_DATE); // format must be ddmmyy + + // Warning ! When truncation is necessary, no dot because 3 dots = three characters. The columns are shifted + foreach ($TData as $data) { $code_compta = $data->numero_compte; if (!empty($data->subledger_account)) { @@ -740,7 +747,7 @@ class AccountancyExport $Tab = array(); //$Tab['type_ligne'] = 'M'; - $Tab['code_journal'] = str_pad(self::trunc($data->code_journal, 2), 2); + $Tab['code_journal'] = str_pad(dol_trunc($data->code_journal, 2, 'right', 'UTF-8', 1), 2); //We use invoice date $data->doc_date not $date_ecriture which is the transfert date //maybe we should set an option for customer who prefer to keep in accounting software the tranfert date instead of invoice date ? @@ -749,11 +756,11 @@ class AccountancyExport $Tab['folio'] = ' 1'; - $Tab['num_ecriture'] = str_pad(self::trunc($data->piece_num, 6), 6, ' ', STR_PAD_LEFT); + $Tab['num_ecriture'] = str_pad(dol_trunc($index, 6, 'right', 'UTF-8', 1), 6, ' ', STR_PAD_LEFT); $Tab['jour_ecriture'] = dol_print_date($data->doc_date, '%d%m%y'); - $Tab['num_compte'] = str_pad(self::trunc($code_compta, 6), 6, '0'); + $Tab['num_compte'] = str_pad(dol_trunc($code_compta, 6, 'right', 'UTF-8', 1), 6, '0'); if ($data->sens == 'D') { $Tab['montant_debit'] = str_pad(number_format($data->debit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); @@ -765,11 +772,11 @@ class AccountancyExport $Tab['montant_crebit'] = str_pad(number_format($data->credit, 2, ',', ''), 13, ' ', STR_PAD_LEFT); } - $Tab['libelle_ecriture'] = str_pad(self::trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30), 30); + $Tab['libelle_ecriture'] = str_pad(dol_trunc(dol_string_unaccent($data->doc_ref).' '.dol_string_unaccent($data->label_operation), 30, 'right', 'UTF-8', 1), 30); - $Tab['lettrage'] = str_repeat(' ', 2); + $Tab['lettrage'] = str_repeat(dol_trunc($data->lettering_code, 2, 'left', 'UTF-8', 1), 2); - $Tab['code_piece'] = str_repeat(' ', 5); + $Tab['code_piece'] = str_pad(dol_trunc($data->piece_num, 5, 'left', 'UTF-8', 1), 5, ' ', STR_PAD_LEFT); $Tab['code_stat'] = str_repeat(' ', 4); @@ -793,6 +800,8 @@ class AccountancyExport $Tab['end_line'] = $end_line; print implode('|', $Tab); + + $index++; } } diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index 95296624145..94ee1ac6029 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -730,7 +730,7 @@ class AccountingAccount extends CommonObject * @param Product $product Product object sell or buy * @param Facture|FactureFournisseur $facture Facture * @param FactureLigne|SupplierInvoiceLine $factureDet Facture Det - * @param array $accountingAccount Array of Account account + * @param array $accountingAccount Array of Accounting account * @param string $type Customer / Supplier * @return array|int Accounting accounts suggested or < 0 if technical error. */ @@ -868,20 +868,44 @@ class AccountingAccount extends CommonObject } // Manage Deposit - if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) { - $accountdeposittoventilated = new self($this->db); - if ($type == 'customer') { - $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); - } elseif ($type == 'supplier') { - $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1); - } - if (isset($result) && $result < 0) { - return -1; + if (getDolGlobalString('ACCOUNTING_ACCOUNT_' . strtoupper($type) . '_DEPOSIT')) { + if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) { + $accountdeposittoventilated = new self($this->db); + if ($type == 'customer') { + $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); + } elseif ($type == 'supplier') { + $result = $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1); + } + if (isset($result) && $result < 0) { + return -1; + } + + $code_l = $accountdeposittoventilated->ref; + $code_p = ''; + $code_t = ''; + $suggestedid = $accountdeposittoventilated->rowid; + $suggestedaccountingaccountfor = 'deposit'; } - $code_l = $accountdeposittoventilated->ref; - $suggestedid = $accountdeposittoventilated->rowid; - $suggestedaccountingaccountfor = 'deposit'; + // For credit note invoice, if origin invoice is a deposit invoice, force also on specific customer/supplier deposit account + if (!empty($facture->fk_facture_source)) { + $invoiceSource = new $facture($this->db); + $invoiceSource->fetch($facture->fk_facture_source); + + if ($facture->type == $facture::TYPE_CREDIT_NOTE && $invoiceSource->type == $facture::TYPE_DEPOSIT) { + $accountdeposittoventilated = new self($this->db); + if ($type == 'customer') { + $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER_DEPOSIT, 1); + } elseif ($type == 'supplier') { + $accountdeposittoventilated->fetch('', $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER_DEPOSIT, 1); + } + $code_l = $accountdeposittoventilated->ref; + $code_p = ''; + $code_t = ''; + $suggestedid = $accountdeposittoventilated->rowid; + $suggestedaccountingaccountfor = 'deposit'; + } + } } // If $suggestedid could not be guessed yet, we set it from the generic default accounting code $code_l diff --git a/htdocs/accountancy/class/accountingjournal.class.php b/htdocs/accountancy/class/accountingjournal.class.php index 982d6849f6e..ca6ea8cd5e5 100644 --- a/htdocs/accountancy/class/accountingjournal.class.php +++ b/htdocs/accountancy/class/accountingjournal.class.php @@ -231,7 +231,7 @@ class AccountingJournal extends CommonObject * Return clicable name (with picto eventually) * * @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto - * @param int $withlabel 0=No label, 1=Include label of journal + * @param int $withlabel 0=No label, 1=Include label of journal, 2=Include nature of journal * @param int $nourl 1=Disable url * @param string $moretitle Add more text to title tooltip * @param int $notooltip 1=Disable tooltip @@ -281,9 +281,14 @@ class AccountingJournal extends CommonObject } $label_link = $this->code; - if ($withlabel && !empty($this->label)) { + if ($withlabel != 2 && !empty($this->label)) { $label_link .= ' - '.($nourl ? '' : '').$langs->transnoentities($this->label).($nourl ? '' : ''); } + if ($withlabel == 2 && !empty($this->nature)) { + $key = $langs->trans("AccountingJournalType".strtoupper($this->nature)); + $transferlabel = ($this->nature && $key != "AccountingJournalType".strtoupper($langs->trans($this->nature)) ? $key : $this->label); + $label_link .= ' - '.($nourl ? '' : '').$transferlabel.($nourl ? '' : ''); + } $result .= $linkstart; if ($withpicto) { diff --git a/htdocs/accountancy/class/lettering.class.php b/htdocs/accountancy/class/lettering.class.php index 857cd12115e..5749518e2b9 100644 --- a/htdocs/accountancy/class/lettering.class.php +++ b/htdocs/accountancy/class/lettering.class.php @@ -592,7 +592,7 @@ class Lettering extends BookKeeping $sql .= " WHERE bpn.entity IN (" . getEntity('accountancy') . ")"; $sql .= " AND bpn.doc_type = 'bank'"; $sql .= " AND bpn.fk_doc IN (" . $this->db->sanitize(implode(',', $bank_ids)) . ")"; - $sql .= " AND bpn ON bpn.piece_num = ab.piece_num"; + $sql .= " AND bpn.piece_num = ab.piece_num"; $sql .= " ) OR "; } $sql .= " EXISTS ("; diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php index 079e05c406b..b887696fb13 100644 --- a/htdocs/accountancy/customer/index.php +++ b/htdocs/accountancy/customer/index.php @@ -142,7 +142,7 @@ if ($action == 'validatehistory') { }*/ // Customer Invoice lines (must be same request than into page list.php for manual binding) - $sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype,"; + $sql = "SELECT f.rowid as facid, f.ref as ref, f.datef, f.type as ftype, f.fk_facture_source,"; $sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,"; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { @@ -237,7 +237,8 @@ if ($action == 'validatehistory') { $facture_static->ref = $objp->ref; $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; - $facture_static->date = $objp->datef; + $facture_static->date = $db->jdate($objp->datef); + $facture_static->fk_facture_source = $objp->fk_facture_source; $facture_static_det->id = $objp->rowid; $facture_static_det->total_ht = $objp->total_ht; diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php index 4def8dfbef6..f9158be9c59 100644 --- a/htdocs/accountancy/customer/list.php +++ b/htdocs/accountancy/customer/list.php @@ -229,7 +229,7 @@ if (empty($chartaccountcode)) { } // Customer Invoice lines -$sql = "SELECT f.rowid as facid, f.ref, f.datef, f.type as ftype,"; +$sql = "SELECT f.rowid as facid, f.ref, f.datef, f.type as ftype, f.fk_facture_source,"; $sql .= " l.rowid, l.fk_product, l.description, l.total_ht, l.fk_code_ventilation, l.product_type as type_l, l.tva_tx as tva_tx_line, l.vat_src_code,"; $sql .= " p.rowid as product_id, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tva_tx as tva_tx_prod,"; if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) { @@ -579,6 +579,7 @@ if ($result) { $facture_static->id = $objp->facid; $facture_static->type = $objp->ftype; $facture_static->date = $db->jdate($objp->datef); + $facture_static->fk_facture_source = $objp->fk_facture_source; $facture_static_det->id = $objp->rowid; $facture_static_det->total_ht = $objp->total_ht; diff --git a/htdocs/accountancy/index.php b/htdocs/accountancy/index.php index bd7d6273848..628dceafd12 100644 --- a/htdocs/accountancy/index.php +++ b/htdocs/accountancy/index.php @@ -113,15 +113,17 @@ if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_S '; } - print load_fiche_titre($langs->trans("AccountancyArea"), $resultboxes['selectboxlist'], 'accountancy', 0, '', '', $showtutorial); + if (!empty($conf->global->INVOICE_USE_SITUATION) && $conf->global->INVOICE_USE_SITUATION == 1) { + print info_admin($langs->trans("SorryThisModuleIsNotCompatibleWithTheExperimentalFeatureOfSituationInvoices")); + print "|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ".$langs->trans("Date")." | "; print "".$langs->trans("Piece").' ('.$langs->trans("ObjectsRef").") | "; print "".$langs->trans("AccountAccounting")." | "; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index d38e49c390e..68e7ebda6ae 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -496,14 +496,16 @@ if ($action == 'exportcsv') { // ISO and not UTF8 ! } if (empty($action) || $action == 'view') { - llxHeader('', $langs->trans("ExpenseReportsJournal")); + $title = $langs->trans("GenerationOfAccountingEntries").' - '.$accountingjournalstatic->getNomUrl(0, 2, 1, '', 1); - $nom = $langs->trans("ExpenseReportsJournal").' | '.$accountingjournalstatic->getNomUrl(0, 1, 1, '', 1); + llxHeader('', dol_string_nohtmltag($title)); + + $nom = $title; $nomlink = ''; $periodlink = ''; $exportlink = ''; $builddate = dol_now(); - $description .= $langs->trans("DescJournalOnlyBindedVisible").'||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$form->editfieldkey("Categories", 'memcats', '', $object, 0).' | '; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, 'parent', null, null, 1); print img_picto('', 'category').$form->multiselectarray('memcats', $cate_arbo, GETPOST('memcats', 'array'), null, null, 'quatrevingtpercent widthcentpercentminusx', 0, 0); @@ -1367,7 +1367,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { print " | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$form->editfieldkey("Categories", 'memcats', '', $object, 0).' | '; print ''; $cate_arbo = $form->select_all_categories(Categorie::TYPE_MEMBER, null, null, null, null, 1); @@ -1725,10 +1725,12 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Type - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '.$adht->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '; + print ''.$adht->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '.$object->getmorphylib('', 1).' | '; + print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '; + print ''.$object->getmorphylib('', 1).' | '; print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Categories").' | '; print ''; print $form->showCategories($object->id, Categorie::TYPE_MEMBER, 1); @@ -1860,7 +1862,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Login Dolibarr - Link to user print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; - $editenable = $user->hasRight('adherent', 'creer') && $user->rights->user->user->creer; + $editenable = $user->hasRight('adherent', 'creer') && $user->hasRight('user', 'user', 'creer'); print $form->editfieldkey('LinkedToDolibarrUser', 'login', '', $object, $editenable); print ' | '; if ($action == 'editlogin') { @@ -1942,7 +1944,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Resiliate if (Adherent::STATUS_VALIDATED == $object->statut) { - if ($user->rights->adherent->supprimer) { + if ($user->hasRight('adherent', 'supprimer')) { print ''.$langs->trans("Resiliate")."\n"; } else { print ''.$langs->trans("Resiliate").''."\n"; @@ -1951,7 +1953,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Exclude if (Adherent::STATUS_VALIDATED == $object->statut) { - if ($user->rights->adherent->supprimer) { + if ($user->hasRight('adherent', 'supprimer')) { print ''.$langs->trans("Exclude")."\n"; } else { print ''.$langs->trans("Exclude").''."\n"; @@ -1960,7 +1962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Create third party if (isModEnabled('societe') && !$object->socid) { - if ($user->rights->societe->creer) { + if ($user->hasRight('societe', 'creer')) { if (Adherent::STATUS_DRAFT != $object->statut) { print 'id).'&action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").''."\n"; } else { @@ -1973,7 +1975,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { // Create user if (!$user->socid && !$object->user_id) { - if ($user->rights->user->user->creer) { + if ($user->hasRight('user', 'user', 'creer')) { if (Adherent::STATUS_DRAFT != $object->statut) { print 'id).'&action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").''."\n"; } else { @@ -1997,7 +1999,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { } // Delete - if ($user->rights->adherent->supprimer) { + if ($user->hasRight('adherent', 'supprimer')) { print ''.$langs->trans("Delete").''."\n"; } else { print ''.$langs->trans("Delete").''."\n"; @@ -2024,7 +2026,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $filename = dol_sanitizeFileName($object->ref); $filedir = $conf->adherent->dir_output.'/'.get_exdir(0, 0, 0, 1, $object, 'member'); $urlsource = $_SERVER['PHP_SELF'].'?id='.$object->id; - $genallowed = $user->rights->adherent->lire; + $genallowed = $user->hasRight('adherent', 'lire'); $delallowed = $user->hasRight('adherent', 'creer'); print $formfile->showdocuments('member', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', (empty($object->default_lang) ? '' : $object->default_lang), '', $object); diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index dd9d58eb7d3..130f5580e3a 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -520,7 +520,7 @@ class Adherent extends CommonObject * Return translated label by the nature of a adherent (physical or moral) * * @param string $morphy Nature of the adherent (physical or moral) - * @param int $addbadge Add badge (1=Full label, 2=First letter only) + * @param int $addbadge Add badge (1=Full label, 2=First letters only) * @return string Label */ public function getmorphylib($morphy = '', $addbadge = 0) @@ -534,21 +534,27 @@ class Adherent extends CommonObject if ($addbadge) { $s = ''; + $labeltoshowm = $langs->trans("Moral"); + $labeltoshowp = $langs->trans("Physical"); if ($morphy == 'phy') { + $labeltoshow = $labeltoshowp; if ($addbadge == 2) { - $labeltoshow = dol_substr($langs->trans("Physical"), 0, 1); - } else { - $labeltoshow = $langs->trans("Physical"); + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowp)); + if ($labeltoshow == dol_strtoupper(dolGetFirstLetters($labeltoshowm))) { + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowp, 2)); + } } - $s .= ''.$labeltoshow.''; + $s .= ''.$labeltoshow.''; } if ($morphy == 'mor') { + $labeltoshow = $labeltoshowm; if ($addbadge == 2) { - $labeltoshow = dol_substr($langs->trans("Moral"), 0, 1); - } else { - $labeltoshow = $langs->trans("Moral"); + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowm)); + if ($labeltoshow == dol_strtoupper(dolGetFirstLetters($labeltoshowp))) { + $labeltoshow = dol_strtoupper(dolGetFirstLetters($labeltoshowm, 2)); + } } - $s .= ''.$labeltoshow.''; + $s .= ''.$labeltoshow.''; } } else { if ($morphy == 'phy') { diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index bce8227ab57..4517bee15c6 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -76,14 +76,14 @@ if ($id > 0 || !empty($ref)) { $result = $object->fetch($id, $ref); // Define variables to know what current user can do on users - $canadduser = ($user->admin || $user->rights->user->user->creer); + $canadduser = ($user->admin || $user->hasRight('user', 'user', 'creer')); // Define variables to know what current user can do on properties of user linked to edited member if ($object->user_id) { // $User is the user who edits, $object->user_id is the id of the related user in the edited member - $caneditfielduser = ((($user->id == $object->user_id) && $user->rights->user->self->creer) - || (($user->id != $object->user_id) && $user->rights->user->user->creer)); - $caneditpassworduser = ((($user->id == $object->user_id) && $user->rights->user->self->password) - || (($user->id != $object->user_id) && $user->rights->user->user->password)); + $caneditfielduser = ((($user->id == $object->user_id) && $$user->hasRight('user', 'self', 'creer')) + || (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'creer'))); + $caneditpassworduser = ((($user->id == $object->user_id) && $user->hasRight('user', 'self', 'password')) + || (($user->id != $object->user_id) && $user->hasRight('user', 'user', 'password'))); } } @@ -158,13 +158,12 @@ if ($id > 0) { } // Type - print ' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '.$membert->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '; + print ''.$membert->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '.$object->getmorphylib().' | '; - /*print ''; - print $form->showphoto('memberphoto',$object); - print ' | ';*/ + print '||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '; + print ''.$object->getmorphylib('', 1).' | '; print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '.$adht->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '; + print ''.$adht->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '.$object->getmorphylib().' | '; - /*print ''; - print $form->showphoto('memberphoto',$member); - print ' | ';*/ + print '||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '; + print ''.$object->getmorphylib('', 1).' | '; print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '.$adht->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Type").' | '; + print ''.$adht->getNomUrl(1)." | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '.$object->getmorphylib().' | '; + print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("MemberNature").' | '; + print ''.$object->getmorphylib('', 1).' | '; print '|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Amount").' | '.price($object->amount).' | ||
| '.$langs->trans("Amount").' | '.price($object->amount).' | ||
| '.$langs->trans("Label").' | '.$object->note.' | ||
| '.$langs->trans("AllowExternalDownload").' | '; +print ''; +print ajax_constantonoff('ORDER_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); +print ' | ||
| '.$langs->trans("AllowExternalDownload").' | '; -print ''; -if ($conf->global->CONTRACT_ALLOW_EXTERNAL_DOWNLOAD) { - print ''; - print img_picto($langs->trans("Activited"), 'switch_on'); - print ''; -} else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; -} +print ' | '; +print ajax_constantonoff('CONTRACT_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); print ' | '; print '|
| '.$langs->trans("Dictionary").' | '; + print ''.$langs->trans("Dictionary").' | '; print ''; + print ' | '; print ' | |
| '; + print ' | ||||
| '; if (!empty($tabcond[$i])) { $tabnamenoprefix = preg_replace('/'.MAIN_DB_PREFIX.'/', '', $tabname[$i]); print ''; @@ -2309,7 +2310,7 @@ if ($id > 0) { print img_picto('Edit', 'edit', ''); print ''; print ' | '; - print ''; + print ' | '; print $form->textwithpicto('', $langs->trans("Table").': '.MAIN_DB_PREFIX.$tabname[$i]); print ' | '; print ''; $fieldname = 'country'; - print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : '')), $fieldname, '', 28, 'maxwidth150 maxwidthonsmartphone'); + print $form->select_country((!empty($obj->country_code) ? $obj->country_code : (!empty($obj->country) ? $obj->country : '')), $fieldname, '', 28, 'minwidth100 maxwidth150 maxwidthonsmartphone'); print ' | '; } elseif ($value == 'country_id') { if (!in_array('country', $fieldlist)) { // If there is already a field country, we don't show country_id (avoid duplicate) diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php index cdb7794c4d2..d2e1ec4ea25 100644 --- a/htdocs/admin/facture.php +++ b/htdocs/admin/facture.php @@ -232,6 +232,37 @@ if ($action == 'updateMask') { if (!($res > 0)) { $error++; } +} elseif (preg_match('/set_(.*)/', $action, $reg)) { + $code = $reg[1]; + $value = (GETPOST($code) ? GETPOST($code) : 1); + + $res = dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity); + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } +} elseif (preg_match('/del_(.*)/', $action, $reg)) { + $code = $reg[1]; + $res = dolibarr_del_const($db, $code, $conf->entity); + + if (!($res > 0)) { + $error++; + } + + if ($error) { + setEventMessages($langs->trans('Error'), null, 'errors'); + } else { + setEventMessages($langs->trans('SetupSaved'), null, 'mesgs'); + header("Location: " . $_SERVER["PHP_SELF"]); + exit(); + } } @@ -771,20 +802,15 @@ print ''; print '|
| '.$langs->trans("InvoiceCheckPosteriorDate"). ' ' ; print $form->textwithpicto('', $langs->trans("InvoiceCheckPosteriorDateHelp"), 1, 'help') . ' | '; -print ''; -if ($conf->use_javascript_ajax) { - print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE'); -} else { - print ' | '; - print ''; - print ''; - print ''; -} +print ' | '; +print ajax_constantonoff('INVOICE_CHECK_POSTERIOR_DATE'); +print ' | |
| '.$langs->trans("AllowExternalDownload").' | '; +print ''; +print ajax_constantonoff('INVOICE_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); print ' | |||
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Parameter").' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Parameter").' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' |
| '.$langs->trans("Parameter").' | '.$langs->trans("Value").' |
| '.$langs->trans("PDF_USE_ALSO_LANGUAGE_CODE").' | '; -//if (getDolGlobalInt('MAIN_MULTILANGS')) - //{ +print ' |
| '; +print $form->textwithpicto($langs->trans("PDFIn2Languages"), $langs->trans("PDF_USE_ALSO_LANGUAGE_CODE")); +print ' | '; $selected = GETPOSTISSET('PDF_USE_ALSO_LANGUAGE_CODE') ? GETPOST('PDF_USE_ALSO_LANGUAGE_CODE') : (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) ? $conf->global->PDF_USE_ALSO_LANGUAGE_CODE : 0); print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, null, 1); -//} else { -// print ''.$langs->trans("MultiLangNotEnabled").''; -//} print ' | '; +print ' | '.$langs->trans("AllowExternalDownload").' | '; +print ''; +print ajax_constantonoff('PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD', array(), null, 0, 0, 0, 2, 0, 1); +print ' | '; + + + // default update prices on cloning a proposal /* print '
| '.$langs->trans("Session").' | '.$langs->trans("Value").' | |
| '.$langs->trans("SessionSavePath").' | '.session_save_path().' | |
| '.$langs->trans("SessionName").' | '.session_name().' | |
| '.$langs->trans("SessionId").' | '.session_id().' | |
| '.$langs->trans("CurrentSessionTimeOut").' (session.gc_maxlifetime) | '.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); -print ' | '; +print ' |
| '.$langs->trans("Session").' | '.$langs->trans("Value").' | |
| '.$langs->trans("SessionSavePath").' | '.session_save_path().' | |
| '.$langs->trans("SessionName").' | '.session_name().' | |
| '.$langs->trans("SessionId").' | '.session_id().' | |
| '.$langs->trans("CurrentSessionTimeOut").' (session.gc_maxlifetime) | '; +print ''; +print ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds"); print ''."\n"; print ''."\n"; print ''."\n"; print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor"))); print " | |
| '.$langs->trans("CurrentTheme").' | '.$conf->theme.' | |
| '.$langs->trans("CurrentMenuHandler").' | '; +print ' | |
| '.$langs->trans("CurrentTheme").' | '.$conf->theme.' | |
| '.$langs->trans("CurrentMenuHandler").' | '; print $conf->standard_menu; print ' | |
| '.$langs->trans("Screen").' | '; +print ' | |
| '.$langs->trans("Screen").' | '; print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight']; print ' | |
| '.$langs->trans("Session").' | '; +print ' | |
| '.$langs->trans("Session").' | '; $i = 0; foreach ($_SESSION as $key => $val) { if ($i > 0) { diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index d8a0b384971..301231b1e4c 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -250,9 +250,19 @@ foreach ($phparray as $key => $value) { //var_dump($value); foreach ($value as $keyparam => $keyvalue) { if (!is_array($keyvalue)) { - print ' | |
| '.$keyparam.' | '; + $keytoshow = $keyparam; $valtoshow = $keyvalue; + // Hide value of session cookies + if (in_array($keyparam, array('HTTP_COOKIE', 'Cookie', "\$_SERVER['HTTP_COOKIE']", 'Authorization'))) { + $valtoshow = ''.$langs->trans("Hidden").''; + } + if (preg_match('/'.preg_quote('$_COOKIE[\'DOLSESSID_', '/').'/i', $keyparam)) { + $keytoshow = $keyparam; + $valtoshow = ''.$langs->trans("Hidden").''; + } + + print '||
| '.$keytoshow.' | '; if ($keyparam == 'X-ChromePhp-Data') { $valtoshow = dol_trunc($keyvalue, 80); } diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 1ea81cd5dd3..d820b8faab7 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -542,13 +542,13 @@ print '||
| '; + print ''; + print ' | ||
| '; + $searchpicto = $form->showFilterButtons('left'); + print $searchpicto; + print ' | '; +} + foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if ($key == 'status') { @@ -561,16 +570,22 @@ $parameters = array('arrayfields'=>$arrayfields); $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column -print ''; -$searchpicto = $form->showFilterButtons(); -print $searchpicto; -print ' | '; +if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ''; + $searchpicto = $form->showFilterButtons(); + print $searchpicto; + print ' | '; +} print ''."\n"; // Fields title label // -------------------------------------------------------------------- print '||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; + } + print ' | '; + } foreach ($object->fields as $key => $val) { $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']); if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) { @@ -676,15 +705,17 @@ while ($i < ($limit ? min($num, $limit) : $num)) { $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; // Action column - print ''; - if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined - $selected = 0; - if (in_array($object->id, $arrayofselected)) { - $selected = 1; + if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) { + print ' | '; + if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined + $selected = 0; + if (in_array($object->id, $arrayofselected)) { + $selected = 1; + } + print ''; } - print ''; + print ' | '; } - print ''; if (!$i) { $totalarray['nbfield']++; } diff --git a/htdocs/bookcal/COPYING b/htdocs/bookcal/COPYING new file mode 100644 index 00000000000..94a04532226 --- /dev/null +++ b/htdocs/bookcal/COPYING @@ -0,0 +1,621 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc.||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| '.$langs->trans("Name").' | '; + print ''.$langs->trans("Description").' | '; + print ''.$langs->trans("Example").' | '; + print ''.$langs->trans("Status").' | '; + print ''.$langs->trans("ShortInfo").' | '; + print '
| '.$module->name." | \n"; + print $module->info(); + print ' | '; + + // Show example of numbering model + print '';
+ $tmp = $module->getExample();
+ if (preg_match('/^Error/', $tmp)) {
+ $langs->load("errors");
+ print ' '.$langs->trans($tmp).' ';
+ } elseif ($tmp == 'NotConfigured') {
+ print $langs->trans($tmp);
+ } else {
+ print $tmp;
+ }
+ print ' | '."\n";
+
+ print ''; + $constforvar = 'BOOKCAL_'.strtoupper($myTmpObjectKey).'_ADDON'; + if (getDolGlobalString($constforvar) == $file) { + print img_picto($langs->trans("Activated"), 'switch_on'); + } else { + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off'); + print ''; + } + print ' | '; + + $mytmpinstance = new $myTmpObjectKey($db); + $mytmpinstance->initAsSpecimen(); + + // Info + $htmltooltip = ''; + $htmltooltip .= ''.$langs->trans("Version").': '.$module->getVersion().''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ' | '; + + print "
| '.$langs->trans("Name").' | '; + print ''.$langs->trans("Description").' | '; + print ''.$langs->trans("Status")." | \n"; + print ''.$langs->trans("Default")." | \n"; + print ''.$langs->trans("ShortInfo").' | '; + print ''.$langs->trans("Preview").' | '; + print "|
| '; + print (empty($module->name) ? $name : $module->name); + print " | \n"; + if (method_exists($module, 'info')) { + print $module->info($langs); + } else { + print $module->description; + } + print ' | '; + + // Active + if (in_array($name, $def)) { + print ''."\n"; + print ''; + print img_picto($langs->trans("Enabled"), 'switch_on'); + print ''; + print ' | '; + } else { + print ''."\n"; + print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').''; + print " | "; + } + + // Default + print ''; + $constforvar = 'BOOKCAL_'.strtoupper($myTmpObjectKey).'_ADDON'; + if (getDolGlobalString($constforvar) == $name) { + //print img_picto($langs->trans("Default"), 'on'); + // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset + print 'scandir).'&label='.urlencode($module->name).'&type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').''; + } else { + print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').''; + } + print ' | '; + + // Info + $htmltooltip = ''.$langs->trans("Name").': '.$module->name; + $htmltooltip .= ''; + print $form->textwithpicto('', $htmltooltip, 1, 0); + print ' | '; + + // Preview + print ''; + if ($module->type == 'pdf') { + $newname = preg_replace('/_'.preg_quote(strtolower($myTmpObjectKey), '/').'/', '', $name); + print ''.img_object($langs->trans("Preview"), 'pdf').''; + } else { + print img_object($langs->trans("PreviewNotAvailable"), 'generic'); + } + print ' | '; + + print "
| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' | ||
| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' | ||
| '.$langs->trans("Bookings").($num?''.$num.'':'').' | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | +ref | +name | +date | +hour | +duration | +description | +||||||||||||||
| ' . $myobjectstatic->id . " | "; + print '' . $myobjectstatic->ref . " | "; + print '' . $myobjectstatic->firstname . " " . $myobjectstatic->lastname . " | "; + print '' . $myobjectstatic->start . " | "; + print '' . $myobjectstatic->duration . " | "; + print '' . $myobjectstatic->description . " | "; + $i++; + } + } else { + print '|||||||||||||||
| '.$langs->trans("NoOrder").' | ||||||||||||||||||||
| '; + print $langs->trans("BoxTitleLatestModifiedMyObjects", $max); + print ' | '; + print ''.$langs->trans("DateModificationShort").' | '; + print '|
|---|---|---|
| '.$myobjectstatic->getNomUrl(1).' | '; + print ''; + print " | "; + print ''.dol_print_date($db->jdate($objp->tms), 'day')." | "; + print '
| '.$langs->trans("None").' | ||
| '.$langs->trans("NbOfAttachedFiles").' | '.count($filearray).' | ||
| '.$langs->trans("TotalSizeOfAttachedFiles").' | '.$totalsize.' '.$langs->trans("bytes").' | ||