commit
e6f4d2dab5
41
.travis.yml
41
.travis.yml
@ -9,6 +9,9 @@ dist: xenial
|
||||
|
||||
language: php
|
||||
|
||||
git:
|
||||
depth: 1
|
||||
|
||||
# Start on every boot
|
||||
services:
|
||||
- memcached
|
||||
@ -41,16 +44,20 @@ jobs:
|
||||
#allow_failures:
|
||||
#- php: nightly
|
||||
include:
|
||||
- if: type = push
|
||||
- stage: PHP 5.6-7.4
|
||||
if: type = push
|
||||
php: '5.6'
|
||||
env: DB=postgresql
|
||||
- if: type = pull_request OR type = push
|
||||
- stage: PHP 5.6-7.4
|
||||
if: type = pull_request OR type = push
|
||||
php: '7.4'
|
||||
env: DB=mysql
|
||||
- if: type = push AND branch = develop
|
||||
- stage: PHP Dev
|
||||
if: type = push AND branch = develop
|
||||
php: nightly
|
||||
env: DB=mysql
|
||||
- if: type = push AND branch = 14.0
|
||||
- stage: PHP Dev
|
||||
if: type = push AND branch = 14.0
|
||||
php: nightly
|
||||
env: DB=mysql
|
||||
|
||||
@ -264,24 +271,27 @@ script:
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Checking PHP syntax errors"
|
||||
echo "Checking PHP syntax errors (only 1 version to not overload travis and avoid duplicate tests)"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
#parallel-lint --exclude htdocs/includes --blame .
|
||||
parallel-lint --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
||||
parallel-lint -e php --exclude dev/tools/test/namespacemig --exclude htdocs/includes/composer --exclude htdocs/includes/myclabs --exclude htdocs/includes/phpspec --exclude dev/initdata/dbf/includes \
|
||||
--exclude htdocs/includes/sabre --exclude htdocs/includes/phpoffice/PhpSpreadsheet --exclude htdocs/includes/sebastian \
|
||||
--exclude htdocs/includes/squizlabs/php_codesniffer --exclude htdocs/includes/jakub-onderka --exclude htdocs/includes/php-parallel-lint --exclude htdocs/includes/symfony \
|
||||
--exclude htdocs/includes/mike42/escpos-php/example --exclude htdocs/includes/maximebf \
|
||||
--exclude htdocs/includes/phpunit/ --exclude htdocs/includes/tecnickcom/tcpdf/include/barcodes --exclude htdocs/includes/webmozart --blame .
|
||||
fi
|
||||
set +e
|
||||
echo
|
||||
|
||||
- |
|
||||
echo "Checking coding style (excluding Pull Requests builds to not overload travis, excluding also some jobs to avoid duplicate tests)"
|
||||
echo "Checking coding style (only for Pull Requests builds and 1 version to not overload travis and avoid duplicate tests)"
|
||||
# Ensure we catch errors
|
||||
set -e
|
||||
# Exclusions are defined in the ruleset.xml file
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ] && [ "$DB" = "mysql" ]; then
|
||||
if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_PHP_VERSION" = "7.4" ]; then
|
||||
phpcs -s -p -d memory_limit=-1 --extensions=php --colors --tab-width=4 --standard=dev/setup/codesniffer/ruleset.xml --encoding=utf-8 --runtime-set ignore_warnings_on_exit true .;
|
||||
fi
|
||||
set +e
|
||||
@ -401,11 +411,16 @@ script:
|
||||
php upgrade.php 13.0.0 14.0.0 ignoredbversion > $TRAVIS_BUILD_DIR/upgrade13001400.log
|
||||
php upgrade2.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-2.log
|
||||
php step5.php 13.0.0 14.0.0 > $TRAVIS_BUILD_DIR/upgrade13001400-3.log
|
||||
ls -alrt $TRAVIS_BUILD_DIR/
|
||||
|
||||
- |
|
||||
echo "Enabling new modules"
|
||||
# Enable modules not enabled into original dump
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
set -e
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_API,MAIN_MODULE_PRODUCTBATCH,MAIN_MODULE_SUPPLIERPROPOSAL,MAIN_MODULE_STRIPE,MAIN_MODULE_EXPENSEREPORT > $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_WEBSITE,MAIN_MODULE_TICKET,MAIN_MODULE_ACCOUNTING,MAIN_MODULE_MRP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_RECEPTION,MAIN_MODULE_RECRUITMENT >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
php upgrade2.php 0.0.0 0.0.0 MAIN_MODULE_KNOWLEDGEMANAGEMENT,MAIN_MODULE_EVENTORGANIZATION,MAIN_MODULE_PARTNERSHIP >> $TRAVIS_BUILD_DIR/enablemodule.log
|
||||
echo $?
|
||||
cd -
|
||||
set +e
|
||||
|
||||
145
ChangeLog
145
ChangeLog
@ -10,29 +10,16 @@ For users:
|
||||
NEW: Module Recruitement to follow application to job positions is now stable.
|
||||
NEW: Feature to make Stock Inventories
|
||||
NEW: Several security issues after a second private bug hunting campaign.
|
||||
NEW: Add a security center page with all information and advices related to the security of your instance
|
||||
NEW: Add a performance center page with all information and advices related to the performance of your instance
|
||||
NEW: A lot of fix into english text after a small proofreading campaign (still not perfect, but really better)
|
||||
NEW: All main menu entries are using the picto of the module
|
||||
NEW: Add a copy to clipboard button on some fields
|
||||
NEW: Add an example of scheduled job to send email reminder for unpaid invoices
|
||||
NEW: Accountancy - Add FEC import
|
||||
NEW: Accountancy - Add a confirmation form with options on export
|
||||
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
|
||||
NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
|
||||
NEW: Accountancy - In ledger & journals, show link on bank transaction
|
||||
NEW: Accountancy - Possibility to filter on journals in balance
|
||||
NEW: Accountancy - Add a page to list subledger accounts
|
||||
NEW: add the Channel column into the list of orders
|
||||
NEW: Add a check to avoid an invoice date in the future
|
||||
NEW: Add some color and picto for the direction of movement
|
||||
NEW: add the column "Channel" into the list of orders
|
||||
NEW: Add the column "alias" of company in the list of proposal, order, invoice
|
||||
NEW: Add the column "Office phone" and "User mobile" in user list
|
||||
NEW: Add the column "Price level"in thirdparty list
|
||||
NEW: Add the column "Price level" in thirdparty list
|
||||
NEW: Add some company information in the dropdown login menu
|
||||
NEW: Add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
|
||||
NEW: Add contact tag and bulk email status on the thirdparty + contact create form
|
||||
NEW: Support down payment on supplier invoice (& somes ajustments)
|
||||
NEW: Add edit/delete action icons on categories list pages
|
||||
NEW: Add hidden option to auto load input line extrafield into new lines
|
||||
NEW: Add import profile to import BOM
|
||||
@ -40,29 +27,21 @@ NEW: Add link picto to the stock movement on the detail of production
|
||||
NEW: Add mass action "Set tag" for product/service, user, thirdparty, warehouse, project, bank account, members
|
||||
NEW: Add bulk action Validate and Set to billed on order list.
|
||||
NEW: Add possibility to exports userGroups fields on user exports
|
||||
NEW: Add price min and price min including tax into product export
|
||||
NEW: Can search on lots or serials into the quick search bar
|
||||
NEW: Add support for Friday as a non working day
|
||||
NEW: Add a total in page of margin by user
|
||||
NEW: Add the total of margin in invoice list
|
||||
NEW: auto notification with module Notification can use templated emails
|
||||
NEW: Bank Entries : display user linked to a salary or a taxes
|
||||
NEW: Can clone a cron job
|
||||
NEW: Can create a lot from the list view (Look and feel standardization).
|
||||
NEW: Can filter on extrafields date on lists
|
||||
NEW: Can filter on rowid in list of blocked logs
|
||||
NEW: Can hide columns "time consumed" on timesheet per week
|
||||
NEW: Can set an employee on each social contribution
|
||||
NEW: Can set a percentage when creating an invoice from another object
|
||||
NEW: Can set order of execution of hooks
|
||||
NEW: Can show the leave dates/holidays on the agenda view
|
||||
NEW: Can toggle FCKeditor on public/private notes
|
||||
NEW: Check update availability for externals modules using a button on module page
|
||||
NEW: Choose lines to use while creating intervention card from origin
|
||||
NEW: Columns shipment method, payment mode, payment term in proposal and order list
|
||||
NEW: Conf for default actioncomm status
|
||||
NEW: customer ref for product customer prices
|
||||
NEW: date and user signature on proposal (Issue 16062) #16980
|
||||
NEW: Dictionary for availability - Add a column position
|
||||
NEW: Can set a user related to a social contribution
|
||||
NEW: ICS Direct debit can be set with a different value for each bank account
|
||||
@ -70,18 +49,13 @@ NEW: LDAP: usergroup search can be filtered
|
||||
NEW: Make public bookmarks editable by admin users only
|
||||
NEW: If main logo not defined, can use the squarred logo on login page
|
||||
NEW: The manifest file can use the squared image if available
|
||||
NEW: Add bulk actions for Bank Transfer
|
||||
NEW: Enhance the multicurrency rate editor
|
||||
NEW: Multiselect ledger account code filter on book keeping list
|
||||
NEW: Normalyse Type company field with ajax combobox
|
||||
NEW: preload product description on selection for customer propal/order/invoice
|
||||
NEW: Add a ref in product customer price
|
||||
NEW: Search usergroups & resources
|
||||
NEW: Set status of all variants when changing status of parent
|
||||
NEW: Setup Page for module creation with module builder enhancement #FoundationFunding
|
||||
NEW: Show picto of module into the list of dictionaries
|
||||
NEW: Show the total of payment on the payment confirmation page
|
||||
NEW: Support color for types of event
|
||||
NEW: The global setup for Mandatory fields can now be done on combo list too.
|
||||
NEW: translate in "en_US" to complete PR 16980
|
||||
NEW: Update the list of taxes available by default for France
|
||||
@ -89,26 +63,63 @@ NEW: Salary payment request and Salary payment are 2 different steps in workflow
|
||||
NEW: VAT payment request and VAT payment are now 2 different steps in workflow on VAT payment recording
|
||||
NEW: VAT report - Optimisation & collapse by rate
|
||||
NEW: When a doc file is shared, link is visible from the main page of doc.
|
||||
NEW: #16378 More E-Mail Contact substitution Values for better salutation
|
||||
NEW: option to keep the "Automatically create a total payment" checkbox empty on the tax creation page
|
||||
NEW: #16378 more E-Mail Contact substitution Values for better salutation
|
||||
NEW: option to keep the "Automatically create the payment" checkbox empty on the tax creation page
|
||||
|
||||
Accountancy
|
||||
NEW: Accountancy - Add FEC import
|
||||
NEW: Accountancy - Add a confirmation form with options on export
|
||||
NEW: Accountancy - Add select date from/to in already bind customer and supplier list
|
||||
NEW: Accountancy - Format FEC - Add new field DateLimitReglmt
|
||||
NEW: Accountancy - In ledger & journals, show link on bank transaction
|
||||
NEW: Accountancy - Possibility to filter on journals in balance
|
||||
NEW: Accountancy - Add a page to list subledger accounts
|
||||
NEW: Multiselect ledger account code filter on book keeping list
|
||||
|
||||
Agenda
|
||||
NEW: add support for Friday as a non working day
|
||||
NEW: can show the leave dates/holidays on the agenda view
|
||||
NEW: Support color for types of event
|
||||
|
||||
Bank
|
||||
NEW: Bank Entries : display user linked to a salary or a taxes
|
||||
NEW: Add bulk actions for Bank Transfer
|
||||
|
||||
ECM/GED
|
||||
NEW: Add db fields note_public and note_private for ECM module
|
||||
NEW: Can filter files in GED on status Shared/Not shared
|
||||
NEW: add DB fields note_public and note_private for ECM module
|
||||
NEW: can filter files in ECM/GED on status Shared / Not shared
|
||||
|
||||
Invoices
|
||||
NEW: add a check to avoid an invoice date in the future
|
||||
NEW: add the total of margin in invoice list
|
||||
NEW: can set a percentage when creating an invoice from another object
|
||||
NEW: Support down payment on supplier invoice (& somes ajustments)
|
||||
|
||||
Margin
|
||||
NEW: add the total of margin in invoice list
|
||||
NEW: add the total of margin in page by user
|
||||
|
||||
Members
|
||||
NEW: #17292 default subscription amount by adherent type
|
||||
NEW: Option to automatically create a login/user when a new subscription of a member is done online
|
||||
NEW: option to automatically create a login/user when a new subscription of a member is done online
|
||||
NEW: option to select membership type on the online payment page for membership subscription or renewal
|
||||
|
||||
Products
|
||||
NEW: Add price min and price min including tax into product export
|
||||
NEW: Add a ref in product customer price
|
||||
NEW: customer ref for product customer prices
|
||||
NEW: Set status of all variants when changing status of parent
|
||||
|
||||
Projects/Tasks
|
||||
NEW: option to automatically close an open project when all its tasks are done (=progress 100%)
|
||||
NEW: can show the project ref into PDF documents
|
||||
NEW: when we add contacts/users to a project, ask to also affect them on tasks
|
||||
NEW: Can hide columns "time consumed" on timesheet per week
|
||||
|
||||
Proposals
|
||||
NEW: add bulk action to set a commercial proposal to status "Refused"
|
||||
NEW: can set a warehouse in a proposal
|
||||
NEW: date and user signature on proposal (Issue 16062) #16980
|
||||
|
||||
Shipment
|
||||
NEW: add option in Workflow module to set a shipment as closed
|
||||
@ -121,18 +132,20 @@ NEW: edit sales lines rights in TakePOS
|
||||
NEW: option for TakePOS to show the total price without tax
|
||||
NEW: more permissions in TakePOS (can edit added line, can modify once order sent to kitchen)
|
||||
|
||||
Third-Parties
|
||||
NEW: Can set a Warehouse on a Thirdparty
|
||||
Third Party / Contacts
|
||||
NEW: add contact tag and bulk email status on the thirdparty + contact create form
|
||||
NEW: can set a warehouse on a thirdparty
|
||||
|
||||
Tickets
|
||||
NEW: can use captcha on public page to create a ticket #16347
|
||||
NEW: can set if a ticket group is visible on public interface or not
|
||||
|
||||
Warehouse
|
||||
NEW: Can make massive stock transfers from a CSV file
|
||||
NEW: Stock movement list - Add more complete date field
|
||||
NEW: Can set a Warehouse on a Thirdparty
|
||||
Warehouse/Stock
|
||||
NEW: Feature to make Stock Inventories
|
||||
NEW: can make massive stock transfers from a CSV file
|
||||
NEW: Stock movement list - add more complete date field
|
||||
NEW: can set a warehouse in a proposal
|
||||
NEW: can set a warehouse on a thirdparty
|
||||
|
||||
Website Module
|
||||
NEW: #17113 Can upload a favicon in website module
|
||||
@ -140,49 +153,63 @@ NEW: add a new permission "Export website"
|
||||
NEW: add last date of modification for website pages in the list of pages
|
||||
NEW: Save old page with .old extension on disk when editing a website page
|
||||
|
||||
new Modules
|
||||
Workflows
|
||||
NEW: add option in Workflow module to set a shipment as closed
|
||||
|
||||
|
||||
for Admins
|
||||
NEW: Add a security center page with all information and advices related to the security of your instance
|
||||
NEW: Add a performance center page with all information and advices related to the performance of your instance
|
||||
|
||||
Modules
|
||||
NEW: Module Recruitement is now stable
|
||||
NEW: start new experimental module Event Organization Management
|
||||
NEW: start new experimental module Partnership Management
|
||||
NEW: start new experimental module Knowledge Management
|
||||
NEW: start new experimental module Workstations Management
|
||||
NEW: Check update availability for externals modules using a button on module page
|
||||
Module SimplePOS is deprecated - TakePOS is recommended for the future
|
||||
|
||||
new Options
|
||||
NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
|
||||
NEW: Add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
|
||||
NEW: Add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
|
||||
NEW: Add option SOCIETE_DISABLE_WORKFORCE to hide staff field
|
||||
NEW: add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
|
||||
NEW: add option SUPPLIER_PROPOSAL_ALLOW_EXTERNAL_DOWNLOAD to make generated doc automatically shared
|
||||
NEW: add option MAIN_SECURITY_ANTI_SSRF_SERVER_IP to define list of IPs that are local IPs
|
||||
NEW: add option SOCIETE_DISABLE_WORKFORCE to hide staff field
|
||||
NEW: add constant MAIN_BUGTRACK_URL to set a custom url to redirect to when clicking on link "declare a bug"
|
||||
|
||||
|
||||
For developers:
|
||||
---------------
|
||||
NEW: Can edit an object property in module builder
|
||||
NEW: hook printFieldListTitle for cabyprodserv.php
|
||||
NEW: Hook to allow external modules to add their own shortlist of recent objects
|
||||
NEW: SQL-altering hooks in the turnover by product report
|
||||
NEW: Add data-eec=1 for EEC countries on select for js interaction
|
||||
NEW: Add experimental repair script to switch to dynamic row format and utf8mb4 encoding
|
||||
NEW: add form confirm hook on company card
|
||||
NEW: Add function showValueWithClipboardCPButton() to add a copy/paste
|
||||
NEW: Add hook addSectionECMAuto method to add custom diretory into ECM auto files
|
||||
NEW: Add native compression in rest apis
|
||||
NEW: Product Variants API, add variant stock to response by parameter
|
||||
NEW: Upgrade Stripe PHP lib to 7.67.0
|
||||
NEW: Add link to OpenAPI specifications xml file in REST API module setup: swagger.json file can be included into external tools like redoc
|
||||
NEW: Support sepa_debit in stripe paymentmethods list
|
||||
NEW: Update doleditor.class.php for easily activate SCAYT
|
||||
NEW: Add triggers in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
|
||||
NEW: Add triggers OBJECT_LINK_INSERT, OBJECT_LINK_UPDATE et OBJECT_LINK_DELETE in the function add_object_linked(), updateObjectLinked() and deleteObjectLinked()
|
||||
NEW: Can set a target image in dolcropresize function.
|
||||
NEW: Can set a label as placeholder for combo lists.
|
||||
NEW: can set a target image in dolcropresize function
|
||||
NEW: can set a label as placeholder for combo lists
|
||||
NEW: Add pagination on Get Products response API
|
||||
NEW: Add the DefaultValues CRUD class
|
||||
NEW: Extrafields of documents lines are inside the lines, not any more on separate TR
|
||||
NEW: unit selection on object edit line
|
||||
NEW: #13739 #17390 Product API route added to get product stock and product with or without variants
|
||||
|
||||
APIs
|
||||
NEW: API Add option $includeifobjectisused to get a product
|
||||
NEW: API Get the list of product ids only
|
||||
NEW: API add option $includeifobjectisused to get a product
|
||||
NEW: API get the list of product ids only
|
||||
NEW: add link to OpenAPI specifications XML file in REST API module setup: swagger.json file can be included into external tools like redoc
|
||||
NEW: add native compression in REST APIs
|
||||
NEW: Product Variants API, add variant stock to response by parameter
|
||||
NEW: Product API route added to get product stock and product with or without variants #13739 #17390
|
||||
|
||||
Hooks
|
||||
NEW: hook printFieldListTitle for cabyprodserv.php
|
||||
NEW: hook to allow external modules to add their own shortlist of recent objects
|
||||
NEW: SQL-altering hooks in the turnover by product report
|
||||
NEW: add form confirm hook on company card
|
||||
NEW: add hook addSectionECMAuto method to add custom diretory into ECM auto files
|
||||
|
||||
|
||||
WARNING:
|
||||
@ -198,6 +225,7 @@ Following changes may create regressions for some external modules, but were nec
|
||||
* If your database is MySQL or MariaDB, you need at least version 5.1
|
||||
* Function set_price_level() has been renamed into setPriceLevel() to follow camelcase rules
|
||||
* removed deprecated subtituion key __REFCLIENT__ (replaced with __REF_CLIENT__)
|
||||
* Removed constant MAIN_COUNTRIES_IN_EEC. You can now set if country is in Europe or not from the dictionary of countries.
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.3 compared to 13.0.2 *****
|
||||
@ -209,6 +237,8 @@ FIX: #17060
|
||||
FIX: #17192 - With tz < 0, event is show in bad day on calendar views
|
||||
FIX: #17363
|
||||
FIX: #17476 releve.php: Fix SQL statement
|
||||
FIX: #17967
|
||||
Fix: #17906 : fix access denied
|
||||
FIX: Accountancy - Import in general ledger
|
||||
FIX: Accountancy - Quadra export - wrong data on credit
|
||||
FIX: Accountancy - Warning on the pages of the preparatory statements of accounting entries
|
||||
@ -255,7 +285,6 @@ FIX: test must be === and not ==
|
||||
FIX: test on link type
|
||||
FIX: type link extrafield case for advanced target emailing
|
||||
FIX: Write right on document
|
||||
>>>>>>> branch '13.0' of git@github.com:Dolibarr/dolibarr.git
|
||||
|
||||
|
||||
***** ChangeLog for 13.0.2 compared to 13.0.1 *****
|
||||
|
||||
@ -202,9 +202,12 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
|
||||
### System Environment / Requirements
|
||||
|
||||
- Works with PHP 5.6+ and MariaDB 5.0.3+, MySQL 5.0.3+ or PostgreSQL 8.1.4+ (See requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite))
|
||||
- PHP
|
||||
- MariaDB, MySQL or PostgreSQL
|
||||
- Compatible with all Cloud solutions that match PHP & MySQL or PostgreSQL prerequisites.
|
||||
|
||||
See exact requirements on the [Wiki](https://wiki.dolibarr.org/index.php/Prerequisite)
|
||||
|
||||
|
||||
### Extending
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -19,7 +19,7 @@ Download
|
||||
Install
|
||||
--------------------------------
|
||||
|
||||
* For a Quick guide, take a look at README file into root directory.
|
||||
* For a Quick guide, take a look at README.md file into root directory.
|
||||
|
||||
* More complete documentations are also available on line on the Dolibarr Wiki:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -23,7 +23,7 @@ Download / Herunterladen
|
||||
Installation / Hilfe
|
||||
------------------------------------
|
||||
|
||||
* Für eine kurze Einleitung schau in die README Datei im Hauptverzeichnis.
|
||||
* Für eine kurze Einleitung schau in die README.md Datei im Hauptverzeichnis.
|
||||
|
||||
* Umfangreiche Dokumentationen sind im Dolibarr Wiki zu finden:
|
||||
https://wiki.dolibarr.org/index.php/Hauptseite
|
||||
|
||||
@ -20,9 +20,7 @@ https://www.dolistore.com
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
* Pour une prise en main et installation rapide, consultez le fichier README-FR.md à la racine.
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org/index.php/Accueil
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en ligne sur le wiki de Dolibarr à l'adresse:
|
||||
https://wiki.dolibarr.org
|
||||
|
||||
@ -4,4 +4,5 @@ User guide
|
||||
--------------------------------
|
||||
|
||||
* All Dolibarr guides are available, on line, on the Dolibarr Web site:
|
||||
|
||||
https://www.dolibarr.org
|
||||
|
||||
@ -7,9 +7,7 @@ Benutzeranleitung
|
||||
|
||||
Alle Dolibarr-Informationen sind online verfuegbar ueber die Webseiten:
|
||||
|
||||
|
||||
https://www.dolibarr.de (de) oder https://www.dolibarr.org (intl)
|
||||
|
||||
|
||||
https://wiki.dolibarr.org/index.php/Hauptseite (de)
|
||||
|
||||
@ -3,9 +3,6 @@ README (french)
|
||||
Documentation utilisateur
|
||||
--------------------------------
|
||||
|
||||
* Pour une prise en main et installation rapide, consultez le fichier
|
||||
README-FR à la racine.
|
||||
La documentation utilisateur francophone est disponible en ligne sur le site Web de Dolibarr à l'adresse:
|
||||
|
||||
* Une documentation utilisateur francophone plus consistante est disponible en
|
||||
ligne sur le site Web de Dolibarr à l'adresse:
|
||||
https://www.dolibarr.fr
|
||||
|
||||
@ -259,7 +259,7 @@ llxHeader('', $title);
|
||||
|
||||
$linkback = '';
|
||||
//$linkback = '<a href="' . DOL_URL_ROOT . '/admin/modules.php?restore_lastsearch_values=1">' . $langs->trans("BackToModuleList") . '</a>';
|
||||
print load_fiche_titre($langs->trans('ConfigAccountingExpert'), $linkback, 'accountancy');
|
||||
print load_fiche_titre($title, $linkback, 'accountancy');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
@ -388,7 +388,7 @@ if ($action != 'export_csv') {
|
||||
} elseif (empty($tmparrayforrootaccount['label'])) {
|
||||
// $tmparrayforrootaccount['label'] not defined = the account has not parent with a parent.
|
||||
// This is useless, we should not create a new account when an account has no parent, we must edit it to fix its parent.
|
||||
// BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so shoule not show a link to create another account.
|
||||
// BUG 1: Accounts on level root or level 1 must not have a parent 2 level higher, so should not show a link to create another account.
|
||||
// BUG 2: Adding a link to create a new accounting account here is useless because it is not add as parent of the orphelin.
|
||||
//$link = '<a href="' . DOL_URL_ROOT . '/accountancy/admin/card.php?action=create&token=' . newToken() . '&accountingaccount=' . length_accountg($line->numero_compte) . '">' . img_edit_add() . '</a>';
|
||||
}
|
||||
@ -429,7 +429,7 @@ if ($action != 'export_csv') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$accounting_account.'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowraponall right">'.price($opening_balance).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($opening_balance).'</td>';
|
||||
}
|
||||
|
||||
$urlzoom = '';
|
||||
@ -466,7 +466,7 @@ if ($action != 'export_csv') {
|
||||
if (!empty($show_subgroup)) {
|
||||
print '<tr class="liste_total"><td class="right">'.$langs->trans("SubTotal").':</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price($sous_total_opening_balance).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_opening_balance).'</td>';
|
||||
}
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
|
||||
@ -486,9 +486,9 @@ if ($action != 'export_csv') {
|
||||
print '<td class="right nowraponall amount">'.price($total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($total_opening_balance + $total_debit - $total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($total_debit - $total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
|
||||
@ -59,6 +59,8 @@ class AccountancyExport
|
||||
public static $EXPORT_TYPE_LDCOMPTA10 = 120;
|
||||
public static $EXPORT_TYPE_GESTIMUMV3 = 130;
|
||||
public static $EXPORT_TYPE_GESTIMUMV5 = 135;
|
||||
public static $EXPORT_TYPE_ISUITEEXPERT = 200;
|
||||
// Generic FEC after that
|
||||
public static $EXPORT_TYPE_FEC = 1000;
|
||||
public static $EXPORT_TYPE_FEC2 = 1010;
|
||||
|
||||
@ -123,6 +125,7 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => $langs->trans('Modelcsv_Gestinum_v5'),
|
||||
self::$EXPORT_TYPE_FEC => $langs->trans('Modelcsv_FEC'),
|
||||
self::$EXPORT_TYPE_FEC2 => $langs->trans('Modelcsv_FEC2'),
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => 'Export iSuite Expert',
|
||||
);
|
||||
|
||||
ksort($listofexporttypes, SORT_NUMERIC);
|
||||
@ -158,6 +161,7 @@ class AccountancyExport
|
||||
self::$EXPORT_TYPE_GESTIMUMV5 => 'gestimumv5',
|
||||
self::$EXPORT_TYPE_FEC => 'fec',
|
||||
self::$EXPORT_TYPE_FEC2 => 'fec2',
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => 'isuiteexpert',
|
||||
);
|
||||
|
||||
return $formatcode[$type];
|
||||
@ -243,6 +247,10 @@ class AccountancyExport
|
||||
'label' => $langs->trans('Modelcsv_FEC2'),
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'txt',
|
||||
),
|
||||
self::$EXPORT_TYPE_ISUITEEXPERT => array(
|
||||
'label' => 'iSuite Expert',
|
||||
'ACCOUNTING_EXPORT_FORMAT' => 'csv',
|
||||
),
|
||||
),
|
||||
'cr'=> array(
|
||||
'1' => $langs->trans("Unix"),
|
||||
@ -334,6 +342,9 @@ class AccountancyExport
|
||||
case self::$EXPORT_TYPE_FEC2:
|
||||
$this->exportFEC2($TData);
|
||||
break;
|
||||
case self::$EXPORT_TYPE_ISUITEEXPERT :
|
||||
$this->exportiSuiteExpert($TData);
|
||||
break;
|
||||
default:
|
||||
$this->errors[] = $langs->trans('accountancy_error_modelnotfound');
|
||||
break;
|
||||
@ -1752,6 +1763,62 @@ class AccountancyExport
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Export format : iSuite Expert
|
||||
*
|
||||
* by OpenSolus [https://opensolus.fr]
|
||||
*
|
||||
* @param array $objectLines data
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function exportiSuiteExpert($objectLines)
|
||||
{
|
||||
$this->separator = ';';
|
||||
$this->end_line = "\r\n";
|
||||
|
||||
|
||||
foreach ($objectLines as $line) {
|
||||
$tab = array();
|
||||
|
||||
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
|
||||
|
||||
$tab[] = $line->piece_num;
|
||||
$tab[] = $date;
|
||||
$tab[] = substr($date, 6, 4);
|
||||
$tab[] = substr($date, 3, 2);
|
||||
$tab[] = substr($date, 0, 2);
|
||||
$tab[] = $line->doc_ref;
|
||||
//Conversion de chaine UTF8 en Latin9
|
||||
$tab[] = mb_convert_encoding(str_replace(' - Compte auxiliaire', '', $line->label_operation), "Windows-1252", 'UTF-8');
|
||||
|
||||
//Calcul de la longueur des numéros de comptes
|
||||
$taille_numero = strlen(length_accountg($line->numero_compte));
|
||||
|
||||
//Création du numéro de client générique
|
||||
$numero_cpt_client = '411';
|
||||
for ($i = 1; $i <= ($taille_numero - 3); $i++) {
|
||||
$numero_cpt_client .= '0';
|
||||
}
|
||||
|
||||
//Création des comptes auxiliaire des clients
|
||||
if (length_accountg($line->numero_compte) == $numero_cpt_client) {
|
||||
$tab[] = rtrim(length_accounta($line->subledger_account), "0");
|
||||
} else {
|
||||
$tab[] = length_accountg($line->numero_compte);
|
||||
}
|
||||
$nom_client = explode(" - ", $line->label_operation);
|
||||
$tab[] = mb_convert_encoding($nom_client[0], "Windows-1252", 'UTF-8');
|
||||
$tab[] = price($line->debit);
|
||||
$tab[] = price($line->credit);
|
||||
$tab[] = price($line->montant);
|
||||
$tab[] = $line->code_journal;
|
||||
|
||||
$separator = $this->separator;
|
||||
print implode($separator, $tab) . $this->end_line;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* trunc
|
||||
*
|
||||
|
||||
@ -297,11 +297,11 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " AND fk_doc = ".((int) $this->fk_doc);
|
||||
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
|
||||
// DO NOT USE THIS IN PRODUCTION. This will generate a lot of trouble into reports and will corrupt database (by generating duplicate entries.
|
||||
$sql .= " AND fk_docdet = " . $this->fk_docdet; // This field can be 0 if record is for several lines
|
||||
$sql .= " AND fk_docdet = ".$this->fk_docdet; // This field can be 0 if record is for several lines
|
||||
}
|
||||
$sql .= " AND numero_compte = '".$this->db->escape($this->numero_compte)."'";
|
||||
$sql .= " AND label_operation = '".$this->db->escape($this->label_operation)."'";
|
||||
$sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
$sql .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -318,7 +318,7 @@ class BookKeeping extends CommonObject
|
||||
$sqlnum .= " AND fk_docdet = ".((int) $this->fk_docdet);
|
||||
}
|
||||
$sqlnum .= " AND doc_ref = '".$this->db->escape($this->doc_ref)."'"; // ref of source object
|
||||
$sqlnum .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
$sqlnum .= " AND entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
|
||||
dol_syslog(get_class($this).":: create sqlnum=".$sqlnum, LOG_DEBUG);
|
||||
$resqlnum = $this->db->query($sqlnum);
|
||||
@ -331,7 +331,7 @@ class BookKeeping extends CommonObject
|
||||
if (empty($this->piece_num)) {
|
||||
$sqlnum = "SELECT MAX(piece_num)+1 as maxpiecenum";
|
||||
$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
$sqlnum .= " WHERE entity = ".$conf->entity; // Do not use getEntity for accounting features
|
||||
|
||||
$resqlnum = $this->db->query($sqlnum);
|
||||
if ($resqlnum) {
|
||||
@ -1067,7 +1067,7 @@ class BookKeeping extends CommonObject
|
||||
$line->label_operation = $obj->label_operation;
|
||||
$line->debit = $obj->debit;
|
||||
$line->credit = $obj->credit;
|
||||
$line->montant = $obj->amount; // deprecated
|
||||
$line->montant = $obj->amount; // deprecated
|
||||
$line->amount = $obj->amount;
|
||||
$line->sens = $obj->sens;
|
||||
$line->lettering_code = $obj->lettering_code;
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -124,7 +124,11 @@ if ($action == 'validate_movements_confirm' && !empty($user->rights->accounting-
|
||||
$form = new Form($db);
|
||||
$formaccounting = new FormAccounting($db);
|
||||
|
||||
llxHeader('', $langs->trans("Closure"));
|
||||
$title = $langs->trans('Closure');
|
||||
|
||||
$help_url ='EN:Module_Double_Entry_Accounting';
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
if ($action == 'validate_movements') {
|
||||
$form_question = array();
|
||||
|
||||
@ -141,6 +141,9 @@ if ($action == 'validatehistory') {
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facturedet as l ON f.rowid = l.fk_facture";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
|
||||
@ -155,6 +158,9 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
|
||||
dol_syslog('htdocs/accountancy/customer/index.php');
|
||||
$result = $db->query($sql);
|
||||
@ -198,11 +204,13 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_sell)) {
|
||||
$objp->code_sell_t = $objp->company_code_sell;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
|
||||
@ -458,8 +458,8 @@ if ($result) {
|
||||
$productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
|
||||
|
||||
$accountingaccountstatic->rowid = $objp->fk_compte;
|
||||
$accountingaccountstatic->label = $objp->label;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort;
|
||||
$accountingaccountstatic->label = $objp->label_account;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort_account;
|
||||
$accountingaccountstatic->account_number = $objp->account_number;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -495,7 +495,7 @@ if ($result) {
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ', '', 1);
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
@ -703,13 +703,13 @@ if ($result) {
|
||||
print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'customer').'</td>';
|
||||
|
||||
// Country
|
||||
print '<td>';
|
||||
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
||||
print $labelcountry;
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelcountry).'">';
|
||||
print dol_escape_htmltag($labelcountry);
|
||||
print '</td>';
|
||||
|
||||
// VAT Num
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($objp->tva_intra).'">'.dol_escape_htmltag($objp->tva_intra).'</td>';
|
||||
|
||||
// Found accounts
|
||||
print '<td class="small">';
|
||||
@ -739,13 +739,11 @@ if ($result) {
|
||||
$s .= (empty($objp->code_sell_p) ? '<span style="'.$code_sell_p_notset.'">'.$langs->trans("NotDefined").'</span>' : length_accountg($objp->code_sell_p));
|
||||
print $form->textwithpicto($s, $shelp, 1, $ttype, '', 0, 2, '', 1);
|
||||
} else {
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
$s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
||||
$shelp = '';
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
print '<br>';
|
||||
$s = '2. '.(($objp->type_l == 1) ? $langs->trans("ThisService") : $langs->trans("ThisProduct")).': ';
|
||||
$shelp = '';
|
||||
$s .= $langs->trans("NotDefined");
|
||||
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
|
||||
}
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
print '<br>';
|
||||
|
||||
@ -103,7 +103,7 @@ if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))
|
||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||
}
|
||||
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlf, f.close_code,";
|
||||
$sql = "SELECT f.rowid, f.ref as ref, f.type, f.datef as df, f.libelle,f.ref_supplier, f.date_lim_reglement as dlr, f.close_code,";
|
||||
$sql .= " fd.rowid as fdid, fd.description, fd.product_type, fd.total_ht, fd.tva as total_tva, fd.total_localtax1, fd.total_localtax2, fd.tva_tx, fd.total_ttc, fd.vat_src_code,";
|
||||
$sql .= " s.rowid as socid, s.nom as name, s.fournisseur, s.code_client, s.code_fournisseur, s.code_compta, s.code_compta_fournisseur,";
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
|
||||
@ -149,6 +149,9 @@ if ($action == 'validatehistory') {
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = f.fk_soc";
|
||||
if (!empty($conf->global->MAIN_COMPANY_PERENTITY_SHARED)) {
|
||||
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_perentity as spe ON spe.fk_soc = s.rowid AND spe.entity = " . ((int) $conf->entity);
|
||||
}
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON co.rowid = s.fk_pays ";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."facture_fourn_det as l ON f.rowid = l.fk_facture_fourn";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = l.fk_product";
|
||||
@ -163,6 +166,9 @@ if ($action == 'validatehistory') {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
|
||||
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
|
||||
$sql .= " AND l.product_type <= 2";
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
|
||||
dol_syslog('htdocs/accountancy/supplier/index.php');
|
||||
|
||||
@ -199,11 +205,13 @@ if ($action == 'validatehistory') {
|
||||
}
|
||||
}
|
||||
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
|
||||
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
|
||||
if (!empty($objp->company_code_buy)) {
|
||||
$objp->code_buy_t = $objp->company_code_buy;
|
||||
$objp->aarowid_suggest = $objp->aarowid_thirdparty;
|
||||
$suggestedaccountingaccountfor = '';
|
||||
}
|
||||
}
|
||||
|
||||
if ($objp->aarowid_suggest > 0) {
|
||||
|
||||
@ -194,7 +194,7 @@ print '<script type="text/javascript">
|
||||
*/
|
||||
$sql = "SELECT f.rowid as facid, f.ref as ref, f.ref_supplier, f.libelle as invoice_label, f.datef, f.fk_soc,";
|
||||
$sql .= " l.rowid, l.fk_product, l.product_type as line_type, l.description, l.total_ht , l.qty, l.tva_tx, l.vat_src_code,";
|
||||
$sql .= " aa.label, aa.labelshort, aa.account_number,";
|
||||
$sql .= " aa.label as label_account, aa.labelshort as labelshort_account, aa.account_number,";
|
||||
$sql .= " p.rowid as product_id, p.fk_product_type as product_type, p.ref as product_ref, p.label as product_label, p.fk_product_type as type, p.tobuy, p.tosell,";
|
||||
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
|
||||
$sql .= " ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export,";
|
||||
@ -459,8 +459,8 @@ if ($result) {
|
||||
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_sell_buy;
|
||||
|
||||
$accountingaccountstatic->rowid = $objp->fk_compte;
|
||||
$accountingaccountstatic->label = $objp->label;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort;
|
||||
$accountingaccountstatic->label = $objp->label_account;
|
||||
$accountingaccountstatic->labelshort = $objp->labelshort_account;
|
||||
$accountingaccountstatic->account_number = $objp->account_number;
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
@ -513,7 +513,7 @@ if ($result) {
|
||||
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<td>';
|
||||
print $accountingaccountstatic->getNomUrl(0, 1, 1, '', 1);
|
||||
print ' <a class="editfielda" href="./card.php?id='.$objp->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($param ? '?'.$param : '')).'">';
|
||||
print img_edit();
|
||||
|
||||
@ -482,7 +482,7 @@ if ($result) {
|
||||
print '<td class="liste_titre right"><input type="text" class="flat maxwidth50 right" name="search_vat" placeholder="%" size="1" value="'.dol_escape_htmltag($search_vat).'"></td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth75imp" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
|
||||
print '<td class="liste_titre">';
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1);
|
||||
print $form->select_country($search_country, 'search_country', '', 0, 'maxwidth125', 'code2', 1, 0, 1, null, 1);
|
||||
//print '<input type="text" class="flat maxwidth50" name="search_country" value="' . dol_escape_htmltag($search_country) . '">';
|
||||
print '</td>';
|
||||
print '<td class="liste_titre"><input type="text" class="flat maxwidth50" name="search_tvaintra" value="'.dol_escape_htmltag($search_tvaintra).'"></td>';
|
||||
@ -503,7 +503,7 @@ if ($result) {
|
||||
//print_liste_field_titre("ProductLabel", $_SERVER["PHP_SELF"], "p.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("ProductDescription", $_SERVER["PHP_SELF"], "l.description", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "l.total_ht", "", $param, '', $sortfield, $sortorder, 'right maxwidth50 ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||
print_liste_field_titre("VATRate", $_SERVER["PHP_SELF"], "l.tva_tx", "", $param, '', $sortfield, $sortorder, 'right ', '', 1);
|
||||
print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("Country", $_SERVER["PHP_SELF"], "co.label", "", $param, '', $sortfield, $sortorder);
|
||||
print_liste_field_titre("VATIntraShort", $_SERVER["PHP_SELF"], "s.tva_intra", "", $param, '', $sortfield, $sortorder);
|
||||
@ -687,13 +687,13 @@ if ($result) {
|
||||
print '<td class="tdoverflowmax100">'.$thirdpartystatic->getNomUrl(1, 'supplier').'</td>';
|
||||
|
||||
// Country
|
||||
print '<td>';
|
||||
$labelcountry = ($objp->country_code && ($langs->trans("Country".$objp->country_code) != "Country".$objp->country_code)) ? $langs->trans("Country".$objp->country_code) : $objp->country_label;
|
||||
print $labelcountry;
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($labelcountry).'">';
|
||||
print dol_escape_htmltag($labelcountry);
|
||||
print '</td>';
|
||||
|
||||
// VAT Num
|
||||
print '<td>'.$objp->tva_intra.'</td>';
|
||||
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($objp->tva_intra).'">'.dol_escape_htmltag($objp->tva_intra).'</td>';
|
||||
|
||||
// Found accounts
|
||||
print '<td class="small">';
|
||||
|
||||
@ -263,6 +263,7 @@ if ($conf->facture->enabled) {
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||
print '<td>';
|
||||
$selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS);
|
||||
print img_picto('', 'product', 'class="pictofixedwidth"');
|
||||
$form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -31,8 +31,6 @@ print load_fiche_titre($this->control->tpl['title']);
|
||||
|
||||
dol_htmloutput_errors((is_numeric($object->error) ? '' : $object->error), $object->errors);
|
||||
|
||||
dol_htmloutput_errors((is_numeric($GLOBALS['error']) ? '' : $GLOBALS['error']), $GLOBALS['errors']);
|
||||
|
||||
dol_htmloutput_errors($this->control->tpl['error'], $this->control->tpl['errors']);
|
||||
|
||||
echo $this->control->tpl['ajax_selectcountry']; ?>
|
||||
|
||||
@ -1054,6 +1054,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Country
|
||||
$object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
|
||||
print '<tr><td width="25%">'.$langs->trans('Country').'</td><td>';
|
||||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
print $form->select_country(GETPOSTISSET('country_id') ? GETPOST('country_id', 'alpha') : $object->country_id, 'country_id');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
@ -1064,6 +1065,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($object->country_id) {
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state(GETPOSTISSET('state_id') ? GETPOST('state_id', 'int') : $object->state_id, $object->country_code);
|
||||
} else {
|
||||
print $countrynotdefined;
|
||||
@ -1303,6 +1305,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// Country
|
||||
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
|
||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||
print img_picto('', 'country', 'class="pictofixedwidth"');
|
||||
print $form->select_country(GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id, 'country_id');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
@ -1312,21 +1315,22 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
// State
|
||||
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state($object->state_id, GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id);
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Pro phone
|
||||
print '<tr><td>'.$langs->trans("PhonePro").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone" value="'.(GETPOSTISSET("phone") ? GETPOST("phone") : $object->phone).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone" value="'.(GETPOSTISSET("phone") ? GETPOST("phone") : $object->phone).'"></td></tr>';
|
||||
|
||||
// Personal phone
|
||||
print '<tr><td>'.$langs->trans("PhonePerso").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning').' <input type="text" name="phone_perso" value="'.(GETPOSTISSET("phone_perso") ? GETPOST("phone_perso") : $object->phone_perso).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning', 'class="pictofixedwidth"').' <input type="text" name="phone_perso" value="'.(GETPOSTISSET("phone_perso") ? GETPOST("phone_perso") : $object->phone_perso).'"></td></tr>';
|
||||
|
||||
// Mobile phone
|
||||
print '<tr><td>'.$langs->trans("PhoneMobile").'</td>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile').' <input type="text" name="phone_mobile" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
print '<td>'.img_picto('', 'object_phoning_mobile', 'class="pictofixedwidth"').' <input type="text" name="phone_mobile" value="'.(GETPOSTISSET("phone_mobile") ? GETPOST("phone_mobile") : $object->phone_mobile).'"></td></tr>';
|
||||
|
||||
if (!empty($conf->socialnetworks->enabled)) {
|
||||
foreach ($socialnetworks as $key => $value) {
|
||||
@ -1727,15 +1731,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
|
||||
// Password
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td>'.preg_replace('/./i', '*', $object->pass);
|
||||
print '<tr><td>'.$langs->trans("Password").'</td><td>';
|
||||
if ($object->pass) {
|
||||
print preg_replace('/./i', '*', $object->pass);
|
||||
} else {
|
||||
if ($user->admin) {
|
||||
print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted;
|
||||
} else {
|
||||
print $langs->trans("Hidden");
|
||||
print '<!-- '.$langs->trans("Crypted").': '.$object->pass_indatabase_crypted.' -->';
|
||||
}
|
||||
print '<span class="opacitymedium"'.$langs->trans("Hidden").'</span>';
|
||||
}
|
||||
if ((!empty($object->pass) || !empty($object->pass_crypted)) && empty($object->user_id)) {
|
||||
$langs->load("errors");
|
||||
|
||||
@ -656,19 +656,19 @@ class AdherentType extends CommonObject
|
||||
/**
|
||||
* Return clicable name (with picto eventually)
|
||||
*
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $maxlen length max label
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @return string String with URL
|
||||
* @param int $withpicto 0=No picto, 1=Include picto into link, 2=Only picto
|
||||
* @param int $maxlen length max label
|
||||
* @param int $notooltip 1=Disable tooltip
|
||||
* @param string $morecss Add more css on link
|
||||
* @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
|
||||
* @return string String with URL
|
||||
*/
|
||||
public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0)
|
||||
public function getNomUrl($withpicto = 0, $maxlen = 0, $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
$result = '';
|
||||
|
||||
$label = '';
|
||||
|
||||
$label = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("MemberType").'</u>';
|
||||
$label .= ' '.$this->getLibStatut(4);
|
||||
$label .= '<br>'.$langs->trans("Label").': '.$this->label;
|
||||
@ -676,7 +676,22 @@ class AdherentType extends CommonObject
|
||||
$label .= '<br>'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription);
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id).'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$option = '';
|
||||
|
||||
$url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id);
|
||||
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
$add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
|
||||
if ($save_lastsearch_value == -1 && preg_match('/list\.php/', $_SERVER["PHP_SELF"])) {
|
||||
$add_save_lastsearch_values = 1;
|
||||
}
|
||||
if ($add_save_lastsearch_values) {
|
||||
$url .= '&save_lastsearch_values=1';
|
||||
}
|
||||
}
|
||||
|
||||
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||
$linkend = '</a>';
|
||||
|
||||
$result .= $linkstart;
|
||||
|
||||
@ -92,7 +92,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, count(*)";
|
||||
$sql .= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
|
||||
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
@ -133,7 +133,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, sum(p.".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$user->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
|
||||
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
@ -154,7 +154,7 @@ class AdherentStats extends Stats
|
||||
$sql = "SELECT date_format(p.dateadh,'%m') as dm, avg(p.".$this->field.")";
|
||||
$sql .= " FROM ".$this->from;
|
||||
//if (!$user->rights->societe->client->voir && !$this->socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
|
||||
$sql .= " WHERE date_format(p.dateadh,'%Y') = ".((int) $year);
|
||||
$sql .= " WHERE ".dolSqlDateFilter('p.dateadh', 0, 0, (int) $year, 1);
|
||||
$sql .= " AND ".$this->where;
|
||||
$sql .= " GROUP BY dm";
|
||||
$sql .= $this->db->order('dm', 'DESC');
|
||||
|
||||
@ -65,6 +65,7 @@ $search_filter = GETPOST("search_filter", 'alpha');
|
||||
$search_status = GETPOST("search_status", 'intcomma');
|
||||
$catid = GETPOST("catid", 'int');
|
||||
$optioncss = GETPOST('optioncss', 'alpha');
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
$filter = GETPOST("filter", 'alpha');
|
||||
if ($filter) {
|
||||
@ -363,13 +364,13 @@ if ($search_type > 0) {
|
||||
$sql .= " AND t.rowid=".((int) $search_type);
|
||||
}
|
||||
if ($search_filter == 'withoutsubscription') {
|
||||
$sql .= " AND (datefin IS NULL OR t.subscription = 0)";
|
||||
$sql .= " AND (datefin IS NULL OR t.subscription = '0')";
|
||||
}
|
||||
if ($search_filter == 'uptodate') {
|
||||
$sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
|
||||
$sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = '0')";
|
||||
}
|
||||
if ($search_filter == 'outofdate') {
|
||||
$sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
|
||||
$sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = '1')";
|
||||
}
|
||||
if ($search_status != '') {
|
||||
// Peut valoir un nombre ou liste de nombre separes par virgules
|
||||
|
||||
@ -68,16 +68,21 @@ if ($id) {
|
||||
$caneditfieldmember = $user->rights->adherent->creer;
|
||||
}
|
||||
|
||||
$hookmanager->initHooks(array('membernote'));
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent', $object->id, '', '', 'socid', 'rowid', 0);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -99,14 +99,16 @@ print "<br>\n";
|
||||
/**
|
||||
* Edit parameters
|
||||
*/
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print '$(document).ready(function () {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#selectcountry_id").change(function() {
|
||||
document.form_index.action.value="updateedit";
|
||||
document.form_index.submit();
|
||||
});
|
||||
});';
|
||||
print '</script>'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -131,7 +133,7 @@ print '<input name="town" class="minwidth100" id="town" value="'.(GETPOSTISSET('
|
||||
|
||||
// Country
|
||||
print '<tr class="oddeven"><td><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
||||
print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
|
||||
print $form->select_country((GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'country_id');
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
@ -139,28 +141,29 @@ if ($user->admin) {
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="state_id">'.$langs->trans("State").'</label></td><td class="maxwidthonsmartphone">';
|
||||
$formcompany->select_departement((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id');
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state((GETPOSTISSET('state_id') ? GETPOST('state_id', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_STATE) ? $conf->global->MAIN_INFO_ACCOUNTANT_STATE : '')), (GETPOSTISSET('country_id') ? GETPOST('country_id', 'int') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY) ? $conf->global->MAIN_INFO_ACCOUNTANT_COUNTRY : '')), 'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="tel" id="phone" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="tel" id="phone" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('tel') ? GETPOST('tel', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_PHONE) ? $conf->global->MAIN_INFO_ACCOUNTANT_PHONE : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="fax" id="fax" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="fax" id="fax" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('fax') ? GETPOST('fax', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_FAX) ? $conf->global->MAIN_INFO_ACCOUNTANT_FAX : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="mail" id="email" class="maxwidth150 widthcentpercentminusx" value="'.(GETPOSTISSET('mail') ? GETPOST('mail', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_MAIL) ? $conf->global->MAIN_INFO_ACCOUNTANT_MAIL : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input name="web" id="web" class="maxwidth300 widthcentpercentminusx" value="'.(GETPOSTISSET('web') ? GETPOST('web', 'alpha') : (!empty($conf->global->MAIN_INFO_ACCOUNTANT_WEB) ? $conf->global->MAIN_INFO_ACCOUNTANT_WEB : '')).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Code
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
/* Copyright (C) 2018-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -18,7 +18,7 @@
|
||||
/**
|
||||
* \file htdocs/admin/accounting.php
|
||||
* \ingroup accounting
|
||||
* \brief Setup page to configure accountanting module
|
||||
* \brief Setup page to configure accounting module
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -32,7 +32,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminaccoutant'; // To manage different context of search
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'companies'));
|
||||
$langs->loadLangs(array('admin', 'companies', 'accountancy'));
|
||||
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
@ -52,12 +52,13 @@ $error = 0;
|
||||
* View
|
||||
*/
|
||||
|
||||
$title = $langs->trans("ConfigAccountingExpert");
|
||||
$help_url = '';
|
||||
llxHeader('', $langs->trans("ConfigAccountingExpert"), $help_url);
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
print load_fiche_titre($langs->trans("ConfigAccountingExpert"), $linkback, 'title_setup');
|
||||
print load_fiche_titre($title, $linkback, 'title_setup');
|
||||
|
||||
print "<br>\n";
|
||||
print '<span class="opacitymedium">'.$langs->trans("AccountancySetupDoneFromAccountancyMenu", $langs->transnoentitiesnoconv("Accounting").' - '.$langs->transnoentitiesnoconv("Setup"))."</span><br>\n";
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
* Copyright (C) 2011-2015 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2016 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -158,14 +159,6 @@ print dol_get_fiche_head($head, 'extsites', $langs->trans("Agenda"), -1, 'action
|
||||
print '<span class="opacitymedium">'.$langs->trans("AgendaExtSitesDesc")."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
$selectedvalue = $conf->global->AGENDA_DISABLE_EXT;
|
||||
if ($selectedvalue == 1) {
|
||||
$selectedvalue = 0;
|
||||
} else {
|
||||
$selectedvalue = 1;
|
||||
}
|
||||
|
||||
print "<table class=\"noborder\" width=\"100%\">";
|
||||
|
||||
print "<tr class=\"liste_titre\">";
|
||||
@ -226,15 +219,15 @@ while ($i <= $MAXAGENDA) {
|
||||
// Nb
|
||||
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb", $key)."</td>";
|
||||
// Name
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : $conf->global->$name).'" size="28"></td>';
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'.(GETPOST('AGENDA_EXT_NAME'.$key) ?GETPOST('AGENDA_EXT_NAME'.$key, 'alpha') : getDolGlobalString($name)).'" size="28"></td>';
|
||||
// URL
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : $conf->global->$src).'" size="60"></td>';
|
||||
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'.(GETPOST('AGENDA_EXT_SRC'.$key) ?GETPOST('AGENDA_EXT_SRC'.$key, 'alpha') : getDolGlobalString($src)).'" size="60"></td>';
|
||||
// Offset TZ
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ?GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : $conf->global->$offsettz).'" size="2"></td>';
|
||||
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_OFFSETTZ'.$key.'" value="'.(GETPOST('AGENDA_EXT_OFFSETTZ'.$key) ? GETPOST('AGENDA_EXT_OFFSETTZ'.$key) : getDolGlobalString($offsettz)).'" size="2"></td>';
|
||||
// Color (Possible colors are limited by Google)
|
||||
print '<td class="nowrap right">';
|
||||
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
|
||||
print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : $conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset');
|
||||
print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key) ?GETPOST("AGENDA_EXT_COLOR".$key) : getDolGlobalString($color)), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset');
|
||||
print '</td>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
|
||||
@ -422,7 +422,7 @@ foreach ($boxactivated as $key => $box) {
|
||||
$hasnext = ($key < (count($boxactivated) - 1));
|
||||
$hasprevious = ($key != 0);
|
||||
print '<td class="center">'.($key + 1).'</td>';
|
||||
print '<td class="center">';
|
||||
print '<td class="center nowraponall">';
|
||||
print ($hasnext ? '<a class="reposition" href="boxes.php?action=switch&switchfrom='.$box->rowid.'&switchto='.$boxactivated[$key + 1]->rowid.'">'.img_down().'</a> ' : '');
|
||||
print ($hasprevious ? '<a class="reposition" href="boxes.php?action=switch&switchfrom='.$box->rowid.'&switchto='.$boxactivated[$key - 1]->rowid.'">'.img_up().'</a>' : '');
|
||||
print '</td>';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2005-2021 Laurent Destailleur <eldy@users.sourceforge.org>
|
||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -20,7 +20,7 @@
|
||||
/**
|
||||
* \file htdocs/admin/clicktodial.php
|
||||
* \ingroup clicktodial
|
||||
* \brief Page to setup module clicktodial
|
||||
* \brief Page to setup module ClickToDial
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -99,7 +99,12 @@ print '<input class="quatrevingtpercent" type="text" id="CLICKTODIAL_URL" name="
|
||||
print ajax_autoselect('CLICKTODIAL_URL');
|
||||
print '<br>';
|
||||
print $langs->trans("ClickToDialUrlDesc").'<br>';
|
||||
print $langs->trans("Example").':<br>http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__';
|
||||
print '<br>';
|
||||
print '<span class="opacitymedium">';
|
||||
print $langs->trans("Example").':<br>';
|
||||
print 'http://myphoneserver/mypage?login=__LOGIN__&password=__PASS__&caller=__PHONEFROM__&called=__PHONETO__<br>';
|
||||
print 'sip:__PHONETO__@my.sip.server';
|
||||
print '</span>';
|
||||
|
||||
//if (! empty($user->clicktodial_url))
|
||||
//{
|
||||
|
||||
@ -384,21 +384,23 @@ print "<br>\n";
|
||||
/**
|
||||
* Edit parameters
|
||||
*/
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print '$(document).ready(function () {
|
||||
if (!empty($conf->use_javascript_ajax)) {
|
||||
print "\n".'<script type="text/javascript" language="javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#selectcountry_id").change(function() {
|
||||
document.form_index.action.value="updateedit";
|
||||
document.form_index.submit();
|
||||
});
|
||||
});';
|
||||
print '</script>'."\n";
|
||||
print '</script>'."\n";
|
||||
}
|
||||
|
||||
print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'" name="form_index">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><th class="titlefield wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
print '<tr class="liste_titre"><th class="titlefieldcreate wordbreak">'.$langs->trans("CompanyInfo").'</th><th>'.$langs->trans("Value").'</th></tr>'."\n";
|
||||
|
||||
// Name
|
||||
print '<tr class="oddeven"><td class="fieldrequired wordbreak"><label for="name">'.$langs->trans("CompanyName").'</label></td><td>';
|
||||
@ -417,8 +419,8 @@ print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SO
|
||||
|
||||
// Country
|
||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||
print img_picto('', 'globe-americas', 'class="paddingrightonly"');
|
||||
print $form->select_country($mysoc->country_id, 'country_id');
|
||||
print img_picto('', 'globe-americas', 'class="pictofixedwidth"');
|
||||
print $form->select_country($mysoc->country_id, 'country_id', '', 0);
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
@ -430,56 +432,58 @@ if (!empty($conf->global->MAIN_INFO_SOCIETE_STATE)) {
|
||||
$tmp = explode(':', $conf->global->MAIN_INFO_SOCIETE_STATE);
|
||||
$state_id = $tmp[0];
|
||||
}
|
||||
$formcompany->select_departement($state_id, $mysoc->country_code, 'state_id');
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state($state_id, $mysoc->country_code, 'state_id');
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Currency
|
||||
print '<tr class="oddeven"><td><label for="currency">'.$langs->trans("CompanyCurrency").'</label></td><td>';
|
||||
print img_picto('', 'multicurrency', 'class="pictofixedwidth"');
|
||||
print $form->selectCurrency($conf->currency, "currency");
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Phone
|
||||
print '<tr class="oddeven"><td><label for="phone">'.$langs->trans("Phone").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="tel" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET('tel') ? GETPOST('tel', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? $conf->global->MAIN_INFO_SOCIETE_TEL : ''))).'"></td></tr>';
|
||||
print img_picto('', 'object_phoning', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input class="maxwidth150 widthcentpercentminusx" name="tel" id="phone" value="'.dol_escape_htmltag((GETPOSTISSET('tel') ? GETPOST('tel', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_TEL) ? $conf->global->MAIN_INFO_SOCIETE_TEL : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Fax
|
||||
print '<tr class="oddeven"><td><label for="fax">'.$langs->trans("Fax").'</label></td><td>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? $conf->global->MAIN_INFO_SOCIETE_FAX : ''))).'"></td></tr>';
|
||||
print img_picto('', 'object_phoning_fax', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input class="maxwidth150" name="fax" id="fax" value="'.dol_escape_htmltag((GETPOSTISSET('fax') ? GETPOST('fax', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_FAX) ? $conf->global->MAIN_INFO_SOCIETE_FAX : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Email
|
||||
print '<tr class="oddeven"><td><label for="email">'.$langs->trans("EMail").'</label></td><td>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="mail" id="email" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
||||
print img_picto('', 'object_email', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input class="maxwidth150" name="mail" id="email" value="'.dol_escape_htmltag((GETPOSTISSET('mail') ? GETPOST('mail', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MAIL) ? $conf->global->MAIN_INFO_SOCIETE_MAIL : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Web
|
||||
print '<tr class="oddeven"><td><label for="web">'.$langs->trans("Web").'</label></td><td>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'paddingright');
|
||||
print '<input name="web" id="web" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? $conf->global->MAIN_INFO_SOCIETE_WEB : ''))).'"></td></tr>';
|
||||
print img_picto('', 'globe', '', false, 0, 0, '', 'pictofixedwidth');
|
||||
print '<input class="maxwidth300 widthcentpercentminusx" name="web" id="web" value="'.dol_escape_htmltag((GETPOSTISSET('web') ? GETPOST('web', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_WEB) ? $conf->global->MAIN_INFO_SOCIETE_WEB : ''))).'"></td></tr>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Barcode
|
||||
if (!empty($conf->barcode->enabled)) {
|
||||
print '<tr class="oddeven"><td>';
|
||||
print '<label for="barcode">'.$langs->trans("Gencod").'</label></td><td>';
|
||||
print '<span class="fa paddingright fa-barcode"></span>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150" value="'.dol_escape_htmltag((GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_GENCODE) ? $conf->global->MAIN_INFO_SOCIETE_GENCODE : ''))).'"></td></tr>';
|
||||
print '<span class="fa fa-barcode pictofixedwidth"></span>';
|
||||
print '<input name="barcode" id="barcode" class="minwidth150 widthcentpercentminusx maxwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('barcode') ? GETPOST('barcode', 'alphanohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_GENCODE) ? $conf->global->MAIN_INFO_SOCIETE_GENCODE : ''))).'"></td></tr>';
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Logo
|
||||
print '<tr class="oddeven"><td><label for="logo">'.$form->textwithpicto($langs->trans("Logo"), 'png, jpg').'</label></td><td>';
|
||||
print '<div class="centpertent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth200" name="logo" id="logo" accept="image/*">';
|
||||
print '<div class="centpercent nobordernopadding valignmiddle "><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo" id="logo" accept="image/*">';
|
||||
print '</div>';
|
||||
if (!empty($mysoc->logo_small)) {
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
||||
print '<img style="max-height: 80px; max-width: 200px;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small).'">';
|
||||
print '</div>';
|
||||
} elseif (!empty($mysoc->logo)) {
|
||||
if (!file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) {
|
||||
@ -487,10 +491,12 @@ if (!empty($mysoc->logo_small)) {
|
||||
}
|
||||
$imgThumbSmall = vignette($conf->mycompany->dir_output.'/logos/'.$mysoc->logo, $maxwidthmini, $maxheightmini, '_small', $quality);
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
print '<img style="max-height: 80px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
|
||||
print '<img style="max-height: 80px; max-width: 200px;" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/thumbs/'.basename($imgThumbSmall)).'">';
|
||||
print '</div>';
|
||||
}
|
||||
print '<div class="inline-block valignmiddle marginrightonly"><a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a></div>';
|
||||
print '<div class="inline-block valignmiddle marginrightonly">';
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removelogo">'.img_delete($langs->trans("Delete"), '', 'marginleftonly').'</a>';
|
||||
print '</div>';
|
||||
} elseif (!empty($mysoc->logo)) {
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) {
|
||||
print '<div class="inline-block valignmiddle">';
|
||||
@ -508,8 +514,8 @@ print '</td></tr>';
|
||||
|
||||
// Logo (squarred)
|
||||
print '<tr class="oddeven"><td><label for="logo_squarred">'.$form->textwithpicto($langs->trans("LogoSquarred"), 'png, jpg').'</label></td><td>';
|
||||
print '<div class="centpertent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth200" name="logo_squarred" id="logo_squarred" accept="image/*">';
|
||||
print '<div class="centpercent nobordernopadding valignmiddle"><div class="inline-block marginrightonly">';
|
||||
print '<input type="file" class="flat minwidth100 maxwidthinputfileonsmartphone" name="logo_squarred" id="logo_squarred" accept="image/*">';
|
||||
print '</div>';
|
||||
if (!empty($mysoc->logo_squarred_small)) {
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_squarred_small)) {
|
||||
@ -551,20 +557,21 @@ print '</table>';
|
||||
print '<br>';
|
||||
|
||||
// IDs of the company (country-specific)
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
print '<tr class="liste_titre"><td class="titlefieldcreate wordbreak">'.$langs->trans("CompanyIds").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
$langs->load("companies");
|
||||
|
||||
// Managing Director(s)
|
||||
print '<tr class="oddeven"><td><label for="director">'.$langs->trans("ManagingDirectors").'</label></td><td>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth200" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS) ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS : ''))).'"></td></tr>';
|
||||
print '<input name="MAIN_INFO_SOCIETE_MANAGERS" id="directors" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET('MAIN_INFO_SOCIETE_MANAGERS') ? GETPOST('MAIN_INFO_SOCIETE_MANAGERS', 'nohtml') : (!empty($conf->global->MAIN_INFO_SOCIETE_MANAGERS) ? $conf->global->MAIN_INFO_SOCIETE_MANAGERS : ''))).'"></td></tr>';
|
||||
|
||||
// GDPR contact
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("GDPRContact"), $langs->trans("GDPRContactDesc"));
|
||||
print '</td><td>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth500" value="'.dol_escape_htmltag((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'nohtml') : (!empty($conf->global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'"></td></tr>';
|
||||
print '<input name="MAIN_INFO_GDPR" id="infodirector" class="minwidth300" value="'.dol_escape_htmltag((GETPOSTISSET("MAIN_INFO_GDPR") ? GETPOST("MAIN_INFO_GDPR", 'nohtml') : (!empty($conf->global->MAIN_INFO_GDPR) ? $conf->global->MAIN_INFO_GDPR : ''))).'"></td></tr>';
|
||||
|
||||
// Capital
|
||||
print '<tr class="oddeven"><td><label for="capital">'.$langs->trans("Capital").'</label></td><td>';
|
||||
@ -656,13 +663,14 @@ print '<textarea class="flat quatrevingtpercent" name="object" id="object" rows=
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
// Fiscal year start
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("FiscalYearInformation").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td><label for="SOCIETE_FISCAL_MONTH_START">'.$langs->trans("FiscalMonthStart").'</label></td><td>';
|
||||
@ -677,12 +685,12 @@ print load_fiche_titre($langs->trans("TypeOfSaleTaxes"), '', 'object_payment');
|
||||
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("VATManagement").'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Main tax
|
||||
print '<tr class="oddeven"><td width="140"><label><input type="radio" name="optiontva" id="use_vat" value="1"'.(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||
print '<tr class="oddeven"><td><label><input type="radio" name="optiontva" id="use_vat" value="1"'.(empty($conf->global->FACTURE_TVAOPTION) ? "" : " checked")."> ".$langs->trans("VATIsUsed")."</label></td>";
|
||||
print '<td colspan="2">';
|
||||
$tooltiphelp = '';
|
||||
if ($mysoc->country_code == 'FR') {
|
||||
@ -707,7 +715,7 @@ print "</table>";
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$form->textwithpicto($langs->transcountry("LocalTax1Management", $mysoc->country_code), $langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -741,7 +749,7 @@ if ($mysoc->useLocalTax(1)) {
|
||||
if (empty($mysoc->country_code)) {
|
||||
print '<tr class="oddeven nohover"><td class="">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).'</td></tr>';
|
||||
print '<tr class="oddeven nohover"><td class="" colspan="3"><span class="opacitymedium">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).'</span></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -751,7 +759,7 @@ print "</table>";
|
||||
print '<br>';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="titlefieldcreate">'.$form->textwithpicto($langs->transcountry("LocalTax2Management", $mysoc->country_code), $langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)).'</td><td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="right"> </td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -784,7 +792,7 @@ if ($mysoc->useLocalTax(2)) {
|
||||
if (empty($mysoc->country_code)) {
|
||||
print '<tr class="oddeven nohover"><td class="">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).'</td></tr>';
|
||||
print '<tr class="oddeven nohover"><td class="" colspan="3"><span class="opacitymedium">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).'</span></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -810,7 +818,7 @@ if ($mysoc->useRevenueStamp()) {
|
||||
if (empty($mysoc->country_code)) {
|
||||
print '<tr class="oddeven nohover"><td class="">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
||||
} else {
|
||||
print '<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).'</td></tr>';
|
||||
print '<tr class="oddeven nohover"><td class="" colspan="3"><span class="opacitymedium">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).'</span></td></tr>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -74,6 +74,8 @@ if (($action == 'update' && !GETPOST("cancel", 'alpha'))) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
}
|
||||
|
||||
|
||||
@ -104,6 +106,8 @@ print '<input type="hidden" name="action" value="update">';
|
||||
|
||||
// Social networks
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent editmode">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefield">'.$langs->trans("SocialNetworksInformation").'</td><td>'.$langs->trans("Url").'</td><td>'.$langs->trans("SocialNetworkId").'</td><td></td>';
|
||||
@ -116,17 +120,18 @@ foreach ($listofnetworks as $key => $value) {
|
||||
print '<td><label for="'.$key.'url">'.$langs->trans(ucfirst($key)).'</label></td>';
|
||||
$networkconstname = 'MAIN_INFO_SOCIETE_'.strtoupper($key).'_URL';
|
||||
$networkconstid = 'MAIN_INFO_SOCIETE_'.strtoupper($key);
|
||||
print '<td><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
|
||||
print '<td class="nowraponall"><span class="fa paddingright '.($value['icon'] ? $value['icon'] : 'fa-link').'"></span>';
|
||||
print '<input name="'.$key.'url" id="'.$key.'url" class="minwidth300" value="'.(!empty($conf->global->$networkconstname) ? dol_escape_htmltag($conf->global->$networkconstname) : '').'">';
|
||||
print '</td><td>';
|
||||
print '<input name="'.$key.'" id="'.$key.'" class="minwidth300" value="'.(!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : '').'">';
|
||||
print '</td>';
|
||||
print '<td>'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).'</td>';
|
||||
print '<td class="nowraponall">'.dol_print_socialnetworks((!empty($conf->global->$networkconstid) ? dol_escape_htmltag($conf->global->$networkconstid) : ''), 0, 0, $key, $listofnetworks).'</td>';
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -241,7 +241,7 @@ if ($defaultvalue) {
|
||||
}
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].((empty($user->entity) && !empty($debug)) ? '?debug=1' : '').'" method="POST">';
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
@ -393,8 +393,8 @@ if (!is_array($result) && $result<0) {
|
||||
// Actions
|
||||
print '<td class="center">';
|
||||
if ($action != 'edit' || GETPOST('rowid') != $defaultvalue->id) {
|
||||
print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=edit&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_edit().'</a>';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=delete&token='.newToken().((empty($user->entity) && $debug) ? '&debug=1' : '').'">'.img_delete().'</a>';
|
||||
print '<a class="editfielda marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=edit&token='.newToken().'">'.img_edit().'</a>';
|
||||
print '<a class="marginleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?rowid='.$defaultvalue->id.'&entity='.$defaultvalue->entity.'&mode='.$mode.'&action=delete&token='.newToken().'">'.img_delete().'</a>';
|
||||
} else {
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="rowid" value="'.$id.'">';
|
||||
|
||||
@ -100,7 +100,7 @@ $hookmanager->initHooks(array('admin'));
|
||||
// Put here declaration of dictionaries properties
|
||||
|
||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
||||
$taborder = array(9, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 0, 29, 0, 33, 34, 32, 24, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 15, 30, 0, 37, 42, 0, 43, 0, 25, 0);
|
||||
$taborder = array(9, 15, 30, 0, 4, 3, 2, 0, 1, 8, 19, 16, 39, 27, 40, 38, 0, 5, 11, 0, 6, 24, 0, 29, 0, 33, 34, 32, 28, 17, 35, 36, 0, 10, 23, 12, 13, 7, 0, 14, 0, 22, 20, 18, 21, 41, 0, 37, 42, 0, 43, 0, 25, 0);
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname = array();
|
||||
@ -223,7 +223,7 @@ $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFI
|
||||
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
|
||||
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
|
||||
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
|
||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
|
||||
$tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
|
||||
$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
|
||||
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
|
||||
@ -315,7 +315,7 @@ $tabfield[24] = "code,label";
|
||||
$tabfield[25] = "code,label";
|
||||
//$tabfield[26]= "code,label,short_label";
|
||||
$tabfield[27] = "code,libelle,picto";
|
||||
$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country";
|
||||
$tabfield[28] = "code,label,affect,delay,newByMonth,country_id,country";
|
||||
$tabfield[29] = "code,label,percent,position";
|
||||
$tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfield[31]= "pcg_version,label";
|
||||
@ -361,7 +361,7 @@ $tabfieldvalue[24] = "code,label";
|
||||
$tabfieldvalue[25] = "code,label";
|
||||
//$tabfieldvalue[26]= "code,label,short_label";
|
||||
$tabfieldvalue[27] = "code,libelle,picto";
|
||||
$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country";
|
||||
$tabfieldvalue[28] = "code,label,affect,delay,newByMonth,country";
|
||||
$tabfieldvalue[29] = "code,label,percent,position";
|
||||
$tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfieldvalue[31]= "pcg_version,label";
|
||||
@ -407,7 +407,7 @@ $tabfieldinsert[24] = "code,label";
|
||||
$tabfieldinsert[25] = "code,label";
|
||||
//$tabfieldinsert[26]= "code,label,short_label";
|
||||
$tabfieldinsert[27] = "code,libelle,picto";
|
||||
$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country";
|
||||
$tabfieldinsert[28] = "code,label,affect,delay,newByMonth,fk_country";
|
||||
$tabfieldinsert[29] = "code,label,percent,position";
|
||||
$tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
|
||||
//$tabfieldinsert[31]= "pcg_version,label";
|
||||
@ -548,7 +548,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
|
||||
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
|
||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
|
||||
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
|
||||
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
|
||||
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
|
||||
@ -568,8 +568,8 @@ $tabhelp[43] = array('code'=>$langs->trans("EnterAnyCode"));
|
||||
// Table to store complete informations (will replace all other table). Key is table name.
|
||||
$tabcomplete = array(
|
||||
'c_forme_juridique'=>array('picto'=>'company'),
|
||||
'c_departements'=>array('picto'=>'country'),
|
||||
'c_regions'=>array('picto'=>'country'),
|
||||
'c_departements'=>array('picto'=>'state'),
|
||||
'c_regions'=>array('picto'=>'region'),
|
||||
'c_country'=>array('picto'=>'country'),
|
||||
'c_civility'=>array('picto'=>'contact'),
|
||||
'c_actioncomm'=>array('picto'=>'action'),
|
||||
@ -695,7 +695,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
|
||||
$listfieldmodify = explode(',', $tabfieldinsert[$id]);
|
||||
$listfieldvalue = explode(',', $tabfieldvalue[$id]);
|
||||
|
||||
// Check that all fields are filled
|
||||
// Check that all mandatory fields are filled
|
||||
$ok = 1;
|
||||
foreach ($listfield as $f => $value) {
|
||||
// Discard check of mandatory fields for country for some tables
|
||||
@ -882,12 +882,12 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
|
||||
}
|
||||
|
||||
if ($keycode == 'sortorder') { // For column name 'sortorder', we use the field name 'position'
|
||||
$sql .= "'".(int) GETPOST('position', 'int')."'";
|
||||
$sql .= (int) GETPOST('position', 'int');
|
||||
} elseif ($_POST[$keycode] == '' && !($keycode == 'code' && $id == 10)) {
|
||||
$sql .= "null"; // For vat, we want/accept code = ''
|
||||
} elseif ($keycode == 'content') {
|
||||
$sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'";
|
||||
} elseif (in_array($keycode, array('joinfile', 'private', 'position', 'scale'))) {
|
||||
} elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) {
|
||||
$sql .= (int) GETPOST($keycode, 'int');
|
||||
} else {
|
||||
$sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'";
|
||||
@ -898,8 +898,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
|
||||
$sql .= ",1)";
|
||||
|
||||
dol_syslog("actionadd", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($result) { // Add is ok
|
||||
$resql = $db->query($sql);
|
||||
if ($resql) { // Add is ok
|
||||
setEventMessages($langs->transnoentities("RecordCreatedSuccessfully"), null, 'mesgs');
|
||||
|
||||
// Clean $_POST array, we keep only id of dictionary
|
||||
@ -956,7 +956,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
|
||||
$sql .= "null"; // For vat, we want/accept code = ''
|
||||
} elseif ($keycode == 'content') {
|
||||
$sql .= "'".$db->escape(GETPOST($keycode, 'restricthtml'))."'";
|
||||
} elseif (in_array($keycode, array('private', 'position', 'scale'))) {
|
||||
} elseif (in_array($keycode, array('joinfile', 'private', 'pos', 'position', 'scale', 'use_default'))) {
|
||||
$sql .= (int) GETPOST($keycode, 'int');
|
||||
} else {
|
||||
$sql .= "'".$db->escape(GETPOST($keycode, 'nohtml'))."'";
|
||||
@ -1234,7 +1234,7 @@ if ($id) {
|
||||
$class = '';
|
||||
|
||||
if ($value == 'pos') {
|
||||
$valuetoshow = $langs->trans("Position"); $class = 'maxwidth100';
|
||||
$valuetoshow = $langs->trans("Position"); $class = 'right';
|
||||
}
|
||||
if ($value == 'source') {
|
||||
$valuetoshow = $langs->trans("Contact");
|
||||
@ -1341,6 +1341,9 @@ if ($id) {
|
||||
if ($value == 'short_label') {
|
||||
$valuetoshow = $langs->trans("ShortLabel");
|
||||
}
|
||||
if ($value == 'fk_parent') {
|
||||
$valuetoshow = $langs->trans("ParentID"); $class = 'center';
|
||||
}
|
||||
if ($value == 'range_account') {
|
||||
$valuetoshow = $langs->trans("Range");
|
||||
}
|
||||
@ -1389,7 +1392,7 @@ if ($id) {
|
||||
if ($value == 'delay') {
|
||||
$valuetoshow = $langs->trans("NoticePeriod");
|
||||
}
|
||||
if ($value == 'newbymonth') {
|
||||
if ($value == 'newByMonth') {
|
||||
$valuetoshow = $langs->trans("NewByMonth");
|
||||
}
|
||||
if ($value == 'fk_tva') {
|
||||
@ -1623,11 +1626,8 @@ if ($id) {
|
||||
if ($value == 'code') {
|
||||
$valuetoshow = $langs->trans("Code");
|
||||
}
|
||||
if ($value == 'pos') {
|
||||
$cssprefix = 'right '; $valuetoshow = $langs->trans("Position");
|
||||
}
|
||||
if ($value == 'position') {
|
||||
$cssprefix = 'right '; $valuetoshow = $langs->trans("Position");
|
||||
if (in_array($value, array('pos', 'position'))) {
|
||||
$valuetoshow = $langs->trans("Position"); $cssprefix = 'right ';
|
||||
}
|
||||
if ($value == 'libelle' || $value == 'label') {
|
||||
$valuetoshow = $langs->trans("Label");
|
||||
@ -1686,6 +1686,9 @@ if ($id) {
|
||||
if ($value == 'short_label') {
|
||||
$valuetoshow = $langs->trans("ShortLabel");
|
||||
}
|
||||
if ($value == 'fk_parent') {
|
||||
$valuetoshow = $langs->trans("ParentID"); $cssprefix = 'center ';
|
||||
}
|
||||
if ($value == 'range_account') {
|
||||
$valuetoshow = $langs->trans("Range");
|
||||
}
|
||||
@ -1734,7 +1737,7 @@ if ($id) {
|
||||
if ($value == 'delay') {
|
||||
$valuetoshow = $langs->trans("NoticePeriod");
|
||||
}
|
||||
if ($value == 'newbymonth') {
|
||||
if ($value == 'newByMonth') {
|
||||
$valuetoshow = $langs->trans("NewByMonth");
|
||||
}
|
||||
if ($value == 'fk_tva') {
|
||||
@ -1992,19 +1995,13 @@ if ($id) {
|
||||
if ($value == 'tracking') {
|
||||
$class .= ' tdoverflowauto';
|
||||
}
|
||||
if ($value == 'position') {
|
||||
if (in_array($value, array('pos', 'position'))) {
|
||||
$class .= ' right';
|
||||
}
|
||||
if ($value == 'localtax1_type') {
|
||||
if (in_array($value, array('localtax1_type', 'localtax2_type'))) {
|
||||
$class .= ' nowrap';
|
||||
}
|
||||
if ($value == 'localtax2_type') {
|
||||
$class .= ' nowrap';
|
||||
}
|
||||
if ($value == 'pos') {
|
||||
$class .= ' right';
|
||||
}
|
||||
if ($value == 'use_default') {
|
||||
if (in_array($value, array('use_default', 'fk_parent'))) {
|
||||
$class .= ' center';
|
||||
}
|
||||
if ($value == 'public') {
|
||||
@ -2271,7 +2268,13 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
print '<td>';
|
||||
print $form->selectarray('source', $sourceList, (!empty($obj->{$value}) ? $obj->{$value}:''));
|
||||
print '</td>';
|
||||
} elseif (in_array($value, array('public', 'use_default'))) {
|
||||
// Fields 0/1 with a combo select Yes/No
|
||||
print '<td class="center">';
|
||||
print $form->selectyesno($value, (!empty($obj->{$value}) ? $obj->{$value}:''), 1);
|
||||
print '</td>';
|
||||
} elseif ($value == 'private') {
|
||||
// Fields 'no'/'yes' with a combo select Yes/No
|
||||
print '<td>';
|
||||
print $form->selectyesno("private", (!empty($obj->{$value}) ? $obj->{$value}:''));
|
||||
print '</td>';
|
||||
@ -2367,7 +2370,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
print $form->selectExpenseRanges($obj->fk_range);
|
||||
print '</td>';
|
||||
} else {
|
||||
$fieldValue = isset($obj->{$value}) ? $obj->{$value}:'';
|
||||
$fieldValue = isset($obj->{$value}) ? $obj->{$value}: '';
|
||||
|
||||
if ($value == 'sortorder') {
|
||||
$fieldlist[$field] = 'position';
|
||||
@ -2377,15 +2380,24 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
if ($fieldlist[$field] == 'code') {
|
||||
$class = 'maxwidth100';
|
||||
}
|
||||
if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'pos', 'use_default', 'affect', 'delay', 'position', 'public', 'sortorder', 'sens', 'category_type'))) {
|
||||
if (in_array($fieldlist[$field], array('pos', 'position'))) {
|
||||
$classtd = 'right'; $class = 'maxwidth50 right';
|
||||
}
|
||||
if (in_array($fieldlist[$field], array('dayrule', 'day', 'month', 'year', 'use_default', 'affect', 'delay', 'public', 'sortorder', 'sens', 'category_type', 'fk_parent'))) {
|
||||
$class = 'maxwidth50 center';
|
||||
}
|
||||
if (in_array($fieldlist[$field], array('use_default', 'public'))) {
|
||||
if (in_array($fieldlist[$field], array('use_default', 'public', 'fk_parent'))) {
|
||||
$classtd = 'center';
|
||||
}
|
||||
if (in_array($fieldlist[$field], array('libelle', 'label', 'tracking'))) {
|
||||
$class = 'quatrevingtpercent';
|
||||
}
|
||||
// Fields that must be suggested as '0' instead of ''
|
||||
if ($fieldlist[$field] == 'fk_parent') {
|
||||
if (empty($fieldValue)) {
|
||||
$fieldValue = '0';
|
||||
}
|
||||
}
|
||||
print '<td class="'.$classtd.'">';
|
||||
$transfound = 0;
|
||||
$transkey = '';
|
||||
|
||||
@ -482,13 +482,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '<input type="hidden" name="id" value="'.$object->id.'">';
|
||||
|
||||
// Filters
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="tablelineoffilters" class="noborder margintable noshadow">';
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
print '<td>'.$form->textwithpicto($langs->trans("Filters"), $langs->trans("EmailCollectorFilterDesc")).'</td><td></td><td></td>';
|
||||
print '</tr>';
|
||||
// Add filter
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven nodrag nodrop">';
|
||||
print '<td>';
|
||||
$arrayoftypes = array(
|
||||
'from'=>array('label'=>'MailFrom', 'data-placeholder'=>$langs->trans('SearchString')),
|
||||
@ -518,7 +518,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
'isnotanswer'=>array('label'=>'IsNotAnAnswer', 'data-noparam'=>1),
|
||||
'isanswer'=>array('label'=>'IsAnAnswer', 'data-noparam'=>1)
|
||||
);
|
||||
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth500', 1, '', 2);
|
||||
print $form->selectarray('filtertype', $arrayoftypes, '', 1, 0, 0, '', 1, 0, 0, '', 'maxwidth300', 1, '', 2);
|
||||
|
||||
print "\n";
|
||||
print '<script>';
|
||||
@ -542,7 +542,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print '</td><td>';
|
||||
print '<input type="text" name="rulevalue" id="rulevalue">';
|
||||
print '</td>';
|
||||
print '<td class="right"><input type="submit" name="addfilter" id="addfilter" class="flat button" value="'.$langs->trans("Add").'"></td>';
|
||||
print '<td class="right"><input type="submit" name="addfilter" id="addfilter" class="flat button small" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
// List filters
|
||||
foreach ($object->filters as $rulefilter) {
|
||||
@ -568,12 +568,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
|
||||
// Operations
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table id="tablelines" class="noborder noshadow tableforfield">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<table id="tablelines" class="noborder margintable noshadow">';
|
||||
print '<tr class="liste_titre nodrag nodrop">';
|
||||
print '<td>'.$form->textwithpicto($langs->trans("EmailcollectorOperations"), $langs->trans("EmailcollectorOperationsDesc")).'</td><td></td><td></td><td></td>';
|
||||
print '</tr>';
|
||||
// Add operation
|
||||
print '<tr class="oddeven">';
|
||||
print '<tr class="oddeven nodrag nodrop">';
|
||||
print '<td>';
|
||||
$arrayoftypes = array(
|
||||
'loadthirdparty'=>$langs->trans('LoadThirdPartyFromName', $langs->transnoentities("ThirdPartyName")),
|
||||
@ -609,7 +609,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$htmltext = $langs->transnoentitiesnoconv("OperationParamDesc");
|
||||
print $form->textwithpicto('', $htmltext, 1, 'help', '', 0, 2, 'operationparamtt');
|
||||
print '</td>';
|
||||
print '<td class="right"><input type="submit" name="addoperation" id="addoperation" class="flat button" value="'.$langs->trans("Add").'"></td>';
|
||||
print '<td class="right"><input type="submit" name="addoperation" id="addoperation" class="flat button small" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
// List operations
|
||||
$nboflines = count($object->actions);
|
||||
@ -630,12 +630,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
print $form->textwithpicto('', $langs->transnoentitiesnoconv('EmailCollectorLoadThirdPartyHelp'));
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="wordbreak">';
|
||||
print '<td class="wordbreak minwidth300">';
|
||||
if ($action == 'editoperation' && $ruleaction['id'] == $operationid) {
|
||||
print '<input type="text" class="quatrevingtquinzepercent" name="operationparam2" value="'.$ruleaction['actionparam'].'"><br>';
|
||||
print '<input type="hidden" name="rowidoperation2" value="'.$ruleaction['id'].'"><br>';
|
||||
print '<input type="submit" class="button button-save" name="saveoperation2" value="'.$langs->trans("Save").'">';
|
||||
print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '<input type="hidden" name="rowidoperation2" value="'.$ruleaction['id'].'">';
|
||||
print '<input type="submit" class="button small button-save" name="saveoperation2" value="'.$langs->trans("Save").'">';
|
||||
print '<input type="submit" class="button small button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
} else {
|
||||
print $ruleaction['actionparam'];
|
||||
}
|
||||
|
||||
@ -315,21 +315,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
{
|
||||
jQuery("#myid").removeAttr(\'disabled\');
|
||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
|
||||
@ -54,12 +54,12 @@ $arrayofparameters = array(
|
||||
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
|
||||
//'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
|
||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
|
||||
'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1),
|
||||
'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1),
|
||||
|
||||
@ -86,13 +86,14 @@ print '<td class="center" width="20"> </td>';
|
||||
print '<td class="center" width="100"></td>'."\n";
|
||||
print '</tr>';
|
||||
|
||||
// Example with a yes / no select
|
||||
/* No more need for this, you can set that a profile is public when saving it.
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("EXPORTS_SHARE_MODELS").'</td>';
|
||||
print '<td class="center" width="20"> </td>';
|
||||
print '<td class="center" width="100">';
|
||||
print ajax_constantonoff('EXPORTS_SHARE_MODELS');
|
||||
print '</td></tr>';
|
||||
*/
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("ExportCsvSeparator").'</td>';
|
||||
|
||||
@ -117,7 +117,7 @@ if (GETPOST('save', 'alpha')) {
|
||||
$error++;
|
||||
}
|
||||
|
||||
$fckeditor_test = GETPOST('formtestfield');
|
||||
$fckeditor_test = GETPOST('formtestfield', 'restricthtml');
|
||||
if (!empty($fckeditor_test)) {
|
||||
if (!dolibarr_set_const($db, 'FCKEDITOR_TEST', $fckeditor_test, 'chaine', 0, '', $conf->entity)) {
|
||||
$error++;
|
||||
|
||||
@ -255,7 +255,7 @@ if ($action == 'update') {
|
||||
|
||||
$_SESSION["mainmenu"] = ""; // Le gestionnaire de menu a pu changer
|
||||
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup");
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup".(GETPOSTISSET('page_y', 'int') ? '&page_y='.GETPOST('page_y', 'int') : ''));
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -281,6 +281,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
print '<form enctype="multipart/form-data" method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="page_y" value="">';
|
||||
|
||||
clearstatcache();
|
||||
|
||||
@ -292,8 +293,9 @@ print '</tr>';
|
||||
|
||||
// Default language
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("DefaultLanguage").'</td><td>';
|
||||
print img_picto('', 'language', 'class="pictofixedwidth"');
|
||||
print $formadmin->select_language($conf->global->MAIN_LANG_DEFAULT, 'MAIN_LANG_DEFAULT', 1, null, '', 0, 0, 'minwidth300', 2);
|
||||
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
//print '<input class="button button-save smallpaddingimp" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -303,12 +305,24 @@ print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table><br>'."\n";
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// Themes and themes options
|
||||
showSkins(null, 1);
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// Other
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -440,6 +454,12 @@ print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '<br><br>';
|
||||
|
||||
// Other
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||
@ -476,7 +496,7 @@ $disabled = '';
|
||||
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
|
||||
$disabled = ' disabled="disabled"';
|
||||
}
|
||||
print '<input type="file" class="flat class=minwidth200" name="imagebackground" id="imagebackground"'.$disabled.'>';
|
||||
print '<input type="file" class="flat maxwidthinputfileonsmartphone" name="imagebackground" id="imagebackground"'.$disabled.'>';
|
||||
if ($disabled) {
|
||||
print '('.$langs->trans("DisabledByOptionADD_UNSPLASH_LOGIN_BACKGROUND").') ';
|
||||
}
|
||||
@ -484,7 +504,7 @@ if (!empty($conf->global->MAIN_LOGIN_BACKGROUND)) {
|
||||
print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=removebackgroundlogin">'.img_delete($langs->trans("Delete")).'</a>';
|
||||
if (file_exists($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_LOGIN_BACKGROUND)) {
|
||||
print ' ';
|
||||
print '<img class="paddingleft valignmiddle" width="100px" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
|
||||
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&file='.urlencode('logos/'.$conf->global->MAIN_LOGIN_BACKGROUND).'">';
|
||||
}
|
||||
} else {
|
||||
print '<img class="paddingleft valignmiddle" width="100" src="'.DOL_URL_ROOT.'/public/theme/common/nophoto.png">';
|
||||
@ -497,7 +517,7 @@ print '</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center">';
|
||||
print '<input class="button button-save" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '<input class="button button-save reposition" type="submit" name="submit" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
@ -51,6 +51,7 @@ if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) {
|
||||
$conf->global->MAIN_MOTD_SETUPPAGE = preg_replace('/<br(\s[\sa-zA-Z_="]*)?\/?>/i', '<br>', $conf->global->MAIN_MOTD_SETUPPAGE);
|
||||
if (!empty($conf->global->MAIN_MOTD_SETUPPAGE)) {
|
||||
$i = 0;
|
||||
$reg = array();
|
||||
while (preg_match('/__\(([a-zA-Z|@]+)\)__/i', $conf->global->MAIN_MOTD_SETUPPAGE, $reg) && $i < 100) {
|
||||
$tmp = explode('|', $reg[1]);
|
||||
if (!empty($tmp[1])) {
|
||||
|
||||
@ -255,11 +255,13 @@ print '<td colspan="3">'.$langs->trans("ForANonAnonymousAccess").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// DNAdmin
|
||||
print '<!-- LDAP_ADMIN_DN -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPAdminDn").'</td><td>';
|
||||
print '<input size="25" type="text" name="admin" value="'.$conf->global->LDAP_ADMIN_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPAdminDnExample").'</td></tr>';
|
||||
|
||||
// Pass
|
||||
print '<!-- LDAP_ADMIN_PASS -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPPassword").'</td><td>';
|
||||
if (!empty($conf->global->LDAP_ADMIN_PASS)) {
|
||||
print '<input size="25" type="password" name="pass" value="'.$conf->global->LDAP_ADMIN_PASS.'">'; // je le met en visible pour test
|
||||
|
||||
@ -155,14 +155,16 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeContacts").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// DN Pour les contacts
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPContactDn").'</span></td><td>';
|
||||
print '<!-- LDAP_CONTACT_DN -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPContactDn").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="contactdn" value="'.$conf->global->LDAP_CONTACT_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPContactDnExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// List of object class used to define attributes in structure
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPContactObjectClassList").'</span></td><td>';
|
||||
print '<!-- LDAP_CONTACT_OBJECT_CLASS -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPContactObjectClassList").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_CONTACT_OBJECT_CLASS.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPContactObjectClassListExample").'</td>';
|
||||
print '<td> </td>';
|
||||
@ -173,7 +175,7 @@ print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
|
||||
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -99,6 +99,8 @@ if ($action == 'setvalue' && $user->admin) {
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
llxHeader('', $langs->trans("LDAPSetup"), 'EN:Module_LDAP_En|FR:Module_LDAP|ES:Módulo_LDAP');
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
|
||||
@ -121,8 +123,6 @@ print '<br>';
|
||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?action=setvalue">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -130,20 +130,23 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeGroups").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// DN pour les groupes
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPGroupDn").'</span></td><td>';
|
||||
print '<!-- LDAP_GROUP_DN -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPGroupDn").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="group" value="'.$conf->global->LDAP_GROUP_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPGroupDnExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// List of object class used to define attributes in structure
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPGroupObjectClassList").'</span></td><td>';
|
||||
print '<!-- LDAP_GROUP_OBJECT_CLASS -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPGroupObjectClassList").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_GROUP_OBJECT_CLASS.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPGroupObjectClassListExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Filter, used to filter search
|
||||
print '<!-- LDAP_GROUP_FILTER -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
|
||||
print '<input size="48" type="text" name="filter" value="'.$conf->global->LDAP_GROUP_FILTER.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPGroupFilterExample").'</td>';
|
||||
@ -151,11 +154,13 @@ print '<td></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
|
||||
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -200,20 +200,23 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeMembers").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// DN Pour les adherents
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberDn").'</span></td><td>';
|
||||
print '<!-- LDAP_MEMBER_DN -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberDn").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="user" value="'.$conf->global->LDAP_MEMBER_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPMemberDnExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// List of object class used to define attributes in structure
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberObjectClassList").'</span></td><td>';
|
||||
print '<!-- LDAP_MEMBER_OBJECT_CLASS -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberObjectClassList").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_MEMBER_OBJECT_CLASS.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPMemberObjectClassListExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Filter, used to filter search
|
||||
print '<!-- LDAP_MEMBER_FILTER -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
|
||||
print '<input size="48" type="text" name="filterconnection" value="'.$conf->global->LDAP_MEMBER_FILTER.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td>';
|
||||
@ -225,7 +228,7 @@ print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
|
||||
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -124,25 +124,29 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeMembersTypes").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// DN pour les types de membres
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeDn").'</span></td><td>';
|
||||
print '<!-- LDAP_MEMBER_TYPE_DN -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeDn").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="membertype" value="'.$conf->global->LDAP_MEMBER_TYPE_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPMemberTypepDnExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// List of object class used to define attributes in structure
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeObjectClassList").'</span></td><td>';
|
||||
print '<!-- LDAP_MEMBER_TYPE_OBJECT_CLASS -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPMemberTypeObjectClassList").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_MEMBER_TYPE_OBJECT_CLASS.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPMemberTypeObjectClassListExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
|
||||
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -190,20 +190,23 @@ print '<td colspan="4">'.$langs->trans("LDAPSynchronizeUsers").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// DN Pour les utilisateurs
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPUserDn").'</span></td><td>';
|
||||
print '<!-- LDAP_USER_DN -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserDn").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="user" value="'.$conf->global->LDAP_USER_DN.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPUserDnExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// List of object class used to define attributes in structure
|
||||
print '<tr class="oddeven"><td width="25%"><span class="fieldrequired">'.$langs->trans("LDAPUserObjectClassList").'</span></td><td>';
|
||||
print '<!-- LDAP_USER_OBJECT_CLASS -->';
|
||||
print '<tr class="oddeven"><td><span class="fieldrequired">'.$langs->trans("LDAPUserObjectClassList").'</span></td><td>';
|
||||
print '<input size="48" type="text" name="objectclass" value="'.$conf->global->LDAP_USER_OBJECT_CLASS.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPUserObjectClassListExample").'</td>';
|
||||
print '<td> </td>';
|
||||
print '</tr>';
|
||||
|
||||
// Filter, used to filter search
|
||||
print '<!-- LDAP_FILTER_CONNECTION -->';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFilterConnection").'</td><td>';
|
||||
print '<input size="48" type="text" name="filterconnection" value="'.$conf->global->LDAP_FILTER_CONNECTION.'">';
|
||||
print '</td><td>'.$langs->trans("LDAPFilterConnectionExample").'</td>';
|
||||
@ -215,7 +218,7 @@ print '<br>';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="25%">'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td>'.$langs->trans("LDAPDolibarrMapping").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("LDAPLdapMapping").'</td>';
|
||||
print '<td class="right">'.$langs->trans("LDAPNamingAttribute").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -413,8 +413,8 @@ if ($action != 'create') {
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
*/
|
||||
print '<table class="border centpercent tableforfield">';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" value="'.GETPOST('label', 'alphanohtml').'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Email").'</td><td><input type="text" name="email" value="'.GETPOST('email', 'alphanohtml').'"></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" value="'.GETPOST('label', 'alphanohtml').'" autofocus></td></tr>';
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("Email").'</td><td><input type="text" name="email" value="'.GETPOST('email', 'alphanohtml').'"></td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Signature").'</td><td>';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('signature', GETPOST('signature'), '', 138, 'dolibarr_notes', 'In', true, true, empty($conf->global->FCKEDITOR_ENABLE_USERSIGN) ? 0 : 1, ROWS_4, '90%');
|
||||
@ -499,7 +499,7 @@ foreach ($object->fields as $key => $val) {
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], empty($search[$key]) ? '' : $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
} elseif (strpos($val['type'], 'integer:') === 0) {
|
||||
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||
print $object->showInputField($val, $key, empty($search[$key]) ? '' : $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||
} elseif (!preg_match('/^(date|timestamp)/', $val['type'])) {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(empty($search[$key]) ? '' : $search[$key]).'">';
|
||||
}
|
||||
|
||||
@ -175,6 +175,7 @@ $elementList = array();
|
||||
// We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']"
|
||||
$elementList = array();
|
||||
// Add all and none after the sort
|
||||
|
||||
$elementList['all'] = '-- '.dol_escape_htmltag($langs->trans("All")).' --';
|
||||
$elementList['none'] = '-- '.dol_escape_htmltag($langs->trans("None")).' --';
|
||||
$elementList['user'] = img_picto('', 'user', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToUser'));
|
||||
@ -824,7 +825,7 @@ if ($resql) {
|
||||
print '<td class="liste_titre"><input type="text" name="search_topic" value="'.dol_escape_htmltag($search_topic).'"></td>';
|
||||
} elseif ($value == 'type_template') {
|
||||
print '<td class="liste_titre center">';
|
||||
print $form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1);
|
||||
print $form->selectarray('search_type_template', $elementList, $search_type_template, 1, 0, 0, '', 0, 0, 0, '', 'minwidth150', 1, '', 0, 1);
|
||||
print '</td>';
|
||||
} elseif (!in_array($value, array('content', 'content_lines'))) {
|
||||
print '<td class="liste_titre"></td>';
|
||||
@ -1229,7 +1230,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
print '<input type="hidden" name="type_template" value="'.$obj->{$value}.'">';
|
||||
print $obj->{$value};
|
||||
} else {
|
||||
print $form->selectarray('type_template', $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''), 1, 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1, '', 0, 1);
|
||||
print $form->selectarray('type_template', $elementList, (!empty($obj->{$value}) ? $obj->{$value}:''), 1, 0, 0, '', 0, 0, 0, '', 'minwidth150', 1, '', 0, 1);
|
||||
}
|
||||
print '</td>';
|
||||
} elseif ($context == 'add' && in_array($value, array('topic', 'joinfiles', 'content', 'content_lines'))) {
|
||||
|
||||
@ -314,14 +314,14 @@ if ($conf->use_javascript_ajax) {
|
||||
$entry .= '<a class="editfielda marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
|
||||
$entry .= '<a class="marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
|
||||
$entry .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
|
||||
$entry .= ' ';
|
||||
$entry .= ' ';
|
||||
$entry .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
|
||||
$entry .= '</td></tr></table>';
|
||||
|
||||
$buttons = '<a class="editfielda marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit('default', 0, 'class="menuEdit" id="edit'.$menu['rowid'].'"').'</a> ';
|
||||
$buttons .= '<a class="marginleftonly marginrightonly" href="edit.php?menu_handler='.$menu_handler_to_search.'&action=create&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_edit_add('default').'</a> ';
|
||||
$buttons .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=delete&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_delete('default').'</a> ';
|
||||
$buttons .= ' ';
|
||||
$buttons .= ' ';
|
||||
$buttons .= '<a class="marginleftonly marginrightonly" href="index.php?menu_handler='.$menu_handler_to_search.'&action=up&token='.newToken().'&menuId='.$menu['rowid'].'">'.img_picto("Up", "1uparrow").'</a><a href="index.php?menu_handler='.$menu_handler_to_search.'&action=down&menuId='.$menu['rowid'].'">'.img_picto("Down", "1downarrow").'</a>';
|
||||
|
||||
$data[] = array(
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
* \brief Page to activate/disable all modules
|
||||
*/
|
||||
|
||||
if (!defined('CSRFCHECK_WITH_TOKEN')) {
|
||||
if (!defined('CSRFCHECK_WITH_TOKEN') && (empty($_GET['action']) || $_GET['action'] != 'reset')) { // We force security except to disable modules so we can do it if problem of a module
|
||||
define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
|
||||
}
|
||||
|
||||
@ -481,7 +481,9 @@ print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
|
||||
$deschelp = '';
|
||||
if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
$desc = $langs->trans("ModulesDesc", '{picto}');
|
||||
$desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}');
|
||||
$desc = str_replace('{picto}', img_picto('', 'switch_off'), $desc);
|
||||
$desc = str_replace('{picto2}', img_picto('', 'setup'), $desc);
|
||||
if (count($conf->modules) <= (empty($conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING) ? 1 : $conf->global->MAIN_MIN_NB_ENABLED_MODULE_FOR_WARNING)) { // If only minimal initial modules enabled
|
||||
$deschelp = '<div class="info hideonsmartphone">'.$desc."<br></div><br>\n";
|
||||
}
|
||||
@ -919,7 +921,6 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
if ($objMod->needUpdate) {
|
||||
$versionTitle = $langs->trans('ModuleUpdateAvailable').' : '.$objMod->lastVersion;
|
||||
print '<span class="badge badge-warning classfortooltip" title="'.dol_escape_htmltag($versionTitle).'">'.$versiontrans.'</span>';
|
||||
$foundoneexternalmodulewithupdate++;
|
||||
} else {
|
||||
print $versiontrans;
|
||||
}
|
||||
@ -937,6 +938,9 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
|
||||
print "</tr>\n";
|
||||
}
|
||||
if ($objMod->needUpdate) {
|
||||
$foundoneexternalmodulewithupdate++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'checklastversion') {
|
||||
@ -1245,7 +1249,13 @@ if ($mode == 'develop') {
|
||||
print '<div class="imgmaxheight50 logo_setup"></div>';
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("TryToUseTheModuleBuilder", $langs->transnoentitiesnoconv("ModuleBuilder")).'</td>';
|
||||
print '<td>'.$langs->trans("SeeTopRightMenu").'</td>';
|
||||
print '<td class="maxwidth300">';
|
||||
if (!empty($conf->modulebuilder->enabled)) {
|
||||
print $langs->trans("SeeTopRightMenu");
|
||||
} else {
|
||||
print '<span class="opacitymedium">'.$langs->trans("ModuleMustBeEnabledFirst", $langs->transnoentitiesnoconv("ModuleBuilder")).'</span>';
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
print '<tr class="oddeven" height="80">'."\n";
|
||||
|
||||
@ -91,6 +91,7 @@ print dol_get_fiche_head($head, 'services', '', -1, 'technic');
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("ListOfSupportedOauthProviders").'</span><br><br>';
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
$i = 0;
|
||||
@ -145,6 +146,7 @@ foreach ($list as $key) {
|
||||
}
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
|
||||
@ -230,7 +230,7 @@ if ($mode == 'setup' && $user->admin) {
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="setconst">';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -262,15 +262,15 @@ if ($mode == 'setup' && $user->admin) {
|
||||
print $langs->trans("NoAccessToken");
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print '<td width="50%">';
|
||||
// Links to delete/checks token
|
||||
if (is_object($tokenobj)) {
|
||||
//test on $storage->hasAccessToken($OAUTH_SERVICENAME) ?
|
||||
print '<a class="button" href="'.$urltodelete.'">'.$langs->trans('DeleteAccess').'</a><br>';
|
||||
print '<a class="button smallpaddingimp" href="'.$urltodelete.'">'.$langs->trans('DeleteAccess').'</a><br>';
|
||||
}
|
||||
// Request remote token
|
||||
if ($urltorenew) {
|
||||
print '<a class="button" href="'.$urltorenew.'">'.$langs->trans('RequestAccess').'</a><br>';
|
||||
print '<a class="button smallpaddingimp" href="'.$urltorenew.'">'.$langs->trans('RequestAccess').'</a><br>';
|
||||
}
|
||||
// Check remote access
|
||||
if ($urltocheckperms) {
|
||||
@ -330,6 +330,7 @@ if ($mode == 'setup' && $user->admin) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
if (!empty($driver)) {
|
||||
if ($submit_enabled) {
|
||||
@ -345,6 +346,7 @@ if ($mode == 'setup' && $user->admin) {
|
||||
if ($mode == 'test' && $user->admin) {
|
||||
print $langs->trans('PrintTestDesc'.$driver)."<br><br>\n";
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder centpercent">';
|
||||
if (!empty($driver)) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/modules/printing/'.$driver.'.modules.php';
|
||||
@ -364,11 +366,13 @@ if ($mode == 'test' && $user->admin) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
if ($mode == 'userconf' && $user->admin) {
|
||||
print $langs->trans('PrintUserConfDesc'.$driver)."<br><br>\n";
|
||||
|
||||
print '<div class="div-table-responsive">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<th>'.$langs->trans("User").'</th>';
|
||||
@ -395,6 +399,7 @@ if ($mode == 'userconf' && $user->admin) {
|
||||
print "</tr>\n";
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -371,17 +371,7 @@ print $formadmin->select_language($selected, 'PDF_USE_ALSO_LANGUAGE_CODE', 0, nu
|
||||
//}
|
||||
print '</td></tr>';
|
||||
|
||||
//Desc
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DESC');
|
||||
} else {
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
//Ref
|
||||
// Ref
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideRefOnPDF").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
@ -391,7 +381,17 @@ if ($conf->use_javascript_ajax) {
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
//Details
|
||||
// Desc
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDescOnPDF").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_HIDE_DESC');
|
||||
} else {
|
||||
print $form->selectyesno('MAIN_GENERATE_DOCUMENTS_HIDE_DESC', (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC)) ? $conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_DESC : 0, 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Details
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("HideDetailsOnPDF").'</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
|
||||
@ -78,7 +78,8 @@ $head = pdf_admin_prepare_head();
|
||||
|
||||
print dol_get_fiche_head($head, 'other', $langs->trans("other"), -1, 'pdf');
|
||||
|
||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $s)."</span><br>\n";
|
||||
$tooltiptext = '';
|
||||
print '<span class="opacitymedium">'.$form->textwithpicto($langs->trans("PDFOtherDesc"), $tooltiptext)."</span><br>\n";
|
||||
print "<br>\n";
|
||||
|
||||
print load_fiche_titre($langs->trans("Proposal"), '', '');
|
||||
@ -116,10 +117,11 @@ print '</td></tr>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
print '<br><div class="center">';
|
||||
print '<input class="button button-save" type="submit" name="save" value="'.$langs->trans("Save").'">';
|
||||
print '</div>';
|
||||
*/
|
||||
|
||||
print '</form>';
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/admin/perms.php
|
||||
* \ingroup core
|
||||
* \brief Page d'administration/configuration des permissions par defaut
|
||||
* \brief Page to setup default permissions of a new user
|
||||
*/
|
||||
|
||||
require '../main.inc.php';
|
||||
@ -64,6 +64,7 @@ if ($action == 'remove') {
|
||||
*/
|
||||
|
||||
$wikihelp = 'EN:Setup_Security|FR:Paramétrage_Sécurité|ES:Configuración_Seguridad';
|
||||
|
||||
llxHeader('', $langs->trans("DefaultRights"), $wikihelp);
|
||||
|
||||
print load_fiche_titre($langs->trans("SecuritySetup"), '', 'title_setup');
|
||||
@ -121,15 +122,15 @@ print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Module").'</td>';
|
||||
print '<td class="center">'.$langs->trans("Default").'</td>';
|
||||
print '<td class="center"> </td>';
|
||||
print '<td class="center" width="24"> </td>';
|
||||
print '<td>'.$langs->trans("Permissions").'</td>';
|
||||
if ($user->admin) {
|
||||
print '<td class="right">'.$langs->trans("ID").'</td>';
|
||||
print '<td class="right"></td>';
|
||||
}
|
||||
print '</tr>'."\n";
|
||||
|
||||
//print "xx".$conf->global->MAIN_USE_ADVANCED_PERMS;
|
||||
$sql = "SELECT r.id, r.libelle as label, r.module, r.module_position, r.perms, r.subperms, r.bydefault";
|
||||
$sql = "SELECT r.id, r.libelle as label, r.module, r.perms, r.subperms, r.module_position, r.bydefault";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."rights_def as r";
|
||||
$sql .= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous"
|
||||
$sql .= " AND r.entity = ".((int) $entity);
|
||||
@ -147,21 +148,32 @@ if ($result) {
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
// If line is for a module that doe snot existe anymore (absent of includes/module), we ignore it
|
||||
// If line is for a module that does not exist anymore (absent of includes/module), we ignore it
|
||||
if (empty($modules[$obj->module])) {
|
||||
$i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Save field module_position in database if value is still zero
|
||||
if (empty($obj->module_position)) {
|
||||
$objMod = $modules[$obj->module];
|
||||
|
||||
// Save field module_position in database if value is wrong
|
||||
if (empty($obj->module_position) || (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $obj->module_position < 100000)) {
|
||||
if (is_object($modules[$obj->module]) && ($modules[$obj->module]->module_position > 0)) {
|
||||
// TODO Define familyposition
|
||||
$family = (!empty($modules[$obj->module]->family_position) ? $modules[$obj->module]->family_position : '');
|
||||
//$familyposition = $modules[$obj->module]->family_position;
|
||||
$familyposition = 0;
|
||||
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $modules[$obj->module]->module_position).",";
|
||||
|
||||
$newmoduleposition = $modules[$obj->module]->module_position;
|
||||
|
||||
// Correct $newmoduleposition position for external modules
|
||||
$objMod = $modules[$obj->module];
|
||||
if (is_object($objMod) && $objMod->isCoreOrExternalModule() == 'external' && $newmoduleposition < 100000) {
|
||||
$newmoduleposition += 100000;
|
||||
}
|
||||
|
||||
$sqlupdate = 'UPDATE '.MAIN_DB_PREFIX."rights_def SET module_position = ".((int) $newmoduleposition).",";
|
||||
$sqlupdate .= " family_position = ".((int) $familyposition);
|
||||
$sqlupdate .= " WHERE module_position = 0 AND module = '".$db->escape($obj->module)."'";
|
||||
$sqlupdate .= " WHERE module_position = ".((int) $obj->module_position)." AND module = '".$db->escape($obj->module)."'";
|
||||
$db->query($sqlupdate);
|
||||
}
|
||||
}
|
||||
@ -203,12 +215,12 @@ if ($result) {
|
||||
print '</tr>'."\n";
|
||||
}
|
||||
|
||||
$perm_libelle = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $obj->label));
|
||||
|
||||
print '<!-- '.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : '').' -->'."\n";
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
// Picto and label of module
|
||||
print '<td class="maxwidthonsmartphone tdoverflowonsmartphone">';
|
||||
//print img_object('', $picto, 'class="pictoobjectwidth"').' '.$objMod->getName();
|
||||
print '</td>';
|
||||
|
||||
// Tick
|
||||
@ -235,11 +247,24 @@ if ($result) {
|
||||
}
|
||||
|
||||
// Permission and tick
|
||||
print '<td>'.$perm_libelle.'</td>';
|
||||
$permlabel = (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ($langs->trans("PermissionAdvanced".$obj->id) != ("PermissionAdvanced".$obj->id)) ? $langs->trans("PermissionAdvanced".$obj->id) : (($langs->trans("Permission".$obj->id) != ("Permission".$obj->id)) ? $langs->trans("Permission".$obj->id) : $langs->trans($obj->label)));
|
||||
print '<td>';
|
||||
print $permlabel;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
if (preg_match('/_advance$/', $obj->perms)) {
|
||||
print ' <span class="opacitymedium">('.$langs->trans("AdvancedModeOnly").')</span>';
|
||||
}
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
// Permission id
|
||||
if ($user->admin) {
|
||||
print '<td class="right"><span class="opacitymedium">'.$obj->id.'</span></td>';
|
||||
print '<td class="right">';
|
||||
$htmltext = $langs->trans("ID").': '.$obj->id;
|
||||
$htmltext .= '<br>'.$langs->trans("Permission").': user->rights->'.$obj->module.'->'.$obj->perms.($obj->subperms ? '->'.$obj->subperms : '');
|
||||
print $form->textwithpicto('', $htmltext);
|
||||
//print '<span class="opacitymedium">'.$obj->id.'</span>';
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
print '</tr>'."\n";
|
||||
@ -252,6 +277,12 @@ if ($result) {
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('insertExtraFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// End of page
|
||||
|
||||
@ -153,7 +153,7 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td class="titlefieldcreate">'.$langs->trans("Parameter").'</td>';
|
||||
print '<td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>";
|
||||
|
||||
|
||||
@ -39,9 +39,11 @@ if (!$user->admin) {
|
||||
// Allow/Disallow change to clear passwords once passwords are crypted
|
||||
$allow_disable_encryption = true;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'setgeneraterule') {
|
||||
if (!dolibarr_set_const($db, 'USER_PASSWORD_GENERATED', $_GET["value"], 'chaine', 0, '', $conf->entity)) {
|
||||
dol_print_error($db);
|
||||
@ -215,6 +217,7 @@ if (is_resource($handle)) {
|
||||
}
|
||||
asort($arrayhandler);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="2">'.$langs->trans("RuleForGeneratedPasswords").'</td>';
|
||||
@ -248,7 +251,7 @@ foreach ($arrayhandler as $key => $module) {
|
||||
} elseif ($tmp == 'NotConfigured') {
|
||||
print $langs->trans($tmp);
|
||||
} else {
|
||||
print $tmp;
|
||||
print '<span class="opacitymedium">'.$tmp.'</span>';
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
@ -266,6 +269,8 @@ foreach ($arrayhandler as $key => $module) {
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
|
||||
@ -273,45 +278,47 @@ print '</form>';
|
||||
if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
|
||||
$tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN);
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td colspan="3"> '.$langs->trans("PasswordPatternDesc").'</td>';
|
||||
print '<td colspan="2"> '.$langs->trans("PasswordPatternDesc").'</td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("MinLength")."</td>";
|
||||
print '<td colspan="2"><input type="number" value="'.$tabConf[0].'" id="minlenght" min="1"></td>';
|
||||
print '<td><input type="number" value="'.$tabConf[0].'" id="minlenght" min="1"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("NbMajMin")."</td>";
|
||||
print '<td colspan="2"><input type="number" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>';
|
||||
print '<td><input type="number" value="'.$tabConf[1].'" id="NbMajMin" min="0"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("NbNumMin")."</td>";
|
||||
print '<td colspan="2"><input type="number" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>';
|
||||
print '<td><input type="number" value="'.$tabConf[2].'" id="NbNumMin" min="0"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("NbSpeMin")."</td>";
|
||||
print '<td colspan="2"><input type="number" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>';
|
||||
print '<td><input type="number" value="'.$tabConf[3].'" id="NbSpeMin" min="0"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("NbIteConsecutive")."</td>";
|
||||
print '<td colspan="2"><input type="number" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>';
|
||||
print '<td><input type="number" value="'.$tabConf[4].'" id="NbIteConsecutive" min="0"></td>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.$langs->trans("NoAmbiCaracAutoGeneration")."</td>";
|
||||
print '<td colspan="2"><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>';
|
||||
print '<td><input type="checkbox" id="NoAmbiCaracAutoGeneration" '.($tabConf[5] ? "checked" : "").' min="0"> <span id="textcheckbox">'.($tabConf[5] ? $langs->trans("Activated") : $langs->trans("Disabled")).'</span></td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -180,10 +180,10 @@ if (!$defaultsyslogfacility) {
|
||||
if (!$defaultsyslogfile) {
|
||||
$defaultsyslogfile = 'dolibarr.log';
|
||||
}
|
||||
|
||||
if ($conf->global->MAIN_MODULE_MULTICOMPANY && $user->entity) {
|
||||
$optionmc = '';
|
||||
if (!empty($conf->global->MAIN_MODULE_MULTICOMPANY) && $user->entity) {
|
||||
print '<div class="error">'.$langs->trans("ContactSuperAdminForChange").'</div>';
|
||||
$option = 'disabled';
|
||||
$optionmc = 'disabled';
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ print '<input type="hidden" name="action" value="set">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Type").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print '<td class="right" colspan="2"><input type="submit" class="button" '.$option.' value="'.$langs->trans("Modify").'"></td>';
|
||||
print '<td class="right" colspan="2"><input type="submit" class="button" '.$optionmc.' value="'.$langs->trans("Modify").'"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($syslogModules as $moduleName) {
|
||||
@ -279,11 +279,11 @@ print '<input type="hidden" name="action" value="setlevel">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td>';
|
||||
print '<td class="right"><input type="submit" class="button" '.$option.' value="'.$langs->trans("Modify").'"></td>';
|
||||
print '<td class="right"><input type="submit" class="button" '.$optionmc.' value="'.$langs->trans("Modify").'"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven"><td width="140">'.$langs->trans("SyslogLevel").'</td>';
|
||||
print '<td colspan="2"><select class="flat" name="level" '.$option.'>';
|
||||
print '<td colspan="2"><select class="flat" name="level" '.$optionmc.'>';
|
||||
print '<option value="'.LOG_EMERG.'" '.($conf->global->SYSLOG_LEVEL == LOG_EMERG ? 'SELECTED' : '').'>LOG_EMERG ('.LOG_EMERG.')</option>';
|
||||
print '<option value="'.LOG_ALERT.'" '.($conf->global->SYSLOG_LEVEL == LOG_ALERT ? 'SELECTED' : '').'>LOG_ALERT ('.LOG_ALERT.')</option>';
|
||||
print '<option value="'.LOG_CRIT.'" '.($conf->global->SYSLOG_LEVEL == LOG_CRIT ? 'SELECTED' : '').'>LOG_CRIT ('.LOG_CRIT.')</option>';
|
||||
|
||||
@ -25,6 +25,8 @@
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
$langs->load("admin");
|
||||
|
||||
@ -35,6 +37,10 @@ if (!$user->admin) {
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'convert') {
|
||||
$sql = "ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
|
||||
$db->query($sql);
|
||||
@ -82,6 +88,7 @@ if (!$base) {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>#</td>';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td colspan="2">'.$langs->trans("Type").'</td>';
|
||||
print '<td>'.$langs->trans("Format").'</td>';
|
||||
@ -105,7 +112,18 @@ if (!$base) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a></td>';
|
||||
print '<td>'.($i+1).'</td>';
|
||||
print '<td><a href="dbtable.php?table='.$obj->Name.'">'.$obj->Name.'</a>';
|
||||
$tablename = preg_replace('/^'.MAIN_DB_PREFIX.'/', 'llx_', $obj->Name);
|
||||
if (dol_is_file(DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql')) {
|
||||
$img = "info";
|
||||
//print img_picto($langs->trans("ExternalModule"), $img);
|
||||
} else {
|
||||
$img = "info_black";
|
||||
//print DOL_DOCUMENT_ROOT.'/install/mysql/tables/'.$tablename.'.sql';
|
||||
print img_picto($langs->trans("ExternalModule"), $img, 'class="small"');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$obj->Engine.'</td>';
|
||||
if (isset($obj->Engine) && $obj->Engine == "MyISAM") {
|
||||
print '<td><a class="reposition" href="database-tables.php?action=convert&table='.$obj->Name.'">'.$langs->trans("Convert").' InnoDb</a></td>';
|
||||
@ -142,6 +160,8 @@ if (!$base) {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
|
||||
print '<td>#</td>';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>Nb of tuples</td>';
|
||||
print '<td>Nb index fetcher.</td>';
|
||||
@ -160,6 +180,7 @@ if (!$base) {
|
||||
while ($i < $num) {
|
||||
$row = $db->fetch_row($resql);
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.($i+1).'</td>';
|
||||
print '<td>'.$row[0].'</td>';
|
||||
print '<td class="right">'.$row[1].'</td>';
|
||||
print '<td class="right">'.$row[2].'</td>';
|
||||
@ -179,6 +200,7 @@ if (!$base) {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>#</td>';
|
||||
print '<td>'.$langs->trans("TableName").'</td>';
|
||||
print '<td>'.$langs->trans("NbOfRecord").'</td>';
|
||||
print "</tr>\n";
|
||||
@ -197,6 +219,7 @@ if (!$base) {
|
||||
}
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td>'.($i+1).'</td>';
|
||||
print '<td>'.$row[0].'</td>';
|
||||
print '<td>'.$count.'</td>';
|
||||
print '</tr>';
|
||||
|
||||
@ -309,57 +309,59 @@ print '<br>';
|
||||
|
||||
// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
|
||||
$configfileparameters = array(
|
||||
'dolibarr_main_url_root' => $langs->trans("URLRoot"),
|
||||
'?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
|
||||
'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"),
|
||||
'?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
|
||||
'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
|
||||
'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"),
|
||||
'separator1' => '',
|
||||
'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
|
||||
'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
|
||||
'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
|
||||
'dolibarr_main_db_type' => $langs->trans("DriverType"),
|
||||
'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
|
||||
'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
|
||||
'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
|
||||
'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
|
||||
'?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
|
||||
'separator2' => '',
|
||||
'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
|
||||
'?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"),
|
||||
'separator'=> '',
|
||||
'?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
|
||||
'?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
|
||||
'?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
|
||||
'?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
|
||||
'?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
|
||||
'?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
|
||||
'?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
|
||||
'?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
|
||||
'separator3' => '',
|
||||
'?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH',
|
||||
'?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
|
||||
'?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
|
||||
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
|
||||
'?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
|
||||
'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
|
||||
'?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
|
||||
'?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
|
||||
'?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'separator4' => '',
|
||||
'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
|
||||
'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups',
|
||||
'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
|
||||
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
|
||||
'?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
|
||||
'?dolibarr_strict_mode' => 'Strict mode is on/off',
|
||||
'?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
|
||||
'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
|
||||
'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"),
|
||||
'separator0' => '',
|
||||
'dolibarr_main_url_root' => $langs->trans("URLRoot"),
|
||||
'?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
|
||||
'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"),
|
||||
'?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
|
||||
'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
|
||||
'separator1' => '',
|
||||
'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
|
||||
'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
|
||||
'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
|
||||
'dolibarr_main_db_type' => $langs->trans("DriverType"),
|
||||
'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
|
||||
'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
|
||||
'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
|
||||
'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
|
||||
'?dolibarr_main_db_prefix' => $langs->trans("DatabasePrefix"),
|
||||
'dolibarr_main_db_readonly' => $langs->trans("ReadOnlyMode"),
|
||||
'separator2' => '',
|
||||
'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
|
||||
'?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"),
|
||||
'separator'=> '',
|
||||
'?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
|
||||
'?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
|
||||
'?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
|
||||
'?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
|
||||
'?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
|
||||
'?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
|
||||
'?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
|
||||
'?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
|
||||
'separator3' => '',
|
||||
'?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH',
|
||||
'?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
|
||||
'?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
|
||||
'?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
|
||||
'?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
|
||||
'?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
|
||||
'?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
|
||||
'?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
|
||||
'?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
|
||||
'?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
|
||||
'?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
|
||||
'?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
|
||||
'separator4' => '',
|
||||
'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups',
|
||||
'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
|
||||
'?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
|
||||
'?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
|
||||
'?dolibarr_strict_mode' => 'Strict mode is on/off',
|
||||
'?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
|
||||
);
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@ -400,8 +402,10 @@ foreach ($configfileparameters as $key => $value) {
|
||||
if (in_array($newkey, array('dolibarr_main_db_pass', 'dolibarr_main_auth_ldap_admin_pass'))) {
|
||||
if (empty($dolibarr_main_prod)) {
|
||||
print '<!-- '.${$newkey}.' -->';
|
||||
print showValueWithClipboardCPButton(${$newkey}, 0, '********');
|
||||
} else {
|
||||
print '**********';
|
||||
}
|
||||
print '**********';
|
||||
} elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
|
||||
print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
|
||||
} elseif ($newkey == 'dolibarr_main_document_root_alt') {
|
||||
@ -420,9 +424,14 @@ foreach ($configfileparameters as $key => $value) {
|
||||
}
|
||||
} elseif ($newkey == 'dolibarr_main_instance_unique_id') {
|
||||
//print $conf->file->instance_unique_id;
|
||||
global $dolibarr_main_cookie_cryptkey;
|
||||
$valuetoshow = ${$newkey} ? ${$newkey} : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey
|
||||
print $valuetoshow;
|
||||
global $dolibarr_main_cookie_cryptkey, $dolibarr_main_instance_unique_id;
|
||||
$valuetoshow = $dolibarr_main_instance_unique_id ? $dolibarr_main_instance_unique_id : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey
|
||||
if (empty($dolibarr_main_prod)) {
|
||||
print '<!-- '.${$newkey}.' -->';
|
||||
print showValueWithClipboardCPButton($valuetoshow, 0, '********');
|
||||
} else {
|
||||
print '**********';
|
||||
}
|
||||
if (empty($valuetoshow)) {
|
||||
print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id');
|
||||
}
|
||||
@ -441,6 +450,13 @@ foreach ($configfileparameters as $key => $value) {
|
||||
if (!empty($valuetoshow)) {
|
||||
print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
|
||||
}
|
||||
} elseif ($newkey == 'dolibarr_main_db_readonly') {
|
||||
print ${$newkey};
|
||||
|
||||
$valuetoshow = ${$newkey};
|
||||
if (!empty($valuetoshow)) {
|
||||
print img_warning($langs->trans('ReadOnlyMode', 1));
|
||||
}
|
||||
} else {
|
||||
print (empty(${$newkey}) ? '' : ${$newkey});
|
||||
}
|
||||
|
||||
@ -79,7 +79,12 @@ $file_list = array('missing' => array(), 'updated' => array());
|
||||
|
||||
// Local file to compare to
|
||||
$xmlshortfile = dol_sanitizeFileName(GETPOST('xmlshortfile', 'alpha') ? GETPOST('xmlshortfile', 'alpha') : 'filelist-'.DOL_VERSION.(empty($conf->global->MAIN_FILECHECK_LOCAL_SUFFIX) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_SUFFIX).'.xml'.(empty($conf->global->MAIN_FILECHECK_LOCAL_EXT) ? '' : $conf->global->MAIN_FILECHECK_LOCAL_EXT));
|
||||
|
||||
$xmlfile = DOL_DOCUMENT_ROOT.'/install/'.$xmlshortfile;
|
||||
if (!preg_match('/\.zip$/i', $xmlfile) && dol_is_file($xmlfile.'.zip')) {
|
||||
$xmlfile = $xmlfile.'.zip';
|
||||
}
|
||||
|
||||
// Remote file to compare to
|
||||
$xmlremote = GETPOST('xmlremote', 'alphanohtml');
|
||||
if (empty($xmlremote) && !empty($conf->global->MAIN_FILECHECK_URL)) {
|
||||
@ -150,6 +155,10 @@ if (GETPOST('target') == 'local') {
|
||||
}
|
||||
}
|
||||
$xml = simplexml_load_file($xmlfile);
|
||||
if ($xml === false) {
|
||||
print '<div class="warning">'.$langs->trans('XmlCorrupted').': '.$xmlfile.'</span>';
|
||||
$error++;
|
||||
}
|
||||
} else {
|
||||
print '<div class="warning">'.$langs->trans('XmlNotFound').': '.$xmlfile.'</span>';
|
||||
$error++;
|
||||
|
||||
@ -172,7 +172,8 @@ jQuery(document).ready(function() {
|
||||
var compphpstring;
|
||||
getphpurl = $.ajax({
|
||||
type: "GET",
|
||||
url: \''.DOL_URL_ROOT.'/index.php\',
|
||||
data: { token: \''.currentToken().'\' },
|
||||
url: \''.DOL_URL_ROOT.'/public/notice.php\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
/* crossDomain: true,*/
|
||||
@ -211,10 +212,11 @@ jQuery(document).ready(function() {
|
||||
var compcssstring;
|
||||
getcssurl = $.ajax({
|
||||
type: "GET",
|
||||
data: { token: \'notrequired\' },
|
||||
url: \''.DOL_URL_ROOT.'/includes/jquery/css/base/jquery-ui.css\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
/*crossDomain: true, */
|
||||
/* crossDomain: true, */
|
||||
success: function () {
|
||||
cachecssstring=getcssurl.getResponseHeader(\'Cache-Control\');
|
||||
/* alert(\'css:\'+getcssurl.getAllResponseHeaders()); */
|
||||
@ -250,10 +252,11 @@ jQuery(document).ready(function() {
|
||||
var compcssphpstring;
|
||||
getcssphpurl = $.ajax({
|
||||
type: "GET",
|
||||
data: { token: \''.currentToken().'\' },
|
||||
url: \''.DOL_URL_ROOT.'/theme/eldy/style.css.php\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
/*crossDomain: true,*/
|
||||
/* crossDomain: true,*/
|
||||
success: function () {
|
||||
cachecssphpstring=getcssphpurl.getResponseHeader(\'Cache-Control\');
|
||||
/* alert(\'cssphp:\'+getcssphpurl.getAllResponseHeaders()); */
|
||||
@ -289,10 +292,11 @@ jQuery(document).ready(function() {
|
||||
var compimgstring;
|
||||
getimgurl = $.ajax({
|
||||
type: "GET",
|
||||
data: { token: \'notrequired\' },
|
||||
url: \''.DOL_URL_ROOT.'/theme/eldy/img/help.png\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
/*crossDomain: true,*/
|
||||
/* crossDomain: true,*/
|
||||
success: function () {
|
||||
cacheimgstring=getimgurl.getResponseHeader(\'Cache-Control\');
|
||||
/* alert(\'img:\'+getimgurl.getAllResponseHeaders()); */
|
||||
@ -328,6 +332,7 @@ jQuery(document).ready(function() {
|
||||
var compjsstring;
|
||||
getjsurl = $.ajax({
|
||||
type: "GET",
|
||||
data: { token: \'notrequired\' },
|
||||
url: \''.DOL_URL_ROOT.'/core/js/lib_rare.js\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
@ -367,6 +372,7 @@ jQuery(document).ready(function() {
|
||||
var compjsphpstring;
|
||||
getjsphpurl = $.ajax({
|
||||
type: "GET",
|
||||
data: { token: \''.currentToken().'\' },
|
||||
url: \''.DOL_URL_ROOT.'/core/js/lib_head.js.php\',
|
||||
cache: false,
|
||||
/* async: false, */
|
||||
|
||||
@ -251,7 +251,7 @@ print '<br>';
|
||||
if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) {
|
||||
print '<strong>$dolibarr_main_db_pass</strong>: ';
|
||||
if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
|
||||
print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").' <span class="opacitymedium">('.$langs->trans("Recommanded").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')</span>';
|
||||
print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").' <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')</span>';
|
||||
//print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')</span>';
|
||||
} else {
|
||||
print img_picto('', 'tick').' '.$langs->trans("DatabasePasswordObfuscated");
|
||||
@ -267,7 +267,65 @@ if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) {
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup").' + '.$langs->trans("OtherSetup"), '', 'folder');
|
||||
|
||||
print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
|
||||
|
||||
|
||||
print '<strong>'.$langs->trans("UseCaptchaCode").'</strong>: ';
|
||||
print empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? '' : img_picto('', 'tick').' ';
|
||||
print yn(empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? 0 : 1);
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
||||
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
|
||||
print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1);
|
||||
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
|
||||
print ' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND')) {
|
||||
print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
|
||||
}
|
||||
}
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
$securityevent = new Events($db);
|
||||
$eventstolog = $securityevent->eventstolog;
|
||||
|
||||
print '<strong>'.$langs->trans("AuditedSecurityEvents").'</strong>: ';
|
||||
$out = '';
|
||||
if (!empty($eventstolog) && is_array($eventstolog)) {
|
||||
// Loop on each event type
|
||||
$i = 0;
|
||||
foreach ($eventstolog as $key => $arr) {
|
||||
if ($arr['id']) {
|
||||
$key = 'MAIN_LOGEVENTS_'.$arr['id'];
|
||||
$value = empty($conf->global->$key) ? '' : $conf->global->$key;
|
||||
if ($value) {
|
||||
if ($i > 0) {
|
||||
$out .= ', ';
|
||||
}
|
||||
$out .= '<span class="opacitymedium">'.$key.'</span>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print $out;
|
||||
}
|
||||
|
||||
if (empty($out)) {
|
||||
print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Security").' - '.$langs->transnoentities("Audit")).'<br>';
|
||||
}
|
||||
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
|
||||
|
||||
|
||||
//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
|
||||
print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_HASH_ALGO)." ";
|
||||
@ -290,13 +348,18 @@ if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
|
||||
}
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> <span class="opacitymedium">('.$langs->trans("Example").': static-ips-of-server - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_ALLOW_SVG_FILES_AS_IMAGES</strong> = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0 <span class="opacitymedium">('.$langs->trans("Recommanded").': 0)</span>' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES)."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommanded").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Recommanded").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
|
||||
print '<br>';
|
||||
|
||||
print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
|
||||
if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
|
||||
print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';
|
||||
@ -313,43 +376,6 @@ print "<br>";
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
||||
print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
|
||||
print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1);
|
||||
if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
|
||||
print ' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND')) {
|
||||
print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
|
||||
}
|
||||
}
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
$securityevent = new Events($db);
|
||||
$eventstolog = $securityevent->eventstolog;
|
||||
|
||||
print '<strong>'.$langs->trans("AuditedSecurityEvents").'</strong>: ';
|
||||
if (!empty($eventstolog) && is_array($eventstolog)) {
|
||||
// Loop on each event type
|
||||
$i = 0;
|
||||
foreach ($eventstolog as $key => $arr) {
|
||||
if ($arr['id']) {
|
||||
$key = 'MAIN_LOGEVENTS_'.$arr['id'];
|
||||
$value = empty($conf->global->$key) ? '' : $conf->global->$key;
|
||||
if ($value) {
|
||||
if ($i > 0) {
|
||||
print ', ';
|
||||
}
|
||||
print '<span class="opacitymedium">'.$key.'</span>';
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
print '<br>';
|
||||
} else {
|
||||
print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Audit")).'<br>';
|
||||
}
|
||||
|
||||
|
||||
// Modules/Applications
|
||||
|
||||
@ -400,7 +426,7 @@ if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) {
|
||||
print '<br>';
|
||||
}
|
||||
if (!empty($conf->api->enabled)) {
|
||||
print '<strong>API_ENDPOINT_RULES</strong> = '.(empty($conf->global->API_ENDPOINT_RULES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->API_ENDPOINT_RULES)."<br>\n";
|
||||
print '<strong>API_ENDPOINT_RULES</strong> = '.(empty($conf->global->API_ENDPOINT_RULES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' ('.$langs->trans("Example").': endpoint1:1,endpoint2:1,...)</span>' : $conf->global->API_ENDPOINT_RULES)."<br>\n";
|
||||
print '<br>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,19 +296,8 @@ if ($mode == 'overwrite') {
|
||||
print '</td><td>';
|
||||
print '<input type="text" class="quatrevingtpercent"'.$disablededit.' name="transvalue" id="transvalue" value="'.(!empty($transvalue) ? $transvalue : "").'">';
|
||||
print '</td>';
|
||||
// Limit to superadmin
|
||||
/*if (! empty($conf->multicompany->enabled) && !$user->entity)
|
||||
{
|
||||
print '<td>';
|
||||
print '<input type="text" class="flat" size="1" name="entity" value="'.$conf->entity.'">';
|
||||
print '</td>';
|
||||
print '<td class="center">';
|
||||
}
|
||||
else
|
||||
{*/
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
//}
|
||||
print '<td class="center">';
|
||||
print '<input type="hidden" name="entity" value="'.$conf->entity.'">';
|
||||
print '<input type="submit" class="button"'.$disabled.' value="'.$langs->trans("Add").'" name="add" title="'.dol_escape_htmltag($langs->trans("YouMustEnabledTranslationOverwriteBefore")).'">';
|
||||
print "</td>\n";
|
||||
print '</tr>';
|
||||
@ -500,7 +489,7 @@ if ($mode == 'searchkey') {
|
||||
//}
|
||||
print '</td>';
|
||||
// Action column
|
||||
print '<td class="nowrap right">';
|
||||
print '<td class="nowraponall">';
|
||||
$searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0, 'checkforselect', 1);
|
||||
print $searchpicto;
|
||||
print '</td>';
|
||||
|
||||
@ -109,6 +109,7 @@ if ($action == 'set_default') {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
@ -267,7 +268,7 @@ foreach ($dirmodels as $reldir) {
|
||||
|
||||
// Defaut
|
||||
print '<td class="center">';
|
||||
if ($conf->global->USER_ADDON_PDF == $name) {
|
||||
if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) {
|
||||
print img_picto($langs->trans("Default"), 'on');
|
||||
} else {
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.$name.'&scandir='.$module->scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
|
||||
|
||||
@ -1013,7 +1013,7 @@ class Setup extends DolibarrApi
|
||||
$list[$tab->elementtype][$tab->name]['computed'] = $tab->fieldcomputed;
|
||||
$list[$tab->elementtype][$tab->name]['unique'] = $tab->fieldunique;
|
||||
$list[$tab->elementtype][$tab->name]['required'] = $tab->fieldrequired;
|
||||
$list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? unserialize($tab->param) : '');
|
||||
$list[$tab->elementtype][$tab->name]['param'] = ($tab->param ? jsonOrUnserialize($tab->param) : ''); // This may be a string encoded with serialise() or json_encode()
|
||||
$list[$tab->elementtype][$tab->name]['pos'] = $tab->pos;
|
||||
$list[$tab->elementtype][$tab->name]['alwayseditable'] = $tab->alwayseditable;
|
||||
$list[$tab->elementtype][$tab->name]['perms'] = $tab->perms;
|
||||
|
||||
@ -305,21 +305,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
{
|
||||
jQuery("#myid").removeAttr(\'disabled\');
|
||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
$param = '';
|
||||
|
||||
@ -70,8 +70,13 @@ $permissionnote = 1;
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
}
|
||||
|
||||
/*
|
||||
* View
|
||||
|
||||
@ -613,8 +613,10 @@ jQuery(document).ready(function () {
|
||||
var fk_block = $(this).attr("data-blockid");
|
||||
|
||||
$.ajax({
|
||||
url:"../ajax/block-info.php?id="+fk_block
|
||||
,dataType:"html"
|
||||
method: "GET",
|
||||
data: { token: \''.currentToken().'\' },
|
||||
url: "'.DOL_URL_ROOT.'/blockedlog/ajax/block-info.php?id="+fk_block,
|
||||
dataType: "html"
|
||||
}).done(function(data) {
|
||||
jQuery("#dialogforpopup").html(data);
|
||||
});
|
||||
@ -630,10 +632,11 @@ if (!empty($conf->global->BLOCKEDLOG_USE_REMOTE_AUTHORITY) && !empty($conf->glob
|
||||
<script type="text/javascript">
|
||||
|
||||
$.ajax({
|
||||
url : "<?php echo dol_buildpath('/blockedlog/ajax/check_signature.php', 1) ?>"
|
||||
,dataType:"html"
|
||||
method: "GET",
|
||||
data: { token: '<?php echo currentToken() ?>' },
|
||||
url: '<?php echo DOL_URL_ROOT.'/blockedlog/ajax/check_signature.php' ?>',
|
||||
dataType: 'html'
|
||||
}).done(function(data) {
|
||||
|
||||
if(data == 'hashisok') {
|
||||
$('#blockchainstatus').html('<?php echo $langs->trans('AuthorityReconizeFingerprintConformity').' '.img_picto($langs->trans('SignatureOK'), 'on') ?>');
|
||||
}
|
||||
|
||||
@ -777,10 +777,8 @@ class BlockedLog
|
||||
public function dolDecodeBlockedData($data, $mode = 0)
|
||||
{
|
||||
try {
|
||||
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
//include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
$aaa = unserialize($data);
|
||||
//$aaa = unserialize($data);
|
||||
} catch (Exception $e) {
|
||||
//print $e->getErrs);
|
||||
}
|
||||
|
||||
@ -244,22 +244,6 @@ $title = $langs->trans('BOM');
|
||||
$help_url ='EN:Module_BOM';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
// Example : Adding jquery code
|
||||
print '<script type="text/javascript" language="javascript">
|
||||
jQuery(document).ready(function() {
|
||||
function init_myfunc()
|
||||
{
|
||||
jQuery("#myid").removeAttr(\'disabled\');
|
||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
||||
}
|
||||
init_myfunc();
|
||||
jQuery("#mybutton").click(function() {
|
||||
init_myfunc();
|
||||
});
|
||||
});
|
||||
</script>';
|
||||
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("NewBOM"), '', 'bom');
|
||||
@ -548,10 +532,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
*/
|
||||
|
||||
if (!empty($object->table_element_line)) {
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '').'" method="POST">
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '').'" method="POST">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="page_y" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">
|
||||
';
|
||||
|
||||
|
||||
@ -83,6 +83,10 @@ foreach ($object->fields as $key => $val) {
|
||||
if (GETPOST('search_'.$key, 'alpha') !== '') {
|
||||
$search[$key] = GETPOST('search_'.$key, 'alpha');
|
||||
}
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
|
||||
$search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
|
||||
}
|
||||
}
|
||||
|
||||
// List of fields to search into when doing a "search in all"
|
||||
@ -93,27 +97,24 @@ foreach ($object->fields as $key => $val) {
|
||||
}
|
||||
}
|
||||
|
||||
// Definition of fields for list
|
||||
// Definition of array of fields for columns
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) {
|
||||
$arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']);
|
||||
$visible = (int) dol_eval($val['visible'], 1);
|
||||
$arrayfields['t.'.$key] = array(
|
||||
'label'=>$val['label'],
|
||||
'checked'=>(($visible < 0) ? 0 : 1),
|
||||
'enabled'=>($visible != 3 && dol_eval($val['enabled'], 1)),
|
||||
'position'=>$val['position'],
|
||||
'help'=> isset($val['help']) ? $val['help'] : ''
|
||||
);
|
||||
}
|
||||
}
|
||||
// Extra fields
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label']) > 0) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
if (!empty($extrafields->attributes[$object->table_element]['list'][$key])) {
|
||||
$arrayfields["ef.".$key] = array(
|
||||
'label'=>$extrafields->attributes[$object->table_element]['label'][$key],
|
||||
'checked'=>(($extrafields->attributes[$object->table_element]['list'][$key] < 0) ? 0 : 1),
|
||||
'position'=>$extrafields->attributes[$object->table_element]['pos'][$key],
|
||||
'enabled'=>(abs($extrafields->attributes[$object->table_element]['list'][$key]) != 3 && $extrafields->attributes[$object->table_element]['perms'][$key])
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$object->fields = dol_sort_array($object->fields, 'position');
|
||||
$arrayfields = dol_sort_array($arrayfields, 'position');
|
||||
|
||||
@ -134,7 +135,8 @@ $result = restrictedArea($user, 'bom');
|
||||
*/
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
$action = 'list'; $massaction = '';
|
||||
$action = 'list';
|
||||
$massaction = '';
|
||||
}
|
||||
if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
|
||||
$massaction = '';
|
||||
@ -154,8 +156,12 @@ if (empty($reshook)) {
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$search[$key] = '';
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
$search[$key.'_dtstart'] = '';
|
||||
$search[$key.'_dtend'] = '';
|
||||
}
|
||||
}
|
||||
$toselect = '';
|
||||
$toselect = array();
|
||||
$search_array_options = array();
|
||||
}
|
||||
if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
|
||||
@ -279,22 +285,19 @@ $form = new Form($db);
|
||||
$now = dol_now();
|
||||
|
||||
$help_url = 'EN:Module_BOM';
|
||||
|
||||
$title = $langs->trans('ListOfBOMs');
|
||||
|
||||
llxHeader('', $title, $help_url);
|
||||
$morejs = array();
|
||||
$morecss = array();
|
||||
|
||||
|
||||
// Build and execute select
|
||||
// --------------------------------------------------------------------
|
||||
$sql = 'SELECT ';
|
||||
foreach ($object->fields as $key => $val) {
|
||||
$sql .= 't.'.$key.', ';
|
||||
}
|
||||
$sql .= $object->getFieldList('t');
|
||||
// Add fields from extrafields
|
||||
if (!empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key.', ' : '');
|
||||
}
|
||||
}
|
||||
// Add fields from hooks
|
||||
@ -303,33 +306,52 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $obje
|
||||
$sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
|
||||
$sql = preg_replace('/,\s*$/', '', $sql);
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
|
||||
if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
|
||||
}
|
||||
// Add table from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
if ($object->ismultientitymanaged == 1) {
|
||||
$sql .= " WHERE t.entity IN (".getEntity($object->element).")";
|
||||
} else {
|
||||
$sql .= " WHERE 1 = 1";
|
||||
}
|
||||
foreach ($search as $key => $val) {
|
||||
if ($key == 'status' && $search[$key] == -1) {
|
||||
continue;
|
||||
}
|
||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||
if (strpos($object->fields[$key]['type'], 'integer:') === 0) {
|
||||
if ($search[$key] == '-1') {
|
||||
$search[$key] = '';
|
||||
if (array_key_exists($key, $object->fields)) {
|
||||
if ($key == 'status' && $search[$key] == -1) {
|
||||
continue;
|
||||
}
|
||||
$mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
|
||||
if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
|
||||
if ($search[$key] == '-1' || $search[$key] === '0') {
|
||||
$search[$key] = '';
|
||||
}
|
||||
$mode_search = 2;
|
||||
}
|
||||
if ($search[$key] != '') {
|
||||
$sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
} else {
|
||||
if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
|
||||
$columnName=preg_replace('/(_dtstart|_dtend)$/', '', $key);
|
||||
if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
|
||||
if (preg_match('/_dtstart$/', $key)) {
|
||||
$sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'";
|
||||
}
|
||||
if (preg_match('/_dtend$/', $key)) {
|
||||
$sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
|
||||
}
|
||||
}
|
||||
}
|
||||
$mode_search = 2;
|
||||
}
|
||||
if ($search[$key] != '') {
|
||||
$sql .= natural_search($key, $search[$key], (($key == 'status') ? 2 : $mode_search));
|
||||
}
|
||||
}
|
||||
|
||||
if ($search_all) {
|
||||
$sql .= natural_search(array_keys($fieldstosearchall), $search_all);
|
||||
}
|
||||
//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
|
||||
// Add where from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
|
||||
// Add where from hooks
|
||||
@ -338,18 +360,20 @@ $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $objec
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
/* If a group by is required
|
||||
$sql.= " GROUP BY "
|
||||
$sql.= " GROUP BY ";
|
||||
foreach($object->fields as $key => $val)
|
||||
{
|
||||
$sql.='t.'.$key.', ';
|
||||
}
|
||||
// Add fields from extrafields
|
||||
if (! empty($extrafields->attributes[$object->table_element]['label'])) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||
foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
|
||||
$sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
|
||||
}
|
||||
}
|
||||
// Add where from hooks
|
||||
$parameters=array();
|
||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook
|
||||
$reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$sql.=$hookmanager->resPrint;
|
||||
$sql=preg_replace('/,\s*$/','', $sql);
|
||||
*/
|
||||
@ -395,7 +419,7 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
||||
// Output page
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
// llxHeader('', $title, $help_url);
|
||||
llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', '');
|
||||
|
||||
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||
|
||||
@ -420,6 +444,10 @@ if ($optioncss != '') {
|
||||
}
|
||||
// Add $param from extra fields
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
|
||||
// Add $param from hooks
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
$param .= $hookmanager->resPrint;
|
||||
|
||||
// List of mass actions available
|
||||
$arrayofmassactions = array(
|
||||
@ -435,7 +463,7 @@ if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'pr
|
||||
}
|
||||
$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
|
||||
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
|
||||
if ($optioncss != '') {
|
||||
print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
|
||||
}
|
||||
@ -444,11 +472,12 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="action" value="list">';
|
||||
print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
|
||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||
print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/bom/bom_card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $user->rights->bom->write);
|
||||
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'bom', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
// Add code for pre mass action (confirmation or email presend form)
|
||||
$topicmail = "SendBillOfMaterialsRef";
|
||||
@ -508,11 +537,18 @@ foreach ($object->fields as $key => $val) {
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
|
||||
if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], $search[$key], $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth150', 1);
|
||||
} elseif (strpos($val['type'], 'integer:') === 0) {
|
||||
print $object->showInputField($val, $key, $search[$key], '', '', 'search_', 'maxwidth150', 1);
|
||||
} elseif (!preg_match('/^(date|timestamp)/', $val['type'])) {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag($search[$key]).'">';
|
||||
print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
|
||||
} elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
|
||||
print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
|
||||
} elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
|
||||
} elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
|
||||
print '</div>';
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
@ -563,7 +599,7 @@ print '</tr>'."\n";
|
||||
|
||||
// Detect if we need a fetch on each output line
|
||||
$needToFetchEachLine = 0;
|
||||
if (is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||
if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
|
||||
foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
|
||||
if (preg_match('/\$object/', $val)) {
|
||||
$needToFetchEachLine++; // There is at least one compute field that use $object
|
||||
@ -576,6 +612,7 @@ if (is_array($extrafields->attributes[$object->table_element]['computed']) && co
|
||||
// --------------------------------------------------------------------
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (empty($obj)) {
|
||||
@ -601,17 +638,16 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
|
||||
}
|
||||
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'status' && empty($val['arrayofkeyval'])) {
|
||||
if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
|
||||
$cssforfield .= ($cssforfield ? ' ' : '').'right';
|
||||
}
|
||||
if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) {
|
||||
$cssforfield = 'tdoverflowmax100';
|
||||
}
|
||||
|
||||
if (!empty($arrayfields['t.'.$key]['checked'])) {
|
||||
print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '').'>';
|
||||
if ($key == 'status') {
|
||||
print $object->getLibStatut(5);
|
||||
} elseif ($key == 'rowid') {
|
||||
print $object->showOutputField($val, $key, $object->id, '');
|
||||
} else {
|
||||
print $object->showOutputField($val, $key, $object->$key, '');
|
||||
}
|
||||
|
||||
@ -70,7 +70,13 @@ restrictedArea($user, 'bom', $object->id, 'bom_bom', '', '', 'rowid', $isdraft);
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -26,6 +26,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php';
|
||||
//require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||
//require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php';
|
||||
|
||||
|
||||
/**
|
||||
* Class for BOM
|
||||
*/
|
||||
@ -96,23 +97,23 @@ class BOM extends CommonObject
|
||||
'rowid' => array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-1, 'position'=>1, 'notnull'=>1, 'index'=>1, 'comment'=>"Id",),
|
||||
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
|
||||
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1),
|
||||
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'),
|
||||
'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
|
||||
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500'),
|
||||
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'),
|
||||
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
|
||||
'qty' => array('type'=>'real', 'label'=>'Quantity', 'enabled'=>1, 'visible'=>1, 'default'=>1, 'position'=>55, 'notnull'=>1, 'isameasure'=>'1', 'css'=>'maxwidth75imp'),
|
||||
//'efficiency' => array('type'=>'real', 'label'=>'ManufacturingEfficiency', 'enabled'=>1, 'visible'=>-1, 'default'=>1, 'position'=>100, 'notnull'=>0, 'css'=>'maxwidth50imp', 'help'=>'ValueOfMeansLossForProductProduced'),
|
||||
'duration' => array('type'=>'duration', 'label'=>'EstimatedDuration', 'enabled'=>1, 'visible'=>-1, 'position'=>101, 'notnull'=>-1, 'css'=>'maxwidth50imp', 'help'=>'EstimatedDurationDesc'),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>-1, 'position'=>102, 'css'=>'maxwidth500'),
|
||||
'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php:0', 'label'=>'WarehouseForProduction', 'picto'=>'stock', 'enabled'=>1, 'visible'=>-1, 'position'=>102, 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'),
|
||||
'note_public' => array('type'=>'html', 'label'=>'NotePublic', 'enabled'=>1, 'visible'=>-2, 'position'=>161, 'notnull'=>-1,),
|
||||
'note_private' => array('type'=>'html', 'label'=>'NotePrivate', 'enabled'=>1, 'visible'=>-2, 'position'=>162, 'notnull'=>-1,),
|
||||
'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'enabled'=>1, 'visible'=>-2, 'position'=>300, 'notnull'=>1,),
|
||||
'tms' => array('type'=>'timestamp', 'label'=>'DateModification', 'enabled'=>1, 'visible'=>-2, 'position'=>501, 'notnull'=>1,),
|
||||
'date_valid' => array('type'=>'datetime', 'label'=>'DateValidation', 'enabled'=>1, 'visible'=>-2, 'position'=>502, 'notnull'=>0,),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid',),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1,),
|
||||
'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0,),
|
||||
'fk_user_creat' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserCreation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>510, 'notnull'=>1, 'foreignkey'=>'user.rowid', 'csslist'=>'tdoverflowmax100'),
|
||||
'fk_user_modif' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserModif', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>511, 'notnull'=>-1, 'csslist'=>'tdoverflowmax100'),
|
||||
'fk_user_valid' => array('type'=>'integer:User:user/class/user.class.php', 'label'=>'UserValidation', 'picto'=>'user', 'enabled'=>1, 'visible'=>-2, 'position'=>512, 'notnull'=>0, 'csslist'=>'tdoverflowmax100'),
|
||||
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>1000, 'notnull'=>-1,),
|
||||
'model_pdf' =>array('type'=>'varchar(255)', 'label'=>'Model pdf', 'enabled'=>1, 'visible'=>0, 'position'=>1010),
|
||||
'status' => array('type'=>'integer', 'label'=>'Status', 'enabled'=>1, 'visible'=>2, 'position'=>1000, 'notnull'=>1, 'default'=>0, 'index'=>1, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Enabled', 9=>'Disabled')),
|
||||
@ -785,8 +786,11 @@ class BOM extends CommonObject
|
||||
}
|
||||
$label .= '<br>';
|
||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||
if (isset($this->label)) {
|
||||
$label .= '<br><b>'.$langs->trans('Label').':</b> '.$this->label;
|
||||
}
|
||||
|
||||
$url = dol_buildpath('/bom/bom_card.php', 1).'?id='.$this->id;
|
||||
$url = DOL_URL_ROOT.'/bom/bom_card.php?id='.$this->id;
|
||||
|
||||
if ($option != 'nolink') {
|
||||
// Add param to save lastsearch_values or not
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Matthieu Valleton <mv@seeschloss.org>
|
||||
* Copyright (C) 2006-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2021 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
|
||||
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
|
||||
@ -257,6 +257,7 @@ if ($user->rights->categorie->creer) {
|
||||
|
||||
// Parent category
|
||||
print '<tr><td>'.$langs->trans("AddIn").'</td><td>';
|
||||
print img_picto($langs->trans("ParentCategory"), 'category', 'class="pictofixedwidth"');
|
||||
print $form->select_all_categories($type, $catorigin, 'parent');
|
||||
print ajax_combobox('parent');
|
||||
print '</td></tr>';
|
||||
|
||||
@ -263,15 +263,16 @@ class Categorie extends CommonObject
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('constructCategory', $parameters, $this); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook >= 0 && !empty($hookmanager->resArray)) {
|
||||
$mapList = $hookmanager->resArray;
|
||||
$mapId = $mapList['id'];
|
||||
$mapCode = $mapList['code'];
|
||||
self::$MAP_ID_TO_CODE[$mapId] = $mapCode;
|
||||
$this->MAP_ID[$mapCode] = $mapId;
|
||||
$this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk'];
|
||||
$this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table'];
|
||||
$this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class'];
|
||||
$this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table'];
|
||||
foreach ($hookmanager->resArray as $mapList) {
|
||||
$mapId = $mapList['id'];
|
||||
$mapCode = $mapList['code'];
|
||||
self::$MAP_ID_TO_CODE[$mapId] = $mapCode;
|
||||
$this->MAP_ID[$mapCode] = $mapId;
|
||||
$this->MAP_CAT_FK[$mapCode] = $mapList['cat_fk'];
|
||||
$this->MAP_CAT_TABLE[$mapCode] = $mapList['cat_table'];
|
||||
$this->MAP_OBJ_CLASS[$mapCode] = $mapList['obj_class'];
|
||||
$this->MAP_OBJ_TABLE[$mapCode] = $mapList['obj_table'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1497,7 +1498,10 @@ class Categorie extends CommonObject
|
||||
} else {
|
||||
$sql = "SELECT ct.fk_categorie, c.label, c.rowid";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."categorie_".(empty($this->MAP_CAT_TABLE[$type]) ? $type : $this->MAP_CAT_TABLE[$type])." as ct, ".MAIN_DB_PREFIX."categorie as c";
|
||||
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id." AND c.type = ".$this->MAP_ID[$type];
|
||||
$sql .= " WHERE ct.fk_categorie = c.rowid AND ct.fk_".(empty($this->MAP_CAT_FK[$type]) ? $type : $this->MAP_CAT_FK[$type])." = ".(int) $id;
|
||||
// This seems useless because the table already contains id of category of 1 unique type. So commented.
|
||||
// So now it works also with external added categories.
|
||||
//$sql .= " AND c.type = ".$this->MAP_ID[$type];
|
||||
$sql .= " AND c.entity IN (".getEntity('category').")";
|
||||
|
||||
$res = $this->db->query($sql);
|
||||
|
||||
@ -382,6 +382,7 @@ class ActionComm extends CommonObject
|
||||
*/
|
||||
const EVENT_FINISHED = 100;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -738,6 +739,11 @@ class ActionComm extends CommonObject
|
||||
{
|
||||
global $langs;
|
||||
|
||||
if (empty($id) && empty($ref) && empty($ref_ext) && empty($email_msgid)) {
|
||||
dol_syslog(get_class($this)."::fetch Bad parameters", LOG_WARNING);
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "SELECT a.id,";
|
||||
$sql .= " a.ref as ref,";
|
||||
$sql .= " a.entity,";
|
||||
@ -747,7 +753,7 @@ class ActionComm extends CommonObject
|
||||
$sql .= " a.durationp,"; // deprecated
|
||||
$sql .= " a.datec,";
|
||||
$sql .= " a.tms as datem,";
|
||||
$sql .= " a.code, a.label, a.note,";
|
||||
$sql .= " a.code, a.label, a.note as note_private,";
|
||||
$sql .= " a.fk_soc,";
|
||||
$sql .= " a.fk_project,";
|
||||
$sql .= " a.fk_user_author, a.fk_user_mod,";
|
||||
@ -806,8 +812,8 @@ class ActionComm extends CommonObject
|
||||
$this->datec = $this->db->jdate($obj->datec);
|
||||
$this->datem = $this->db->jdate($obj->datem);
|
||||
|
||||
$this->note = $obj->note; // deprecated
|
||||
$this->note_private = $obj->note;
|
||||
$this->note = $obj->note_private; // deprecated
|
||||
$this->note_private = $obj->note_private;
|
||||
$this->percentage = $obj->percentage;
|
||||
|
||||
$this->authorid = $obj->fk_user_author;
|
||||
@ -1817,7 +1823,7 @@ class ActionComm extends CommonObject
|
||||
$sql .= " a.datep2,"; // End
|
||||
$sql .= " a.durationp,"; // deprecated
|
||||
$sql .= " a.datec, a.tms as datem,";
|
||||
$sql .= " a.label, a.code, a.note, a.fk_action as type_id,";
|
||||
$sql .= " a.label, a.code, a.note as note_private, a.fk_action as type_id,";
|
||||
$sql .= " a.fk_soc,";
|
||||
$sql .= " a.fk_user_author, a.fk_user_mod,";
|
||||
$sql .= " a.fk_user_action,";
|
||||
@ -1945,7 +1951,7 @@ class ActionComm extends CommonObject
|
||||
$duration = ($datestart && $dateend) ? ($dateend - $datestart) : 0;
|
||||
$event['summary'] = $obj->label.($obj->socname ? " (".$obj->socname.")" : "");
|
||||
|
||||
$event['desc'] = $obj->note;
|
||||
$event['desc'] = $obj->note_private;
|
||||
$event['startdate'] = $datestart;
|
||||
$event['enddate'] = $dateend; // Not required with type 'journal'
|
||||
$event['duration'] = $duration; // Not required with type 'journal'
|
||||
|
||||
@ -138,16 +138,18 @@ if (empty($action) && !GETPOSTISSET('action')) {
|
||||
if ($action == 'default') { // When action is default, we want a calendar view and not the list
|
||||
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
||||
}
|
||||
if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
|
||||
if (GETPOST('viewcal', 'int') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
|
||||
$action = 'show_month'; $day = '';
|
||||
} // View by month
|
||||
if (GETPOST('viewweek', 'restricthtml') || GETPOST('action', 'alpha') == 'show_week') {
|
||||
if (GETPOST('viewweek', 'int') || GETPOST('action', 'alpha') == 'show_week') {
|
||||
$action = 'show_week'; $week = ($week ? $week : date("W")); $day = ($day ? $day : date("d"));
|
||||
} // View by week
|
||||
if (GETPOST('viewday', 'restricthtml') || GETPOST('action', 'alpha') == 'show_day') {
|
||||
if (GETPOST('viewday', 'int') || GETPOST('action', 'alpha') == 'show_day') {
|
||||
$action = 'show_day'; $day = ($day ? $day : date("d"));
|
||||
} // View by day
|
||||
|
||||
$object = new ActionComm($db);
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('agenda', 'other', 'commercial'));
|
||||
|
||||
@ -197,6 +199,7 @@ if (GETPOST("viewperuser", 'alpha') || $action == 'show_peruser') {
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
if ($action == 'delete_action') {
|
||||
$event = new ActionComm($db);
|
||||
$event->fetch($actionid);
|
||||
@ -206,6 +209,7 @@ if ($action == 'delete_action') {
|
||||
|
||||
$result = $event->delete();
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
@ -363,9 +367,9 @@ if ($action == 'show_day') {
|
||||
//print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour');
|
||||
|
||||
/*$title = $langs->trans("DoneAndToDoActions");
|
||||
if ($status == 'done') $title = $langs->trans("DoneActions");
|
||||
if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
||||
*/
|
||||
if ($status == 'done') $title = $langs->trans("DoneActions");
|
||||
if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
||||
*/
|
||||
|
||||
$param = '';
|
||||
if ($actioncode || GETPOSTISSET('search_actioncode')) {
|
||||
@ -454,13 +458,13 @@ $param .= '&year='.$year.'&month='.$month.($day ? '&day='.$day : '');
|
||||
|
||||
|
||||
/*$tabactive = '';
|
||||
if ($action == 'show_month') $tabactive = 'cardmonth';
|
||||
if ($action == 'show_week') $tabactive = 'cardweek';
|
||||
if ($action == 'show_day') $tabactive = 'cardday';
|
||||
if ($action == 'show_list') $tabactive = 'cardlist';
|
||||
if ($action == 'show_pertuser') $tabactive = 'cardperuser';
|
||||
if ($action == 'show_pertype') $tabactive = 'cardpertype';
|
||||
*/
|
||||
if ($action == 'show_month') $tabactive = 'cardmonth';
|
||||
if ($action == 'show_week') $tabactive = 'cardweek';
|
||||
if ($action == 'show_day') $tabactive = 'cardday';
|
||||
if ($action == 'show_list') $tabactive = 'cardlist';
|
||||
if ($action == 'show_pertuser') $tabactive = 'cardperuser';
|
||||
if ($action == 'show_pertype') $tabactive = 'cardpertype';
|
||||
*/
|
||||
|
||||
$paramnoaction = preg_replace('/action=[a-z_]+/', '', $param);
|
||||
$paramnoactionodate = preg_replace('/action=[a-z_]+/', '', $paramnodate);
|
||||
@ -484,32 +488,30 @@ $viewmode .= img_picto($langs->trans("List"), 'object_list', 'class="pictoaction
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewList").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_month' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_month&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewCal"), 'object_calendarmonth', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewCal").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_week' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_week&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewWeek").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle'.($action == 'show_day' ? ' btnTitleSelected' : '').' reposition" href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewDay").'</span></a>';
|
||||
|
||||
$viewmode .= '<a class="btnTitle reposition marginrightonly" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.dol_print_date($object->datep, '%Y').'&month='.dol_print_date($object->datep, '%m').'&day='.dol_print_date($object->datep, '%d').$paramnoactionodate.'">';
|
||||
$viewmode .= '<a class="btnTitle reposition" href="'.DOL_URL_ROOT.'/comm/action/peruser.php?action=show_peruser&year='.(isset($object->datep) ? dol_print_date($object->datep, '%Y') : $year).'&month='.(isset($object->datep) ? dol_print_date($object->datep, '%m') : $month).'&day='.(isset($object->datep) ? dol_print_date($object->datep, '%d') : $day).$paramnoactionodate.'">';
|
||||
//$viewmode .= '<span class="fa paddingleft imgforviewmode valignmiddle btnTitle-icon">';
|
||||
$viewmode .= img_picto($langs->trans("ViewPerUser"), 'object_calendarperuser', 'class="pictoactionview block"');
|
||||
//$viewmode .= '</span>';
|
||||
$viewmode .= '<span class="valignmiddle text-plus-circle btnTitle-label hideonsmartphone">'.$langs->trans("ViewPerUser").'</span></a>';
|
||||
|
||||
$viewmode .= '<span class="marginrightonly"></span>';
|
||||
|
||||
// Add more views from hooks
|
||||
$parameters = array(); $object = null;
|
||||
$reshook = $hookmanager->executeHooks('addCalendarView', $parameters, $object, $action);
|
||||
@ -519,6 +521,8 @@ if (empty($reshook)) {
|
||||
$viewmode = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
$viewmode .= '<span class="marginrightonly"></span>'; // To add a space before the navigation tools
|
||||
|
||||
|
||||
$newcardbutton = '';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
@ -925,13 +929,13 @@ if ($showbirthday) {
|
||||
$eventarray[$daykey][] = $event;
|
||||
|
||||
/*$loop = true;
|
||||
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
|
||||
do {
|
||||
$eventarray[$daykey][] = $event;
|
||||
$daykey += 60 * 60 * 24;
|
||||
if ($daykey > $event->date_end_in_calendar) $loop = false;
|
||||
} while ($loop);
|
||||
*/
|
||||
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
|
||||
do {
|
||||
$eventarray[$daykey][] = $event;
|
||||
$daykey += 60 * 60 * 24;
|
||||
if ($daykey > $event->date_end_in_calendar) $loop = false;
|
||||
} while ($loop);
|
||||
*/
|
||||
$i++;
|
||||
}
|
||||
} else {
|
||||
@ -939,6 +943,7 @@ if ($showbirthday) {
|
||||
}
|
||||
}
|
||||
|
||||
// LEAVE CALENDAR
|
||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
||||
$sql .= " WHERE u.rowid = x.fk_user";
|
||||
@ -1543,13 +1548,13 @@ if (empty($action) || $action == 'show_month') { // View by month
|
||||
echo " </td>\n";
|
||||
|
||||
/*
|
||||
echo ' <div class="tagtr">';
|
||||
echo ' <div class="tagtd width100"></div>';
|
||||
echo ' <div class="tagtd center">';
|
||||
echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1);
|
||||
echo ' </div>'."\n";
|
||||
echo " </div>\n";
|
||||
*/
|
||||
echo ' <div class="tagtr">';
|
||||
echo ' <div class="tagtd width100"></div>';
|
||||
echo ' <div class="tagtd center">';
|
||||
echo show_day_events($db, $day, $month, $year, $month, $style, $eventarray, 0, $maxnbofchar, $newparam, 1, 300, -1);
|
||||
echo ' </div>'."\n";
|
||||
echo " </div>\n";
|
||||
*/
|
||||
|
||||
echo '</table>';
|
||||
print '</div>';
|
||||
@ -1793,7 +1798,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
} else {
|
||||
if ($user->rights->agenda->allactions->create ||
|
||||
(($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
|
||||
$cssclass .= " movable cursormove";
|
||||
$cssclass .= " movable cursormove";
|
||||
} else {
|
||||
$cssclass .= " unmovable";
|
||||
}
|
||||
@ -1877,7 +1882,8 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
$cacheusers[$tmpid] = $newuser;
|
||||
}
|
||||
|
||||
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
|
||||
$listofusertoshow = '';
|
||||
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
|
||||
print $listofusertoshow;
|
||||
} else { // Other calendar
|
||||
// Picto
|
||||
|
||||
@ -391,7 +391,7 @@ $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // N
|
||||
$sql .= $hookmanager->resPrint;
|
||||
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object) ";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."actioncomm_extrafields as ef ON (a.id = ef.fk_object)";
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
|
||||
}
|
||||
@ -578,8 +578,8 @@ if ($resql) {
|
||||
//print dol_get_fiche_end();
|
||||
|
||||
// Add link to show birthdays
|
||||
$link = '';
|
||||
/*
|
||||
$link = '';
|
||||
if (empty($conf->use_javascript_ajax))
|
||||
{
|
||||
$newparam=$param; // newparam is for birthday links
|
||||
@ -841,7 +841,7 @@ if ($resql) {
|
||||
|
||||
// Ref
|
||||
if (!empty($arrayfields['a.id']['checked'])) {
|
||||
print '<td>';
|
||||
print '<td class="nowraponall">';
|
||||
print $actionstatic->getNomUrl(1, -1);
|
||||
print '</td>';
|
||||
}
|
||||
|
||||
@ -540,6 +540,7 @@ if ($object->id > 0) {
|
||||
print "</td>";
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Warehouse
|
||||
if (!empty($conf->stock->enabled) && !empty($conf->global->SOCIETE_ASK_FOR_WAREHOUSE)) {
|
||||
$langs->load('stocks');
|
||||
@ -552,11 +553,15 @@ if ($object->id > 0) {
|
||||
if ($action == 'editwarehouse') {
|
||||
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'fk_warehouse', 1);
|
||||
} else {
|
||||
if ($object->fk_warehouse > 0) {
|
||||
print img_picto('', 'stock', 'class="paddingrightonly"');
|
||||
}
|
||||
$formproduct->formSelectWarehouses($_SERVER['PHP_SELF'].'?id='.$object->id, $object->fk_warehouse, 'none');
|
||||
}
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
// Preferred shipping Method
|
||||
if (!empty($conf->global->SOCIETE_ASK_FOR_SHIPPING_METHOD)) {
|
||||
print '<tr><td class="nowrap">';
|
||||
|
||||
@ -65,6 +65,8 @@ $socid = GETPOST("socid", 'int');
|
||||
if ($user->socid > 0) {
|
||||
$action = '';
|
||||
$id = $user->socid;
|
||||
} else {
|
||||
$id = 0;
|
||||
}
|
||||
restrictedArea($user, 'societe', $id, '&societe', '', 'fk_soc', 'rowid', 0);
|
||||
|
||||
|
||||
@ -577,7 +577,6 @@ if (empty($reshook)) {
|
||||
|
||||
if (!$isupload) {
|
||||
$mesgs = array();
|
||||
|
||||
$object->sujet = (string) GETPOST("sujet");
|
||||
$object->body = (string) GETPOST("bodyemail", 'restricthtml');
|
||||
$object->bgcolor = (string) GETPOST("bgcolor");
|
||||
@ -744,7 +743,7 @@ if ($action == 'create') {
|
||||
print '<div style="padding-top: 10px">';
|
||||
// wysiwyg editor
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
|
||||
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtml'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
|
||||
$doleditor = new DolEditor('bodyemail', GETPOST('bodyemail', 'restricthtmlallowunvalid'), '', 600, 'dolibarr_mailings', '', true, true, $conf->global->FCKEDITOR_ENABLE_MAILING, 20, '90%');
|
||||
$doleditor->Create();
|
||||
print '</div>';
|
||||
|
||||
|
||||
@ -208,6 +208,12 @@ class Mailing extends CommonObject
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
// Check properties
|
||||
if ($this->body === 'InvalidHTMLString') {
|
||||
$this->error = 'InvalidHTMLString';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$this->title = trim($this->title);
|
||||
@ -257,6 +263,12 @@ class Mailing extends CommonObject
|
||||
*/
|
||||
public function update($user)
|
||||
{
|
||||
// Check properties
|
||||
if ($this->body === 'InvalidHTMLString') {
|
||||
$this->error = 'InvalidHTMLString';
|
||||
return -1;
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."mailing ";
|
||||
$sql .= " SET titre = '".$this->db->escape($this->title)."'";
|
||||
$sql .= ", sujet = '".$this->db->escape($this->sujet)."'";
|
||||
@ -493,22 +505,44 @@ class Mailing extends CommonObject
|
||||
/**
|
||||
* Delete emailing
|
||||
*
|
||||
* @param int $rowid id du mailing a supprimer
|
||||
* @return int 1 en cas de succes
|
||||
* @param int $rowid Id if emailing to delete
|
||||
* @param int $notrigger Disable triggers
|
||||
* @return int >0 if OK, <0 if KO
|
||||
*/
|
||||
public function delete($rowid)
|
||||
public function delete($rowid, $notrigger = 0)
|
||||
{
|
||||
global $user;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."mailing";
|
||||
$sql .= " WHERE rowid = ".((int) $rowid);
|
||||
|
||||
dol_syslog("Mailing::delete", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
return $this->delete_targets();
|
||||
$res = $this->delete_targets();
|
||||
if ($res <= 0) {
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
} else {
|
||||
$this->db->rollback();
|
||||
$this->error = $this->db->lasterror();
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!$notrigger) {
|
||||
$result = $this->call_trigger('MAILING_DELETE', $user);
|
||||
if ($result < 0) {
|
||||
$this->db->rollback();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
}
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/comm/mailing/index.php
|
||||
* \ingroup mailing
|
||||
* \brief Page accueil de la zone mailing
|
||||
* \brief Home page for emailing area
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
@ -34,8 +34,9 @@ $hookmanager = new HookManager($db);
|
||||
$hookmanager->initHooks(array('mailingindex'));
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('commercial', 'orders'));
|
||||
$langs->loadLangs(array('commercial', 'orders', 'mails'));
|
||||
|
||||
$object = new Mailing($db);
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'mailing');
|
||||
@ -46,9 +47,11 @@ $result = restrictedArea($user, 'mailing');
|
||||
*/
|
||||
|
||||
$help_url = 'EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing';
|
||||
llxHeader('', 'EMailing', $help_url);
|
||||
$title = $langs->trans('MailingArea');
|
||||
|
||||
print load_fiche_titre($langs->trans("MailingArea"));
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
print load_fiche_titre($title);
|
||||
|
||||
//print '<table class="notopnoleftnoright" width="100%">';
|
||||
//print '<tr><td valign="top" width="30%" class="notopnoleft">';
|
||||
@ -190,19 +193,9 @@ if ($result) {
|
||||
}
|
||||
|
||||
|
||||
//print '</td></tr></table>';
|
||||
print '</div></div></div>';
|
||||
|
||||
|
||||
if ($langs->file_exists("html/spam.html", 0)) {
|
||||
print "<br><br><br><br>".$langs->trans("Note")."<br>";
|
||||
print '<div style="padding: 4px; background: #FAFAFA; border: 1px solid #BBBBBB;" >';
|
||||
dol_print_file($langs, "html/spam.html", 0);
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
$parameters = array('user' => $user);
|
||||
$reshook = $hookmanager->executeHooks('dashboardEmailings', $parameters, $object); // Note that $action and $object may have been modified by hook
|
||||
|
||||
|
||||
@ -843,16 +843,16 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) {
|
||||
if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('type') < 0) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Type")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht === '' && $price_ht_devise === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal.
|
||||
if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && $price_ht === '' && $price_ht_devise === '') { // Unit price can be 0 but not ''. Also price can be negative for proposal.
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) {
|
||||
if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && empty($product_desc)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Description")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -871,7 +871,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && ($qty >= 0) && (!empty($product_desc) || !empty($idprod))) {
|
||||
if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
|
||||
$pu_ht = 0;
|
||||
$pu_ttc = 0;
|
||||
$price_min = 0;
|
||||
@ -885,7 +885,7 @@ if (empty($reshook)) {
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $tva_tx par celui du produit
|
||||
// Replaces $fk_unit with the product unit
|
||||
if (!empty($idprod)) {
|
||||
if (!empty($idprod) && $idprod > 0) {
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($idprod);
|
||||
|
||||
@ -2450,10 +2450,11 @@ if ($action == 'create') {
|
||||
// Show object lines
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
print ' <form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="page_y" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">
|
||||
';
|
||||
|
||||
@ -2594,9 +2595,14 @@ if ($action == 'create') {
|
||||
}
|
||||
|
||||
// Close as accepted/refused
|
||||
if ($object->statut == Propal::STATUS_VALIDATED && $usercanclose) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
|
||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||
if ($object->statut == Propal::STATUS_VALIDATED) {
|
||||
if ($usercanclose) {
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
|
||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotEnoughPermissions").'"';
|
||||
print '>'.$langs->trans('SetAcceptedRefused').'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
// Clone
|
||||
|
||||
@ -605,7 +605,7 @@ class Propal extends CommonObject
|
||||
$this->db->begin();
|
||||
|
||||
$product_type = $type;
|
||||
if (!empty($fk_product)) {
|
||||
if (!empty($fk_product) && $fk_product > 0) {
|
||||
$product = new Product($this->db);
|
||||
$result = $product->fetch($fk_product);
|
||||
$product_type = $product->type;
|
||||
@ -2535,12 +2535,12 @@ class Propal extends CommonObject
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
// Status self::STATUS_REFUSED by default
|
||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
||||
$modelpdf = !empty($conf->global->PROPALE_ADDON_PDF_ODT_CLOSED) ? $conf->global->PROPALE_ADDON_PDF_ODT_CLOSED : $this->model_pdf;
|
||||
$trigger_name = 'PROPAL_CLOSE_REFUSED';
|
||||
|
||||
if ($status == self::STATUS_SIGNED) { // Status self::STATUS_SIGNED
|
||||
$trigger_name = 'PROPAL_CLOSE_SIGNED';
|
||||
$modelpdf = $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL:$this->model_pdf;
|
||||
$modelpdf = !empty($conf->global->PROPALE_ADDON_PDF_ODT_TOBILL) ? $conf->global->PROPALE_ADDON_PDF_ODT_TOBILL : $this->model_pdf;
|
||||
|
||||
// The connected company is classified as a client
|
||||
$soc=new Societe($this->db);
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2021 Anthony Berton <anthony.berton@bb2a.fr>
|
||||
* Copyright (C) 2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -216,20 +217,19 @@ $arrayfields = array(
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||
|
||||
$permissiontoread = $user->rights->propal->lire;
|
||||
$permissiontoadd = $user->rights->propal->write;
|
||||
$permissiontoadd = $user->rights->propal->creer;
|
||||
$permissiontodelete = $user->rights->propal->supprimer;
|
||||
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
|
||||
$permissiontovalidate = $user->rights->propale->propal_advance->validate;
|
||||
$permissiontoclose = $user->rights->propale->propal_advance->close;
|
||||
$permissiontosendbymail = $user->rights->propale->propal_advance->send;
|
||||
$permissiontovalidate = $user->rights->propal->propal_advance->validate;
|
||||
$permissiontoclose = $user->rights->propal->propal_advance->close;
|
||||
$permissiontosendbymail = $user->rights->propal->propal_advance->send;
|
||||
} else {
|
||||
$permissiontovalidate = $user->rights->propal->write;
|
||||
$permissiontoclose = $user->rights->propal->write;
|
||||
$permissiontovalidate = $user->rights->propal->creer;
|
||||
$permissiontoclose = $user->rights->propal->creer;
|
||||
$permissiontosendbymail = $user->rights->propal->lire;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -465,13 +465,13 @@ $sql .= " typent.code as typent_code,";
|
||||
$sql .= " ava.rowid as availability,";
|
||||
$sql .= " country.code as country_code,";
|
||||
$sql .= " state.code_departement as state_code, state.nom as state_name,";
|
||||
$sql .= ' p.rowid, p.entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
|
||||
$sql .= ' p.rowid, p.entity as propal_entity, p.note_private, p.total_ht, p.total_tva, p.total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut as status, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,p.date_livraison as ddelivery,';
|
||||
$sql .= ' p.fk_multicurrency, p.multicurrency_code, p.multicurrency_tx, p.multicurrency_total_ht, p.multicurrency_total_tva, p.multicurrency_total_ttc,';
|
||||
$sql .= ' p.datec as date_creation, p.tms as date_update, p.date_cloture as date_cloture,';
|
||||
$sql .= ' p.note_public, p.note_private,';
|
||||
$sql .= ' p.fk_cond_reglement,p.fk_mode_reglement,p.fk_shipping_method,p.fk_input_reason,';
|
||||
$sql .= " pr.rowid as project_id, pr.ref as project_ref, pr.title as project_label,";
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
|
||||
$sql .= ' u.login, u.lastname, u.firstname, u.email, u.statut, u.entity as user_entity, u.photo, u.office_phone, u.office_fax, u.user_mobile, u.job, u.gender';
|
||||
if (!$user->rights->societe->client->voir && !$socid) {
|
||||
$sql .= ", sc.fk_soc, sc.fk_user";
|
||||
}
|
||||
@ -1321,6 +1321,11 @@ if ($resql) {
|
||||
$now = dol_now();
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$totalarray['nbfield'] = 0;
|
||||
$totalarray['val'] = array();
|
||||
$totalarray['val']['p.total_ht'] = 0;
|
||||
$totalarray['val']['p.total_tva'] = 0;
|
||||
$totalarray['val']['p.total_ttc'] = 0;
|
||||
$typenArray = null;
|
||||
|
||||
while ($i < min($num, $limit)) {
|
||||
@ -1396,7 +1401,7 @@ if ($resql) {
|
||||
// Other picto tool
|
||||
print '<td width="16" class="nobordernopadding right">';
|
||||
$filename = dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->propal->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||
$filedir = $conf->propal->multidir_output[$obj->propal_entity].'/'.dol_sanitizeFileName($obj->ref);
|
||||
$urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
|
||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||
print '</td></tr></table>';
|
||||
@ -1705,7 +1710,7 @@ if ($resql) {
|
||||
$userstatic->firstname = $obj->firstname;
|
||||
$userstatic->email = $obj->email;
|
||||
$userstatic->statut = $obj->statut;
|
||||
$userstatic->entity = $obj->entity;
|
||||
$userstatic->entity = $obj->user_entity;
|
||||
$userstatic->photo = $obj->photo;
|
||||
$userstatic->office_phone = $obj->office_phone;
|
||||
$userstatic->office_fax = $obj->office_fax;
|
||||
|
||||
@ -52,6 +52,10 @@ if ($user->socid > 0) {
|
||||
$socid = $user->socid;
|
||||
$object->id = $user->socid;
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('propalnote'));
|
||||
|
||||
restrictedArea($user, 'propal', $object->id, 'propal');
|
||||
|
||||
|
||||
@ -61,7 +65,13 @@ restrictedArea($user, 'propal', $object->id, 'propal');
|
||||
|
||||
$permissionnote = $user->rights->propale->creer; // Used by the include of actions_setnotes.inc.php
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -91,6 +91,10 @@ $hideref = (GETPOST('hideref', 'int') ? GETPOST('hideref', 'int') : (!empty($con
|
||||
if (!empty($user->socid)) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ordercard', 'globalcard'));
|
||||
|
||||
$result = restrictedArea($user, 'commande', $id);
|
||||
|
||||
$object = new Commande($db);
|
||||
@ -102,9 +106,6 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
||||
// Load object
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ordercard', 'globalcard'));
|
||||
|
||||
$usercanread = $user->rights->commande->lire;
|
||||
$usercancreate = $user->rights->commande->creer;
|
||||
$usercandelete = $user->rights->commande->supprimer;
|
||||
@ -645,15 +646,15 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($idprod) && ($price_ht < 0) && ($qty < 0)) {
|
||||
if ((empty($idprod) || $idprod < 0) && ($price_ht < 0) && ($qty < 0)) {
|
||||
setEventMessages($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && GETPOST('type') < 0) {
|
||||
if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && GETPOST('type') < 0) {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && $price_ht == '' && $price_ht_devise == '') { // Unit price can be 0 but not ''. Also price can be negative for order.
|
||||
if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && $price_ht == '' && $price_ht_devise == '') { // Unit price can be 0 but not ''. Also price can be negative for order.
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -661,7 +662,7 @@ if (empty($reshook)) {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
if ($prod_entry_mode == 'free' && empty($idprod) && empty($product_desc)) {
|
||||
if ($prod_entry_mode == 'free' && (empty($idprod) || $idprod < 0) && empty($product_desc)) {
|
||||
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Description')), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -680,7 +681,7 @@ if (empty($reshook)) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error && ($qty >= 0) && (!empty($product_desc) || !empty($idprod))) {
|
||||
if (!$error && ($qty >= 0) && (!empty($product_desc) || (!empty($idprod) && $idprod > 0))) {
|
||||
// Clean parameters
|
||||
$date_start = dol_mktime(GETPOST('date_start'.$predef.'hour'), GETPOST('date_start'.$predef.'min'), GETPOST('date_start'.$predef.'sec'), GETPOST('date_start'.$predef.'month'), GETPOST('date_start'.$predef.'day'), GETPOST('date_start'.$predef.'year'));
|
||||
$date_end = dol_mktime(GETPOST('date_end'.$predef.'hour'), GETPOST('date_end'.$predef.'min'), GETPOST('date_end'.$predef.'sec'), GETPOST('date_end'.$predef.'month'), GETPOST('date_end'.$predef.'day'), GETPOST('date_end'.$predef.'year'));
|
||||
@ -690,7 +691,7 @@ if (empty($reshook)) {
|
||||
// Ecrase $desc par celui du produit
|
||||
// Ecrase $tva_tx par celui du produit
|
||||
// Ecrase $base_price_type par celui du produit
|
||||
if (!empty($idprod)) {
|
||||
if (!empty($idprod) && $idprod > 0) {
|
||||
$prod = new Product($db);
|
||||
$prod->fetch($idprod);
|
||||
|
||||
@ -2417,10 +2418,11 @@ if ($action == 'create' && $usercancreate) {
|
||||
*/
|
||||
$result = $object->getLinesArray();
|
||||
|
||||
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '#addline' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
print '<form name="addproduct" id="addproduct" action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.(($action != 'editline') ? '' : '#line_'.GETPOST('lineid', 'int')).'" method="POST">
|
||||
<input type="hidden" name="token" value="' . newToken().'">
|
||||
<input type="hidden" name="action" value="' . (($action != 'editline') ? 'addline' : 'updateline').'">
|
||||
<input type="hidden" name="mode" value="">
|
||||
<input type="hidden" name="page_y" value="">
|
||||
<input type="hidden" name="id" value="' . $object->id.'">';
|
||||
|
||||
if (!empty($conf->use_javascript_ajax) && $object->statut == Commande::STATUS_DRAFT) {
|
||||
|
||||
@ -1368,7 +1368,7 @@ class Commande extends CommonOrder
|
||||
}
|
||||
// Possibility to add external linked objects with hooks
|
||||
$this->linked_objects[$this->origin] = $this->origin_id;
|
||||
if (is_array($object->other_linked_objects) && !empty($object->other_linked_objects)) {
|
||||
if (isset($object->other_linked_objects) && is_array($object->other_linked_objects) && !empty($object->other_linked_objects)) {
|
||||
$this->linked_objects = array_merge($this->linked_objects, $object->other_linked_objects);
|
||||
}
|
||||
|
||||
@ -1518,7 +1518,7 @@ class Commande extends CommonOrder
|
||||
$this->db->begin();
|
||||
|
||||
$product_type = $type;
|
||||
if (!empty($fk_product)) {
|
||||
if (!empty($fk_product) && $fk_product > 0) {
|
||||
$product = new Product($this->db);
|
||||
$result = $product->fetch($fk_product);
|
||||
$product_type = $product->type;
|
||||
@ -2347,6 +2347,10 @@ class Commande extends CommonOrder
|
||||
// For triggers
|
||||
$line->fetch($lineid);
|
||||
|
||||
// Memorize previous line for triggers
|
||||
$staticline = clone $line;
|
||||
$line->oldline = $staticline;
|
||||
|
||||
if ($line->delete($user) > 0) {
|
||||
$result = $this->update_price(1);
|
||||
|
||||
@ -4010,7 +4014,7 @@ class Commande extends CommonOrder
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
return max($this->date_commande, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
|
||||
return max($this->date, $this->date_livraison) < ($now - $conf->commande->client->warning_delay);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4127,7 +4131,7 @@ class OrderLine extends CommonOrderLine
|
||||
$sql .= ' cd.fk_unit,';
|
||||
$sql .= ' cd.fk_multicurrency, cd.multicurrency_code, cd.multicurrency_subprice, cd.multicurrency_total_ht, cd.multicurrency_total_tva, cd.multicurrency_total_ttc,';
|
||||
$sql .= ' p.ref as product_ref, p.label as product_label, p.description as product_desc, p.tobatch as product_tobatch,';
|
||||
$sql .= ' cd.date_start, cd.date_end';
|
||||
$sql .= ' cd.date_start, cd.date_end, cd.vat_src_code';
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.'commandedet as cd';
|
||||
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product as p ON cd.fk_product = p.rowid';
|
||||
$sql .= ' WHERE cd.rowid = '.((int) $rowid);
|
||||
@ -4348,7 +4352,8 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
// if buy price not defined, define buyprice as configured in margin admin
|
||||
if ($this->pa_ht == 0 && $pa_ht_isemptystring) {
|
||||
if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) {
|
||||
$result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
} else {
|
||||
$this->pa_ht = $result;
|
||||
@ -4384,7 +4389,7 @@ class OrderLine extends CommonOrderLine
|
||||
$sql .= " '".price2num($this->localtax2_tx)."',";
|
||||
$sql .= " '".$this->db->escape($this->localtax1_type)."',";
|
||||
$sql .= " '".$this->db->escape($this->localtax2_type)."',";
|
||||
$sql .= ' '.(!empty($this->fk_product) ? $this->fk_product : "null").',';
|
||||
$sql .= ' '.((!empty($this->fk_product) && $this->fk_product > 0) ? $this->fk_product : "null").',';
|
||||
$sql .= " '".$this->db->escape($this->product_type)."',";
|
||||
$sql .= " '".price2num($this->remise_percent)."',";
|
||||
$sql .= " ".(price2num($this->subprice) !== '' ?price2num($this->subprice) : "null").",";
|
||||
@ -4525,7 +4530,8 @@ class OrderLine extends CommonOrderLine
|
||||
|
||||
// if buy price not defined, define buyprice as configured in margin admin
|
||||
if ($this->pa_ht == 0 && $pa_ht_isemptystring) {
|
||||
if (($result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product)) < 0) {
|
||||
$result = $this->defineBuyPrice($this->subprice, $this->remise_percent, $this->fk_product);
|
||||
if ($result < 0) {
|
||||
return $result;
|
||||
} else {
|
||||
$this->pa_ht = $result;
|
||||
|
||||
@ -494,7 +494,7 @@ if ($search_billed != '' && $search_billed >= 0) {
|
||||
$sql .= ' AND c.facture = '.((int) $search_billed);
|
||||
}
|
||||
if ($search_status <> '') {
|
||||
if ($search_status < 4 && $search_status > -3) {
|
||||
if ($search_status < 4 && $search_status > -4) {
|
||||
if ($search_status == 1 && empty($conf->expedition->enabled)) {
|
||||
$sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated'
|
||||
} else {
|
||||
@ -513,6 +513,11 @@ if ($search_status <> '') {
|
||||
//$sql.= ' AND c.facture = 0'; // invoice not created
|
||||
$sql .= ' AND ((c.fk_statut IN (1,2)) OR (c.fk_statut = 3 AND c.facture = 0))'; // validated, in process or closed but not billed
|
||||
}
|
||||
|
||||
|
||||
if ($search_status == -4) { // "validate and in progress"
|
||||
$sql .= ' AND (c.fk_statut IN (1,2))'; // validated, in process
|
||||
}
|
||||
}
|
||||
|
||||
if ($search_datecloture_start) {
|
||||
@ -675,6 +680,9 @@ if ($resql) {
|
||||
if ($search_status == -3) {
|
||||
$title .= ' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled) ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill');
|
||||
}
|
||||
if ($search_status == -4) {
|
||||
$title .= ' - '.$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort");
|
||||
}
|
||||
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
@ -1236,6 +1244,7 @@ if ($resql) {
|
||||
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
|
||||
-4=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"),
|
||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||
);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
|
||||
@ -1373,7 +1382,7 @@ if ($resql) {
|
||||
$generic_product = new Product($db);
|
||||
$userstatic = new User($db);
|
||||
$i = 0;
|
||||
$totalarray = array();
|
||||
$totalarray = array('nbfield' => 0, 'val' => array(), 'pos' => array());
|
||||
while ($i < min($num, $limit)) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
|
||||
@ -1610,7 +1619,11 @@ if ($resql) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 'c.total_ht';
|
||||
}
|
||||
$totalarray['val']['c.total_ht'] += $obj->total_ht;
|
||||
if (isset($totalarray['val']['c.total_ht'])) {
|
||||
$totalarray['val']['c.total_ht'] += $obj->total_ht;
|
||||
} else {
|
||||
$totalarray['val']['c.total_ht'] = $obj->total_ht;
|
||||
}
|
||||
}
|
||||
// Amount VAT
|
||||
if (!empty($arrayfields['c.total_vat']['checked'])) {
|
||||
|
||||
@ -45,6 +45,10 @@ $socid = 0;
|
||||
if ($user->socid) {
|
||||
$socid = $user->socid;
|
||||
}
|
||||
|
||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||
$hookmanager->initHooks(array('ordernote'));
|
||||
|
||||
$result = restrictedArea($user, 'commande', $id, '');
|
||||
|
||||
|
||||
@ -61,7 +65,13 @@ $permissionnote = $user->rights->commande->creer; // Used by the include of acti
|
||||
* Actions
|
||||
*/
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not includ_once
|
||||
$reshook = $hookmanager->executeHooks('doActions', array(), $object, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be include, not include_once
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -47,7 +47,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
|
||||
}
|
||||
echo '<tr class="'.$trclass.'" >';
|
||||
echo '<td class="linkedcol-element" >'.$langs->trans("CustomerOrder");
|
||||
if (!empty($showImportButton) && $conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES) {
|
||||
if (!empty($showImportButton) && !empty($conf->global->MAIN_ENABLE_IMPORT_LINKED_OBJECT_LINES)) {
|
||||
print '<a class="objectlinked_importbtn" href="'.$objectlink->getNomUrl(0, '', 0, 1).'&action=selectlines" data-element="'.$objectlink->element.'" data-id="'.$objectlink->id.'" > <i class="fa fa-indent"></i> </a';
|
||||
}
|
||||
echo '</td>';
|
||||
|
||||
@ -170,7 +170,7 @@ if (($action == 'searchfiles' || $action == 'dl')) {
|
||||
if (!empty($sql)) {
|
||||
$sql .= " UNION ALL";
|
||||
}
|
||||
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva, t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
|
||||
$sql .= "SELECT t.rowid as id, t.entity, t.ref, t.paye as paid, t.total_ht, t.total_ttc, t.total_tva as total_vat, t.multicurrency_code as currency, t.fk_soc, t.datef as date, t.date_lim_reglement as date_due, 'Invoice' as item, s.nom as thirdparty_name, s.code_client as thirdparty_code, c.code as country_code, s.tva_intra as vatnum, ".PAY_CREDIT." as sens";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as t LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = t.fk_soc LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON c.rowid = s.fk_pays";
|
||||
$sql .= " WHERE datef between ".$wheretail;
|
||||
$sql .= " AND t.entity IN (".$db->sanitize($entity == 1 ? '0,1' : $entity).')';
|
||||
@ -547,7 +547,11 @@ print dol_get_fiche_head($head, 'AccountancyFiles');
|
||||
print '<form name="searchfiles" action="?action=searchfiles" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("ExportAccountingSourceDocHelp", $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Journals")).'</span><br>';
|
||||
print '<span class="opacitymedium">'.$langs->trans("ExportAccountingSourceDocHelp");
|
||||
if (!empty($conf->accounting->enabled)) {
|
||||
print ' '.$langs->trans("ExportAccountingSourceDocHelp2", $langs->transnoentitiesnoconv("Accounting"), $langs->transnoentitiesnoconv("Journals"));
|
||||
}
|
||||
print '</span><br>';
|
||||
print '<br>';
|
||||
|
||||
print $langs->trans("ReportPeriod").': ';
|
||||
|
||||
@ -399,7 +399,8 @@ if ($action == 'create') {
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||
if ($selectedcode) {
|
||||
$formcompany->select_departement(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id');
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id');
|
||||
} else {
|
||||
print $countrynotdefined;
|
||||
}
|
||||
@ -407,7 +408,10 @@ if ($action == 'create') {
|
||||
|
||||
// Web
|
||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||
print '<td><input class="minwidth300" type="text" class="flat" name="url" value="'.GETPOST("url").'"></td></tr>';
|
||||
print '<td>';
|
||||
print img_picto('', 'globe', 'class="pictofixedwidth"');
|
||||
print '<input class="minwidth300" type="text" class="flat" name="url" value="'.GETPOST("url").'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Tags-Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
@ -865,6 +869,7 @@ if ($action == 'create') {
|
||||
if (!$selectedcode) {
|
||||
$selectedcode = $conf->currency;
|
||||
}
|
||||
print img_picto('', 'multicurrency', 'class="pictofixedwidth"');
|
||||
print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code');
|
||||
//print $langs->trans("Currency".$conf->currency);
|
||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
|
||||
@ -897,6 +902,7 @@ if ($action == 'create') {
|
||||
// State
|
||||
print '<tr><td>'.$langs->trans('State').'</td><td class="maxwidth200onsmartphone">';
|
||||
if ($selectedcode) {
|
||||
print img_picto('', 'state', 'class="pictofixedwidth"');
|
||||
print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $object->state_id, $selectedcode, 'account_state_id');
|
||||
} else {
|
||||
print $countrynotdefined;
|
||||
@ -925,7 +931,9 @@ if ($action == 'create') {
|
||||
|
||||
// Web
|
||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
|
||||
print '<td>';
|
||||
print img_picto('', 'globe', 'class="pictofixedwidth"');
|
||||
print '<input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
// Tags-Categories
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user