Merge branch 'develop' into develop#3
This commit is contained in:
commit
f21a4e8aed
@ -39,7 +39,7 @@ TCPDI 1.0.0 LGPL-3+ / Apache 2.0 Yes
|
||||
|
||||
JS libraries:
|
||||
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 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
|
||||
|
||||
38
ChangeLog
38
ChangeLog
@ -31,7 +31,7 @@ NEW: add column payment term into list of supplier invoices
|
||||
NEW: add column quantity in product margin page
|
||||
NEW: add column vat rate in page to define accounting account on product/service
|
||||
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 EORI No. as ProfID5
|
||||
NEW: add export for various payments
|
||||
@ -181,10 +181,9 @@ NEW: #15065 Add option to put the product label in bold in the PDF templates if
|
||||
For developers:
|
||||
---------------
|
||||
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: 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: fill ECM src object fields in dol_add_file_process
|
||||
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: Can use dynamic code into the 'enabled' property of DAO fields
|
||||
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: field ref_ext in llx_commandedet
|
||||
NEW: fields ref_ext for Attributes and Combinations
|
||||
@ -213,10 +208,17 @@ NEW: Triggers Attributes and Attributes values
|
||||
NEW: added incoterms data into the substitution array
|
||||
NEW: add send context for ticket
|
||||
NEW: add a message in error_log after detection of SQL or script injection
|
||||
NEW: add __TYPE__ substitution key
|
||||
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: Graphics can be horizontal bars.
|
||||
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
|
||||
@ -243,7 +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 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().
|
||||
|
||||
* 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 *****
|
||||
@ -380,8 +382,8 @@ FIX: SQL Problem in customer invoice list
|
||||
FIX: SQL Problem in social contribution list
|
||||
FIX: SQL Problem in supplier invoice list
|
||||
FIX: SQL syntax error when editing extrafields
|
||||
FIX: Sql type
|
||||
FIX: takepos 12 hook
|
||||
FIX: SQL type
|
||||
FIX: TakePOS 12 hook
|
||||
FIX: Update form erased extrafields that were hidden
|
||||
FIX: Update of extrafields date
|
||||
FIX: Update of extrafiels on draft object
|
||||
@ -395,7 +397,7 @@ For users:
|
||||
|
||||
NEW: Module MO (Manufacturing Order) is available as stable module.
|
||||
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: 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
|
||||
@ -406,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: Add accountancy code of thirdparty in contact and supplier export
|
||||
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 parameter to group same products in TakePOS
|
||||
NEW: add a parameter to sort product by label in TakePOS
|
||||
NEW: Add a profil to import contact categories
|
||||
NEW: Add company extrafields into order export
|
||||
NEW: add a profil to import contact categories
|
||||
NEW: add company extrafields into order export
|
||||
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 csv separator setup in module admin
|
||||
NEW: add dedicated substitutions keys for extrafields of type date and datetime
|
||||
NEW: add default warehouse for dispatch
|
||||
NEW: Add due date in feature "Export accounting documents"
|
||||
NEW: Add duration information for fichinter
|
||||
NEW: add due date in feature "Export accounting documents"
|
||||
NEW: add duration information for fichinter
|
||||
NEW: Start support of Dark theme into ELDY theme
|
||||
NEW: Add field author public alias for blog post on website module
|
||||
NEW: Add "finished" field on product list
|
||||
|
||||
@ -12,8 +12,7 @@ This file contains some policies about the security reports on Dolibarr ERP CRM
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
To report a vulnerability, please 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.
|
||||
To report a vulnerability, please use GitHub security advisory (alternatively send an email to security@dolibarr.org)
|
||||
|
||||
|
||||
## Hunting vulnerabilities on Dolibarr
|
||||
|
||||
@ -581,23 +581,36 @@ if ($nboftargetok) {
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/workstation*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/oblyon*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/themes/allscreen*`;
|
||||
$ret=`rm -f $BUILDROOT/$PROJECT/htdocs/theme/common/octicons/LICENSE`;
|
||||
|
||||
# Removed other test files
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/public/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 -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`;
|
||||
|
||||
# Removed files installed by the awful composer
|
||||
$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/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 -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/select2/release.sh`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/mike42/escpos-php/doc`;
|
||||
$ret=`rm -fr $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/example`;
|
||||
$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/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/samples`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/parsedown/LICENSE.txt`;
|
||||
@ -612,21 +625,17 @@ if ($nboftargetok) {
|
||||
$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/LICENSE`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tcpdf/fonts/dejavu-fonts-ttf-*`;
|
||||
$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 -f $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/examples`;
|
||||
$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/ae_fonts_*`;
|
||||
$ret=`rm -fr $BUILDROOT/$PROJECT/htdocs/includes/tecnickcom/tcpdf/fonts/utils`;
|
||||
$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/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/theme/common/octicons/LICENSE`;
|
||||
}
|
||||
|
||||
# Build package for each target
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
"nnnick/chartjs" : "^2.9",
|
||||
"stripe/stripe-php" : "6.43.1",
|
||||
"maximebf/debugbar" : "1.15.1",
|
||||
"symfony/var-dumper": "3"
|
||||
"symfony/var-dumper" : "3"
|
||||
},
|
||||
"require-dev" : {
|
||||
"php-parallel-lint/php-parallel-lint" : "^0",
|
||||
|
||||
263
composer.lock
generated
263
composer.lock
generated
@ -6,6 +6,53 @@
|
||||
],
|
||||
"content-hash": "1dbd2d05cc0836acfca5988f29005cf2",
|
||||
"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",
|
||||
"version": "4.12.1",
|
||||
@ -217,16 +264,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nnnick/chartjs",
|
||||
"version": "v2.9.3",
|
||||
"version": "v2.9.4",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/chartjs/Chart.js.git",
|
||||
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2"
|
||||
"reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/06f73dc3590084b2c464bf08189c7aee2b6b92d2",
|
||||
"reference": "06f73dc3590084b2c464bf08189c7aee2b6b92d2",
|
||||
"url": "https://api.github.com/repos/chartjs/Chart.js/zipball/9bd4cf82fda9f50a5fb50b72843e06ab88124278",
|
||||
"reference": "9bd4cf82fda9f50a5fb50b72843e06ab88124278",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -254,7 +301,11 @@
|
||||
"JS",
|
||||
"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",
|
||||
@ -314,53 +365,6 @@
|
||||
"abandoned": "phpoffice/phpspreadsheet",
|
||||
"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",
|
||||
"version": "3.0.0-RC6",
|
||||
@ -2037,159 +2041,6 @@
|
||||
],
|
||||
"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",
|
||||
"version": "v3.4.32",
|
||||
@ -2312,5 +2163,5 @@
|
||||
"ext-curl": "*"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "1.1.0"
|
||||
"plugin-api-version": "2.0.0"
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2013-2017 Florian Henry <florian.henry@open-concept.pro>
|
||||
* Copyright (C) 2013-2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -128,8 +128,7 @@ if ($action == "confirm_update") {
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
if ($mode != '_tmp')
|
||||
{
|
||||
if ($mode != '_tmp') {
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
}
|
||||
|
||||
@ -165,14 +164,14 @@ if ($action == "confirm_update") {
|
||||
$object->label_operation = $label_operation;
|
||||
$object->debit = $debit;
|
||||
$object->credit = $credit;
|
||||
$object->doc_date = GETPOST('doc_date', 'alpha');
|
||||
$object->doc_type = GETPOST('doc_type', 'alpha');
|
||||
$object->doc_date = (string) GETPOST('doc_date', 'alpha');
|
||||
$object->doc_type = (string) GETPOST('doc_type', 'alpha');
|
||||
$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->journal_label = $journal_label;
|
||||
$object->fk_doc = (int) GETPOST('fk_doc', 'int');
|
||||
$object->fk_docdet = (int) GETPOST('fk_docdet', 'int');
|
||||
$object->fk_doc = GETPOSTINT('fk_doc');
|
||||
$object->fk_docdet = GETPOSTINT('fk_docdet');
|
||||
|
||||
if (floatval($debit) != 0.0) {
|
||||
$object->montant = $debit; // deprecated
|
||||
@ -190,8 +189,7 @@ if ($action == "confirm_update") {
|
||||
if ($result < 0) {
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
} else {
|
||||
if ($mode != '_tmp')
|
||||
{
|
||||
if ($mode != '_tmp') {
|
||||
setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
|
||||
}
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ class AccountingJournal extends CommonObject
|
||||
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 = '';
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* 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 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 Eric Seigne <eric.seigne@cap-rel.fr>
|
||||
*
|
||||
@ -73,15 +73,18 @@ $date_endmonth = GETPOST('date_endmonth', 'int');
|
||||
$date_endday = GETPOST('date_endday', 'int');
|
||||
$date_endyear = GETPOST('date_endyear', 'int');
|
||||
$in_bookkeeping = GETPOST('in_bookkeeping', 'aZ09');
|
||||
if ($in_bookkeeping == '') $in_bookkeeping = 'notyet';
|
||||
if ($in_bookkeeping == '') {
|
||||
$in_bookkeeping = 'notyet';
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
// Security check
|
||||
if ($user->socid > 0 && empty($id_journal))
|
||||
if ($user->socid > 0 && empty($id_journal)) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
@ -93,8 +96,7 @@ $error = 0;
|
||||
$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);
|
||||
|
||||
if (empty($date_startmonth) || empty($date_endmonth))
|
||||
{
|
||||
if (empty($date_startmonth) || empty($date_endmonth)) {
|
||||
// Period by default on transfer
|
||||
$dates = getDefaultDatesForTransfer();
|
||||
$date_start = $dates['date_start'];
|
||||
@ -103,8 +105,7 @@ if (empty($date_startmonth) || empty($date_endmonth))
|
||||
$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_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 .= " 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
|
||||
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)."'";
|
||||
}
|
||||
// Define begin binding date
|
||||
if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
|
||||
$sql .= " AND b.dateo >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
|
||||
}
|
||||
// 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') )";
|
||||
}
|
||||
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 .= " ORDER BY b.datev";
|
||||
@ -177,9 +177,9 @@ if ($result) {
|
||||
//print $sql;
|
||||
|
||||
// Variables
|
||||
$account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_customer = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_employee = (!empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_supplier = (($conf->global->ACCOUNTING_ACCOUNT_SUPPLIER != "") ? $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_customer = (($conf->global->ACCOUNTING_ACCOUNT_CUSTOMER != "") ? $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_employee = (!empty($conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT) ? $conf->global->SALARIES_ACCOUNTING_ACCOUNT_PAYMENT : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_pay_vat = (!empty($conf->global->ACCOUNTING_VAT_PAY_ACCOUNT) ? $conf->global->ACCOUNTING_VAT_PAY_ACCOUNT : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_pay_donation = (!empty($conf->global->DONATION_ACCOUNTINGACCOUNT) ? $conf->global->DONATION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
|
||||
$account_pay_subscription = (!empty($conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT) ? $conf->global->ADHERENT_SUBSCRIPTION_ACCOUNTINGACCOUNT : 'NotDefined'); // NotDefined is a reserved word
|
||||
@ -198,23 +198,28 @@ if ($result) {
|
||||
// one line for bank record = tabbq
|
||||
// one line for thirdparty record = tabtp
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$lineisapurchase = -1;
|
||||
$lineisasale = -1;
|
||||
// Old method to detect if it's a sale or purchase
|
||||
if ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') $lineisapurchase = 1;
|
||||
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') $lineisasale = 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 ($obj->label == '(SupplierInvoicePayment)' || $obj->label == '(SupplierInvoicePaymentBack)') {
|
||||
$lineisapurchase = 1;
|
||||
}
|
||||
if ($lineisasale < 0)
|
||||
{
|
||||
if ($obj->typeop_payment == 'payment') $lineisasale = 1;
|
||||
if ($obj->label == '(CustomerInvoicePayment)' || $obj->label == '(CustomerInvoicePaymentBack)') {
|
||||
$lineisasale = 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;
|
||||
}
|
||||
}
|
||||
//var_dump($obj->type_payment); var_dump($obj->type_payment_supplier);
|
||||
//var_dump($lineisapurchase); //var_dump($lineisasale);
|
||||
@ -224,28 +229,30 @@ if ($result) {
|
||||
|
||||
// Set accountancy code for thirdparty (example: '411CU...' or '411' if no subledger account defined on customer)
|
||||
$compta_soc = 'NotDefined';
|
||||
if ($lineisapurchase > 0)
|
||||
if ($lineisapurchase > 0) {
|
||||
$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);
|
||||
}
|
||||
|
||||
$tabcompany[$obj->rowid] = array(
|
||||
'id' => $obj->socid,
|
||||
'name' => $obj->name,
|
||||
'code_compta' => $compta_soc,
|
||||
'email' => $obj->email
|
||||
'id' => $obj->socid,
|
||||
'name' => $obj->name,
|
||||
'code_compta' => $compta_soc,
|
||||
'email' => $obj->email
|
||||
);
|
||||
|
||||
// Set accountancy code for user
|
||||
$compta_user = (!empty($obj->accountancy_code) ? $obj->accountancy_code : '');
|
||||
|
||||
$tabuser[$obj->rowid] = array(
|
||||
'id' => $obj->userid,
|
||||
'name' => dolGetFirstLastname($obj->firstname, $obj->lastname),
|
||||
'lastname' => $obj->lastname,
|
||||
'firstname' => $obj->firstname,
|
||||
'email' => $obj->useremail,
|
||||
'accountancy_code' => $compta_user
|
||||
'id' => $obj->userid,
|
||||
'name' => dolGetFirstLastname($obj->firstname, $obj->lastname),
|
||||
'lastname' => $obj->lastname,
|
||||
'firstname' => $obj->firstname,
|
||||
'email' => $obj->useremail,
|
||||
'accountancy_code' => $compta_user
|
||||
);
|
||||
|
||||
// Variable bookkeeping ($obj->rowid is Bank Id)
|
||||
@ -264,10 +271,6 @@ if ($result) {
|
||||
// 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'=> )
|
||||
|
||||
//var_dump($i);
|
||||
//var_dump($tabpay);
|
||||
//var_dump($tabcompany);
|
||||
|
||||
// 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.
|
||||
$tabtype[$obj->rowid] = 'unknown';
|
||||
@ -277,17 +280,14 @@ if ($result) {
|
||||
if (is_array($links) && count($links) > 0) {
|
||||
// Now loop on each link of record in bank.
|
||||
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
|
||||
|
||||
// We save tabtype for a future use, to remember what kind of payment it is
|
||||
$tabpay[$obj->rowid]['type'] = $links[$key]['type'];
|
||||
$tabtype[$obj->rowid] = $links[$key]['type'];
|
||||
} elseif (in_array($links[$key]['type'], array('company', 'user')))
|
||||
{
|
||||
if ($tabpay[$obj->rowid]['type'] == 'unknown')
|
||||
{
|
||||
} elseif (in_array($links[$key]['type'], array('company', 'user'))) {
|
||||
if ($tabpay[$obj->rowid]['type'] == 'unknown') {
|
||||
// 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.
|
||||
}
|
||||
@ -312,16 +312,23 @@ if ($result) {
|
||||
$societestatic->name = $links[$key]['label'];
|
||||
$societestatic->email = $tabcompany[$obj->rowid]['email'];
|
||||
$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') {
|
||||
$userstatic->id = $links[$key]['url_id'];
|
||||
$userstatic->name = $links[$key]['label'];
|
||||
$userstatic->email = $tabuser[$obj->rowid]['email'];
|
||||
$userstatic->firstname = $tabuser[$obj->rowid]['firstname'];
|
||||
$userstatic->lastname = $tabuser[$obj->rowid]['lastname'];
|
||||
if ($userstatic->id > 0) $tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
||||
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;
|
||||
if ($userstatic->id > 0) {
|
||||
$tabpay[$obj->rowid]["soclib"] = $userstatic->getNomUrl(1, '', 30);
|
||||
} 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') {
|
||||
$chargestatic->id = $links[$key]['url_id'];
|
||||
$chargestatic->ref = $links[$key]['url_id'];
|
||||
@ -329,8 +336,9 @@ if ($result) {
|
||||
$tabpay[$obj->rowid]["lib"] .= ' '.$chargestatic->getNomUrl(2);
|
||||
$reg = array();
|
||||
if (preg_match('/^\((.*)\)$/i', $links[$key]['label'], $reg)) {
|
||||
if ($reg[1] == 'socialcontribution')
|
||||
if ($reg[1] == 'socialcontribution') {
|
||||
$reg[1] = 'SocialContribution';
|
||||
}
|
||||
$chargestatic->label = $langs->trans($reg[1]);
|
||||
} else {
|
||||
$chargestatic->label = $links[$key]['label'];
|
||||
@ -430,20 +438,17 @@ if ($result) {
|
||||
|
||||
// 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'.
|
||||
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) {
|
||||
if ($links[$key]['type'] == 'payment') {
|
||||
// Get thirdparty
|
||||
$tmppayment->fetch($links[$key]['url_id']);
|
||||
$arrayofamounts = $tmppayment->getAmountsArray();
|
||||
if (is_array($arrayofamounts)) {
|
||||
foreach ($arrayofamounts as $invoiceid => $amount)
|
||||
{
|
||||
foreach ($arrayofamounts as $invoiceid => $amount) {
|
||||
$tmpinvoice->fetch($invoiceid);
|
||||
$tmpinvoice->fetch_thirdparty();
|
||||
if ($tmpinvoice->thirdparty->code_compta)
|
||||
{
|
||||
if ($tmpinvoice->thirdparty->code_compta) {
|
||||
$tabtp[$obj->rowid][$tmpinvoice->thirdparty->code_compta] += $amount;
|
||||
}
|
||||
}
|
||||
@ -453,7 +458,9 @@ if ($result) {
|
||||
}
|
||||
|
||||
// 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
|
||||
/*if ($action == 'writebookkeeping') // Make test now in such a case
|
||||
@ -494,8 +501,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
$now = dol_now();
|
||||
|
||||
$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');
|
||||
|
||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||
@ -513,17 +519,18 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
var_dump($tabbq);exit;*/
|
||||
|
||||
// Bank
|
||||
if (!$errorforline && is_array($tabbq[$key]))
|
||||
{
|
||||
if (!$errorforline && is_array($tabbq[$key])) {
|
||||
// Line into bank account
|
||||
foreach ($tabbq[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
{
|
||||
foreach ($tabbq[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
$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']);
|
||||
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->doc_date = $val["date"];
|
||||
@ -556,8 +563,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
@ -572,18 +578,16 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
}
|
||||
|
||||
// Third party
|
||||
if (!$errorforline)
|
||||
{
|
||||
if (is_array($tabtp[$key]))
|
||||
{
|
||||
if (!$errorforline) {
|
||||
if (is_array($tabtp[$key])) {
|
||||
// Line into thirdparty account
|
||||
foreach ($tabtp[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||
if ($tabtype[$key] == 'banktransfert')
|
||||
{
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||
}
|
||||
if ($tabtype[$key] == 'banktransfert') {
|
||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||
} else {
|
||||
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
||||
@ -683,8 +687,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
$accountingaccount->fetch(null, $k, true);
|
||||
$bookkeeping->label_compte = $accountingaccount->label;
|
||||
} 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
|
||||
$bookkeeping->subledger_account = '';
|
||||
$bookkeeping->subledger_label = '';
|
||||
@ -702,8 +705,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
|
||||
$result = $bookkeeping->create($user);
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
@ -717,10 +719,11 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
}
|
||||
} else { // If thirdparty unknown, output the waiting account
|
||||
foreach ($tabbq[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
if ($mt) {
|
||||
$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');
|
||||
|
||||
$bookkeeping = new BookKeeping($db);
|
||||
@ -747,8 +750,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
$result = $bookkeeping->create($user);
|
||||
|
||||
if ($result < 0) {
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') // Already exists
|
||||
{
|
||||
if ($bookkeeping->error == 'BookkeepingRecordAlreadyExists') { // Already exists
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages('Transaction for ('.$bookkeeping->doc_type.', '.$bookkeeping->fk_doc.', '.$bookkeeping->fk_docdet.') were already recorded', null, 'warnings');
|
||||
@ -763,23 +765,20 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
}
|
||||
}
|
||||
|
||||
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))
|
||||
{
|
||||
if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) {
|
||||
$error++;
|
||||
$errorforline++;
|
||||
setEventMessages('Try to insert a non balanced transaction in book for '.$ref.'. Canceled. Surely a bug.', null, 'errors');
|
||||
}
|
||||
|
||||
if (!$errorforline)
|
||||
{
|
||||
if (!$errorforline) {
|
||||
$db->commit();
|
||||
} else {
|
||||
//print 'KO for line '.$key.' '.$error.'<br>';
|
||||
$db->rollback();
|
||||
|
||||
$MAXNBERRORS = 5;
|
||||
if ($error >= $MAXNBERRORS)
|
||||
{
|
||||
if ($error >= $MAXNBERRORS) {
|
||||
setEventMessages($langs->trans("ErrorTooManyErrorsProcessStopped").' (>'.$MAXNBERRORS.')', null, 'errors');
|
||||
break; // Break in the foreach
|
||||
}
|
||||
@ -788,8 +787,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
|
||||
if (empty($error) && count($tabpay) > 0) {
|
||||
setEventMessages($langs->trans("GeneralLedgerIsWritten"), null, 'mesgs');
|
||||
} elseif (count($tabpay) == $error)
|
||||
{
|
||||
} elseif (count($tabpay) == $error) {
|
||||
setEventMessages($langs->trans("NoNewRecordSaved"), null, 'warnings');
|
||||
} else {
|
||||
setEventMessages($langs->trans("GeneralLedgerSomeRecordWasNotRecorded"), null, 'warnings');
|
||||
@ -798,8 +796,7 @@ if (!$error && $action == 'writebookkeeping') {
|
||||
$action = '';
|
||||
|
||||
// Must reload data, so we make a redirect
|
||||
if (count($tabpay) != $error)
|
||||
{
|
||||
if (count($tabpay) != $error) {
|
||||
$param = 'id_journal='.$id_journal;
|
||||
$param .= '&date_startday='.$date_startday;
|
||||
$param .= '&date_startmonth='.$date_startmonth;
|
||||
@ -837,20 +834,22 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
print '"'.$langs->transnoentitiesnoconv("Note").'"'.$sep;
|
||||
print "\n";
|
||||
|
||||
foreach ($tabpay as $key => $val)
|
||||
{
|
||||
foreach ($tabpay as $key => $val) {
|
||||
$date = dol_print_date($db->jdate($val["date"]), 'day');
|
||||
|
||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||
|
||||
// Bank
|
||||
foreach ($tabbq[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
if ($mt) {
|
||||
$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']);
|
||||
if (!empty($val['soclib'])) $reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||
if (!empty($val['soclib'])) {
|
||||
$reflabel .= " - ".dol_string_nohtmltag($val['soclib']);
|
||||
}
|
||||
|
||||
print '"'.$key.'"'.$sep;
|
||||
print '"'.$date.'"'.$sep;
|
||||
@ -870,12 +869,12 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
// Third party
|
||||
if (is_array($tabtp[$key])) {
|
||||
foreach ($tabtp[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) $reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||
if ($tabtype[$key] == 'banktransfert')
|
||||
{
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= dol_string_nohtmltag($val['lib']).($val['soclib'] ? " - " : "");
|
||||
}
|
||||
if ($tabtype[$key] == 'banktransfert') {
|
||||
$reflabel .= dol_string_nohtmltag($langs->transnoentitiesnoconv('TransitionalAccount').' '.$account_transfer);
|
||||
} else {
|
||||
$reflabel .= dol_string_nohtmltag($val['soclib']);
|
||||
@ -907,10 +906,11 @@ if ($action == 'exportcsv') { // ISO and not UTF8 !
|
||||
}
|
||||
} else { // If thirdparty unkown, output the waiting account
|
||||
foreach ($tabbq[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
if ($mt) {
|
||||
$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');
|
||||
|
||||
print '"'.$key.'"'.$sep;
|
||||
@ -967,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)
|
||||
$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);
|
||||
if ($resql)
|
||||
{
|
||||
if ($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 ' : '.$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>';
|
||||
}
|
||||
} else dol_print_error($db);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
|
||||
// Button to write into Ledger
|
||||
@ -990,14 +992,19 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
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'
|
||||
|| ($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").'" />';
|
||||
} else {
|
||||
if ($in_bookkeeping == 'notyet') 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>';
|
||||
if ($in_bookkeeping == 'notyet') {
|
||||
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>';
|
||||
@ -1040,21 +1047,22 @@ if (empty($action) || $action == 'view') {
|
||||
|
||||
$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');
|
||||
|
||||
$ref = getSourceDocRef($val, $tabtype[$key]);
|
||||
|
||||
// Bank
|
||||
foreach ($tabbq[$key] as $k => $mt)
|
||||
{
|
||||
if ($mt)
|
||||
{
|
||||
foreach ($tabbq[$key] as $k => $mt) {
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) $reflabel .= $val['lib']." - ";
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= $val['lib']." - ";
|
||||
}
|
||||
$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]);
|
||||
print '<!-- Bank bank.rowid='.$key.' type='.$tabpay[$key]['type'].' ref='.$tabpay[$key]['ref'].'-->';
|
||||
@ -1064,10 +1072,11 @@ if (empty($action) || $action == 'view') {
|
||||
// Ledger account
|
||||
print "<td>";
|
||||
$accounttoshow = length_accountg($k);
|
||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||
{
|
||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
||||
print '<span class="error">'.$langs->trans("BankAccountNotDefined").'</span>';
|
||||
} else print $accounttoshow;
|
||||
} else {
|
||||
print $accounttoshow;
|
||||
}
|
||||
print "</td>";
|
||||
// Subledger account
|
||||
print "<td>";
|
||||
@ -1091,12 +1100,12 @@ if (empty($action) || $action == 'view') {
|
||||
// Third party
|
||||
if (is_array($tabtp[$key])) {
|
||||
foreach ($tabtp[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) $reflabel .= $val['lib'].($val['soclib'] ? " - " : "");
|
||||
if ($tabtype[$key] == 'banktransfert')
|
||||
{
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= $val['lib'].($val['soclib'] ? " - " : "");
|
||||
}
|
||||
if ($tabtype[$key] == 'banktransfert') {
|
||||
$reflabel .= $langs->trans('TransitionalAccount').' '.$account_transfer;
|
||||
} else {
|
||||
$reflabel .= $val['soclib'];
|
||||
@ -1110,21 +1119,32 @@ if (empty($action) || $action == 'view') {
|
||||
print "<td>";
|
||||
$account_ledger = $k;
|
||||
// Try to force general ledger account depending on type
|
||||
if ($tabtype[$key] == 'payment') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
if ($tabtype[$key] == 'payment_supplier') $account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
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"];
|
||||
if ($tabtype[$key] == 'payment') {
|
||||
$account_ledger = $conf->global->ACCOUNTING_ACCOUNT_CUSTOMER;
|
||||
}
|
||||
if ($tabtype[$key] == 'payment_supplier') {
|
||||
$account_ledger = $conf->global->ACCOUNTING_ACCOUNT_SUPPLIER;
|
||||
}
|
||||
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);
|
||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined')
|
||||
{
|
||||
if ($tabtype[$key] == 'unknown')
|
||||
{
|
||||
if (empty($accounttoshow) || $accounttoshow == 'NotDefined') {
|
||||
if ($tabtype[$key] == 'unknown') {
|
||||
// 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>';
|
||||
} else {
|
||||
print '<span class="warning">'.$langs->trans('UnknownAccountForThirdparty', length_accountg($conf->global->ACCOUNTING_ACCOUNT_SUSPENSE)).'</span>'; // We will use a waiting account
|
||||
@ -1132,32 +1152,42 @@ if (empty($action) || $action == 'view') {
|
||||
} else {
|
||||
// We will refuse writing
|
||||
$errorstring = 'UnknownAccountForThirdpartyBlocking';
|
||||
if ($tabtype[$key] == 'payment') $errorstring = 'MainAccountForCustomersNotDefined';
|
||||
if ($tabtype[$key] == 'payment_supplier') $errorstring = 'MainAccountForSuppliersNotDefined';
|
||||
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';
|
||||
if ($tabtype[$key] == 'payment') {
|
||||
$errorstring = 'MainAccountForCustomersNotDefined';
|
||||
}
|
||||
if ($tabtype[$key] == 'payment_supplier') {
|
||||
$errorstring = 'MainAccountForSuppliersNotDefined';
|
||||
}
|
||||
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>';
|
||||
}
|
||||
} else print $accounttoshow;
|
||||
} else {
|
||||
print $accounttoshow;
|
||||
}
|
||||
print "</td>";
|
||||
|
||||
// Subledger account
|
||||
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);
|
||||
if ($accounttoshow != $accounttoshowsubledger)
|
||||
{
|
||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined')
|
||||
{
|
||||
if ($accounttoshow != $accounttoshowsubledger) {
|
||||
if (empty($accounttoshowsubledger) || $accounttoshowsubledger == 'NotDefined') {
|
||||
/*var_dump($tabpay[$key]);
|
||||
var_dump($tabtype[$key]);
|
||||
var_dump($tabbq[$key]);*/
|
||||
//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'))) {
|
||||
// For such case, if subledger is not defined, we won't use subledger accounts.
|
||||
print '<span class="warning">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownSubledgerIgnored").'</span>';
|
||||
@ -1167,7 +1197,9 @@ if (empty($action) || $action == 'view') {
|
||||
} else {
|
||||
print '<span class="error">'.$langs->trans("ThirdpartyAccountNotDefinedOrThirdPartyUnknownBlocking").'</span>';
|
||||
}
|
||||
} else print $accounttoshowsubledger;
|
||||
} else {
|
||||
print $accounttoshowsubledger;
|
||||
}
|
||||
}
|
||||
}
|
||||
print "</td>";
|
||||
@ -1180,10 +1212,11 @@ if (empty($action) || $action == 'view') {
|
||||
}
|
||||
} else { // Waiting account
|
||||
foreach ($tabbq[$key] as $k => $mt) {
|
||||
if ($mt)
|
||||
{
|
||||
if ($mt) {
|
||||
$reflabel = '';
|
||||
if (!empty($val['lib'])) $reflabel .= $val['lib']." - ";
|
||||
if (!empty($val['lib'])) {
|
||||
$reflabel .= $val['lib']." - ";
|
||||
}
|
||||
$reflabel .= 'WaitingAccount';
|
||||
|
||||
print '<!-- Wait bank.rowid='.$key.' -->';
|
||||
@ -1267,78 +1300,67 @@ function getSourceDocRef($val, $typerecord)
|
||||
}
|
||||
|
||||
$sqlmid = '';
|
||||
if ($typerecord == 'payment')
|
||||
{
|
||||
if ($typerecord == 'payment') {
|
||||
$sqlmid = 'SELECT payfac.fk_facture as id, f.ref as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiement_facture as payfac, ".MAIN_DB_PREFIX."facture as f";
|
||||
$sqlmid .= " WHERE payfac.fk_facture = f.rowid AND payfac.fk_paiement=".$val["paymentid"];
|
||||
$ref = $langs->transnoentitiesnoconv("Invoice");
|
||||
} elseif ($typerecord == 'payment_supplier')
|
||||
{
|
||||
} elseif ($typerecord == 'payment_supplier') {
|
||||
$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 .= " WHERE payfac.fk_facturefourn = f.rowid AND payfac.fk_paiementfourn=".$val["paymentsupplierid"];
|
||||
$ref = $langs->transnoentitiesnoconv("SupplierInvoice");
|
||||
} elseif ($typerecord == 'payment_expensereport')
|
||||
{
|
||||
} elseif ($typerecord == 'payment_expensereport') {
|
||||
$sqlmid = 'SELECT e.rowid as id, e.ref';
|
||||
$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";
|
||||
$ref = $langs->transnoentitiesnoconv("ExpenseReport");
|
||||
} elseif ($typerecord == 'payment_salary')
|
||||
{
|
||||
} elseif ($typerecord == 'payment_salary') {
|
||||
$sqlmid = 'SELECT s.rowid as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_salary as s";
|
||||
$sqlmid .= " WHERE s.rowid=".$val["paymentsalid"];
|
||||
$ref = $langs->transnoentitiesnoconv("SalaryPayment");
|
||||
} elseif ($typerecord == 'sc')
|
||||
{
|
||||
} elseif ($typerecord == 'sc') {
|
||||
$sqlmid = 'SELECT sc.rowid as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."paiementcharge as sc";
|
||||
$sqlmid .= " WHERE sc.rowid=".$val["paymentscid"];
|
||||
$ref = $langs->transnoentitiesnoconv("SocialContribution");
|
||||
} elseif ($typerecord == 'payment_vat')
|
||||
{
|
||||
} elseif ($typerecord == 'payment_vat') {
|
||||
$sqlmid = 'SELECT v.rowid as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."tva as v";
|
||||
$sqlmid .= " WHERE v.rowid=".$val["paymentvatid"];
|
||||
$ref = $langs->transnoentitiesnoconv("PaymentVat");
|
||||
} elseif ($typerecord == 'payment_donation')
|
||||
{
|
||||
} elseif ($typerecord == 'payment_donation') {
|
||||
$sqlmid = 'SELECT payd.fk_donation as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_donation as payd";
|
||||
$sqlmid .= " WHERE payd.fk_donation=".$val["paymentdonationid"];
|
||||
$ref = $langs->transnoentitiesnoconv("Donation");
|
||||
} elseif ($typerecord == 'payment_loan')
|
||||
{
|
||||
} elseif ($typerecord == 'payment_loan') {
|
||||
$sqlmid = 'SELECT l.rowid as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_loan as l";
|
||||
$sqlmid .= " WHERE l.rowid=".$val["paymentloanid"];
|
||||
$ref = $langs->transnoentitiesnoconv("LoanPayment");
|
||||
} elseif ($typerecord == 'payment_various')
|
||||
{
|
||||
} elseif ($typerecord == 'payment_various') {
|
||||
$sqlmid = 'SELECT v.rowid as ref';
|
||||
$sqlmid .= " FROM ".MAIN_DB_PREFIX."payment_various as v";
|
||||
$sqlmid .= " WHERE v.rowid=".$val["paymentvariousid"];
|
||||
$ref = $langs->transnoentitiesnoconv("VariousPayment");
|
||||
}
|
||||
// Add warning
|
||||
if (empty($sqlmid))
|
||||
{
|
||||
if (empty($sqlmid)) {
|
||||
dol_syslog("Found a typerecord=".$typerecord." not supported", LOG_WARNING);
|
||||
}
|
||||
|
||||
if ($sqlmid)
|
||||
{
|
||||
if ($sqlmid) {
|
||||
dol_syslog("accountancy/journal/bankjournal.php::sqlmid=".$sqlmid, LOG_DEBUG);
|
||||
$resultmid = $db->query($sqlmid);
|
||||
if ($resultmid)
|
||||
{
|
||||
while ($objmid = $db->fetch_object($resultmid))
|
||||
{
|
||||
if ($resultmid) {
|
||||
while ($objmid = $db->fetch_object($resultmid)) {
|
||||
$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
|
||||
|
||||
@ -31,7 +31,9 @@ include_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('admin', 'boxes', 'accountancy'));
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$rowid = GETPOST('rowid', 'int');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
@ -46,8 +48,7 @@ $boxes = array();
|
||||
* 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_ACTIVATE_FILECACHE", $_POST["MAIN_ACTIVATE_FILECACHE"], 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
@ -59,8 +60,7 @@ if ($action == 'add') {
|
||||
$db->begin();
|
||||
if (is_array($boxids)) {
|
||||
foreach ($boxids 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'];
|
||||
|
||||
// Initialize distinct fk_user with all already existing values of fk_user (user that use a personalized view of boxes for page "pos")
|
||||
@ -72,12 +72,10 @@ if ($action == 'add') {
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
dol_syslog("boxes.php search fk_user to activate box for", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
$i = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$distinctfkuser[$obj->fk_user] = $obj->fk_user;
|
||||
$i++;
|
||||
@ -90,26 +88,28 @@ if ($action == 'add') {
|
||||
|
||||
$distinctfkuser['0'] = '0'; // Add entry for fk_user = 0. We must use string as key and val
|
||||
|
||||
foreach ($distinctfkuser as $fk_user)
|
||||
{
|
||||
if (!$error && $fk_user != '')
|
||||
{
|
||||
foreach ($distinctfkuser as $fk_user) {
|
||||
if (!$error && $fk_user != '') {
|
||||
$arrayofexistingboxid = array();
|
||||
$nbboxonleft = $nbboxonright = 0;
|
||||
$sql = "SELECT box_id, box_order FROM ".MAIN_DB_PREFIX."boxes";
|
||||
$sql .= " WHERE position = ".$pos." AND fk_user = ".$fk_user." AND entity = ".$conf->entity;
|
||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
while ($obj = $db->fetch_object($resql))
|
||||
{
|
||||
if ($resql) {
|
||||
while ($obj = $db->fetch_object($resql)) {
|
||||
$boxorder = $obj->box_order;
|
||||
if (preg_match('/A/', $boxorder)) $nbboxonleft++;
|
||||
if (preg_match('/B/', $boxorder)) $nbboxonright++;
|
||||
if (preg_match('/A/', $boxorder)) {
|
||||
$nbboxonleft++;
|
||||
}
|
||||
if (preg_match('/B/', $boxorder)) {
|
||||
$nbboxonright++;
|
||||
}
|
||||
$arrayofexistingboxid[$obj->box_id] = 1;
|
||||
}
|
||||
} else dol_print_error($db);
|
||||
} else {
|
||||
dol_print_error($db);
|
||||
}
|
||||
|
||||
if (empty($arrayofexistingboxid[$boxid['value']])) {
|
||||
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes (";
|
||||
@ -120,8 +120,7 @@ if ($action == 'add') {
|
||||
|
||||
dol_syslog("boxes.php activate box", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if (!$resql)
|
||||
{
|
||||
if (!$resql) {
|
||||
setEventMessages($db->lasterror(), null, 'errors');
|
||||
$error++;
|
||||
}
|
||||
@ -133,8 +132,7 @@ if ($action == 'add') {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$db->commit();
|
||||
$action = '';
|
||||
} else {
|
||||
@ -142,15 +140,13 @@ if ($action == 'add') {
|
||||
}
|
||||
}
|
||||
|
||||
if ($action == 'delete')
|
||||
{
|
||||
if ($action == 'delete') {
|
||||
$sql = "SELECT box_id FROM ".MAIN_DB_PREFIX."boxes";
|
||||
$sql .= " WHERE rowid=".((int) $rowid);
|
||||
|
||||
$resql = $db->query($sql);
|
||||
$obj = $db->fetch_object($resql);
|
||||
if (!empty($obj->box_id))
|
||||
{
|
||||
if (!empty($obj->box_id)) {
|
||||
$db->begin();
|
||||
|
||||
// Remove all personalized setup when a box is activated or disabled (why removing all ? We removed only removed boxes)
|
||||
@ -168,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
|
||||
$db->begin();
|
||||
|
||||
@ -181,12 +176,10 @@ if ($action == 'switch')
|
||||
|
||||
$resultupdatefrom = 0;
|
||||
$resultupdateto = 0;
|
||||
if (is_object($objfrom) && is_object($objto))
|
||||
{
|
||||
if (is_object($objfrom) && is_object($objto)) {
|
||||
$newfirst = $objto->box_order;
|
||||
$newsecond = $objfrom->box_order;
|
||||
if ($newfirst == $newsecond)
|
||||
{
|
||||
if ($newfirst == $newsecond) {
|
||||
$newsecondchar = preg_replace('/[0-9]+/', '', $newsecond);
|
||||
$newsecondnum = preg_replace('/[a-zA-Z]+/', '', $newsecond);
|
||||
$newsecond = sprintf("%s%02d", $newsecondchar ? $newsecondchar : 'A', $newsecondnum + 1);
|
||||
@ -194,16 +187,19 @@ if ($action == 'switch')
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."boxes SET box_order='".$db->escape($newfirst)."' WHERE rowid=".((int) $objfrom->rowid);
|
||||
dol_syslog($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);
|
||||
dol_syslog($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();
|
||||
} else {
|
||||
$db->rollback();
|
||||
@ -240,33 +236,31 @@ $sql .= " ORDER by b.position, b.box_order";
|
||||
|
||||
dol_syslog("Search available boxes", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num = $db->num_rows($resql);
|
||||
|
||||
// Check record to know if we must recalculate sort order
|
||||
$i = 0;
|
||||
$decalage = 0;
|
||||
while ($i < $num)
|
||||
{
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($resql);
|
||||
$boxes[$obj->position][$obj->box_id] = 1;
|
||||
$i++;
|
||||
|
||||
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 ''
|
||||
// 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;
|
||||
$db->query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
if ($decalage)
|
||||
{
|
||||
if ($decalage) {
|
||||
// If we have renumbered, we correct the field box_order
|
||||
// This occurs just after an insert.
|
||||
$sql = "SELECT box_order";
|
||||
@ -276,32 +270,24 @@ if ($resql)
|
||||
|
||||
dol_syslog("Execute requests to renumber box order", LOG_DEBUG);
|
||||
$result = $db->query($sql);
|
||||
if ($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 ($result) {
|
||||
while ($record = $db->fetch_array($result)) {
|
||||
if (dol_strlen($record['box_order']) == 1) {
|
||||
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1))) {
|
||||
$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'])."'";
|
||||
$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'];
|
||||
$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);
|
||||
}
|
||||
} elseif (dol_strlen($record['box_order']) == 2)
|
||||
{
|
||||
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1)))
|
||||
{
|
||||
} elseif (dol_strlen($record['box_order']) == 2) {
|
||||
if (preg_match("/[13579]{1}/", substr($record['box_order'], -1))) {
|
||||
$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'])."'";
|
||||
$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'];
|
||||
$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);
|
||||
@ -336,10 +322,8 @@ print '<td>'.$langs->trans("SourceFile").'</td>';
|
||||
print '<td width="160" class="center">'.$langs->trans("ActivateOn").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
foreach ($boxtoadd as $box)
|
||||
{
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg))
|
||||
{
|
||||
foreach ($boxtoadd as $box) {
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) {
|
||||
$logo = $box->boximg;
|
||||
} else {
|
||||
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
||||
@ -348,14 +332,17 @@ foreach ($boxtoadd as $box)
|
||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||
print '<tr class="oddeven">'."\n";
|
||||
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>';
|
||||
if ($box->note == '(WarningUsingThisBoxSlowDown)')
|
||||
{
|
||||
if ($box->note == '(WarningUsingThisBoxSlowDown)') {
|
||||
$langs->load("errors");
|
||||
print $langs->trans("WarningUsingThisBoxSlowDown");
|
||||
} else print ($box->note ? $box->note : ' ');
|
||||
} else {
|
||||
print ($box->note ? $box->note : ' ');
|
||||
}
|
||||
print '</td>'."\n";
|
||||
print '<td>'.$box->sourcefile.'</td>'."\n";
|
||||
|
||||
@ -367,8 +354,7 @@ foreach ($boxtoadd as $box)
|
||||
|
||||
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 '</table>'."\n";
|
||||
@ -398,10 +384,8 @@ print '</tr>'."\n";
|
||||
|
||||
$box_order = 1;
|
||||
$foundrupture = 1;
|
||||
foreach ($boxactivated as $key => $box)
|
||||
{
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg))
|
||||
{
|
||||
foreach ($boxactivated as $key => $box) {
|
||||
if (preg_match('/^([^@]+)@([^@]+)$/i', $box->boximg)) {
|
||||
$logo = $box->boximg;
|
||||
} else {
|
||||
$logo = preg_replace("/^object_/i", "", $box->boximg);
|
||||
@ -410,14 +394,17 @@ foreach ($boxactivated as $key => $box)
|
||||
print "\n".'<!-- Box '.$box->boxcode.' -->'."\n";
|
||||
print '<tr class="oddeven">';
|
||||
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>';
|
||||
if ($box->note == '(WarningUsingThisBoxSlowDown)')
|
||||
{
|
||||
if ($box->note == '(WarningUsingThisBoxSlowDown)') {
|
||||
$langs->load("errors");
|
||||
print img_warning('', 0).' '.$langs->trans("WarningUsingThisBoxSlowDown");
|
||||
} else print ($box->note ? $box->note : ' ');
|
||||
} else {
|
||||
print ($box->note ? $box->note : ' ');
|
||||
}
|
||||
print '</td>';
|
||||
print '<td class="center">'.(empty($pos_name[$box->position]) ? '' : $langs->trans($pos_name[$box->position])).'</td>';
|
||||
$hasnext = ($key < (count($boxactivated) - 1));
|
||||
@ -446,6 +433,7 @@ print load_fiche_titre($langs->trans("Other"), '', '');
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="addconst">';
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
@ -471,6 +459,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL == 2 || !empty($conf->global->MAIN_ACTIVA
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
print '<div class="center"><input type="submit" class="button button-save" value="'.$langs->trans("Save").'" name="Button"></div>';
|
||||
|
||||
@ -100,9 +100,12 @@ if ($action == 'update')
|
||||
|
||||
$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
|
||||
|
||||
@ -125,7 +128,8 @@ if (!empty($conf->multicurrency->enabled) && !empty($conf->global->MULTICURRENCY
|
||||
if (!empty($aCurrencies) && count($aCurrencies) > 1)
|
||||
{
|
||||
$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 '<br>';
|
||||
} else {
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
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 '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit'.(!empty($currencycode) ? '¤cycode='.$currencycode : '').'">'.$langs->trans("Modify").'</a>';
|
||||
|
||||
@ -1074,7 +1074,7 @@ function fieldList($fieldlist, $obj = '', $tabname = '', $context = '')
|
||||
print '<td class="center">';
|
||||
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 $obj->{$fieldlist[$field]};
|
||||
} else {
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
/* Copyright (C) 2007-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -30,15 +31,16 @@ $langs->loadLangs(array("companies", "admin", "products", "sms", "other", "error
|
||||
|
||||
$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
|
||||
|
||||
if (!$user->admin)
|
||||
accessforbidden();
|
||||
if (!$user->admin) {
|
||||
accessforbidden();
|
||||
}
|
||||
|
||||
$substitutionarrayfortest = array(
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
'__PHONEFROM__' => 'TESTPhoneFrom',
|
||||
'__PHONETO__' => 'TESTPhoneTo',
|
||||
'__LASTNAME__' => 'TESTLastname',
|
||||
'__FIRSTNAME__' => 'TESTFirstname'
|
||||
'__ID__' => 'TESTIdRecord',
|
||||
'__PHONEFROM__' => 'TESTPhoneFrom',
|
||||
'__PHONETO__' => 'TESTPhoneTo',
|
||||
'__LASTNAME__' => 'TESTLastname',
|
||||
'__FIRSTNAME__' => 'TESTFirstname'
|
||||
);
|
||||
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
@ -48,8 +50,7 @@ $action = GETPOST('action', 'aZ09');
|
||||
* 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_SMS_SENDMODE", GETPOST("MAIN_SMS_SENDMODE", 'alphanohtml'), 'chaine', 0, '', $conf->entity);
|
||||
@ -64,13 +65,16 @@ if ($action == 'update' && !$cancel)
|
||||
/*
|
||||
* Send sms
|
||||
*/
|
||||
if ($action == 'send' && !$_POST['cancel'])
|
||||
{
|
||||
if ($action == 'send' && !$_POST['cancel']) {
|
||||
$error = 0;
|
||||
|
||||
$smsfrom = '';
|
||||
if (!empty($_POST["fromsms"])) $smsfrom = GETPOST("fromsms", 'alphanohtml');
|
||||
if (empty($smsfrom)) $smsfrom = GETPOST("fromname", 'alphanohtml');
|
||||
if (!empty($_POST["fromsms"])) {
|
||||
$smsfrom = GETPOST("fromsms", 'alphanohtml');
|
||||
}
|
||||
if (empty($smsfrom)) {
|
||||
$smsfrom = GETPOST("fromname", 'alphanohtml');
|
||||
}
|
||||
$sendto = GETPOST("sendto", 'alphanohtml');
|
||||
$body = GETPOST('message', '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';
|
||||
$formsms = new FormSms($db);
|
||||
|
||||
if (!empty($formsms->error))
|
||||
{
|
||||
if (!empty($formsms->error)) {
|
||||
setEventMessages($formsms->error, $formsms->errors, 'errors');
|
||||
$action = 'test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($body))
|
||||
{
|
||||
if (empty($body)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Message")), null, 'errors');
|
||||
$action = 'test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($smsfrom) || !str_replace('+', '', $smsfrom))
|
||||
{
|
||||
if (empty($smsfrom) || !str_replace('+', '', $smsfrom)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsFrom")), null, 'errors');
|
||||
$action = 'test';
|
||||
$error++;
|
||||
}
|
||||
if (empty($sendto) || !str_replace('+', '', $sendto))
|
||||
{
|
||||
if (empty($sendto) || !str_replace('+', '', $sendto)) {
|
||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("SmsTo")), null, 'errors');
|
||||
$action = 'test';
|
||||
$error++;
|
||||
}
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
// Make substitutions into message
|
||||
complete_substitutions_array($substitutionarrayfortest, $langs);
|
||||
$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
|
||||
$result = $smsfile->sendfile(); // This send SMS
|
||||
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
setEventMessages($langs->trans("SmsSuccessfulySent", $smsfrom, $sendto), null, 'mesgs');
|
||||
setEventMessages($smsfile->error, $smsfile->errors, 'mesgs');
|
||||
} else {
|
||||
@ -138,8 +136,12 @@ if ($action == 'send' && !$_POST['cancel'])
|
||||
*/
|
||||
|
||||
$linuxlike = 1;
|
||||
if (preg_match('/^win/i', PHP_OS)) $linuxlike = 0;
|
||||
if (preg_match('/^mac/i', PHP_OS)) $linuxlike = 0;
|
||||
if (preg_match('/^win/i', PHP_OS)) {
|
||||
$linuxlike = 0;
|
||||
}
|
||||
if (preg_match('/^mac/i', PHP_OS)) {
|
||||
$linuxlike = 0;
|
||||
}
|
||||
|
||||
$wikihelp = 'EN:Setup Sms|FR:Paramétrage Sms|ES:Configuración Sms';
|
||||
llxHeader('', $langs->trans("Setup"), $wikihelp);
|
||||
@ -153,11 +155,14 @@ print "<br>\n";
|
||||
$listofmethods = (is_array($conf->modules_parts['sms']) ? $conf->modules_parts['sms'] : array());
|
||||
asort($listofmethods);
|
||||
|
||||
if ($action == 'edit')
|
||||
{
|
||||
$form = new Form($db);
|
||||
if (!count($listofmethods)) {
|
||||
$descnosms = $langs->trans("NoSmsEngine", '{Dolistore}');
|
||||
$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 '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
@ -178,8 +183,11 @@ if ($action == 'edit')
|
||||
|
||||
// Method
|
||||
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);
|
||||
else print '<font class="error">'.$langs->trans("None").'</font>';
|
||||
if (count($listofmethods)) {
|
||||
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>';
|
||||
|
||||
// From
|
||||
@ -204,8 +212,6 @@ if ($action == 'edit')
|
||||
print '</form>';
|
||||
print '<br>';
|
||||
} 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 '<tr class="liste_titre"><td>'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
|
||||
|
||||
@ -218,14 +224,18 @@ if ($action == 'edit')
|
||||
// Method
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_SMS_SENDMODE").'</td><td>';
|
||||
$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 '</td></tr>';
|
||||
|
||||
// From
|
||||
print '<tr class="oddeven"><td>'.$langs->trans("MAIN_MAIL_SMS_FROM", $langs->transnoentities("Undefined")).'</td>';
|
||||
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>';
|
||||
|
||||
// Autocopy to
|
||||
@ -234,7 +244,7 @@ if ($action == 'edit')
|
||||
print '<td>'.$conf->global->MAIN_MAIL_AUTOCOPY_TO;
|
||||
if (!empty($conf->global->MAIN_MAIL_AUTOCOPY_TO) && ! isValidEmail($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print img_warning($langs->trans("ErrorBadEMail"));
|
||||
print '</td></tr>';
|
||||
*/
|
||||
*/
|
||||
|
||||
print '</table>';
|
||||
|
||||
@ -257,8 +267,7 @@ if ($action == 'edit')
|
||||
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>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("DoTestSend").'</a>';
|
||||
@ -290,8 +299,7 @@ if ($action == 'edit')
|
||||
}*/
|
||||
|
||||
// Affichage formulaire de TEST simple
|
||||
if ($action == 'test')
|
||||
{
|
||||
if ($action == 'test') {
|
||||
print '<br>';
|
||||
print load_fiche_titre($langs->trans("DoTestSend"));
|
||||
|
||||
|
||||
@ -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';
|
||||
print img_picto('', 'globe').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
|
||||
} else {
|
||||
print $langs->trans("NotAvailableWithThisDistribution");
|
||||
$langs->load("errors");
|
||||
print info_admin($langs->trans("ErrorNotAvailableWithThisDistribution"), 0, 0, 'error');
|
||||
}
|
||||
|
||||
llxFooter();
|
||||
|
||||
@ -158,28 +158,6 @@ class Asset extends CommonObject
|
||||
*/
|
||||
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
|
||||
|
||||
@ -183,19 +183,19 @@ class BOM extends CommonObject
|
||||
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';
|
||||
|
||||
/**
|
||||
* @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';
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
//protected $childtables=array();
|
||||
// /**
|
||||
// * @var array List of child tables. To test if we can delete object.
|
||||
// */
|
||||
// protected $childtables=array();
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To know object to delete on cascade.
|
||||
|
||||
@ -54,7 +54,7 @@ class AdvanceTargetingMailing extends CommonObject
|
||||
public $name;
|
||||
|
||||
/**
|
||||
* @var int element id
|
||||
* @var int element id (it's not the name of a field)
|
||||
*/
|
||||
public $fk_element;
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ class Propal extends CommonObject
|
||||
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';
|
||||
|
||||
@ -1099,7 +1099,7 @@ class Propal extends CommonObject
|
||||
if ($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);
|
||||
$resql = $this->db->query($sql);
|
||||
@ -1111,7 +1111,7 @@ class Propal extends CommonObject
|
||||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
@ -3753,7 +3753,10 @@ class PropaleLigne extends CommonObjectLine
|
||||
public $product_type = Product::TYPE_PRODUCT;
|
||||
|
||||
public $qty;
|
||||
|
||||
public $tva_tx;
|
||||
public $vat_src_code;
|
||||
|
||||
public $subprice;
|
||||
public $remise_percent;
|
||||
public $fk_remise_except;
|
||||
@ -3805,6 +3808,11 @@ class PropaleLigne extends CommonObjectLine
|
||||
* @see $product_label
|
||||
*/
|
||||
public $libelle;
|
||||
/**
|
||||
* @deprecated
|
||||
* @see $product_label
|
||||
*/
|
||||
public $label;
|
||||
/**
|
||||
* Product label
|
||||
* @var string
|
||||
|
||||
@ -43,12 +43,12 @@ class Deplacement extends CommonObject
|
||||
public $table_element = 'deplacement';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable 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 = '';
|
||||
|
||||
|
||||
@ -3551,7 +3551,7 @@ if ($action == 'create')
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Lines from source (TODO Show them also when creating invoice from tempalte invoice)
|
||||
// Lines from source (TODO Show them also when creating invoice from template invoice)
|
||||
if (!empty($origin) && !empty($originid) && is_object($objectsrc))
|
||||
{
|
||||
// TODO for compatibility
|
||||
|
||||
@ -50,12 +50,12 @@ class FactureRec extends CommonInvoice
|
||||
public $table_element = 'facture_rec';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'facturedet_rec';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_facture';
|
||||
|
||||
|
||||
@ -64,12 +64,12 @@ class Facture extends CommonInvoice
|
||||
public $table_element = 'facture';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'facturedet';
|
||||
|
||||
/**
|
||||
* @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_facture';
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2017 Olivier Geffroy <jeff@jeffinfo.com>
|
||||
* 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
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -122,7 +122,9 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
$name = $langs->trans("Turnover");
|
||||
$calcmode = $langs->trans("CalcModeDebt");
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=BOOKKEEPING">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInBookkeepingMode", '{links1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=BOOKKEEPING">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
$description = $langs->trans("RulesCADue");
|
||||
@ -146,7 +148,9 @@ if ($modecompta == "CREANCES-DETTES")
|
||||
{
|
||||
$name = $langs->trans("Turnover");
|
||||
$calcmode = $langs->trans("CalcModeBookkeeping");
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=CREANCES-DETTES">', '</a>').')';
|
||||
$calcmode .= '<br>('.$langs->trans("SeeReportInDueDebtMode", '{link1}', '{link2}').')';
|
||||
$calcmode = str_replace('{link1}', '<a class="bold" href="'.$_SERVER["PHP_SELF"].'?'.($param ? $param : 'year_start='.$year_start).'&modecompta=CREANCES-DETTES">', $calcmode);
|
||||
$calcmode = str_replace('{link2}', '</a>', $calcmode);
|
||||
//$calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year_start='.$year_start.'&modecompta=RECETTES-DEPENSES">','</a>').')';
|
||||
$period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.$form->selectDate($date_end, 'date_end', 0, 0, 0, '', 1, 0);
|
||||
$periodlink = ($year_start ? "<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear - 2)."&modecompta=".$modecompta."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start + $nbofyear)."&modecompta=".$modecompta."'>".img_next()."</a>" : "");
|
||||
|
||||
@ -53,12 +53,12 @@ class Contrat extends CommonObject
|
||||
public $table_element = 'contrat';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'contratdet';
|
||||
|
||||
/**
|
||||
* @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_contrat';
|
||||
|
||||
|
||||
@ -84,21 +84,25 @@ class box_produits extends ModeleBoxes
|
||||
|
||||
$this->info_box_head = array('text' => $langs->trans("BoxTitleLastProducts", $max));
|
||||
|
||||
if ($user->rights->produit->lire || $user->rights->service->lire)
|
||||
{
|
||||
if ($user->rights->produit->lire || $user->rights->service->lire) {
|
||||
$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell, p.tobuy, p.fk_price_expression, p.entity";
|
||||
$sql .= ", p.accountancy_code_sell";
|
||||
$sql .= ", p.accountancy_code_sell_intra";
|
||||
$sql .= ", p.accountancy_code_sell_export";
|
||||
$sql .= ", p.accountancy_code_buy";
|
||||
$sql .= ", p.accountancy_code_buy_intra";
|
||||
$sql .= ", p.accountancy_code_buy_export";
|
||||
$sql .= ', p.barcode';
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."product as p";
|
||||
$sql .= ' WHERE p.entity IN ('.getEntity($productstatic->element).')';
|
||||
if (empty($user->rights->produit->lire)) $sql .= ' AND p.fk_product_type != 0';
|
||||
if (empty($user->rights->service->lire)) $sql .= ' AND p.fk_product_type != 1';
|
||||
if (empty($user->rights->produit->lire)) {
|
||||
$sql .= ' AND p.fk_product_type != 0';
|
||||
}
|
||||
if (empty($user->rights->service->lire)) {
|
||||
$sql .= ' AND p.fk_product_type != 1';
|
||||
}
|
||||
// Add where from hooks
|
||||
if (is_object($hookmanager))
|
||||
{
|
||||
if (is_object($hookmanager)) {
|
||||
$parameters = array('boxproductlist'=>1);
|
||||
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
|
||||
$sql .= $hookmanager->resPrint;
|
||||
@ -107,18 +111,15 @@ class box_produits extends ModeleBoxes
|
||||
$sql .= $this->db->plimit($max, 0);
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if ($result)
|
||||
{
|
||||
if ($result) {
|
||||
$num = $this->db->num_rows($result);
|
||||
$line = 0;
|
||||
while ($line < $num)
|
||||
{
|
||||
while ($line < $num) {
|
||||
$objp = $this->db->fetch_object($result);
|
||||
$datem = $this->db->jdate($objp->tms);
|
||||
|
||||
// Multilangs
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) // si l'option est active
|
||||
{
|
||||
if (!empty($conf->global->MAIN_MULTILANGS)) { // si l'option est active
|
||||
$sqld = "SELECT label";
|
||||
$sqld .= " FROM ".MAIN_DB_PREFIX."product_lang";
|
||||
$sqld .= " WHERE fk_product=".$objp->rowid;
|
||||
@ -126,11 +127,11 @@ class box_produits extends ModeleBoxes
|
||||
$sqld .= " LIMIT 1";
|
||||
|
||||
$resultd = $this->db->query($sqld);
|
||||
if ($resultd)
|
||||
{
|
||||
if ($resultd) {
|
||||
$objtp = $this->db->fetch_object($resultd);
|
||||
if (isset($objtp->label) && $objtp->label != '')
|
||||
if (isset($objtp->label) && $objtp->label != '') {
|
||||
$objp->label = $objtp->label;
|
||||
}
|
||||
}
|
||||
}
|
||||
$productstatic->id = $objp->rowid;
|
||||
@ -145,6 +146,8 @@ class box_produits extends ModeleBoxes
|
||||
$productstatic->accountancy_code_sell_intra = $objp->accountancy_code_sell_intra;
|
||||
$productstatic->accountancy_code_sell_export = $objp->accountancy_code_sell_export;
|
||||
$productstatic->accountancy_code_buy = $objp->accountancy_code_buy;
|
||||
$productstatic->accountancy_code_buy_intra = $objp->accountancy_code_buy_intra;
|
||||
$productstatic->accountancy_code_buy_export = $objp->accountancy_code_buy_export;
|
||||
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="tdoverflowmax100 maxwidth100onsmartphone"',
|
||||
@ -161,14 +164,13 @@ class box_produits extends ModeleBoxes
|
||||
if (empty($conf->dynamicprices->enabled) || empty($objp->fk_price_expression)) {
|
||||
$price_base_type = $langs->trans($objp->price_base_type);
|
||||
$price = ($objp->price_base_type == 'HT') ?price($objp->price) : $price = price($objp->price_ttc);
|
||||
} else //Parse the dynamic price
|
||||
{
|
||||
} else {
|
||||
//Parse the dynamic price
|
||||
$productstatic->fetch($objp->rowid, '', '', 1);
|
||||
$priceparser = new PriceParser($this->db);
|
||||
$price_result = $priceparser->parseProduct($productstatic);
|
||||
if ($price_result >= 0) {
|
||||
if ($objp->price_base_type == 'HT')
|
||||
{
|
||||
if ($objp->price_base_type == 'HT') {
|
||||
$price_base_type = $langs->trans("HT");
|
||||
} else {
|
||||
$price_result = $price_result * (1 + ($productstatic->tva_tx / 100));
|
||||
@ -176,7 +178,7 @@ class box_produits extends ModeleBoxes
|
||||
}
|
||||
$price = price($price_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->info_box_contents[$line][] = array(
|
||||
'td' => 'class="right"',
|
||||
'text' => $price,
|
||||
@ -206,11 +208,12 @@ class box_produits extends ModeleBoxes
|
||||
|
||||
$line++;
|
||||
}
|
||||
if ($num == 0)
|
||||
if ($num == 0) {
|
||||
$this->info_box_contents[$line][0] = array(
|
||||
'td' => 'class="center"',
|
||||
'text'=>$langs->trans("NoRecordedProducts"),
|
||||
);
|
||||
}
|
||||
|
||||
$this->db->free($result);
|
||||
} else {
|
||||
|
||||
@ -242,6 +242,7 @@ class CMailFile
|
||||
{
|
||||
$this->html = $msg;
|
||||
|
||||
$findimg = 0;
|
||||
if (!empty($conf->global->MAIN_MAIL_ADD_INLINE_IMAGES_IF_IN_MEDIAS))
|
||||
{
|
||||
$findimg = $this->findHtmlImages($dolibarr_main_data_root.'/medias');
|
||||
|
||||
@ -32,10 +32,13 @@ class Comment extends CommonObject
|
||||
public $table_element = 'comment';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var int ID of parent key (it's not the name of a field)
|
||||
*/
|
||||
public $fk_element = '';
|
||||
public $fk_element;
|
||||
|
||||
/**
|
||||
* @var string element type
|
||||
*/
|
||||
public $element_type;
|
||||
|
||||
/**
|
||||
@ -72,10 +75,16 @@ class Comment extends CommonObject
|
||||
*/
|
||||
public $entity;
|
||||
|
||||
/**
|
||||
* @var string import key
|
||||
*/
|
||||
public $import_key;
|
||||
|
||||
public $comments = array();
|
||||
|
||||
/**
|
||||
* @var Comment Object oldcopy
|
||||
*/
|
||||
public $oldcopy;
|
||||
|
||||
|
||||
@ -131,26 +140,26 @@ class Comment extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::create", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
if (!$resql) {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$error) {
|
||||
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX.$this->table_element);
|
||||
|
||||
if (!$notrigger)
|
||||
{
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('TASK_COMMENT_CREATE', $user);
|
||||
if ($result < 0) { $error++; }
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
foreach ($this->errors as $errmsg)
|
||||
{
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::create ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
}
|
||||
@ -190,12 +199,10 @@ class Comment extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
|
||||
if ($num_rows)
|
||||
{
|
||||
if ($num_rows) {
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
|
||||
$this->id = $obj->rowid;
|
||||
@ -212,8 +219,11 @@ class Comment extends CommonObject
|
||||
|
||||
$this->db->free($resql);
|
||||
|
||||
if ($num_rows) return 1;
|
||||
else return 0;
|
||||
if ($num_rows) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
$this->error = "Error ".$this->db->lasterror();
|
||||
return -1;
|
||||
@ -234,8 +244,12 @@ class Comment extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Clean parameters
|
||||
if (isset($this->fk_element)) $this->fk_project = (int) trim($this->fk_element);
|
||||
if (isset($this->description)) $this->description = trim($this->description);
|
||||
if (isset($this->fk_element)) {
|
||||
$this->fk_project = (int) trim($this->fk_element);
|
||||
}
|
||||
if (isset($this->description)) {
|
||||
$this->description = trim($this->description);
|
||||
}
|
||||
|
||||
|
||||
// Update request
|
||||
@ -253,24 +267,24 @@ class Comment extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this)."::update", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
if (!$resql) {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
if (!$error) {
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('TASK_COMMENT_MODIFY', $user);
|
||||
if ($result < 0) { $error++; }
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
foreach ($this->errors as $errmsg)
|
||||
{
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::update ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
}
|
||||
@ -303,24 +317,24 @@ class Comment extends CommonObject
|
||||
$sql .= " WHERE rowid=".$this->id;
|
||||
|
||||
$resql = $this->db->query($sql);
|
||||
if (!$resql) { $error++; $this->errors[] = "Error ".$this->db->lasterror(); }
|
||||
if (!$resql) {
|
||||
$error++; $this->errors[] = "Error ".$this->db->lasterror();
|
||||
}
|
||||
|
||||
if (!$error)
|
||||
{
|
||||
if (!$notrigger)
|
||||
{
|
||||
if (!$error) {
|
||||
if (!$notrigger) {
|
||||
// Call trigger
|
||||
$result = $this->call_trigger('TASK_COMMENT_DELETE', $user);
|
||||
if ($result < 0) { $error++; }
|
||||
if ($result < 0) {
|
||||
$error++;
|
||||
}
|
||||
// End call triggers
|
||||
}
|
||||
}
|
||||
|
||||
// Commit or rollback
|
||||
if ($error)
|
||||
{
|
||||
foreach ($this->errors as $errmsg)
|
||||
{
|
||||
if ($error) {
|
||||
foreach ($this->errors as $errmsg) {
|
||||
dol_syslog(get_class($this)."::delete ".$errmsg, LOG_ERR);
|
||||
$this->error .= ($this->error ? ', '.$errmsg : $errmsg);
|
||||
}
|
||||
@ -355,13 +369,10 @@ class Comment extends CommonObject
|
||||
|
||||
dol_syslog(get_class($this).'::'.__METHOD__, LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
if ($resql) {
|
||||
$num_rows = $this->db->num_rows($resql);
|
||||
if ($num_rows > 0)
|
||||
{
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
if ($num_rows > 0) {
|
||||
while ($obj = $this->db->fetch_object($resql)) {
|
||||
$comment = new self($db);
|
||||
$comment->fetch($obj->rowid);
|
||||
$this->comments[] = $comment;
|
||||
|
||||
@ -3161,7 +3161,7 @@ abstract class CommonObject
|
||||
$this->multicurrency_total_ttc += isset($this->revenuestamp) ? ($this->revenuestamp * $multicurrency_tx) : 0;
|
||||
|
||||
// Situations totals
|
||||
if ($this->situation_cycle_ref && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits') && $this->type != $this::TYPE_CREDIT_NOTE)
|
||||
if (!empty($this->situation_cycle_ref) && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits') && $this->type != $this::TYPE_CREDIT_NOTE)
|
||||
{
|
||||
$prev_sits = $this->get_prev_sits();
|
||||
|
||||
|
||||
@ -125,7 +125,6 @@ class EmailSenderProfile extends CommonObject
|
||||
*/
|
||||
public $date_creation;
|
||||
|
||||
|
||||
public $tms;
|
||||
public $private;
|
||||
public $signature;
|
||||
@ -134,32 +133,6 @@ class EmailSenderProfile extends CommonObject
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
|
||||
|
||||
// If this object has a subtable with lines
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
*/
|
||||
//public $table_element_line = 'emailsenderprofiledet';
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
//public $fk_element = 'fk_emailsenderprofile';
|
||||
/**
|
||||
* @var int Name of subtable class that manage subtable lines
|
||||
*/
|
||||
//public $class_element_line = 'EmailSenderProfileline';
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
//protected $childtables=array();
|
||||
/**
|
||||
* @var EmailSenderProfileLine[] Array of subtable lines
|
||||
*/
|
||||
//public $lines = array();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
||||
@ -35,6 +35,9 @@ class Fiscalyear extends CommonObject
|
||||
*/
|
||||
public $element = 'fiscalyear';
|
||||
|
||||
/**
|
||||
* @var string picto
|
||||
*/
|
||||
public $picto = 'technic';
|
||||
|
||||
/**
|
||||
@ -43,12 +46,12 @@ class Fiscalyear extends CommonObject
|
||||
public $table_element = 'accounting_fiscalyear';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = '';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = '';
|
||||
|
||||
|
||||
@ -924,30 +924,33 @@ function purgeSessions($mysessionid)
|
||||
dol_syslog('admin.lib:purgeSessions mysessionid='.$mysessionid.' sessPath='.$sessPath);
|
||||
|
||||
$error = 0;
|
||||
$dh = @opendir(dol_osencode($sessPath));
|
||||
while (($file = @readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $sessPath.$file;
|
||||
if (!@is_dir($fullpath)) {
|
||||
$sessValues = file_get_contents($fullpath); // get raw session data
|
||||
|
||||
if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session
|
||||
preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity
|
||||
preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i', $sessValues)) { // limit to company name
|
||||
$tmp = explode('_', $file);
|
||||
$idsess = $tmp[1];
|
||||
// We remove session if it's not ourself
|
||||
if ($idsess != $mysessionid) {
|
||||
$res = @unlink($fullpath);
|
||||
if (!$res) {
|
||||
$error++;
|
||||
$dh = @opendir(dol_osencode($sessPath));
|
||||
if ($dh) {
|
||||
while (($file = @readdir($dh)) !== false) {
|
||||
if ($file != "." && $file != "..") {
|
||||
$fullpath = $sessPath.$file;
|
||||
if (!@is_dir($fullpath)) {
|
||||
$sessValues = file_get_contents($fullpath); // get raw session data
|
||||
|
||||
if (preg_match('/dol_login/i', $sessValues) && // limit to dolibarr session
|
||||
preg_match('/dol_entity\|s:([0-9]+):"('.$conf->entity.')"/i', $sessValues) && // limit to current entity
|
||||
preg_match('/dol_company\|s:([0-9]+):"('.$conf->global->MAIN_INFO_SOCIETE_NOM.')"/i', $sessValues)) { // limit to company name
|
||||
$tmp = explode('_', $file);
|
||||
$idsess = $tmp[1];
|
||||
// We remove session if it's not ourself
|
||||
if ($idsess != $mysessionid) {
|
||||
$res = @unlink($fullpath);
|
||||
if (!$res) {
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
@closedir($dh);
|
||||
|
||||
if (!$error) {
|
||||
return 1;
|
||||
|
||||
@ -3186,9 +3186,8 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
||||
|
||||
// We forge fullpathpicto for image to $path/img/$picto. By default, we take DOL_URL_ROOT/theme/$conf->theme/img/$picto
|
||||
$url = DOL_URL_ROOT;
|
||||
$theme = $conf->theme;
|
||||
$theme = isset($conf->theme) ? $conf->theme : null;
|
||||
$path = 'theme/'.$theme;
|
||||
|
||||
// Define fullpathpicto to use into src
|
||||
if ($pictoisfullpath) {
|
||||
// Clean parameters
|
||||
|
||||
@ -442,7 +442,7 @@ function dolSaveReadme($file, $content)
|
||||
/**
|
||||
* Show list of themes. Show all thumbs of themes/skins
|
||||
*
|
||||
* @param Website $website Object website to load the tempalte into
|
||||
* @param Website $website Object website to load the template into
|
||||
* @return void
|
||||
*/
|
||||
function showWebsiteTemplates(Website $website)
|
||||
|
||||
@ -360,10 +360,11 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
|
||||
|
||||
// HRM
|
||||
$tmpentry = array(
|
||||
'enabled'=>(!empty($conf->hrm->enabled) || !empty($conf->holiday->enabled) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)),
|
||||
'enabled'=>(!empty($conf->hrm->enabled) || (!empty($conf->holiday->enabled)) || !empty($conf->deplacement->enabled) || !empty($conf->expensereport->enabled) || !empty($conf->recruitment->enabled)),
|
||||
'perms'=>(!empty($user->rights->hrm->employee->read) || !empty($user->rights->holiday->write) || !empty($user->rights->deplacement->lire) || !empty($user->rights->expensereport->lire) || !empty($user->rights->recruitment->recruitmentjobposition->read)),
|
||||
'module'=>'hrm|holiday|deplacement|expensereport|recruitment'
|
||||
);
|
||||
|
||||
$menu_arr[] = array(
|
||||
'name' => 'HRM',
|
||||
'link' => '/hrm/index.php?mainmenu=hrm&leftmenu=',
|
||||
@ -1592,7 +1593,7 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
|
||||
if ($conf->supplier_order->enabled) {
|
||||
$newmenu->add("/product/stock/replenish.php", $langs->trans("Replenishment"), 1, $user->rights->stock->mouvement->creer && $user->rights->fournisseur->lire);
|
||||
}
|
||||
$newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->rights->produit->lire && $user->rights->stock->lire && $conf->global->MAIN_FEATURES_LEVEL >= 2);
|
||||
$newmenu->add("/product/stock/stockatdate.php", $langs->trans("StockAtDate"), 1, $user->rights->produit->lire && $user->rights->stock->lire);
|
||||
|
||||
// Categories for warehouses
|
||||
if (!empty($conf->categorie->enabled)) {
|
||||
|
||||
@ -32,10 +32,13 @@ class MenuManager
|
||||
|
||||
public $type_user = 0; // Put 0 for internal users, 1 for external users
|
||||
public $atarget = ""; // To store default target to use onto links
|
||||
public $name = "empty";
|
||||
|
||||
public $menu;
|
||||
public $menu_array_after;
|
||||
|
||||
public $tabMenu;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
@ -60,6 +63,7 @@ class MenuManager
|
||||
public function loadMenu($forcemainmenu = '', $forceleftmenu = '')
|
||||
{
|
||||
// Do nothing
|
||||
$this->tabMenu = array();
|
||||
}
|
||||
|
||||
|
||||
@ -348,14 +352,29 @@ class MenuManager
|
||||
|
||||
// ***** END *****
|
||||
|
||||
$menu_array_before = array();
|
||||
$menu_array_after = array();
|
||||
|
||||
// do not change code after this
|
||||
|
||||
$menu_array = $this->menu->liste;
|
||||
if (is_array($menu_array_before)) {
|
||||
$menu_array = array_merge($menu_array_before, $menu_array);
|
||||
}
|
||||
if (is_array($menu_array_after)) {
|
||||
$menu_array = array_merge($menu_array, $menu_array_after);
|
||||
}
|
||||
//var_dump($menu_array);exit;
|
||||
if (!is_array($menu_array)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (empty($noout)) {
|
||||
$alt = 0; $altok = 0; $blockvmenuopened = false;
|
||||
$num = count($this->menu->liste);
|
||||
$num = count($menu_array);
|
||||
for ($i = 0; $i < $num; $i++) {
|
||||
$alt++;
|
||||
if (empty($this->menu->liste[$i]['level'])) {
|
||||
if (empty($menu_array[$i]['level'])) {
|
||||
$altok++;
|
||||
$blockvmenuopened = true;
|
||||
$lastopened = true;
|
||||
@ -375,55 +394,55 @@ class MenuManager
|
||||
|
||||
// Add tabulation
|
||||
$tabstring = '';
|
||||
$tabul = ($this->menu->liste[$i]['level'] - 1);
|
||||
$tabul = ($menu_array[$i]['level'] - 1);
|
||||
if ($tabul > 0) {
|
||||
for ($j = 0; $j < $tabul; $j++) {
|
||||
$tabstring .= ' ';
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->menu->liste[$i]['level'] == 0) {
|
||||
if ($this->menu->liste[$i]['enabled']) {
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.dol_buildpath($this->menu->liste[$i]['url'], 1).'"'.($this->menu->liste[$i]['target'] ? ' target="'.$this->menu->liste[$i]['target'].'"' : '').'>'.$this->menu->liste[$i]['titre'].'</a></div>'."\n";
|
||||
if ($menu_array[$i]['level'] == 0) {
|
||||
if ($menu_array[$i]['enabled']) {
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.dol_buildpath($menu_array[$i]['url'], 1).'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>'.$menu_array[$i]['titre'].'</a></div>'."\n";
|
||||
} else {
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$this->menu->liste[$i]['titre'].'</font></div>'."\n";
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n";
|
||||
}
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
|
||||
if ($this->menu->liste[$i]['level'] > 0) {
|
||||
if ($menu_array[$i]['level'] > 0) {
|
||||
$cssmenu = '';
|
||||
if ($this->menu->liste[$i]['url']) {
|
||||
$cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $this->menu->liste[$i]['url']));
|
||||
if ($menu_array[$i]['url']) {
|
||||
$cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url']));
|
||||
}
|
||||
|
||||
print '<div class="menu_contenu'.$cssmenu.'">';
|
||||
|
||||
if ($this->menu->liste[$i]['enabled']) {
|
||||
if ($menu_array[$i]['enabled']) {
|
||||
print $tabstring;
|
||||
if ($this->menu->liste[$i]['url']) {
|
||||
print '<a class="vsmenu" itle="'.dol_escape_htmltag($this->menu->liste[$i]['titre']).'" href="'.dol_buildpath($this->menu->liste[$i]['url'], 1).'"'.($this->menu->liste[$i]['target'] ? ' target="'.$this->menu->liste[$i]['target'].'"' : '').'>';
|
||||
if ($menu_array[$i]['url']) {
|
||||
print '<a class="vsmenu" itle="'.dol_escape_htmltag($menu_array[$i]['titre']).'" href="'.dol_buildpath($menu_array[$i]['url'], 1).'"'.($menu_array[$i]['target'] ? ' target="'.$menu_array[$i]['target'].'"' : '').'>';
|
||||
} else {
|
||||
print '<span class="vsmenu" title="'.dol_escape_htmltag($this->menu->liste[$i]['titre']).'">';
|
||||
print '<span class="vsmenu" title="'.dol_escape_htmltag($menu_array[$i]['titre']).'">';
|
||||
}
|
||||
if ($this->menu->liste[$i]['url']) {
|
||||
print $this->menu->liste[$i]['titre'].'</a>';
|
||||
if ($menu_array[$i]['url']) {
|
||||
print $menu_array[$i]['titre'].'</a>';
|
||||
} else {
|
||||
print '</span>';
|
||||
}
|
||||
} else {
|
||||
print $tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$this->menu->liste[$i]['titre'].'</font>';
|
||||
print $tabstring.'<font class="vsmenudisabled vsmenudisabledmargin">'.$menu_array[$i]['titre'].'</font>';
|
||||
}
|
||||
|
||||
// If title is not pure text and contains a table, no carriage return added
|
||||
if (!strstr($this->menu->liste[$i]['titre'], '<table')) {
|
||||
if (!strstr($menu_array[$i]['titre'], '<table')) {
|
||||
print '<br>';
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
// If next is a new block or end
|
||||
if (empty($this->menu->liste[$i + 1]['level'])) {
|
||||
if (empty($menu_array[$i + 1]['level'])) {
|
||||
print '<div class="menu_end"></div>'."\n";
|
||||
print "</div>\n";
|
||||
}
|
||||
@ -436,66 +455,9 @@ class MenuManager
|
||||
|
||||
if ($mode == 'jmobile') {
|
||||
$this->leftmenu = clone $this->menu;
|
||||
unset($this->menu->liste);
|
||||
unset($menu_array);
|
||||
}
|
||||
}
|
||||
/*
|
||||
if ($mode == 'jmobile')
|
||||
{
|
||||
$substitarray = getCommonSubstitutionArray($langs, 0, null, null);
|
||||
|
||||
foreach($this->menu->liste as $key => $val) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
print '<ul class="ulmenu" data-inset="true">';
|
||||
print '<li class="lilevel0">';
|
||||
|
||||
$val['url'] = make_substitutions($val['url'], $substitarray);
|
||||
|
||||
if ($val['enabled'] == 1)
|
||||
{
|
||||
$relurl=dol_buildpath($val['url'],1);
|
||||
|
||||
print '<a href="#">'.$val['titre'].'</a>'."\n";
|
||||
// Search submenu fot this entry
|
||||
$tmpmainmenu=$val['mainmenu'];
|
||||
$tmpleftmenu='all';
|
||||
//$submenu=new Menu();
|
||||
//$res=print_left_eldy_menu($this->db,$this->menu_array,$this->menu_array_after,$this->tabMenu,$submenu,1,$tmpmainmenu,$tmpleftmenu, null, $this->type_user);
|
||||
//$nexturl=dol_buildpath($submenu->liste[0]['url'],1);
|
||||
$submenu=$this->leftmenu;
|
||||
|
||||
$canonrelurl=preg_replace('/\?.*$/','',$relurl);
|
||||
$canonnexturl=preg_replace('/\?.*$/','',$nexturl);
|
||||
//var_dump($canonrelurl);
|
||||
//var_dump($canonnexturl);
|
||||
print '<ul>';
|
||||
if ($canonrelurl != $canonnexturl && ! in_array($val['mainmenu'],array('home','tools')))
|
||||
{
|
||||
// We add sub entry
|
||||
print '<li><a href="'.$relurl.'">'.$langs->trans("MainArea").'-'.$val['titre'].'</a></li>'."\n";
|
||||
}
|
||||
foreach($submenu->liste as $key2 => $val2) // $val['url','titre','level','enabled'=0|1|2,'target','mainmenu','leftmenu'
|
||||
{
|
||||
$val2['url'] = make_substitutions($val2['url'], $substitarray);
|
||||
|
||||
$relurl2=dol_buildpath($val2['url'],1);
|
||||
//var_dump($val2);
|
||||
print '<li><a href="'.$relurl2.'">'.$val2['titre'].'</a></li>'."\n";
|
||||
}
|
||||
//var_dump($submenu);
|
||||
print '</ul>';
|
||||
}
|
||||
if ($val['enabled'] == 2)
|
||||
{
|
||||
print '<font class="vsmenudisabled">'.$val['titre'].'</font>';
|
||||
}
|
||||
print '</li>';
|
||||
print '</ul>'."\n";
|
||||
|
||||
break; // Only first menu entry (so home)
|
||||
}
|
||||
}
|
||||
*/
|
||||
unset($this->menu);
|
||||
|
||||
return $res;
|
||||
|
||||
@ -1250,12 +1250,13 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
//print "Remove box ".$file.'<br>';
|
||||
if ($file == 'box_graph_product_distribution.php') {
|
||||
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||
dol_syslog("We discard disabling of module ".$file." because another module still active require it.");
|
||||
dol_syslog("We discard deleting module ".$file." because another module still active requires it.");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($file)) { $file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] : ''; // For backward compatibility
|
||||
if (empty($file)) {
|
||||
$file = isset($this->boxes[$key][1]) ? $this->boxes[$key][1] : ''; // For backward compatibility
|
||||
}
|
||||
|
||||
if ($this->db->type == 'sqlite3') {
|
||||
@ -1284,7 +1285,7 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes_def";
|
||||
$sql .= " WHERE file = '".$this->db->escape($file)."'";
|
||||
$sql .= " AND entity = ".$conf->entity;
|
||||
$sql .= " AND entity = ".$conf->entity; // Do not use getEntity here, we want to delete only in current company
|
||||
|
||||
dol_syslog(get_class($this)."::delete_boxes", LOG_DEBUG);
|
||||
$resql = $this->db->query($sql);
|
||||
|
||||
@ -69,7 +69,9 @@ class modBookmark extends DolibarrModules
|
||||
$this->const = array();
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array(0=>array('file'=>'box_bookmarks.php', 'enabledbydefaulton'=>'Home'));
|
||||
$this->boxes = array(
|
||||
0=>array('file'=>'box_bookmarks.php', 'enabledbydefaulton'=>'Home')
|
||||
);
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
|
||||
@ -386,10 +386,10 @@ class modCategorie extends DolibarrModules
|
||||
)
|
||||
);
|
||||
$typeexample = "";
|
||||
if ($conf->product->enabled) { $typeexample .= ($typeexample ? "/" : "")."0=Product"; }
|
||||
if (!empty($conf->product->enabled)) { $typeexample .= ($typeexample ? "/" : "")."0=Product"; }
|
||||
if (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)) { $typeexample .= ($typeexample ? "/" : "")."1=Supplier"; }
|
||||
if ($conf->societe->enabled) { $typeexample .= ($typeexample ? "/" : "")."2=Customer-Prospect"; }
|
||||
if ($conf->adherent->enabled) { $typeexample .= ($typeexample ? "/" : "")."3=Member"; }
|
||||
if (!empty($conf->societe->enabled)) { $typeexample .= ($typeexample ? "/" : "")."2=Customer-Prospect"; }
|
||||
if (!empty($conf->adherent->enabled)) { $typeexample .= ($typeexample ? "/" : "")."3=Member"; }
|
||||
$this->import_examplevalues_array[$r] = array(
|
||||
'ca.label'=>"Supplier Category", 'ca.type'=>$typeexample, 'ca.description'=>"My Category description",
|
||||
'ca.fk_parent' => '0'
|
||||
|
||||
@ -291,7 +291,7 @@ class modExpedition extends DolibarrModules
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'expedition as c';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'expedition_extrafields as extra ON c.rowid = extra.fk_object,';
|
||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'societe as s';
|
||||
if (!$user->rights->societe->client->voir) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
|
||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'expeditiondet as ed';
|
||||
@ -306,7 +306,7 @@ class modExpedition extends DolibarrModules
|
||||
}
|
||||
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';
|
||||
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('expedition').')';
|
||||
if (!$user->rights->societe->client->voir) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -138,16 +138,12 @@ class modProjet extends DolibarrModules
|
||||
$r++;
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
$r = 0;
|
||||
$this->boxes[$r][1] = "box_project.php";
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "box_task.php";
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "box_validated_projects.php";
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "box_funnel_of_prospection.php";
|
||||
$r++;
|
||||
$this->boxes = array(
|
||||
0=>array('file'=>'box_project.php', 'enabledbydefaulton'=>'Home'),
|
||||
1=>array('file'=>'box_task.php', 'enabledbydefaulton'=>'Home'),
|
||||
2=>array('file'=>'box_validated_projects.php', 'enabledbydefaulton'=>'Home'),
|
||||
3=>array('file'=>'box_funnel_of_prospection.php', 'enabledbydefaulton'=>'Home'),
|
||||
);
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
|
||||
@ -241,7 +241,7 @@ class modPropale extends DolibarrModules
|
||||
$this->export_sql_end[$r] = ' FROM '.MAIN_DB_PREFIX.'societe as s ';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra4 ON s.rowid = extra4.fk_object';
|
||||
|
||||
if (!$user->rights->societe->client->voir) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe_commerciaux as sc ON sc.fk_soc = s.rowid';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
|
||||
$this->export_sql_end[$r] .= ' '.MAIN_DB_PREFIX.'propal as c';
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pj ON c.fk_projet = pj.rowid';
|
||||
@ -254,7 +254,7 @@ class modPropale extends DolibarrModules
|
||||
$this->export_sql_end[$r] .= ' LEFT JOIN '.MAIN_DB_PREFIX.'product_extrafields as extra3 on p.rowid = extra3.fk_object';
|
||||
$this->export_sql_end[$r] .= ' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal';
|
||||
$this->export_sql_end[$r] .= ' AND c.entity IN ('.getEntity('propal').')';
|
||||
if (!$user->rights->societe->client->voir) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
||||
if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .= ' AND sc.fk_user = '.$user->id;
|
||||
|
||||
// Imports
|
||||
//--------
|
||||
|
||||
@ -122,20 +122,14 @@ class modSociete extends DolibarrModules
|
||||
$r++;
|
||||
|
||||
// Boxes
|
||||
$this->boxes = array();
|
||||
$r = 0;
|
||||
$this->boxes[$r][1] = "box_clients.php";
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "box_prospect.php";
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "box_contacts.php";
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "box_activity.php";
|
||||
$this->boxes[$r][2] = '(WarningUsingThisBoxSlowDown)';
|
||||
$r++;
|
||||
$this->boxes[$r][1] = "box_goodcustomers.php";
|
||||
$this->boxes[$r][2] = '(WarningUsingThisBoxSlowDown)';
|
||||
$r++;
|
||||
$this->boxes = array(
|
||||
0=>array('file'=>'box_clients.php', 'enabledbydefaulton'=>'Home'),
|
||||
1=>array('file'=>'box_prospect.php', 'enabledbydefaulton'=>'Home'),
|
||||
2=>array('file'=>'box_contacts.php', 'enabledbydefaulton'=>'Home'),
|
||||
3=>array('file'=>'box_activity.php', 'enabledbydefaulton'=>'Home', 'note'=>'(WarningUsingThisBoxSlowDown)'),
|
||||
4=>array('file'=>'box_goodcustomers.php', 'enabledbydefaulton'=>'Home', 'note'=>'(WarningUsingThisBoxSlowDown)'),
|
||||
);
|
||||
|
||||
// Permissions
|
||||
$this->rights = array();
|
||||
$this->rights_class = 'societe';
|
||||
|
||||
@ -139,15 +139,10 @@ class modTicket extends DolibarrModules
|
||||
|
||||
// Boxes
|
||||
// Add here list of php file(s) stored in core/boxes that contains class to show a box.
|
||||
$this->boxes = array(); // Boxes list
|
||||
$r = 0;
|
||||
// Example:
|
||||
|
||||
$this->boxes[$r][1] = "box_last_ticket";
|
||||
$r++;
|
||||
|
||||
$this->boxes[$r][1] = "box_last_modified_ticket";
|
||||
$r++;
|
||||
$this->boxes = array(
|
||||
0=>array('file'=>'box_last_ticket.php', 'enabledbydefaulton'=>'Home'),
|
||||
1=>array('file'=>'box_last_modified_ticket.php', 'enabledbydefaulton'=>'Home')
|
||||
); // Boxes list
|
||||
|
||||
// Permissions
|
||||
$this->rights = array(); // Permission array used by this module
|
||||
|
||||
@ -132,8 +132,9 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
$langs->load('ticket');
|
||||
|
||||
// Send email to notification email
|
||||
$sendto = $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||
if (!empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) && empty($object->context['disableticketemail'])) {
|
||||
$sendto = empty($conf->global->TICKET_NOTIFICATION_EMAIL_TO) ? '' : $conf->global->TICKET_NOTIFICATION_EMAIL_TO;
|
||||
|
||||
if ($sendto) {
|
||||
// Init to avoid errors
|
||||
$filepath = array();
|
||||
@ -246,7 +247,7 @@ class InterfaceTicketEmail extends DolibarrTriggers
|
||||
$message_customer .= '<p>'.$langs->trans('TicketNewEmailBodyInfosTrackUrlCustomer').' : <a href="'.$url_public_ticket.'">'.$url_public_ticket.'</a></p>';
|
||||
$message_customer .= '<p>'.$langs->trans('TicketEmailPleaseDoNotReplyToThisEmail').'</p>';
|
||||
|
||||
$from = $conf->global->MAIN_INFO_SOCIETE_NOM.'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$from = (empty($conf->global->MAIN_INFO_SOCIETE_NOM) ? '' : $conf->global->MAIN_INFO_SOCIETE_NOM.' ').'<'.$conf->global->TICKET_NOTIFICATION_EMAIL_FROM.'>';
|
||||
$replyto = $from;
|
||||
|
||||
$trackid = 'tic'.$object->id;
|
||||
|
||||
@ -48,7 +48,7 @@ class Delivery extends CommonObject
|
||||
public $element = "delivery";
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = "fk_delivery";
|
||||
|
||||
@ -58,7 +58,7 @@ class Delivery extends CommonObject
|
||||
public $table_element = "delivery";
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = "deliverydet";
|
||||
|
||||
|
||||
@ -47,7 +47,7 @@ class Don extends CommonObject
|
||||
public $table_element = 'don';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_donation';
|
||||
|
||||
|
||||
@ -52,13 +52,14 @@ class EmailCollector extends CommonObject
|
||||
* @var int Does emailcollector support extrafields ? 0=No, 1=Yes
|
||||
*/
|
||||
public $isextrafieldmanaged = 0;
|
||||
|
||||
/**
|
||||
* @var string String with name of icon for emailcollector. Must be the part after the 'object_' into object_emailcollector.png
|
||||
*/
|
||||
public $picto = 'generic';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_emailcollector';
|
||||
|
||||
@ -158,7 +159,9 @@ class EmailCollector extends CommonObject
|
||||
*/
|
||||
public $date_creation;
|
||||
|
||||
|
||||
/**
|
||||
* @var int timestamp
|
||||
*/
|
||||
public $tms;
|
||||
|
||||
/**
|
||||
@ -171,6 +174,9 @@ class EmailCollector extends CommonObject
|
||||
*/
|
||||
public $fk_user_modif;
|
||||
|
||||
/**
|
||||
* @var string import key
|
||||
*/
|
||||
public $import_key;
|
||||
|
||||
|
||||
|
||||
@ -118,17 +118,17 @@ class EmailCollectorAction extends CommonObject
|
||||
// If this object has a subtable with lines
|
||||
|
||||
// /**
|
||||
// * @var int Name of subtable line
|
||||
// * @var string Name of subtable line
|
||||
// */
|
||||
//public $table_element_line = 'emailcollectoractiondet';
|
||||
|
||||
// /**
|
||||
// * @var int Field with ID of parent key if this field has a parent
|
||||
// * @var string Field with ID of parent key if this field has a parent
|
||||
// */
|
||||
//public $fk_element = 'fk_emailcollectoraction';
|
||||
|
||||
// /**
|
||||
// * @var int Name of subtable class that manage subtable lines
|
||||
// * @var string Name of subtable class that manage subtable lines
|
||||
// */
|
||||
//public $class_element_line = 'EmailcollectorActionline';
|
||||
|
||||
|
||||
@ -55,7 +55,7 @@ class Expedition extends CommonObject
|
||||
public $element = "shipping";
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = "fk_expedition";
|
||||
|
||||
@ -65,7 +65,7 @@ class Expedition extends CommonObject
|
||||
public $table_element = "expedition";
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = "expeditiondet";
|
||||
|
||||
|
||||
@ -44,7 +44,14 @@ class ExpenseReport extends CommonObject
|
||||
*/
|
||||
public $table_element = 'expensereport';
|
||||
|
||||
/**
|
||||
* @var string table element line name
|
||||
*/
|
||||
public $table_element_line = 'expensereport_det';
|
||||
|
||||
/**
|
||||
* @var string Fieldname with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_expensereport';
|
||||
|
||||
/**
|
||||
|
||||
@ -40,7 +40,7 @@ class ExpenseReportIk extends CoreObject
|
||||
public $table_element = 'expensereport_ik';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_expense_ik';
|
||||
|
||||
|
||||
@ -40,7 +40,7 @@ class ExpenseReportRule extends CoreObject
|
||||
public $table_element = 'expensereport_rules';
|
||||
|
||||
/**
|
||||
* @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_expense_rule';
|
||||
|
||||
|
||||
@ -35,6 +35,8 @@ class Export
|
||||
*/
|
||||
public $db;
|
||||
|
||||
public $error;
|
||||
|
||||
public $array_export_code = array(); // Tableau de "idmodule_numlot"
|
||||
public $array_export_module = array(); // Tableau de "nom de modules"
|
||||
public $array_export_label = array(); // Tableau de "libelle de lots"
|
||||
@ -139,11 +141,10 @@ class Export
|
||||
{
|
||||
$perm = $val;
|
||||
//print_r("$perm[0]-$perm[1]-$perm[2]<br>");
|
||||
if (!empty($perm[2]))
|
||||
{
|
||||
$bool = $user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]};
|
||||
if (!empty($perm[2])) {
|
||||
$bool = isset($user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]}) ? $user->rights->{$perm[0]}->{$perm[1]}->{$perm[2]} : false;
|
||||
} else {
|
||||
$bool = $user->rights->{$perm[0]}->{$perm[1]};
|
||||
$bool = isset($user->rights->{$perm[0]}->{$perm[1]}) ? $user->rights->{$perm[0]}->{$perm[1]} : false;
|
||||
}
|
||||
if ($perm[0] == 'user' && $user->admin) $bool = true;
|
||||
if (!$bool) break;
|
||||
@ -185,14 +186,14 @@ class Export
|
||||
// Tableau des operations speciales sur champ
|
||||
$this->array_export_special[$i] = (!empty($module->export_special_array[$r]) ? $module->export_special_array[$r] : '');
|
||||
// Array of examples
|
||||
$this->array_export_examplevalues[$i] = $module->export_examplevalues_array[$r];
|
||||
$this->array_export_examplevalues[$i] = (!empty($module->export_examplevalues_array[$r]) ? $module->export_examplevalues_array[$r] : null);
|
||||
// Array of help tooltips
|
||||
$this->array_export_help[$i] = (!empty($module->export_help_array[$r]) ? $module->export_help_array[$r] : '');
|
||||
|
||||
// Requete sql du dataset
|
||||
$this->array_export_sql_start[$i] = $module->export_sql_start[$r];
|
||||
$this->array_export_sql_end[$i] = $module->export_sql_end[$r];
|
||||
$this->array_export_sql_order[$i] = $module->export_sql_order[$r];
|
||||
$this->array_export_sql_order[$i] = (!empty($module->export_sql_order[$r]) ? $module->export_sql_order[$r] : null);
|
||||
//$this->array_export_sql[$i]=$module->export_sql[$r];
|
||||
|
||||
dol_syslog(get_class($this)."::load_arrays loaded for module ".$modulename." with index ".$i.", dataset=".$module->export_code[$r].", nb of fields=".(!empty($module->export_fields_code[$r]) ?count($module->export_fields_code[$r]) : ''));
|
||||
@ -580,9 +581,12 @@ class Export
|
||||
if ($resql)
|
||||
{
|
||||
//$this->array_export_label[$indice]
|
||||
if ($conf->global->EXPORT_PREFIX_SPEC)
|
||||
if (!empty($conf->global->EXPORT_PREFIX_SPEC)) {
|
||||
$filename = $conf->global->EXPORT_PREFIX_SPEC."_".$datatoexport;
|
||||
else $filename = "export_".$datatoexport;
|
||||
}
|
||||
else {
|
||||
$filename = "export_".$datatoexport;
|
||||
}
|
||||
$filename .= '.'.$objmodel->getDriverExtension();
|
||||
$dirname = $conf->export->dir_temp.'/'.$user->id;
|
||||
|
||||
@ -598,7 +602,7 @@ class Export
|
||||
$objmodel->write_header($outputlangs);
|
||||
|
||||
// Genere ligne de titre
|
||||
$objmodel->write_title($this->array_export_fields[$indice], $array_selected, $outputlangs, $this->array_export_TypeFields[$indice]);
|
||||
$objmodel->write_title($this->array_export_fields[$indice], $array_selected, $outputlangs, isset($this->array_export_TypeFields[$indice]) ? $this->array_export_TypeFields[$indice] : null);
|
||||
|
||||
while ($obj = $this->db->fetch_object($resql))
|
||||
{
|
||||
@ -651,18 +655,20 @@ class Export
|
||||
}
|
||||
$obj->$alias = $remaintopay;
|
||||
} else {
|
||||
// TODO FIXME Export of compute field does not work. $obj containt $obj->alias_field and formulat will contains $obj->field
|
||||
// TODO FIXME
|
||||
// Export of compute field does not work. $obj contains $obj->alias_field and formula may contains $obj->field
|
||||
// Also the formula may contains objects of class that are not loaded.
|
||||
$computestring = $this->array_export_special[$indice][$key];
|
||||
$tmp = dol_eval($computestring, 1, 0);
|
||||
$obj->$alias = $tmp;
|
||||
//$tmp = dol_eval($computestring, 1, 0);
|
||||
//$obj->$alias = $tmp;
|
||||
|
||||
$this->error = "ERROPNOTSUPPORTED. Operation ".$this->array_export_special[$indice][$key]." not supported. Export of 'computed' extrafields is not yet supported, please remove field.";
|
||||
$this->error = "ERROPNOTSUPPORTED. Operation ".$computestring." not supported. Export of 'computed' extrafields is not yet supported, please remove field.";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
// end of special operation processing
|
||||
$objmodel->write_record($array_selected, $obj, $outputlangs, $this->array_export_TypeFields[$indice]);
|
||||
$objmodel->write_record($array_selected, $obj, $outputlangs, isset($this->array_export_TypeFields[$indice]) ? $this->array_export_TypeFields[$indice] : null);
|
||||
}
|
||||
|
||||
// Genere en-tete
|
||||
|
||||
@ -76,7 +76,7 @@ class Fichinter extends CommonObject
|
||||
public $table_element = 'fichinter';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_fichinter';
|
||||
|
||||
@ -1435,7 +1435,7 @@ class FichinterLigne extends CommonObjectLine
|
||||
public $table_element = 'fichinterdet';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_fichinter';
|
||||
|
||||
|
||||
@ -41,6 +41,10 @@ class FichinterRec extends Fichinter
|
||||
public $element = 'fichinterrec';
|
||||
public $table_element = 'fichinter_rec';
|
||||
public $table_element_line = 'fichinter_rec';
|
||||
|
||||
/**
|
||||
* @var string Fieldname with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_fichinter';
|
||||
|
||||
/**
|
||||
|
||||
@ -53,12 +53,12 @@ class CommandeFournisseur extends CommonOrder
|
||||
public $table_element = 'commande_fournisseur';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'commande_fournisseurdet';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_commande';
|
||||
|
||||
|
||||
@ -57,12 +57,12 @@ class FactureFournisseur extends CommonInvoice
|
||||
public $table_element = 'facture_fourn';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'facture_fourn_det';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_facture_fourn';
|
||||
|
||||
@ -336,7 +336,7 @@ class FactureFournisseur extends CommonInvoice
|
||||
/**
|
||||
* Create supplier invoice into database
|
||||
*
|
||||
* @param User $user object utilisateur qui cree
|
||||
* @param User $user user object that creates
|
||||
* @return int Id invoice created if OK, < 0 if KO
|
||||
*/
|
||||
public function create($user)
|
||||
@ -1251,8 +1251,8 @@ class FactureFournisseur extends CommonInvoice
|
||||
* Tag invoice as a payed invoice
|
||||
*
|
||||
* @param User $user Object user
|
||||
* @param string $close_code Code renseigne si on classe a payee completement alors que paiement incomplet. Not implementd yet.
|
||||
* @param string $close_note Commentaire renseigne si on classe a payee alors que paiement incomplet. Not implementd yet.
|
||||
* @param string $close_code Code indicates whether the class has paid in full while payment is incomplete. Not implementd yet.
|
||||
* @param string $close_note Comment informs if the class has been paid while payment is incomplete. Not implementd yet.
|
||||
* @return int <0 si ko, >0 si ok
|
||||
*/
|
||||
public function set_paid($user, $close_code = '', $close_note = '')
|
||||
@ -1294,9 +1294,9 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Tag la facture comme non payee completement + appel trigger BILL_UNPAYED
|
||||
* Fonction utilisee quand un paiement prelevement est refuse,
|
||||
* ou quand une facture annulee et reouverte.
|
||||
* Tag the invoice as not fully paid + trigger call BILL_UNPAYED
|
||||
* Function used when a direct debit payment is refused,
|
||||
* or when the invoice was canceled and reopened.
|
||||
*
|
||||
* @param User $user Object user that change status
|
||||
* @return int <0 si ok, >0 si ok
|
||||
@ -1579,25 +1579,25 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
|
||||
/**
|
||||
* Ajoute une ligne de facture (associe a aucun produit/service predefini)
|
||||
* Les parametres sont deja cense etre juste et avec valeurs finales a l'appel
|
||||
* de cette methode. Aussi, pour le taux tva, il doit deja avoir ete defini
|
||||
* par l'appelant par la methode get_default_tva(societe_vendeuse,societe_acheteuse,idprod)
|
||||
* et le desc doit deja avoir la bonne valeur (a l'appelant de gerer le multilangue).
|
||||
* Adds an invoice line (associated with no predefined product/service)
|
||||
* The parameters are already supposed to be correct and with final values when calling
|
||||
* this method. Also, for the VAT rate, it must already have been defined by the caller by
|
||||
* by the get_default_tva method(vendor_company, buying company, idprod) and the desc must
|
||||
* already have the right value (the caller has to manage the multilanguage).
|
||||
*
|
||||
* @param string $desc Description de la ligne
|
||||
* @param double $pu Prix unitaire (HT ou TTC selon price_base_type, > 0 even for credit note)
|
||||
* @param string $desc Description of the line
|
||||
* @param double $pu Unit price (HT or TTC according to price_base_type, > 0 even for credit note)
|
||||
* @param double $txtva Force Vat rate to use, -1 for auto.
|
||||
* @param double $txlocaltax1 LocalTax1 Rate
|
||||
* @param double $txlocaltax2 LocalTax2 Rate
|
||||
* @param double $qty Quantite
|
||||
* @param double $qty Quantity
|
||||
* @param int $fk_product Product/Service ID predefined
|
||||
* @param double $remise_percent Percentage discount of the line
|
||||
* @param integer $date_start Date de debut de validite du service
|
||||
* @param integer $date_end Date de fin de validite du service
|
||||
* @param string $ventil Code de ventilation comptable
|
||||
* @param int $info_bits Bits de type de lines
|
||||
* @param string $price_base_type HT ou TTC
|
||||
* @param integer $date_start Service start date
|
||||
* @param integer $date_end Service expiry date
|
||||
* @param string $ventil Accounting breakdown code
|
||||
* @param int $info_bits Line type bits
|
||||
* @param string $price_base_type HT or TTC
|
||||
* @param int $type Type of line (0=product, 1=service)
|
||||
* @param int $rang Position of line
|
||||
* @param int $notrigger Disable triggers
|
||||
@ -2046,9 +2046,9 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
|
||||
/**
|
||||
* Charge les informations d'ordre info dans l'objet facture
|
||||
* Loads the info order information into the invoice object
|
||||
*
|
||||
* @param int $id Id de la facture a charger
|
||||
* @param int $id Id of the invoice to load
|
||||
* @return void
|
||||
*/
|
||||
public function info($id)
|
||||
@ -2095,11 +2095,11 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoi liste des factures remplacables
|
||||
* Statut validee ou abandonnee pour raison autre + non payee + aucun paiement + pas deja remplacee
|
||||
* Return list of replaceable invoices
|
||||
* Status valid or abandoned for other reason + not paid + no payment + not already replaced
|
||||
*
|
||||
* @param int $socid Id societe
|
||||
* @return array|int Tableau des factures ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
|
||||
* @param int $socid Thirdparty id
|
||||
* @return array|int Table of invoices ('id'=>id, 'ref'=>ref, 'status'=>status, 'paymentornot'=>0/1)
|
||||
* <0 if error
|
||||
*/
|
||||
public function list_replacable_supplier_invoices($socid = 0)
|
||||
@ -2144,12 +2144,12 @@ class FactureFournisseur extends CommonInvoice
|
||||
|
||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||
/**
|
||||
* Renvoi liste des factures qualifiables pour correction par avoir
|
||||
* Les factures qui respectent les regles suivantes sont retournees:
|
||||
* (validee + paiement en cours) ou classee (payee completement ou payee partiellement) + pas deja remplacee + pas deja avoir
|
||||
* Return list of qualifying invoices for correction by credit note
|
||||
* Invoices that respect the following rules are returned:
|
||||
* (validated + payment in progress) or classified (paid in full or paid in part) + not already replaced + not already having
|
||||
*
|
||||
* @param int $socid Id societe
|
||||
* @return array|int Tableau des factures ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>)
|
||||
* @param int $socid Thirdparty id
|
||||
* @return array|int Table of invoices ($id => array('ref'=>,'paymentornot'=>,'status'=>,'paye'=>)
|
||||
* <0 if error
|
||||
*/
|
||||
public function list_qualified_avoir_supplier_invoices($socid = 0)
|
||||
|
||||
@ -148,11 +148,11 @@ if (empty($reshook))
|
||||
$description = trim(GETPOST('description', 'restricthtml'));
|
||||
|
||||
// Check that leave is for a user inside the hierarchy or advanced permission for all is set
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->creer)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->expensereport->writeall_advance))) {
|
||||
if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->write)) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->holiday->writeall_advance))) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("NotEnoughPermission"), null, 'errors');
|
||||
} else {
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->expensereport->writeall_advance)) {
|
||||
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || empty($user->rights->holiday->writeall_advance)) {
|
||||
if (!in_array($fuserid, $childids)) {
|
||||
$error++;
|
||||
setEventMessages($langs->trans("UserNotInHierachy"), null, 'errors');
|
||||
@ -403,7 +403,7 @@ if (empty($reshook))
|
||||
{
|
||||
$object->fetch($id);
|
||||
|
||||
// Si brouillon et créateur
|
||||
// If draft and owner of leave
|
||||
if ($object->statut == Holiday::STATUS_DRAFT && $cancreate)
|
||||
{
|
||||
$object->oldcopy = dol_clone($object);
|
||||
@ -430,7 +430,8 @@ if (empty($reshook))
|
||||
// From
|
||||
$expediteur = new User($db);
|
||||
$expediteur->fetch($object->fk_user);
|
||||
$emailFrom = $expediteur->email;
|
||||
//$emailFrom = $expediteur->email; Email of user can be an email into another company. Sending will fails, we must use the generic email.
|
||||
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
|
||||
// Subject
|
||||
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||
@ -441,6 +442,7 @@ if (empty($reshook))
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysToValidateBody")."\n";
|
||||
|
||||
$delayForRequest = $object->getConfCP('delayForRequest');
|
||||
@ -525,7 +527,7 @@ if (empty($reshook))
|
||||
{
|
||||
$object->fetch($id);
|
||||
|
||||
// Si statut en attente de validation et valideur = utilisateur
|
||||
// If status is waiting approval and approver is also user
|
||||
if ($object->statut == Holiday::STATUS_VALIDATED && $user->id == $object->fk_validator)
|
||||
{
|
||||
$object->oldcopy = dol_clone($object);
|
||||
@ -582,7 +584,8 @@ if (empty($reshook))
|
||||
// From
|
||||
$expediteur = new User($db);
|
||||
$expediteur->fetch($object->fk_validator);
|
||||
$emailFrom = $expediteur->email;
|
||||
//$emailFrom = $expediteur->email; Email of user can be an email into another company. Sending will fails, we must use the generic email.
|
||||
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
|
||||
// Subject
|
||||
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||
@ -593,6 +596,7 @@ if (empty($reshook))
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysValidatedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
|
||||
$message .= "- ".$langs->transnoentitiesnoconv("ValidatedBy")." : ".dolGetFirstLastname($expediteur->firstname, $expediteur->lastname)."\n";
|
||||
@ -666,7 +670,8 @@ if (empty($reshook))
|
||||
// From
|
||||
$expediteur = new User($db);
|
||||
$expediteur->fetch($object->fk_validator);
|
||||
$emailFrom = $expediteur->email;
|
||||
//$emailFrom = $expediteur->email; Email of user can be an email into another company. Sending will fails, we must use the generic email.
|
||||
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
|
||||
// Subject
|
||||
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||
@ -677,6 +682,7 @@ if (empty($reshook))
|
||||
// Content
|
||||
$message = $langs->transnoentitiesnoconv("Hello")." ".$destinataire->firstname.",\n";
|
||||
$message .= "\n";
|
||||
|
||||
$message .= $langs->transnoentities("HolidaysRefusedBody", dol_print_date($object->date_debut, 'day'), dol_print_date($object->date_fin, 'day'))."\n";
|
||||
$message .= GETPOST('detail_refuse', 'alpha')."\n\n";
|
||||
|
||||
@ -813,7 +819,8 @@ if (empty($reshook))
|
||||
// From
|
||||
$expediteur = new User($db);
|
||||
$expediteur->fetch($object->fk_user_cancel);
|
||||
$emailFrom = $expediteur->email;
|
||||
//$emailFrom = $expediteur->email; Email of user can be an email into another company. Sending will fails, we must use the generic email.
|
||||
$emailFrom = $conf->global->MAIN_MAIL_EMAIL_FROM;
|
||||
|
||||
// Subject
|
||||
$societeName = $conf->global->MAIN_INFO_SOCIETE_NOM;
|
||||
@ -962,8 +969,7 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
|
||||
print '<input type="hidden" name="token" value="'.newToken().'" />'."\n";
|
||||
print '<input type="hidden" name="action" value="add" />'."\n";
|
||||
|
||||
if (empty($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||
{
|
||||
if (empty($conf->global->HOLIDAY_HIDE_BALANCE)) {
|
||||
print dol_get_fiche_head('', '', '', -1);
|
||||
|
||||
$out = '';
|
||||
@ -973,15 +979,14 @@ if ((empty($id) && empty($ref)) || $action == 'create' || $action == 'add')
|
||||
$nb_type = $object->getCPforUser($user->id, $val['rowid']);
|
||||
$nb_holiday += $nb_type;
|
||||
|
||||
$out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
|
||||
$out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>';
|
||||
//$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
|
||||
}
|
||||
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>';
|
||||
print $out;
|
||||
|
||||
print dol_get_fiche_end();
|
||||
} elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE))
|
||||
{
|
||||
} elseif (!is_numeric($conf->global->HOLIDAY_HIDE_BALANCE)) {
|
||||
print $langs->trans($conf->global->HOLIDAY_HIDE_BALANCE).'<br>';
|
||||
}
|
||||
|
||||
|
||||
@ -50,7 +50,7 @@ class Holiday extends CommonObject
|
||||
public $ismultientitymanaged = 0;
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_holiday';
|
||||
|
||||
|
||||
@ -40,12 +40,12 @@ class Establishment extends CommonObject
|
||||
public $table_element = 'establishment';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = '';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_establishment';
|
||||
|
||||
|
||||
@ -153,7 +153,7 @@ if (!empty($conf->holiday->enabled))
|
||||
{
|
||||
$nb_type = $holiday->getCPforUser($user->id, $val['rowid']);
|
||||
$nb_holiday += $nb_type;
|
||||
$out .= ' - '.$val['label'].': <strong>'.($nb_type ?price2num($nb_type) : 0).'</strong><br>';
|
||||
$out .= ' - '.($langs->trans($val['code']) != $val['code'] ? $langs->trans($val['code']) : $val['label']).': <strong>'.($nb_type ? price2num($nb_type) : 0).'</strong><br>';
|
||||
}
|
||||
print $langs->trans('SoldeCPUser', round($nb_holiday, 5)).'<br>';
|
||||
print $out;
|
||||
|
||||
4
htdocs/includes/mike42/escpos-php/.gitignore
vendored
4
htdocs/includes/mike42/escpos-php/.gitignore
vendored
@ -4,9 +4,7 @@
|
||||
.buildpath
|
||||
|
||||
# doxygen files
|
||||
doc/html
|
||||
doc/latex
|
||||
doc/doxygen_sqlite3.db
|
||||
doc
|
||||
|
||||
# composer files
|
||||
vendor/
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
<?php
|
||||
/**
|
||||
* Users who do not have 'composer' to manage dependencies, include this
|
||||
* file to provide auto-loading of the classes in this library.
|
||||
* file to provide auto-loading of the classes in this library.
|
||||
*/
|
||||
spl_autoload_register( function ($class) {
|
||||
spl_autoload_register ( function ($class) {
|
||||
/*
|
||||
* PSR-4 autoloader, based on PHP Framework Interop Group snippet (Under MIT License.)
|
||||
* https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md
|
||||
*/
|
||||
$prefix = "Mike42\\";
|
||||
$base_dir = __DIR__ . "/src/Mike42/";
|
||||
|
||||
|
||||
/* Only continue for classes in this namespace */
|
||||
$len = strlen($prefix);
|
||||
if (strncmp($prefix, $class, $len) !== 0) {
|
||||
$len = strlen ( $prefix );
|
||||
if (strncmp ( $prefix, $class, $len ) !== 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Require the file if it exists */
|
||||
$relative_class = substr($class, $len);
|
||||
$file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
|
||||
if (file_exists($file)) {
|
||||
$relative_class = substr ( $class, $len );
|
||||
$file = $base_dir . str_replace ( '\\', '/', $relative_class ) . '.php';
|
||||
if (file_exists ( $file )) {
|
||||
require $file;
|
||||
}
|
||||
} );
|
||||
|
||||
@ -1,142 +0,0 @@
|
||||
# Frequently Asked Questions (FAQ)
|
||||
|
||||
## Can I print to File Format X with this?
|
||||
|
||||
If you are trying to generate XPS, PDF or DOCX or HTML files from PHP, then you are most likely in the wrong place.
|
||||
|
||||
The purpose of this driver it to generate binary ESC/POS code, which is understood by many embedded thermal receipt and impact printers.
|
||||
|
||||
## I have Printer X. Can I use this driver?
|
||||
|
||||
If the printer understands ESC/POS, and you know how to get raw binary data to it, then yes. Otherwise, no.
|
||||
|
||||
The [list of printers that are known to work](https://github.com/mike42/escpos-php/blob/development/README.md#printers) is crowd-sourced. We appreciate it when developers try out the driver, then [file information on the bug tracker](https://github.com/mike42/escpos-php/issues/new) with some information about which features worked on their model of printer.
|
||||
|
||||
To see how well your printer works, first check that it supports ESC/POS, then begin by attempting to send the text "Hello World" to your printer on the command-line, from the computer that will run PHP.
|
||||
|
||||
Once you solve this, [try to do the same from PHP](https://github.com/mike42/escpos-php/blob/development/README.md#basic-usage) using the default profile. Further details are in the [README](https://github.com/mike42/escpos-php/blob/development/README.md) file.
|
||||
|
||||
## Can you add support for Printer X?
|
||||
|
||||
Features vary between printers, so we collaborate on an ESC/POS printer compatibility database to collect known differences: [receipt-print-hq/escpos-printer-db](https://github.com/receipt-print-hq/escpos-printer-db).
|
||||
|
||||
If you encounter garbage output when you try to print images or special characters, then please submit a test page and a link to vendor documentation to the `escpos-printer-db` project, so that support can be improved for future versions.
|
||||
|
||||
## I have a printer that does not understand ESC/POS. Can I use this driver?
|
||||
|
||||
No. The purpose of this driver it to generate binary ESC/POS code. If your printer doesn't understand that, then this code wont be much use to you.
|
||||
|
||||
Some printers do have an emulation mode for ESC/POS. The vendor docs will tell if this is the case, and how to enable it.
|
||||
|
||||
## Why do I get this error when I try to print?
|
||||
|
||||
Start by testing that you can send text to your printer outside of escpos-php. The examples linked to in the README are commented with some commands to get you started.
|
||||
|
||||
Generally, initial setup problems seem to have one of these causes:
|
||||
|
||||
1. You are writing to the wrong place. Writing to `LPT1` does not output to parallel port on Linux, and `/dev/ttyS0` is not a serial printer on Windows.
|
||||
2. The printer has not been set up to accept printing the way you expect. This means permissions on Linux, network printers being configured, and shared printers having user accounts and firewalls set up correctly on the print server.
|
||||
3. Your printer actually doesn't work (rare but possible).
|
||||
|
||||
To be clear, these are not escpos-php issues: No amount of PHP code can set up your printer for you. Instead, the driver relies on developers determining how their setup is going to work before using a connector to transport data to their printer.
|
||||
|
||||
Once you have a working command to send text to your printer (from the PHP server), you are ready to use escpos-php. You can try to use a PrintConnector now, based on your operating system and printer interface. A table is located in the README to help you select the right one.
|
||||
|
||||
The connectors are-
|
||||
|
||||
- `FilePrintConnector` and `NetworkPrintConnector` directly use files or network sockets.
|
||||
- `WindowsPrintConnector` and `CupsPrintConnector` tie in with Windows and Unix system printing.
|
||||
- `DummyPrintConnector` does not connect to a real printer, and can be used to save ESC/POS receipts to a database, for example.
|
||||
|
||||
At this point, you might find that the way you would like to print is not supported by escpos-php. You can post your printing command as a feature request on the issue tracker.
|
||||
|
||||
Lastly, you may run in to the final common trap:
|
||||
|
||||
4. Your PHP is not running with the same sort of permissions as your login account. Again, no amount of PHP code can fix this. For example, on LAMP, your `www-data` user needs to be in the `lp` group, while on WAMP, `Local Service` account may run in to problems. SELinux and firewalls are also worth a look.
|
||||
|
||||
When printing fails, you can expect a PHP Exception that explains what went wrong. They are all clues:
|
||||
|
||||
- `Warning: copy(\\pc\printer): failed to open stream: Permission denied`
|
||||
- `/dev/usb/lp0: Permission denied`
|
||||
- `User name or password is incorrect`
|
||||
|
||||
Ensure that while you are developing, you configure PHP to show error messages, so that you can see these problems.
|
||||
|
||||
Please file a bug if you think that there is a specific situation which escpos-php could provide better error messages for.
|
||||
|
||||
## Can I print over the network?
|
||||
|
||||
Certainly, as long as your printer is available over the network.
|
||||
|
||||
- `NetworkPrintConnector` will speak directly to an Ethernet-connected printer on port 9100.
|
||||
|
||||
For USB or Serial printers, you need to install the printer on a computer and then share it, so that it becomes network-accessible.
|
||||
|
||||
- `WindowsPrintConnector` will connect to Windows shared printers from Windows or Linux (Linux users will need Samba).
|
||||
- `CupsPrintConnector` will connect to CUPS-shared printers from Linux or Mac.
|
||||
|
||||
Always start by testing your shared printer setup outside of escpos-php. The examples linked to in the README are commented with some example commands to get you started. Typically, networks, firewalls and permissions need to be set up.
|
||||
|
||||
Once you have a working command to send text to your printer (from the PHP server), you are ready to use escpos-php.
|
||||
|
||||
If you have any issues at this stage, please ask on the issue tracker, and include the commands that you used to verify your setup.
|
||||
|
||||
## Can I print from my server on the Internet?
|
||||
|
||||
Since PHP is a server-side language, escpos-php is a server-side print library. The driver is able to transport data between a server and a printer in a few different ways, all of them server-side. For example, you may print to a USB printer *connected to the server running PHP*, or an Ethernet printer *on a network accessible to the server*.
|
||||
|
||||
Many developers dream of having an application that is hosted on the public Internet, with POS terminals accessing it, and printing via a web browser. Because the webserver cannot see the printer in this sort of setup, a server-side print driver is not much use.
|
||||
|
||||
Because of this, there are no cut-and-paste recipes available, but here are two top-level approaches you could take:
|
||||
|
||||
1. Architect your application so that the server can see your printer
|
||||
2. Use an application which runs client-side to deliver print data instead
|
||||
|
||||
### Option 1: Allow the server to print
|
||||
|
||||
Server-side printing is viable if the server can get to the printer. Here are some ways it could work:
|
||||
|
||||
- Run your server on the LAN instead, and read the section above about printing over the network
|
||||
- Set up a VPN so that your cloud-hosted server can also access the LAN
|
||||
- Expose the printer via some other secure tunnel to the server, via SSH or TLS
|
||||
|
||||
Please do your own research to determine how these may apply to your setup- the escpos-php issue tracker is not a place where you should be requesting network support.
|
||||
|
||||
### Option 2: Use client software to print
|
||||
|
||||
If you aren't able to set up some network infrastructure to implement the above, then you cannot use a server-side print driver.
|
||||
|
||||
Here are some browser-based printing tools which you may like to consider instead.
|
||||
|
||||
- Use system printing with a vendor driver, and some good `@media print` CSS
|
||||
- [Chrome Raw Print](https://github.com/receipt-print-hq/chrome-raw-print) app
|
||||
- [qz](https://qz.io/)
|
||||
- [ePOS-Device SDK for JavaScript](https://reference.epson-biz.com/modules/ref_epos_device_js_en/index.php?content_id=139). Requires network interface card that supports ePOS (UB-E04/R04)
|
||||
|
||||
Please direct queries about client-side printing products to the appropriate project.
|
||||
|
||||
## Why is image printing slow?
|
||||
|
||||
Three things tend to slow down the image processing:
|
||||
|
||||
1. Slow PHP code
|
||||
2. Data link
|
||||
3. The printer itself
|
||||
|
||||
First, ensure you have the Imagick plugin loaded. The driver will avoid a slower image processing implementation once you've got it.
|
||||
|
||||
Next, connect over a faster interface. Serial printers have a low bit-rate, and the printer spends a lot of time waiting for data. If you have USB or Ethernet, then use it (note: storing graphics to the printer memory is not currently implemented).
|
||||
|
||||
Lastly, the printer will go faster if you use less pixels. Since images are two-dimensional, scaling down by 50% removes 75% of the pixels. The driver can then print at a half the density, so that your lower resolution image appears the same size when printed.
|
||||
|
||||
## How can I get the status of the printer?
|
||||
|
||||
This feature is not implemented, but a solution for some Epson printers is planned.
|
||||
|
||||
Only `FilePrintConnector` or `NetworkPrintConnector` will support reading from the printer, ensure that you migrate to those if you would like these features.
|
||||
|
||||
## How do I produce this complex layout?
|
||||
|
||||
ESC/POS "page mode" is not currently supported, which would allow some printers to render some more complex layouts natively
|
||||
|
||||
Since the output is raster anyway, it is suggested that you render your output to an image and print that instead. The driver supports PDF printing via Imagick, and an example that uses `wkhtmltoimage` is available in the repository.
|
||||
@ -1,20 +0,0 @@
|
||||
html: escpos.doxyfile
|
||||
# Compile
|
||||
doxygen escpos.doxyfile
|
||||
# Filter out warnings on README.md- doxygen cannot handle image links that
|
||||
# are used there: [](https://example.com/image)
|
||||
sed -i '/README.md\:/d' warnings.log
|
||||
# Show warnings log
|
||||
cat warnings.log
|
||||
# Return failure if there were any doc warnings
|
||||
[ ! -s warnings.log ]
|
||||
|
||||
latex: html
|
||||
# Do nothing
|
||||
|
||||
xml: html
|
||||
xsltproc xml/combine.xslt xml/index.xml > all.xml
|
||||
|
||||
clean:
|
||||
rm --preserve-root -Rf html latex xml doxygen_sqlite3.db all.xml warnings.log
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -78,7 +78,7 @@ class CupsPrintConnector implements PrintConnector
|
||||
|
||||
// Build command to work on data
|
||||
$tmpfname = tempnam(sys_get_temp_dir(), 'print-');
|
||||
if ($tmpfname==false) dol_syslog("CupsPrintConnector.php::Permission denied to write into target directory ".sys_get_temp_dir(), LOG_WARNING);
|
||||
if ($tmpfname==false) dol_syslog("CupsPrintConnector.php::Permission denied to write into target directory ".sys_get_temp_dir(), LOG_WARNING);
|
||||
file_put_contents($tmpfname, $data);
|
||||
$cmd = sprintf(
|
||||
"lp -d %s %s",
|
||||
|
||||
1
htdocs/includes/mobiledetect/mobiledetectlib/.gitignore
vendored
Normal file
1
htdocs/includes/mobiledetect/mobiledetectlib/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/docs
|
||||
@ -1,48 +0,0 @@
|
||||
**Reporting issues**
|
||||
|
||||
1. Specify the User-agent by visiting [http://demo.mobiledetect.net](http://demo.mobiledetect.net).
|
||||
1. Specify the expected behaviour.
|
||||
|
||||
**Developing**
|
||||
|
||||
1. Fork Mobile Detect repository. See ["How to fork"](https://help.github.com/articles/fork-a-repo/#fork-an-example-repository) example.
|
||||
1. `git clone https://github.com/[yourname]/Mobile-Detect.git`
|
||||
1. `git add remote serbanghita https://github.com/serbanghita/Mobile-Detect.git`
|
||||
1. `git remote -v` - You should see:
|
||||
```
|
||||
origin git@github.com:serbanghita/Mobile-Detect.git
|
||||
serbanghita https://github.com/serbanghita/Mobile-Detect.git
|
||||
```
|
||||
1. `git checkout -b devel origin/devel`
|
||||
1. `composer install`
|
||||
1. Start working on your changes.
|
||||
1. If you add new methods or make structural changes to the `Mobile_Detect.php` class
|
||||
you need to add unit tests!
|
||||
1. If you add new regexes make sure you commit the User-Agents in [`tests/providers/vendors`](https://github.com/serbanghita/Mobile-Detect/tree/master/tests/providers/vendors)
|
||||
1. Run tests `vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-text --strict-coverage --stop-on-risky`
|
||||
1. `git status` or `git diff` - inspect your changes
|
||||
1 `git stage .`
|
||||
1. `git commit -m "[your commit message here]`
|
||||
1. `git push origin devel`
|
||||
1. Go to your repo on GitHub and ["Submit the PR"](https://help.github.com/articles/about-pull-requests/)
|
||||
|
||||
**New module, plugin, plugin or port**
|
||||
|
||||
[Submit new module, plugin, port](../../issues/new?title=New%203rd%20party%20module&body=Name,%20Link%20and%20Description%20of%20the%20module.)
|
||||
including the following information:
|
||||
* Module name
|
||||
* Description
|
||||
* Link
|
||||
* Author
|
||||
|
||||
Or you can submit a PR against `README.md`.
|
||||
|
||||
**Website updates**
|
||||
|
||||
1. Our official website is hosted at [http://mobiledetect.net](http://mobiledetect.net).
|
||||
1. The files are found on the `gh-pages` branch.
|
||||
1. `git checkout gh-pages`
|
||||
1. `npm install -g browser-sync`
|
||||
1. `browser-sync start --s . --f . --port 3000 --reload-debounce 1500 --no-ui`
|
||||
1. Go to `http://localhost:3000` and make changes.
|
||||
1. Commit, push and submit the PR against `serbanghita:gh-pages`.
|
||||
@ -1,11 +0,0 @@
|
||||
The first version of the script was developed in 2009 and it was hosted at https://code.google.com/p/php-mobile-detect/, it was a small project with around 30 stars. (Original blog post by Victor: http://victorstanciu.ro/detectarea-platformelor-mobile-in-php/)
|
||||
|
||||
In December 2011 it received a major update from the first version, an important number of issues were fixed, then 2.0 was launched. The new version marks a new mindset and also featuring tablet detection.
|
||||
|
||||
Throughout 2012 the script has been updated constantly and we have received tons of feedback and requests.
|
||||
|
||||
In July 2012 we moved the repository from Google Code to GitHub in order to quickly accommodate the frequent updates and to involve more people.
|
||||
|
||||
In August 2013 the library has 1800+ stargazers and support for: composer, PHPUnit tests, PSR standards and a new webpage http://mobiledetect.net
|
||||
|
||||
Mobile Detect library and user contributions are <a href="https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt">MIT Licensed</a>.
|
||||
@ -1,15 +0,0 @@
|
||||
-------------delete this message-------------
|
||||
* By submitting a new issue I acknowledge that I already read the README, CODE EXAMPLES and KNOWN LIMITATIONS.
|
||||
* I understand that the current version `2.x` is only meant to detect `mobile` devices.
|
||||
* Please post your User-Agent string! On a real device/s, the library is expected to work correctly.
|
||||
-------------delete this message-------------
|
||||
|
||||
|
||||
|
||||
**Issue description**
|
||||
|
||||
|
||||
**User-Agent(s)**
|
||||
|
||||
|
||||
**Suggestions**
|
||||
@ -1,12 +0,0 @@
|
||||
**Known limitations**
|
||||
|
||||
* Mobile Detect script was designed to detect `mobile` devices. Implicitly other devices are considered to be `desktop`.
|
||||
* User-Agent and HTTP headers sniffing is a non reliable method of detecting a mobile device.
|
||||
* If the mobile browser is set on `Desktop mode`, the Mobile Detect script has no way of knowing that the device is `mobile`.
|
||||
* Some touchscreen devices (eg. Microsoft Surface) are tough to detect as mobile since they can be used in a laptop mode. See: [#32](https://github.com/serbanghita/Mobile-Detect/issues/32), [#461](https://github.com/serbanghita/Mobile-Detect/issues/461), [#667](https://github.com/serbanghita/Mobile-Detect/issues/667)
|
||||
* Some mobile devices (eg. IPadOS, Google Pixel Slate). See: [#795](https://github.com/serbanghita/Mobile-Detect/issues/795), [#788](https://github.com/serbanghita/Mobile-Detect/issues/788)
|
||||
* Detecting the device brand (eg. Apple, Samsung, HTC) is not 100% reliable.
|
||||
* We don't monitor the quality of the 3rd party tools based on Mobile Detect script.
|
||||
We cannot guarantee that they are using the class properly or if they provide the latest version.
|
||||
* Version `2.x` is made to be PHP 5.3 compatible because of the backward compatibility changes of PHP.
|
||||
* There are hundreds of devices launched every month, we cannot keep a 100% up to date detection rate.
|
||||
7
htdocs/includes/nnnick/chartjs/.gitignore
vendored
7
htdocs/includes/nnnick/chartjs/.gitignore
vendored
@ -1,8 +1,13 @@
|
||||
.github
|
||||
/_book
|
||||
/coverage
|
||||
/custom
|
||||
/dist
|
||||
/docs/index.md
|
||||
/docs
|
||||
/samples
|
||||
/scripts
|
||||
/src
|
||||
/test
|
||||
/gh-pages
|
||||
/jsdoc
|
||||
/node_modules
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- lts/*
|
||||
# Using node 12.18.2 instead of lts
|
||||
# https://github.com/chartjs/Chart.js/issues/7863#issuecomment-705222874
|
||||
- "12.18.2"
|
||||
|
||||
before_install:
|
||||
- "export CHROME_BIN=/usr/bin/google-chrome"
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*!
|
||||
* Chart.js v2.9.3
|
||||
* Chart.js v2.9.4
|
||||
* https://www.chartjs.org
|
||||
* (c) 2019 Chart.js Contributors
|
||||
* (c) 2020 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
(function (global, factory) {
|
||||
@ -2107,6 +2107,10 @@ if (typeof window !== 'undefined') {
|
||||
|
||||
var chartjsColor = Color;
|
||||
|
||||
function isValidKey(key) {
|
||||
return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @namespace Chart.helpers
|
||||
*/
|
||||
@ -2282,7 +2286,7 @@ var helpers = {
|
||||
}
|
||||
|
||||
if (helpers.isObject(source)) {
|
||||
var target = {};
|
||||
var target = Object.create(source);
|
||||
var keys = Object.keys(source);
|
||||
var klen = keys.length;
|
||||
var k = 0;
|
||||
@ -2303,6 +2307,12 @@ var helpers = {
|
||||
* @private
|
||||
*/
|
||||
_merger: function(key, target, source, options) {
|
||||
if (!isValidKey(key)) {
|
||||
// We want to ensure we do not copy prototypes over
|
||||
// as this can pollute global namespaces
|
||||
return;
|
||||
}
|
||||
|
||||
var tval = target[key];
|
||||
var sval = source[key];
|
||||
|
||||
@ -2318,6 +2328,12 @@ var helpers = {
|
||||
* @private
|
||||
*/
|
||||
_mergerIf: function(key, target, source) {
|
||||
if (!isValidKey(key)) {
|
||||
// We want to ensure we do not copy prototypes over
|
||||
// as this can pollute global namespaces
|
||||
return;
|
||||
}
|
||||
|
||||
var tval = target[key];
|
||||
var sval = source[key];
|
||||
|
||||
@ -3816,7 +3832,7 @@ helpers$1.extend(DatasetController.prototype, {
|
||||
*/
|
||||
_configure: function() {
|
||||
var me = this;
|
||||
me._config = helpers$1.merge({}, [
|
||||
me._config = helpers$1.merge(Object.create(null), [
|
||||
me.chart.options.datasets[me._type],
|
||||
me.getDataset(),
|
||||
], {
|
||||
@ -7086,7 +7102,8 @@ function updateDims(chartArea, params, layout) {
|
||||
chartArea.h = newHeight;
|
||||
|
||||
// return true if chart area changed in layout's direction
|
||||
return layout.horizontal ? newWidth !== chartArea.w : newHeight !== chartArea.h;
|
||||
var sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];
|
||||
return sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -8098,7 +8115,7 @@ var core_scaleService = {
|
||||
},
|
||||
getScaleDefaults: function(type) {
|
||||
// Return the scale defaults merged with the global settings so that we always use the latest ones
|
||||
return this.defaults.hasOwnProperty(type) ? helpers$1.merge({}, [core_defaults.scale, this.defaults[type]]) : {};
|
||||
return this.defaults.hasOwnProperty(type) ? helpers$1.merge(Object.create(null), [core_defaults.scale, this.defaults[type]]) : {};
|
||||
},
|
||||
updateScaleDefaults: function(type, additions) {
|
||||
var me = this;
|
||||
@ -9173,7 +9190,7 @@ core_defaults._set('global', {
|
||||
* returns a deep copy of the result, thus doesn't alter inputs.
|
||||
*/
|
||||
function mergeScaleConfig(/* config objects ... */) {
|
||||
return helpers$1.merge({}, [].slice.call(arguments), {
|
||||
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
|
||||
merger: function(key, target, source, options) {
|
||||
if (key === 'xAxes' || key === 'yAxes') {
|
||||
var slen = source[key].length;
|
||||
@ -9213,9 +9230,9 @@ function mergeScaleConfig(/* config objects ... */) {
|
||||
* a deep copy of the result, thus doesn't alter inputs.
|
||||
*/
|
||||
function mergeConfig(/* config objects ... */) {
|
||||
return helpers$1.merge({}, [].slice.call(arguments), {
|
||||
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
|
||||
merger: function(key, target, source, options) {
|
||||
var tval = target[key] || {};
|
||||
var tval = target[key] || Object.create(null);
|
||||
var sval = source[key];
|
||||
|
||||
if (key === 'scales') {
|
||||
@ -9232,7 +9249,7 @@ function mergeConfig(/* config objects ... */) {
|
||||
}
|
||||
|
||||
function initConfig(config) {
|
||||
config = config || {};
|
||||
config = config || Object.create(null);
|
||||
|
||||
// Do NOT use mergeConfig for the data object because this method merges arrays
|
||||
// and so would change references to labels and datasets, preventing data updates.
|
||||
@ -11213,6 +11230,8 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
|
||||
var widths = [];
|
||||
var heights = [];
|
||||
var offsets = [];
|
||||
var widestLabelSize = 0;
|
||||
var highestLabelSize = 0;
|
||||
var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
@ -11240,11 +11259,13 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
|
||||
widths.push(width);
|
||||
heights.push(height);
|
||||
offsets.push(lineHeight / 2);
|
||||
widestLabelSize = Math.max(width, widestLabelSize);
|
||||
highestLabelSize = Math.max(height, highestLabelSize);
|
||||
}
|
||||
garbageCollect(caches, length);
|
||||
|
||||
widest = widths.indexOf(Math.max.apply(null, widths));
|
||||
highest = heights.indexOf(Math.max.apply(null, heights));
|
||||
widest = widths.indexOf(widestLabelSize);
|
||||
highest = heights.indexOf(highestLabelSize);
|
||||
|
||||
function valueAt(idx) {
|
||||
return {
|
||||
|
||||
File diff suppressed because one or more lines are too long
45
htdocs/includes/nnnick/chartjs/dist/Chart.js
vendored
45
htdocs/includes/nnnick/chartjs/dist/Chart.js
vendored
@ -1,7 +1,7 @@
|
||||
/*!
|
||||
* Chart.js v2.9.3
|
||||
* Chart.js v2.9.4
|
||||
* https://www.chartjs.org
|
||||
* (c) 2019 Chart.js Contributors
|
||||
* (c) 2020 Chart.js Contributors
|
||||
* Released under the MIT License
|
||||
*/
|
||||
(function (global, factory) {
|
||||
@ -2103,6 +2103,10 @@ if (typeof window !== 'undefined') {
|
||||
|
||||
var chartjsColor = Color;
|
||||
|
||||
function isValidKey(key) {
|
||||
return ['__proto__', 'prototype', 'constructor'].indexOf(key) === -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @namespace Chart.helpers
|
||||
*/
|
||||
@ -2278,7 +2282,7 @@ var helpers = {
|
||||
}
|
||||
|
||||
if (helpers.isObject(source)) {
|
||||
var target = {};
|
||||
var target = Object.create(source);
|
||||
var keys = Object.keys(source);
|
||||
var klen = keys.length;
|
||||
var k = 0;
|
||||
@ -2299,6 +2303,12 @@ var helpers = {
|
||||
* @private
|
||||
*/
|
||||
_merger: function(key, target, source, options) {
|
||||
if (!isValidKey(key)) {
|
||||
// We want to ensure we do not copy prototypes over
|
||||
// as this can pollute global namespaces
|
||||
return;
|
||||
}
|
||||
|
||||
var tval = target[key];
|
||||
var sval = source[key];
|
||||
|
||||
@ -2314,6 +2324,12 @@ var helpers = {
|
||||
* @private
|
||||
*/
|
||||
_mergerIf: function(key, target, source) {
|
||||
if (!isValidKey(key)) {
|
||||
// We want to ensure we do not copy prototypes over
|
||||
// as this can pollute global namespaces
|
||||
return;
|
||||
}
|
||||
|
||||
var tval = target[key];
|
||||
var sval = source[key];
|
||||
|
||||
@ -3812,7 +3828,7 @@ helpers$1.extend(DatasetController.prototype, {
|
||||
*/
|
||||
_configure: function() {
|
||||
var me = this;
|
||||
me._config = helpers$1.merge({}, [
|
||||
me._config = helpers$1.merge(Object.create(null), [
|
||||
me.chart.options.datasets[me._type],
|
||||
me.getDataset(),
|
||||
], {
|
||||
@ -7082,7 +7098,8 @@ function updateDims(chartArea, params, layout) {
|
||||
chartArea.h = newHeight;
|
||||
|
||||
// return true if chart area changed in layout's direction
|
||||
return layout.horizontal ? newWidth !== chartArea.w : newHeight !== chartArea.h;
|
||||
var sizes = layout.horizontal ? [newWidth, chartArea.w] : [newHeight, chartArea.h];
|
||||
return sizes[0] !== sizes[1] && (!isNaN(sizes[0]) || !isNaN(sizes[1]));
|
||||
}
|
||||
}
|
||||
|
||||
@ -8094,7 +8111,7 @@ var core_scaleService = {
|
||||
},
|
||||
getScaleDefaults: function(type) {
|
||||
// Return the scale defaults merged with the global settings so that we always use the latest ones
|
||||
return this.defaults.hasOwnProperty(type) ? helpers$1.merge({}, [core_defaults.scale, this.defaults[type]]) : {};
|
||||
return this.defaults.hasOwnProperty(type) ? helpers$1.merge(Object.create(null), [core_defaults.scale, this.defaults[type]]) : {};
|
||||
},
|
||||
updateScaleDefaults: function(type, additions) {
|
||||
var me = this;
|
||||
@ -9169,7 +9186,7 @@ core_defaults._set('global', {
|
||||
* returns a deep copy of the result, thus doesn't alter inputs.
|
||||
*/
|
||||
function mergeScaleConfig(/* config objects ... */) {
|
||||
return helpers$1.merge({}, [].slice.call(arguments), {
|
||||
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
|
||||
merger: function(key, target, source, options) {
|
||||
if (key === 'xAxes' || key === 'yAxes') {
|
||||
var slen = source[key].length;
|
||||
@ -9209,9 +9226,9 @@ function mergeScaleConfig(/* config objects ... */) {
|
||||
* a deep copy of the result, thus doesn't alter inputs.
|
||||
*/
|
||||
function mergeConfig(/* config objects ... */) {
|
||||
return helpers$1.merge({}, [].slice.call(arguments), {
|
||||
return helpers$1.merge(Object.create(null), [].slice.call(arguments), {
|
||||
merger: function(key, target, source, options) {
|
||||
var tval = target[key] || {};
|
||||
var tval = target[key] || Object.create(null);
|
||||
var sval = source[key];
|
||||
|
||||
if (key === 'scales') {
|
||||
@ -9228,7 +9245,7 @@ function mergeConfig(/* config objects ... */) {
|
||||
}
|
||||
|
||||
function initConfig(config) {
|
||||
config = config || {};
|
||||
config = config || Object.create(null);
|
||||
|
||||
// Do NOT use mergeConfig for the data object because this method merges arrays
|
||||
// and so would change references to labels and datasets, preventing data updates.
|
||||
@ -11209,6 +11226,8 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
|
||||
var widths = [];
|
||||
var heights = [];
|
||||
var offsets = [];
|
||||
var widestLabelSize = 0;
|
||||
var highestLabelSize = 0;
|
||||
var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;
|
||||
|
||||
for (i = 0; i < length; ++i) {
|
||||
@ -11236,11 +11255,13 @@ function computeLabelSizes(ctx, tickFonts, ticks, caches) {
|
||||
widths.push(width);
|
||||
heights.push(height);
|
||||
offsets.push(lineHeight / 2);
|
||||
widestLabelSize = Math.max(width, widestLabelSize);
|
||||
highestLabelSize = Math.max(height, highestLabelSize);
|
||||
}
|
||||
garbageCollect(caches, length);
|
||||
|
||||
widest = widths.indexOf(Math.max.apply(null, widths));
|
||||
highest = heights.indexOf(Math.max.apply(null, heights));
|
||||
widest = widths.indexOf(widestLabelSize);
|
||||
highest = heights.indexOf(highestLabelSize);
|
||||
|
||||
function valueAt(idx) {
|
||||
return {
|
||||
|
||||
File diff suppressed because one or more lines are too long
2
htdocs/includes/nnnick/chartjs/package-lock.json
generated
2
htdocs/includes/nnnick/chartjs/package-lock.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chart.js",
|
||||
"version": "2.9.3",
|
||||
"version": "2.9.4",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "chart.js",
|
||||
"homepage": "https://www.chartjs.org",
|
||||
"description": "Simple HTML5 charts using the canvas element.",
|
||||
"version": "2.9.3",
|
||||
"version": "2.9.4",
|
||||
"license": "MIT",
|
||||
"jsdelivr": "dist/Chart.min.js",
|
||||
"unpkg": "dist/Chart.min.js",
|
||||
|
||||
3
htdocs/includes/symfony/var-dumper/.gitignore
vendored
Normal file
3
htdocs/includes/symfony/var-dumper/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
composer.lock
|
||||
phpunit.xml
|
||||
vendor/
|
||||
@ -1,44 +1,41 @@
|
||||
{
|
||||
"name" : "symfony/var-dumper",
|
||||
"type" : "library",
|
||||
"description" : "Symfony mechanism for exploring and dumping PHP variables",
|
||||
"keywords" : [
|
||||
"dump",
|
||||
"debug"
|
||||
],
|
||||
"homepage" : "https://symfony.com",
|
||||
"license" : "MIT",
|
||||
"authors" : [{
|
||||
"name" : "Nicolas Grekas",
|
||||
"email" : "p@tchwork.com"
|
||||
}, {
|
||||
"name" : "Symfony Community",
|
||||
"homepage" : "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require" : {
|
||||
"php" : ">=5.5.9",
|
||||
"symfony/polyfill-mbstring" : "~1.0"
|
||||
},
|
||||
"require-dev" : {
|
||||
"twig/twig" : "~1.20|~2.0"
|
||||
},
|
||||
"suggest" : {},
|
||||
"autoload" : {
|
||||
"files" : [
|
||||
"Resources/functions/dump.php"
|
||||
],
|
||||
"psr-4" : {
|
||||
"Symfony\\Component\\VarDumper\\" : ""
|
||||
},
|
||||
"exclude-from-classmap" : [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"minimum-stability" : "dev",
|
||||
"extra" : {
|
||||
"branch-alias" : {
|
||||
"dev-master" : "3.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
"name": "symfony/var-dumper",
|
||||
"type": "library",
|
||||
"description": "Symfony mechanism for exploring and dumping PHP variables",
|
||||
"keywords": ["dump", "debug"],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5.9",
|
||||
"symfony/polyfill-mbstring": "~1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"twig/twig": "~1.20|~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-symfony_debug": ""
|
||||
},
|
||||
"autoload": {
|
||||
"files": [ "Resources/functions/dump.php" ],
|
||||
"psr-4": { "Symfony\\Component\\VarDumper\\": "" },
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "3.0-dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
29
htdocs/includes/symfony/var-dumper/phpunit.xml.dist
Normal file
29
htdocs/includes/symfony/var-dumper/phpunit.xml.dist
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Symfony VarDumper Component Test Suite">
|
||||
<directory>./Tests/</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>./</directory>
|
||||
<exclude>
|
||||
<directory>./Resources</directory>
|
||||
<directory>./Tests</directory>
|
||||
<directory>./vendor</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
||||
2
htdocs/includes/tecnickcom/tcpdf/.gitignore
vendored
Normal file
2
htdocs/includes/tecnickcom/tcpdf/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/examples/
|
||||
/tools/
|
||||
@ -40,7 +40,7 @@ class IntracommReport extends CommonObject
|
||||
public $table_element = 'intracommreport';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_intracommreport';
|
||||
|
||||
|
||||
@ -250,6 +250,7 @@ ErrorParameterMustBeEnabledToAllwoThisFeature=Error, parameter <b>%s</b> must be
|
||||
ErrorLoginDateValidity=Error, this login is outside the validity date range
|
||||
ErrorValueLength=Length of field '<b>%s</b>' must be higher than '<b>%s</b>'
|
||||
ErrorReservedKeyword=The word '<b>%s</b>' is a reserved keyword
|
||||
ErrorNotAvailableWithThisDistribution=Not available with this distribution
|
||||
# Warnings
|
||||
WarningParamUploadMaxFileSizeHigherThanPostMaxSize=Your PHP parameter upload_max_filesize (%s) is higher than PHP parameter post_max_size (%s). This is not a consistent setup.
|
||||
WarningPasswordSetWithNoAccount=A password was set for this member. However, no user account was created. So this password is stored but can't be used to login to Dolibarr. It may be used by an external module/interface but if you don't need to define any login nor password for a member, you can disable option "Manage a login for each member" from Member module setup. If you need to manage a login but don't need any password, you can keep this field empty to avoid this warning. Note: Email can also be used as a login if the member is linked to a user.
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/modulebuilder/tempalte/admin/myobject_extrafields.php
|
||||
* \file htdocs/modulebuilder/template/admin/myobject_extrafields.php
|
||||
* \ingroup mymodule
|
||||
* \brief Page to setup extra fields of myobject
|
||||
*/
|
||||
@ -31,7 +31,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/bom.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('mrp@mrp', 'admin'));
|
||||
$langs->loadLangs(array('mymodule@mymodule', 'admin'));
|
||||
|
||||
$extrafields = new ExtraFields($db);
|
||||
$form = new Form($db);
|
||||
|
||||
@ -187,37 +187,37 @@ class MyObject extends CommonObject
|
||||
|
||||
// If this object has a subtable with lines
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
*/
|
||||
//public $table_element_line = 'mymodule_myobjectline';
|
||||
// /**
|
||||
// * @var string Name of subtable line
|
||||
// */
|
||||
// public $table_element_line = 'mymodule_myobjectline';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this object has a parent
|
||||
*/
|
||||
//public $fk_element = 'fk_myobject';
|
||||
// /**
|
||||
// * @var string Field with ID of parent key if this object has a parent
|
||||
// */
|
||||
// public $fk_element = 'fk_myobject';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable class that manage subtable lines
|
||||
*/
|
||||
//public $class_element_line = 'MyObjectline';
|
||||
// /**
|
||||
// * @var string Name of subtable class that manage subtable lines
|
||||
// */
|
||||
// public $class_element_line = 'MyObjectline';
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
//protected $childtables = array();
|
||||
// /**
|
||||
// * @var array List of child tables. To test if we can delete object.
|
||||
// */
|
||||
// protected $childtables = array();
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To know object to delete on cascade.
|
||||
* If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
||||
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
||||
*/
|
||||
//protected $childtablesoncascade = array('mymodule_myobjectdet');
|
||||
// /**
|
||||
// * @var array List of child tables. To know object to delete on cascade.
|
||||
// * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
||||
// * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
||||
// */
|
||||
// protected $childtablesoncascade = array('mymodule_myobjectdet');
|
||||
|
||||
/**
|
||||
* @var MyObjectLine[] Array of subtable lines
|
||||
*/
|
||||
//public $lines = array();
|
||||
// /**
|
||||
// * @var MyObjectLine[] Array of subtable lines
|
||||
// */
|
||||
// public $lines = array();
|
||||
|
||||
|
||||
|
||||
|
||||
@ -166,17 +166,17 @@ class Mo extends CommonObject
|
||||
// If this object has a subtable with lines
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'mo_production';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_mo';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable class that manage subtable lines
|
||||
* @var string Name of subtable class that manage subtable lines
|
||||
*/
|
||||
public $class_element_line = 'MoLine';
|
||||
|
||||
|
||||
@ -135,6 +135,7 @@ if (!function_exists('curl_version'))
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
// Account Parameters
|
||||
@ -144,7 +145,7 @@ print '<td>'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
print '<tr class="oddeven">';
|
||||
print '<td class="titlefield">';
|
||||
print '<td>';
|
||||
print $langs->trans("PaypalLiveEnabled").'</td><td>';
|
||||
if (empty($conf->global->PAYPAL_API_SANDBOX))
|
||||
{
|
||||
@ -181,6 +182,15 @@ print $langs->trans("PAYPAL_SSLVERSION").'</td><td>';
|
||||
print $form->selectarray("PAYPAL_SSLVERSION", array('1'=> $langs->trans('TLSv1'), '6'=> $langs->trans('TLSv1.2')), $conf->global->PAYPAL_SSLVERSION);
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
// Usage Parameters
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("UsageParameter").'</td>';
|
||||
@ -211,6 +221,7 @@ if (!empty($conf->banque->enabled))
|
||||
{
|
||||
print '<tr class="oddeven"><td>';
|
||||
print $langs->trans("BankAccount").'</td><td>';
|
||||
print img_picto('', 'bank_account').' ';
|
||||
$form->select_comptes($conf->global->PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS, 'PAYPAL_BANK_ACCOUNT_FOR_PAYMENTS', 0, '', 1);
|
||||
print '</td></tr>';
|
||||
}
|
||||
@ -255,6 +266,14 @@ print '<input class="minwidth200" type="text" name="ONLINE_PAYMENT_SENDEMAIL" va
|
||||
print ' <span class="opacitymedium">'.$langs->trans("Example").': myemail@myserver.com, Payment service <myemail2@myserver2.com></span>';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("UrlGenerationParameters").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
@ -284,6 +303,7 @@ if ($conf->use_javascript_ajax) {
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
print '</div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
@ -296,7 +316,7 @@ print '<br><br>';
|
||||
// Help doc
|
||||
print '<u>'.$langs->trans("InformationToFindParameters", "Paypal").'</u>:<br>';
|
||||
if (!empty($conf->use_javascript_ajax))
|
||||
print '<a href="#" class="reposition" id="apidoca">'.$langs->trans("ClickHere").'...</a>';
|
||||
print '<a class="reposition" id="apidoca">'.$langs->trans("ClickHere").'...</a>';
|
||||
|
||||
$realpaypalurl = 'www.paypal.com';
|
||||
$sandboxpaypalurl = 'developer.paypal.com';
|
||||
@ -318,11 +338,13 @@ if (!empty($conf->use_javascript_ajax))
|
||||
{
|
||||
print "\n".'<script type="text/javascript">';
|
||||
print '$(document).ready(function () {
|
||||
$("#apidoc").hide();
|
||||
$("#apidoca").click(function() {
|
||||
$("#apidoc").show();
|
||||
$("#apidoca").hide();
|
||||
})
|
||||
$("#apidoc").hide();
|
||||
$("#apidoca").click(function() {
|
||||
console.log("We click on apidoca show/hide");
|
||||
$("#apidoc").show();
|
||||
$("#apidoca").hide();
|
||||
return false;
|
||||
})
|
||||
});';
|
||||
print '</script>';
|
||||
}
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
* \brief Library for common paypal functions
|
||||
*/
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
|
||||
|
||||
|
||||
/**
|
||||
* Define head array for tabs of paypal tools setup pages
|
||||
@ -54,131 +56,6 @@ function paypaladmin_prepare_head()
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return string with full Url
|
||||
*
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
* @return string Url string
|
||||
*/
|
||||
function showPaypalPaymentUrl($type, $ref)
|
||||
{
|
||||
global $conf, $langs;
|
||||
|
||||
$langs->load("paypal");
|
||||
$langs->load("paybox");
|
||||
$servicename = 'PayPal';
|
||||
$out = '<br><br>';
|
||||
$out .= img_picto('', 'globe').' '.$langs->trans("ToOfferALinkForOnlinePayment", $servicename).'<br>';
|
||||
$url = getPaypalPaymentUrl(0, $type, $ref);
|
||||
$out .= '<input type="text" id="paypalurl" class="quatrevingtpercent" value="'.$url.'">';
|
||||
$out .= ajax_autoselect("paypalurl", 0);
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return string with full Url
|
||||
*
|
||||
* @param int $mode 0=True url, 1=Url formated with colors
|
||||
* @param string $type Type of URL ('free', 'order', 'invoice', 'contractline', 'membersubscription' ...)
|
||||
* @param string $ref Ref of object
|
||||
* @param int $amount Amount
|
||||
* @param string $freetag Free tag
|
||||
* @return string Url string
|
||||
*/
|
||||
function getPaypalPaymentUrl($mode, $type, $ref = '', $amount = '9.99', $freetag = 'your_tag')
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$ref = str_replace(' ', '', $ref);
|
||||
|
||||
if ($type == 'free')
|
||||
{
|
||||
$out = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?amount='.($mode ? '<font color="#666666">' : '').$amount.($mode ? '</font>' : '').'&tag='.($mode ? '<font color="#666666">' : '').$freetag.($mode ? '</font>' : '');
|
||||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else $out .= '&securekey='.dol_hash($conf->global->PAYPAL_SECURITY_TOKEN, 2);
|
||||
}
|
||||
}
|
||||
if ($type == 'order')
|
||||
{
|
||||
$out = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=order&ref='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= 'order_ref';
|
||||
if ($mode == 0) $out .= urlencode($ref);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + order_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($type == 'invoice')
|
||||
{
|
||||
$out = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=invoice&ref='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= 'invoice_ref';
|
||||
if ($mode == 0) $out .= urlencode($ref);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + invoice_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($type == 'contractline')
|
||||
{
|
||||
$out = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=contractline&ref='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= 'contractline_ref';
|
||||
if ($mode == 0) $out .= urlencode($ref);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + contractline_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($type == 'membersubscription')
|
||||
{
|
||||
$out = DOL_MAIN_URL_ROOT.'/public/paypal/newpayment.php?source=membersubscription&ref='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= 'member_ref';
|
||||
if ($mode == 0) $out .= urlencode($ref);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
if (!empty($conf->global->PAYPAL_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->PAYPAL_SECURITY_TOKEN_UNIQUE)) $out .= '&securekey='.$conf->global->PAYPAL_SECURITY_TOKEN;
|
||||
else {
|
||||
$out .= '&securekey='.($mode ? '<font color="#666666">' : '');
|
||||
if ($mode == 1) $out .= "hash('".$conf->global->PAYPAL_SECURITY_TOKEN."' + '".$type."' + member_ref)";
|
||||
if ($mode == 0) $out .= dol_hash($conf->global->PAYPAL_SECURITY_TOKEN.$type.$ref, 2);
|
||||
$out .= ($mode ? '</font>' : '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// For multicompany
|
||||
$out .= "&entity=".$conf->entity; // Check the entity because He may be the same reference in several entities
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Send redirect to paypal to browser
|
||||
*
|
||||
|
||||
@ -56,14 +56,22 @@ class Product extends CommonObject
|
||||
public $table_element = 'product';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_product';
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
protected $childtables = array('supplier_proposaldet', 'propaldet', 'commandedet', 'facturedet', 'contratdet', 'facture_fourn_det', 'commande_fournisseurdet');
|
||||
protected $childtables = array(
|
||||
'supplier_proposaldet',
|
||||
'propaldet',
|
||||
'commandedet',
|
||||
'facturedet',
|
||||
'contratdet',
|
||||
'facture_fourn_det',
|
||||
'commande_fournisseurdet'
|
||||
);
|
||||
|
||||
/**
|
||||
* 0=No test on entity, 1=Test with field entity, 2=Test with link by societe
|
||||
@ -828,7 +836,8 @@ class Product extends CommonObject
|
||||
$error = 0;
|
||||
|
||||
// Check parameters
|
||||
if (!$this->label) { $this->label = 'MISSING LABEL';
|
||||
if (!$this->label) {
|
||||
$this->label = 'MISSING LABEL';
|
||||
}
|
||||
|
||||
// Clean parameters
|
||||
@ -919,6 +928,9 @@ class Product extends CommonObject
|
||||
// Check name is required and codes are ok or unique. If error, this->errors[] is filled
|
||||
if ($action != 'add') {
|
||||
$result = $this->verify(); // We don't check when update called during a create because verify was already done
|
||||
} else {
|
||||
// we can continue
|
||||
$result = 0;
|
||||
}
|
||||
|
||||
if ($result >= 0) {
|
||||
@ -1091,7 +1103,7 @@ class Product extends CommonObject
|
||||
}
|
||||
|
||||
if (!$error) {
|
||||
if ($conf->variants->enabled) {
|
||||
if (!empty($conf->variants->enabled)) {
|
||||
include_once DOL_DOCUMENT_ROOT.'/variants/class/ProductCombination.class.php';
|
||||
|
||||
$comb = new ProductCombination($this->db);
|
||||
|
||||
@ -170,6 +170,9 @@ class Inventory extends CommonObject
|
||||
*/
|
||||
public $fk_user_valid;
|
||||
|
||||
/**
|
||||
* @var string import key
|
||||
*/
|
||||
public $import_key;
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
@ -178,17 +181,17 @@ class Inventory extends CommonObject
|
||||
// If this object has a subtable with lines
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'inventorydet';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_inventory';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable class that manage subtable lines
|
||||
* @var string Name of subtable class that manage subtable lines
|
||||
*/
|
||||
public $class_element_line = 'Inventoryline';
|
||||
|
||||
|
||||
@ -45,17 +45,17 @@ class Project extends CommonObject
|
||||
public $table_element = 'projet';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
public $table_element_line = 'projet_task';
|
||||
|
||||
/**
|
||||
* @var int Name of field date
|
||||
* @var string Name of field date
|
||||
*/
|
||||
public $table_element_date;
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_projet';
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ class Task extends CommonObject
|
||||
public $table_element = 'projet_task';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = 'fk_task';
|
||||
|
||||
|
||||
@ -144,7 +144,7 @@ $fieldstosearchall['s.nom'] = "ThirdPartyName";
|
||||
$arrayfields = array();
|
||||
foreach ($object->fields as $key => $val) {
|
||||
// If $val['visible']==0, then we never show the field
|
||||
if (!empty($val['visible'])) $arrayfields['t.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']);
|
||||
if (!empty($val['visible'])) $arrayfields['p.'.$key] = array('label'=>$val['label'], 'checked'=>(($val['visible'] < 0) ? 0 : 1), 'enabled'=>($val['enabled'] && ($val['visible'] != 3)), 'position'=>$val['position']);
|
||||
}
|
||||
|
||||
// Add none object fields to fields for list
|
||||
|
||||
@ -46,7 +46,14 @@ class Reception extends CommonObject
|
||||
{
|
||||
use CommonIncoterm;
|
||||
|
||||
/**
|
||||
* @var string element name
|
||||
*/
|
||||
public $element = "reception";
|
||||
|
||||
/**
|
||||
* @var string Fieldname with ID of parent key if this field has a parent
|
||||
*/
|
||||
public $fk_element = "fk_reception";
|
||||
public $table_element = "reception";
|
||||
public $table_element_line = "commande_fournisseur_dispatch";
|
||||
|
||||
@ -153,42 +153,6 @@ class RecruitmentCandidature extends CommonObject
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
|
||||
// If this object has a subtable with lines
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
*/
|
||||
//public $table_element_line = 'recruitment_recruitmentcandidatureline';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this object has a parent
|
||||
*/
|
||||
//public $fk_element = 'fk_recruitmentcandidature';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable class that manage subtable lines
|
||||
*/
|
||||
//public $class_element_line = 'RecruitmentCandidatureline';
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
//protected $childtables = array();
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To know object to delete on cascade.
|
||||
* If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will
|
||||
* call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object
|
||||
*/
|
||||
//protected $childtablesoncascade = array('recruitment_recruitmentcandidaturedet');
|
||||
|
||||
/**
|
||||
* @var RecruitmentCandidatureLine[] Array of subtable lines
|
||||
*/
|
||||
//public $lines = array();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
||||
@ -168,40 +168,6 @@ class RecruitmentJobPosition extends CommonObject
|
||||
// END MODULEBUILDER PROPERTIES
|
||||
|
||||
|
||||
// If this object has a subtable with lines
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
*/
|
||||
//public $table_element_line = 'recruitment_recruitmentjobpositionline';
|
||||
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
//public $fk_element = 'fk_recruitmentjobposition';
|
||||
|
||||
/**
|
||||
* @var int Name of subtable class that manage subtable lines
|
||||
*/
|
||||
//public $class_element_line = 'RecruitmentJobPositionline';
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To test if we can delete object.
|
||||
*/
|
||||
//protected $childtables=array();
|
||||
|
||||
/**
|
||||
* @var array List of child tables. To know object to delete on cascade.
|
||||
*/
|
||||
//protected $childtablesoncascade=array('recruitment_recruitmentjobpositiondet');
|
||||
|
||||
/**
|
||||
* @var RecruitmentJobPositionLine[] Array of subtable lines
|
||||
*/
|
||||
//public $lines = array();
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
||||
@ -199,15 +199,15 @@ class CompanyPaymentMode extends CommonObject
|
||||
// If this object has a subtable with lines
|
||||
|
||||
/**
|
||||
* @var int Name of subtable line
|
||||
* @var string Name of subtable line
|
||||
*/
|
||||
//public $table_element_line = 'companypaymentmodedet';
|
||||
/**
|
||||
* @var int Field with ID of parent key if this field has a parent
|
||||
* @var string Field with ID of parent key if this field has a parent
|
||||
*/
|
||||
//public $fk_element = 'fk_companypaymentmode';
|
||||
/**
|
||||
* @var int Name of subtable class that manage subtable lines
|
||||
* @var string Name of subtable class that manage subtable lines
|
||||
*/
|
||||
//public $class_element_line = 'CompanyPaymentModeline';
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user