Merge remote-tracking branch 'upstream/develop' into mailingcard
This commit is contained in:
commit
cb77d9f175
2
.github/workflows/exakat.yml
vendored
2
.github/workflows/exakat.yml
vendored
@ -13,5 +13,5 @@ jobs:
|
|||||||
- name: Exakat
|
- name: Exakat
|
||||||
uses: docker://exakat/exakat-ga
|
uses: docker://exakat/exakat-ga
|
||||||
with:
|
with:
|
||||||
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/RepeatedPrint,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
ignore_rules: 'Classes/UseInstanceof,Performances/PrePostIncrement,Functions/UndefinedFunctions,Functions/WrongNumberOfArguments,Functions/WrongTypeWithCall,Variables/UndefinedVariable,Classes/DontUnsetProperties,Classes/NonPpp,Classes/StaticMethodsCalledFromObject,Classes/UseClassOperator,Functions/UsesDefaultArguments,Php/NoClassInGlobal,Php/ShouldUseCoalesce,Php/WrongTypeForNativeFunction,Structures/AddZero,Structures/DropElseAfterReturn,Structures/IfWithSameConditions,Structures/MergeIfThen,Structures/ElseIfElseif,Structures/ExitUsage,Structures/RepeatedPrint,Structures/RepeatedRegex,Structures/SameConditions,Structures/SwitchWithoutDefault,Structures/ShouldMakeTernary,Structures/UselessParenthesis,Structures/UseConstant'
|
||||||
ignore_dirs: '/htdocs/includes,/build,/dev,/doc,/scripts,/test'
|
ignore_dirs: '/htdocs/includes,/build,/dev,/doc,/scripts,/test'
|
||||||
@ -39,7 +39,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
|
|||||||
|
|
||||||
JS libraries:
|
JS libraries:
|
||||||
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
Ace 1.4.8 BSD Yes JS library to get code syntaxique coloration in a textarea.
|
||||||
ChartJS 2.9.3 MIT License Yes JS library for graph
|
ChartJS 2.9.4 MIT License Yes JS library for graph
|
||||||
jQuery 3.5.1 MIT License Yes JS library
|
jQuery 3.5.1 MIT License Yes JS library
|
||||||
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
jQuery UI 1.12.1 GPL and MIT License Yes JS library plugin UI
|
||||||
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
jQuery select2 4.0.13 GPL and Apache License Yes JS library plugin for sexier multiselect. Warning: 4.0.6+ create troubles without patching css
|
||||||
|
|||||||
54
ChangeLog
54
ChangeLog
@ -18,6 +18,7 @@ NEW: Accountancy - change menu disposition
|
|||||||
NEW: Accountancy - on transfers, select the periodicity by default
|
NEW: Accountancy - on transfers, select the periodicity by default
|
||||||
NEW: Accountancy - Add export for Gestinum (v3 & v5)
|
NEW: Accountancy - Add export for Gestinum (v3 & v5)
|
||||||
NEW: new currency rate editor
|
NEW: new currency rate editor
|
||||||
|
NEW: add a widget to show the customers with outstanding limits reached
|
||||||
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
|
NEW: add 2 rules for emailcollector: Message send/not sent from Dolibarr
|
||||||
NEW: add a counter of number of words for pages in website module
|
NEW: add a counter of number of words for pages in website module
|
||||||
NEW: add alert before changing thirdparty in TakePOS
|
NEW: add alert before changing thirdparty in TakePOS
|
||||||
@ -30,7 +31,7 @@ NEW: add column payment term into list of supplier invoices
|
|||||||
NEW: add column quantity in product margin page
|
NEW: add column quantity in product margin page
|
||||||
NEW: add column vat rate in page to define accounting account on product/service
|
NEW: add column vat rate in page to define accounting account on product/service
|
||||||
NEW: add costprice in fields of products list
|
NEW: add costprice in fields of products list
|
||||||
NEW: added an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
|
NEW: add an import profile for CUSTOMER ORDER, PO, PROPOSAL MODULE, SUPPLIER INVOICE
|
||||||
NEW: add employee link in expense report binding page
|
NEW: add employee link in expense report binding page
|
||||||
NEW: add EORI No. as ProfID5
|
NEW: add EORI No. as ProfID5
|
||||||
NEW: add export for various payments
|
NEW: add export for various payments
|
||||||
@ -167,7 +168,8 @@ NEW: Thirdparty module : box on customer/supplier tab for invoice outsantding am
|
|||||||
NEW: ticket classification on create from email collector
|
NEW: ticket classification on create from email collector
|
||||||
NEW: Ticket message notifications when edited from public interface
|
NEW: Ticket message notifications when edited from public interface
|
||||||
NEW: translate classification labels in ticket
|
NEW: translate classification labels in ticket
|
||||||
NEW: Add VAT and juridical status for Algeria
|
NEW: VAT rate for Angola #15606
|
||||||
|
NEW: VAT and juridical status for Algeria
|
||||||
NEW: VAT report - Invert constant to show by default zero VAT in reports
|
NEW: VAT report - Invert constant to show by default zero VAT in reports
|
||||||
NEW: website page fields selection
|
NEW: website page fields selection
|
||||||
NEW: Weighing Scale compatibility with TakePOS connector
|
NEW: Weighing Scale compatibility with TakePOS connector
|
||||||
@ -178,13 +180,10 @@ NEW: #15065 Add option to put the product label in bold in the PDF templates if
|
|||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
---------------
|
---------------
|
||||||
NEW: Hook on propal card
|
|
||||||
NEW: add __MEMBER_TYPE__ substitution key
|
NEW: add __MEMBER_TYPE__ substitution key
|
||||||
|
NEW: add __TYPE__ substitution key
|
||||||
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
NEW: add function dolButtonToOpenUrlInDialogPopup() to be able to open page into a popup
|
||||||
NEW: add hooks on stats pages
|
|
||||||
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
NEW: show line number on intervention card (via MAIN_VIEW_LINE_NUMBER)
|
||||||
NEW: API get contacts list of a given order
|
|
||||||
NEW: API endpoint getContacts and Clean results
|
|
||||||
NEW: Add some fields to link website page to an other object
|
NEW: Add some fields to link website page to an other object
|
||||||
NEW: fill ECM src object fields in dol_add_file_process
|
NEW: fill ECM src object fields in dol_add_file_process
|
||||||
NEW: conf to allow to show the full tree in warehouse popup
|
NEW: conf to allow to show the full tree in warehouse popup
|
||||||
@ -194,10 +193,6 @@ NEW: can add event to log into blockedlog module with a constant
|
|||||||
NEW: add property cssview when declaring fields of an object
|
NEW: add property cssview when declaring fields of an object
|
||||||
NEW: Can use dynamic code into the 'enabled' property of DAO fields
|
NEW: Can use dynamic code into the 'enabled' property of DAO fields
|
||||||
NEW: allow to edit "demand reason" field though API
|
NEW: allow to edit "demand reason" field though API
|
||||||
NEW: API can update a payment
|
|
||||||
NEW: API get member by thirdparty
|
|
||||||
NEW: API get thirdparty by barcode
|
|
||||||
NEW: API get users by email / login
|
|
||||||
NEW: fetch contact by email with REST API
|
NEW: fetch contact by email with REST API
|
||||||
NEW: field ref_ext in llx_commandedet
|
NEW: field ref_ext in llx_commandedet
|
||||||
NEW: fields ref_ext for Attributes and Combinations
|
NEW: fields ref_ext for Attributes and Combinations
|
||||||
@ -210,15 +205,27 @@ NEW: standardizes API thirdparties by email like other object
|
|||||||
NEW: Thirdparty REST API: endpoint to set price level
|
NEW: Thirdparty REST API: endpoint to set price level
|
||||||
NEW: use new category API for project list view
|
NEW: use new category API for project list view
|
||||||
NEW: Triggers Attributes and Attributes values
|
NEW: Triggers Attributes and Attributes values
|
||||||
NEW: add hooks on newpayment page to allow external payment modules
|
|
||||||
NEW: added incoterms data into the substitution array
|
NEW: added incoterms data into the substitution array
|
||||||
NEW: add formConfirm hook on product page
|
|
||||||
NEW: add send context for ticket
|
NEW: add send context for ticket
|
||||||
NEW: add a message in error_log after detection of SQL or script injection
|
NEW: add a message in error_log after detection of SQL or script injection
|
||||||
NEW: add two hooks printFieldListFrom and printFieldSearchParam
|
|
||||||
NEW: add __TYPE__ substitution key
|
|
||||||
NEW: add validation of MX domain for emails
|
NEW: add validation of MX domain for emails
|
||||||
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
|
NEW: calculate the virtual stock in transverse mode ( not on getEntity('commande'), ... but on getEntity('stock') )
|
||||||
|
NEW: Graphics can be horizontal bars
|
||||||
|
|
||||||
|
APIs
|
||||||
|
NEW: API get contacts list of a given order
|
||||||
|
NEW: API endpoint getContacts and Clean results
|
||||||
|
NEW: API can update a payment
|
||||||
|
NEW: API get member by thirdparty
|
||||||
|
NEW: API get thirdparty by barcode
|
||||||
|
NEW: API get users by email / login
|
||||||
|
|
||||||
|
HOOKs
|
||||||
|
NEW: Hook on propal card
|
||||||
|
NEW: add hooks on newpayment page to allow external payment modules
|
||||||
|
NEW: add hooks on stats pages
|
||||||
|
NEW: add formConfirm hook on product page
|
||||||
|
NEW: add two hooks printFieldListFrom and printFieldSearchParam
|
||||||
|
|
||||||
|
|
||||||
WARNING:
|
WARNING:
|
||||||
@ -238,6 +245,7 @@ Following changes may create regressions for some external modules, but were nec
|
|||||||
* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of simple amount.
|
* The API addPayment for api_invoice has evolved to accept amount into a foreign currency. You must provide array(amount=>X,mutlicurrency_ammount=>Y) instead of simple amount.
|
||||||
* The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed.
|
* The method select_thirdparty(), deprecated since 3.8, into html.form.class.php has been removed.
|
||||||
* Depreciate all methods with name ->valide(). Use instead methods ->validate().
|
* Depreciate all methods with name ->valide(). Use instead methods ->validate().
|
||||||
|
* Function showStripePaymentUrl, getStripePaymentUrl, showPaypalPaymentUrl and getPaypalPaymentUrl has been removed. The generic one showOnlinePaymentUrl and getOnlinePaymentUrl are always used.
|
||||||
|
|
||||||
|
|
||||||
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
|
***** ChangeLog for 12.0.3 compared to 12.0.2 *****
|
||||||
@ -266,7 +274,7 @@ FIX: Look and feel v12: First tab must be name of object
|
|||||||
FIX: missing entity check
|
FIX: missing entity check
|
||||||
FIX: missing param for hook
|
FIX: missing param for hook
|
||||||
FIX: Missing transaction on PO actions
|
FIX: Missing transaction on PO actions
|
||||||
FIX: MySql Strict mode
|
FIX: MySQL Strict mode
|
||||||
FIX: param entity in html form file
|
FIX: param entity in html form file
|
||||||
FIX: Problems on FEC format
|
FIX: Problems on FEC format
|
||||||
FIX: round stock value on product list
|
FIX: round stock value on product list
|
||||||
@ -374,8 +382,8 @@ FIX: SQL Problem in customer invoice list
|
|||||||
FIX: SQL Problem in social contribution list
|
FIX: SQL Problem in social contribution list
|
||||||
FIX: SQL Problem in supplier invoice list
|
FIX: SQL Problem in supplier invoice list
|
||||||
FIX: SQL syntax error when editing extrafields
|
FIX: SQL syntax error when editing extrafields
|
||||||
FIX: Sql type
|
FIX: SQL type
|
||||||
FIX: takepos 12 hook
|
FIX: TakePOS 12 hook
|
||||||
FIX: Update form erased extrafields that were hidden
|
FIX: Update form erased extrafields that were hidden
|
||||||
FIX: Update of extrafields date
|
FIX: Update of extrafields date
|
||||||
FIX: Update of extrafiels on draft object
|
FIX: Update of extrafiels on draft object
|
||||||
@ -389,7 +397,7 @@ For users:
|
|||||||
|
|
||||||
NEW: Module MO (Manufacturing Order) is available as stable module.
|
NEW: Module MO (Manufacturing Order) is available as stable module.
|
||||||
NEW: Receipt printer module moved from 'development' to 'experimental'
|
NEW: Receipt printer module moved from 'development' to 'experimental'
|
||||||
NEW: Add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists.
|
NEW: add option MAIN_VIEW_LINE_NUMBER_IN_LIST for some lists
|
||||||
NEW: add numbering module for TakePOS module
|
NEW: add numbering module for TakePOS module
|
||||||
NEW: 2 new options when creating an invoice from time spent on a project : by period or by task
|
NEW: 2 new options when creating an invoice from time spent on a project : by period or by task
|
||||||
NEW: Accountancy add column thirdparty on binding page
|
NEW: Accountancy add column thirdparty on binding page
|
||||||
@ -400,19 +408,19 @@ NEW: Accountancy - Add possibility to manage a short alternative label for accou
|
|||||||
NEW: Accountancy - General ledger - Add an option to search not reconciled lines
|
NEW: Accountancy - General ledger - Add an option to search not reconciled lines
|
||||||
NEW: Add accountancy code of thirdparty in contact and supplier export
|
NEW: Add accountancy code of thirdparty in contact and supplier export
|
||||||
NEW: support webp image format
|
NEW: support webp image format
|
||||||
NEW: Add checkbox "overwrite if exists" into ECM/DMS module
|
NEW: add checkbox "overwrite if exists" into ECM/DMS module
|
||||||
NEW: add a link to notes in members list
|
NEW: add a link to notes in members list
|
||||||
NEW: add a parameter to group same products in TakePOS
|
NEW: add a parameter to group same products in TakePOS
|
||||||
NEW: add a parameter to sort product by label in TakePOS
|
NEW: add a parameter to sort product by label in TakePOS
|
||||||
NEW: Add a profil to import contact categories
|
NEW: add a profil to import contact categories
|
||||||
NEW: Add company extrafields into order export
|
NEW: add company extrafields into order export
|
||||||
NEW: add const CASHDESK_FORCE_DECREASE_STOCK to force batch decrementation
|
NEW: add const CASHDESK_FORCE_DECREASE_STOCK to force batch decrementation
|
||||||
NEW: add const TAKEPOS_NUMPAD_USE_PAYMENT_ICON to use icons on payment buttons
|
NEW: add const TAKEPOS_NUMPAD_USE_PAYMENT_ICON to use icons on payment buttons
|
||||||
NEW: add csv separator setup in module admin
|
NEW: add csv separator setup in module admin
|
||||||
NEW: add dedicated substitutions keys for extrafields of type date and datetime
|
NEW: add dedicated substitutions keys for extrafields of type date and datetime
|
||||||
NEW: add default warehouse for dispatch
|
NEW: add default warehouse for dispatch
|
||||||
NEW: Add due date in feature "Export accounting documents"
|
NEW: add due date in feature "Export accounting documents"
|
||||||
NEW: Add duration information for fichinter
|
NEW: add duration information for fichinter
|
||||||
NEW: Start support of Dark theme into ELDY theme
|
NEW: Start support of Dark theme into ELDY theme
|
||||||
NEW: Add field author public alias for blog post on website module
|
NEW: Add field author public alias for blog post on website module
|
||||||
NEW: Add "finished" field on product list
|
NEW: Add "finished" field on product list
|
||||||
|
|||||||
@ -140,15 +140,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
|
|||||||
### Other general features
|
### Other general features
|
||||||
|
|
||||||
- Localization in most major languages
|
- Localization in most major languages
|
||||||
|
- Multi-Language Support
|
||||||
- Multi-Users and groups with finely grained rights
|
- Multi-Users and groups with finely grained rights
|
||||||
- Multi-currency
|
- Multi-Currency
|
||||||
- Multi-company by adding of an external module
|
- Multi-Company (by adding of an external module)
|
||||||
|
|
||||||
- Very user friendly and easy to use
|
- Very user friendly and easy to use
|
||||||
- customizable Dashboard
|
- customizable Dashboard
|
||||||
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
|
||||||
|
|
||||||
- APIs
|
- APIs (REST, SOAP)
|
||||||
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
|
||||||
|
|
||||||
- Support a lot of country specific features:
|
- Support a lot of country specific features:
|
||||||
- Spanish Tax RE and ISPF
|
- Spanish Tax RE and ISPF
|
||||||
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
|
||||||
|
|||||||
@ -12,8 +12,7 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
|||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
To report a vulnerability, please send an email to security@dolibarr.org
|
To report a vulnerability, please use GitHub security advisory (alternatively send an email to security@dolibarr.org)
|
||||||
In most cases, after fixing the security, we make an answer by email to say the issue has been fixed.
|
|
||||||
|
|
||||||
|
|
||||||
## Hunting vulnerabilities on Dolibarr
|
## Hunting vulnerabilities on Dolibarr
|
||||||
|
|||||||
26
build/README
26
build/README
@ -1,48 +1,62 @@
|
|||||||
README (English)
|
README (English)
|
||||||
|
|
||||||
|
Path: /dolibarr/build/README
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
Building packages
|
Building packages
|
||||||
##################################################
|
##################################################
|
||||||
|
|
||||||
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
|
All sub-directories of "build" directory contains files (setup or binary tools) required to build automatically Dolibarr packages.
|
||||||
There are several tools:
|
|
||||||
|
|
||||||
|
There are several tools:
|
||||||
|
|
||||||
|
|
||||||
- To build full Dolibarr packages, launch the script
|
- To build full Dolibarr packages, launch the script
|
||||||
> Launch command perl makepack-dolibarr.pl
|
> Launch command perl makepack-dolibarr.pl
|
||||||
|
|
||||||
Note: Prerequisites to build tgz, debian, rpm package
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
Prerequisites to build tgz, debian, rpm package:
|
||||||
|
|
||||||
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
> apt-get install tar dpkg dpatch p7zip-full rpm zip
|
||||||
|
|
||||||
Note: Prerequisites to build autoexe DoliWamp package:
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Prerequisites to build autoexe DoliWamp package:
|
||||||
> apt-get install wine q4wine
|
> apt-get install wine q4wine
|
||||||
> Launch "wine cmd" to check a drive Z: pointing to / exists.
|
> Launch "wine cmd" to check a drive Z: pointing to / exists.
|
||||||
> Install InnoSetup
|
> Install InnoSetup
|
||||||
For example by running isetup-5.3.9.exe (http://www.jrsoftware.org)
|
For example by running isetup-5.5.8.exe (https://www.jrsoftware.org) https://files.jrsoftware.org/is/5/
|
||||||
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
> Install WampServer into "C:\wamp64" to have Apache, PHP and MariaDB
|
||||||
For example by running wampserver3.2.0_x64.exe (http://www.wampserver.com). See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
For example by running wampserver3.2.0_x64.exe (https://www.wampserver.com).
|
||||||
|
See file build/exe/doliwamp.iss to know the doliwamp version currently setup.
|
||||||
> Add path to ISCC into PATH windows var:
|
> Add path to ISCC into PATH windows var:
|
||||||
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
Launch wine cmd, then regedit and add entry int HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment\PATH
|
||||||
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
> To build manually the .exe from Windows (running from makepack-dolibarr.pl script is however recommanded),
|
||||||
open file build/exe/doliwamp.iss and click on button "Compile".
|
open file build/exe/doliwamp.iss and click on button "Compile".
|
||||||
The .exe file will be build into directory build.
|
The .exe file will be build into directory build.
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build a theme package, launch the script
|
- To build a theme package, launch the script
|
||||||
> perl makepack-dolibarrtheme.pl
|
> perl makepack-dolibarrtheme.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build a package for a module, launch the script
|
- To build a package for a module, launch the script
|
||||||
> perl makepack-dolibarrmodule.pl
|
> perl makepack-dolibarrmodule.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- To build developper documentation, launch the script
|
- To build developper documentation, launch the script
|
||||||
> perl dolibarr-doxygen-build.pl
|
> perl dolibarr-doxygen-build.pl
|
||||||
|
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
The build directory and all its contents is absolutely not required to make Dolibarr working.
|
||||||
|
|||||||
@ -504,6 +504,9 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/install/pgsql/README`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/mssql`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/install/sqlite3`;
|
||||||
|
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/node_modules`;
|
||||||
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/ansible`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/dev/codesniffer`;
|
||||||
@ -578,23 +581,36 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||||
|
|
||||||
# Removed other test files
|
# Removed other test files
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/Thumbs.db $BUILDROOT/$PROJECT/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/Thumbs.db $BUILDROOT/$PROJECT/*/*/*/*/Thumbs.db`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/.cvsignore $BUILDROOT/$PROJECT/*/.cvsignore $BUILDROOT/$PROJECT/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/.cvsignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.cvsignore`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/.gitignore $BUILDROOT/$PROJECT/*/.gitignore $BUILDROOT/$PROJECT/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/.gitignore $BUILDROOT/$PROJECT/*/*/*/*/*/*/.gitignore`;
|
||||||
|
|
||||||
|
# Removed files installed by the awful composer
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/geoip/sample*.*`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/bin`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/adapters`; # Keep this removal in case we embed libraries
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/ckeditor/samples`; # Keep this removal in case we embed libraries
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/ckeditor/_source`; # _source must be kept into tarball for official debian, not for the rest
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/composer`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/doctrine`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/multiselect/MIT-LICENSE.txt`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/jquery/plugins/select2/release.sh`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/example`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/.gitmodules`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mobiledetect/mobiledetectlib/docs`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/.github`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/docs`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/samples`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/scripts`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/src`;
|
||||||
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nnnick/chartjs/test`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/lib/Mail`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/nusoap/samples`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
||||||
@ -609,21 +625,17 @@ if ($nboftargetok) {
|
|||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/sabre/sabre/*/tests`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/tests`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/stripe/LICENSE`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/examples`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/freefont-*`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/ae_fonts_*`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/utils`;
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/LICENSE.TXT`;
|
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/freefont-*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/ae_fonts_*`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/LICENSE.TXT`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/tools`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/vendor`;
|
||||||
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/webmozart`;
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
|
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/includes/autoload.php`;
|
||||||
|
|
||||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Build package for each target
|
# Build package for each target
|
||||||
|
|||||||
263
composer.lock
generated
263
composer.lock
generated
@ -6,6 +6,53 @@
|
|||||||
],
|
],
|
||||||
"content-hash": "1dbd2d05cc0836acfca5988f29005cf2",
|
"content-hash": "1dbd2d05cc0836acfca5988f29005cf2",
|
||||||
"packages": [
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "Psr/log",
|
||||||
|
"version": "1.1.3",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/php-fig/log.git",
|
||||||
|
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||||
|
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=5.3.0"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-master": "1.1.x-dev"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Psr\\Log\\": "Psr/Log/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "PHP-FIG",
|
||||||
|
"homepage": "http://www.php-fig.org/"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Common interface for logging libraries",
|
||||||
|
"homepage": "https://github.com/php-fig/log",
|
||||||
|
"keywords": [
|
||||||
|
"log",
|
||||||
|
"psr",
|
||||||
|
"psr-3"
|
||||||
|
],
|
||||||
|
"time": "2020-03-23T09:12:05+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ckeditor/ckeditor",
|
"name": "ckeditor/ckeditor",
|
||||||
"version": "4.12.1",
|
"version": "4.12.1",
|
||||||
@ -217,16 +264,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "nnnick/chartjs",
|
"name": "nnnick/chartjs",
|
||||||
"version": "v2.9.3",
|
"version": "v2.9.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/chartjs/Chart.js.git",
|
"url": "https://github.com/chartjs/Chart.js.git",
|
||||||
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2"
|
"reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/06f73dc3590084b2c464bf08189c7aee2b6b92d2",
|
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/9bd4cf82fda9f50a5fb50b72843e06ab88124278",
|
||||||
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2",
|
"reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -254,7 +301,11 @@
|
|||||||
"JS",
|
"JS",
|
||||||
"chart"
|
"chart"
|
||||||
],
|
],
|
||||||
"time": "2019-11-14T18:37:30+00:00"
|
"support": {
|
||||||
|
"issues": "https://github.com/chartjs/Chart.js/issues",
|
||||||
|
"source": "https://github.com/chartjs/Chart.js/tree/v2.9.4"
|
||||||
|
},
|
||||||
|
"time": "2020-10-19T12:22:11+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpoffice/phpexcel",
|
"name": "phpoffice/phpexcel",
|
||||||
@ -314,53 +365,6 @@
|
|||||||
"abandoned": "phpoffice/phpspreadsheet",
|
"abandoned": "phpoffice/phpspreadsheet",
|
||||||
"time": "2015-05-01T07:00:55+00:00"
|
"time": "2015-05-01T07:00:55+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "psr/log",
|
|
||||||
"version": "1.1.3",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/php-fig/log.git",
|
|
||||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
|
|
||||||
"reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.0"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.1.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Psr\\Log\\": "Psr/Log/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "PHP-FIG",
|
|
||||||
"homepage": "http://www.php-fig.org/"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Common interface for logging libraries",
|
|
||||||
"homepage": "https://github.com/php-fig/log",
|
|
||||||
"keywords": [
|
|
||||||
"log",
|
|
||||||
"psr",
|
|
||||||
"psr-3"
|
|
||||||
],
|
|
||||||
"time": "2020-03-23T09:12:05+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "restler/framework",
|
"name": "restler/framework",
|
||||||
"version": "3.0.0-RC6",
|
"version": "3.0.0-RC6",
|
||||||
@ -2037,159 +2041,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2019-08-06T08:03:45+00:00"
|
"time": "2019-08-06T08:03:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "symfony/polyfill-php72",
|
|
||||||
"version": "v1.18.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/symfony/polyfill-php72.git",
|
|
||||||
"reference": "639447d008615574653fb3bc60d1986d7172eaae"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/639447d008615574653fb3bc60d1986d7172eaae",
|
|
||||||
"reference": "639447d008615574653fb3bc60d1986d7172eaae",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.3.3"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.18-dev"
|
|
||||||
},
|
|
||||||
"thanks": {
|
|
||||||
"name": "symfony/polyfill",
|
|
||||||
"url": "https://github.com/symfony/polyfill"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Php72\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"bootstrap.php"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Nicolas Grekas",
|
|
||||||
"email": "p@tchwork.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Symfony Community",
|
|
||||||
"homepage": "https://symfony.com/contributors"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
|
|
||||||
"homepage": "https://symfony.com",
|
|
||||||
"keywords": [
|
|
||||||
"compatibility",
|
|
||||||
"polyfill",
|
|
||||||
"portable",
|
|
||||||
"shim"
|
|
||||||
],
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://symfony.com/sponsor",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/fabpot",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2020-07-14T12:35:20+00:00"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "symfony/polyfill-php80",
|
|
||||||
"version": "v1.18.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
|
||||||
"reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/d87d5766cbf48d72388a9f6b85f280c8ad51f981",
|
|
||||||
"reference": "d87d5766cbf48d72388a9f6b85f280c8ad51f981",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=7.0.8"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.18-dev"
|
|
||||||
},
|
|
||||||
"thanks": {
|
|
||||||
"name": "symfony/polyfill",
|
|
||||||
"url": "https://github.com/symfony/polyfill"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Php80\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"bootstrap.php"
|
|
||||||
],
|
|
||||||
"classmap": [
|
|
||||||
"Resources/stubs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Ion Bazan",
|
|
||||||
"email": "ion.bazan@gmail.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Nicolas Grekas",
|
|
||||||
"email": "p@tchwork.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Symfony Community",
|
|
||||||
"homepage": "https://symfony.com/contributors"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
|
|
||||||
"homepage": "https://symfony.com",
|
|
||||||
"keywords": [
|
|
||||||
"compatibility",
|
|
||||||
"polyfill",
|
|
||||||
"portable",
|
|
||||||
"shim"
|
|
||||||
],
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"url": "https://symfony.com/sponsor",
|
|
||||||
"type": "custom"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/fabpot",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"time": "2020-07-14T12:35:20+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "symfony/yaml",
|
"name": "symfony/yaml",
|
||||||
"version": "v3.4.32",
|
"version": "v3.4.32",
|
||||||
@ -2312,5 +2163,5 @@
|
|||||||
"ext-curl": "*"
|
"ext-curl": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "1.1.0"
|
"plugin-api-version": "2.0.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
"npm": ">=5.6.0"
|
"npm": ">=5.6.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"zapier-platform-core": "10.1.1"
|
"zapier-platform-core": "10.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
|
|||||||
@ -1,25 +0,0 @@
|
|||||||
comparison of terms
|
|
||||||
|
|
||||||
|
|
||||||
Dolibarr SAP ERP Odoo
|
|
||||||
-------------------------------------------------------------------------
|
|
||||||
Thirdparty Contact partner Partner/Contact (company)
|
|
||||||
Contact/address Contact person Partner/Contact (individual)
|
|
||||||
|
|
||||||
Financial Finance (FI) Accounting
|
|
||||||
Accounting
|
|
||||||
|
|
||||||
|
|
||||||
Income / Expense ?? Profit / Loss
|
|
||||||
Balance ?? Net profit
|
|
||||||
Subledger account Subledger account ??
|
|
||||||
|
|
||||||
CRM Sales & Distribution Sales
|
|
||||||
Proposal ?? Quotation
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Proposal is ok but proposition looks better (proposal is for a detailed proposition).
|
|
||||||
We can say also "business proposition or business proposal".
|
|
||||||
In India they are using "Quotation".
|
|
||||||
|
|
||||||
@ -187,7 +187,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
$msg .= $langs->transnoentities('ErrorFieldFormat', $langs->transnoentities('Code')).'<br>';
|
||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
if (isset($_POST["country"]) && ($_POST["country"] == '0') && ($id != 2))
|
if (GETPOSTISSET("country") && (GETPOST("country") == '0') && ($id != 2))
|
||||||
{
|
{
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities("Country")), null, 'errors');
|
||||||
|
|||||||
@ -247,7 +247,7 @@ if ($action == 'create') {
|
|||||||
// Chart of accounts type
|
// Chart of accounts type
|
||||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
@ -309,7 +309,7 @@ if ($action == 'create') {
|
|||||||
// Chart of accounts type
|
// Chart of accounts type
|
||||||
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
print '<tr><td>'.$langs->trans("Pcgtype").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(isset($_POST['pcg_type']) ?GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
print '<input type="text" name="pcg_type" value="'.dol_escape_htmltag(GETPOSTISSET('pcg_type') ? GETPOST('pcg_type', 'alpha') : $object->pcg_type).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|||||||
@ -168,7 +168,7 @@ if (GETPOST('actionadd', 'alpha') || GETPOST('actionmodify', 'alpha'))
|
|||||||
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
setEventMessages($langs->transnoentities("ErrorFieldRequired", $langs->transnoentities($fieldnamekey)), null, 'errors');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($_POST["code"]))
|
if (GETPOSTISSET("code"))
|
||||||
{
|
{
|
||||||
if ($_POST["code"] == '0')
|
if ($_POST["code"] == '0')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2018-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -128,8 +128,7 @@ if ($action == "confirm_update") {
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
if ($mode != '_tmp')
|
if ($mode != '_tmp') {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,14 +164,14 @@ if ($action == "confirm_update") {
|
|||||||
$object->label_operation = $label_operation;
|
$object->label_operation = $label_operation;
|
||||||
$object->debit = $debit;
|
$object->debit = $debit;
|
||||||
$object->credit = $credit;
|
$object->credit = $credit;
|
||||||
$object->doc_date = GETPOST('doc_date', 'alpha');
|
$object->doc_date = (string) GETPOST('doc_date', 'alpha');
|
||||||
$object->doc_type = GETPOST('doc_type', 'alpha');
|
$object->doc_type = (string) GETPOST('doc_type', 'alpha');
|
||||||
$object->piece_num = $piece_num;
|
$object->piece_num = $piece_num;
|
||||||
$object->doc_ref = GETPOST('doc_ref', 'alpha');
|
$object->doc_ref = (string) GETPOST('doc_ref', 'alpha');
|
||||||
$object->code_journal = $journal_code;
|
$object->code_journal = $journal_code;
|
||||||
$object->journal_label = $journal_label;
|
$object->journal_label = $journal_label;
|
||||||
$object->fk_doc = (int) GETPOST('fk_doc', 'int');
|
$object->fk_doc = GETPOSTINT('fk_doc');
|
||||||
$object->fk_docdet = (int) GETPOST('fk_docdet', 'int');
|
$object->fk_docdet = GETPOSTINT('fk_docdet');
|
||||||
|
|
||||||
if (floatval($debit) != 0.0) {
|
if (floatval($debit) != 0.0) {
|
||||||
$object->montant = $debit; // deprecated
|
$object->montant = $debit; // deprecated
|
||||||
@ -190,8 +189,7 @@ if ($action == "confirm_update") {
|
|||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
setEventMessages($object->error, $object->errors, 'errors');
|
||||||
} else {
|
} else {
|
||||||
if ($mode != '_tmp')
|
if ($mode != '_tmp') {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@ $hookmanager->initHooks(array('bookkeepinglist'));
|
|||||||
$formaccounting = new FormAccounting($db);
|
$formaccounting = new FormAccounting($db);
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !isset($_POST['formfilteraction']) && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
|
if (!in_array($action, array('export_file', 'delmouv', 'delmouvconfirm')) && !GETPOSTISSET('begin') && !GETPOSTISSET('formfilteraction') && GETPOST('page', 'int') == '' && !GETPOST('noreset', 'int') && $user->rights->accounting->mouvements->export)
|
||||||
{
|
{
|
||||||
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values'))
|
if (empty($search_date_start) && empty($search_date_end) && !GETPOSTISSET('restore_lastsearch_values'))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class AccountingJournal extends CommonObject
|
|||||||
public $table_element = 'accounting_journal';
|
public $table_element = 'accounting_journal';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Field with ID of parent key if this field has a parent
|
* @var string Fieldname with ID of parent key if this field has a parent
|
||||||
*/
|
*/
|
||||||
public $fk_element = '';
|
public $fk_element = '';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2016-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2016-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2019 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
@ -103,13 +103,19 @@ if ($conf->accounting->enabled)
|
|||||||
|
|
||||||
// STEPS
|
// STEPS
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescJournalSetup", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/journals_list.php?id=35"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("AccountingJournals").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChartModel", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/accountmodel.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Pcg_version").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescChart", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/account.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Chartofaccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
@ -118,60 +124,45 @@ if ($conf->accounting->enabled)
|
|||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDefault", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/defaultaccounts.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBank", $step, '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/compta/bank/list.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuBankAccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=10&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuVatAccounts").'</strong></a>';
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, $textlink);
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescVat", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', $textlink, $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
if (!empty($conf->tax->enabled))
|
if (!empty($conf->tax->enabled))
|
||||||
{
|
{
|
||||||
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
$textlink = '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=7&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuTaxAccounts").'</strong></a>';
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, $textlink);
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescContrib", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', $textlink, $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
/*if (! empty($conf->salaries->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSal", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("MenuAccountancy").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
// htdocs/admin/salaries.php
|
|
||||||
print "<br>\n";
|
|
||||||
print "<br>\n";
|
|
||||||
}*/
|
|
||||||
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
if (!empty($conf->expensereport->enabled)) // TODO Move this in the default account page because this is only one accounting account per purpose, not several.
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescExpenseReport", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/admin/dict.php?id=17&from=accountancy"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuExpenseReportAccounts").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
if (! empty($conf->loan->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescLoan", $step, '<strong>'.$langs->transnoentitiesnoconv("MenuSpecialExpenses").' - '.$langs->transnoentitiesnoconv("Loans").'</strong> '.$langs->transnoentitiesnoconv("or").' <strong>'.$langs->transnoentitiesnoconv("MenuFinancial").'-'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}
|
|
||||||
if (! empty($conf->don->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescDonation", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}
|
|
||||||
if (! empty($conf->adherents->enabled))
|
|
||||||
{
|
|
||||||
$step++;
|
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescSubscription", $step, '<strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("MenuDefaultAccounts").'</strong>');
|
|
||||||
print "<br>\n";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>');
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescProd", $step, '{s}');
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/admin/productaccount.php"><strong>'.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("ProductsBinding").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
|
|
||||||
@ -188,26 +179,34 @@ if ($conf->accounting->enabled)
|
|||||||
$langs->loadLangs(array('bills', 'trips'));
|
$langs->loadLangs(array('bills', 'trips'));
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsCustomers"), '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/customer/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("CustomersVentilation").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("BillsSuppliers"), '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/supplier/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("SuppliersVentilation").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
|
if (!empty($conf->expensereport->enabled) || !empty($conf->deplacement->enabled))
|
||||||
{
|
{
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>')."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescBind", chr(64 + $step), $langs->transnoentitiesnoconv("ExpenseReports"), '{s}')."\n";
|
||||||
|
$s = str_replace('{s}', '<a href="'.DOL_URL_ROOT.'/accountancy/expensereport/index.php"><strong>'.$langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("ExpenseReportsVentilation").'</strong></a>', $s);
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("RegistrationInAccounting"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescWriteRecords", chr(64 + $step), $langs->transnoentitiesnoconv("TransferInAccounting").' - '.$langs->transnoentitiesnoconv("RegistrationInAccounting"), $langs->transnoentitiesnoconv("WriteBookKeeping"))."\n";
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
$step++;
|
$step++;
|
||||||
print img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64 + $step))."<br>\n";
|
$s = img_picto('', 'puce').' '.$langs->trans("AccountancyAreaDescAnalyze", chr(64 + $step))."<br>\n";
|
||||||
|
print $s;
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
* Copyright (C) 2013-2019 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||||
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
* Copyright (C) 2013-2014 Florian Henry <florian.henry@open-concept.pro>
|
||||||
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
|
||||||
* Copyright (C) 2017-2018 Frédéric France <frederic.france@netlogic.fr>
|
* Copyright (C) 2017-2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
* Copyright (C) 2018 Ferran Marcet <fmarcet@2byte.es>
|
||||||
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
* Copyright (C) 2018 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||||
*
|
*
|
||||||
@ -73,15 +73,18 @@ $date_endmonth = GETPOST('date_endmonth', 'int');
|
|||||||
$date_endday = GETPOST('date_endday', 'int');
|
$date_endday = GETPOST('date_endday', 'int');
|
||||||
$date_endyear = GETPOST('date_endyear', 'int');
|
$date_endyear = GETPOST('date_endyear', 'int');
|
||||||
$in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09');
|
$in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09');
|
||||||
if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
|
if ($in_bookkeeping == '') {
|
||||||
|
$in_bookkeeping = 'notyet';
|
||||||
|
}
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->socid > 0 && empty($id_journal))
|
if ($user->socid > 0 && empty($id_journal)) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -93,8 +96,7 @@ $error = 0;
|
|||||||
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
$date_start = dol_mktime(0, 0, 0, $date_startmonth, $date_startday, $date_startyear);
|
||||||
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
$date_end = dol_mktime(23, 59, 59, $date_endmonth, $date_endday, $date_endyear);
|
||||||
|
|
||||||
if (empty($date_startmonth) || empty($date_endmonth))
|
if (empty($date_startmonth) || empty($date_endmonth)) {
|
||||||
{
|
|
||||||
// Period by default on transfer
|
// Period by default on transfer
|
||||||
$dates = getDefaultDatesForTransfer();
|
$dates = getDefaultDatesForTransfer();
|
||||||
$date_start = $dates['date_start'];
|
$date_start = $dates['date_start'];
|
||||||
@ -103,8 +105,7 @@ if (empty($date_startmonth) || empty($date_endmonth))
|
|||||||
$pastmonth = $dates['pastmonth'];
|
$pastmonth = $dates['pastmonth'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) // We define date_start and date_end, only if we did not submit the form
|
if (!GETPOSTISSET('date_startmonth') && (empty($date_start) || empty($date_end))) { // We define date_start and date_end, only if we did not submit the form
|
||||||
{
|
|
||||||
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
|
$date_start = dol_get_first_day($pastmonthyear, $pastmonth, false);
|
||||||
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
$date_end = dol_get_last_day($pastmonthyear, $pastmonth, false);
|
||||||
}
|
}
|
||||||
@ -124,19 +125,18 @@ $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as soc on bu1.url_id=soc.rowid";
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on bu2.url_id=u.rowid";
|
||||||
$sql .= " WHERE ba.fk_accountancy_journal=".$id_journal;
|
$sql .= " WHERE ba.fk_accountancy_journal=".$id_journal;
|
||||||
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
$sql .= ' AND b.amount != 0 AND ba.entity IN ('.getEntity('bank_account', 0).')'; // We don't share object for accountancy
|
||||||
if ($date_start && $date_end)
|
if ($date_start && $date_end) {
|
||||||
$sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'";
|
$sql .= " AND b.dateo >= '".$db->idate($date_start)."' AND b.dateo <= '".$db->idate($date_end)."'";
|
||||||
|
}
|
||||||
// Define begin binding date
|
// Define begin binding date
|
||||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||||
$sql .= " AND b.dateo >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
$sql .= " AND b.dateo >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||||
}
|
}
|
||||||
// Already in bookkeeping or not
|
// Already in bookkeeping or not
|
||||||
if ($in_bookkeeping == 'already')
|
if ($in_bookkeeping == 'already') {
|
||||||
{
|
|
||||||
$sql .= " AND (b.rowid IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
$sql .= " AND (b.rowid IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
||||||
}
|
}
|
||||||
if ($in_bookkeeping == 'notyet')
|
if ($in_bookkeeping == 'notyet') {
|
||||||
{
|
|
||||||
$sql .= " AND (b.rowid NOT IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
$sql .= " AND (b.rowid NOT IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='bank') )";
|
||||||
}
|
}
|
||||||
$sql .= " ORDER BY b.datev";
|
$sql .= " ORDER BY b.datev";
|
||||||
@ -198,23 +198,28 @@ if ($result) {
|
|||||||
// one line for bank record = tabbq
|
// one line for bank record = tabbq
|
||||||
// one line for thirdparty record = tabtp
|
// one line for thirdparty record = tabtp
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
|
|
||||||
$lineisapurchase = -1;
|
$lineisapurchase = -1;
|
||||||
$lineisasale = -1;
|
$lineisasale = -1;
|
||||||
// Old method to detect if it's a sale or purchase
|
// Old method to detect if it's a sale or purchase
|
||||||
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase = 1;
|
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') {
|
||||||
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale = 1;
|
$lineisapurchase = 1;
|
||||||
// Try a more reliable method to detect if record is a supplier payment or a customer payment
|
}
|
||||||
if ($lineisapurchase < 0)
|
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') {
|
||||||
{
|
$lineisasale = 1;
|
||||||
if ($obj->typeop_payment_supplier == 'payment_supplier') $lineisapurchase = 1;
|
}
|
||||||
|
// Try a more reliable method to detect if record is a supplier payment or a customer payment
|
||||||
|
if ($lineisapurchase < 0) {
|
||||||
|
if ($obj->typeop_payment_supplier == 'payment_supplier') {
|
||||||
|
$lineisapurchase = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($lineisasale < 0) {
|
||||||
|
if ($obj->typeop_payment == 'payment') {
|
||||||
|
$lineisasale = 1;
|
||||||
}
|
}
|
||||||
if ($lineisasale < 0)
|
|
||||||
{
|
|
||||||
if ($obj->typeop_payment == 'payment') $lineisasale = 1;
|
|
||||||
}
|
}
|
||||||
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
|
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
|
||||||
//var_dump($lineisapurchase); //var_dump($lineisasale);
|
//var_dump($lineisapurchase); //var_dump($lineisasale);
|
||||||
@ -224,10 +229,12 @@ if ($result) {
|
|||||||
|
|
||||||
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
|
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
|
||||||
$compta_soc = 'NotDefined';
|
$compta_soc = 'NotDefined';
|
||||||
if ($lineisapurchase > 0)
|
if ($lineisapurchase > 0) {
|
||||||
$compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier);
|
$compta_soc = (($obj->code_compta_fournisseur != "") ? $obj->code_compta_fournisseur : $account_supplier);
|
||||||
if ($lineisasale > 0)
|
}
|
||||||
|
if ($lineisasale > 0) {
|
||||||
$compta_soc = (!empty($obj->code_compta) ? $obj->code_compta : $account_customer);
|
$compta_soc = (!empty($obj->code_compta) ? $obj->code_compta : $account_customer);
|
||||||
|
}
|
||||||
|
|
||||||
$tabcompany[$obj->rowid] = array(
|
$tabcompany[$obj->rowid] = array(
|
||||||
'id' => $obj->socid,
|
'id' => $obj->socid,
|
||||||
@ -264,10 +271,6 @@ if ($result) {
|
|||||||
// Load of url links to the line into llx_bank
|
// Load of url links to the line into llx_bank
|
||||||
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
$links = $object->get_url($obj->rowid); // Get an array('url'=>, 'url_id'=>, 'label'=>, 'type'=> 'fk_bank'=> )
|
||||||
|
|
||||||
//var_dump($i);
|
|
||||||
//var_dump($tabpay);
|
|
||||||
//var_dump($tabcompany);
|
|
||||||
|
|
||||||
// By default
|
// By default
|
||||||
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
|
$tabpay[$obj->rowid]['type'] = 'unknown'; // Can be SOLD, miscellaneous entry, payment of patient, or any old record with no links in bank_url.
|
||||||
$tabtype[$obj->rowid] = 'unknown';
|
$tabtype[$obj->rowid] = 'unknown';
|
||||||
@ -277,17 +280,14 @@ if ($result) {
|
|||||||
if (is_array($links) && count($links) > 0) {
|
if (is_array($links) && count($links) > 0) {
|
||||||
// Now loop on each link of record in bank.
|
// Now loop on each link of record in bank.
|
||||||
foreach ($links as $key => $val) {
|
foreach ($links as $key => $val) {
|
||||||
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various')))
|
if (in_array($links[$key]['type'], array('sc', 'payment_sc', 'payment', 'payment_supplier', 'payment_vat', 'payment_expensereport', 'banktransfert', 'payment_donation', 'member', 'payment_loan', 'payment_salary', 'payment_various'))) {
|
||||||
{
|
|
||||||
// So we excluded 'company' and 'user' here. We want only payment lines
|
// So we excluded 'company' and 'user' here. We want only payment lines
|
||||||
|
|
||||||
// We save tabtype for a future use, to remember what kind of payment it is
|
// We save tabtype for a future use, to remember what kind of payment it is
|
||||||
$tabpay[$obj->rowid]['type'] = $links[$key]['type'];
|
$tabpay[$obj->rowid]['type'] = $links[$key]['type'];
|
||||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||||
} elseif (in_array($links[$key]['type'], array('company', 'user')))
|
} elseif (in_array($links[$key]['type'], array('company', 'user'))) {
|
||||||
{
|
if ($tabpay[$obj->rowid]['type'] == 'unknown') {
|
||||||
if ($tabpay[$obj->rowid]['type'] == 'unknown')
|
|
||||||
{
|
|
||||||
// We can guess here it is a bank record for a thirdparty company or a user.
|
// We can guess here it is a bank record for a thirdparty company or a user.
|
||||||
// But we won't be able to record somewhere else than into a waiting account, because there is no other journal to record the contreparty.
|
// But we won't be able to record somewhere else than into a waiting account, because there is no other journal to record the contreparty.
|
||||||
}
|
}
|
||||||
@ -312,16 +312,23 @@ if ($result) {
|
|||||||
$societestatic->name = $links[$key]['label'];
|
$societestatic->name = $links[$key]['label'];
|
||||||
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
||||||
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
|
||||||
if ($compta_soc) $tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
if ($compta_soc) {
|
||||||
|
$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
|
||||||
|
}
|
||||||
} elseif ($links[$key]['type'] == 'user') {
|
} elseif ($links[$key]['type'] == 'user') {
|
||||||
$userstatic->id = $links[$key]['url_id'];
|
$userstatic->id = $links[$key]['url_id'];
|
||||||
$userstatic->name = $links[$key]['label'];
|
$userstatic->name = $links[$key]['label'];
|
||||||
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
||||||
$userstatic->firstname = $tabuser[$obj->rowid]['firstname'];
|
$userstatic->firstname = $tabuser[$obj->rowid]['firstname'];
|
||||||
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
|
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
|
||||||
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
if ($userstatic->id > 0) {
|
||||||
else $tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
||||||
if ($compta_user) $tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
} else {
|
||||||
|
$tabpay[$obj->rowid]["soclib"] = '???'; // Should not happen, but happens with old data when id of user was not saved on expense report payment.
|
||||||
|
}
|
||||||
|
if ($compta_user) {
|
||||||
|
$tabtp[$obj->rowid][$compta_user] += $obj->amount;
|
||||||
|
}
|
||||||
} elseif ($links[$key]['type'] == 'sc') {
|
} elseif ($links[$key]['type'] == 'sc') {
|
||||||
$chargestatic->id = $links[$key]['url_id'];
|
$chargestatic->id = $links[$key]['url_id'];
|
||||||
$chargestatic->ref = $links[$key]['url_id'];
|
$chargestatic->ref = $links[$key]['url_id'];
|
||||||
@ -329,8 +336,9 @@ if ($result) {
|
|||||||
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
|
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
|
||||||
$reg = array();
|
$reg = array();
|
||||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||||
if ($reg[1] == 'socialcontribution')
|
if ($reg[1] == 'socialcontribution') {
|
||||||
$reg[1] = 'SocialContribution';
|
$reg[1] = 'SocialContribution';
|
||||||
|
}
|
||||||
$chargestatic->label = $langs->trans($reg[1]);
|
$chargestatic->label = $langs->trans($reg[1]);
|
||||||
} else {
|
} else {
|
||||||
$chargestatic->label = $links[$key]['label'];
|
$chargestatic->label = $links[$key]['label'];
|
||||||
@ -430,28 +438,29 @@ if ($result) {
|
|||||||
|
|
||||||
// If no links were found to know the amount on thirdparty, we try to guess it.
|
// If no links were found to know the amount on thirdparty, we try to guess it.
|
||||||
// This may happens on bank entries without the links lines to 'company'.
|
// This may happens on bank entries without the links lines to 'company'.
|
||||||
if (empty($tabtp[$obj->rowid]) && !empty($tabmoreinfo[$obj->rowid]['withdraw'])) // If we dont find 'company' link because it is an old 'withdraw' record
|
if (empty($tabtp[$obj->rowid]) && !empty($tabmoreinfo[$obj->rowid]['withdraw'])) { // If we dont find 'company' link because it is an old 'withdraw' record
|
||||||
{
|
|
||||||
foreach ($links as $key => $val) {
|
foreach ($links as $key => $val) {
|
||||||
if ($links[$key]['type'] == 'payment') {
|
if ($links[$key]['type'] == 'payment') {
|
||||||
// Get thirdparty
|
// Get thirdparty
|
||||||
$tmppayment->fetch($links[$key]['url_id']);
|
$tmppayment->fetch($links[$key]['url_id']);
|
||||||
$arrayofamounts = $tmppayment->getAmountsArray();
|
$arrayofamounts = $tmppayment->getAmountsArray();
|
||||||
foreach ($arrayofamounts as $invoiceid => $amount)
|
if (is_array($arrayofamounts)) {
|
||||||
{
|
foreach ($arrayofamounts as $invoiceid => $amount) {
|
||||||
$tmpinvoice->fetch($invoiceid);
|
$tmpinvoice->fetch($invoiceid);
|
||||||
$tmpinvoice->fetch_thirdparty();
|
$tmpinvoice->fetch_thirdparty();
|
||||||
if ($tmpinvoice->thirdparty->code_compta)
|
if ($tmpinvoice->thirdparty->code_compta) {
|
||||||
{
|
|
||||||
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
|
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
|
// If no links were found to know the amount on thirdparty, we init it to account 'NotDefined'.
|
||||||
if (empty($tabtp[$obj->rowid])) $tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
|
if (empty($tabtp[$obj->rowid])) {
|
||||||
|
$tabtp[$obj->rowid]['NotDefined'] = $tabbq[$obj->rowid][$compta_bank];
|
||||||
|
}
|
||||||
|
|
||||||
// Check account number is ok
|
// Check account number is ok
|
||||||
/*if ($action == 'writebookkeeping') // Make test now in such a case
|
/*if ($action == 'writebookkeeping') // Make test now in such a case
|
||||||
@ -492,8 +501,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
foreach ($tabpay as $key => $val) // $key is rowid into llx_bank
|
foreach ($tabpay as $key => $val) { // $key is rowid into llx_bank
|
||||||
{
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
@ -511,17 +519,18 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
var_dump($tabbq);exit;*/
|
var_dump($tabbq);exit;*/
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
if (!$errorforline && is_array($tabbq[$key]))
|
if (!$errorforline && is_array($tabbq[$key])) {
|
||||||
{
|
|
||||||
// Line into bank account
|
// Line into bank account
|
||||||
foreach ($tabbq[$key] as $k => $mt)
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
{
|
if ($mt) {
|
||||||
if ($mt)
|
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
||||||
if (!empty($val['soclib'])) $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
if (!empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||||
|
}
|
||||||
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
$bookkeeping->doc_date = $val["date"];
|
$bookkeeping->doc_date = $val["date"];
|
||||||
@ -554,8 +563,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
|
|
||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
@ -570,18 +578,16 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Third party
|
// Third party
|
||||||
if (!$errorforline)
|
if (!$errorforline) {
|
||||||
{
|
if (is_array($tabtp[$key])) {
|
||||||
if (is_array($tabtp[$key]))
|
|
||||||
{
|
|
||||||
// Line into thirdparty account
|
// Line into thirdparty account
|
||||||
foreach ($tabtp[$key] as $k => $mt) {
|
foreach ($tabtp[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
if (!empty($val['lib'])) {
|
||||||
if ($tabtype[$key] == 'banktransfert')
|
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||||
{
|
}
|
||||||
|
if ($tabtype[$key] == 'banktransfert') {
|
||||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||||
} else {
|
} else {
|
||||||
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
||||||
@ -681,8 +687,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$accountingaccount->fetch(null, $k, true);
|
$accountingaccount->fetch(null, $k, true);
|
||||||
$bookkeeping->label_compte = $accountingaccount->label;
|
$bookkeeping->label_compte = $accountingaccount->label;
|
||||||
} else {
|
} else {
|
||||||
if ($tabtype[$key] == 'unknown') // Unknown transaction, we will use a waiting account for thirdparty.
|
if ($tabtype[$key] == 'unknown') { // Unknown transaction, we will use a waiting account for thirdparty.
|
||||||
{
|
|
||||||
// Temporary account
|
// Temporary account
|
||||||
$bookkeeping->subledger_account = '';
|
$bookkeeping->subledger_account = '';
|
||||||
$bookkeeping->subledger_label = '';
|
$bookkeeping->subledger_label = '';
|
||||||
@ -700,8 +705,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
|
|
||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
@ -715,10 +719,11 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
} else { // If thirdparty unknown, output the waiting account
|
} else { // If thirdparty unknown, output the waiting account
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
||||||
|
|
||||||
$bookkeeping = new BookKeeping($db);
|
$bookkeeping = new BookKeeping($db);
|
||||||
@ -745,8 +750,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$result = $bookkeeping->create($user);
|
$result = $bookkeeping->create($user);
|
||||||
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||||
@ -761,23 +765,20 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))
|
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
$errorforline++;
|
$errorforline++;
|
||||||
setEventMessages('Try to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors');
|
setEventMessages('Try to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$errorforline)
|
if (!$errorforline) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
//print 'KO for line '.$key.' '.$error.'<br>';
|
//print 'KO for line '.$key.' '.$error.'<br>';
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
|
|
||||||
$MAXNBERRORS = 5;
|
$MAXNBERRORS = 5;
|
||||||
if ($error >= $MAXNBERRORS)
|
if ($error >= $MAXNBERRORS) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors');
|
setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors');
|
||||||
break; // Break in the foreach
|
break; // Break in the foreach
|
||||||
}
|
}
|
||||||
@ -786,8 +787,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
|
|
||||||
if (empty($error) && count($tabpay) > 0) {
|
if (empty($error) && count($tabpay) > 0) {
|
||||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||||
} elseif (count($tabpay) == $error)
|
} elseif (count($tabpay) == $error) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||||
@ -796,8 +796,7 @@ if (!$error && $action == 'writebookkeeping') {
|
|||||||
$action = '';
|
$action = '';
|
||||||
|
|
||||||
// Must reload data, so we make a redirect
|
// Must reload data, so we make a redirect
|
||||||
if (count($tabpay) != $error)
|
if (count($tabpay) != $error) {
|
||||||
{
|
|
||||||
$param = 'id_journal='.$id_journal;
|
$param = 'id_journal='.$id_journal;
|
||||||
$param .= '&date_startday='.$date_startday;
|
$param .= '&date_startday='.$date_startday;
|
||||||
$param .= '&date_startmonth='.$date_startmonth;
|
$param .= '&date_startmonth='.$date_startmonth;
|
||||||
@ -835,20 +834,22 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep;
|
print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep;
|
||||||
print "\n";
|
print "\n";
|
||||||
|
|
||||||
foreach ($tabpay as $key => $val)
|
foreach ($tabpay as $key => $val) {
|
||||||
{
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
$reflabel .= $langs->trans("Bank").' '.dol_string_nohtmltag($val['bank_account_ref']);
|
||||||
if (!empty($val['soclib'])) $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
if (!empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||||
|
}
|
||||||
|
|
||||||
print '"'.$key.'"'.$sep;
|
print '"'.$key.'"'.$sep;
|
||||||
print '"'.$date.'"'.$sep;
|
print '"'.$date.'"'.$sep;
|
||||||
@ -868,12 +869,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ($tabtp[$key] as $k => $mt) {
|
foreach ($tabtp[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
if (!empty($val['lib'])) {
|
||||||
if ($tabtype[$key] == 'banktransfert')
|
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||||
{
|
}
|
||||||
|
if ($tabtype[$key] == 'banktransfert') {
|
||||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||||
} else {
|
} else {
|
||||||
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
||||||
@ -905,10 +906,11 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
|||||||
}
|
}
|
||||||
} else { // If thirdparty unkown, output the waiting account
|
} else { // If thirdparty unkown, output the waiting account
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= dol_string_nohtmltag($val['lib'])." - ";
|
||||||
|
}
|
||||||
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
$reflabel .= dol_string_nohtmltag('WaitingAccount');
|
||||||
|
|
||||||
print '"'.$key.'"'.$sep;
|
print '"'.$key.'"'.$sep;
|
||||||
@ -965,16 +967,18 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
|
// Test that setup is complete (we are in accounting, so test on entity is always on $conf->entity only, no sharing allowed)
|
||||||
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0';
|
$sql = 'SELECT COUNT(rowid) as nb FROM '.MAIN_DB_PREFIX.'bank_account WHERE entity = '.$conf->entity.' AND fk_accountancy_journal IS NULL AND clos=0';
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if ($obj->nb > 0)
|
if ($obj->nb > 0) {
|
||||||
{
|
|
||||||
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
|
print '<br><div class="warning">'.img_warning().' '.$langs->trans("TheJournalCodeIsNotDefinedOnSomeBankAccount");
|
||||||
print ' : '.$langs->trans("AccountancyAreaDescBank", 9, '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>');
|
$desc = ' : '.$langs->trans("AccountancyAreaDescBank", 9, '{link}');
|
||||||
|
$desc = str_replace('{link}', '<strong>'.$langs->transnoentitiesnoconv("MenuAccountancy").'-'.$langs->transnoentitiesnoconv("Setup")."-".$langs->transnoentitiesnoconv("BankAccounts").'</strong>', $desc);
|
||||||
|
print $desc;
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
} else dol_print_error($db);
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Button to write into Ledger
|
// Button to write into Ledger
|
||||||
@ -988,14 +992,19 @@ if (empty($action) || $action == 'view') {
|
|||||||
|
|
||||||
print '<div class="tabsAction tabsActionNoBottom">';
|
print '<div class="tabsAction tabsActionNoBottom">';
|
||||||
|
|
||||||
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
if (!empty($conf->global->ACCOUNTING_ENABLE_EXPORT_DRAFT_JOURNAL) && $in_bookkeeping == 'notyet') {
|
||||||
|
print '<input type="button" class="butAction" name="exportcsv" value="'.$langs->trans("ExportDraftJournal").'" onclick="launch_export();" />';
|
||||||
|
}
|
||||||
|
|
||||||
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
if (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == "") || $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER == '-1'
|
||||||
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
|| ($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == "") || $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER == '-1') {
|
||||||
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
print '<input type="button" class="butActionRefused classfortooltip" title="'.dol_escape_htmltag($langs->trans("SomeMandatoryStepsOfSetupWereNotDone")).'" value="'.$langs->trans("WriteBookKeeping").'" />';
|
||||||
} else {
|
} else {
|
||||||
if ($in_bookkeeping == 'notyet') print '<input type="button" class="butAction" name="writebookkeeping" value="'.$langs->trans("WriteBookKeeping").'" onclick="writebookkeeping();" />';
|
if ($in_bookkeeping == 'notyet') {
|
||||||
else print '<a class="butActionRefused classfortooltip" name="writebookkeeping">'.$langs->trans("WriteBookKeeping").'</a>';
|
print '<input type="button" class="butAction" name="writebookkeeping" value="'.$langs->trans("WriteBookKeeping").'" onclick="writebookkeeping();" />';
|
||||||
|
} else {
|
||||||
|
print '<a class="butActionRefused classfortooltip" name="writebookkeeping">'.$langs->trans("WriteBookKeeping").'</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
@ -1038,21 +1047,22 @@ if (empty($action) || $action == 'view') {
|
|||||||
|
|
||||||
$r = '';
|
$r = '';
|
||||||
|
|
||||||
foreach ($tabpay as $key => $val) // $key is rowid in llx_bank
|
foreach ($tabpay as $key => $val) { // $key is rowid in llx_bank
|
||||||
{
|
|
||||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||||
|
|
||||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||||
|
|
||||||
// Bank
|
// Bank
|
||||||
foreach ($tabbq[$key] as $k => $mt)
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
{
|
if ($mt) {
|
||||||
if ($mt)
|
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= $val['lib']." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= $val['lib']." - ";
|
||||||
|
}
|
||||||
$reflabel .= $langs->trans("Bank").' '.$val['bank_account_ref'];
|
$reflabel .= $langs->trans("Bank").' '.$val['bank_account_ref'];
|
||||||
if (!empty($val['soclib'])) $reflabel .= " - ".$val['soclib'];
|
if (!empty($val['soclib'])) {
|
||||||
|
$reflabel .= " - ".$val['soclib'];
|
||||||
|
}
|
||||||
|
|
||||||
//var_dump($tabpay[$key]);
|
//var_dump($tabpay[$key]);
|
||||||
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
||||||
@ -1062,10 +1072,11 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Ledger account
|
// Ledger account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
$accounttoshow = length_accountg($k);
|
$accounttoshow = length_accountg($k);
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
||||||
{
|
|
||||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||||
} else print $accounttoshow;
|
} else {
|
||||||
|
print $accounttoshow;
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
// Subledger account
|
// Subledger account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
@ -1089,12 +1100,12 @@ if (empty($action) || $action == 'view') {
|
|||||||
// Third party
|
// Third party
|
||||||
if (is_array($tabtp[$key])) {
|
if (is_array($tabtp[$key])) {
|
||||||
foreach ($tabtp[$key] as $k => $mt) {
|
foreach ($tabtp[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= $val['lib'].($val['soclib'] ? " - " : "");
|
if (!empty($val['lib'])) {
|
||||||
if ($tabtype[$key] == 'banktransfert')
|
$reflabel .= $val['lib'].($val['soclib'] ? " - " : "");
|
||||||
{
|
}
|
||||||
|
if ($tabtype[$key] == 'banktransfert') {
|
||||||
$reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer;
|
$reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer;
|
||||||
} else {
|
} else {
|
||||||
$reflabel .= $val['soclib'];
|
$reflabel .= $val['soclib'];
|
||||||
@ -1108,21 +1119,32 @@ if (empty($action) || $action == 'view') {
|
|||||||
print "<td>";
|
print "<td>";
|
||||||
$account_ledger = $k;
|
$account_ledger = $k;
|
||||||
// Try to force general ledger account depending on type
|
// Try to force general ledger account depending on type
|
||||||
if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
if ($tabtype[$key] == 'payment') {
|
||||||
if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
$account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||||
if ($tabtype[$key] == 'payment_expensereport') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
}
|
||||||
if ($tabtype[$key] == 'payment_salary') $account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
if ($tabtype[$key] == 'payment_supplier') {
|
||||||
if ($tabtype[$key] == 'payment_vat') $account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
|
$account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||||
if ($tabtype[$key] == 'member') $account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
|
}
|
||||||
if ($tabtype[$key] == 'payment_various') $account_ledger = $tabpay[$key]["account_various"];
|
if ($tabtype[$key] == 'payment_expensereport') {
|
||||||
|
$account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_salary') {
|
||||||
|
$account_ledger = $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT;
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_vat') {
|
||||||
|
$account_ledger = $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT;
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'member') {
|
||||||
|
$account_ledger = $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT;
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_various') {
|
||||||
|
$account_ledger = $tabpay[$key]["account_various"];
|
||||||
|
}
|
||||||
$accounttoshow = length_accountg($account_ledger);
|
$accounttoshow = length_accountg($account_ledger);
|
||||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
||||||
{
|
if ($tabtype[$key] == 'unknown') {
|
||||||
if ($tabtype[$key] == 'unknown')
|
|
||||||
{
|
|
||||||
// We will accept writing, but into a waiting account
|
// We will accept writing, but into a waiting account
|
||||||
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1')
|
if (empty($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE) || $conf->global->ACCOUNTING_ACCOUNT_SUSPENSE == '-1') {
|
||||||
{
|
|
||||||
print '<span class="error">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
print '<span class="error">'.$langs->trans('UnknownAccountForThirdpartyAndWaitingAccountNotDefinedBlocking').'</span>';
|
||||||
} else {
|
} else {
|
||||||
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||||
@ -1130,32 +1152,42 @@ if (empty($action) || $action == 'view') {
|
|||||||
} else {
|
} else {
|
||||||
// We will refuse writing
|
// We will refuse writing
|
||||||
$errorstring = 'UnknownAccountForThirdpartyBlocking';
|
$errorstring = 'UnknownAccountForThirdpartyBlocking';
|
||||||
if ($tabtype[$key] == 'payment') $errorstring = 'MainAccountForCustomersNotDefined';
|
if ($tabtype[$key] == 'payment') {
|
||||||
if ($tabtype[$key] == 'payment_supplier') $errorstring = 'MainAccountForSuppliersNotDefined';
|
$errorstring = 'MainAccountForCustomersNotDefined';
|
||||||
if ($tabtype[$key] == 'payment_expensereport') $errorstring = 'MainAccountForUsersNotDefined';
|
}
|
||||||
if ($tabtype[$key] == 'payment_salary') $errorstring = 'MainAccountForUsersNotDefined';
|
if ($tabtype[$key] == 'payment_supplier') {
|
||||||
if ($tabtype[$key] == 'payment_vat') $errorstring = 'MainAccountForVatPaymentNotDefined';
|
$errorstring = 'MainAccountForSuppliersNotDefined';
|
||||||
if ($tabtype[$key] == 'member') $errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_expensereport') {
|
||||||
|
$errorstring = 'MainAccountForUsersNotDefined';
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_salary') {
|
||||||
|
$errorstring = 'MainAccountForUsersNotDefined';
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'payment_vat') {
|
||||||
|
$errorstring = 'MainAccountForVatPaymentNotDefined';
|
||||||
|
}
|
||||||
|
if ($tabtype[$key] == 'member') {
|
||||||
|
$errorstring = 'MainAccountForSubscriptionPaymentNotDefined';
|
||||||
|
}
|
||||||
print '<span class="error">'.$langs->trans($errorstring).'</span>';
|
print '<span class="error">'.$langs->trans($errorstring).'</span>';
|
||||||
}
|
}
|
||||||
} else print $accounttoshow;
|
} else {
|
||||||
|
print $accounttoshow;
|
||||||
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Subledger account
|
// Subledger account
|
||||||
print "<td>";
|
print "<td>";
|
||||||
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) // Type of payment with subledger
|
if (in_array($tabtype[$key], array('payment', 'payment_supplier', 'payment_expensereport', 'payment_salary', 'payment_various'))) { // Type of payment with subledger
|
||||||
{
|
|
||||||
$accounttoshowsubledger = length_accounta($k);
|
$accounttoshowsubledger = length_accounta($k);
|
||||||
if ($accounttoshow != $accounttoshowsubledger)
|
if ($accounttoshow != $accounttoshowsubledger) {
|
||||||
{
|
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
|
||||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
|
|
||||||
{
|
|
||||||
/*var_dump($tabpay[$key]);
|
/*var_dump($tabpay[$key]);
|
||||||
var_dump($tabtype[$key]);
|
var_dump($tabtype[$key]);
|
||||||
var_dump($tabbq[$key]);*/
|
var_dump($tabbq[$key]);*/
|
||||||
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
//print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefined").'</span>';
|
||||||
if (!empty($tabcompany[$key]['code_compta']))
|
if (!empty($tabcompany[$key]['code_compta'])) {
|
||||||
{
|
|
||||||
if (in_array($tabtype[$key], array('payment_various'))) {
|
if (in_array($tabtype[$key], array('payment_various'))) {
|
||||||
// For such case, if subledger is not defined, we won't use subledger accounts.
|
// For such case, if subledger is not defined, we won't use subledger accounts.
|
||||||
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||||
@ -1165,7 +1197,9 @@ if (empty($action) || $action == 'view') {
|
|||||||
} else {
|
} else {
|
||||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||||
}
|
}
|
||||||
} else print $accounttoshowsubledger;
|
} else {
|
||||||
|
print $accounttoshowsubledger;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
@ -1178,10 +1212,11 @@ if (empty($action) || $action == 'view') {
|
|||||||
}
|
}
|
||||||
} else { // Waiting account
|
} else { // Waiting account
|
||||||
foreach ($tabbq[$key] as $k => $mt) {
|
foreach ($tabbq[$key] as $k => $mt) {
|
||||||
if ($mt)
|
if ($mt) {
|
||||||
{
|
|
||||||
$reflabel = '';
|
$reflabel = '';
|
||||||
if (!empty($val['lib'])) $reflabel .= $val['lib']." - ";
|
if (!empty($val['lib'])) {
|
||||||
|
$reflabel .= $val['lib']." - ";
|
||||||
|
}
|
||||||
$reflabel .= 'WaitingAccount';
|
$reflabel .= 'WaitingAccount';
|
||||||
|
|
||||||
print '<!-- Wait bank.rowid='.$key.' -->';
|
print '<!-- Wait bank.rowid='.$key.' -->';
|
||||||
@ -1265,78 +1300,67 @@ function getSourceDocRef($val, $typerecord)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sqlmid = '';
|
$sqlmid = '';
|
||||||
if ($typerecord == 'payment')
|
if ($typerecord == 'payment') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
$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 .= " 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=".$val["paymentid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("Invoice");
|
$ref = $langs->transnoentitiesnoconv("Invoice");
|
||||||
} elseif ($typerecord == 'payment_supplier')
|
} elseif ($typerecord == 'payment_supplier') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';
|
$sqlmid = 'SELECT payfac.fk_facturefourn as id, f.ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as payfac, ".MAIN_DB_PREFIX."facture_fourn as f";
|
||||||
$sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=".$val["paymentsupplierid"];
|
$sqlmid .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=".$val["paymentsupplierid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("SupplierInvoice");
|
$ref = $langs->transnoentitiesnoconv("SupplierInvoice");
|
||||||
} elseif ($typerecord == 'payment_expensereport')
|
} elseif ($typerecord == 'payment_expensereport') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT e.rowid as id, e.ref';
|
$sqlmid = 'SELECT e.rowid as id, e.ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as pe, ".MAIN_DB_PREFIX."expensereport as e";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_expensereport as pe, ".MAIN_DB_PREFIX."expensereport as e";
|
||||||
$sqlmid .= " WHERE pe.rowid=".$val["paymentexpensereport"]." AND pe.fk_expensereport = e.rowid";
|
$sqlmid .= " WHERE pe.rowid=".$val["paymentexpensereport"]." AND pe.fk_expensereport = e.rowid";
|
||||||
$ref = $langs->transnoentitiesnoconv("ExpenseReport");
|
$ref = $langs->transnoentitiesnoconv("ExpenseReport");
|
||||||
} elseif ($typerecord == 'payment_salary')
|
} elseif ($typerecord == 'payment_salary') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT s.rowid as ref';
|
$sqlmid = 'SELECT s.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||||
$sqlmid .= " WHERE s.rowid=".$val["paymentsalid"];
|
$sqlmid .= " WHERE s.rowid=".$val["paymentsalid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("SalaryPayment");
|
$ref = $langs->transnoentitiesnoconv("SalaryPayment");
|
||||||
} elseif ($typerecord == 'sc')
|
} elseif ($typerecord == 'sc') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT sc.rowid as ref';
|
$sqlmid = 'SELECT sc.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementcharge as sc";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementcharge as sc";
|
||||||
$sqlmid .= " WHERE sc.rowid=".$val["paymentscid"];
|
$sqlmid .= " WHERE sc.rowid=".$val["paymentscid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("SocialContribution");
|
$ref = $langs->transnoentitiesnoconv("SocialContribution");
|
||||||
} elseif ($typerecord == 'payment_vat')
|
} elseif ($typerecord == 'payment_vat') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT v.rowid as ref';
|
$sqlmid = 'SELECT v.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."tva as v";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."tva as v";
|
||||||
$sqlmid .= " WHERE v.rowid=".$val["paymentvatid"];
|
$sqlmid .= " WHERE v.rowid=".$val["paymentvatid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("PaymentVat");
|
$ref = $langs->transnoentitiesnoconv("PaymentVat");
|
||||||
} elseif ($typerecord == 'payment_donation')
|
} elseif ($typerecord == 'payment_donation') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT payd.fk_donation as ref';
|
$sqlmid = 'SELECT payd.fk_donation as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_donation as payd";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_donation as payd";
|
||||||
$sqlmid .= " WHERE payd.fk_donation=".$val["paymentdonationid"];
|
$sqlmid .= " WHERE payd.fk_donation=".$val["paymentdonationid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("Donation");
|
$ref = $langs->transnoentitiesnoconv("Donation");
|
||||||
} elseif ($typerecord == 'payment_loan')
|
} elseif ($typerecord == 'payment_loan') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT l.rowid as ref';
|
$sqlmid = 'SELECT l.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_loan as l";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_loan as l";
|
||||||
$sqlmid .= " WHERE l.rowid=".$val["paymentloanid"];
|
$sqlmid .= " WHERE l.rowid=".$val["paymentloanid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("LoanPayment");
|
$ref = $langs->transnoentitiesnoconv("LoanPayment");
|
||||||
} elseif ($typerecord == 'payment_various')
|
} elseif ($typerecord == 'payment_various') {
|
||||||
{
|
|
||||||
$sqlmid = 'SELECT v.rowid as ref';
|
$sqlmid = 'SELECT v.rowid as ref';
|
||||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||||
$sqlmid .= " WHERE v.rowid=".$val["paymentvariousid"];
|
$sqlmid .= " WHERE v.rowid=".$val["paymentvariousid"];
|
||||||
$ref = $langs->transnoentitiesnoconv("VariousPayment");
|
$ref = $langs->transnoentitiesnoconv("VariousPayment");
|
||||||
}
|
}
|
||||||
// Add warning
|
// Add warning
|
||||||
if (empty($sqlmid))
|
if (empty($sqlmid)) {
|
||||||
{
|
|
||||||
dol_syslog("Found a typerecord=".$typerecord." not supported", LOG_WARNING);
|
dol_syslog("Found a typerecord=".$typerecord." not supported", LOG_WARNING);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sqlmid)
|
if ($sqlmid) {
|
||||||
{
|
|
||||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=".$sqlmid, LOG_DEBUG);
|
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=".$sqlmid, LOG_DEBUG);
|
||||||
$resultmid = $db->query($sqlmid);
|
$resultmid = $db->query($sqlmid);
|
||||||
if ($resultmid)
|
if ($resultmid) {
|
||||||
{
|
while ($objmid = $db->fetch_object($resultmid)) {
|
||||||
while ($objmid = $db->fetch_object($resultmid))
|
|
||||||
{
|
|
||||||
$ref .= ' '.$objmid->ref;
|
$ref .= ' '.$objmid->ref;
|
||||||
}
|
}
|
||||||
} else dol_print_error($db);
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$ref = dol_trunc($langs->transnoentitiesnoconv("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300
|
$ref = dol_trunc($langs->transnoentitiesnoconv("BankId").' '.$val['fk_bank'].' - '.$ref, 295); // 295 + 3 dots (...) is < than max size of 300
|
||||||
|
|||||||
@ -382,14 +382,12 @@ if (empty($reshook)) {
|
|||||||
if ($action == 'add' && $user->rights->adherent->creer) {
|
if ($action == 'add' && $user->rights->adherent->creer) {
|
||||||
if ($canvas) $object->canvas = $canvas;
|
if ($canvas) $object->canvas = $canvas;
|
||||||
$birthdate = '';
|
$birthdate = '';
|
||||||
if (isset($_POST["birthday"]) && $_POST["birthday"]
|
if (GETPOSTISSET("birthday") && GETPOST("birthday") && GETPOSTISSET("birthmonth") && GETPOST("birthmonth") && GETPOSTISSET("birthyear") && GETPOST("birthyear")) {
|
||||||
&& isset($_POST["birthmonth"]) && $_POST["birthmonth"]
|
$birthdate = dol_mktime(12, 0, 0, GETPOST("birthmonth", 'int'), GETPOST("birthday", 'int'), GETPOST("birthyear", 'int'));
|
||||||
&& isset($_POST["birthyear"]) && $_POST["birthyear"]) {
|
|
||||||
$birthdate = dol_mktime(12, 0, 0, $_POST["birthmonth"], $_POST["birthday"], $_POST["birthyear"]);
|
|
||||||
}
|
}
|
||||||
$datesubscription = '';
|
$datesubscription = '';
|
||||||
if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"])) {
|
if (GETPOSTISSET("reday") && GETPOSTISSET("remonth") && GETPOSTISSET("reyear")) {
|
||||||
$datesubscription = dol_mktime(12, 0, 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]);
|
$datesubscription = dol_mktime(12, 0, 0, GETPOST("remonth", 'int'), GETPOST("reday", "int"), GETPOST("reyear", "int"));
|
||||||
}
|
}
|
||||||
|
|
||||||
$typeid = GETPOST("typeid", 'int');
|
$typeid = GETPOST("typeid", 'int');
|
||||||
@ -1075,7 +1073,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// Password
|
// Password
|
||||||
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) {
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(isset($_POST["pass"]) ?GETPOST("pass", '', 2) : $object->pass).'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Password").'</td><td><input type="password" name="pass" class="minwidth300" maxlength="50" value="'.(GETPOSTISSET("pass") ? GETPOST("pass", '', 2) : $object->pass).'"></td></tr>';
|
||||||
}
|
}
|
||||||
// Morphy
|
// Morphy
|
||||||
$morphys["phy"] = $langs->trans("Physical");
|
$morphys["phy"] = $langs->trans("Physical");
|
||||||
@ -1134,7 +1132,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
|
|
||||||
// EMail
|
// EMail
|
||||||
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
|
print '<tr><td>'.($conf->global->ADHERENT_MAIL_REQUIRED ? '<span class="fieldrequired">' : '').$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED ? '</span>' : '').'</td>';
|
||||||
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(isset($_POST["member_email"]) ?GETPOST("member_email", '', 2) : $object->email).'"></td></tr>';
|
print '<td>'.img_picto('', 'object_email').' <input type="text" name="member_email" class="minwidth300" maxlength="255" value="'.(GETPOSTISSET("member_email") ? GETPOST("member_email", '', 2) : $object->email).'"></td></tr>';
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
print '<tr><td>'.$langs->trans("Address").'</td><td>';
|
||||||
@ -1151,14 +1149,14 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||||||
// Country
|
// Country
|
||||||
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
|
//$object->country_id=$object->country_id?$object->country_id:$mysoc->country_id; // In edit mode we don't force to company country if not defined
|
||||||
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
print '<tr><td>'.$langs->trans('Country').'</td><td>';
|
||||||
print $form->select_country(isset($_POST["country_id"]) ? $_POST["country_id"] : $object->country_id, 'country_id');
|
print $form->select_country(GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id, 'country_id');
|
||||||
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// State
|
// State
|
||||||
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
|
if (empty($conf->global->MEMBER_DISABLE_STATE)) {
|
||||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||||
print $formcompany->select_state($object->state_id, isset($_POST["country_id"]) ?GETPOST("country_id") : $object->country_id);
|
print $formcompany->select_state($object->state_id, GETPOSTISSET("country_id") ? GETPOST("country_id", "alpha") : $object->country_id);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -103,6 +103,7 @@ class Adherent extends CommonObject
|
|||||||
* @var int Thirdparty ID
|
* @var int Thirdparty ID
|
||||||
*/
|
*/
|
||||||
public $fk_soc;
|
public $fk_soc;
|
||||||
|
public $socid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Address
|
* @var string Address
|
||||||
@ -1262,14 +1263,15 @@ class Adherent extends CommonObject
|
|||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid";
|
||||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
|
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
|
||||||
$sql .= " WHERE d.fk_adherent_type = t.rowid";
|
$sql .= " WHERE d.fk_adherent_type = t.rowid";
|
||||||
if ($rowid)
|
if ($rowid) {
|
||||||
$sql .= " AND d.rowid=".$rowid;
|
$sql .= " AND d.rowid=".((int) $rowid);
|
||||||
elseif ($ref || $fk_soc) {
|
} elseif ($ref || $fk_soc) {
|
||||||
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
$sql .= " AND d.entity IN (".getEntity('adherent').")";
|
||||||
if ($ref)
|
if ($ref) {
|
||||||
$sql .= " AND d.rowid='".$this->db->escape($ref)."'";
|
$sql .= " AND d.rowid='".$this->db->escape($ref)."'";
|
||||||
elseif ($fk_soc > 0)
|
} elseif ($fk_soc > 0) {
|
||||||
$sql .= " AND d.fk_soc=".$fk_soc;
|
$sql .= " AND d.fk_soc=".((int) $fk_soc);
|
||||||
|
}
|
||||||
} elseif ($ref_ext) {
|
} elseif ($ref_ext) {
|
||||||
$sql .= " AND d.ref_ext='".$this->db->escape($ref_ext)."'";
|
$sql .= " AND d.ref_ext='".$this->db->escape($ref_ext)."'";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -333,7 +333,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'subscription' && !
|
|||||||
$listofpaths = array();
|
$listofpaths = array();
|
||||||
$listofnames = array();
|
$listofnames = array();
|
||||||
$listofmimes = array();
|
$listofmimes = array();
|
||||||
if (is_object($object->invoice)) {
|
if (is_object($object->invoice) && (!is_object($arraydefaultmessage) || intval($arraydefaultmessage->joinfiles))) {
|
||||||
$invoicediroutput = $conf->facture->dir_output;
|
$invoicediroutput = $conf->facture->dir_output;
|
||||||
$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+');
|
$fileparams = dol_most_recent_file($invoicediroutput.'/'.$object->invoice->ref, preg_quote($object->invoice->ref, '/').'[^\-]+');
|
||||||
$file = $fileparams['fullname'];
|
$file = $fileparams['fullname'];
|
||||||
|
|||||||
@ -719,7 +719,7 @@ if ($rowid > 0) {
|
|||||||
|
|
||||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
|
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
|
||||||
|
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" name="label" size="40" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth300" name="label" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||||
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status);
|
print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status);
|
||||||
|
|||||||
@ -37,6 +37,7 @@ $langs->loadLangs(array('members', 'languages'));
|
|||||||
$id = GETPOST('rowid', 'int');
|
$id = GETPOST('rowid', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
$cancel = GETPOST('cancel', 'alpha');
|
$cancel = GETPOST('cancel', 'alpha');
|
||||||
|
$ref = GETPOST('ref', 'alphanohtml');
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
$fieldvalue = (!empty($id) ? $id : (!empty($ref) ? $ref : ''));
|
||||||
@ -67,15 +68,17 @@ if ($action == 'vadd' && $cancel != $langs->trans("Cancel") && $user->rights->ad
|
|||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
$current_lang = $langs->getDefaultLang();
|
$current_lang = $langs->getDefaultLang();
|
||||||
|
|
||||||
|
$forcelangprod = GETPOST("forcelangprod", 'aZ09');
|
||||||
|
|
||||||
// update of object
|
// update of object
|
||||||
if ($_POST["forcelangprod"] == $current_lang) {
|
if ($forcelangprod == $current_lang) {
|
||||||
$object->label = $_POST["libelle"];
|
$object->label = GETPOST("libelle", 'alphanohtml');
|
||||||
$object->description = dol_htmlcleanlastbr($_POST["desc"]);
|
$object->description = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||||
$object->other = dol_htmlcleanlastbr($_POST["other"]);
|
$object->other = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||||
} else {
|
} else {
|
||||||
$object->multilangs[$_POST["forcelangprod"]]["label"] = $_POST["libelle"];
|
$object->multilangs[$forcelangprod]["label"] = GETPOST("libelle", 'alphanohtml');
|
||||||
$object->multilangs[$_POST["forcelangprod"]]["description"] = dol_htmlcleanlastbr($_POST["desc"]);
|
$object->multilangs[$forcelangprod]["description"] = dol_htmlcleanlastbr(GETPOST("desc", 'restricthtml'));
|
||||||
$object->multilangs[$_POST["forcelangprod"]]["other"] = dol_htmlcleanlastbr($_POST["other"]);
|
$object->multilangs[$forcelangprod]["other"] = dol_htmlcleanlastbr(GETPOST("other", 'restricthtml'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// backup into database
|
// backup into database
|
||||||
@ -95,13 +98,13 @@ if ($action == 'vedit' && $cancel != $langs->trans("Cancel") && $user->rights->a
|
|||||||
|
|
||||||
foreach ($object->multilangs as $key => $value) { // saving new values in the object
|
foreach ($object->multilangs as $key => $value) { // saving new values in the object
|
||||||
if ($key == $current_lang) {
|
if ($key == $current_lang) {
|
||||||
$object->label = $_POST["libelle-".$key];
|
$object->label = GETPOST("libelle-".$key, 'alphanohtml');
|
||||||
$object->description = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
$object->description = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
|
||||||
$object->other = dol_htmlcleanlastbr($_POST["other-".$key]);
|
$object->other = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||||
} else {
|
} else {
|
||||||
$object->multilangs[$key]["label"] = $_POST["libelle-".$key];
|
$object->multilangs[$key]["label"] = GETPOST("libelle-".$key, 'alphanohtml');
|
||||||
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr($_POST["desc-".$key]);
|
$object->multilangs[$key]["description"] = dol_htmlcleanlastbr(GETPOST("desc-".$key, 'restricthtml'));
|
||||||
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr($_POST["other-".$key]);
|
$object->multilangs[$key]["other"] = dol_htmlcleanlastbr(GETPOST("other-".$key, 'restricthtml'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,7 +208,7 @@ if ($action == 'edit') {
|
|||||||
|
|
||||||
print '<div class="underbanner clearboth"></div>';
|
print '<div class="underbanner clearboth"></div>';
|
||||||
print '<table class="border centpercent">';
|
print '<table class="border centpercent">';
|
||||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" size="40" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
|
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle-'.$key.'" class="minwidth300" value="'.dol_escape_htmltag($object->multilangs[$key]["label"]).'"></td></tr>';
|
||||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||||
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
$doleditor = new DolEditor("desc-$key", $object->multilangs[$key]["description"], '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
@ -264,7 +267,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) {
|
|||||||
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Language').'</td><td>';
|
print '<tr><td class="tdtop titlefieldcreate fieldrequired">'.$langs->trans('Language').'</td><td>';
|
||||||
print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
|
print $formadmin->select_language('', 'forcelangprod', 0, $object->multilangs, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" size="40"></td></tr>';
|
print '<tr><td class="tdtop fieldrequired">'.$langs->trans('Label').'</td><td><input name="libelle" class="minwidth300" value="'.dol_escape_htmltag(GETPOST("libelle", 'alphanohtml')).'"></td></tr>';
|
||||||
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
print '<tr><td class="tdtop">'.$langs->trans('Description').'</td><td>';
|
||||||
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
$doleditor = new DolEditor('desc', '', '', 160, 'dolibarr_notes', '', false, true, $conf->global->FCKEDITOR_ENABLE_PRODUCTDESC, ROWS_3, '90%');
|
||||||
$doleditor->Create();
|
$doleditor->Create();
|
||||||
|
|||||||
@ -292,7 +292,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL >= 2)
|
|||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -391,7 +391,7 @@ foreach ($dirmodels as $reldir) {
|
|||||||
// Preview
|
// Preview
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf') {
|
if ($module->type == 'pdf') {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -232,8 +232,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering model
|
// Show example of numbering model
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -412,7 +414,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -31,7 +31,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
|||||||
// Load translation files required by the page
|
// Load translation files required by the page
|
||||||
$langs->loadLangs(array('admin', 'boxes', 'accountancy'));
|
$langs->loadLangs(array('admin', 'boxes', 'accountancy'));
|
||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$rowid = GETPOST('rowid', 'int');
|
$rowid = GETPOST('rowid', 'int');
|
||||||
$action = GETPOST('action', 'aZ09');
|
$action = GETPOST('action', 'aZ09');
|
||||||
@ -46,39 +48,34 @@ $boxes = array();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'addconst')
|
if ($action == 'addconst') {
|
||||||
{
|
|
||||||
dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", $_POST["MAIN_BOXES_MAXLINES"], '', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_BOXES_MAXLINES", $_POST["MAIN_BOXES_MAXLINES"], '', 0, '', $conf->entity);
|
||||||
dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"], 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"], 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'add') {
|
if ($action == 'add') {
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
$boxids = GETPOST('boxid', 'array');
|
||||||
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
if (isset($_POST['boxid']) && is_array($_POST['boxid']))
|
if (is_array($boxids)) {
|
||||||
{
|
foreach ($boxids as $boxid) {
|
||||||
foreach ($_POST['boxid'] as $boxid)
|
if (is_numeric($boxid['pos']) && $boxid['pos'] >= 0) { // 0=Home, 1=...
|
||||||
{
|
|
||||||
if (is_numeric($boxid['pos']) && $boxid['pos'] >= 0) // 0=Home, 1=...
|
|
||||||
{
|
|
||||||
$pos = $boxid['pos'];
|
$pos = $boxid['pos'];
|
||||||
|
|
||||||
// Initialize distinct fk_user with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
|
// Initialize distinct fk_user with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
|
||||||
$distinctfkuser = array();
|
$distinctfkuser = array();
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
$sql = "SELECT fk_user";
|
$sql = "SELECT fk_user";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."user_param";
|
$sql .= " FROM ".MAIN_DB_PREFIX."user_param";
|
||||||
$sql .= " WHERE param = 'MAIN_BOXES_".$db->escape($pos)."' AND value = '1'";
|
$sql .= " WHERE param = 'MAIN_BOXES_".$db->escape($pos)."' AND value = '1'";
|
||||||
$sql .= " AND entity = ".$conf->entity;
|
$sql .= " AND entity = ".$conf->entity;
|
||||||
dol_syslog("boxes.php search fk_user to activate box for", LOG_DEBUG);
|
dol_syslog("boxes.php search fk_user to activate box for", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$distinctfkuser[$obj->fk_user] = $obj->fk_user;
|
$distinctfkuser[$obj->fk_user] = $obj->fk_user;
|
||||||
$i++;
|
$i++;
|
||||||
@ -91,26 +88,28 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
$distinctfkuser['0'] = '0'; // Add entry for fk_user = 0. We must use string as key and val
|
$distinctfkuser['0'] = '0'; // Add entry for fk_user = 0. We must use string as key and val
|
||||||
|
|
||||||
foreach ($distinctfkuser as $fk_user)
|
foreach ($distinctfkuser as $fk_user) {
|
||||||
{
|
if (!$error && $fk_user != '') {
|
||||||
if (!$error && $fk_user != '')
|
|
||||||
{
|
|
||||||
$arrayofexistingboxid = array();
|
$arrayofexistingboxid = array();
|
||||||
$nbboxonleft = $nbboxonright = 0;
|
$nbboxonleft = $nbboxonright = 0;
|
||||||
$sql = "SELECT box_id, box_order FROM ".MAIN_DB_PREFIX."boxes";
|
$sql = "SELECT box_id, box_order FROM ".MAIN_DB_PREFIX."boxes";
|
||||||
$sql .= " WHERE position = ".$pos." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
|
$sql .= " WHERE position = ".$pos." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
|
||||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
while ($obj = $db->fetch_object($resql)) {
|
||||||
while ($obj = $db->fetch_object($resql))
|
|
||||||
{
|
|
||||||
$boxorder = $obj->box_order;
|
$boxorder = $obj->box_order;
|
||||||
if (preg_match('/A/', $boxorder)) $nbboxonleft++;
|
if (preg_match('/A/', $boxorder)) {
|
||||||
if (preg_match('/B/', $boxorder)) $nbboxonright++;
|
$nbboxonleft++;
|
||||||
|
}
|
||||||
|
if (preg_match('/B/', $boxorder)) {
|
||||||
|
$nbboxonright++;
|
||||||
|
}
|
||||||
$arrayofexistingboxid[$obj->box_id] = 1;
|
$arrayofexistingboxid[$obj->box_id] = 1;
|
||||||
}
|
}
|
||||||
} else dol_print_error($db);
|
} else {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
if (empty($arrayofexistingboxid[$boxid['value']])) {
|
if (empty($arrayofexistingboxid[$boxid['value']])) {
|
||||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||||
@ -121,8 +120,7 @@ if ($action == 'add') {
|
|||||||
|
|
||||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if (!$resql)
|
if (!$resql) {
|
||||||
{
|
|
||||||
setEventMessages($db->lasterror(), null, 'errors');
|
setEventMessages($db->lasterror(), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
@ -134,8 +132,7 @@ if ($action == 'add') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
$action = '';
|
$action = '';
|
||||||
} else {
|
} else {
|
||||||
@ -143,15 +140,13 @@ if ($action == 'add') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'delete')
|
if ($action == 'delete') {
|
||||||
{
|
|
||||||
$sql = "SELECT box_id FROM ".MAIN_DB_PREFIX."boxes";
|
$sql = "SELECT box_id FROM ".MAIN_DB_PREFIX."boxes";
|
||||||
$sql .= " WHERE rowid=".$rowid;
|
$sql .= " WHERE rowid=".((int) $rowid);
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
if (!empty($obj->box_id))
|
if (!empty($obj->box_id)) {
|
||||||
{
|
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
// Remove all personalized setup when a box is activated or disabled (why removing all ? We removed only removed boxes)
|
// Remove all personalized setup when a box is activated or disabled (why removing all ? We removed only removed boxes)
|
||||||
@ -169,8 +164,7 @@ if ($action == 'delete')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($action == 'switch')
|
if ($action == 'switch') {
|
||||||
{
|
|
||||||
// We switch values of field box_order for the 2 lines of table boxes
|
// We switch values of field box_order for the 2 lines of table boxes
|
||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
@ -182,12 +176,10 @@ if ($action == 'switch')
|
|||||||
|
|
||||||
$resultupdatefrom = 0;
|
$resultupdatefrom = 0;
|
||||||
$resultupdateto = 0;
|
$resultupdateto = 0;
|
||||||
if (is_object($objfrom) && is_object($objto))
|
if (is_object($objfrom) && is_object($objto)) {
|
||||||
{
|
|
||||||
$newfirst = $objto->box_order;
|
$newfirst = $objto->box_order;
|
||||||
$newsecond = $objfrom->box_order;
|
$newsecond = $objfrom->box_order;
|
||||||
if ($newfirst == $newsecond)
|
if ($newfirst == $newsecond) {
|
||||||
{
|
|
||||||
$newsecondchar = preg_replace('/[0-9]+/', '', $newsecond);
|
$newsecondchar = preg_replace('/[0-9]+/', '', $newsecond);
|
||||||
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
|
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
|
||||||
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
|
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
|
||||||
@ -195,16 +187,19 @@ if ($action == 'switch')
|
|||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid);
|
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid);
|
||||||
dol_syslog($sql);
|
dol_syslog($sql);
|
||||||
$resultupdatefrom = $db->query($sql);
|
$resultupdatefrom = $db->query($sql);
|
||||||
if (!$resultupdatefrom) { dol_print_error($db); }
|
if (!$resultupdatefrom) {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newsecond)."' WHERE rowid=".((int) $objto->rowid);
|
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newsecond)."' WHERE rowid=".((int) $objto->rowid);
|
||||||
dol_syslog($sql);
|
dol_syslog($sql);
|
||||||
$resultupdateto = $db->query($sql);
|
$resultupdateto = $db->query($sql);
|
||||||
if (!$resultupdateto) { dol_print_error($db); }
|
if (!$resultupdateto) {
|
||||||
|
dol_print_error($db);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($resultupdatefrom && $resultupdateto)
|
if ($resultupdatefrom && $resultupdateto) {
|
||||||
{
|
|
||||||
$db->commit();
|
$db->commit();
|
||||||
} else {
|
} else {
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
@ -241,33 +236,31 @@ $sql .= " ORDER by b.position, b.box_order";
|
|||||||
|
|
||||||
dol_syslog("Search available boxes", LOG_DEBUG);
|
dol_syslog("Search available boxes", LOG_DEBUG);
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
|
|
||||||
// Check record to know if we must recalculate sort order
|
// Check record to know if we must recalculate sort order
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$decalage = 0;
|
$decalage = 0;
|
||||||
while ($i < $num)
|
while ($i < $num) {
|
||||||
{
|
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
$boxes[$obj->position][$obj->box_id] = 1;
|
$boxes[$obj->position][$obj->box_id] = 1;
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
array_push($actives, $obj->box_id);
|
array_push($actives, $obj->box_id);
|
||||||
|
|
||||||
if ($obj->box_order == '' || $obj->box_order == '0' || $decalage) $decalage++;
|
if ($obj->box_order == '' || $obj->box_order == '0' || $decalage) {
|
||||||
|
$decalage++;
|
||||||
|
}
|
||||||
// We renumber the order of the boxes if one of them is in ''
|
// We renumber the order of the boxes if one of them is in ''
|
||||||
// This occurs just after an insert.
|
// This occurs just after an insert.
|
||||||
if ($decalage)
|
if ($decalage) {
|
||||||
{
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($decalage)."' WHERE rowid=".$obj->rowid;
|
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($decalage)."' WHERE rowid=".$obj->rowid;
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($decalage)
|
if ($decalage) {
|
||||||
{
|
|
||||||
// If we have renumbered, we correct the field box_order
|
// If we have renumbered, we correct the field box_order
|
||||||
// This occurs just after an insert.
|
// This occurs just after an insert.
|
||||||
$sql = "SELECT box_order";
|
$sql = "SELECT box_order";
|
||||||
@ -277,32 +270,24 @@ if ($resql)
|
|||||||
|
|
||||||
dol_syslog("Execute requests to renumber box order", LOG_DEBUG);
|
dol_syslog("Execute requests to renumber box order", LOG_DEBUG);
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
while ($record = $db->fetch_array($result)) {
|
||||||
while ($record = $db->fetch_array($result))
|
if (dol_strlen($record['box_order']) == 1) {
|
||||||
{
|
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1))) {
|
||||||
if (dol_strlen($record['box_order']) == 1)
|
|
||||||
{
|
|
||||||
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1)))
|
|
||||||
{
|
|
||||||
$box_order = "A0".$record['box_order'];
|
$box_order = "A0".$record['box_order'];
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
} elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
} elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) {
|
||||||
{
|
|
||||||
$box_order = "B0".$record['box_order'];
|
$box_order = "B0".$record['box_order'];
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
}
|
}
|
||||||
} elseif (dol_strlen($record['box_order']) == 2)
|
} elseif (dol_strlen($record['box_order']) == 2) {
|
||||||
{
|
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1))) {
|
||||||
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1)))
|
|
||||||
{
|
|
||||||
$box_order = "A".$record['box_order'];
|
$box_order = "A".$record['box_order'];
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
} elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1)))
|
} elseif (preg_match("/[02468]{1}/", substr($record['box_order'], -1))) {
|
||||||
{
|
|
||||||
$box_order = "B".$record['box_order'];
|
$box_order = "B".$record['box_order'];
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order = '".$db->escape($box_order)."' WHERE entity = ".$conf->entity." AND box_order = '".$db->escape($record['box_order'])."'";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
@ -337,10 +322,8 @@ print '<td>'.$langs->trans("SourceFile").'</td>';
|
|||||||
print '<td width="160" class="center">'.$langs->trans("ActivateOn").'</td>';
|
print '<td width="160" class="center">'.$langs->trans("ActivateOn").'</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
foreach ($boxtoadd as $box)
|
foreach ($boxtoadd as $box) {
|
||||||
{
|
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) {
|
||||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg))
|
|
||||||
{
|
|
||||||
$logo = $box->boximg;
|
$logo = $box->boximg;
|
||||||
} else {
|
} else {
|
||||||
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
||||||
@ -349,14 +332,17 @@ foreach ($boxtoadd as $box)
|
|||||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||||
print '<tr class="oddeven">'."\n";
|
print '<tr class="oddeven">'."\n";
|
||||||
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||||
if (!empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')';
|
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
|
||||||
|
print ' ('.$langs->trans("Graph").')';
|
||||||
|
}
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($box->note == '(WarningUsingThisBoxSlowDown)')
|
if ($box->note == '(WarningUsingThisBoxSlowDown)') {
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print $langs->trans("WarningUsingThisBoxSlowDown");
|
print $langs->trans("WarningUsingThisBoxSlowDown");
|
||||||
} else print ($box->note ? $box->note : ' ');
|
} else {
|
||||||
|
print ($box->note ? $box->note : ' ');
|
||||||
|
}
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
print '<td>'.$box->sourcefile.'</td>'."\n";
|
print '<td>'.$box->sourcefile.'</td>'."\n";
|
||||||
|
|
||||||
@ -368,8 +354,7 @@ foreach ($boxtoadd as $box)
|
|||||||
|
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
}
|
}
|
||||||
if (!count($boxtoadd) && count($boxactivated))
|
if (!count($boxtoadd) && count($boxactivated)) {
|
||||||
{
|
|
||||||
print '<tr><td class="opacitymedium" colspan="4">'.$langs->trans("AllWidgetsWereEnabled").'</td></tr>';
|
print '<tr><td class="opacitymedium" colspan="4">'.$langs->trans("AllWidgetsWereEnabled").'</td></tr>';
|
||||||
}
|
}
|
||||||
print '</table>'."\n";
|
print '</table>'."\n";
|
||||||
@ -399,10 +384,8 @@ print '</tr>'."\n";
|
|||||||
|
|
||||||
$box_order = 1;
|
$box_order = 1;
|
||||||
$foundrupture = 1;
|
$foundrupture = 1;
|
||||||
foreach ($boxactivated as $key => $box)
|
foreach ($boxactivated as $key => $box) {
|
||||||
{
|
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) {
|
||||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg))
|
|
||||||
{
|
|
||||||
$logo = $box->boximg;
|
$logo = $box->boximg;
|
||||||
} else {
|
} else {
|
||||||
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
||||||
@ -411,14 +394,17 @@ foreach ($boxactivated as $key => $box)
|
|||||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
print '<td>'.img_object("", $logo, 'height="14px"').' '.$langs->transnoentitiesnoconv($box->boxlabel);
|
||||||
if (!empty($box->class) && preg_match('/graph_/', $box->class)) print ' ('.$langs->trans("Graph").')';
|
if (!empty($box->class) && preg_match('/graph_/', $box->class)) {
|
||||||
|
print ' ('.$langs->trans("Graph").')';
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
if ($box->note == '(WarningUsingThisBoxSlowDown)')
|
if ($box->note == '(WarningUsingThisBoxSlowDown)') {
|
||||||
{
|
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
|
print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
|
||||||
} else print ($box->note ? $box->note : ' ');
|
} else {
|
||||||
|
print ($box->note ? $box->note : ' ');
|
||||||
|
}
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">'.(empty($pos_name[$box->position]) ? '' : $langs->trans($pos_name[$box->position])).'</td>';
|
print '<td class="center">'.(empty($pos_name[$box->position]) ? '' : $langs->trans($pos_name[$box->position])).'</td>';
|
||||||
$hasnext = ($key < (count($boxactivated) - 1));
|
$hasnext = ($key < (count($boxactivated) - 1));
|
||||||
@ -447,6 +433,7 @@ print load_fiche_titre($langs->trans("Other"), '', '');
|
|||||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="addconst">';
|
print '<input type="hidden" name="action" value="addconst">';
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
|
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -472,6 +459,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2 || !empty($conf->global->MAIN_ACTIVA
|
|||||||
}
|
}
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'" name="Button"></div>';
|
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'" name="Button"></div>';
|
||||||
|
|||||||
@ -168,8 +168,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -297,8 +297,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering model
|
// Show example of numbering model
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -482,7 +484,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -406,11 +406,12 @@ print '<input name="nom" id="name" class="minwidth200" value="'.dol_escape_htmlt
|
|||||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ADDRESS">'.$langs->trans("CompanyAddress").'</label></td><td>';
|
||||||
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.($conf->global->MAIN_INFO_SOCIETE_ADDRESS ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS : GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml')).'</textarea></td></tr>'."\n";
|
print '<textarea name="MAIN_INFO_SOCIETE_ADDRESS" id="MAIN_INFO_SOCIETE_ADDRESS" class="quatrevingtpercent" rows="'.ROWS_3.'">'.($conf->global->MAIN_INFO_SOCIETE_ADDRESS ? $conf->global->MAIN_INFO_SOCIETE_ADDRESS : GETPOST("MAIN_INFO_SOCIETE_ADDRESS", 'nohtml')).'</textarea></td></tr>'."\n";
|
||||||
|
|
||||||
|
// Zip
|
||||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_ZIP">'.$langs->trans("CompanyZip").'</label></td><td>';
|
||||||
print '<input class="minwidth100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP ? $conf->global->MAIN_INFO_SOCIETE_ZIP : GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha')).'"></td></tr>'."\n";
|
print '<input class="width100" name="MAIN_INFO_SOCIETE_ZIP" id="MAIN_INFO_SOCIETE_ZIP" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_ZIP ? $conf->global->MAIN_INFO_SOCIETE_ZIP : GETPOST("MAIN_INFO_SOCIETE_ZIP", 'alpha')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
|
print '<tr class="oddeven"><td><label for="MAIN_INFO_SOCIETE_TOWN">'.$langs->trans("CompanyTown").'</label></td><td>';
|
||||||
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth100" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN ? $conf->global->MAIN_INFO_SOCIETE_TOWN : GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml')).'"></td></tr>'."\n";
|
print '<input name="MAIN_INFO_SOCIETE_TOWN" class="minwidth200" id="MAIN_INFO_SOCIETE_TOWN" value="'.dol_escape_htmltag($conf->global->MAIN_INFO_SOCIETE_TOWN ? $conf->global->MAIN_INFO_SOCIETE_TOWN : GETPOST("MAIN_INFO_SOCIETE_TOWN", 'nohtml')).'"></td></tr>'."\n";
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
print '<tr class="oddeven"><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
|
||||||
@ -727,7 +728,7 @@ if ($mysoc->useLocalTax(1))
|
|||||||
print '<div class="nobordernopadding">';
|
print '<div class="nobordernopadding">';
|
||||||
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
|
||||||
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||||
print "<label for=\"lt1\">".$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
print '<label for="lt1">'.$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)."</label>";
|
||||||
if (!isOnlyOneLocalTax(1))
|
if (!isOnlyOneLocalTax(1))
|
||||||
{
|
{
|
||||||
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
print '<br><label for="lt1">'.$langs->trans("LTRate").'</label>: ';
|
||||||
@ -750,9 +751,9 @@ if ($mysoc->useLocalTax(1))
|
|||||||
} else {
|
} else {
|
||||||
if (empty($mysoc->country_code))
|
if (empty($mysoc->country_code))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven nohover"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
print '<tr class="oddeven nohover"><td class="">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven nohover"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).'</td></tr>';
|
print '<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax1Management")).'</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,7 +773,7 @@ if ($mysoc->useLocalTax(2))
|
|||||||
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
print "<tr class=\"oddeven\"><td><input type=\"radio\" name=\"optionlocaltax2\" id=\"lt2\" value=\"localtax2on\"".(($conf->global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)."</td>";
|
||||||
print '<td colspan="2">';
|
print '<td colspan="2">';
|
||||||
print '<div class="nobordernopadding">';
|
print '<div class="nobordernopadding">';
|
||||||
print "<label for=\"lt2\">".$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
|
print '<label for="lt2">'.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)."</label>";
|
||||||
$tooltiphelp = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
|
$tooltiphelp = $langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code);
|
||||||
$tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
$tooltiphelp = ($tooltiphelp != "LocalTax2IsUsedExample" ? "<i>".$langs->trans("Example").': '.$langs->transcountry("LocalTax2IsUsedExample", $mysoc->country_code)."</i>\n" : "");
|
||||||
if (!isOnlyOneLocalTax(2))
|
if (!isOnlyOneLocalTax(2))
|
||||||
@ -796,9 +797,9 @@ if ($mysoc->useLocalTax(2))
|
|||||||
} else {
|
} else {
|
||||||
if (empty($mysoc->country_code))
|
if (empty($mysoc->country_code))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven nohover"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
print '<tr class="oddeven nohover"><td class="">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven nohover"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).'</td></tr>';
|
print '<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryVAT"), $langs->transnoentitiesnoconv("LocalTax2Management")).'</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -824,9 +825,9 @@ if ($mysoc->useRevenueStamp())
|
|||||||
} else {
|
} else {
|
||||||
if (empty($mysoc->country_code))
|
if (empty($mysoc->country_code))
|
||||||
{
|
{
|
||||||
print '<tr class="oddeven nohover"><td class="opacitymedium">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
print '<tr class="oddeven nohover"><td class="">'.$countrynotdefined.'</td><td></td><td></td></tr>';
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven nohover"><td class="opacitymedium" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).'</td></tr>';
|
print '<tr class="oddeven nohover"><td class="" colspan="3">'.$langs->trans("NoLocalTaxXForThisCountry", $langs->transnoentitiesnoconv("Setup"), $langs->transnoentitiesnoconv("Dictionaries"), $langs->transnoentitiesnoconv("DictionaryRevenueStamp"), $langs->transnoentitiesnoconv("RevenueStamp")).'</td></tr>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -229,7 +229,11 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering model
|
// Show example of numbering model
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
}
|
||||||
|
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -410,7 +414,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -188,7 +188,7 @@ if ($action == 'update')
|
|||||||
if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE';
|
if (!empty($conf->global->MAIN_USE_METEO_WITH_PERCENTAGE)) $plus = '_PERCENTAGE';
|
||||||
// Update values
|
// Update values
|
||||||
for ($i = 0; $i < 4; $i++) {
|
for ($i = 0; $i < 4; $i++) {
|
||||||
if (isset($_POST['MAIN_METEO'.$plus.'_LEVEL'.$i])) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
|
if (GETPOSTISSET('MAIN_METEO'.$plus.'_LEVEL'.$i)) dolibarr_set_const($db, 'MAIN_METEO'.$plus.'_LEVEL'.$i, GETPOST('MAIN_METEO'.$plus.'_LEVEL'.$i, 'int'), 'chaine', 0, '', $conf->entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -229,7 +229,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
@ -397,7 +398,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'sending').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -682,7 +682,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
{
|
{
|
||||||
// Discard check of mandatory fields for country for some tables
|
// Discard check of mandatory fields for country for some tables
|
||||||
if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryVAT', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
if ($value == 'country_id' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryVAT', 'DictionaryRegion', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp', 'DictionaryAccountancysystem', 'DictionaryAccountancyCategory'))) continue; // For some pages, country is not mandatory
|
||||||
if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryCanton', 'DictionaryCompanyType', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
if ($value == 'country' && in_array($tablib[$id], array('DictionaryPublicHolidays', 'DictionaryCanton', 'DictionaryCompanyType', 'DictionaryHolidayTypes', 'DictionaryRevenueStamp'))) continue; // For some pages, country is not mandatory
|
||||||
// Discard check of mandatory fiedls for other fields
|
// Discard check of mandatory fiedls for other fields
|
||||||
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
if ($value == 'localtax1' && empty($_POST['localtax1_type'])) continue;
|
||||||
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
if ($value == 'localtax2' && empty($_POST['localtax2_type'])) continue;
|
||||||
@ -690,7 +690,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($value == 'formula' && empty($_POST['formula'])) continue;
|
if ($value == 'formula' && empty($_POST['formula'])) continue;
|
||||||
if ($value == 'dayrule' && empty($_POST['dayrule'])) continue;
|
if ($value == 'dayrule' && empty($_POST['dayrule'])) continue;
|
||||||
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
|
if ($value == 'sortorder') continue; // For a column name 'sortorder', we use the field name 'position'
|
||||||
if ((!isset($_POST[$value]) || $_POST[$value] == '')
|
if ((!GETPOSTISSET($value) || GETPOST($value) == '')
|
||||||
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto')) // Fields that are not mandatory
|
&& (!in_array($listfield[$f], array('decalage', 'module', 'accountancy_code', 'accountancy_code_sell', 'accountancy_code_buy', 'tracking', 'picto')) // Fields that are not mandatory
|
||||||
&& (!($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
|
&& (!($id == 10 && $listfield[$f] == 'code')) // Code is mandatory fir table 10
|
||||||
)
|
)
|
||||||
@ -719,7 +719,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Other checks
|
// Other checks
|
||||||
if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && isset($_POST["type"]) && in_array($_POST["type"], array('system', 'systemauto'))) {
|
if (GETPOST('actionadd') && $tabname[$id] == MAIN_DB_PREFIX."c_actioncomm" && GETPOSTISSET("type") && in_array(GETPOST("type"), array('system', 'systemauto'))) {
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
|
setEventMessages($langs->transnoentities('ErrorReservedTypeSystemSystemAuto'), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -757,7 +757,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
|
|||||||
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"] = ''; // If empty, we force to null
|
if ($_POST["accountancy_code"] <= 0) $_POST["accountancy_code"] = ''; // If empty, we force to null
|
||||||
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"] = ''; // If empty, we force to null
|
if ($_POST["accountancy_code_sell"] <= 0) $_POST["accountancy_code_sell"] = ''; // If empty, we force to null
|
||||||
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"] = ''; // If empty, we force to null
|
if ($_POST["accountancy_code_buy"] <= 0) $_POST["accountancy_code_buy"] = ''; // If empty, we force to null
|
||||||
if ($id == 10 && isset($_POST["code"])) // Spaces are not allowed into code
|
if ($id == 10 && GETPOSTISSET("code")) // Spaces are not allowed into code
|
||||||
{
|
{
|
||||||
$_POST["code"] = preg_replace('/\s/', '', $_POST["code"]);
|
$_POST["code"] = preg_replace('/\s/', '', $_POST["code"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -223,21 +223,6 @@ $help_url = "EN:Module_EMail_Collector|FR:Module_Collecteur_de_courrier_électro
|
|||||||
|
|
||||||
llxHeader('', 'EmailCollector', $help_url);
|
llxHeader('', 'EmailCollector', $help_url);
|
||||||
|
|
||||||
// Example : Adding jquery code
|
|
||||||
print '<script type="text/javascript" language="javascript">
|
|
||||||
jQuery(document).ready(function() {
|
|
||||||
function init_myfunc()
|
|
||||||
{
|
|
||||||
jQuery("#myid").removeAttr(\'disabled\');
|
|
||||||
jQuery("#myid").attr(\'disabled\',\'disabled\');
|
|
||||||
}
|
|
||||||
init_myfunc();
|
|
||||||
jQuery("#mybutton").click(function() {
|
|
||||||
init_myfunc();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>';
|
|
||||||
|
|
||||||
// Part to create
|
// Part to create
|
||||||
if ($action == 'create') {
|
if ($action == 'create') {
|
||||||
print load_fiche_titre($langs->trans("NewEmailCollector", $langs->transnoentitiesnoconv("EmailCollector")));
|
print load_fiche_titre($langs->trans("NewEmailCollector", $langs->transnoentitiesnoconv("EmailCollector")));
|
||||||
@ -433,6 +418,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
if (!$connection)
|
if (!$connection)
|
||||||
{
|
{
|
||||||
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
|
$morehtml .= 'Failed to open IMAP connection '.$connectstringsource;
|
||||||
|
$morehtml .= '<br>'.imap_last_error();
|
||||||
|
//var_dump(imap_errors())
|
||||||
} else {
|
} else {
|
||||||
$morehtml .= imap_num_msg($connection);
|
$morehtml .= imap_num_msg($connection);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -234,7 +234,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
@ -414,7 +415,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'sending').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -238,8 +238,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering model
|
// Show example of numbering model
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -409,7 +411,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -313,8 +313,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -547,7 +549,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -291,8 +291,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering model
|
// Show example of numbering model
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -465,7 +467,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'intervention').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,7 +229,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering model
|
// Show example of numbering model
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -423,7 +426,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,8 +241,8 @@ print '<input type="hidden" name="action" value="update">';
|
|||||||
clearstatcache();
|
clearstatcache();
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<table summary="edit" class="noborder centpercent editmode">';
|
print '<table summary="edit" class="noborder centpercent editmode tableforfield">';
|
||||||
print '<tr class="liste_titre"><th>'.$langs->trans("Language").'</th><th></th>';
|
print '<tr class="liste_titre"><th>'.img_picto('', 'language').' '.$langs->trans("Language").'</th><th></th>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Default language
|
// Default language
|
||||||
|
|||||||
@ -100,9 +100,12 @@ if ($action == 'update')
|
|||||||
|
|
||||||
$form = new Form($db);
|
$form = new Form($db);
|
||||||
|
|
||||||
llxHeader();
|
$title = $langs->trans("LimitsSetup");
|
||||||
|
$help_url = '';
|
||||||
|
|
||||||
print load_fiche_titre($langs->trans("LimitsSetup"), '', 'title_setup');
|
llxHeader('', $title, $help_url);
|
||||||
|
|
||||||
|
print load_fiche_titre($title, '', 'title_setup');
|
||||||
|
|
||||||
$aCurrencies = array($conf->currency); // Default currency always first position
|
$aCurrencies = array($conf->currency); // Default currency always first position
|
||||||
|
|
||||||
@ -125,7 +128,8 @@ if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY
|
|||||||
if (!empty($aCurrencies) && count($aCurrencies) > 1)
|
if (!empty($aCurrencies) && count($aCurrencies) > 1)
|
||||||
{
|
{
|
||||||
$head = multicurrencyLimitPrepareHead($aCurrencies);
|
$head = multicurrencyLimitPrepareHead($aCurrencies);
|
||||||
print dol_get_fiche_head($head, $currencycode, '', -1, "multicurrency");
|
|
||||||
|
print dol_get_fiche_head($head, $currencycode, '', -1, '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,6 +176,7 @@ if ($action == 'edit')
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} else {
|
} else {
|
||||||
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
@ -191,6 +196,7 @@ if ($action == 'edit')
|
|||||||
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : $conf->global->MAIN_ROUNDING_RULE_TOT).'</td></tr>';
|
print '</td><td align="right">'.(isset($conf->global->$mainroundingruletot) ? $conf->global->$mainroundingruletot : $conf->global->MAIN_ROUNDING_RULE_TOT).'</td></tr>';
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit'.(!empty($currencycode) ? '¤cycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit'.(!empty($currencycode) ? '¤cycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
|
||||||
|
|||||||
@ -178,6 +178,7 @@ if ($action == 'edit')
|
|||||||
jQuery("#MAIN_MAIL_EMAIL_DKIM_DOMAIN").prop("disabled", true);
|
jQuery("#MAIN_MAIL_EMAIL_DKIM_DOMAIN").prop("disabled", true);
|
||||||
jQuery("#MAIN_MAIL_EMAIL_DKIM_SELECTOR").prop("disabled", true);
|
jQuery("#MAIN_MAIL_EMAIL_DKIM_SELECTOR").prop("disabled", true);
|
||||||
jQuery("#MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").prop("disabled", true);
|
jQuery("#MAIN_MAIL_EMAIL_DKIM_PRIVATE_KEY").prop("disabled", true);
|
||||||
|
jQuery(".smtp_method").hide();
|
||||||
jQuery(".dkim").hide();
|
jQuery(".dkim").hide();
|
||||||
';
|
';
|
||||||
if ($linuxlike)
|
if ($linuxlike)
|
||||||
@ -220,6 +221,7 @@ if ($action == 'edit')
|
|||||||
jQuery("#MAIN_MAIL_SMTP_PORT").show();
|
jQuery("#MAIN_MAIL_SMTP_PORT").show();
|
||||||
jQuery("#smtp_server_mess").hide();
|
jQuery("#smtp_server_mess").hide();
|
||||||
jQuery("#smtp_port_mess").hide();
|
jQuery("#smtp_port_mess").hide();
|
||||||
|
jQuery(".smtp_method").show();
|
||||||
jQuery(".dkim").hide();
|
jQuery(".dkim").hide();
|
||||||
}
|
}
|
||||||
if (jQuery("#MAIN_MAIL_SENDMODE").val()==\'swiftmailer\')
|
if (jQuery("#MAIN_MAIL_SENDMODE").val()==\'swiftmailer\')
|
||||||
@ -246,6 +248,7 @@ if ($action == 'edit')
|
|||||||
jQuery("#MAIN_MAIL_SMTP_PORT").show();
|
jQuery("#MAIN_MAIL_SMTP_PORT").show();
|
||||||
jQuery("#smtp_server_mess").hide();
|
jQuery("#smtp_server_mess").hide();
|
||||||
jQuery("#smtp_port_mess").hide();
|
jQuery("#smtp_port_mess").hide();
|
||||||
|
jQuery(".smtp_method").show();
|
||||||
jQuery(".dkim").show();
|
jQuery(".dkim").show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -318,13 +321,15 @@ if ($action == 'edit')
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Host server
|
// Host server
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven">';
|
||||||
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail')
|
if (!$conf->use_javascript_ajax && $linuxlike && $conf->global->MAIN_MAIL_SENDMODE == 'mail') {
|
||||||
{
|
print '<td>';
|
||||||
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
||||||
print '</td><td>';
|
print '</td><td>';
|
||||||
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
print '<span class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
|
print '<td>';
|
||||||
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '');
|
$mainserver = (!empty($conf->global->MAIN_MAIL_SMTP_SERVER) ? $conf->global->MAIN_MAIL_SMTP_SERVER : '');
|
||||||
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
|
$smtpserver = ini_get('SMTP') ?ini_get('SMTP') : $langs->transnoentities("Undefined");
|
||||||
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
if ($linuxlike) print $langs->trans("MAIN_MAIL_SMTP_SERVER_NotAvailableOnLinuxLike");
|
||||||
@ -333,17 +338,19 @@ if ($action == 'edit')
|
|||||||
// SuperAdministrator access only
|
// SuperAdministrator access only
|
||||||
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity))
|
if (empty($conf->multicompany->enabled) || ($user->admin && !$user->entity))
|
||||||
{
|
{
|
||||||
print '<input class="flat" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" size="18" value="'.$mainserver.'" autocomplete="off">';
|
print '<input class="flat minwidth300" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" value="'.$mainserver.'" autocomplete="off">';
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="'.$mainserver.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER_sav" name="MAIN_MAIL_SMTP_SERVER_sav" value="'.$mainserver.'">';
|
||||||
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
print '<span id="smtp_server_mess" class="opacitymedium">'.$langs->trans("SeeLocalSendMailSetup").'</span>';
|
||||||
|
print ' <span class="opacitymedium smtp_method">'.$langs->trans("SeeLinkToOnlineDocumentation").'</span>';
|
||||||
} else {
|
} else {
|
||||||
$text = !empty($mainserver) ? $mainserver : $smtpserver;
|
$text = !empty($mainserver) ? $mainserver : $smtpserver;
|
||||||
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
$htmltext = $langs->trans("ContactSuperAdminForChange");
|
||||||
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
print $form->textwithpicto($text, $htmltext, 1, 'superadmin');
|
||||||
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" value="'.$mainserver.'">';
|
print '<input type="hidden" id="MAIN_MAIL_SMTP_SERVER" name="MAIN_MAIL_SMTP_SERVER" value="'.$mainserver.'">';
|
||||||
}
|
}
|
||||||
|
print '</td>';
|
||||||
}
|
}
|
||||||
print '</td></tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Port
|
// Port
|
||||||
print '<tr class="oddeven"><td>';
|
print '<tr class="oddeven"><td>';
|
||||||
@ -856,8 +863,8 @@ if ($action == 'edit')
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
||||||
$formmail->fromname = (isset($_POST['fromname']) ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->fromname = (GETPOSTISSET('fromname') ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->frommail = (isset($_POST['frommail']) ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->frommail = (GETPOSTISSET('frommail') ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->fromid = $user->id;
|
$formmail->fromid = $user->id;
|
||||||
$formmail->fromalsorobot = 1;
|
$formmail->fromalsorobot = 1;
|
||||||
$formmail->fromtype = (GETPOSTISSET('fromtype') ?GETPOST('fromtype', 'aZ09') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
|
$formmail->fromtype = (GETPOSTISSET('fromtype') ?GETPOST('fromtype', 'aZ09') : (!empty($conf->global->MAIN_MAIL_DEFAULT_FROMTYPE) ? $conf->global->MAIN_MAIL_DEFAULT_FROMTYPE : 'user'));
|
||||||
@ -865,13 +872,13 @@ if ($action == 'edit')
|
|||||||
$formmail->withsubstit = 1;
|
$formmail->withsubstit = 1;
|
||||||
$formmail->withfrom = 1;
|
$formmail->withfrom = 1;
|
||||||
$formmail->witherrorsto = 1;
|
$formmail->witherrorsto = 1;
|
||||||
$formmail->withto = (!empty($_POST['sendto']) ? $_POST['sendto'] : ($user->email ? $user->email : 1));
|
$formmail->withto = (!empty($_POST['sendto']) ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
|
||||||
$formmail->withtocc = (!empty($_POST['sendtocc']) ? $_POST['sendtocc'] : 1); // ! empty to keep field if empty
|
$formmail->withtocc = (!empty($_POST['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? $_POST['sendtoccc'] : 1); // ! empty to keep field if empty
|
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtopic = (isset($_POST['subject']) ? $_POST['subject'] : $langs->trans("Test"));
|
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly = 0;
|
$formmail->withtopicreadonly = 0;
|
||||||
$formmail->withfile = 2;
|
$formmail->withfile = 2;
|
||||||
$formmail->withbody = (isset($_POST['message']) ? $_POST['message'] : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
|
$formmail->withbody = (GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
|
||||||
$formmail->withbodyreadonly = 0;
|
$formmail->withbodyreadonly = 0;
|
||||||
$formmail->withcancel = 1;
|
$formmail->withcancel = 1;
|
||||||
$formmail->withdeliveryreceipt = 1;
|
$formmail->withdeliveryreceipt = 1;
|
||||||
|
|||||||
@ -564,20 +564,20 @@ if ($action == 'edit')
|
|||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
$formmail->fromname = (isset($_POST['fromname']) ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->fromname = (GETPOSTISSET('fromname') ? GETPOST('fromname', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->frommail = (isset($_POST['frommail']) ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->frommail = (GETPOSTISSET('frommail') ? GETPOST('frommail', 'restricthtml') : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
||||||
$formmail->withfromreadonly = 0;
|
$formmail->withfromreadonly = 0;
|
||||||
$formmail->withsubstit = 0;
|
$formmail->withsubstit = 0;
|
||||||
$formmail->withfrom = 1;
|
$formmail->withfrom = 1;
|
||||||
$formmail->witherrorsto = 1;
|
$formmail->witherrorsto = 1;
|
||||||
$formmail->withto = (!empty($_POST['sendto']) ? $_POST['sendto'] : ($user->email ? $user->email : 1));
|
$formmail->withto = (!GETPOST('sendto') ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
|
||||||
$formmail->withtocc = (!empty($_POST['sendtocc']) ? $_POST['sendtocc'] : 1); // ! empty to keep field if empty
|
$formmail->withtocc = (!GETPOST(['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? $_POST['sendtoccc'] : 1); // ! empty to keep field if empty
|
$formmail->withtoccc = (!GETPOST(['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtopic = (isset($_POST['subject']) ? $_POST['subject'] : $langs->trans("Test"));
|
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly = 0;
|
$formmail->withtopicreadonly = 0;
|
||||||
$formmail->withfile = 2;
|
$formmail->withfile = 2;
|
||||||
$formmail->withbody = (isset($_POST['message']) ? $_POST['message'] : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
|
$formmail->withbody = (GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
|
||||||
$formmail->withbodyreadonly = 0;
|
$formmail->withbodyreadonly = 0;
|
||||||
$formmail->withcancel = 1;
|
$formmail->withcancel = 1;
|
||||||
$formmail->withdeliveryreceipt = 1;
|
$formmail->withdeliveryreceipt = 1;
|
||||||
|
|||||||
@ -271,7 +271,7 @@ if (empty($reshook)) {
|
|||||||
// Rename some POST variables into a generic name
|
// Rename some POST variables into a generic name
|
||||||
if (GETPOST('actionmodify', 'alpha') && $value == 'topic') $_POST['topic'] = $_POST['topic-'.$rowid];
|
if (GETPOST('actionmodify', 'alpha') && $value == 'topic') $_POST['topic'] = $_POST['topic-'.$rowid];
|
||||||
|
|
||||||
if ((!isset($_POST[$value]) || $_POST[$value] == '' || $_POST[$value] == '-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position')
|
if ((!GETPOSTISSET($value) || GETPOST($value) == '' || GETPOST($value) == '-1') && $value != 'lang' && $value != 'fk_user' && $value != 'position')
|
||||||
{
|
{
|
||||||
$ok = 0;
|
$ok = 0;
|
||||||
$fieldnamekey = $listfield[$f];
|
$fieldnamekey = $listfield[$f];
|
||||||
@ -1074,7 +1074,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($context == 'edit' && !empty($obj->{$fieldlist[$field]}) && !in_array($obj->{$fieldlist[$field]}, array_keys($elementList)))
|
if ($context == 'edit' && !empty($obj->{$fieldlist[$field]}) && !in_array($obj->{$fieldlist[$field]}, array_keys($elementList)))
|
||||||
{
|
{
|
||||||
// Current tempalte type is an unknown type, so we must keep it as it is.
|
// Current template type is an unknown type, so we must keep it as it is.
|
||||||
print '<input type="hidden" name="type_template" value="'.$obj->{$fieldlist[$field]}.'">';
|
print '<input type="hidden" name="type_template" value="'.$obj->{$fieldlist[$field]}.'">';
|
||||||
print $obj->{$fieldlist[$field]};
|
print $obj->{$fieldlist[$field]};
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -530,20 +530,20 @@ if ($action == 'edit')
|
|||||||
// Cree l'objet formulaire mail
|
// Cree l'objet formulaire mail
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
|
||||||
$formmail = new FormMail($db);
|
$formmail = new FormMail($db);
|
||||||
$formmail->fromname = (isset($_POST['fromname']) ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->fromname = (GETPOSTISSET('fromname') ? $_POST['fromname'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->frommail = (isset($_POST['frommail']) ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
$formmail->frommail = (GETPOSTISSET('frommail') ? $_POST['frommail'] : $conf->global->MAIN_MAIL_EMAIL_FROM);
|
||||||
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
$formmail->trackid = (($action == 'testhtml') ? "testhtml" : "test");
|
||||||
$formmail->withfromreadonly = 0;
|
$formmail->withfromreadonly = 0;
|
||||||
$formmail->withsubstit = 0;
|
$formmail->withsubstit = 0;
|
||||||
$formmail->withfrom = 1;
|
$formmail->withfrom = 1;
|
||||||
$formmail->witherrorsto = 1;
|
$formmail->witherrorsto = 1;
|
||||||
$formmail->withto = (!empty($_POST['sendto']) ? $_POST['sendto'] : ($user->email ? $user->email : 1));
|
$formmail->withto = (!empty($_POST['sendto']) ? GETPOST('sendto', 'restricthtml') : ($user->email ? $user->email : 1));
|
||||||
$formmail->withtocc = (!empty($_POST['sendtocc']) ? $_POST['sendtocc'] : 1); // ! empty to keep field if empty
|
$formmail->withtocc = (!empty($_POST['sendtocc']) ? GETPOST('sendtocc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? $_POST['sendtoccc'] : 1); // ! empty to keep field if empty
|
$formmail->withtoccc = (!empty($_POST['sendtoccc']) ? GETPOST('sendtoccc', 'restricthtml') : 1); // ! empty to keep field if empty
|
||||||
$formmail->withtopic = (isset($_POST['subject']) ? $_POST['subject'] : $langs->trans("Test"));
|
$formmail->withtopic = (GETPOSTISSET('subject') ? GETPOST('subject') : $langs->trans("Test"));
|
||||||
$formmail->withtopicreadonly = 0;
|
$formmail->withtopicreadonly = 0;
|
||||||
$formmail->withfile = 2;
|
$formmail->withfile = 2;
|
||||||
$formmail->withbody = (isset($_POST['message']) ? $_POST['message'] : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
|
$formmail->withbody = (GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : ($action == 'testhtml' ? $langs->transnoentities("PredefinedMailTestHtml") : $langs->transnoentities("PredefinedMailTest")));
|
||||||
$formmail->withbodyreadonly = 0;
|
$formmail->withbodyreadonly = 0;
|
||||||
$formmail->withcancel = 1;
|
$formmail->withcancel = 1;
|
||||||
$formmail->withdeliveryreceipt = 1;
|
$formmail->withdeliveryreceipt = 1;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -233,8 +233,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering model
|
// Show example of numbering model
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -413,7 +415,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -171,8 +171,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -340,7 +340,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -347,7 +347,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -256,8 +256,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -442,7 +444,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -135,7 +135,7 @@ print '<tr class="oddeven">';
|
|||||||
print '<td>'.$langs->trans("ConnectionTimeout").'</td><td class="right">';
|
print '<td>'.$langs->trans("ConnectionTimeout").'</td><td class="right">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.(isset($_POST["MAIN_USE_CONNECT_TIMEOUT"]) ?GETPOST("MAIN_USE_CONNECT_TIMEOUT") : $conf->global->MAIN_USE_CONNECT_TIMEOUT).'">';
|
print '<input class="flat" name="MAIN_USE_CONNECT_TIMEOUT" type="text" size="4" value="'.(GETPOSTISSET("MAIN_USE_CONNECT_TIMEOUT") ? GETPOST("MAIN_USE_CONNECT_TIMEOUT") : $conf->global->MAIN_USE_CONNECT_TIMEOUT).'">';
|
||||||
print ' '.strtolower($langs->trans("Seconds"));
|
print ' '.strtolower($langs->trans("Seconds"));
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|||||||
@ -420,7 +420,7 @@ if ($mode == 'template' && $user->admin) {
|
|||||||
print '<td></td>';
|
print '<td></td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
|
print '<td>'.$printer->listprinterstemplates[$line]['name'].'</td>';
|
||||||
print '<td>'.nl2br(htmlentities($printer->listprinterstemplates[$line]['template'])).'</td>';
|
print '<td>'.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template']).'</td>';
|
||||||
// edit icon
|
// edit icon
|
||||||
print '<td><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
|
print '<td><a class="editfielda paddingleftonly marginrightonly" href="'.$_SERVER['PHP_SELF'].'?mode=template&action=edittemplate&templateid='.$printer->listprinterstemplates[$line]['rowid'].'">';
|
||||||
print img_picto($langs->trans("Edit"), 'edit');
|
print img_picto($langs->trans("Edit"), 'edit');
|
||||||
|
|||||||
@ -240,7 +240,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
@ -423,7 +424,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'reception').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -256,7 +256,10 @@ foreach ($arrayhandler as $key => $module)
|
|||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>'; } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
|
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -30,8 +31,9 @@ $langs->loadLangs(array("companies", "admin", "products", "sms", "other", "error
|
|||||||
|
|
||||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin) {
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
}
|
||||||
|
|
||||||
$substitutionarrayfortest = array(
|
$substitutionarrayfortest = array(
|
||||||
'__ID__' => 'TESTIdRecord',
|
'__ID__' => 'TESTIdRecord',
|
||||||
@ -48,8 +50,7 @@ $action = GETPOST('action', 'aZ09');
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($action == 'update' && !$cancel)
|
if ($action == 'update' && !$cancel) {
|
||||||
{
|
|
||||||
dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", GETPOST("MAIN_DISABLE_ALL_SMS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_DISABLE_ALL_SMS", GETPOST("MAIN_DISABLE_ALL_SMS", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||||
|
|
||||||
dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
dolibarr_set_const($db, "MAIN_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||||
@ -64,13 +65,16 @@ if ($action == 'update' && !$cancel)
|
|||||||
/*
|
/*
|
||||||
* Send sms
|
* Send sms
|
||||||
*/
|
*/
|
||||||
if ($action == 'send' && !$_POST['cancel'])
|
if ($action == 'send' && !$_POST['cancel']) {
|
||||||
{
|
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
$smsfrom = '';
|
$smsfrom = '';
|
||||||
if (!empty($_POST["fromsms"])) $smsfrom = GETPOST("fromsms", 'alphanohtml');
|
if (!empty($_POST["fromsms"])) {
|
||||||
if (empty($smsfrom)) $smsfrom = GETPOST("fromname", 'alphanohtml');
|
$smsfrom = GETPOST("fromsms", 'alphanohtml');
|
||||||
|
}
|
||||||
|
if (empty($smsfrom)) {
|
||||||
|
$smsfrom = GETPOST("fromname", 'alphanohtml');
|
||||||
|
}
|
||||||
$sendto = GETPOST("sendto", 'alphanohtml');
|
$sendto = GETPOST("sendto", 'alphanohtml');
|
||||||
$body = GETPOST('message', 'alphanohtml');
|
$body = GETPOST('message', 'alphanohtml');
|
||||||
$deliveryreceipt = GETPOST("deliveryreceipt", 'alphanohtml');
|
$deliveryreceipt = GETPOST("deliveryreceipt", 'alphanohtml');
|
||||||
@ -83,32 +87,27 @@ if ($action == 'send' && !$_POST['cancel'])
|
|||||||
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formsms.class.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formsms.class.php';
|
||||||
$formsms = new FormSms($db);
|
$formsms = new FormSms($db);
|
||||||
|
|
||||||
if (!empty($formsms->error))
|
if (!empty($formsms->error)) {
|
||||||
{
|
|
||||||
setEventMessages($formsms->error, $formsms->errors, 'errors');
|
setEventMessages($formsms->error, $formsms->errors, 'errors');
|
||||||
$action = 'test';
|
$action = 'test';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($body))
|
if (empty($body)) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors');
|
||||||
$action = 'test';
|
$action = 'test';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($smsfrom) || !str_replace('+', '', $smsfrom))
|
if (empty($smsfrom) || !str_replace('+', '', $smsfrom)) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsFrom")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsFrom")), null, 'errors');
|
||||||
$action = 'test';
|
$action = 'test';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (empty($sendto) || !str_replace('+', '', $sendto))
|
if (empty($sendto) || !str_replace('+', '', $sendto)) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsTo")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsTo")), null, 'errors');
|
||||||
$action = 'test';
|
$action = 'test';
|
||||||
$error++;
|
$error++;
|
||||||
}
|
}
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
|
||||||
// Make substitutions into message
|
// Make substitutions into message
|
||||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||||
$body = make_substitutions($body, $substitutionarrayfortest);
|
$body = make_substitutions($body, $substitutionarrayfortest);
|
||||||
@ -118,8 +117,7 @@ if ($action == 'send' && !$_POST['cancel'])
|
|||||||
$smsfile = new CSMSFile($sendto, $smsfrom, $body, $deliveryreceipt, $deferred, $priority, $class); // This define OvhSms->login, pass, session and account
|
$smsfile = new CSMSFile($sendto, $smsfrom, $body, $deliveryreceipt, $deferred, $priority, $class); // This define OvhSms->login, pass, session and account
|
||||||
$result = $smsfile->sendfile(); // This send SMS
|
$result = $smsfile->sendfile(); // This send SMS
|
||||||
|
|
||||||
if ($result)
|
if ($result) {
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs');
|
setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs');
|
||||||
setEventMessages($smsfile->error, $smsfile->errors, 'mesgs');
|
setEventMessages($smsfile->error, $smsfile->errors, 'mesgs');
|
||||||
} else {
|
} else {
|
||||||
@ -138,8 +136,12 @@ if ($action == 'send' && !$_POST['cancel'])
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$linuxlike = 1;
|
$linuxlike = 1;
|
||||||
if (preg_match('/^win/i', PHP_OS)) $linuxlike = 0;
|
if (preg_match('/^win/i', PHP_OS)) {
|
||||||
if (preg_match('/^mac/i', PHP_OS)) $linuxlike = 0;
|
$linuxlike = 0;
|
||||||
|
}
|
||||||
|
if (preg_match('/^mac/i', PHP_OS)) {
|
||||||
|
$linuxlike = 0;
|
||||||
|
}
|
||||||
|
|
||||||
$wikihelp = 'EN:Setup Sms|FR:Paramétrage Sms|ES:Configuración Sms';
|
$wikihelp = 'EN:Setup Sms|FR:Paramétrage Sms|ES:Configuración Sms';
|
||||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||||
@ -153,11 +155,14 @@ print "<br>\n";
|
|||||||
$listofmethods = (is_array($conf->modules_parts['sms']) ? $conf->modules_parts['sms'] : array());
|
$listofmethods = (is_array($conf->modules_parts['sms']) ? $conf->modules_parts['sms'] : array());
|
||||||
asort($listofmethods);
|
asort($listofmethods);
|
||||||
|
|
||||||
if ($action == 'edit')
|
if (!count($listofmethods)) {
|
||||||
{
|
$descnosms = $langs->trans("NoSmsEngine", '{Dolistore}');
|
||||||
$form = new Form($db);
|
$descnosms = str_replace('{Dolistore}', '<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>', $descnosms);
|
||||||
|
print '<div class="warning">'.$descnosms.'</div>';
|
||||||
|
}
|
||||||
|
|
||||||
if (!count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine", '<a href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
|
if ($action == 'edit') {
|
||||||
|
$form = new Form($db);
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
@ -178,8 +183,11 @@ if ($action == 'edit')
|
|||||||
|
|
||||||
// Method
|
// Method
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
||||||
if (count($listofmethods)) print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
|
if (count($listofmethods)) {
|
||||||
else print '<font class="error">'.$langs->trans("None").'</font>';
|
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
|
||||||
|
} else {
|
||||||
|
print '<font class="error">'.$langs->trans("None").'</font>';
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// From
|
// From
|
||||||
@ -204,8 +212,6 @@ if ($action == 'edit')
|
|||||||
print '</form>';
|
print '</form>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
} else {
|
} else {
|
||||||
if (!count($listofmethods)) print '<div class="warning">'.$langs->trans("NoSmsEngine", '<a target="_blank" href="http://www.dolistore.com/search.php?orderby=position&orderway=desc&search_query=smsmanager">DoliStore</a>').'</div>';
|
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
print '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||||
|
|
||||||
@ -218,14 +224,18 @@ if ($action == 'edit')
|
|||||||
// Method
|
// Method
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
||||||
$text = $listofmethods[$conf->global->MAIN_SMS_SENDMODE];
|
$text = $listofmethods[$conf->global->MAIN_SMS_SENDMODE];
|
||||||
if (empty($text)) $text = $langs->trans("Undefined").' '.img_warning();
|
if (empty($text)) {
|
||||||
|
$text = $langs->trans("Undefined").' '.img_warning();
|
||||||
|
}
|
||||||
print $text;
|
print $text;
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// From
|
// From
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).'</td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).'</td>';
|
||||||
print '<td>'.$conf->global->MAIN_MAIL_SMS_FROM;
|
print '<td>'.$conf->global->MAIN_MAIL_SMS_FROM;
|
||||||
if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && !isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) print ' '.img_warning($langs->trans("ErrorBadPhone"));
|
if (!empty($conf->global->MAIN_MAIL_SMS_FROM) && !isValidPhone($conf->global->MAIN_MAIL_SMS_FROM)) {
|
||||||
|
print ' '.img_warning($langs->trans("ErrorBadPhone"));
|
||||||
|
}
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Autocopy to
|
// Autocopy to
|
||||||
@ -257,8 +267,7 @@ if ($action == 'edit')
|
|||||||
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
|
print '<a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("FeatureNotAvailableOnLinux").'">'.$langs->trans("DoTestServerAvailability").'</a>';
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if (count($listofmethods) && !empty($conf->global->MAIN_SMS_SENDMODE))
|
if (count($listofmethods) && !empty($conf->global->MAIN_SMS_SENDMODE)) {
|
||||||
{
|
|
||||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>';
|
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=test&mode=init">'.$langs->trans("DoTestSend").'</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>';
|
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>';
|
||||||
@ -290,8 +299,7 @@ if ($action == 'edit')
|
|||||||
}*/
|
}*/
|
||||||
|
|
||||||
// Affichage formulaire de TEST simple
|
// Affichage formulaire de TEST simple
|
||||||
if ($action == 'test')
|
if ($action == 'test') {
|
||||||
{
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print load_fiche_titre($langs->trans("DoTestSend"));
|
print load_fiche_titre($langs->trans("DoTestSend"));
|
||||||
|
|
||||||
|
|||||||
@ -638,7 +638,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -251,7 +251,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
@ -425,7 +426,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -274,7 +274,8 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
$langs->load("errors"); print '<div class="error">'.$langs->trans($tmp).'</div>';
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
@ -438,7 +439,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -256,8 +256,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -410,7 +412,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
print $form->textwithpicto('', $htmltooltip, 1, 0);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'order').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|||||||
@ -251,8 +251,10 @@ foreach ($dirmodels as $reldir)
|
|||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
$langs->load("errors");
|
||||||
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
|
} elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
|
||||||
else print $tmp;
|
else print $tmp;
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
@ -435,7 +437,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'bill').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,7 +85,7 @@ if ($action == 'set')
|
|||||||
$db->begin();
|
$db->begin();
|
||||||
|
|
||||||
$newActiveModules = array();
|
$newActiveModules = array();
|
||||||
$selectedModules = (isset($_POST['SYSLOG_HANDLERS']) ? $_POST['SYSLOG_HANDLERS'] : array());
|
$selectedModules = (GETPOSTISSET('SYSLOG_HANDLERS') ? GETPOST('SYSLOG_HANDLERS') : array());
|
||||||
|
|
||||||
// Save options of handler
|
// Save options of handler
|
||||||
foreach ($syslogModules as $syslogHandler)
|
foreach ($syslogModules as $syslogHandler)
|
||||||
@ -97,11 +97,10 @@ if ($action == 'set')
|
|||||||
if (in_array($syslogHandler, $selectedModules)) $newActiveModules[] = $syslogHandler;
|
if (in_array($syslogHandler, $selectedModules)) $newActiveModules[] = $syslogHandler;
|
||||||
foreach ($module->configure() as $option)
|
foreach ($module->configure() as $option)
|
||||||
{
|
{
|
||||||
if (isset($_POST[$option['constant']]))
|
if (GETPOSTISSET($option['constant']))
|
||||||
{
|
{
|
||||||
$_POST[$option['constant']] = trim($_POST[$option['constant']]);
|
|
||||||
dolibarr_del_const($db, $option['constant'], -1);
|
dolibarr_del_const($db, $option['constant'], -1);
|
||||||
dolibarr_set_const($db, $option['constant'], $_POST[$option['constant']], 'chaine', 0, '', 0);
|
dolibarr_set_const($db, $option['constant'], trim(GETPOST($option['constant'])), 'chaine', 0, '', 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -229,7 +228,7 @@ foreach ($syslogModules as $moduleName)
|
|||||||
$tmpoption = $option['constant'];
|
$tmpoption = $option['constant'];
|
||||||
if (!empty($tmpoption))
|
if (!empty($tmpoption))
|
||||||
{
|
{
|
||||||
if (isset($_POST[$tmpoption])) $value = $_POST[$tmpoption];
|
if (GETPOSTISSET($tmpoption)) $value = GETPOST($tmpoption);
|
||||||
elseif (!empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
|
elseif (!empty($conf->global->$tmpoption)) $value = $conf->global->$tmpoption;
|
||||||
} else $value = (isset($option['default']) ? $option['default'] : '');
|
} else $value = (isset($option['default']) ? $option['default'] : '');
|
||||||
|
|
||||||
@ -240,7 +239,7 @@ foreach ($syslogModules as $moduleName)
|
|||||||
{
|
{
|
||||||
$filelogparam = ' (<a href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file='.basename($value).'">';
|
$filelogparam = ' (<a href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file='.basename($value).'">';
|
||||||
$filelogparam .= $langs->trans('Download');
|
$filelogparam .= $langs->trans('Download');
|
||||||
$filelogparam .= $filelog.'</a>)';
|
$filelogparam .= ' '.basename($value).'</a>)';
|
||||||
print $filelogparam;
|
print $filelogparam;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,19 +85,22 @@ if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
|
|||||||
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
|
if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$version = DOL_VERSION;
|
||||||
|
if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
|
||||||
|
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||||
|
|
||||||
|
$newversion = '';
|
||||||
if (function_exists('curl_init'))
|
if (function_exists('curl_init'))
|
||||||
{
|
{
|
||||||
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
$conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
|
||||||
print ' - ';
|
print ' - ';
|
||||||
if ($action == 'getlastversion')
|
if ($action == 'getlastversion') {
|
||||||
{
|
if ($sfurl) {
|
||||||
if ($sfurl)
|
$i = 0;
|
||||||
{
|
while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) {
|
||||||
while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000)
|
|
||||||
{
|
|
||||||
$title = $sfurl->channel[0]->item[$i]->title;
|
$title = $sfurl->channel[0]->item[$i]->title;
|
||||||
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg))
|
$reg = array();
|
||||||
{
|
if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) {
|
||||||
$newversion = $reg[1];
|
$newversion = $reg[1];
|
||||||
$newversionarray = explode('.', $newversion);
|
$newversionarray = explode('.', $newversion);
|
||||||
$versionarray = explode('.', $version);
|
$versionarray = explode('.', $version);
|
||||||
@ -109,6 +112,9 @@ if (function_exists('curl_init'))
|
|||||||
|
|
||||||
// Show version
|
// Show version
|
||||||
print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
|
print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
|
||||||
|
if ($version != '0.0') {
|
||||||
|
print ' <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
|
print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
|
||||||
}
|
}
|
||||||
@ -118,12 +124,11 @@ if (function_exists('curl_init'))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Now show link to the changelog
|
// Now show link to the changelog
|
||||||
print ' - ';
|
//print ' - ';
|
||||||
|
|
||||||
$version = DOL_VERSION;
|
$version = DOL_VERSION;
|
||||||
if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
|
if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
|
||||||
|
|
||||||
print '<a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
|
|
||||||
print '</td></tr>'."\n";
|
print '</td></tr>'."\n";
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
|
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
|
||||||
|
|||||||
@ -28,9 +28,7 @@ require '../../main.inc.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
|
||||||
|
|
||||||
$langs->load("admin");
|
$langs->loadLangs(array("admin", "install", "errors"));
|
||||||
$langs->load("install");
|
|
||||||
$langs->load("errors");
|
|
||||||
|
|
||||||
if (!$user->admin)
|
if (!$user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
@ -95,7 +93,7 @@ if (versioncompare(versionphparray(), $arrayphpminversionerror) < 0)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '<tr><td>GET and POST support</td><td>';
|
print '<tr><td>GET and POST support</td><td>';
|
||||||
|
|
||||||
if (!isset($_GET["testget"]) && !isset($_POST["testpost"]) && !isset($_GET["mainmenu"]))
|
if (!isset($_GET["testget"]) && !isset($_POST["testpost"]) && !isset($_GET["mainmenu"])) // We must keep $_GET and $_POST here
|
||||||
{
|
{
|
||||||
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
|
print '<img src="'.$WarningPicturePath.'" alt="Warning"> '.$langs->trans("PHPSupportPOSTGETKo");
|
||||||
print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';
|
print ' (<a href="'.$_SERVER["PHP_SELF"].'?testget=ok">'.$langs->trans("Recheck").'</a>)';
|
||||||
@ -126,7 +124,7 @@ print '</table>';
|
|||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
$activatedExtensions = array_map('strtolower', getActivatedExtensions());
|
$activatedExtensions = array();
|
||||||
$loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
|
$loadedExtensions = array_map('strtolower', get_loaded_extensions(false));
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
@ -165,7 +163,6 @@ $name = "GD";
|
|||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<td>".$name."</td>";
|
print "<td>".$name."</td>";
|
||||||
//print getTableColumn($name, $activatedExtensions);
|
|
||||||
print getTableColumn($name, $loadedExtensions);
|
print getTableColumn($name, $loadedExtensions);
|
||||||
print getTableColumnFunction($functions);
|
print getTableColumnFunction($functions);
|
||||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||||
@ -176,7 +173,6 @@ $name = "Curl";
|
|||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<td>".$name."</td>";
|
print "<td>".$name."</td>";
|
||||||
//print getTableColumn($name, $activatedExtensions);
|
|
||||||
print getTableColumn($name, $loadedExtensions);
|
print getTableColumn($name, $loadedExtensions);
|
||||||
print getTableColumnFunction($functions);
|
print getTableColumnFunction($functions);
|
||||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||||
@ -189,7 +185,6 @@ if (empty($_SERVER["SERVER_ADMIN"]) || $_SERVER["SERVER_ADMIN"] != 'doliwamp@loc
|
|||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<td>".$name."</td>";
|
print "<td>".$name."</td>";
|
||||||
//print getTableColumn($name, $activatedExtensions);
|
|
||||||
print getTableColumn($name, $loadedExtensions);
|
print getTableColumn($name, $loadedExtensions);
|
||||||
print getTableColumnFunction($functions);
|
print getTableColumnFunction($functions);
|
||||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||||
@ -201,7 +196,6 @@ $name = "xDebug";
|
|||||||
|
|
||||||
print "<tr>";
|
print "<tr>";
|
||||||
print "<td>".$name."</td>";
|
print "<td>".$name."</td>";
|
||||||
//print getTableColumn($name, $activatedExtensions);
|
|
||||||
print getTableColumn($name, $loadedExtensions);
|
print getTableColumn($name, $loadedExtensions);
|
||||||
print getTableColumnFunction($functions);
|
print getTableColumnFunction($functions);
|
||||||
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
print getResultColumn($name, $activatedExtensions, $loadedExtensions, $functions);
|
||||||
@ -240,7 +234,7 @@ foreach ($phparray as $key => $value)
|
|||||||
print '</tr>';
|
print '</tr>';
|
||||||
} else {
|
} else {
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td>'.$keyparam.'</td>';
|
print '<td class="wordbreak">'.$keyparam.'</td>';
|
||||||
$i = 0;
|
$i = 0;
|
||||||
foreach ($keyvalue as $keyparam2 => $keyvalue2)
|
foreach ($keyvalue as $keyparam2 => $keyvalue2)
|
||||||
{
|
{
|
||||||
@ -264,85 +258,6 @@ foreach ($phparray as $key => $value)
|
|||||||
llxFooter();
|
llxFooter();
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
/**
|
|
||||||
* Return all list with all activated, but possible not loaded PHP extensions
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
function getActivatedExtensions()
|
|
||||||
{
|
|
||||||
$file = trim(getConfigFilePath());
|
|
||||||
$handle = fopen($file, "r");
|
|
||||||
$content = fread($handle, filesize($file));
|
|
||||||
|
|
||||||
fclose($handle);
|
|
||||||
|
|
||||||
$configLines = explode("\r", $content);
|
|
||||||
|
|
||||||
// For compatibility with LF (Line Feed)
|
|
||||||
if (empty($configLines) || count($configLines) < 2) {
|
|
||||||
$configLines = explode("\n", $content);
|
|
||||||
}
|
|
||||||
|
|
||||||
$extensions = array();
|
|
||||||
$lastLine = "";
|
|
||||||
|
|
||||||
foreach ($configLines as $line)
|
|
||||||
{
|
|
||||||
$line = trim($line);
|
|
||||||
|
|
||||||
// ignore comment lines
|
|
||||||
if (substr($line, 0, 1) === ";" || empty($line))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// var_dump($line);
|
|
||||||
|
|
||||||
// extension
|
|
||||||
if (substr($line, 0, 9) === "extension" && substr($line, 0, 10) !== "extension_")
|
|
||||||
{
|
|
||||||
$value = trim(end(explode("=", $line)));
|
|
||||||
|
|
||||||
$extensions[] = $value === "gd2" ? "gd" : $value;
|
|
||||||
}
|
|
||||||
|
|
||||||
// zend_extension
|
|
||||||
if (substr($line, 0, 14) === "zend_extension")
|
|
||||||
{
|
|
||||||
$extensions[] = str_replace("[", "", str_replace("]", "", $lastLine));
|
|
||||||
}
|
|
||||||
|
|
||||||
$lastLine = $line;
|
|
||||||
}
|
|
||||||
|
|
||||||
return array_unique($extensions);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Return the path to the current used php config file
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function getConfigFilePath()
|
|
||||||
{
|
|
||||||
$phparray = phpinfo_array();
|
|
||||||
|
|
||||||
foreach ($phparray as $value)
|
|
||||||
{
|
|
||||||
foreach ($value as $keyparam => $keyvalue)
|
|
||||||
{
|
|
||||||
if (strtolower($keyparam) !== "loaded configuration file")
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $keyvalue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a table column with a indicator (okay or warning), based on the given name and list
|
* Return a table column with a indicator (okay or warning), based on the given name and list
|
||||||
@ -411,7 +326,7 @@ function getTableColumnFunction(array $functions)
|
|||||||
* Return a result column with a translated result text
|
* Return a result column with a translated result text
|
||||||
*
|
*
|
||||||
* @param string $name The name of the PHP extension
|
* @param string $name The name of the PHP extension
|
||||||
* @param array $activated A list with all activated PHP extensions
|
* @param array $activated A list with all activated PHP extensions. Deprecated.
|
||||||
* @param array $loaded A list with all loaded PHP extensions
|
* @param array $loaded A list with all loaded PHP extensions
|
||||||
* @param array $functions A list with all PHP functions to check
|
* @param array $functions A list with all PHP functions to check
|
||||||
*
|
*
|
||||||
|
|||||||
@ -240,6 +240,7 @@ foreach ($dirmodels as $reldir) {
|
|||||||
print '<td class="nowrap">';
|
print '<td class="nowrap">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
|
$langs->load("errors");
|
||||||
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
print '<div class="error">'.$langs->trans($tmp).'</div>';
|
||||||
} elseif ($tmp == 'NotConfigured') {
|
} elseif ($tmp == 'NotConfigured') {
|
||||||
print $langs->trans($tmp);
|
print $langs->trans($tmp);
|
||||||
|
|||||||
@ -90,18 +90,18 @@ print '<table class="border centpercent">';
|
|||||||
|
|
||||||
print '<tr class="border"><td style="padding: 4px">';
|
print '<tr class="border"><td style="padding: 4px">';
|
||||||
|
|
||||||
if (!empty($conf->syslog->enabled))
|
if (!empty($conf->syslog->enabled)) {
|
||||||
{
|
|
||||||
print '<input type="radio" name="choice" value="logfile"';
|
print '<input type="radio" name="choice" value="logfile"';
|
||||||
print ($choice && $choice == 'logfile') ? ' checked' : '';
|
print ($choice && $choice == 'logfile') ? ' checked' : '';
|
||||||
$filelogparam = $filelog;
|
$filelogparam = $filelog;
|
||||||
if ($user->admin && preg_match('/^dolibarr.*\.log$/', basename($filelog)))
|
if ($user->admin && preg_match('/^dolibarr.*\.log$/', basename($filelog))) {
|
||||||
{
|
|
||||||
$filelogparam = '<a class="wordbreak" href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file=';
|
$filelogparam = '<a class="wordbreak" href="'.DOL_URL_ROOT.'/document.php?modulepart=logs&file=';
|
||||||
$filelogparam .= basename($filelog);
|
$filelogparam .= basename($filelog);
|
||||||
$filelogparam .= '">'.$filelog.'</a>';
|
$filelogparam .= '">'.$filelog.'</a>';
|
||||||
}
|
}
|
||||||
print '> '.$langs->trans("PurgeDeleteLogFile", $filelogparam);
|
$desc = $langs->trans("PurgeDeleteLogFile", '{filelogparam}');
|
||||||
|
$desc = str_replace('{filelogparam}', $filelogparam, $desc);
|
||||||
|
print '> '.$desc;
|
||||||
print '<br><br>';
|
print '<br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +123,7 @@ print '</td></tr></table>';
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
if (preg_match('/^confirm/i', $choice))
|
if (preg_match('/^confirm/i', $choice)) {
|
||||||
{
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$formquestion = array();
|
$formquestion = array();
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').img_warning().' ', 'purge', $formquestion, 'no', 2);
|
print $form->formconfirm($_SERVER["PHP_SELF"].'?choice=allfiles', $langs->trans('Purge'), $langs->trans('ConfirmPurge').img_warning().' ', 'purge', $formquestion, 'no', 2);
|
||||||
|
|||||||
@ -363,7 +363,7 @@ if ($mode == 'overwrite')
|
|||||||
|
|
||||||
if ($mode == 'searchkey')
|
if ($mode == 'searchkey')
|
||||||
{
|
{
|
||||||
$langcode = GETPOST('langcode') ?GETPOST('langcode') : $langs->defaultlang;
|
$langcode = GETPOSTISSET('langcode') ? GETPOST('langcode') : $langs->defaultlang;
|
||||||
|
|
||||||
$newlang = new Translate('', $conf);
|
$newlang = new Translate('', $conf);
|
||||||
$newlang->setDefaultLang($langcode);
|
$newlang->setDefaultLang($langcode);
|
||||||
@ -384,8 +384,7 @@ if ($mode == 'searchkey')
|
|||||||
if (empty($langcode) || $langcode == '-1') $nbempty++;
|
if (empty($langcode) || $langcode == '-1') $nbempty++;
|
||||||
if (empty($transkey)) $nbempty++;
|
if (empty($transkey)) $nbempty++;
|
||||||
if (empty($transvalue)) $nbempty++;
|
if (empty($transvalue)) $nbempty++;
|
||||||
if ($action == 'search' && ($nbempty > 999)) // 999 to disable this
|
if ($action == 'search' && ($nbempty > 999)) { // 999 to disable this
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings');
|
setEventMessages($langs->trans("WarningAtLeastKeyOrTranslationRequired"), null, 'warnings');
|
||||||
} else {
|
} else {
|
||||||
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
|
// Search into dir of modules (the $modulesdir is already a list that loop on $conf->file->dol_document_root)
|
||||||
|
|||||||
@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,7 +241,7 @@ foreach ($dirmodels as $reldir)
|
|||||||
print '<td class="center">';
|
print '<td class="center">';
|
||||||
if ($module->type == 'pdf')
|
if ($module->type == 'pdf')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'contract').'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
|
||||||
} else {
|
} else {
|
||||||
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
print img_object($langs->trans("PreviewNotAvailable"), 'generic');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -160,7 +160,8 @@ if (dol_is_dir(DOL_DOCUMENT_ROOT.'/includes/restler/framework/Luracast/Restler/e
|
|||||||
$url = DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
|
$url = DOL_MAIN_URL_ROOT.'/api/index.php/explorer';
|
||||||
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("NotAvailableWithThisDistribution");
|
$langs->load("errors");
|
||||||
|
print info_admin($langs->trans("ErrorNotAvailableWithThisDistribution"), 0, 0, 'error');
|
||||||
}
|
}
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -113,6 +113,7 @@ class DolibarrApi
|
|||||||
|
|
||||||
unset($object->error);
|
unset($object->error);
|
||||||
unset($object->errors);
|
unset($object->errors);
|
||||||
|
unset($object->errorhidden);
|
||||||
|
|
||||||
unset($object->ref_previous);
|
unset($object->ref_previous);
|
||||||
unset($object->ref_next);
|
unset($object->ref_next);
|
||||||
|
|||||||
@ -85,6 +85,71 @@ class Setup extends DolibarrApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$sql .= $this->db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
|
if ($limit) {
|
||||||
|
if ($page < 0) {
|
||||||
|
$page = 0;
|
||||||
|
}
|
||||||
|
$offset = $limit * $page;
|
||||||
|
|
||||||
|
$sql .= $this->db->plimit($limit, $offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
$result = $this->db->query($sql);
|
||||||
|
|
||||||
|
if ($result) {
|
||||||
|
$num = $this->db->num_rows($result);
|
||||||
|
$min = min($num, ($limit <= 0 ? $num : $limit));
|
||||||
|
for ($i = 0; $i < $min; $i++) {
|
||||||
|
$list[] = $this->db->fetch_object($result);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new RestException(400, $this->db->lasterror());
|
||||||
|
}
|
||||||
|
|
||||||
|
return $list;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list of ordering origins.
|
||||||
|
*
|
||||||
|
* @param string $sortfield Sort field
|
||||||
|
* @param string $sortorder Sort order
|
||||||
|
* @param int $limit Number of items per page
|
||||||
|
* @param int $page Page number {@min 0}
|
||||||
|
* @param int $active Payment type is active or not {@min 0} {@max 1}
|
||||||
|
* @param string $sqlfilters SQL criteria to filter with. Syntax example "(t.code:=:'OrderByWWW')"
|
||||||
|
*
|
||||||
|
* @url GET dictionary/ordering_origins
|
||||||
|
*
|
||||||
|
* @return array [List of ordering reasons]
|
||||||
|
*
|
||||||
|
* @throws RestException 400
|
||||||
|
*/
|
||||||
|
public function getOrderingOrigins($sortfield = "code", $sortorder = 'ASC', $limit = 100, $page = 0, $active = 1, $sqlfilters = '')
|
||||||
|
{
|
||||||
|
$list = array();
|
||||||
|
|
||||||
|
if (!DolibarrApiAccess::$user->rights->commande->lire) {
|
||||||
|
throw new RestException(401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = "SELECT rowid, code, label, module";
|
||||||
|
$sql .= " FROM ".MAIN_DB_PREFIX."c_input_reason as t";
|
||||||
|
$sql .= " WHERE t.active = ".$active;
|
||||||
|
// Add sql filters
|
||||||
|
if ($sqlfilters)
|
||||||
|
{
|
||||||
|
if (!DolibarrApi::_checkFilters($sqlfilters))
|
||||||
|
{
|
||||||
|
throw new RestException(400, 'error when validating parameter sqlfilters '.$sqlfilters);
|
||||||
|
}
|
||||||
|
$regexstring = '\(([^:\'\(\)]+:[^:\'\(\)]+:[^:\(\)]+)\)';
|
||||||
|
$sql .= " AND (".preg_replace_callback('/'.$regexstring.'/', 'DolibarrApi::_forge_criteria_callback', $sqlfilters).")";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql .= $this->db->order($sortfield, $sortorder);
|
$sql .= $this->db->order($sortfield, $sortorder);
|
||||||
|
|
||||||
if ($limit) {
|
if ($limit) {
|
||||||
@ -1543,6 +1608,14 @@ class Setup extends DolibarrApi
|
|||||||
{
|
{
|
||||||
global $mysoc;
|
global $mysoc;
|
||||||
|
|
||||||
|
unset($mysoc->skype);
|
||||||
|
unset($mysoc->twitter);
|
||||||
|
unset($mysoc->facebook);
|
||||||
|
unset($mysoc->linkedin);
|
||||||
|
|
||||||
|
unset($mysoc->note);
|
||||||
|
unset($mysoc->lines);
|
||||||
|
|
||||||
return $this->_cleanObjectDatas($mysoc);
|
return $this->_cleanObjectDatas($mysoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -158,28 +158,6 @@ class Asset extends CommonObject
|
|||||||
*/
|
*/
|
||||||
public $status;
|
public $status;
|
||||||
|
|
||||||
// If this object has a subtable with lines
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var int Name of subtable line
|
|
||||||
*/
|
|
||||||
//public $table_element_line = 'assetdet';
|
|
||||||
/**
|
|
||||||
* @var int Field with ID of parent key if this field has a parent
|
|
||||||
*/
|
|
||||||
//public $fk_element = 'fk_asset';
|
|
||||||
/**
|
|
||||||
* @var int Name of subtable class that manage subtable lines
|
|
||||||
*/
|
|
||||||
//public $class_element_line = 'Assetline';
|
|
||||||
/**
|
|
||||||
* @var array List of child tables. To test if we can delete object.
|
|
||||||
*/
|
|
||||||
//protected $childtables=array();
|
|
||||||
/**
|
|
||||||
* @var AssetLine[] Array of subtable lines
|
|
||||||
*/
|
|
||||||
//public $lines = array();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
|||||||
@ -39,6 +39,8 @@ $block = new BlockedLog($db);
|
|||||||
|
|
||||||
if ((!$user->admin && !$user->rights->blockedlog->read) || empty($conf->blockedlog->enabled)) accessforbidden();
|
if ((!$user->admin && !$user->rights->blockedlog->read) || empty($conf->blockedlog->enabled)) accessforbidden();
|
||||||
|
|
||||||
|
$langs->loadLangs(array("admin"));
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
|
|||||||
@ -383,21 +383,6 @@ if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $
|
|||||||
|
|
||||||
llxHeader('', $title, $help_url);
|
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();
|
$arrayofselected = is_array($toselect) ? $toselect : array();
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
@ -469,7 +454,7 @@ $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
|
|||||||
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
|
||||||
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
|
||||||
|
|
||||||
print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
|
print '<div class="div-table-responsive">';
|
||||||
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -183,18 +183,18 @@ class BOM extends CommonObject
|
|||||||
public $table_element_line = 'bom_bomline';
|
public $table_element_line = 'bom_bomline';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Field with ID of parent key if this field has a parent
|
* @var string Fieldname with ID of parent key if this field has a parent
|
||||||
*/
|
*/
|
||||||
public $fk_element = 'fk_bom';
|
public $fk_element = 'fk_bom';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Name of subtable class that manage subtable lines
|
* @var string Name of subtable class that manage subtable lines
|
||||||
*/
|
*/
|
||||||
public $class_element_line = 'BOMLine';
|
public $class_element_line = 'BOMLine';
|
||||||
|
|
||||||
/**
|
// /**
|
||||||
* @var array List of child tables. To test if we can delete object.
|
// * @var array List of child tables. To test if we can delete object.
|
||||||
*/
|
// */
|
||||||
// protected $childtables=array();
|
// protected $childtables=array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -769,6 +769,7 @@ class Categories extends DolibarrApi
|
|||||||
|
|
||||||
$objects = $result;
|
$objects = $result;
|
||||||
$cleaned_objects = array();
|
$cleaned_objects = array();
|
||||||
|
$objects_api = null;
|
||||||
if ($type == 'member') {
|
if ($type == 'member') {
|
||||||
$objects_api = new Members();
|
$objects_api = new Members();
|
||||||
} elseif ($type == 'customer' || $type == 'supplier') {
|
} elseif ($type == 'customer' || $type == 'supplier') {
|
||||||
|
|||||||
@ -1891,13 +1891,12 @@ class Categorie extends CommonObject
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$searchCategorySqlList = array();
|
||||||
foreach ($searchList as $searchCategory) {
|
foreach ($searchList as $searchCategory) {
|
||||||
if (intval($searchCategory) == -2) {
|
if (intval($searchCategory) == -2) {
|
||||||
$searchCategorySqlList[] = " cp.fk_categorie IS NULL";
|
$searchCategorySqlList[] = " cp.fk_categorie IS NULL";
|
||||||
} elseif (intval($searchCategory) > 0) {
|
} elseif (intval($searchCategory) > 0) {
|
||||||
$searchCategorySqlList[] = " ".$rowIdName
|
$searchCategorySqlList[] = " ".$rowIdName." IN (SELECT fk_".$type." FROM ".MAIN_DB_PREFIX."categorie_".$type." WHERE fk_categorie = ".((int) $searchCategory).")";
|
||||||
." IN (SELECT fk_".$type." FROM ".MAIN_DB_PREFIX."categorie_".$type
|
|
||||||
." WHERE fk_categorie = ".$searchCategory.")";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -280,7 +280,7 @@ if (empty($reshook) && $action == 'add')
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$object->fk_project = isset($_POST["projectid"]) ? $_POST["projectid"] : 0;
|
$object->fk_project = GETPOSTISSET("projectid") ? GETPOST("projectid", 'int') : 0;
|
||||||
|
|
||||||
$taskid = GETPOST('taskid', 'int');
|
$taskid = GETPOST('taskid', 'int');
|
||||||
if (!empty($taskid)) {
|
if (!empty($taskid)) {
|
||||||
@ -324,7 +324,7 @@ if (empty($reshook) && $action == 'add')
|
|||||||
|
|
||||||
$object->note_private = trim(GETPOST("note", "restricthtml"));
|
$object->note_private = trim(GETPOST("note", "restricthtml"));
|
||||||
|
|
||||||
if (isset($_POST["contactid"])) $object->contact = $contact;
|
if (GETPOSTISSET("contactid")) $object->contact = $contact;
|
||||||
|
|
||||||
if (GETPOST('socid', 'int') > 0)
|
if (GETPOST('socid', 'int') > 0)
|
||||||
{
|
{
|
||||||
@ -1051,8 +1051,8 @@ if ($action == 'create')
|
|||||||
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
|
print '<tr><td>'.$langs->trans("Status").' / '.$langs->trans("Percentage").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$percent = -1;
|
$percent = -1;
|
||||||
if (isset($_GET['status']) || isset($_POST['status'])) $percent = GETPOST('status');
|
if (GETPOSTISSET('status')) $percent = GETPOST('status');
|
||||||
elseif (isset($_GET['percentage']) || isset($_POST['percentage'])) $percent = GETPOST('percentage');
|
elseif (GETPOSTISSET('percentage')) $percent = GETPOST('percentage');
|
||||||
else {
|
else {
|
||||||
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent = '0';
|
if (GETPOST('complete') == '0' || GETPOST("afaire") == 1) $percent = '0';
|
||||||
elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent = 100;
|
elseif (GETPOST('complete') == 100 || GETPOST("afaire") == 2) $percent = 100;
|
||||||
@ -1104,7 +1104,7 @@ if ($action == 'create')
|
|||||||
// Categories
|
// Categories
|
||||||
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
|
print '<tr><td>'.$langs->trans("Categories").'</td><td>';
|
||||||
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
|
$cate_arbo = $form->select_all_categories(Categorie::TYPE_ACTIONCOMM, '', 'parent', 64, 0, 1);
|
||||||
print $form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent', 0, 0);
|
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, GETPOST('categories', 'array'), '', 0, 'minwidth300 quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1578,7 +1578,7 @@ if ($id > 0)
|
|||||||
foreach ($cats as $cat) {
|
foreach ($cats as $cat) {
|
||||||
$arrayselected[] = $cat->id;
|
$arrayselected[] = $cat->id;
|
||||||
}
|
}
|
||||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -336,7 +336,7 @@ if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
|
if ($actioncode || GETPOSTISSET('search_actioncode')) {
|
||||||
if (is_array($actioncode)) {
|
if (is_array($actioncode)) {
|
||||||
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
|
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
|
||||||
} else $param .= "&search_actioncode=".urlencode($actioncode);
|
} else $param .= "&search_actioncode=".urlencode($actioncode);
|
||||||
@ -1492,19 +1492,19 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
|
|
||||||
if ($nonew <= 0)
|
if ($nonew <= 0)
|
||||||
{
|
{
|
||||||
print '<div class="tagtr"><div class="nowrap tagtd">';
|
print '<div class="tagtr"><div class="nowrap tagtd"><div class="left inline-block">';
|
||||||
print '<a class="dayevent-aday" style="color: #666" href="'.$urltoshow.'">';
|
print '<a class="dayevent-aday" style="color: #666" href="'.$urltoshow.'">';
|
||||||
if ($showinfo) print dol_print_date($curtime, 'daytextshort');
|
if ($showinfo) print dol_print_date($curtime, 'daytextshort');
|
||||||
else print dol_print_date($curtime, '%d');
|
else print dol_print_date($curtime, '%d');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
print '</div><div class="nowrap tagtd right">';
|
print '</div><div class="nowrap floatright inline-block marginrightonly">';
|
||||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
|
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
|
||||||
{
|
{
|
||||||
print '<a class="cursoradd" href="'.$urltocreate.'">'; // Explicit link, usefull for nojs interfaces
|
print '<a class="cursoradd" href="'.$urltocreate.'">'; // Explicit link, usefull for nojs interfaces
|
||||||
print img_picto($langs->trans("NewAction"), 'edit_add.png');
|
print img_picto($langs->trans("NewAction"), 'edit_add.png');
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
print '</div></div>'."\n";
|
print '</div></div></div>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($nonew < 0)
|
if ($nonew < 0)
|
||||||
|
|||||||
@ -122,8 +122,8 @@ $tmparray = explode('-', $tmp);
|
|||||||
$begin_d = 1;
|
$begin_d = 1;
|
||||||
$end_d = 53;
|
$end_d = 53;
|
||||||
|
|
||||||
if ($status == '' && !isset($_GET['status']) && !isset($_POST['status'])) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
if ($status == '' && !GETPOSTISSET('status')) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||||
if (empty($action) && !isset($_GET['action']) && !isset($_POST['action'])) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
|
|
||||||
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||||
$action = 'show_month'; $day = '';
|
$action = 'show_month'; $day = '';
|
||||||
@ -227,13 +227,13 @@ if ($status == 'done') $title = $langs->trans("DoneActions");
|
|||||||
if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
|
if ($actioncode || GETPOSTISSET('search_actioncode')) {
|
||||||
if (is_array($actioncode)) {
|
if (is_array($actioncode)) {
|
||||||
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
|
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
|
||||||
} else $param .= "&search_actioncode=".urlencode($actioncode);
|
} else $param .= "&search_actioncode=".urlencode($actioncode);
|
||||||
}
|
}
|
||||||
if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
|
if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
|
||||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param .= "&search_status=".urlencode($status);
|
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
|
||||||
if ($filter) $param .= "&search_filter=".urlencode($filter);
|
if ($filter) $param .= "&search_filter=".urlencode($filter);
|
||||||
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
|
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
|
||||||
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
|
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
|
||||||
|
|||||||
@ -125,8 +125,8 @@ if ($begin_d < 1 || $begin_d > 7) $begin_d = 1;
|
|||||||
if ($end_d < 1 || $end_d > 7) $end_d = 7;
|
if ($end_d < 1 || $end_d > 7) $end_d = 7;
|
||||||
if ($end_d < $begin_d) $end_d = $begin_d + 1;
|
if ($end_d < $begin_d) $end_d = $begin_d + 1;
|
||||||
|
|
||||||
if ($status == '' && !isset($_GET['status']) && !isset($_POST['status'])) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
if ($status == '' && !GETPOSTISSET('status')) $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||||
if (empty($action) && !isset($_GET['action']) && !isset($_POST['action'])) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
if (empty($action) && !GETPOSTISSET('action')) $action = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
|
|
||||||
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
if (GETPOST('viewcal', 'alpha') && $action != 'show_day' && $action != 'show_week' && $action != 'show_peruser') {
|
||||||
$action = 'show_month'; $day = '';
|
$action = 'show_month'; $day = '';
|
||||||
@ -227,13 +227,13 @@ if ($status == 'done') $title = $langs->trans("DoneActions");
|
|||||||
if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
if ($actioncode || isset($_GET['search_actioncode']) || isset($_POST['search_actioncode'])) {
|
if ($actioncode || GETPOSTISSET('search_actioncode')) {
|
||||||
if (is_array($actioncode)) {
|
if (is_array($actioncode)) {
|
||||||
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
|
foreach ($actioncode as $str_action) $param .= "&search_actioncode[]=".urlencode($str_action);
|
||||||
} else $param .= "&search_actioncode=".urlencode($actioncode);
|
} else $param .= "&search_actioncode=".urlencode($actioncode);
|
||||||
}
|
}
|
||||||
if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
|
if ($resourceid > 0) $param .= "&search_resourceid=".urlencode($resourceid);
|
||||||
if ($status || isset($_GET['status']) || isset($_POST['status'])) $param .= "&search_status=".urlencode($status);
|
if ($status || GETPOSTISSET('status')) $param .= "&search_status=".urlencode($status);
|
||||||
if ($filter) $param .= "&search_filter=".urlencode($filter);
|
if ($filter) $param .= "&search_filter=".urlencode($filter);
|
||||||
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
|
if ($filtert) $param .= "&search_filtert=".urlencode($filtert);
|
||||||
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
|
if ($usergroup) $param .= "&search_usergroup=".urlencode($usergroup);
|
||||||
|
|||||||
@ -86,6 +86,15 @@ $extrafields->fetch_name_optionals_label($object->table_element);
|
|||||||
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
$hookmanager->initHooks(array('thirdpartycomm', 'globalcard'));
|
$hookmanager->initHooks(array('thirdpartycomm', 'globalcard'));
|
||||||
|
|
||||||
|
// Security check
|
||||||
|
$result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', 0);
|
||||||
|
|
||||||
|
if ($object->id > 0) {
|
||||||
|
if (!($object->client > 0) || empty($user->rights->societe->lire)) {
|
||||||
|
accessforbidden();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -805,14 +805,14 @@ if ($action == 'create') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$text = '';
|
$text = '';
|
||||||
if ($conf->global->MAILING_LIMIT_SENDBYCLI >= 0) {
|
if (!isset($conf->global->MAILING_LIMIT_SENDBYCLI) || $conf->global->MAILING_LIMIT_SENDBYCLI >= 0) {
|
||||||
$text .= $langs->trans("MailingNeedCommand");
|
$text .= $langs->trans("MailingNeedCommand");
|
||||||
$text .= '<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.' '.$user->login.'</textarea>';
|
$text .= '<br><textarea cols="60" rows="'.ROWS_2.'" wrap="soft">php ./scripts/emailings/mailing-send.php '.$object->id.' '.$user->login.'</textarea>';
|
||||||
$text .= '<br><br>';
|
$text .= '<br><br>';
|
||||||
}
|
}
|
||||||
$text .= $langs->trans('ConfirmSendingEmailing').'<br>';
|
$text .= $langs->trans('ConfirmSendingEmailing').'<br>';
|
||||||
$text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
|
$text .= $langs->trans('LimitSendingEmailing', $conf->global->MAILING_LIMIT_SENDBYWEB);
|
||||||
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('SendMailing'), $text, 'sendallconfirmed', $formquestion, '', 1, 330, 600);
|
print $form->formconfirm($_SERVER['PHP_SELF'].'?id='.$object->id, $langs->trans('SendMailing'), $text, 'sendallconfirmed', '', '', 1, 330, 600);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ class AdvanceTargetingMailing extends CommonObject
|
|||||||
public $name;
|
public $name;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int element id
|
* @var int element id (it's not the name of a field)
|
||||||
*/
|
*/
|
||||||
public $fk_element;
|
public $fk_element;
|
||||||
|
|
||||||
|
|||||||
@ -366,9 +366,6 @@ if (empty($reshook))
|
|||||||
$object->statut = Propal::STATUS_DRAFT;
|
$object->statut = Propal::STATUS_DRAFT;
|
||||||
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
|
||||||
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
|
||||||
|
|
||||||
// the create is done below and further more the existing create_from function is quite hilarating
|
|
||||||
//$id = $object->create_from($user);
|
|
||||||
} else {
|
} else {
|
||||||
setEventMessages($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailedToCopyProposal", GETPOST('copie_propal')), null, 'errors');
|
||||||
}
|
}
|
||||||
@ -550,9 +547,8 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($id > 0)
|
if ($id > 0)
|
||||||
{
|
{
|
||||||
// Insertion contact par defaut si defini
|
// Insert default contacts if defined
|
||||||
if (GETPOST('contactid') > 0)
|
if (GETPOST('contactid') > 0) {
|
||||||
{
|
|
||||||
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
{
|
{
|
||||||
@ -1347,7 +1343,8 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if ($object->id > 0) {
|
if ($object->id > 0) {
|
||||||
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
|
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
|
||||||
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
|
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||||
|
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
@ -2411,7 +2408,8 @@ if ($action == 'create')
|
|||||||
if ($action != 'editline')
|
if ($action != 'editline')
|
||||||
{
|
{
|
||||||
// Validate
|
// Validate
|
||||||
if ($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
|
if (($object->statut == Propal::STATUS_DRAFT && $object->total_ttc >= 0 && count($object->lines) > 0)
|
||||||
|
|| ($object->statut == Propal::STATUS_DRAFT && !empty($conf->global->PROPAL_ENABLE_NEGATIVE) && count($object->lines) > 0))
|
||||||
{
|
{
|
||||||
if ($usercanvalidate)
|
if ($usercanvalidate)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -66,7 +66,7 @@ class Propal extends CommonObject
|
|||||||
public $table_element_line = 'propaldet';
|
public $table_element_line = 'propaldet';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Field with ID of parent key if this field has a parent
|
* @var string Fieldname with ID of parent key if this field has a parent
|
||||||
*/
|
*/
|
||||||
public $fk_element = 'fk_propal';
|
public $fk_element = 'fk_propal';
|
||||||
|
|
||||||
@ -208,7 +208,6 @@ class Propal extends CommonObject
|
|||||||
public $demand_reason_id;
|
public $demand_reason_id;
|
||||||
public $demand_reason_code;
|
public $demand_reason_code;
|
||||||
|
|
||||||
public $products = array();
|
|
||||||
public $extraparams = array();
|
public $extraparams = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -355,15 +354,13 @@ class Propal extends CommonObject
|
|||||||
$this->socid = $socid;
|
$this->socid = $socid;
|
||||||
$this->id = $propalid;
|
$this->id = $propalid;
|
||||||
|
|
||||||
$this->products = array();
|
|
||||||
|
|
||||||
$this->duree_validite = ((int) $conf->global->PROPALE_VALIDITY_DURATION);
|
$this->duree_validite = ((int) $conf->global->PROPALE_VALIDITY_DURATION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Add line into array products
|
* Add line into array ->lines
|
||||||
* $this->thirdparty should be loaded
|
* $this->thirdparty should be loaded
|
||||||
*
|
*
|
||||||
* @param int $idproduct Product Id to add
|
* @param int $idproduct Product Id to add
|
||||||
@ -372,7 +369,6 @@ class Propal extends CommonObject
|
|||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*
|
*
|
||||||
* TODO Replace calls to this function by generation objet Ligne
|
* TODO Replace calls to this function by generation objet Ligne
|
||||||
* inserted into table $this->products
|
|
||||||
*/
|
*/
|
||||||
public function add_product($idproduct, $qty, $remise_percent = 0)
|
public function add_product($idproduct, $qty, $remise_percent = 0)
|
||||||
{
|
{
|
||||||
@ -1103,7 +1099,7 @@ class Propal extends CommonObject
|
|||||||
if ($this->id)
|
if ($this->id)
|
||||||
{
|
{
|
||||||
$this->ref = '(PROV'.$this->id.')';
|
$this->ref = '(PROV'.$this->id.')';
|
||||||
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".$this->id;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX."propal SET ref='".$this->db->escape($this->ref)."' WHERE rowid=".((int) $this->id);
|
||||||
|
|
||||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||||
$resql = $this->db->query($sql);
|
$resql = $this->db->query($sql);
|
||||||
@ -1115,7 +1111,7 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add object linked
|
// Add object linked
|
||||||
if (!$error && $this->id && is_array($this->linked_objects) && !empty($this->linked_objects))
|
if (!$error && $this->id && !empty($this->linked_objects) && is_array($this->linked_objects))
|
||||||
{
|
{
|
||||||
foreach ($this->linked_objects as $origin => $tmp_origin_id)
|
foreach ($this->linked_objects as $origin => $tmp_origin_id)
|
||||||
{
|
{
|
||||||
@ -1279,24 +1275,6 @@ class Propal extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
|
||||||
* Insert into DB a proposal object completely defined by its data members (ex, results from copy).
|
|
||||||
*
|
|
||||||
* @param User $user User that create
|
|
||||||
* @return int Id of the new object if ok, <0 if ko
|
|
||||||
* @see create()
|
|
||||||
*/
|
|
||||||
public function create_from($user)
|
|
||||||
{
|
|
||||||
// phpcs:enable
|
|
||||||
// i love this function because $this->products is not used in create function...
|
|
||||||
$this->products = $this->lines;
|
|
||||||
|
|
||||||
return $this->create($user);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load an object from its id and create a new one in database
|
* Load an object from its id and create a new one in database
|
||||||
*
|
*
|
||||||
@ -3775,7 +3753,10 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
public $product_type = Product::TYPE_PRODUCT;
|
public $product_type = Product::TYPE_PRODUCT;
|
||||||
|
|
||||||
public $qty;
|
public $qty;
|
||||||
|
|
||||||
public $tva_tx;
|
public $tva_tx;
|
||||||
|
public $vat_src_code;
|
||||||
|
|
||||||
public $subprice;
|
public $subprice;
|
||||||
public $remise_percent;
|
public $remise_percent;
|
||||||
public $fk_remise_except;
|
public $fk_remise_except;
|
||||||
@ -3827,6 +3808,11 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
* @see $product_label
|
* @see $product_label
|
||||||
*/
|
*/
|
||||||
public $libelle;
|
public $libelle;
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
* @see $product_label
|
||||||
|
*/
|
||||||
|
public $label;
|
||||||
/**
|
/**
|
||||||
* Product label
|
* Product label
|
||||||
* @var string
|
* @var string
|
||||||
|
|||||||
@ -79,7 +79,8 @@ if ($action == 'addcontact' && $user->rights->propale->creer)
|
|||||||
if ($object->id > 0)
|
if ($object->id > 0)
|
||||||
{
|
{
|
||||||
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||||
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
|
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||||
|
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
|
|||||||
@ -37,11 +37,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
|||||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||||
|
|
||||||
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||||
if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden();
|
if ($mode == 'customer' && !$user->rights->propale->lire) accessforbidden();
|
||||||
if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden();
|
if ($mode == 'supplier' && !$user->rights->supplier_proposal->lire) accessforbidden();
|
||||||
|
|
||||||
$object_status = GETPOST('object_status');
|
$object_status = GETPOST('object_status', 'intcomma');
|
||||||
$typent_id = GETPOST('typent_id', 'int');
|
$typent_id = GETPOST('typent_id', 'int');
|
||||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ if ($user->socid > 0)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$nowyear = strftime("%Y", dol_now());
|
$nowyear = strftime("%Y", dol_now());
|
||||||
$year = GETPOST('year') > 0 ?GETPOST('year') : $nowyear;
|
$year = GETPOST('year') > 0 ? GETPOST('year', 'int') : $nowyear;
|
||||||
//$startyear=$year-2;
|
//$startyear=$year-2;
|
||||||
$startyear = $year - 1;
|
$startyear = $year - 1;
|
||||||
$endyear = $year;
|
$endyear = $year;
|
||||||
|
|||||||
@ -453,26 +453,14 @@ if (empty($reshook))
|
|||||||
if (!$error)
|
if (!$error)
|
||||||
{
|
{
|
||||||
$object_id = $object->create($user);
|
$object_id = $object->create($user);
|
||||||
|
|
||||||
// If some invoice's lines already known
|
|
||||||
$NBLINES = 8;
|
|
||||||
for ($i = 1; $i <= $NBLINES; $i++) {
|
|
||||||
if ($_POST['idprod'.$i]) {
|
|
||||||
$xid = 'idprod'.$i;
|
|
||||||
$xqty = 'qty'.$i;
|
|
||||||
$xremise = 'remise_percent'.$i;
|
|
||||||
$object->add_product($_POST[$xid], $_POST[$xqty], $_POST[$xremise]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert default contacts if defined
|
// Insert default contacts if defined
|
||||||
if ($object_id > 0)
|
if ($object_id > 0)
|
||||||
{
|
{
|
||||||
if (GETPOST('contactid'))
|
if (GETPOST('contactid', 'int')) {
|
||||||
{
|
$result = $object->add_contact(GETPOST('contactid', 'int'), 'CUSTOMER', 'external');
|
||||||
$result = $object->add_contact(GETPOST('contactid'), 'CUSTOMER', 'external');
|
|
||||||
if ($result < 0) {
|
if ($result < 0) {
|
||||||
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
|
setEventMessages($langs->trans("ErrorFailedToAddContact"), null, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
@ -931,6 +919,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
$ret = $object->fetch($object->id); // Reload to get new records
|
$ret = $object->fetch($object->id); // Reload to get new records
|
||||||
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
|
||||||
// Define output language
|
// Define output language
|
||||||
@ -1378,7 +1367,8 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
if ($object->id > 0) {
|
if ($object->id > 0) {
|
||||||
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
|
$contactid = (GETPOST('userid') ? GETPOST('userid') : GETPOST('contactid'));
|
||||||
$result = $object->add_contact($contactid, GETPOST('type'), GETPOST('source'));
|
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||||
|
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result >= 0) {
|
if ($result >= 0) {
|
||||||
|
|||||||
@ -199,6 +199,7 @@ class Commande extends CommonOrder
|
|||||||
public $rang;
|
public $rang;
|
||||||
public $special_code;
|
public $special_code;
|
||||||
public $source; // Order mode. How we received order (by phone, by email, ...)
|
public $source; // Order mode. How we received order (by phone, by email, ...)
|
||||||
|
|
||||||
public $extraparams = array();
|
public $extraparams = array();
|
||||||
|
|
||||||
public $linked_objects = array();
|
public $linked_objects = array();
|
||||||
@ -368,8 +369,6 @@ class Commande extends CommonOrder
|
|||||||
|
|
||||||
$this->remise = 0;
|
$this->remise = 0;
|
||||||
$this->remise_percent = 0;
|
$this->remise_percent = 0;
|
||||||
|
|
||||||
$this->products = array();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1690,7 +1689,6 @@ class Commande extends CommonOrder
|
|||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
* TODO Remplacer les appels a cette fonction par generation objet Ligne
|
||||||
* insere dans tableau $this->products
|
|
||||||
*/
|
*/
|
||||||
public function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '')
|
public function add_product($idproduct, $qty, $remise_percent = 0.0, $date_start = '', $date_end = '')
|
||||||
{
|
{
|
||||||
@ -1755,12 +1753,10 @@ class Commande extends CommonOrder
|
|||||||
foreach($prods_arbo as $key => $value)
|
foreach($prods_arbo as $key => $value)
|
||||||
{
|
{
|
||||||
// print "id : ".$value[1].' :qty: '.$value[0].'<br>';
|
// print "id : ".$value[1].' :qty: '.$value[0].'<br>';
|
||||||
if(! in_array($value[1],$this->products))
|
if not in lines {
|
||||||
$this->add_product($value[1], $value[0]);
|
$this->add_product($value[1], $value[0]);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
**/
|
**/
|
||||||
}
|
}
|
||||||
@ -3277,6 +3273,7 @@ class Commande extends CommonOrder
|
|||||||
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
$sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? $this->cond_reglement_id : "null").",";
|
||||||
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
|
$sql .= " fk_mode_reglement=".(isset($this->mode_reglement_id) ? $this->mode_reglement_id : "null").",";
|
||||||
$sql .= " fk_account=".($this->fk_account > 0 ? $this->fk_account : "null").",";
|
$sql .= " fk_account=".($this->fk_account > 0 ? $this->fk_account : "null").",";
|
||||||
|
$sql .= " fk_input_reason=".($this->demand_reason_id > 0 ? $this->demand_reason_id : "null").",";
|
||||||
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
|
$sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").",";
|
||||||
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
|
$sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").",";
|
||||||
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").",";
|
$sql .= " model_pdf=".(isset($this->modelpdf) ? "'".$this->db->escape($this->modelpdf)."'" : "null").",";
|
||||||
|
|||||||
@ -56,7 +56,8 @@ if ($action == 'addcontact' && $user->rights->commande->creer)
|
|||||||
if ($result > 0 && $id > 0)
|
if ($result > 0 && $id > 0)
|
||||||
{
|
{
|
||||||
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
$contactid = (GETPOST('userid', 'int') ? GETPOST('userid', 'int') : GETPOST('contactid', 'int'));
|
||||||
$result = $object->add_contact($contactid, $_POST["type"], $_POST["source"]);
|
$typeid = (GETPOST('typecontact') ? GETPOST('typecontact') : GETPOST('type'));
|
||||||
|
$result = $object->add_contact($contactid, $typeid, GETPOST("source", 'aZ09'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result >= 0)
|
if ($result >= 0)
|
||||||
|
|||||||
@ -109,7 +109,7 @@ $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
|
|||||||
$sortfield = GETPOST("sortfield", 'alpha');
|
$sortfield = GETPOST("sortfield", 'alpha');
|
||||||
$sortorder = GETPOST("sortorder", 'alpha');
|
$sortorder = GETPOST("sortorder", 'alpha');
|
||||||
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
|
||||||
if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
|
if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { $page = 0; } // If $page is not defined, or '' or -1 or if we click on clear filters
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
@ -142,35 +142,35 @@ if (empty($user->socid)) $fieldstosearchall["c.note_private"] = "NotePrivate";
|
|||||||
|
|
||||||
$checkedtypetiers = 0;
|
$checkedtypetiers = 0;
|
||||||
$arrayfields = array(
|
$arrayfields = array(
|
||||||
'c.ref'=>array('label'=>"Ref", 'checked'=>1),
|
'c.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>5),
|
||||||
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>1),
|
'c.ref_client'=>array('label'=>"RefCustomerOrder", 'checked'=>-1, 'position'=>10),
|
||||||
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
|
'p.ref'=>array('label'=>"ProjectRef", 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>20),
|
||||||
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1)),
|
'p.title'=>array('label'=>"ProjectLabel", 'checked'=>0, 'enabled'=>(empty($conf->projet->enabled) ? 0 : 1), 'position'=>25),
|
||||||
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1),
|
's.nom'=>array('label'=>"ThirdParty", 'checked'=>1, 'position'=>30),
|
||||||
's.town'=>array('label'=>"Town", 'checked'=>1),
|
's.town'=>array('label'=>"Town", 'checked'=>1, 'position'=>35),
|
||||||
's.zip'=>array('label'=>"Zip", 'checked'=>1),
|
's.zip'=>array('label'=>"Zip", 'checked'=>1, 'position'=>40),
|
||||||
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
|
'state.nom'=>array('label'=>"StateShort", 'checked'=>0, 'position'=>45),
|
||||||
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
|
'country.code_iso'=>array('label'=>"Country", 'checked'=>0, 'position'=>50),
|
||||||
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
|
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55),
|
||||||
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1),
|
'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60),
|
||||||
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE)),
|
'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65),
|
||||||
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1),
|
'c.total_ht'=>array('label'=>"AmountHT", 'checked'=>1, 'position'=>75),
|
||||||
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0),
|
'c.total_vat'=>array('label'=>"AmountVAT", 'checked'=>0, 'position'=>80),
|
||||||
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0),
|
'c.total_ttc'=>array('label'=>"AmountTTC", 'checked'=>0, 'position'=>85),
|
||||||
'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
'c.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>90),
|
||||||
'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
'c.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>95),
|
||||||
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
'c.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>100),
|
||||||
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
'c.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>105),
|
||||||
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1)),
|
'c.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(empty($conf->multicurrency->enabled) ? 0 : 1), 'position'=>110),
|
||||||
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10),
|
'u.login'=>array('label'=>"Author", 'checked'=>1, 'position'=>10, 'position'=>115),
|
||||||
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500),
|
'c.datec'=>array('label'=>"DateCreation", 'checked'=>0, 'position'=>500, 'position'=>120),
|
||||||
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500),
|
'c.tms'=>array('label'=>"DateModificationShort", 'checked'=>0, 'position'=>500, 'position'=>125),
|
||||||
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500),
|
'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>500, 'position'=>130),
|
||||||
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES))),
|
'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'position'=>510, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135),
|
||||||
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES))),
|
'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'position'=>511, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140),
|
||||||
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000),
|
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>990, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>145),
|
||||||
'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'position'=>1000, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT))),
|
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>995, 'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>150),
|
||||||
'shippable'=>array('label'=>"Shippable", 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->expedition->enabled)))
|
'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000, 'position'=>155)
|
||||||
);
|
);
|
||||||
// Extra fields
|
// Extra fields
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
|
||||||
@ -831,21 +831,6 @@ if ($resql)
|
|||||||
print '<td class="liste_titre">';
|
print '<td class="liste_titre">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
// Status
|
|
||||||
if (!empty($arrayfields['c.fk_statut']['checked']))
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre maxwidthonsmartphone right">';
|
|
||||||
$liststatus = array(
|
|
||||||
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
|
||||||
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
|
||||||
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
|
|
||||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
|
||||||
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
|
|
||||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
|
||||||
);
|
|
||||||
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
// Shippable
|
// Shippable
|
||||||
if (!empty($arrayfields['shippable']['checked']))
|
if (!empty($arrayfields['shippable']['checked']))
|
||||||
{
|
{
|
||||||
@ -866,6 +851,21 @@ if ($resql)
|
|||||||
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1, 1);
|
print $form->selectyesno('search_billed', $search_billed, 1, 0, 1, 1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
// Status
|
||||||
|
if (!empty($arrayfields['c.fk_statut']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre maxwidthonsmartphone center">';
|
||||||
|
$liststatus = array(
|
||||||
|
Commande::STATUS_DRAFT=>$langs->trans("StatusOrderDraftShort"),
|
||||||
|
Commande::STATUS_VALIDATED=>$langs->trans("StatusOrderValidated"),
|
||||||
|
Commande::STATUS_SHIPMENTONPROCESS=>$langs->trans("StatusOrderSentShort"),
|
||||||
|
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||||
|
-3=>$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort").'+'.$langs->trans("StatusOrderDelivered"),
|
||||||
|
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceledShort")
|
||||||
|
);
|
||||||
|
print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'maxwidth100', 1);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="liste_titre" align="middle">';
|
print '<td class="liste_titre" align="middle">';
|
||||||
$searchpicto = $form->showFilterButtons();
|
$searchpicto = $form->showFilterButtons();
|
||||||
@ -909,9 +909,9 @@ if ($resql)
|
|||||||
if (!empty($arrayfields['c.date_cloture']['checked'])) print_liste_field_titre($arrayfields['c.date_cloture']['label'], $_SERVER["PHP_SELF"], "c.date_cloture", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
if (!empty($arrayfields['c.date_cloture']['checked'])) print_liste_field_titre($arrayfields['c.date_cloture']['label'], $_SERVER["PHP_SELF"], "c.date_cloture", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
|
||||||
if (!empty($arrayfields['c.note_public']['checked'])) print_liste_field_titre($arrayfields['c.note_public']['label'], $_SERVER["PHP_SELF"], "c.note_public", "", $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.note_public']['checked'])) print_liste_field_titre($arrayfields['c.note_public']['label'], $_SERVER["PHP_SELF"], "c.note_public", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
if (!empty($arrayfields['c.note_private']['checked'])) print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, 'right ');
|
if (!empty($arrayfields['c.note_private']['checked'])) print_liste_field_titre($arrayfields['c.note_private']['label'], $_SERVER["PHP_SELF"], "c.note_private", "", $param, '', $sortfield, $sortorder, 'right ');
|
||||||
if (!empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
|
|
||||||
if (!empty($arrayfields['shippable']['checked'])) print_liste_field_titre($arrayfields['shippable']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
|
if (!empty($arrayfields['shippable']['checked'])) print_liste_field_titre($arrayfields['shippable']['label'], $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
if (!empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center ');
|
if (!empty($arrayfields['c.facture']['checked'])) print_liste_field_titre($arrayfields['c.facture']['label'], $_SERVER["PHP_SELF"], 'c.facture', '', $param, '', $sortfield, $sortorder, 'center ');
|
||||||
|
if (!empty($arrayfields['c.fk_statut']['checked'])) print_liste_field_titre($arrayfields['c.fk_statut']['label'], $_SERVER["PHP_SELF"], "c.fk_statut", "", $param, '', $sortfield, $sortorder, 'center ');
|
||||||
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', $param, '', $sortfield, $sortorder, 'maxwidthsearch center ');
|
||||||
print '</tr>'."\n";
|
print '</tr>'."\n";
|
||||||
|
|
||||||
@ -1218,13 +1218,6 @@ if ($resql)
|
|||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Status
|
|
||||||
if (!empty($arrayfields['c.fk_statut']['checked']))
|
|
||||||
{
|
|
||||||
print '<td class="nowrap right">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';
|
|
||||||
if (!$i) $totalarray['nbfield']++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Show shippable Icon (this creates subloops, so may be slow)
|
// Show shippable Icon (this creates subloops, so may be slow)
|
||||||
if (!empty($arrayfields['shippable']['checked']))
|
if (!empty($arrayfields['shippable']['checked']))
|
||||||
{
|
{
|
||||||
@ -1334,6 +1327,13 @@ if ($resql)
|
|||||||
if (!$i) $totalarray['nbfield']++;
|
if (!$i) $totalarray['nbfield']++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Status
|
||||||
|
if (!empty($arrayfields['c.fk_statut']['checked']))
|
||||||
|
{
|
||||||
|
print '<td class="nowrap center">'.$generic_commande->LibStatut($obj->fk_statut, $obj->billed, 5, 1).'</td>';
|
||||||
|
if (!$i) $totalarray['nbfield']++;
|
||||||
|
}
|
||||||
|
|
||||||
// Action column
|
// Action column
|
||||||
print '<td class="nowrap center">';
|
print '<td class="nowrap center">';
|
||||||
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
|
||||||
|
|||||||
@ -38,11 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
|
|||||||
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
$WIDTH = DolGraph::getDefaultGraphSizeForStats('width');
|
||||||
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
$HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
|
||||||
|
|
||||||
$mode = GETPOST("mode") ?GETPOST("mode") : 'customer';
|
$mode = GETPOSTISSET("mode") ? GETPOST("mode", 'aZ09') : 'customer';
|
||||||
if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden();
|
if ($mode == 'customer' && !$user->rights->commande->lire) accessforbidden();
|
||||||
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden();
|
if ($mode == 'supplier' && !$user->rights->fournisseur->commande->lire) accessforbidden();
|
||||||
|
|
||||||
$object_status = GETPOST('object_status');
|
$object_status = GETPOST('object_status', 'intcomma');
|
||||||
$typent_id = GETPOST('typent_id', 'int');
|
$typent_id = GETPOST('typent_id', 'int');
|
||||||
$categ_id = GETPOST('categ_id', 'categ_id');
|
$categ_id = GETPOST('categ_id', 'categ_id');
|
||||||
|
|
||||||
@ -302,7 +302,7 @@ if ($mode == 'customer')
|
|||||||
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
Commande::STATUS_CLOSED=>$langs->trans("StatusOrderDelivered"),
|
||||||
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled")
|
Commande::STATUS_CANCELED=>$langs->trans("StatusOrderCanceled")
|
||||||
);
|
);
|
||||||
print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'int'), -4);
|
print $form->selectarray('object_status', $liststatus, GETPOST('object_status', 'intcomma'), -4);
|
||||||
}
|
}
|
||||||
if ($mode == 'supplier')
|
if ($mode == 'supplier')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -225,17 +225,16 @@ if ((GETPOST('confirm_savestatement', 'alpha') || GETPOST('confirm_reconcile', '
|
|||||||
if ($num_releve)
|
if ($num_releve)
|
||||||
{
|
{
|
||||||
$bankline = new AccountLine($db);
|
$bankline = new AccountLine($db);
|
||||||
if (isset($_POST['rowid']) && is_array($_POST['rowid']))
|
|
||||||
{
|
$rowids = GETPOST('rowid', 'array');
|
||||||
foreach ($_POST['rowid'] as $row)
|
|
||||||
{
|
if (!empty($rowids) && is_array($rowids)) {
|
||||||
if ($row > 0)
|
foreach ($rowids as $row) {
|
||||||
{
|
if ($row > 0) {
|
||||||
$result = $bankline->fetch($row);
|
$result = $bankline->fetch($row);
|
||||||
$bankline->num_releve = $num_releve; //$_POST["num_releve"];
|
$bankline->num_releve = $num_releve; //$_POST["num_releve"];
|
||||||
$result = $bankline->update_conciliation($user, GETPOST("cat"), GETPOST('confirm_reconcile', 'alpha') ? 1 : 0); // If we confirm_reconcile, we set flag 'rappro' to 1.
|
$result = $bankline->update_conciliation($user, GETPOST("cat"), GETPOST('confirm_reconcile', 'alpha') ? 1 : 0); // If we confirm_reconcile, we set flag 'rappro' to 1.
|
||||||
if ($result < 0)
|
if ($result < 0) {
|
||||||
{
|
|
||||||
setEventMessages($bankline->error, $bankline->errors, 'errors');
|
setEventMessages($bankline->error, $bankline->errors, 'errors');
|
||||||
$error++;
|
$error++;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -346,7 +346,7 @@ if ($action == 'create')
|
|||||||
// Type
|
// Type
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formbank->selectTypeOfBankAccount(isset($_POST["type"]) ? $_POST["type"] : Account::TYPE_CURRENT, "type");
|
$formbank->selectTypeOfBankAccount(GETPOSTISSET("type") ? GETPOST("type") : Account::TYPE_CURRENT, "type");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
@ -354,7 +354,7 @@ if ($action == 'create')
|
|||||||
print '<td>';
|
print '<td>';
|
||||||
$selectedcode = $object->currency_code;
|
$selectedcode = $object->currency_code;
|
||||||
if (!$selectedcode) $selectedcode = $conf->currency;
|
if (!$selectedcode) $selectedcode = $conf->currency;
|
||||||
print $form->selectCurrency((isset($_POST["account_currency_code"]) ? $_POST["account_currency_code"] : $selectedcode), 'account_currency_code');
|
print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code');
|
||||||
//print $langs->trans("Currency".$conf->currency);
|
//print $langs->trans("Currency".$conf->currency);
|
||||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
|
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -367,9 +367,8 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Country
|
// Country
|
||||||
$selectedcode = '';
|
$selectedcode = '';
|
||||||
if (isset($_POST["account_country_id"]))
|
if (GETPOSTISSET("account_country_id")) {
|
||||||
{
|
$selectedcode = GETPOST("account_country_id") ? GETPOST("account_country_id") : $object->country_code;
|
||||||
$selectedcode = $_POST["account_country_id"] ? $_POST["account_country_id"] : $object->country_code;
|
|
||||||
} elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
|
} elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
|
||||||
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
||||||
|
|
||||||
@ -383,7 +382,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
print '<tr><td>'.$langs->trans('State').'</td><td>';
|
||||||
if ($selectedcode)
|
if ($selectedcode)
|
||||||
{
|
{
|
||||||
$formcompany->select_departement(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : '', $selectedcode, 'account_state_id');
|
$formcompany->select_departement(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : '', $selectedcode, 'account_state_id');
|
||||||
} else {
|
} else {
|
||||||
print $countrynotdefined;
|
print $countrynotdefined;
|
||||||
}
|
}
|
||||||
@ -408,7 +407,7 @@ if ($action == 'create')
|
|||||||
$arrayselected[] = $cat->id;
|
$arrayselected[] = $cat->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -818,16 +817,16 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(isset($_POST["ref"]) ?GETPOST("ref") : $object->ref).'"></td></tr>';
|
print '<td><input type="text" class="flat maxwidth200" name="ref" value="'.dol_escape_htmltag(GETPOSTISSET("ref") ? GETPOST("ref") : $object->ref).'"></td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td>';
|
||||||
print '<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(isset($_POST["label"]) ?GETPOST("label") : $object->label).'"></td></tr>';
|
print '<td><input type="text" class="flat minwidth300" name="label" value="'.dol_escape_htmltag(GETPOSTISSET("label") ? GETPOST("label") : $object->label).'"></td></tr>';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||||
print '<td class="maxwidth200onsmartphone">';
|
print '<td class="maxwidth200onsmartphone">';
|
||||||
$formbank->selectTypeOfBankAccount((isset($_POST["type"]) ? $_POST["type"] : $object->type), "type");
|
$formbank->selectTypeOfBankAccount((GETPOSTISSET("type") ? GETPOST("type") : $object->type), "type");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Currency
|
// Currency
|
||||||
@ -837,7 +836,7 @@ if ($action == 'create')
|
|||||||
print '<td class="maxwidth200onsmartphone">';
|
print '<td class="maxwidth200onsmartphone">';
|
||||||
$selectedcode = $object->currency_code;
|
$selectedcode = $object->currency_code;
|
||||||
if (!$selectedcode) $selectedcode = $conf->currency;
|
if (!$selectedcode) $selectedcode = $conf->currency;
|
||||||
print $form->selectCurrency((isset($_POST["account_currency_code"]) ? $_POST["account_currency_code"] : $selectedcode), 'account_currency_code');
|
print $form->selectCurrency((GETPOSTISSET("account_currency_code") ? GETPOST("account_currency_code") : $selectedcode), 'account_currency_code');
|
||||||
//print $langs->trans("Currency".$conf->currency);
|
//print $langs->trans("Currency".$conf->currency);
|
||||||
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
|
//print '<input type="hidden" name="account_currency_code" value="'.$conf->currency.'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
@ -845,13 +844,13 @@ if ($action == 'create')
|
|||||||
// Status
|
// Status
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
|
||||||
print '<td class="maxwidth200onsmartphone">';
|
print '<td class="maxwidth200onsmartphone">';
|
||||||
print $form->selectarray("clos", $object->status, (isset($_POST["clos"]) ? $_POST["clos"] : $object->clos));
|
print $form->selectarray("clos", $object->status, (GETPOSTISSET("clos") ? GETPOST("clos") : $object->clos));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
$object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
|
$object->country_id = $object->country_id ? $object->country_id : $mysoc->country_id;
|
||||||
$selectedcode = $object->country_code;
|
$selectedcode = $object->country_code;
|
||||||
if (isset($_POST["account_country_id"])) $selectedcode = $_POST["account_country_id"];
|
if (GETPOSTISSET("account_country_id")) $selectedcode = GETPOST("account_country_id");
|
||||||
elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
|
elseif (empty($selectedcode)) $selectedcode = $mysoc->country_code;
|
||||||
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
$object->country_code = getCountry($selectedcode, 2); // Force country code on account to have following field on bank fields matching country rules
|
||||||
|
|
||||||
@ -865,7 +864,7 @@ if ($action == 'create')
|
|||||||
print '<tr><td>'.$langs->trans('State').'</td><td class="maxwidth200onsmartphone">';
|
print '<tr><td>'.$langs->trans('State').'</td><td class="maxwidth200onsmartphone">';
|
||||||
if ($selectedcode)
|
if ($selectedcode)
|
||||||
{
|
{
|
||||||
print $formcompany->select_state(isset($_POST["account_state_id"]) ? $_POST["account_state_id"] : $object->state_id, $selectedcode, 'account_state_id');
|
print $formcompany->select_state(GETPOSTISSET("account_state_id") ? GETPOST("account_state_id") : $object->state_id, $selectedcode, 'account_state_id');
|
||||||
} else {
|
} else {
|
||||||
print $countrynotdefined;
|
print $countrynotdefined;
|
||||||
}
|
}
|
||||||
@ -882,14 +881,14 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Balance
|
// Balance
|
||||||
print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
print '<tr><td>'.$langs->trans("BalanceMinimalAllowed").'</td>';
|
||||||
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(isset($_POST["account_min_allowed"]) ?GETPOST("account_min_allowed") : $object->min_allowed).'"></td></tr>';
|
print '<td><input size="12" type="text" class="flat" name="account_min_allowed" value="'.(GETPOSTISSET("account_min_allowed") ? GETPOST("account_min_allowed") : $object->min_allowed).'"></td></tr>';
|
||||||
|
|
||||||
print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
|
print '<tr><td>'.$langs->trans("BalanceMinimalDesired").'</td>';
|
||||||
print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(isset($_POST["account_min_desired"]) ?GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
|
print '<td><input size="12" type="text" class="flat" name="account_min_desired" value="'.(GETPOSTISSET("account_min_desired") ? GETPOST("account_min_desired") : $object->min_desired).'"></td></tr>';
|
||||||
|
|
||||||
// Web
|
// Web
|
||||||
print '<tr><td>'.$langs->trans("Web").'</td>';
|
print '<tr><td>'.$langs->trans("Web").'</td>';
|
||||||
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(isset($_POST["url"]) ?GETPOST("url") : $object->url).'">';
|
print '<td><input class="maxwidth200onsmartphone" type="text" class="flat" name="url" value="'.(GETPOSTISSET("url") ? GETPOST("url") : $object->url).'">';
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Tags-Categories
|
// Tags-Categories
|
||||||
@ -905,7 +904,7 @@ if ($action == 'create')
|
|||||||
$arrayselected[] = $cat->id;
|
$arrayselected[] = $cat->id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
print $form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, '', 0, '100%');
|
print img_picto('', 'category').$form->multiselectarray('categories', $cate_arbo, $arrayselected, '', 0, 'quatrevingtpercent widthcentpercentminusx', 0, 0);
|
||||||
print "</td></tr>";
|
print "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -771,11 +771,11 @@ print '<table class="notopnoleftnoright" width="100%">';
|
|||||||
print '<tr><td class="right">'.$morehtml.' ';
|
print '<tr><td class="right">'.$morehtml.' ';
|
||||||
if ($mode == 'showalltime')
|
if ($mode == 'showalltime')
|
||||||
{
|
{
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$account.'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?account='.$account.(GETPOST("option") != 'all' ? '' : '&option=all').'">';
|
||||||
print $langs->trans("GoBack");
|
print $langs->trans("GoBack");
|
||||||
print '</a>';
|
print '</a>';
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=showalltime&account='.$account.'">';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?mode=showalltime&account='.$account.(GETPOST("option") != 'all' ? '' : '&option=all').'">';
|
||||||
print $langs->trans("ShowAllTimeBalance");
|
print $langs->trans("ShowAllTimeBalance");
|
||||||
print '</a>';
|
print '</a>';
|
||||||
}
|
}
|
||||||
@ -793,7 +793,7 @@ if ($mode == 'standard')
|
|||||||
if ($nextmonth > 12) { $nextmonth = 1; $nextyear++; }
|
if ($nextmonth > 12) { $nextmonth = 1; $nextyear++; }
|
||||||
|
|
||||||
// For month
|
// For month
|
||||||
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
|
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$prevyear."&month=".$prevmonth."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Month")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".$nextyear."&month=".$nextmonth."'>".img_next('', 'class="valignbottom"')."</a>";
|
||||||
print '<div class="right clearboth">'.$link.'</div>';
|
print '<div class="right clearboth">'.$link.'</div>';
|
||||||
|
|
||||||
print '<div class="center clearboth margintoponly">';
|
print '<div class="center clearboth margintoponly">';
|
||||||
@ -807,7 +807,7 @@ if ($mode == 'standard')
|
|||||||
|
|
||||||
// For year
|
// For year
|
||||||
$prevyear = $year - 1; $nextyear = $year + 1;
|
$prevyear = $year - 1; $nextyear = $year + 1;
|
||||||
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
|
$link = "<a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($prevyear)."'>".img_previous('', 'class="valignbottom"')."</a> ".$langs->trans("Year")." <a href='".$_SERVER["PHP_SELF"]."?account=".$account.(GETPOST("option") != 'all' ? '' : '&option=all')."&year=".($nextyear)."'>".img_next('', 'class="valignbottom"')."</a>";
|
||||||
|
|
||||||
print '<div class="right clearboth margintoponly">'.$link.'</div>';
|
print '<div class="right clearboth margintoponly">'.$link.'</div>';
|
||||||
|
|
||||||
|
|||||||
@ -139,17 +139,17 @@ if ($user->rights->banque->modifier && $action == "update")
|
|||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."bank";
|
||||||
$sql .= " SET ";
|
$sql .= " SET ";
|
||||||
// Always opened
|
// Always opened
|
||||||
if (isset($_POST['value'])) $sql .= " fk_type='".$db->escape(GETPOST('value'))."',";
|
if (GETPOSTISSET('value')) $sql .= " fk_type='".$db->escape(GETPOST('value'))."',";
|
||||||
if (isset($_POST['num_chq'])) $sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',";
|
if (GETPOSTISSET('num_chq')) $sql .= " num_chq='".$db->escape(GETPOST("num_chq"))."',";
|
||||||
if (isset($_POST['banque'])) $sql .= " banque='".$db->escape(GETPOST("banque"))."',";
|
if (GETPOSTISSET('banque')) $sql .= " banque='".$db->escape(GETPOST("banque"))."',";
|
||||||
if (isset($_POST['emetteur'])) $sql .= " emetteur='".$db->escape(GETPOST("emetteur"))."',";
|
if (GETPOSTISSET('emetteur')) $sql .= " emetteur='".$db->escape(GETPOST("emetteur"))."',";
|
||||||
// Blocked when conciliated
|
// Blocked when conciliated
|
||||||
if (!$acline->rappro)
|
if (!$acline->rappro)
|
||||||
{
|
{
|
||||||
if (isset($_POST['label'])) $sql .= " label = '".$db->escape(GETPOST("label"))."',";
|
if (GETPOSTISSET('label')) $sql .= " label = '".$db->escape(GETPOST("label"))."',";
|
||||||
if (isset($_POST['amount'])) $sql .= " amount= '".$db->escape($amount)."',";
|
if (GETPOSTISSET('amount')) $sql .= " amount= '".$db->escape($amount)."',";
|
||||||
if (isset($_POST['dateomonth'])) $sql .= " dateo = '".$db->idate($dateop)."',";
|
if (GETPOSTISSET('dateomonth')) $sql .= " dateo = '".$db->idate($dateop)."',";
|
||||||
if (isset($_POST['datevmonth'])) $sql .= " datev = '".$db->idate($dateval)."',";
|
if (GETPOSTISSET('datevmonth')) $sql .= " datev = '".$db->idate($dateval)."',";
|
||||||
}
|
}
|
||||||
$sql .= " fk_account = ".$actarget->id;
|
$sql .= " fk_account = ".$actarget->id;
|
||||||
$sql .= " WHERE rowid = ".$acline->id;
|
$sql .= " WHERE rowid = ".$acline->id;
|
||||||
@ -613,7 +613,7 @@ if ($result)
|
|||||||
if ($user->rights->banque->consolidate)
|
if ($user->rights->banque->consolidate)
|
||||||
{
|
{
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="checkbox" name="reconciled" class="flat" '.(isset($_POST["reconciled"]) ? ($_POST["reconciled"] ? ' checked="checked"' : '') : ($objp->rappro ? ' checked="checked"' : '')).'">';
|
print '<input type="checkbox" name="reconciled" class="flat" '.(GETPOSTISSET("reconciled") ? (GETPOST("reconciled") ? ' checked="checked"' : '') : ($objp->rappro ? ' checked="checked"' : '')).'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
} else {
|
} else {
|
||||||
print '<td>'.yn($objp->rappro).'</td>';
|
print '<td>'.yn($objp->rappro).'</td>';
|
||||||
|
|||||||
@ -43,12 +43,12 @@ class Deplacement extends CommonObject
|
|||||||
public $table_element = 'deplacement';
|
public $table_element = 'deplacement';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Name of subtable line
|
* @var string Name of subtable line
|
||||||
*/
|
*/
|
||||||
public $table_element_line = '';
|
public $table_element_line = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var int Field with ID of parent key if this field has a parent
|
* @var string Fieldname with ID of parent key if this field has a parent
|
||||||
*/
|
*/
|
||||||
public $fk_element = '';
|
public $fk_element = '';
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user