Merge branch 'develop' into new_validation_method_for_common_object
This commit is contained in:
commit
167ae5b0f2
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
|
||||
|
||||
300
ChangeLog
300
ChangeLog
@ -10,13 +10,63 @@ 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 unpayed invoices
|
||||
NEW: Can make massive stock transfers from a CSV file.
|
||||
NEW: Add an example of scheduled job to send email reminder for unpaid invoices
|
||||
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 some company information in the dropdown login menu
|
||||
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
|
||||
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: Can search on lots or serials into the quick search bar
|
||||
NEW: Add support for Friday as a non working day
|
||||
NEW: auto notification with module Notification can use templated emails
|
||||
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 order of execution of hooks
|
||||
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: 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
|
||||
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: Enhance the multicurrency rate editor
|
||||
NEW: Normalyse Type company field with ajax combobox
|
||||
NEW: preload product description on selection for customer propal/order/invoice
|
||||
NEW: Search usergroups & resources
|
||||
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: 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
|
||||
NEW: Salary payment request and Salary payment are 2 different steps in workflow on Salary payment recording
|
||||
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 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
|
||||
@ -24,152 +74,159 @@ 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 "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 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 thirparty+contact create form
|
||||
NEW: Add db fields note_public and note_private for ECM module
|
||||
NEW: Manage deposit 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
|
||||
NEW: Add last date of modification for website pages in the list of pages
|
||||
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 bulk action to set a commercial proposal to status "Refused"
|
||||
NEW: Add option CONTRACT_ALLOW_EXTERNAL_DOWNLOAD and 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 a new permission "Export website"
|
||||
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: Can set a Warehouse on a Thirparty
|
||||
NEW: auto notification with module Notification can use templated emails
|
||||
NEW: Bank Entries : display user linked to a salary or a taxes
|
||||
NEW: Can set a warehouse in a proposal
|
||||
NEW: Can clone a cron job.
|
||||
NEW: Can create a lot from the list view (Look and feel standardization).
|
||||
NEW: Can filter files in GED on status Shared/Not shared
|
||||
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 if a ticket group is visible on public interface or not.
|
||||
NEW: Can set order of execution of hooks
|
||||
NEW: Can show the leave dates/holidays on the agenda view.
|
||||
NEW: Can show the project ref into PDF documents
|
||||
NEW: Can toggle FCKeditor on public/private notes
|
||||
NEW: Can use captcha on public page to create a ticket
|
||||
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: Column shippement method, payment mode, payment term in proposal and order list
|
||||
NEW: Conf for default actiomm status
|
||||
NEW: customer ref for product customer prices
|
||||
NEW: date and user signature on proposal (Issue 16062)
|
||||
NEW: Dictionary for availability - Add a column position
|
||||
NEW: TAKEPOS delayed payment in TakePOS
|
||||
NEW: TAKEPOS display date range if exist in TakePOS
|
||||
NEW: TAKEPOS display resiliate status in TakePOS for member
|
||||
NEW: TAKEPOS Edit sales lines rights in TakePOS
|
||||
NEW: TAKEPOS Option for Takepos to show the total price without tax
|
||||
NEW: TAKEPOS More permission in TakePOS (Can edit added line, can modify once order sent to kitchen)
|
||||
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
|
||||
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: option to automatically close an open project when all its tasks are done (=progress 100%)
|
||||
NEW: option to select membership type on the online payment page for membership subscription or renewal
|
||||
NEW: preload product description on selection for customer propal/order/invoice
|
||||
NEW: Add a ref in product customer price
|
||||
NEW: Save old page with .old extension on disk when editing a website page
|
||||
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: Stock movement list - Add more complete date field
|
||||
|
||||
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
|
||||
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
|
||||
NEW: Add captcha on public page to create a ticket
|
||||
NEW: Salary payment request and Salary payment are 2 different steps in workflow on Salary payment recording
|
||||
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 we add contacts/users to a project, ask to also affect them on tasks.
|
||||
NEW: When a doc file is shared, link is visible from the main page of doc.
|
||||
NEW: Add option in Workflow module to set a shipment as closed.
|
||||
NEW: Option to automatically create a login/user when a new subscription of a member is done online
|
||||
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: #17113 Can upload a favicon in website module
|
||||
|
||||
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 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 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
|
||||
|
||||
TakePOS
|
||||
NEW: delayed payment in TakePOS #14456?
|
||||
NEW: display date range if exist in TakePOS
|
||||
NEW: display resiliate status in TakePOS for member
|
||||
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 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/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
|
||||
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
|
||||
|
||||
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: 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 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: API Add option $includeifobjectisused to get a product
|
||||
NEW: API Get the list of product ids only
|
||||
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: 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:
|
||||
|
||||
Following changes may create regressions for some external modules, but were necessary to make Dolibarr better:
|
||||
* Module SimplePOS is deprecated. If you need a POS module, please use the module TakePOS.
|
||||
* The ICS value for direct debit or credit transfer is now store on each bank account instead of into the global setup.
|
||||
* The ICS value for direct debit or credit transfer is now stored on each bank account instead of into the global setup.
|
||||
* API /setup/shipment_methods has been replaced with API /setup/shipping_methods
|
||||
* Field "total" renamed into to "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
|
||||
* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
|
||||
* Field "total" renamed into "total_ttc" for table lx_propal, llx_supplier_proposal for better field name consistency
|
||||
* If your database is PostgreSql, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
|
||||
* If your database is MySql or MariaDB, you need at least version 5.1
|
||||
* Field "total" renamed into "total_ht" for table llx_facture, llx_facture_rec for better field name consistency
|
||||
* Field "tva" renamed into "total_tva" for table llx_propal, llx_supplier_proposal, llx_commande, llx_commande_fournisseur for better field name consistency
|
||||
* Field "total" renamed into "total_ttc" for table llx_propal, llx_supplier_proposal for better field name consistency
|
||||
* If your database is PostgreSQL, you must use version 9.1.0 or more (Dolibarr need the SQL function CONCAT)
|
||||
* 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
|
||||
* Remove deprecated subtituion key __REFCLIENT__ (Replaced with __REF_CLIENT__)
|
||||
* 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 *****
|
||||
|
||||
@ -180,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
|
||||
@ -193,7 +252,7 @@ FIX: create sociales : keep values error form
|
||||
FIX: dol_print_date for %a and %b with some timezone
|
||||
FIX: email is not case sensitive
|
||||
FIX: error for duplicate thirdparty found correctly returned by ws
|
||||
FIX: Espadon PDF shippment model with long public note now wroking
|
||||
FIX: Espadon PDF shippment model with long public note now working
|
||||
FIX: esupplier order: error 500 when using packaging with product where it is not defined
|
||||
FIX: Filter on debit/credit
|
||||
FIX: Filter on supplier payment list
|
||||
@ -226,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 *****
|
||||
|
||||
20
README-FR.md
20
README-FR.md
@ -8,10 +8,12 @@ Il est simple d'utilisation et modulaire, vous permettant de n'activez que les f
|
||||
|
||||

|
||||
|
||||
|
||||
## LICENCE
|
||||
|
||||
Dolibarr est distribué sous les termes de la licence GNU General Public License v3+ ou supérieure.
|
||||
|
||||
|
||||
## INSTALLER DOLIBARR
|
||||
|
||||
### Configuration simple
|
||||
@ -52,6 +54,7 @@ Vous pouvez aussi utiliser un serveur Web et une base de données prise en charg
|
||||
|
||||
- Suivez les instructions de l'installateur
|
||||
|
||||
|
||||
## METTRE A JOUR DOLIBARR
|
||||
|
||||
Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
||||
@ -64,9 +67,11 @@ Pour mettre à jour Dolibarr depuis une vieille version vers celle ci:
|
||||
|
||||
*Note: Le processus de migration peut être lancé manuellement et plusieurs fois, sans risque, en appelant la page /install/*
|
||||
|
||||
|
||||
## CE QUI EST NOUVEAU
|
||||
|
||||
Voir fichier ChangeLog.
|
||||
See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog) file.
|
||||
|
||||
|
||||
## CE QUE DOLIBARR PEUT FAIRE
|
||||
|
||||
@ -82,15 +87,17 @@ Voir fichier ChangeLog.
|
||||
- Calendrier/Agenda partagé (avec export ical, vcal)
|
||||
- Suivi des opportunités et/ou projets (suivi de rentabilité incluant les factures, notes de frais, temps consommé valorisé, ...)
|
||||
- Gestion de contrats de services
|
||||
- Gestion de stock
|
||||
- Gestion de stock et inventaires
|
||||
- Gestion des expéditions
|
||||
- Gestion des demandes de congès
|
||||
- Gestion des notes de frais
|
||||
- Gestion de recrutement
|
||||
- GED (Gestion Electronique de Documents)
|
||||
- EMailings de masse
|
||||
- Réalisation de sondages
|
||||
- Gestion d'adhérents
|
||||
- Point de vente/Caisse enregistreuse
|
||||
- …
|
||||
- … (près de 100 modules disponibles en standard, près de 1000 autre sur la place de marché d'extensions)
|
||||
|
||||
### Autres modules
|
||||
|
||||
@ -135,31 +142,36 @@ Voir fichier ChangeLog.
|
||||
|
||||
Dolibarr peut aussi être étendu à volonté avec l'ajout de module/applications externes développées par des développeus tiers, disponible sur [DoliStore](https://www.dolistore.com).
|
||||
|
||||
|
||||
## CE QUE DOLIBARR NE PEUT PAS (ENCORE) FAIRE
|
||||
|
||||
Voici un liste de fonctionnalités pas encore gérées par Dolibarr:
|
||||
|
||||
- Dolibarr ne contient pas de module de Gestion de la paie.
|
||||
- Dolibarr ne contient pas de module de génération de feuille de paie.
|
||||
- Les tâches du module de gestion de projets n'ont pas de dépendances entre elle.
|
||||
- Dolibarr n'embarque pas de Webmail intégré nativement.
|
||||
- Dolibarr ne fait pas le café (pas encore).
|
||||
|
||||
|
||||
## DOCUMENTATION
|
||||
|
||||
La documentation utilisateur, développeur et traducteur est disponible sous forme de ressources de la communauté via le site [Wiki](https://wiki.dolibarr.org).
|
||||
|
||||
|
||||
## CONTRIBUER
|
||||
|
||||
Ce projet existe grâce à ses nombreux contributeurs [[Contribuer](https://github.com/Dolibarr/dolibarr/blob/develop/.github/CONTRIBUTING.md)].
|
||||
|
||||
<a href="https://github.com/Dolibarr/dolibarr/graphs/contributors"><img src="https://opencollective.com/dolibarr/contributors.svg?width=890&button=false" /></a>
|
||||
|
||||
|
||||
## CREDITS
|
||||
|
||||
Dolibarr est le résultat du travail de nombreux contributeurs depuis des années et utilise des librairies d'autres contributeurs.
|
||||
|
||||
Voir le fichier [COPYRIGHT](https://github.com/Dolibarr/dolibarr/blob/develop/COPYRIGHT)
|
||||
|
||||
|
||||
## ACTUALITES ET RESEAUX SOCIAUX
|
||||
|
||||
Suivez le projet Dolibarr project sur les réseaux francophones
|
||||
|
||||
97
README.md
97
README.md
@ -13,7 +13,7 @@ You can freely use, study, modify or distribute it according to its licence.
|
||||
|
||||
You can use it as a standalone application or as a web application to access it from the Internet or a LAN.
|
||||
|
||||
Dolibarr has a large community ready to help you, free forums and [officially preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||
Dolibarr has a large community ready to help you, free forums and [preferred partners ready to offer commercial support should you need it](https://partners.dolibarr.org)
|
||||
|
||||

|
||||
|
||||
@ -97,48 +97,80 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
||||
|
||||
### Main application/modules (all optional)
|
||||
|
||||
- Customers, Prospects (Leads) and/or Suppliers directory + Contacts
|
||||
- Members/Membership management
|
||||
- Products and/or Services catalog
|
||||
- Commercial proposals management
|
||||
- Customer & Supplier Orders management
|
||||
- Invoices and payment management
|
||||
- Shipping management
|
||||
- Warehouse/Stock management
|
||||
- Manufacturing Orders
|
||||
- Bank accounts management
|
||||
- Direct debit orders management (European SEPA)
|
||||
- Accounting management
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Opportunities or Leads management
|
||||
- Projects & Tasks management
|
||||
- Ticket System
|
||||
- Contracts management
|
||||
- Interventions management
|
||||
- Employee's leave requests management
|
||||
- Expense reports
|
||||
- Timesheets
|
||||
- Electronic Document Management (EDM)
|
||||
- Foundations members management
|
||||
- Point of Sale (POS)
|
||||
- …
|
||||
- Third-Parties Management: Customers, Prospects (Leads) and/or Suppliers + Contacts
|
||||
- Members/Membership/Foundation management
|
||||
|
||||
Product Management
|
||||
- Products and/or Services catalog
|
||||
- Stock / Warehouse management + Inventory
|
||||
- Barcodes
|
||||
- Batches / Lots / Serials
|
||||
- Product Variants
|
||||
- Bill of Materials (BOM)
|
||||
- Manufacturing Orders
|
||||
|
||||
Customer/Sales Management
|
||||
- Customers/Prospects + Contacts management
|
||||
- Opportunities or Leads management
|
||||
- Commercial proposals management
|
||||
- Customer Orders management
|
||||
- Contracts/Subscription management
|
||||
- Interventions management
|
||||
- Ticket System
|
||||
- Shipping management
|
||||
- Customer Invoices/Credit notes and payment management
|
||||
- Point of Sale (POS)
|
||||
|
||||
Supplier/Purchase Management
|
||||
- Suppliers/Vendors + Contacts
|
||||
- Supplier (price) requests
|
||||
- Purchase Orders management
|
||||
- Delivery/Receiption
|
||||
- Supplier Invoices/credit notes and payment management
|
||||
- INCOTERMS
|
||||
|
||||
Finance / Accounting
|
||||
- Invoices / Payments
|
||||
- Bank accounts management
|
||||
- Direct debit orders management (European SEPA)
|
||||
- Accounting management
|
||||
- Donations management
|
||||
- Loan management
|
||||
- Margins
|
||||
- Reports
|
||||
|
||||
Collaboration
|
||||
- Shared calendar/agenda (with ical and vcal export for third party tools integration)
|
||||
- Projects & Tasks management
|
||||
- Ticket System
|
||||
- Surveys
|
||||
|
||||
HR
|
||||
- Employee's leave requests management
|
||||
- Expense reports
|
||||
- Recruitment management
|
||||
- Timesheets
|
||||
|
||||
|
||||
### Other application/modules
|
||||
|
||||
- Electronic Document Management (EDM)
|
||||
- Bookmarks management
|
||||
- Donations management
|
||||
- Reporting
|
||||
- Surveys
|
||||
- Data export/import
|
||||
- Barcodes support
|
||||
- Barcodes
|
||||
- Margin calculations
|
||||
- LDAP connectivity
|
||||
- ClickToDial integration
|
||||
- Mass emailing
|
||||
- RSS integration
|
||||
- Skype integration
|
||||
- Social platforms linking
|
||||
- Payment platforms integration (PayPal, Stripe, Paybox...)
|
||||
- …
|
||||
- Email-Collector
|
||||
|
||||
(around 100 modules available by default, 1000+ on the addon market place)
|
||||
|
||||
|
||||
### Other general features
|
||||
|
||||
@ -170,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
|
||||
|
||||
|
||||
74
dev/examples/zapier/creates/contact.js
Normal file
74
dev/examples/zapier/creates/contact.js
Normal file
@ -0,0 +1,74 @@
|
||||
/*jshint esversion: 6 */
|
||||
// create a particular contact by name
|
||||
const createContact = async (z, bundle) => {
|
||||
const apiurl = bundle.authData.url + '/api/index.php/contacts';
|
||||
|
||||
const response = await z.request({
|
||||
method: 'POST',
|
||||
url: apiurl,
|
||||
body: {
|
||||
name: bundle.inputData.name,
|
||||
name_alias: bundle.inputData.name_alias,
|
||||
ref_ext: bundle.inputData.ref_ext,
|
||||
ref_int: bundle.inputData.ref_int,
|
||||
address: bundle.inputData.address,
|
||||
zip: bundle.inputData.zip,
|
||||
town: bundle.inputData.town,
|
||||
country_code: bundle.inputData.country_code,
|
||||
country_id: bundle.inputData.country_id,
|
||||
country: bundle.inputData.country,
|
||||
phone: bundle.inputData.phone,
|
||||
email: bundle.inputData.email,
|
||||
sens: 'fromzapier'
|
||||
}
|
||||
});
|
||||
const result = z.JSON.parse(response.content);
|
||||
// api returns an integer when ok, a json when ko
|
||||
return result.response || {id: response};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'contact',
|
||||
noun: 'Contact',
|
||||
|
||||
display: {
|
||||
label: 'Create Contact',
|
||||
description: 'Creates a contact.'
|
||||
},
|
||||
|
||||
operation: {
|
||||
inputFields: [
|
||||
{key: 'name', required: true},
|
||||
{key: 'name_alias', required: false},
|
||||
{key: 'address', required: false},
|
||||
{key: 'zip', required: false},
|
||||
{key: 'town', required: false},
|
||||
{key: 'email', required: false}
|
||||
],
|
||||
perform: createContact,
|
||||
|
||||
sample: {
|
||||
id: 1,
|
||||
name: 'DUPOND',
|
||||
name_alias: 'DUPOND Ltd',
|
||||
address: 'Rue des Canaries',
|
||||
zip: '34090',
|
||||
town: 'MONTPELLIER',
|
||||
phone: '0123456789',
|
||||
fax: '2345678901',
|
||||
email: 'robot@domain.com'
|
||||
},
|
||||
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'name', label: 'Name'},
|
||||
{key: 'name_alias', label: 'Name alias'},
|
||||
{key: 'address', label: 'Address'},
|
||||
{key: 'zip', label: 'Zip'},
|
||||
{key: 'town', label: 'Town'},
|
||||
{key: 'phone', label: 'Phone'},
|
||||
{key: 'fax', label: 'Fax'},
|
||||
{key: 'email', label: 'Email'}
|
||||
]
|
||||
}
|
||||
};
|
||||
74
dev/examples/zapier/creates/member.js
Normal file
74
dev/examples/zapier/creates/member.js
Normal file
@ -0,0 +1,74 @@
|
||||
/*jshint esversion: 6 */
|
||||
// create a particular member by name
|
||||
const createMember = async (z, bundle) => {
|
||||
const apiurl = bundle.authData.url + '/api/index.php/members';
|
||||
|
||||
const response = await z.request({
|
||||
method: 'POST',
|
||||
url: apiurl,
|
||||
body: {
|
||||
name: bundle.inputData.name,
|
||||
name_alias: bundle.inputData.name_alias,
|
||||
ref_ext: bundle.inputData.ref_ext,
|
||||
ref_int: bundle.inputData.ref_int,
|
||||
address: bundle.inputData.address,
|
||||
zip: bundle.inputData.zip,
|
||||
town: bundle.inputData.town,
|
||||
country_code: bundle.inputData.country_code,
|
||||
country_id: bundle.inputData.country_id,
|
||||
country: bundle.inputData.country,
|
||||
phone: bundle.inputData.phone,
|
||||
email: bundle.inputData.email,
|
||||
sens: 'fromzapier'
|
||||
}
|
||||
});
|
||||
const result = z.JSON.parse(response.content);
|
||||
// api returns an integer when ok, a json when ko
|
||||
return result.response || {id: response};
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
key: 'member',
|
||||
noun: 'Member',
|
||||
|
||||
display: {
|
||||
label: 'Create Member',
|
||||
description: 'Creates a member.'
|
||||
},
|
||||
|
||||
operation: {
|
||||
inputFields: [
|
||||
{key: 'name', required: true},
|
||||
{key: 'name_alias', required: false},
|
||||
{key: 'address', required: false},
|
||||
{key: 'zip', required: false},
|
||||
{key: 'town', required: false},
|
||||
{key: 'email', required: false}
|
||||
],
|
||||
perform: createMember,
|
||||
|
||||
sample: {
|
||||
id: 1,
|
||||
name: 'DUPOND',
|
||||
name_alias: 'DUPOND Ltd',
|
||||
address: 'Rue des Canaries',
|
||||
zip: '34090',
|
||||
town: 'MONTPELLIER',
|
||||
phone: '0123456789',
|
||||
fax: '2345678901',
|
||||
email: 'robot@domain.com'
|
||||
},
|
||||
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'name', label: 'Name'},
|
||||
{key: 'name_alias', label: 'Name alias'},
|
||||
{key: 'address', label: 'Address'},
|
||||
{key: 'zip', label: 'Zip'},
|
||||
{key: 'town', label: 'Town'},
|
||||
{key: 'phone', label: 'Phone'},
|
||||
{key: 'fax', label: 'Fax'},
|
||||
{key: 'email', label: 'Email'}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -6,7 +6,7 @@ const createThirdparty = async (z, bundle) => {
|
||||
const response = await z.request({
|
||||
method: 'POST',
|
||||
url: apiurl,
|
||||
body: JSON.stringify({
|
||||
body: {
|
||||
name: bundle.inputData.name,
|
||||
name_alias: bundle.inputData.name_alias,
|
||||
ref_ext: bundle.inputData.ref_ext,
|
||||
@ -24,7 +24,7 @@ const createThirdparty = async (z, bundle) => {
|
||||
code_client: bundle.inputData.code_client,
|
||||
code_fournisseur: bundle.inputData.code_fournisseur,
|
||||
sens: 'fromzapier'
|
||||
})
|
||||
}
|
||||
});
|
||||
const result = z.JSON.parse(response.content);
|
||||
// api returns an integer when ok, a json when ko
|
||||
|
||||
@ -2,12 +2,18 @@
|
||||
const triggerAction = require('./triggers/action');
|
||||
const triggerOrder = require('./triggers/order');
|
||||
const triggerThirdparty = require('./triggers/thirdparty');
|
||||
const triggerContact = require('./triggers/contact');
|
||||
const triggerTicket = require('./triggers/ticket');
|
||||
const triggerUser = require('./triggers/user');
|
||||
const triggerMember = require('./triggers/member');
|
||||
|
||||
const searchThirdparty = require('./searches/thirdparty');
|
||||
const searchContact = require('./searches/contact');
|
||||
const searchMember = require('./searches/member');
|
||||
|
||||
const createThirdparty = require('./creates/thirdparty');
|
||||
const createContact = require('./creates/contact');
|
||||
const createMember = require('./creates/member');
|
||||
|
||||
const {
|
||||
config: authentication,
|
||||
@ -62,18 +68,24 @@ const App = {
|
||||
[triggerAction.key]: triggerAction,
|
||||
[triggerOrder.key]: triggerOrder,
|
||||
[triggerThirdparty.key]: triggerThirdparty,
|
||||
[triggerContact.key]: triggerContact,
|
||||
[triggerTicket.key]: triggerTicket,
|
||||
[triggerUser.key]: triggerUser,
|
||||
[triggerMember.key]: triggerMember,
|
||||
},
|
||||
|
||||
// If you want your searches to show up, you better include it here!
|
||||
searches: {
|
||||
[searchThirdparty.key]: searchThirdparty,
|
||||
[searchContact.key]: searchContact,
|
||||
[searchMember.key]: searchMember,
|
||||
},
|
||||
|
||||
// If you want your creates to show up, you better include it here!
|
||||
creates: {
|
||||
[createThirdparty.key]: createThirdparty,
|
||||
[createContact.key]: createContact,
|
||||
[createMember.key]: createMember,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dolibarr",
|
||||
"version": "1.13.0",
|
||||
"version": "1.14.0",
|
||||
"description": "An app for connecting Dolibarr to the Zapier platform.",
|
||||
"repository": "Dolibarr/dolibarr",
|
||||
"homepage": "https://www.dolibarr.org/",
|
||||
@ -11,11 +11,11 @@
|
||||
"test": "mocha --recursive"
|
||||
},
|
||||
"engines": {
|
||||
"node": "8.10.0",
|
||||
"node": "14.0.0",
|
||||
"npm": ">=5.6.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"zapier-platform-core": "11.0.0"
|
||||
"zapier-platform-core": "11.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "^5.2.0",
|
||||
|
||||
95
dev/examples/zapier/searches/contact.js
Normal file
95
dev/examples/zapier/searches/contact.js
Normal file
@ -0,0 +1,95 @@
|
||||
module.exports = {
|
||||
key: 'contact',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Contact',
|
||||
display: {
|
||||
label: 'Find a Contact',
|
||||
description: 'Search for contact.'
|
||||
},
|
||||
|
||||
// `operation` is where we make the call to your API to do the search
|
||||
operation: {
|
||||
// This search only has one search field. Your searches might have just one, or many
|
||||
// search fields.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'lastname',
|
||||
type: 'string',
|
||||
label: 'Lastname',
|
||||
helpText: 'Lastname to limit to the search to (i.e. The company or %company%).'
|
||||
},
|
||||
{
|
||||
key: 'email',
|
||||
type: 'string',
|
||||
label: 'Email',
|
||||
helpText: 'Email to limit to the search to.'
|
||||
}
|
||||
],
|
||||
|
||||
perform: async (z, bundle) => {
|
||||
const url = bundle.authData.url + '/api/index.php/contacts/';
|
||||
|
||||
// Put the search value in a query param. The details of how to build
|
||||
// a search URL will depend on how your API works.
|
||||
let filter = '';
|
||||
if (bundle.inputData.lastname) {
|
||||
filter = "t.lastname like \'%"+bundle.inputData.name+"%\'";
|
||||
}
|
||||
if (bundle.inputData.email) {
|
||||
if (bundle.inputData.lastname) {
|
||||
filter += " and ";
|
||||
}
|
||||
filter += "t.email like \'"+bundle.inputData.email+"\'";
|
||||
}
|
||||
const response = await z.request({
|
||||
url: url,
|
||||
// this parameter avoid throwing errors and let us manage them
|
||||
skipThrowForStatus: true,
|
||||
params: {
|
||||
sqlfilters: filter
|
||||
}
|
||||
});
|
||||
//z.console.log(response);
|
||||
if (response.status != 200) {
|
||||
return [];
|
||||
}
|
||||
return response.json;
|
||||
},
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
name: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
directions: '1. Boil Noodles\n2.Serve with sauce',
|
||||
style: 'italian'
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{
|
||||
key: 'id',
|
||||
type: "integer",
|
||||
label: 'ID'
|
||||
},
|
||||
{key: 'createdAt', type: "integer", label: 'Created At'},
|
||||
{key: 'name', label: 'Name'},
|
||||
{key: 'firstname', label: 'Firstname'},
|
||||
{key: 'directions', label: 'Directions'},
|
||||
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||
{
|
||||
key: 'style',
|
||||
label: 'Style'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
88
dev/examples/zapier/searches/member.js
Normal file
88
dev/examples/zapier/searches/member.js
Normal file
@ -0,0 +1,88 @@
|
||||
module.exports = {
|
||||
key: 'member',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Member',
|
||||
display: {
|
||||
label: 'Find a Member',
|
||||
description: 'Search for member.'
|
||||
},
|
||||
|
||||
// `operation` is where we make the call to your API to do the search
|
||||
operation: {
|
||||
// This search only has one search field. Your searches might have just one, or many
|
||||
// search fields.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'lastname',
|
||||
type: 'string',
|
||||
label: 'Lastname',
|
||||
helpText: 'Lastname to limit to the search to (i.e. The company or %company%).'
|
||||
},
|
||||
{
|
||||
key: 'email',
|
||||
type: 'string',
|
||||
label: 'Email',
|
||||
helpText: 'Email to limit to the search to.'
|
||||
}
|
||||
],
|
||||
|
||||
perform: async (z, bundle) => {
|
||||
const url = bundle.authData.url + '/api/index.php/members/';
|
||||
|
||||
// Put the search value in a query param. The details of how to build
|
||||
// a search URL will depend on how your API works.
|
||||
let filter = '';
|
||||
if (bundle.inputData.lastname) {
|
||||
filter = "t.lastname like \'%" + bundle.inputData.name + "%\'";
|
||||
}
|
||||
if (bundle.inputData.email) {
|
||||
if (bundle.inputData.lastname) {
|
||||
filter += " and ";
|
||||
}
|
||||
filter += "t.email like \'" + bundle.inputData.email + "\'";
|
||||
}
|
||||
const response = await z.request({
|
||||
url: url,
|
||||
// this parameter avoid throwing errors and let us manage them
|
||||
skipThrowForStatus: true,
|
||||
params: {
|
||||
sqlfilters: filter
|
||||
}
|
||||
});
|
||||
//z.console.log(response);
|
||||
if (response.status != 200) {
|
||||
return [];
|
||||
}
|
||||
return response.json;
|
||||
},
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
name: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{
|
||||
key: 'id',
|
||||
type: "integer",
|
||||
label: 'ID'
|
||||
},
|
||||
{ key: 'createdAt', type: "integer", label: 'Created At' },
|
||||
{ key: 'name', label: 'Name' },
|
||||
{ key: 'firstname', label: 'Firstname' },
|
||||
{ key: 'authorId', type: "integer", label: 'Author ID' },
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -19,21 +19,43 @@ module.exports = {
|
||||
type: 'string',
|
||||
label: 'Name',
|
||||
helpText: 'Name to limit to the search to (i.e. The company or %company%).'
|
||||
},
|
||||
{
|
||||
key: 'email',
|
||||
type: 'string',
|
||||
label: 'Email',
|
||||
helpText: 'Email to limit to the search to.'
|
||||
}
|
||||
],
|
||||
|
||||
perform: (z, bundle) => {
|
||||
perform: async (z, bundle) => {
|
||||
const url = bundle.authData.url + '/api/index.php/thirdparties/';
|
||||
|
||||
// Put the search value in a query param. The details of how to build
|
||||
// a search URL will depend on how your API works.
|
||||
const options = {
|
||||
params: {
|
||||
sqlfilters: "t.nom like \'%"+bundle.inputData.name+"%\'"
|
||||
let filter = '';
|
||||
if (bundle.inputData.name) {
|
||||
filter = "t.nom like \'%"+bundle.inputData.name+"%\'";
|
||||
}
|
||||
if (bundle.inputData.email) {
|
||||
if (bundle.inputData.name) {
|
||||
filter += " and ";
|
||||
}
|
||||
};
|
||||
|
||||
return z.request(url, options).then(response => JSON.parse(response.content));
|
||||
filter += "t.email like \'"+bundle.inputData.email+"\'";
|
||||
}
|
||||
const response = await z.request({
|
||||
url: url,
|
||||
// this parameter avoid throwing errors and let us manage them
|
||||
skipThrowForStatus: true,
|
||||
params: {
|
||||
sqlfilters: filter
|
||||
}
|
||||
});
|
||||
//z.console.log(response);
|
||||
if (response.status != 200) {
|
||||
return [];
|
||||
}
|
||||
return response.json;
|
||||
},
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
|
||||
171
dev/examples/zapier/triggers/contact.js
Normal file
171
dev/examples/zapier/triggers/contact.js
Normal file
@ -0,0 +1,171 @@
|
||||
const subscribeHook = (z, bundle) => {
|
||||
// `z.console.log()` is similar to `console.log()`.
|
||||
z.console.log('suscribing hook!');
|
||||
|
||||
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||
const data = {
|
||||
url: bundle.targetUrl,
|
||||
event: bundle.event,
|
||||
module: 'contact',
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
body: data,
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const unsubscribeHook = (z, bundle) => {
|
||||
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||
// request made initially.
|
||||
z.console.log('unsuscribing hook!');
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const getContact = (z, bundle) => {
|
||||
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||
// test poll) and also a .querystring property with the URL's query string.
|
||||
const contact = {
|
||||
id: bundle.cleanedRequest.id,
|
||||
name: bundle.cleanedRequest.name,
|
||||
name_alias: bundle.cleanedRequest.name_alias,
|
||||
firstname: bundle.cleanedRequest.firstname,
|
||||
address: bundle.cleanedRequest.address,
|
||||
zip: bundle.cleanedRequest.zip,
|
||||
town: bundle.cleanedRequest.town,
|
||||
email: bundle.cleanedRequest.email,
|
||||
phone_pro: bundle.cleanedRequest.phone_pro,
|
||||
phone_perso: bundle.cleanedRequest.phone_perso,
|
||||
phone_mobile: bundle.cleanedRequest.phone_mobile,
|
||||
authorId: bundle.cleanedRequest.authorId,
|
||||
createdAt: bundle.cleanedRequest.createdAt,
|
||||
action: bundle.cleanedRequest.action
|
||||
};
|
||||
|
||||
return [contact];
|
||||
};
|
||||
|
||||
const getFallbackRealContact = (z, bundle) => {
|
||||
// For the test poll, you should get some real data, to aid the setup process.
|
||||
const module = bundle.inputData.module;
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/contacts/0',
|
||||
};
|
||||
|
||||
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||
};
|
||||
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
// const getModulesChoices = () => {
|
||||
// return {
|
||||
// orders: "Order",
|
||||
// invoices: "Invoice",
|
||||
// contacts: "Contact",
|
||||
// contacts: "Contacts"
|
||||
// };
|
||||
// };
|
||||
|
||||
// const getActionsChoices = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
|
||||
// We recommend writing your triggers separate like this and rolling them
|
||||
// into the App definition at the end.
|
||||
module.exports = {
|
||||
key: 'contact',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Contact',
|
||||
display: {
|
||||
label: 'New Contact',
|
||||
description: 'Triggers when a new contact action is done in Dolibarr.'
|
||||
},
|
||||
|
||||
// `operation` is where the business logic goes.
|
||||
operation: {
|
||||
|
||||
// `inputFields` can define the fields a user could provide,
|
||||
// we'll pass them in as `bundle.inputData` later.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'action',
|
||||
required: true,
|
||||
type: 'string',
|
||||
helpText: 'Which action of contact this should trigger on.',
|
||||
choices: {
|
||||
create: "Create",
|
||||
modify: "Modify",
|
||||
validate: "Validate",
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
type: 'hook',
|
||||
|
||||
performSubscribe: subscribeHook,
|
||||
performUnsubscribe: unsubscribeHook,
|
||||
|
||||
perform: getContact,
|
||||
performList: getFallbackRealContact,
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
lastname: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
action: 'create'
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'createdAt', label: 'Created At'},
|
||||
{key: 'lastname', label: 'Lastname'},
|
||||
{key: 'firstname', label: 'Firstname'},
|
||||
{key: 'phone', label: 'Phone pro'},
|
||||
{key: 'phone_perso', label: 'Phone perso'},
|
||||
{key: 'phone_mobile', label: 'Phone mobile'},
|
||||
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||
{key: 'action', label: 'Action'}
|
||||
]
|
||||
}
|
||||
};
|
||||
171
dev/examples/zapier/triggers/member.js
Normal file
171
dev/examples/zapier/triggers/member.js
Normal file
@ -0,0 +1,171 @@
|
||||
const subscribeHook = (z, bundle) => {
|
||||
// `z.console.log()` is similar to `console.log()`.
|
||||
z.console.log('suscribing hook!');
|
||||
|
||||
// bundle.targetUrl has the Hook URL this app should call when an action is created.
|
||||
const data = {
|
||||
url: bundle.targetUrl,
|
||||
event: bundle.event,
|
||||
module: 'member',
|
||||
action: bundle.inputData.action
|
||||
};
|
||||
|
||||
const url = bundle.authData.url + '/api/index.php/zapierapi/hook';
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: url,
|
||||
method: 'POST',
|
||||
body: data,
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const unsubscribeHook = (z, bundle) => {
|
||||
// bundle.subscribeData contains the parsed response JSON from the subscribe
|
||||
// request made initially.
|
||||
z.console.log('unsuscribing hook!');
|
||||
|
||||
// You can build requests and our client will helpfully inject all the variables
|
||||
// you need to complete. You can also register middleware to control this.
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/zapierapi/hook/' + bundle.subscribeData.id,
|
||||
method: 'DELETE',
|
||||
};
|
||||
|
||||
// You may return a promise or a normal data structure from any perform method.
|
||||
return z.request(options).then((response) => JSON.parse(response.content));
|
||||
};
|
||||
|
||||
const getMember = (z, bundle) => {
|
||||
// bundle.cleanedRequest will include the parsed JSON object (if it's not a
|
||||
// test poll) and also a .querystring property with the URL's query string.
|
||||
const member = {
|
||||
id: bundle.cleanedRequest.id,
|
||||
name: bundle.cleanedRequest.name,
|
||||
name_alias: bundle.cleanedRequest.name_alias,
|
||||
firstname: bundle.cleanedRequest.firstname,
|
||||
address: bundle.cleanedRequest.address,
|
||||
zip: bundle.cleanedRequest.zip,
|
||||
town: bundle.cleanedRequest.town,
|
||||
email: bundle.cleanedRequest.email,
|
||||
phone_pro: bundle.cleanedRequest.phone_pro,
|
||||
phone_perso: bundle.cleanedRequest.phone_perso,
|
||||
phone_mobile: bundle.cleanedRequest.phone_mobile,
|
||||
authorId: bundle.cleanedRequest.authorId,
|
||||
createdAt: bundle.cleanedRequest.createdAt,
|
||||
action: bundle.cleanedRequest.action
|
||||
};
|
||||
|
||||
return [member];
|
||||
};
|
||||
|
||||
const getFallbackRealMember = (z, bundle) => {
|
||||
// For the test poll, you should get some real data, to aid the setup process.
|
||||
const module = bundle.inputData.module;
|
||||
const options = {
|
||||
url: bundle.authData.url + '/api/index.php/members/0',
|
||||
};
|
||||
|
||||
return z.request(options).then((response) => [JSON.parse(response.content)]);
|
||||
};
|
||||
|
||||
// const getModulesChoices = (z/*, bundle*/) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const options = {
|
||||
// url: bundle.authData.url + '/api/index.php/zapierapi/getmoduleschoices',
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
// const getModulesChoices = () => {
|
||||
// return {
|
||||
// orders: "Order",
|
||||
// invoices: "Invoice",
|
||||
// members: "Member",
|
||||
// members: "Members"
|
||||
// };
|
||||
// };
|
||||
|
||||
// const getActionsChoices = (z, bundle) => {
|
||||
// // For the test poll, you should get some real data, to aid the setup process.
|
||||
// const module = bundle.inputData.module;
|
||||
// const options = {
|
||||
// url: url: bundle.authData.url + '/api/index.php/zapierapi/getactionschoices/thirparty`,
|
||||
// };
|
||||
|
||||
// return z.request(options).then((response) => JSON.parse(response.content));
|
||||
// };
|
||||
|
||||
// We recommend writing your triggers separate like this and rolling them
|
||||
// into the App definition at the end.
|
||||
module.exports = {
|
||||
key: 'member',
|
||||
|
||||
// You'll want to provide some helpful display labels and descriptions
|
||||
// for users. Zapier will put them into the UX.
|
||||
noun: 'Member',
|
||||
display: {
|
||||
label: 'New Member',
|
||||
description: 'Triggers when a new member action is done in Dolibarr.'
|
||||
},
|
||||
|
||||
// `operation` is where the business logic goes.
|
||||
operation: {
|
||||
|
||||
// `inputFields` can define the fields a user could provide,
|
||||
// we'll pass them in as `bundle.inputData` later.
|
||||
inputFields: [
|
||||
{
|
||||
key: 'action',
|
||||
required: true,
|
||||
type: 'string',
|
||||
helpText: 'Which action of member this should trigger on.',
|
||||
choices: {
|
||||
create: "Create",
|
||||
modify: "Modify",
|
||||
validate: "Validate",
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
type: 'hook',
|
||||
|
||||
performSubscribe: subscribeHook,
|
||||
performUnsubscribe: unsubscribeHook,
|
||||
|
||||
perform: getMember,
|
||||
performList: getFallbackRealMember,
|
||||
|
||||
// In cases where Zapier needs to show an example record to the user, but we are unable to get a live example
|
||||
// from the API, Zapier will fallback to this hard-coded sample. It should reflect the data structure of
|
||||
// returned records, and have obviously dummy values that we can show to any user.
|
||||
sample: {
|
||||
id: 1,
|
||||
createdAt: 1472069465,
|
||||
lastname: 'DOE',
|
||||
firstname: 'John',
|
||||
authorId: 1,
|
||||
action: 'create'
|
||||
},
|
||||
|
||||
// If the resource can have fields that are custom on a per-user basis, define a function to fetch the custom
|
||||
// field definitions. The result will be used to augment the sample.
|
||||
// outputFields: () => { return []; }
|
||||
// Alternatively, a static field definition should be provided, to specify labels for the fields
|
||||
outputFields: [
|
||||
{key: 'id', type: "integer", label: 'ID'},
|
||||
{key: 'createdAt', label: 'Created At'},
|
||||
{key: 'lastname', label: 'Lastname'},
|
||||
{key: 'firstname', label: 'Firstname'},
|
||||
{key: 'phone', label: 'Phone pro'},
|
||||
{key: 'phone_perso', label: 'Phone perso'},
|
||||
{key: 'phone_mobile', label: 'Phone mobile'},
|
||||
{key: 'authorId', type: "integer", label: 'Author ID'},
|
||||
{key: 'action', label: 'Action'}
|
||||
]
|
||||
}
|
||||
};
|
||||
@ -56,6 +56,12 @@ const getThirdparty = (z, bundle) => {
|
||||
fournisseur: bundle.cleanedRequest.fournisseur,
|
||||
code_client: bundle.cleanedRequest.code_client,
|
||||
code_fournisseur: bundle.cleanedRequest.code_fournisseur,
|
||||
idprof1: bundle.cleanedRequest.idprof1,
|
||||
idprof2: bundle.cleanedRequest.idprof2,
|
||||
idprof3: bundle.cleanedRequest.idprof3,
|
||||
idprof4: bundle.cleanedRequest.idprof4,
|
||||
idprof5: bundle.cleanedRequest.idprof5,
|
||||
idprof6: bundle.cleanedRequest.idprof6,
|
||||
authorId: bundle.cleanedRequest.authorId,
|
||||
createdAt: bundle.cleanedRequest.createdAt,
|
||||
action: bundle.cleanedRequest.action
|
||||
@ -112,7 +118,7 @@ module.exports = {
|
||||
noun: 'Thirdparty',
|
||||
display: {
|
||||
label: 'New Thirdparty',
|
||||
description: 'Triggers when a new thirdpaty action is done in Dolibarr.'
|
||||
description: 'Triggers when a new thirdparty action is done in Dolibarr.'
|
||||
},
|
||||
|
||||
// `operation` is where the business logic goes.
|
||||
@ -170,7 +176,13 @@ module.exports = {
|
||||
{key: 'client', label: 'Customer/Prospect 0/1/2/3'},
|
||||
{key: 'fournisseur', label: 'Supplier 0/1'},
|
||||
{key: 'code_client', label: 'Customer code'},
|
||||
{key: 'code_fournisseur', label: 'Supplier code'}
|
||||
{key: 'code_fournisseur', label: 'Supplier code'},
|
||||
{key: 'idprof1', label: 'Id Prof 1'},
|
||||
{key: 'idprof2', label: 'Id Prof 2'},
|
||||
{key: 'idprof3', label: 'Id Prof 3'},
|
||||
{key: 'idprof4', label: 'Id Prof 4'},
|
||||
{key: 'idprof5', label: 'Id Prof 5'},
|
||||
{key: 'idprof6', label: 'Id Prof 6'}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
@ -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
|
||||
|
||||
@ -444,7 +444,7 @@ if ($search_country_id > 0) {
|
||||
} else {
|
||||
$sql .= " WHERE ";
|
||||
}
|
||||
$sql .= " (a.fk_country = ".$search_country_id." OR a.fk_country = 0)";
|
||||
$sql .= " (a.fk_country = ".((int) $search_country_id)." OR a.fk_country = 0)";
|
||||
}
|
||||
|
||||
// If sort order is "country", we use country_code instead
|
||||
|
||||
@ -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>';
|
||||
}
|
||||
@ -401,14 +401,14 @@ if ($action != 'export_csv') {
|
||||
print '<tr class="liste_total">';
|
||||
print '<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="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit)).'</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($sous_total_debit - $sous_total_credit)).'</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
@ -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 = '';
|
||||
@ -443,14 +443,14 @@ if ($action != 'export_csv') {
|
||||
}
|
||||
}
|
||||
// Debit
|
||||
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->debit).'</a></td>';
|
||||
// Credit
|
||||
print '<td class="nowraponall right"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
|
||||
print '<td class="right nowraponall amount"><a href="'.$urlzoom.'">'.price($line->credit).'</a></td>';
|
||||
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowraponall right">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($opening_balance + $line->debit - $line->credit, 'MT')).'</td>';
|
||||
} else {
|
||||
print '<td class="nowraponall right">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($line->debit - $line->credit, 'MT')).'</td>';
|
||||
}
|
||||
print '<td class="center">';
|
||||
print $link;
|
||||
@ -466,14 +466,14 @@ 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="nowrap right">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($sous_total_credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($sous_total_credit).'</td>';
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($sous_total_opening_balance + $sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
} else {
|
||||
print '<td class="nowrap right">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
print '<td class="right nowraponall amount">' . price(price2num($sous_total_debit - $sous_total_credit, 'MT')) . '</td>';
|
||||
}
|
||||
print "<td></td>\n";
|
||||
print '</tr>';
|
||||
@ -483,12 +483,12 @@ if ($action != 'export_csv') {
|
||||
if (!empty($conf->global->ACCOUNTANCY_SHOW_OPENING_BALANCE)) {
|
||||
print '<td class="nowrap right">'.price($total_opening_balance).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($total_debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($total_credit).'</td>';
|
||||
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>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -537,6 +537,22 @@ if ($action == 'create') {
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date document creation
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("DateExport").'</td>';
|
||||
print '<td>';
|
||||
print $object->date_export ? dol_print_date($object->date_export, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Date document creation
|
||||
print '<tr>';
|
||||
print '<td class="titlefield">'.$langs->trans("DateValidation").'</td>';
|
||||
print '<td>';
|
||||
print $object->date_validation ? dol_print_date($object->date_validation, 'dayhour') : ' ';
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Validate
|
||||
/*
|
||||
print '<tr>';
|
||||
@ -619,7 +635,9 @@ if ($action == 'create') {
|
||||
print_liste_field_titre("LabelOperation");
|
||||
print_liste_field_titre("Debit", "", "", "", "", 'class="right"');
|
||||
print_liste_field_titre("Credit", "", "", "", "", 'class="right"');
|
||||
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
|
||||
if (empty($object->date_validation)) {
|
||||
print_liste_field_titre("Action", "", "", "", "", 'width="60" class="center"');
|
||||
}
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
@ -662,21 +680,25 @@ if ($action == 'create') {
|
||||
}
|
||||
print '</td>';
|
||||
print '<td>'.$line->label_operation.'</td>';
|
||||
print '<td class="nowrap right">'.price($line->debit).'</td>';
|
||||
print '<td class="nowrap right">'.price($line->credit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($line->debit).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($line->credit).'</td>';
|
||||
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda reposition" href="'.$_SERVER["PHP_SELF"].'?action=update&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
|
||||
print img_edit('', 0, 'class="marginrightonly"');
|
||||
print '</a> ';
|
||||
|
||||
$actiontodelete = 'delete';
|
||||
if ($mode == '_tmp' || $action != 'delmouv') {
|
||||
$actiontodelete = 'confirm_delete';
|
||||
if (empty($line->date_export) || empty($line->date_validation)) {
|
||||
print '<td class="center">';
|
||||
print '<a class="editfielda reposition" href="' . $_SERVER["PHP_SELF"] . '?action=update&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
||||
print img_edit('', 0, 'class="marginrightonly"');
|
||||
print '</a> ';
|
||||
}
|
||||
|
||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action='.$actiontodelete.'&id='.$line->id.'&piece_num='.urlencode($line->piece_num).'&mode='.urlencode($mode).'&token='.urlencode(newToken()).'">';
|
||||
print img_delete();
|
||||
if (empty($line->date_validation)) {
|
||||
$actiontodelete = 'delete';
|
||||
if ($mode == '_tmp' || $action != 'delmouv') {
|
||||
$actiontodelete = 'confirm_delete';
|
||||
}
|
||||
|
||||
print '<a href="' . $_SERVER["PHP_SELF"] . '?action=' . $actiontodelete . '&id=' . $line->id . '&piece_num=' . urlencode($line->piece_num) . '&mode=' . urlencode($mode) . '&token=' . urlencode(newToken()) . '">';
|
||||
print img_delete();
|
||||
}
|
||||
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
@ -691,32 +713,33 @@ if ($action == 'create') {
|
||||
setEventMessages(null, array($langs->trans('MvtNotCorrectlyBalanced', $total_debit, $total_credit)), 'warnings');
|
||||
}
|
||||
|
||||
if ($action == "" || $action == 'add') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<!-- td columns in add mode -->';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccount")).'">';
|
||||
if (empty($object->date_export) || empty($object->date_validation)) {
|
||||
if ($action == "" || $action == 'add') {
|
||||
print '<tr class="oddeven">';
|
||||
print '<!-- td columns in add mode -->';
|
||||
print '<td>';
|
||||
print $formaccounting->select_account('', 'accountingaccount_number', 1, array(), 1, 1, '');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
// TODO For the moment we keep a free input text instead of a combo. The select_auxaccount has problem because:
|
||||
// It does not use the setup of "key pressed" to select a thirdparty and this hang browser on large databases.
|
||||
// Also, it is not possible to use a value that is not in the list.
|
||||
// Also, the label is not automatically filled when a value is selected.
|
||||
if (!empty($conf->global->ACCOUNTANCY_COMBO_FOR_AUX)) {
|
||||
print $formaccounting->select_auxaccount('', 'subledger_account', 1);
|
||||
} else {
|
||||
print '<input type="text" class="maxwidth150" name="subledger_account" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccount")) . '">';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="' . dol_escape_htmltag($langs->trans("SubledgerAccountLabel")) . '">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="' . $label_operation . '"/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="' . $langs->trans("Add") . '"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<br><input type="text" class="maxwidth150" name="subledger_label" value="" placeholder="'.dol_escape_htmltag($langs->trans("SubledgerAccountLabel")).'">';
|
||||
print '</td>';
|
||||
print '<td><input type="text" class="minwidth200" name="label_operation" value="'.$label_operation.'"/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="debit" value=""/></td>';
|
||||
print '<td class="right"><input type="text" size="6" class="right" name="credit" value=""/></td>';
|
||||
print '<td><input type="submit" class="button" name="save" value="'.$langs->trans("Add").'"></td>';
|
||||
print '</tr>';
|
||||
print '</table>';
|
||||
}
|
||||
print '</table>';
|
||||
|
||||
|
||||
if ($mode == '_tmp' && $action == '') {
|
||||
print '<br>';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* Copyright (C) 2013-2016 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2020 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2013-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* Copyright (C) 2016-2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2018-2021 Frédéric France <frederic.france@netlogic.fr>
|
||||
*
|
||||
@ -44,15 +44,47 @@ $action = GETPOST('action', 'aZ09');
|
||||
$search_mvt_num = GETPOST('search_mvt_num', 'int');
|
||||
$search_doc_type = GETPOST("search_doc_type", 'alpha');
|
||||
$search_doc_ref = GETPOST("search_doc_ref", 'alpha');
|
||||
$search_date_start = dol_mktime(0, 0, 0, GETPOST('search_date_startmonth', 'int'), GETPOST('search_date_startday', 'int'), GETPOST('search_date_startyear', 'int'));
|
||||
$search_date_end = dol_mktime(23, 59, 59, GETPOST('search_date_endmonth', 'int'), GETPOST('search_date_endday', 'int'), GETPOST('search_date_endyear', 'int'));
|
||||
$search_date_startyear = GETPOST('search_date_startyear', 'int');
|
||||
$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
|
||||
$search_date_startday = GETPOST('search_date_startday', 'int');
|
||||
$search_date_endyear = GETPOST('search_date_endyear', 'int');
|
||||
$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
|
||||
$search_date_endday = GETPOST('search_date_endday', 'int');
|
||||
$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear);
|
||||
$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
|
||||
$search_doc_date = dol_mktime(0, 0, 0, GETPOST('doc_datemonth', 'int'), GETPOST('doc_dateday', 'int'), GETPOST('doc_dateyear', 'int'));
|
||||
$search_date_creation_start = dol_mktime(0, 0, 0, GETPOST('date_creation_startmonth', 'int'), GETPOST('date_creation_startday', 'int'), GETPOST('date_creation_startyear', 'int'));
|
||||
$search_date_creation_end = dol_mktime(23, 59, 59, GETPOST('date_creation_endmonth', 'int'), GETPOST('date_creation_endday', 'int'), GETPOST('date_creation_endyear', 'int'));
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, GETPOST('date_modification_startmonth', 'int'), GETPOST('date_modification_startday', 'int'), GETPOST('date_modification_startyear', 'int'));
|
||||
$search_date_modification_end = dol_mktime(23, 59, 59, GETPOST('date_modification_endmonth', 'int'), GETPOST('date_modification_endday', 'int'), GETPOST('date_modification_endyear', 'int'));
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, GETPOST('date_export_startmonth', 'int'), GETPOST('date_export_startday', 'int'), GETPOST('date_export_startyear', 'int'));
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, GETPOST('date_export_endmonth', 'int'), GETPOST('date_export_endday', 'int'), GETPOST('date_export_endyear', 'int'));
|
||||
$search_date_creation_startyear = GETPOST('search_date_creation_startyear', 'int');
|
||||
$search_date_creation_startmonth = GETPOST('search_date_creation_startmonth', 'int');
|
||||
$search_date_creation_startday = GETPOST('search_date_creation_startday', 'int');
|
||||
$search_date_creation_endyear = GETPOST('search_date_creation_endyear', 'int');
|
||||
$search_date_creation_endmonth = GETPOST('search_date_creation_endmonth', 'int');
|
||||
$search_date_creation_endday = GETPOST('search_date_creation_endday', 'int');
|
||||
$search_date_creation_start = dol_mktime(0, 0, 0, $search_date_creation_startmonth, $search_date_creation_startday, $search_date_creation_startyear);
|
||||
$search_date_creation_end = dol_mktime(23, 59, 59, $search_date_creation_endmonth, $search_date_creation_endday, $search_date_creation_endyear);
|
||||
$search_date_modification_startyear = GETPOST('search_date_modification_startyear', 'int');
|
||||
$search_date_modification_startmonth = GETPOST('search_date_modification_startmonth', 'int');
|
||||
$search_date_modification_startday = GETPOST('search_date_modification_startday', 'int');
|
||||
$search_date_modification_endyear = GETPOST('search_date_modification_endyear', 'int');
|
||||
$search_date_modification_endmonth = GETPOST('search_date_modification_endmonth', 'int');
|
||||
$search_date_modification_endday = GETPOST('search_date_modification_endday', 'int');
|
||||
$search_date_modification_start = dol_mktime(0, 0, 0, $search_date_modification_startmonth, $search_date_modification_startday, $search_date_modification_startyear);
|
||||
$search_date_modification_end = dol_mktime(23, 59, 59, $search_date_modification_endmonth, $search_date_modification_endday, $search_date_modification_endyear);
|
||||
$search_date_export_startyear = GETPOST('search_date_export_startyear', 'int');
|
||||
$search_date_export_startmonth = GETPOST('search_date_export_startmonth', 'int');
|
||||
$search_date_export_startday = GETPOST('search_date_export_startday', 'int');
|
||||
$search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
|
||||
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
|
||||
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_validation_startyear = GETPOST('search_date_validation_startyear', 'int');
|
||||
$search_date_validation_startmonth = GETPOST('search_date_validation_startmonth', 'int');
|
||||
$search_date_validation_startday = GETPOST('search_date_validation_startday', 'int');
|
||||
$search_date_validation_endyear = GETPOST('search_date_validation_endyear', 'int');
|
||||
$search_date_validation_endmonth = GETPOST('search_date_validation_endmonth', 'int');
|
||||
$search_date_validation_endday = GETPOST('search_date_validation_endday', 'int');
|
||||
$search_date_validation_start = dol_mktime(0, 0, 0, $search_date_validation_startmonth, $search_date_validation_startday, $search_date_validation_startyear);
|
||||
$search_date_validation_end = dol_mktime(23, 59, 59, $search_date_validation_endmonth, $search_date_validation_endday, $search_date_validation_endyear);
|
||||
|
||||
//var_dump($search_date_start);exit;
|
||||
if (GETPOST("button_delmvt_x") || GETPOST("button_delmvt.x") || GETPOST("button_delmvt")) {
|
||||
@ -157,6 +189,7 @@ $arrayfields = array(
|
||||
't.date_creation'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0),
|
||||
't.tms'=>array('label'=>$langs->trans("DateModification"), 'checked'=>0),
|
||||
't.date_export'=>array('label'=>$langs->trans("DateExport"), 'checked'=>1),
|
||||
't.date_validated'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
|
||||
);
|
||||
|
||||
if (empty($conf->global->ACCOUNTING_ENABLE_LETTERING)) {
|
||||
@ -216,14 +249,46 @@ if (empty($reshook)) {
|
||||
$search_mvt_label = '';
|
||||
$search_direction = '';
|
||||
$search_ledger_code = array();
|
||||
$search_date_startyear = '';
|
||||
$search_date_startmonth = '';
|
||||
$search_date_startday = '';
|
||||
$search_date_endyear = '';
|
||||
$search_date_endmonth = '';
|
||||
$search_date_endday = '';
|
||||
$search_date_start = '';
|
||||
$search_date_end = '';
|
||||
$search_date_creation_startyear = '';
|
||||
$search_date_creation_startmonth = '';
|
||||
$search_date_creation_startday = '';
|
||||
$search_date_creation_endyear = '';
|
||||
$search_date_creation_endmonth = '';
|
||||
$search_date_creation_endday = '';
|
||||
$search_date_creation_start = '';
|
||||
$search_date_creation_end = '';
|
||||
$search_date_modification_startyear = '';
|
||||
$search_date_modification_startmonth = '';
|
||||
$search_date_modification_startday = '';
|
||||
$search_date_modification_endyear = '';
|
||||
$search_date_modification_endmonth = '';
|
||||
$search_date_modification_endday = '';
|
||||
$search_date_modification_start = '';
|
||||
$search_date_modification_end = '';
|
||||
$search_date_export_startyear = '';
|
||||
$search_date_export_startmonth = '';
|
||||
$search_date_export_startday = '';
|
||||
$search_date_export_endyear = '';
|
||||
$search_date_export_endmonth = '';
|
||||
$search_date_export_endday = '';
|
||||
$search_date_export_start = '';
|
||||
$search_date_export_end = '';
|
||||
$search_date_validation_startyear = '';
|
||||
$search_date_validation_startmonth = '';
|
||||
$search_date_validation_startday = '';
|
||||
$search_date_validation_endyear = '';
|
||||
$search_date_validation_endmonth = '';
|
||||
$search_date_validation_endday = '';
|
||||
$search_date_validation_start = '';
|
||||
$search_date_validation_end = '';
|
||||
$search_debit = '';
|
||||
$search_credit = '';
|
||||
$search_lettering_code = '';
|
||||
@ -328,6 +393,16 @@ if (empty($reshook)) {
|
||||
$tmp = dol_getdate($search_date_export_end);
|
||||
$param .= '&date_export_endmonth='.urlencode($tmp['mon']).'&date_export_endday='.urlencode($tmp['mday']).'&date_export_endyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_validation_start)) {
|
||||
$filter['t.date_validated>='] = $search_date_validation_start;
|
||||
$tmp = dol_getdate($search_date_validation_start);
|
||||
$param .= '&date_validation_startmonth='.urlencode($tmp['mon']).'&date_validation_startday='.urlencode($tmp['mday']).'&date_validation_startyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_date_validation_end)) {
|
||||
$filter['t.date_validated<='] = $search_date_validation_end;
|
||||
$tmp = dol_getdate($search_date_validation_end);
|
||||
$param .= '&date_validation_endmonth='.urlencode($tmp['mon']).'&date_validation_endday='.urlencode($tmp['mday']).'&date_validation_endyear='.urlencode($tmp['year']);
|
||||
}
|
||||
if (!empty($search_debit)) {
|
||||
$filter['t.debit'] = $search_debit;
|
||||
$param .= '&search_debit='.urlencode($search_debit);
|
||||
@ -447,7 +522,8 @@ $sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.tms as date_modification,";
|
||||
$sql .= " t.date_export";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$object->table_element.' as t';
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
@ -471,6 +547,8 @@ if (count($filter) > 0) {
|
||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
||||
$sqlwhere[] = $key.'\''.$db->idate($value).'\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} elseif ($key == 't.reconciled_option') {
|
||||
@ -508,10 +586,13 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
$accountancyexport = new AccountancyExport($db);
|
||||
$accountancyexport->export($object->lines, $formatexportset);
|
||||
|
||||
$notifiedexportdate = GETPOST('notifiedexportdate', 'alpha');
|
||||
$notifiedvalidationdate = GETPOST('notifiedvalidationdate', 'alpha');
|
||||
|
||||
if (!empty($accountancyexport->errors)) {
|
||||
setEventMessages('', $accountancyexport->errors, 'errors');
|
||||
} else {
|
||||
// Specify as export : update field date_export
|
||||
} elseif (!$notifiedexportdate || !$notifiedvalidationdate) {
|
||||
// Specify as export : update field date_export or date_validated
|
||||
$error = 0;
|
||||
$db->begin();
|
||||
|
||||
@ -520,8 +601,15 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
$now = dol_now();
|
||||
|
||||
$sql = " UPDATE ".MAIN_DB_PREFIX."accounting_bookkeeping";
|
||||
$sql .= " SET date_export = '".$db->idate($now)."'";
|
||||
$sql .= " , date_validated = '".$db->idate($now)."'";
|
||||
$sql .= " SET";
|
||||
if (!$notifiedexportdate && !$notifiedvalidationdate) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
$sql .= ", date_validated = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedexportdate) {
|
||||
$sql .= " date_export = '".$db->idate($now)."'";
|
||||
} elseif (!$notifiedvalidationdate) {
|
||||
$sql .= " date_validated = '".$db->idate($now)."'";
|
||||
}
|
||||
$sql .= " WHERE rowid = ".((int) $movement->id);
|
||||
|
||||
dol_syslog("/accountancy/bookeeping/list.php Function export_file Specify movements as exported sql=".$sql, LOG_DEBUG);
|
||||
@ -535,11 +623,11 @@ if ($action == 'export_fileconfirm' && $user->rights->accounting->mouvements->ex
|
||||
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExported"), null, 'mesgs');
|
||||
// setEventMessages($langs->trans("AllExportedMovementsWereRecordedAsExportedOrValidated"), null, 'mesgs');
|
||||
} else {
|
||||
$error++;
|
||||
$db->rollback();
|
||||
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExported"), null, 'errors');
|
||||
setEventMessages($langs->trans("NotAllExportedMovementsCouldBeRecordedAsExportedOrValidated"), null, 'errors');
|
||||
}
|
||||
}
|
||||
exit;
|
||||
@ -587,6 +675,8 @@ if (is_numeric($nbtotalofrecords) && $limit > $nbtotalofrecords) {
|
||||
|
||||
llxHeader('', $title_page);
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
if ($action == 'export_file') {
|
||||
$form_question = array();
|
||||
|
||||
@ -598,17 +688,15 @@ if ($action == 'export_file') {
|
||||
);
|
||||
$form_question['notifiedvalidationdate'] = array(
|
||||
'name' => 'notifiedvalidationdate',
|
||||
'type' => 'checkbox', // We don't use select here, the journal_array is already a select html component
|
||||
'type' => 'checkbox',
|
||||
'label' => $langs->trans('NotifiedValidationDate'),
|
||||
'value' => (!empty($conf->global->ACCOUNTING_DEFAULT_NOT_NOTIFIED_VALIDATION_DATE) ? 'false' : 'true'),
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300);
|
||||
print $formconfirm;
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans("ExportFilteredList").' ('.$listofformat[$formatexportset].')', $langs->trans('ConfirmExportFile'), 'export_fileconfirm', $form_question, '', 1, 300, 600);
|
||||
}
|
||||
if ($action == 'delmouv') {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?mvt_num='.GETPOST('mvt_num').$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvtPartial'), 'delmouvconfirm', '', 0, 1);
|
||||
print $formconfirm;
|
||||
}
|
||||
if ($action == 'delbookkeepingyear') {
|
||||
$form_question = array();
|
||||
@ -648,9 +736,11 @@ if ($action == 'delbookkeepingyear') {
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?'.$param, $langs->trans('DeleteMvt'), $langs->trans('ConfirmDeleteMvt', $langs->transnoentitiesnoconv("RegistrationInAccounting")), 'delbookkeepingyearconfirm', $form_question, '', 1, 300);
|
||||
print $formconfirm;
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
//$param=''; param started before
|
||||
if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
|
||||
$param .= '&contextpage='.urlencode($contextpage);
|
||||
@ -669,6 +759,8 @@ print '<input type="hidden" name="formfilteraction" id="formfilteraction" value=
|
||||
print '<input type="hidden" name="sortfield" value="'.urlencode($sortfield).'">';
|
||||
print '<input type="hidden" name="sortorder" value="'.urlencode($sortorder).'">';
|
||||
|
||||
$massactionbutton = '';
|
||||
|
||||
if (count($filter)) {
|
||||
$buttonLabel = $langs->trans("ExportFilteredList");
|
||||
} else {
|
||||
@ -701,7 +793,7 @@ if (empty($reshook)) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('NewAccountingMvt'), '', 'fa fa-plus-circle paddingleft', $url, '', $user->rights->accounting->mouvements->creer);
|
||||
}
|
||||
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
print_barre_liste($title_page, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_accountancy', 0, $newcardbutton, '', $limit, 0, 0, 1);
|
||||
|
||||
$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||
@ -841,6 +933,17 @@ if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Date validation
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="liste_titre center">';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_start, 'date_validation_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("From"));
|
||||
print '</div>';
|
||||
print '<div class="nowrap">';
|
||||
print $form->selectDate($search_date_validation_end, 'date_validation_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans("to"));
|
||||
print '</div>';
|
||||
print '</td>';
|
||||
}
|
||||
// Action column
|
||||
print '<td class="liste_titre center">';
|
||||
$searchpicto = $form->showFilterButtons();
|
||||
@ -892,6 +995,9 @@ if (!empty($arrayfields['t.tms']['checked'])) {
|
||||
if (!empty($arrayfields['t.date_export']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_export']['label'], $_SERVER['PHP_SELF'], "t.date_export", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print_liste_field_titre($arrayfields['t.date_validated']['label'], $_SERVER['PHP_SELF'], "t.date_validated", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||
}
|
||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
|
||||
print "</tr>\n";
|
||||
|
||||
@ -934,6 +1040,7 @@ while ($i < min($num, $limit)) {
|
||||
$line->date_creation = $db->jdate($obj->date_creation);
|
||||
$line->date_modification = $db->jdate($obj->date_modification);
|
||||
$line->date_export = $db->jdate($obj->date_export);
|
||||
$line->date_validation = $db->jdate($obj->date_validation);
|
||||
|
||||
$total_debit += $line->debit;
|
||||
$total_credit += $line->credit;
|
||||
@ -1067,7 +1174,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->debit != 0 ? price($line->debit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -1079,7 +1186,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount credit
|
||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->credit != 0 ? price($line->credit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -1126,12 +1233,22 @@ while ($i < min($num, $limit)) {
|
||||
}
|
||||
}
|
||||
|
||||
// Validated operation date
|
||||
if (!empty($arrayfields['t.date_validated']['checked'])) {
|
||||
print '<td class="center">'.dol_print_date($line->date_validation, 'dayhour').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
}
|
||||
|
||||
// Action column
|
||||
print '<td class="nowraponall center">';
|
||||
if (empty($line->date_export)) {
|
||||
if (empty($line->date_export) || empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->creer) {
|
||||
print '<a class="editfielda paddingleft marginrightonly" href="'.DOL_URL_ROOT.'/accountancy/bookkeeping/card.php?piece_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_edit().'</a>';
|
||||
print '<a class="editfielda paddingleft marginrightonly" href="' . DOL_URL_ROOT . '/accountancy/bookkeeping/card.php?piece_num=' . $line->piece_num . $param . '&page=' . $page . ($sortfield ? '&sortfield=' . $sortfield : '') . ($sortorder ? '&sortorder=' . $sortorder : '') . '">' . img_edit() . '</a>';
|
||||
}
|
||||
}
|
||||
if (empty($line->date_validation)) {
|
||||
if ($user->rights->accounting->mouvements->supprimer) {
|
||||
print '<a class="reposition paddingleft marginrightonly" href="'.$_SERVER['PHP_SELF'].'?action=delmouv&mvt_num='.$line->piece_num.$param.'&page='.$page.($sortfield ? '&sortfield='.$sortfield : '').($sortorder ? '&sortorder='.$sortorder : '').'">'.img_delete().'</a>';
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ $search_date_export_endyear = GETPOST('search_date_export_endyear', 'int');
|
||||
$search_date_export_endmonth = GETPOST('search_date_export_endmonth', 'int');
|
||||
$search_date_export_endday = GETPOST('search_date_export_endday', 'int');
|
||||
$search_date_export_start = dol_mktime(0, 0, 0, $search_date_export_startmonth, $search_date_export_startday, $search_date_export_startyear);
|
||||
$search_date_export_end = dol_mktime(0, 0, 0, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
$search_date_export_end = dol_mktime(23, 59, 59, $search_date_export_endmonth, $search_date_export_endday, $search_date_export_endyear);
|
||||
|
||||
$search_accountancy_code = GETPOST("search_accountancy_code");
|
||||
$search_accountancy_code_start = GETPOST('search_accountancy_code_start', 'alpha');
|
||||
@ -807,7 +807,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -819,7 +819,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount credit
|
||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -682,7 +682,7 @@ while ($i < min($num, $limit)) {
|
||||
print "<tr>";
|
||||
print '<td colspan="'.($totalarray['nbfield'] ? $totalarray['nbfield'] : 10).'" style="font-weight:bold; border-bottom: 1pt solid black;">';
|
||||
if ($line->subledger_account != "" && $line->subledger_account != '-1') {
|
||||
print $object->get_compte_desc($line->numero_compte).' : '.length_accounta($line->subledger_account);
|
||||
print $line->subledger_label.' : '.length_accounta($line->subledger_account);
|
||||
} else {
|
||||
// Should not happen: subledger account must be null or a non empty value
|
||||
print '<span class="error">'.$langs->trans("Unknown");
|
||||
@ -821,7 +821,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount debit
|
||||
if (!empty($arrayfields['t.debit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->debit ? price($line->debit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
@ -833,7 +833,7 @@ while ($i < min($num, $limit)) {
|
||||
|
||||
// Amount credit
|
||||
if (!empty($arrayfields['t.credit']['checked'])) {
|
||||
print '<td class="nowrap right">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
print '<td class="right nowraponall amount">'.($line->credit ? price($line->credit) : '').'</td>';
|
||||
if (!$i) {
|
||||
$totalarray['nbfield']++;
|
||||
}
|
||||
|
||||
@ -296,15 +296,15 @@ if ($resql) {
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
|
||||
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td colspan="4"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td colspan="6"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -293,15 +293,15 @@ if ($resql) {
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Total").':</td>'."\n";
|
||||
print '<td class="nowrap right"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit).'</strong></td>';
|
||||
print '<td colspan="6"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="right" colspan="3">'.$langs->trans("Balancing").':</td>'."\n";
|
||||
print '<td colspan="2"> </td>';
|
||||
print '<td class="nowrap right"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td class="right nowraponall amount"><strong>'.price($credit - $debit).'</strong></td>';
|
||||
print '<td colspan="4"></td>';
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
@ -201,7 +201,7 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= "entity";
|
||||
$sql .= ") VALUES (";
|
||||
if ($this->rowid > 0) {
|
||||
$sql .= " ".$this->rowid.",";
|
||||
$sql .= " ".((int) $this->rowid).",";
|
||||
}
|
||||
$sql .= " ".(!isset($this->code) ? 'NULL' : "'".$this->db->escape($this->code)."'").",";
|
||||
$sql .= " ".(!isset($this->label) ? 'NULL' : "'".$this->db->escape($this->label)."'").",";
|
||||
@ -209,9 +209,9 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= " ".(!isset($this->sens) ? 'NULL' : "'".$this->db->escape($this->sens)."'").",";
|
||||
$sql .= " ".(!isset($this->category_type) ? 'NULL' : "'".$this->db->escape($this->category_type)."'").",";
|
||||
$sql .= " ".(!isset($this->formula) ? 'NULL' : "'".$this->db->escape($this->formula)."'").",";
|
||||
$sql .= " ".(!isset($this->position) ? 'NULL' : $this->db->escape($this->position)).",";
|
||||
$sql .= " ".(!isset($this->fk_country) ? 'NULL' : $this->db->escape($this->fk_country)).",";
|
||||
$sql .= " ".(!isset($this->active) ? 'NULL' : $this->db->escape($this->active));
|
||||
$sql .= " ".(!isset($this->position) ? 'NULL' : ((int) $this->position)).",";
|
||||
$sql .= " ".(!isset($this->fk_country) ? 'NULL' : ((int) $this->fk_country)).",";
|
||||
$sql .= " ".(!isset($this->active) ? 'NULL' : ((int) $this->active));
|
||||
$sql .= ", ".$conf->entity;
|
||||
$sql .= ")";
|
||||
|
||||
@ -263,7 +263,7 @@ class AccountancyCategory // extends CommonObject
|
||||
if ($id) {
|
||||
$sql .= " WHERE t.rowid = ".((int) $id);
|
||||
} else {
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Dont't use entity if you use rowid
|
||||
$sql .= " WHERE t.entity IN (".getEntity('c_accounting_category').")"; // Don't use entity if you use rowid
|
||||
if ($code) {
|
||||
$sql .= " AND t.code = '".$this->db->escape($code)."'";
|
||||
} elseif ($label) {
|
||||
@ -675,7 +675,7 @@ class AccountancyCategory // extends CommonObject
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_accounting_category as c";
|
||||
$sql .= " WHERE c.active = 1";
|
||||
$sql .= " AND c.entity = ".$conf->entity;
|
||||
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
|
||||
$sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)";
|
||||
$sql .= " AND cat.rowid = t.fk_accounting_category";
|
||||
$sql .= " AND t.entity = ".$conf->entity;
|
||||
$sql .= " ORDER BY cat.position ASC";
|
||||
@ -806,7 +806,7 @@ class AccountancyCategory // extends CommonObject
|
||||
if ($categorytype >= 0) {
|
||||
$sql .= " AND c.category_type = 1";
|
||||
}
|
||||
$sql .= " AND (c.fk_country = ".$mysoc->country_id." OR c.fk_country = 0)";
|
||||
$sql .= " AND (c.fk_country = ".((int) $mysoc->country_id)." OR c.fk_country = 0)";
|
||||
$sql .= " ORDER BY c.position ASC";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -561,9 +561,9 @@ class AccountancyExport
|
||||
$Tab['contrepartie'] = str_repeat(' ', 8);
|
||||
|
||||
// Force date format : %d%m%y
|
||||
if (!empty($data->date_echeance)) {
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%y'); // Format must be ddmmyy
|
||||
if (!empty($data->date_lim_reglement)) {
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%y'); // Format must be ddmmyy
|
||||
} else {
|
||||
$Tab['date_echeance'] = '000000';
|
||||
}
|
||||
@ -660,9 +660,9 @@ class AccountancyExport
|
||||
|
||||
$Tab['code_stat'] = str_repeat(' ', 4);
|
||||
|
||||
if (!empty($data->date_echeance)) {
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_echeance, '%d%m%Y');
|
||||
if (!empty($data->date_lim_reglement)) {
|
||||
//$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, $conf->global->ACCOUNTING_EXPORT_DATE);
|
||||
$Tab['date_echeance'] = dol_print_date($data->date_lim_reglement, '%d%m%Y');
|
||||
} else {
|
||||
$Tab['date_echeance'] = dol_print_date($data->doc_date, '%d%m%Y');
|
||||
}
|
||||
|
||||
@ -602,7 +602,7 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account ";
|
||||
$sql .= "SET ".$fieldtouse." = '0'";
|
||||
$sql .= " WHERE rowid = ".$this->db->escape($id);
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
||||
dol_syslog(get_class($this)."::accountDeactivate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
@ -640,7 +640,7 @@ class AccountingAccount extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."accounting_account";
|
||||
$sql .= " SET ".$fieldtouse." = '1'";
|
||||
$sql .= " WHERE rowid = ".$this->db->escape($id);
|
||||
$sql .= " WHERE rowid = ".((int) $id);
|
||||
|
||||
dol_syslog(get_class($this)."::account_activate ".$fieldtouse." sql=".$sql, LOG_DEBUG);
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@ -294,14 +294,14 @@ class BookKeeping extends CommonObject
|
||||
$sql = "SELECT count(*) as nb";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'";
|
||||
$sql .= " AND fk_doc = ".$this->fk_doc;
|
||||
$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);
|
||||
|
||||
@ -312,13 +312,13 @@ class BookKeeping extends CommonObject
|
||||
$sqlnum = "SELECT piece_num";
|
||||
$sqlnum .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sqlnum .= " WHERE doc_type = '".$this->db->escape($this->doc_type)."'"; // For example doc_type = 'bank'
|
||||
$sqlnum .= " AND fk_doc = ".$this->fk_doc;
|
||||
$sqlnum .= " AND fk_doc = ".((int) $this->fk_doc);
|
||||
if (!empty($conf->global->ACCOUNTANCY_ENABLE_FKDOCDET)) {
|
||||
// fk_docdet is rowid into llx_bank or llx_facturedet or llx_facturefourndet, or ...
|
||||
$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) {
|
||||
@ -728,7 +728,9 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.code_journal,";
|
||||
$sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.$mode.' as t';
|
||||
$sql .= ' WHERE 1 = 1';
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
@ -769,6 +771,9 @@ class BookKeeping extends CommonObject
|
||||
$this->journal_label = $obj->journal_label;
|
||||
$this->piece_num = $obj->piece_num;
|
||||
$this->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$this->date_export = $this->db->jdate($obj->date_export);
|
||||
$this->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$this->date_validation = $this->db->jdate($obj->date_validation);
|
||||
}
|
||||
$this->db->free($resql);
|
||||
|
||||
@ -834,7 +839,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.journal_label,";
|
||||
$sql .= " t.piece_num,";
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.date_export";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
if (count($filter) > 0) {
|
||||
@ -853,6 +859,8 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} elseif ($key == 't.reconciled_option') {
|
||||
@ -926,6 +934,8 @@ class BookKeeping extends CommonObject
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $this->db->jdate($obj->date_creation);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
@ -987,7 +997,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " t.date_creation,";
|
||||
$sql .= " t.date_lim_reglement,";
|
||||
$sql .= " t.tms as date_modification,";
|
||||
$sql .= " t.date_export";
|
||||
$sql .= " t.date_export,";
|
||||
$sql .= " t.date_validated as date_validation";
|
||||
$sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t';
|
||||
// Manage filter
|
||||
$sqlwhere = array();
|
||||
@ -1009,6 +1020,8 @@ class BookKeeping extends CommonObject
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_export>=' || $key == 't.date_export<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.date_validated>=' || $key == 't.date_validated<=') {
|
||||
$sqlwhere[] = $key.'\''.$this->db->idate($value).'\'';
|
||||
} elseif ($key == 't.credit' || $key == 't.debit') {
|
||||
$sqlwhere[] = natural_search($key, $value, 1, 1);
|
||||
} else {
|
||||
@ -1054,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;
|
||||
@ -1068,6 +1081,8 @@ class BookKeeping extends CommonObject
|
||||
$line->date_lim_reglement = $this->db->jdate($obj->date_lim_reglement);
|
||||
$line->date_modification = $this->db->jdate($obj->date_modification);
|
||||
$line->date_export = $this->db->jdate($obj->date_export);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validated);
|
||||
$line->date_validation = $this->db->jdate($obj->date_validation);
|
||||
|
||||
$this->lines[] = $line;
|
||||
|
||||
@ -1454,6 +1469,8 @@ class BookKeeping extends CommonObject
|
||||
$sql .= " AND code_journal = '".$this->db->escape($journal)."'";
|
||||
}
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
// Exclusion of validated entries at the time of deletion
|
||||
$sql .= " AND date_validated IS NULL";
|
||||
|
||||
// TODO: In a future we must forbid deletion if record is inside a closed fiscal period.
|
||||
|
||||
@ -1603,7 +1620,8 @@ class BookKeeping extends CommonObject
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$sql = "SELECT piece_num,doc_date,code_journal,journal_label,doc_ref,doc_type,date_creation";
|
||||
$sql = "SELECT piece_num, doc_date,code_journal, journal_label, doc_ref, doc_type,";
|
||||
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||
$sql .= " WHERE piece_num = ".$piecenum;
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
@ -1620,6 +1638,10 @@ class BookKeeping extends CommonObject
|
||||
$this->doc_ref = $obj->doc_ref;
|
||||
$this->doc_type = $obj->doc_type;
|
||||
$this->date_creation = $obj->date_creation;
|
||||
$this->date_modification = $obj->date_modification;
|
||||
$this->date_export = $obj->date_export;
|
||||
$this->date_validation = $obj->date_validated;
|
||||
$this->date_validation = $obj->date_validation;
|
||||
} else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
dol_syslog(__METHOD__.$this->error, LOG_ERR);
|
||||
@ -1675,7 +1697,8 @@ class BookKeeping extends CommonObject
|
||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
|
||||
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num, date_creation";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, journal_label, piece_num,";
|
||||
$sql .= " date_creation, tms as date_modification, date_export, date_validated as date_validation";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element.$mode;
|
||||
$sql .= " WHERE piece_num = ".$piecenum;
|
||||
$sql .= " AND entity IN (".getEntity('accountancy').")";
|
||||
@ -1708,6 +1731,10 @@ class BookKeeping extends CommonObject
|
||||
$line->journal_label = $obj->journal_label;
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_creation = $obj->date_creation;
|
||||
$line->date_modification = $obj->date_modification;
|
||||
$line->date_export = $obj->date_export;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesmvt[] = $line;
|
||||
}
|
||||
@ -1735,7 +1762,8 @@ class BookKeeping extends CommonObject
|
||||
$sql = "SELECT rowid, doc_date, doc_type,";
|
||||
$sql .= " doc_ref, fk_doc, fk_docdet, thirdparty_code, subledger_account, subledger_label,";
|
||||
$sql .= " numero_compte, label_compte, label_operation, debit, credit,";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num";
|
||||
$sql .= " montant as amount, sens, fk_user_author, import_key, code_journal, piece_num,";
|
||||
$sql .= " date_validated as date_validation";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX.$this->table_element;
|
||||
$sql .= " WHERE entity IN (".getEntity('accountancy').")";
|
||||
|
||||
@ -1770,6 +1798,8 @@ class BookKeeping extends CommonObject
|
||||
$line->sens = $obj->sens;
|
||||
$line->code_journal = $obj->code_journal;
|
||||
$line->piece_num = $obj->piece_num;
|
||||
$line->date_validation = $obj->date_validated;
|
||||
$line->date_validation = $obj->date_validation;
|
||||
|
||||
$this->linesexport[] = $line;
|
||||
}
|
||||
@ -2103,4 +2133,9 @@ class BookKeepingLine
|
||||
* @var integer|string $date_export;
|
||||
*/
|
||||
public $date_export;
|
||||
|
||||
/**
|
||||
* @var integer|string $date_validation;
|
||||
*/
|
||||
public $date_validation;
|
||||
}
|
||||
|
||||
@ -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/>.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -29,7 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formaccounting.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/accountancy/class/bookkeeping.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
$socid = GETPOST('socid', 'int');
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
// Security check
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
@ -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";
|
||||
@ -319,10 +322,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -405,10 +408,10 @@ if ($resql) {
|
||||
print '</td>';
|
||||
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -472,9 +475,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -533,9 +536,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price(price2num($row[$i])).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price(price2num($row[$i])).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price(price2num($row[13])).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price(price2num($row[13])).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
@ -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">';
|
||||
@ -492,7 +492,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
|
||||
|
||||
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||
|
||||
|
||||
@ -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);
|
||||
@ -687,7 +687,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">';
|
||||
print '<td class="right nowraponall amount">';
|
||||
print price($objp->total_ht);
|
||||
print '</td>';
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/accounting.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
$month_start = ($conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1);
|
||||
if (GETPOST("year", 'int')) {
|
||||
@ -210,10 +210,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -290,10 +290,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -352,9 +352,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
|
||||
@ -388,7 +388,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Amount without taxes
|
||||
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
|
||||
|
||||
// Vat rate
|
||||
print '<td class="center">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||
|
||||
@ -434,7 +434,7 @@ if ($result) {
|
||||
print '</td>';
|
||||
|
||||
// Amount without taxes
|
||||
print '<td class="nowrap right">';
|
||||
print '<td class="right nowraponall amount">';
|
||||
print price($objp->price);
|
||||
print '</td>';
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ if (empty($user->rights->compta->resultat->lire) && empty($user->rights->account
|
||||
if (GETPOST('addbox')) {
|
||||
// Add box (when submit is done from a form when ajax disabled)
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
$zone = GETPOST('areacode', 'aZ09');
|
||||
$zone = GETPOST('areacode', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$boxorder = GETPOST('boxorder', 'aZ09');
|
||||
$boxorder .= GETPOST('boxcombo', 'aZ09');
|
||||
|
||||
@ -1108,8 +1108,8 @@ if (empty($action) || $action == 'view') {
|
||||
print $reflabel;
|
||||
print "</td>";
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1222,8 +1222,8 @@ if (empty($action) || $action == 'view') {
|
||||
print "</td>";
|
||||
print "<td>".$reflabel."</td>";
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1259,8 +1259,8 @@ if (empty($action) || $action == 'view') {
|
||||
print "</td>";
|
||||
print "<td>".$reflabel."</td>";
|
||||
print '<td class="center">'.$val["type_payment"]."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1320,7 +1320,7 @@ function getSourceDocRef($val, $typerecord)
|
||||
if ($typerecord == 'payment') {
|
||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"];
|
||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".((int) $val["paymentid"]);
|
||||
$ref = $langs->transnoentitiesnoconv("Invoice");
|
||||
} elseif ($typerecord == 'payment_supplier') {
|
||||
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';
|
||||
|
||||
@ -610,8 +610,8 @@ if (empty($action) || $action == 'view') {
|
||||
$userstatic->id = $tabuser[$key]['id'];
|
||||
$userstatic->name = $tabuser[$key]['name'];
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -644,8 +644,8 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
print '</td>';
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("SubledgerAccount")."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -680,8 +680,8 @@ if (empty($action) || $action == 'view') {
|
||||
print '</td>';
|
||||
print "<td>".$userstatic->getNomUrl(0, 'user', 16).' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)) {
|
||||
@ -911,8 +911,8 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("SubledgerAccount")."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -940,8 +940,8 @@ if (empty($action) || $action == 'view') {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -977,8 +977,8 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>";
|
||||
print $companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
@ -1005,8 +1005,8 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>";
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'supplier', 16).' - '.$invoicestatic->ref_supplier.' - '.$langs->trans("VAT")." NPR (counterpart)</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -851,8 +851,8 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("SubledgerAccount")."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -880,8 +880,8 @@ if (empty($action) || $action == 'view') {
|
||||
$companystatic->id = $tabcompany[$key]['id'];
|
||||
$companystatic->name = $tabcompany[$key]['name'];
|
||||
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$accountingaccount->label."</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
@ -916,8 +916,8 @@ if (empty($action) || $action == 'view') {
|
||||
print '</td>';
|
||||
print "<td>".$companystatic->getNomUrl(0, 'customer', 16).' - '.$invoicestatic->ref.' - '.$langs->trans("VAT").' '.join(', ', $def_tva[$key][$k]).' %'.($numtax ? ' - Localtax '.$numtax : '');
|
||||
print "</td>";
|
||||
print '<td class="right nowraponall">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt < 0 ? price(-$mt) : '')."</td>";
|
||||
print '<td class="right nowraponall amount">'.($mt >= 0 ? price($mt) : '')."</td>";
|
||||
print "</tr>";
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("compta", "bills", "other", "main", "accountancy"));
|
||||
$langs->loadLangs(array("compta", "bills", "other", "accountancy"));
|
||||
|
||||
// Security check
|
||||
if (empty($conf->accounting->enabled)) {
|
||||
@ -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";
|
||||
@ -314,10 +317,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -393,10 +396,10 @@ if ($resql) {
|
||||
}
|
||||
print '</td>';
|
||||
for ($i = 2; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right">'.price($row[13]).'</td>';
|
||||
print '<td class="nowrap right"><b>'.price($row[14]).'</b></td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[13]).'</td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[14]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
@ -456,9 +459,9 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
|
||||
while ($row = $db->fetch_row($resql)) {
|
||||
print '<tr><td>'.$row[0].'</td>';
|
||||
for ($i = 1; $i <= 12; $i++) {
|
||||
print '<td class="nowrap right">'.price($row[$i]).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($row[$i]).'</td>';
|
||||
}
|
||||
print '<td class="nowrap right"><b>'.price($row[13]).'</b></td>';
|
||||
print '<td class="right nowraponall amount"><b>'.price($row[13]).'</b></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
$db->free($resql);
|
||||
|
||||
@ -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">';
|
||||
@ -497,7 +497,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">'.price($objp->total_ht).'</td>';
|
||||
print '<td class="right nowraponall amount">'.price($objp->total_ht).'</td>';
|
||||
|
||||
print '<td class="right">'.vatrate($objp->tva_tx.($objp->vat_src_code ? ' ('.$objp->vat_src_code.')' : '')).'</td>';
|
||||
|
||||
@ -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);
|
||||
@ -671,7 +671,7 @@ if ($result) {
|
||||
print $form->textwithtooltip(dol_trunc($text, $trunclength), $objp->description);
|
||||
print '</td>';
|
||||
|
||||
print '<td class="nowrap right">';
|
||||
print '<td class="right nowraponall amount">';
|
||||
print price($objp->total_ht);
|
||||
print '</td>';
|
||||
|
||||
@ -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">';
|
||||
|
||||
@ -68,7 +68,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Morphy"); ?></td>
|
||||
<td colspan="3"><input name="morphy" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
<td colspan="3"><input name="morphy" type="text" class="minwidth200" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@ -105,7 +105,7 @@ echo $this->control->tpl['ajax_selectcountry']; ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Email"); ?></td>
|
||||
<td colspan="3"><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
<td colspan="3"><input name="email" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -77,7 +77,7 @@ echo $this->control->tpl['ajax_selectcountry'];
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Morphy"); ?></td>
|
||||
<td colspan="3"><input name="poste" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
<td colspan="3"><input name="poste" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['select_morphy']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
@ -114,7 +114,7 @@ echo $this->control->tpl['ajax_selectcountry'];
|
||||
|
||||
<tr>
|
||||
<td><?php echo $langs->trans("Email"); ?></td>
|
||||
<td><input name="email" type="text" size="50" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
<td><input name="email" type="text" class="minwidth200" maxlength="80" value="<?php echo $this->control->tpl['email']; ?>"></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
@ -1727,15 +1727,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");
|
||||
@ -1908,7 +1907,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
}
|
||||
|
||||
// Reactivate
|
||||
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $Object->statut) {
|
||||
if (Adherent::STATUS_RESILIATED == $object->statut || Adherent::STATUS_EXCLUDED == $object->statut) {
|
||||
if ($user->rights->adherent->creer) {
|
||||
print '<a class="butAction" href="card.php?rowid='.$id.'&action=valid">'.$langs->trans("Reenable")."</a>\n";
|
||||
} else {
|
||||
|
||||
@ -260,9 +260,9 @@ class Adherent extends CommonObject
|
||||
|
||||
public $datefin;
|
||||
|
||||
// From member table
|
||||
|
||||
// Fields loaded by fetch_subscriptions()
|
||||
// Fields loaded by fetch_subscriptions() from member table
|
||||
|
||||
public $first_subscription_date;
|
||||
|
||||
public $first_subscription_amount;
|
||||
@ -277,6 +277,12 @@ class Adherent extends CommonObject
|
||||
|
||||
public $subscriptions = array();
|
||||
|
||||
|
||||
// Fields loaded by fetchPartnerships() from partnership table
|
||||
|
||||
public $partnerships = array();
|
||||
|
||||
|
||||
/**
|
||||
* @var Adherent To contains a clone of this when we need to save old properties of object
|
||||
*/
|
||||
@ -296,15 +302,15 @@ class Adherent extends CommonObject
|
||||
'entity' => array('type' => 'integer', 'label' => 'Entity', 'default' => 1, 'enabled' => 1, 'visible' => -2, 'notnull' => 1, 'position' => 15, 'index' => 1),
|
||||
'ref_ext' => array('type' => 'varchar(128)', 'label' => 'Ref ext', 'enabled' => 1, 'visible' => 0, 'position' => 20),
|
||||
'civility' => array('type' => 'varchar(6)', 'label' => 'Civility', 'enabled' => 1, 'visible' => -1, 'position' => 25),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35),
|
||||
'lastname' => array('type' => 'varchar(50)', 'label' => 'Lastname', 'enabled' => 1, 'visible' => -1, 'position' => 30, 'showoncombobox'=>1),
|
||||
'firstname' => array('type' => 'varchar(50)', 'label' => 'Firstname', 'enabled' => 1, 'visible' => -1, 'position' => 35, 'showoncombobox'=>1),
|
||||
'login' => array('type' => 'varchar(50)', 'label' => 'Login', 'enabled' => 1, 'visible' => -1, 'position' => 40),
|
||||
'gender' => array('type' => 'varchar(10)', 'label' => 'Gender', 'enabled' => 1, 'visible' => -1, 'position' => 250),
|
||||
'pass' => array('type' => 'varchar(50)', 'label' => 'Pass', 'enabled' => 1, 'visible' => -1, 'position' => 45),
|
||||
'pass_crypted' => array('type' => 'varchar(128)', 'label' => 'Pass crypted', 'enabled' => 1, 'visible' => -1, 'position' => 50),
|
||||
'fk_adherent_type' => array('type' => 'integer', 'label' => 'Fk adherent type', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 55),
|
||||
'morphy' => array('type' => 'varchar(3)', 'label' => 'MorPhy', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'position' => 60),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65),
|
||||
'societe' => array('type' => 'varchar(128)', 'label' => 'Societe', 'enabled' => 1, 'visible' => -1, 'position' => 65, 'showoncombobox'=>2),
|
||||
'fk_soc' => array('type' => 'integer:Societe:societe/class/societe.class.php', 'label' => 'ThirdParty', 'enabled' => 1, 'visible' => -1, 'position' => 70),
|
||||
'address' => array('type' => 'text', 'label' => 'Address', 'enabled' => 1, 'visible' => -1, 'position' => 75),
|
||||
'zip' => array('type' => 'varchar(10)', 'label' => 'Zip', 'enabled' => 1, 'visible' => -1, 'position' => 80),
|
||||
@ -592,8 +598,8 @@ class Adherent extends CommonObject
|
||||
if ($this->user_id) {
|
||||
// Add link to user
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
|
||||
$sql .= " fk_member = ".$this->id;
|
||||
$sql .= " WHERE rowid = ".$this->user_id;
|
||||
$sql .= " fk_member = ".((int) $this->id);
|
||||
$sql .= " WHERE rowid = ".((int) $this->user_id);
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) {
|
||||
@ -722,7 +728,7 @@ class Adherent extends CommonObject
|
||||
if (!empty($this->oldcopy) && $this->typeid != $this->oldcopy->typeid) {
|
||||
$sql2 = "SELECT libelle as label";
|
||||
$sql2 .= " FROM ".MAIN_DB_PREFIX."adherent_type";
|
||||
$sql2 .= " WHERE rowid = ".$this->typeid;
|
||||
$sql2 .= " WHERE rowid = ".((int) $this->typeid);
|
||||
$resql2 = $this->db->query($sql2);
|
||||
if ($resql2) {
|
||||
while ($obj = $this->db->fetch_object($resql2)) {
|
||||
@ -1439,11 +1445,12 @@ class Adherent extends CommonObject
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Function to get member subscriptions data
|
||||
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
|
||||
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
|
||||
* Function to get member subscriptions data:
|
||||
* subscriptions,
|
||||
* first_subscription_date, first_subscription_date_start, first_subscription_date_end, first_subscription_amount
|
||||
* last_subscription_date, last_subscription_date_start, last_subscription_date_end, last_subscription_amount
|
||||
*
|
||||
* @return int <0 si KO, >0 si OK
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetch_subscriptions()
|
||||
{
|
||||
@ -1475,7 +1482,7 @@ class Adherent extends CommonObject
|
||||
$this->first_subscription_amount = $obj->subscription;
|
||||
}
|
||||
$this->last_subscription_date = $this->db->jdate($obj->datec);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_date_start = $this->db->jdate($obj->dateh);
|
||||
$this->last_subscription_date_end = $this->db->jdate($obj->datef);
|
||||
$this->last_subscription_amount = $obj->subscription;
|
||||
|
||||
@ -1503,6 +1510,25 @@ class Adherent extends CommonObject
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Function to get partnerships array
|
||||
*
|
||||
* @param string $mode 'member' or 'thirdparty'
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
public function fetchPartnerships($mode)
|
||||
{
|
||||
global $langs;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/parntership/class/partnership.class.php';
|
||||
|
||||
|
||||
$this->partnerships[] = array();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Insert subscription into database and eventually add links to banks, mailman, etc...
|
||||
*
|
||||
@ -1712,7 +1738,8 @@ class Adherent extends CommonObject
|
||||
}
|
||||
}
|
||||
$invoice->socid = $this->fk_soc;
|
||||
$invoice->date = $datesubscription;
|
||||
//$invoice->date = $datesubscription;
|
||||
$invoice->date = dol_now();
|
||||
|
||||
// Possibility to add external linked objects with hooks
|
||||
$invoice->linked_objects['subscription'] = $subscriptionid;
|
||||
|
||||
@ -362,7 +362,7 @@ class AdherentType extends CommonObject
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent_type ";
|
||||
$sql .= "SET ";
|
||||
$sql .= "statut = ".$this->status.",";
|
||||
$sql .= "statut = ".((int) $this->status).",";
|
||||
$sql .= "libelle = '".$this->db->escape($this->label)."',";
|
||||
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
|
||||
$sql .= "subscription = '".$this->db->escape($this->subscription)."',";
|
||||
@ -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');
|
||||
|
||||
@ -228,12 +228,12 @@ class Members extends DolibarrApi
|
||||
}
|
||||
$sql .= ' WHERE t.entity IN ('.getEntity('adherent').')';
|
||||
if (!empty($typeid)) {
|
||||
$sql .= ' AND t.fk_adherent_type='.$typeid;
|
||||
$sql .= ' AND t.fk_adherent_type='.((int) $typeid);
|
||||
}
|
||||
// Select members of given category
|
||||
if ($category > 0) {
|
||||
$sql .= " AND c.fk_categorie = ".$this->db->escape($category);
|
||||
$sql .= " AND c.fk_member = t.rowid ";
|
||||
$sql .= " AND c.fk_categorie = ".((int) $category);
|
||||
$sql .= " AND c.fk_member = t.rowid";
|
||||
}
|
||||
// Add sql filters
|
||||
if ($sqlfilters) {
|
||||
|
||||
@ -168,7 +168,7 @@ class Subscription extends CommonObject
|
||||
$sql .= " VALUES (".((int) $this->fk_adherent).", '".$this->db->escape($type)."', '".$this->db->idate($now)."',";
|
||||
$sql .= " '".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " '".$this->db->idate($this->datef)."',";
|
||||
$sql .= " ".$this->amount.",";
|
||||
$sql .= " ".((float) $this->amount).",";
|
||||
$sql .= " '".$this->db->escape($this->note_public ? $this->note_public : $this->note)."')";
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
@ -267,14 +267,14 @@ class Subscription extends CommonObject
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."subscription SET ";
|
||||
$sql .= " fk_type = ".$this->fk_type.",";
|
||||
$sql .= " fk_adherent = ".$this->fk_adherent.",";
|
||||
$sql .= " fk_type = ".((int) $this->fk_type).",";
|
||||
$sql .= " fk_adherent = ".((int) $this->fk_adherent).",";
|
||||
$sql .= " note=".($this->note ? "'".$this->db->escape($this->note)."'" : 'null').",";
|
||||
$sql .= " subscription = ".price2num($this->amount).",";
|
||||
$sql .= " dateadh='".$this->db->idate($this->dateh)."',";
|
||||
$sql .= " datef='".$this->db->idate($this->datef)."',";
|
||||
$sql .= " datec='".$this->db->idate($this->datec)."',";
|
||||
$sql .= " fk_bank = ".($this->fk_bank ? $this->fk_bank : 'null');
|
||||
$sql .= " fk_bank = ".($this->fk_bank ? ((int) $this->fk_bank) : 'null');
|
||||
$sql .= " WHERE rowid = ".$this->id;
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
@ -341,7 +341,7 @@ class Subscription extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".$this->id;
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."subscription WHERE rowid = ".((int) $this->id);
|
||||
dol_syslog(get_class($this)."::delete", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql) {
|
||||
|
||||
@ -182,7 +182,7 @@ if ($id > 0) {
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$modulepart = 'member';
|
||||
$permission = $user->rights->adherent->creer;
|
||||
$permissiontoadd = $user->rights->adherent->creer;
|
||||
$permtoedit = $user->rights->adherent->creer;
|
||||
$param = '&id='.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
|
||||
@ -52,7 +52,7 @@ $result = restrictedArea($user, 'adherent');
|
||||
if (GETPOST('addbox')) {
|
||||
// Add box (when submit is done from a form when ajax disabled)
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/infobox.class.php';
|
||||
$zone = GETPOST('areacode', 'aZ09');
|
||||
$zone = GETPOST('areacode', 'int');
|
||||
$userid = GETPOST('userid', 'int');
|
||||
$boxorder = GETPOST('boxorder', 'aZ09');
|
||||
$boxorder .= GETPOST('boxcombo', 'aZ09');
|
||||
|
||||
@ -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
|
||||
@ -473,28 +474,28 @@ llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacu
|
||||
|
||||
$titre = $langs->trans("MembersList");
|
||||
if (GETPOSTISSET("search_status")) {
|
||||
if ($search_status == '-1,1') {
|
||||
if ($search_status == '-1,1') { // TODO : check this test as -1 == Adherent::STATUS_DRAFT and -2 == Adherent::STATUS_EXLCUDED
|
||||
$titre = $langs->trans("MembersListQualified");
|
||||
}
|
||||
if ($search_status == '-1') {
|
||||
if ($search_status == Adherent::STATUS_DRAFT) {
|
||||
$titre = $langs->trans("MembersListToValid");
|
||||
}
|
||||
if ($search_status == '1' && $filter == '') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == '') {
|
||||
$titre = $langs->trans("MembersValidated");
|
||||
}
|
||||
if ($search_status == '1' && $filter == 'withoutsubscription') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'withoutsubscription') {
|
||||
$titre = $langs->trans("MembersWithSubscriptionToReceive");
|
||||
}
|
||||
if ($search_status == '1' && $filter == 'uptodate') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'uptodate') {
|
||||
$titre = $langs->trans("MembersListUpToDate");
|
||||
}
|
||||
if ($search_status == '1' && $filter == 'outofdate') {
|
||||
if ($search_status == Adherent::STATUS_VALIDATED && $filter == 'outofdate') {
|
||||
$titre = $langs->trans("MembersListNotUpToDate");
|
||||
}
|
||||
if ($search_status == '0') {
|
||||
if ($search_status == Adherent::STATUS_RESILIATED) {
|
||||
$titre = $langs->trans("MembersListResiliated");
|
||||
}
|
||||
if ($search_status == '-2') {
|
||||
if ($search_status == Adherent::STATUS_EXCLUDED) {
|
||||
$titre = $langs->trans("MembersListExcluded");
|
||||
}
|
||||
} elseif ($action == 'search') {
|
||||
@ -571,7 +572,7 @@ if ($search_phone_mobile != '') {
|
||||
if ($search_filter && $search_filter != '-1') {
|
||||
$param .= "&search_filter=".urlencode($search_filter);
|
||||
}
|
||||
if ($search_status != "" && $search_status != '-1') {
|
||||
if ($search_status != "" && $search_status != Adherent::STATUS_DRAFT) {
|
||||
$param .= "&search_status=".urlencode($search_status);
|
||||
}
|
||||
if ($search_type > 0) {
|
||||
@ -796,10 +797,10 @@ if (!empty($arrayfields['d.tms']['checked'])) {
|
||||
if (!empty($arrayfields['d.statut']['checked'])) {
|
||||
print '<td class="liste_titre right maxwidthonsmartphone">';
|
||||
$liststatus = array(
|
||||
'-1'=>$langs->trans("Draft"),
|
||||
'1'=>$langs->trans("Validated"),
|
||||
'0'=>$langs->trans("MemberStatusResiliatedShort"),
|
||||
'-2'=>$langs->trans("MemberStatusExcludedShort")
|
||||
Adherent::STATUS_DRAFT => $langs->trans("Draft"),
|
||||
Adherent::STATUS_VALIDATED => $langs->trans("Validated"),
|
||||
Adherent::STATUS_RESILIATED => $langs->trans("MemberStatusResiliatedShort"),
|
||||
Adherent::STATUS_EXCLUDED =>$langs->trans("MemberStatusExcludedShort")
|
||||
);
|
||||
print $form->selectarray('search_status', $liststatus, $search_status, -3);
|
||||
print '</td>';
|
||||
|
||||
@ -44,50 +44,20 @@
|
||||
//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res = 0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
||||
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php using relative path
|
||||
if (!$res && file_exists("../main.inc.php")) {
|
||||
$res = @include "../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../main.inc.php")) {
|
||||
$res = @include "../../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../../main.inc.php")) {
|
||||
$res = @include "../../../main.inc.php";
|
||||
}
|
||||
if (!$res) {
|
||||
die("Include of main fails");
|
||||
}
|
||||
|
||||
require '../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
|
||||
dol_include_once('/partnership/class/partnership.class.php');
|
||||
dol_include_once('/partnership/lib/partnership.lib.php');
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/class/partnership.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/partnership/lib/partnership.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("companies","members","partnership", "other"));
|
||||
|
||||
// Get parameters
|
||||
$id = GETPOST('id', 'int');
|
||||
$memberid = GETPOST('rowid', 'int');
|
||||
$id = GETPOST('rowid', 'int') ? GETPOST('rowid', 'int') : GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
@ -97,9 +67,9 @@ $backtopage = GETPOST('backtopage', 'alpha');
|
||||
$backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
||||
//$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
$member = new Adherent($db);
|
||||
if ($memberid > 0) {
|
||||
$member->fetch($memberid);
|
||||
$object = new Adherent($db);
|
||||
if ($id > 0) {
|
||||
$object->fetch($id);
|
||||
}
|
||||
|
||||
// Initialize technical objects
|
||||
@ -141,15 +111,15 @@ if (empty($conf->partnership->enabled)) accessforbidden();
|
||||
if (empty($permissiontoread)) accessforbidden();
|
||||
if ($action == 'edit' && empty($permissiontoadd)) accessforbidden();
|
||||
|
||||
$partnershipid = $object->fetch(0, "", $memberid);
|
||||
if (empty($action) && empty($partnershipid)) {
|
||||
$action = 'create';
|
||||
if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) {
|
||||
accessforbidden();
|
||||
}
|
||||
if (($action == 'update' || $action == 'edit') && $object->status != $object::STATUS_DRAFT) accessforbidden();
|
||||
|
||||
if (empty($memberid) && $object) {
|
||||
$memberid = $object->fk_member;
|
||||
}
|
||||
|
||||
// Security check
|
||||
$result = restrictedArea($user, 'adherent', $id, '', '', 'socid', 'rowid', 0);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
@ -166,102 +136,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET
|
||||
if (empty($reshook)) {
|
||||
$error = 0;
|
||||
|
||||
$backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($memberid > 0 ? $memberid : '__ID__');
|
||||
|
||||
$triggermodname = 'PARTNERSHIP_MODIFY'; // Name of trigger action code to execute when we modify record
|
||||
|
||||
if ($action == 'add' && $permissiontoread) {
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
if (!$error) {
|
||||
$old_start_date = $object->date_partnership_start;
|
||||
|
||||
$object->fk_member = $memberid;
|
||||
$object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
|
||||
$object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
|
||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||
$object->date_creation = $now;
|
||||
$object->fk_user_creat = $user->id;
|
||||
$object->entity = $conf->entity;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->create($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
if ($result == -4) {
|
||||
setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
$action = 'create';
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
} elseif ($action == 'update' && $permissiontoread) {
|
||||
$error = 0;
|
||||
|
||||
$db->begin();
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
if (!$error) {
|
||||
$object->oldcopy = clone $object;
|
||||
|
||||
$old_start_date = $object->date_partnership_start;
|
||||
|
||||
$object->date_partnership_start = (!GETPOST('date_partnership_start')) ? '' : $date_start;
|
||||
$object->date_partnership_end = (!GETPOST('date_partnership_end')) ? '' : $date_end;
|
||||
$object->note_public = GETPOST('note_public', 'restricthtml');
|
||||
$object->fk_user_creat = $user->id;
|
||||
$object->fk_user_modif = $user->id;
|
||||
|
||||
// Fill array 'array_options' with data from add form
|
||||
$ret = $extrafields->setOptionalsFromPost(null, $object);
|
||||
if ($ret < 0) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
$result = $object->update($user);
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
if ($result == -4) {
|
||||
setEventMessages($langs->trans("ErrorRefAlreadyExists"), null, 'errors');
|
||||
} else {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($error) {
|
||||
$db->rollback();
|
||||
$action = 'edit';
|
||||
} else {
|
||||
$db->commit();
|
||||
}
|
||||
} elseif ($action == 'confirm_close' || $action == 'update_extras') {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
|
||||
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?rowid=".$memberid);
|
||||
exit;
|
||||
}
|
||||
$backtopage = dol_buildpath('/partnership/partnership.php', 1).'?rowid='.($id > 0 ? $id : '__ID__');
|
||||
|
||||
// Actions when linking object each other
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
|
||||
@ -271,10 +146,9 @@ $object->fields['fk_member']['visible'] = 0;
|
||||
if ($object->id > 0 && $object->status == $object::STATUS_REFUSED && empty($action)) $object->fields['reason_decline_or_cancel']['visible'] = 1;
|
||||
$object->fields['note_public']['visible'] = 1;
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*
|
||||
* Put here all code to build page
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
@ -285,11 +159,11 @@ llxHeader('', $title);
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
if ($memberid) {
|
||||
if ($id > 0) {
|
||||
$langs->load("members");
|
||||
|
||||
$member = new Adherent($db);
|
||||
$result = $member->fetch($memberid);
|
||||
$object = new Adherent($db);
|
||||
$result = $object->fetch($id);
|
||||
|
||||
if (!empty($conf->notification->enabled)) {
|
||||
$langs->load("mails");
|
||||
@ -297,13 +171,13 @@ if ($memberid) {
|
||||
|
||||
$adht->fetch($object->typeid);
|
||||
|
||||
$head = member_prepare_head($member);
|
||||
$head = member_prepare_head($object);
|
||||
|
||||
print dol_get_fiche_head($head, 'partnership', $langs->trans("ThirdParty"), -1, 'user');
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/adherents/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
dol_banner_tab($member, 'rowid', $linkback);
|
||||
dol_banner_tab($object, 'rowid', $linkback);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
|
||||
@ -312,21 +186,21 @@ if ($memberid) {
|
||||
|
||||
// Login
|
||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$member->login.' </td></tr>';
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Login").' / '.$langs->trans("Id").'</td><td class="valeur">'.$object->login.' </td></tr>';
|
||||
}
|
||||
|
||||
// Type
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Type").'</td><td class="valeur">'.$adht->getNomUrl(1)."</td></tr>\n";
|
||||
|
||||
// Morphy
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$member->getmorphylib().'</td>';
|
||||
print '<tr><td>'.$langs->trans("MemberNature").'</td><td class="valeur" >'.$object->getmorphylib().'</td>';
|
||||
print '</tr>';
|
||||
|
||||
// Company
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$member->company.'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Company").'</td><td class="valeur">'.$object->company.'</td></tr>';
|
||||
|
||||
// Civility
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$member->getCivilityLabel().' </td>';
|
||||
print '<tr><td>'.$langs->trans("UserTitle").'</td><td class="valeur">'.$object->getCivilityLabel().' </td>';
|
||||
print '</tr>';
|
||||
|
||||
print '</table>';
|
||||
@ -334,194 +208,13 @@ if ($memberid) {
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
$params = '';
|
||||
|
||||
print '<br>';
|
||||
} else {
|
||||
dol_print_error('', 'Parameter rowid not defined');
|
||||
}
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("Partnership")), '', '');
|
||||
|
||||
$backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="add">';
|
||||
print '<input type="hidden" name="rowid" value="'.$memberid.'">';
|
||||
print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
|
||||
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head(array(), '');
|
||||
|
||||
print '<table class="border centpercent tableforfieldcreate">'."\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
|
||||
|
||||
print '</table>'."\n";
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" name="add" value="'.dol_escape_htmltag($langs->trans("Validate")).'">';
|
||||
print ' ';
|
||||
// print '<input type="'.($backtopage ? "submit" : "button").'" class="button button-cancel" name="cancel" value="'.dol_escape_htmltag($langs->trans("Cancel")).'"'.($backtopage ? '' : ' onclick="javascript:history.go(-1)"').'>'; // Cancel for create does not post form if we don't know the backtopage
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// Part to edit record
|
||||
if (($partnershipid || $ref) && $action == 'edit') {
|
||||
print load_fiche_titre($langs->trans("Partnership"), '', '');
|
||||
|
||||
$backtopageforcancel = DOL_URL_ROOT.'/partnership/partnership.php?rowid='.$memberid;
|
||||
|
||||
print '<form 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="rowid" value="'.$memberid.'">';
|
||||
print '<input type="hidden" name="fk_member" value="'.$memberid.'">';
|
||||
if ($backtopage) {
|
||||
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
|
||||
}
|
||||
if ($backtopageforcancel) {
|
||||
print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
|
||||
}
|
||||
|
||||
print dol_get_fiche_head();
|
||||
|
||||
print '<table class="border centpercent tableforfieldedit">'."\n";
|
||||
|
||||
// Common attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
|
||||
|
||||
// Other attributes
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<div class="center"><input type="submit" class="button button-save" name="save" value="'.$langs->trans("Save").'">';
|
||||
print ' <input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans("Cancel").'">';
|
||||
print '</div>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
// Part to show record
|
||||
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
|
||||
print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), '', '');
|
||||
|
||||
$res = $object->fetch_optionals();
|
||||
|
||||
// $head = partnershipPrepareHead($object);
|
||||
// print dol_get_fiche_head($head, 'card', $langs->trans("Partnership"), -1, $object->picto);
|
||||
|
||||
$linkback = '';
|
||||
dol_banner_tab($object, 'id', $linkback, 0, 'rowid', 'ref');
|
||||
|
||||
$formconfirm = '';
|
||||
|
||||
// Close confirmation
|
||||
if ($action == 'close') {
|
||||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClose'), $langs->trans('ConfirmClosePartnershipAsk', $object->ref), 'confirm_close', $formquestion, 'yes', 1);
|
||||
}
|
||||
// Reopon confirmation
|
||||
if ($action == 'reopen') {
|
||||
// Create an array for form
|
||||
$formquestion = array();
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToReopon'), $langs->trans('ConfirmReoponAsk', $object->ref), 'confirm_reopen', $formquestion, 'yes', 1);
|
||||
}
|
||||
|
||||
// Refuse confirmatio
|
||||
if ($action == 'refuse') {
|
||||
//Form to close proposal (signed or not)
|
||||
$formquestion = array(
|
||||
array('type' => 'text', 'name' => 'reason_decline_or_cancel', 'label' => $langs->trans("Note"), 'morecss' => 'reason_decline_or_cancel', 'value' => '') // Field to complete private note (not replace)
|
||||
);
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ReasonDecline'), $text, 'confirm_refuse', $formquestion, '', 1, 250);
|
||||
}
|
||||
|
||||
// Call Hook formConfirm
|
||||
$parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
|
||||
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
$formconfirm .= $hookmanager->resPrint;
|
||||
} elseif ($reshook > 0) {
|
||||
$formconfirm = $hookmanager->resPrint;
|
||||
}
|
||||
|
||||
// Print form confirm
|
||||
print $formconfirm;
|
||||
|
||||
|
||||
// Object card
|
||||
// ------------------------------------------------------------
|
||||
$linkback = '<a href="'.dol_buildpath('/partnership/partnership_list.php', 1).'?restore_lastsearch_values=1'.(!empty($memberid) ? '&rowid='.$memberid : '').'">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Common attributes
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_member']); // Hide field already shown in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// End of subscription date
|
||||
$fadherent = new Adherent($db);
|
||||
$fadherent->fetch($object->fk_member);
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||
if ($fadherent->datefin) {
|
||||
print dol_print_date($fadherent->datefin, 'day');
|
||||
if ($fadherent->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
} else {
|
||||
if (!$adht->subscription) {
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
// Buttons for actions
|
||||
|
||||
if ($action != 'presend') {
|
||||
@ -533,24 +226,67 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
}
|
||||
|
||||
if (empty($reshook)) {
|
||||
if ($object->status == $object::STATUS_DRAFT) {
|
||||
print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?rowid='.$memberid.'&action=edit', '', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Show
|
||||
if ($permissiontoadd) {
|
||||
print dolGetButtonAction($langs->trans('ShowPartnership'), '', 'default', dol_buildpath('/partnership/partnership_card.php', 1).'?id='.$object->id, '', $permissiontoadd);
|
||||
}
|
||||
|
||||
// Cancel
|
||||
if ($permissiontoadd) {
|
||||
if ($object->status == $object::STATUS_ACCEPTED) {
|
||||
print dolGetButtonAction($langs->trans('Cancel'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=close&token='.newToken(), '', $permissiontoadd);
|
||||
}
|
||||
print dolGetButtonAction($langs->trans('AddPartnership'), '', 'default', DOL_URL_ROOT.'/partnership/partnership_card.php?action=create&fk_member='.$object->id.'&backtopage='.urlencode(DOL_URL_ROOT.'/adherents/partnership.php?id='.$object->id), '', $permissiontoadd);
|
||||
}
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
|
||||
//$morehtmlright = 'partnership/partnership_card.php?action=create&backtopage=%2Fdolibarr%2Fhtdocs%2Fpartnership%2Fpartnership_list.php';
|
||||
$morehtmlright = '';
|
||||
|
||||
print load_fiche_titre($langs->trans("PartnershipDedicatedToThisMember", $langs->transnoentitiesnoconv("Partnership")), $morehtmlright, '');
|
||||
|
||||
$memberid = $object->id;
|
||||
|
||||
|
||||
// TODO Replace this card with the list of all partnerships.
|
||||
|
||||
$object = new Partnership($db);
|
||||
$partnershipid = $object->fetch(0, "", $memberid);
|
||||
|
||||
if ($partnershipid > 0) {
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
print '<table class="border centpercent tableforfield">'."\n";
|
||||
|
||||
// Common attributes
|
||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||
//unset($object->fields['fk_member']); // Hide field already shown in banner
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||
|
||||
// End of subscription date
|
||||
$fadherent = new Adherent($db);
|
||||
$fadherent->fetch($object->fk_member);
|
||||
print '<tr><td>'.$langs->trans("SubscriptionEndDate").'</td><td class="valeur">';
|
||||
if ($fadherent->datefin) {
|
||||
print dol_print_date($fadherent->datefin, 'day');
|
||||
if ($fadherent->hasDelay()) {
|
||||
print " ".img_warning($langs->trans("Late"));
|
||||
}
|
||||
} else {
|
||||
if (!$adht->subscription) {
|
||||
print $langs->trans("SubscriptionNotRecorded");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
} else {
|
||||
print $langs->trans("SubscriptionNotReceived");
|
||||
if ($fadherent->statut > 0) {
|
||||
print " ".img_warning($langs->trans("Late")); // Display a delay picto only if it is not a draft and is not canceled
|
||||
}
|
||||
}
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
// End of page
|
||||
|
||||
@ -29,7 +29,7 @@ $graphwidth = 700;
|
||||
$mapratio = 0.5;
|
||||
$graphheight = round($graphwidth * $mapratio);
|
||||
|
||||
$mode = GETPOST('mode') ?GETPOST('mode') : '';
|
||||
$mode = GETPOST('mode') ? GETPOST('mode') : '';
|
||||
|
||||
|
||||
// Security check
|
||||
@ -40,7 +40,7 @@ if ($user->socid > 0) {
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$startyear = $year - 2;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -69,7 +69,7 @@ $sql .= " d.morphy as code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1"; // Not draft
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY d.morphy";
|
||||
$foundphy = $foundmor = 0;
|
||||
|
||||
@ -104,7 +104,7 @@ $sql .= " d.morphy as code";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut >= 1"; // Active (not draft=-1, not resiliated=0)
|
||||
$sql .= " AND d.statut >= 1"; // Active (not excluded=-2, not draft=-1, not resiliated=0)
|
||||
$sql .= " GROUP BY d.morphy";
|
||||
$foundphy = $foundmor = 0;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ if ($user->socid > 0) {
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$startyear = $year - 2;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -92,7 +92,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY c.label, c.code";
|
||||
//print $sql;
|
||||
}
|
||||
@ -110,7 +110,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY co.label, co.code, c.nom";
|
||||
//print $sql;
|
||||
}
|
||||
@ -127,7 +127,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY co.label, co.code, r.nom"; //+
|
||||
//print $sql;
|
||||
}
|
||||
@ -142,7 +142,7 @@ if ($mode) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."subscription as s ON s.fk_adherent = d.rowid";
|
||||
$sql .= " WHERE d.entity IN (".getEntity('adherent').")";
|
||||
$sql .= " AND d.statut != -1";
|
||||
$sql .= " AND d.statut <> ".Adherent::STATUS_DRAFT;
|
||||
$sql .= " GROUP BY c.label, c.code, d.town";
|
||||
//print $sql;
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ if ($user->socid > 0) {
|
||||
$result = restrictedArea($user, 'adherent', '', '', 'cotisation');
|
||||
|
||||
$year = strftime("%Y", time());
|
||||
$startyear = $year - 2;
|
||||
$startyear = $year - (empty($conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS) ? 2 : max(1, min(10, $conf->global->MAIN_STATS_GRAPHS_SHOW_N_YEARS)));
|
||||
$endyear = $year;
|
||||
|
||||
// Load translation files required by the page
|
||||
@ -151,12 +151,14 @@ print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<table class="border centpercent">';
|
||||
print '<tr class="liste_titre"><td class="liste_titre" colspan="2">'.$langs->trans("Filter").'</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("Member").'</td><td>';
|
||||
print img_picto('', 'company', 'class="pictofixedwidth"');
|
||||
print $form->select_company($id,'memberid','',1);
|
||||
print '</td></tr>';
|
||||
print '<tr><td>'.$langs->trans("User").'</td><td>';
|
||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
||||
print img_picto('', 'user', 'class="pictofixedwidth"');
|
||||
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'widthcentpercentminusx maxwidth300');
|
||||
print '</td></tr>';
|
||||
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '<tr><td class="center" colspan="2"><input type="submit" name="submit" class="button small" value="'.$langs->trans("Refresh").'"></td></tr>';
|
||||
print '</table>';
|
||||
print '</form>';
|
||||
print '<br><br>';
|
||||
@ -187,8 +189,8 @@ foreach ($data as $val) {
|
||||
//print '</a>';
|
||||
print '</td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right">0</td>';
|
||||
print '<td class="right amount nowraponall">0</td>';
|
||||
print '<td class="right amount nowraponall">0</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
print '<tr class="oddeven" height="24">';
|
||||
@ -198,8 +200,8 @@ foreach ($data as $val) {
|
||||
//print '</a>';
|
||||
print '</td>';
|
||||
print '<td class="right">'.$val['nb'].'</td>';
|
||||
print '<td class="right"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
|
||||
print '<td class="right"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
|
||||
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['total'], 'MT'), 1).'</span></td>';
|
||||
print '<td class="right amount nowraponall"><span class="amount">'.price(price2num($val['avg'], 'MT'), 1).'</span></td>';
|
||||
print '</tr>';
|
||||
$oldyear = $year;
|
||||
}
|
||||
|
||||
@ -144,23 +144,23 @@ 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 '<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 '<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 '<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 '<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
|
||||
|
||||
@ -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++;
|
||||
|
||||
@ -179,6 +179,7 @@ print dol_get_fiche_head($head, 'settings', $langs->trans("BOMs"), -1, 'bom');
|
||||
|
||||
print load_fiche_titre($langs->trans("BOMsNumberingModules"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -272,7 +273,9 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</table><br>\n";
|
||||
print "</table>";
|
||||
print "</div>";
|
||||
print "<br>\n";
|
||||
|
||||
|
||||
/*
|
||||
@ -301,6 +304,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -414,6 +418,7 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print "<br>";
|
||||
|
||||
/*
|
||||
@ -421,6 +426,8 @@ print "<br>";
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -469,6 +476,7 @@ print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ if ($action == 'add') {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
$sql .= "box_id, position, box_order, fk_user, entity";
|
||||
$sql .= ") VALUES (";
|
||||
$sql .= $boxid['value'].", ".((int) $pos).", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".$fk_user.", ".$conf->entity;
|
||||
$sql .= ((int) $boxid['value']).", ".((int) $pos).", '".(($nbboxonleft > $nbboxonright) ? 'B01' : 'A01')."', ".((int) $fk_user).", ".$conf->entity;
|
||||
$sql .= ")";
|
||||
|
||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||
@ -149,11 +149,6 @@ if ($action == 'delete') {
|
||||
if (!empty($obj->box_id)) {
|
||||
$db->begin();
|
||||
|
||||
// Remove all personalized setup when a box is activated or disabled (why removing all ? We removed only removed boxes)
|
||||
// $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_param";
|
||||
// $sql.= " WHERE param LIKE 'MAIN_BOXES_%'";
|
||||
// $resql = $db->query($sql);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes";
|
||||
$sql .= " WHERE entity = ".$conf->entity;
|
||||
$sql .= " AND box_id=".((int) $obj->box_id);
|
||||
@ -184,6 +179,7 @@ if ($action == 'switch') {
|
||||
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
|
||||
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
|
||||
}
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid);
|
||||
dol_syslog($sql);
|
||||
$resultupdatefrom = $db->query($sql);
|
||||
@ -426,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>';
|
||||
|
||||
@ -367,8 +367,8 @@ if ($resql) {
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print "<table class=\"noborder\" width=\"100%\">\n";
|
||||
print "<tr class=\"liste_titre\">\n";
|
||||
print '<table class="noborder centpercent">'."\n";
|
||||
print '<tr class="liste_titre">'."\n";
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
|
||||
@ -498,6 +498,7 @@ print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInOrder")
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -584,6 +585,8 @@ if (empty($conf->facture->enabled)) {
|
||||
}
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
@ -594,6 +597,8 @@ print '<br>';
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -704,6 +709,8 @@ if ($conf->stock->enabled) {
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -712,6 +719,8 @@ print '<br>';
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("Notifications"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -725,6 +734,7 @@ print '</td><td class="right">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
|
||||
@ -418,7 +418,7 @@ 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 $form->select_country($mysoc->country_id, 'country_id', '', 0);
|
||||
if ($user->admin) {
|
||||
print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||
}
|
||||
@ -441,25 +441,25 @@ 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 '<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 '<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 '<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 '<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
|
||||
@ -467,19 +467,19 @@ 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 '<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 +487,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 +510,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 +553,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="titlefield 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,6 +659,7 @@ print '<textarea class="flat quatrevingtpercent" name="object" id="object" rows=
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
// Fiscal year start
|
||||
|
||||
@ -104,6 +104,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 +118,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>';
|
||||
|
||||
|
||||
@ -456,7 +456,7 @@ print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input size="50" class="flat" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.$conf->global->CONTRACT_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="CONTRACT_DRAFT_WATERMARK" value="'.$conf->global->CONTRACT_DRAFT_WATERMARK.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
|
||||
@ -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, 25, 0, 43, 0);
|
||||
$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);
|
||||
|
||||
// Name of SQL tables of dictionaries
|
||||
$tabname = array();
|
||||
@ -608,7 +608,7 @@ $tabcomplete = array(
|
||||
'c_prospectcontactlevel'=>array('picto'=>'company'),
|
||||
'c_stcommcontact'=>array('picto'=>'company'),
|
||||
'c_product_nature'=>array('picto'=>'product'),
|
||||
'c_productbatch_qcstatus'=>array('picto'=>'batch'),
|
||||
'c_productbatch_qcstatus'=>array('picto'=>'lot'),
|
||||
|
||||
);
|
||||
|
||||
@ -970,7 +970,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) {
|
||||
$sql .= " WHERE ".$rowidcol." = ".((int) $rowid);
|
||||
}
|
||||
if (in_array('entity', $listfieldmodify)) {
|
||||
$sql .= " AND entity = '".getEntity($tabname[$id])."'";
|
||||
$sql .= " AND entity = ".((int) getEntity($tabname[$id], 0));
|
||||
}
|
||||
|
||||
dol_syslog("actionmodify", LOG_DEBUG);
|
||||
@ -2391,10 +2391,10 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
$transkey = '';
|
||||
if (in_array($fieldlist[$field], array('label', 'libelle'))) { // For label
|
||||
// Special case for labels
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_civility') {
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_civility' && !empty($obj->code)) {
|
||||
$transkey = "Civility".strtoupper($obj->code);
|
||||
}
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_payment_term') {
|
||||
if ($tabname == MAIN_DB_PREFIX.'c_payment_term' && !empty($obj->code)) {
|
||||
$langs->load("bills");
|
||||
$transkey = "PaymentConditionShort".strtoupper($obj->code);
|
||||
}
|
||||
|
||||
@ -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'];
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ foreach ($object->fields as $key => $val) {
|
||||
// List of fields to search into when doing a "search in all"
|
||||
$fieldstosearchall = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
if ($val['searchall']) {
|
||||
if (!empty($val['searchall'])) {
|
||||
$fieldstosearchall['t.'.$key] = $val['label'];
|
||||
}
|
||||
}
|
||||
@ -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 = '';
|
||||
@ -549,6 +534,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
if (!isset($totalarray['val'])) {
|
||||
$totalarray['val'] = array();
|
||||
}
|
||||
if (!isset($totalarray['val']['t.'.$key])) {
|
||||
$totalarray['val']['t.'.$key] = 0;
|
||||
}
|
||||
$totalarray['val']['t.'.$key] += $object->$key;
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,7 +449,7 @@ print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '<input size="50" class="flat" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="SHIPPING_DRAFT_WATERMARK" value="'.$conf->global->SHIPPING_DRAFT_WATERMARK.'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -455,7 +455,7 @@ print '</td></tr>'."\n";
|
||||
|
||||
print '<tr class="oddeven"><td colspan="2">';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '<input size="50" class="flat" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="EXPENSEREPORT_DRAFT_WATERMARK" value="'.$conf->global->EXPENSEREPORT_DRAFT_WATERMARK.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -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>';
|
||||
|
||||
@ -249,6 +249,7 @@ print dol_get_fiche_head($head, 'general', $langs->trans("Invoices"), -1, 'invoi
|
||||
|
||||
print load_fiche_titre($langs->trans("BillsNumberingModule"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -411,6 +412,7 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
|
||||
/*
|
||||
@ -439,6 +441,7 @@ if ($resql) {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -558,6 +561,7 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) { // Hidden conf
|
||||
/*
|
||||
@ -565,9 +569,12 @@ if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) { // Hidden conf
|
||||
*/
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("BillsPDFModulesAccordindToInvoiceType"), '', '');
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'#default-pdf-modules-by-type-table" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
print '<input type="hidden" name="action" value="setDefaultPDFModulesByType" >';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table id="default-pdf-modules-by-type-table" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Type").'</td>';
|
||||
@ -595,6 +602,8 @@ if (!empty($conf->global->INVOICE_USE_DEFAULT_DOCUMENT)) { // Hidden conf
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
}
|
||||
|
||||
@ -607,6 +616,7 @@ print load_fiche_titre($langs->trans("SuggestedPaymentModesIfNotDefinedInInvoice
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -681,12 +691,15 @@ if ($resql) {
|
||||
print "</select>";
|
||||
print "</td></tr>";
|
||||
print "</table>";
|
||||
print '</div>';
|
||||
|
||||
print "</form>";
|
||||
|
||||
|
||||
print "<br>";
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -740,14 +753,14 @@ print '<input type="hidden" name="action" value="set_FACTURE_DRAFT_WATERMARK" />
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftBill"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td>';
|
||||
print '<td><input size="50" class="flat" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
|
||||
print '<td><input class="flat minwidth200imp" type="text" name="FACTURE_DRAFT_WATERMARK" value="'.$conf->global->FACTURE_DRAFT_WATERMARK.'" />';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
|
||||
print "</td></tr>\n";
|
||||
print '</form>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
/*
|
||||
* Repertoire
|
||||
|
||||
@ -236,6 +236,7 @@ print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1
|
||||
|
||||
print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td width="100">'.$langs->trans("Name").'</td>';
|
||||
@ -328,7 +329,10 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
}
|
||||
|
||||
print '</table><br>';
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
/*
|
||||
@ -358,6 +362,7 @@ if ($resql) {
|
||||
}
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
@ -468,6 +473,7 @@ foreach ($dirmodels as $reldir) {
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
print "<br>";
|
||||
|
||||
/*
|
||||
@ -475,6 +481,8 @@ print "<br>";
|
||||
*/
|
||||
|
||||
print load_fiche_titre($langs->trans("OtherOptions"), '', '');
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
@ -515,7 +523,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERM
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
|
||||
print '</td><td class="right">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print "</td></tr>\n";
|
||||
@ -585,6 +593,7 @@ print '</tr>';
|
||||
print '</form>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
@ -132,7 +132,7 @@ print '<td colspan="2">';
|
||||
if ($conf->global->GEOIP_VERSION == 'php') {
|
||||
print 'Using geoip PHP internal functions. Value must be '.geoip_db_filename(GEOIP_COUNTRY_EDITION).' or '.geoip_db_filename(GEOIP_CITY_EDITION_REV1).' or /pathtodatafile/GeoLite2-Country.mmdb<br>';
|
||||
}
|
||||
print '<input size="50" type="text" name="GEOIPMAXMIND_COUNTRY_DATAFILE" value="'.dol_escape_htmltag($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE).'">';
|
||||
print '<input type="text" class="minwidth200" name="GEOIPMAXMIND_COUNTRY_DATAFILE" value="'.dol_escape_htmltag($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE).'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -472,7 +472,7 @@ print '</td></tr>'."\n";
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
|
||||
print '</td><td>';
|
||||
print '<input size="50" class="flat" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.$conf->global->HOLIDAY_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.$conf->global->HOLIDAY_DRAFT_WATERMARK.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -476,7 +476,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 +484,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">';
|
||||
|
||||
@ -23,32 +23,8 @@
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res = 0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
||||
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php using relative path
|
||||
if (!$res && file_exists("../main.inc.php")) {
|
||||
$res = @include "../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../main.inc.php")) {
|
||||
$res = @include "../../main.inc.php";
|
||||
}
|
||||
if (!$res) {
|
||||
die("Include of main fails");
|
||||
}
|
||||
require '../main.inc.php';
|
||||
|
||||
global $langs, $user;
|
||||
|
||||
// Libraries
|
||||
|
||||
@ -27,32 +27,7 @@
|
||||
*/
|
||||
|
||||
// Load Dolibarr environment
|
||||
$res = 0;
|
||||
// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
|
||||
if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) {
|
||||
$res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
|
||||
$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
|
||||
while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
|
||||
$i--; $j--;
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) {
|
||||
$res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
|
||||
}
|
||||
if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
||||
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
||||
}
|
||||
// Try main.inc.php using relative path
|
||||
if (!$res && file_exists("../main.inc.php")) {
|
||||
$res = @include "../main.inc.php";
|
||||
}
|
||||
if (!$res && file_exists("../../main.inc.php")) {
|
||||
$res = @include "../../main.inc.php";
|
||||
}
|
||||
if (!$res) {
|
||||
die("Include of main fails");
|
||||
}
|
||||
require '../main.inc.php';
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/knowledgemanagement/lib/knowledgemanagement.lib.php';
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -609,6 +609,12 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
|
||||
if (!$i) {
|
||||
$totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
|
||||
}
|
||||
if (!isset($totalarray['val'])) {
|
||||
$totalarray['val'] = array();
|
||||
}
|
||||
if (!isset($totalarray['val']['t.'.$key])) {
|
||||
$totalarray['val']['t.'.$key] = 0;
|
||||
}
|
||||
$totalarray['val']['t.'.$key] += $object->$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(
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
|
||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* 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
|
||||
@ -28,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
|
||||
}
|
||||
|
||||
@ -246,6 +247,7 @@ if ($action == 'install') {
|
||||
|
||||
if ($action == 'set' && $user->admin) {
|
||||
$resarray = activateModule($value);
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
||||
if (!empty($resarray['errors'])) {
|
||||
setEventMessages('', $resarray['errors'], 'errors');
|
||||
} else {
|
||||
@ -269,6 +271,7 @@ if ($action == 'set' && $user->admin) {
|
||||
exit;
|
||||
} elseif ($action == 'reset' && $user->admin && GETPOST('confirm') == 'yes') {
|
||||
$result = unActivateModule($value);
|
||||
dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
|
||||
if ($result) {
|
||||
setEventMessages($result, null, 'errors');
|
||||
}
|
||||
@ -532,7 +535,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
|
||||
$moreforfilter .= '<div class="colorbacktimesheet float valignmiddle">';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacityhigh"').'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth125" value="'.dol_escape_htmltag($search_keyword).'" placeholder="'.dol_escape_htmltag($langs->trans('Keyword')).'">';
|
||||
$moreforfilter .= img_picto($langs->trans("Filter"), 'filter', 'class="paddingright opacityhigh hideonsmartphone"').'<input type="text" id="search_keyword" name="search_keyword" class="maxwidth125" value="'.dol_escape_htmltag($search_keyword).'" placeholder="'.dol_escape_htmltag($langs->trans('Keyword')).'">';
|
||||
$moreforfilter .= '</div>';
|
||||
$moreforfilter .= '<div class="divsearchfield paddingtop">';
|
||||
$moreforfilter .= $form->selectarray('search_nature', $arrayofnatures, dol_escape_htmltag($search_nature), $langs->trans('Origin'), 0, 0, '', 0, 0, 0, '', 'maxwidth200', 1);
|
||||
@ -823,8 +826,7 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
} else {
|
||||
$codetoconfig .= img_picto($langs->trans("NothingToSetup"), "setup", 'class="opacitytransp" style="padding-right: 6px"', false, 0, 0, '', 'fa-15');
|
||||
}
|
||||
} else // Module not yet activated
|
||||
{
|
||||
} else { // Module not yet activated
|
||||
// Set $codeenabledisable
|
||||
if (!empty($objMod->always_enabled)) {
|
||||
// Should never happened
|
||||
@ -881,11 +883,11 @@ if ($mode == 'common' || $mode == 'commonkanban') {
|
||||
} else {
|
||||
print '<tr class="oddeven">'."\n";
|
||||
if (!empty($conf->global->MAIN_MODULES_SHOW_LINENUMBERS)) {
|
||||
print '<td width="20px">'.$linenum.'</td>';
|
||||
print '<td class="width50">'.$linenum.'</td>';
|
||||
}
|
||||
|
||||
// Picto + Name of module
|
||||
print ' <td width="200px">';
|
||||
print ' <td class="tdoverflowmax300" title="'.dol_escape_htmltag($objMod->getName()).'">';
|
||||
$alttext = '';
|
||||
//if (is_array($objMod->need_dolibarr_version)) $alttext.=($alttext?' - ':'').'Dolibarr >= '.join('.',$objMod->need_dolibarr_version);
|
||||
//if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin);
|
||||
@ -1012,7 +1014,7 @@ if ($mode == 'marketplace') {
|
||||
<input type="hidden" name="token" value="<?php echo newToken(); ?>">
|
||||
<input type="hidden" name="mode" value="marketplace">
|
||||
<div class="divsearchfield">
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" size="50" value="<?php echo $options['search'] ?>"><br>
|
||||
<input name="search_keyword" placeholder="<?php echo $langs->trans('Keyword') ?>" id="search_keyword" type="text" class="minwidth200" value="<?php echo $options['search'] ?>"><br>
|
||||
</div>
|
||||
<div class="divsearchfield">
|
||||
<input class="button buttongen" value="<?php echo $langs->trans('Rechercher') ?>" type="submit">
|
||||
|
||||
@ -91,7 +91,9 @@ print '<div class="div-table-responsive-no-min">';
|
||||
print '<table summary="more" class="noborder centpercent">';
|
||||
print '<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans("Parameter").'</td><td width="200px">'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE").'</td><td>';
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE");
|
||||
print ' <span class="opacitymedium">('.$langs->trans("RandomlySelectedIfSeveral").')</span>';
|
||||
print '</td><td>';
|
||||
if ($conf->use_javascript_ajax) {
|
||||
print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE');
|
||||
} else {
|
||||
|
||||
@ -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>";
|
||||
|
||||
|
||||
@ -313,7 +313,7 @@ if ($mode == 'config' && $user->admin) {
|
||||
|
||||
if ($action != 'editprinter') {
|
||||
print '<tr>';
|
||||
print '<td><input size="50" type="text" name="printername"></td>';
|
||||
print '<td><input class="minwidth200" type="text" name="printername"></td>';
|
||||
$ret = $printer->selectTypePrinter();
|
||||
print '<td>'.$printer->resprint.'</td>';
|
||||
$ret = $printer->selectProfilePrinter();
|
||||
@ -334,7 +334,7 @@ if ($mode == 'config' && $user->admin) {
|
||||
print '<tr class="oddeven">';
|
||||
if ($action == 'editprinter' && $printer->listprinters[$line]['rowid'] == $printerid) {
|
||||
print '<input type="hidden" name="printerid" value="'.$printer->listprinters[$line]['rowid'].'">';
|
||||
print '<td><input size="50" type="text" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
|
||||
print '<td><input type="text" class="minwidth200" name="printername" value="'.$printer->listprinters[$line]['name'].'"></td>';
|
||||
$ret = $printer->selectTypePrinter($printer->listprinters[$line]['fk_type']);
|
||||
print '<td>'.$printer->resprint.'</td>';
|
||||
$ret = $printer->selectProfilePrinter($printer->listprinters[$line]['fk_profile']);
|
||||
@ -427,7 +427,7 @@ if ($mode == 'template' && $user->admin) {
|
||||
print '<tr class="oddeven">';
|
||||
if ($action == 'edittemplate' && $printer->listprinterstemplates[$line]['rowid'] == $templateid) {
|
||||
print '<input type="hidden" name="templateid" value="'.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
|
||||
print '<td><input type="text" class="minwidth200" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
|
||||
print '<td>';
|
||||
print '<textarea name="template" wrap="soft" cols="120" rows="12">'.$printer->listprinterstemplates[$line]['template'].'</textarea>';
|
||||
print '</td>';
|
||||
@ -456,7 +456,7 @@ if ($mode == 'template' && $user->admin) {
|
||||
|
||||
if ($action != 'edittemplate') {
|
||||
print '<tr>';
|
||||
print '<td><input size="50" type="text" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
|
||||
print '<td><input type="text" class="minwidth200" name="templatename" value="'.$printer->listprinterstemplates[$line]['name'].'"></td>';
|
||||
print '<td>';
|
||||
print '<textarea name="template" wrap="soft" cols="120" rows="12">';
|
||||
print '</textarea>';
|
||||
|
||||
@ -465,7 +465,7 @@ print "</td></tr>\n";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->textwithpicto($langs->trans("WatermarkOnDraftContractCards"), $htmltext).'<br>';
|
||||
print '<input size="50" class="flat" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.$conf->global->RECEPTION_DRAFT_WATERMARK.'">';
|
||||
print '<input class="flat minwidth200" type="text" name="RECEPTION_DRAFT_WATERMARK" value="'.$conf->global->RECEPTION_DRAFT_WATERMARK.'">';
|
||||
print "</td></tr>\n";
|
||||
*/
|
||||
print '</table>';
|
||||
|
||||
@ -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>';
|
||||
@ -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>';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user